@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.
@@ -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,2CAYpC,CAAC;AAEF,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,gBAAgB,mBACX,cAAc,GAAG,IAAI,QAC/B,MAAM;;;;CA6Bb,CAAC"}
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=300,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=300),!t)return"";if(t<o)return t;var r=t.replace(/<[^>]*>/g,"").trim().replace(/&nbsp;|[^a-zA-Z0-9\s]/g,"").replace(/\s\s+/g," ").slice(0,o).split(" "),e=String(t).indexOf(r[r.length-2]);return t.slice(0,e).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
+ "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(/&nbsp;|[^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":";AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAC;AAK7E,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,gBAmDjB,CAAC"}
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"),s=require("@licklist/plugins/dist/utils/formatDate");exports.ResultCard=function(e){var c,u,o,m=e.order,d=e.className,p=e.onCardClick,E=l.useTranslation("Design").t,f=m.id,v=m.people,N=m.user,q=m.status,D=m.startDate,x=(null===(c=m.products.map((function(e){return e.name})))||void 0===c?void 0:c.join(", "))||"",g=function(){p&&p(f)};return t.createElement("div",{className:n("result-card",d),onClick:g,onKeyUp:g,role:"button",tabIndex:0},t.createElement("div",{className:"card-content"},t.createElement("div",{className:"order-id"},f),t.createElement("div",{className:"order-people"},t.createElement(a.default,{type:"user",width:"10",height:"11"}),v),t.createElement("div",{className:"order-description"},t.createElement("p",{className:"name"},N.firstName," ",N.lastName),N.email&&t.createElement("p",null,N.email),(null===(u=N.userDetail)||void 0===u?void 0:u.phone)&&t.createElement("p",null,null===(o=N.userDetail)||void 0===o?void 0:o.phone),t.createElement("p",null,"------"),t.createElement("p",null,E("activity"),": "),t.createElement("p",null,E("staff"),": "),t.createElement("p",null,E("status"),": ",E(q)),t.createElement("p",null,E("date"),": ",s.formatDateStringForEvent(D,!1)),t.createElement("p",null,E("time"),": ",i.DateTime.fromISO(D).toFormat(r.TIME_FORMAT)),t.createElement("p",{className:"products",title:x},E("products"),": ",x))))};
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))))))};
@@ -8,6 +8,7 @@ export interface Filters {
8
8
  orderable_date_from: string;
9
9
  orderable_date_to: string;
10
10
  is_in_cart: boolean;
11
+ isFilterOpen?: boolean;
11
12
  }
12
13
  export interface SaleFiltersProps {
13
14
  values: Filters;
@@ -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;CACrB;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"}
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: 12.125rem;
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: #6D6D6D;
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: inline-block;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.539",
3
+ "version": "0.44.541",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -8,7 +8,10 @@ export function formatContent(content, maxSymbols) {
8
8
  return content;
9
9
  }
10
10
 
11
- export const formatContentWithoutTags = (content, maxLength = 300) => {
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 { id, people, user, status, startDate, products } = order;
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>
@@ -13,6 +13,7 @@ export interface Filters {
13
13
  orderable_date_from: string;
14
14
  orderable_date_to: string;
15
15
  is_in_cart: boolean;
16
+ isFilterOpen?: boolean;
16
17
  }
17
18
 
18
19
  export interface SaleFiltersProps {
@@ -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: 12.125rem;
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: #6D6D6D;
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: inline-block;
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
+ }