@licklist/design 0.75.1-dev.0 → 0.75.1-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.
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +0 -6
- package/dist/index.js +0 -1
- package/dist/provider/index.d.ts +0 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/provider/index.ts +0 -1
- package/yarn.lock +43 -34
- 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
|
@@ -25,12 +25,6 @@ import 'react-phone-number-input/locale/en.json';
|
|
|
25
25
|
import 'react-select';
|
|
26
26
|
import '../../../../provider/provider-form/ProviderForm.js';
|
|
27
27
|
import '../../../../provider/venue-form/VenueForm.js';
|
|
28
|
-
import 'clsx';
|
|
29
|
-
import '@licklist/core/dist/DataMapper/User/UserRoleDataMapper';
|
|
30
|
-
import '@licklist/plugins/dist/validation/Rules/emailRule';
|
|
31
|
-
import '@licklist/plugins/dist/services/Form/HookFormService';
|
|
32
|
-
import 'react-bootstrap/Col';
|
|
33
|
-
import 'react-bootstrap/Row';
|
|
34
28
|
import { CollapsibleInputGroup } from '../../../../collapsible-input-group/CollapsibleInputGroup.js';
|
|
35
29
|
import { TipTapEditor } from '../../../../tiptap-editor/TipTapEditor.js';
|
|
36
30
|
import { FileUpload } from '../../../../file-upload/FileUpload.js';
|
package/dist/index.js
CHANGED
|
@@ -106,7 +106,6 @@ export { ProviderLinksInput } from './provider/provider-links-input/ProviderLink
|
|
|
106
106
|
export { VenueForm } from './provider/venue-form/VenueForm.js';
|
|
107
107
|
export { WorkingHoursInput } from './provider/working-hours-input/WorkingHoursInput.js';
|
|
108
108
|
export { WorkingHoursInputDescription } from './provider/working-hours-input/WorkingHoursInputDescription.js';
|
|
109
|
-
export { UserForm } from './provider/company/user-form/UserForm.js';
|
|
110
109
|
export { RecurrenceInput } from './recurrence-input/RecurrenceInput.js';
|
|
111
110
|
export { RecurringDatePickerInput, getDateTimeObject } from './recurring-date-picker-input/RecurringDatePickerInput.js';
|
|
112
111
|
export { StatisticsChart } from './sales/statistics-chart/StatisticsChart.js';
|
package/dist/provider/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.75.1-dev.
|
|
3
|
+
"version": "0.75.1-dev.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -42,9 +42,10 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@licklist/core": "0.
|
|
45
|
+
"@licklist/core": "0.34.3-dev.0",
|
|
46
46
|
"@licklist/eslint-config": "0.5.6",
|
|
47
|
-
"@licklist/plugins": "0.
|
|
47
|
+
"@licklist/plugins": "0.36.1-dev.0",
|
|
48
|
+
"clsx": "2.1.1",
|
|
48
49
|
"lodash": "4.17.21",
|
|
49
50
|
"luxon": "3.5.0",
|
|
50
51
|
"react": "17.0.2",
|
|
@@ -61,9 +62,9 @@
|
|
|
61
62
|
"@dnd-kit/utilities": "2.0.0",
|
|
62
63
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
63
64
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
64
|
-
"@licklist/core": "0.
|
|
65
|
+
"@licklist/core": "0.34.3-dev.0",
|
|
65
66
|
"@licklist/eslint-config": "0.5.6",
|
|
66
|
-
"@licklist/plugins": "0.
|
|
67
|
+
"@licklist/plugins": "0.36.1-dev.0",
|
|
67
68
|
"@mantine/core": "6.0.22",
|
|
68
69
|
"@mantine/hooks": "6.0.22",
|
|
69
70
|
"@mdx-js/react": "1.6.22",
|
|
@@ -94,7 +95,6 @@
|
|
|
94
95
|
"@wojtekmaj/react-daterange-picker": "4.1.0",
|
|
95
96
|
"bootstrap": "4.6.0",
|
|
96
97
|
"bootstrap-social": "5.1.1",
|
|
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",
|
package/src/provider/index.ts
CHANGED
package/yarn.lock
CHANGED
|
@@ -2478,9 +2478,9 @@ __metadata:
|
|
|
2478
2478
|
languageName: node
|
|
2479
2479
|
linkType: hard
|
|
2480
2480
|
|
|
2481
|
-
"@licklist/core@npm:0.
|
|
2482
|
-
version: 0.
|
|
2483
|
-
resolution: "@licklist/core@npm:0.
|
|
2481
|
+
"@licklist/core@npm:0.34.3-dev.0":
|
|
2482
|
+
version: 0.34.3-dev.0
|
|
2483
|
+
resolution: "@licklist/core@npm:0.34.3-dev.0"
|
|
2484
2484
|
dependencies:
|
|
2485
2485
|
"@sentry/browser": "npm:6.2.0"
|
|
2486
2486
|
axios: "npm:0.26.0"
|
|
@@ -2502,7 +2502,7 @@ __metadata:
|
|
|
2502
2502
|
react-i18next: 11.8.8
|
|
2503
2503
|
react-intl: 6.6.8
|
|
2504
2504
|
zustand: 3.7.2
|
|
2505
|
-
checksum: 10c0/
|
|
2505
|
+
checksum: 10c0/4fa363166e7175d1661c6a080d913f59f60fb0571bd013718b4a9256144be8c4f2b66fdc3c7b3f063b5f59ff61bbeb107b11ee0048450723f75c346140235c72
|
|
2506
2506
|
languageName: node
|
|
2507
2507
|
linkType: hard
|
|
2508
2508
|
|
|
@@ -2517,9 +2517,9 @@ __metadata:
|
|
|
2517
2517
|
"@dnd-kit/utilities": "npm:2.0.0"
|
|
2518
2518
|
"@fortawesome/fontawesome-svg-core": "npm:1.2.34"
|
|
2519
2519
|
"@fortawesome/free-solid-svg-icons": "npm:5.15.2"
|
|
2520
|
-
"@licklist/core": "npm:0.
|
|
2520
|
+
"@licklist/core": "npm:0.34.3-dev.0"
|
|
2521
2521
|
"@licklist/eslint-config": "npm:0.5.6"
|
|
2522
|
-
"@licklist/plugins": "npm:0.
|
|
2522
|
+
"@licklist/plugins": "npm:0.36.1-dev.0"
|
|
2523
2523
|
"@mantine/core": "npm:6.0.22"
|
|
2524
2524
|
"@mantine/hooks": "npm:6.0.22"
|
|
2525
2525
|
"@mdx-js/react": "npm:1.6.22"
|
|
@@ -2581,7 +2581,6 @@ __metadata:
|
|
|
2581
2581
|
babel-loader: "npm:8.2.2"
|
|
2582
2582
|
bootstrap: "npm:4.6.0"
|
|
2583
2583
|
bootstrap-social: "npm:5.1.1"
|
|
2584
|
-
clsx: "npm:2.1.1"
|
|
2585
2584
|
css-loader: "npm:5.1.1"
|
|
2586
2585
|
cssnano: "npm:7.0.6"
|
|
2587
2586
|
date-fns: "npm:2.29.3"
|
|
@@ -2648,9 +2647,10 @@ __metadata:
|
|
|
2648
2647
|
vite-plugin-svgr: "npm:4.2.0"
|
|
2649
2648
|
vite-tsconfig-paths: "npm:5.0.1"
|
|
2650
2649
|
peerDependencies:
|
|
2651
|
-
"@licklist/core": 0.
|
|
2650
|
+
"@licklist/core": 0.34.3-dev.0
|
|
2652
2651
|
"@licklist/eslint-config": 0.5.6
|
|
2653
|
-
"@licklist/plugins": 0.
|
|
2652
|
+
"@licklist/plugins": 0.36.1-dev.0
|
|
2653
|
+
clsx: 2.1.1
|
|
2654
2654
|
lodash: 4.17.21
|
|
2655
2655
|
luxon: 3.5.0
|
|
2656
2656
|
react: 17.0.2
|
|
@@ -2680,12 +2680,13 @@ __metadata:
|
|
|
2680
2680
|
languageName: node
|
|
2681
2681
|
linkType: hard
|
|
2682
2682
|
|
|
2683
|
-
"@licklist/plugins@npm:0.
|
|
2684
|
-
version: 0.
|
|
2685
|
-
resolution: "@licklist/plugins@npm:0.
|
|
2683
|
+
"@licklist/plugins@npm:0.36.1-dev.0":
|
|
2684
|
+
version: 0.36.1-dev.0
|
|
2685
|
+
resolution: "@licklist/plugins@npm:0.36.1-dev.0"
|
|
2686
2686
|
dependencies:
|
|
2687
2687
|
"@licklist/core": "npm:0.31.2-dev.10"
|
|
2688
2688
|
axios: "npm:0.26.0"
|
|
2689
|
+
clsx: "npm:2.1.1"
|
|
2689
2690
|
history: "npm:4.10.1"
|
|
2690
2691
|
laravel-echo: "npm:1.15.1"
|
|
2691
2692
|
lodash: "npm:4.17.21"
|
|
@@ -2702,6 +2703,7 @@ __metadata:
|
|
|
2702
2703
|
react-query: "npm:3.34.12"
|
|
2703
2704
|
react-router-dom: "npm:5.2.0"
|
|
2704
2705
|
rrule: "npm:2.6.8"
|
|
2706
|
+
tailwind-merge: "npm:3.1.0"
|
|
2705
2707
|
use-debounce: "npm:7.0.1"
|
|
2706
2708
|
peerDependencies:
|
|
2707
2709
|
"@licklist/core": 0.31.2-dev.10
|
|
@@ -2716,7 +2718,7 @@ __metadata:
|
|
|
2716
2718
|
react-loader: 2.4.7
|
|
2717
2719
|
react-query: 3.34.12
|
|
2718
2720
|
react-router-dom: 5.2.0
|
|
2719
|
-
checksum: 10c0/
|
|
2721
|
+
checksum: 10c0/d208236e03a6e43163b8cc755348988c05a83944e49d3fa1fc831c603e625036eae1e79b6e789fffcf06e87bbac0ff3d0f1dc274341dce101305b7ef9c6cf12d
|
|
2720
2722
|
languageName: node
|
|
2721
2723
|
linkType: hard
|
|
2722
2724
|
|
|
@@ -8220,8 +8222,8 @@ __metadata:
|
|
|
8220
8222
|
linkType: hard
|
|
8221
8223
|
|
|
8222
8224
|
"chromatic@npm:^11.4.0":
|
|
8223
|
-
version: 11.28.
|
|
8224
|
-
resolution: "chromatic@npm:11.28.
|
|
8225
|
+
version: 11.28.3
|
|
8226
|
+
resolution: "chromatic@npm:11.28.3"
|
|
8225
8227
|
peerDependencies:
|
|
8226
8228
|
"@chromatic-com/cypress": ^0.*.* || ^1.0.0
|
|
8227
8229
|
"@chromatic-com/playwright": ^0.*.* || ^1.0.0
|
|
@@ -8234,7 +8236,7 @@ __metadata:
|
|
|
8234
8236
|
chroma: dist/bin.js
|
|
8235
8237
|
chromatic: dist/bin.js
|
|
8236
8238
|
chromatic-cli: dist/bin.js
|
|
8237
|
-
checksum: 10c0/
|
|
8239
|
+
checksum: 10c0/b43b22dad9d72411e1b646ef6e669de799e7b4ccf11f0700e8b7001d21c8f701caaa7db607c69c8e2a796e353bd8b4000c5035963fe7314362397eb6e34f7674
|
|
8238
8240
|
languageName: node
|
|
8239
8241
|
linkType: hard
|
|
8240
8242
|
|
|
@@ -9864,9 +9866,9 @@ __metadata:
|
|
|
9864
9866
|
linkType: hard
|
|
9865
9867
|
|
|
9866
9868
|
"electron-to-chromium@npm:^1.3.564, electron-to-chromium@npm:^1.5.149":
|
|
9867
|
-
version: 1.5.
|
|
9868
|
-
resolution: "electron-to-chromium@npm:1.5.
|
|
9869
|
-
checksum: 10c0/
|
|
9869
|
+
version: 1.5.157
|
|
9870
|
+
resolution: "electron-to-chromium@npm:1.5.157"
|
|
9871
|
+
checksum: 10c0/d22dc2603bdfb0d89c8e199bcc29a34995cc6e37261b5029b4e635ea536b843ed00dfc3b1dd2f69e1852031daee0c7cf3fb63cc70abf5312908328075b35e9af
|
|
9870
9872
|
languageName: node
|
|
9871
9873
|
linkType: hard
|
|
9872
9874
|
|
|
@@ -10074,25 +10076,25 @@ __metadata:
|
|
|
10074
10076
|
linkType: hard
|
|
10075
10077
|
|
|
10076
10078
|
"es-abstract@npm:^1.17.5, es-abstract@npm:^1.22.1, es-abstract@npm:^1.22.3, es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.3, es-abstract@npm:^1.23.5, es-abstract@npm:^1.23.6, es-abstract@npm:^1.23.9":
|
|
10077
|
-
version: 1.23.
|
|
10078
|
-
resolution: "es-abstract@npm:1.23.
|
|
10079
|
+
version: 1.23.10
|
|
10080
|
+
resolution: "es-abstract@npm:1.23.10"
|
|
10079
10081
|
dependencies:
|
|
10080
10082
|
array-buffer-byte-length: "npm:^1.0.2"
|
|
10081
10083
|
arraybuffer.prototype.slice: "npm:^1.0.4"
|
|
10082
10084
|
available-typed-arrays: "npm:^1.0.7"
|
|
10083
10085
|
call-bind: "npm:^1.0.8"
|
|
10084
|
-
call-bound: "npm:^1.0.
|
|
10086
|
+
call-bound: "npm:^1.0.4"
|
|
10085
10087
|
data-view-buffer: "npm:^1.0.2"
|
|
10086
10088
|
data-view-byte-length: "npm:^1.0.2"
|
|
10087
10089
|
data-view-byte-offset: "npm:^1.0.1"
|
|
10088
10090
|
es-define-property: "npm:^1.0.1"
|
|
10089
10091
|
es-errors: "npm:^1.3.0"
|
|
10090
|
-
es-object-atoms: "npm:^1.
|
|
10092
|
+
es-object-atoms: "npm:^1.1.1"
|
|
10091
10093
|
es-set-tostringtag: "npm:^2.1.0"
|
|
10092
10094
|
es-to-primitive: "npm:^1.3.0"
|
|
10093
10095
|
function.prototype.name: "npm:^1.1.8"
|
|
10094
|
-
get-intrinsic: "npm:^1.
|
|
10095
|
-
get-proto: "npm:^1.0.
|
|
10096
|
+
get-intrinsic: "npm:^1.3.0"
|
|
10097
|
+
get-proto: "npm:^1.0.1"
|
|
10096
10098
|
get-symbol-description: "npm:^1.1.0"
|
|
10097
10099
|
globalthis: "npm:^1.0.4"
|
|
10098
10100
|
gopd: "npm:^1.2.0"
|
|
@@ -10108,13 +10110,13 @@ __metadata:
|
|
|
10108
10110
|
is-shared-array-buffer: "npm:^1.0.4"
|
|
10109
10111
|
is-string: "npm:^1.1.1"
|
|
10110
10112
|
is-typed-array: "npm:^1.1.15"
|
|
10111
|
-
is-weakref: "npm:^1.1.
|
|
10113
|
+
is-weakref: "npm:^1.1.1"
|
|
10112
10114
|
math-intrinsics: "npm:^1.1.0"
|
|
10113
|
-
object-inspect: "npm:^1.13.
|
|
10115
|
+
object-inspect: "npm:^1.13.4"
|
|
10114
10116
|
object-keys: "npm:^1.1.1"
|
|
10115
10117
|
object.assign: "npm:^4.1.7"
|
|
10116
10118
|
own-keys: "npm:^1.0.1"
|
|
10117
|
-
regexp.prototype.flags: "npm:^1.5.
|
|
10119
|
+
regexp.prototype.flags: "npm:^1.5.4"
|
|
10118
10120
|
safe-array-concat: "npm:^1.1.3"
|
|
10119
10121
|
safe-push-apply: "npm:^1.0.0"
|
|
10120
10122
|
safe-regex-test: "npm:^1.1.0"
|
|
@@ -10127,8 +10129,8 @@ __metadata:
|
|
|
10127
10129
|
typed-array-byte-offset: "npm:^1.0.4"
|
|
10128
10130
|
typed-array-length: "npm:^1.0.7"
|
|
10129
10131
|
unbox-primitive: "npm:^1.1.0"
|
|
10130
|
-
which-typed-array: "npm:^1.1.
|
|
10131
|
-
checksum: 10c0/
|
|
10132
|
+
which-typed-array: "npm:^1.1.19"
|
|
10133
|
+
checksum: 10c0/e65c8fb973d6ba489fc1bc88730c56a592e249f49a9811c77bf88568f23696b682fe3f3485c03aaf6561042a3c7a675ae57d512861dffd8b0abde0035231c6a3
|
|
10132
10134
|
languageName: node
|
|
10133
10135
|
linkType: hard
|
|
10134
10136
|
|
|
@@ -13211,7 +13213,7 @@ __metadata:
|
|
|
13211
13213
|
languageName: node
|
|
13212
13214
|
linkType: hard
|
|
13213
13215
|
|
|
13214
|
-
"is-weakref@npm:^1.0.2, is-weakref@npm:^1.1.
|
|
13216
|
+
"is-weakref@npm:^1.0.2, is-weakref@npm:^1.1.1":
|
|
13215
13217
|
version: 1.1.1
|
|
13216
13218
|
resolution: "is-weakref@npm:1.1.1"
|
|
13217
13219
|
dependencies:
|
|
@@ -15266,7 +15268,7 @@ __metadata:
|
|
|
15266
15268
|
languageName: node
|
|
15267
15269
|
linkType: hard
|
|
15268
15270
|
|
|
15269
|
-
"object-inspect@npm:^1.12.0, object-inspect@npm:^1.13.3":
|
|
15271
|
+
"object-inspect@npm:^1.12.0, object-inspect@npm:^1.13.3, object-inspect@npm:^1.13.4":
|
|
15270
15272
|
version: 1.13.4
|
|
15271
15273
|
resolution: "object-inspect@npm:1.13.4"
|
|
15272
15274
|
checksum: 10c0/d7f8711e803b96ea3191c745d6f8056ce1f2496e530e6a19a0e92d89b0fa3c76d910c31f0aa270432db6bd3b2f85500a376a83aaba849a8d518c8845b3211692
|
|
@@ -18406,7 +18408,7 @@ __metadata:
|
|
|
18406
18408
|
languageName: node
|
|
18407
18409
|
linkType: hard
|
|
18408
18410
|
|
|
18409
|
-
"regexp.prototype.flags@npm:^1.5.3":
|
|
18411
|
+
"regexp.prototype.flags@npm:^1.5.3, regexp.prototype.flags@npm:^1.5.4":
|
|
18410
18412
|
version: 1.5.4
|
|
18411
18413
|
resolution: "regexp.prototype.flags@npm:1.5.4"
|
|
18412
18414
|
dependencies:
|
|
@@ -20395,6 +20397,13 @@ __metadata:
|
|
|
20395
20397
|
languageName: node
|
|
20396
20398
|
linkType: hard
|
|
20397
20399
|
|
|
20400
|
+
"tailwind-merge@npm:3.1.0":
|
|
20401
|
+
version: 3.1.0
|
|
20402
|
+
resolution: "tailwind-merge@npm:3.1.0"
|
|
20403
|
+
checksum: 10c0/71d6dc5f8bae2f87950eefa2605a391ffef45a09759de22ba0e90976180ab3cd4fc48ed37063a617dc2ff0f48768c0006090a78bcd1f5ad0ae1c373aad16d2b6
|
|
20404
|
+
languageName: node
|
|
20405
|
+
linkType: hard
|
|
20406
|
+
|
|
20398
20407
|
"tailwindcss@npm:3.4.13":
|
|
20399
20408
|
version: 3.4.13
|
|
20400
20409
|
resolution: "tailwindcss@npm:3.4.13"
|
|
@@ -21989,7 +21998,7 @@ __metadata:
|
|
|
21989
21998
|
languageName: node
|
|
21990
21999
|
linkType: hard
|
|
21991
22000
|
|
|
21992
|
-
"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.
|
|
22001
|
+
"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.19":
|
|
21993
22002
|
version: 1.1.19
|
|
21994
22003
|
resolution: "which-typed-array@npm:1.1.19"
|
|
21995
22004
|
dependencies:
|
|
@@ -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'
|