@licklist/design 0.44.539 → 0.44.541
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/events/event-card/utils.d.ts.map +1 -1
- package/dist/events/event-card/utils.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +1 -1
- package/dist/sales/filters/SaleFilters.d.ts +1 -0
- package/dist/sales/filters/SaleFilters.d.ts.map +1 -1
- package/dist/styles/events/EventCard.scss +2 -2
- package/dist/styles/sales/BookingResults.scss +7 -7
- package/package.json +1 -1
- package/src/events/event-card/utils.ts +4 -1
- package/src/sales/booking/results/BookingResults.stories.tsx +12 -0
- package/src/sales/booking/results/components/ResultCard.tsx +16 -1
- package/src/sales/filters/SaleFilters.tsx +1 -0
- package/src/styles/events/EventCard.scss +2 -2
- package/src/styles/sales/BookingResults.scss +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAGlG,wBAAgB,aAAa,CAAC,OAAO,KAAA,EAAE,UAAU,KAAA,OAIhD;AAED,eAAO,MAAM,wBAAwB,2CAepC,CAAC;AAEF,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;;;;CA6Bb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon");exports.EVENT_DESCRIPTION_SIZE=
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon");var r=300;exports.EVENT_DESCRIPTION_SIZE=r,exports.formatContent=function(t,o){return t?t.length>o?"".concat(t.slice(0,o),"..."):t:""},exports.formatContentWithoutTags=function(t,o){if(void 0===o&&(o=r),!t)return"";if(t<o)return t;var e=t.replace(/<[^>]*>/g,"").trim().replace(/ |[^a-zA-Z0-9\s]/g,"").replace(/\s\s+/g," ").slice(0,o).split(" "),i=String(t).indexOf(e[e.length-2]);return t.slice(0,i).concat("...")},exports.getStatisticInfo=function(r,e){var i,n,a,l,u=0,s=0;if(!r)return{totalViews:0,totalSold:0,totalAmount:0};var c=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_FORMAT);l=(null===(i=r.views[c])||void 0===i?void 0:i.pageViews)||0;var d=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_TIME_FULL_FORMAT);return null===(a=null===(n=null==r?void 0:r.productCategorySummary)||void 0===n?void 0:n[d])||void 0===a||a.forEach((function(t){var o=t.totalPerCategory,r=t.productsSummary,e=void 0===r?[]:r;s+=o||0,null==e||e.forEach((function(t){var o=t.productsSold;u+=o}))})),{totalViews:l,totalSold:u,totalAmount:s}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ResultCard.d.ts","sourceRoot":"","sources":["../../../../../src/sales/booking/results/components/ResultCard.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAO7E,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAIF,eAAO,MAAM,UAAU,uCAIpB,eAAe,gBA+DjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react")),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),a=require("../../../../static/Icon.js"),n=e(require("clsx")),i=require("luxon"),u=require("react-intl"),c=require("@licklist/plugins/dist/utils/formatDate"),s=require("@licklist/plugins/dist/utils/sourceTitle");exports.ResultCard=function(e){var o,m,d,p=e.order,E=e.className,f=e.onCardClick,v=l.useTranslation("Design").t,N=u.useIntl().formatNumber,q=p.id,y=p.people,g=p.user,D=p.status,x=p.startDate,C=p.products,T=p.source,b=p.totalAmount,h=(null===(o=C.map((function(e){return e.name})))||void 0===o?void 0:o.join(", "))||"",k=function(){f&&f(q)};return t.createElement("div",{className:n("result-card",E),onClick:k,onKeyUp:k,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},q),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),y),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},g.firstName," ",g.lastName),g.email&&t.createElement("p",null,g.email),(null===(m=g.userDetail)||void 0===m?void 0:m.phone)&&t.createElement("p",null,null===(d=g.userDetail)||void 0===d?void 0:d.phone),t.createElement("p",null,"------"),t.createElement("p",null,v("activity"),": "),t.createElement("p",null,v("staff"),": "),t.createElement("p",null,v("status"),": ",v(D)),t.createElement("p",null,v("date"),": ",c.formatDateStringForEvent(x,!1)),t.createElement("p",null,v("time"),": ",i.DateTime.fromISO(x).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:h},v("products"),": ",h),t.createElement("p",null,v("totalAmount"),":"," ",N(b,{style:"currency",currency:r.Currency.GBP})),t.createElement("p",null,v("source"),": ",v(s.getOrderSourceTitle(T))))))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaleFilters.d.ts","sourceRoot":"","sources":["../../../src/sales/filters/SaleFilters.tsx"],"names":[],"mappings":";AAMA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SaleFilters.d.ts","sourceRoot":"","sources":["../../../src/sales/filters/SaleFilters.tsx"],"names":[],"mappings":";AAMA,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC;AAUD,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,eAsDjE"}
|
|
@@ -39,7 +39,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.card-body {
|
|
42
|
-
padding: 0;
|
|
42
|
+
padding: 0 0 3rem 0;
|
|
43
43
|
|
|
44
44
|
.event-description {
|
|
45
45
|
min-height: 8rem;
|
|
@@ -54,7 +54,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
54
54
|
min-height: 13.75rem;
|
|
55
55
|
max-height: 22rem;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.card-title {
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
flex-wrap: wrap;
|
|
6
6
|
|
|
7
7
|
.result-card {
|
|
8
|
-
height:
|
|
8
|
+
height: 13.825rem;
|
|
9
9
|
border: 1px solid $gray-400;
|
|
10
10
|
max-width: calc(50% - 0.75rem);
|
|
11
11
|
flex: 0 0 calc(50% - 0.75rem);
|
|
12
12
|
transition: ease-in 0.25s;
|
|
13
13
|
border-radius: 0.25rem;
|
|
14
14
|
box-shadow: 0px 0px 0.125rem 0px rgb(0 0 0 / 20%);
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
.card-content {
|
|
17
17
|
width: 100%;
|
|
18
18
|
height: 100%;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
position: absolute;
|
|
29
29
|
left: 0.5rem;
|
|
30
30
|
top: 0.125rem;
|
|
31
|
-
font-weight: 600;
|
|
31
|
+
font-weight: 600;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.order-people {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
height: 1.75rem;
|
|
44
44
|
font-size: 0.625rem;
|
|
45
45
|
line-height: 0.625rem;
|
|
46
|
-
color: #
|
|
46
|
+
color: #6d6d6d;
|
|
47
47
|
font-weight: 600;
|
|
48
48
|
|
|
49
49
|
svg {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.products {
|
|
67
|
-
display:
|
|
67
|
+
display: block;
|
|
68
68
|
width: 80%;
|
|
69
69
|
white-space: nowrap;
|
|
70
70
|
overflow: hidden;
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
&:hover {
|
|
76
76
|
box-shadow: 0px 0px 0.5rem 0px rgb(0 0 0 / 20%);
|
|
77
|
-
cursor: pointer;
|
|
77
|
+
cursor: pointer;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -93,4 +93,4 @@
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|
package/package.json
CHANGED
|
@@ -8,7 +8,10 @@ export function formatContent(content, maxSymbols) {
|
|
|
8
8
|
return content;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const formatContentWithoutTags = (
|
|
11
|
+
export const formatContentWithoutTags = (
|
|
12
|
+
content,
|
|
13
|
+
maxLength = EVENT_DESCRIPTION_SIZE
|
|
14
|
+
) => {
|
|
12
15
|
if (!content) return "";
|
|
13
16
|
if (content < maxLength) return content;
|
|
14
17
|
const text = content.replace(/<[^>]*>/g, "");
|
|
@@ -4,6 +4,10 @@ import { Event } from "@licklist/core/dist/DataMapper/Provider/EventDataMapper";
|
|
|
4
4
|
import { User } from "@licklist/core/dist/DataMapper/User/UserDataMapper";
|
|
5
5
|
import { Product } from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
6
6
|
import { Order } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
|
|
7
|
+
import {
|
|
8
|
+
ORDER_SOURCE_IFRAME,
|
|
9
|
+
ORDER_SOURCE_MANUAL,
|
|
10
|
+
} from "@licklist/core/src/DataMapper/Order/OrderDataMapper";
|
|
7
11
|
import { BookingResults } from "./BookingResults";
|
|
8
12
|
|
|
9
13
|
export default {
|
|
@@ -21,6 +25,7 @@ Default.args = {
|
|
|
21
25
|
{
|
|
22
26
|
id: 1,
|
|
23
27
|
people: 2,
|
|
28
|
+
source: ORDER_SOURCE_MANUAL,
|
|
24
29
|
products: [
|
|
25
30
|
{
|
|
26
31
|
id: 1,
|
|
@@ -60,6 +65,7 @@ Default.args = {
|
|
|
60
65
|
{
|
|
61
66
|
id: 2,
|
|
62
67
|
people: 10,
|
|
68
|
+
source: ORDER_SOURCE_MANUAL,
|
|
63
69
|
products: [
|
|
64
70
|
{
|
|
65
71
|
id: 2,
|
|
@@ -100,6 +106,8 @@ Default.args = {
|
|
|
100
106
|
{
|
|
101
107
|
id: 3,
|
|
102
108
|
people: 10,
|
|
109
|
+
source: ORDER_SOURCE_MANUAL,
|
|
110
|
+
|
|
103
111
|
products: [
|
|
104
112
|
{
|
|
105
113
|
id: 3,
|
|
@@ -151,6 +159,7 @@ Default.args = {
|
|
|
151
159
|
{
|
|
152
160
|
id: 4,
|
|
153
161
|
people: 10,
|
|
162
|
+
source: ORDER_SOURCE_MANUAL,
|
|
154
163
|
products: [
|
|
155
164
|
{
|
|
156
165
|
id: 3,
|
|
@@ -182,6 +191,7 @@ Default.args = {
|
|
|
182
191
|
{
|
|
183
192
|
id: 5,
|
|
184
193
|
people: 10,
|
|
194
|
+
source: ORDER_SOURCE_IFRAME,
|
|
185
195
|
products: [
|
|
186
196
|
{
|
|
187
197
|
id: 3,
|
|
@@ -209,6 +219,7 @@ Default.args = {
|
|
|
209
219
|
{
|
|
210
220
|
id: 6,
|
|
211
221
|
people: 10,
|
|
222
|
+
source: ORDER_SOURCE_IFRAME,
|
|
212
223
|
products: [
|
|
213
224
|
{
|
|
214
225
|
id: 3,
|
|
@@ -235,6 +246,7 @@ Default.args = {
|
|
|
235
246
|
{
|
|
236
247
|
id: 7,
|
|
237
248
|
people: 10,
|
|
249
|
+
source: ORDER_SOURCE_IFRAME,
|
|
238
250
|
products: [
|
|
239
251
|
{
|
|
240
252
|
id: 3,
|
|
@@ -2,9 +2,12 @@ import React from "react";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { DateTime } from "luxon";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
5
6
|
import { Order } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
|
|
6
7
|
import { TIME_FORMAT } from "@licklist/core/dist/Config";
|
|
8
|
+
import * as Config from "@licklist/core/dist/Config";
|
|
7
9
|
import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
|
|
10
|
+
import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
|
|
8
11
|
import Icon from "../../../../static/Icon";
|
|
9
12
|
|
|
10
13
|
export type ResultCardProps = {
|
|
@@ -21,7 +24,9 @@ export const ResultCard = ({
|
|
|
21
24
|
onCardClick,
|
|
22
25
|
}: ResultCardProps) => {
|
|
23
26
|
const { t } = useTranslation("Design");
|
|
24
|
-
const {
|
|
27
|
+
const { formatNumber } = useIntl();
|
|
28
|
+
const { id, people, user, status, startDate, products, source, totalAmount } =
|
|
29
|
+
order;
|
|
25
30
|
|
|
26
31
|
const productList = products.map((product) => product.name)?.join(", ") || "";
|
|
27
32
|
|
|
@@ -66,6 +71,16 @@ export const ResultCard = ({
|
|
|
66
71
|
<p className="products" title={productList}>
|
|
67
72
|
{t("products")}: {productList}
|
|
68
73
|
</p>
|
|
74
|
+
<p>
|
|
75
|
+
{t("totalAmount")}:{" "}
|
|
76
|
+
{formatNumber(totalAmount, {
|
|
77
|
+
style: "currency",
|
|
78
|
+
currency: Config.Currency.GBP,
|
|
79
|
+
})}
|
|
80
|
+
</p>
|
|
81
|
+
<p>
|
|
82
|
+
{t("source")}: {t(getOrderSourceTitle(source))}
|
|
83
|
+
</p>
|
|
69
84
|
</div>
|
|
70
85
|
</div>
|
|
71
86
|
</div>
|
|
@@ -39,7 +39,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.card-body {
|
|
42
|
-
padding: 0;
|
|
42
|
+
padding: 0 0 3rem 0;
|
|
43
43
|
|
|
44
44
|
.event-description {
|
|
45
45
|
min-height: 8rem;
|
|
@@ -54,7 +54,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
54
54
|
min-height: 13.75rem;
|
|
55
55
|
max-height: 22rem;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
.card-title {
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
flex-wrap: wrap;
|
|
6
6
|
|
|
7
7
|
.result-card {
|
|
8
|
-
height:
|
|
8
|
+
height: 13.825rem;
|
|
9
9
|
border: 1px solid $gray-400;
|
|
10
10
|
max-width: calc(50% - 0.75rem);
|
|
11
11
|
flex: 0 0 calc(50% - 0.75rem);
|
|
12
12
|
transition: ease-in 0.25s;
|
|
13
13
|
border-radius: 0.25rem;
|
|
14
14
|
box-shadow: 0px 0px 0.125rem 0px rgb(0 0 0 / 20%);
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
.card-content {
|
|
17
17
|
width: 100%;
|
|
18
18
|
height: 100%;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
position: absolute;
|
|
29
29
|
left: 0.5rem;
|
|
30
30
|
top: 0.125rem;
|
|
31
|
-
font-weight: 600;
|
|
31
|
+
font-weight: 600;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.order-people {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
height: 1.75rem;
|
|
44
44
|
font-size: 0.625rem;
|
|
45
45
|
line-height: 0.625rem;
|
|
46
|
-
color: #
|
|
46
|
+
color: #6d6d6d;
|
|
47
47
|
font-weight: 600;
|
|
48
48
|
|
|
49
49
|
svg {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.products {
|
|
67
|
-
display:
|
|
67
|
+
display: block;
|
|
68
68
|
width: 80%;
|
|
69
69
|
white-space: nowrap;
|
|
70
70
|
overflow: hidden;
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
&:hover {
|
|
76
76
|
box-shadow: 0px 0px 0.5rem 0px rgb(0 0 0 / 20%);
|
|
77
|
-
cursor: pointer;
|
|
77
|
+
cursor: pointer;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -93,4 +93,4 @@
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|