@adiba-banking-cloud/backoffice 0.0.70 → 0.0.71
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/build/index.cjs.js/index.js +1259 -50
- package/build/index.esm.js/index.js +1261 -54
- package/build/typings/components/forms/simple/Simple.stories.d.ts +2 -0
- package/build/typings/components/forms/simple/Simple.types.d.ts +5 -1
- package/build/typings/components/index.d.ts +1 -0
- package/build/typings/components/panels/tile/Tile.d.ts +4 -0
- package/build/typings/components/panels/tile/Tile.stories.d.ts +7 -0
- package/build/typings/components/panels/tile/Tile.types.d.ts +7 -0
- package/build/typings/components/theme.d.ts +1 -1
- package/package.json +2 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import { modals } from '@mantine/modals';
|
|
4
|
-
import React, { useRef, useMemo, useEffect } from 'react';
|
|
5
|
-
import { Center, Image, Space, Popover, Button, Stack, Divider, Group, Text, Menu, Avatar, Badge, NavLink, Card, TextInput, ActionIcon, Box, Title,
|
|
4
|
+
import React, { useRef, useMemo, useEffect, useLayoutEffect, useState, useCallback } from 'react';
|
|
5
|
+
import { Center, Image, Space, Popover, Button, Stack, Divider, Group, Text, Menu, Avatar, Badge, NavLink, Card, TextInput, ActionIcon, Box, Title, SegmentedControl, Breadcrumbs, Anchor, ColorSwatch, AspectRatio, Overlay, rem, SimpleGrid, Indicator, Table, createTheme, PinInput, Drawer as Drawer$1, ScrollArea, Grid, NumberInput, PasswordInput, Textarea } from '@mantine/core';
|
|
6
6
|
import { DotLottieReact } from '@lottiefiles/dotlottie-react';
|
|
7
7
|
import _extends from '@babel/runtime/helpers/extends';
|
|
8
8
|
import HighchartsReact from 'highcharts-react-official';
|
|
9
9
|
import HighchartsRounded from 'highcharts-rounded-corners';
|
|
10
10
|
import * as IconSax from 'iconsax-react';
|
|
11
11
|
import { Link } from 'react-router-dom';
|
|
12
|
-
import { useDisclosure } from '@mantine/hooks';
|
|
12
|
+
import { useDisclosure, useToggle } from '@mantine/hooks';
|
|
13
13
|
import '@fontsource/poppins/100.css';
|
|
14
14
|
import '@fontsource/poppins/200.css';
|
|
15
15
|
import '@fontsource/poppins/300.css';
|
|
@@ -11321,8 +11321,8 @@ const createAreaFillGradient = function (baseColor) {
|
|
|
11321
11321
|
};
|
|
11322
11322
|
};
|
|
11323
11323
|
|
|
11324
|
-
function ownKeys$
|
|
11325
|
-
function _objectSpread$
|
|
11324
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11325
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11326
11326
|
|
|
11327
11327
|
// Initialize Highcharts with rounded corners
|
|
11328
11328
|
if (typeof window !== "undefined") {
|
|
@@ -11331,8 +11331,8 @@ if (typeof window !== "undefined") {
|
|
|
11331
11331
|
const Column = props => {
|
|
11332
11332
|
const chartRef = useRef(null);
|
|
11333
11333
|
const chartOptions = useMemo(() => {
|
|
11334
|
-
const column = _objectSpread$
|
|
11335
|
-
return _objectSpread$
|
|
11334
|
+
const column = _objectSpread$5({}, props);
|
|
11335
|
+
return _objectSpread$5(_objectSpread$5({}, initChart$2(column)), initSeries$2(column));
|
|
11336
11336
|
}, [props]);
|
|
11337
11337
|
useEffect(() => {
|
|
11338
11338
|
if (chartRef.current && chartRef.current.chart) {
|
|
@@ -11435,7 +11435,7 @@ const initSeries$2 = props => {
|
|
|
11435
11435
|
enableMouseTracking: false,
|
|
11436
11436
|
showInLegend: false
|
|
11437
11437
|
});
|
|
11438
|
-
const mainSeries = _objectSpread$
|
|
11438
|
+
const mainSeries = _objectSpread$5(_objectSpread$5({}, fillSeries(boundary)), {
|
|
11439
11439
|
name: props.yAxisLabel[0],
|
|
11440
11440
|
color: seriesColors ? seriesColors[0] : "gray",
|
|
11441
11441
|
data: seriesData[0],
|
|
@@ -11475,7 +11475,7 @@ const initSeries$2 = props => {
|
|
|
11475
11475
|
pointWidth: undefined
|
|
11476
11476
|
}
|
|
11477
11477
|
};
|
|
11478
|
-
const plot = _objectSpread$
|
|
11478
|
+
const plot = _objectSpread$5(_objectSpread$5({}, {
|
|
11479
11479
|
column: {
|
|
11480
11480
|
borderWidth: 0,
|
|
11481
11481
|
borderRadius: 10
|
|
@@ -11530,13 +11530,13 @@ const initChart$1 = props => {
|
|
|
11530
11530
|
};
|
|
11531
11531
|
};
|
|
11532
11532
|
|
|
11533
|
-
function ownKeys$
|
|
11534
|
-
function _objectSpread$
|
|
11533
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11534
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11535
11535
|
const Area = props => {
|
|
11536
11536
|
const chartRef = useRef(null);
|
|
11537
11537
|
const chartOptions = useMemo(() => {
|
|
11538
|
-
const area = _objectSpread$
|
|
11539
|
-
return _objectSpread$
|
|
11538
|
+
const area = _objectSpread$4({}, props);
|
|
11539
|
+
return _objectSpread$4(_objectSpread$4({}, initChart$1(area)), initSeries$1(area));
|
|
11540
11540
|
}, [props]);
|
|
11541
11541
|
useEffect(() => {
|
|
11542
11542
|
if (chartRef.current && chartRef.current.chart) {
|
|
@@ -11597,7 +11597,7 @@ const initSeries$1 = props => {
|
|
|
11597
11597
|
const labels = {
|
|
11598
11598
|
color: "#575E77"
|
|
11599
11599
|
};
|
|
11600
|
-
return _objectSpread$
|
|
11600
|
+
return _objectSpread$4(_objectSpread$4({}, defaults), {
|
|
11601
11601
|
labels
|
|
11602
11602
|
});
|
|
11603
11603
|
};
|
|
@@ -11635,8 +11635,8 @@ const initSeries$1 = props => {
|
|
|
11635
11635
|
};
|
|
11636
11636
|
|
|
11637
11637
|
const _excluded$c = ["withLegend", "centerLabel", "centerValue"];
|
|
11638
|
-
function ownKeys$
|
|
11639
|
-
function _objectSpread$
|
|
11638
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11639
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11640
11640
|
const initChart = _ref => {
|
|
11641
11641
|
let {
|
|
11642
11642
|
withLegend,
|
|
@@ -11686,7 +11686,7 @@ const initChart = _ref => {
|
|
|
11686
11686
|
},
|
|
11687
11687
|
legend: !withLegend ? {
|
|
11688
11688
|
enabled: false
|
|
11689
|
-
} : _objectSpread$
|
|
11689
|
+
} : _objectSpread$3(_objectSpread$3({}, {
|
|
11690
11690
|
enabled: true,
|
|
11691
11691
|
layout: "vertical",
|
|
11692
11692
|
verticalAlign: "middle",
|
|
@@ -11719,13 +11719,13 @@ const initChart = _ref => {
|
|
|
11719
11719
|
};
|
|
11720
11720
|
};
|
|
11721
11721
|
|
|
11722
|
-
function ownKeys$
|
|
11723
|
-
function _objectSpread$
|
|
11722
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11723
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11724
11724
|
const DonutChart = props => {
|
|
11725
11725
|
const chartRef = useRef(null);
|
|
11726
11726
|
const chartOptions = useMemo(() => {
|
|
11727
|
-
const area = _objectSpread$
|
|
11728
|
-
return _objectSpread$
|
|
11727
|
+
const area = _objectSpread$2({}, props);
|
|
11728
|
+
return _objectSpread$2(_objectSpread$2({}, initChart(area)), initSeries(area));
|
|
11729
11729
|
}, [props]);
|
|
11730
11730
|
useEffect(() => {
|
|
11731
11731
|
if (chartRef.current && chartRef.current.chart) {
|
|
@@ -12355,25 +12355,6 @@ const SimpleText = _ref => {
|
|
|
12355
12355
|
}, rest), label);
|
|
12356
12356
|
};
|
|
12357
12357
|
|
|
12358
|
-
const theme = createTheme({
|
|
12359
|
-
focusRing: "never",
|
|
12360
|
-
colors: {
|
|
12361
|
-
adiba: ["#E7E8EB", "#CFD1D8", "#B7BAC4", "#9FA3B1", "#575E77", "#273050", "#0f193d", "#0D1636", "#0C1430", "#0A112A"],
|
|
12362
|
-
altiba: ["#F4E2CE", "#EED4B5", "#E9C59D", "#D89A54", "#D38C3B", "#CD7E23", "#c8700b", "#B46409", "#A05908", "#8C4E07"]
|
|
12363
|
-
},
|
|
12364
|
-
fontFamily: "Poppins",
|
|
12365
|
-
headings: {
|
|
12366
|
-
fontFamily: "Poppins",
|
|
12367
|
-
fontWeight: "500"
|
|
12368
|
-
},
|
|
12369
|
-
primaryColor: "adiba",
|
|
12370
|
-
other: {
|
|
12371
|
-
fontWeights: {
|
|
12372
|
-
normal: 300
|
|
12373
|
-
}
|
|
12374
|
-
}
|
|
12375
|
-
});
|
|
12376
|
-
|
|
12377
12358
|
const _excluded$6 = ["createFn", "icon", "label"];
|
|
12378
12359
|
const PageTitle = _ref => {
|
|
12379
12360
|
var _switcher$items;
|
|
@@ -12407,8 +12388,7 @@ const PageTitle = _ref => {
|
|
|
12407
12388
|
rightsection = /*#__PURE__*/React.createElement(SegmentedControl, {
|
|
12408
12389
|
size: "sm",
|
|
12409
12390
|
bg: "white",
|
|
12410
|
-
|
|
12411
|
-
color: theme.primaryColor,
|
|
12391
|
+
color: 'adiba',
|
|
12412
12392
|
data: switcher.items
|
|
12413
12393
|
});
|
|
12414
12394
|
}
|
|
@@ -13044,6 +13024,25 @@ const File = _ref => {
|
|
|
13044
13024
|
}, /*#__PURE__*/React.createElement(Icons, rightsection === null || rightsection === void 0 ? void 0 : rightsection.icon)) : undefined)));
|
|
13045
13025
|
};
|
|
13046
13026
|
|
|
13027
|
+
const theme = createTheme({
|
|
13028
|
+
focusRing: "never",
|
|
13029
|
+
colors: {
|
|
13030
|
+
adiba: ["#E7E8EB", "#CFD1D8", "#B7BAC4", "#9FA3B1", "#575E77", "#273050", "#0f193d", "#0D1636", "#0C1430", "#0A112A"],
|
|
13031
|
+
altiba: ["#F4E2CE", "#EED4B5", "#E9C59D", "#D89A54", "#D38C3B", "#CD7E23", "#c8700b", "#B46409", "#A05908", "#8C4E07"]
|
|
13032
|
+
},
|
|
13033
|
+
fontFamily: "Poppins",
|
|
13034
|
+
headings: {
|
|
13035
|
+
fontFamily: "Poppins",
|
|
13036
|
+
fontWeight: "500"
|
|
13037
|
+
},
|
|
13038
|
+
primaryColor: "adiba",
|
|
13039
|
+
other: {
|
|
13040
|
+
fontWeights: {
|
|
13041
|
+
normal: 300
|
|
13042
|
+
}
|
|
13043
|
+
}
|
|
13044
|
+
});
|
|
13045
|
+
|
|
13047
13046
|
var ErrorAnimation = "data:null;base64,UEsDBBQAAAAIAEC21lqNk9Q5gAAAALUAAAANAAAAbWFuaWZlc3QuanNvbo2NQQ7CIBBF7zJrqYCk2K56AU9gXIyFKoYyBkYT0/Tu4sZ1d/8n7+Ut8Pa5BErQg4Id3HzyGZly/YMjjsQc/P6/xKMMqtGNrCy++L4NTGFGrpEC/XmB4KpjtTsaPV6FVG0rjEUUne0mMaFDHKVCc/ipz4ifEzlfjUR5xgjrZf0CUEsDBBQAAAAIAEC21loISOBs8wYAAK1lAAA0AAAAYW5pbWF0aW9ucy83MmQ4NDJjYi0wMTY2LTQ3YWEtOTc5Zi1mYWRhYWMwMWE0MzAuanNvbu1cW2/iRhT+K2iebcsz4ytvvb+0UqVWfUHRik3IhoYAAnpZRfnv/c7MGMZgE5wGyrpHK8Zk7ufzOd98M2b9LP4UQ5FEWaRFIO5XYqiSQEyXYhgHYoGLkoH4Swy1wt8P7jp/Qpvbh8nt42y63qDd3d2daTBeryebtRiObgIxG3+erOj787Z4OsdVBWLzWQwxiunml4fxcjL4kSoPJM3hEW2exYKSsWn1KIYyjl8Cgcl5edrkYYZe3khmcSDTMkqD+AalKPBL4yDUiS0xg3jtYrSzn5sXaojxUbSmyVkbaM7i0woTnG6sUZiWNUVMZsiuekQm9fgsppTxNw0bZVkemBS4oMFIBpImYYy0N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hdGlvbnMvNzJkODQyY2ItMDE2Ni00N2FhLTk3OWYtZmFkYWFjMDFhNDMwLmpzb25QSwUGAAAAAAIAAgCdAAAA8AcAAAAA";
|
|
13048
13047
|
|
|
13049
13048
|
const ErrorModal = _ref => {
|
|
@@ -13227,20 +13226,1086 @@ const Drawer = _ref => {
|
|
|
13227
13226
|
}, page))));
|
|
13228
13227
|
};
|
|
13229
13228
|
|
|
13230
|
-
|
|
13229
|
+
function validateFormName(name) {
|
|
13230
|
+
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
13231
|
+
throw new Error(
|
|
13232
|
+
`[@mantine/use-form] Form name "${name}" is invalid, it should contain only letters, numbers and dashes`
|
|
13233
|
+
);
|
|
13234
|
+
}
|
|
13235
|
+
}
|
|
13236
|
+
const useIsomorphicEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
13237
|
+
function useFormEvent(eventKey, handler) {
|
|
13238
|
+
useIsomorphicEffect(() => {
|
|
13239
|
+
if (eventKey) {
|
|
13240
|
+
window.addEventListener(eventKey, handler);
|
|
13241
|
+
return () => window.removeEventListener(eventKey, handler);
|
|
13242
|
+
}
|
|
13243
|
+
return void 0;
|
|
13244
|
+
}, [eventKey]);
|
|
13245
|
+
}
|
|
13246
|
+
function useFormActions(name, form) {
|
|
13247
|
+
if (name) {
|
|
13248
|
+
validateFormName(name);
|
|
13249
|
+
}
|
|
13250
|
+
useFormEvent(
|
|
13251
|
+
`mantine-form:${name}:set-field-value`,
|
|
13252
|
+
(event) => form.setFieldValue(event.detail.path, event.detail.value)
|
|
13253
|
+
);
|
|
13254
|
+
useFormEvent(
|
|
13255
|
+
`mantine-form:${name}:set-values`,
|
|
13256
|
+
(event) => form.setValues(event.detail)
|
|
13257
|
+
);
|
|
13258
|
+
useFormEvent(
|
|
13259
|
+
`mantine-form:${name}:set-initial-values`,
|
|
13260
|
+
(event) => form.setInitialValues(event.detail)
|
|
13261
|
+
);
|
|
13262
|
+
useFormEvent(
|
|
13263
|
+
`mantine-form:${name}:set-errors`,
|
|
13264
|
+
(event) => form.setErrors(event.detail)
|
|
13265
|
+
);
|
|
13266
|
+
useFormEvent(
|
|
13267
|
+
`mantine-form:${name}:set-field-error`,
|
|
13268
|
+
(event) => form.setFieldError(event.detail.path, event.detail.error)
|
|
13269
|
+
);
|
|
13270
|
+
useFormEvent(
|
|
13271
|
+
`mantine-form:${name}:clear-field-error`,
|
|
13272
|
+
(event) => form.clearFieldError(event.detail)
|
|
13273
|
+
);
|
|
13274
|
+
useFormEvent(`mantine-form:${name}:clear-errors`, form.clearErrors);
|
|
13275
|
+
useFormEvent(`mantine-form:${name}:reset`, form.reset);
|
|
13276
|
+
useFormEvent(`mantine-form:${name}:validate`, form.validate);
|
|
13277
|
+
useFormEvent(
|
|
13278
|
+
`mantine-form:${name}:validate-field`,
|
|
13279
|
+
(event) => form.validateField(event.detail)
|
|
13280
|
+
);
|
|
13281
|
+
useFormEvent(
|
|
13282
|
+
`mantine-form:${name}:reorder-list-item`,
|
|
13283
|
+
(event) => form.reorderListItem(event.detail.path, event.detail.payload)
|
|
13284
|
+
);
|
|
13285
|
+
useFormEvent(
|
|
13286
|
+
`mantine-form:${name}:remove-list-item`,
|
|
13287
|
+
(event) => form.removeListItem(event.detail.path, event.detail.index)
|
|
13288
|
+
);
|
|
13289
|
+
useFormEvent(
|
|
13290
|
+
`mantine-form:${name}:insert-list-item`,
|
|
13291
|
+
(event) => form.insertListItem(event.detail.path, event.detail.item, event.detail.index)
|
|
13292
|
+
);
|
|
13293
|
+
useFormEvent(
|
|
13294
|
+
`mantine-form:${name}:set-dirty`,
|
|
13295
|
+
(event) => form.setDirty(event.detail)
|
|
13296
|
+
);
|
|
13297
|
+
useFormEvent(
|
|
13298
|
+
`mantine-form:${name}:set-touched`,
|
|
13299
|
+
(event) => form.setTouched(event.detail)
|
|
13300
|
+
);
|
|
13301
|
+
useFormEvent(
|
|
13302
|
+
`mantine-form:${name}:reset-dirty`,
|
|
13303
|
+
(event) => form.resetDirty(event.detail)
|
|
13304
|
+
);
|
|
13305
|
+
useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
|
|
13306
|
+
}
|
|
13307
|
+
|
|
13308
|
+
function getInputOnChange(setValue) {
|
|
13309
|
+
return (val) => {
|
|
13310
|
+
if (!val) {
|
|
13311
|
+
setValue(val);
|
|
13312
|
+
} else if (typeof val === "function") {
|
|
13313
|
+
setValue(val);
|
|
13314
|
+
} else if (typeof val === "object" && "nativeEvent" in val) {
|
|
13315
|
+
const { currentTarget } = val;
|
|
13316
|
+
if (currentTarget instanceof HTMLInputElement) {
|
|
13317
|
+
if (currentTarget.type === "checkbox") {
|
|
13318
|
+
setValue(currentTarget.checked);
|
|
13319
|
+
} else {
|
|
13320
|
+
setValue(currentTarget.value);
|
|
13321
|
+
}
|
|
13322
|
+
} else if (currentTarget instanceof HTMLTextAreaElement || currentTarget instanceof HTMLSelectElement) {
|
|
13323
|
+
setValue(currentTarget.value);
|
|
13324
|
+
}
|
|
13325
|
+
} else {
|
|
13326
|
+
setValue(val);
|
|
13327
|
+
}
|
|
13328
|
+
};
|
|
13329
|
+
}
|
|
13330
|
+
|
|
13331
|
+
function filterErrors(errors) {
|
|
13332
|
+
if (errors === null || typeof errors !== "object") {
|
|
13333
|
+
return {};
|
|
13334
|
+
}
|
|
13335
|
+
return Object.keys(errors).reduce((acc, key) => {
|
|
13336
|
+
const errorValue = errors[key];
|
|
13337
|
+
if (errorValue !== void 0 && errorValue !== null && errorValue !== false) {
|
|
13338
|
+
acc[key] = errorValue;
|
|
13339
|
+
}
|
|
13340
|
+
return acc;
|
|
13341
|
+
}, {});
|
|
13342
|
+
}
|
|
13343
|
+
|
|
13344
|
+
function useFormErrors(initialErrors) {
|
|
13345
|
+
const [errorsState, setErrorsState] = useState(filterErrors(initialErrors));
|
|
13346
|
+
const errorsRef = useRef(errorsState);
|
|
13347
|
+
const setErrors = useCallback((errors) => {
|
|
13348
|
+
setErrorsState((current) => {
|
|
13349
|
+
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
13350
|
+
errorsRef.current = newErrors;
|
|
13351
|
+
return newErrors;
|
|
13352
|
+
});
|
|
13353
|
+
}, []);
|
|
13354
|
+
const clearErrors = useCallback(() => setErrors({}), []);
|
|
13355
|
+
const clearFieldError = useCallback(
|
|
13356
|
+
(path) => {
|
|
13357
|
+
if (errorsRef.current[path] === void 0) {
|
|
13358
|
+
return;
|
|
13359
|
+
}
|
|
13360
|
+
setErrors((current) => {
|
|
13361
|
+
const errors = { ...current };
|
|
13362
|
+
delete errors[path];
|
|
13363
|
+
return errors;
|
|
13364
|
+
});
|
|
13365
|
+
},
|
|
13366
|
+
[errorsState]
|
|
13367
|
+
);
|
|
13368
|
+
const setFieldError = useCallback(
|
|
13369
|
+
(path, error) => {
|
|
13370
|
+
if (error == null || error === false) {
|
|
13371
|
+
clearFieldError(path);
|
|
13372
|
+
} else if (errorsRef.current[path] !== error) {
|
|
13373
|
+
setErrors((current) => ({ ...current, [path]: error }));
|
|
13374
|
+
}
|
|
13375
|
+
},
|
|
13376
|
+
[errorsState]
|
|
13377
|
+
);
|
|
13378
|
+
return {
|
|
13379
|
+
errorsState,
|
|
13380
|
+
setErrors,
|
|
13381
|
+
clearErrors,
|
|
13382
|
+
setFieldError,
|
|
13383
|
+
clearFieldError
|
|
13384
|
+
};
|
|
13385
|
+
}
|
|
13386
|
+
|
|
13387
|
+
function clearListState(field, state) {
|
|
13388
|
+
if (state === null || typeof state !== "object") {
|
|
13389
|
+
return {};
|
|
13390
|
+
}
|
|
13391
|
+
const clone = { ...state };
|
|
13392
|
+
Object.keys(state).forEach((errorKey) => {
|
|
13393
|
+
if (errorKey.includes(`${String(field)}.`)) {
|
|
13394
|
+
delete clone[errorKey];
|
|
13395
|
+
}
|
|
13396
|
+
});
|
|
13397
|
+
return clone;
|
|
13398
|
+
}
|
|
13399
|
+
|
|
13400
|
+
function getIndexFromKeyAfterPath(key, path) {
|
|
13401
|
+
const split = key.substring(path.length + 1).split(".")[0];
|
|
13402
|
+
return parseInt(split, 10);
|
|
13403
|
+
}
|
|
13404
|
+
function changeErrorIndices(path, index, errors, change) {
|
|
13405
|
+
if (index === void 0) {
|
|
13406
|
+
return errors;
|
|
13407
|
+
}
|
|
13408
|
+
const pathString = `${String(path)}`;
|
|
13409
|
+
let clearedErrors = errors;
|
|
13410
|
+
if (change === -1) {
|
|
13411
|
+
clearedErrors = clearListState(`${pathString}.${index}`, clearedErrors);
|
|
13412
|
+
}
|
|
13413
|
+
const cloned = { ...clearedErrors };
|
|
13414
|
+
const changedKeys = /* @__PURE__ */ new Set();
|
|
13415
|
+
Object.entries(clearedErrors).filter(([key]) => {
|
|
13416
|
+
if (!key.startsWith(`${pathString}.`)) {
|
|
13417
|
+
return false;
|
|
13418
|
+
}
|
|
13419
|
+
const currIndex = getIndexFromKeyAfterPath(key, pathString);
|
|
13420
|
+
if (Number.isNaN(currIndex)) {
|
|
13421
|
+
return false;
|
|
13422
|
+
}
|
|
13423
|
+
return currIndex >= index;
|
|
13424
|
+
}).forEach(([key, value]) => {
|
|
13425
|
+
const currIndex = getIndexFromKeyAfterPath(key, pathString);
|
|
13426
|
+
const newKey = key.replace(
|
|
13427
|
+
`${pathString}.${currIndex}`,
|
|
13428
|
+
`${pathString}.${currIndex + change}`
|
|
13429
|
+
);
|
|
13430
|
+
cloned[newKey] = value;
|
|
13431
|
+
changedKeys.add(newKey);
|
|
13432
|
+
if (!changedKeys.has(key)) {
|
|
13433
|
+
delete cloned[key];
|
|
13434
|
+
}
|
|
13435
|
+
});
|
|
13436
|
+
return cloned;
|
|
13437
|
+
}
|
|
13438
|
+
|
|
13439
|
+
function reorderErrors(path, { from, to }, errors) {
|
|
13440
|
+
const oldKeyStart = `${path}.${from}`;
|
|
13441
|
+
const newKeyStart = `${path}.${to}`;
|
|
13442
|
+
const clone = { ...errors };
|
|
13443
|
+
const processedKeys = /* @__PURE__ */ new Set();
|
|
13444
|
+
Object.keys(errors).forEach((key) => {
|
|
13445
|
+
if (processedKeys.has(key)) {
|
|
13446
|
+
return;
|
|
13447
|
+
}
|
|
13448
|
+
let oldKey;
|
|
13449
|
+
let newKey;
|
|
13450
|
+
if (key.startsWith(oldKeyStart)) {
|
|
13451
|
+
oldKey = key;
|
|
13452
|
+
newKey = key.replace(oldKeyStart, newKeyStart);
|
|
13453
|
+
} else if (key.startsWith(newKeyStart)) {
|
|
13454
|
+
oldKey = key.replace(newKeyStart, oldKeyStart);
|
|
13455
|
+
newKey = key;
|
|
13456
|
+
}
|
|
13457
|
+
if (oldKey && newKey) {
|
|
13458
|
+
const value1 = clone[oldKey];
|
|
13459
|
+
const value2 = clone[newKey];
|
|
13460
|
+
value2 === void 0 ? delete clone[oldKey] : clone[oldKey] = value2;
|
|
13461
|
+
value1 === void 0 ? delete clone[newKey] : clone[newKey] = value1;
|
|
13462
|
+
processedKeys.add(oldKey);
|
|
13463
|
+
processedKeys.add(newKey);
|
|
13464
|
+
}
|
|
13465
|
+
});
|
|
13466
|
+
return clone;
|
|
13467
|
+
}
|
|
13468
|
+
|
|
13469
|
+
function set(obj, key, val) {
|
|
13470
|
+
if (typeof val.value === 'object') val.value = klona(val.value);
|
|
13471
|
+
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
|
13472
|
+
Object.defineProperty(obj, key, val);
|
|
13473
|
+
} else obj[key] = val.value;
|
|
13474
|
+
}
|
|
13475
|
+
|
|
13476
|
+
function klona(x) {
|
|
13477
|
+
if (typeof x !== 'object') return x;
|
|
13478
|
+
|
|
13479
|
+
var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
|
|
13480
|
+
|
|
13481
|
+
if (str === '[object Object]') {
|
|
13482
|
+
tmp = Object.create(x.__proto__ || null);
|
|
13483
|
+
} else if (str === '[object Array]') {
|
|
13484
|
+
tmp = Array(x.length);
|
|
13485
|
+
} else if (str === '[object Set]') {
|
|
13486
|
+
tmp = new Set;
|
|
13487
|
+
x.forEach(function (val) {
|
|
13488
|
+
tmp.add(klona(val));
|
|
13489
|
+
});
|
|
13490
|
+
} else if (str === '[object Map]') {
|
|
13491
|
+
tmp = new Map;
|
|
13492
|
+
x.forEach(function (val, key) {
|
|
13493
|
+
tmp.set(klona(key), klona(val));
|
|
13494
|
+
});
|
|
13495
|
+
} else if (str === '[object Date]') {
|
|
13496
|
+
tmp = new Date(+x);
|
|
13497
|
+
} else if (str === '[object RegExp]') {
|
|
13498
|
+
tmp = new RegExp(x.source, x.flags);
|
|
13499
|
+
} else if (str === '[object DataView]') {
|
|
13500
|
+
tmp = new x.constructor( klona(x.buffer) );
|
|
13501
|
+
} else if (str === '[object ArrayBuffer]') {
|
|
13502
|
+
tmp = x.slice(0);
|
|
13503
|
+
} else if (str.slice(-6) === 'Array]') {
|
|
13504
|
+
// ArrayBuffer.isView(x)
|
|
13505
|
+
// ~> `new` bcuz `Buffer.slice` => ref
|
|
13506
|
+
tmp = new x.constructor(x);
|
|
13507
|
+
}
|
|
13508
|
+
|
|
13509
|
+
if (tmp) {
|
|
13510
|
+
for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
|
13511
|
+
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
13512
|
+
}
|
|
13513
|
+
|
|
13514
|
+
for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
13515
|
+
if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
|
|
13516
|
+
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
13517
|
+
}
|
|
13518
|
+
}
|
|
13519
|
+
|
|
13520
|
+
return tmp || x;
|
|
13521
|
+
}
|
|
13522
|
+
|
|
13523
|
+
function getSplittedPath(path) {
|
|
13524
|
+
if (typeof path !== "string") {
|
|
13525
|
+
return [];
|
|
13526
|
+
}
|
|
13527
|
+
return path.split(".");
|
|
13528
|
+
}
|
|
13529
|
+
|
|
13530
|
+
function getPath(path, values) {
|
|
13531
|
+
const splittedPath = getSplittedPath(path);
|
|
13532
|
+
if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
|
|
13533
|
+
return void 0;
|
|
13534
|
+
}
|
|
13535
|
+
let value = values[splittedPath[0]];
|
|
13536
|
+
for (let i = 1; i < splittedPath.length; i += 1) {
|
|
13537
|
+
if (value == null) {
|
|
13538
|
+
break;
|
|
13539
|
+
}
|
|
13540
|
+
value = value[splittedPath[i]];
|
|
13541
|
+
}
|
|
13542
|
+
return value;
|
|
13543
|
+
}
|
|
13544
|
+
|
|
13545
|
+
function setPath(path, value, values) {
|
|
13546
|
+
const splittedPath = getSplittedPath(path);
|
|
13547
|
+
if (splittedPath.length === 0) {
|
|
13548
|
+
return values;
|
|
13549
|
+
}
|
|
13550
|
+
const cloned = klona(values);
|
|
13551
|
+
if (splittedPath.length === 1) {
|
|
13552
|
+
cloned[splittedPath[0]] = value;
|
|
13553
|
+
return cloned;
|
|
13554
|
+
}
|
|
13555
|
+
let val = cloned[splittedPath[0]];
|
|
13556
|
+
for (let i = 1; i < splittedPath.length - 1; i += 1) {
|
|
13557
|
+
if (val === void 0) {
|
|
13558
|
+
return cloned;
|
|
13559
|
+
}
|
|
13560
|
+
val = val[splittedPath[i]];
|
|
13561
|
+
}
|
|
13562
|
+
val[splittedPath[splittedPath.length - 1]] = value;
|
|
13563
|
+
return cloned;
|
|
13564
|
+
}
|
|
13565
|
+
|
|
13566
|
+
function reorderPath(path, { from, to }, values) {
|
|
13567
|
+
const currentValue = getPath(path, values);
|
|
13568
|
+
if (!Array.isArray(currentValue)) {
|
|
13569
|
+
return values;
|
|
13570
|
+
}
|
|
13571
|
+
const cloned = [...currentValue];
|
|
13572
|
+
const item = currentValue[from];
|
|
13573
|
+
cloned.splice(from, 1);
|
|
13574
|
+
cloned.splice(to, 0, item);
|
|
13575
|
+
return setPath(path, cloned, values);
|
|
13576
|
+
}
|
|
13577
|
+
|
|
13578
|
+
function insertPath(path, value, index, values) {
|
|
13579
|
+
const currentValue = getPath(path, values);
|
|
13580
|
+
if (!Array.isArray(currentValue)) {
|
|
13581
|
+
return values;
|
|
13582
|
+
}
|
|
13583
|
+
const cloned = [...currentValue];
|
|
13584
|
+
cloned.splice(typeof index === "number" ? index : cloned.length, 0, value);
|
|
13585
|
+
return setPath(path, cloned, values);
|
|
13586
|
+
}
|
|
13587
|
+
|
|
13588
|
+
function removePath(path, index, values) {
|
|
13589
|
+
const currentValue = getPath(path, values);
|
|
13590
|
+
if (!Array.isArray(currentValue)) {
|
|
13591
|
+
return values;
|
|
13592
|
+
}
|
|
13593
|
+
return setPath(
|
|
13594
|
+
path,
|
|
13595
|
+
currentValue.filter((_, itemIndex) => itemIndex !== index),
|
|
13596
|
+
values
|
|
13597
|
+
);
|
|
13598
|
+
}
|
|
13599
|
+
|
|
13600
|
+
function replacePath(path, item, index, values) {
|
|
13601
|
+
const currentValue = getPath(path, values);
|
|
13602
|
+
if (!Array.isArray(currentValue)) {
|
|
13603
|
+
return values;
|
|
13604
|
+
}
|
|
13605
|
+
if (currentValue.length <= index) {
|
|
13606
|
+
return values;
|
|
13607
|
+
}
|
|
13608
|
+
const cloned = [...currentValue];
|
|
13609
|
+
cloned[index] = item;
|
|
13610
|
+
return setPath(path, cloned, values);
|
|
13611
|
+
}
|
|
13612
|
+
|
|
13613
|
+
function useFormList({
|
|
13614
|
+
$values,
|
|
13615
|
+
$errors,
|
|
13616
|
+
$status
|
|
13617
|
+
}) {
|
|
13618
|
+
const reorderListItem = useCallback((path, payload) => {
|
|
13619
|
+
$status.clearFieldDirty(path);
|
|
13620
|
+
$errors.setErrors((errs) => reorderErrors(path, payload, errs));
|
|
13621
|
+
$values.setValues({
|
|
13622
|
+
values: reorderPath(path, payload, $values.refValues.current),
|
|
13623
|
+
updateState: true
|
|
13624
|
+
});
|
|
13625
|
+
}, []);
|
|
13626
|
+
const removeListItem = useCallback((path, index) => {
|
|
13627
|
+
$status.clearFieldDirty(path);
|
|
13628
|
+
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
|
|
13629
|
+
$values.setValues({
|
|
13630
|
+
values: removePath(path, index, $values.refValues.current),
|
|
13631
|
+
updateState: true
|
|
13632
|
+
});
|
|
13633
|
+
}, []);
|
|
13634
|
+
const insertListItem = useCallback((path, item, index) => {
|
|
13635
|
+
$status.clearFieldDirty(path);
|
|
13636
|
+
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
|
|
13637
|
+
$values.setValues({
|
|
13638
|
+
values: insertPath(path, item, index, $values.refValues.current),
|
|
13639
|
+
updateState: true
|
|
13640
|
+
});
|
|
13641
|
+
}, []);
|
|
13642
|
+
const replaceListItem = useCallback((path, index, item) => {
|
|
13643
|
+
$status.clearFieldDirty(path);
|
|
13644
|
+
$values.setValues({
|
|
13645
|
+
values: replacePath(path, item, index, $values.refValues.current),
|
|
13646
|
+
updateState: true
|
|
13647
|
+
});
|
|
13648
|
+
}, []);
|
|
13649
|
+
return { reorderListItem, removeListItem, insertListItem, replaceListItem };
|
|
13650
|
+
}
|
|
13651
|
+
|
|
13652
|
+
var fastDeepEqual;
|
|
13653
|
+
var hasRequiredFastDeepEqual;
|
|
13654
|
+
function requireFastDeepEqual() {
|
|
13655
|
+
if (hasRequiredFastDeepEqual) return fastDeepEqual;
|
|
13656
|
+
hasRequiredFastDeepEqual = 1;
|
|
13657
|
+
|
|
13658
|
+
// do not edit .js files directly - edit src/index.jst
|
|
13659
|
+
|
|
13660
|
+
fastDeepEqual = function equal(a, b) {
|
|
13661
|
+
if (a === b) return true;
|
|
13662
|
+
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
13663
|
+
if (a.constructor !== b.constructor) return false;
|
|
13664
|
+
var length, i, keys;
|
|
13665
|
+
if (Array.isArray(a)) {
|
|
13666
|
+
length = a.length;
|
|
13667
|
+
if (length != b.length) return false;
|
|
13668
|
+
for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
|
|
13669
|
+
return true;
|
|
13670
|
+
}
|
|
13671
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
13672
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
13673
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
13674
|
+
keys = Object.keys(a);
|
|
13675
|
+
length = keys.length;
|
|
13676
|
+
if (length !== Object.keys(b).length) return false;
|
|
13677
|
+
for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
13678
|
+
for (i = length; i-- !== 0;) {
|
|
13679
|
+
var key = keys[i];
|
|
13680
|
+
if (!equal(a[key], b[key])) return false;
|
|
13681
|
+
}
|
|
13682
|
+
return true;
|
|
13683
|
+
}
|
|
13684
|
+
|
|
13685
|
+
// true if both NaN, false otherwise
|
|
13686
|
+
return a !== a && b !== b;
|
|
13687
|
+
};
|
|
13688
|
+
return fastDeepEqual;
|
|
13689
|
+
}
|
|
13690
|
+
|
|
13691
|
+
var fastDeepEqualExports = requireFastDeepEqual();
|
|
13692
|
+
var isEqual = /*@__PURE__*/getDefaultExportFromCjs(fastDeepEqualExports);
|
|
13693
|
+
|
|
13694
|
+
function getStatus(status, path) {
|
|
13695
|
+
const paths = Object.keys(status);
|
|
13696
|
+
if (typeof path === "string") {
|
|
13697
|
+
const nestedPaths = paths.filter((statusPath) => statusPath.startsWith(`${path}.`));
|
|
13698
|
+
return status[path] || nestedPaths.some((statusPath) => status[statusPath]) || false;
|
|
13699
|
+
}
|
|
13700
|
+
return paths.some((statusPath) => status[statusPath]);
|
|
13701
|
+
}
|
|
13702
|
+
|
|
13703
|
+
function useFormStatus({
|
|
13704
|
+
initialDirty,
|
|
13705
|
+
initialTouched,
|
|
13706
|
+
mode,
|
|
13707
|
+
$values
|
|
13708
|
+
}) {
|
|
13709
|
+
const [touchedState, setTouchedState] = useState(initialTouched);
|
|
13710
|
+
const [dirtyState, setDirtyState] = useState(initialDirty);
|
|
13711
|
+
const touchedRef = useRef(initialTouched);
|
|
13712
|
+
const dirtyRef = useRef(initialDirty);
|
|
13713
|
+
const setTouched = useCallback((values) => {
|
|
13714
|
+
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
13715
|
+
touchedRef.current = resolvedValues;
|
|
13716
|
+
if (mode === "controlled") {
|
|
13717
|
+
setTouchedState(resolvedValues);
|
|
13718
|
+
}
|
|
13719
|
+
}, []);
|
|
13720
|
+
const setDirty = useCallback(
|
|
13721
|
+
(values, forceUpdate = false) => {
|
|
13722
|
+
const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
|
|
13723
|
+
dirtyRef.current = resolvedValues;
|
|
13724
|
+
if (mode === "controlled" || forceUpdate) {
|
|
13725
|
+
setDirtyState(resolvedValues);
|
|
13726
|
+
}
|
|
13727
|
+
},
|
|
13728
|
+
[]
|
|
13729
|
+
);
|
|
13730
|
+
const resetTouched = useCallback(() => setTouched({}), []);
|
|
13731
|
+
const resetDirty = useCallback((values) => {
|
|
13732
|
+
const newSnapshot = values ? { ...$values.refValues.current, ...values } : $values.refValues.current;
|
|
13733
|
+
$values.setValuesSnapshot(newSnapshot);
|
|
13734
|
+
setDirty({});
|
|
13735
|
+
}, []);
|
|
13736
|
+
const setFieldTouched = useCallback((path, touched) => {
|
|
13737
|
+
setTouched((currentTouched) => {
|
|
13738
|
+
if (getStatus(currentTouched, path) === touched) {
|
|
13739
|
+
return currentTouched;
|
|
13740
|
+
}
|
|
13741
|
+
return { ...currentTouched, [path]: touched };
|
|
13742
|
+
});
|
|
13743
|
+
}, []);
|
|
13744
|
+
const setFieldDirty = useCallback((path, dirty, forceUpdate) => {
|
|
13745
|
+
setDirty((currentDirty) => {
|
|
13746
|
+
if (getStatus(currentDirty, path) === dirty) {
|
|
13747
|
+
return currentDirty;
|
|
13748
|
+
}
|
|
13749
|
+
return { ...currentDirty, [path]: dirty };
|
|
13750
|
+
}, forceUpdate);
|
|
13751
|
+
}, []);
|
|
13752
|
+
const setCalculatedFieldDirty = useCallback((path, value) => {
|
|
13753
|
+
const currentDirty = getStatus(dirtyRef.current, path);
|
|
13754
|
+
const dirty = !isEqual(getPath(path, $values.getValuesSnapshot()), value);
|
|
13755
|
+
const clearedState = clearListState(path, dirtyRef.current);
|
|
13756
|
+
clearedState[path] = dirty;
|
|
13757
|
+
setDirty(clearedState, currentDirty !== dirty);
|
|
13758
|
+
}, []);
|
|
13759
|
+
const isTouched = useCallback(
|
|
13760
|
+
(path) => getStatus(touchedRef.current, path),
|
|
13761
|
+
[]
|
|
13762
|
+
);
|
|
13763
|
+
const clearFieldDirty = useCallback(
|
|
13764
|
+
(path) => setDirty((current) => {
|
|
13765
|
+
if (typeof path !== "string") {
|
|
13766
|
+
return current;
|
|
13767
|
+
}
|
|
13768
|
+
const result = clearListState(path, current);
|
|
13769
|
+
delete result[path];
|
|
13770
|
+
if (isEqual(result, current)) {
|
|
13771
|
+
return current;
|
|
13772
|
+
}
|
|
13773
|
+
return result;
|
|
13774
|
+
}),
|
|
13775
|
+
[]
|
|
13776
|
+
);
|
|
13777
|
+
const isDirty = useCallback((path) => {
|
|
13778
|
+
if (path) {
|
|
13779
|
+
const overriddenValue = getPath(path, dirtyRef.current);
|
|
13780
|
+
if (typeof overriddenValue === "boolean") {
|
|
13781
|
+
return overriddenValue;
|
|
13782
|
+
}
|
|
13783
|
+
const sliceOfValues = getPath(path, $values.refValues.current);
|
|
13784
|
+
const sliceOfInitialValues = getPath(path, $values.valuesSnapshot.current);
|
|
13785
|
+
return !isEqual(sliceOfValues, sliceOfInitialValues);
|
|
13786
|
+
}
|
|
13787
|
+
const isOverridden = Object.keys(dirtyRef.current).length > 0;
|
|
13788
|
+
if (isOverridden) {
|
|
13789
|
+
return getStatus(dirtyRef.current);
|
|
13790
|
+
}
|
|
13791
|
+
return !isEqual($values.refValues.current, $values.valuesSnapshot.current);
|
|
13792
|
+
}, []);
|
|
13793
|
+
const getDirty = useCallback(() => dirtyRef.current, []);
|
|
13794
|
+
const getTouched = useCallback(() => touchedRef.current, []);
|
|
13795
|
+
return {
|
|
13796
|
+
touchedState,
|
|
13797
|
+
dirtyState,
|
|
13798
|
+
touchedRef,
|
|
13799
|
+
dirtyRef,
|
|
13800
|
+
setTouched,
|
|
13801
|
+
setDirty,
|
|
13802
|
+
resetDirty,
|
|
13803
|
+
resetTouched,
|
|
13804
|
+
isTouched,
|
|
13805
|
+
setFieldTouched,
|
|
13806
|
+
setFieldDirty,
|
|
13807
|
+
setTouchedState,
|
|
13808
|
+
setDirtyState,
|
|
13809
|
+
clearFieldDirty,
|
|
13810
|
+
isDirty,
|
|
13811
|
+
getDirty,
|
|
13812
|
+
getTouched,
|
|
13813
|
+
setCalculatedFieldDirty
|
|
13814
|
+
};
|
|
13815
|
+
}
|
|
13816
|
+
|
|
13817
|
+
function useFormValues({
|
|
13818
|
+
initialValues,
|
|
13819
|
+
onValuesChange,
|
|
13820
|
+
mode
|
|
13821
|
+
}) {
|
|
13822
|
+
const initialized = useRef(false);
|
|
13823
|
+
const [stateValues, setStateValues] = useState(initialValues || {});
|
|
13824
|
+
const refValues = useRef(stateValues);
|
|
13825
|
+
const valuesSnapshot = useRef(stateValues);
|
|
13826
|
+
const setValues = useCallback(
|
|
13827
|
+
({
|
|
13828
|
+
values,
|
|
13829
|
+
subscribers,
|
|
13830
|
+
updateState = true,
|
|
13831
|
+
mergeWithPreviousValues = true
|
|
13832
|
+
}) => {
|
|
13833
|
+
const previousValues = refValues.current;
|
|
13834
|
+
const resolvedValues = values instanceof Function ? values(refValues.current) : values;
|
|
13835
|
+
const updatedValues = mergeWithPreviousValues ? { ...previousValues, ...resolvedValues } : resolvedValues;
|
|
13836
|
+
refValues.current = updatedValues;
|
|
13837
|
+
if (updateState) {
|
|
13838
|
+
setStateValues(updatedValues);
|
|
13839
|
+
if (mode === "uncontrolled") {
|
|
13840
|
+
refValues.current = updatedValues;
|
|
13841
|
+
}
|
|
13842
|
+
}
|
|
13843
|
+
onValuesChange?.(updatedValues, previousValues);
|
|
13844
|
+
subscribers?.filter(Boolean).forEach((subscriber) => subscriber({ updatedValues, previousValues }));
|
|
13845
|
+
},
|
|
13846
|
+
[onValuesChange]
|
|
13847
|
+
);
|
|
13848
|
+
const setFieldValue = useCallback(
|
|
13849
|
+
(payload) => {
|
|
13850
|
+
const currentValue = getPath(payload.path, refValues.current);
|
|
13851
|
+
const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
|
|
13852
|
+
if (currentValue !== updatedValue) {
|
|
13853
|
+
const previousValues = refValues.current;
|
|
13854
|
+
const updatedValues = setPath(payload.path, updatedValue, refValues.current);
|
|
13855
|
+
setValues({ values: updatedValues, updateState: payload.updateState });
|
|
13856
|
+
payload.subscribers?.filter(Boolean).forEach(
|
|
13857
|
+
(subscriber) => subscriber({ path: payload.path, updatedValues, previousValues })
|
|
13858
|
+
);
|
|
13859
|
+
}
|
|
13860
|
+
},
|
|
13861
|
+
[setValues]
|
|
13862
|
+
);
|
|
13863
|
+
const setValuesSnapshot = useCallback((payload) => {
|
|
13864
|
+
valuesSnapshot.current = payload;
|
|
13865
|
+
}, []);
|
|
13866
|
+
const initialize = useCallback(
|
|
13867
|
+
(values, onInitialize) => {
|
|
13868
|
+
if (!initialized.current) {
|
|
13869
|
+
initialized.current = true;
|
|
13870
|
+
setValues({ values, updateState: mode === "controlled" });
|
|
13871
|
+
setValuesSnapshot(values);
|
|
13872
|
+
onInitialize();
|
|
13873
|
+
}
|
|
13874
|
+
},
|
|
13875
|
+
[setValues]
|
|
13876
|
+
);
|
|
13877
|
+
const resetValues = useCallback(() => {
|
|
13878
|
+
setValues({
|
|
13879
|
+
values: valuesSnapshot.current,
|
|
13880
|
+
updateState: true,
|
|
13881
|
+
mergeWithPreviousValues: false
|
|
13882
|
+
});
|
|
13883
|
+
}, [setValues]);
|
|
13884
|
+
const getValues = useCallback(() => refValues.current, []);
|
|
13885
|
+
const getValuesSnapshot = useCallback(() => valuesSnapshot.current, []);
|
|
13886
|
+
const resetField = useCallback(
|
|
13887
|
+
(path, subscribers) => {
|
|
13888
|
+
const snapshotValue = getPath(path, valuesSnapshot.current);
|
|
13889
|
+
if (typeof snapshotValue === "undefined") {
|
|
13890
|
+
return;
|
|
13891
|
+
}
|
|
13892
|
+
setFieldValue({
|
|
13893
|
+
path,
|
|
13894
|
+
value: snapshotValue,
|
|
13895
|
+
updateState: mode === "controlled",
|
|
13896
|
+
subscribers
|
|
13897
|
+
});
|
|
13898
|
+
},
|
|
13899
|
+
[setFieldValue, mode]
|
|
13900
|
+
);
|
|
13901
|
+
return {
|
|
13902
|
+
initialized,
|
|
13903
|
+
stateValues,
|
|
13904
|
+
refValues,
|
|
13905
|
+
valuesSnapshot,
|
|
13906
|
+
setValues,
|
|
13907
|
+
setFieldValue,
|
|
13908
|
+
resetValues,
|
|
13909
|
+
setValuesSnapshot,
|
|
13910
|
+
initialize,
|
|
13911
|
+
getValues,
|
|
13912
|
+
getValuesSnapshot,
|
|
13913
|
+
resetField
|
|
13914
|
+
};
|
|
13915
|
+
}
|
|
13916
|
+
|
|
13917
|
+
function useFormWatch({
|
|
13918
|
+
$status,
|
|
13919
|
+
cascadeUpdates
|
|
13920
|
+
}) {
|
|
13921
|
+
const subscribers = useRef(
|
|
13922
|
+
{}
|
|
13923
|
+
);
|
|
13924
|
+
const watch = useCallback((path, callback) => {
|
|
13925
|
+
useEffect(() => {
|
|
13926
|
+
subscribers.current[path] = subscribers.current[path] || [];
|
|
13927
|
+
subscribers.current[path].push(callback);
|
|
13928
|
+
return () => {
|
|
13929
|
+
subscribers.current[path] = subscribers.current[path].filter((cb) => cb !== callback);
|
|
13930
|
+
};
|
|
13931
|
+
}, [callback]);
|
|
13932
|
+
}, []);
|
|
13933
|
+
const getFieldSubscribers = useCallback((path) => {
|
|
13934
|
+
const result = subscribers.current[path]?.map(
|
|
13935
|
+
(callback) => (input) => callback({
|
|
13936
|
+
previousValue: getPath(path, input.previousValues),
|
|
13937
|
+
value: getPath(path, input.updatedValues),
|
|
13938
|
+
touched: $status.isTouched(path),
|
|
13939
|
+
dirty: $status.isDirty(path)
|
|
13940
|
+
})
|
|
13941
|
+
) ?? [];
|
|
13942
|
+
if (cascadeUpdates) {
|
|
13943
|
+
for (const subscriptionKey in subscribers.current) {
|
|
13944
|
+
if (subscriptionKey.startsWith(`${path}.`) || path.startsWith(`${subscriptionKey}.`)) {
|
|
13945
|
+
result.push(
|
|
13946
|
+
...subscribers.current[subscriptionKey].map(
|
|
13947
|
+
(cb) => (input) => cb({
|
|
13948
|
+
previousValue: getPath(subscriptionKey, input.previousValues),
|
|
13949
|
+
value: getPath(subscriptionKey, input.updatedValues),
|
|
13950
|
+
touched: $status.isTouched(subscriptionKey),
|
|
13951
|
+
dirty: $status.isDirty(subscriptionKey)
|
|
13952
|
+
})
|
|
13953
|
+
)
|
|
13954
|
+
);
|
|
13955
|
+
}
|
|
13956
|
+
}
|
|
13957
|
+
}
|
|
13958
|
+
return result;
|
|
13959
|
+
}, []);
|
|
13960
|
+
return {
|
|
13961
|
+
subscribers,
|
|
13962
|
+
watch,
|
|
13963
|
+
getFieldSubscribers
|
|
13964
|
+
};
|
|
13965
|
+
}
|
|
13966
|
+
|
|
13967
|
+
function getDataPath(formName, fieldPath) {
|
|
13968
|
+
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
13969
|
+
}
|
|
13970
|
+
|
|
13971
|
+
const formRootRule = Symbol("root-rule");
|
|
13972
|
+
function getValidationResults(errors) {
|
|
13973
|
+
const filteredErrors = filterErrors(errors);
|
|
13974
|
+
return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
|
|
13975
|
+
}
|
|
13976
|
+
function validateRulesRecord(rules, values, path = "", errors = {}) {
|
|
13977
|
+
if (typeof rules !== "object" || rules === null) {
|
|
13978
|
+
return errors;
|
|
13979
|
+
}
|
|
13980
|
+
return Object.keys(rules).reduce((acc, ruleKey) => {
|
|
13981
|
+
const rule = rules[ruleKey];
|
|
13982
|
+
const rulePath = `${path === "" ? "" : `${path}.`}${ruleKey}`;
|
|
13983
|
+
const value = getPath(rulePath, values);
|
|
13984
|
+
let arrayValidation = false;
|
|
13985
|
+
if (typeof rule === "function") {
|
|
13986
|
+
acc[rulePath] = rule(value, values, rulePath);
|
|
13987
|
+
}
|
|
13988
|
+
if (typeof rule === "object" && Array.isArray(value)) {
|
|
13989
|
+
arrayValidation = true;
|
|
13990
|
+
value.forEach(
|
|
13991
|
+
(_item, index) => validateRulesRecord(rule, values, `${rulePath}.${index}`, acc)
|
|
13992
|
+
);
|
|
13993
|
+
if (formRootRule in rule) {
|
|
13994
|
+
acc[rulePath] = rule[formRootRule](value, values, rulePath);
|
|
13995
|
+
}
|
|
13996
|
+
}
|
|
13997
|
+
if (typeof rule === "object" && typeof value === "object" && value !== null) {
|
|
13998
|
+
if (!arrayValidation) {
|
|
13999
|
+
validateRulesRecord(rule, values, rulePath, acc);
|
|
14000
|
+
}
|
|
14001
|
+
if (formRootRule in rule) {
|
|
14002
|
+
acc[rulePath] = rule[formRootRule](value, values, rulePath);
|
|
14003
|
+
}
|
|
14004
|
+
}
|
|
14005
|
+
return acc;
|
|
14006
|
+
}, errors);
|
|
14007
|
+
}
|
|
14008
|
+
function validateValues(validate, values) {
|
|
14009
|
+
if (typeof validate === "function") {
|
|
14010
|
+
return getValidationResults(validate(values));
|
|
14011
|
+
}
|
|
14012
|
+
return getValidationResults(validateRulesRecord(validate, values));
|
|
14013
|
+
}
|
|
14014
|
+
|
|
14015
|
+
function validateFieldValue(path, rules, values) {
|
|
14016
|
+
if (typeof path !== "string") {
|
|
14017
|
+
return { hasError: false, error: null };
|
|
14018
|
+
}
|
|
14019
|
+
const results = validateValues(rules, values);
|
|
14020
|
+
const pathInError = Object.keys(results.errors).find(
|
|
14021
|
+
(errorKey) => path.split(".").every((pathPart, i) => pathPart === errorKey.split(".")[i])
|
|
14022
|
+
);
|
|
14023
|
+
return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
|
|
14024
|
+
}
|
|
14025
|
+
|
|
14026
|
+
const FORM_INDEX = "__MANTINE_FORM_INDEX__";
|
|
14027
|
+
|
|
14028
|
+
function shouldValidateOnChange(path, validateInputOnChange) {
|
|
14029
|
+
if (!validateInputOnChange) {
|
|
14030
|
+
return false;
|
|
14031
|
+
}
|
|
14032
|
+
if (typeof validateInputOnChange === "boolean") {
|
|
14033
|
+
return validateInputOnChange;
|
|
14034
|
+
}
|
|
14035
|
+
if (Array.isArray(validateInputOnChange)) {
|
|
14036
|
+
return validateInputOnChange.includes(path.replace(/[.][0-9]+/g, `.${FORM_INDEX}`));
|
|
14037
|
+
}
|
|
14038
|
+
return false;
|
|
14039
|
+
}
|
|
14040
|
+
|
|
14041
|
+
function useForm({
|
|
14042
|
+
name,
|
|
14043
|
+
mode = "controlled",
|
|
14044
|
+
initialValues,
|
|
14045
|
+
initialErrors = {},
|
|
14046
|
+
initialDirty = {},
|
|
14047
|
+
initialTouched = {},
|
|
14048
|
+
clearInputErrorOnChange = true,
|
|
14049
|
+
validateInputOnChange = false,
|
|
14050
|
+
validateInputOnBlur = false,
|
|
14051
|
+
onValuesChange,
|
|
14052
|
+
transformValues = (values) => values,
|
|
14053
|
+
enhanceGetInputProps,
|
|
14054
|
+
validate: rules,
|
|
14055
|
+
onSubmitPreventDefault = "always",
|
|
14056
|
+
touchTrigger = "change",
|
|
14057
|
+
cascadeUpdates = false
|
|
14058
|
+
} = {}) {
|
|
14059
|
+
const $errors = useFormErrors(initialErrors);
|
|
14060
|
+
const $values = useFormValues({ initialValues, onValuesChange, mode });
|
|
14061
|
+
const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
|
|
14062
|
+
const $list = useFormList({ $values, $errors, $status });
|
|
14063
|
+
const $watch = useFormWatch({ $status, cascadeUpdates });
|
|
14064
|
+
const [formKey, setFormKey] = useState(0);
|
|
14065
|
+
const [fieldKeys, setFieldKeys] = useState({});
|
|
14066
|
+
const [submitting, setSubmitting] = useState(false);
|
|
14067
|
+
const reset = useCallback(() => {
|
|
14068
|
+
$values.resetValues();
|
|
14069
|
+
$errors.clearErrors();
|
|
14070
|
+
$status.resetDirty();
|
|
14071
|
+
$status.resetTouched();
|
|
14072
|
+
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
14073
|
+
}, []);
|
|
14074
|
+
const handleValuesChanges = useCallback(
|
|
14075
|
+
(previousValues) => {
|
|
14076
|
+
clearInputErrorOnChange && $errors.clearErrors();
|
|
14077
|
+
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
14078
|
+
Object.keys($watch.subscribers.current).forEach((path) => {
|
|
14079
|
+
const value = getPath(path, $values.refValues.current);
|
|
14080
|
+
const previousValue = getPath(path, previousValues);
|
|
14081
|
+
if (value !== previousValue) {
|
|
14082
|
+
$watch.getFieldSubscribers(path).forEach((cb) => cb({ previousValues, updatedValues: $values.refValues.current }));
|
|
14083
|
+
}
|
|
14084
|
+
});
|
|
14085
|
+
},
|
|
14086
|
+
[clearInputErrorOnChange]
|
|
14087
|
+
);
|
|
14088
|
+
const initialize = useCallback(
|
|
14089
|
+
(values) => {
|
|
14090
|
+
const previousValues = $values.refValues.current;
|
|
14091
|
+
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
14092
|
+
handleValuesChanges(previousValues);
|
|
14093
|
+
},
|
|
14094
|
+
[handleValuesChanges]
|
|
14095
|
+
);
|
|
14096
|
+
const setFieldValue = useCallback(
|
|
14097
|
+
(path, value, options) => {
|
|
14098
|
+
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
14099
|
+
const resolvedValue = value instanceof Function ? value(getPath(path, $values.refValues.current)) : value;
|
|
14100
|
+
$status.setCalculatedFieldDirty(path, resolvedValue);
|
|
14101
|
+
touchTrigger === "change" && $status.setFieldTouched(path, true);
|
|
14102
|
+
!shouldValidate && clearInputErrorOnChange && $errors.clearFieldError(path);
|
|
14103
|
+
$values.setFieldValue({
|
|
14104
|
+
path,
|
|
14105
|
+
value,
|
|
14106
|
+
updateState: mode === "controlled",
|
|
14107
|
+
subscribers: [
|
|
14108
|
+
...$watch.getFieldSubscribers(path),
|
|
14109
|
+
shouldValidate ? (payload) => {
|
|
14110
|
+
const validationResults = validateFieldValue(path, rules, payload.updatedValues);
|
|
14111
|
+
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
14112
|
+
} : null,
|
|
14113
|
+
options?.forceUpdate !== false && mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
14114
|
+
...keys,
|
|
14115
|
+
[path]: (keys[path] || 0) + 1
|
|
14116
|
+
})) : null
|
|
14117
|
+
]
|
|
14118
|
+
});
|
|
14119
|
+
},
|
|
14120
|
+
[onValuesChange, rules]
|
|
14121
|
+
);
|
|
14122
|
+
const setValues = useCallback(
|
|
14123
|
+
(values) => {
|
|
14124
|
+
const previousValues = $values.refValues.current;
|
|
14125
|
+
$values.setValues({ values, updateState: mode === "controlled" });
|
|
14126
|
+
handleValuesChanges(previousValues);
|
|
14127
|
+
},
|
|
14128
|
+
[onValuesChange, handleValuesChanges]
|
|
14129
|
+
);
|
|
14130
|
+
const validate = useCallback(() => {
|
|
14131
|
+
const results = validateValues(rules, $values.refValues.current);
|
|
14132
|
+
$errors.setErrors(results.errors);
|
|
14133
|
+
return results;
|
|
14134
|
+
}, [rules]);
|
|
14135
|
+
const validateField = useCallback(
|
|
14136
|
+
(path) => {
|
|
14137
|
+
const results = validateFieldValue(path, rules, $values.refValues.current);
|
|
14138
|
+
results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
|
|
14139
|
+
return results;
|
|
14140
|
+
},
|
|
14141
|
+
[rules]
|
|
14142
|
+
);
|
|
14143
|
+
const getInputProps = (path, { type = "input", withError = true, withFocus = true, ...otherOptions } = {}) => {
|
|
14144
|
+
const onChange = getInputOnChange(
|
|
14145
|
+
(value) => setFieldValue(path, value, { forceUpdate: false })
|
|
14146
|
+
);
|
|
14147
|
+
const payload = { onChange, "data-path": getDataPath(name, path) };
|
|
14148
|
+
if (withError) {
|
|
14149
|
+
payload.error = $errors.errorsState[path];
|
|
14150
|
+
}
|
|
14151
|
+
if (type === "checkbox") {
|
|
14152
|
+
payload[mode === "controlled" ? "checked" : "defaultChecked"] = getPath(
|
|
14153
|
+
path,
|
|
14154
|
+
$values.refValues.current
|
|
14155
|
+
);
|
|
14156
|
+
} else {
|
|
14157
|
+
payload[mode === "controlled" ? "value" : "defaultValue"] = getPath(
|
|
14158
|
+
path,
|
|
14159
|
+
$values.refValues.current
|
|
14160
|
+
);
|
|
14161
|
+
}
|
|
14162
|
+
if (withFocus) {
|
|
14163
|
+
payload.onFocus = () => $status.setFieldTouched(path, true);
|
|
14164
|
+
payload.onBlur = () => {
|
|
14165
|
+
if (shouldValidateOnChange(path, validateInputOnBlur)) {
|
|
14166
|
+
const validationResults = validateFieldValue(path, rules, $values.refValues.current);
|
|
14167
|
+
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
14168
|
+
}
|
|
14169
|
+
};
|
|
14170
|
+
}
|
|
14171
|
+
return Object.assign(
|
|
14172
|
+
payload,
|
|
14173
|
+
enhanceGetInputProps?.({
|
|
14174
|
+
inputProps: payload,
|
|
14175
|
+
field: path,
|
|
14176
|
+
options: { type, withError, withFocus, ...otherOptions },
|
|
14177
|
+
form
|
|
14178
|
+
})
|
|
14179
|
+
);
|
|
14180
|
+
};
|
|
14181
|
+
const onSubmit = (handleSubmit, handleValidationFailure) => (event) => {
|
|
14182
|
+
if (onSubmitPreventDefault === "always") {
|
|
14183
|
+
event?.preventDefault();
|
|
14184
|
+
}
|
|
14185
|
+
const results = validate();
|
|
14186
|
+
if (results.hasErrors) {
|
|
14187
|
+
if (onSubmitPreventDefault === "validation-failed") {
|
|
14188
|
+
event?.preventDefault();
|
|
14189
|
+
}
|
|
14190
|
+
handleValidationFailure?.(results.errors, $values.refValues.current, event);
|
|
14191
|
+
} else {
|
|
14192
|
+
const submitResult = handleSubmit?.(
|
|
14193
|
+
transformValues($values.refValues.current),
|
|
14194
|
+
event
|
|
14195
|
+
);
|
|
14196
|
+
if (submitResult instanceof Promise) {
|
|
14197
|
+
setSubmitting(true);
|
|
14198
|
+
submitResult.finally(() => setSubmitting(false));
|
|
14199
|
+
}
|
|
14200
|
+
}
|
|
14201
|
+
};
|
|
14202
|
+
const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
|
|
14203
|
+
const onReset = useCallback((event) => {
|
|
14204
|
+
event.preventDefault();
|
|
14205
|
+
reset();
|
|
14206
|
+
}, []);
|
|
14207
|
+
const isValid = useCallback(
|
|
14208
|
+
(path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
|
|
14209
|
+
[rules]
|
|
14210
|
+
);
|
|
14211
|
+
const key = (path) => `${formKey}-${String(path)}-${fieldKeys[String(path)] || 0}`;
|
|
14212
|
+
const getInputNode = useCallback(
|
|
14213
|
+
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
14214
|
+
[]
|
|
14215
|
+
);
|
|
14216
|
+
const resetField = useCallback(
|
|
14217
|
+
(path) => {
|
|
14218
|
+
$values.resetField(path, [
|
|
14219
|
+
mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
14220
|
+
...keys,
|
|
14221
|
+
[path]: (keys[path] || 0) + 1
|
|
14222
|
+
})) : null
|
|
14223
|
+
]);
|
|
14224
|
+
},
|
|
14225
|
+
[$values.resetField, mode, setFieldKeys]
|
|
14226
|
+
);
|
|
14227
|
+
const form = {
|
|
14228
|
+
watch: $watch.watch,
|
|
14229
|
+
initialized: $values.initialized.current,
|
|
14230
|
+
values: mode === "uncontrolled" ? $values.refValues.current : $values.stateValues,
|
|
14231
|
+
getValues: $values.getValues,
|
|
14232
|
+
getInitialValues: $values.getValuesSnapshot,
|
|
14233
|
+
setInitialValues: $values.setValuesSnapshot,
|
|
14234
|
+
resetField,
|
|
14235
|
+
initialize,
|
|
14236
|
+
setValues,
|
|
14237
|
+
setFieldValue,
|
|
14238
|
+
submitting,
|
|
14239
|
+
setSubmitting,
|
|
14240
|
+
errors: $errors.errorsState,
|
|
14241
|
+
setErrors: $errors.setErrors,
|
|
14242
|
+
setFieldError: $errors.setFieldError,
|
|
14243
|
+
clearFieldError: $errors.clearFieldError,
|
|
14244
|
+
clearErrors: $errors.clearErrors,
|
|
14245
|
+
resetDirty: $status.resetDirty,
|
|
14246
|
+
setTouched: $status.setTouched,
|
|
14247
|
+
setDirty: $status.setDirty,
|
|
14248
|
+
isTouched: $status.isTouched,
|
|
14249
|
+
resetTouched: $status.resetTouched,
|
|
14250
|
+
isDirty: $status.isDirty,
|
|
14251
|
+
getTouched: $status.getTouched,
|
|
14252
|
+
getDirty: $status.getDirty,
|
|
14253
|
+
reorderListItem: $list.reorderListItem,
|
|
14254
|
+
insertListItem: $list.insertListItem,
|
|
14255
|
+
removeListItem: $list.removeListItem,
|
|
14256
|
+
replaceListItem: $list.replaceListItem,
|
|
14257
|
+
reset,
|
|
14258
|
+
validate,
|
|
14259
|
+
validateField,
|
|
14260
|
+
getInputProps,
|
|
14261
|
+
onSubmit,
|
|
14262
|
+
onReset,
|
|
14263
|
+
isValid,
|
|
14264
|
+
getTransformedValues,
|
|
14265
|
+
key,
|
|
14266
|
+
getInputNode
|
|
14267
|
+
};
|
|
14268
|
+
useFormActions(name, form);
|
|
14269
|
+
return form;
|
|
14270
|
+
}
|
|
14271
|
+
|
|
14272
|
+
const _excluded$1 = ["fields", "isEditable", "layout", "hasSubmit", "hasReset"];
|
|
14273
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14274
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13231
14275
|
const SimpleForm = _ref => {
|
|
13232
14276
|
let {
|
|
13233
14277
|
fields,
|
|
13234
14278
|
isEditable = true,
|
|
13235
|
-
layout = []
|
|
13236
|
-
|
|
13237
|
-
|
|
14279
|
+
layout = [],
|
|
14280
|
+
hasSubmit,
|
|
14281
|
+
hasReset
|
|
14282
|
+
} = _ref,
|
|
14283
|
+
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
13238
14284
|
const components = {
|
|
13239
14285
|
Textarea: Textarea,
|
|
13240
14286
|
TextInput: TextInput,
|
|
13241
14287
|
PasswordInput: PasswordInput,
|
|
13242
14288
|
NumberInput: NumberInput
|
|
13243
14289
|
};
|
|
14290
|
+
const form = useForm({
|
|
14291
|
+
mode: "uncontrolled",
|
|
14292
|
+
initialValues: () => {
|
|
14293
|
+
const localInitialValues = {};
|
|
14294
|
+
fields.forEach((field, index) => {
|
|
14295
|
+
if (typeof field === "string") {
|
|
14296
|
+
const sanitizedField = santize(field);
|
|
14297
|
+
localInitialValues[sanitizedField.name] = "";
|
|
14298
|
+
}
|
|
14299
|
+
if (typeof field === "object" && Object.keys(components).includes(field.component)) {
|
|
14300
|
+
var _field$field;
|
|
14301
|
+
const sanitizedField = santize((_field$field = field.field) !== null && _field$field !== void 0 ? _field$field : "");
|
|
14302
|
+
localInitialValues[sanitizedField.name] = "";
|
|
14303
|
+
}
|
|
14304
|
+
});
|
|
14305
|
+
return _objectSpread$1(_objectSpread$1({}, localInitialValues), rest.initialValues);
|
|
14306
|
+
},
|
|
14307
|
+
validate: rest.formValidate
|
|
14308
|
+
});
|
|
13244
14309
|
const indexDiff = fields.length - layout.length;
|
|
13245
14310
|
layout.push(...Array(indexDiff).fill(12));
|
|
13246
14311
|
const inputProps = {
|
|
@@ -13254,29 +14319,47 @@ const SimpleForm = _ref => {
|
|
|
13254
14319
|
variant: !isEditable ? "unstyled" : "default",
|
|
13255
14320
|
required: true
|
|
13256
14321
|
};
|
|
13257
|
-
return /*#__PURE__*/React.createElement(
|
|
14322
|
+
return /*#__PURE__*/React.createElement("form", {
|
|
14323
|
+
onSubmit: form.onSubmit(values => {
|
|
14324
|
+
var _rest$onSubmit;
|
|
14325
|
+
return hasSubmit ? (_rest$onSubmit = rest.onSubmit) === null || _rest$onSubmit === void 0 ? void 0 : _rest$onSubmit.call(rest, values) : void 0;
|
|
14326
|
+
}),
|
|
14327
|
+
onReset: form.reset,
|
|
14328
|
+
style: {
|
|
14329
|
+
height: "100%"
|
|
14330
|
+
}
|
|
14331
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
14332
|
+
h: "100%"
|
|
14333
|
+
}, /*#__PURE__*/React.createElement(Grid, null, fields.map((field, index) => {
|
|
13258
14334
|
if (typeof field === "string") {
|
|
14335
|
+
const sanitizedField = santize(field);
|
|
13259
14336
|
return /*#__PURE__*/React.createElement(Grid.Col, {
|
|
13260
14337
|
key: index,
|
|
13261
14338
|
span: layout[index]
|
|
13262
|
-
}, /*#__PURE__*/React.createElement(TextInput, _extends({}, inputProps,
|
|
14339
|
+
}, /*#__PURE__*/React.createElement(TextInput, _extends({}, inputProps, sanitizedField, form.getInputProps(sanitizedField.name))));
|
|
13263
14340
|
}
|
|
13264
14341
|
if (typeof field === "function") {
|
|
13265
14342
|
return /*#__PURE__*/React.createElement(Grid.Col, {
|
|
13266
14343
|
key: index,
|
|
13267
14344
|
span: layout[index]
|
|
13268
|
-
}, field());
|
|
14345
|
+
}, field(form.getInputProps));
|
|
13269
14346
|
}
|
|
13270
|
-
if (
|
|
13271
|
-
var _field$
|
|
14347
|
+
if (Object.keys(components).includes(field.component)) {
|
|
14348
|
+
var _field$field2;
|
|
13272
14349
|
const Component = components[field.component];
|
|
14350
|
+
const sanitizedField = santize((_field$field2 = field.field) !== null && _field$field2 !== void 0 ? _field$field2 : "");
|
|
13273
14351
|
return /*#__PURE__*/React.createElement(Grid.Col, {
|
|
13274
14352
|
key: index,
|
|
13275
14353
|
span: layout[index]
|
|
13276
|
-
}, /*#__PURE__*/React.createElement(Component, _extends({}, field.field, inputProps,
|
|
14354
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({}, field.field, inputProps, sanitizedField, form.getInputProps(sanitizedField.name))));
|
|
13277
14355
|
}
|
|
13278
14356
|
return null;
|
|
13279
|
-
}))
|
|
14357
|
+
})), /*#__PURE__*/React.createElement(Space, {
|
|
14358
|
+
flex: 1
|
|
14359
|
+
}), /*#__PURE__*/React.createElement(FormButtons, {
|
|
14360
|
+
hasSubmit,
|
|
14361
|
+
hasReset
|
|
14362
|
+
})));
|
|
13280
14363
|
};
|
|
13281
14364
|
const santize = field => {
|
|
13282
14365
|
var _ref2, _field$label, _field$placeholder, _field$name, _field$name$split$joi, _field$name2;
|
|
@@ -13294,6 +14377,130 @@ const santize = field => {
|
|
|
13294
14377
|
name: (_field$name$split$joi = (_field$name2 = field.name) === null || _field$name2 === void 0 ? void 0 : _field$name2.split(" ").join("_").toLowerCase()) !== null && _field$name$split$joi !== void 0 ? _field$name$split$joi : ""
|
|
13295
14378
|
};
|
|
13296
14379
|
};
|
|
14380
|
+
const FormButtons = _ref3 => {
|
|
14381
|
+
let {
|
|
14382
|
+
hasSubmit = false,
|
|
14383
|
+
hasReset = false
|
|
14384
|
+
} = _ref3;
|
|
14385
|
+
return /*#__PURE__*/React.createElement(Group, {
|
|
14386
|
+
justify: "flex-end",
|
|
14387
|
+
grow: true,
|
|
14388
|
+
gap: 10,
|
|
14389
|
+
w: "100%",
|
|
14390
|
+
display: hasSubmit || hasReset ? "flex" : "none"
|
|
14391
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
14392
|
+
leftSection: /*#__PURE__*/React.createElement(Icons, {
|
|
14393
|
+
name: "CloseCircle",
|
|
14394
|
+
size: 16
|
|
14395
|
+
}),
|
|
14396
|
+
variant: "filled",
|
|
14397
|
+
color: "red",
|
|
14398
|
+
size: "lg",
|
|
14399
|
+
radius: "xl",
|
|
14400
|
+
miw: "25%",
|
|
14401
|
+
type: "reset",
|
|
14402
|
+
style: {
|
|
14403
|
+
display: hasReset ? "block" : "none"
|
|
14404
|
+
},
|
|
14405
|
+
flex: 1
|
|
14406
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
14407
|
+
fw: 400,
|
|
14408
|
+
fz: "sm",
|
|
14409
|
+
c: "white"
|
|
14410
|
+
}, "Cancel")), /*#__PURE__*/React.createElement(Button, {
|
|
14411
|
+
leftSection: /*#__PURE__*/React.createElement(Icons, {
|
|
14412
|
+
name: "TickCircle",
|
|
14413
|
+
size: 16
|
|
14414
|
+
}),
|
|
14415
|
+
variant: "filled",
|
|
14416
|
+
color: "adiba.5",
|
|
14417
|
+
size: "lg",
|
|
14418
|
+
radius: "xl",
|
|
14419
|
+
miw: "25%",
|
|
14420
|
+
type: "submit",
|
|
14421
|
+
style: {
|
|
14422
|
+
display: hasSubmit ? "block" : "none"
|
|
14423
|
+
},
|
|
14424
|
+
flex: 1
|
|
14425
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
14426
|
+
fw: 300,
|
|
14427
|
+
fz: "sm",
|
|
14428
|
+
c: "white"
|
|
14429
|
+
}, "Save")));
|
|
14430
|
+
};
|
|
14431
|
+
|
|
14432
|
+
const MaskedTilePanel = _ref => {
|
|
14433
|
+
let {
|
|
14434
|
+
label,
|
|
14435
|
+
value,
|
|
14436
|
+
icon,
|
|
14437
|
+
onMasked = () => true
|
|
14438
|
+
} = _ref;
|
|
14439
|
+
const [masked, toggle] = useToggle();
|
|
14440
|
+
const name = masked ? "Eye" : "EyeSlash";
|
|
14441
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
14442
|
+
p: "md",
|
|
14443
|
+
bg: "gray.0",
|
|
14444
|
+
style: {
|
|
14445
|
+
borderRadius: "10px"
|
|
14446
|
+
}
|
|
14447
|
+
}, /*#__PURE__*/React.createElement(Group, {
|
|
14448
|
+
justify: "space-between"
|
|
14449
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
14450
|
+
gap: 0,
|
|
14451
|
+
p: 0
|
|
14452
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
14453
|
+
fz: "sm",
|
|
14454
|
+
fw: 300,
|
|
14455
|
+
p: 0,
|
|
14456
|
+
c: "gray.7"
|
|
14457
|
+
}, label), /*#__PURE__*/React.createElement(TextInput, {
|
|
14458
|
+
type: masked ? "password" : "text",
|
|
14459
|
+
fw: 300,
|
|
14460
|
+
p: 0,
|
|
14461
|
+
c: "adiba",
|
|
14462
|
+
value: value,
|
|
14463
|
+
variant: "unstyled",
|
|
14464
|
+
readOnly: true
|
|
14465
|
+
})), /*#__PURE__*/React.createElement(ActionIcon, {
|
|
14466
|
+
variant: "transparent",
|
|
14467
|
+
onClick: () => onMasked() ? toggle() : void 0
|
|
14468
|
+
}, icon && /*#__PURE__*/React.createElement(Icons, {
|
|
14469
|
+
size: 24,
|
|
14470
|
+
color: "gray",
|
|
14471
|
+
name: name
|
|
14472
|
+
}))));
|
|
14473
|
+
};
|
|
14474
|
+
const TilePanel = _ref2 => {
|
|
14475
|
+
let {
|
|
14476
|
+
label,
|
|
14477
|
+
value
|
|
14478
|
+
} = _ref2;
|
|
14479
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
14480
|
+
p: "md",
|
|
14481
|
+
bg: "gray.0",
|
|
14482
|
+
style: {
|
|
14483
|
+
borderRadius: "10px"
|
|
14484
|
+
}
|
|
14485
|
+
}, /*#__PURE__*/React.createElement(Group, {
|
|
14486
|
+
justify: "space-between"
|
|
14487
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
14488
|
+
gap: 0,
|
|
14489
|
+
p: 0
|
|
14490
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
14491
|
+
fz: "sm",
|
|
14492
|
+
fw: 300,
|
|
14493
|
+
p: 0,
|
|
14494
|
+
c: "gray.7"
|
|
14495
|
+
}, label), /*#__PURE__*/React.createElement(TextInput, {
|
|
14496
|
+
fw: 300,
|
|
14497
|
+
p: 0,
|
|
14498
|
+
c: "adiba",
|
|
14499
|
+
value: value,
|
|
14500
|
+
variant: "unstyled",
|
|
14501
|
+
readOnly: true
|
|
14502
|
+
}))));
|
|
14503
|
+
};
|
|
13297
14504
|
|
|
13298
14505
|
var ConfirmAnimation = "data:null;base64,UEsDBBQAAAAIAEoK11qAribJgAAAALUAAAANAAAAbWFuaWZlc3QuanNvbo2OwQ7CIBBE/2XPUoFI0vbUH/ALjIcNUMVQ1sBqYpr+u+vFc28zk3mZWeEda0tUYAQDB7jFEisyVfFTIM7EnOLxr9SjTaaznZYuvvi+r1jSgiwjDcbLCikI471Dh1YrN2CvTrO3qrcW1WyM14O2Ev/+PDN+zhSiEIXqghm26/YFUEsDBBQAAAAIAEoK11olD9QhehoAAFmNAQA0AAAAYW5pbWF0aW9ucy9jYzVhNWEyMC01OWE4LTRmYzItODIyYS1mMTFjMDkwMjU5YTEuanNvbtXdzXLjWHIF4FfRYM2iibyZeUmtPP+rjuhwO2ZT0eFgS6yWpiSxguTMuKOiVn4Yv4f9Ys4LAqBUjWsXcc7GMT0FiWQmgIsDguQHgZ+bl+fmttl+OO0O/7Z/eNk3i+b+/r65XS2ah+ZWWl00/4ipxu/Pu9O2uf3c/BwF//y0P50edx8en3bHfzrt908fH0/v/nq8WS3Fl23zZdE8bX/ZHY7N7fvPzemX5jb6dHP6zc3d/uW0P7zsjzGr46G5bWNyam7fpXjI/lNzm1tfNI/xg8T0IRblw/bpuLss1k/Rpizd9vjd9vhxvHu7727+GLP83HTLGf+UG2IR2iyxXIt3KstVSovVjzGDf485x2IOD4+lKI/83ESbz03cuVq2nhdNLPoqHvY43rqOBuXWvvj9arFatKvSMlZC/MsCbZGvafFutVypTPZZV/osV+s02av7abLVptYqfvo/W7WytMX5n6FhipW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AAUAAAACABKCtdagK4myYAAAAC1AAAADQAAAAAAAAAAAAAAAAAAAAAAbWFuaWZlc3QuanNvblBLAQIUABQAAAAIAEoK11olD9QhehoAAFmNAQA0AAAAAAAAAAAAAAAAAKsAAABhbmltYXRpb25zL2NjNWE1YTIwLTU5YTgtNGZjMi04MjJhLWYxMWMwOTAyNTlhMS5qc29uUEsFBgAAAAACAAIAnQAAAHcbAAAAAA==";
|
|
13299
14506
|
|
|
@@ -13467,4 +14674,4 @@ const useManagedModals = () => {
|
|
|
13467
14674
|
};
|
|
13468
14675
|
};
|
|
13469
14676
|
|
|
13470
|
-
export { ApplicationMenu, ApplicationPanel, AvatarLabelPanel, ConnectionPanel, DonutChart, Drawer, DynamicLogo, DynamicShigaLogo, EqualizerColumn, ErrorModal, File, Icons, InfoModal, LabelPanel, PageTitle, PaymentMethod, PaymentMethodAdd, SearchPanel, SideMenu, SimpleArea, SimpleColumn, SimpleForm, SimpleModal, SimplePanel, SimpleTable, SimpleText, StackedColumn, SubscriptionPlans, SuccessModal, TitleWithIndex, TitledPanel, TwoFactorModal, UserMenu, theme, useManagedModals, useModal };
|
|
14677
|
+
export { ApplicationMenu, ApplicationPanel, AvatarLabelPanel, ConnectionPanel, DonutChart, Drawer, DynamicLogo, DynamicShigaLogo, EqualizerColumn, ErrorModal, File, Icons, InfoModal, LabelPanel, MaskedTilePanel, PageTitle, PaymentMethod, PaymentMethodAdd, SearchPanel, SideMenu, SimpleArea, SimpleColumn, SimpleForm, SimpleModal, SimplePanel, SimpleTable, SimpleText, StackedColumn, SubscriptionPlans, SuccessModal, TilePanel, TitleWithIndex, TitledPanel, TwoFactorModal, UserMenu, theme, useManagedModals, useModal };
|