@licklist/design 0.49.0 → 0.50.0-dev.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/calendar/Calendar.d.ts +3 -0
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/calendar/utils/index.d.ts +2 -1
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/calendar/utils/index.js +1 -1
- package/dist/date-time-button/DateTimeButton.d.ts +3 -2
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/date-time-button/DateTimeButton.js +1 -1
- package/dist/events/event-venue-map/components/Scrollbars/Scrollbars.js +1 -1
- package/dist/iframe/event/event-booking-products/EventBookingProducts.js +1 -1
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts +2 -2
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
- package/dist/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.d.ts +2 -1
- package/dist/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
- package/dist/iframe/order-process/components/utils/useCategoryVerification.js +1 -1
- package/dist/index.js +1 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.d.ts +1 -2
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts +2 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.js +1 -1
- package/dist/static/date-range-input/DateRangeInput.d.ts.map +1 -1
- package/dist/static/date-range-input/DateRangeInput.js +1 -1
- package/dist/static/switch/BooleanSwitch.d.ts +3 -1
- package/dist/static/switch/BooleanSwitch.d.ts.map +1 -1
- package/dist/static/switch/BooleanSwitch.js +1 -1
- package/dist/styles/resources-blocking/_index.scss +6 -0
- package/dist/styles/sales/BookingFilter.scss +21 -1
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +63 -5
- package/dist/styles/sales/LifeTimeSales.scss +1 -0
- package/dist/styles/sales/ManualBooking.scss +56 -2
- package/dist/styles/sales/SourceOfSales.scss +3 -0
- package/dist/styles/static/Switch.scss +1 -0
- package/dist/styles/static/Tabs.scss +6 -0
- package/dist/table/TableHelperComponent.d.ts +2 -1
- package/dist/table/TableHelperComponent.d.ts.map +1 -1
- package/dist/table/TableHelperComponent.js +1 -1
- package/package.json +3 -3
- package/src/calendar/Calendar.tsx +5 -0
- package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +3 -3
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +5 -2
- package/src/calendar/utils/index.ts +15 -6
- package/src/date-time-button/DateTimeButton.tsx +16 -3
- package/src/iframe/event/event-booking-products/EventBookingProducts.tsx +1 -1
- package/src/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.tsx +8 -8
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +5 -5
- package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +2 -2
- package/src/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.tsx +16 -3
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +2 -2
- package/src/iframe/order-process/components/utils/useCategoryVerification.ts +1 -1
- package/src/iframe/payment/payment-page/PaymentPage.stories.tsx +1 -1
- package/src/product-set/product/ProductControl.tsx +1 -4
- package/src/product-set/product/duration/ProductDurationControl.tsx +10 -9
- package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +9 -1
- package/src/static/date-range-input/DateRangeInput.tsx +23 -2
- package/src/static/switch/BooleanSwitch.tsx +6 -2
- package/src/styles/resources-blocking/_index.scss +6 -0
- package/src/styles/sales/BookingFilter.scss +21 -1
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +63 -5
- package/src/styles/sales/LifeTimeSales.scss +1 -0
- package/src/styles/sales/ManualBooking.scss +56 -2
- package/src/styles/sales/SourceOfSales.scss +3 -0
- package/src/styles/static/Switch.scss +1 -0
- package/src/styles/static/Tabs.scss +6 -0
- package/src/table/TableHelperComponent.tsx +73 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),n=require("react"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,a=require("react-i18next"),i=require("react-bootstrap"),s=require("../Icon.js"),o=require("@react-aria/utils"),u=require("react-date-range"),c=require("react-use"),l=require("./utils/index.js"),d=require("../../iframe/order-process/components/BookingSummary/types/index.js");require("react-date-range/dist/styles.css"),require("react-date-range/dist/theme/default.css"),require("../index.js");var m={name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;Object.assign(t.styles.popper,{marginLeft:"-2px",maxWidth:"unset"})},effect:function(e){var t=e.state;Object.assign(t.elements.popper.style,{maxWidth:"unset"})}};exports.DateRangeInput=function(e){var f=e.placeholder,p=e.startDate,g=e.endDate,D=e.onDateChange,v=e.months,h=void 0===v?2:v,y=e.disabled,_=a.useTranslation("Design").t,E=t.__read(n.useState("horizontal"),2),w=E[0],q=E[1],b=t.__read(n.useState([{startDate:new Date,endDate:new Date,key:"selection"}]),2),x=b[0],j=b[1],k=t.__read(n.useState(!1),2),C=k[0],S=k[1],I=o.useId(),N=n.useRef();c.useClickAway(N,(function(){return S(!1)}));return n.useEffect((function(){p&&g&&j((function(e){return[t.__assign(t.__assign({},e[0]),l.stringDatesToJSDates({startDate:p,endDate:g}))]}))}),[p,g]),n.useEffect((function(){var e=function(){window.innerWidth>d.MOBILE_WIDTH?q("horizontal"):q("vertical")};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),r.createElement("div",null,r.createElement(i.OverlayTrigger,{show:C,overlay:r.createElement(i.Popover,{id:I,className:"rounded"},r.createElement(i.Popover.Content,{className:"shadow-lg rounded",ref:N},r.createElement(u.DateRange,{onChange:function(e){return j([e.selection])},moveRangeOnFirstSelection:!1,ranges:x,months:h,direction:w}),r.createElement("div",{className:"mt-3 d-flex justify-content-end"},r.createElement(i.Button,{onClick:function(){D&&D({}),j((function(e){return[t.__assign(t.__assign({},e[0]),{startDate:new Date,endDate:new Date})]})),S(!1)},variant:"link"},_("clear")),r.createElement(i.Button,{onClick:function(){D&&D(l.rangeDatesToStringDates(x)),S(!1)},className:"ml-3",variant:"link"},_("apply"))))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[m]}},r.createElement("div",{onClick:function(){return S((function(e){return!e}))},onKeyDown:function(){return S((function(e){return!e}))},role:"button",tabIndex:0,className:"date-range-input-wrapper"},r.createElement(i.Form.Control,{type:"input",placeholder:f,disabled:y,readOnly:!0,className:"date-range-input",value:l.stringDatesToInputValue({startDate:p,endDate:g})}),r.createElement(s.default,{type:"calendar",height:"1rem",className:"date-range-input-icon"}))))};
|
|
@@ -4,6 +4,8 @@ export interface BooleanSwitchProps {
|
|
|
4
4
|
value?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
onChange: (value: boolean) => void;
|
|
7
|
+
firstValueTitle?: string;
|
|
8
|
+
secondValueTitle?: string;
|
|
7
9
|
}
|
|
8
|
-
export declare function BooleanSwitch({ name, value, disabled, onChange, }: BooleanSwitchProps): JSX.Element;
|
|
10
|
+
export declare function BooleanSwitch({ name, value, disabled, onChange, firstValueTitle, secondValueTitle, }: BooleanSwitchProps): JSX.Element;
|
|
9
11
|
//# sourceMappingURL=BooleanSwitch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanSwitch.d.ts","sourceRoot":"","sources":["../../../src/static/switch/BooleanSwitch.tsx"],"names":[],"mappings":";AAKA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"BooleanSwitch.d.ts","sourceRoot":"","sources":["../../../src/static/switch/BooleanSwitch.tsx"],"names":[],"mappings":";AAKA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,gBAAgB,GACjB,EAAE,kBAAkB,eAwBpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),a=require("react"),i=(e=a)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-i18next"),l=require("./Switch.js");exports.BooleanSwitch=function(e){var r=e.name,u=e.value,o=e.disabled,s=e.onChange,c=e.firstValueTitle,d=e.secondValueTitle,v=n.useTranslation("Design").t,b=[{id:1,value:null!=c?c:v("yes")},{id:0,value:null!=d?d:v("no")}],f=a.useCallback((function(e){s(Boolean(e))}),[s]);return i.createElement(l.Switch,t.__assign({name:r},void 0!==u&&{value:Number(u)},{options:b,disabled:o,onChange:f}))};
|
|
@@ -157,6 +157,19 @@
|
|
|
157
157
|
margin-bottom: 0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
.apply-container{
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: space-around;
|
|
164
|
+
column-gap: 2rem;
|
|
165
|
+
margin-left: 3rem;
|
|
166
|
+
|
|
167
|
+
@include media-breakpoint-down(sm) {
|
|
168
|
+
flex-direction: row;
|
|
169
|
+
margin-left: 0rem;
|
|
170
|
+
column-gap: 1rem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
160
173
|
}
|
|
161
174
|
|
|
162
175
|
.additional-filter-container {
|
|
@@ -164,10 +177,12 @@
|
|
|
164
177
|
|
|
165
178
|
@include media-breakpoint-down(md) {
|
|
166
179
|
flex-wrap: wrap;
|
|
180
|
+
|
|
167
181
|
.date-container {
|
|
168
182
|
width: 100%;
|
|
169
183
|
flex: 1;
|
|
170
184
|
}
|
|
185
|
+
|
|
171
186
|
.btn-primary {
|
|
172
187
|
margin-top: 1rem;
|
|
173
188
|
}
|
|
@@ -228,6 +243,11 @@
|
|
|
228
243
|
transform: rotate(45deg);
|
|
229
244
|
}
|
|
230
245
|
}
|
|
246
|
+
|
|
247
|
+
@include media-breakpoint-down(sm) {
|
|
248
|
+
flex-direction: column;
|
|
249
|
+
justify-content: flex-start;
|
|
250
|
+
}
|
|
231
251
|
}
|
|
232
252
|
}
|
|
233
|
-
}
|
|
253
|
+
}
|
|
@@ -1,24 +1,49 @@
|
|
|
1
1
|
.booking-tabs-pane {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
|
+
justify-content: space-between;
|
|
4
5
|
align-items: center;
|
|
5
6
|
height: 2.75rem;
|
|
6
7
|
background-color: $white;
|
|
7
8
|
|
|
8
9
|
.booking-tabs {
|
|
9
10
|
svg {
|
|
10
|
-
g
|
|
11
|
-
fill: $white;
|
|
11
|
+
g>rect:first-child {
|
|
12
|
+
fill: $white;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
|
|
15
16
|
.active {
|
|
16
17
|
svg {
|
|
17
|
-
g
|
|
18
|
-
fill: $blue;
|
|
18
|
+
g>rect:first-child {
|
|
19
|
+
fill: $blue;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
@include media-breakpoint-down(sm) {
|
|
25
|
+
width: 4rem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 90%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
|
|
35
|
+
@include media-breakpoint-down(sm) {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: start;
|
|
39
|
+
height: 4rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.booking {
|
|
43
|
+
@include media-breakpoint-down(sm) {
|
|
44
|
+
height: 13rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
22
47
|
}
|
|
23
48
|
|
|
24
49
|
.separator {
|
|
@@ -29,6 +54,12 @@
|
|
|
29
54
|
.children {
|
|
30
55
|
flex: 1;
|
|
31
56
|
margin-left: 1rem;
|
|
57
|
+
|
|
58
|
+
@include media-breakpoint-down(sm) {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: start;
|
|
62
|
+
}
|
|
32
63
|
}
|
|
33
64
|
|
|
34
65
|
.buttons {
|
|
@@ -61,6 +92,33 @@
|
|
|
61
92
|
border-radius: 0.625rem;
|
|
62
93
|
margin-right: 0.5rem;
|
|
63
94
|
}
|
|
95
|
+
@include media-breakpoint-down(sm) {
|
|
96
|
+
width: 12.5rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@include media-breakpoint-down(sm) {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
align-items: start;
|
|
105
|
+
gap: .5rem;
|
|
106
|
+
margin-top: .5rem;
|
|
107
|
+
white-space: nowrap;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@include media-breakpoint-down(sm) {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: start;
|
|
114
|
+
gap: 1rem;
|
|
115
|
+
margin-top: 1rem;
|
|
116
|
+
height: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.booking {
|
|
120
|
+
@include media-breakpoint-down(sm) {
|
|
121
|
+
height: 13rem;
|
|
64
122
|
}
|
|
65
123
|
}
|
|
66
124
|
}
|
|
@@ -361,10 +361,11 @@
|
|
|
361
361
|
width: inherit;
|
|
362
362
|
|
|
363
363
|
@include media-breakpoint-down(sm) {
|
|
364
|
-
|
|
365
|
-
padding-top: 2rem;
|
|
364
|
+
display: none;
|
|
366
365
|
}
|
|
367
366
|
|
|
367
|
+
|
|
368
|
+
|
|
368
369
|
.form-control {
|
|
369
370
|
margin-bottom: 1.5rem;
|
|
370
371
|
}
|
|
@@ -411,6 +412,59 @@
|
|
|
411
412
|
}
|
|
412
413
|
}
|
|
413
414
|
|
|
415
|
+
.manual-booking-summary-mobile {
|
|
416
|
+
padding: 0 1.5rem;
|
|
417
|
+
padding-top: 2rem;
|
|
418
|
+
height: max-content;
|
|
419
|
+
margin-bottom: 1.5rem;
|
|
420
|
+
width: inherit;
|
|
421
|
+
|
|
422
|
+
.form-control {
|
|
423
|
+
margin-bottom: .5rem;
|
|
424
|
+
}
|
|
425
|
+
.receipt-title {
|
|
426
|
+
font-size: 1.125rem;
|
|
427
|
+
font-weight: 600;
|
|
428
|
+
padding-bottom: 0.4rem;
|
|
429
|
+
margin-bottom: 1rem;
|
|
430
|
+
border-bottom: 2px solid $gray-400;
|
|
431
|
+
}
|
|
432
|
+
.event-name {
|
|
433
|
+
font-size: 0.94rem;
|
|
434
|
+
font-weight: 600;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.border-summary-item {
|
|
438
|
+
padding-bottom: 0.9rem;
|
|
439
|
+
margin-bottom: 1%;
|
|
440
|
+
border-bottom: 2px solid $gray-100;
|
|
441
|
+
flex-wrap: wrap;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.total-container {
|
|
445
|
+
display: flex;
|
|
446
|
+
justify-content: space-between;
|
|
447
|
+
font-size: 1rem;
|
|
448
|
+
font-weight: 600;
|
|
449
|
+
|
|
450
|
+
@include media-breakpoint-down(lg) {
|
|
451
|
+
flex-wrap: wrap;
|
|
452
|
+
}
|
|
453
|
+
.total-amount {
|
|
454
|
+
padding-left: 1rem;
|
|
455
|
+
@include media-breakpoint-down(lg) {
|
|
456
|
+
padding-left: 0;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.summary-item-container {
|
|
462
|
+
.border-summary-item:nth-last-child(2) {
|
|
463
|
+
border-bottom: 2px solid $gray-400;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
414
468
|
.menu-list-manual-booking {
|
|
415
469
|
display: flex;
|
|
416
470
|
align-items: center;
|
|
@@ -27,6 +27,7 @@ $btn-switch-option-padding-y: calc(#{$btn-padding-y} - #{sp(1)}) !default;
|
|
|
27
27
|
border-radius: $btn-switch-option-border-radius;
|
|
28
28
|
margin: 0;
|
|
29
29
|
padding: $btn-switch-option-padding-y $btn-switch-option-padding-x;
|
|
30
|
+
min-width: 4.25rem;
|
|
30
31
|
|
|
31
32
|
&:hover,
|
|
32
33
|
&:active,
|
|
@@ -11,6 +11,12 @@ $tab-nav-link-active-border-bottom: 1px solid $tab-nav-link-active-color !defaul
|
|
|
11
11
|
margin-left: -1.25rem;
|
|
12
12
|
border-bottom: 1px solid $nav-tabs-border-color;
|
|
13
13
|
|
|
14
|
+
@include media-breakpoint-down(sm) {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
.nav-link {
|
|
15
21
|
color: $tab-nav-link-color;
|
|
16
22
|
background-color: transparent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { SetStateAction } from "react";
|
|
2
2
|
import ILengthAwarePaginator from "@licklist/plugins/dist/types/services/Table/ILengthAwarePaginator";
|
|
3
3
|
import ITableHeader from "@licklist/plugins/dist/types/services/Table/ITableHeader";
|
|
4
4
|
import ITableProps from "@licklist/plugins/dist/types/services/Table/ITableProps";
|
|
@@ -18,6 +18,7 @@ export interface TableHelperComponentProps {
|
|
|
18
18
|
[key: string]: any;
|
|
19
19
|
};
|
|
20
20
|
initialOptions?: Partial<ITableProps>;
|
|
21
|
+
filteredOrdersOptions?: (value: SetStateAction<ITableProps>) => void;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* TableHelperComponent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHelperComponent.d.ts","sourceRoot":"","sources":["../../src/table/TableHelperComponent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TableHelperComponent.d.ts","sourceRoot":"","sources":["../../src/table/TableHelperComponent.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,cAAc,EAAuB,MAAM,OAAO,CAAC;AAOnE,OAAO,qBAAqB,MAAM,mEAAmE,CAAC;AACtG,OAAO,YAAY,MAAM,0DAA0D,CAAC;AACpF,OAAO,WAAW,MAAM,yDAAyD,CAAC;AAQlF,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,YAAY,EAAE,QAAQ,CAAC;IACvB,SAAS,CAAC,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACzC,cAAc,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACtE;AAUD;;;;;;GAMG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,eA4S7D;AAED,OAAO,EAAE,oBAAoB,EAAE,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=require("tslib"),r=require("react"),n=e(r),i=require("react-router-dom"),a=e(require("@licklist/plugins/dist/services/Route/RouteService")),o=require("../static/loader/LoaderIndicator.js"),
|
|
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"),r=require("react"),n=e(r),i=require("react-router-dom"),a=e(require("@licklist/plugins/dist/services/Route/RouteService")),o=require("../static/loader/LoaderIndicator.js"),s=require("react-bootstrap"),l=e(require("@licklist/plugins/dist/hooks/Query/useQuery")),u=require("lodash"),c=require("./FilterHelperComponent.js"),g=require("./PaginationHelperComponent.js"),p=e(require("@licklist/plugins/dist/services/Table/TableService")),d=require("./PerPageHelperComponent.js"),_=require("./utils/index.js");exports.TableHelperComponent=function(e){var f,m,v=e.paginator,y=e.headers,E=e.renderItemFn,S=e.isLoading,h=e.onRefreshFn,C=e.refreshAt,P=e.striped,b=void 0===P||P,q=e.bordered,D=void 0===q||q,F=e.displaySearchBar,j=void 0===F||F,O=e.displayPerPageSelect,k=void 0===O||O,L=e.displayShowingSection,w=void 0===L||L,H=e.externalFilters,R=void 0===H?{}:H,T=e.initialOptions,K=void 0===T?{}:T,N=e.filteredOrdersOptions,V=l(),I=i.useLocation().pathname,x=Number(_.getFilterOptionsValue(V,K,"page")),A=Number(_.getFilterOptionsValue(V,K,"perPage")),U=String(_.getFilterOptionsValue(V,K,"sortKey")),Q=String(_.getFilterOptionsValue(V,K,"sortDirection")),B=String(_.getFilterOptionsValue(V,K,"filter")),G=t.__read(r.useState(),2),M=G[0],z=G[1],J=t.__read(r.useState({page:x,perPage:A,sortKey:U,sortDirection:Q,filter:B}),2),W=J[0],X=J[1],Y=t.__read(r.useState(0),2),Z=Y[0],$=Y[1],ee=t.__read(r.useState(R),2),te=ee[0],re=ee[1];r.useEffect((function(){u.isEqual(M,W)&&u.isEqual(te,R)||N||(z(W),re(R),h&&h(W),a.redirectTo([I,["page=".concat(W.page),"perPage=".concat(W.perPage),"sortKey=".concat(escape(W.sortKey)),"sortDirection=".concat(escape(W.sortDirection)),"filter=".concat(escape(W.filter)),new URLSearchParams(R).toString()].join("&")].join("?")))}),[I,W,h,N,R]),r.useEffect((function(){Z===C||N||($((function(e){return null!=C?C:e})),h&&h(W))}),[h,W,C,N,Z]);var ne=function(e){var r,i;if("string"==typeof e)return n.createElement("th",{key:e.toLowerCase(),className:p.getHeaderClasses(e,U,Q)},e);if("object"==typeof e){var a={width:null!==(r=e.width)&&void 0!==r?r:"auto"};return n.createElement("th",{key:null!==(i=e.key)&&void 0!==i?i:e.title.toLowerCase(),className:p.getHeaderClasses(e,U,Q),style:a,onClick:function(){return e.isSortable&&(r=e.key,n=p.DEFAULT_SORT_DIRECTION,void(U===r?N?N((function(e){return n=p.getSortDirection(e.sortDirection,n),t.__assign(t.__assign({},e),{sortKey:r,sortDirection:n})})):X((function(e){return n=p.getSortDirection(e.sortDirection,n),t.__assign(t.__assign({},e),{sortKey:r,sortDirection:n})})):N?N((function(e){return t.__assign(t.__assign({},e),{sortKey:r,sortDirection:n})})):X((function(e){return t.__assign(t.__assign({},e),{sortKey:r,sortDirection:n})}))));var r,n}},e.title)}return null};return n.createElement("div",{className:["table-helper",S?"py-5":"py-1"].join(" ")},n.createElement(o.LoaderIndicator,{isLoaded:!S},n.createElement(s.Row,null,n.createElement(s.Col,null,k&&n.createElement(d.PerPageHelperComponent,{onChangeFn:function(e){N?N((function(r){return t.__assign(t.__assign({},r),{page:e})})):X((function(r){return t.__assign(t.__assign({},r),{perPage:e})}))},defaultValue:null!==(f=null==v?void 0:v.per_page)&&void 0!==f?f:p.DEFAULT_PER_PAGE})),n.createElement(s.Col,null,j&&n.createElement(c.FilterHelperComponent,{onClickFn:function(e){N&&N((function(r){var n=r.page,i=t.__rest(r,["page"]),a=n;return(!e&&i.filter||e&&!i.filter)&&(a=1),t.__assign(t.__assign({},i),{page:a,filter:e})})),X((function(r){var n=r.page,i=t.__rest(r,["page"]),a=n;return(!e&&i.filter||e&&!i.filter)&&(a=1),t.__assign(t.__assign({},i),{page:a,filter:e})}))},defaultValue:null!==(m=W.filter)&&void 0!==m?m:""}))),n.createElement(s.Row,null,n.createElement(s.Col,null,n.createElement("div",{className:"table-responsive"},n.createElement(s.Table,{striped:b,bordered:D,hover:!0},n.createElement("thead",null,n.createElement("tr",null,y.map((function(e){return ne(e)})))),n.createElement("tbody",null,v?v.data.map((function(e,t){return E(e,t)})):null))))),n.createElement(g.PaginationHelperComponent,{displayShowingSection:w,paginator:v,onPageChangeFn:function(e){N?N((function(r){return t.__assign(t.__assign({},r),{page:e})})):X((function(r){return t.__assign(t.__assign({},r),{page:e})}))}})))};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0-dev.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@fortawesome/free-brands-svg-icons": "5.15.2",
|
|
54
54
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
55
55
|
"@fortawesome/react-fontawesome": "0.1.9",
|
|
56
|
-
"@licklist/core": "
|
|
56
|
+
"@licklist/core": ">=0.15.41-dev.0 < 0.15.41",
|
|
57
57
|
"@licklist/eslint-config": "0.3.4",
|
|
58
|
-
"@licklist/plugins": "
|
|
58
|
+
"@licklist/plugins": ">=0.24.0-dev.0 < 0.24.0",
|
|
59
59
|
"@mdx-js/react": "1.6.22",
|
|
60
60
|
"@popperjs/core": "2.11.8",
|
|
61
61
|
"@react-aria/utils": "3.9.0",
|
|
@@ -4,6 +4,9 @@ import { ZoneResourcesAvailability } from "@licklist/core/dist/DataMapper/Order/
|
|
|
4
4
|
import { CalendarButtons } from "./components/CalendarButtons";
|
|
5
5
|
import { CalendarDates } from "./components/CalendarDates";
|
|
6
6
|
|
|
7
|
+
// same as apps/iframe/src/types/availability.ts
|
|
8
|
+
export type AvailableTimes = Record<string, string[]>;
|
|
9
|
+
|
|
7
10
|
export const defaultStartDay = DateTime.now().set({
|
|
8
11
|
millisecond: 0,
|
|
9
12
|
second: 0,
|
|
@@ -23,6 +26,8 @@ export type CalendarProps = {
|
|
|
23
26
|
initialDate?: DateTime;
|
|
24
27
|
getAvailability?: (date: DateTime) => ZoneResourcesAvailability | null;
|
|
25
28
|
includeAvailability?: boolean;
|
|
29
|
+
availableTimes?: AvailableTimes;
|
|
30
|
+
shouldCalculateResources?: boolean;
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
export const Calendar = ({
|
|
@@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import { range } from "lodash";
|
|
5
5
|
import { ReactComponent as SelectArrow } from "../../../assets/iframe/selectArrow.svg";
|
|
6
6
|
import { CalendarSelect } from "../CalendarSelect";
|
|
7
|
-
import {
|
|
7
|
+
import { isDateDisabled } from "../../utils";
|
|
8
8
|
import { CalendarProps } from "../../Calendar";
|
|
9
9
|
|
|
10
10
|
type CalendarButtonsProps = Pick<
|
|
@@ -66,7 +66,7 @@ export const CalendarButtons = ({
|
|
|
66
66
|
const onTodayClick = () => {
|
|
67
67
|
setCurrentDate(initialDate);
|
|
68
68
|
|
|
69
|
-
if (
|
|
69
|
+
if (isDateDisabled(initialDate, disabledDates)) return;
|
|
70
70
|
|
|
71
71
|
setSelectedDate(initialDate);
|
|
72
72
|
};
|
|
@@ -75,7 +75,7 @@ export const CalendarButtons = ({
|
|
|
75
75
|
const nextDate = initialDate.set({ day: initialDate.day + 1 });
|
|
76
76
|
setCurrentDate(nextDate);
|
|
77
77
|
|
|
78
|
-
if (
|
|
78
|
+
if (isDateDisabled(nextDate, disabledDates)) return;
|
|
79
79
|
|
|
80
80
|
setSelectedDate(nextDate);
|
|
81
81
|
};
|
|
@@ -2,7 +2,7 @@ import React, { useMemo } from "react";
|
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
3
|
import { DateTimeButton, Variant } from "../../../date-time-button";
|
|
4
4
|
import { CalendarWeekdays } from "../CalendarWeekdays";
|
|
5
|
-
import {
|
|
5
|
+
import { isDateDisabled } from "../../utils";
|
|
6
6
|
import { CalendarProps } from "../../Calendar";
|
|
7
7
|
|
|
8
8
|
export type CalendarDatesProps = Omit<
|
|
@@ -19,6 +19,8 @@ export const CalendarDates = ({
|
|
|
19
19
|
fromPrice,
|
|
20
20
|
getAvailability,
|
|
21
21
|
includeAvailability,
|
|
22
|
+
shouldCalculateResources,
|
|
23
|
+
availableTimes,
|
|
22
24
|
}: CalendarDatesProps) => {
|
|
23
25
|
const fillCalendarDates = useMemo(() => {
|
|
24
26
|
let firstDayOfWeek = calendarDates[0]?.weekday ?? 0;
|
|
@@ -45,7 +47,7 @@ export const CalendarDates = ({
|
|
|
45
47
|
if (date === null) return <div />;
|
|
46
48
|
|
|
47
49
|
const isDisabled =
|
|
48
|
-
isLoading ||
|
|
50
|
+
isLoading || isDateDisabled(date, disabledDates, availableTimes);
|
|
49
51
|
|
|
50
52
|
return (
|
|
51
53
|
<DateTimeButton
|
|
@@ -60,6 +62,7 @@ export const CalendarDates = ({
|
|
|
60
62
|
resources={getAvailability?.(date)}
|
|
61
63
|
showResources={includeAvailability}
|
|
62
64
|
variant={Variant.month}
|
|
65
|
+
shouldCalculateResources={shouldCalculateResources}
|
|
63
66
|
/>
|
|
64
67
|
);
|
|
65
68
|
})}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { DateTime, Interval } from "luxon";
|
|
2
2
|
import isEqual from "lodash/isEqual";
|
|
3
|
+
import { DATE_FORMAT } from "@licklist/core/dist/Config";
|
|
4
|
+
import { AvailableTimes } from "../Calendar";
|
|
3
5
|
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
disabledDates: DateTime[] = []
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const isDateDisabled = (
|
|
7
|
+
date: DateTime,
|
|
8
|
+
disabledDates: DateTime[] = [],
|
|
9
|
+
availableTimes?: AvailableTimes
|
|
10
|
+
): boolean => {
|
|
11
|
+
const disabledByDates = !!disabledDates.find((disabledDate) =>
|
|
12
|
+
isEqual(disabledDate.toObject(), date.toObject())
|
|
10
13
|
);
|
|
14
|
+
|
|
15
|
+
const noAvailableTimes = availableTimes
|
|
16
|
+
? !availableTimes?.[date.toFormat(DATE_FORMAT)]
|
|
17
|
+
: false;
|
|
18
|
+
|
|
19
|
+
return disabledByDates || noAvailableTimes;
|
|
11
20
|
};
|
|
12
21
|
|
|
13
22
|
export const getMonthCalendarDates = (initialDate: DateTime): DateTime[] => {
|
|
@@ -2,6 +2,7 @@ import React, { ReactElement } from "react";
|
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
4
|
import { ZoneResourcesAvailability } from "@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper";
|
|
5
|
+
import { has } from "lodash";
|
|
5
6
|
import { AvailabilityIndicator } from "../availability-indicator";
|
|
6
7
|
import { DateContent } from "./DateContent";
|
|
7
8
|
|
|
@@ -18,8 +19,9 @@ export type DateTimeButtonProps = {
|
|
|
18
19
|
isSoldOut?: boolean;
|
|
19
20
|
onSelect: (date: DateTime) => void;
|
|
20
21
|
price?: string | number | ReactElement | null;
|
|
21
|
-
resources
|
|
22
|
+
resources: ZoneResourcesAvailability | null | undefined;
|
|
22
23
|
showResources?: boolean;
|
|
24
|
+
shouldCalculateResources?: boolean;
|
|
23
25
|
variant: Variant;
|
|
24
26
|
};
|
|
25
27
|
|
|
@@ -32,17 +34,28 @@ export const DateTimeButton = ({
|
|
|
32
34
|
price,
|
|
33
35
|
resources,
|
|
34
36
|
showResources,
|
|
37
|
+
shouldCalculateResources = true,
|
|
35
38
|
variant = Variant.week,
|
|
36
39
|
}: DateTimeButtonProps) => {
|
|
37
40
|
const isSoldOut =
|
|
38
41
|
_isSoldOut ||
|
|
39
|
-
|
|
42
|
+
// only consider resources if shouldCalculateResources is true
|
|
43
|
+
(shouldCalculateResources &&
|
|
44
|
+
resources &&
|
|
45
|
+
resources.bookedResources >= resources.totalResources);
|
|
40
46
|
|
|
41
47
|
const isTimeVariant = variant === Variant.time;
|
|
42
48
|
|
|
43
49
|
const isTimeInPast = isTimeVariant && isDateInPast(date);
|
|
44
50
|
|
|
45
|
-
const
|
|
51
|
+
const noResources =
|
|
52
|
+
shouldCalculateResources &&
|
|
53
|
+
// only consider resources if shouldCalculateResources is true
|
|
54
|
+
(!resources ||
|
|
55
|
+
!has(resources, "bookedResources") ||
|
|
56
|
+
!has(resources, "totalResources"));
|
|
57
|
+
|
|
58
|
+
const isDisabled = _isDisabled || isSoldOut || isTimeInPast || noResources;
|
|
46
59
|
|
|
47
60
|
return (
|
|
48
61
|
<button
|
|
@@ -27,7 +27,7 @@ export function EventBookingProducts({
|
|
|
27
27
|
<AccordionItem
|
|
28
28
|
key={productsCategory.id}
|
|
29
29
|
eventKey={`${productsCategory.id}`}
|
|
30
|
-
|
|
30
|
+
productCategoryId={productsCategory.id}
|
|
31
31
|
name={productsCategory.name}
|
|
32
32
|
products={productsCategory.products}
|
|
33
33
|
order={order}
|
|
@@ -24,7 +24,7 @@ interface AccordionItemProps {
|
|
|
24
24
|
products: Product[];
|
|
25
25
|
setOrder: SetOrderFn;
|
|
26
26
|
order: Record<number, OrderItem>;
|
|
27
|
-
|
|
27
|
+
productCategoryId: number;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function CustomToggle({
|
|
@@ -60,7 +60,7 @@ export function AccordionItem({
|
|
|
60
60
|
order,
|
|
61
61
|
setOrder,
|
|
62
62
|
products,
|
|
63
|
-
|
|
63
|
+
productCategoryId,
|
|
64
64
|
}: AccordionItemProps) {
|
|
65
65
|
return (
|
|
66
66
|
<Card className="event-booking-products__card">
|
|
@@ -71,7 +71,7 @@ export function AccordionItem({
|
|
|
71
71
|
<ProductItem
|
|
72
72
|
key={product.id}
|
|
73
73
|
id={product.id}
|
|
74
|
-
|
|
74
|
+
productCategoryId={productCategoryId}
|
|
75
75
|
price={product.price}
|
|
76
76
|
name={product.name}
|
|
77
77
|
description={product.description}
|
|
@@ -92,7 +92,7 @@ interface ProductItemProps {
|
|
|
92
92
|
description: string;
|
|
93
93
|
order: OrderItems;
|
|
94
94
|
setOrder: SetOrderFn;
|
|
95
|
-
|
|
95
|
+
productCategoryId: OrderItem["productCategoryId"];
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function ProductItem({
|
|
@@ -102,7 +102,7 @@ function ProductItem({
|
|
|
102
102
|
description,
|
|
103
103
|
order,
|
|
104
104
|
setOrder,
|
|
105
|
-
|
|
105
|
+
productCategoryId,
|
|
106
106
|
}: ProductItemProps) {
|
|
107
107
|
const { formatNumber } = useIntl();
|
|
108
108
|
|
|
@@ -120,7 +120,7 @@ function ProductItem({
|
|
|
120
120
|
quantity: val,
|
|
121
121
|
name,
|
|
122
122
|
price,
|
|
123
|
-
|
|
123
|
+
productCategoryId,
|
|
124
124
|
},
|
|
125
125
|
}));
|
|
126
126
|
}}
|
|
@@ -132,7 +132,7 @@ function ProductItem({
|
|
|
132
132
|
quantity: prev[id]?.quantity - 1 || 0,
|
|
133
133
|
name,
|
|
134
134
|
price,
|
|
135
|
-
|
|
135
|
+
productCategoryId,
|
|
136
136
|
},
|
|
137
137
|
}))
|
|
138
138
|
}
|
|
@@ -144,7 +144,7 @@ function ProductItem({
|
|
|
144
144
|
quantity: prev[id]?.quantity + 1 || 1,
|
|
145
145
|
name,
|
|
146
146
|
price,
|
|
147
|
-
|
|
147
|
+
productCategoryId,
|
|
148
148
|
},
|
|
149
149
|
}))
|
|
150
150
|
}
|