@licklist/design 0.72.72-dev.0 → 0.72.72-dev.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.
Files changed (36) hide show
  1. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  2. package/dist/index.js +0 -2
  3. package/dist/product-set/product/ProductControl.d.ts +2 -2
  4. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  5. package/dist/product-set/product/ProductControl.js +4 -53
  6. package/dist/product-set/utils/index.d.ts +1 -1
  7. package/dist/setting/index.d.ts +0 -2
  8. package/dist/setting/index.d.ts.map +1 -1
  9. package/package.json +1 -1
  10. package/src/product-set/product/Product.stories.tsx +1 -1
  11. package/src/product-set/product/ProductControl.tsx +3 -55
  12. package/src/setting/index.ts +0 -2
  13. package/yarn.lock +26 -26
  14. package/dist/setting/admin/AdminSettingForm.d.ts +0 -25
  15. package/dist/setting/admin/AdminSettingForm.d.ts.map +0 -1
  16. package/dist/setting/admin/AdminSettingForm.js +0 -220
  17. package/dist/setting/admin/PaymentFeeForm.d.ts +0 -13
  18. package/dist/setting/admin/PaymentFeeForm.d.ts.map +0 -1
  19. package/dist/setting/admin/PaymentFeeForm.js +0 -439
  20. package/dist/setting/admin/index.d.ts +0 -2
  21. package/dist/setting/admin/index.d.ts.map +0 -1
  22. package/dist/setting/system/SystemSettingForm.d.ts +0 -10
  23. package/dist/setting/system/SystemSettingForm.d.ts.map +0 -1
  24. package/dist/setting/system/SystemSettingForm.js +0 -95
  25. package/dist/setting/system/index.d.ts +0 -2
  26. package/dist/setting/system/index.d.ts.map +0 -1
  27. package/dist/types/currency.d.ts +0 -5
  28. package/dist/types/currency.d.ts.map +0 -1
  29. package/src/setting/admin/AdminSetting.stories.tsx +0 -52
  30. package/src/setting/admin/AdminSettingForm.tsx +0 -196
  31. package/src/setting/admin/PaymentFeeForm.tsx +0 -309
  32. package/src/setting/admin/index.ts +0 -1
  33. package/src/setting/system/SystemSetting.stories.tsx +0 -26
  34. package/src/setting/system/SystemSettingForm.tsx +0 -62
  35. package/src/setting/system/index.ts +0 -1
  36. package/src/types/currency.ts +0 -4
