@gobolt/genesis 0.0.11 → 0.1.1
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/README.md +6 -0
- package/dist/ClockCircleOutlined-BaXQuLIn.js +13 -0
- package/dist/{Compact-DBh6nSYB.js → Compact-Du9689ax.js} +8 -8
- package/dist/{ContextIsolator-CwuJooYf.js → ContextIsolator-BmfhJgG0.js} +2 -2
- package/dist/{DownOutlined-5-15jS0h.js → DownOutlined-Dcq69ZKM.js} +9 -9
- package/dist/{EllipsisOutlined-CJ2pgE2d.js → EllipsisOutlined-DGMph0Bj.js} +110 -110
- package/dist/{Keyframes-sPZXYuXt.js → Keyframes-C9_aCDvn.js} +1 -1
- package/dist/{Overflow-DdNKJLQh.js → Overflow-DWf4XIal.js} +31 -31
- package/dist/{Skeleton-B3vg9CbL.js → Skeleton-BVN4pcVe.js} +2 -2
- package/dist/TextArea-Bkf9hh7l.js +708 -0
- package/dist/{Typography-DqI7RslA.js → Typography-CoZ5qD-t.js} +3 -3
- package/dist/{button-B2Rgggx2.js → button-BwqpCxVM.js} +5 -5
- package/dist/components/Avatar/Avatar.js +3 -3
- package/dist/components/Avatar/__tests__/Avatar.test.js +1 -1
- package/dist/components/Avatar/styles.js +42 -42
- package/dist/components/Badge/Badge.js +3 -3
- package/dist/components/Badge/__tests__/Badge.test.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +1 -1
- package/dist/components/Breadcrumb/styles.js +4 -4
- package/dist/components/Button/__tests__/Button.test.js +1 -1
- package/dist/components/Button/styles.js +1 -1
- package/dist/components/Card/__tests__/Card.test.js +1 -1
- package/dist/components/Card/styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -3
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +1 -1
- package/dist/components/Checkbox/styles.js +1 -1
- package/dist/components/Dashboard/__stories__/DashboardLayoutContent.js +8 -8
- package/dist/components/Dashboard/__stories__/DashboardLayoutHeader.js +4 -4
- package/dist/components/Dashboard/__tests__/Dashboard.test.js +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +6 -0
- package/dist/components/DatePicker/DatePicker.js +5 -0
- package/dist/components/DatePicker/__stories__/DatePicker.stories.d.ts +10 -0
- package/dist/components/DatePicker/__tests__/DatePicker.test.d.ts +1 -0
- package/dist/components/DatePicker/__tests__/DatePicker.test.js +19 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +5 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +5 -0
- package/dist/components/DateRangePicker/__stories__/DateRangePicker.stories.d.ts +9 -0
- package/dist/components/DateRangePicker/__tests__/DateRangePicker.test.d.ts +1 -0
- package/dist/components/DateRangePicker/__tests__/DateRangePicker.test.js +23 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/DateRangePicker/index.js +4 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js +3 -3
- package/dist/components/ErrorBoundary/__tests__/ErrorBoundary.test.js +1 -1
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +3 -3
- package/dist/components/ErrorBoundaryFallback/styles.js +1 -1
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/__stories__/FormStory.js +4 -4
- package/dist/components/Form/__tests__/form.test.js +2 -2
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Form/styles.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/__tests__/Input.test.js +1 -1
- package/dist/components/Input/styles.js +1 -1
- package/dist/components/Layout/Content/ResponsiveContent.js +3 -3
- package/dist/components/Layout/MainLayout/MainLayout.js +1 -1
- package/dist/components/Layout/__tests__/Layout.test.js +1 -1
- package/dist/components/Message/Message.js +3 -3
- package/dist/components/Message/__tests__/Message.test.js +1 -1
- package/dist/components/Notification/Notification.js +3 -3
- package/dist/components/Notification/NotificationBadge/__tests__/NotificationBadge.test.js +1 -1
- package/dist/components/Notification/__tests__/Notification.test.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/__tests__/Popover.test.js +1 -1
- package/dist/components/Popover/styles.js +1 -1
- package/dist/components/Progress/Progress.js +3 -3
- package/dist/components/Progress/Progress.util.js +3 -3
- package/dist/components/Progress/ProgressText.js +3 -3
- package/dist/components/Progress/__tests__/Progress.test.js +1 -1
- package/dist/components/Progress/styles.js +3 -3
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Radio/RadioGroup.js +1 -1
- package/dist/components/Radio/__tests__/RadioGroup.test.js +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/Row/RowActions/RowActions.js +3 -3
- package/dist/components/Row/RowLabelValue/RowLabelValue.js +3 -3
- package/dist/components/Row/RowLabelValue/styles.js +1 -1
- package/dist/components/Row/__tests__/Row.test.js +1 -1
- package/dist/components/SegmentedControls/__tests__/SegmentedControls.test.js +1 -1
- package/dist/components/SegmentedControls/styles.js +27 -27
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/__tests__/Select.test.js +1 -1
- package/dist/components/Select/styles.js +1 -1
- package/dist/components/Shapes/__tests__/Shapes.test.js +1 -1
- package/dist/components/Switch/__tests__/Switch.test.js +1 -1
- package/dist/components/Switch/styles.js +15 -15
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/__mocks__/table-mocks.js +3 -3
- package/dist/components/Table/__tests__/Table.test.js +1 -1
- package/dist/components/Table/styles.js +1 -1
- package/dist/components/Tabs/__tests__/Tabs.test.js +1 -1
- package/dist/components/Tabs/styles.js +1 -1
- package/dist/components/Tile/__tests__/Tile.test.js +1 -1
- package/dist/components/Toast/Toast.js +3 -3
- package/dist/components/Toast/__tests__/Toast.test.js +2 -2
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +3 -3
- package/dist/components/Tooltip/__tests__/Tooltip.test.js +1 -1
- package/dist/components/Tooltip/styles.js +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/Typography/__tests__/Typography.test.js +2 -2
- package/dist/components/Typography/index.js +1 -1
- package/dist/components/Typography/styles.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +46 -42
- package/dist/{context-Cx7GtZpz.js → context-DIFtNa4d.js} +70 -70
- package/dist/{dropdown-zGGFIyJ_.js → dropdown-Dp_PTQ2u.js} +60 -59
- package/dist/genesis/GenesisThemeBreakdown.js +86 -44
- package/dist/genesis/labs/Lab.stories.d.ts +6 -0
- package/dist/genesis/styles.js +2 -2
- package/dist/{index-CdiHBmVe.js → index-BPVue1Yd.js} +44 -44
- package/dist/{index-CRotrkWm.js → index-BQM5OniU.js} +7 -7
- package/dist/{index-BTGF--50.js → index-B_1Ge8na.js} +20 -19
- package/dist/{index-ByspLxrB.js → index-BbTV2Cw5.js} +32 -31
- package/dist/index-BeGv28kJ.js +5173 -0
- package/dist/{index-Dyl-ddV6.js → index-BpZSuIUV.js} +16 -16
- package/dist/{index-CodMmNWv.js → index-BvOLXELm.js} +3 -3
- package/dist/{index-hoPiccJv.js → index-CLSrpQRW.js} +9 -8
- package/dist/{index-D0P16DlX.js → index-CbVOl2U6.js} +26 -24
- package/dist/{index-DWUXwgXK.js → index-D0U6r5O7.js} +265 -294
- package/dist/{index-BW_7pvTr.js → index-DEu2PVzQ.js} +4 -4
- package/dist/{index-DmZOkMjs.js → index-DNQ-jnBx.js} +1207 -1514
- package/dist/index-DOsPeIWJ.js +1000 -0
- package/dist/{index-CSPlXIlA.js → index-DRGX1Wem.js} +7 -7
- package/dist/index-DWjq9XYj.js +899 -0
- package/dist/index.js +53 -49
- package/dist/motion-CUN72xsH.js +33 -0
- package/dist/providers/GenesisProvider.js +1 -1
- package/dist/providers/ToastProvider.js +3 -3
- package/dist/providers/index.js +1 -1
- package/dist/providers/useGenesis.js +1 -1
- package/dist/{responsiveObserver-O1kw80RG.js → responsiveObserver-dCkpy7Cb.js} +1 -1
- package/dist/roundedArrow-DI_Q-xdU.js +65 -0
- package/dist/{setup-CKu7-AfI.js → setup-BjIR5S0o.js} +2458 -2433
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +7 -7
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +3 -3
- package/dist/styles/theme/genesis-theme.js +211 -349
- package/dist/styles/theme/theme-tree/ThemeTree.js +114 -113
- package/dist/{styles-BSD221S5.js → styles-CWdUpZom.js} +12 -12
- package/dist/{styles-BDbHpHsc.js → styles-D1vKDy9V.js} +9 -9
- package/dist/{styles-D9iYILpv.js → styles-qerRs7Rn.js} +493 -492
- package/dist/test/setup.js +2 -2
- package/dist/{toArray-DGvPoJP_.js → toArray-U3Az44CO.js} +1 -1
- package/dist/{useBreakpoint-CAMzKscx.js → useBreakpoint-TkMv121M.js} +2 -2
- package/dist/{useCSSVarCls-C-MlZC6a.js → useCSSVarCls-Dau77fzS.js} +1 -1
- package/dist/useIcons-Ck4JP1m9.js +321 -0
- package/dist/{useLocale-DWRfeMSS.js → useLocale-CTfNpakL.js} +1 -1
- package/dist/{useMergedState-BoELfaU9.js → useMergedState-D6toxSxh.js} +1 -1
- package/dist/{useSize-CPo2bUE3.js → useSize-DSq4r6zy.js} +1 -1
- package/dist/{useVariants-Cin23jEC.js → useVariants-DrLzUVLU.js} +2 -2
- package/dist/{useZIndex-D81lkWy4.js → useZIndex-DhyHuZTN.js} +1 -1
- package/dist/utils/icon-util.js +38 -44
- package/package.json +2 -1
- package/dist/TextArea-CKWbFr0u.js +0 -1698
- package/dist/index-CqqwGTME.js +0 -956
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as E from "react";
|
|
2
2
|
import { useRef as we, useState as lr, useMemo as fr, useContext as cr, useEffect as dr } from "react";
|
|
3
|
-
import { w as D, f as W, _ as
|
|
3
|
+
import { w as D, f as W, _ as N, b as d, g as Ae, d as Ye, a as ue } from "./presets-Djh_L_6R.js";
|
|
4
4
|
import { _ as oe, a as Y } from "./asyncToGenerator-CKP9bEZn.js";
|
|
5
|
-
import { a3 as gr, a4 as Be, a5 as vr,
|
|
6
|
-
import { t as hr } from "./toArray-
|
|
5
|
+
import { a3 as gr, a4 as Be, a5 as vr, o as k, x as Ze, y as Xe, e as le, a6 as q, _ as fe, a7 as ie, X, Y as B, $ as Le } from "./index-BbTV2Cw5.js";
|
|
6
|
+
import { t as hr } from "./toArray-U3Az44CO.js";
|
|
7
7
|
import { o as mr } from "./omit-B_u6A-HL.js";
|
|
8
8
|
var Q = "RC_FORM_INTERNAL_HOOKS", I = function() {
|
|
9
9
|
D(!1, "Can not find FormContext. Please make sure you wrap Field under Form.");
|
|
@@ -254,7 +254,7 @@ function Pr(s, t, e, n, r) {
|
|
|
254
254
|
function Cr(s) {
|
|
255
255
|
return !!(s && s.message !== void 0);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function xr(s, t) {
|
|
258
258
|
for (var e = s, n = 0; n < t.length; n++) {
|
|
259
259
|
if (e == null)
|
|
260
260
|
return e;
|
|
@@ -265,7 +265,7 @@ function Nr(s, t) {
|
|
|
265
265
|
function _e(s, t) {
|
|
266
266
|
return function(e) {
|
|
267
267
|
var n;
|
|
268
|
-
return s.fullFields ? n =
|
|
268
|
+
return s.fullFields ? n = xr(t, s.fullFields) : n = t[e.field || s.fullField], Cr(e) ? (e.field = e.field || s.fullField, e.fieldValue = n, e) : {
|
|
269
269
|
message: typeof e == "function" ? e() : e,
|
|
270
270
|
fieldValue: n,
|
|
271
271
|
field: e.field || s.fullField
|
|
@@ -277,12 +277,12 @@ function We(s, t) {
|
|
|
277
277
|
for (var e in t)
|
|
278
278
|
if (t.hasOwnProperty(e)) {
|
|
279
279
|
var n = t[e];
|
|
280
|
-
W(n) === "object" && W(s[e]) === "object" ? s[e] =
|
|
280
|
+
W(n) === "object" && W(s[e]) === "object" ? s[e] = N(N({}, s[e]), n) : s[e] = n;
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
return s;
|
|
284
284
|
}
|
|
285
|
-
var ee = "enum",
|
|
285
|
+
var ee = "enum", Nr = function(t, e, n, r, i) {
|
|
286
286
|
t[ee] = Array.isArray(t[ee]) ? t[ee] : [], t[ee].indexOf(e) === -1 && r.push(H(i.messages[ee], t.fullField, t[ee].join(", ")));
|
|
287
287
|
}, Rr = function(t, e, n, r, i) {
|
|
288
288
|
if (t.pattern) {
|
|
@@ -397,7 +397,7 @@ const $ = {
|
|
|
397
397
|
whitespace: Ar,
|
|
398
398
|
type: $r,
|
|
399
399
|
range: Or,
|
|
400
|
-
enum:
|
|
400
|
+
enum: Nr,
|
|
401
401
|
pattern: Rr
|
|
402
402
|
};
|
|
403
403
|
var qr = function(t, e, n, r, i) {
|
|
@@ -590,9 +590,9 @@ var ce = /* @__PURE__ */ function() {
|
|
|
590
590
|
var m = n.rules[p], c = a[p];
|
|
591
591
|
m.forEach(function(F) {
|
|
592
592
|
var v = F;
|
|
593
|
-
typeof v.transform == "function" && (a === e && (a =
|
|
593
|
+
typeof v.transform == "function" && (a === e && (a = N({}, a)), c = a[p] = v.transform(c), c != null && (v.type = v.type || (Array.isArray(c) ? "array" : W(c)))), typeof v == "function" ? v = {
|
|
594
594
|
validator: v
|
|
595
|
-
} : v =
|
|
595
|
+
} : v = N({}, v), v.validator = n.getValidationMethod(v), v.validator && (v.field = p, v.fullField = v.fullField || p, v.type = n.getType(v), g[p] = g[p] || [], g[p].push({
|
|
596
596
|
rule: v,
|
|
597
597
|
value: c,
|
|
598
598
|
source: a,
|
|
@@ -604,14 +604,14 @@ var ce = /* @__PURE__ */ function() {
|
|
|
604
604
|
return Pr(g, u, function(p, m) {
|
|
605
605
|
var c = p.rule, F = (c.type === "object" || c.type === "array") && (W(c.fields) === "object" || W(c.defaultField) === "object");
|
|
606
606
|
F = F && (c.required || !c.required && p.value), c.field = p.field;
|
|
607
|
-
function v(
|
|
608
|
-
return
|
|
609
|
-
fullField: "".concat(c.fullField, ".").concat(
|
|
610
|
-
fullFields: c.fullFields ? [].concat(k(c.fullFields), [
|
|
607
|
+
function v(x, R) {
|
|
608
|
+
return N(N({}, R), {}, {
|
|
609
|
+
fullField: "".concat(c.fullField, ".").concat(x),
|
|
610
|
+
fullFields: c.fullFields ? [].concat(k(c.fullFields), [x]) : [x]
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
613
|
function y() {
|
|
614
|
-
var
|
|
614
|
+
var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], R = Array.isArray(x) ? x : [x];
|
|
615
615
|
!u.suppressWarning && R.length && s.warning("async-validator:", R), R.length && c.message !== void 0 && (R = [].concat(c.message));
|
|
616
616
|
var w = R.map(_e(c, a));
|
|
617
617
|
if (u.first && w.length)
|
|
@@ -624,7 +624,7 @@ var ce = /* @__PURE__ */ function() {
|
|
|
624
624
|
var P = {};
|
|
625
625
|
c.defaultField && Object.keys(p.value).map(function(S) {
|
|
626
626
|
P[S] = c.defaultField;
|
|
627
|
-
}), P =
|
|
627
|
+
}), P = N(N({}, P), p.rule.fields);
|
|
628
628
|
var O = {};
|
|
629
629
|
Object.keys(P).forEach(function(S) {
|
|
630
630
|
var M = P[S], z = Array.isArray(M) ? M : [M];
|
|
@@ -643,18 +643,18 @@ var ce = /* @__PURE__ */ function() {
|
|
|
643
643
|
else if (c.validator) {
|
|
644
644
|
try {
|
|
645
645
|
C = c.validator(c, p.value, y, p.source, u);
|
|
646
|
-
} catch (
|
|
646
|
+
} catch (x) {
|
|
647
647
|
var V, A;
|
|
648
|
-
(V = (A = console).error) === null || V === void 0 || V.call(A,
|
|
649
|
-
throw
|
|
650
|
-
}, 0), y(
|
|
648
|
+
(V = (A = console).error) === null || V === void 0 || V.call(A, x), u.suppressValidatorError || setTimeout(function() {
|
|
649
|
+
throw x;
|
|
650
|
+
}, 0), y(x.message);
|
|
651
651
|
}
|
|
652
652
|
C === !0 ? y() : C === !1 ? y(typeof c.message == "function" ? c.message(c.fullField || c.field) : c.message || "".concat(c.fullField || c.field, " fails")) : C instanceof Array ? y(C) : C instanceof Error && y(C.message);
|
|
653
653
|
}
|
|
654
654
|
C && C.then && C.then(function() {
|
|
655
655
|
return y();
|
|
656
|
-
}, function(
|
|
657
|
-
return y(
|
|
656
|
+
}, function(x) {
|
|
657
|
+
return y(x);
|
|
658
658
|
});
|
|
659
659
|
}, function(p) {
|
|
660
660
|
f(p);
|
|
@@ -741,23 +741,23 @@ function Jr(s, t) {
|
|
|
741
741
|
});
|
|
742
742
|
}
|
|
743
743
|
var Ke = "CODE_LOGIC_ERROR";
|
|
744
|
-
function
|
|
745
|
-
return
|
|
744
|
+
function xe(s, t, e, n, r) {
|
|
745
|
+
return Ne.apply(this, arguments);
|
|
746
746
|
}
|
|
747
|
-
function
|
|
748
|
-
return
|
|
747
|
+
function Ne() {
|
|
748
|
+
return Ne = oe(/* @__PURE__ */ Y().mark(function s(t, e, n, r, i) {
|
|
749
749
|
var a, u, l, f, o, g, h, b, p;
|
|
750
750
|
return Y().wrap(function(c) {
|
|
751
751
|
for (; ; ) switch (c.prev = c.next) {
|
|
752
752
|
case 0:
|
|
753
|
-
return a =
|
|
753
|
+
return a = N({}, n), delete a.ruleIndex, He.warning = function() {
|
|
754
754
|
}, a.validator && (u = a.validator, a.validator = function() {
|
|
755
755
|
try {
|
|
756
756
|
return u.apply(void 0, arguments);
|
|
757
757
|
} catch (F) {
|
|
758
758
|
return console.error(F), Promise.reject(Ke);
|
|
759
759
|
}
|
|
760
|
-
}), l = null, a && a.type === "array" && a.defaultField && (l = a.defaultField, delete a.defaultField), f = new He(d({}, t, [a])), o = ie(rr, r.validateMessages), f.messages(o), g = [], c.prev = 10, c.next = 13, Promise.resolve(f.validate(d({}, t, e),
|
|
760
|
+
}), l = null, a && a.type === "array" && a.defaultField && (l = a.defaultField, delete a.defaultField), f = new He(d({}, t, [a])), o = ie(rr, r.validateMessages), f.messages(o), g = [], c.prev = 10, c.next = 13, Promise.resolve(f.validate(d({}, t, e), N({}, r)));
|
|
761
761
|
case 13:
|
|
762
762
|
c.next = 18;
|
|
763
763
|
break;
|
|
@@ -777,14 +777,14 @@ function xe() {
|
|
|
777
777
|
break;
|
|
778
778
|
}
|
|
779
779
|
return c.next = 21, Promise.all(e.map(function(F, v) {
|
|
780
|
-
return
|
|
780
|
+
return xe("".concat(t, ".").concat(v), F, l, r, i);
|
|
781
781
|
}));
|
|
782
782
|
case 21:
|
|
783
783
|
return h = c.sent, c.abrupt("return", h.reduce(function(F, v) {
|
|
784
784
|
return [].concat(k(F), k(v));
|
|
785
785
|
}, []));
|
|
786
786
|
case 23:
|
|
787
|
-
return b =
|
|
787
|
+
return b = N(N({}, n), {}, {
|
|
788
788
|
name: t,
|
|
789
789
|
enum: (n.enum || []).join(", ")
|
|
790
790
|
}, i), p = g.map(function(F) {
|
|
@@ -795,17 +795,17 @@ function xe() {
|
|
|
795
795
|
return c.stop();
|
|
796
796
|
}
|
|
797
797
|
}, s, null, [[10, 15]]);
|
|
798
|
-
})),
|
|
798
|
+
})), Ne.apply(this, arguments);
|
|
799
799
|
}
|
|
800
800
|
function Yr(s, t, e, n, r, i) {
|
|
801
801
|
var a = s.join("."), u = e.map(function(o, g) {
|
|
802
|
-
var h = o.validator, b =
|
|
802
|
+
var h = o.validator, b = N(N({}, o), {}, {
|
|
803
803
|
ruleIndex: g
|
|
804
804
|
});
|
|
805
805
|
return h && (b.validator = function(p, m, c) {
|
|
806
806
|
var F = !1, v = function() {
|
|
807
|
-
for (var V = arguments.length, A = new Array(V),
|
|
808
|
-
A[
|
|
807
|
+
for (var V = arguments.length, A = new Array(V), x = 0; x < V; x++)
|
|
808
|
+
A[x] = arguments[x];
|
|
809
809
|
Promise.resolve().then(function() {
|
|
810
810
|
D(!F, "Your validator function has already return a promise. `callback` will be ignored."), F || c.apply(void 0, A);
|
|
811
811
|
});
|
|
@@ -833,7 +833,7 @@ function Yr(s, t, e, n, r, i) {
|
|
|
833
833
|
v.next = 12;
|
|
834
834
|
break;
|
|
835
835
|
}
|
|
836
|
-
return m = u[p], v.next = 5,
|
|
836
|
+
return m = u[p], v.next = 5, xe(a, t, m, n, i);
|
|
837
837
|
case 5:
|
|
838
838
|
if (c = v.sent, !c.length) {
|
|
839
839
|
v.next = 9;
|
|
@@ -860,7 +860,7 @@ function Yr(s, t, e, n, r, i) {
|
|
|
860
860
|
}());
|
|
861
861
|
else {
|
|
862
862
|
var f = u.map(function(o) {
|
|
863
|
-
return
|
|
863
|
+
return xe(a, t, o, n, i).then(function(g) {
|
|
864
864
|
return {
|
|
865
865
|
errors: g,
|
|
866
866
|
rule: o
|
|
@@ -995,7 +995,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
995
995
|
}), d(q(r), "metaCache", null), d(q(r), "triggerMetaEvent", function(l) {
|
|
996
996
|
var f = r.props.onMetaChange;
|
|
997
997
|
if (f) {
|
|
998
|
-
var o =
|
|
998
|
+
var o = N(N({}, r.getMeta()), {}, {
|
|
999
999
|
destroy: l
|
|
1000
1000
|
});
|
|
1001
1001
|
Le(r.metaCache, o) || f(o), r.metaCache = o;
|
|
@@ -1034,8 +1034,8 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1034
1034
|
}
|
|
1035
1035
|
case "dependenciesUpdate": {
|
|
1036
1036
|
var A = p.map(L);
|
|
1037
|
-
if (A.some(function(
|
|
1038
|
-
return te(o.relatedFields,
|
|
1037
|
+
if (A.some(function(x) {
|
|
1038
|
+
return te(o.relatedFields, x);
|
|
1039
1039
|
})) {
|
|
1040
1040
|
r.reRender();
|
|
1041
1041
|
return;
|
|
@@ -1052,7 +1052,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1052
1052
|
h === !0 && r.reRender();
|
|
1053
1053
|
}), d(q(r), "validateRules", function(l) {
|
|
1054
1054
|
var f = r.getNamePath(), o = r.getValue(), g = l || {}, h = g.triggerName, b = g.validateOnly, p = b === void 0 ? !1 : b, m = Promise.resolve().then(/* @__PURE__ */ oe(/* @__PURE__ */ Y().mark(function c() {
|
|
1055
|
-
var F, v, y, C, V, A,
|
|
1055
|
+
var F, v, y, C, V, A, x;
|
|
1056
1056
|
return Y().wrap(function(w) {
|
|
1057
1057
|
for (; ; ) switch (w.prev = w.next) {
|
|
1058
1058
|
case 0:
|
|
@@ -1084,7 +1084,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
return w.abrupt("return", []);
|
|
1086
1086
|
case 10:
|
|
1087
|
-
return
|
|
1087
|
+
return x = Yr(f, o, A, l, y, C), x.catch(function(P) {
|
|
1088
1088
|
return P;
|
|
1089
1089
|
}).then(function() {
|
|
1090
1090
|
var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K;
|
|
@@ -1097,7 +1097,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1097
1097
|
z ? S.push.apply(S, k(G)) : T.push.apply(T, k(G));
|
|
1098
1098
|
}), r.errors = T, r.warnings = S, r.triggerMetaEvent(), r.reRender();
|
|
1099
1099
|
}
|
|
1100
|
-
}), w.abrupt("return",
|
|
1100
|
+
}), w.abrupt("return", x);
|
|
1101
1101
|
case 13:
|
|
1102
1102
|
case "end":
|
|
1103
1103
|
return w.stop();
|
|
@@ -1138,7 +1138,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1138
1138
|
}), d(q(r), "getOnlyChild", function(l) {
|
|
1139
1139
|
if (typeof l == "function") {
|
|
1140
1140
|
var f = r.getMeta();
|
|
1141
|
-
return
|
|
1141
|
+
return N(N({}, r.getOnlyChild(l(r.getControlled(), f, r.props.fieldContext))), {}, {
|
|
1142
1142
|
isFunction: !0
|
|
1143
1143
|
});
|
|
1144
1144
|
}
|
|
@@ -1154,18 +1154,18 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1154
1154
|
var f = r.props.fieldContext.getFieldsValue, o = r.getNamePath();
|
|
1155
1155
|
return X(l || f(!0), o);
|
|
1156
1156
|
}), d(q(r), "getControlled", function() {
|
|
1157
|
-
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, f = r.props, o = f.name, g = f.trigger, h = f.validateTrigger, b = f.getValueFromEvent, p = f.normalize, m = f.valuePropName, c = f.getValueProps, F = f.fieldContext, v = h !== void 0 ? h : F.validateTrigger, y = r.getNamePath(), C = F.getInternalHooks, V = F.getFieldsValue, A = C(Q),
|
|
1157
|
+
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, f = r.props, o = f.name, g = f.trigger, h = f.validateTrigger, b = f.getValueFromEvent, p = f.normalize, m = f.valuePropName, c = f.getValueProps, F = f.fieldContext, v = h !== void 0 ? h : F.validateTrigger, y = r.getNamePath(), C = F.getInternalHooks, V = F.getFieldsValue, A = C(Q), x = A.dispatch, R = r.getValue(), w = c || function(M) {
|
|
1158
1158
|
return d({}, m, M);
|
|
1159
1159
|
}, P = l[g], O = o !== void 0 ? w(R) : {};
|
|
1160
1160
|
process.env.NODE_ENV !== "production" && O && Object.keys(O).forEach(function(M) {
|
|
1161
1161
|
D(typeof O[M] != "function", "It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(M, ")"));
|
|
1162
1162
|
});
|
|
1163
|
-
var T =
|
|
1163
|
+
var T = N(N({}, l), O);
|
|
1164
1164
|
T[g] = function() {
|
|
1165
1165
|
r.touched = !0, r.dirty = !0, r.triggerMetaEvent();
|
|
1166
1166
|
for (var M, z = arguments.length, _ = new Array(z), G = 0; G < z; G++)
|
|
1167
1167
|
_[G] = arguments[G];
|
|
1168
|
-
b ? M = b.apply(void 0, _) : M = Qr.apply(void 0, [m].concat(_)), p && (M = p(M, R, V(!0))), M !== R &&
|
|
1168
|
+
b ? M = b.apply(void 0, _) : M = Qr.apply(void 0, [m].concat(_)), p && (M = p(M, R, V(!0))), M !== R && x({
|
|
1169
1169
|
type: "updateValue",
|
|
1170
1170
|
namePath: y,
|
|
1171
1171
|
value: M
|
|
@@ -1177,7 +1177,7 @@ var qe = /* @__PURE__ */ function(s) {
|
|
|
1177
1177
|
T[M] = function() {
|
|
1178
1178
|
z && z.apply(void 0, arguments);
|
|
1179
1179
|
var _ = r.props.rules;
|
|
1180
|
-
_ && _.length &&
|
|
1180
|
+
_ && _.length && x({
|
|
1181
1181
|
type: "validateField",
|
|
1182
1182
|
namePath: y,
|
|
1183
1183
|
triggerName: M
|
|
@@ -1243,7 +1243,7 @@ function rt(s) {
|
|
|
1243
1243
|
var m = L(u.prefixName) || [];
|
|
1244
1244
|
return [].concat(k(m), k(L(t)));
|
|
1245
1245
|
}, [u.prefixName, t]), h = E.useMemo(function() {
|
|
1246
|
-
return
|
|
1246
|
+
return N(N({}, u), {}, {
|
|
1247
1247
|
prefixName: g
|
|
1248
1248
|
});
|
|
1249
1249
|
}, [u, g]), b = E.useMemo(function() {
|
|
@@ -1295,8 +1295,8 @@ function rt(s) {
|
|
|
1295
1295
|
w < 0 || w >= O.length || P < 0 || P >= O.length || (o.keys = Ge(o.keys, w, P), y(Ge(O, w, P)));
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
1298
|
-
},
|
|
1299
|
-
return Array.isArray(
|
|
1298
|
+
}, x = v || [];
|
|
1299
|
+
return Array.isArray(x) || (x = [], process.env.NODE_ENV !== "production" && D(!1, "Current value of '".concat(g.join(" > "), "' is not an array type."))), n(x.map(function(R, w) {
|
|
1300
1300
|
var P = o.keys[w];
|
|
1301
1301
|
return P === void 0 && (o.keys[w] = o.id, P = o.keys[w], o.id += 1), {
|
|
1302
1302
|
name: w,
|
|
@@ -1646,7 +1646,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1646
1646
|
}), e.notifyWatch(i);
|
|
1647
1647
|
}), d(this, "getFields", function() {
|
|
1648
1648
|
var n = e.getFieldEntities(!0), r = n.map(function(i) {
|
|
1649
|
-
var a = i.getNamePath(), u = i.getMeta(), l =
|
|
1649
|
+
var a = i.getNamePath(), u = i.getMeta(), l = N(N({}, u), {}, {
|
|
1650
1650
|
name: a,
|
|
1651
1651
|
value: e.getFieldValue(a)
|
|
1652
1652
|
});
|
|
@@ -1714,7 +1714,7 @@ var re = /* @__PURE__ */ function() {
|
|
|
1714
1714
|
}
|
|
1715
1715
|
}), d(this, "notifyObservers", function(n, r, i) {
|
|
1716
1716
|
if (e.subscribable) {
|
|
1717
|
-
var a =
|
|
1717
|
+
var a = N(N({}, i), {}, {
|
|
1718
1718
|
store: e.getFieldsValue(!0)
|
|
1719
1719
|
});
|
|
1720
1720
|
e.getFieldEntities().forEach(function(u) {
|
|
@@ -1810,8 +1810,8 @@ var re = /* @__PURE__ */ function() {
|
|
|
1810
1810
|
if (u || l.push(v.getNamePath()), !(!v.props.rules || !v.props.rules.length) && !(p && !v.isFieldDirty())) {
|
|
1811
1811
|
var y = v.getNamePath();
|
|
1812
1812
|
if (g.add(y.join(o)), !u || te(l, y, b)) {
|
|
1813
|
-
var C = v.validateRules(
|
|
1814
|
-
validateMessages:
|
|
1813
|
+
var C = v.validateRules(N({
|
|
1814
|
+
validateMessages: N(N({}, rr), e.validateMessages)
|
|
1815
1815
|
}, a));
|
|
1816
1816
|
f.push(C.then(function() {
|
|
1817
1817
|
return {
|
|
@@ -1820,17 +1820,17 @@ var re = /* @__PURE__ */ function() {
|
|
|
1820
1820
|
warnings: []
|
|
1821
1821
|
};
|
|
1822
1822
|
}).catch(function(V) {
|
|
1823
|
-
var A,
|
|
1823
|
+
var A, x = [], R = [];
|
|
1824
1824
|
return (A = V.forEach) === null || A === void 0 || A.call(V, function(w) {
|
|
1825
1825
|
var P = w.rule.warningOnly, O = w.errors;
|
|
1826
|
-
P ? R.push.apply(R, k(O)) :
|
|
1827
|
-
}),
|
|
1826
|
+
P ? R.push.apply(R, k(O)) : x.push.apply(x, k(O));
|
|
1827
|
+
}), x.length ? Promise.reject({
|
|
1828
1828
|
name: y,
|
|
1829
|
-
errors:
|
|
1829
|
+
errors: x,
|
|
1830
1830
|
warnings: R
|
|
1831
1831
|
}) : {
|
|
1832
1832
|
name: y,
|
|
1833
|
-
errors:
|
|
1833
|
+
errors: x,
|
|
1834
1834
|
warnings: R
|
|
1835
1835
|
};
|
|
1836
1836
|
}));
|
|
@@ -1908,8 +1908,8 @@ var ke = /* @__PURE__ */ E.createContext({
|
|
|
1908
1908
|
}), sr = function(t) {
|
|
1909
1909
|
var e = t.validateMessages, n = t.onFormChange, r = t.onFormFinish, i = t.children, a = E.useContext(ke), u = E.useRef({});
|
|
1910
1910
|
return /* @__PURE__ */ E.createElement(ke.Provider, {
|
|
1911
|
-
value:
|
|
1912
|
-
validateMessages:
|
|
1911
|
+
value: N(N({}, a), {}, {
|
|
1912
|
+
validateMessages: N(N({}, a.validateMessages), e),
|
|
1913
1913
|
// =========================================================
|
|
1914
1914
|
// = Global Form Control =
|
|
1915
1915
|
// =========================================================
|
|
@@ -1926,25 +1926,25 @@ var ke = /* @__PURE__ */ E.createContext({
|
|
|
1926
1926
|
}), a.triggerFormFinish(f, o);
|
|
1927
1927
|
},
|
|
1928
1928
|
registerForm: function(f, o) {
|
|
1929
|
-
f && (u.current =
|
|
1929
|
+
f && (u.current = N(N({}, u.current), {}, d({}, f, o))), a.registerForm(f, o);
|
|
1930
1930
|
},
|
|
1931
1931
|
unregisterForm: function(f) {
|
|
1932
|
-
var o =
|
|
1932
|
+
var o = N({}, u.current);
|
|
1933
1933
|
delete o[f], u.current = o, a.unregisterForm(f);
|
|
1934
1934
|
}
|
|
1935
1935
|
})
|
|
1936
1936
|
}, i);
|
|
1937
1937
|
}, at = ["name", "initialValues", "fields", "form", "preserve", "children", "component", "validateMessages", "validateTrigger", "onValuesChange", "onFieldsChange", "onFinish", "onFinishFailed", "clearOnDestroy"], st = function(t, e) {
|
|
1938
|
-
var n = t.name, r = t.initialValues, i = t.fields, a = t.form, u = t.preserve, l = t.children, f = t.component, o = f === void 0 ? "form" : f, g = t.validateMessages, h = t.validateTrigger, b = h === void 0 ? "onChange" : h, p = t.onValuesChange, m = t.onFieldsChange, c = t.onFinish, F = t.onFinishFailed, v = t.clearOnDestroy, y = Ae(t, at), C = E.useRef(null), V = E.useContext(ke), A = ar(a),
|
|
1938
|
+
var n = t.name, r = t.initialValues, i = t.fields, a = t.form, u = t.preserve, l = t.children, f = t.component, o = f === void 0 ? "form" : f, g = t.validateMessages, h = t.validateTrigger, b = h === void 0 ? "onChange" : h, p = t.onValuesChange, m = t.onFieldsChange, c = t.onFinish, F = t.onFinishFailed, v = t.clearOnDestroy, y = Ae(t, at), C = E.useRef(null), V = E.useContext(ke), A = ar(a), x = ue(A, 1), R = x[0], w = R.getInternalHooks(Q), P = w.useSubscribe, O = w.setInitialValues, T = w.setCallbacks, S = w.setValidateMessages, M = w.setPreserve, z = w.destroyForm;
|
|
1939
1939
|
E.useImperativeHandle(e, function() {
|
|
1940
|
-
return
|
|
1940
|
+
return N(N({}, R), {}, {
|
|
1941
1941
|
nativeElement: C.current
|
|
1942
1942
|
});
|
|
1943
1943
|
}), E.useEffect(function() {
|
|
1944
1944
|
return V.registerForm(n, R), function() {
|
|
1945
1945
|
V.unregisterForm(n);
|
|
1946
1946
|
};
|
|
1947
|
-
}, [V, R, n]), S(
|
|
1947
|
+
}, [V, R, n]), S(N(N({}, V.validateMessages), g)), T({
|
|
1948
1948
|
onValuesChange: p,
|
|
1949
1949
|
onFieldsChange: function(J) {
|
|
1950
1950
|
if (V.triggerFormChange(n, J), m) {
|
|
@@ -1980,7 +1980,7 @@ var ke = /* @__PURE__ */ E.createContext({
|
|
|
1980
1980
|
Xr(Ie.current || [], i || []) || R.setFields(i || []), Ie.current = i;
|
|
1981
1981
|
}, [i, R]);
|
|
1982
1982
|
var or = E.useMemo(function() {
|
|
1983
|
-
return
|
|
1983
|
+
return N(N({}, R), {}, {
|
|
1984
1984
|
validateTrigger: b
|
|
1985
1985
|
});
|
|
1986
1986
|
}, [R, b]), Se = /* @__PURE__ */ E.createElement(he.Provider, {
|
|
@@ -2026,13 +2026,13 @@ function ot() {
|
|
|
2026
2026
|
return v.current = F, ut(F), dr(
|
|
2027
2027
|
function() {
|
|
2028
2028
|
if (c) {
|
|
2029
|
-
var y = m.getFieldsValue, C = m.getInternalHooks, V = C(Q), A = V.registerWatch,
|
|
2029
|
+
var y = m.getFieldsValue, C = m.getInternalHooks, V = C(Q), A = V.registerWatch, x = function(O, T) {
|
|
2030
2030
|
var S = a.preserve ? T : O;
|
|
2031
2031
|
return typeof n == "function" ? n(S) : X(S, v.current);
|
|
2032
2032
|
}, R = A(function(P, O) {
|
|
2033
|
-
var T =
|
|
2033
|
+
var T = x(P, O), S = Je(T);
|
|
2034
2034
|
b.current !== S && (b.current = S, g(T));
|
|
2035
|
-
}), w =
|
|
2035
|
+
}), w = x(y(), y(!0));
|
|
2036
2036
|
return o !== w && g(w), R;
|
|
2037
2037
|
}
|
|
2038
2038
|
},
|