@reachfive/identity-ui 1.20.2 → 1.22.0
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 +27 -2
- package/cjs/identity-ui.js +264 -285
- package/es/identity-ui.js +269 -289
- package/package.json +2 -2
- package/umd/identity-ui.js +279 -334
- package/umd/identity-ui.min.js +1 -1
package/es/identity-ui.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createClient as createClient$1 } from '@reachfive/identity-core';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
-
import React__default, { createElement, useState } from 'react';
|
|
3
|
+
import React__default, { createElement, useState, useEffect, useMemo } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { getContext, compose as compose$1, withContext, withHandlers } from '@hypnosphi/recompose';
|
|
6
|
-
import { darken, lighten, transparentize
|
|
6
|
+
import { darken, lighten, transparentize } from 'polished';
|
|
7
7
|
import styled, { keyframes, css } from 'styled-components';
|
|
8
8
|
import { Transition } from 'react-transition-group';
|
|
9
9
|
import classes from 'classnames';
|
|
10
10
|
import { Remarkable } from 'remarkable';
|
|
11
|
-
import validator
|
|
12
|
-
import { isValidNumber, AsYouType, format
|
|
11
|
+
import validator from 'validator';
|
|
12
|
+
import { isValidNumber, AsYouType, format, parse } from 'libphonenumber-js';
|
|
13
13
|
import { isEqual } from 'lodash-es';
|
|
14
|
-
import { DateTime } from 'luxon';
|
|
14
|
+
import { DateTime, Info as Info$1 } from 'luxon';
|
|
15
15
|
import { isLower, isUpper, isDigit } from 'char-info';
|
|
16
16
|
import zxcvbn from '@reachfive/zxcvbn';
|
|
17
17
|
|
|
@@ -6277,75 +6277,88 @@ var paypal = {
|
|
|
6277
6277
|
icon: icon$e
|
|
6278
6278
|
};
|
|
6279
6279
|
|
|
6280
|
-
var icon$f = "data:image/svg+xml,%3Csvg%20width%3D%
|
|
6280
|
+
var icon$f = "data:image/svg+xml,%3Csvg%20width%3D%22800px%22%20height%3D%22800px%22%20viewBox%3D%220%200%20128%20128%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20aria-hidden%3D%22true%22%20role%3D%22img%22%20class%3D%22iconify%20iconify--noto%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%3E%3Cpath%20d%3D%22M72.51%2015.42H34.65c-.15%200-.28.06-.42.08h-6.47c-1.24%200-2.24%201-2.24%202.24v100.97c0%201.24%201%202.24%202.24%202.24h21.9c1.24%200%202.24-1%202.24-2.24V86.63h20.61c19.83%200%2035.96-15.97%2035.96-35.6c.01-19.63-16.13-35.61-35.96-35.61zm-1.72%2050.22c-.35.03-.7.06-1.06.06H52.28c-.05%200-.09-.04-.14-.06a.513.513%200%200%201-.24-.1a.577.577%200%200%201-.21-.43V36.94c0-.18.09-.32.21-.43c.06-.06.14-.07.22-.09c.06-.02.09-.06.15-.06h17.45c.4%200%20.8.03%201.19.06c7.25.63%2012.97%206.94%2012.97%2014.61c.01%207.71-5.77%2014.05-13.09%2014.61z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E";
|
|
6281
|
+
|
|
6282
|
+
var ping = {
|
|
6283
|
+
key: 'ping',
|
|
6284
|
+
name: 'Ping',
|
|
6285
|
+
color: '#c90917',
|
|
6286
|
+
icon: icon$f,
|
|
6287
|
+
windowSize: {
|
|
6288
|
+
width: 450,
|
|
6289
|
+
height: 400
|
|
6290
|
+
}
|
|
6291
|
+
};
|
|
6292
|
+
|
|
6293
|
+
var icon$g = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M270%20806q-8-19-8-52%200-20%2011-49t24-45q-1-22%207.5-53t22.5-43q0-139%2092.5-288.5t217.5-209.5q139-66%20324-66%20133%200%20266%2055%2049%2021%2090%2048t71%2056%2055%2068%2042%2074%2032.5%2084.5%2025.5%2089.5%2022%2098l1%205q55%2083%2055%20150%200%2014-9%2040t-9%2038q0%201%201.5%203.5t3.5%205%202%203.5q77%20114%20120.5%20214.5t43.5%20208.5q0%2043-19.5%20100t-55.5%2057q-9%200-19.5-7.5t-19-17.5-19-26-16-26.5-13.5-26-9-17.5q-1-1-3-1l-5%204q-59%20154-132%20223%2020%2020%2061.5%2038.5t69%2041.5%2035.5%2065q-2%204-4%2016t-7%2018q-64%2097-302%2097-53%200-110.5-9t-98-20-104.5-30q-15-5-23-7-14-4-46-4.5t-40-1.5q-41%2045-127.5%2065t-168.5%2020q-35%200-69-1.5t-93-9-101-20.5-74.5-40-32.5-64q0-40%2010-59.5t41-48.5q11-2%2040.5-13t49.5-12q4%200%2014-2%202-2%202-4l-2-3q-48-11-108-105.5t-73-156.5l-5-3q-4%200-12%2020-18%2041-54.5%2074.5t-77.5%2037.5h-1q-4%200-6-4.5t-5-5.5q-23-54-23-100%200-275%20252-466z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
|
|
6281
6294
|
|
|
6282
6295
|
var qq = {
|
|
6283
6296
|
key: 'qq',
|
|
6284
6297
|
name: 'QQ',
|
|
6285
6298
|
color: '#0071c3',
|
|
6286
|
-
icon: icon$
|
|
6299
|
+
icon: icon$g,
|
|
6287
6300
|
windowSize: {
|
|
6288
6301
|
width: 450,
|
|
6289
6302
|
height: 400
|
|
6290
6303
|
}
|
|
6291
6304
|
};
|
|
6292
6305
|
|
|
6293
|
-
var icon$
|
|
6306
|
+
var icon$h = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1684%20408q-67%2098-162%20167%201%2014%201%2042%200%20130-38%20259.5t-115.5%20248.5-184.5%20210.5-258%20146-323%2054.5q-271%200-496-145%2035%204%2078%204%20225%200%20401-138-105-2-188-64.5t-114-159.5q33%205%2061%205%2043%200%2085-11-112-23-185.5-111.5t-73.5-205.5v-4q68%2038%20146%2041-66-44-105-115t-39-154q0-88%2044-163%20121%20149%20294.5%20238.5t371.5%2099.5q-8-38-8-74%200-134%2094.5-228.5t228.5-94.5q140%200%20236%20102%20109-21%20205-78-37%20115-142%20178%2093-10%20186-50z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
|
|
6294
6307
|
|
|
6295
6308
|
var twitter = {
|
|
6296
6309
|
key: 'twitter',
|
|
6297
6310
|
name: 'Twitter',
|
|
6298
6311
|
color: '#55acee',
|
|
6299
|
-
icon: icon$
|
|
6312
|
+
icon: icon$h,
|
|
6300
6313
|
windowSize: {
|
|
6301
6314
|
width: 800,
|
|
6302
6315
|
height: 440
|
|
6303
6316
|
}
|
|
6304
6317
|
};
|
|
6305
6318
|
|
|
6306
|
-
var icon$
|
|
6319
|
+
var icon$i = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1853%20520q23%2064-150%20294-24%2032-65%2085-78%20100-90%20131-17%2041%2014%2081%2017%2021%2081%2082h1l1%201%201%201%202%202q141%20131%20191%20221%203%205%206.5%2012.5t7%2026.5-.5%2034-25%2027.5-59%2012.5l-256%204q-24%205-56-5t-52-22l-20-12q-30-21-70-64t-68.5-77.5-61-58-56.5-15.5q-3%201-8%203.5t-17%2014.5-21.5%2029.5-17%2052-6.5%2077.5q0%2015-3.5%2027.5t-7.5%2018.5l-4%205q-18%2019-53%2022h-115q-71%204-146-16.5t-131.5-53-103-66-70.5-57.5l-25-24q-10-10-27.5-30t-71.5-91-106-151-122.5-211-130.5-272q-6-16-6-27t3-16l4-6q15-19%2057-19l274-2q12%202%2023%206.5t16%208.5l5%203q16%2011%2024%2032%2020%2050%2046%20103.5t41%2081.5l16%2029q29%2060%2056%20104t48.5%2068.5%2041.5%2038.5%2034%2014%2027-5q2-1%205-5t12-22%2013.5-47%209.5-81%200-125q-2-40-9-73t-14-46l-6-12q-25-34-85-43-13-2%205-24%2017-19%2038-30%2053-26%20239-24%2082%201%20135%2013%2020%205%2033.5%2013.5t20.5%2024%2010.5%2032%203.5%2045.5-1%2055-2.5%2070.5-1.5%2082.5q0%2011-1%2042t-.5%2048%203.5%2040.5%2011.5%2039%2022.5%2024.5q8%202%2017%204t26-11%2038-34.5%2052-67%2068-107.5q60-104%20107-225%204-10%2010-17.5t11-10.5l4-3%205-2.5%2013-3%2020-.5%20288-2q39-5%2064%202.5t31%2016.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
|
|
6307
6320
|
|
|
6308
6321
|
var vkontakte = {
|
|
6309
6322
|
key: 'vkontakte',
|
|
6310
6323
|
fontKey: 'vk',
|
|
6311
6324
|
name: 'VKontakte',
|
|
6312
6325
|
color: '#45668e',
|
|
6313
|
-
icon: icon$
|
|
6326
|
+
icon: icon$i,
|
|
6314
6327
|
windowSize: {
|
|
6315
6328
|
width: 655,
|
|
6316
6329
|
height: 430
|
|
6317
6330
|
}
|
|
6318
6331
|
};
|
|
6319
6332
|
|
|
6320
|
-
var icon$
|
|
6333
|
+
var icon$j = "data:image/svg+xml,%3Csvg%20width%3D%222048%22%20height%3D%221792%22%20viewBox%3D%220%200%202048%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M580%20461q0-41-25-66t-66-25q-43%200-76%2025.5t-33%2065.5q0%2039%2033%2064.5t76%2025.5q41%200%2066-24.5t25-65.5zm743%20507q0-28-25.5-50t-65.5-22q-27%200-49.5%2022.5t-22.5%2049.5q0%2028%2022.5%2050.5t49.5%2022.5q40%200%2065.5-22t25.5-51zm-236-507q0-41-24.5-66t-65.5-25q-43%200-76%2025.5t-33%2065.5q0%2039%2033%2064.5t76%2025.5q41%200%2065.5-24.5t24.5-65.5zm635%20507q0-28-26-50t-65-22q-27%200-49.5%2022.5t-22.5%2049.5q0%2028%2022.5%2050.5t49.5%2022.5q39%200%2065-22t26-51zm-266-397q-31-4-70-4-169%200-311%2077t-223.5%20208.5-81.5%20287.5q0%2078%2023%20152-35%203-68%203-26%200-50-1.5t-55-6.5-44.5-7-54.5-10.5-50-10.5l-253%20127%2072-218q-290-203-290-490%200-169%2097.5-311t264-223.5%20363.5-81.5q176%200%20332.5%2066t262%20182.5%20136.5%20260.5zm592%20561q0%20117-68.5%20223.5t-185.5%20193.5l55%20181-199-109q-150%2037-218%2037-169%200-311-70.5t-223.5-191.5-81.5-264%2081.5-264%20223.5-191.5%20311-70.5q161%200%20303%2070.5t227.5%20192%2085.5%20263.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
|
|
6321
6334
|
|
|
6322
6335
|
var wechat = {
|
|
6323
6336
|
key: 'wechat',
|
|
6324
6337
|
name: 'WeChat',
|
|
6325
6338
|
color: '#44b549',
|
|
6326
|
-
icon: icon$
|
|
6339
|
+
icon: icon$j,
|
|
6327
6340
|
windowSize: {
|
|
6328
6341
|
width: 450,
|
|
6329
6342
|
height: 400
|
|
6330
6343
|
}
|
|
6331
6344
|
};
|
|
6332
6345
|
|
|
6333
|
-
var icon$
|
|
6346
|
+
var icon$k = "data:image/svg+xml,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M675%201284q21-34%2011-69t-45-50q-34-14-73-1t-60%2046q-22%2034-13%2068.5t43%2050.5%2074.5%202.5%2062.5-47.5zm94-121q8-13%203.5-26.5t-17.5-18.5q-14-5-28.5.5t-21.5%2018.5q-17%2031%2013%2045%2014%205%2029-.5t22-18.5zm174%20107q-45%20102-158%20150t-224%2012q-107-34-147.5-126.5t6.5-187.5q47-93%20151.5-139t210.5-19q111%2029%20158.5%20119.5t2.5%20190.5zm312-160q-9-96-89-170t-208.5-109-274.5-21q-223%2023-369.5%20141.5t-132.5%20264.5q9%2096%2089%20170t208.5%20109%20274.5%2021q223-23%20369.5-141.5t132.5-264.5zm308%204q0%2068-37%20139.5t-109%20137-168.5%20117.5-226%2083-270.5%2031-275-33.5-240.5-93-171.5-151-65-199.5q0-115%2069.5-245t197.5-258q169-169%20341.5-236t246.5%207q65%2064%2020%20209-4%2014-1%2020t10%207%2014.5-.5%2013.5-3.5l6-2q139-59%20246-59t153%2061q45%2063%200%20178-2%2013-4.5%2020t4.5%2012.5%2012%207.5%2017%206q57%2018%20103%2047t80%2081.5%2034%20116.5zm-74-624q42%2047%2054.5%20108.5t-6.5%20117.5q-8%2023-29.5%2034t-44.5%204q-23-8-34-29.5t-4-44.5q20-63-24-111t-107-35q-24%205-45-8t-25-37q-5-24%208-44.5t37-25.5q60-13%20119%205.5t101%2065.5zm181-163q87%2096%20112.5%20222.5t-13.5%20241.5q-9%2027-34%2040t-52%204-40-34-5-52q28-82%2010-172t-80-158q-62-69-148-95.5t-173-8.5q-28%206-52-9.5t-30-43.5%209.5-51.5%2043.5-29.5q123-26%20244%2011.5t208%20134.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
|
|
6334
6347
|
|
|
6335
6348
|
var weibo = {
|
|
6336
6349
|
key: 'weibo',
|
|
6337
6350
|
name: 'Weibo',
|
|
6338
6351
|
color: '#e71d34',
|
|
6339
|
-
icon: icon$
|
|
6352
|
+
icon: icon$k
|
|
6340
6353
|
};
|
|
6341
6354
|
|
|
6342
|
-
var icon$
|
|
6355
|
+
var icon$l = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M937%201004l266-499h-112l-157%20312q-24%2048-44%2092l-42-92-155-312h-120l263%20493v324h101v-318zm727-588v960q0%20119-84.5%20203.5t-203.5%2084.5h-960q-119%200-203.5-84.5t-84.5-203.5v-960q0-119%2084.5-203.5t203.5-84.5h960q119%200%20203.5%2084.5t84.5%20203.5z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
|
|
6343
6356
|
|
|
6344
6357
|
var yandex = {
|
|
6345
6358
|
key: 'yandex',
|
|
6346
6359
|
name: 'Yandex',
|
|
6347
6360
|
color: '#d43b2f',
|
|
6348
|
-
icon: icon$
|
|
6361
|
+
icon: icon$l,
|
|
6349
6362
|
windowSize: {
|
|
6350
6363
|
width: 655,
|
|
6351
6364
|
height: 700
|
|
@@ -6369,6 +6382,7 @@ var providers = /*#__PURE__*/Object.freeze({
|
|
|
6369
6382
|
oney: oney,
|
|
6370
6383
|
orange: orange,
|
|
6371
6384
|
paypal: paypal,
|
|
6385
|
+
ping: ping,
|
|
6372
6386
|
qq: qq,
|
|
6373
6387
|
twitter: twitter,
|
|
6374
6388
|
vkontakte: vkontakte,
|
|
@@ -7305,12 +7319,6 @@ function isValued(v) {
|
|
|
7305
7319
|
var unwrap = isObject(v) ? v[rawProperty] : v;
|
|
7306
7320
|
return unwrap !== null && unwrap !== undefined && unwrap !== '' && !Number.isNaN(unwrap) && (Array.isArray(unwrap) ? unwrap.length > 0 : true);
|
|
7307
7321
|
}
|
|
7308
|
-
function formatISO8601Date(year, month, day) {
|
|
7309
|
-
if (isValued(year) && isValued(month) && isValued(day)) {
|
|
7310
|
-
return "".concat(year, "-").concat(month.toString().padStart(2, '0'), "-").concat(day.toString().padStart(2, '0'));
|
|
7311
|
-
}
|
|
7312
|
-
return null;
|
|
7313
|
-
}
|
|
7314
7322
|
function specializeIdentifierData(data) {
|
|
7315
7323
|
return data.identifier ? _objectSpread2(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
7316
7324
|
identifier: undefined
|
|
@@ -8676,7 +8684,7 @@ var IdentifierField = /*#__PURE__*/function (_React$Component) {
|
|
|
8676
8684
|
_defineProperty(_assertThisInitialized(_this), "asYouType", function (inputValue) {
|
|
8677
8685
|
var country = _this.props.value.country;
|
|
8678
8686
|
var phone = new AsYouType(country).input(inputValue);
|
|
8679
|
-
var formatted = format
|
|
8687
|
+
var formatted = format(phone, country, 'International');
|
|
8680
8688
|
var isValid = isValidNumber(phone, country);
|
|
8681
8689
|
return {
|
|
8682
8690
|
country: country,
|
|
@@ -8693,9 +8701,10 @@ var IdentifierField = /*#__PURE__*/function (_React$Component) {
|
|
|
8693
8701
|
var _this$props$value = this.props.value,
|
|
8694
8702
|
userInput = _this$props$value.userInput,
|
|
8695
8703
|
country = _this$props$value.country;
|
|
8704
|
+
if (!userInput) return;
|
|
8696
8705
|
try {
|
|
8697
8706
|
var parsed = parse(userInput, country);
|
|
8698
|
-
var phoneValue = country === parsed.country ? format
|
|
8707
|
+
var phoneValue = country === parsed.country ? format(parsed, 'National') : userInput;
|
|
8699
8708
|
this.asYouType(phoneValue);
|
|
8700
8709
|
} catch (e) {
|
|
8701
8710
|
console.error(e);
|
|
@@ -9601,275 +9610,248 @@ function selectField(_ref) {
|
|
|
9601
9610
|
}));
|
|
9602
9611
|
}
|
|
9603
9612
|
|
|
9604
|
-
var
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9613
|
+
var useDebounce = function useDebounce(value, milliSeconds) {
|
|
9614
|
+
var _useState = useState(value),
|
|
9615
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9616
|
+
debouncedValue = _useState2[0],
|
|
9617
|
+
setDebouncedValue = _useState2[1];
|
|
9618
|
+
useEffect(function () {
|
|
9619
|
+
var handler = setTimeout(function () {
|
|
9620
|
+
setDebouncedValue(value);
|
|
9621
|
+
}, milliSeconds);
|
|
9622
|
+
return function () {
|
|
9623
|
+
clearTimeout(handler);
|
|
9624
|
+
};
|
|
9625
|
+
}, [value, milliSeconds]);
|
|
9626
|
+
return debouncedValue;
|
|
9616
9627
|
};
|
|
9617
|
-
function dateField(config) {
|
|
9618
|
-
return simpleField(_objectSpread2(_objectSpread2({
|
|
9619
|
-
placeholder: 'mm/dd/yyyy'
|
|
9620
|
-
}, config), {}, {
|
|
9621
|
-
type: 'text',
|
|
9622
|
-
format: {
|
|
9623
|
-
bind: function bind(modelValue) {
|
|
9624
|
-
if (modelValue && modelValue.length) {
|
|
9625
|
-
var _modelValue$split = modelValue.split('-'),
|
|
9626
|
-
_modelValue$split2 = _slicedToArray(_modelValue$split, 3),
|
|
9627
|
-
_modelValue$split2$ = _modelValue$split2[0],
|
|
9628
|
-
year = _modelValue$split2$ === void 0 ? '' : _modelValue$split2$,
|
|
9629
|
-
_modelValue$split2$2 = _modelValue$split2[1],
|
|
9630
|
-
month = _modelValue$split2$2 === void 0 ? '' : _modelValue$split2$2,
|
|
9631
|
-
_modelValue$split2$3 = _modelValue$split2[2],
|
|
9632
|
-
day = _modelValue$split2$3 === void 0 ? '' : _modelValue$split2$3;
|
|
9633
|
-
return "".concat(month, "/").concat(day, "/").concat(year);
|
|
9634
|
-
}
|
|
9635
|
-
},
|
|
9636
|
-
unbind: formatDate
|
|
9637
|
-
},
|
|
9638
|
-
validator: new Validator({
|
|
9639
|
-
rule: function rule(value) {
|
|
9640
|
-
var date = formatDate(value);
|
|
9641
|
-
return !date || validator(date);
|
|
9642
|
-
},
|
|
9643
|
-
hint: 'date'
|
|
9644
|
-
})
|
|
9645
|
-
}));
|
|
9646
|
-
}
|
|
9647
9628
|
|
|
9648
|
-
var _excluded$6 = ["state"];
|
|
9649
9629
|
var _templateObject$a, _templateObject2$5;
|
|
9650
|
-
var BIRTHDAY_PATH = 'birthdate';
|
|
9651
|
-
var months = function months(i18n) {
|
|
9652
|
-
return ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'].map(function (m, i) {
|
|
9653
|
-
return {
|
|
9654
|
-
value: i + 1,
|
|
9655
|
-
label: i18n(m)
|
|
9656
|
-
};
|
|
9657
|
-
});
|
|
9658
|
-
};
|
|
9659
9630
|
var inputRowGutter = 10;
|
|
9660
|
-
var InputRow = styled.div(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n
|
|
9661
|
-
var InputCol = styled.div(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteral(["\n
|
|
9631
|
+
var InputRow = styled.div(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n gap: ", "px;\n"])), inputRowGutter);
|
|
9632
|
+
var InputCol = styled.div(_templateObject2$5 || (_templateObject2$5 = _taggedTemplateLiteral(["\n flex-basis: ", "%;\n"])), function (props) {
|
|
9662
9633
|
return props.width;
|
|
9663
9634
|
});
|
|
9664
|
-
var
|
|
9665
|
-
var
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9635
|
+
var DateField = function DateField(_ref) {
|
|
9636
|
+
var i18n = _ref.i18n,
|
|
9637
|
+
inputId = _ref.inputId,
|
|
9638
|
+
label = _ref.label,
|
|
9639
|
+
locale = _ref.locale,
|
|
9640
|
+
onChange = _ref.onChange,
|
|
9641
|
+
path = _ref.path,
|
|
9642
|
+
required = _ref.required,
|
|
9643
|
+
showLabel = _ref.showLabel,
|
|
9644
|
+
validation = _ref.validation,
|
|
9645
|
+
value = _ref.value;
|
|
9646
|
+
var _useState = useState(isValued(value) ? value.raw.day : undefined),
|
|
9647
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9648
|
+
day = _useState2[0],
|
|
9649
|
+
setDay = _useState2[1];
|
|
9650
|
+
var _useState3 = useState(isValued(value) ? value.raw.month : undefined),
|
|
9651
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9652
|
+
month = _useState4[0],
|
|
9653
|
+
setMonth = _useState4[1];
|
|
9654
|
+
var _useState5 = useState(isValued(value) ? value.raw.year : undefined),
|
|
9655
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9656
|
+
year = _useState6[0],
|
|
9657
|
+
setYear = _useState6[1];
|
|
9658
|
+
|
|
9659
|
+
// debounce year value to delay value update when user is currently editing it
|
|
9660
|
+
var debouncedYear = useDebounce(year, 1000);
|
|
9661
|
+
var setDatePart = function setDatePart(setter, value) {
|
|
9662
|
+
if (Number.isNaN(Number(value))) return; // only accept number value
|
|
9663
|
+
setter(Number(value));
|
|
9687
9664
|
};
|
|
9688
|
-
var
|
|
9689
|
-
return
|
|
9690
|
-
|
|
9691
|
-
|
|
9665
|
+
var handleDayChange = function handleDayChange(event) {
|
|
9666
|
+
return setDatePart(setDay, event.target.value);
|
|
9667
|
+
};
|
|
9668
|
+
var handleMonthChange = function handleMonthChange(event) {
|
|
9669
|
+
return setDatePart(setMonth, event.target.value);
|
|
9670
|
+
};
|
|
9671
|
+
var handleYearChange = function handleYearChange(event) {
|
|
9672
|
+
return setDatePart(setYear, event.target.value);
|
|
9673
|
+
};
|
|
9674
|
+
useEffect(function () {
|
|
9675
|
+
if (day && month && debouncedYear) {
|
|
9676
|
+
onChange(function () {
|
|
9677
|
+
return {
|
|
9678
|
+
value: {
|
|
9679
|
+
raw: DateTime.fromObject({
|
|
9680
|
+
year: debouncedYear,
|
|
9681
|
+
month: month,
|
|
9682
|
+
day: day
|
|
9683
|
+
})
|
|
9684
|
+
},
|
|
9692
9685
|
isDirty: true
|
|
9693
|
-
}
|
|
9686
|
+
};
|
|
9694
9687
|
});
|
|
9695
|
-
}
|
|
9688
|
+
}
|
|
9689
|
+
}, [debouncedYear, month, day]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
9690
|
+
|
|
9691
|
+
var months = useMemo(function () {
|
|
9692
|
+
return Info$1.months("long", {
|
|
9693
|
+
locale: locale
|
|
9694
|
+
});
|
|
9695
|
+
}, [locale]);
|
|
9696
|
+
var daysInMonth = useMemo(function () {
|
|
9697
|
+
return Array.from({
|
|
9698
|
+
length: DateTime.fromObject({
|
|
9699
|
+
year: debouncedYear,
|
|
9700
|
+
month: month
|
|
9701
|
+
}).daysInMonth
|
|
9702
|
+
}, function (_value, index) {
|
|
9703
|
+
return index + 1;
|
|
9704
|
+
});
|
|
9705
|
+
}, [debouncedYear, month]);
|
|
9706
|
+
|
|
9707
|
+
// reset day if current value is out of range
|
|
9708
|
+
if (day && !daysInMonth.includes(day)) {
|
|
9709
|
+
setDay(undefined);
|
|
9710
|
+
}
|
|
9711
|
+
var parts = useMemo(function () {
|
|
9712
|
+
return DateTime.now().setLocale(locale).toLocaleParts().map(function (part) {
|
|
9713
|
+
return part.type;
|
|
9714
|
+
}).filter(function (type) {
|
|
9715
|
+
return type !== 'literal';
|
|
9716
|
+
});
|
|
9717
|
+
}, [locale]);
|
|
9718
|
+
var error = _typeof(validation) === 'object' && 'error' in validation ? validation.error : null;
|
|
9719
|
+
var fields = {
|
|
9720
|
+
day: /*#__PURE__*/React__default.createElement(InputCol, {
|
|
9721
|
+
key: "day",
|
|
9722
|
+
width: 20
|
|
9723
|
+
}, /*#__PURE__*/React__default.createElement(Select, {
|
|
9724
|
+
name: "".concat(path, ".day"),
|
|
9725
|
+
value: day || '',
|
|
9726
|
+
hasError: error,
|
|
9727
|
+
required: required,
|
|
9728
|
+
onChange: handleDayChange,
|
|
9729
|
+
placeholder: i18n('day'),
|
|
9730
|
+
options: daysInMonth.map(function (day) {
|
|
9731
|
+
return {
|
|
9732
|
+
value: day,
|
|
9733
|
+
label: day
|
|
9734
|
+
};
|
|
9735
|
+
}),
|
|
9736
|
+
"data-testid": "".concat(path, ".day"),
|
|
9737
|
+
"aria-label": i18n('day')
|
|
9738
|
+
})),
|
|
9739
|
+
month: /*#__PURE__*/React__default.createElement(InputCol, {
|
|
9740
|
+
key: "month",
|
|
9741
|
+
width: 50
|
|
9742
|
+
}, /*#__PURE__*/React__default.createElement(Select, {
|
|
9743
|
+
name: "".concat(path, ".month"),
|
|
9744
|
+
value: month || '',
|
|
9745
|
+
hasError: error,
|
|
9746
|
+
required: required,
|
|
9747
|
+
onChange: handleMonthChange,
|
|
9748
|
+
placeholder: i18n('month'),
|
|
9749
|
+
options: months.map(function (month, index) {
|
|
9750
|
+
return {
|
|
9751
|
+
value: index + 1,
|
|
9752
|
+
label: month
|
|
9753
|
+
};
|
|
9754
|
+
}),
|
|
9755
|
+
"data-testid": "".concat(path, ".month"),
|
|
9756
|
+
"aria-label": i18n('month')
|
|
9757
|
+
})),
|
|
9758
|
+
year: /*#__PURE__*/React__default.createElement(InputCol, {
|
|
9759
|
+
key: "year",
|
|
9760
|
+
width: 30
|
|
9761
|
+
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
9762
|
+
type: "number",
|
|
9763
|
+
maxlength: "4",
|
|
9764
|
+
inputmode: "numeric",
|
|
9765
|
+
name: "".concat(path, ".year"),
|
|
9766
|
+
value: year || '',
|
|
9767
|
+
hasError: error,
|
|
9768
|
+
required: required,
|
|
9769
|
+
onChange: handleYearChange,
|
|
9770
|
+
placeholder: i18n('year'),
|
|
9771
|
+
"data-testid": "".concat(path, ".year"),
|
|
9772
|
+
"aria-label": i18n('year')
|
|
9773
|
+
}))
|
|
9696
9774
|
};
|
|
9697
|
-
return /*#__PURE__*/React__default.createElement(FormGroup,
|
|
9775
|
+
return /*#__PURE__*/React__default.createElement(FormGroup, {
|
|
9698
9776
|
inputId: inputId,
|
|
9699
|
-
labelText: label
|
|
9700
|
-
|
|
9777
|
+
labelText: label,
|
|
9778
|
+
error: error,
|
|
9701
9779
|
showLabel: showLabel
|
|
9702
|
-
}
|
|
9703
|
-
|
|
9704
|
-
}
|
|
9705
|
-
type: "text",
|
|
9706
|
-
id: inputId,
|
|
9707
|
-
name: "".concat(BIRTHDAY_PATH, ".day"),
|
|
9708
|
-
maxlength: "2",
|
|
9709
|
-
inputmode: "numeric",
|
|
9710
|
-
value: day.value,
|
|
9711
|
-
hasError: !!validation.day,
|
|
9712
|
-
required: required,
|
|
9713
|
-
placeholder: i18n('day'),
|
|
9714
|
-
onChange: handleFieldChange('day'),
|
|
9715
|
-
onBlur: handleFieldBlur('day'),
|
|
9716
|
-
"data-testid": "".concat(BIRTHDAY_PATH, ".day")
|
|
9717
|
-
})), /*#__PURE__*/React__default.createElement(InputCol, {
|
|
9718
|
-
width: 50
|
|
9719
|
-
}, /*#__PURE__*/React__default.createElement(Select, {
|
|
9720
|
-
name: "".concat(BIRTHDAY_PATH, ".month"),
|
|
9721
|
-
value: month.value || '',
|
|
9722
|
-
hasError: !!validation.month,
|
|
9723
|
-
required: required,
|
|
9724
|
-
onChange: handleFieldChange('month'),
|
|
9725
|
-
onBlur: handleFieldBlur('month'),
|
|
9726
|
-
placeholder: i18n('month'),
|
|
9727
|
-
options: months,
|
|
9728
|
-
"data-testid": "".concat(BIRTHDAY_PATH, ".month")
|
|
9729
|
-
})), /*#__PURE__*/React__default.createElement(InputCol, {
|
|
9730
|
-
width: 30
|
|
9731
|
-
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
9732
|
-
type: "text",
|
|
9733
|
-
name: "".concat(BIRTHDAY_PATH, ".year"),
|
|
9734
|
-
maxlength: "4",
|
|
9735
|
-
inputmode: "numeric",
|
|
9736
|
-
value: year.value,
|
|
9737
|
-
hasError: !!validation.year,
|
|
9738
|
-
required: required,
|
|
9739
|
-
placeholder: i18n('year'),
|
|
9740
|
-
onChange: handleFieldChange('year'),
|
|
9741
|
-
onBlur: handleFieldBlur('year'),
|
|
9742
|
-
"data-testid": "".concat(BIRTHDAY_PATH, ".year")
|
|
9743
|
-
}))));
|
|
9780
|
+
}, /*#__PURE__*/React__default.createElement(InputRow, null, parts.map(function (part) {
|
|
9781
|
+
return fields[part];
|
|
9782
|
+
})));
|
|
9744
9783
|
};
|
|
9745
|
-
var
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
-
|
|
9784
|
+
var dateFormat = function dateFormat(locale) {
|
|
9785
|
+
return DateTime.now().setLocale(locale).toLocaleParts().map(function (part) {
|
|
9786
|
+
switch (part.type) {
|
|
9787
|
+
case 'day':
|
|
9788
|
+
return 'dd';
|
|
9789
|
+
case 'month':
|
|
9790
|
+
return 'mm';
|
|
9791
|
+
case 'year':
|
|
9792
|
+
return 'yyyy';
|
|
9793
|
+
case 'literal':
|
|
9794
|
+
return part.value;
|
|
9795
|
+
}
|
|
9796
|
+
}).join('');
|
|
9754
9797
|
};
|
|
9755
|
-
var
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9798
|
+
var datetimeValidator = function datetimeValidator(locale) {
|
|
9799
|
+
return new Validator({
|
|
9800
|
+
rule: function rule(value) {
|
|
9801
|
+
return isValued(value) && value.raw.isValid;
|
|
9802
|
+
},
|
|
9803
|
+
hint: 'date',
|
|
9804
|
+
parameters: {
|
|
9805
|
+
format: dateFormat(locale)
|
|
9806
|
+
}
|
|
9807
|
+
});
|
|
9760
9808
|
};
|
|
9761
|
-
function
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
};
|
|
9779
|
-
return {
|
|
9780
|
-
key: BIRTHDAY_PATH,
|
|
9781
|
-
modelPath: BIRTHDAY_PATH,
|
|
9782
|
-
render: function render(_ref6) {
|
|
9783
|
-
var state = _ref6.state,
|
|
9784
|
-
props = _objectWithoutProperties(_ref6, _excluded$6);
|
|
9785
|
-
return /*#__PURE__*/React__default.createElement(BirthdateField, _extends({
|
|
9786
|
-
key: BIRTHDAY_PATH
|
|
9787
|
-
}, state, props, staticProps));
|
|
9788
|
-
},
|
|
9789
|
-
initialize: function initialize(model) {
|
|
9790
|
-
var modelValue = model.birthdate || defaultValue;
|
|
9791
|
-
var _ref7 = modelValue ? modelValue.split('-') : [],
|
|
9792
|
-
_ref8 = _slicedToArray(_ref7, 3),
|
|
9793
|
-
_ref8$ = _ref8[0],
|
|
9794
|
-
year = _ref8$ === void 0 ? '' : _ref8$,
|
|
9795
|
-
_ref8$2 = _ref8[1],
|
|
9796
|
-
month = _ref8$2 === void 0 ? '' : _ref8$2,
|
|
9797
|
-
_ref8$3 = _ref8[2],
|
|
9798
|
-
day = _ref8$3 === void 0 ? '' : _ref8$3;
|
|
9799
|
-
return {
|
|
9800
|
-
day: {
|
|
9801
|
-
value: day,
|
|
9802
|
-
isDirty: false
|
|
9803
|
-
},
|
|
9804
|
-
month: {
|
|
9805
|
-
value: parseInt(month),
|
|
9806
|
-
isDirty: false
|
|
9807
|
-
},
|
|
9808
|
-
year: {
|
|
9809
|
-
value: year,
|
|
9810
|
-
isDirty: false
|
|
9811
|
-
}
|
|
9812
|
-
};
|
|
9813
|
-
},
|
|
9814
|
-
unbind: function unbind(model, state) {
|
|
9815
|
-
return _objectSpread2(_objectSpread2({}, model), {}, {
|
|
9816
|
-
birthdate: format(state)
|
|
9817
|
-
});
|
|
9818
|
-
},
|
|
9819
|
-
validate: function validate(state, _ref9) {
|
|
9820
|
-
var isSubmitted = _ref9.isSubmitted;
|
|
9821
|
-
var required = staticProps.required;
|
|
9822
|
-
var day = state.day,
|
|
9823
|
-
month = state.month,
|
|
9824
|
-
year = state.year;
|
|
9825
|
-
var missingFields = ['day', 'month', 'year'].filter(function (field) {
|
|
9826
|
-
return (isSubmitted || state[field].isDirty) && !isValued(state[field].value);
|
|
9827
|
-
});
|
|
9828
|
-
if (missingFields.length) {
|
|
9829
|
-
return required || missingFields.length < 3 ? _objectSpread2({
|
|
9830
|
-
error: i18n('validation.required')
|
|
9831
|
-
}, missingFields.reduce(function (acc, field) {
|
|
9832
|
-
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, field, true));
|
|
9833
|
-
}, {})) : {};
|
|
9834
|
-
}
|
|
9835
|
-
if (isSubmitted || day.isDirty || month.isDirty || year.isDirty) {
|
|
9836
|
-
if (!isNumeric(year.value.toString()) || !DateTime.fromObject({
|
|
9837
|
-
year: parseInt(year.value, 10)
|
|
9838
|
-
}).isValid) {
|
|
9839
|
-
return {
|
|
9840
|
-
error: i18n("validation.birthdate.year"),
|
|
9841
|
-
year: true
|
|
9842
|
-
};
|
|
9843
|
-
}
|
|
9844
|
-
var birthdate = format(state);
|
|
9845
|
-
if (!birthdate || !isISO8601(birthdate)) {
|
|
9846
|
-
return {
|
|
9847
|
-
error: i18n('validation.birthdate.dayOfMonth'),
|
|
9848
|
-
day: true
|
|
9849
|
-
};
|
|
9850
|
-
}
|
|
9851
|
-
if (!(isNumeric(month.value.toString()) && isNumeric(day.value.toString())) || !DateTime.fromObject({
|
|
9852
|
-
year: year.value,
|
|
9853
|
-
month: month.value,
|
|
9854
|
-
day: day.value
|
|
9855
|
-
}).isValid) {
|
|
9856
|
-
return {
|
|
9857
|
-
error: i18n("validation.birthdate.dayOfMonth"),
|
|
9858
|
-
day: true
|
|
9859
|
-
};
|
|
9860
|
-
}
|
|
9861
|
-
var limitAge = validateLimitAge(day.value, month.value, year.value);
|
|
9862
|
-
if (limitAge) {
|
|
9863
|
-
return {
|
|
9864
|
-
error: i18n("validation.".concat(limitAge))
|
|
9865
|
-
};
|
|
9866
|
-
}
|
|
9867
|
-
}
|
|
9868
|
-
return {};
|
|
9869
|
-
}
|
|
9870
|
-
};
|
|
9809
|
+
function dateField(props, config) {
|
|
9810
|
+
return createField(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
9811
|
+
format: {
|
|
9812
|
+
bind: function bind(value) {
|
|
9813
|
+
var dt = value ? DateTime.fromISO(value) : DateTime.invalid('empty value');
|
|
9814
|
+
return dt.isValid ? {
|
|
9815
|
+
raw: dt
|
|
9816
|
+
} : undefined;
|
|
9817
|
+
},
|
|
9818
|
+
unbind: function unbind(value) {
|
|
9819
|
+
return value.raw.toISODate();
|
|
9820
|
+
}
|
|
9821
|
+
},
|
|
9822
|
+
validator: props.validator ? datetimeValidator(config.language).and(props.validator) : datetimeValidator(config.language),
|
|
9823
|
+
component: DateField,
|
|
9824
|
+
extendedParams: {
|
|
9825
|
+
locale: config.language
|
|
9871
9826
|
}
|
|
9872
|
-
};
|
|
9827
|
+
}));
|
|
9828
|
+
}
|
|
9829
|
+
|
|
9830
|
+
var _excluded$6 = ["min", "max", "label"];
|
|
9831
|
+
var ageLimitValidator = function ageLimitValidator() {
|
|
9832
|
+
var min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
|
|
9833
|
+
var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 129;
|
|
9834
|
+
return new Validator({
|
|
9835
|
+
rule: function rule(value) {
|
|
9836
|
+
var age = DateTime.now().diff(value.raw, 'years').years;
|
|
9837
|
+
return min < age && age < max;
|
|
9838
|
+
},
|
|
9839
|
+
hint: 'birthdate.yearLimit',
|
|
9840
|
+
parameters: {
|
|
9841
|
+
min: min,
|
|
9842
|
+
max: max
|
|
9843
|
+
}
|
|
9844
|
+
});
|
|
9845
|
+
};
|
|
9846
|
+
function birthdateField(_ref, config) {
|
|
9847
|
+
var min = _ref.min,
|
|
9848
|
+
max = _ref.max,
|
|
9849
|
+
label = _ref.label,
|
|
9850
|
+
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
9851
|
+
return dateField(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
9852
|
+
label: label || 'birthdate',
|
|
9853
|
+
validator: ageLimitValidator(min, max)
|
|
9854
|
+
}), config);
|
|
9873
9855
|
}
|
|
9874
9856
|
|
|
9875
9857
|
var PhoneNumberField = /*#__PURE__*/function (_React$Component) {
|
|
@@ -9885,7 +9867,7 @@ var PhoneNumberField = /*#__PURE__*/function (_React$Component) {
|
|
|
9885
9867
|
_defineProperty(_assertThisInitialized(_this), "asYouType", function (inputValue) {
|
|
9886
9868
|
var country = _this.props.value.country;
|
|
9887
9869
|
var phone = new AsYouType(country).input(inputValue);
|
|
9888
|
-
var formatted = format
|
|
9870
|
+
var formatted = format(phone, country, 'International');
|
|
9889
9871
|
var isValid = isValidNumber(phone, country);
|
|
9890
9872
|
_this.props.onChange({
|
|
9891
9873
|
value: {
|
|
@@ -9906,7 +9888,7 @@ var PhoneNumberField = /*#__PURE__*/function (_React$Component) {
|
|
|
9906
9888
|
country = _this$props$value.country;
|
|
9907
9889
|
try {
|
|
9908
9890
|
var parsed = parse(raw, country);
|
|
9909
|
-
var phoneValue = country === parsed.country ? format
|
|
9891
|
+
var phoneValue = country === parsed.country ? format(parsed, 'National') : raw;
|
|
9910
9892
|
this.asYouType(phoneValue);
|
|
9911
9893
|
} catch (e) {
|
|
9912
9894
|
console.error(e);
|
|
@@ -10490,7 +10472,7 @@ var predefinedFields = {
|
|
|
10490
10472
|
}, cfg));
|
|
10491
10473
|
}
|
|
10492
10474
|
};
|
|
10493
|
-
function customFieldComponent(customField, cfg) {
|
|
10475
|
+
function customFieldComponent(customField, cfg, config) {
|
|
10494
10476
|
var baseConfig = _objectSpread2(_objectSpread2({
|
|
10495
10477
|
label: customField.name
|
|
10496
10478
|
}, cfg), {}, {
|
|
@@ -10502,7 +10484,7 @@ function customFieldComponent(customField, cfg) {
|
|
|
10502
10484
|
}) : _objectSpread2({}, baseConfig);
|
|
10503
10485
|
return checkboxField(checkboxConfig);
|
|
10504
10486
|
} else if (customField.dataType === 'date') {
|
|
10505
|
-
return dateField(baseConfig);
|
|
10487
|
+
return dateField(baseConfig, config);
|
|
10506
10488
|
} else if (customField.dataType === 'integer') {
|
|
10507
10489
|
return simpleField(_objectSpread2(_objectSpread2({}, baseConfig), {}, {
|
|
10508
10490
|
type: 'number',
|
|
@@ -10597,7 +10579,7 @@ var resolveField = function resolveField(fieldConfig, config) {
|
|
|
10597
10579
|
}
|
|
10598
10580
|
var customField = findCustomField(config, camelPath);
|
|
10599
10581
|
if (customField) {
|
|
10600
|
-
return customFieldComponent(customField, fieldConfig);
|
|
10582
|
+
return customFieldComponent(customField, fieldConfig, config);
|
|
10601
10583
|
}
|
|
10602
10584
|
var camelPathSplit = camelPath.split('.v'); // TODO What if consent start with a `v`?
|
|
10603
10585
|
var consentField = findConsentField(config, camelPathSplit[0]);
|
|
@@ -11218,12 +11200,10 @@ var VerificationCodeView = /*#__PURE__*/function (_React$Component3) {
|
|
|
11218
11200
|
var _this5$props = _this5.props,
|
|
11219
11201
|
apiClient = _this5$props.apiClient,
|
|
11220
11202
|
auth = _this5$props.auth,
|
|
11221
|
-
challengeId = _this5$props.challengeId
|
|
11222
|
-
accessToken = _this5$props.accessToken;
|
|
11203
|
+
challengeId = _this5$props.challengeId;
|
|
11223
11204
|
return apiClient.verifyMfaPasswordless({
|
|
11224
11205
|
challengeId: challengeId,
|
|
11225
|
-
verificationCode: data.verificationCode
|
|
11226
|
-
accessToken: accessToken
|
|
11206
|
+
verificationCode: data.verificationCode
|
|
11227
11207
|
}).then(function (resp) {
|
|
11228
11208
|
return window.location.replace(auth.redirectUri + "?" + toQueryString(resp));
|
|
11229
11209
|
});
|
|
@@ -12526,7 +12506,7 @@ var Credential = withTheme(styled(Card)(_templateObject3$6 || (_templateObject3$
|
|
|
12526
12506
|
var CardContent = withTheme(styled.div(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteral(["\n margin-left: ", "px;\n white-space: initial;\n"])), function (props) {
|
|
12527
12507
|
return props.theme.get('_blockInnerHeight');
|
|
12528
12508
|
}));
|
|
12529
|
-
var dateFormat = function dateFormat(dateString, locales) {
|
|
12509
|
+
var dateFormat$1 = function dateFormat(dateString, locales) {
|
|
12530
12510
|
return new Date(dateString).toLocaleDateString(locales, {
|
|
12531
12511
|
timeZone: 'UTC'
|
|
12532
12512
|
});
|
|
@@ -12549,7 +12529,7 @@ var MfaList = compose(withI18n, withConfig)(function (_ref) {
|
|
|
12549
12529
|
}
|
|
12550
12530
|
}, friendlyName), /*#__PURE__*/React__default.createElement("div", null, email || phoneNumber), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("span", null, i18n('mfaList.createdAt'), "\xA0: "), /*#__PURE__*/React__default.createElement("time", {
|
|
12551
12531
|
dateTime: createdAt
|
|
12552
|
-
}, dateFormat(createdAt, config.language)))));
|
|
12532
|
+
}, dateFormat$1(createdAt, config.language)))));
|
|
12553
12533
|
}));
|
|
12554
12534
|
});
|
|
12555
12535
|
var mfaListWidget = createWidget({
|