@mittwald/flow-react-components 0.2.0-alpha.543 → 0.2.0-alpha.545
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/CHANGELOG.md +12 -0
- package/dist/assets/doc-properties.json +222 -280
- package/dist/js/components/src/components/Alert/Alert.mjs +1 -1
- package/dist/js/components/src/components/Alert/Alert.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs +7 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs +9 -34
- package/dist/js/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
- package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs.map +1 -1
- package/dist/js/components/src/lib/react/ReactAriaControlledValueFix.mjs +27 -6
- package/dist/js/components/src/lib/react/ReactAriaControlledValueFix.mjs.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Field/Field.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/context/formContext.d.ts +2 -1
- package/dist/types/integrations/react-hook-form/components/context/formContext.d.ts.map +1 -1
- package/dist/types/lib/react/ReactAriaControlledValueFix.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.2.0-alpha.545](https://github.com/mittwald/flow/compare/0.2.0-alpha.544...0.2.0-alpha.545) (2025-11-05)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **Alert:** fix icon does not update when status changes ([#2114](https://github.com/mittwald/flow/issues/2114)) ([8d93763](https://github.com/mittwald/flow/commit/8d9376306a9030e52372c67858070a3ac13fa802))
|
|
11
|
+
|
|
12
|
+
# [0.2.0-alpha.544](https://github.com/mittwald/flow/compare/0.2.0-alpha.543...0.2.0-alpha.544) (2025-11-04)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **Remote:** value for input and textareas stutter ([#2106](https://github.com/mittwald/flow/issues/2106)) ([5566c6c](https://github.com/mittwald/flow/commit/5566c6c2fa77a5c44aee5b1be3b8044d8defd26e))
|
|
17
|
+
|
|
6
18
|
# [0.2.0-alpha.543](https://github.com/mittwald/flow/compare/0.2.0-alpha.542...0.2.0-alpha.543) (2025-11-04)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @mittwald/flow-react-components
|
|
@@ -54,65 +54,7 @@
|
|
|
54
54
|
"description": "",
|
|
55
55
|
"displayName": "TunnelEntry",
|
|
56
56
|
"methods": [],
|
|
57
|
-
"props": {
|
|
58
|
-
"id": {
|
|
59
|
-
"defaultValue": null,
|
|
60
|
-
"description": "",
|
|
61
|
-
"name": "id",
|
|
62
|
-
"parent": {
|
|
63
|
-
"fileName": "packages/react-tunnel/dist/types/components/TunnelEntry.d.ts",
|
|
64
|
-
"name": "TunnelEntryProps"
|
|
65
|
-
},
|
|
66
|
-
"declarations": [
|
|
67
|
-
{
|
|
68
|
-
"fileName": "packages/react-tunnel/dist/types/components/TunnelEntry.d.ts",
|
|
69
|
-
"name": "TunnelEntryProps"
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
"required": false,
|
|
73
|
-
"type": {
|
|
74
|
-
"name": "string"
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"children": {
|
|
78
|
-
"defaultValue": null,
|
|
79
|
-
"description": "",
|
|
80
|
-
"name": "children",
|
|
81
|
-
"parent": {
|
|
82
|
-
"fileName": "packages/react-tunnel/dist/types/components/TunnelEntry.d.ts",
|
|
83
|
-
"name": "TunnelEntryProps"
|
|
84
|
-
},
|
|
85
|
-
"declarations": [
|
|
86
|
-
{
|
|
87
|
-
"fileName": "packages/react-tunnel/dist/types/components/TunnelEntry.d.ts",
|
|
88
|
-
"name": "TunnelEntryProps"
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
"required": false,
|
|
92
|
-
"type": {
|
|
93
|
-
"name": "TunnelEntryChildren"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"staticEntryId": {
|
|
97
|
-
"defaultValue": null,
|
|
98
|
-
"description": "Static entry ID instead of generated ID by `useId`",
|
|
99
|
-
"name": "staticEntryId",
|
|
100
|
-
"parent": {
|
|
101
|
-
"fileName": "packages/react-tunnel/dist/types/components/TunnelEntry.d.ts",
|
|
102
|
-
"name": "TunnelEntryProps"
|
|
103
|
-
},
|
|
104
|
-
"declarations": [
|
|
105
|
-
{
|
|
106
|
-
"fileName": "packages/react-tunnel/dist/types/components/TunnelEntry.d.ts",
|
|
107
|
-
"name": "TunnelEntryProps"
|
|
108
|
-
}
|
|
109
|
-
],
|
|
110
|
-
"required": false,
|
|
111
|
-
"type": {
|
|
112
|
-
"name": "string"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
57
|
+
"props": {}
|
|
116
58
|
},
|
|
117
59
|
{
|
|
118
60
|
"tags": {},
|
|
@@ -256693,10 +256635,10 @@
|
|
|
256693
256635
|
"name": "() => ArrayIterator<any>"
|
|
256694
256636
|
}
|
|
256695
256637
|
},
|
|
256696
|
-
"__@unscopables@
|
|
256638
|
+
"__@unscopables@3166": {
|
|
256697
256639
|
"defaultValue": null,
|
|
256698
256640
|
"description": "Is an object whose properties have the value 'true'\nwhen they will be absent when used in a 'with' statement.",
|
|
256699
|
-
"name": "__@unscopables@
|
|
256641
|
+
"name": "__@unscopables@3166",
|
|
256700
256642
|
"parent": {
|
|
256701
256643
|
"fileName": "flow/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts",
|
|
256702
256644
|
"name": "Array"
|
|
@@ -257529,10 +257471,10 @@
|
|
|
257529
257471
|
"name": "() => ArrayIterator<any>"
|
|
257530
257472
|
}
|
|
257531
257473
|
},
|
|
257532
|
-
"__@unscopables@
|
|
257474
|
+
"__@unscopables@3166": {
|
|
257533
257475
|
"defaultValue": null,
|
|
257534
257476
|
"description": "Is an object whose properties have the value 'true'\nwhen they will be absent when used in a 'with' statement.",
|
|
257535
|
-
"name": "__@unscopables@
|
|
257477
|
+
"name": "__@unscopables@3166",
|
|
257536
257478
|
"parent": {
|
|
257537
257479
|
"fileName": "flow/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts",
|
|
257538
257480
|
"name": "Array"
|
|
@@ -258365,10 +258307,10 @@
|
|
|
258365
258307
|
"name": "() => ArrayIterator<any>"
|
|
258366
258308
|
}
|
|
258367
258309
|
},
|
|
258368
|
-
"__@unscopables@
|
|
258310
|
+
"__@unscopables@3166": {
|
|
258369
258311
|
"defaultValue": null,
|
|
258370
258312
|
"description": "Is an object whose properties have the value 'true'\nwhen they will be absent when used in a 'with' statement.",
|
|
258371
|
-
"name": "__@unscopables@
|
|
258313
|
+
"name": "__@unscopables@3166",
|
|
258372
258314
|
"parent": {
|
|
258373
258315
|
"fileName": "flow/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts",
|
|
258374
258316
|
"name": "Array"
|
|
@@ -286679,6 +286621,14 @@
|
|
|
286679
286621
|
"methods": [],
|
|
286680
286622
|
"props": {}
|
|
286681
286623
|
},
|
|
286624
|
+
{
|
|
286625
|
+
"tags": {},
|
|
286626
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Footer/Footer.tsx",
|
|
286627
|
+
"description": "",
|
|
286628
|
+
"displayName": "Footer",
|
|
286629
|
+
"methods": [],
|
|
286630
|
+
"props": {}
|
|
286631
|
+
},
|
|
286682
286632
|
{
|
|
286683
286633
|
"tags": {},
|
|
286684
286634
|
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/Header.tsx",
|
|
@@ -286707,14 +286657,6 @@
|
|
|
286707
286657
|
}
|
|
286708
286658
|
}
|
|
286709
286659
|
},
|
|
286710
|
-
{
|
|
286711
|
-
"tags": {},
|
|
286712
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Footer/Footer.tsx",
|
|
286713
|
-
"description": "",
|
|
286714
|
-
"displayName": "Footer",
|
|
286715
|
-
"methods": [],
|
|
286716
|
-
"props": {}
|
|
286717
|
-
},
|
|
286718
286660
|
{
|
|
286719
286661
|
"tags": {},
|
|
286720
286662
|
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/DataLoader/DataLoaderSuspense.tsx",
|
|
@@ -328404,213 +328346,6 @@
|
|
|
328404
328346
|
"methods": [],
|
|
328405
328347
|
"props": {}
|
|
328406
328348
|
},
|
|
328407
|
-
{
|
|
328408
|
-
"tags": {},
|
|
328409
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx",
|
|
328410
|
-
"description": "",
|
|
328411
|
-
"displayName": "ViewModeMenuItem",
|
|
328412
|
-
"methods": [],
|
|
328413
|
-
"props": {
|
|
328414
|
-
"viewMode": {
|
|
328415
|
-
"defaultValue": null,
|
|
328416
|
-
"description": "",
|
|
328417
|
-
"name": "viewMode",
|
|
328418
|
-
"parent": {
|
|
328419
|
-
"fileName": "components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx",
|
|
328420
|
-
"name": "Props"
|
|
328421
|
-
},
|
|
328422
|
-
"declarations": [
|
|
328423
|
-
{
|
|
328424
|
-
"fileName": "components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx",
|
|
328425
|
-
"name": "Props"
|
|
328426
|
-
}
|
|
328427
|
-
],
|
|
328428
|
-
"required": true,
|
|
328429
|
-
"type": {
|
|
328430
|
-
"name": "ListViewMode"
|
|
328431
|
-
}
|
|
328432
|
-
}
|
|
328433
|
-
}
|
|
328434
|
-
},
|
|
328435
|
-
{
|
|
328436
|
-
"tags": {},
|
|
328437
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/ViewModeMenu.tsx",
|
|
328438
|
-
"description": "",
|
|
328439
|
-
"displayName": "ViewModeMenu",
|
|
328440
|
-
"methods": [],
|
|
328441
|
-
"props": {}
|
|
328442
|
-
},
|
|
328443
|
-
{
|
|
328444
|
-
"tags": {},
|
|
328445
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/SortingMenuItem.tsx",
|
|
328446
|
-
"description": "",
|
|
328447
|
-
"displayName": "SortingMenuItem",
|
|
328448
|
-
"methods": [],
|
|
328449
|
-
"props": {
|
|
328450
|
-
"sorting": {
|
|
328451
|
-
"defaultValue": null,
|
|
328452
|
-
"description": "",
|
|
328453
|
-
"name": "sorting",
|
|
328454
|
-
"parent": {
|
|
328455
|
-
"fileName": "components/src/components/List/components/Header/components/Settings/SortingMenuItem.tsx",
|
|
328456
|
-
"name": "Props"
|
|
328457
|
-
},
|
|
328458
|
-
"declarations": [
|
|
328459
|
-
{
|
|
328460
|
-
"fileName": "components/src/components/List/components/Header/components/Settings/SortingMenuItem.tsx",
|
|
328461
|
-
"name": "Props"
|
|
328462
|
-
}
|
|
328463
|
-
],
|
|
328464
|
-
"required": true,
|
|
328465
|
-
"type": {
|
|
328466
|
-
"name": "Sorting<never>"
|
|
328467
|
-
}
|
|
328468
|
-
}
|
|
328469
|
-
}
|
|
328470
|
-
},
|
|
328471
|
-
{
|
|
328472
|
-
"tags": {},
|
|
328473
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/SortingMenu.tsx",
|
|
328474
|
-
"description": "",
|
|
328475
|
-
"displayName": "SortingMenu",
|
|
328476
|
-
"methods": [],
|
|
328477
|
-
"props": {}
|
|
328478
|
-
},
|
|
328479
|
-
{
|
|
328480
|
-
"tags": {},
|
|
328481
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/SettingsMenu.tsx",
|
|
328482
|
-
"description": "",
|
|
328483
|
-
"displayName": "SettingsMenu",
|
|
328484
|
-
"methods": [],
|
|
328485
|
-
"props": {}
|
|
328486
|
-
},
|
|
328487
|
-
{
|
|
328488
|
-
"tags": {},
|
|
328489
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/SearchField/SearchField.tsx",
|
|
328490
|
-
"description": "",
|
|
328491
|
-
"displayName": "SearchField",
|
|
328492
|
-
"methods": [],
|
|
328493
|
-
"props": {
|
|
328494
|
-
"search": {
|
|
328495
|
-
"defaultValue": null,
|
|
328496
|
-
"description": "",
|
|
328497
|
-
"name": "search",
|
|
328498
|
-
"parent": {
|
|
328499
|
-
"fileName": "components/src/components/List/components/Header/components/SearchField/SearchField.tsx",
|
|
328500
|
-
"name": "Props"
|
|
328501
|
-
},
|
|
328502
|
-
"declarations": [
|
|
328503
|
-
{
|
|
328504
|
-
"fileName": "components/src/components/List/components/Header/components/SearchField/SearchField.tsx",
|
|
328505
|
-
"name": "Props"
|
|
328506
|
-
}
|
|
328507
|
-
],
|
|
328508
|
-
"required": true,
|
|
328509
|
-
"type": {
|
|
328510
|
-
"name": "Search<never>"
|
|
328511
|
-
}
|
|
328512
|
-
},
|
|
328513
|
-
"className": {
|
|
328514
|
-
"defaultValue": null,
|
|
328515
|
-
"description": "The elements class name.",
|
|
328516
|
-
"name": "className",
|
|
328517
|
-
"parent": {
|
|
328518
|
-
"fileName": "components/src/lib/types/props.ts",
|
|
328519
|
-
"name": "PropsWithClassName"
|
|
328520
|
-
},
|
|
328521
|
-
"declarations": [
|
|
328522
|
-
{
|
|
328523
|
-
"fileName": "components/src/lib/types/props.ts",
|
|
328524
|
-
"name": "PropsWithClassName"
|
|
328525
|
-
}
|
|
328526
|
-
],
|
|
328527
|
-
"required": false,
|
|
328528
|
-
"type": {
|
|
328529
|
-
"name": "string"
|
|
328530
|
-
}
|
|
328531
|
-
}
|
|
328532
|
-
}
|
|
328533
|
-
},
|
|
328534
|
-
{
|
|
328535
|
-
"tags": {},
|
|
328536
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/FilterMenuList.tsx",
|
|
328537
|
-
"description": "",
|
|
328538
|
-
"displayName": "FilterMenuList",
|
|
328539
|
-
"methods": [],
|
|
328540
|
-
"props": {}
|
|
328541
|
-
},
|
|
328542
|
-
{
|
|
328543
|
-
"tags": {},
|
|
328544
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/FilterMenuItem.tsx",
|
|
328545
|
-
"description": "",
|
|
328546
|
-
"displayName": "FilterMenuItem",
|
|
328547
|
-
"methods": [],
|
|
328548
|
-
"props": {
|
|
328549
|
-
"filterValue": {
|
|
328550
|
-
"defaultValue": null,
|
|
328551
|
-
"description": "",
|
|
328552
|
-
"name": "filterValue",
|
|
328553
|
-
"parent": {
|
|
328554
|
-
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenuItem.tsx",
|
|
328555
|
-
"name": "Props"
|
|
328556
|
-
},
|
|
328557
|
-
"declarations": [
|
|
328558
|
-
{
|
|
328559
|
-
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenuItem.tsx",
|
|
328560
|
-
"name": "Props"
|
|
328561
|
-
}
|
|
328562
|
-
],
|
|
328563
|
-
"required": true,
|
|
328564
|
-
"type": {
|
|
328565
|
-
"name": "FilterValue"
|
|
328566
|
-
}
|
|
328567
|
-
}
|
|
328568
|
-
}
|
|
328569
|
-
},
|
|
328570
|
-
{
|
|
328571
|
-
"tags": {},
|
|
328572
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/FilterMenu.tsx",
|
|
328573
|
-
"description": "",
|
|
328574
|
-
"displayName": "FilterMenu",
|
|
328575
|
-
"methods": [],
|
|
328576
|
-
"props": {
|
|
328577
|
-
"filter": {
|
|
328578
|
-
"defaultValue": null,
|
|
328579
|
-
"description": "",
|
|
328580
|
-
"name": "filter",
|
|
328581
|
-
"parent": {
|
|
328582
|
-
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenu.tsx",
|
|
328583
|
-
"name": "Props"
|
|
328584
|
-
},
|
|
328585
|
-
"declarations": [
|
|
328586
|
-
{
|
|
328587
|
-
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenu.tsx",
|
|
328588
|
-
"name": "Props"
|
|
328589
|
-
}
|
|
328590
|
-
],
|
|
328591
|
-
"required": true,
|
|
328592
|
-
"type": {
|
|
328593
|
-
"name": "Filter<never, never, never>"
|
|
328594
|
-
}
|
|
328595
|
-
}
|
|
328596
|
-
}
|
|
328597
|
-
},
|
|
328598
|
-
{
|
|
328599
|
-
"tags": {},
|
|
328600
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/CombinedFilterMenu.tsx",
|
|
328601
|
-
"description": "",
|
|
328602
|
-
"displayName": "CombinedFilterMenu",
|
|
328603
|
-
"methods": [],
|
|
328604
|
-
"props": {}
|
|
328605
|
-
},
|
|
328606
|
-
{
|
|
328607
|
-
"tags": {},
|
|
328608
|
-
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.tsx",
|
|
328609
|
-
"description": "",
|
|
328610
|
-
"displayName": "ActiveFilters",
|
|
328611
|
-
"methods": [],
|
|
328612
|
-
"props": {}
|
|
328613
|
-
},
|
|
328614
328349
|
{
|
|
328615
328350
|
"tags": {},
|
|
328616
328351
|
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Footer/components/ShowNextBatchButton/ShowNextBatchButton.tsx",
|
|
@@ -336438,6 +336173,213 @@
|
|
|
336438
336173
|
}
|
|
336439
336174
|
}
|
|
336440
336175
|
},
|
|
336176
|
+
{
|
|
336177
|
+
"tags": {},
|
|
336178
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx",
|
|
336179
|
+
"description": "",
|
|
336180
|
+
"displayName": "ViewModeMenuItem",
|
|
336181
|
+
"methods": [],
|
|
336182
|
+
"props": {
|
|
336183
|
+
"viewMode": {
|
|
336184
|
+
"defaultValue": null,
|
|
336185
|
+
"description": "",
|
|
336186
|
+
"name": "viewMode",
|
|
336187
|
+
"parent": {
|
|
336188
|
+
"fileName": "components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx",
|
|
336189
|
+
"name": "Props"
|
|
336190
|
+
},
|
|
336191
|
+
"declarations": [
|
|
336192
|
+
{
|
|
336193
|
+
"fileName": "components/src/components/List/components/Header/components/Settings/ViewModeMenuItem.tsx",
|
|
336194
|
+
"name": "Props"
|
|
336195
|
+
}
|
|
336196
|
+
],
|
|
336197
|
+
"required": true,
|
|
336198
|
+
"type": {
|
|
336199
|
+
"name": "ListViewMode"
|
|
336200
|
+
}
|
|
336201
|
+
}
|
|
336202
|
+
}
|
|
336203
|
+
},
|
|
336204
|
+
{
|
|
336205
|
+
"tags": {},
|
|
336206
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/ViewModeMenu.tsx",
|
|
336207
|
+
"description": "",
|
|
336208
|
+
"displayName": "ViewModeMenu",
|
|
336209
|
+
"methods": [],
|
|
336210
|
+
"props": {}
|
|
336211
|
+
},
|
|
336212
|
+
{
|
|
336213
|
+
"tags": {},
|
|
336214
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/SortingMenuItem.tsx",
|
|
336215
|
+
"description": "",
|
|
336216
|
+
"displayName": "SortingMenuItem",
|
|
336217
|
+
"methods": [],
|
|
336218
|
+
"props": {
|
|
336219
|
+
"sorting": {
|
|
336220
|
+
"defaultValue": null,
|
|
336221
|
+
"description": "",
|
|
336222
|
+
"name": "sorting",
|
|
336223
|
+
"parent": {
|
|
336224
|
+
"fileName": "components/src/components/List/components/Header/components/Settings/SortingMenuItem.tsx",
|
|
336225
|
+
"name": "Props"
|
|
336226
|
+
},
|
|
336227
|
+
"declarations": [
|
|
336228
|
+
{
|
|
336229
|
+
"fileName": "components/src/components/List/components/Header/components/Settings/SortingMenuItem.tsx",
|
|
336230
|
+
"name": "Props"
|
|
336231
|
+
}
|
|
336232
|
+
],
|
|
336233
|
+
"required": true,
|
|
336234
|
+
"type": {
|
|
336235
|
+
"name": "Sorting<never>"
|
|
336236
|
+
}
|
|
336237
|
+
}
|
|
336238
|
+
}
|
|
336239
|
+
},
|
|
336240
|
+
{
|
|
336241
|
+
"tags": {},
|
|
336242
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/SortingMenu.tsx",
|
|
336243
|
+
"description": "",
|
|
336244
|
+
"displayName": "SortingMenu",
|
|
336245
|
+
"methods": [],
|
|
336246
|
+
"props": {}
|
|
336247
|
+
},
|
|
336248
|
+
{
|
|
336249
|
+
"tags": {},
|
|
336250
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Settings/SettingsMenu.tsx",
|
|
336251
|
+
"description": "",
|
|
336252
|
+
"displayName": "SettingsMenu",
|
|
336253
|
+
"methods": [],
|
|
336254
|
+
"props": {}
|
|
336255
|
+
},
|
|
336256
|
+
{
|
|
336257
|
+
"tags": {},
|
|
336258
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/SearchField/SearchField.tsx",
|
|
336259
|
+
"description": "",
|
|
336260
|
+
"displayName": "SearchField",
|
|
336261
|
+
"methods": [],
|
|
336262
|
+
"props": {
|
|
336263
|
+
"search": {
|
|
336264
|
+
"defaultValue": null,
|
|
336265
|
+
"description": "",
|
|
336266
|
+
"name": "search",
|
|
336267
|
+
"parent": {
|
|
336268
|
+
"fileName": "components/src/components/List/components/Header/components/SearchField/SearchField.tsx",
|
|
336269
|
+
"name": "Props"
|
|
336270
|
+
},
|
|
336271
|
+
"declarations": [
|
|
336272
|
+
{
|
|
336273
|
+
"fileName": "components/src/components/List/components/Header/components/SearchField/SearchField.tsx",
|
|
336274
|
+
"name": "Props"
|
|
336275
|
+
}
|
|
336276
|
+
],
|
|
336277
|
+
"required": true,
|
|
336278
|
+
"type": {
|
|
336279
|
+
"name": "Search<never>"
|
|
336280
|
+
}
|
|
336281
|
+
},
|
|
336282
|
+
"className": {
|
|
336283
|
+
"defaultValue": null,
|
|
336284
|
+
"description": "The elements class name.",
|
|
336285
|
+
"name": "className",
|
|
336286
|
+
"parent": {
|
|
336287
|
+
"fileName": "components/src/lib/types/props.ts",
|
|
336288
|
+
"name": "PropsWithClassName"
|
|
336289
|
+
},
|
|
336290
|
+
"declarations": [
|
|
336291
|
+
{
|
|
336292
|
+
"fileName": "components/src/lib/types/props.ts",
|
|
336293
|
+
"name": "PropsWithClassName"
|
|
336294
|
+
}
|
|
336295
|
+
],
|
|
336296
|
+
"required": false,
|
|
336297
|
+
"type": {
|
|
336298
|
+
"name": "string"
|
|
336299
|
+
}
|
|
336300
|
+
}
|
|
336301
|
+
}
|
|
336302
|
+
},
|
|
336303
|
+
{
|
|
336304
|
+
"tags": {},
|
|
336305
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/FilterMenuList.tsx",
|
|
336306
|
+
"description": "",
|
|
336307
|
+
"displayName": "FilterMenuList",
|
|
336308
|
+
"methods": [],
|
|
336309
|
+
"props": {}
|
|
336310
|
+
},
|
|
336311
|
+
{
|
|
336312
|
+
"tags": {},
|
|
336313
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/FilterMenuItem.tsx",
|
|
336314
|
+
"description": "",
|
|
336315
|
+
"displayName": "FilterMenuItem",
|
|
336316
|
+
"methods": [],
|
|
336317
|
+
"props": {
|
|
336318
|
+
"filterValue": {
|
|
336319
|
+
"defaultValue": null,
|
|
336320
|
+
"description": "",
|
|
336321
|
+
"name": "filterValue",
|
|
336322
|
+
"parent": {
|
|
336323
|
+
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenuItem.tsx",
|
|
336324
|
+
"name": "Props"
|
|
336325
|
+
},
|
|
336326
|
+
"declarations": [
|
|
336327
|
+
{
|
|
336328
|
+
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenuItem.tsx",
|
|
336329
|
+
"name": "Props"
|
|
336330
|
+
}
|
|
336331
|
+
],
|
|
336332
|
+
"required": true,
|
|
336333
|
+
"type": {
|
|
336334
|
+
"name": "FilterValue"
|
|
336335
|
+
}
|
|
336336
|
+
}
|
|
336337
|
+
}
|
|
336338
|
+
},
|
|
336339
|
+
{
|
|
336340
|
+
"tags": {},
|
|
336341
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/FilterMenu.tsx",
|
|
336342
|
+
"description": "",
|
|
336343
|
+
"displayName": "FilterMenu",
|
|
336344
|
+
"methods": [],
|
|
336345
|
+
"props": {
|
|
336346
|
+
"filter": {
|
|
336347
|
+
"defaultValue": null,
|
|
336348
|
+
"description": "",
|
|
336349
|
+
"name": "filter",
|
|
336350
|
+
"parent": {
|
|
336351
|
+
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenu.tsx",
|
|
336352
|
+
"name": "Props"
|
|
336353
|
+
},
|
|
336354
|
+
"declarations": [
|
|
336355
|
+
{
|
|
336356
|
+
"fileName": "components/src/components/List/components/Header/components/Filters/FilterMenu.tsx",
|
|
336357
|
+
"name": "Props"
|
|
336358
|
+
}
|
|
336359
|
+
],
|
|
336360
|
+
"required": true,
|
|
336361
|
+
"type": {
|
|
336362
|
+
"name": "Filter<never, never, never>"
|
|
336363
|
+
}
|
|
336364
|
+
}
|
|
336365
|
+
}
|
|
336366
|
+
},
|
|
336367
|
+
{
|
|
336368
|
+
"tags": {},
|
|
336369
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/Filters/CombinedFilterMenu.tsx",
|
|
336370
|
+
"description": "",
|
|
336371
|
+
"displayName": "CombinedFilterMenu",
|
|
336372
|
+
"methods": [],
|
|
336373
|
+
"props": {}
|
|
336374
|
+
},
|
|
336375
|
+
{
|
|
336376
|
+
"tags": {},
|
|
336377
|
+
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.tsx",
|
|
336378
|
+
"description": "",
|
|
336379
|
+
"displayName": "ActiveFilters",
|
|
336380
|
+
"methods": [],
|
|
336381
|
+
"props": {}
|
|
336382
|
+
},
|
|
336441
336383
|
{
|
|
336442
336384
|
"tags": {},
|
|
336443
336385
|
"filePath": "/home/runner/work/flow/flow/packages/components/src/components/List/components/Items/components/Item/hooks/useGridItemProps.tsx",
|
|
@@ -34,7 +34,7 @@ const Alert = flowComponent("Alert", (props) => {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
return /* @__PURE__ */ jsx("aside", { ...rest, className: rootClassName, ref, children: /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children }) });
|
|
37
|
+
return /* @__PURE__ */ jsx("aside", { ...rest, className: rootClassName, ref, children: /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, dependencies: [status], children }) });
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
export { Alert, Alert as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.mjs","sources":["../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\n\nexport interface AlertProps\n extends PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const rootClassName = clsx(styles.alert, styles[status], className);\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n Button: {\n size: \"s\",\n },\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n </aside>\n );\n});\n\nexport default Alert;\n"],"names":["props"],"mappings":";;;;;;;;;AAgBO,MAAM,KAAA,GAAQ,aAAA,CAAc,OAAA,EAAS,CAAC,KAAA,KAAU;AACrD,EAAA,MAAM,EAAE,UAAU,SAAA,EAAW,MAAA,GAAS,QAAQ,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAE/D,EAAA,MAAM,gBAAgB,IAAA,CAAK,MAAA,CAAO,OAAO,MAAA,CAAO,MAAM,GAAG,SAAS,CAAA;AAElE,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,KAAA,EAAO,CAAA;AAAA,MACP,IAAA,EAAM,GAAA;AAAA,MACN,QAAA,EAAU,OAAA,CAAQ,CAACA,MAAAA,qBACjB,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,MAAA,EAAgB,SAAA,EAAW,MAAA,CAAO,IAAA,EAAM,CAAA;AAAA,QAClDA,MAAAA,CAAM;AAAA,OAAA,EACT,CACD;AAAA,KACH;AAAA,IACA,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM;AAAA,OACR;AAAA,MACA,WAAA,EAAa;AAAA,QACX,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM;AAAA;AACR;AACF;AACF,GACF;AAEA,EAAA,
|
|
1
|
+
{"version":3,"file":"Alert.mjs","sources":["../../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { AlertIcon } from \"@/components/AlertIcon\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithStatus } from \"@/lib/types/props\";\nimport clsx from \"clsx\";\nimport type { ComponentProps, PropsWithChildren } from \"react\";\nimport styles from \"./Alert.module.scss\";\n\nexport interface AlertProps\n extends PropsWithChildren<ComponentProps<\"aside\">>,\n PropsWithStatus,\n FlowComponentProps<HTMLElement> {}\n\n/** @flr-generate all */\nexport const Alert = flowComponent(\"Alert\", (props) => {\n const { children, className, status = \"info\", ref, ...rest } = props;\n\n const rootClassName = clsx(styles.alert, styles[status], className);\n\n const propsContext: PropsContext = {\n Heading: {\n className: styles.heading,\n level: 3,\n size: \"s\",\n children: dynamic((props) => (\n <>\n <AlertIcon status={status} className={styles.icon} />\n {props.children}\n </>\n )),\n },\n Content: {\n className: styles.content,\n Button: {\n size: \"s\",\n },\n ActionGroup: {\n Button: {\n size: \"s\",\n },\n },\n },\n };\n\n return (\n <aside {...rest} className={rootClassName} ref={ref}>\n <PropsContextProvider props={propsContext} dependencies={[status]}>\n {children}\n </PropsContextProvider>\n </aside>\n );\n});\n\nexport default Alert;\n"],"names":["props"],"mappings":";;;;;;;;;AAgBO,MAAM,KAAA,GAAQ,aAAA,CAAc,OAAA,EAAS,CAAC,KAAA,KAAU;AACrD,EAAA,MAAM,EAAE,UAAU,SAAA,EAAW,MAAA,GAAS,QAAQ,GAAA,EAAK,GAAG,MAAK,GAAI,KAAA;AAE/D,EAAA,MAAM,gBAAgB,IAAA,CAAK,MAAA,CAAO,OAAO,MAAA,CAAO,MAAM,GAAG,SAAS,CAAA;AAElE,EAAA,MAAM,YAAA,GAA6B;AAAA,IACjC,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,KAAA,EAAO,CAAA;AAAA,MACP,IAAA,EAAM,GAAA;AAAA,MACN,QAAA,EAAU,OAAA,CAAQ,CAACA,MAAAA,qBACjB,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,MAAA,EAAgB,SAAA,EAAW,MAAA,CAAO,IAAA,EAAM,CAAA;AAAA,QAClDA,MAAAA,CAAM;AAAA,OAAA,EACT,CACD;AAAA,KACH;AAAA,IACA,OAAA,EAAS;AAAA,MACP,WAAW,MAAA,CAAO,OAAA;AAAA,MAClB,MAAA,EAAQ;AAAA,QACN,IAAA,EAAM;AAAA,OACR;AAAA,MACA,WAAA,EAAa;AAAA,QACX,MAAA,EAAQ;AAAA,UACN,IAAA,EAAM;AAAA;AACR;AACF;AACF,GACF;AAEA,EAAA,2BACG,OAAA,EAAA,EAAO,GAAG,IAAA,EAAM,SAAA,EAAW,eAAe,GAAA,EACzC,QAAA,kBAAA,GAAA,CAAC,oBAAA,EAAA,EAAqB,KAAA,EAAO,cAAc,YAAA,EAAc,CAAC,MAAM,CAAA,EAC7D,UACH,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -46,6 +46,7 @@ function Field(props) {
|
|
|
46
46
|
name,
|
|
47
47
|
form: formContext.id,
|
|
48
48
|
isRequired: !!rest.rules?.required,
|
|
49
|
+
isReadOnly: formContext.isReadOnly,
|
|
49
50
|
validationBehavior: "aria",
|
|
50
51
|
defaultValue,
|
|
51
52
|
isInvalid: isFieldInvalid,
|
|
@@ -100,7 +101,12 @@ function Field(props) {
|
|
|
100
101
|
PropsContextProvider,
|
|
101
102
|
{
|
|
102
103
|
props: propsContext,
|
|
103
|
-
dependencies: [
|
|
104
|
+
dependencies: [
|
|
105
|
+
controller.fieldState,
|
|
106
|
+
controller.field,
|
|
107
|
+
value,
|
|
108
|
+
formContext.isReadOnly
|
|
109
|
+
],
|
|
104
110
|
children
|
|
105
111
|
}
|
|
106
112
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { inheritProps } from \"@/lib/propsContext/inherit/types\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const fieldProps = {\n ...inheritProps,\n ...controller.field,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const { value: ignoredValue, ...fieldPropsWithoutValue } = fieldProps;\n\n const propsContext: PropsContext = {\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldPropsWithoutValue,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[controller.fieldState
|
|
1
|
+
{"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport { dynamic, type PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { inheritProps } from \"@/lib/propsContext/inherit/types\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const fieldProps = {\n ...inheritProps,\n ...controller.field,\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const { value: ignoredValue, ...fieldPropsWithoutValue } = fieldProps;\n\n const propsContext: PropsContext = {\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldPropsWithoutValue,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"names":[],"mappings":";;;;;;;;;;;;AAoBO,SAAS,MAA6B,KAAA,EAAsB;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,GAAG,MAAK,GAAI,KAAA;AAElD,EAAA,MAAM,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,MAAM,aAAa,aAAA,CAAc;AAAA,IAC/B,GAAG,KAAA;AAAA,IACH,KAAA,EAAO;AAAA,MACL,GAAG,KAAA,CAAM,KAAA;AAAA,MACT,SAAA,EACE,OAAO,IAAA,CAAK,KAAA,EAAO,cAAc,QAAA,GAC7B;AAAA,QACE,KAAA,EAAO,KAAK,KAAA,CAAM,SAAA;AAAA,QAClB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AA;AAAA,QACX,KAAA;AAAA,QACA,WAAA,CAAY;AAAA,OACd;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ;AAEO,MAAM,UAAA,GAAa,CACxB,WAAA,KACoB;;;;"}
|
|
@@ -4,13 +4,10 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { FormContextProvider } from '../context/formContext.mjs';
|
|
5
5
|
import { useState, useId, useMemo } from 'react';
|
|
6
6
|
import { FormProvider } from 'react-hook-form';
|
|
7
|
-
import '../../../../lib/propsContext/propsContext.mjs';
|
|
8
|
-
import { PropsContextProvider } from '../../../../lib/propsContext/components/PropsContextProvider.mjs';
|
|
9
7
|
import { Action } from '../../../../components/Action/Action.mjs';
|
|
10
8
|
import 'react-aria';
|
|
11
9
|
import '@react-aria/live-announcer';
|
|
12
10
|
import { useRegisterActionStateContext } from './lib/useRegisterActionStateContext.mjs';
|
|
13
|
-
import { inheritProps } from '../../../../lib/propsContext/inherit/types.mjs';
|
|
14
11
|
|
|
15
12
|
const DefaultFormComponent = (p) => /* @__PURE__ */ jsx("form", { ...p });
|
|
16
13
|
function Form(props) {
|
|
@@ -22,7 +19,7 @@ function Form(props) {
|
|
|
22
19
|
isReadOnly: isReadOnlyFromProps,
|
|
23
20
|
...formProps
|
|
24
21
|
} = props;
|
|
25
|
-
const [readonlyContextState,
|
|
22
|
+
const [readonlyContextState, setReadOnlyContextState] = useState(!!isReadOnlyFromProps);
|
|
26
23
|
const isReadOnly = isReadOnlyFromProps || readonlyContextState;
|
|
27
24
|
const formId = useId();
|
|
28
25
|
const FormViewComponent = useMemo(() => FormView, [formId]);
|
|
@@ -41,37 +38,15 @@ function Form(props) {
|
|
|
41
38
|
return result;
|
|
42
39
|
})(formEvent);
|
|
43
40
|
};
|
|
44
|
-
|
|
45
|
-
...inheritProps,
|
|
46
|
-
isReadOnly
|
|
47
|
-
};
|
|
48
|
-
const propsContext = {
|
|
49
|
-
SearchField: readonlyPropsContext,
|
|
50
|
-
TextField: readonlyPropsContext,
|
|
51
|
-
TextArea: readonlyPropsContext,
|
|
52
|
-
MarkdownEditor: readonlyPropsContext,
|
|
53
|
-
Checkbox: readonlyPropsContext,
|
|
54
|
-
CheckboxGroup: readonlyPropsContext,
|
|
55
|
-
CheckboxButton: readonlyPropsContext,
|
|
56
|
-
FileField: readonlyPropsContext,
|
|
57
|
-
FileDropZone: readonlyPropsContext,
|
|
58
|
-
NumberField: readonlyPropsContext,
|
|
59
|
-
RadioGroup: readonlyPropsContext,
|
|
60
|
-
Switch: readonlyPropsContext,
|
|
61
|
-
Slider: readonlyPropsContext,
|
|
62
|
-
PasswordCreationField: readonlyPropsContext,
|
|
63
|
-
DatePicker: readonlyPropsContext,
|
|
64
|
-
DateRangePicker: readonlyPropsContext,
|
|
65
|
-
TimeField: readonlyPropsContext,
|
|
66
|
-
SegmentedControl: readonlyPropsContext,
|
|
67
|
-
Select: readonlyPropsContext,
|
|
68
|
-
ComboBox: readonlyPropsContext,
|
|
69
|
-
Button: readonlyPropsContext
|
|
70
|
-
};
|
|
71
|
-
return /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, dependencies: [isReadOnly], children: /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsx(
|
|
41
|
+
return /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsx(
|
|
72
42
|
FormContextProvider,
|
|
73
43
|
{
|
|
74
|
-
value: {
|
|
44
|
+
value: {
|
|
45
|
+
form,
|
|
46
|
+
id: formId,
|
|
47
|
+
isReadOnly,
|
|
48
|
+
setReadOnly: setReadOnlyContextState
|
|
49
|
+
},
|
|
75
50
|
children: /* @__PURE__ */ jsx(Action, { actionModel: action, children: /* @__PURE__ */ jsx(
|
|
76
51
|
FormViewComponent,
|
|
77
52
|
{
|
|
@@ -82,7 +57,7 @@ function Form(props) {
|
|
|
82
57
|
}
|
|
83
58
|
) })
|
|
84
59
|
}
|
|
85
|
-
) })
|
|
60
|
+
) });
|
|
86
61
|
}
|
|
87
62
|
|
|
88
63
|
export { Form, Form as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import { FormContextProvider } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FormEvent,\n type FormEventHandler,\n type PropsWithChildren,\n useId,\n useMemo,\n useState,\n} from \"react\";\nimport type {\n FieldValues,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\nimport {
|
|
1
|
+
{"version":3,"file":"Form.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"sourcesContent":["import { FormContextProvider } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport {\n type ComponentProps,\n type ComponentType,\n type FormEvent,\n type FormEventHandler,\n type PropsWithChildren,\n useId,\n useMemo,\n useState,\n} from \"react\";\nimport type {\n FieldValues,\n SubmitHandler,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { FormProvider as RhfFormContextProvider } from \"react-hook-form\";\nimport { Action } from \"@/components/Action\";\nimport { useRegisterActionStateContext } from \"@/integrations/react-hook-form/components/Form/lib/useRegisterActionStateContext\";\n\nexport type FormOnSubmitHandler<F extends FieldValues> = SubmitHandler<F>;\n\ntype FormComponentType = ComponentType<\n PropsWithChildren<{\n id: string;\n onSubmit?: FormEventHandler | FormOnSubmitHandler<never>;\n }>\n>;\n\nexport interface FormProps<F extends FieldValues>\n extends Omit<ComponentProps<\"form\">, \"onSubmit\">,\n PropsWithChildren {\n form: UseFormReturn<F>;\n onSubmit: FormOnSubmitHandler<F>;\n formComponent?: FormComponentType;\n isReadOnly?: boolean;\n}\n\nconst DefaultFormComponent: FormComponentType = (p) => <form {...p} />;\n\nexport function Form<F extends FieldValues>(props: FormProps<F>) {\n const {\n form,\n children,\n onSubmit,\n formComponent: FormView = DefaultFormComponent,\n isReadOnly: isReadOnlyFromProps,\n ...formProps\n } = props;\n\n const [readonlyContextState, setReadOnlyContextState] =\n useState(!!isReadOnlyFromProps);\n\n const isReadOnly = isReadOnlyFromProps || readonlyContextState;\n\n const formId = useId();\n const FormViewComponent = useMemo(() => FormView, [formId]);\n const { action, registerSubmitResult } = useRegisterActionStateContext(form);\n\n const handleOnSubmit = (e?: FormEvent<HTMLFormElement> | F) => {\n const { isSubmitting, isValidating } = form.control._formState;\n const formEvent =\n e && \"nativeEvent\" in e ? (e as FormEvent<HTMLFormElement>) : undefined;\n\n formEvent?.stopPropagation();\n\n if (isSubmitting || isValidating) {\n formEvent?.preventDefault();\n return;\n }\n\n form.handleSubmit((values) => {\n const result = onSubmit(values, formEvent);\n registerSubmitResult(result);\n return result;\n })(formEvent);\n };\n\n return (\n <RhfFormContextProvider {...form}>\n <FormContextProvider\n value={{\n form,\n id: formId,\n isReadOnly,\n setReadOnly: setReadOnlyContextState,\n }}\n >\n <Action actionModel={action}>\n <FormViewComponent\n {...formProps}\n id={formId}\n onSubmit={handleOnSubmit}\n >\n {children}\n </FormViewComponent>\n </Action>\n </FormContextProvider>\n </RhfFormContextProvider>\n );\n}\n\nexport default Form;\n"],"names":["RhfFormContextProvider"],"mappings":";;;;;;;;;AAsCA,MAAM,uBAA0C,CAAC,CAAA,qBAAM,GAAA,CAAC,MAAA,EAAA,EAAM,GAAG,CAAA,EAAG,CAAA;AAE7D,SAAS,KAA4B,KAAA,EAAqB;AAC/D,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA,eAAe,QAAA,GAAW,oBAAA;AAAA,IAC1B,UAAA,EAAY,mBAAA;AAAA,IACZ,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,CAAC,oBAAA,EAAsB,uBAAuB,IAClD,QAAA,CAAS,CAAC,CAAC,mBAAmB,CAAA;AAEhC,EAAA,MAAM,aAAa,mBAA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;AAAA,UACJ,QAAA,EAAU,cAAA;AAAA,UAET;AAAA;AAAA,OACH,EACF;AAAA;AAAA,GACF,EACF,CAAA;AAEJ;;;;"}
|
package/dist/js/components/src/integrations/react-hook-form/components/context/formContext.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formContext.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/context/formContext.ts"],"sourcesContent":["import type { FieldValues, UseFormReturn } from \"react-hook-form\";\nimport { createContext, useContext, type Dispatch } from \"react\";\nimport invariant from \"invariant\";\n\ninterface FormContext<F extends FieldValues> {\n form: UseFormReturn<F>;\n id: string;\n
|
|
1
|
+
{"version":3,"file":"formContext.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/context/formContext.ts"],"sourcesContent":["import type { FieldValues, UseFormReturn } from \"react-hook-form\";\nimport { createContext, useContext, type Dispatch } from \"react\";\nimport invariant from \"invariant\";\n\ninterface FormContext<F extends FieldValues> {\n form: UseFormReturn<F>;\n id: string;\n isReadOnly: boolean;\n setReadOnly: Dispatch<React.SetStateAction<boolean>>;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFormContext = FormContext<any>;\n\nexport const formContext = createContext<AnyFormContext | undefined>(undefined);\n\nexport const FormContextProvider = formContext.Provider;\n\nexport const useFormContext = <F extends FieldValues>(): FormContext<F> => {\n const ctx = useContext(formContext);\n invariant(\n !!ctx,\n \"Could not useFormContext() outside a Form, or multiple versions of Flow installed.\",\n );\n return ctx;\n};\n\nexport const useOptionalFormContext = <F extends FieldValues>() =>\n useContext(formContext) as FormContext<F> | undefined;\n"],"names":[],"mappings":";;;AAcO,MAAM,WAAA,GAAc,cAA0C,MAAS;AAEvE,MAAM,sBAAsB,WAAA,CAAY;AAExC,MAAM,iBAAiB,MAA6C;AACzE,EAAA,MAAM,GAAA,GAAM,WAAW,WAAW,CAAA;AAClC,EAAA,SAAA;AAAA,IACE,CAAC,CAAC,GAAA;AAAA,IACF;AAAA,GACF;AACA,EAAA,OAAO,GAAA;AACT;AAEO,MAAM,sBAAA,GAAyB,MACpC,UAAA,CAAW,WAAW;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* */
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import * as Aria from 'react-aria-components';
|
|
5
|
-
import { Children, isValidElement, useLayoutEffect } from 'react';
|
|
5
|
+
import { Children, isValidElement, useRef, useDeferredValue, useLayoutEffect } from 'react';
|
|
6
6
|
import { emitElementValueChange } from './emitElementValueChange.mjs';
|
|
7
7
|
|
|
8
8
|
const ReactAriaControlledValueFix = (props) => {
|
|
@@ -17,13 +17,34 @@ const ReactAriaControlledValueFix = (props) => {
|
|
|
17
17
|
ref,
|
|
18
18
|
context
|
|
19
19
|
);
|
|
20
|
+
const elementRef = contextRef.current;
|
|
21
|
+
const isInFocus = useRef(false);
|
|
22
|
+
const isValidElementType = elementRef && (elementRef instanceof HTMLInputElement || elementRef instanceof HTMLTextAreaElement);
|
|
23
|
+
const deferredValueFromContext = useDeferredValue(String(contextProps.value));
|
|
20
24
|
useLayoutEffect(() => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const newValue = String(contextProps.value ?? "");
|
|
24
|
-
emitElementValueChange(element, newValue);
|
|
25
|
+
if (!isValidElementType) {
|
|
26
|
+
return;
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
emitElementValueChange(elementRef, deferredValueFromContext);
|
|
29
|
+
const onFocus = (event) => {
|
|
30
|
+
isInFocus.current = !!event?.isTrusted;
|
|
31
|
+
};
|
|
32
|
+
const onBlur = () => {
|
|
33
|
+
isInFocus.current = false;
|
|
34
|
+
};
|
|
35
|
+
elementRef?.addEventListener("focus", onFocus);
|
|
36
|
+
elementRef?.addEventListener("blur", onBlur);
|
|
37
|
+
return () => {
|
|
38
|
+
elementRef?.removeEventListener("focus", onFocus);
|
|
39
|
+
elementRef?.removeEventListener("blur", onBlur);
|
|
40
|
+
};
|
|
41
|
+
}, [elementRef]);
|
|
42
|
+
useLayoutEffect(() => {
|
|
43
|
+
if (!isValidElementType || isInFocus.current) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
emitElementValueChange(elementRef, deferredValueFromContext);
|
|
47
|
+
}, [deferredValueFromContext]);
|
|
27
48
|
const uncontrolledContextProps = {
|
|
28
49
|
...contextProps,
|
|
29
50
|
value: void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactAriaControlledValueFix.mjs","sources":["../../../../../../src/lib/react/ReactAriaControlledValueFix.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport {\n Children,\n isValidElement,\n type Context,\n type FC,\n type ForwardedRef,\n type PropsWithChildren,\n useLayoutEffect,\n} from \"react\";\nimport { emitElementValueChange } from \"@/lib/react/emitElementValueChange\";\n\nexport interface ReactAriaControlledValueFixProps extends PropsWithChildren {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n inputContext: Context<any>;\n props: unknown;\n}\n\ninterface ChildProps {\n [key: string]: unknown;\n ref: ForwardedRef<Element>;\n}\n\n/**\n * React Aria (accidentally?!) enforces controlled inputs by always setting the\n * value prop on Inputs and TextAreas with its context props API. This component\n * also uses this API to only unset the value prop. Furthermore setting an input\n * value is finally done by directly on the DOM element.\n *\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/textfield/src/useTextField.ts#L182\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/numberfield/src/useNumberField.ts#L206\n */\nexport const ReactAriaControlledValueFix: FC<\n ReactAriaControlledValueFixProps\n> = (props) => {\n const { inputContext: context, children } = props;\n\n const child = Children.only(children);\n if (!isValidElement<ChildProps>(child)) {\n throw new Error(\"Expected valid element\");\n }\n\n const { ref, ...inputProps } = child.props;\n const [contextProps, contextRef] = Aria.useContextProps(\n inputProps,\n ref,\n context,\n );\n\n
|
|
1
|
+
{"version":3,"file":"ReactAriaControlledValueFix.mjs","sources":["../../../../../../src/lib/react/ReactAriaControlledValueFix.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport {\n Children,\n isValidElement,\n type Context,\n type FC,\n type ForwardedRef,\n type PropsWithChildren,\n useDeferredValue,\n useLayoutEffect,\n useRef,\n} from \"react\";\nimport { emitElementValueChange } from \"@/lib/react/emitElementValueChange\";\n\nexport interface ReactAriaControlledValueFixProps extends PropsWithChildren {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n inputContext: Context<any>;\n props: unknown;\n}\n\ninterface ChildProps {\n [key: string]: unknown;\n ref: ForwardedRef<Element>;\n}\n\n/**\n * React Aria (accidentally?!) enforces controlled inputs by always setting the\n * value prop on Inputs and TextAreas with its context props API. This component\n * also uses this API to only unset the value prop. Furthermore setting an input\n * value is finally done by directly on the DOM element.\n *\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/textfield/src/useTextField.ts#L182\n * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/numberfield/src/useNumberField.ts#L206\n */\nexport const ReactAriaControlledValueFix: FC<\n ReactAriaControlledValueFixProps\n> = (props) => {\n const { inputContext: context, children } = props;\n\n const child = Children.only(children);\n if (!isValidElement<ChildProps>(child)) {\n throw new Error(\"Expected valid element\");\n }\n\n const { ref, ...inputProps } = child.props;\n const [contextProps, contextRef] = Aria.useContextProps(\n inputProps,\n ref,\n context,\n );\n\n const elementRef = contextRef.current;\n const isInFocus = useRef(false);\n\n const isValidElementType =\n elementRef &&\n (elementRef instanceof HTMLInputElement ||\n elementRef instanceof HTMLTextAreaElement);\n\n const deferredValueFromContext = useDeferredValue(String(contextProps.value));\n\n useLayoutEffect(() => {\n if (!isValidElementType) {\n return;\n }\n\n // sync the last known value when element reference is available\n emitElementValueChange(elementRef, deferredValueFromContext);\n\n const onFocus = (event: Event) => {\n isInFocus.current = !!event?.isTrusted;\n };\n const onBlur = () => {\n isInFocus.current = false;\n };\n\n elementRef?.addEventListener(\"focus\", onFocus);\n elementRef?.addEventListener(\"blur\", onBlur);\n\n return () => {\n elementRef?.removeEventListener(\"focus\", onFocus);\n elementRef?.removeEventListener(\"blur\", onBlur);\n };\n }, [elementRef]);\n\n useLayoutEffect(() => {\n if (!isValidElementType || isInFocus.current) {\n return;\n }\n\n emitElementValueChange(elementRef, deferredValueFromContext);\n }, [deferredValueFromContext]);\n\n const uncontrolledContextProps = {\n ...contextProps,\n value: undefined,\n ref: contextRef,\n };\n\n return (\n <Aria.Provider values={[[context, uncontrolledContextProps]]}>\n {child}\n </Aria.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;AAkCO,MAAM,2BAAA,GAET,CAAC,KAAA,KAAU;AACb,EAAA,MAAM,EAAE,YAAA,EAAc,OAAA,EAAS,QAAA,EAAS,GAAI,KAAA;AAE5C,EAAA,MAAM,KAAA,GAAQ,QAAA,CAAS,IAAA,CAAK,QAAQ,CAAA;AACpC,EAAA,IAAI,CAAC,cAAA,CAA2B,KAAK,CAAA,EAAG;AACtC,IAAA,MAAM,IAAI,MAAM,wBAAwB,CAAA;AAAA,EAC1C;AAEA,EAAA,MAAM,EAAE,GAAA,EAAK,GAAG,UAAA,KAAe,KAAA,CAAM,KAAA;AACrC,EAAA,MAAM,CAAC,YAAA,EAAc,UAAU,CAAA,GAAI,IAAA,CAAK,eAAA;AAAA,IACtC,UAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,aAAa,UAAA,CAAW,OAAA;AAC9B,EAAA,MAAM,SAAA,GAAY,OAAO,KAAK,CAAA;AAE9B,EAAA,MAAM,kBAAA,GACJ,UAAA,KACC,UAAA,YAAsB,gBAAA,IACrB,UAAA,YAAsB,mBAAA,CAAA;AAE1B,EAAA,MAAM,wBAAA,GAA2B,gBAAA,CAAiB,MAAA,CAAO,YAAA,CAAa,KAAK,CAAC,CAAA;AAE5E,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,IAAI,CAAC,kBAAA,EAAoB;AACvB,MAAA;AAAA,IACF;AA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E,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW,CAC/C,SAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EACxC,iBAAiB;CAAG;AAExB,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW,CAC/C,SAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EACxC,iBAAiB;CAAG;AAExB,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,2CA+HhE;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,EAC9C,aAAa,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAC1D,OAAO,KAAK,CAAC,CAAC,CAAU,CAAC;AAE5B,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACd,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Form/Form.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACd,MAAM,iBAAiB,CAAC;AAKzB,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,WAAW,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC;AAE1E,KAAK,iBAAiB,GAAG,aAAa,CACpC,iBAAiB,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;CAC1D,CAAC,CACH,CAAC;AAEF,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,WAAW,CAC9C,SAAQ,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,EAC9C,iBAAiB;IACnB,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAID,wBAAgB,IAAI,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,2CA4D9D;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { Dispatch } from 'react';
|
|
|
3
3
|
interface FormContext<F extends FieldValues> {
|
|
4
4
|
form: UseFormReturn<F>;
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
6
|
+
isReadOnly: boolean;
|
|
7
|
+
setReadOnly: Dispatch<React.SetStateAction<boolean>>;
|
|
7
8
|
}
|
|
8
9
|
type AnyFormContext = FormContext<any>;
|
|
9
10
|
export declare const formContext: import('react').Context<AnyFormContext | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formContext.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/context/formContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAA6B,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjE,UAAU,WAAW,CAAC,CAAC,SAAS,WAAW;IACzC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACtD;AAGD,KAAK,cAAc,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;AAEvC,eAAO,MAAM,WAAW,qDAAuD,CAAC;AAEhF,eAAO,MAAM,mBAAmB,sDAAuB,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,WAAW,OAAK,WAAW,CAAC,CAAC,CAOrE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,WAAW,OAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"formContext.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/context/formContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAA6B,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjE,UAAU,WAAW,CAAC,CAAC,SAAS,WAAW;IACzC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACtD;AAGD,KAAK,cAAc,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;AAEvC,eAAO,MAAM,WAAW,qDAAuD,CAAC;AAEhF,eAAO,MAAM,mBAAmB,sDAAuB,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,WAAW,OAAK,WAAW,CAAC,CAAC,CAOrE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,WAAW,OAC/B,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactAriaControlledValueFix.d.ts","sourceRoot":"","sources":["../../../../src/lib/react/ReactAriaControlledValueFix.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,EAAE,EAEP,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ReactAriaControlledValueFix.d.ts","sourceRoot":"","sources":["../../../../src/lib/react/ReactAriaControlledValueFix.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,EAAE,EAEP,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AAGf,MAAM,WAAW,gCAAiC,SAAQ,iBAAiB;IAEzE,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;CAChB;AAOD;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAC1C,gCAAgC,CAqEjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.545",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@internationalized/string-compiler": "^3.2.6",
|
|
60
60
|
"@mittwald/password-tools-js": "3.0.0-alpha.18",
|
|
61
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
61
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.545",
|
|
62
62
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
63
63
|
"@react-aria/form": "^3.1.2",
|
|
64
64
|
"@react-aria/live-announcer": "^3.4.4",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@faker-js/faker": "^10.1.0",
|
|
102
102
|
"@internationalized/date": "^3.10.0",
|
|
103
103
|
"@mittwald/flow-core": "",
|
|
104
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
104
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.545",
|
|
105
105
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
106
106
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
107
107
|
"@mittwald/typescript-config": "",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"optional": true
|
|
175
175
|
}
|
|
176
176
|
},
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "3ab013cc2439746ce692c2c4f05f9cfcc4cc0978"
|
|
178
178
|
}
|