@licklist/design 0.44.532 → 0.44.533
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/EventCard.d.ts.map +1 -1
- package/dist/events/event-card/EventCard.js +1 -1
- package/dist/events/event-card/utils.d.ts +1 -0
- package/dist/events/event-card/utils.d.ts.map +1 -1
- package/dist/events/event-card/utils.js +1 -1
- package/dist/styles/events/EventCard.scss +10 -3
- package/package.json +1 -1
- package/src/events/event-card/EventCard.tsx +6 -2
- package/src/events/event-card/utils.ts +2 -0
- package/src/styles/events/EventCard.scss +10 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventCard.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/EventCard.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAElG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"EventCard.d.ts","sourceRoot":"","sources":["../../../src/events/event-card/EventCard.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAElG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAS5C,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,QAAQ,EACR,aAAoB,EACpB,WAAW,EACX,cAAc,EACd,OAAO,EACP,aAAa,GACd,EAAE,cAAc,eAiIhB"}
|
|
@@ -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=require("tslib"),a=require("react"),n=e(a),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),c=require("react-bootstrap"),i=require("../../static/Icon.js"),s=e(require("clsx")),m=require("react-intl"),o=require("../../tiptap-editor/TipTapEditor.js"),u=require("./utils.js"),d=require("../../assets/dashboard/chartBar.svg.js");exports.EventCard=function(e){var
|
|
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=require("tslib"),a=require("react"),n=e(a),r=require("@licklist/core/dist/Config"),l=require("react-i18next"),c=require("react-bootstrap"),i=require("../../static/Icon.js"),s=e(require("clsx")),m=require("react-intl"),o=require("../../tiptap-editor/TipTapEditor.js"),u=require("./utils.js"),d=require("../../assets/dashboard/chartBar.svg.js");exports.EventCard=function(e){var E=e.name,v=e.description,p=e.date,y=e.imageUrl,f=e.sales,b=e.onPreview,N=e.onEdit,C=e.onCopy,k=e.onRemove,x=e.hasPermission,g=void 0===x||x,q=e.onStatistic,w=e.eventStatistic,h=e.titleId,j=e.descriptionId,I=l.useTranslation("Design").t,T=m.useIntl(),P=T.formatNumber,_=T.formatDate,B=u.getStatisticInfo(w,p),S=B.totalViews,D=t.__rest(B,["totalViews"]),M=a.useMemo((function(){return u.formatContent(v,u.EVENT_DESCRIPTION_SIZE)}),[v]);return n.createElement(c.Card,{className:"d-flex flex-column event-card h-100"},n.createElement("div",{className:s("event-card-image-container",!y&&"no-image")},y&&n.createElement(c.Card.Img,{variant:"top",src:y}),n.createElement(c.Badge,{className:"event-card-date",as:"time",dateTime:p,variant:"primary"},_(new Date(p),{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric"}))),n.createElement(c.Card.Body,null,n.createElement(c.Card.Title,{id:h},E),n.createElement("div",{className:"flex-grow-1"},n.createElement(o.TipTapEditor,{viewMode:!0,disabled:!0,className:s("event-description",!y&&"no-image"),content:M,id:j}),n.createElement("div",{className:"mt-2 ml-2"},Object.keys(D).map((function(e){return n.createElement("div",{className:"event-card-sale",key:e},n.createElement("span",{className:"event-card-sale-name"},I(e),":"," ","totalAmount"===e?P(D[e],{style:"currency",currency:r.Currency.GBP}):D[e]))}))),f&&f.map((function(e){return n.createElement("div",{className:"event-card-sale",key:e.id},n.createElement("div",{className:"event-card-sale-text"},n.createElement("span",{className:"event-card-sale-name"},e.name)," ",n.createElement("span",{className:"event-card-sale-quantity"},[e.current,e.max].map((function(e){return P(e)})).join(" / "))),n.createElement(c.ProgressBar,{now:e.current,max:e.max}))})))),n.createElement(c.Card.Footer,null,n.createElement("div",{className:"d-flex w-100 justify-content-between"},n.createElement("div",{className:"d-flex"},n.createElement("button",{type:"button",className:"event-card-link-button ml-3 mr-4",onClick:q},n.createElement(d.ReactComponent,null)),n.createElement("div",{className:"event-card-views"},n.createElement(i.default,{type:"eye"}),n.createElement("span",null,P(S)))),n.createElement("div",null,n.createElement("button",{type:"button",className:"event-card-link-button",onClick:b},n.createElement(i.default,{type:"external-link-alt"})),g&&n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:"event-card-link-button",onClick:N},n.createElement(i.default,{type:"edit"})),n.createElement("button",{type:"button",className:"event-card-link-button",onClick:C},n.createElement(i.default,{type:"copy"})),n.createElement("button",{type:"button",className:"event-card-link-button",onClick:k},n.createElement(i.default,{type:"trash-alt"})))))))};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper";
|
|
2
2
|
export declare function formatContent(content: any, maxSymbols: any): any;
|
|
3
|
+
export declare const EVENT_DESCRIPTION_SIZE = 340;
|
|
3
4
|
export declare const getStatisticInfo: (eventStatistic: EventStatistic | null, date: string) => {
|
|
4
5
|
totalViews: number;
|
|
5
6
|
totalSold: number;
|
|
@@ -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,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,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.formatContent=function(t,o){return t?t.length>o?"".concat(t.slice(0,o),"..."):t:""},exports.getStatisticInfo=function(r,e){var i,a,l,n,u=0,c=0;if(!r)return{totalViews:0,totalSold:0,totalAmount:0};var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@licklist/core/dist/Config"),o=require("luxon");exports.EVENT_DESCRIPTION_SIZE=340,exports.formatContent=function(t,o){return t?t.length>o?"".concat(t.slice(0,o),"..."):t:""},exports.getStatisticInfo=function(r,e){var i,a,l,n,u=0,c=0;if(!r)return{totalViews:0,totalSold:0,totalAmount:0};var s=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_FORMAT);n=(null===(i=r.views[s])||void 0===i?void 0:i.pageViews)||0;var d=o.DateTime.fromISO(e).toUTC().toFormat(t.DATE_TIME_FULL_FORMAT);return null===(l=null===(a=null==r?void 0:r.productCategorySummary)||void 0===a?void 0:a[d])||void 0===l||l.forEach((function(t){var o=t.totalPerCategory,r=t.productsSummary,e=void 0===r?[]:r;c+=o||0,null==e||e.forEach((function(t){var o=t.productsSold;u+=o}))})),{totalViews:n,totalSold:u,totalAmount:c}};
|
|
@@ -34,7 +34,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
34
34
|
transition: ease-in 0.25s;
|
|
35
35
|
border-radius: $event-card-border-radius;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
>*+* {
|
|
38
38
|
margin-top: $event-card-contents-gutter;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -43,9 +43,16 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
43
43
|
|
|
44
44
|
.event-description {
|
|
45
45
|
min-height: 8rem;
|
|
46
|
+
max-height: 21rem;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
|
|
49
|
+
&:last-child {
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
}
|
|
46
52
|
|
|
47
53
|
&.no-image {
|
|
48
54
|
min-height: 13.75rem;
|
|
55
|
+
max-height: 22rem;
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
}
|
|
@@ -75,7 +82,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
&:hover {
|
|
78
|
-
box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
|
|
85
|
+
box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
|
|
@@ -168,4 +175,4 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
168
175
|
color: #504f4f;
|
|
169
176
|
width: 1.7rem;
|
|
170
177
|
}
|
|
171
|
-
}
|
|
178
|
+
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,11 @@ import { EventStatistic } from "@licklist/core/dist/DataMapper/Provider/EventSta
|
|
|
9
9
|
import Icon from "../../static/Icon";
|
|
10
10
|
import { Sale } from "../../types/bookings";
|
|
11
11
|
import { TipTapEditor } from "../../tiptap-editor/TipTapEditor";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
EVENT_DESCRIPTION_SIZE,
|
|
14
|
+
formatContent,
|
|
15
|
+
getStatisticInfo,
|
|
16
|
+
} from "./utils";
|
|
13
17
|
import { ReactComponent as ChartBarIcon } from "../../assets/dashboard/chartBar.svg";
|
|
14
18
|
|
|
15
19
|
export interface EventCardProps extends HasPermissionProp {
|
|
@@ -48,7 +52,7 @@ export function EventCard({
|
|
|
48
52
|
const { formatNumber, formatDate } = useIntl();
|
|
49
53
|
const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date);
|
|
50
54
|
const memoedContent = useMemo(
|
|
51
|
-
() => formatContent(description,
|
|
55
|
+
() => formatContent(description, EVENT_DESCRIPTION_SIZE),
|
|
52
56
|
[description]
|
|
53
57
|
);
|
|
54
58
|
|
|
@@ -34,7 +34,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
34
34
|
transition: ease-in 0.25s;
|
|
35
35
|
border-radius: $event-card-border-radius;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
>*+* {
|
|
38
38
|
margin-top: $event-card-contents-gutter;
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -43,9 +43,16 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
43
43
|
|
|
44
44
|
.event-description {
|
|
45
45
|
min-height: 8rem;
|
|
46
|
+
max-height: 21rem;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
|
|
49
|
+
&:last-child {
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
}
|
|
46
52
|
|
|
47
53
|
&.no-image {
|
|
48
54
|
min-height: 13.75rem;
|
|
55
|
+
max-height: 22rem;
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
}
|
|
@@ -75,7 +82,7 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
&:hover {
|
|
78
|
-
box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
|
|
85
|
+
box-shadow: 0px 0px 1rem 0px rgb(0 0 0 / 20%);
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
|
|
@@ -168,4 +175,4 @@ $event-card-views-gutter: sp(3) !default;
|
|
|
168
175
|
color: #504f4f;
|
|
169
176
|
width: 1.7rem;
|
|
170
177
|
}
|
|
171
|
-
}
|
|
178
|
+
}
|