magneto365.ui 2.74.1-beta.2 → 2.74.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/assets/342fc1eb392bbe91.svg +9 -0
  2. package/dist/assets/42b6ff7331cb6a26.svg +9 -0
  3. package/dist/assets/4fa20cc6be9fba51.svg +9 -0
  4. package/dist/assets/535663c17baaa8a6.svg +9 -0
  5. package/dist/assets/8f27be7e1b41e32f.svg +9 -0
  6. package/dist/assets/ae4aaa99fd18e561.svg +9 -0
  7. package/dist/assets/b03d6f7e32deda3b.svg +9 -0
  8. package/dist/assets/d4d4927f96c0f016.svg +9 -0
  9. package/dist/cjs/css/magneto.ui.lib.min.css +1 -1
  10. package/dist/cjs/index.js +1549 -863
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/types/components/UI/organism/FilterCard/FilterCard.interface.d.ts +4 -0
  13. package/dist/cjs/types/components/UI/page/JobsPage/JobsPage.interface.d.ts +4 -0
  14. package/dist/cjs/types/components/UI/template/HorizontalFilter/HorizontalFilter.component.d.ts +4 -0
  15. package/dist/cjs/types/components/UI/template/HorizontalFilter/HorizontalFilter.interface.d.ts +35 -0
  16. package/dist/cjs/types/components/UI/template/HorizontalFilter/index.d.ts +2 -0
  17. package/dist/cjs/types/components/UI/template/SideFilter/SideFilter.interface.d.ts +1 -0
  18. package/dist/cjs/types/components/UI/template/SortBar/SortBar.interface.d.ts +4 -0
  19. package/dist/cjs/types/components/UI/template/index.d.ts +1 -0
  20. package/dist/cjs/types/components/hooks/filters/useFilterCard.d.ts +85 -0
  21. package/dist/cjs/types/components/hooks/filters/useFilterEventListeners.d.ts +49 -0
  22. package/dist/cjs/types/components/hooks/filters/useFilterRendering.d.ts +43 -0
  23. package/dist/cjs/types/components/hooks/filters/usePositionCalculation.d.ts +31 -0
  24. package/dist/cjs/types/constants/icons.constants.d.ts +8 -0
  25. package/dist/cjs/types/utils/icons/iconMapping.utils.d.ts +1 -0
  26. package/dist/esm/css/magneto.ui.lib.min.css +1 -1
  27. package/dist/esm/index.js +1549 -863
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/types/components/UI/organism/FilterCard/FilterCard.interface.d.ts +4 -0
  30. package/dist/esm/types/components/UI/page/JobsPage/JobsPage.interface.d.ts +4 -0
  31. package/dist/esm/types/components/UI/template/HorizontalFilter/HorizontalFilter.component.d.ts +4 -0
  32. package/dist/esm/types/components/UI/template/HorizontalFilter/HorizontalFilter.interface.d.ts +35 -0
  33. package/dist/esm/types/components/UI/template/HorizontalFilter/index.d.ts +2 -0
  34. package/dist/esm/types/components/UI/template/SideFilter/SideFilter.interface.d.ts +1 -0
  35. package/dist/esm/types/components/UI/template/SortBar/SortBar.interface.d.ts +4 -0
  36. package/dist/esm/types/components/UI/template/index.d.ts +1 -0
  37. package/dist/esm/types/components/hooks/filters/useFilterCard.d.ts +85 -0
  38. package/dist/esm/types/components/hooks/filters/useFilterEventListeners.d.ts +49 -0
  39. package/dist/esm/types/components/hooks/filters/useFilterRendering.d.ts +43 -0
  40. package/dist/esm/types/components/hooks/filters/usePositionCalculation.d.ts +31 -0
  41. package/dist/esm/types/constants/icons.constants.d.ts +8 -0
  42. package/dist/esm/types/utils/icons/iconMapping.utils.d.ts +1 -0
  43. package/dist/index.d.ts +49 -1
  44. package/package.json +1 -1
