@wayke-se/components-react 5.2.0-beta.0 → 6.0.0-beta.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.
Files changed (126) hide show
  1. package/README.md +222 -122
  2. package/dist/index.js +1365 -1489
  3. package/dist/index.js.map +4 -4
  4. package/dist/index.mjs +1381 -1505
  5. package/dist/index.mjs.map +4 -4
  6. package/dist/types/src/@types/filter.d.ts +7 -1
  7. package/dist/types/src/Gql/ad/legacyWaykeId.d.ts +1 -0
  8. package/dist/types/src/Gql/ad/propertyTree.d.ts +5 -0
  9. package/dist/types/src/Gql/ad/queries.d.ts +9 -0
  10. package/dist/types/src/Gql/ad/types.d.ts +378 -0
  11. package/dist/types/src/Gql/ad/useAd.d.ts +8 -0
  12. package/dist/types/src/Gql/ad/useInsuranceInquiry.d.ts +11 -0
  13. package/dist/types/src/Gql/ad/useLoanCalculation.d.ts +14 -0
  14. package/dist/types/src/Gql/ad/useRelatedAds.d.ts +12 -0
  15. package/dist/types/src/Gql/ad/view.d.ts +94 -0
  16. package/dist/types/src/Gql/client.d.ts +11 -0
  17. package/dist/types/src/Gql/config.d.ts +9 -0
  18. package/dist/types/src/Gql/facets.d.ts +19 -0
  19. package/dist/types/src/Gql/hit.d.ts +5 -0
  20. package/dist/types/src/Gql/legacyParams.d.ts +7 -0
  21. package/dist/types/src/Gql/queries.d.ts +17 -0
  22. package/dist/types/src/Gql/searchParams.d.ts +55 -0
  23. package/dist/types/src/Gql/suggest.d.ts +8 -0
  24. package/dist/types/src/Gql/types.d.ts +131 -0
  25. package/dist/types/src/Gql/useAdsSearch.d.ts +21 -0
  26. package/dist/types/src/State/Ad/AdContext.d.ts +5 -0
  27. package/dist/types/src/State/Router/RouterContext.d.ts +15 -0
  28. package/dist/types/src/State/Router/RouterProvider.d.ts +6 -0
  29. package/dist/types/src/State/Router/useRouter.d.ts +2 -0
  30. package/dist/types/src/State/Search/SearchContext.d.ts +15 -9
  31. package/dist/types/src/State/Search/SearchProvider.d.ts +1 -5
  32. package/dist/types/src/State/Settings/SettingsContext.d.ts +2 -12
  33. package/dist/types/src/State/Settings/settings.d.ts +56 -0
  34. package/dist/types/src/State/Settings/useSettings.d.ts +1 -1
  35. package/dist/types/src/components/ActionList/index.d.ts +3 -10
  36. package/dist/types/src/components/DocumentList/index.d.ts +3 -3
  37. package/dist/types/src/components/Filter/index.d.ts +1 -3
  38. package/dist/types/src/components/FilterPanel/checkListFacet.d.ts +2 -3
  39. package/dist/types/src/components/FilterPanel/colorFacet.d.ts +2 -3
  40. package/dist/types/src/components/FilterPanel/faceSelector.d.ts +2 -3
  41. package/dist/types/src/components/FilterPanel/index.d.ts +8 -15
  42. package/dist/types/src/components/FilterPanel/rangeFacet.d.ts +3 -3
  43. package/dist/types/src/components/FinancialOptions/LoanModal.d.ts +3 -7
  44. package/dist/types/src/components/FinancialOptions/index.d.ts +5 -7
  45. package/dist/types/src/components/FinancialOptions/leasing.d.ts +3 -3
  46. package/dist/types/src/components/FinancialOptions/loan.d.ts +3 -7
  47. package/dist/types/src/components/Gallery/index.d.ts +3 -5
  48. package/dist/types/src/components/Grid/index.d.ts +3 -7
  49. package/dist/types/src/components/InsuranceOptions/Insurance.d.ts +4 -6
  50. package/dist/types/src/components/InsuranceOptions/InsuranceFree.d.ts +5 -7
  51. package/dist/types/src/components/InsuranceOptions/InsuranceFreeModal.d.ts +4 -4
  52. package/dist/types/src/components/InsuranceOptions/InsuranceModal.d.ts +4 -6
  53. package/dist/types/src/components/InsuranceOptions/index.d.ts +5 -6
  54. package/dist/types/src/components/LeadForm/index.d.ts +1 -6
  55. package/dist/types/src/components/Lightbox/index.d.ts +2 -2
  56. package/dist/types/src/components/Map/index.d.ts +4 -2
  57. package/dist/types/src/components/OpeningHours/index.d.ts +2 -2
  58. package/dist/types/src/components/ProductCard/HitCard.d.ts +10 -0
  59. package/dist/types/src/components/ProductCard/index.d.ts +9 -13
  60. package/dist/types/src/components/SearchBar/index.d.ts +4 -1
  61. package/dist/types/src/components/SearchBar/wrapper.d.ts +10 -0
  62. package/dist/types/src/components/SortSelect/index.d.ts +1 -2
  63. package/dist/types/src/hooks/useSubmitLead.d.ts +1 -1
  64. package/dist/types/src/index.d.ts +5 -4
  65. package/dist/types/src/layouts/WaykeComposite.d.ts +3 -8
  66. package/dist/types/src/layouts/WaykeCompositeWithProvider.d.ts +1 -1
  67. package/dist/types/src/layouts/search/index.d.ts +6 -7
  68. package/dist/types/src/layouts/searchItem/Accessories/AccessoryModal.d.ts +2 -2
  69. package/dist/types/src/layouts/searchItem/Accessories/index.d.ts +2 -2
  70. package/dist/types/src/layouts/searchItem/Branch.d.ts +3 -4
  71. package/dist/types/src/layouts/searchItem/CheckList.d.ts +3 -15
  72. package/dist/types/src/layouts/searchItem/Documents.d.ts +2 -2
  73. package/dist/types/src/layouts/searchItem/ManufacturerPackagesOption.d.ts +2 -2
  74. package/dist/types/src/layouts/searchItem/PackageOptions.d.ts +3 -3
  75. package/dist/types/src/layouts/searchItem/Property.d.ts +1 -6
  76. package/dist/types/src/layouts/searchItem/Related.d.ts +5 -6
  77. package/dist/types/src/layouts/searchItem/index.d.ts +8 -6
  78. package/dist/types/src/layouts/searchItem/useEcom.d.ts +7 -3
  79. package/dist/types/src/providers/WaykeProvider.d.ts +7 -21
  80. package/dist/types/src/utils/image.d.ts +14 -0
  81. package/dist/types/src/utils/sortOptions.d.ts +4 -13
  82. package/package.json +10 -16
  83. package/dist/types/src/@types/action.d.ts +0 -3
  84. package/dist/types/src/@types/codegen/types.d.ts +0 -433
  85. package/dist/types/src/@types/queryFilter.d.ts +0 -5
  86. package/dist/types/src/@types/search.d.ts +0 -114
  87. package/dist/types/src/State/CentralStorage/CentralStorageContext.d.ts +0 -5
  88. package/dist/types/src/State/CentralStorage/CentralStorageProvider.d.ts +0 -6
  89. package/dist/types/src/State/CentralStorage/useCentralStorage.d.ts +0 -6
  90. package/dist/types/src/State/Path/PathContext.d.ts +0 -8
  91. package/dist/types/src/State/Path/PathProvider.d.ts +0 -6
  92. package/dist/types/src/State/Path/reducer.d.ts +0 -14
  93. package/dist/types/src/State/Path/usePath.d.ts +0 -3
  94. package/dist/types/src/State/RelatedSearch/RelatedSearchContext.d.ts +0 -9
  95. package/dist/types/src/State/RelatedSearch/RelatedSearchProvider.d.ts +0 -9
  96. package/dist/types/src/State/RelatedSearch/useRelatedSearch.d.ts +0 -2
  97. package/dist/types/src/State/Settings/SettingsProvider.d.ts +0 -11
  98. package/dist/types/src/components/Video/QuickNavVideo.d.ts +0 -7
  99. package/dist/types/src/hooks/apolloTypes.d.ts +0 -6
  100. package/dist/types/src/hooks/useHasBeenVisible.d.ts +0 -2
  101. package/dist/types/src/hooks/useHashGuid.d.ts +0 -2
  102. package/dist/types/src/hooks/useInsurance.d.ts +0 -4
  103. package/dist/types/src/hooks/useLoan.d.ts +0 -4
  104. package/dist/types/src/hooks/useOnScreen.d.ts +0 -2
  105. package/dist/types/src/hooks/usePrevious.d.ts +0 -2
  106. package/dist/types/src/hooks/useSearchItem.d.ts +0 -4
  107. package/dist/types/src/hooks/useSearchItemBranch.d.ts +0 -4
  108. package/dist/types/src/hooks/useSessionStorage.d.ts +0 -7
  109. package/dist/types/src/layouts/searchItem/BranchModal.d.ts +0 -9
  110. package/dist/types/src/providers/WaykeItemProvidet.d.ts +0 -24
  111. package/dist/types/src/providers/graphqlProvider.d.ts +0 -6
  112. package/dist/types/src/queries/INSURANCE_CALCULATION.d.ts +0 -2
  113. package/dist/types/src/queries/LOAN_CALCULATION.d.ts +0 -2
  114. package/dist/types/src/queries/SEARCH_ITEM_BRANCH_QUERY.d.ts +0 -2
  115. package/dist/types/src/queries/SEARCH_ITEM_QUERY.d.ts +0 -2
  116. package/dist/types/src/utils/deep-copy.d.ts +0 -5
  117. package/dist/types/src/utils/regex.d.ts +0 -3
  118. package/dist/types/src/utils/specification.d.ts +0 -28
  119. package/dist/types/src/utils/url.d.ts +0 -1
  120. package/dist/types/src/utils/vehicle-properties/compare-basic-properties.d.ts +0 -3
  121. package/dist/types/src/utils/vehicle-properties/compare-categories.d.ts +0 -3
  122. package/dist/types/src/utils/vehicle-properties/compare-properties.d.ts +0 -3
  123. package/dist/types/src/utils/vehicle-properties/custom-property-adder.d.ts +0 -13
  124. package/dist/types/src/utils/vehicle-properties/property-remover.d.ts +0 -7
  125. package/dist/types/src/utils/vehicle-properties/property-tree-creator.d.ts +0 -31
  126. package/dist/types/src/utils/vehicle-properties/property-tree-sorter.d.ts +0 -3
