@gravityforms/components 6.4.2 → 6.4.4
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/js/admin-components.asset.php +1 -1
- package/dist/js/admin-components.js +1 -1
- package/dist/js/admin-components.min.asset.php +1 -1
- package/dist/js/admin-components.min.js +1 -1
- package/dist/mappings/admin.js +43 -43
- package/package.json +3 -3
- package/react/admin/modules/Calendar/index.js +1 -1
- package/react/admin/modules/ColorPicker/index.js +4 -4
- package/react/admin/modules/DataGrid/GridCell.js +2 -2
- package/react/admin/modules/Dialog/index.js +6 -5
- package/react/admin/modules/Droplist/index.js +1 -1
- package/react/admin/modules/Flyout/index.js +1 -0
- package/react/admin/modules/Kanban/modules/ActiveFilters.js +14 -6
- package/react/admin/modules/Kanban/modules/Search.js +10 -4
- package/react/admin/modules/Kanban/modules/SimpleFilters.js +14 -6
- package/react/admin/modules/Overlay/index.js +5 -2
package/dist/mappings/admin.js
CHANGED
|
@@ -21,25 +21,25 @@ module.exports = [
|
|
|
21
21
|
"externalPath": "components.admin.html.modules"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"defaultExport": "
|
|
24
|
+
"defaultExport": "Toggle",
|
|
25
25
|
"namedExports": [
|
|
26
|
-
"
|
|
26
|
+
"toggleTemplate"
|
|
27
27
|
],
|
|
28
28
|
"importPath": "html/admin/elements/",
|
|
29
29
|
"externalPath": "components.admin.html.elements"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
"defaultExport": "
|
|
32
|
+
"defaultExport": "Textarea",
|
|
33
33
|
"namedExports": [
|
|
34
|
-
"
|
|
34
|
+
"textareaTemplate"
|
|
35
35
|
],
|
|
36
36
|
"importPath": "html/admin/elements/",
|
|
37
37
|
"externalPath": "components.admin.html.elements"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
"defaultExport": "
|
|
40
|
+
"defaultExport": "Text",
|
|
41
41
|
"namedExports": [
|
|
42
|
-
"
|
|
42
|
+
"textTemplate"
|
|
43
43
|
],
|
|
44
44
|
"importPath": "html/admin/elements/",
|
|
45
45
|
"externalPath": "components.admin.html.elements"
|
|
@@ -53,17 +53,17 @@ module.exports = [
|
|
|
53
53
|
"externalPath": "components.admin.html.elements"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
"defaultExport": "
|
|
56
|
+
"defaultExport": "Select",
|
|
57
57
|
"namedExports": [
|
|
58
|
-
"
|
|
58
|
+
"selectTemplate"
|
|
59
59
|
],
|
|
60
60
|
"importPath": "html/admin/elements/",
|
|
61
61
|
"externalPath": "components.admin.html.elements"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
|
-
"defaultExport": "
|
|
64
|
+
"defaultExport": "StackedIcon",
|
|
65
65
|
"namedExports": [
|
|
66
|
-
"
|
|
66
|
+
"stackedIconTemplate"
|
|
67
67
|
],
|
|
68
68
|
"importPath": "html/admin/elements/",
|
|
69
69
|
"externalPath": "components.admin.html.elements"
|
|
@@ -306,12 +306,12 @@ module.exports = [
|
|
|
306
306
|
"externalPath": "components.admin.react.elements"
|
|
307
307
|
},
|
|
308
308
|
{
|
|
309
|
-
"defaultExport": "
|
|
309
|
+
"defaultExport": "Textarea",
|
|
310
310
|
"importPath": "react/admin/elements/",
|
|
311
311
|
"externalPath": "components.admin.react.elements"
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
|
-
"defaultExport": "
|
|
314
|
+
"defaultExport": "Text",
|
|
315
315
|
"importPath": "react/admin/elements/",
|
|
316
316
|
"externalPath": "components.admin.react.elements"
|
|
317
317
|
},
|
|
@@ -345,6 +345,11 @@ module.exports = [
|
|
|
345
345
|
"importPath": "react/admin/elements/",
|
|
346
346
|
"externalPath": "components.admin.react.elements"
|
|
347
347
|
},
|
|
348
|
+
{
|
|
349
|
+
"defaultExport": "Pill",
|
|
350
|
+
"importPath": "react/admin/elements/",
|
|
351
|
+
"externalPath": "components.admin.react.elements"
|
|
352
|
+
},
|
|
348
353
|
{
|
|
349
354
|
"defaultExport": "Link",
|
|
350
355
|
"importPath": "react/admin/elements/",
|
|
@@ -366,12 +371,12 @@ module.exports = [
|
|
|
366
371
|
"externalPath": "components.admin.react.elements"
|
|
367
372
|
},
|
|
368
373
|
{
|
|
369
|
-
"defaultExport": "
|
|
374
|
+
"defaultExport": "HelpText",
|
|
370
375
|
"importPath": "react/admin/elements/",
|
|
371
376
|
"externalPath": "components.admin.react.elements"
|
|
372
377
|
},
|
|
373
378
|
{
|
|
374
|
-
"defaultExport": "
|
|
379
|
+
"defaultExport": "Icon",
|
|
375
380
|
"importPath": "react/admin/elements/",
|
|
376
381
|
"externalPath": "components.admin.react.elements"
|
|
377
382
|
},
|
|
@@ -386,12 +391,12 @@ module.exports = [
|
|
|
386
391
|
"externalPath": "components.admin.react.elements"
|
|
387
392
|
},
|
|
388
393
|
{
|
|
389
|
-
"defaultExport": "
|
|
394
|
+
"defaultExport": "DescriptionList",
|
|
390
395
|
"importPath": "react/admin/elements/",
|
|
391
396
|
"externalPath": "components.admin.react.elements"
|
|
392
397
|
},
|
|
393
398
|
{
|
|
394
|
-
"defaultExport": "
|
|
399
|
+
"defaultExport": "FileUpload",
|
|
395
400
|
"importPath": "react/admin/elements/",
|
|
396
401
|
"externalPath": "components.admin.react.elements"
|
|
397
402
|
},
|
|
@@ -405,18 +410,13 @@ module.exports = [
|
|
|
405
410
|
"importPath": "react/admin/elements/",
|
|
406
411
|
"externalPath": "components.admin.react.elements"
|
|
407
412
|
},
|
|
408
|
-
{
|
|
409
|
-
"defaultExport": "Box",
|
|
410
|
-
"importPath": "react/admin/elements/",
|
|
411
|
-
"externalPath": "components.admin.react.elements"
|
|
412
|
-
},
|
|
413
413
|
{
|
|
414
414
|
"defaultExport": "VidyardVideo",
|
|
415
415
|
"importPath": "react/admin/modules/Videos/",
|
|
416
416
|
"externalPath": "components.admin.react.modules"
|
|
417
417
|
},
|
|
418
418
|
{
|
|
419
|
-
"defaultExport": "
|
|
419
|
+
"defaultExport": "Box",
|
|
420
420
|
"importPath": "react/admin/elements/",
|
|
421
421
|
"externalPath": "components.admin.react.elements"
|
|
422
422
|
},
|
|
@@ -425,6 +425,14 @@ module.exports = [
|
|
|
425
425
|
"importPath": "react/admin/modules/Loaders/",
|
|
426
426
|
"externalPath": "components.admin.react.modules"
|
|
427
427
|
},
|
|
428
|
+
{
|
|
429
|
+
"__esModule": true,
|
|
430
|
+
"default": {
|
|
431
|
+
"defaultExport": "Simple",
|
|
432
|
+
"importPath": "react/admin/modules/ProgressBar/",
|
|
433
|
+
"externalPath": "components.admin.react.modules"
|
|
434
|
+
}
|
|
435
|
+
},
|
|
428
436
|
{
|
|
429
437
|
"defaultExport": "Placeholder",
|
|
430
438
|
"importPath": "react/admin/modules/Loaders/",
|
|
@@ -475,26 +483,18 @@ module.exports = [
|
|
|
475
483
|
"importPath": "react/admin/modules/Cards/",
|
|
476
484
|
"externalPath": "components.admin.react.modules"
|
|
477
485
|
},
|
|
478
|
-
{
|
|
479
|
-
"__esModule": true,
|
|
480
|
-
"default": {
|
|
481
|
-
"defaultExport": "Simple",
|
|
482
|
-
"importPath": "react/admin/modules/ProgressBar/",
|
|
483
|
-
"externalPath": "components.admin.react.modules"
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
486
|
{
|
|
487
487
|
"defaultExport": "ZohoLogo",
|
|
488
488
|
"importPath": "react/admin/elements/Svgs/",
|
|
489
489
|
"externalPath": "components.admin.react.elements"
|
|
490
490
|
},
|
|
491
491
|
{
|
|
492
|
-
"defaultExport": "
|
|
492
|
+
"defaultExport": "ZohoFullLogo",
|
|
493
493
|
"importPath": "react/admin/elements/Svgs/",
|
|
494
494
|
"externalPath": "components.admin.react.elements"
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
|
-
"defaultExport": "
|
|
497
|
+
"defaultExport": "WordPressLogo",
|
|
498
498
|
"importPath": "react/admin/elements/Svgs/",
|
|
499
499
|
"externalPath": "components.admin.react.elements"
|
|
500
500
|
},
|
|
@@ -534,17 +534,17 @@ module.exports = [
|
|
|
534
534
|
"externalPath": "components.admin.react.elements"
|
|
535
535
|
},
|
|
536
536
|
{
|
|
537
|
-
"defaultExport": "
|
|
537
|
+
"defaultExport": "SendGridLogo",
|
|
538
538
|
"importPath": "react/admin/elements/Svgs/",
|
|
539
539
|
"externalPath": "components.admin.react.elements"
|
|
540
540
|
},
|
|
541
541
|
{
|
|
542
|
-
"defaultExport": "
|
|
542
|
+
"defaultExport": "SendGridFullLogo",
|
|
543
543
|
"importPath": "react/admin/elements/Svgs/",
|
|
544
544
|
"externalPath": "components.admin.react.elements"
|
|
545
545
|
},
|
|
546
546
|
{
|
|
547
|
-
"defaultExport": "
|
|
547
|
+
"defaultExport": "SearchNoResults",
|
|
548
548
|
"importPath": "react/admin/elements/Svgs/",
|
|
549
549
|
"externalPath": "components.admin.react.elements"
|
|
550
550
|
},
|
|
@@ -554,17 +554,17 @@ module.exports = [
|
|
|
554
554
|
"externalPath": "components.admin.react.elements"
|
|
555
555
|
},
|
|
556
556
|
{
|
|
557
|
-
"defaultExport": "
|
|
557
|
+
"defaultExport": "SMTP2GOFullLogo",
|
|
558
558
|
"importPath": "react/admin/elements/Svgs/",
|
|
559
559
|
"externalPath": "components.admin.react.elements"
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
|
-
"defaultExport": "
|
|
562
|
+
"defaultExport": "ResendLogo",
|
|
563
563
|
"importPath": "react/admin/elements/Svgs/",
|
|
564
564
|
"externalPath": "components.admin.react.elements"
|
|
565
565
|
},
|
|
566
566
|
{
|
|
567
|
-
"defaultExport": "
|
|
567
|
+
"defaultExport": "ResendFullLogo",
|
|
568
568
|
"importPath": "react/admin/elements/Svgs/",
|
|
569
569
|
"externalPath": "components.admin.react.elements"
|
|
570
570
|
},
|
|
@@ -678,11 +678,6 @@ module.exports = [
|
|
|
678
678
|
"importPath": "react/admin/elements/Svgs/",
|
|
679
679
|
"externalPath": "components.admin.react.elements"
|
|
680
680
|
},
|
|
681
|
-
{
|
|
682
|
-
"defaultExport": "GravitySMTPTextLogo",
|
|
683
|
-
"importPath": "react/admin/elements/Svgs/",
|
|
684
|
-
"externalPath": "components.admin.react.elements"
|
|
685
|
-
},
|
|
686
681
|
{
|
|
687
682
|
"defaultExport": "GravitySMTPLogo",
|
|
688
683
|
"importPath": "react/admin/elements/Svgs/",
|
|
@@ -793,6 +788,11 @@ module.exports = [
|
|
|
793
788
|
"importPath": "react/admin/elements/Link/",
|
|
794
789
|
"externalPath": "components.admin.react.elements"
|
|
795
790
|
},
|
|
791
|
+
{
|
|
792
|
+
"defaultExport": "GravitySMTPTextLogo",
|
|
793
|
+
"importPath": "react/admin/elements/Svgs/",
|
|
794
|
+
"externalPath": "components.admin.react.elements"
|
|
795
|
+
},
|
|
796
796
|
{
|
|
797
797
|
"defaultExport": "BrandedButton",
|
|
798
798
|
"importPath": "react/admin/elements/Button/",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravityforms/components",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.4",
|
|
4
4
|
"description": "UI components for use in Gravity Forms development. Both React and vanilla js flavors.",
|
|
5
5
|
"author": "Rocketgenius",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.26.0",
|
|
33
|
-
"@gravityforms/components": "^6.4.
|
|
33
|
+
"@gravityforms/components": "^6.4.4",
|
|
34
34
|
"@gravityforms/libraries": "^6.0.0",
|
|
35
|
-
"@gravityforms/react-utils": "^5.2.
|
|
35
|
+
"@gravityforms/react-utils": "^5.2.1",
|
|
36
36
|
"@gravityforms/request": "^6.1.0",
|
|
37
37
|
"@gravityforms/utils": "^5.0.4",
|
|
38
38
|
"input-format": "0.3.14",
|
|
@@ -197,7 +197,7 @@ const CalendarComponent = forwardRef( ( props, ref ) => {
|
|
|
197
197
|
|
|
198
198
|
const mergedCalendarAttributes = deepMerge( defaultCalendarAttributes, calendarAttributes );
|
|
199
199
|
const maxDetail = mergedCalendarAttributes.maxDetail || 'month';
|
|
200
|
-
const trapRef = useFocusTrap( trapFocus && popupOpen );
|
|
200
|
+
const trapRef = useFocusTrap( trapFocus && popupOpen, { focusTrapId: id } );
|
|
201
201
|
const needsWrapper = withTrigger || externalControl;
|
|
202
202
|
|
|
203
203
|
const {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { React, PropTypes, classnames, HexColorPicker, HexColorInput } from '@gravityforms/libraries';
|
|
2
|
-
import { useFocusTrap, useStateWithDep } from '@gravityforms/react-utils';
|
|
3
|
-
import { spacerClasses
|
|
2
|
+
import { useFocusTrap, useStateWithDep, useId } from '@gravityforms/react-utils';
|
|
3
|
+
import { spacerClasses } from '@gravityforms/utils';
|
|
4
4
|
import Label from '../../elements/Label';
|
|
5
5
|
import Button from '../../elements/Button';
|
|
6
6
|
import { hexToRGB } from '../../utils/colors';
|
|
@@ -57,9 +57,9 @@ const ColorPicker = ( {
|
|
|
57
57
|
const [ rgbColor, setRgbColor ] = useState( hexToRGB( value ) );
|
|
58
58
|
const [ position, setPosition ] = useState( false );
|
|
59
59
|
const [ coords, setCoords ] = useState( false );
|
|
60
|
-
const rgbInputIdPrefix =
|
|
60
|
+
const rgbInputIdPrefix = useId( rgbIdPrefix );
|
|
61
61
|
|
|
62
|
-
const trapRef = useFocusTrap( trapFocus );
|
|
62
|
+
const trapRef = useFocusTrap( trapFocus, { focusTrapId: rgbInputIdPrefix } );
|
|
63
63
|
const selfRef = useRef( null );
|
|
64
64
|
|
|
65
65
|
const setRef = useCallback( ( node ) => {
|
|
@@ -26,8 +26,8 @@ const GridCell = memo( ( {
|
|
|
26
26
|
}
|
|
27
27
|
}, [ data.props, setGridData ] );
|
|
28
28
|
|
|
29
|
-
const handleClicks = useCallback( () => {
|
|
30
|
-
handleGridClicks( data.props );
|
|
29
|
+
const handleClicks = useCallback( ( event ) => {
|
|
30
|
+
handleGridClicks( data.props, event );
|
|
31
31
|
}, [ data.props, handleGridClicks ] );
|
|
32
32
|
|
|
33
33
|
const renderNestedFields = ( entries ) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { React, SimpleBar, PropTypes, classnames } from '@gravityforms/libraries';
|
|
2
|
-
import { bodyLock
|
|
3
|
-
import { ConditionalWrapper, useStateWithDep, useFocusTrap } from '@gravityforms/react-utils';
|
|
2
|
+
import { bodyLock } from '@gravityforms/utils';
|
|
3
|
+
import { ConditionalWrapper, useStateWithDep, useFocusTrap, useId } from '@gravityforms/react-utils';
|
|
4
4
|
import IconIndicator from '../Indicators/IconIndicator';
|
|
5
5
|
import Button from '../../elements/Button';
|
|
6
6
|
|
|
@@ -36,7 +36,7 @@ const { useState, useEffect, useRef, forwardRef } = React;
|
|
|
36
36
|
* @param {string|Array|object} props.customMaskClasses Custom classes for the mask as array.
|
|
37
37
|
* @param {string|Array|object} props.customWrapperClasses Custom classes for the wrapper as array.
|
|
38
38
|
* @param {string|Array|object} props.description Optional text to show below title.
|
|
39
|
-
* @param {string} props.id The id for the dialog. If not passed auto generated using
|
|
39
|
+
* @param {string} props.id The id for the dialog. If not passed auto generated using useId from react-utils.
|
|
40
40
|
* @param {boolean} props.isOpen Prop to control whether the dialog is currently open.
|
|
41
41
|
* @param {boolean} props.lockBody Whether to lock the body behind the dialog to prevent interaction or scrolling.
|
|
42
42
|
* @param {boolean} props.maskBlur Whether to blur behind the mask for the dialog.
|
|
@@ -159,7 +159,8 @@ const Dialog = forwardRef( ( {
|
|
|
159
159
|
const [ animationActive, setAnimationActive ] = useState( false );
|
|
160
160
|
const [ modalAnimation, setModalAnimation ] = useState( false );
|
|
161
161
|
const [ dialogActive, setDialogActive ] = useStateWithDep( isOpen );
|
|
162
|
-
const
|
|
162
|
+
const dialogId = useId( id );
|
|
163
|
+
const trapRef = useFocusTrap( dialogActive, { focusTrapId: dialogId } );
|
|
163
164
|
const mountedRef = useRef( true );
|
|
164
165
|
|
|
165
166
|
useEffect( () => {
|
|
@@ -258,7 +259,7 @@ const Dialog = forwardRef( ( {
|
|
|
258
259
|
};
|
|
259
260
|
|
|
260
261
|
const wrapperProps = {
|
|
261
|
-
id:
|
|
262
|
+
id: dialogId,
|
|
262
263
|
className: classnames( {
|
|
263
264
|
'gform-dialog': true,
|
|
264
265
|
'gform-dialog--animated': animateModal,
|
|
@@ -58,8 +58,8 @@ const DroplistComponent = forwardRef( ( props, ref ) => { // eslint-disable-line
|
|
|
58
58
|
},
|
|
59
59
|
onOpen,
|
|
60
60
|
} );
|
|
61
|
-
const trapRef = useFocusTrap( popupOpen );
|
|
62
61
|
const id = useIdContext();
|
|
62
|
+
const trapRef = useFocusTrap( popupOpen, { focusTrapId: id } );
|
|
63
63
|
|
|
64
64
|
const depthKeys = Object.keys( selectedState );
|
|
65
65
|
|
|
@@ -241,6 +241,7 @@ const Flyout = forwardRef( ( {
|
|
|
241
241
|
ariaModal: ! flyoutPinned,
|
|
242
242
|
focusKey,
|
|
243
243
|
focusSelector: '.gform-flyout__close',
|
|
244
|
+
focusTrapId: id,
|
|
244
245
|
} );
|
|
245
246
|
|
|
246
247
|
const isRtl = document.documentElement.dir === 'rtl' || getComputedStyle( document.documentElement ).direction === 'rtl';
|
|
@@ -77,13 +77,17 @@ const ActiveFilters = forwardRef( ( {
|
|
|
77
77
|
onPillClick( event );
|
|
78
78
|
setIsLoading( true );
|
|
79
79
|
onFilterChange( combinedState )
|
|
80
|
-
.then( () => {
|
|
80
|
+
.then( ( success ) => {
|
|
81
|
+
if ( ! success ) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
81
84
|
updateModuleState( updatedState );
|
|
82
|
-
setIsLoading( false );
|
|
83
85
|
} )
|
|
84
86
|
.catch( ( error ) => {
|
|
85
|
-
setIsLoading( false );
|
|
86
87
|
console.info( error );
|
|
88
|
+
} )
|
|
89
|
+
.finally( () => {
|
|
90
|
+
setIsLoading( false );
|
|
87
91
|
} );
|
|
88
92
|
},
|
|
89
93
|
},
|
|
@@ -108,13 +112,17 @@ const ActiveFilters = forwardRef( ( {
|
|
|
108
112
|
onResetClick( event );
|
|
109
113
|
setIsLoading( true );
|
|
110
114
|
onFilterChange( combinedState )
|
|
111
|
-
.then( () => {
|
|
115
|
+
.then( ( success ) => {
|
|
116
|
+
if ( ! success ) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
112
119
|
updateModuleState( updatedState );
|
|
113
|
-
setIsLoading( false );
|
|
114
120
|
} )
|
|
115
121
|
.catch( ( error ) => {
|
|
116
|
-
setIsLoading( false );
|
|
117
122
|
console.info( error );
|
|
123
|
+
} )
|
|
124
|
+
.finally( () => {
|
|
125
|
+
setIsLoading( false );
|
|
118
126
|
} );
|
|
119
127
|
},
|
|
120
128
|
},
|
|
@@ -87,12 +87,19 @@ const Search = forwardRef( ( {
|
|
|
87
87
|
const combinedState = { ...moduleState, ...updatedState };
|
|
88
88
|
setIsLoading( true );
|
|
89
89
|
onSearch( combinedState )
|
|
90
|
-
.then( () => {
|
|
90
|
+
.then( ( success ) => {
|
|
91
|
+
if ( ! success ) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if ( ! value ) {
|
|
95
|
+
setSearchValue( '' );
|
|
96
|
+
}
|
|
91
97
|
updateModuleState( updatedState );
|
|
92
|
-
setIsLoading( false );
|
|
93
98
|
} )
|
|
94
99
|
.catch( ( error ) => {
|
|
95
100
|
console.info( error );
|
|
101
|
+
} )
|
|
102
|
+
.finally( () => {
|
|
96
103
|
setIsLoading( false );
|
|
97
104
|
} );
|
|
98
105
|
};
|
|
@@ -109,9 +116,8 @@ const Search = forwardRef( ( {
|
|
|
109
116
|
),
|
|
110
117
|
customClasses: [ 'gform-kanban__controls-search' ],
|
|
111
118
|
inputAttributes: {
|
|
112
|
-
|
|
119
|
+
directControlled: true,
|
|
113
120
|
onClear: () => {
|
|
114
|
-
setSearchValue( '' );
|
|
115
121
|
onClear();
|
|
116
122
|
handleSearch();
|
|
117
123
|
},
|
|
@@ -75,13 +75,17 @@ const augmentListItem = (
|
|
|
75
75
|
const combinedState = { ...moduleState, ...updatedState };
|
|
76
76
|
setIsLoading( true );
|
|
77
77
|
onFilterChange( combinedState )
|
|
78
|
-
.then( () => {
|
|
78
|
+
.then( ( success ) => {
|
|
79
|
+
if ( ! success ) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
79
82
|
updateModuleState( updatedState );
|
|
80
|
-
setIsLoading( false );
|
|
81
83
|
} )
|
|
82
84
|
.catch( ( error ) => {
|
|
83
|
-
setIsLoading( false );
|
|
84
85
|
console.info( error );
|
|
86
|
+
} )
|
|
87
|
+
.finally( () => {
|
|
88
|
+
setIsLoading( false );
|
|
85
89
|
} );
|
|
86
90
|
};
|
|
87
91
|
|
|
@@ -181,13 +185,17 @@ const augmentListItems = ( items = [], props = {}, depth = 0 ) => {
|
|
|
181
185
|
const combinedState = { ...moduleState, ...updatedState };
|
|
182
186
|
setIsLoading( true );
|
|
183
187
|
onFilterChange( combinedState )
|
|
184
|
-
.then( () => {
|
|
188
|
+
.then( ( success ) => {
|
|
189
|
+
if ( ! success ) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
185
192
|
updateModuleState( updatedState );
|
|
186
|
-
setIsLoading( false );
|
|
187
193
|
} )
|
|
188
194
|
.catch( ( error ) => {
|
|
189
|
-
setIsLoading( false );
|
|
190
195
|
console.info( error );
|
|
196
|
+
} )
|
|
197
|
+
.finally( () => {
|
|
198
|
+
setIsLoading( false );
|
|
191
199
|
} );
|
|
192
200
|
},
|
|
193
201
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { React, classnames } from '@gravityforms/libraries';
|
|
2
|
-
import { useStateWithDep, useFocusTrap } from '@gravityforms/react-utils';
|
|
2
|
+
import { useStateWithDep, useFocusTrap, useId } from '@gravityforms/react-utils';
|
|
3
3
|
import { getClosest, wait } from '@gravityforms/utils';
|
|
4
4
|
import Button from '../../elements/Button';
|
|
5
5
|
import { ENTER, ESCAPE } from '../../utils/keymap';
|
|
@@ -19,6 +19,7 @@ const { useCallback, useState, useEffect, useRef, forwardRef } = React;
|
|
|
19
19
|
* @param {string|Array|object} props.customClasses An array of additional classes.
|
|
20
20
|
* @param {boolean} props.hasConfirm Whether the overlay has a confirm button.
|
|
21
21
|
* @param {object} props.i18n i18n strings.
|
|
22
|
+
* @param {string} props.id The id for the overlay. If not passed auto generated using useId from react-utils.
|
|
22
23
|
* @param {Array} props.ignoreOutsideClickClasses Array of selectors to ignore outside click.
|
|
23
24
|
* @param {boolean} props.isOpen Whether the overlay is open.
|
|
24
25
|
* @param {Function} props.onCancel Callback function when the overlay is canceled.
|
|
@@ -61,6 +62,7 @@ const Overlay = forwardRef( ( {
|
|
|
61
62
|
cancel: 'Needs i18n',
|
|
62
63
|
confirm: 'Needs i18n',
|
|
63
64
|
},
|
|
65
|
+
id = '',
|
|
64
66
|
ignoreOutsideClickClasses = [],
|
|
65
67
|
isOpen = false,
|
|
66
68
|
onCancel = async () => {},
|
|
@@ -80,8 +82,9 @@ const Overlay = forwardRef( ( {
|
|
|
80
82
|
const [ animationActive, setAnimationActive ] = useState( false );
|
|
81
83
|
const [ overlayActive, setOverlayActive ] = useStateWithDep( isOpen );
|
|
82
84
|
const [ positionAbove, setPositionAbove ] = useState( false );
|
|
85
|
+
const overlayId = useId( id );
|
|
83
86
|
const overlayRef = useRef( null );
|
|
84
|
-
const trapRef = useFocusTrap( overlayActive );
|
|
87
|
+
const trapRef = useFocusTrap( overlayActive, { focusTrapId: overlayId } );
|
|
85
88
|
const mountedRef = useRef( true );
|
|
86
89
|
const debounceTimerRef = useRef( null );
|
|
87
90
|
|