@tsed/react-formio 1.11.1 → 1.13.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/.env +2 -1
- package/craco.config.js +11 -1
- package/dist/components/alert/alert.component.spec.d.ts +1 -0
- package/dist/components/alert/alert.stories.d.ts +15 -0
- package/dist/components/card/card.component.d.ts +2 -1
- package/dist/components/form/form.component.d.ts +2 -0
- package/dist/components/form/form.stories.d.ts +37 -0
- package/dist/components/form/useForm.hook.d.ts +1 -0
- package/dist/components/form-action/formAction.stories.d.ts +90 -414
- package/dist/components/input-text/inputText.component.d.ts +1 -1
- package/dist/components/input-text/inputText.component.spec.d.ts +1 -0
- package/dist/components/loader/loader.component.d.ts +2 -2
- package/dist/components/loader/loader.stories.d.ts +15 -0
- package/dist/components/pagination/pagination.component.spec.d.ts +1 -0
- package/dist/components/pagination/pagination.stories.d.ts +0 -27
- package/dist/components/select/select.component.spec.d.ts +1 -0
- package/dist/components/tabs/tabs.component.spec.d.ts +1 -0
- package/dist/index.js +114 -35
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +86 -34
- package/dist/index.modern.js.map +1 -1
- package/jest.config.js +1 -1
- package/package.json +5 -9
- package/readme.md +114 -86
- package/src/components/__fixtures__/form-schema.json +10 -42
- package/src/components/__fixtures__/form.fixture.json +1 -1
- package/src/components/actions-table/actionsTable.component.spec.tsx +4 -13
- package/src/components/actions-table/actionsTable.component.tsx +3 -11
- package/src/components/alert/alert.component.spec.tsx +97 -0
- package/src/components/alert/alert.component.tsx +2 -8
- package/src/components/alert/alert.stories.tsx +17 -0
- package/src/components/card/card.component.tsx +2 -5
- package/src/components/form/form.component.tsx +4 -8
- package/src/components/form/form.stories.tsx +66 -2
- package/src/components/form/useForm.hook.ts +29 -14
- package/src/components/form-access/formAccess.component.tsx +19 -82
- package/src/components/form-access/formAccess.schema.ts +7 -23
- package/src/components/form-access/formAccess.stories.tsx +2 -9
- package/src/components/form-access/formAccess.utils.spec.ts +4 -22
- package/src/components/form-access/formAccess.utils.ts +7 -29
- package/src/components/form-action/formAction.component.tsx +3 -19
- package/src/components/form-action/formAction.stories.tsx +251 -672
- package/src/components/form-builder/formBuilder.component.tsx +4 -13
- package/src/components/form-builder/formBuilder.stories.tsx +12 -24
- package/src/components/form-control/formControl.component.tsx +2 -8
- package/src/components/form-edit/formCtas.component.tsx +5 -23
- package/src/components/form-edit/formEdit.component.tsx +2 -20
- package/src/components/form-edit/formEdit.reducer.ts +2 -8
- package/src/components/form-edit/formEdit.stories.tsx +3 -15
- package/src/components/form-edit/formParameters.component.tsx +3 -20
- package/src/components/form-edit/useFormEdit.hook.ts +2 -9
- package/src/components/form-settings/formSettings.component.spec.tsx +2 -9
- package/src/components/form-settings/formSettings.component.tsx +6 -34
- package/src/components/form-settings/formSettings.stories.tsx +1 -6
- package/src/components/form-settings/formSettings.utils.spec.ts +1 -4
- package/src/components/form-settings/formSettings.utils.ts +2 -7
- package/src/components/forms-table/components/formCell.component.tsx +2 -6
- package/src/components/forms-table/formsTable.component.tsx +2 -7
- package/src/components/input-tags/inputTags.component.tsx +10 -34
- package/src/components/input-tags/inputTags.stories.tsx +4 -14
- package/src/components/input-text/inputText.component.spec.tsx +56 -0
- package/src/components/input-text/inputText.component.tsx +4 -5
- package/src/components/input-text/inputText.stories.tsx +6 -26
- package/src/components/loader/loader.component.spec.tsx +7 -6
- package/src/components/loader/loader.component.tsx +3 -12
- package/src/components/loader/loader.stories.tsx +17 -0
- package/src/components/modal/modal.component.spec.tsx +8 -14
- package/src/components/modal/modal.component.tsx +6 -27
- package/src/components/modal/modal.stories.tsx +1 -5
- package/src/components/modal/removeModal.component.tsx +4 -22
- package/src/components/pagination/pagination.component.spec.tsx +111 -0
- package/src/components/pagination/pagination.component.tsx +10 -42
- package/src/components/pagination/pagination.stories.tsx +9 -29
- package/src/components/react-component/reactComponent.component.tsx +3 -11
- package/src/components/select/select.component.spec.tsx +86 -0
- package/src/components/select/select.component.tsx +11 -15
- package/src/components/select/select.stories.tsx +6 -26
- package/src/components/submissions-table/submissionsTable.component.tsx +1 -3
- package/src/components/submissions-table/submissionsTable.stories.tsx +1 -1
- package/src/components/table/components/defaultArrowSort.component.tsx +1 -10
- package/src/components/table/components/defaultCell.component.tsx +1 -4
- package/src/components/table/components/defaultCellHeader.component.tsx +4 -14
- package/src/components/table/components/defaultCellOperations.component.tsx +14 -25
- package/src/components/table/components/defaultOperationButton.component.tsx +2 -10
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +1 -1
- package/src/components/table/filters/selectColumnFilter.component.spec.tsx +2 -10
- package/src/components/table/filters/selectColumnFilter.component.tsx +2 -6
- package/src/components/table/table.component.tsx +13 -53
- package/src/components/table/table.stories.tsx +1 -1
- package/src/components/table/utils/getPageNumbers.ts +3 -11
- package/src/components/table/utils/mapFormToColumns.tsx +14 -22
- package/src/components/table/utils/useOperations.hook.tsx +2 -12
- package/src/components/tabs/tabs.component.spec.tsx +86 -0
- package/src/components/tabs/tabs.component.stories.tsx +2 -9
- package/src/components/tabs/tabs.component.tsx +9 -43
- package/src/interfaces/Operation.ts +1 -4
- package/src/react-table.d.ts +9 -28
- package/src/stores/action/action.actions.ts +31 -33
- package/src/stores/action/action.reducers.spec.ts +1 -8
- package/src/stores/action/action.reducers.ts +1 -8
- package/src/stores/action/action.selectors.ts +1 -2
- package/src/stores/action-info/action-info.actions.spec.ts +1 -5
- package/src/stores/action-info/action-info.actions.ts +16 -19
- package/src/stores/action-info/action-info.reducers.spec.ts +1 -6
- package/src/stores/action-info/action-info.reducers.ts +1 -6
- package/src/stores/action-info/action-info.selectors.ts +1 -4
- package/src/stores/actions/actions.actions.spec.ts +1 -6
- package/src/stores/actions/actions.actions.ts +16 -19
- package/src/stores/actions/actions.reducers.spec.ts +1 -6
- package/src/stores/actions/actions.reducers.ts +1 -6
- package/src/stores/actions/actions.selectors.ts +2 -4
- package/src/stores/auth/auth.reducers.ts +1 -4
- package/src/stores/auth/auth.selectors.spec.ts +1 -5
- package/src/stores/auth/auth.selectors.ts +3 -6
- package/src/stores/auth/auth.utils.tsx +2 -8
- package/src/stores/auth/getAccess.action.spec.ts +11 -54
- package/src/stores/auth/getAccess.action.ts +1 -6
- package/src/stores/auth/initAuth.action.ts +15 -17
- package/src/stores/form/form.actions.spec.ts +8 -39
- package/src/stores/form/form.actions.ts +55 -64
- package/src/stores/form/form.reducers.spec.ts +1 -7
- package/src/stores/form/form.reducers.ts +1 -8
- package/src/stores/form/form.selectors.ts +1 -2
- package/src/stores/forms/forms.actions.spec.ts +5 -18
- package/src/stores/forms/forms.actions.ts +17 -21
- package/src/stores/forms/forms.reducers.spec.ts +1 -6
- package/src/stores/forms/forms.reducers.ts +2 -13
- package/src/stores/forms/forms.selectors.ts +2 -4
- package/src/stores/index.spec.ts +6 -9
- package/src/stores/root/root.selectors.spec.ts +1 -6
- package/src/stores/root/root.selectors.ts +6 -24
- package/src/stores/submission/submission.actions.spec.ts +11 -33
- package/src/stores/submission/submission.actions.ts +57 -66
- package/src/stores/submission/submission.reducers.spec.ts +17 -27
- package/src/stores/submission/submission.reducers.ts +1 -4
- package/src/stores/submission/submission.selectors.ts +1 -4
- package/src/stores/submissions/submissions.actions.spec.ts +5 -18
- package/src/stores/submissions/submissions.actions.ts +17 -26
- package/src/stores/submissions/submissions.reducers.spec.ts +3 -12
- package/src/stores/submissions/submissions.reducers.ts +3 -17
- package/src/stores/submissions/submissions.selectors.spec.ts +1 -4
- package/src/stores/submissions/submissions.selectors.ts +2 -4
- package/src/utils/getEventValue.ts +1 -4
- package/src/utils/iconClass.ts +2 -10
- package/src/utils/mapPagination.ts +1 -6
- package/src/utils/mapRequestParams.ts +2 -12
- package/src/utils/url.test.ts +4 -12
- package/src/utils/url.ts +2 -7
- package/tsconfig.json +4 -12
- package/tsconfig.test.json +1 -1
- package/.eslintrc +0 -47
- package/.prettierrc +0 -10
package/dist/index.modern.js
CHANGED
|
@@ -1227,7 +1227,7 @@ function Select(_ref) {
|
|
|
1227
1227
|
onChange,
|
|
1228
1228
|
required,
|
|
1229
1229
|
value,
|
|
1230
|
-
choices
|
|
1230
|
+
choices,
|
|
1231
1231
|
description,
|
|
1232
1232
|
placeholder,
|
|
1233
1233
|
prefix,
|
|
@@ -1357,6 +1357,7 @@ function PaginationButton(props) {
|
|
|
1357
1357
|
otherProps = _objectWithoutPropertiesLoose(props, ["component", "children", "disabled", "active"]);
|
|
1358
1358
|
|
|
1359
1359
|
return React.createElement(Component, Object.assign({}, otherProps, {
|
|
1360
|
+
"data-testid": 'pagination-button',
|
|
1360
1361
|
disabled: disabled,
|
|
1361
1362
|
className: classnames("page-link", disabled ? "disabled" : "", active ? "" : "", props.className)
|
|
1362
1363
|
}), children);
|
|
@@ -1372,7 +1373,7 @@ function Pagination(props) {
|
|
|
1372
1373
|
nextPage,
|
|
1373
1374
|
canNextPage,
|
|
1374
1375
|
pageCount,
|
|
1375
|
-
pageIndex,
|
|
1376
|
+
pageIndex = 1,
|
|
1376
1377
|
pageOptions,
|
|
1377
1378
|
pageSize,
|
|
1378
1379
|
setPageSize,
|
|
@@ -1489,9 +1490,10 @@ function InputText(_ref) {
|
|
|
1489
1490
|
prefix,
|
|
1490
1491
|
suffix,
|
|
1491
1492
|
description,
|
|
1492
|
-
className
|
|
1493
|
+
className,
|
|
1494
|
+
placeholder
|
|
1493
1495
|
} = _ref,
|
|
1494
|
-
props = _objectWithoutPropertiesLoose(_ref, ["name", "value", "label", "onChange", "required", "size", "type", "prefix", "suffix", "description", "className"]);
|
|
1496
|
+
props = _objectWithoutPropertiesLoose(_ref, ["name", "value", "label", "onChange", "required", "size", "type", "prefix", "suffix", "description", "className", "placeholder"]);
|
|
1495
1497
|
|
|
1496
1498
|
const [localValue, setValue] = useState(value);
|
|
1497
1499
|
const change = useMemo(() => callLast(onChange, 300), [onChange]);
|
|
@@ -1513,7 +1515,8 @@ function InputText(_ref) {
|
|
|
1513
1515
|
className: classnames("form-control", size && `form-control-${size}`),
|
|
1514
1516
|
id: name,
|
|
1515
1517
|
required: required,
|
|
1516
|
-
value: localValue || "",
|
|
1518
|
+
value: localValue || placeholder || "",
|
|
1519
|
+
placeholder: placeholder,
|
|
1517
1520
|
onChange: event => {
|
|
1518
1521
|
const value = getEventValue(event);
|
|
1519
1522
|
setValue(value);
|
|
@@ -1600,7 +1603,7 @@ function DefaultCellOperations({
|
|
|
1600
1603
|
className: 'btn-group'
|
|
1601
1604
|
}, operations.filter(({
|
|
1602
1605
|
permissionsResolver
|
|
1603
|
-
}) => !permissionsResolver || permissionsResolver(data, ctx)).map(
|
|
1606
|
+
}) => !permissionsResolver || permissionsResolver(data, ctx)).map(_ref => {
|
|
1604
1607
|
let {
|
|
1605
1608
|
OperationButton = DefaultOperationButton
|
|
1606
1609
|
} = _ref,
|
|
@@ -1925,12 +1928,29 @@ function useForm(props) {
|
|
|
1925
1928
|
const instance = useRef();
|
|
1926
1929
|
const events = useRef(new Map());
|
|
1927
1930
|
|
|
1931
|
+
async function customValidation(submission, callback) {
|
|
1932
|
+
if (events.current.has("onAsyncSubmit")) {
|
|
1933
|
+
try {
|
|
1934
|
+
await events.current.get("onAsyncSubmit")(submission);
|
|
1935
|
+
} catch (err) {
|
|
1936
|
+
callback((err == null ? void 0 : err.errors) || err);
|
|
1937
|
+
}
|
|
1938
|
+
} else {
|
|
1939
|
+
callback(null);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1928
1943
|
const createWebForm = (srcOrForm, options) => {
|
|
1929
1944
|
options = Object.assign({}, options);
|
|
1930
1945
|
srcOrForm = typeof srcOrForm === "string" ? srcOrForm : cloneDeep(srcOrForm);
|
|
1931
1946
|
|
|
1932
1947
|
if (!instance.current) {
|
|
1948
|
+
var _options, _options$hooks;
|
|
1949
|
+
|
|
1933
1950
|
isLoaded.current = false;
|
|
1951
|
+
options.hooks = _extends({}, options.hooks || {}, {
|
|
1952
|
+
customValidation: ((_options = options) == null ? void 0 : (_options$hooks = _options.hooks) == null ? void 0 : _options$hooks.customValidation) || customValidation
|
|
1953
|
+
});
|
|
1934
1954
|
instance.current = new Form$1(element.current, srcOrForm, options);
|
|
1935
1955
|
instance.current.onAny((event, ...args) => {
|
|
1936
1956
|
if (!instance.current) {
|
|
@@ -1953,7 +1973,8 @@ function useForm(props) {
|
|
|
1953
1973
|
events.current.set(funcName, fn);
|
|
1954
1974
|
}
|
|
1955
1975
|
|
|
1956
|
-
|
|
1976
|
+
instance.current.instance.setAlert("success", "");
|
|
1977
|
+
events.current.get(funcName)(...args, instance.current);
|
|
1957
1978
|
}
|
|
1958
1979
|
}
|
|
1959
1980
|
});
|
|
@@ -2012,6 +2033,9 @@ function useForm(props) {
|
|
|
2012
2033
|
useEffect(() => {
|
|
2013
2034
|
props.onSubmit && events.current.set("onSubmit", props.onSubmit);
|
|
2014
2035
|
}, [props.onSubmit, events]);
|
|
2036
|
+
useEffect(() => {
|
|
2037
|
+
props.onAsyncSubmit && events.current.set("onAsyncSubmit", props.onAsyncSubmit);
|
|
2038
|
+
}, [props.onAsyncSubmit, events]);
|
|
2015
2039
|
useEffect(() => {
|
|
2016
2040
|
props.onSubmitDone && events.current.set("onSubmitDone", props.onSubmitDone);
|
|
2017
2041
|
}, [props.onSubmitDone, events]);
|
|
@@ -2063,7 +2087,8 @@ Form.propTypes = {
|
|
|
2063
2087
|
noAlerts: PropTypes.bool,
|
|
2064
2088
|
i18n: PropTypes.any,
|
|
2065
2089
|
template: PropTypes.string,
|
|
2066
|
-
saveDraft: PropTypes.bool
|
|
2090
|
+
saveDraft: PropTypes.bool,
|
|
2091
|
+
hooks: PropTypes.any
|
|
2067
2092
|
}),
|
|
2068
2093
|
onPrevPage: PropTypes.func,
|
|
2069
2094
|
onNextPage: PropTypes.func,
|
|
@@ -2072,6 +2097,7 @@ Form.propTypes = {
|
|
|
2072
2097
|
onCustomEvent: PropTypes.func,
|
|
2073
2098
|
onComponentChange: PropTypes.func,
|
|
2074
2099
|
onSubmit: PropTypes.func,
|
|
2100
|
+
onAsyncSubmit: PropTypes.func,
|
|
2075
2101
|
onSubmitDone: PropTypes.func,
|
|
2076
2102
|
onFormLoad: PropTypes.func,
|
|
2077
2103
|
onError: PropTypes.func,
|
|
@@ -2563,7 +2589,8 @@ class FormBuilder extends React.Component {
|
|
|
2563
2589
|
var _this$builderRef;
|
|
2564
2590
|
|
|
2565
2591
|
(_this$builderRef = this.builderRef) == null ? void 0 : _this$builderRef.destroy();
|
|
2566
|
-
}
|
|
2592
|
+
} // eslint-disable-next-line react/no-deprecated
|
|
2593
|
+
|
|
2567
2594
|
|
|
2568
2595
|
async componentWillReceiveProps(nextProps) {
|
|
2569
2596
|
if (this.builderRef) {
|
|
@@ -3302,9 +3329,10 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
3302
3329
|
|
|
3303
3330
|
function map(arr, fn) {
|
|
3304
3331
|
var res = [],
|
|
3305
|
-
i
|
|
3332
|
+
i,
|
|
3333
|
+
arrLen = arr.length;
|
|
3306
3334
|
|
|
3307
|
-
for (i = 0; i <
|
|
3335
|
+
for (i = 0; i < arrLen; ++i) {
|
|
3308
3336
|
res.push(fn(arr[i], i));
|
|
3309
3337
|
}
|
|
3310
3338
|
|
|
@@ -3423,7 +3451,10 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
3423
3451
|
updateInProgress = false;
|
|
3424
3452
|
|
|
3425
3453
|
function copyConfig(to, from) {
|
|
3426
|
-
var i,
|
|
3454
|
+
var i,
|
|
3455
|
+
prop,
|
|
3456
|
+
val,
|
|
3457
|
+
momentPropertiesLen = momentProperties.length;
|
|
3427
3458
|
|
|
3428
3459
|
if (!isUndefined(from._isAMomentObject)) {
|
|
3429
3460
|
to._isAMomentObject = from._isAMomentObject;
|
|
@@ -3465,8 +3496,8 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
3465
3496
|
to._locale = from._locale;
|
|
3466
3497
|
}
|
|
3467
3498
|
|
|
3468
|
-
if (
|
|
3469
|
-
for (i = 0; i <
|
|
3499
|
+
if (momentPropertiesLen > 0) {
|
|
3500
|
+
for (i = 0; i < momentPropertiesLen; i++) {
|
|
3470
3501
|
prop = momentProperties[i];
|
|
3471
3502
|
val = from[prop];
|
|
3472
3503
|
|
|
@@ -3518,9 +3549,10 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
3518
3549
|
var args = [],
|
|
3519
3550
|
arg,
|
|
3520
3551
|
i,
|
|
3521
|
-
key
|
|
3552
|
+
key,
|
|
3553
|
+
argLen = arguments.length;
|
|
3522
3554
|
|
|
3523
|
-
for (i = 0; i <
|
|
3555
|
+
for (i = 0; i < argLen; i++) {
|
|
3524
3556
|
arg = '';
|
|
3525
3557
|
|
|
3526
3558
|
if (typeof arguments[i] === 'object') {
|
|
@@ -3950,9 +3982,10 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
3950
3982
|
if (typeof units === 'object') {
|
|
3951
3983
|
units = normalizeObjectUnits(units);
|
|
3952
3984
|
var prioritized = getPrioritizedUnits(units),
|
|
3953
|
-
i
|
|
3985
|
+
i,
|
|
3986
|
+
prioritizedLen = prioritized.length;
|
|
3954
3987
|
|
|
3955
|
-
for (i = 0; i <
|
|
3988
|
+
for (i = 0; i < prioritizedLen; i++) {
|
|
3956
3989
|
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
3957
3990
|
}
|
|
3958
3991
|
} else {
|
|
@@ -4033,7 +4066,8 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
4033
4066
|
|
|
4034
4067
|
function addParseToken(token, callback) {
|
|
4035
4068
|
var i,
|
|
4036
|
-
func = callback
|
|
4069
|
+
func = callback,
|
|
4070
|
+
tokenLen;
|
|
4037
4071
|
|
|
4038
4072
|
if (typeof token === 'string') {
|
|
4039
4073
|
token = [token];
|
|
@@ -4045,7 +4079,9 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
4045
4079
|
};
|
|
4046
4080
|
}
|
|
4047
4081
|
|
|
4048
|
-
|
|
4082
|
+
tokenLen = token.length;
|
|
4083
|
+
|
|
4084
|
+
for (i = 0; i < tokenLen; i++) {
|
|
4049
4085
|
tokens[token[i]] = func;
|
|
4050
4086
|
}
|
|
4051
4087
|
}
|
|
@@ -5131,11 +5167,16 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
5131
5167
|
return globalLocale;
|
|
5132
5168
|
}
|
|
5133
5169
|
|
|
5170
|
+
function isLocaleNameSane(name) {
|
|
5171
|
+
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
|
5172
|
+
return name.match('^[^/\\\\]*$') != null;
|
|
5173
|
+
}
|
|
5174
|
+
|
|
5134
5175
|
function loadLocale(name) {
|
|
5135
5176
|
var oldLocale = null,
|
|
5136
5177
|
aliasedRequire; // TODO: Find a better way to register and load all the locales in Node
|
|
5137
5178
|
|
|
5138
|
-
if (locales[name] === undefined && 'object' !== 'undefined' && module && module.exports) {
|
|
5179
|
+
if (locales[name] === undefined && 'object' !== 'undefined' && module && module.exports && isLocaleNameSane(name)) {
|
|
5139
5180
|
try {
|
|
5140
5181
|
oldLocale = globalLocale._abbr;
|
|
5141
5182
|
aliasedRequire = commonjsRequire;
|
|
@@ -5367,12 +5408,14 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
5367
5408
|
allowTime,
|
|
5368
5409
|
dateFormat,
|
|
5369
5410
|
timeFormat,
|
|
5370
|
-
tzFormat
|
|
5411
|
+
tzFormat,
|
|
5412
|
+
isoDatesLen = isoDates.length,
|
|
5413
|
+
isoTimesLen = isoTimes.length;
|
|
5371
5414
|
|
|
5372
5415
|
if (match) {
|
|
5373
5416
|
getParsingFlags(config).iso = true;
|
|
5374
5417
|
|
|
5375
|
-
for (i = 0, l =
|
|
5418
|
+
for (i = 0, l = isoDatesLen; i < l; i++) {
|
|
5376
5419
|
if (isoDates[i][1].exec(match[1])) {
|
|
5377
5420
|
dateFormat = isoDates[i][0];
|
|
5378
5421
|
allowTime = isoDates[i][2] !== false;
|
|
@@ -5386,7 +5429,7 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
5386
5429
|
}
|
|
5387
5430
|
|
|
5388
5431
|
if (match[3]) {
|
|
5389
|
-
for (i = 0, l =
|
|
5432
|
+
for (i = 0, l = isoTimesLen; i < l; i++) {
|
|
5390
5433
|
if (isoTimes[i][1].exec(match[3])) {
|
|
5391
5434
|
// match[2] should be 'T' or space
|
|
5392
5435
|
timeFormat = (match[2] || ' ') + isoTimes[i][0];
|
|
@@ -5722,10 +5765,12 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
5722
5765
|
skipped,
|
|
5723
5766
|
stringLength = string.length,
|
|
5724
5767
|
totalParsedInputLength = 0,
|
|
5725
|
-
era
|
|
5768
|
+
era,
|
|
5769
|
+
tokenLen;
|
|
5726
5770
|
tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
|
5771
|
+
tokenLen = tokens.length;
|
|
5727
5772
|
|
|
5728
|
-
for (i = 0; i <
|
|
5773
|
+
for (i = 0; i < tokenLen; i++) {
|
|
5729
5774
|
token = tokens[i];
|
|
5730
5775
|
parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
|
|
5731
5776
|
|
|
@@ -5818,15 +5863,16 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
5818
5863
|
i,
|
|
5819
5864
|
currentScore,
|
|
5820
5865
|
validFormatFound,
|
|
5821
|
-
bestFormatIsValid = false
|
|
5866
|
+
bestFormatIsValid = false,
|
|
5867
|
+
configfLen = config._f.length;
|
|
5822
5868
|
|
|
5823
|
-
if (
|
|
5869
|
+
if (configfLen === 0) {
|
|
5824
5870
|
getParsingFlags(config).invalidFormat = true;
|
|
5825
5871
|
config._d = new Date(NaN);
|
|
5826
5872
|
return;
|
|
5827
5873
|
}
|
|
5828
5874
|
|
|
5829
|
-
for (i = 0; i <
|
|
5875
|
+
for (i = 0; i < configfLen; i++) {
|
|
5830
5876
|
currentScore = 0;
|
|
5831
5877
|
validFormatFound = false;
|
|
5832
5878
|
tempConfig = copyConfig({}, config);
|
|
@@ -6048,7 +6094,8 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
6048
6094
|
function isDurationValid(m) {
|
|
6049
6095
|
var key,
|
|
6050
6096
|
unitHasDecimal = false,
|
|
6051
|
-
i
|
|
6097
|
+
i,
|
|
6098
|
+
orderLen = ordering.length;
|
|
6052
6099
|
|
|
6053
6100
|
for (key in m) {
|
|
6054
6101
|
if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
|
|
@@ -6056,7 +6103,7 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
6056
6103
|
}
|
|
6057
6104
|
}
|
|
6058
6105
|
|
|
6059
|
-
for (i = 0; i <
|
|
6106
|
+
for (i = 0; i < orderLen; ++i) {
|
|
6060
6107
|
if (m[ordering[i]]) {
|
|
6061
6108
|
if (unitHasDecimal) {
|
|
6062
6109
|
return false; // only allow non-integers for smallest unit
|
|
@@ -6544,9 +6591,10 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
6544
6591
|
propertyTest = false,
|
|
6545
6592
|
properties = ['years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms'],
|
|
6546
6593
|
i,
|
|
6547
|
-
property
|
|
6594
|
+
property,
|
|
6595
|
+
propertyLen = properties.length;
|
|
6548
6596
|
|
|
6549
|
-
for (i = 0; i <
|
|
6597
|
+
for (i = 0; i < propertyLen; i += 1) {
|
|
6550
6598
|
property = properties[i];
|
|
6551
6599
|
propertyTest = propertyTest || hasOwnProp(input, property);
|
|
6552
6600
|
}
|
|
@@ -8288,7 +8336,7 @@ var moment = createCommonjsModule(function (module, exports) {
|
|
|
8288
8336
|
config._d = new Date(toInt(input));
|
|
8289
8337
|
}); //! moment.js
|
|
8290
8338
|
|
|
8291
|
-
hooks.version = '2.29.
|
|
8339
|
+
hooks.version = '2.29.3';
|
|
8292
8340
|
setHookCallback(createLocal);
|
|
8293
8341
|
hooks.fn = proto;
|
|
8294
8342
|
hooks.min = min;
|
|
@@ -8855,8 +8903,10 @@ function ButtonTab({
|
|
|
8855
8903
|
after
|
|
8856
8904
|
}) {
|
|
8857
8905
|
return React.createElement("div", {
|
|
8906
|
+
title: 'button-wrapper',
|
|
8858
8907
|
className: classnames("tw-tabs__button-wrapper", isActive ? "-active" : "", back ? "-back" : "", className)
|
|
8859
8908
|
}, React.createElement("button", {
|
|
8909
|
+
title: 'button-tab',
|
|
8860
8910
|
className: classnames("tw-tabs__button", reverse ? "-reverse" : "", isActive ? "-active" : "", back ? "-back" : ""),
|
|
8861
8911
|
onClick: onClick
|
|
8862
8912
|
}, icon && React.createElement("i", {
|
|
@@ -8883,6 +8933,7 @@ function Tabs(_ref) {
|
|
|
8883
8933
|
additionalProps = _objectWithoutPropertiesLoose(_ref, ["style", "current", "items", "children", "HeaderChildren", "AddButton", "Button", "className", "onClick", "i18n"]);
|
|
8884
8934
|
|
|
8885
8935
|
return React.createElement("div", {
|
|
8936
|
+
"data-testid": 'tabs-comp',
|
|
8886
8937
|
className: `tw-tabs ${className}`,
|
|
8887
8938
|
style: style
|
|
8888
8939
|
}, React.createElement("div", null, React.createElement("nav", {
|
|
@@ -8906,6 +8957,7 @@ function Tabs(_ref) {
|
|
|
8906
8957
|
})))), HeaderChildren && React.createElement(HeaderChildren, Object.assign({}, additionalProps, {
|
|
8907
8958
|
current: current
|
|
8908
8959
|
}))), React.createElement("div", {
|
|
8960
|
+
title: "tab-body",
|
|
8909
8961
|
className: "tw-tabs__body"
|
|
8910
8962
|
}, children));
|
|
8911
8963
|
}
|