@@ -28,4 +28,8 @@ export interface IFilterCard extends IFilter, ISearchRenderTypeProps {
28
28
  * key to know if a filter has changed
29
29
  */
30
30
  showFilters: boolean;
31
+ /**
32
+ * To render horizontal filter
33
+ */
34
+ horizontal?: boolean;
31
35
  }
@@ -79,6 +79,10 @@ export interface IJobsPage {
79
79
  * This property sets the create account card data
80
80
  */
81
81
  createAccountCTAProps?: ICreateAccountCTA;
82
+ /**
83
+ * This property sets the job card type filter, which can be either 'row' or 'side'.
84
+ */
85
+ typeFilters?: 'row' | 'side';
82
86
  }
83
87
  export interface IVacancies extends IJobCard {
84
88
  offerVacancyData?: string;
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { IHorizontalFilter } from './HorizontalFilter.interface';
3
+ declare const HorizontalFilter: FC<IHorizontalFilter>;
4
+ export default HorizontalFilter;
@@ -0,0 +1,35 @@
1
+ import { IFilter, ISearchRenderTypeProps } from '@components/UI/template/SideFilter';
2
+ export interface IHorizontalFilter extends ISearchRenderTypeProps {
3
+ /**
4
+ * This is the title of the filters
5
+ */
6
+ title: string;
7
+ /**
8
+ * This is a vector with the total filters
9
+ */
10
+ filters: IFilter[];
11
+ /**
12
+ * This is the total filters applied
13
+ */
14
+ totalAppliedFilters: number;
15
+ /**
16
+ * This is the text that shows the clean button
17
+ */
18
+ buttonText: string;
19
+ /**
20
+ * This is the flag when the filters promise is pending
21
+ */
22
+ loading: boolean;
23
+ /**
24
+ * If this flag is true the buttonFilter isn't visible
25
+ */
26
+ isFiltersOpen: boolean;
27
+ /**
28
+ * This function selected or un-applied the option
29
+ */
30
+ setIsApplied: (filter: any) => Promise<void>;
31
+ /**
32
+ * This is the function to clean all the filters
33
+ */
34
+ clearFilters: () => Promise<void>;
35
+ }
@@ -0,0 +1,2 @@
1
+ export * from './HorizontalFilter.component';
2
+ export * from './HorizontalFilter.interface';
@@ -84,6 +84,7 @@ export interface IFilter {
84
84
  renderChild?: string;
85
85
  child?: IFilter;
86
86
  filtersApplied?: Array<string | number>;
87
+ icon?: string;
87
88
  }
88
89
  export interface IFieldsAlias {
89
90
  id?: string;
@@ -57,4 +57,8 @@ export interface ISortBar {
57
57
  emptyVacant?: boolean;
58
58
  infoMessageQuotas?: string;
59
59
  widthInfoMessage?: string;
60
+ /**
61
+ * To render conditional content in the sort bar
62
+ */
63
+ horizontal?: boolean;
60
64
  }
@@ -10,3 +10,4 @@ export * from './MegaMenu';
10
10
  export * from './SideFilter';
11
11
  export * from './SortBar';
12
12
  export * from './VacantPositionsTemplate';
13
+ export * from './HorizontalFilter';
@@ -0,0 +1,85 @@
1
+ /// <reference types="react" />
2
+ import { IFilterValue, ISetIsApplied } from '@components/UI/template';
3
+ import { ERenderType } from '@constants/stories';
4
+ import { Position } from './usePositionCalculation';
5
+ declare type UseFilterCardProps = {
6
+ /**
7
+ * array of filter values to be displayed in the card
8
+ */
9
+ values: IFilterValue[];
10
+ /**
11
+ * type of rendering for the filter card
12
+ */
13
+ renderType?: ERenderType;
14
+ /**
15
+ * function to set the applied filter value
16
+ */
17
+ setIsApplied?: (optionData: ISetIsApplied) => void;
18
+ /**
19
+ * index of the filter card
20
+ */
21
+ index: number;
22
+ /**
23
+ * function to set the current open filter index
24
+ */
25
+ setCurrentOpenFilter: (index: number) => void;
26
+ /**
27
+ * whether to show the filters or not
28
+ */
29
+ showFilters: boolean;
30
+ /**
31
+ * whether the filter card is displayed horizontally
32
+ */
33
+ horizontal?: boolean;
34
+ /**
35
+ * field name for the filter
36
+ */
37
+ field?: string;
38
+ };
39
+ interface UseFilterCardReturn {
40
+ /**
41
+ * state and computed values for the filter card
42
+ */
43
+ state: {
44
+ options: IFilterValue[];
45
+ showItems: boolean;
46
+ showMobileDrawer: boolean;
47
+ showTooltip: boolean;
48
+ buttonRef: React.RefObject<HTMLButtonElement>;
49
+ };
50
+ /**
51
+ * computed properties for the filter card
52
+ */
53
+ computed: {
54
+ isMobile: boolean;
55
+ hasSearch: boolean;
56
+ hasTotal: boolean;
57
+ appliedOption: IFilterValue | undefined;
58
+ appliedValue: IFilterValue | undefined;
59
+ hasntOptions: boolean;
60
+ isInteractiveSection: boolean;
61
+ };
62
+ /**
63
+ * positions for popover and tooltip
64
+ */
65
+ positions: {
66
+ popoverPosition: Position;
67
+ tooltipPosition: Position;
68
+ };
69
+ /**
70
+ * handlers for various interactions in the filter card
71
+ */
72
+ handlers: {
73
+ handleSearch: (event: React.ChangeEvent<HTMLInputElement>) => void;
74
+ handleShowItems: () => void;
75
+ handleCloseMobileDrawer: () => void;
76
+ handleOptionSelected: (optionData: ISetIsApplied) => void;
77
+ handleRemove: (e: React.MouseEvent) => void;
78
+ handleMouseEnter: () => void;
79
+ handleMouseLeave: () => void;
80
+ handleTouchStart: () => void;
81
+ handleTouchEnd: () => void;
82
+ };
83
+ }
84
+ export declare const useFilterCard: ({ values, renderType, setIsApplied, index, setCurrentOpenFilter, showFilters, horizontal, field }: UseFilterCardProps) => UseFilterCardReturn;
85
+ export {};
@@ -0,0 +1,49 @@
1
+ /// <reference types="react" />
2
+ declare type UseFilterEventListenersProps = {
3
+ /**
4
+ * the filter is displayed horizontally
5
+ */
6
+ horizontal?: boolean;
7
+ /**
8
+ * the filter items are currently shown
9
+ */
10
+ showItems: boolean;
11
+ /**
12
+ * the tooltip is currently shown
13
+ */
14
+ showTooltip: boolean;
15
+ /**
16
+ * the device is mobile
17
+ */
18
+ isMobile: boolean;
19
+ /**
20
+ * the index of the filter
21
+ */
22
+ index: number;
23
+ /**
24
+ * reference to the button element
25
+ */
26
+ buttonRef: React.RefObject<HTMLButtonElement>;
27
+ /**
28
+ * function to set the current open filter index
29
+ */
30
+ setCurrentOpenFilter: (index: number) => void;
31
+ /**
32
+ * function to set the visibility of filter items
33
+ */
34
+ setShowItems: (value: boolean) => void;
35
+ /**
36
+ * function to set the visibility of the tooltip
37
+ */
38
+ setShowTooltip: (value: boolean) => void;
39
+ /**
40
+ * function to set the drag scrolling state
41
+ */
42
+ setIsDragScrolling: (value: boolean) => void;
43
+ /**
44
+ * function to calculate the positions of elements
45
+ */
46
+ calculatePositions: (element: HTMLButtonElement | null) => void;
47
+ };
48
+ export declare const useFilterEventListeners: ({ horizontal, showItems, showTooltip, isMobile, index, buttonRef, setCurrentOpenFilter, setShowItems, setShowTooltip, setIsDragScrolling, calculatePositions }: UseFilterEventListenersProps) => void;
49
+ export {};
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { IFilterValue, ISetIsApplied } from '@components/UI/template';
3
+ declare type UseFilterRenderingProps = {
4
+ /**
5
+ * array of filter values to be rendered
6
+ */
7
+ options: IFilterValue[];
8
+ /**
9
+ * currently applied option
10
+ */
11
+ appliedOption: IFilterValue | undefined;
12
+ /**
13
+ * flag indicating if there are no options
14
+ */
15
+ hasntOptions: boolean;
16
+ /**
17
+ * flag indicating if there are any options
18
+ */
19
+ hasTotal: boolean;
20
+ /**
21
+ * flag indicating if the options should be rendered horizontally
22
+ */
23
+ horizontal?: boolean;
24
+ /**
25
+ * function to handle option selection
26
+ */
27
+ handleOptionSelected: (optionData: ISetIsApplied) => void;
28
+ /**
29
+ * additional properties for the filter rendering
30
+ */
31
+ props: {
32
+ field: string;
33
+ multiple: boolean;
34
+ loading: boolean;
35
+ type?: string;
36
+ [key: string]: unknown;
37
+ };
38
+ };
39
+ export declare const useFilterRendering: ({ options, appliedOption, hasntOptions, hasTotal, handleOptionSelected, props }: UseFilterRenderingProps) => {
40
+ optionsToRender: React.FunctionComponentElement<import("@components/UI/molecules/FilterMenuItem").IFilterMenuItem>[];
41
+ horizontalOptionsToRender: React.FunctionComponentElement<import("@components/UI/molecules/FilterMenuItem").IFilterMenuItem>[];
42
+ };
43
+ export {};
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ export interface Position {
3
+ /**
4
+ * vertical position
5
+ */
6
+ top: number;
7
+ /**
8
+ * horizontal position
9
+ */
10
+ left: number;
11
+ }
12
+ declare type UsePositionCalculationProps = {
13
+ /**
14
+ * reference to the button element
15
+ */
16
+ buttonRef: React.RefObject<HTMLButtonElement>;
17
+ /**
18
+ * width of the popover
19
+ */
20
+ popoverWidth?: number;
21
+ /**
22
+ * width of the tooltip
23
+ */
24
+ tooltipWidth?: number;
25
+ };
26
+ export declare const usePositionCalculation: ({ buttonRef, popoverWidth, tooltipWidth }: UsePositionCalculationProps) => {
27
+ popoverPosition: Position;
28
+ tooltipPosition: Position;
29
+ calculatePositions: (buttonElement?: HTMLButtonElement | null | undefined) => void;
30
+ };
31
+ export {};
@@ -191,3 +191,11 @@ export { default as YoutubeSolid } from '../assets/YoutubeSolid.svg';
191
191
  export { default as FilterIcon } from '../assets/filter-search.svg';
192
192
  export { default as SortIcon } from '../assets/SortIcon.svg';
193
193
  export { default as CurrentLocation } from '../assets/current-location.svg';
194
+ export { default as FiltersContract } from '../assets/filters-contract.svg';
195
+ export { default as FiltersDate } from '../assets/filters-date.svg';
196
+ export { default as FiltersExperience } from '../assets/filters-experience.svg';
197
+ export { default as FiltersInternship } from '../assets/filters-internship.svg';
198
+ export { default as FiltersModality } from '../assets/filters-modality.svg';
199
+ export { default as FiltersOthers } from '../assets/filters-others.svg';
200
+ export { default as FiltersSalary } from '../assets/filters-salary.svg';
201
+ export { default as FiltersSectors } from '../assets/filters-sectors.svg';
@@ -0,0 +1 @@
1
+ export declare const getFieldIcon: (field: string, providedIcon?: string | undefined) => string;