iglooform 2.5.19 → 2.5.20

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.
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { FormItemConfig, FormItemName } from '../../types';
3
3
  import './style/index.less';
4
4
  import { ConfirmationProps } from '../../confirmation';
@@ -8,9 +8,11 @@ export interface HStepsProps {
8
8
  [key: string]: {
9
9
  required: boolean;
10
10
  confirmation?: ConfirmationProps;
11
+ requiredMessage?: string;
11
12
  };
12
13
  };
13
14
  withReview?: boolean;
15
+ description?: ReactNode;
14
16
  };
15
17
  parentName?: FormItemName;
16
18
  name?: FormItemName;
@@ -29,7 +29,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
29
29
 
30
30
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
31
 
32
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
32
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
33
33
  import { useState, useContext, useEffect, useReducer, useRef } from 'react';
34
34
  import HStep from '../hstep';
35
35
  import { calcNamePath } from '../../utils/form-utils';
@@ -58,6 +58,7 @@ var HSteps = function HSteps(_ref) {
58
58
  subscribedFields = _ref$config.subscribedFields,
59
59
  onEdit = _ref$config.onEdit,
60
60
  confirmations = _ref$config.confirmations,
61
+ description = _ref$config.description,
61
62
  _ref$config$withRevie = _ref$config.withReview,
62
63
  withReview = _ref$config$withRevie === void 0 ? true : _ref$config$withRevie,
63
64
  name = _ref$config.name;
@@ -313,30 +314,32 @@ var HSteps = function HSteps(_ref) {
313
314
  }, (step === null || step === void 0 ? void 0 : step.key) || (step === null || step === void 0 ? void 0 : step.name));
