@licklist/design 0.75.0 → 0.75.1-dev.1
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/affiliate/form/AffiliateForm.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.js +2 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +0 -6
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +2 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +0 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +2 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.js +2 -1
- package/dist/events/event-statistic-modal/utils/index.js +3 -3
- package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
- package/dist/events/event-venue-map/EventVenueMap.js +1 -0
- package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.js +11 -4
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +2 -3
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +4 -11
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +13 -0
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +4 -5
- package/dist/index.js +0 -1
- package/dist/layout/DropDown.d.ts +2 -1
- package/dist/layout/DropDown.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +3 -0
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +5 -3
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductZonesControl.js +0 -2
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +4 -3
- package/dist/product-set/form/StepsControl.d.ts.map +1 -1
- package/dist/product-set/form/StepsControl.js +2 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +0 -3
- package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
- package/dist/product-set/form/VenueMapsControl.js +0 -3
- package/dist/product-set/form/context.d.ts +1 -2
- package/dist/product-set/form/context.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts +2 -0
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +7 -0
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +6 -0
- package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
- package/dist/product-set/product/deposit/ProductDepositControl.js +3 -0
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +6 -0
- package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +3 -0
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +4 -1
- package/dist/product-set/product/scanRange/ProductScanRangeControl.d.ts +12 -0
- package/dist/product-set/product/scanRange/ProductScanRangeControl.d.ts.map +1 -0
- package/dist/product-set/product/scanRange/ProductScanRangeControl.js +153 -0
- package/dist/product-set/product/scanRange/index.d.ts +2 -0
- package/dist/product-set/product/scanRange/index.d.ts.map +1 -0
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
- package/dist/product-set/utils/index.d.ts +3 -1
- package/dist/product-set/utils/index.d.ts.map +1 -1
- package/dist/provider/index.d.ts +0 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.js +3 -0
- package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.js +3 -0
- package/dist/resource/form/components/SortControl.d.ts.map +1 -1
- package/dist/resource/form/components/SortControl.js +3 -0
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +0 -2
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +21 -0
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.js +3 -0
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +3 -0
- package/dist/static/number-input/NumberInput.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.js +3 -0
- package/dist/styles/iframe-events/Calendar.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/product-set/ProductSetForm.scss +2 -3
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
- package/dist/zone/form/components/GameDurationControl.js +3 -0
- package/dist/zone/form/components/SortControl.d.ts.map +1 -1
- package/dist/zone/form/components/SortControl.js +3 -0
- package/package.json +8 -6
- package/src/affiliate/form/AffiliateForm.tsx +1 -0
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +12 -7
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +3 -1
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +2 -1
- package/src/events/event-statistic-modal/utils/index.ts +4 -4
- package/src/events/event-venue-map/EventVenueMap.tsx +1 -0
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +5 -1
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +2 -2
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +5 -13
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +1 -0
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +9 -0
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +1 -0
- package/src/iframe/ryft/utils/ryft-form.ts +6 -5
- package/src/layout/DropDown.tsx +1 -1
- package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
- package/src/product-set/control/ProductSetControl.tsx +11 -8
- package/src/product-set/form/ProductSetForm.tsx +7 -6
- package/src/product-set/form/ProductZonesControl.tsx +1 -4
- package/src/product-set/form/ProductsControl.tsx +3 -9
- package/src/product-set/form/StepsControl.tsx +1 -3
- package/src/product-set/form/SubProductsControl.tsx +0 -3
- package/src/product-set/form/VenueMapsControl.tsx +0 -3
- package/src/product-set/form/context.tsx +2 -5
- package/src/product-set/product/ProductControl.tsx +19 -17
- package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
- package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +2 -0
- package/src/product-set/product/deposit/ProductDepositControl.tsx +1 -0
- package/src/product-set/product/duration/ProductDurationControl.tsx +2 -0
- package/src/product-set/product/price/ProductPriceControl.tsx +1 -0
- package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +1 -0
- package/src/product-set/product/scanRange/ProductScanRangeControl.stories.ts +45 -0
- package/src/product-set/product/scanRange/ProductScanRangeControl.tsx +163 -0
- package/src/product-set/product/scanRange/index.ts +1 -0
- package/src/product-set/product-category/ProductCategoryControl.tsx +4 -0
- package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
- package/src/provider/index.ts +0 -1
- package/src/recurrence-input/RecurrenceEndInput.tsx +1 -0
- package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +1 -0
- package/src/resource/form/components/CapacityControl.tsx +1 -0
- package/src/resource/form/components/SortControl.tsx +1 -0
- package/src/sales/booking/results/components/ResultCard.tsx +0 -2
- package/src/sales/coupon/control/CouponFormControl.tsx +7 -0
- package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
- package/src/sortable-tree/SortableTreeItem.tsx +1 -6
- package/src/static/CurrencyNumberInput.tsx +1 -0
- package/src/static/form-number-input/FormNumberInput.tsx +1 -0
- package/src/static/number-input/NumberInput.tsx +1 -0
- package/src/styles/iframe-events/Calendar.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/product-set/ProductSetForm.scss +2 -3
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/components/GameDurationControl.tsx +1 -0
- package/src/zone/form/components/SortControl.tsx +1 -0
- package/yarn.lock +183 -183
- package/dist/assets/dashboard/managerRole.svg.js +0 -18
- package/dist/assets/dashboard/subManagerRole.svg.js +0 -24
- package/dist/assets/dashboard/viewerRole.svg.js +0 -24
- package/dist/provider/company/index.d.ts +0 -2
- package/dist/provider/company/index.d.ts.map +0 -1
- package/dist/provider/company/user-form/UserForm.d.ts +0 -17
- package/dist/provider/company/user-form/UserForm.d.ts.map +0 -1
- package/dist/provider/company/user-form/UserForm.js +0 -205
- package/dist/provider/company/user-form/index.d.ts +0 -2
- package/dist/provider/company/user-form/index.d.ts.map +0 -1
- package/src/provider/company/index.ts +0 -1
- package/src/provider/company/user-form/UserForm.stories.tsx +0 -18
- package/src/provider/company/user-form/UserForm.tsx +0 -151
- package/src/provider/company/user-form/index.ts +0 -1
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
var _path;
|
|
4
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
|
-
const SvgManagerRole = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width: 48,
|
|
8
|
-
height: 48,
|
|
9
|
-
fill: "none"
|
|
10
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
-
stroke: "#000",
|
|
12
|
-
strokeLinecap: "round",
|
|
13
|
-
strokeLinejoin: "round",
|
|
14
|
-
strokeWidth: 2,
|
|
15
|
-
d: "M35.936 23.36 39.018 30h5.958a1.47 1.47 0 0 1 1.036 2.566l-5.164 5.124 2.884 6.628a1.571 1.571 0 0 1-2.238 1.964l-6.972-3.922-6.974 3.922a1.572 1.572 0 0 1-2.238-1.964l2.89-6.622-5.2-5.124A1.468 1.468 0 0 1 24.018 30h6l3.088-6.646a1.6 1.6 0 0 1 2.83.006M23.664 23.466A12.04 12.04 0 0 0 13.5 18a12 12 0 0 0-12 10.5M6.75 8.25a6.75 6.75 0 1 0 13.5 0 6.75 6.75 0 0 0-13.5 0M27.75 6.75a5.25 5.25 0 1 0 10.5 0 5.25 5.25 0 0 0-10.5 0M40.8 18a9 9 0 0 0-14.568-1.42"
|
|
16
|
-
})));
|
|
17
|
-
|
|
18
|
-
export { SvgManagerRole as ReactComponent };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
var _path, _path2;
|
|
4
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
|
-
const SvgSubManagerRole = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width: 48,
|
|
8
|
-
height: 48,
|
|
9
|
-
fill: "none"
|
|
10
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
-
stroke: "#000",
|
|
12
|
-
strokeLinecap: "round",
|
|
13
|
-
strokeLinejoin: "round",
|
|
14
|
-
strokeWidth: 2,
|
|
15
|
-
d: "M31.5 33a3 3 0 1 0 6 0 3 3 0 0 0-6 0"
|
|
16
|
-
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
17
|
-
stroke: "#000",
|
|
18
|
-
strokeLinecap: "round",
|
|
19
|
-
strokeLinejoin: "round",
|
|
20
|
-
strokeWidth: 2,
|
|
21
|
-
d: "m37.048 21.4.884 2.906a1.986 1.986 0 0 0 2.346 1.362l2.946-.684a2.678 2.678 0 0 1 2.548 4.438l-2.06 2.222a2 2 0 0 0 0 2.724l2.06 2.222a2.676 2.676 0 0 1-2.548 4.436l-2.946-.682a1.984 1.984 0 0 0-2.346 1.362l-.884 2.894a2.662 2.662 0 0 1-5.098 0l-.884-2.904a1.984 1.984 0 0 0-2.346-1.362l-2.946.682a2.676 2.676 0 0 1-2.548-4.436l2.06-2.222a2 2 0 0 0 0-2.724l-2.06-2.222a2.678 2.678 0 0 1 2.548-4.438l2.946.684a1.986 1.986 0 0 0 2.346-1.362l.884-2.906a2.662 2.662 0 0 1 5.098.01M20.512 20.2A12.13 12.13 0 0 0 13.5 18a12 12 0 0 0-12 10.5M6.75 8.25a6.75 6.75 0 1 0 13.5 0 6.75 6.75 0 0 0-13.5 0M27.75 6.75a5.25 5.25 0 1 0 10.5 0 5.25 5.25 0 0 0-10.5 0M39.052 15.842a9 9 0 0 0-12.828.738"
|
|
22
|
-
})));
|
|
23
|
-
|
|
24
|
-
export { SvgSubManagerRole as ReactComponent };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
var _path, _path2;
|
|
4
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
|
-
const SvgViewerRole = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
6
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
-
width: 48,
|
|
8
|
-
height: 48,
|
|
9
|
-
fill: "none"
|
|
10
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
-
stroke: "#000",
|
|
12
|
-
strokeLinecap: "round",
|
|
13
|
-
strokeLinejoin: "round",
|
|
14
|
-
strokeWidth: 2,
|
|
15
|
-
d: "M34.998 32.001c-4.3-.072-8.746 2.933-11.542 6.01a1.774 1.774 0 0 0 0 2.374c2.735 3.013 7.169 6.087 11.542 6.013 4.374.074 8.809-3 11.546-6.013a1.774 1.774 0 0 0 0-2.374c-2.799-3.077-7.246-6.082-11.546-6.01"
|
|
16
|
-
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
17
|
-
stroke: "#000",
|
|
18
|
-
strokeLinecap: "round",
|
|
19
|
-
strokeLinejoin: "round",
|
|
20
|
-
strokeWidth: 2,
|
|
21
|
-
d: "M38.999 39.2a4 4 0 1 1-8.001-.002 4 4 0 0 1 8 .002M20.512 20.2A12.13 12.13 0 0 0 13.5 18a12 12 0 0 0-12 10.5M6.75 8.25a6.75 6.75 0 1 0 13.5 0 6.75 6.75 0 0 0-13.5 0M27.75 6.75a5.25 5.25 0 1 0 10.5 0 5.25 5.25 0 0 0-10.5 0M39.052 15.842a9 9 0 0 0-12.828.738"
|
|
22
|
-
})));
|
|
23
|
-
|
|
24
|
-
export { SvgViewerRole as ReactComponent };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/company/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { User } from '@licklist/core/dist/DataMapper/User/UserDataMapper';
|
|
2
|
-
import { VIEWER_ROLE, MANAGER_ROLE, SUBMANAGER_ROLE } from '@licklist/core/dist/DataMapper/User/UserRoleDataMapper';
|
|
3
|
-
export type UserFormValues = {
|
|
4
|
-
email?: User['email'];
|
|
5
|
-
role?: typeof VIEWER_ROLE | typeof MANAGER_ROLE | typeof SUBMANAGER_ROLE;
|
|
6
|
-
};
|
|
7
|
-
export type UserFormProps = {
|
|
8
|
-
defaultValues?: UserFormValues;
|
|
9
|
-
onSubmit: (values: {
|
|
10
|
-
email: User['email'];
|
|
11
|
-
role: typeof VIEWER_ROLE | typeof MANAGER_ROLE | typeof SUBMANAGER_ROLE;
|
|
12
|
-
}) => void;
|
|
13
|
-
isLoading?: boolean;
|
|
14
|
-
hasPermission: boolean;
|
|
15
|
-
};
|
|
16
|
-
export declare const UserForm: ({ defaultValues, onSubmit, isLoading, hasPermission, }: UserFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
//# sourceMappingURL=UserForm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserForm.d.ts","sourceRoot":"","sources":["../../../../src/provider/company/user-form/UserForm.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,oDAAoD,CAAA;AACzE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EAChB,MAAM,wDAAwD,CAAA;AAQ/D,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,WAAW,GAAG,OAAO,YAAY,GAAG,OAAO,eAAe,CAAA;CACzE,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,cAAc,CAAA;IAC9B,QAAQ,EAAE,CAAC,MAAM,EAAE;QACjB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACpB,IAAI,EAAE,OAAO,WAAW,GAAG,OAAO,YAAY,GAAG,OAAO,eAAe,CAAA;KACxE,KAAK,IAAI,CAAA;IACV,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,QAAQ,2DAKlB,aAAa,4CAiHf,CAAA"}
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Form, Row, Col, Button } from 'react-bootstrap';
|
|
3
|
-
import { useForm, Controller } from 'react-hook-form';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import { MANAGER_ROLE, SUBMANAGER_ROLE, VIEWER_ROLE } from '@licklist/core/dist/DataMapper/User/UserRoleDataMapper';
|
|
7
|
-
import emailRule from '@licklist/plugins/dist/validation/Rules/emailRule';
|
|
8
|
-
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService';
|
|
9
|
-
import Logo from '../../../logo/Logo.js';
|
|
10
|
-
import { ReactComponent as SvgManagerRole } from '../../../assets/dashboard/managerRole.svg.js';
|
|
11
|
-
import { ReactComponent as SvgSubManagerRole } from '../../../assets/dashboard/subManagerRole.svg.js';
|
|
12
|
-
import { ReactComponent as SvgViewerRole } from '../../../assets/dashboard/viewerRole.svg.js';
|
|
13
|
-
|
|
14
|
-
function _define_property(obj, key, value) {
|
|
15
|
-
if (key in obj) {
|
|
16
|
-
Object.defineProperty(obj, key, {
|
|
17
|
-
value: value,
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true
|
|
21
|
-
});
|
|
22
|
-
} else {
|
|
23
|
-
obj[key] = value;
|
|
24
|
-
}
|
|
25
|
-
return obj;
|
|
26
|
-
}
|
|
27
|
-
function _object_spread(target) {
|
|
28
|
-
for(var i = 1; i < arguments.length; i++){
|
|
29
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
30
|
-
var ownKeys = Object.keys(source);
|
|
31
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
32
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
33
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
ownKeys.forEach(function(key) {
|
|
37
|
-
_define_property(target, key, source[key]);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return target;
|
|
41
|
-
}
|
|
42
|
-
function ownKeys(object, enumerableOnly) {
|
|
43
|
-
var keys = Object.keys(object);
|
|
44
|
-
if (Object.getOwnPropertySymbols) {
|
|
45
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
46
|
-
if (enumerableOnly) {
|
|
47
|
-
symbols = symbols.filter(function(sym) {
|
|
48
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
keys.push.apply(keys, symbols);
|
|
52
|
-
}
|
|
53
|
-
return keys;
|
|
54
|
-
}
|
|
55
|
-
function _object_spread_props(target, source) {
|
|
56
|
-
source = source != null ? source : {};
|
|
57
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
58
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
59
|
-
} else {
|
|
60
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
61
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return target;
|
|
65
|
-
}
|
|
66
|
-
var UserForm = function(param) {
|
|
67
|
-
var _param_defaultValues = param.defaultValues, defaultValues = _param_defaultValues === void 0 ? {} : _param_defaultValues, onSubmit = param.onSubmit, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, hasPermission = param.hasPermission;
|
|
68
|
-
var t = useTranslation([
|
|
69
|
-
'Design',
|
|
70
|
-
'User',
|
|
71
|
-
'Validation'
|
|
72
|
-
]).t;
|
|
73
|
-
var _useForm = useForm({
|
|
74
|
-
defaultValues: defaultValues
|
|
75
|
-
}), control = _useForm.control, register = _useForm.register, handleSubmit = _useForm.handleSubmit, errors = _useForm.formState.errors;
|
|
76
|
-
var rolesOptions = [
|
|
77
|
-
{
|
|
78
|
-
value: MANAGER_ROLE,
|
|
79
|
-
label: t('Design:manager'),
|
|
80
|
-
description: t('Design:managerAccessMessage'),
|
|
81
|
-
component: /*#__PURE__*/ jsx(SvgManagerRole, {})
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
value: SUBMANAGER_ROLE,
|
|
85
|
-
label: t('Design:subManager'),
|
|
86
|
-
description: t('Design:subManagerAccessMessage'),
|
|
87
|
-
component: /*#__PURE__*/ jsx(SvgSubManagerRole, {})
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
value: VIEWER_ROLE,
|
|
91
|
-
label: t('Design:viewer'),
|
|
92
|
-
description: t('Design:viewerAccessMessage'),
|
|
93
|
-
component: /*#__PURE__*/ jsx(SvgViewerRole, {})
|
|
94
|
-
}
|
|
95
|
-
];
|
|
96
|
-
return /* @ts-expect-error 2345 */ /*#__PURE__*/ jsxs(Form, {
|
|
97
|
-
className: "company-user-form",
|
|
98
|
-
onSubmit: handleSubmit(onSubmit),
|
|
99
|
-
children: [
|
|
100
|
-
/*#__PURE__*/ jsx(Row, {
|
|
101
|
-
children: /*#__PURE__*/ jsx(Col, {
|
|
102
|
-
xl: 6,
|
|
103
|
-
lg: 6,
|
|
104
|
-
sm: 12,
|
|
105
|
-
children: /*#__PURE__*/ jsxs(Form.Group, {
|
|
106
|
-
children: [
|
|
107
|
-
/*#__PURE__*/ jsxs(Form.Label, {
|
|
108
|
-
children: [
|
|
109
|
-
t('User:email'),
|
|
110
|
-
"*"
|
|
111
|
-
]
|
|
112
|
-
}),
|
|
113
|
-
/*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({
|
|
114
|
-
isInvalid: !!errors.email
|
|
115
|
-
}, register('email', {
|
|
116
|
-
pattern: emailRule,
|
|
117
|
-
required: true
|
|
118
|
-
})), {
|
|
119
|
-
disabled: isLoading || Boolean(defaultValues.email)
|
|
120
|
-
})),
|
|
121
|
-
/*#__PURE__*/ jsxs(Form.Control.Feedback, {
|
|
122
|
-
type: "invalid",
|
|
123
|
-
children: [
|
|
124
|
-
HookFormService.hasError(errors.email, 'required') && t('Validation:fieldRequired', {
|
|
125
|
-
attribute: t('User:email')
|
|
126
|
-
}),
|
|
127
|
-
HookFormService.hasError(errors.email, 'pattern') && t('Validation:fieldValidEmail', {
|
|
128
|
-
attribute: t('User:email')
|
|
129
|
-
})
|
|
130
|
-
]
|
|
131
|
-
})
|
|
132
|
-
]
|
|
133
|
-
})
|
|
134
|
-
})
|
|
135
|
-
}),
|
|
136
|
-
/*#__PURE__*/ jsx(Row, {
|
|
137
|
-
children: /*#__PURE__*/ jsx(Col, {
|
|
138
|
-
children: /*#__PURE__*/ jsx(Controller, {
|
|
139
|
-
render: function(param) {
|
|
140
|
-
var _param_field = param.field, onChange = _param_field.onChange, fieldValue = _param_field.value, error = param.fieldState.error;
|
|
141
|
-
return /*#__PURE__*/ jsxs(Form.Group, {
|
|
142
|
-
className: clsx('roles-form-group', !!error && 'is-invalid'),
|
|
143
|
-
children: [
|
|
144
|
-
/*#__PURE__*/ jsxs(Form.Label, {
|
|
145
|
-
children: [
|
|
146
|
-
t('User:role'),
|
|
147
|
-
"*"
|
|
148
|
-
]
|
|
149
|
-
}),
|
|
150
|
-
/*#__PURE__*/ jsx("div", {
|
|
151
|
-
className: "roles-wrapper",
|
|
152
|
-
children: rolesOptions.map(function(param) {
|
|
153
|
-
var value = param.value, label = param.label, description = param.description, component = param.component;
|
|
154
|
-
return /*#__PURE__*/ jsxs("button", {
|
|
155
|
-
onClick: function() {
|
|
156
|
-
return onChange(value);
|
|
157
|
-
},
|
|
158
|
-
className: clsx('role', {
|
|
159
|
-
active: fieldValue === value
|
|
160
|
-
}),
|
|
161
|
-
type: "button",
|
|
162
|
-
children: [
|
|
163
|
-
/*#__PURE__*/ jsx(Logo, {
|
|
164
|
-
logo: component
|
|
165
|
-
}),
|
|
166
|
-
/*#__PURE__*/ jsx("p", {
|
|
167
|
-
className: "label",
|
|
168
|
-
children: label
|
|
169
|
-
}),
|
|
170
|
-
/*#__PURE__*/ jsx("p", {
|
|
171
|
-
className: "description",
|
|
172
|
-
children: description
|
|
173
|
-
})
|
|
174
|
-
]
|
|
175
|
-
}, value);
|
|
176
|
-
})
|
|
177
|
-
}),
|
|
178
|
-
/*#__PURE__*/ jsx(Form.Control.Feedback, {
|
|
179
|
-
type: "invalid",
|
|
180
|
-
children: error === null || error === void 0 ? void 0 : error.message
|
|
181
|
-
})
|
|
182
|
-
]
|
|
183
|
-
});
|
|
184
|
-
},
|
|
185
|
-
control: control,
|
|
186
|
-
name: "role",
|
|
187
|
-
rules: {
|
|
188
|
-
required: t('Validation:fieldRequired', {
|
|
189
|
-
fieldName: t('User:role')
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
})
|
|
193
|
-
})
|
|
194
|
-
}),
|
|
195
|
-
hasPermission && /*#__PURE__*/ jsx(Button, {
|
|
196
|
-
type: "submit",
|
|
197
|
-
size: "lg",
|
|
198
|
-
disabled: isLoading,
|
|
199
|
-
children: defaultValues.email ? t('User:submit') : t('Design:addUser')
|
|
200
|
-
})
|
|
201
|
-
]
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
export { UserForm };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/provider/company/user-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './user-form'
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Meta, Story } from '@storybook/react'
|
|
2
|
-
import { UserForm, UserFormProps } from './UserForm'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Provider/Company/User form',
|
|
6
|
-
component: UserForm,
|
|
7
|
-
} as Meta
|
|
8
|
-
|
|
9
|
-
export const Default: Story<UserFormProps> = (args) => {
|
|
10
|
-
return <UserForm {...args} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
Default.args = {
|
|
14
|
-
onSubmit: (values) => console.log(values),
|
|
15
|
-
isLoading: false,
|
|
16
|
-
defaultValues: {},
|
|
17
|
-
hasPermission: true,
|
|
18
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { Button, Col, Form, Row } from 'react-bootstrap'
|
|
2
|
-
import { useForm, Controller } from 'react-hook-form'
|
|
3
|
-
import { useTranslation } from 'react-i18next'
|
|
4
|
-
import clsx from 'clsx'
|
|
5
|
-
import { User } from '@licklist/core/dist/DataMapper/User/UserDataMapper'
|
|
6
|
-
import {
|
|
7
|
-
VIEWER_ROLE,
|
|
8
|
-
MANAGER_ROLE,
|
|
9
|
-
SUBMANAGER_ROLE,
|
|
10
|
-
} from '@licklist/core/dist/DataMapper/User/UserRoleDataMapper'
|
|
11
|
-
import emailRule from '@licklist/plugins/dist/validation/Rules/emailRule'
|
|
12
|
-
import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService'
|
|
13
|
-
import Logo from '../../../logo/Logo'
|
|
14
|
-
import { ReactComponent as ManagerRoleImg } from '../../../assets/dashboard/managerRole.svg'
|
|
15
|
-
import { ReactComponent as SubManagerRoleImg } from '../../../assets/dashboard/subManagerRole.svg'
|
|
16
|
-
import { ReactComponent as ViewerRoleImg } from '../../../assets/dashboard/viewerRole.svg'
|
|
17
|
-
|
|
18
|
-
export type UserFormValues = {
|
|
19
|
-
email?: User['email']
|
|
20
|
-
role?: typeof VIEWER_ROLE | typeof MANAGER_ROLE | typeof SUBMANAGER_ROLE
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export type UserFormProps = {
|
|
24
|
-
defaultValues?: UserFormValues
|
|
25
|
-
onSubmit: (values: {
|
|
26
|
-
email: User['email']
|
|
27
|
-
role: typeof VIEWER_ROLE | typeof MANAGER_ROLE | typeof SUBMANAGER_ROLE
|
|
28
|
-
}) => void
|
|
29
|
-
isLoading?: boolean
|
|
30
|
-
hasPermission: boolean
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const UserForm = ({
|
|
34
|
-
defaultValues = {},
|
|
35
|
-
onSubmit,
|
|
36
|
-
isLoading = false,
|
|
37
|
-
hasPermission,
|
|
38
|
-
}: UserFormProps) => {
|
|
39
|
-
const { t } = useTranslation(['Design', 'User', 'Validation'])
|
|
40
|
-
const {
|
|
41
|
-
control,
|
|
42
|
-
register,
|
|
43
|
-
handleSubmit,
|
|
44
|
-
formState: { errors },
|
|
45
|
-
} = useForm<UserFormValues>({
|
|
46
|
-
defaultValues,
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
const rolesOptions = [
|
|
50
|
-
{
|
|
51
|
-
value: MANAGER_ROLE,
|
|
52
|
-
label: t('Design:manager'),
|
|
53
|
-
description: t('Design:managerAccessMessage'),
|
|
54
|
-
component: <ManagerRoleImg />,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
value: SUBMANAGER_ROLE,
|
|
58
|
-
label: t('Design:subManager'),
|
|
59
|
-
description: t('Design:subManagerAccessMessage'),
|
|
60
|
-
component: <SubManagerRoleImg />,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
value: VIEWER_ROLE,
|
|
64
|
-
label: t('Design:viewer'),
|
|
65
|
-
description: t('Design:viewerAccessMessage'),
|
|
66
|
-
component: <ViewerRoleImg />,
|
|
67
|
-
},
|
|
68
|
-
]
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
/* @ts-expect-error 2345 */
|
|
72
|
-
<Form className='company-user-form' onSubmit={handleSubmit(onSubmit)}>
|
|
73
|
-
<Row>
|
|
74
|
-
<Col xl={6} lg={6} sm={12}>
|
|
75
|
-
<Form.Group>
|
|
76
|
-
<Form.Label>{t('User:email')}*</Form.Label>
|
|
77
|
-
<Form.Control
|
|
78
|
-
isInvalid={!!errors.email}
|
|
79
|
-
{...register('email', {
|
|
80
|
-
pattern: emailRule,
|
|
81
|
-
required: true,
|
|
82
|
-
})}
|
|
83
|
-
disabled={isLoading || Boolean(defaultValues.email)}
|
|
84
|
-
/>
|
|
85
|
-
|
|
86
|
-
<Form.Control.Feedback type='invalid'>
|
|
87
|
-
{HookFormService.hasError(errors.email, 'required') &&
|
|
88
|
-
t('Validation:fieldRequired', {
|
|
89
|
-
attribute: t('User:email'),
|
|
90
|
-
})}
|
|
91
|
-
{HookFormService.hasError(errors.email, 'pattern') &&
|
|
92
|
-
t('Validation:fieldValidEmail', {
|
|
93
|
-
attribute: t('User:email'),
|
|
94
|
-
})}
|
|
95
|
-
</Form.Control.Feedback>
|
|
96
|
-
</Form.Group>
|
|
97
|
-
</Col>
|
|
98
|
-
</Row>
|
|
99
|
-
|
|
100
|
-
<Row>
|
|
101
|
-
<Col>
|
|
102
|
-
<Controller
|
|
103
|
-
render={({
|
|
104
|
-
field: { onChange, value: fieldValue },
|
|
105
|
-
fieldState: { error },
|
|
106
|
-
}) => (
|
|
107
|
-
<Form.Group
|
|
108
|
-
className={clsx('roles-form-group', !!error && 'is-invalid')}
|
|
109
|
-
>
|
|
110
|
-
<Form.Label>{t('User:role')}*</Form.Label>
|
|
111
|
-
<div className='roles-wrapper'>
|
|
112
|
-
{rolesOptions.map(
|
|
113
|
-
({ value, label, description, component }) => (
|
|
114
|
-
<button
|
|
115
|
-
key={value}
|
|
116
|
-
onClick={() => onChange(value)}
|
|
117
|
-
className={clsx('role', {
|
|
118
|
-
active: fieldValue === value,
|
|
119
|
-
})}
|
|
120
|
-
type='button'
|
|
121
|
-
>
|
|
122
|
-
<Logo logo={component} />
|
|
123
|
-
<p className='label'>{label}</p>
|
|
124
|
-
<p className='description'>{description}</p>
|
|
125
|
-
</button>
|
|
126
|
-
),
|
|
127
|
-
)}
|
|
128
|
-
</div>
|
|
129
|
-
<Form.Control.Feedback type='invalid'>
|
|
130
|
-
{error?.message}
|
|
131
|
-
</Form.Control.Feedback>
|
|
132
|
-
</Form.Group>
|
|
133
|
-
)}
|
|
134
|
-
control={control}
|
|
135
|
-
name='role'
|
|
136
|
-
rules={{
|
|
137
|
-
required: t('Validation:fieldRequired', {
|
|
138
|
-
fieldName: t('User:role'),
|
|
139
|
-
}) as string,
|
|
140
|
-
}}
|
|
141
|
-
/>
|
|
142
|
-
</Col>
|
|
143
|
-
</Row>
|
|
144
|
-
{hasPermission && (
|
|
145
|
-
<Button type='submit' size='lg' disabled={isLoading}>
|
|
146
|
-
{defaultValues.email ? t('User:submit') : t('Design:addUser')}
|
|
147
|
-
</Button>
|
|
148
|
-
)}
|
|
149
|
-
</Form>
|
|
150
|
-
)
|
|
151
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './UserForm'
|