@@ -1,4 +0,0 @@
1
- import { Query, QueryLoanArgs } from '../@types/codegen/types';
2
- import { StrictQueryResult } from './apolloTypes';
3
- declare const useLoanCalculation: (id: string, duration?: number, downPayment?: number, residual?: number) => StrictQueryResult<Query, QueryLoanArgs>;
4
- export default useLoanCalculation;
@@ -1,2 +0,0 @@
1
- declare const useOnScreen: (ref: React.MutableRefObject<HTMLElement | null>) => boolean;
2
- export default useOnScreen;
@@ -1,2 +0,0 @@
1
- declare const usePrevious: <T>(value: T) => T | undefined;
2
- export default usePrevious;
@@ -1,4 +0,0 @@
1
- import { Query, QueryVehicleArgs } from '../@types/codegen/types';
2
- import { StrictQueryResult } from './apolloTypes';
3
- declare const useSearchItem: (id?: string) => StrictQueryResult<Query, QueryVehicleArgs>;
4
- export default useSearchItem;
@@ -1,4 +0,0 @@
1
- import { Query, QueryVehicleArgs } from '../@types/codegen/types';
2
- import { StrictQueryResult } from './apolloTypes';
3
- declare const useSearchItemBranch: (id?: string | null, branch?: string | null) => StrictQueryResult<Query, QueryVehicleArgs>;
4
- export default useSearchItemBranch;
@@ -1,7 +0,0 @@
1
- declare const useSessionStorage: (key: string) => {
2
- value: string | null;
3
- set: (v: string) => void;
4
- remove: () => void;
5
- clear: () => void;
6
- };
7
- export default useSessionStorage;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { BranchConnection } from '../../@types/codegen/types';
3
- interface BranchModalProps {
4
- loading: boolean;
5
- connections?: BranchConnection[];
6
- onClose: () => void;
7
- }
8
- declare const BranchModal: ({ loading, connections, onClose }: BranchModalProps) => React.JSX.Element | null;
9
- export default BranchModal;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- export interface EcomSettings {
3
- url: string;
4
- /** @deprecated Not used since 3.0.0. Will be removed in the next major version. */
5
- useBankId?: boolean;
6
- /** @deprecated Not used since 3.0.0. Will be removed in the next major version. */
7
- displayBankIdAlert?: boolean;
8
- serviceLogotypeUrl?: string;
9
- bankIdThumbprint?: string;
10
- }
11
- export interface WaykeItemProviderSettings {
12
- url: string;
13
- urlMlt?: string;
14
- graphQlUrl: string;
15
- apiKey?: string;
16
- ecomSettings?: EcomSettings;
17
- googleMapsApiKey?: string;
18
- googleMapsMarker?: string;
19
- }
20
- export type WaykeItemProviderProps = WaykeItemProviderSettings & {
21
- children?: React.ReactNode;
22
- };
23
- declare const WaykeItemProvider: ({ url, urlMlt, apiKey, ecomSettings, graphQlUrl, googleMapsApiKey, googleMapsMarker, children, }: WaykeItemProviderProps) => React.JSX.Element;
24
- export default WaykeItemProvider;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- declare const GraphqlProvider: ({ uri, children }: {
3
- uri: string;
4
- children: React.ReactNode;
5
- }) => React.JSX.Element;
6
- export default GraphqlProvider;
@@ -1,2 +0,0 @@
1
- declare const INSURANCE_CALCULATION: import("graphql").DocumentNode;
2
- export default INSURANCE_CALCULATION;
@@ -1,2 +0,0 @@
1
- declare const LOAN_CALCULATION: import("graphql").DocumentNode;
2
- export default LOAN_CALCULATION;
@@ -1,2 +0,0 @@
1
- declare const SEARCH_ITEM_BRANCH_QUERY: import("graphql").DocumentNode;
2
- export default SEARCH_ITEM_BRANCH_QUERY;
@@ -1,2 +0,0 @@
1
- declare const SEARCH_ITEM_QUERY: import("graphql").DocumentNode;
2
- export default SEARCH_ITEM_QUERY;
@@ -1,5 +0,0 @@
1
- /**
2
- * Does not copy complex objects such as Date, functions etc.
3
- */
4
- declare const deepCopy: <T extends Object>(object: T) => T;
5
- export default deepCopy;
@@ -1,3 +0,0 @@
1
- export declare const regexGuid: RegExp;
2
- export declare const escapeRegExpString: (s: string) => string;
3
- export declare const regexPathGuid: (path?: string) => RegExp;
@@ -1,28 +0,0 @@
1
- import { VehicleData } from '../@types/codegen/types';
2
- export interface ItemPropertModalType {
3
- title: string;
4
- text: string;
5
- }
6
- export interface ItemPropertyType {
7
- label: string;
8
- value: string | null;
9
- modal?: ItemPropertModalType;
10
- }
11
- type ValueTypes = number | string | null | undefined | string[] | boolean | {
12
- [key: string]: string | number | boolean;
13
- };
14
- export interface SpecPropertyType {
15
- label?: string;
16
- formatLabel?: (item: VehicleData) => string;
17
- formatData?: (value: ValueTypes, item: VehicleData) => string | null;
18
- modal?: {
19
- title?: string;
20
- dynamicTitle?: (item: VehicleData) => string;
21
- text?: string;
22
- dynamicText?: (item: VehicleData) => string;
23
- nonConcatablePropValue?: string;
24
- concatPropValue?: string;
25
- };
26
- }
27
- export declare const getSpecificationList: (item: VehicleData) => ItemPropertyType[];
28
- export {};
@@ -1 +0,0 @@
1
- export declare const getUrlSearchParamsFromUrl: () => URLSearchParams;
@@ -1,3 +0,0 @@
1
- import { Property } from '../../@types/vehicle-properties';
2
- export default _default;
3
- declare function _default(first: Property, second: Property): number;
@@ -1,3 +0,0 @@
1
- import { Category } from '../../@types/vehicle-properties';
2
- export default _default;
3
- declare function _default(first: Category, second: Category): number;
@@ -1,3 +0,0 @@
1
- import { Property } from '../../@types/vehicle-properties';
2
- export default _default;
3
- declare function _default(first: Property, second: Property): number;
@@ -1,13 +0,0 @@
1
- import { TFunction } from 'i18next';
2
- import { VehicleData } from '../../@types/codegen/types';
3
- import { EnhancedProperty, ItemCategory } from '../../@types/vehicle-properties';
4
- export declare const TEXT_TYPE = "text";
5
- export declare const NUMBER_TYPE = "number";
6
- export declare const BASIC_CATEGORY: (t: TFunction<'translation', undefined>) => ItemCategory;
7
- export declare const ENGINE_SUBCATEGORY: (t: TFunction<'translation', undefined>) => ItemCategory;
8
- export default _default;
9
- declare function _default(t: TFunction<'translation', undefined>, item: VehicleData, properties: {
10
- [key: string]: EnhancedProperty;
11
- }): {
12
- [key: string]: EnhancedProperty;
13
- };
@@ -1,7 +0,0 @@
1
- import { EnhancedProperty } from '../../@types/vehicle-properties';
2
- export default _default;
3
- declare function _default(properties: {
4
- [key: string]: EnhancedProperty;
5
- }): {
6
- [key: string]: EnhancedProperty;
7
- };
@@ -1,31 +0,0 @@
1
- import { EnhancedProperty, Tree } from '../../@types/vehicle-properties';
2
- declare class PropertyTreeCreator {
3
- private properties;
4
- constructor(properties: {
5
- [key: string]: EnhancedProperty;
6
- });
7
- create(): Tree;
8
- private getRootProperties;
9
- private propertiesWithCategory;
10
- private propertiesWithoutCategory;
11
- private isList;
12
- private isNonList;
13
- private createTreeCategories;
14
- private getCategories;
15
- private convertToTreeCategories;
16
- private hasCategoryWithId;
17
- private propertiesWithSubCategory;
18
- private propertiesWithoutSubCategory;
19
- private createTreeSubCategories;
20
- private getSubCategoriesOfCategory;
21
- private convertSubCategory;
22
- private hasSubCategoryWithId;
23
- private static distinctCategories;
24
- private createListSubCategories;
25
- private asBoolProperties;
26
- static DEFAULT_CATEGORY_NAME: string;
27
- static DEFAULT_CATEGORY_ID: number;
28
- static TEXT_LIST_TYPE: string;
29
- static LIST_CATEGORY_START_ID: number;
30
- }
31
- export default PropertyTreeCreator;
@@ -1,3 +0,0 @@
1
- import { Tree } from '../../@types/vehicle-properties';
2
- declare const sort: (tree: Tree) => void;
3
- export default sort;