314
315
  }), _jsxs("div", {
315
316
  className: "igloo-hsteps-confirmation",
316
- children: [_jsx(Typography, {
317
- level: md ? 'h3a' : 'h4',
318
- wrapElement: "div",
319
- children: formatMessage({
320
- id: 'Review and Submit'
321
- })
322
- }), _jsx(Typography, {
323
- level: md ? 'h3b' : 'body1',
324
- style: {
325
- marginTop: 24
326
- },
327
- wrapElement: "div",
328
- children: formatMessage({
329
- id: 'Please take a moment to review what you’ve told us above.'
330
- })
331
- }), _jsx(Typography, {
332
- level: md ? 'h3b' : 'body2',
333
- style: {
334
- marginTop: 24
335
- },
336
- wrapElement: "div",
337
- children: formatMessage({
338
- id: 'Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.'
339
- })
317
+ children: [description || _jsxs(_Fragment, {
318
+ children: [_jsx(Typography, {
319
+ level: md ? 'h3a' : 'h4',
320
+ wrapElement: "div",
321
+ children: formatMessage({
322
+ id: 'Review and Submit'
323
+ })
324
+ }), _jsx(Typography, {
325
+ level: md ? 'h3b' : 'body1',
326
+ style: {
327
+ marginTop: 24
328
+ },
329
+ wrapElement: "div",
330
+ children: formatMessage({
331
+ id: 'Please take a moment to review what you’ve told us above.'
332
+ })
333
+ }), _jsx(Typography, {
334
+ level: md ? 'h3b' : 'body2',
335
+ style: {
336
+ marginTop: 24
337
+ },
338
+ wrapElement: "div",
339
+ children: formatMessage({
340
+ id: 'Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.'
341
+ })
342
+ })]
340
343
  }), _jsx(_Divider, {}), !confirmations && _jsx(_Form.Item, {
341
344
  name: calcNamePath(parentName, 'confirmation'),
342
345
  rules: [{
@@ -360,14 +363,15 @@ var HSteps = function HSteps(_ref) {
360
363
  _ref7$ = _ref7[1],
361
364
  required = _ref7$.required,
362
365
  _ref7$$confirmation = _ref7$.confirmation,
363
- confirmation = _ref7$$confirmation === void 0 ? {} : _ref7$$confirmation;
366
+ confirmation = _ref7$$confirmation === void 0 ? {} : _ref7$$confirmation,
367
+ requiredMessage = _ref7$.requiredMessage;
364
368
 
365
369
  return _jsx(_Form.Item, {
366
370
  name: calcNamePath(parentName, key),
367
371
  rules: [{
368
372
  validator: function validator(_, value) {
369
373
  if (required && !value) {
370
- return Promise.reject(formatMessage({
374
+ return Promise.reject(requiredMessage || formatMessage({
371
375
  id: 'Please read and agree to Igloo Terms of Use and Privacy Policy'
372
376
  }));
373
377
  }
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { FormItemConfig, FormItemName } from '../../types';
3
3
  import './style/index.less';
4
4
  import { ConfirmationProps } from '../../confirmation';
@@ -8,9 +8,11 @@ export interface HStepsProps {
8
8
  [key: string]: {
9
9
  required: boolean;
10
10
  confirmation?: ConfirmationProps;
11
+ requiredMessage?: string;
11
12
  };
12
13
  };
13
14
  withReview?: boolean;
15
+ description?: ReactNode;
14
16
  };
15
17
  parentName?: FormItemName;
16
18
  name?: FormItemName;
@@ -87,6 +87,7 @@ var HSteps = function HSteps(_ref) {
87
87
  subscribedFields = _ref$config.subscribedFields,
88
88
  onEdit = _ref$config.onEdit,
89
89
  confirmations = _ref$config.confirmations,
90
+ description = _ref$config.description,
90
91
  _ref$config$withRevie = _ref$config.withReview,
91
92
  withReview = _ref$config$withRevie === void 0 ? true : _ref$config$withRevie,
92
93
  name = _ref$config.name;
@@ -342,30 +343,32 @@ var HSteps = function HSteps(_ref) {
342
343
  }, (step === null || step === void 0 ? void 0 : step.key) || (step === null || step === void 0 ? void 0 : step.name));
343
344
  }), (0, _jsxRuntime.jsxs)("div", {
344
345
  className: "igloo-hsteps-confirmation",
345
- children: [(0, _jsxRuntime.jsx)(_typography.default, {
346
- level: md ? 'h3a' : 'h4',
347
- wrapElement: "div",
348
- children: formatMessage({
349
- id: 'Review and Submit'
350
- })
351
- }), (0, _jsxRuntime.jsx)(_typography.default, {
352
- level: md ? 'h3b' : 'body1',
353
- style: {
354
- marginTop: 24
355
- },
356
- wrapElement: "div",
357
- children: formatMessage({
358
- id: 'Please take a moment to review what you’ve told us above.'
359
- })
360
- }), (0, _jsxRuntime.jsx)(_typography.default, {
361
- level: md ? 'h3b' : 'body2',
362
- style: {
363
- marginTop: 24
364
- },
365
- wrapElement: "div",
366
- children: formatMessage({
367
- id: 'Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.'
368
- })
346
+ children: [description || (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
347
+ children: [(0, _jsxRuntime.jsx)(_typography.default, {
348
+ level: md ? 'h3a' : 'h4',
349
+ wrapElement: "div",
350
+ children: formatMessage({
351
+ id: 'Review and Submit'
352
+ })
353
+ }), (0, _jsxRuntime.jsx)(_typography.default, {
354
+ level: md ? 'h3b' : 'body1',
355
+ style: {
356
+ marginTop: 24
357
+ },
358
+ wrapElement: "div",
359
+ children: formatMessage({
360
+ id: 'Please take a moment to review what you’ve told us above.'
361
+ })
362
+ }), (0, _jsxRuntime.jsx)(_typography.default, {
363
+ level: md ? 'h3b' : 'body2',
364
+ style: {
365
+ marginTop: 24
366
+ },
367
+ wrapElement: "div",
368
+ children: formatMessage({
369
+ id: 'Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.'
370
+ })
371
+ })]
369
372
  }), (0, _jsxRuntime.jsx)(_divider.default, {}), !confirmations && (0, _jsxRuntime.jsx)(_form.default.Item, {
370
373
  name: (0, _formUtils.calcNamePath)(parentName, 'confirmation'),
371
374
  rules: [{
@@ -389,14 +392,15 @@ var HSteps = function HSteps(_ref) {
389
392
  _ref7$ = _ref7[1],
390
393
  required = _ref7$.required,
391
394
  _ref7$$confirmation = _ref7$.confirmation,
392
- confirmation = _ref7$$confirmation === void 0 ? {} : _ref7$$confirmation;
395
+ confirmation = _ref7$$confirmation === void 0 ? {} : _ref7$$confirmation,
396
+ requiredMessage = _ref7$.requiredMessage;
393
397
 
394
398
  return (0, _jsxRuntime.jsx)(_form.default.Item, {
395
399
  name: (0, _formUtils.calcNamePath)(parentName, key),
396
400
  rules: [{
397
401
  validator: function validator(_, value) {
398
402
  if (required && !value) {
399
- return Promise.reject(formatMessage({
403
+ return Promise.reject(requiredMessage || formatMessage({
400
404
  id: 'Please read and agree to Igloo Terms of Use and Privacy Policy'
401
405
  }));
402
406
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "2.5.19",
3
+ "version": "2.5.20",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",