@@ -1,220 +0,0 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import { useId } from '@react-aria/utils';
3
- import { Form, Button, Spinner } from 'react-bootstrap';
4
- import InputGroup from 'react-bootstrap/InputGroup';
5
- import { useForm, FormProvider } from 'react-hook-form';
6
- import { useTranslation } from 'react-i18next';
7
- import Card from 'react-bootstrap/Card';
8
- import Row from 'react-bootstrap/Row';
9
- import Col from 'react-bootstrap/Col';
10
- import { Link } from 'react-router-dom';
11
- import HookFormService from '@licklist/plugins/dist/services/Form/HookFormService';
12
- import { FaCommentAlt } from 'react-icons/fa';
13
- import { PaymentFeeForm } from './PaymentFeeForm.js';
14
-
15
- function _define_property(obj, key, value) {
16
- if (key in obj) {
17
- Object.defineProperty(obj, key, {
18
- value: value,
19
- enumerable: true,
20
- configurable: true,
21
- writable: true
22
- });
23
- } else {
24
- obj[key] = value;
25
- }
26
- return obj;
27
- }
28
- function _object_spread(target) {
29
- for(var i = 1; i < arguments.length; i++){
30
- var source = arguments[i] != null ? arguments[i] : {};
31
- var ownKeys = Object.keys(source);
32
- if (typeof Object.getOwnPropertySymbols === "function") {
33
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
34
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
35
- }));
36
- }
37
- ownKeys.forEach(function(key) {
38
- _define_property(target, key, source[key]);
39
- });
40
- }
41
- return target;
42
- }
43
- function ownKeys(object, enumerableOnly) {
44
- var keys = Object.keys(object);
45
- if (Object.getOwnPropertySymbols) {
46
- var symbols = Object.getOwnPropertySymbols(object);
47
- if (enumerableOnly) {
48
- symbols = symbols.filter(function(sym) {
49
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
50
- });
51
- }
52
- keys.push.apply(keys, symbols);
53
- }
54
- return keys;
55
- }
56
- function _object_spread_props(target, source) {
57
- source = source != null ? source : {};
58
- if (Object.getOwnPropertyDescriptors) {
59
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
60
- } else {
61
- ownKeys(Object(source)).forEach(function(key) {
62
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
63
- });
64
- }
65
- return target;
66
- }
67
- var AdminSettingForm = function(param) {
68
- var _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_defaultValues = param.defaultValues, defaultValues = _param_defaultValues === void 0 ? {} : _param_defaultValues, onSubmit = param.onSubmit, _param_currencies = param.currencies, currencies = _param_currencies === void 0 ? [] : _param_currencies, _param_hasPermission = param.hasPermission, hasPermission = _param_hasPermission === void 0 ? true : _param_hasPermission, providerMetadata = param.providerMetadata;
69
- var form = useForm({
70
- mode: 'onChange',
71
- defaultValues: defaultValues
72
- });
73
- var register = form.register, handleSubmit = form.handleSubmit, _form_formState = form.formState, errors = _form_formState.errors, isValid = _form_formState.isValid;
74
- var t = useTranslation('Design').t;
75
- var warningOnNumberOfPeopleId = useId();
76
- var providerHasMapId = useId();
77
- var hasBookingManagement = useId();
78
- var additionalPaymentMethodsEnabledId = useId();
79
- var externalPaymentLinkEnabledId = useId();
80
- return /*#__PURE__*/ jsxs(Form, {
81
- className: "d-flex flex-column",
82
- noValidate: true,
83
- onSubmit: handleSubmit(onSubmit),
84
- children: [
85
- /*#__PURE__*/ jsxs(FormProvider, _object_spread_props(_object_spread({}, form), {
86
- children: [
87
- /*#__PURE__*/ jsxs(Form.Group, {
88
- controlId: warningOnNumberOfPeopleId,
89
- children: [
90
- /*#__PURE__*/ jsx(Form.Label, {
91
- children: t('warningOnNumberOfPeople')
92
- }),
93
- /*#__PURE__*/ jsxs(InputGroup, {
94
- children: [
95
- /*#__PURE__*/ jsx(InputGroup.Prepend, {
96
- children: /*#__PURE__*/ jsx(InputGroup.Text, {
97
- children: /*#__PURE__*/ jsx(FaCommentAlt, {
98
- size: 16
99
- })
100
- })
101
- }),
102
- /*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({}, register('warningOnNumberOfPeople')), {
103
- disabled: isLoading
104
- }))
105
- ]
106
- })
107
- ]
108
- }),
109
- /*#__PURE__*/ jsx(PaymentFeeForm, {
110
- isLoading: isLoading
111
- }),
112
- /*#__PURE__*/ jsx(Form.Label, {
113
- className: "mt-5",
114
- children: t('defaultVenueCurrency')
115
- }),
116
- /*#__PURE__*/ jsx(Form.Control, _object_spread_props(_object_spread({}, register('currency_id')), {
117
- as: "select",
118
- disabled: isLoading,
119
- children: currencies === null || currencies === void 0 ? void 0 : currencies.map(function(currency) {
120
- return /*#__PURE__*/ jsx("option", {
121
- value: currency.id,
122
- children: currency.title
123
- }, currency.id);
124
- })
125
- })),
126
- /*#__PURE__*/ jsx(Row, {
127
- children: /*#__PURE__*/ jsx(Col, {
128
- xs: 12,
129
- children: /*#__PURE__*/ jsx("h5", {
130
- className: "mt-5",
131
- children: t('advanced')
132
- })
133
- })
134
- }),
135
- /*#__PURE__*/ jsx(Card, {
136
- className: "mb-3",
137
- children: /*#__PURE__*/ jsx(Card.Body, {
138
- children: /*#__PURE__*/ jsx(Row, {
139
- children: /*#__PURE__*/ jsxs(Col, {
140
- xs: 12,
141
- children: [
142
- /*#__PURE__*/ jsx(Form.Group, {
143
- controlId: providerHasMapId,
144
- children: /*#__PURE__*/ jsx(Form.Check, _object_spread_props(_object_spread({}, register('providerHasMap')), {
145
- disabled: isLoading,
146
- label: t('providerHasMap')
147
- }))
148
- }),
149
- /*#__PURE__*/ jsx(Form.Group, {
150
- controlId: hasBookingManagement,
151
- children: /*#__PURE__*/ jsx(Form.Check, _object_spread_props(_object_spread({}, register('hasBookingManagement')), {
152
- disabled: isLoading,
153
- label: t('hasBookingManagement')
154
- }))
155
- }),
156
- /*#__PURE__*/ jsx(Form.Group, {
157
- controlId: additionalPaymentMethodsEnabledId,
158
- children: /*#__PURE__*/ jsxs(Form.Check, {
159
- children: [
160
- /*#__PURE__*/ jsx(Form.Check.Input, _object_spread_props(_object_spread({}, register('additionalPaymentMethodsEnabled', {
161
- validate: function(value) {
162
- return !value || Boolean(providerMetadata === null || providerMetadata === void 0 ? void 0 : providerMetadata.country);
163
- }
164
- })), {
165
- disabled: isLoading,
166
- isInvalid: !!(errors === null || errors === void 0 ? void 0 : errors.additionalPaymentMethodsEnabled)
167
- })),
168
- /*#__PURE__*/ jsx(Form.Check.Label, {
169
- children: t('additionalPaymentMethodsEnabled')
170
- }),
171
- /*#__PURE__*/ jsx(Form.Control.Feedback, {
172
- type: "invalid",
173
- children: HookFormService.hasError(errors.additionalPaymentMethodsEnabled, 'validate') && /*#__PURE__*/ jsxs(Fragment, {
174
- children: [
175
- t('noCountryIsProvided'),
176
- /*#__PURE__*/ jsx(Link, {
177
- role: "button",
178
- to: "/provider/".concat(providerMetadata === null || providerMetadata === void 0 ? void 0 : providerMetadata.providerType, "/").concat(providerMetadata === null || providerMetadata === void 0 ? void 0 : providerMetadata.providableId, "/update"),
179
- children: t('here')
180
- })
181
- ]
182
- })
183
- })
184
- ]
185
- })
186
- }),
187
- /*#__PURE__*/ jsx(Form.Group, {
188
- controlId: externalPaymentLinkEnabledId,
189
- children: /*#__PURE__*/ jsx(Form.Check, _object_spread_props(_object_spread({}, register('externalPaymentLinkEnabled')), {
190
- disabled: isLoading,
191
- label: t('externalPaymentLinkEnabled')
192
- }))
193
- })
194
- ]
195
- })
196
- })
197
- })
198
- })
199
- ]
200
- })),
201
- hasPermission && /*#__PURE__*/ jsxs(Button, {
202
- type: "submit",
203
- disabled: isLoading || !isValid,
204
- className: "d-flex align-items-center align-self-end mt-5",
205
- children: [
206
- isLoading && /*#__PURE__*/ jsx(Spinner, {
207
- animation: "border",
208
- size: "sm",
209
- role: "status",
210
- "aria-hidden": "true",
211
- className: "mr-2"
212
- }),
213
- t('update')
214
- ]
215
- })
216
- ]
217
- });
218
- };
219
-
220
- export { AdminSettingForm };
@@ -1,13 +0,0 @@
1
- export type PaymentFeeFormFieldValues = {
2
- feeInPercent: number;
3
- minFeeInPounds: number;
4
- maxFeeInPounds: number;
5
- vatInPercent: number;
6
- fixedFee: number;
7
- };
8
- export type PaymentFeeFormProps = {
9
- isLoading: boolean;
10
- defaultValues?: Partial<PaymentFeeFormFieldValues>;
11
- };
12
- export declare function PaymentFeeForm({ isLoading }: PaymentFeeFormProps): import("react/jsx-runtime").JSX.Element;
13
- //# sourceMappingURL=PaymentFeeForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaymentFeeForm.d.ts","sourceRoot":"","sources":["../../../src/setting/admin/PaymentFeeForm.tsx"],"names":[],"mappings":"AAWA,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;CACnD,CAAA;AAED,wBAAgB,cAAc,CAAC,EAAE,SAAiB,EAAE,EAAE,mBAAmB,2CA4RxE"}