@gravityforms/components 6.4.0 → 6.4.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/css/admin/progressbar/simple.css +7 -1
- package/dist/css/admin/progressbar/simple.css +4 -0
- package/dist/css/admin/progressbar/simple.css.map +1 -1
- 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 +64 -64
- package/package.json +2 -2
- package/react/admin/modules/DataGrid/use-data-grid-state.js +4 -4
- package/react/admin/modules/ProgressBar/Simple/index.js +5 -1
- package/react/admin/modules/SnackBar/index.js +7 -5
package/dist/mappings/admin.js
CHANGED
|
@@ -20,6 +20,14 @@ module.exports = [
|
|
|
20
20
|
"importPath": "html/admin/modules/",
|
|
21
21
|
"externalPath": "components.admin.html.modules"
|
|
22
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"defaultExport": "Textarea",
|
|
25
|
+
"namedExports": [
|
|
26
|
+
"textareaTemplate"
|
|
27
|
+
],
|
|
28
|
+
"importPath": "html/admin/elements/",
|
|
29
|
+
"externalPath": "components.admin.html.elements"
|
|
30
|
+
},
|
|
23
31
|
{
|
|
24
32
|
"defaultExport": "Text",
|
|
25
33
|
"namedExports": [
|
|
@@ -28,6 +36,14 @@ module.exports = [
|
|
|
28
36
|
"importPath": "html/admin/elements/",
|
|
29
37
|
"externalPath": "components.admin.html.elements"
|
|
30
38
|
},
|
|
39
|
+
{
|
|
40
|
+
"defaultExport": "Toggle",
|
|
41
|
+
"namedExports": [
|
|
42
|
+
"toggleTemplate"
|
|
43
|
+
],
|
|
44
|
+
"importPath": "html/admin/elements/",
|
|
45
|
+
"externalPath": "components.admin.html.elements"
|
|
46
|
+
},
|
|
31
47
|
{
|
|
32
48
|
"defaultExport": "StatusIndicator",
|
|
33
49
|
"namedExports": [
|
|
@@ -125,22 +141,6 @@ module.exports = [
|
|
|
125
141
|
"importPath": "html/admin/elements/",
|
|
126
142
|
"externalPath": "components.admin.html.elements"
|
|
127
143
|
},
|
|
128
|
-
{
|
|
129
|
-
"defaultExport": "Textarea",
|
|
130
|
-
"namedExports": [
|
|
131
|
-
"textareaTemplate"
|
|
132
|
-
],
|
|
133
|
-
"importPath": "html/admin/elements/",
|
|
134
|
-
"externalPath": "components.admin.html.elements"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"defaultExport": "Toggle",
|
|
138
|
-
"namedExports": [
|
|
139
|
-
"toggleTemplate"
|
|
140
|
-
],
|
|
141
|
-
"importPath": "html/admin/elements/",
|
|
142
|
-
"externalPath": "components.admin.html.elements"
|
|
143
|
-
},
|
|
144
144
|
{
|
|
145
145
|
"defaultExport": "Tooltip",
|
|
146
146
|
"importPath": "react/admin/modules/",
|
|
@@ -170,6 +170,16 @@ module.exports = [
|
|
|
170
170
|
"importPath": "react/admin/modules/",
|
|
171
171
|
"externalPath": "components.admin.react.modules"
|
|
172
172
|
},
|
|
173
|
+
{
|
|
174
|
+
"defaultExport": "RouterNavBar",
|
|
175
|
+
"importPath": "react/admin/modules/",
|
|
176
|
+
"externalPath": "components.admin.react.modules"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"defaultExport": "Repeater",
|
|
180
|
+
"importPath": "react/admin/modules/",
|
|
181
|
+
"externalPath": "components.admin.react.modules"
|
|
182
|
+
},
|
|
173
183
|
{
|
|
174
184
|
"defaultExport": "Phone",
|
|
175
185
|
"importPath": "react/admin/modules/",
|
|
@@ -236,7 +246,7 @@ module.exports = [
|
|
|
236
246
|
"externalPath": "components.admin.react.modules"
|
|
237
247
|
},
|
|
238
248
|
{
|
|
239
|
-
"defaultExport": "
|
|
249
|
+
"defaultExport": "Dialog",
|
|
240
250
|
"importPath": "react/admin/modules/",
|
|
241
251
|
"externalPath": "components.admin.react.modules"
|
|
242
252
|
},
|
|
@@ -260,11 +270,6 @@ module.exports = [
|
|
|
260
270
|
"importPath": "react/admin/modules/",
|
|
261
271
|
"externalPath": "components.admin.react.modules"
|
|
262
272
|
},
|
|
263
|
-
{
|
|
264
|
-
"defaultExport": "RouterNavBar",
|
|
265
|
-
"importPath": "react/admin/modules/",
|
|
266
|
-
"externalPath": "components.admin.react.modules"
|
|
267
|
-
},
|
|
268
273
|
{
|
|
269
274
|
"defaultExport": "Calendar",
|
|
270
275
|
"importPath": "react/admin/modules/",
|
|
@@ -301,12 +306,12 @@ module.exports = [
|
|
|
301
306
|
"externalPath": "components.admin.react.elements"
|
|
302
307
|
},
|
|
303
308
|
{
|
|
304
|
-
"defaultExport": "
|
|
309
|
+
"defaultExport": "Text",
|
|
305
310
|
"importPath": "react/admin/elements/",
|
|
306
311
|
"externalPath": "components.admin.react.elements"
|
|
307
312
|
},
|
|
308
313
|
{
|
|
309
|
-
"defaultExport": "
|
|
314
|
+
"defaultExport": "Textarea",
|
|
310
315
|
"importPath": "react/admin/elements/",
|
|
311
316
|
"externalPath": "components.admin.react.elements"
|
|
312
317
|
},
|
|
@@ -331,22 +336,22 @@ module.exports = [
|
|
|
331
336
|
"externalPath": "components.admin.react.elements"
|
|
332
337
|
},
|
|
333
338
|
{
|
|
334
|
-
"defaultExport": "
|
|
339
|
+
"defaultExport": "Radio",
|
|
335
340
|
"importPath": "react/admin/elements/",
|
|
336
341
|
"externalPath": "components.admin.react.elements"
|
|
337
342
|
},
|
|
338
343
|
{
|
|
339
|
-
"defaultExport": "
|
|
344
|
+
"defaultExport": "Popover",
|
|
340
345
|
"importPath": "react/admin/elements/",
|
|
341
346
|
"externalPath": "components.admin.react.elements"
|
|
342
347
|
},
|
|
343
348
|
{
|
|
344
|
-
"defaultExport": "
|
|
349
|
+
"defaultExport": "Link",
|
|
345
350
|
"importPath": "react/admin/elements/",
|
|
346
351
|
"externalPath": "components.admin.react.elements"
|
|
347
352
|
},
|
|
348
353
|
{
|
|
349
|
-
"defaultExport": "
|
|
354
|
+
"defaultExport": "Label",
|
|
350
355
|
"importPath": "react/admin/elements/",
|
|
351
356
|
"externalPath": "components.admin.react.elements"
|
|
352
357
|
},
|
|
@@ -356,7 +361,7 @@ module.exports = [
|
|
|
356
361
|
"externalPath": "components.admin.react.elements"
|
|
357
362
|
},
|
|
358
363
|
{
|
|
359
|
-
"defaultExport": "
|
|
364
|
+
"defaultExport": "Image",
|
|
360
365
|
"importPath": "react/admin/elements/",
|
|
361
366
|
"externalPath": "components.admin.react.elements"
|
|
362
367
|
},
|
|
@@ -366,7 +371,7 @@ 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
|
},
|
|
@@ -375,11 +380,6 @@ module.exports = [
|
|
|
375
380
|
"importPath": "react/admin/elements/",
|
|
376
381
|
"externalPath": "components.admin.react.elements"
|
|
377
382
|
},
|
|
378
|
-
{
|
|
379
|
-
"defaultExport": "HelpText",
|
|
380
|
-
"importPath": "react/admin/elements/",
|
|
381
|
-
"externalPath": "components.admin.react.elements"
|
|
382
|
-
},
|
|
383
383
|
{
|
|
384
384
|
"defaultExport": "Grid",
|
|
385
385
|
"importPath": "react/admin/elements/",
|
|
@@ -416,17 +416,9 @@ module.exports = [
|
|
|
416
416
|
"externalPath": "components.admin.react.modules"
|
|
417
417
|
},
|
|
418
418
|
{
|
|
419
|
-
"defaultExport": "
|
|
420
|
-
"importPath": "react/admin/
|
|
421
|
-
"externalPath": "components.admin.react.
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
"__esModule": true,
|
|
425
|
-
"default": {
|
|
426
|
-
"defaultExport": "Simple",
|
|
427
|
-
"importPath": "react/admin/modules/ProgressBar/",
|
|
428
|
-
"externalPath": "components.admin.react.modules"
|
|
429
|
-
}
|
|
419
|
+
"defaultExport": "Pill",
|
|
420
|
+
"importPath": "react/admin/elements/",
|
|
421
|
+
"externalPath": "components.admin.react.elements"
|
|
430
422
|
},
|
|
431
423
|
{
|
|
432
424
|
"defaultExport": "RingLoader",
|
|
@@ -483,18 +475,26 @@ module.exports = [
|
|
|
483
475
|
"importPath": "react/admin/modules/Cards/",
|
|
484
476
|
"externalPath": "components.admin.react.modules"
|
|
485
477
|
},
|
|
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": "WordPressLogo",
|
|
493
493
|
"importPath": "react/admin/elements/Svgs/",
|
|
494
494
|
"externalPath": "components.admin.react.elements"
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
|
-
"defaultExport": "
|
|
497
|
+
"defaultExport": "ZohoFullLogo",
|
|
498
498
|
"importPath": "react/admin/elements/Svgs/",
|
|
499
499
|
"externalPath": "components.admin.react.elements"
|
|
500
500
|
},
|
|
@@ -509,17 +509,17 @@ module.exports = [
|
|
|
509
509
|
"externalPath": "components.admin.react.elements"
|
|
510
510
|
},
|
|
511
511
|
{
|
|
512
|
-
"defaultExport": "
|
|
512
|
+
"defaultExport": "TwilioLogo",
|
|
513
513
|
"importPath": "react/admin/elements/Svgs/",
|
|
514
514
|
"externalPath": "components.admin.react.elements"
|
|
515
515
|
},
|
|
516
516
|
{
|
|
517
|
-
"defaultExport": "
|
|
517
|
+
"defaultExport": "TelegramLogo",
|
|
518
518
|
"importPath": "react/admin/elements/Svgs/",
|
|
519
519
|
"externalPath": "components.admin.react.elements"
|
|
520
520
|
},
|
|
521
521
|
{
|
|
522
|
-
"defaultExport": "
|
|
522
|
+
"defaultExport": "SparkPostLogo",
|
|
523
523
|
"importPath": "react/admin/elements/Svgs/",
|
|
524
524
|
"externalPath": "components.admin.react.elements"
|
|
525
525
|
},
|
|
@@ -534,17 +534,17 @@ module.exports = [
|
|
|
534
534
|
"externalPath": "components.admin.react.elements"
|
|
535
535
|
},
|
|
536
536
|
{
|
|
537
|
-
"defaultExport": "
|
|
537
|
+
"defaultExport": "SendGridFullLogo",
|
|
538
538
|
"importPath": "react/admin/elements/Svgs/",
|
|
539
539
|
"externalPath": "components.admin.react.elements"
|
|
540
540
|
},
|
|
541
541
|
{
|
|
542
|
-
"defaultExport": "
|
|
542
|
+
"defaultExport": "SearchNoResults",
|
|
543
543
|
"importPath": "react/admin/elements/Svgs/",
|
|
544
544
|
"externalPath": "components.admin.react.elements"
|
|
545
545
|
},
|
|
546
546
|
{
|
|
547
|
-
"defaultExport": "
|
|
547
|
+
"defaultExport": "SendGridLogo",
|
|
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": "ResendLogo",
|
|
558
558
|
"importPath": "react/admin/elements/Svgs/",
|
|
559
559
|
"externalPath": "components.admin.react.elements"
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
|
-
"defaultExport": "
|
|
562
|
+
"defaultExport": "ResendFullLogo",
|
|
563
563
|
"importPath": "react/admin/elements/Svgs/",
|
|
564
564
|
"externalPath": "components.admin.react.elements"
|
|
565
565
|
},
|
|
566
566
|
{
|
|
567
|
-
"defaultExport": "
|
|
567
|
+
"defaultExport": "SMTP2GOFullLogo",
|
|
568
568
|
"importPath": "react/admin/elements/Svgs/",
|
|
569
569
|
"externalPath": "components.admin.react.elements"
|
|
570
570
|
},
|
|
@@ -728,6 +728,11 @@ module.exports = [
|
|
|
728
728
|
"importPath": "react/admin/elements/Svgs/",
|
|
729
729
|
"externalPath": "components.admin.react.elements"
|
|
730
730
|
},
|
|
731
|
+
{
|
|
732
|
+
"defaultExport": "EmailitLogo",
|
|
733
|
+
"importPath": "react/admin/elements/Svgs/",
|
|
734
|
+
"externalPath": "components.admin.react.elements"
|
|
735
|
+
},
|
|
731
736
|
{
|
|
732
737
|
"defaultExport": "EmailitFullLogo",
|
|
733
738
|
"importPath": "react/admin/elements/Svgs/",
|
|
@@ -739,12 +744,12 @@ module.exports = [
|
|
|
739
744
|
"externalPath": "components.admin.react.elements"
|
|
740
745
|
},
|
|
741
746
|
{
|
|
742
|
-
"defaultExport": "
|
|
747
|
+
"defaultExport": "ElasticEmailFullLogo",
|
|
743
748
|
"importPath": "react/admin/elements/Svgs/",
|
|
744
749
|
"externalPath": "components.admin.react.elements"
|
|
745
750
|
},
|
|
746
751
|
{
|
|
747
|
-
"defaultExport": "
|
|
752
|
+
"defaultExport": "CustomSMTPFull",
|
|
748
753
|
"importPath": "react/admin/elements/Svgs/",
|
|
749
754
|
"externalPath": "components.admin.react.elements"
|
|
750
755
|
},
|
|
@@ -768,11 +773,6 @@ module.exports = [
|
|
|
768
773
|
"importPath": "react/admin/elements/Svgs/",
|
|
769
774
|
"externalPath": "components.admin.react.elements"
|
|
770
775
|
},
|
|
771
|
-
{
|
|
772
|
-
"defaultExport": "CustomSMTPFull",
|
|
773
|
-
"importPath": "react/admin/elements/Svgs/",
|
|
774
|
-
"externalPath": "components.admin.react.elements"
|
|
775
|
-
},
|
|
776
776
|
{
|
|
777
777
|
"defaultExport": "BrevoFullLogo",
|
|
778
778
|
"importPath": "react/admin/elements/Svgs/",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravityforms/components",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.2",
|
|
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,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.26.0",
|
|
33
|
-
"@gravityforms/components": "^6.4.
|
|
33
|
+
"@gravityforms/components": "^6.4.2",
|
|
34
34
|
"@gravityforms/libraries": "^6.0.0",
|
|
35
35
|
"@gravityforms/react-utils": "^5.2.0",
|
|
36
36
|
"@gravityforms/request": "^6.1.0",
|
|
@@ -2,7 +2,7 @@ import { React } from '@gravityforms/libraries';
|
|
|
2
2
|
import { isFunction } from '@gravityforms/utils';
|
|
3
3
|
import { getModules } from './utils';
|
|
4
4
|
|
|
5
|
-
const { useEffect, useState } = React;
|
|
5
|
+
const { useCallback, useEffect, useState } = React;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @function getOrganizedData
|
|
@@ -122,9 +122,9 @@ const useDataGridState = ( {
|
|
|
122
122
|
moduleState,
|
|
123
123
|
} ) );
|
|
124
124
|
|
|
125
|
-
const updateModuleState = ( newState ) => {
|
|
126
|
-
setModuleState( { ...
|
|
127
|
-
};
|
|
125
|
+
const updateModuleState = useCallback( ( newState ) => {
|
|
126
|
+
setModuleState( ( prevState ) => ( { ...prevState, ...newState } ) );
|
|
127
|
+
}, [] );
|
|
128
128
|
|
|
129
129
|
useEffect( () => {
|
|
130
130
|
setGridLocked( organizedData.length === 0 || isLoading );
|
|
@@ -10,6 +10,7 @@ const { forwardRef } = React;
|
|
|
10
10
|
* @since 5.7.3
|
|
11
11
|
*
|
|
12
12
|
* @param {object} props Component props.
|
|
13
|
+
* @param {string} props.animation Animation style for the progress bar. Options: '' (none), 'simple'.
|
|
13
14
|
* @param {string} props.customAttributes Custom attributes for the component.
|
|
14
15
|
* @param {string | Array | object} props.customClasses Custom CSS classes for the component.
|
|
15
16
|
* @param {string} props.label Custom label text (overrides percentage).
|
|
@@ -33,6 +34,7 @@ const { forwardRef } = React;
|
|
|
33
34
|
*
|
|
34
35
|
*/
|
|
35
36
|
const Simple = forwardRef( ( {
|
|
37
|
+
animation = '',
|
|
36
38
|
customAttributes = {},
|
|
37
39
|
customClasses = [],
|
|
38
40
|
label = '',
|
|
@@ -46,6 +48,7 @@ const Simple = forwardRef( ( {
|
|
|
46
48
|
const componentProps = {
|
|
47
49
|
className: classnames( {
|
|
48
50
|
'gform-progress-bar': true,
|
|
51
|
+
[ `gform-progress-bar--animation-${ animation }` ]: !! animation,
|
|
49
52
|
[ `gform-progress-bar--size-${ size }` ]: true,
|
|
50
53
|
'gform-progress-bar--simple': true,
|
|
51
54
|
'gform-progress-bar--has-label': showLabel,
|
|
@@ -55,7 +58,7 @@ const Simple = forwardRef( ( {
|
|
|
55
58
|
...customAttributes,
|
|
56
59
|
};
|
|
57
60
|
|
|
58
|
-
const normalizedValue = Math.min( 100, Math.max( 0, value ) );
|
|
61
|
+
const normalizedValue = Math.round( Math.min( 100, Math.max( 0, value ) ) );
|
|
59
62
|
let displayLabel = label || `${ normalizedValue }%`;
|
|
60
63
|
if ( stepMode ) {
|
|
61
64
|
displayLabel = totalSteps > 0
|
|
@@ -91,6 +94,7 @@ const Simple = forwardRef( ( {
|
|
|
91
94
|
} );
|
|
92
95
|
|
|
93
96
|
Simple.propTypes = {
|
|
97
|
+
animation: PropTypes.oneOf( [ '', 'simple' ] ),
|
|
94
98
|
customAttributes: PropTypes.object,
|
|
95
99
|
customClasses: PropTypes.oneOfType( [
|
|
96
100
|
PropTypes.string,
|
|
@@ -3,7 +3,7 @@ import { spacerClasses } from '@gravityforms/utils';
|
|
|
3
3
|
import Button from '../../elements/Button';
|
|
4
4
|
import Icon from '../../elements/Icon';
|
|
5
5
|
|
|
6
|
-
const { forwardRef, useEffect, useState, createContext, useContext } = React;
|
|
6
|
+
const { forwardRef, useCallback, useEffect, useRef, useState, createContext, useContext } = React;
|
|
7
7
|
|
|
8
8
|
const SnackbarSettingsContext = createContext( {} );
|
|
9
9
|
const SnackbarContext = createContext( null );
|
|
@@ -155,16 +155,18 @@ const SnackBar = forwardRef( ( props, ref ) => {
|
|
|
155
155
|
|
|
156
156
|
export const SnackbarProvider = ( { children, defaultSettings = {} } ) => {
|
|
157
157
|
const [ messages, setMessages ] = useState( [] );
|
|
158
|
+
const defaultSettingsRef = useRef( defaultSettings );
|
|
159
|
+
defaultSettingsRef.current = defaultSettings;
|
|
158
160
|
|
|
159
|
-
const addMessage = ( message, type = 'success', additionalProps = {} ) => {
|
|
160
|
-
// Merge the global defaults with the individual message settings
|
|
161
|
-
const settings = { ...
|
|
161
|
+
const addMessage = useCallback( ( message, type = 'success', additionalProps = {} ) => {
|
|
162
|
+
// Merge the global defaults with the individual message settings (read from ref for stable callback identity)
|
|
163
|
+
const settings = { ...defaultSettingsRef.current, type, ...additionalProps };
|
|
162
164
|
|
|
163
165
|
// Generate a unique ID for the message
|
|
164
166
|
const id = Math.random().toString( 36 ).substring( 7 );
|
|
165
167
|
|
|
166
168
|
setMessages( ( prevMessages ) => [ ...prevMessages, { id, message, ...settings } ] );
|
|
167
|
-
};
|
|
169
|
+
}, [] );
|
|
168
170
|
|
|
169
171
|
const removeMessage = ( id ) => {
|
|
170
172
|
setMessages( ( prevMessages ) => prevMessages.filter( ( message ) => message.id !== id ) );
|