@licklist/design 0.72.72-stage.0 → 0.72.72-stage.2
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/header/BookeditHeader.d.ts +1 -4
- package/dist/header/BookeditHeader.d.ts.map +1 -1
- package/dist/header/Header.d.ts +10 -2
- package/dist/header/Header.d.ts.map +1 -1
- package/dist/header/Header.js +31 -5
- package/dist/header/index.d.ts +2 -2
- package/dist/header/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/sales/coupon/form/CouponFrom.d.ts +2 -1
- package/dist/sales/coupon/form/CouponFrom.d.ts.map +1 -1
- package/dist/sales/coupon/form/CouponFrom.js +19 -6
- package/dist/setting/index.d.ts +0 -2
- package/dist/setting/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/header/BookeditHeader.tsx +1 -5
- package/src/header/Header.stories.tsx +39 -90
- package/src/header/Header.tsx +47 -9
- package/src/header/index.ts +2 -2
- package/src/sales/coupon/form/CouponFrom.tsx +20 -8
- package/src/setting/index.ts +0 -2
- package/yarn.lock +152 -142
- package/dist/assets/logo/licklist.sm.svg.js +0 -33
- package/dist/assets/logo/licklist.svg.js +0 -16
- package/dist/header/LicklistHeader.d.ts +0 -15
- package/dist/header/LicklistHeader.d.ts.map +0 -1
- package/dist/header/LicklistHeader.js +0 -23
- package/dist/setting/admin/AdminSettingForm.d.ts +0 -25
- package/dist/setting/admin/AdminSettingForm.d.ts.map +0 -1
- package/dist/setting/admin/AdminSettingForm.js +0 -220
- package/dist/setting/admin/PaymentFeeForm.d.ts +0 -13
- package/dist/setting/admin/PaymentFeeForm.d.ts.map +0 -1
- package/dist/setting/admin/PaymentFeeForm.js +0 -424
- package/dist/setting/admin/index.d.ts +0 -2
- package/dist/setting/admin/index.d.ts.map +0 -1
- package/dist/setting/system/SystemSettingForm.d.ts +0 -10
- package/dist/setting/system/SystemSettingForm.d.ts.map +0 -1
- package/dist/setting/system/SystemSettingForm.js +0 -95
- package/dist/setting/system/index.d.ts +0 -2
- package/dist/setting/system/index.d.ts.map +0 -1
- package/dist/types/currency.d.ts +0 -5
- package/dist/types/currency.d.ts.map +0 -1
- package/src/header/LicklistHeader.tsx +0 -46
- package/src/setting/admin/AdminSetting.stories.tsx +0 -52
- package/src/setting/admin/AdminSettingForm.tsx +0 -196
- package/src/setting/admin/PaymentFeeForm.tsx +0 -304
- package/src/setting/admin/index.ts +0 -1
- package/src/setting/system/SystemSetting.stories.tsx +0 -26
- package/src/setting/system/SystemSettingForm.tsx +0 -62
- package/src/setting/system/index.ts +0 -1
- package/src/types/currency.ts +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookeditHeader.d.ts","sourceRoot":"","sources":["../../src/header/BookeditHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"BookeditHeader.d.ts","sourceRoot":"","sources":["../../src/header/BookeditHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAEjD,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;IAC3B,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,SAAS,CAAA;CAC1E;AAED,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,sBAAsB,GACvB,EAAE,KAAK,2CAYP;AAED,eAAe,cAAc,CAAA"}
|
package/dist/header/Header.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
export type NavigationItem = {
|
|
3
3
|
href: string;
|
|
4
4
|
label: string;
|
|
5
|
-
|
|
5
|
+
pathname: string[];
|
|
6
|
+
} | {
|
|
7
|
+
label: string;
|
|
8
|
+
links: {
|
|
9
|
+
href: string;
|
|
10
|
+
label: string;
|
|
11
|
+
pathname: string[];
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
6
14
|
type Props = {
|
|
7
15
|
children?: ReactNode | ReactNode[];
|
|
8
16
|
href?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/header/Header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/header/Header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjC,MAAM,MAAM,cAAc,GACtB;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB,GACD;IACE,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,EAAE,CAAA;KACnB,EAAE,CAAA;CACJ,CAAA;AAEL,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAA;IAClC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;IAC3B,sBAAsB,CAAC,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,SAAS,CAAA;CAC1E,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,sBAAsB,GACvB,EAAE,KAAK,2CAmEP;AAED,eAAe,MAAM,CAAA"}
|
package/dist/header/Header.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { Accordion } from '@mantine/core';
|
|
2
3
|
import Nav from 'react-bootstrap/Nav';
|
|
3
4
|
import Navbar from 'react-bootstrap/Navbar';
|
|
5
|
+
import { NavLink } from 'react-router-dom';
|
|
4
6
|
|
|
5
7
|
function Header(param) {
|
|
6
8
|
var children = param.children, href = param.href, logo = param.logo, leftNavs = param.leftNavs, navItems = param.navItems, renderMobileNavigation = param.renderMobileNavigation;
|
|
@@ -39,12 +41,36 @@ function Header(param) {
|
|
|
39
41
|
id: "header-navbar-nav",
|
|
40
42
|
children: renderMobileNavigation ? renderMobileNavigation(navItems) : /*#__PURE__*/ jsx(Nav, {
|
|
41
43
|
className: "mr-auto",
|
|
42
|
-
children: navItems.map(function(
|
|
43
|
-
|
|
44
|
+
children: navItems.map(function(item) {
|
|
45
|
+
if ('links' in item) {
|
|
46
|
+
return /*#__PURE__*/ jsx(Accordion, {
|
|
47
|
+
defaultValue: "Apples",
|
|
48
|
+
children: /*#__PURE__*/ jsxs(Accordion.Item, {
|
|
49
|
+
value: item.label,
|
|
50
|
+
children: [
|
|
51
|
+
/*#__PURE__*/ jsx(Accordion.Control, {
|
|
52
|
+
children: item.label
|
|
53
|
+
}),
|
|
54
|
+
item.links.map(function(subItem) {
|
|
55
|
+
return /*#__PURE__*/ jsx(Accordion.Panel, {
|
|
56
|
+
children: /*#__PURE__*/ jsx(Nav.Item, {
|
|
57
|
+
children: /*#__PURE__*/ jsx(NavLink, {
|
|
58
|
+
exact: true,
|
|
59
|
+
to: subItem.href,
|
|
60
|
+
className: "nav-link",
|
|
61
|
+
children: subItem.label
|
|
62
|
+
})
|
|
63
|
+
}, "".concat(subItem.label, "-").concat(subItem.href))
|
|
64
|
+
}, subItem.href + subItem.label);
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
44
70
|
return /*#__PURE__*/ jsx(Nav.Link, {
|
|
45
|
-
href: href,
|
|
46
|
-
children: label
|
|
47
|
-
}, "".concat(href).concat(label));
|
|
71
|
+
href: item.href,
|
|
72
|
+
children: item.label
|
|
73
|
+
}, "".concat(item.href).concat(item.label));
|
|
48
74
|
})
|
|
49
75
|
})
|
|
50
76
|
})
|
package/dist/header/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BookeditHeader from './BookeditHeader';
|
|
2
|
-
import LicklistHeader from './LicklistHeader';
|
|
3
2
|
import Header from './Header';
|
|
4
3
|
export * from './elements';
|
|
5
|
-
export {
|
|
4
|
+
export { BookeditHeader, Header };
|
|
5
|
+
export type { NavigationItem } from './Header';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,MAAM,MAAM,UAAU,CAAA;AAE7B,cAAc,YAAY,CAAA;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,6 @@ export { EventStatisticModal } from './events/event-statistic-modal/EventStatist
|
|
|
30
30
|
export { EventVenueMap } from './events/event-venue-map/EventVenueMap.js';
|
|
31
31
|
export { FileUpload } from './file-upload/FileUpload.js';
|
|
32
32
|
export { default as BookeditHeader } from './header/BookeditHeader.js';
|
|
33
|
-
export { default as LicklistHeader } from './header/LicklistHeader.js';
|
|
34
33
|
export { default as Header } from './header/Header.js';
|
|
35
34
|
export { default as CompanySelector } from './header/elements/CompanySelector.js';
|
|
36
35
|
export { Example, ExampleContent, ExampleToggle } from './help/example/Example.js';
|
|
@@ -137,8 +136,6 @@ export { RyftPayment } from './sales/payment-form/components/RyftPayment/RyftPay
|
|
|
137
136
|
export { BookingResults } from './sales/booking/results/BookingResults.js';
|
|
138
137
|
export { BACKGROUND_COLOR_CLASSNAMES } from './sales/booking/results/constants.js';
|
|
139
138
|
export { NotesTable } from './sales/notes/NotesTable.js';
|
|
140
|
-
export { SystemSettingForm } from './setting/system/SystemSettingForm.js';
|
|
141
|
-
export { AdminSettingForm } from './setting/admin/AdminSettingForm.js';
|
|
142
139
|
export { DashboardSettingForm } from './setting/dashboard/DashboardSettingForm.js';
|
|
143
140
|
export { SnippetCard } from './setting/dashboard/snippets/card/SnippetCard.js';
|
|
144
141
|
export { SnippetTemplateCard } from './setting/dashboard/snippet-templates/card/SnippetTemplateCard.js';
|
|
@@ -23,9 +23,10 @@ export interface CouponFormProps {
|
|
|
23
23
|
productGroups?: ProductGroup[];
|
|
24
24
|
defaultValues?: CouponFormValues;
|
|
25
25
|
onSubmit: (values: CouponFormValues) => void;
|
|
26
|
+
onCancel: () => void;
|
|
26
27
|
isLoading?: boolean;
|
|
27
28
|
hasPermission: boolean;
|
|
28
29
|
serverErrors?: ServerError;
|
|
29
30
|
}
|
|
30
|
-
export declare const CouponForm: ({ onSubmit, defaultValues, isLoading, productGroups, hasPermission, serverErrors, }: CouponFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const CouponForm: ({ onSubmit, onCancel, defaultValues, isLoading, productGroups, hasPermission, serverErrors, }: CouponFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
//# sourceMappingURL=CouponFrom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CouponFrom.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/form/CouponFrom.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,eAAe,EAChB,MAAM,+DAA+D,CAAA;AACtE,OAAO,EACL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAA;AAIhE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;
|
|
1
|
+
{"version":3,"file":"CouponFrom.d.ts","sourceRoot":"","sources":["../../../../src/sales/coupon/form/CouponFrom.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,eAAe,EAChB,MAAM,+DAA+D,CAAA;AACtE,OAAO,EACL,eAAe,EACf,UAAU,EACX,MAAM,yDAAyD,CAAA;AAIhE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAI3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,UAAU,CAAA;IACxB,eAAe,EAAE,eAAe,EAAE,CAAA;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,eAAe,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAA;IAC9B,aAAa,CAAC,EAAE,gBAAgB,CAAA;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,WAAW,CAAA;CAC3B;AAED,eAAO,MAAM,UAAU,kGAQpB,eAAe,4CA6CjB,CAAA"}
|
|
@@ -59,7 +59,7 @@ function _object_spread_props(target, source) {
|
|
|
59
59
|
return target;
|
|
60
60
|
}
|
|
61
61
|
var CouponForm = function(param) {
|
|
62
|
-
var onSubmit = param.onSubmit, defaultValues = param.defaultValues, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, productGroups = param.productGroups, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? false : _param_hasPermission, serverErrors = param.serverErrors;
|
|
62
|
+
var onSubmit = param.onSubmit, onCancel = param.onCancel, defaultValues = param.defaultValues, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, productGroups = param.productGroups, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? false : _param_hasPermission, serverErrors = param.serverErrors;
|
|
63
63
|
var form = useForm({
|
|
64
64
|
defaultValues: defaultValues
|
|
65
65
|
});
|
|
@@ -85,11 +85,24 @@ var CouponForm = function(param) {
|
|
|
85
85
|
productGroups: productGroups,
|
|
86
86
|
isLoading: isLoading
|
|
87
87
|
}),
|
|
88
|
-
hasPermission && /*#__PURE__*/
|
|
89
|
-
className: "
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
hasPermission && /*#__PURE__*/ jsxs("div", {
|
|
89
|
+
className: "tw-flex tw-gap-4",
|
|
90
|
+
children: [
|
|
91
|
+
/*#__PURE__*/ jsx(Button, {
|
|
92
|
+
className: "d-md-block mt-5",
|
|
93
|
+
type: "submit",
|
|
94
|
+
disabled: isLoading,
|
|
95
|
+
children: t('save')
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ jsx(Button, {
|
|
98
|
+
className: "mt-5 d-md-block",
|
|
99
|
+
variant: "outline-primary",
|
|
100
|
+
type: "reset",
|
|
101
|
+
onClick: onCancel,
|
|
102
|
+
disabled: isLoading,
|
|
103
|
+
children: t('cancel')
|
|
104
|
+
})
|
|
105
|
+
]
|
|
93
106
|
})
|
|
94
107
|
]
|
|
95
108
|
})
|
package/dist/setting/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setting/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setting/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.72.72-stage.
|
|
3
|
+
"version": "0.72.72-stage.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@wojtekmaj/react-daterange-picker": "4.1.0",
|
|
95
95
|
"bootstrap": "4.6.0",
|
|
96
96
|
"bootstrap-social": "5.1.1",
|
|
97
|
-
"clsx": "
|
|
97
|
+
"clsx": "2.1.1",
|
|
98
98
|
"date-fns": "2.29.3",
|
|
99
99
|
"emojibase": "6.1.0",
|
|
100
100
|
"emojibase-data": "7.0.1",
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react'
|
|
2
2
|
import { ReactComponent as LogoSvg } from '../assets/logo/bookedit.svg'
|
|
3
3
|
import Logo from '../logo/Logo'
|
|
4
|
-
import Header from './Header'
|
|
4
|
+
import Header, { NavigationItem } from './Header'
|
|
5
5
|
|
|
6
|
-
interface NavigationItem {
|
|
7
|
-
href: string
|
|
8
|
-
label: string
|
|
9
|
-
}
|
|
10
6
|
interface Props {
|
|
11
7
|
children?: ReactNode | ReactNode[]
|
|
12
8
|
href?: string
|
|
@@ -1,87 +1,38 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import StyledButton from '../static/StyledButton'
|
|
3
3
|
import BookeditHeader from './BookeditHeader'
|
|
4
4
|
import CompanySelector from './elements/CompanySelector'
|
|
5
|
-
import
|
|
5
|
+
import { NavigationItem } from './Header'
|
|
6
6
|
|
|
7
|
-
const providerNavItems = [
|
|
8
|
-
{ href: `/profile`, label: 'profile' },
|
|
9
|
-
{ href: `/events`, label: 'events' },
|
|
10
|
-
{ href: `/sales`, label: 'salesAndEnquiries' },
|
|
11
|
-
{ href: `/product-sets`, label: 'productSets' },
|
|
12
|
-
{ href: `/affiliates`, label: 'affiliates' },
|
|
13
|
-
{ href: `/product-groups`, label: 'productGroups' },
|
|
14
|
-
{ href: '/#', label: 'loyalty' },
|
|
15
|
-
{ href: '/#', label: 'emailAndSms' },
|
|
16
|
-
{ href: '/#', label: 'followersAndProfiles' },
|
|
7
|
+
const providerNavItems: NavigationItem[] = [
|
|
8
|
+
{ href: `/profile`, label: 'profile', pathname: [] },
|
|
9
|
+
{ href: `/events`, label: 'events', pathname: [] },
|
|
10
|
+
{ href: `/sales`, label: 'salesAndEnquiries', pathname: [] },
|
|
11
|
+
{ href: `/product-sets`, label: 'productSets', pathname: [] },
|
|
12
|
+
{ href: `/affiliates`, label: 'affiliates', pathname: [] },
|
|
13
|
+
{ href: `/product-groups`, label: 'productGroups', pathname: [] },
|
|
14
|
+
{ href: '/#', label: 'loyalty', pathname: [] },
|
|
15
|
+
{ href: '/#', label: 'emailAndSms', pathname: [] },
|
|
16
|
+
{ href: '/#', label: 'followersAndProfiles', pathname: [] },
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
20
|
title: 'Header',
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export const Licklist = () => (
|
|
24
|
-
<>
|
|
25
|
-
<LicklistHeader
|
|
26
|
-
leftNavs={
|
|
27
|
-
<>
|
|
28
|
-
<ul className='navbar-nav bd-navbar-nav flex-row navbar-nav-primary'>
|
|
29
|
-
<li className='nav-item px-3 px-sm-3 px-lg-4'>
|
|
30
|
-
<Nav.Link href='#'>
|
|
31
|
-
<FaSearch />
|
|
32
|
-
</Nav.Link>
|
|
33
|
-
</li>
|
|
34
|
-
<li className='nav-item px-3 px-sm-4 d-none d-sm-inline'>
|
|
35
|
-
<Nav.Link href='#' className='nav-link-light-grey'>
|
|
36
|
-
Explore
|
|
37
|
-
</Nav.Link>
|
|
38
|
-
</li>
|
|
39
|
-
<li className='nav-item px-3 px-sm-4 d-none d-sm-inline'>
|
|
40
|
-
<Nav.Link href='#' className=''>
|
|
41
|
-
Galleries
|
|
42
|
-
</Nav.Link>
|
|
43
|
-
</li>
|
|
44
|
-
</ul>
|
|
45
|
-
</>
|
|
46
|
-
}
|
|
47
|
-
>
|
|
48
|
-
<StyledButton size='sm' className='rounded-pill mr-2'>
|
|
49
|
-
Login
|
|
50
|
-
</StyledButton>
|
|
51
|
-
<StyledButton
|
|
52
|
-
size='sm'
|
|
53
|
-
className='rounded-pill'
|
|
54
|
-
variant='outline-secondary'
|
|
55
|
-
>
|
|
56
|
-
Sign up
|
|
57
|
-
</StyledButton>
|
|
58
|
-
</LicklistHeader>
|
|
59
|
-
</>
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
Licklist.story = {
|
|
63
|
-
parameters: {
|
|
64
|
-
info: `
|
|
65
|
-
Licklist header component
|
|
66
|
-
`,
|
|
67
|
-
},
|
|
68
|
-
}
|
|
69
|
-
|
|
70
23
|
export const Bookedit = () => (
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</BookeditHeader>
|
|
84
|
-
</>
|
|
24
|
+
<BookeditHeader navItems={providerNavItems}>
|
|
25
|
+
<StyledButton size='sm' className='rounded-pill mr-2'>
|
|
26
|
+
Login
|
|
27
|
+
</StyledButton>
|
|
28
|
+
<StyledButton
|
|
29
|
+
size='sm'
|
|
30
|
+
className='rounded-pill'
|
|
31
|
+
variant='outline-secondary'
|
|
32
|
+
>
|
|
33
|
+
Sign up
|
|
34
|
+
</StyledButton>
|
|
35
|
+
</BookeditHeader>
|
|
85
36
|
)
|
|
86
37
|
|
|
87
38
|
Bookedit.story = {
|
|
@@ -93,23 +44,21 @@ Bookedit.story = {
|
|
|
93
44
|
}
|
|
94
45
|
|
|
95
46
|
export const BookeditWithElements = () => (
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/>
|
|
112
|
-
</>
|
|
47
|
+
<BookeditHeader
|
|
48
|
+
leftNavs={
|
|
49
|
+
<div className='header-elements'>
|
|
50
|
+
<CompanySelector
|
|
51
|
+
value={1}
|
|
52
|
+
list={[
|
|
53
|
+
{ id: 1, title: 'Company #1' },
|
|
54
|
+
{ id: 2, title: 'Company #2' },
|
|
55
|
+
]}
|
|
56
|
+
onChange={() => null}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
}
|
|
60
|
+
navItems={providerNavItems}
|
|
61
|
+
/>
|
|
113
62
|
)
|
|
114
63
|
|
|
115
64
|
BookeditWithElements.story = {
|
package/src/header/Header.tsx
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
import { Accordion } from '@mantine/core'
|
|
1
2
|
import { ReactNode } from 'react'
|
|
2
3
|
import Nav from 'react-bootstrap/Nav'
|
|
3
4
|
import Navbar from 'react-bootstrap/Navbar'
|
|
5
|
+
import { NavLink } from 'react-router-dom'
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export type NavigationItem =
|
|
8
|
+
| {
|
|
9
|
+
href: string
|
|
10
|
+
label: string
|
|
11
|
+
pathname: string[]
|
|
12
|
+
}
|
|
13
|
+
| {
|
|
14
|
+
label: string
|
|
15
|
+
links: {
|
|
16
|
+
href: string
|
|
17
|
+
label: string
|
|
18
|
+
pathname: string[]
|
|
19
|
+
}[]
|
|
20
|
+
}
|
|
9
21
|
|
|
10
22
|
type Props = {
|
|
11
23
|
children?: ReactNode | ReactNode[]
|
|
@@ -53,11 +65,37 @@ function Header({
|
|
|
53
65
|
renderMobileNavigation(navItems)
|
|
54
66
|
) : (
|
|
55
67
|
<Nav className='mr-auto'>
|
|
56
|
-
{navItems.map((
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
{navItems.map((item) => {
|
|
69
|
+
if ('links' in item) {
|
|
70
|
+
return (
|
|
71
|
+
<Accordion defaultValue='Apples'>
|
|
72
|
+
<Accordion.Item value={item.label}>
|
|
73
|
+
<Accordion.Control>{item.label}</Accordion.Control>
|
|
74
|
+
{item.links.map((subItem) => (
|
|
75
|
+
<Accordion.Panel key={subItem.href + subItem.label}>
|
|
76
|
+
<Nav.Item key={`${subItem.label}-${subItem.href}`}>
|
|
77
|
+
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
|
|
78
|
+
{/* @ts-ignore */}
|
|
79
|
+
<NavLink
|
|
80
|
+
exact
|
|
81
|
+
to={subItem.href}
|
|
82
|
+
className='nav-link'
|
|
83
|
+
>
|
|
84
|
+
{subItem.label}
|
|
85
|
+
</NavLink>
|
|
86
|
+
</Nav.Item>
|
|
87
|
+
</Accordion.Panel>
|
|
88
|
+
))}
|
|
89
|
+
</Accordion.Item>
|
|
90
|
+
</Accordion>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
return (
|
|
94
|
+
<Nav.Link href={item.href} key={`${item.href}${item.label}`}>
|
|
95
|
+
{item.label}
|
|
96
|
+
</Nav.Link>
|
|
97
|
+
)
|
|
98
|
+
})}
|
|
61
99
|
</Nav>
|
|
62
100
|
)}
|
|
63
101
|
</Navbar.Collapse>
|
package/src/header/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BookeditHeader from './BookeditHeader'
|
|
2
|
-
import LicklistHeader from './LicklistHeader'
|
|
3
2
|
import Header from './Header'
|
|
4
3
|
|
|
5
4
|
export * from './elements'
|
|
6
5
|
|
|
7
|
-
export {
|
|
6
|
+
export { BookeditHeader, Header }
|
|
7
|
+
export type { NavigationItem } from './Header'
|
|
@@ -12,7 +12,6 @@ import { useForm, FormProvider } from 'react-hook-form'
|
|
|
12
12
|
import { useTranslation } from 'react-i18next'
|
|
13
13
|
import { ServerError } from '@licklist/plugins/dist/hooks/Api/useHttpQuery'
|
|
14
14
|
import FormErrorService from '@licklist/plugins/dist/services/Form/FormErrorService'
|
|
15
|
-
|
|
16
15
|
import { CouponFormControl } from '../control'
|
|
17
16
|
|
|
18
17
|
export interface CouponFormValues {
|
|
@@ -38,6 +37,7 @@ export interface CouponFormProps {
|
|
|
38
37
|
productGroups?: ProductGroup[]
|
|
39
38
|
defaultValues?: CouponFormValues
|
|
40
39
|
onSubmit: (values: CouponFormValues) => void
|
|
40
|
+
onCancel: () => void
|
|
41
41
|
isLoading?: boolean
|
|
42
42
|
hasPermission: boolean
|
|
43
43
|
serverErrors?: ServerError
|
|
@@ -45,6 +45,7 @@ export interface CouponFormProps {
|
|
|
45
45
|
|
|
46
46
|
export const CouponForm = ({
|
|
47
47
|
onSubmit,
|
|
48
|
+
onCancel,
|
|
48
49
|
defaultValues,
|
|
49
50
|
isLoading = false,
|
|
50
51
|
productGroups,
|
|
@@ -73,13 +74,24 @@ export const CouponForm = ({
|
|
|
73
74
|
isLoading={isLoading}
|
|
74
75
|
/>
|
|
75
76
|
{hasPermission && (
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
<div className='tw-flex tw-gap-4'>
|
|
78
|
+
<Button
|
|
79
|
+
className='d-md-block mt-5'
|
|
80
|
+
type='submit'
|
|
81
|
+
disabled={isLoading}
|
|
82
|
+
>
|
|
83
|
+
{t('save')}
|
|
84
|
+
</Button>
|
|
85
|
+
<Button
|
|
86
|
+
className='mt-5 d-md-block'
|
|
87
|
+
variant='outline-primary'
|
|
88
|
+
type='reset'
|
|
89
|
+
onClick={onCancel}
|
|
90
|
+
disabled={isLoading}
|
|
91
|
+
>
|
|
92
|
+
{t('cancel')}
|
|
93
|
+
</Button>
|
|
94
|
+
</div>
|
|
83
95
|
)}
|
|
84
96
|
</Form>
|
|
85
97
|
</FormProvider>
|
package/src/setting/index.ts
CHANGED