@wayke-se/components-react 2.14.0 → 2.15.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/dist-node/index.js +50 -2
- package/dist-node/index.js.map +1 -1
- package/dist-src/components/Pdf/index.js +11 -0
- package/dist-src/components/Pdf/wrapper.js +55 -0
- package/dist-src/layouts/searchItem/index.js +10 -1
- package/dist-src/queries/SEARCH_ITEM_QUERY.js +1 -0
- package/dist-types/@types/codegen/types.d.ts +57 -42
- package/dist-types/components/Pdf/index.d.ts +11 -0
- package/dist-types/components/Pdf/wrapper.d.ts +11 -0
- package/dist-web/index.js +73 -1
- package/dist-web/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PdfListItem, PdfSubtitle, PdfTitle, PdfContainer, PdfListInner, PdfLink, PdfColumn, } from './wrapper';
|
|
3
|
+
export const PdfDownloadItem = ({ document }) => (React.createElement(PdfListItem, null,
|
|
4
|
+
React.createElement(PdfListInner, null,
|
|
5
|
+
React.createElement(PdfColumn, null,
|
|
6
|
+
React.createElement(PdfTitle, null, document.name),
|
|
7
|
+
React.createElement(PdfSubtitle, null, document.contentType)),
|
|
8
|
+
React.createElement(PdfColumn, null,
|
|
9
|
+
React.createElement(PdfLink, { href: document.url, rel: "noopener noreferrer nofollow", target: "_blank" }, "\u00D6ppna")))));
|
|
10
|
+
export const PdfDownloadContainer = ({ documents }) => (React.createElement(PdfContainer, null, documents.map((document, i) => (React.createElement(PdfDownloadItem, { key: `${document.url}-${i}`, document: document })))));
|
|
11
|
+
export default PdfDownloadContainer;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { size } from '../../layout/helpers';
|
|
3
|
+
export const PdfListItem = styled.li.attrs(() => ({
|
|
4
|
+
className: 'wayke__theme wayke__color--primary-text',
|
|
5
|
+
})) `
|
|
6
|
+
flex: 0 0 50%;
|
|
7
|
+
padding: ${size(1)};
|
|
8
|
+
|
|
9
|
+
${({ theme }) => theme.breakpoint.LtSm} {
|
|
10
|
+
flex: 0 0 100%;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
export const PdfContainer = styled.ul `
|
|
14
|
+
list-style: none;
|
|
15
|
+
padding: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
margin: ${size(-1)};
|
|
19
|
+
`;
|
|
20
|
+
export const PdfLink = styled.a.attrs(() => ({
|
|
21
|
+
className: 'wayke__theme wayke__color--primary-text wayke__font--bold',
|
|
22
|
+
})) `
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
font-size: 0.875rem;
|
|
25
|
+
&:after {
|
|
26
|
+
content: '';
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: 0;
|
|
29
|
+
left: 0;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 100%;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export const PdfTitle = styled.div `
|
|
35
|
+
color: ${(props) => props.theme.color.textDark};
|
|
36
|
+
`;
|
|
37
|
+
export const PdfSubtitle = styled.div `
|
|
38
|
+
color: ${(props) => props.theme.color.textDarkLighten};
|
|
39
|
+
`;
|
|
40
|
+
export const PdfColumn = styled.div `
|
|
41
|
+
flex 0 0 auto;
|
|
42
|
+
&:first-child {
|
|
43
|
+
flex: 1 1 auto;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
export const PdfListInner = styled.div `
|
|
47
|
+
position: relative;
|
|
48
|
+
border: 1px solid ${(props) => props.theme.color.border};
|
|
49
|
+
padding: ${size(1.5)};
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
:hover {
|
|
53
|
+
background-color: ${(props) => props.theme.color.hoverOverlay};
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
@@ -31,6 +31,7 @@ import Page404 from './Page404';
|
|
|
31
31
|
import PageLoading from './PageLoading';
|
|
32
32
|
import PubSub from '../../utils/pubsub/pubsub';
|
|
33
33
|
import Property from './Property';
|
|
34
|
+
import PdfDownloadContainer from '../../components/Pdf/index';
|
|
34
35
|
const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, onClickSearchItem, }) => {
|
|
35
36
|
var _a, _b, _c;
|
|
36
37
|
const [ecomModal, setEcomModal] = useState(false);
|
|
@@ -61,7 +62,7 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
61
62
|
const { vehicle } = result;
|
|
62
63
|
const contact = centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.contact;
|
|
63
64
|
const branch = centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.branch;
|
|
64
|
-
const { title, shortDescription, media, description, price, financialOptions, insuranceOptions, manufacturer, ecommerce, packageOptions, publishedAt, } = vehicle;
|
|
65
|
+
const { title, shortDescription, media, description, price, financialOptions, insuranceOptions, manufacturer, ecommerce, packageOptions, publishedAt, documents, } = vehicle;
|
|
65
66
|
const { fuelType, mileage, gearbox, modelYear, propertySet } = vehicle.data;
|
|
66
67
|
const uspList = [
|
|
67
68
|
{
|
|
@@ -131,6 +132,14 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
131
132
|
React.createElement(Repeat, null,
|
|
132
133
|
React.createElement(ExtendContent, { actionTitle: "Visa mer", onClick: onShowMoreOptionsClick },
|
|
133
134
|
React.createElement(UspList, { items: options }))))),
|
|
135
|
+
(documents.length || 0) > 0 && (React.createElement(ProductPageMainSection, null,
|
|
136
|
+
React.createElement(Repeat, null,
|
|
137
|
+
React.createElement(H2, { noMargin: true }, "Dokument")),
|
|
138
|
+
React.createElement(Repeat, null,
|
|
139
|
+
React.createElement(Content, null,
|
|
140
|
+
React.createElement("p", null, "Tillh\u00F6rande dokument f\u00F6r bilen."))),
|
|
141
|
+
React.createElement(Repeat, null,
|
|
142
|
+
React.createElement(PdfDownloadContainer, { documents: documents })))),
|
|
134
143
|
React.createElement(ProductPageMainSection, null,
|
|
135
144
|
React.createElement(Branch, { branch: branch, loading: loadingCentralStorageVehicle }),
|
|
136
145
|
ecommerce && ecommerce.enabled && (React.createElement(Repeat, null,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare type Maybe<T> = T | null;
|
|
2
|
+
export declare type InputMaybe<T> = Maybe<T>;
|
|
2
3
|
export declare type Exact<T extends {
|
|
3
4
|
[key: string]: unknown;
|
|
4
5
|
}> = {
|
|
@@ -19,6 +20,11 @@ export declare type Scalars = {
|
|
|
19
20
|
Float: number;
|
|
20
21
|
DateTime: Date;
|
|
21
22
|
Email: string;
|
|
23
|
+
FileDocument: {
|
|
24
|
+
contentType: string;
|
|
25
|
+
name: string;
|
|
26
|
+
url: string;
|
|
27
|
+
};
|
|
22
28
|
PersonalNumber: string;
|
|
23
29
|
PhoneNumber: string;
|
|
24
30
|
Time: string;
|
|
@@ -30,38 +36,38 @@ export declare type Scalars = {
|
|
|
30
36
|
};
|
|
31
37
|
export declare type Branch = {
|
|
32
38
|
__typename?: 'Branch';
|
|
33
|
-
|
|
39
|
+
connections: Array<BranchConnection>;
|
|
40
|
+
contact?: Maybe<ContactOptions>;
|
|
34
41
|
description?: Maybe<Scalars['String']>;
|
|
35
42
|
flags?: Maybe<BranchFlags>;
|
|
36
|
-
name?: Maybe<Scalars['String']>;
|
|
37
|
-
contact?: Maybe<ContactOptions>;
|
|
38
43
|
homepage?: Maybe<Scalars['URL']>;
|
|
44
|
+
id: Scalars['ID'];
|
|
45
|
+
location?: Maybe<Location>;
|
|
39
46
|
logotype?: Maybe<Scalars['URL']>;
|
|
47
|
+
name?: Maybe<Scalars['String']>;
|
|
40
48
|
openingHours?: Maybe<OpeningHours>;
|
|
41
49
|
organization?: Maybe<Organization>;
|
|
42
|
-
location?: Maybe<Location>;
|
|
43
50
|
promos: Array<Promo>;
|
|
44
51
|
services: Array<Service>;
|
|
45
|
-
connections: Array<BranchConnection>;
|
|
46
52
|
};
|
|
47
53
|
export declare type BranchConnection = {
|
|
48
54
|
__typename?: 'BranchConnection';
|
|
49
55
|
id: Scalars['ID'];
|
|
50
|
-
name?: Maybe<Scalars['String']>;
|
|
51
56
|
location?: Maybe<Location>;
|
|
57
|
+
name?: Maybe<Scalars['String']>;
|
|
52
58
|
};
|
|
53
59
|
export declare type BranchFlags = {
|
|
54
60
|
__typename?: 'BranchFlags';
|
|
55
|
-
mrf?: Maybe<Scalars['Boolean']>;
|
|
56
61
|
centralStorage?: Maybe<Scalars['Boolean']>;
|
|
57
62
|
ecommerce?: Maybe<Scalars['Boolean']>;
|
|
63
|
+
mrf?: Maybe<Scalars['Boolean']>;
|
|
58
64
|
};
|
|
59
65
|
export declare type ContactOptions = {
|
|
60
66
|
__typename?: 'ContactOptions';
|
|
61
|
-
|
|
67
|
+
avatar?: Maybe<Scalars['URL']>;
|
|
62
68
|
email?: Maybe<Scalars['Email']>;
|
|
69
|
+
name?: Maybe<Scalars['String']>;
|
|
63
70
|
phonenumber?: Maybe<Scalars['PhoneNumber']>;
|
|
64
|
-
avatar?: Maybe<Scalars['URL']>;
|
|
65
71
|
};
|
|
66
72
|
export declare enum DrivingDistance {
|
|
67
73
|
Between0And1000 = "BETWEEN0AND1000",
|
|
@@ -74,8 +80,8 @@ export declare type Ecommerce = {
|
|
|
74
80
|
__typename?: 'Ecommerce';
|
|
75
81
|
enabled?: Maybe<Scalars['Boolean']>;
|
|
76
82
|
reserved?: Maybe<Scalars['Boolean']>;
|
|
77
|
-
withTradeIn?: Maybe<Scalars['Boolean']>;
|
|
78
83
|
withHomeDelivery?: Maybe<Scalars['Boolean']>;
|
|
84
|
+
withTradeIn?: Maybe<Scalars['Boolean']>;
|
|
79
85
|
};
|
|
80
86
|
export declare type FinancialOption = {
|
|
81
87
|
__typename?: 'FinancialOption';
|
|
@@ -122,30 +128,30 @@ export declare type HoursOpen = {
|
|
|
122
128
|
};
|
|
123
129
|
export declare type Insurance = {
|
|
124
130
|
__typename?: 'Insurance';
|
|
125
|
-
name: Scalars['String'];
|
|
126
|
-
price: Scalars['Float'];
|
|
127
|
-
unit: Scalars['String'];
|
|
128
|
-
description: Scalars['String'];
|
|
129
|
-
logotype?: Maybe<Scalars['URL']>;
|
|
130
131
|
addons: Array<InsuranceAddon>;
|
|
132
|
+
description: Scalars['String'];
|
|
131
133
|
items: Array<InsuranceItem>;
|
|
132
134
|
legality?: Maybe<InsuranceLegality>;
|
|
135
|
+
logotype?: Maybe<Scalars['URL']>;
|
|
136
|
+
name: Scalars['String'];
|
|
137
|
+
price: Scalars['Float'];
|
|
133
138
|
terms?: Maybe<Scalars['URL']>;
|
|
139
|
+
unit: Scalars['String'];
|
|
134
140
|
url?: Maybe<Scalars['URL']>;
|
|
135
141
|
};
|
|
136
142
|
export declare type InsuranceAddon = {
|
|
137
143
|
__typename?: 'InsuranceAddon';
|
|
138
|
-
id: Scalars['ID'];
|
|
139
|
-
title?: Maybe<Scalars['String']>;
|
|
140
144
|
description?: Maybe<Scalars['String']>;
|
|
145
|
+
exclusions: Array<Scalars['String']>;
|
|
146
|
+
id: Scalars['ID'];
|
|
141
147
|
price: Scalars['Float'];
|
|
148
|
+
title?: Maybe<Scalars['String']>;
|
|
142
149
|
unit: Scalars['String'];
|
|
143
|
-
exclusions: Array<Scalars['String']>;
|
|
144
150
|
};
|
|
145
151
|
export declare type InsuranceItem = {
|
|
146
152
|
__typename?: 'InsuranceItem';
|
|
147
|
-
name?: Maybe<Scalars['String']>;
|
|
148
153
|
description?: Maybe<Scalars['String']>;
|
|
154
|
+
name?: Maybe<Scalars['String']>;
|
|
149
155
|
};
|
|
150
156
|
export declare type InsuranceLegality = {
|
|
151
157
|
__typename?: 'InsuranceLegality';
|
|
@@ -169,9 +175,9 @@ export declare type Location = {
|
|
|
169
175
|
__typename?: 'Location';
|
|
170
176
|
city?: Maybe<Scalars['String']>;
|
|
171
177
|
county?: Maybe<Scalars['String']>;
|
|
172
|
-
streetAddress?: Maybe<Scalars['String']>;
|
|
173
|
-
postalCode?: Maybe<Scalars['String']>;
|
|
174
178
|
position?: Maybe<Position>;
|
|
179
|
+
postalCode?: Maybe<Scalars['String']>;
|
|
180
|
+
streetAddress?: Maybe<Scalars['String']>;
|
|
175
181
|
};
|
|
176
182
|
export declare type Manufacturer = {
|
|
177
183
|
__typename?: 'Manufacturer';
|
|
@@ -182,8 +188,8 @@ export declare type Manufacturer = {
|
|
|
182
188
|
};
|
|
183
189
|
export declare type Media = {
|
|
184
190
|
__typename?: 'Media';
|
|
185
|
-
type: Scalars['String'];
|
|
186
191
|
files: Array<MediaFile>;
|
|
192
|
+
type: Scalars['String'];
|
|
187
193
|
};
|
|
188
194
|
export declare type MediaFile = {
|
|
189
195
|
__typename?: 'MediaFile';
|
|
@@ -197,17 +203,24 @@ export declare type MediaFileFormat = {
|
|
|
197
203
|
};
|
|
198
204
|
export declare type OpeningHours = {
|
|
199
205
|
__typename?: 'OpeningHours';
|
|
200
|
-
monday?: Maybe<HoursOpen>;
|
|
201
|
-
tuesday?: Maybe<HoursOpen>;
|
|
202
|
-
wednesday?: Maybe<HoursOpen>;
|
|
203
|
-
thursday?: Maybe<HoursOpen>;
|
|
204
206
|
friday?: Maybe<HoursOpen>;
|
|
207
|
+
monday?: Maybe<HoursOpen>;
|
|
205
208
|
saturday?: Maybe<HoursOpen>;
|
|
206
209
|
sunday?: Maybe<HoursOpen>;
|
|
210
|
+
thursday?: Maybe<HoursOpen>;
|
|
211
|
+
tuesday?: Maybe<HoursOpen>;
|
|
212
|
+
wednesday?: Maybe<HoursOpen>;
|
|
207
213
|
};
|
|
208
214
|
export declare type Organization = {
|
|
209
215
|
__typename?: 'Organization';
|
|
210
216
|
branches: Array<Maybe<Branch>>;
|
|
217
|
+
contact?: Maybe<ContactOptions>;
|
|
218
|
+
description?: Maybe<Scalars['String']>;
|
|
219
|
+
flags?: Maybe<BranchFlags>;
|
|
220
|
+
homepage?: Maybe<Scalars['URL']>;
|
|
221
|
+
id: Scalars['ID'];
|
|
222
|
+
logotype?: Maybe<Scalars['URL']>;
|
|
223
|
+
name?: Maybe<Scalars['String']>;
|
|
211
224
|
parent?: Maybe<Branch>;
|
|
212
225
|
};
|
|
213
226
|
export declare type PackageOption = {
|
|
@@ -231,35 +244,36 @@ export declare type Promo = {
|
|
|
231
244
|
};
|
|
232
245
|
export declare type Query = {
|
|
233
246
|
__typename?: 'Query';
|
|
234
|
-
vehicle?: Maybe<Vehicle>;
|
|
235
247
|
branch?: Maybe<Branch>;
|
|
236
|
-
loan?: Maybe<FinancialOption>;
|
|
237
248
|
insurances: Array<Insurance>;
|
|
249
|
+
loan?: Maybe<FinancialOption>;
|
|
250
|
+
vehicle?: Maybe<Vehicle>;
|
|
238
251
|
};
|
|
239
|
-
export declare type
|
|
252
|
+
export declare type QueryBranchArgs = {
|
|
240
253
|
id: Scalars['ID'];
|
|
241
|
-
branch?: Maybe<Scalars['ID']>;
|
|
242
254
|
};
|
|
243
|
-
export declare type
|
|
255
|
+
export declare type QueryInsurancesArgs = {
|
|
256
|
+
drivingDistance: DrivingDistance;
|
|
244
257
|
id: Scalars['ID'];
|
|
258
|
+
personalNumber: Scalars['PersonalNumber'];
|
|
245
259
|
};
|
|
246
260
|
export declare type QueryLoanArgs = {
|
|
247
|
-
|
|
248
|
-
duration: Scalars['Int'];
|
|
261
|
+
branch?: InputMaybe<Scalars['ID']>;
|
|
249
262
|
downPayment: Scalars['Int'];
|
|
263
|
+
duration: Scalars['Int'];
|
|
264
|
+
id: Scalars['ID'];
|
|
250
265
|
residual: Scalars['Float'];
|
|
251
266
|
};
|
|
252
|
-
export declare type
|
|
267
|
+
export declare type QueryVehicleArgs = {
|
|
268
|
+
branch?: InputMaybe<Scalars['ID']>;
|
|
253
269
|
id: Scalars['ID'];
|
|
254
|
-
personalNumber: Scalars['PersonalNumber'];
|
|
255
|
-
drivingDistance: DrivingDistance;
|
|
256
270
|
};
|
|
257
271
|
export declare type SafetyOption = {
|
|
258
272
|
__typename?: 'SafetyOption';
|
|
259
273
|
content?: Maybe<Scalars['String']>;
|
|
274
|
+
image?: Maybe<Scalars['URL']>;
|
|
260
275
|
name?: Maybe<Scalars['String']>;
|
|
261
276
|
title?: Maybe<Scalars['String']>;
|
|
262
|
-
image?: Maybe<Scalars['URL']>;
|
|
263
277
|
};
|
|
264
278
|
export declare type Service = {
|
|
265
279
|
__typename?: 'Service';
|
|
@@ -268,22 +282,23 @@ export declare type Service = {
|
|
|
268
282
|
};
|
|
269
283
|
export declare type Vehicle = {
|
|
270
284
|
__typename?: 'Vehicle';
|
|
271
|
-
id: Scalars['ID'];
|
|
272
285
|
branch?: Maybe<Branch>;
|
|
273
286
|
contact?: Maybe<ContactOptions>;
|
|
274
287
|
data: VehicleData;
|
|
275
288
|
description?: Maybe<Scalars['String']>;
|
|
276
289
|
discount?: Maybe<Scalars['Float']>;
|
|
290
|
+
documents: Array<Scalars['FileDocument']>;
|
|
277
291
|
ecommerce?: Maybe<Ecommerce>;
|
|
278
292
|
financialOptions: Array<FinancialOption>;
|
|
279
293
|
flags?: Maybe<VehicleFlags>;
|
|
294
|
+
id: Scalars['ID'];
|
|
280
295
|
insuranceOptions: Array<InsuranceOption>;
|
|
281
|
-
|
|
296
|
+
location?: Maybe<Location>;
|
|
282
297
|
manufacturer?: Maybe<Manufacturer>;
|
|
283
298
|
media: Array<Media>;
|
|
284
|
-
location?: Maybe<Location>;
|
|
285
299
|
packageOptions: Array<PackageOption>;
|
|
286
300
|
price: Scalars['Float'];
|
|
301
|
+
publishedAt?: Maybe<Scalars['DateTime']>;
|
|
287
302
|
safety: Array<SafetyOption>;
|
|
288
303
|
shortDescription?: Maybe<Scalars['String']>;
|
|
289
304
|
title: Scalars['String'];
|
|
@@ -309,8 +324,8 @@ export declare type VehicleData = {
|
|
|
309
324
|
vin?: Maybe<Scalars['String']>;
|
|
310
325
|
};
|
|
311
326
|
export declare type VehicleDataPropertySetArgs = {
|
|
312
|
-
|
|
313
|
-
|
|
327
|
+
category?: InputMaybe<Scalars['String']>;
|
|
328
|
+
properties?: InputMaybe<Array<Scalars['String']>>;
|
|
314
329
|
};
|
|
315
330
|
export declare type VehicleFlags = {
|
|
316
331
|
__typename?: 'VehicleFlags';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Scalars } from '../../@types/codegen/types';
|
|
3
|
+
interface PdfDownloadItemProps {
|
|
4
|
+
document: Scalars['FileDocument'];
|
|
5
|
+
}
|
|
6
|
+
export declare const PdfDownloadItem: ({ document }: PdfDownloadItemProps) => JSX.Element;
|
|
7
|
+
interface PdfDownloadContainerProps {
|
|
8
|
+
documents: Scalars['FileDocument'][];
|
|
9
|
+
}
|
|
10
|
+
export declare const PdfDownloadContainer: ({ documents }: PdfDownloadContainerProps) => JSX.Element;
|
|
11
|
+
export default PdfDownloadContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const PdfListItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {
|
|
2
|
+
className: "wayke__theme wayke__color--primary-text";
|
|
3
|
+
}, "className">;
|
|
4
|
+
export declare const PdfContainer: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const PdfLink: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, {
|
|
6
|
+
className: "wayke__theme wayke__color--primary-text wayke__font--bold";
|
|
7
|
+
}, "className">;
|
|
8
|
+
export declare const PdfTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
+
export declare const PdfSubtitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
export declare const PdfColumn: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
export declare const PdfListInner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
package/dist-web/index.js
CHANGED
|
@@ -4098,6 +4098,7 @@ const SEARCH_ITEM_QUERY = gql `
|
|
|
4098
4098
|
query SearchItem($id: ID!) {
|
|
4099
4099
|
vehicle(id: $id) {
|
|
4100
4100
|
id
|
|
4101
|
+
documents
|
|
4101
4102
|
contact {
|
|
4102
4103
|
name
|
|
4103
4104
|
email
|
|
@@ -6946,6 +6947,69 @@ const PropertySet = ({ propertySet, vehicleData }) => {
|
|
|
6946
6947
|
React__default.createElement(MetadataCategory, { properties: activeCategory.properties, subCategories: activeCategory.subCategories })))));
|
|
6947
6948
|
};
|
|
6948
6949
|
|
|
6950
|
+
const PdfListItem = styled.li.attrs(() => ({
|
|
6951
|
+
className: 'wayke__theme wayke__color--primary-text',
|
|
6952
|
+
})) `
|
|
6953
|
+
flex: 0 0 50%;
|
|
6954
|
+
padding: ${size(1)};
|
|
6955
|
+
|
|
6956
|
+
${({ theme }) => theme.breakpoint.LtSm} {
|
|
6957
|
+
flex: 0 0 100%;
|
|
6958
|
+
}
|
|
6959
|
+
`;
|
|
6960
|
+
const PdfContainer = styled.ul `
|
|
6961
|
+
list-style: none;
|
|
6962
|
+
padding: 0;
|
|
6963
|
+
display: flex;
|
|
6964
|
+
flex-wrap: wrap;
|
|
6965
|
+
margin: ${size(-1)};
|
|
6966
|
+
`;
|
|
6967
|
+
const PdfLink = styled.a.attrs(() => ({
|
|
6968
|
+
className: 'wayke__theme wayke__color--primary-text wayke__font--bold',
|
|
6969
|
+
})) `
|
|
6970
|
+
text-decoration: none;
|
|
6971
|
+
font-size: 0.875rem;
|
|
6972
|
+
&:after {
|
|
6973
|
+
content: '';
|
|
6974
|
+
position: absolute;
|
|
6975
|
+
top: 0;
|
|
6976
|
+
left: 0;
|
|
6977
|
+
width: 100%;
|
|
6978
|
+
height: 100%;
|
|
6979
|
+
}
|
|
6980
|
+
`;
|
|
6981
|
+
const PdfTitle = styled.div `
|
|
6982
|
+
color: ${(props) => props.theme.color.textDark};
|
|
6983
|
+
`;
|
|
6984
|
+
const PdfSubtitle = styled.div `
|
|
6985
|
+
color: ${(props) => props.theme.color.textDarkLighten};
|
|
6986
|
+
`;
|
|
6987
|
+
const PdfColumn = styled.div `
|
|
6988
|
+
flex 0 0 auto;
|
|
6989
|
+
&:first-child {
|
|
6990
|
+
flex: 1 1 auto;
|
|
6991
|
+
}
|
|
6992
|
+
`;
|
|
6993
|
+
const PdfListInner = styled.div `
|
|
6994
|
+
position: relative;
|
|
6995
|
+
border: 1px solid ${(props) => props.theme.color.border};
|
|
6996
|
+
padding: ${size(1.5)};
|
|
6997
|
+
display: flex;
|
|
6998
|
+
align-items: center;
|
|
6999
|
+
:hover {
|
|
7000
|
+
background-color: ${(props) => props.theme.color.hoverOverlay};
|
|
7001
|
+
}
|
|
7002
|
+
`;
|
|
7003
|
+
|
|
7004
|
+
const PdfDownloadItem = ({ document }) => (React__default.createElement(PdfListItem, null,
|
|
7005
|
+
React__default.createElement(PdfListInner, null,
|
|
7006
|
+
React__default.createElement(PdfColumn, null,
|
|
7007
|
+
React__default.createElement(PdfTitle, null, document.name),
|
|
7008
|
+
React__default.createElement(PdfSubtitle, null, document.contentType)),
|
|
7009
|
+
React__default.createElement(PdfColumn, null,
|
|
7010
|
+
React__default.createElement(PdfLink, { href: document.url, rel: "noopener noreferrer nofollow", target: "_blank" }, "\u00D6ppna")))));
|
|
7011
|
+
const PdfDownloadContainer = ({ documents }) => (React__default.createElement(PdfContainer, null, documents.map((document, i) => (React__default.createElement(PdfDownloadItem, { key: `${document.url}-${i}`, document: document })))));
|
|
7012
|
+
|
|
6949
7013
|
const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, onClickSearchItem, }) => {
|
|
6950
7014
|
var _a, _b, _c;
|
|
6951
7015
|
const [ecomModal, setEcomModal] = useState(false);
|
|
@@ -6976,7 +7040,7 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
6976
7040
|
const { vehicle } = result;
|
|
6977
7041
|
const contact = centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.contact;
|
|
6978
7042
|
const branch = centralStorageVehicle === null || centralStorageVehicle === void 0 ? void 0 : centralStorageVehicle.branch;
|
|
6979
|
-
const { title, shortDescription, media, description, price, financialOptions, insuranceOptions, manufacturer, ecommerce, packageOptions, publishedAt, } = vehicle;
|
|
7043
|
+
const { title, shortDescription, media, description, price, financialOptions, insuranceOptions, manufacturer, ecommerce, packageOptions, publishedAt, documents, } = vehicle;
|
|
6980
7044
|
const { fuelType, mileage, gearbox, modelYear, propertySet } = vehicle.data;
|
|
6981
7045
|
const uspList = [
|
|
6982
7046
|
{
|
|
@@ -7046,6 +7110,14 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
7046
7110
|
React__default.createElement(Repeat, null,
|
|
7047
7111
|
React__default.createElement(ExtendContent, { actionTitle: "Visa mer", onClick: onShowMoreOptionsClick },
|
|
7048
7112
|
React__default.createElement(UspList, { items: options }))))),
|
|
7113
|
+
(documents.length || 0) > 0 && (React__default.createElement(ProductPageMainSection, null,
|
|
7114
|
+
React__default.createElement(Repeat, null,
|
|
7115
|
+
React__default.createElement(H2, { noMargin: true }, "Dokument")),
|
|
7116
|
+
React__default.createElement(Repeat, null,
|
|
7117
|
+
React__default.createElement(Content$2, null,
|
|
7118
|
+
React__default.createElement("p", null, "Tillh\u00F6rande dokument f\u00F6r bilen."))),
|
|
7119
|
+
React__default.createElement(Repeat, null,
|
|
7120
|
+
React__default.createElement(PdfDownloadContainer, { documents: documents })))),
|
|
7049
7121
|
React__default.createElement(ProductPageMainSection, null,
|
|
7050
7122
|
React__default.createElement(Branch, { branch: branch, loading: loadingCentralStorageVehicle }),
|
|
7051
7123
|
ecommerce && ecommerce.enabled && (React__default.createElement(Repeat, null,
|