@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
|
@@ -11342,8 +11342,8 @@ const createAreaFillGradient = function (baseColor) {
|
|
|
11342
11342
|
};
|
|
11343
11343
|
};
|
|
11344
11344
|
|
|
11345
|
-
function ownKeys$
|
|
11346
|
-
function _objectSpread$
|
|
11345
|
+
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; }
|
|
11346
|
+
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; }
|
|
11347
11347
|
|
|
11348
11348
|
// Initialize Highcharts with rounded corners
|
|
11349
11349
|
if (typeof window !== "undefined") {
|
|
@@ -11352,8 +11352,8 @@ if (typeof window !== "undefined") {
|
|
|
11352
11352
|
const Column = props => {
|
|
11353
11353
|
const chartRef = React.useRef(null);
|
|
11354
11354
|
const chartOptions = React.useMemo(() => {
|
|
11355
|
-
const column = _objectSpread$
|
|
11356
|
-
return _objectSpread$
|
|
11355
|
+
const column = _objectSpread$5({}, props);
|
|
11356
|
+
return _objectSpread$5(_objectSpread$5({}, initChart$2(column)), initSeries$2(column));
|
|
11357
11357
|
}, [props]);
|
|
11358
11358
|
React.useEffect(() => {
|
|
11359
11359
|
if (chartRef.current && chartRef.current.chart) {
|
|
@@ -11456,7 +11456,7 @@ const initSeries$2 = props => {
|
|
|
11456
11456
|
enableMouseTracking: false,
|
|
11457
11457
|
showInLegend: false
|
|
11458
11458
|
});
|
|
11459
|
-
const mainSeries = _objectSpread$
|
|
11459
|
+
const mainSeries = _objectSpread$5(_objectSpread$5({}, fillSeries(boundary)), {
|
|
11460
11460
|
name: props.yAxisLabel[0],
|
|
11461
11461
|
color: seriesColors ? seriesColors[0] : "gray",
|
|
11462
11462
|
data: seriesData[0],
|
|
@@ -11496,7 +11496,7 @@ const initSeries$2 = props => {
|
|
|
11496
11496
|
pointWidth: undefined
|
|
11497
11497
|
}
|
|
11498
11498
|
};
|
|
11499
|
-
const plot = _objectSpread$
|
|
11499
|
+
const plot = _objectSpread$5(_objectSpread$5({}, {
|
|
11500
11500
|
column: {
|
|
11501
11501
|
borderWidth: 0,
|
|
11502
11502
|
borderRadius: 10
|
|
@@ -11551,13 +11551,13 @@ const initChart$1 = props => {
|
|
|
11551
11551
|
};
|
|
11552
11552
|
};
|
|
11553
11553
|
|
|
11554
|
-
function ownKeys$
|
|
11555
|
-
function _objectSpread$
|
|
11554
|
+
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; }
|
|
11555
|
+
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; }
|
|
11556
11556
|
const Area = props => {
|
|
11557
11557
|
const chartRef = React.useRef(null);
|
|
11558
11558
|
const chartOptions = React.useMemo(() => {
|
|
11559
|
-
const area = _objectSpread$
|
|
11560
|
-
return _objectSpread$
|
|
11559
|
+
const area = _objectSpread$4({}, props);
|
|
11560
|
+
return _objectSpread$4(_objectSpread$4({}, initChart$1(area)), initSeries$1(area));
|
|
11561
11561
|
}, [props]);
|
|
11562
11562
|
React.useEffect(() => {
|
|
11563
11563
|
if (chartRef.current && chartRef.current.chart) {
|
|
@@ -11618,7 +11618,7 @@ const initSeries$1 = props => {
|
|
|
11618
11618
|
const labels = {
|
|
11619
11619
|
color: "#575E77"
|
|
11620
11620
|
};
|
|
11621
|
-
return _objectSpread$
|
|
11621
|
+
return _objectSpread$4(_objectSpread$4({}, defaults), {
|
|
11622
11622
|
labels
|
|
11623
11623
|
});
|
|
11624
11624
|
};
|
|
@@ -11656,8 +11656,8 @@ const initSeries$1 = props => {
|
|
|
11656
11656
|
};
|
|
11657
11657
|
|
|
11658
11658
|
const _excluded$c = ["withLegend", "centerLabel", "centerValue"];
|
|
11659
|
-
function ownKeys$
|
|
11660
|
-
function _objectSpread$
|
|
11659
|
+
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; }
|
|
11660
|
+
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; }
|
|
11661
11661
|
const initChart = _ref => {
|
|
11662
11662
|
let {
|
|
11663
11663
|
withLegend,
|
|
@@ -11707,7 +11707,7 @@ const initChart = _ref => {
|
|
|
11707
11707
|
},
|
|
11708
11708
|
legend: !withLegend ? {
|
|
11709
11709
|
enabled: false
|
|
11710
|
-
} : _objectSpread$
|
|
11710
|
+
} : _objectSpread$3(_objectSpread$3({}, {
|
|
11711
11711
|
enabled: true,
|
|
11712
11712
|
layout: "vertical",
|
|
11713
11713
|
verticalAlign: "middle",
|
|
@@ -11740,13 +11740,13 @@ const initChart = _ref => {
|
|
|
11740
11740
|
};
|
|
11741
11741
|
};
|
|
11742
11742
|
|
|
11743
|
-
function ownKeys$
|
|
11744
|
-
function _objectSpread$
|
|
11743
|
+
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; }
|
|
11744
|
+
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; }
|
|
11745
11745
|
const DonutChart = props => {
|
|
11746
11746
|
const chartRef = React.useRef(null);
|
|
11747
11747
|
const chartOptions = React.useMemo(() => {
|
|
11748
|
-
const area = _objectSpread$
|
|
11749
|
-
return _objectSpread$
|
|
11748
|
+
const area = _objectSpread$2({}, props);
|
|
11749
|
+
return _objectSpread$2(_objectSpread$2({}, initChart(area)), initSeries(area));
|
|
11750
11750
|
}, [props]);
|
|
11751
11751
|
React.useEffect(() => {
|
|
11752
11752
|
if (chartRef.current && chartRef.current.chart) {
|
|
@@ -12376,25 +12376,6 @@ const SimpleText = _ref => {
|
|
|
12376
12376
|
}, rest), label);
|
|
12377
12377
|
};
|
|
12378
12378
|
|
|
12379
|
-
const theme = core.createTheme({
|
|
12380
|
-
focusRing: "never",
|
|
12381
|
-
colors: {
|
|
12382
|
-
adiba: ["#E7E8EB", "#CFD1D8", "#B7BAC4", "#9FA3B1", "#575E77", "#273050", "#0f193d", "#0D1636", "#0C1430", "#0A112A"],
|
|
12383
|
-
altiba: ["#F4E2CE", "#EED4B5", "#E9C59D", "#D89A54", "#D38C3B", "#CD7E23", "#c8700b", "#B46409", "#A05908", "#8C4E07"]
|
|
12384
|
-
},
|
|
12385
|
-
fontFamily: "Poppins",
|
|
12386
|
-
headings: {
|
|
12387
|
-
fontFamily: "Poppins",
|
|
12388
|
-
fontWeight: "500"
|
|
12389
|
-
},
|
|
12390
|
-
primaryColor: "adiba",
|
|
12391
|
-
other: {
|
|
12392
|
-
fontWeights: {
|
|
12393
|
-
normal: 300
|
|
12394
|
-
}
|
|
12395
|
-
}
|
|
12396
|
-
});
|
|
12397
|
-
|
|
12398
12379
|
const _excluded$6 = ["createFn", "icon", "label"];
|
|
12399
12380
|
const PageTitle = _ref => {
|
|
12400
12381
|
var _switcher$items;
|
|
@@ -12428,8 +12409,7 @@ const PageTitle = _ref => {
|
|
|
12428
12409
|
rightsection = /*#__PURE__*/React.createElement(core.SegmentedControl, {
|
|
12429
12410
|
size: "sm",
|
|
12430
12411
|
bg: "white",
|
|
12431
|
-
|
|
12432
|
-
color: theme.primaryColor,
|
|
12412
|
+
color: 'adiba',
|
|
12433
12413
|
data: switcher.items
|
|
12434
12414
|
});
|
|
12435
12415
|
}
|
|
@@ -13065,6 +13045,25 @@ const File = _ref => {
|
|
|
13065
13045
|
}, /*#__PURE__*/React.createElement(Icons, rightsection === null || rightsection === void 0 ? void 0 : rightsection.icon)) : undefined)));
|
|
13066
13046
|
};
|
|
13067
13047
|
|
|
13048
|
+
const theme = core.createTheme({
|
|
13049
|
+
focusRing: "never",
|
|
13050
|
+
colors: {
|
|
13051
|
+
adiba: ["#E7E8EB", "#CFD1D8", "#B7BAC4", "#9FA3B1", "#575E77", "#273050", "#0f193d", "#0D1636", "#0C1430", "#0A112A"],
|
|
13052
|
+
altiba: ["#F4E2CE", "#EED4B5", "#E9C59D", "#D89A54", "#D38C3B", "#CD7E23", "#c8700b", "#B46409", "#A05908", "#8C4E07"]
|
|
13053
|
+
},
|
|
13054
|
+
fontFamily: "Poppins",
|
|
13055
|
+
headings: {
|
|
13056
|
+
fontFamily: "Poppins",
|
|
13057
|
+
fontWeight: "500"
|
|
13058
|
+
},
|
|
13059
|
+
primaryColor: "adiba",
|
|
13060
|
+
other: {
|
|
13061
|
+
fontWeights: {
|
|
13062
|
+
normal: 300
|
|
13063
|
+
}
|
|
13064
|
+
}
|
|
13065
|
+
});
|
|
13066
|
+
|
|
13068
13067
|
var ErrorAnimation = "data:null;base64,UEsDBBQAAAAIAEC21lqNk9Q5gAAAALUAAAANAAAAbWFuaWZlc3QuanNvbo2NQQ7CIBBF7zJrqYCk2K56AU9gXIyFKoYyBkYT0/Tu4sZ1d/8n7+Ut8Pa5BErQg4Id3HzyGZly/YMjjsQc/P6/xKMMqtGNrCy++L4NTGFGrpEC/XmB4KpjtTsaPV6FVG0rjEUUne0mMaFDHKVCc/ipz4ifEzlfjUR5xgjrZf0CUEsDBBQAAAAIAEC21loISOBs8wYAAK1lAAA0AAAAYW5pbWF0aW9ucy83MmQ4NDJjYi0wMTY2LTQ3YWEtOTc5Zi1mYWRhYWMwMWE0MzAuanNvbu1cW2/iRhT+K2iebcsz4ytvvb+0UqVWfUHRik3IhoYAAnpZRfnv/c7MGMZgE5wGyrpHK8Zk7ufzOd98M2b9LP4UQ5FEWaRFIO5XYqiSQEyXYhgHYoGLkoH4Swy1wt8P7jp/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10uxINHlQivEjhR0qvCzAbPB2P/WKm/rp7Tkz5dgsOog+ZJnMjauY6Ie1twmnk0AH4/om5d/AFBLAQIUABQAAAAIAEC21lqNk9Q5gAAAALUAAAANAAAAAAAAAAAAAAAAAAAAAABtYW5pZmVzdC5qc29uUEsBAhQAFAAAAAgAQLbWWghI4GzzBgAArWUAADQAAAAAAAAAAAAAAAAAqwAAAGFuaW1hdGlvbnMvNzJkODQyY2ItMDE2Ni00N2FhLTk3OWYtZmFkYWFjMDFhNDMwLmpzb25QSwUGAAAAAAIAAgCdAAAA8AcAAAAA";
|
|
13069
13068
|
|
|
13070
13069
|
const ErrorModal = _ref => {
|
|
@@ -13248,20 +13247,1086 @@ const Drawer = _ref => {
|
|
|
13248
13247
|
}, page))));
|
|
13249
13248
|
};
|
|
13250
13249
|
|
|
13251
|
-
|
|
13250
|
+
function validateFormName(name) {
|
|
13251
|
+
if (!/^[0-9a-zA-Z-]+$/.test(name)) {
|
|
13252
|
+
throw new Error(
|
|
13253
|
+
`[@mantine/use-form] Form name "${name}" is invalid, it should contain only letters, numbers and dashes`
|
|
13254
|
+
);
|
|
13255
|
+
}
|
|
13256
|
+
}
|
|
13257
|
+
const useIsomorphicEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
13258
|
+
function useFormEvent(eventKey, handler) {
|
|
13259
|
+
useIsomorphicEffect(() => {
|
|
13260
|
+
if (eventKey) {
|
|
13261
|
+
window.addEventListener(eventKey, handler);
|
|
13262
|
+
return () => window.removeEventListener(eventKey, handler);
|
|
13263
|
+
}
|
|
13264
|
+
return void 0;
|
|
13265
|
+
}, [eventKey]);
|
|
13266
|
+
}
|
|
13267
|
+
function useFormActions(name, form) {
|
|
13268
|
+
if (name) {
|
|
13269
|
+
validateFormName(name);
|
|
13270
|
+
}
|
|
13271
|
+
useFormEvent(
|
|
13272
|
+
`mantine-form:${name}:set-field-value`,
|
|
13273
|
+
(event) => form.setFieldValue(event.detail.path, event.detail.value)
|
|
13274
|
+
);
|
|
13275
|
+
useFormEvent(
|
|
13276
|
+
`mantine-form:${name}:set-values`,
|
|
13277
|
+
(event) => form.setValues(event.detail)
|
|
13278
|
+
);
|
|
13279
|
+
useFormEvent(
|
|
13280
|
+
`mantine-form:${name}:set-initial-values`,
|
|
13281
|
+
(event) => form.setInitialValues(event.detail)
|
|
13282
|
+
);
|
|
13283
|
+
useFormEvent(
|
|
13284
|
+
`mantine-form:${name}:set-errors`,
|
|
13285
|
+
(event) => form.setErrors(event.detail)
|
|
13286
|
+
);
|
|
13287
|
+
useFormEvent(
|
|
13288
|
+
`mantine-form:${name}:set-field-error`,
|
|
13289
|
+
(event) => form.setFieldError(event.detail.path, event.detail.error)
|
|
13290
|
+
);
|
|
13291
|
+
useFormEvent(
|
|
13292
|
+
`mantine-form:${name}:clear-field-error`,
|
|
13293
|
+
(event) => form.clearFieldError(event.detail)
|
|
13294
|
+
);
|
|
13295
|
+
useFormEvent(`mantine-form:${name}:clear-errors`, form.clearErrors);
|
|
13296
|
+
useFormEvent(`mantine-form:${name}:reset`, form.reset);
|
|
13297
|
+
useFormEvent(`mantine-form:${name}:validate`, form.validate);
|
|
13298
|
+
useFormEvent(
|
|
13299
|
+
`mantine-form:${name}:validate-field`,
|
|
13300
|
+
(event) => form.validateField(event.detail)
|
|
13301
|
+
);
|
|
13302
|
+
useFormEvent(
|
|
13303
|
+
`mantine-form:${name}:reorder-list-item`,
|
|
13304
|
+
(event) => form.reorderListItem(event.detail.path, event.detail.payload)
|
|
13305
|
+
);
|
|
13306
|
+
useFormEvent(
|
|
13307
|
+
`mantine-form:${name}:remove-list-item`,
|
|
13308
|
+
(event) => form.removeListItem(event.detail.path, event.detail.index)
|
|
13309
|
+
);
|
|
13310
|
+
useFormEvent(
|
|
13311
|
+
`mantine-form:${name}:insert-list-item`,
|
|
13312
|
+
(event) => form.insertListItem(event.detail.path, event.detail.item, event.detail.index)
|
|
13313
|
+
);
|
|
13314
|
+
useFormEvent(
|
|
13315
|
+
`mantine-form:${name}:set-dirty`,
|
|
13316
|
+
(event) => form.setDirty(event.detail)
|
|
13317
|
+
);
|
|
13318
|
+
useFormEvent(
|
|
13319
|
+
`mantine-form:${name}:set-touched`,
|
|
13320
|
+
(event) => form.setTouched(event.detail)
|
|
13321
|
+
);
|
|
13322
|
+
useFormEvent(
|
|
13323
|
+
`mantine-form:${name}:reset-dirty`,
|
|
13324
|
+
(event) => form.resetDirty(event.detail)
|
|
13325
|
+
);
|
|
13326
|
+
useFormEvent(`mantine-form:${name}:reset-touched`, form.resetTouched);
|
|
13327
|
+
}
|
|
13328
|
+
|
|
13329
|
+
function getInputOnChange(setValue) {
|
|
13330
|
+
return (val) => {
|
|
13331
|
+
if (!val) {
|
|
13332
|
+
setValue(val);
|
|
13333
|
+
} else if (typeof val === "function") {
|
|
13334
|
+
setValue(val);
|
|
13335
|
+
} else if (typeof val === "object" && "nativeEvent" in val) {
|
|
13336
|
+
const { currentTarget } = val;
|
|
13337
|
+
if (currentTarget instanceof HTMLInputElement) {
|
|
13338
|
+
if (currentTarget.type === "checkbox") {
|
|
13339
|
+
setValue(currentTarget.checked);
|
|
13340
|
+
} else {
|
|
13341
|
+
setValue(currentTarget.value);
|
|
13342
|
+
}
|
|
13343
|
+
} else if (currentTarget instanceof HTMLTextAreaElement || currentTarget instanceof HTMLSelectElement) {
|
|
13344
|
+
setValue(currentTarget.value);
|
|
13345
|
+
}
|
|
13346
|
+
} else {
|
|
13347
|
+
setValue(val);
|
|
13348
|
+
}
|
|
13349
|
+
};
|
|
13350
|
+
}
|
|
13351
|
+
|
|
13352
|
+
function filterErrors(errors) {
|
|
13353
|
+
if (errors === null || typeof errors !== "object") {
|
|
13354
|
+
return {};
|
|
13355
|
+
}
|
|
13356
|
+
return Object.keys(errors).reduce((acc, key) => {
|
|
13357
|
+
const errorValue = errors[key];
|
|
13358
|
+
if (errorValue !== void 0 && errorValue !== null && errorValue !== false) {
|
|
13359
|
+
acc[key] = errorValue;
|
|
13360
|
+
}
|
|
13361
|
+
return acc;
|
|
13362
|
+
}, {});
|
|
13363
|
+
}
|
|
13364
|
+
|
|
13365
|
+
function useFormErrors(initialErrors) {
|
|
13366
|
+
const [errorsState, setErrorsState] = React.useState(filterErrors(initialErrors));
|
|
13367
|
+
const errorsRef = React.useRef(errorsState);
|
|
13368
|
+
const setErrors = React.useCallback((errors) => {
|
|
13369
|
+
setErrorsState((current) => {
|
|
13370
|
+
const newErrors = filterErrors(typeof errors === "function" ? errors(current) : errors);
|
|
13371
|
+
errorsRef.current = newErrors;
|
|
13372
|
+
return newErrors;
|
|
13373
|
+
});
|
|
13374
|
+
}, []);
|
|
13375
|
+
const clearErrors = React.useCallback(() => setErrors({}), []);
|
|
13376
|
+
const clearFieldError = React.useCallback(
|
|
13377
|
+
(path) => {
|
|
13378
|
+
if (errorsRef.current[path] === void 0) {
|
|
13379
|
+
return;
|
|
13380
|
+
}
|
|
13381
|
+
setErrors((current) => {
|
|
13382
|
+
const errors = { ...current };
|
|
13383
|
+
delete errors[path];
|
|
13384
|
+
return errors;
|
|
13385
|
+
});
|
|
13386
|
+
},
|
|
13387
|
+
[errorsState]
|
|
13388
|
+
);
|
|
13389
|
+
const setFieldError = React.useCallback(
|
|
13390
|
+
(path, error) => {
|
|
13391
|
+
if (error == null || error === false) {
|
|
13392
|
+
clearFieldError(path);
|
|
13393
|
+
} else if (errorsRef.current[path] !== error) {
|
|
13394
|
+
setErrors((current) => ({ ...current, [path]: error }));
|
|
13395
|
+
}
|
|
13396
|
+
},
|
|
13397
|
+
[errorsState]
|
|
13398
|
+
);
|
|
13399
|
+
return {
|
|
13400
|
+
errorsState,
|
|
13401
|
+
setErrors,
|
|
13402
|
+
clearErrors,
|
|
13403
|
+
setFieldError,
|
|
13404
|
+
clearFieldError
|
|
13405
|
+
};
|
|
13406
|
+
}
|
|
13407
|
+
|
|
13408
|
+
function clearListState(field, state) {
|
|
13409
|
+
if (state === null || typeof state !== "object") {
|
|
13410
|
+
return {};
|
|
13411
|
+
}
|
|
13412
|
+
const clone = { ...state };
|
|
13413
|
+
Object.keys(state).forEach((errorKey) => {
|
|
13414
|
+
if (errorKey.includes(`${String(field)}.`)) {
|
|
13415
|
+
delete clone[errorKey];
|
|
13416
|
+
}
|
|
13417
|
+
});
|
|
13418
|
+
return clone;
|
|
13419
|
+
}
|
|
13420
|
+
|
|
13421
|
+
function getIndexFromKeyAfterPath(key, path) {
|
|
13422
|
+
const split = key.substring(path.length + 1).split(".")[0];
|
|
13423
|
+
return parseInt(split, 10);
|
|
13424
|
+
}
|
|
13425
|
+
function changeErrorIndices(path, index, errors, change) {
|
|
13426
|
+
if (index === void 0) {
|
|
13427
|
+
return errors;
|
|
13428
|
+
}
|
|
13429
|
+
const pathString = `${String(path)}`;
|
|
13430
|
+
let clearedErrors = errors;
|
|
13431
|
+
if (change === -1) {
|
|
13432
|
+
clearedErrors = clearListState(`${pathString}.${index}`, clearedErrors);
|
|
13433
|
+
}
|
|
13434
|
+
const cloned = { ...clearedErrors };
|
|
13435
|
+
const changedKeys = /* @__PURE__ */ new Set();
|
|
13436
|
+
Object.entries(clearedErrors).filter(([key]) => {
|
|
13437
|
+
if (!key.startsWith(`${pathString}.`)) {
|
|
13438
|
+
return false;
|
|
13439
|
+
}
|
|
13440
|
+
const currIndex = getIndexFromKeyAfterPath(key, pathString);
|
|
13441
|
+
if (Number.isNaN(currIndex)) {
|
|
13442
|
+
return false;
|
|
13443
|
+
}
|
|
13444
|
+
return currIndex >= index;
|
|
13445
|
+
}).forEach(([key, value]) => {
|
|
13446
|
+
const currIndex = getIndexFromKeyAfterPath(key, pathString);
|
|
13447
|
+
const newKey = key.replace(
|
|
13448
|
+
`${pathString}.${currIndex}`,
|
|
13449
|
+
`${pathString}.${currIndex + change}`
|
|
13450
|
+
);
|
|
13451
|
+
cloned[newKey] = value;
|
|
13452
|
+
changedKeys.add(newKey);
|
|
13453
|
+
if (!changedKeys.has(key)) {
|
|
13454
|
+
delete cloned[key];
|
|
13455
|
+
}
|
|
13456
|
+
});
|
|
13457
|
+
return cloned;
|
|
13458
|
+
}
|
|
13459
|
+
|
|
13460
|
+
function reorderErrors(path, { from, to }, errors) {
|
|
13461
|
+
const oldKeyStart = `${path}.${from}`;
|
|
13462
|
+
const newKeyStart = `${path}.${to}`;
|
|
13463
|
+
const clone = { ...errors };
|
|
13464
|
+
const processedKeys = /* @__PURE__ */ new Set();
|
|
13465
|
+
Object.keys(errors).forEach((key) => {
|
|
13466
|
+
if (processedKeys.has(key)) {
|
|
13467
|
+
return;
|
|
13468
|
+
}
|
|
13469
|
+
let oldKey;
|
|
13470
|
+
let newKey;
|
|
13471
|
+
if (key.startsWith(oldKeyStart)) {
|
|
13472
|
+
oldKey = key;
|
|
13473
|
+
newKey = key.replace(oldKeyStart, newKeyStart);
|
|
13474
|
+
} else if (key.startsWith(newKeyStart)) {
|
|
13475
|
+
oldKey = key.replace(newKeyStart, oldKeyStart);
|
|
13476
|
+
newKey = key;
|
|
13477
|
+
}
|
|
13478
|
+
if (oldKey && newKey) {
|
|
13479
|
+
const value1 = clone[oldKey];
|
|
13480
|
+
const value2 = clone[newKey];
|
|
13481
|
+
value2 === void 0 ? delete clone[oldKey] : clone[oldKey] = value2;
|
|
13482
|
+
value1 === void 0 ? delete clone[newKey] : clone[newKey] = value1;
|
|
13483
|
+
processedKeys.add(oldKey);
|
|
13484
|
+
processedKeys.add(newKey);
|
|
13485
|
+
}
|
|
13486
|
+
});
|
|
13487
|
+
return clone;
|
|
13488
|
+
}
|
|
13489
|
+
|
|
13490
|
+
function set(obj, key, val) {
|
|
13491
|
+
if (typeof val.value === 'object') val.value = klona(val.value);
|
|
13492
|
+
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
|
13493
|
+
Object.defineProperty(obj, key, val);
|
|
13494
|
+
} else obj[key] = val.value;
|
|
13495
|
+
}
|
|
13496
|
+
|
|
13497
|
+
function klona(x) {
|
|
13498
|
+
if (typeof x !== 'object') return x;
|
|
13499
|
+
|
|
13500
|
+
var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
|
|
13501
|
+
|
|
13502
|
+
if (str === '[object Object]') {
|
|
13503
|
+
tmp = Object.create(x.__proto__ || null);
|
|
13504
|
+
} else if (str === '[object Array]') {
|
|
13505
|
+
tmp = Array(x.length);
|
|
13506
|
+
} else if (str === '[object Set]') {
|
|
13507
|
+
tmp = new Set;
|
|
13508
|
+
x.forEach(function (val) {
|
|
13509
|
+
tmp.add(klona(val));
|
|
13510
|
+
});
|
|
13511
|
+
} else if (str === '[object Map]') {
|
|
13512
|
+
tmp = new Map;
|
|
13513
|
+
x.forEach(function (val, key) {
|
|
13514
|
+
tmp.set(klona(key), klona(val));
|
|
13515
|
+
});
|
|
13516
|
+
} else if (str === '[object Date]') {
|
|
13517
|
+
tmp = new Date(+x);
|
|
13518
|
+
} else if (str === '[object RegExp]') {
|
|
13519
|
+
tmp = new RegExp(x.source, x.flags);
|
|
13520
|
+
} else if (str === '[object DataView]') {
|
|
13521
|
+
tmp = new x.constructor( klona(x.buffer) );
|
|
13522
|
+
} else if (str === '[object ArrayBuffer]') {
|
|
13523
|
+
tmp = x.slice(0);
|
|
13524
|
+
} else if (str.slice(-6) === 'Array]') {
|
|
13525
|
+
// ArrayBuffer.isView(x)
|
|
13526
|
+
// ~> `new` bcuz `Buffer.slice` => ref
|
|
13527
|
+
tmp = new x.constructor(x);
|
|
13528
|
+
}
|
|
13529
|
+
|
|
13530
|
+
if (tmp) {
|
|
13531
|
+
for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
|
13532
|
+
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
13533
|
+
}
|
|
13534
|
+
|
|
13535
|
+
for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
13536
|
+
if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
|
|
13537
|
+
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
13538
|
+
}
|
|
13539
|
+
}
|
|
13540
|
+
|
|
13541
|
+
return tmp || x;
|
|
13542
|
+
}
|
|
13543
|
+
|
|
13544
|
+
function getSplittedPath(path) {
|
|
13545
|
+
if (typeof path !== "string") {
|
|
13546
|
+
return [];
|
|
13547
|
+
}
|
|
13548
|
+
return path.split(".");
|
|
13549
|
+
}
|
|
13550
|
+
|
|
13551
|
+
function getPath(path, values) {
|
|
13552
|
+
const splittedPath = getSplittedPath(path);
|
|
13553
|
+
if (splittedPath.length === 0 || typeof values !== "object" || values === null) {
|
|
13554
|
+
return void 0;
|
|
13555
|
+
}
|
|
13556
|
+
let value = values[splittedPath[0]];
|
|
13557
|
+
for (let i = 1; i < splittedPath.length; i += 1) {
|
|
13558
|
+
if (value == null) {
|
|
13559
|
+
break;
|
|
13560
|
+
}
|
|
13561
|
+
value = value[splittedPath[i]];
|
|
13562
|
+
}
|
|
13563
|
+
return value;
|
|
13564
|
+
}
|
|
13565
|
+
|
|
13566
|
+
function setPath(path, value, values) {
|
|
13567
|
+
const splittedPath = getSplittedPath(path);
|
|
13568
|
+
if (splittedPath.length === 0) {
|
|
13569
|
+
return values;
|
|
13570
|
+
}
|
|
13571
|
+
const cloned = klona(values);
|
|
13572
|
+
if (splittedPath.length === 1) {
|
|
13573
|
+
cloned[splittedPath[0]] = value;
|
|
13574
|
+
return cloned;
|
|
13575
|
+
}
|
|
13576
|
+
let val = cloned[splittedPath[0]];
|
|
13577
|
+
for (let i = 1; i < splittedPath.length - 1; i += 1) {
|
|
13578
|
+
if (val === void 0) {
|
|
13579
|
+
return cloned;
|
|
13580
|
+
}
|
|
13581
|
+
val = val[splittedPath[i]];
|
|
13582
|
+
}
|
|
13583
|
+
val[splittedPath[splittedPath.length - 1]] = value;
|
|
13584
|
+
return cloned;
|
|
13585
|
+
}
|
|
13586
|
+
|
|
13587
|
+
function reorderPath(path, { from, to }, values) {
|
|
13588
|
+
const currentValue = getPath(path, values);
|
|
13589
|
+
if (!Array.isArray(currentValue)) {
|
|
13590
|
+
return values;
|
|
13591
|
+
}
|
|
13592
|
+
const cloned = [...currentValue];
|
|
13593
|
+
const item = currentValue[from];
|
|
13594
|
+
cloned.splice(from, 1);
|
|
13595
|
+
cloned.splice(to, 0, item);
|
|
13596
|
+
return setPath(path, cloned, values);
|
|
13597
|
+
}
|
|
13598
|
+
|
|
13599
|
+
function insertPath(path, value, index, values) {
|
|
13600
|
+
const currentValue = getPath(path, values);
|
|
13601
|
+
if (!Array.isArray(currentValue)) {
|
|
13602
|
+
return values;
|
|
13603
|
+
}
|
|
13604
|
+
const cloned = [...currentValue];
|
|
13605
|
+
cloned.splice(typeof index === "number" ? index : cloned.length, 0, value);
|
|
13606
|
+
return setPath(path, cloned, values);
|
|
13607
|
+
}
|
|
13608
|
+
|
|
13609
|
+
function removePath(path, index, values) {
|
|
13610
|
+
const currentValue = getPath(path, values);
|
|
13611
|
+
if (!Array.isArray(currentValue)) {
|
|
13612
|
+
return values;
|
|
13613
|
+
}
|
|
13614
|
+
return setPath(
|
|
13615
|
+
path,
|
|
13616
|
+
currentValue.filter((_, itemIndex) => itemIndex !== index),
|
|
13617
|
+
values
|
|
13618
|
+
);
|
|
13619
|
+
}
|
|
13620
|
+
|
|
13621
|
+
function replacePath(path, item, index, values) {
|
|
13622
|
+
const currentValue = getPath(path, values);
|
|
13623
|
+
if (!Array.isArray(currentValue)) {
|
|
13624
|
+
return values;
|
|
13625
|
+
}
|
|
13626
|
+
if (currentValue.length <= index) {
|
|
13627
|
+
return values;
|
|
13628
|
+
}
|
|
13629
|
+
const cloned = [...currentValue];
|
|
13630
|
+
cloned[index] = item;
|
|
13631
|
+
return setPath(path, cloned, values);
|
|
13632
|
+
}
|
|
13633
|
+
|
|
13634
|
+
function useFormList({
|
|
13635
|
+
$values,
|
|
13636
|
+
$errors,
|
|
13637
|
+
$status
|
|
13638
|
+
}) {
|
|
13639
|
+
const reorderListItem = React.useCallback((path, payload) => {
|
|
13640
|
+
$status.clearFieldDirty(path);
|
|
13641
|
+
$errors.setErrors((errs) => reorderErrors(path, payload, errs));
|
|
13642
|
+
$values.setValues({
|
|
13643
|
+
values: reorderPath(path, payload, $values.refValues.current),
|
|
13644
|
+
updateState: true
|
|
13645
|
+
});
|
|
13646
|
+
}, []);
|
|
13647
|
+
const removeListItem = React.useCallback((path, index) => {
|
|
13648
|
+
$status.clearFieldDirty(path);
|
|
13649
|
+
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, -1));
|
|
13650
|
+
$values.setValues({
|
|
13651
|
+
values: removePath(path, index, $values.refValues.current),
|
|
13652
|
+
updateState: true
|
|
13653
|
+
});
|
|
13654
|
+
}, []);
|
|
13655
|
+
const insertListItem = React.useCallback((path, item, index) => {
|
|
13656
|
+
$status.clearFieldDirty(path);
|
|
13657
|
+
$errors.setErrors((errs) => changeErrorIndices(path, index, errs, 1));
|
|
13658
|
+
$values.setValues({
|
|
13659
|
+
values: insertPath(path, item, index, $values.refValues.current),
|
|
13660
|
+
updateState: true
|
|
13661
|
+
});
|
|
13662
|
+
}, []);
|
|
13663
|
+
const replaceListItem = React.useCallback((path, index, item) => {
|
|
13664
|
+
$status.clearFieldDirty(path);
|
|
13665
|
+
$values.setValues({
|
|
13666
|
+
values: replacePath(path, item, index, $values.refValues.current),
|
|
13667
|
+
updateState: true
|
|
13668
|
+
});
|
|
13669
|
+
}, []);
|
|
13670
|
+
return { reorderListItem, removeListItem, insertListItem, replaceListItem };
|
|
13671
|
+
}
|
|
13672
|
+
|
|
13673
|
+
var fastDeepEqual;
|
|
13674
|
+
var hasRequiredFastDeepEqual;
|
|
13675
|
+
function requireFastDeepEqual() {
|
|
13676
|
+
if (hasRequiredFastDeepEqual) return fastDeepEqual;
|
|
13677
|
+
hasRequiredFastDeepEqual = 1;
|
|
13678
|
+
|
|
13679
|
+
// do not edit .js files directly - edit src/index.jst
|
|
13680
|
+
|
|
13681
|
+
fastDeepEqual = function equal(a, b) {
|
|
13682
|
+
if (a === b) return true;
|
|
13683
|
+
if (a && b && typeof a == 'object' && typeof b == 'object') {
|
|
13684
|
+
if (a.constructor !== b.constructor) return false;
|
|
13685
|
+
var length, i, keys;
|
|
13686
|
+
if (Array.isArray(a)) {
|
|
13687
|
+
length = a.length;
|
|
13688
|
+
if (length != b.length) return false;
|
|
13689
|
+
for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;
|
|
13690
|
+
return true;
|
|
13691
|
+
}
|
|
13692
|
+
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
13693
|
+
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
13694
|
+
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
13695
|
+
keys = Object.keys(a);
|
|
13696
|
+
length = keys.length;
|
|
13697
|
+
if (length !== Object.keys(b).length) return false;
|
|
13698
|
+
for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
13699
|
+
for (i = length; i-- !== 0;) {
|
|
13700
|
+
var key = keys[i];
|
|
13701
|
+
if (!equal(a[key], b[key])) return false;
|
|
13702
|
+
}
|
|
13703
|
+
return true;
|
|
13704
|
+
}
|
|
13705
|
+
|
|
13706
|
+
// true if both NaN, false otherwise
|
|
13707
|
+
return a !== a && b !== b;
|
|
13708
|
+
};
|
|
13709
|
+
return fastDeepEqual;
|
|
13710
|
+
}
|
|
13711
|
+
|
|
13712
|
+
var fastDeepEqualExports = requireFastDeepEqual();
|
|
13713
|
+
var isEqual = /*@__PURE__*/getDefaultExportFromCjs(fastDeepEqualExports);
|
|
13714
|
+
|
|
13715
|
+
function getStatus(status, path) {
|
|
13716
|
+
const paths = Object.keys(status);
|
|
13717
|
+
if (typeof path === "string") {
|
|
13718
|
+
const nestedPaths = paths.filter((statusPath) => statusPath.startsWith(`${path}.`));
|
|
13719
|
+
return status[path] || nestedPaths.some((statusPath) => status[statusPath]) || false;
|
|
13720
|
+
}
|
|
13721
|
+
return paths.some((statusPath) => status[statusPath]);
|
|
13722
|
+
}
|
|
13723
|
+
|
|
13724
|
+
function useFormStatus({
|
|
13725
|
+
initialDirty,
|
|
13726
|
+
initialTouched,
|
|
13727
|
+
mode,
|
|
13728
|
+
$values
|
|
13729
|
+
}) {
|
|
13730
|
+
const [touchedState, setTouchedState] = React.useState(initialTouched);
|
|
13731
|
+
const [dirtyState, setDirtyState] = React.useState(initialDirty);
|
|
13732
|
+
const touchedRef = React.useRef(initialTouched);
|
|
13733
|
+
const dirtyRef = React.useRef(initialDirty);
|
|
13734
|
+
const setTouched = React.useCallback((values) => {
|
|
13735
|
+
const resolvedValues = typeof values === "function" ? values(touchedRef.current) : values;
|
|
13736
|
+
touchedRef.current = resolvedValues;
|
|
13737
|
+
if (mode === "controlled") {
|
|
13738
|
+
setTouchedState(resolvedValues);
|
|
13739
|
+
}
|
|
13740
|
+
}, []);
|
|
13741
|
+
const setDirty = React.useCallback(
|
|
13742
|
+
(values, forceUpdate = false) => {
|
|
13743
|
+
const resolvedValues = typeof values === "function" ? values(dirtyRef.current) : values;
|
|
13744
|
+
dirtyRef.current = resolvedValues;
|
|
13745
|
+
if (mode === "controlled" || forceUpdate) {
|
|
13746
|
+
setDirtyState(resolvedValues);
|
|
13747
|
+
}
|
|
13748
|
+
},
|
|
13749
|
+
[]
|
|
13750
|
+
);
|
|
13751
|
+
const resetTouched = React.useCallback(() => setTouched({}), []);
|
|
13752
|
+
const resetDirty = React.useCallback((values) => {
|
|
13753
|
+
const newSnapshot = values ? { ...$values.refValues.current, ...values } : $values.refValues.current;
|
|
13754
|
+
$values.setValuesSnapshot(newSnapshot);
|
|
13755
|
+
setDirty({});
|
|
13756
|
+
}, []);
|
|
13757
|
+
const setFieldTouched = React.useCallback((path, touched) => {
|
|
13758
|
+
setTouched((currentTouched) => {
|
|
13759
|
+
if (getStatus(currentTouched, path) === touched) {
|
|
13760
|
+
return currentTouched;
|
|
13761
|
+
}
|
|
13762
|
+
return { ...currentTouched, [path]: touched };
|
|
13763
|
+
});
|
|
13764
|
+
}, []);
|
|
13765
|
+
const setFieldDirty = React.useCallback((path, dirty, forceUpdate) => {
|
|
13766
|
+
setDirty((currentDirty) => {
|
|
13767
|
+
if (getStatus(currentDirty, path) === dirty) {
|
|
13768
|
+
return currentDirty;
|
|
13769
|
+
}
|
|
13770
|
+
return { ...currentDirty, [path]: dirty };
|
|
13771
|
+
}, forceUpdate);
|
|
13772
|
+
}, []);
|
|
13773
|
+
const setCalculatedFieldDirty = React.useCallback((path, value) => {
|
|
13774
|
+
const currentDirty = getStatus(dirtyRef.current, path);
|
|
13775
|
+
const dirty = !isEqual(getPath(path, $values.getValuesSnapshot()), value);
|
|
13776
|
+
const clearedState = clearListState(path, dirtyRef.current);
|
|
13777
|
+
clearedState[path] = dirty;
|
|
13778
|
+
setDirty(clearedState, currentDirty !== dirty);
|
|
13779
|
+
}, []);
|
|
13780
|
+
const isTouched = React.useCallback(
|
|
13781
|
+
(path) => getStatus(touchedRef.current, path),
|
|
13782
|
+
[]
|
|
13783
|
+
);
|
|
13784
|
+
const clearFieldDirty = React.useCallback(
|
|
13785
|
+
(path) => setDirty((current) => {
|
|
13786
|
+
if (typeof path !== "string") {
|
|
13787
|
+
return current;
|
|
13788
|
+
}
|
|
13789
|
+
const result = clearListState(path, current);
|
|
13790
|
+
delete result[path];
|
|
13791
|
+
if (isEqual(result, current)) {
|
|
13792
|
+
return current;
|
|
13793
|
+
}
|
|
13794
|
+
return result;
|
|
13795
|
+
}),
|
|
13796
|
+
[]
|
|
13797
|
+
);
|
|
13798
|
+
const isDirty = React.useCallback((path) => {
|
|
13799
|
+
if (path) {
|
|
13800
|
+
const overriddenValue = getPath(path, dirtyRef.current);
|
|
13801
|
+
if (typeof overriddenValue === "boolean") {
|
|
13802
|
+
return overriddenValue;
|
|
13803
|
+
}
|
|
13804
|
+
const sliceOfValues = getPath(path, $values.refValues.current);
|
|
13805
|
+
const sliceOfInitialValues = getPath(path, $values.valuesSnapshot.current);
|
|
13806
|
+
return !isEqual(sliceOfValues, sliceOfInitialValues);
|
|
13807
|
+
}
|
|
13808
|
+
const isOverridden = Object.keys(dirtyRef.current).length > 0;
|
|
13809
|
+
if (isOverridden) {
|
|
13810
|
+
return getStatus(dirtyRef.current);
|
|
13811
|
+
}
|
|
13812
|
+
return !isEqual($values.refValues.current, $values.valuesSnapshot.current);
|
|
13813
|
+
}, []);
|
|
13814
|
+
const getDirty = React.useCallback(() => dirtyRef.current, []);
|
|
13815
|
+
const getTouched = React.useCallback(() => touchedRef.current, []);
|
|
13816
|
+
return {
|
|
13817
|
+
touchedState,
|
|
13818
|
+
dirtyState,
|
|
13819
|
+
touchedRef,
|
|
13820
|
+
dirtyRef,
|
|
13821
|
+
setTouched,
|
|
13822
|
+
setDirty,
|
|
13823
|
+
resetDirty,
|
|
13824
|
+
resetTouched,
|
|
13825
|
+
isTouched,
|
|
13826
|
+
setFieldTouched,
|
|
13827
|
+
setFieldDirty,
|
|
13828
|
+
setTouchedState,
|
|
13829
|
+
setDirtyState,
|
|
13830
|
+
clearFieldDirty,
|
|
13831
|
+
isDirty,
|
|
13832
|
+
getDirty,
|
|
13833
|
+
getTouched,
|
|
13834
|
+
setCalculatedFieldDirty
|
|
13835
|
+
};
|
|
13836
|
+
}
|
|
13837
|
+
|
|
13838
|
+
function useFormValues({
|
|
13839
|
+
initialValues,
|
|
13840
|
+
onValuesChange,
|
|
13841
|
+
mode
|
|
13842
|
+
}) {
|
|
13843
|
+
const initialized = React.useRef(false);
|
|
13844
|
+
const [stateValues, setStateValues] = React.useState(initialValues || {});
|
|
13845
|
+
const refValues = React.useRef(stateValues);
|
|
13846
|
+
const valuesSnapshot = React.useRef(stateValues);
|
|
13847
|
+
const setValues = React.useCallback(
|
|
13848
|
+
({
|
|
13849
|
+
values,
|
|
13850
|
+
subscribers,
|
|
13851
|
+
updateState = true,
|
|
13852
|
+
mergeWithPreviousValues = true
|
|
13853
|
+
}) => {
|
|
13854
|
+
const previousValues = refValues.current;
|
|
13855
|
+
const resolvedValues = values instanceof Function ? values(refValues.current) : values;
|
|
13856
|
+
const updatedValues = mergeWithPreviousValues ? { ...previousValues, ...resolvedValues } : resolvedValues;
|
|
13857
|
+
refValues.current = updatedValues;
|
|
13858
|
+
if (updateState) {
|
|
13859
|
+
setStateValues(updatedValues);
|
|
13860
|
+
if (mode === "uncontrolled") {
|
|
13861
|
+
refValues.current = updatedValues;
|
|
13862
|
+
}
|
|
13863
|
+
}
|
|
13864
|
+
onValuesChange?.(updatedValues, previousValues);
|
|
13865
|
+
subscribers?.filter(Boolean).forEach((subscriber) => subscriber({ updatedValues, previousValues }));
|
|
13866
|
+
},
|
|
13867
|
+
[onValuesChange]
|
|
13868
|
+
);
|
|
13869
|
+
const setFieldValue = React.useCallback(
|
|
13870
|
+
(payload) => {
|
|
13871
|
+
const currentValue = getPath(payload.path, refValues.current);
|
|
13872
|
+
const updatedValue = payload.value instanceof Function ? payload.value(currentValue) : payload.value;
|
|
13873
|
+
if (currentValue !== updatedValue) {
|
|
13874
|
+
const previousValues = refValues.current;
|
|
13875
|
+
const updatedValues = setPath(payload.path, updatedValue, refValues.current);
|
|
13876
|
+
setValues({ values: updatedValues, updateState: payload.updateState });
|
|
13877
|
+
payload.subscribers?.filter(Boolean).forEach(
|
|
13878
|
+
(subscriber) => subscriber({ path: payload.path, updatedValues, previousValues })
|
|
13879
|
+
);
|
|
13880
|
+
}
|
|
13881
|
+
},
|
|
13882
|
+
[setValues]
|
|
13883
|
+
);
|
|
13884
|
+
const setValuesSnapshot = React.useCallback((payload) => {
|
|
13885
|
+
valuesSnapshot.current = payload;
|
|
13886
|
+
}, []);
|
|
13887
|
+
const initialize = React.useCallback(
|
|
13888
|
+
(values, onInitialize) => {
|
|
13889
|
+
if (!initialized.current) {
|
|
13890
|
+
initialized.current = true;
|
|
13891
|
+
setValues({ values, updateState: mode === "controlled" });
|
|
13892
|
+
setValuesSnapshot(values);
|
|
13893
|
+
onInitialize();
|
|
13894
|
+
}
|
|
13895
|
+
},
|
|
13896
|
+
[setValues]
|
|
13897
|
+
);
|
|
13898
|
+
const resetValues = React.useCallback(() => {
|
|
13899
|
+
setValues({
|
|
13900
|
+
values: valuesSnapshot.current,
|
|
13901
|
+
updateState: true,
|
|
13902
|
+
mergeWithPreviousValues: false
|
|
13903
|
+
});
|
|
13904
|
+
}, [setValues]);
|
|
13905
|
+
const getValues = React.useCallback(() => refValues.current, []);
|
|
13906
|
+
const getValuesSnapshot = React.useCallback(() => valuesSnapshot.current, []);
|
|
13907
|
+
const resetField = React.useCallback(
|
|
13908
|
+
(path, subscribers) => {
|
|
13909
|
+
const snapshotValue = getPath(path, valuesSnapshot.current);
|
|
13910
|
+
if (typeof snapshotValue === "undefined") {
|
|
13911
|
+
return;
|
|
13912
|
+
}
|
|
13913
|
+
setFieldValue({
|
|
13914
|
+
path,
|
|
13915
|
+
value: snapshotValue,
|
|
13916
|
+
updateState: mode === "controlled",
|
|
13917
|
+
subscribers
|
|
13918
|
+
});
|
|
13919
|
+
},
|
|
13920
|
+
[setFieldValue, mode]
|
|
13921
|
+
);
|
|
13922
|
+
return {
|
|
13923
|
+
initialized,
|
|
13924
|
+
stateValues,
|
|
13925
|
+
refValues,
|
|
13926
|
+
valuesSnapshot,
|
|
13927
|
+
setValues,
|
|
13928
|
+
setFieldValue,
|
|
13929
|
+
resetValues,
|
|
13930
|
+
setValuesSnapshot,
|
|
13931
|
+
initialize,
|
|
13932
|
+
getValues,
|
|
13933
|
+
getValuesSnapshot,
|
|
13934
|
+
resetField
|
|
13935
|
+
};
|
|
13936
|
+
}
|
|
13937
|
+
|
|
13938
|
+
function useFormWatch({
|
|
13939
|
+
$status,
|
|
13940
|
+
cascadeUpdates
|
|
13941
|
+
}) {
|
|
13942
|
+
const subscribers = React.useRef(
|
|
13943
|
+
{}
|
|
13944
|
+
);
|
|
13945
|
+
const watch = React.useCallback((path, callback) => {
|
|
13946
|
+
React.useEffect(() => {
|
|
13947
|
+
subscribers.current[path] = subscribers.current[path] || [];
|
|
13948
|
+
subscribers.current[path].push(callback);
|
|
13949
|
+
return () => {
|
|
13950
|
+
subscribers.current[path] = subscribers.current[path].filter((cb) => cb !== callback);
|
|
13951
|
+
};
|
|
13952
|
+
}, [callback]);
|
|
13953
|
+
}, []);
|
|
13954
|
+
const getFieldSubscribers = React.useCallback((path) => {
|
|
13955
|
+
const result = subscribers.current[path]?.map(
|
|
13956
|
+
(callback) => (input) => callback({
|
|
13957
|
+
previousValue: getPath(path, input.previousValues),
|
|
13958
|
+
value: getPath(path, input.updatedValues),
|
|
13959
|
+
touched: $status.isTouched(path),
|
|
13960
|
+
dirty: $status.isDirty(path)
|
|
13961
|
+
})
|
|
13962
|
+
) ?? [];
|
|
13963
|
+
if (cascadeUpdates) {
|
|
13964
|
+
for (const subscriptionKey in subscribers.current) {
|
|
13965
|
+
if (subscriptionKey.startsWith(`${path}.`) || path.startsWith(`${subscriptionKey}.`)) {
|
|
13966
|
+
result.push(
|
|
13967
|
+
...subscribers.current[subscriptionKey].map(
|
|
13968
|
+
(cb) => (input) => cb({
|
|
13969
|
+
previousValue: getPath(subscriptionKey, input.previousValues),
|
|
13970
|
+
value: getPath(subscriptionKey, input.updatedValues),
|
|
13971
|
+
touched: $status.isTouched(subscriptionKey),
|
|
13972
|
+
dirty: $status.isDirty(subscriptionKey)
|
|
13973
|
+
})
|
|
13974
|
+
)
|
|
13975
|
+
);
|
|
13976
|
+
}
|
|
13977
|
+
}
|
|
13978
|
+
}
|
|
13979
|
+
return result;
|
|
13980
|
+
}, []);
|
|
13981
|
+
return {
|
|
13982
|
+
subscribers,
|
|
13983
|
+
watch,
|
|
13984
|
+
getFieldSubscribers
|
|
13985
|
+
};
|
|
13986
|
+
}
|
|
13987
|
+
|
|
13988
|
+
function getDataPath(formName, fieldPath) {
|
|
13989
|
+
return formName ? `${formName}-${fieldPath.toString()}` : fieldPath.toString();
|
|
13990
|
+
}
|
|
13991
|
+
|
|
13992
|
+
const formRootRule = Symbol("root-rule");
|
|
13993
|
+
function getValidationResults(errors) {
|
|
13994
|
+
const filteredErrors = filterErrors(errors);
|
|
13995
|
+
return { hasErrors: Object.keys(filteredErrors).length > 0, errors: filteredErrors };
|
|
13996
|
+
}
|
|
13997
|
+
function validateRulesRecord(rules, values, path = "", errors = {}) {
|
|
13998
|
+
if (typeof rules !== "object" || rules === null) {
|
|
13999
|
+
return errors;
|
|
14000
|
+
}
|
|
14001
|
+
return Object.keys(rules).reduce((acc, ruleKey) => {
|
|
14002
|
+
const rule = rules[ruleKey];
|
|
14003
|
+
const rulePath = `${path === "" ? "" : `${path}.`}${ruleKey}`;
|
|
14004
|
+
const value = getPath(rulePath, values);
|
|
14005
|
+
let arrayValidation = false;
|
|
14006
|
+
if (typeof rule === "function") {
|
|
14007
|
+
acc[rulePath] = rule(value, values, rulePath);
|
|
14008
|
+
}
|
|
14009
|
+
if (typeof rule === "object" && Array.isArray(value)) {
|
|
14010
|
+
arrayValidation = true;
|
|
14011
|
+
value.forEach(
|
|
14012
|
+
(_item, index) => validateRulesRecord(rule, values, `${rulePath}.${index}`, acc)
|
|
14013
|
+
);
|
|
14014
|
+
if (formRootRule in rule) {
|
|
14015
|
+
acc[rulePath] = rule[formRootRule](value, values, rulePath);
|
|
14016
|
+
}
|
|
14017
|
+
}
|
|
14018
|
+
if (typeof rule === "object" && typeof value === "object" && value !== null) {
|
|
14019
|
+
if (!arrayValidation) {
|
|
14020
|
+
validateRulesRecord(rule, values, rulePath, acc);
|
|
14021
|
+
}
|
|
14022
|
+
if (formRootRule in rule) {
|
|
14023
|
+
acc[rulePath] = rule[formRootRule](value, values, rulePath);
|
|
14024
|
+
}
|
|
14025
|
+
}
|
|
14026
|
+
return acc;
|
|
14027
|
+
}, errors);
|
|
14028
|
+
}
|
|
14029
|
+
function validateValues(validate, values) {
|
|
14030
|
+
if (typeof validate === "function") {
|
|
14031
|
+
return getValidationResults(validate(values));
|
|
14032
|
+
}
|
|
14033
|
+
return getValidationResults(validateRulesRecord(validate, values));
|
|
14034
|
+
}
|
|
14035
|
+
|
|
14036
|
+
function validateFieldValue(path, rules, values) {
|
|
14037
|
+
if (typeof path !== "string") {
|
|
14038
|
+
return { hasError: false, error: null };
|
|
14039
|
+
}
|
|
14040
|
+
const results = validateValues(rules, values);
|
|
14041
|
+
const pathInError = Object.keys(results.errors).find(
|
|
14042
|
+
(errorKey) => path.split(".").every((pathPart, i) => pathPart === errorKey.split(".")[i])
|
|
14043
|
+
);
|
|
14044
|
+
return { hasError: !!pathInError, error: pathInError ? results.errors[pathInError] : null };
|
|
14045
|
+
}
|
|
14046
|
+
|
|
14047
|
+
const FORM_INDEX = "__MANTINE_FORM_INDEX__";
|
|
14048
|
+
|
|
14049
|
+
function shouldValidateOnChange(path, validateInputOnChange) {
|
|
14050
|
+
if (!validateInputOnChange) {
|
|
14051
|
+
return false;
|
|
14052
|
+
}
|
|
14053
|
+
if (typeof validateInputOnChange === "boolean") {
|
|
14054
|
+
return validateInputOnChange;
|
|
14055
|
+
}
|
|
14056
|
+
if (Array.isArray(validateInputOnChange)) {
|
|
14057
|
+
return validateInputOnChange.includes(path.replace(/[.][0-9]+/g, `.${FORM_INDEX}`));
|
|
14058
|
+
}
|
|
14059
|
+
return false;
|
|
14060
|
+
}
|
|
14061
|
+
|
|
14062
|
+
function useForm({
|
|
14063
|
+
name,
|
|
14064
|
+
mode = "controlled",
|
|
14065
|
+
initialValues,
|
|
14066
|
+
initialErrors = {},
|
|
14067
|
+
initialDirty = {},
|
|
14068
|
+
initialTouched = {},
|
|
14069
|
+
clearInputErrorOnChange = true,
|
|
14070
|
+
validateInputOnChange = false,
|
|
14071
|
+
validateInputOnBlur = false,
|
|
14072
|
+
onValuesChange,
|
|
14073
|
+
transformValues = (values) => values,
|
|
14074
|
+
enhanceGetInputProps,
|
|
14075
|
+
validate: rules,
|
|
14076
|
+
onSubmitPreventDefault = "always",
|
|
14077
|
+
touchTrigger = "change",
|
|
14078
|
+
cascadeUpdates = false
|
|
14079
|
+
} = {}) {
|
|
14080
|
+
const $errors = useFormErrors(initialErrors);
|
|
14081
|
+
const $values = useFormValues({ initialValues, onValuesChange, mode });
|
|
14082
|
+
const $status = useFormStatus({ initialDirty, initialTouched, $values, mode });
|
|
14083
|
+
const $list = useFormList({ $values, $errors, $status });
|
|
14084
|
+
const $watch = useFormWatch({ $status, cascadeUpdates });
|
|
14085
|
+
const [formKey, setFormKey] = React.useState(0);
|
|
14086
|
+
const [fieldKeys, setFieldKeys] = React.useState({});
|
|
14087
|
+
const [submitting, setSubmitting] = React.useState(false);
|
|
14088
|
+
const reset = React.useCallback(() => {
|
|
14089
|
+
$values.resetValues();
|
|
14090
|
+
$errors.clearErrors();
|
|
14091
|
+
$status.resetDirty();
|
|
14092
|
+
$status.resetTouched();
|
|
14093
|
+
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
14094
|
+
}, []);
|
|
14095
|
+
const handleValuesChanges = React.useCallback(
|
|
14096
|
+
(previousValues) => {
|
|
14097
|
+
clearInputErrorOnChange && $errors.clearErrors();
|
|
14098
|
+
mode === "uncontrolled" && setFormKey((key2) => key2 + 1);
|
|
14099
|
+
Object.keys($watch.subscribers.current).forEach((path) => {
|
|
14100
|
+
const value = getPath(path, $values.refValues.current);
|
|
14101
|
+
const previousValue = getPath(path, previousValues);
|
|
14102
|
+
if (value !== previousValue) {
|
|
14103
|
+
$watch.getFieldSubscribers(path).forEach((cb) => cb({ previousValues, updatedValues: $values.refValues.current }));
|
|
14104
|
+
}
|
|
14105
|
+
});
|
|
14106
|
+
},
|
|
14107
|
+
[clearInputErrorOnChange]
|
|
14108
|
+
);
|
|
14109
|
+
const initialize = React.useCallback(
|
|
14110
|
+
(values) => {
|
|
14111
|
+
const previousValues = $values.refValues.current;
|
|
14112
|
+
$values.initialize(values, () => mode === "uncontrolled" && setFormKey((key2) => key2 + 1));
|
|
14113
|
+
handleValuesChanges(previousValues);
|
|
14114
|
+
},
|
|
14115
|
+
[handleValuesChanges]
|
|
14116
|
+
);
|
|
14117
|
+
const setFieldValue = React.useCallback(
|
|
14118
|
+
(path, value, options) => {
|
|
14119
|
+
const shouldValidate = shouldValidateOnChange(path, validateInputOnChange);
|
|
14120
|
+
const resolvedValue = value instanceof Function ? value(getPath(path, $values.refValues.current)) : value;
|
|
14121
|
+
$status.setCalculatedFieldDirty(path, resolvedValue);
|
|
14122
|
+
touchTrigger === "change" && $status.setFieldTouched(path, true);
|
|
14123
|
+
!shouldValidate && clearInputErrorOnChange && $errors.clearFieldError(path);
|
|
14124
|
+
$values.setFieldValue({
|
|
14125
|
+
path,
|
|
14126
|
+
value,
|
|
14127
|
+
updateState: mode === "controlled",
|
|
14128
|
+
subscribers: [
|
|
14129
|
+
...$watch.getFieldSubscribers(path),
|
|
14130
|
+
shouldValidate ? (payload) => {
|
|
14131
|
+
const validationResults = validateFieldValue(path, rules, payload.updatedValues);
|
|
14132
|
+
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
14133
|
+
} : null,
|
|
14134
|
+
options?.forceUpdate !== false && mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
14135
|
+
...keys,
|
|
14136
|
+
[path]: (keys[path] || 0) + 1
|
|
14137
|
+
})) : null
|
|
14138
|
+
]
|
|
14139
|
+
});
|
|
14140
|
+
},
|
|
14141
|
+
[onValuesChange, rules]
|
|
14142
|
+
);
|
|
14143
|
+
const setValues = React.useCallback(
|
|
14144
|
+
(values) => {
|
|
14145
|
+
const previousValues = $values.refValues.current;
|
|
14146
|
+
$values.setValues({ values, updateState: mode === "controlled" });
|
|
14147
|
+
handleValuesChanges(previousValues);
|
|
14148
|
+
},
|
|
14149
|
+
[onValuesChange, handleValuesChanges]
|
|
14150
|
+
);
|
|
14151
|
+
const validate = React.useCallback(() => {
|
|
14152
|
+
const results = validateValues(rules, $values.refValues.current);
|
|
14153
|
+
$errors.setErrors(results.errors);
|
|
14154
|
+
return results;
|
|
14155
|
+
}, [rules]);
|
|
14156
|
+
const validateField = React.useCallback(
|
|
14157
|
+
(path) => {
|
|
14158
|
+
const results = validateFieldValue(path, rules, $values.refValues.current);
|
|
14159
|
+
results.hasError ? $errors.setFieldError(path, results.error) : $errors.clearFieldError(path);
|
|
14160
|
+
return results;
|
|
14161
|
+
},
|
|
14162
|
+
[rules]
|
|
14163
|
+
);
|
|
14164
|
+
const getInputProps = (path, { type = "input", withError = true, withFocus = true, ...otherOptions } = {}) => {
|
|
14165
|
+
const onChange = getInputOnChange(
|
|
14166
|
+
(value) => setFieldValue(path, value, { forceUpdate: false })
|
|
14167
|
+
);
|
|
14168
|
+
const payload = { onChange, "data-path": getDataPath(name, path) };
|
|
14169
|
+
if (withError) {
|
|
14170
|
+
payload.error = $errors.errorsState[path];
|
|
14171
|
+
}
|
|
14172
|
+
if (type === "checkbox") {
|
|
14173
|
+
payload[mode === "controlled" ? "checked" : "defaultChecked"] = getPath(
|
|
14174
|
+
path,
|
|
14175
|
+
$values.refValues.current
|
|
14176
|
+
);
|
|
14177
|
+
} else {
|
|
14178
|
+
payload[mode === "controlled" ? "value" : "defaultValue"] = getPath(
|
|
14179
|
+
path,
|
|
14180
|
+
$values.refValues.current
|
|
14181
|
+
);
|
|
14182
|
+
}
|
|
14183
|
+
if (withFocus) {
|
|
14184
|
+
payload.onFocus = () => $status.setFieldTouched(path, true);
|
|
14185
|
+
payload.onBlur = () => {
|
|
14186
|
+
if (shouldValidateOnChange(path, validateInputOnBlur)) {
|
|
14187
|
+
const validationResults = validateFieldValue(path, rules, $values.refValues.current);
|
|
14188
|
+
validationResults.hasError ? $errors.setFieldError(path, validationResults.error) : $errors.clearFieldError(path);
|
|
14189
|
+
}
|
|
14190
|
+
};
|
|
14191
|
+
}
|
|
14192
|
+
return Object.assign(
|
|
14193
|
+
payload,
|
|
14194
|
+
enhanceGetInputProps?.({
|
|
14195
|
+
inputProps: payload,
|
|
14196
|
+
field: path,
|
|
14197
|
+
options: { type, withError, withFocus, ...otherOptions },
|
|
14198
|
+
form
|
|
14199
|
+
})
|
|
14200
|
+
);
|
|
14201
|
+
};
|
|
14202
|
+
const onSubmit = (handleSubmit, handleValidationFailure) => (event) => {
|
|
14203
|
+
if (onSubmitPreventDefault === "always") {
|
|
14204
|
+
event?.preventDefault();
|
|
14205
|
+
}
|
|
14206
|
+
const results = validate();
|
|
14207
|
+
if (results.hasErrors) {
|
|
14208
|
+
if (onSubmitPreventDefault === "validation-failed") {
|
|
14209
|
+
event?.preventDefault();
|
|
14210
|
+
}
|
|
14211
|
+
handleValidationFailure?.(results.errors, $values.refValues.current, event);
|
|
14212
|
+
} else {
|
|
14213
|
+
const submitResult = handleSubmit?.(
|
|
14214
|
+
transformValues($values.refValues.current),
|
|
14215
|
+
event
|
|
14216
|
+
);
|
|
14217
|
+
if (submitResult instanceof Promise) {
|
|
14218
|
+
setSubmitting(true);
|
|
14219
|
+
submitResult.finally(() => setSubmitting(false));
|
|
14220
|
+
}
|
|
14221
|
+
}
|
|
14222
|
+
};
|
|
14223
|
+
const getTransformedValues = (input) => transformValues(input || $values.refValues.current);
|
|
14224
|
+
const onReset = React.useCallback((event) => {
|
|
14225
|
+
event.preventDefault();
|
|
14226
|
+
reset();
|
|
14227
|
+
}, []);
|
|
14228
|
+
const isValid = React.useCallback(
|
|
14229
|
+
(path) => path ? !validateFieldValue(path, rules, $values.refValues.current).hasError : !validateValues(rules, $values.refValues.current).hasErrors,
|
|
14230
|
+
[rules]
|
|
14231
|
+
);
|
|
14232
|
+
const key = (path) => `${formKey}-${String(path)}-${fieldKeys[String(path)] || 0}`;
|
|
14233
|
+
const getInputNode = React.useCallback(
|
|
14234
|
+
(path) => document.querySelector(`[data-path="${getDataPath(name, path)}"]`),
|
|
14235
|
+
[]
|
|
14236
|
+
);
|
|
14237
|
+
const resetField = React.useCallback(
|
|
14238
|
+
(path) => {
|
|
14239
|
+
$values.resetField(path, [
|
|
14240
|
+
mode !== "controlled" ? () => setFieldKeys((keys) => ({
|
|
14241
|
+
...keys,
|
|
14242
|
+
[path]: (keys[path] || 0) + 1
|
|
14243
|
+
})) : null
|
|
14244
|
+
]);
|
|
14245
|
+
},
|
|
14246
|
+
[$values.resetField, mode, setFieldKeys]
|
|
14247
|
+
);
|
|
14248
|
+
const form = {
|
|
14249
|
+
watch: $watch.watch,
|
|
14250
|
+
initialized: $values.initialized.current,
|
|
14251
|
+
values: mode === "uncontrolled" ? $values.refValues.current : $values.stateValues,
|
|
14252
|
+
getValues: $values.getValues,
|
|
14253
|
+
getInitialValues: $values.getValuesSnapshot,
|
|
14254
|
+
setInitialValues: $values.setValuesSnapshot,
|
|
14255
|
+
resetField,
|
|
14256
|
+
initialize,
|
|
14257
|
+
setValues,
|
|
14258
|
+
setFieldValue,
|
|
14259
|
+
submitting,
|
|
14260
|
+
setSubmitting,
|
|
14261
|
+
errors: $errors.errorsState,
|
|
14262
|
+
setErrors: $errors.setErrors,
|
|
14263
|
+
setFieldError: $errors.setFieldError,
|
|
14264
|
+
clearFieldError: $errors.clearFieldError,
|
|
14265
|
+
clearErrors: $errors.clearErrors,
|
|
14266
|
+
resetDirty: $status.resetDirty,
|
|
14267
|
+
setTouched: $status.setTouched,
|
|
14268
|
+
setDirty: $status.setDirty,
|
|
14269
|
+
isTouched: $status.isTouched,
|
|
14270
|
+
resetTouched: $status.resetTouched,
|
|
14271
|
+
isDirty: $status.isDirty,
|
|
14272
|
+
getTouched: $status.getTouched,
|
|
14273
|
+
getDirty: $status.getDirty,
|
|
14274
|
+
reorderListItem: $list.reorderListItem,
|
|
14275
|
+
insertListItem: $list.insertListItem,
|
|
14276
|
+
removeListItem: $list.removeListItem,
|
|
14277
|
+
replaceListItem: $list.replaceListItem,
|
|
14278
|
+
reset,
|
|
14279
|
+
validate,
|
|
14280
|
+
validateField,
|
|
14281
|
+
getInputProps,
|
|
14282
|
+
onSubmit,
|
|
14283
|
+
onReset,
|
|
14284
|
+
isValid,
|
|
14285
|
+
getTransformedValues,
|
|
14286
|
+
key,
|
|
14287
|
+
getInputNode
|
|
14288
|
+
};
|
|
14289
|
+
useFormActions(name, form);
|
|
14290
|
+
return form;
|
|
14291
|
+
}
|
|
14292
|
+
|
|
14293
|
+
const _excluded$1 = ["fields", "isEditable", "layout", "hasSubmit", "hasReset"];
|
|
14294
|
+
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; }
|
|
14295
|
+
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; }
|
|
13252
14296
|
const SimpleForm = _ref => {
|
|
13253
14297
|
let {
|
|
13254
14298
|
fields,
|
|
13255
14299
|
isEditable = true,
|
|
13256
|
-
layout = []
|
|
13257
|
-
|
|
13258
|
-
|
|
14300
|
+
layout = [],
|
|
14301
|
+
hasSubmit,
|
|
14302
|
+
hasReset
|
|
14303
|
+
} = _ref,
|
|
14304
|
+
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
13259
14305
|
const components = {
|
|
13260
14306
|
Textarea: core.Textarea,
|
|
13261
14307
|
TextInput: core.TextInput,
|
|
13262
14308
|
PasswordInput: core.PasswordInput,
|
|
13263
14309
|
NumberInput: core.NumberInput
|
|
13264
14310
|
};
|
|
14311
|
+
const form = useForm({
|
|
14312
|
+
mode: "uncontrolled",
|
|
14313
|
+
initialValues: () => {
|
|
14314
|
+
const localInitialValues = {};
|
|
14315
|
+
fields.forEach((field, index) => {
|
|
14316
|
+
if (typeof field === "string") {
|
|
14317
|
+
const sanitizedField = santize(field);
|
|
14318
|
+
localInitialValues[sanitizedField.name] = "";
|
|
14319
|
+
}
|
|
14320
|
+
if (typeof field === "object" && Object.keys(components).includes(field.component)) {
|
|
14321
|
+
var _field$field;
|
|
14322
|
+
const sanitizedField = santize((_field$field = field.field) !== null && _field$field !== void 0 ? _field$field : "");
|
|
14323
|
+
localInitialValues[sanitizedField.name] = "";
|
|
14324
|
+
}
|
|
14325
|
+
});
|
|
14326
|
+
return _objectSpread$1(_objectSpread$1({}, localInitialValues), rest.initialValues);
|
|
14327
|
+
},
|
|
14328
|
+
validate: rest.formValidate
|
|
14329
|
+
});
|
|
13265
14330
|
const indexDiff = fields.length - layout.length;
|
|
13266
14331
|
layout.push(...Array(indexDiff).fill(12));
|
|
13267
14332
|
const inputProps = {
|
|
@@ -13275,29 +14340,47 @@ const SimpleForm = _ref => {
|
|
|
13275
14340
|
variant: !isEditable ? "unstyled" : "default",
|
|
13276
14341
|
required: true
|
|
13277
14342
|
};
|
|
13278
|
-
return /*#__PURE__*/React.createElement(
|
|
14343
|
+
return /*#__PURE__*/React.createElement("form", {
|
|
14344
|
+
onSubmit: form.onSubmit(values => {
|
|
14345
|
+
var _rest$onSubmit;
|
|
14346
|
+
return hasSubmit ? (_rest$onSubmit = rest.onSubmit) === null || _rest$onSubmit === void 0 ? void 0 : _rest$onSubmit.call(rest, values) : void 0;
|
|
14347
|
+
}),
|
|
14348
|
+
onReset: form.reset,
|
|
14349
|
+
style: {
|
|
14350
|
+
height: "100%"
|
|
14351
|
+
}
|
|
14352
|
+
}, /*#__PURE__*/React.createElement(core.Stack, {
|
|
14353
|
+
h: "100%"
|
|
14354
|
+
}, /*#__PURE__*/React.createElement(core.Grid, null, fields.map((field, index) => {
|
|
13279
14355
|
if (typeof field === "string") {
|
|
14356
|
+
const sanitizedField = santize(field);
|
|
13280
14357
|
return /*#__PURE__*/React.createElement(core.Grid.Col, {
|
|
13281
14358
|
key: index,
|
|
13282
14359
|
span: layout[index]
|
|
13283
|
-
}, /*#__PURE__*/React.createElement(core.TextInput, _extends({}, inputProps,
|
|
14360
|
+
}, /*#__PURE__*/React.createElement(core.TextInput, _extends({}, inputProps, sanitizedField, form.getInputProps(sanitizedField.name))));
|
|
13284
14361
|
}
|
|
13285
14362
|
if (typeof field === "function") {
|
|
13286
14363
|
return /*#__PURE__*/React.createElement(core.Grid.Col, {
|
|
13287
14364
|
key: index,
|
|
13288
14365
|
span: layout[index]
|
|
13289
|
-
}, field());
|
|
14366
|
+
}, field(form.getInputProps));
|
|
13290
14367
|
}
|
|
13291
|
-
if (
|
|
13292
|
-
var _field$
|
|
14368
|
+
if (Object.keys(components).includes(field.component)) {
|
|
14369
|
+
var _field$field2;
|
|
13293
14370
|
const Component = components[field.component];
|
|
14371
|
+
const sanitizedField = santize((_field$field2 = field.field) !== null && _field$field2 !== void 0 ? _field$field2 : "");
|
|
13294
14372
|
return /*#__PURE__*/React.createElement(core.Grid.Col, {
|
|
13295
14373
|
key: index,
|
|
13296
14374
|
span: layout[index]
|
|
13297
|
-
}, /*#__PURE__*/React.createElement(Component, _extends({}, field.field, inputProps,
|
|
14375
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({}, field.field, inputProps, sanitizedField, form.getInputProps(sanitizedField.name))));
|
|
13298
14376
|
}
|
|
13299
14377
|
return null;
|
|
13300
|
-
}))
|
|
14378
|
+
})), /*#__PURE__*/React.createElement(core.Space, {
|
|
14379
|
+
flex: 1
|
|
14380
|
+
}), /*#__PURE__*/React.createElement(FormButtons, {
|
|
14381
|
+
hasSubmit,
|
|
14382
|
+
hasReset
|
|
14383
|
+
})));
|
|
13301
14384
|
};
|
|
13302
14385
|
const santize = field => {
|
|
13303
14386
|
var _ref2, _field$label, _field$placeholder, _field$name, _field$name$split$joi, _field$name2;
|
|
@@ -13315,6 +14398,130 @@ const santize = field => {
|
|
|
13315
14398
|
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 : ""
|
|
13316
14399
|
};
|
|
13317
14400
|
};
|
|
14401
|
+
const FormButtons = _ref3 => {
|
|
14402
|
+
let {
|
|
14403
|
+
hasSubmit = false,
|
|
14404
|
+
hasReset = false
|
|
14405
|
+
} = _ref3;
|
|
14406
|
+
return /*#__PURE__*/React.createElement(core.Group, {
|
|
14407
|
+
justify: "flex-end",
|
|
14408
|
+
grow: true,
|
|
14409
|
+
gap: 10,
|
|
14410
|
+
w: "100%",
|
|
14411
|
+
display: hasSubmit || hasReset ? "flex" : "none"
|
|
14412
|
+
}, /*#__PURE__*/React.createElement(core.Button, {
|
|
14413
|
+
leftSection: /*#__PURE__*/React.createElement(Icons, {
|
|
14414
|
+
name: "CloseCircle",
|
|
14415
|
+
size: 16
|
|
14416
|
+
}),
|
|
14417
|
+
variant: "filled",
|
|
14418
|
+
color: "red",
|
|
14419
|
+
size: "lg",
|
|
14420
|
+
radius: "xl",
|
|
14421
|
+
miw: "25%",
|
|
14422
|
+
type: "reset",
|
|
14423
|
+
style: {
|
|
14424
|
+
display: hasReset ? "block" : "none"
|
|
14425
|
+
},
|
|
14426
|
+
flex: 1
|
|
14427
|
+
}, /*#__PURE__*/React.createElement(core.Text, {
|
|
14428
|
+
fw: 400,
|
|
14429
|
+
fz: "sm",
|
|
14430
|
+
c: "white"
|
|
14431
|
+
}, "Cancel")), /*#__PURE__*/React.createElement(core.Button, {
|
|
14432
|
+
leftSection: /*#__PURE__*/React.createElement(Icons, {
|
|
14433
|
+
name: "TickCircle",
|
|
14434
|
+
size: 16
|
|
14435
|
+
}),
|
|
14436
|
+
variant: "filled",
|
|
14437
|
+
color: "adiba.5",
|
|
14438
|
+
size: "lg",
|
|
14439
|
+
radius: "xl",
|
|
14440
|
+
miw: "25%",
|
|
14441
|
+
type: "submit",
|
|
14442
|
+
style: {
|
|
14443
|
+
display: hasSubmit ? "block" : "none"
|
|
14444
|
+
},
|
|
14445
|
+
flex: 1
|
|
14446
|
+
}, /*#__PURE__*/React.createElement(core.Text, {
|
|
14447
|
+
fw: 300,
|
|
14448
|
+
fz: "sm",
|
|
14449
|
+
c: "white"
|
|
14450
|
+
}, "Save")));
|
|
14451
|
+
};
|
|
14452
|
+
|
|
14453
|
+
const MaskedTilePanel = _ref => {
|
|
14454
|
+
let {
|
|
14455
|
+
label,
|
|
14456
|
+
value,
|
|
14457
|
+
icon,
|
|
14458
|
+
onMasked = () => true
|
|
14459
|
+
} = _ref;
|
|
14460
|
+
const [masked, toggle] = hooks.useToggle();
|
|
14461
|
+
const name = masked ? "Eye" : "EyeSlash";
|
|
14462
|
+
return /*#__PURE__*/React.createElement(core.Card, {
|
|
14463
|
+
p: "md",
|
|
14464
|
+
bg: "gray.0",
|
|
14465
|
+
style: {
|
|
14466
|
+
borderRadius: "10px"
|
|
14467
|
+
}
|
|
14468
|
+
}, /*#__PURE__*/React.createElement(core.Group, {
|
|
14469
|
+
justify: "space-between"
|
|
14470
|
+
}, /*#__PURE__*/React.createElement(core.Stack, {
|
|
14471
|
+
gap: 0,
|
|
14472
|
+
p: 0
|
|
14473
|
+
}, /*#__PURE__*/React.createElement(core.Text, {
|
|
14474
|
+
fz: "sm",
|
|
14475
|
+
fw: 300,
|
|
14476
|
+
p: 0,
|
|
14477
|
+
c: "gray.7"
|
|
14478
|
+
}, label), /*#__PURE__*/React.createElement(core.TextInput, {
|
|
14479
|
+
type: masked ? "password" : "text",
|
|
14480
|
+
fw: 300,
|
|
14481
|
+
p: 0,
|
|
14482
|
+
c: "adiba",
|
|
14483
|
+
value: value,
|
|
14484
|
+
variant: "unstyled",
|
|
14485
|
+
readOnly: true
|
|
14486
|
+
})), /*#__PURE__*/React.createElement(core.ActionIcon, {
|
|
14487
|
+
variant: "transparent",
|
|
14488
|
+
onClick: () => onMasked() ? toggle() : void 0
|
|
14489
|
+
}, icon && /*#__PURE__*/React.createElement(Icons, {
|
|
14490
|
+
size: 24,
|
|
14491
|
+
color: "gray",
|
|
14492
|
+
name: name
|
|
14493
|
+
}))));
|
|
14494
|
+
};
|
|
14495
|
+
const TilePanel = _ref2 => {
|
|
14496
|
+
let {
|
|
14497
|
+
label,
|
|
14498
|
+
value
|
|
14499
|
+
} = _ref2;
|
|
14500
|
+
return /*#__PURE__*/React.createElement(core.Card, {
|
|
14501
|
+
p: "md",
|
|
14502
|
+
bg: "gray.0",
|
|
14503
|
+
style: {
|
|
14504
|
+
borderRadius: "10px"
|
|
14505
|
+
}
|
|
14506
|
+
}, /*#__PURE__*/React.createElement(core.Group, {
|
|
14507
|
+
justify: "space-between"
|
|
14508
|
+
}, /*#__PURE__*/React.createElement(core.Stack, {
|
|
14509
|
+
gap: 0,
|
|
14510
|
+
p: 0
|
|
14511
|
+
}, /*#__PURE__*/React.createElement(core.Text, {
|
|
14512
|
+
fz: "sm",
|
|
14513
|
+
fw: 300,
|
|
14514
|
+
p: 0,
|
|
14515
|
+
c: "gray.7"
|
|
14516
|
+
}, label), /*#__PURE__*/React.createElement(core.TextInput, {
|
|
14517
|
+
fw: 300,
|
|
14518
|
+
p: 0,
|
|
14519
|
+
c: "adiba",
|
|
14520
|
+
value: value,
|
|
14521
|
+
variant: "unstyled",
|
|
14522
|
+
readOnly: true
|
|
14523
|
+
}))));
|
|
14524
|
+
};
|
|
13318
14525
|
|
|
13319
14526
|
var ConfirmAnimation = "data:null;base64,UEsDBBQAAAAIAEoK11qAribJgAAAALUAAAANAAAAbWFuaWZlc3QuanNvbo2OwQ7CIBBE/2XPUoFI0vbUH/ALjIcNUMVQ1sBqYpr+u+vFc28zk3mZWeEda0tUYAQDB7jFEisyVfFTIM7EnOLxr9SjTaaznZYuvvi+r1jSgiwjDcbLCikI471Dh1YrN2CvTrO3qrcW1WyM14O2Ev/+PDN+zhSiEIXqghm26/YFUEsDBBQAAAAIAEoK11olD9QhehoAAFmNAQA0AAAAYW5pbWF0aW9ucy9jYzVhNWEyMC01OWE4LTRmYzItODIyYS1mMTFjMDkwMjU5YTEuanNvbtXdzXLjWHIF4FfRYM2iibyZeUmtPP+rjuhwO2ZT0eFgS6yWpiSxguTMuKOiVn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nrtHPNw3tx+2T8fdonl+ift++4ff/fHmL7u70/5w86fHp9PucPPu5l9+HwUvUdD89nDY3e9f7reHm7vty2l/vGnjrjIb+Xr22s+//TLO+Hj6thn/+bD99PB4F3P+4XTYf9wNc//Xw/a//+O//nN7v+9m+3QX3WPy127y/BTzjNF5sxDtql+KSFXzjzd32WV4os+rO963i9UyPgfOMYmvE/NF2w9+uqzJh6dr1yQGs9R06/H9Ybd7uXt4fN7FEHar8o1LUNYiRjnWtrKadlnE0yH6xiNe910tVn2nPnhvZhpN4v/jysYD4uZfB6osxKev+0rq6+LpYzqHsV81x7fL8yqhlfXJX7782GX/JQZZyk9/j1WzZbtcx9p9iBlJbMd9LI57PCqmso61Ph53p7IL/fjlfwBQSwECFAAUAAAACABKCtdagK4myYAAAAC1AAAADQAAAAAAAAAAAAAAAAAAAAAAbWFuaWZlc3QuanNvblBLAQIUABQAAAAIAEoK11olD9QhehoAAFmNAQA0AAAAAAAAAAAAAAAAAKsAAABhbmltYXRpb25zL2NjNWE1YTIwLTU5YTgtNGZjMi04MjJhLWYxMWMwOTAyNTlhMS5qc29uUEsFBgAAAAACAAIAnQAAAHcbAAAAAA==";
|
|
13320
14527
|
|
|
@@ -13502,6 +14709,7 @@ exports.File = File;
|
|
|
13502
14709
|
exports.Icons = Icons;
|
|
13503
14710
|
exports.InfoModal = InfoModal;
|
|
13504
14711
|
exports.LabelPanel = LabelPanel;
|
|
14712
|
+
exports.MaskedTilePanel = MaskedTilePanel;
|
|
13505
14713
|
exports.PageTitle = PageTitle;
|
|
13506
14714
|
exports.PaymentMethod = PaymentMethod;
|
|
13507
14715
|
exports.PaymentMethodAdd = PaymentMethodAdd;
|
|
@@ -13517,6 +14725,7 @@ exports.SimpleText = SimpleText;
|
|
|
13517
14725
|
exports.StackedColumn = StackedColumn;
|
|
13518
14726
|
exports.SubscriptionPlans = SubscriptionPlans;
|
|
13519
14727
|
exports.SuccessModal = SuccessModal;
|
|
14728
|
+
exports.TilePanel = TilePanel;
|
|
13520
14729
|
exports.TitleWithIndex = TitleWithIndex;
|
|
13521
14730
|
exports.TitledPanel = TitledPanel;
|
|
13522
14731
|
exports.TwoFactorModal = TwoFactorModal;
|