@gobolt/genesis 0.0.8 → 0.0.10
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 +10 -0
- package/dist/{AntdIcon-c395a1c4.js → AntdIcon-BoLh1dP8.js} +66 -68
- package/dist/CheckOutlined-CeTKr6II.js +13 -0
- package/dist/{CloseCircleFilled-ddc51e7e.js → CloseCircleFilled-DXCxlIQL.js} +8 -11
- package/dist/{CloseOutlined-14b8bba1.js → CloseOutlined-ClXDNn82.js} +9 -12
- package/dist/{Compact-c39ed20d.js → Compact-CGY560JF.js} +63 -65
- package/dist/ContextIsolator-D5x2Ih51.js +20 -0
- package/dist/{ExclamationCircleFilled-23ef9812.js → ExclamationCircleFilled-C0Kj5KQV.js} +16 -22
- package/dist/KeyCode-DM2sFh3-.js +517 -0
- package/dist/LoadingOutlined-8EnJdZ7I.js +13 -0
- package/dist/{Overflow-a570fa69.js → Overflow-PBZD-PFm.js} +63 -64
- package/dist/{DownOutlined-64a4732a.js → PurePanel-BqPLRtc2.js} +67 -70
- package/dist/{SearchOutlined-a9014e08.js → SearchOutlined-BP3Z2K6j.js} +8 -11
- package/dist/{TextArea-20825221.js → TextArea-DKwCct3i.js} +583 -588
- package/dist/Typography-aGoDUl4R.js +710 -0
- package/dist/bundle.css +1204 -0
- package/dist/{button-fa1c119c.js → button-CDQgO1OK.js} +274 -278
- package/dist/{collapse-345bc884.js → collapse-Dtpt-6W_.js} +2 -2
- package/dist/compact-item-DH13cl8A.js +61 -0
- package/dist/components/Badge/Badge.d.ts +2 -2
- package/dist/components/Badge/Badge.js +63 -62
- package/dist/components/Badge/__tests__/Badge.test.js +11 -65
- package/dist/components/Badge/index.js +2 -21
- package/dist/components/Badge/styles.js +7 -8
- package/dist/components/Breadcrumb/Breadcrumb.js +8 -24
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +21 -7
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +13 -60
- package/dist/components/Breadcrumb/index.js +2 -25
- package/dist/components/Breadcrumb/styles.d.ts +10 -6
- package/dist/components/Breadcrumb/styles.js +787 -808
- package/dist/components/Button/Button.d.ts +6 -4
- package/dist/components/Button/Button.js +20 -40
- package/dist/components/Button/__tests__/Button.test.js +9 -54
- package/dist/components/Button/index.js +2 -20
- package/dist/components/Button/styles.d.ts +9 -5
- package/dist/components/Button/styles.js +19 -30
- package/dist/components/Checkbox/Checkbox.js +8 -38
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +16 -62
- package/dist/components/Checkbox/index.js +2 -47
- package/dist/components/Checkbox/styles.d.ts +8 -1
- package/dist/components/Checkbox/styles.js +181 -188
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.d.ts +2 -4
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +19 -51
- package/dist/components/ErrorBoundaryFallback/index.d.ts +1 -0
- package/dist/components/ErrorBoundaryFallback/index.js +2 -49
- package/dist/components/ErrorBoundaryFallback/styles.d.ts +1 -3
- package/dist/components/ErrorBoundaryFallback/styles.js +34 -37
- package/dist/components/Form/Form.d.ts +18 -5
- package/dist/components/Form/Form.js +4 -45
- package/dist/components/Form/__stories__/FormStory.js +44 -81
- package/dist/components/Form/__tests__/form.test.d.ts +1 -0
- package/dist/components/Form/__tests__/form.test.js +18 -0
- package/dist/components/Form/index.js +2 -46
- package/dist/components/Form/styles.d.ts +3 -0
- package/dist/components/Form/styles.js +5 -0
- package/dist/components/Input/Input.js +6 -29
- package/dist/components/Input/__tests__/Input.test.js +21 -66
- package/dist/components/Input/index.js +2 -29
- package/dist/components/Input/styles.d.ts +5 -2
- package/dist/components/Input/styles.js +319 -332
- package/dist/components/Message/Message.d.ts +4 -4
- package/dist/components/Message/Message.js +53 -80
- package/dist/components/Message/__tests__/Message.test.js +24 -70
- package/dist/components/Message/index.js +2 -48
- package/dist/components/Message/styles.d.ts +4 -1
- package/dist/components/Message/styles.js +24 -18
- package/dist/components/Notification/Notification.d.ts +11 -10
- package/dist/components/Notification/Notification.js +306 -372
- package/dist/components/Notification/NotificationRightChevron.d.ts +2 -0
- package/dist/components/Notification/NotificationRightChevron.js +23 -0
- package/dist/components/Notification/__tests__/Notification.test.js +8 -69
- package/dist/components/Notification/index.js +2 -59
- package/dist/components/Notification/styles.d.ts +13 -3
- package/dist/components/Notification/styles.js +36 -20
- package/dist/components/Radio/Radio.js +20 -106
- package/dist/components/Radio/RadioGroup.js +18 -71
- package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +1 -1
- package/dist/components/Radio/__tests__/RadioGroup.test.js +15 -70
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Radio/index.js +2 -56
- package/dist/components/Select/DropdownChevron.d.ts +2 -0
- package/dist/components/Select/DropdownChevron.js +23 -0
- package/dist/components/Select/Select.d.ts +9 -4
- package/dist/components/Select/Select.js +29 -41
- package/dist/components/Select/__tests__/Select.test.js +10752 -93
- package/dist/components/Select/index.js +2 -28
- package/dist/components/Select/styles.d.ts +20 -6
- package/dist/components/Select/styles.js +1381 -1370
- package/dist/components/Toast/Toast.d.ts +4 -4
- package/dist/components/Toast/Toast.js +8 -37
- package/dist/components/Toast/__stories__/Toast.stories.d.ts +1 -0
- package/dist/components/Toast/__tests__/Toast.test.js +10 -55
- package/dist/components/Toast/index.js +2 -46
- package/dist/components/Toast/styles.d.ts +6 -1
- package/dist/components/Toast/styles.js +36 -21
- package/dist/components/Typography/Typography.d.ts +7 -4
- package/dist/components/Typography/Typography.js +2 -42
- package/dist/components/Typography/__stories__/Typography.stories.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.js +19 -56
- package/dist/components/Typography/index.js +2 -46
- package/dist/components/Typography/styles.d.ts +18 -4
- package/dist/components/Typography/styles.js +36 -43
- package/dist/components/index.d.ts +13 -5
- package/dist/components/index.js +24 -70
- package/dist/{context-3b8a39af.js → context-BMW3aJEf.js} +538 -548
- package/dist/genesis/GenesisThemeBreakdown.js +38 -55
- package/dist/genesis/GenesisThemeDemo.js +3 -53
- package/dist/genesis/styles.d.ts +6 -2
- package/dist/genesis/styles.js +496 -521
- package/dist/{index-e2b72ca8.js → index-1CBpubM3.js} +97 -102
- package/dist/index-BZAhCB_K.js +97 -0
- package/dist/{index-501fc13d.js → index-C0SmxWLS.js} +367 -392
- package/dist/index-C8haFnXI.js +1112 -0
- package/dist/index-CfDY25LP.js +873 -0
- package/dist/index-DPW8XdWj.js +952 -0
- package/dist/{index-8c8d2d0c.js → index-bKlRxQp4.js} +114 -114
- package/dist/index-oK7z6jnz.js +22795 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +31 -77
- package/dist/{isVisible-729780f5.js → isVisible-A-IfeFoT.js} +67 -94
- package/dist/{magic-string.es-b7491176.js → magic-string.es-D2FWSwU3.js} +56 -103
- package/dist/{pickAttrs-00ba4687.js → pickAttrs-B0YTfcV1.js} +1 -1
- package/dist/providers/GenesisProvider.d.ts +0 -5
- package/dist/providers/GenesisProvider.js +9 -59
- package/dist/providers/ThemeProvider.d.ts +1 -2
- package/dist/providers/ThemeProvider.js +11 -13
- package/dist/providers/ToastProvider.d.ts +11 -4
- package/dist/providers/ToastProvider.js +10 -39
- package/dist/providers/index.d.ts +2 -3
- package/dist/providers/index.js +4 -51
- package/dist/providers/useGenesis.d.ts +7 -0
- package/dist/providers/useGenesis.js +6 -0
- package/dist/setup-BvfREoHl.js +33891 -0
- package/dist/{styled-components.browser.esm-02f500bc.js → styled-components.browser.esm-CZ1XM4o4.js} +72 -134
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +15 -45
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +15 -45
- package/dist/styles/design-tokens/{typography → typography-tokens}/TypographyTokens.stories.d.ts +1 -0
- package/dist/styles/design-tokens/variables.d.ts +10 -10
- package/dist/styles/design-tokens/variables.js +1 -1
- package/dist/styles/global-styles.d.ts +1 -0
- package/dist/styles/global-styles.js +14 -31
- package/dist/styles/theme/genesis-theme.js +257 -212
- package/dist/styles/theme/genesis-theme.types.d.ts +46 -0
- package/dist/styles/theme/index.js +4 -5
- package/dist/styles-CT_fyXBd.js +1808 -0
- package/dist/test/setup.js +3 -46
- package/dist/useLocale-DT-z_vQ6.js +16 -0
- package/dist/useVariants-DvhXfgJY.js +30 -0
- package/dist/utils/isAllEnglishString.js +1 -2
- package/dist/{presets-83ccb923.js → warning-C63HNL9U.js} +358 -356
- package/package.json +51 -43
- package/dist/CheckOutlined-52d9ac25.js +0 -29
- package/dist/ContextIsolator-b09b2c52.js +0 -20
- package/dist/EllipsisOutlined-60122660.js +0 -1115
- package/dist/InfoCircleFilled-c5f90c20.js +0 -16
- package/dist/RightOutlined-83515eb4.js +0 -16
- package/dist/compact-item-b8f85aa6.js +0 -75
- package/dist/index-0a886e53.js +0 -100
- package/dist/index-0b9ee239.js +0 -955
- package/dist/index-1a33c134.js +0 -1389
- package/dist/index-4003d75b.js +0 -3748
- package/dist/index-89035ea5.js +0 -3242
- package/dist/providers/ToastWrapper.d.ts +0 -7
- package/dist/providers/ToastWrapper.js +0 -56
- package/dist/setup-aaca7b6f.js +0 -21158
- package/dist/styles/theme/global-styles.d.ts +0 -1
- package/dist/styles/theme/global-styles.js +0 -36
- package/dist/useVariants-a0d64298.js +0 -30
- /package/dist/{presetColors-ccf8cb4c.js → presetColors-Cl8UP3Nw.js} +0 -0
- /package/dist/{reactNode-f4391605.js → reactNode-sKPeiqPL.js} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { _ as k, d as U, j as H, a as Z } from "./
|
|
1
|
+
import { _ as k, d as U, j as H, a as Z } from "./warning-C63HNL9U.js";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { t as ee } from "./isVisible-
|
|
4
|
-
import { _ as te,
|
|
3
|
+
import { t as ee } from "./isVisible-A-IfeFoT.js";
|
|
4
|
+
import { _ as te, d as ne, e as re, f as ie, s as oe, h as se, j as ae, k as E } from "./index-oK7z6jnz.js";
|
|
5
5
|
var O = /* @__PURE__ */ a.createContext(null);
|
|
6
6
|
function ue(e) {
|
|
7
|
-
var t = e.children,
|
|
8
|
-
|
|
9
|
-
var
|
|
7
|
+
var t = e.children, n = e.onBatchResize, r = a.useRef(0), i = a.useRef([]), o = a.useContext(O), s = a.useCallback(function(f, u, c) {
|
|
8
|
+
r.current += 1;
|
|
9
|
+
var l = r.current;
|
|
10
10
|
i.current.push({
|
|
11
|
-
size:
|
|
11
|
+
size: f,
|
|
12
12
|
element: u,
|
|
13
|
-
data:
|
|
13
|
+
data: c
|
|
14
14
|
}), Promise.resolve().then(function() {
|
|
15
|
-
|
|
16
|
-
}), o == null || o(
|
|
17
|
-
}, [
|
|
15
|
+
l === r.current && (n == null || n(i.current), i.current = []);
|
|
16
|
+
}), o == null || o(f, u, c);
|
|
17
|
+
}, [n, o]);
|
|
18
18
|
return /* @__PURE__ */ a.createElement(O.Provider, {
|
|
19
19
|
value: s
|
|
20
20
|
}, t);
|
|
@@ -22,11 +22,11 @@ function ue(e) {
|
|
|
22
22
|
var I = function() {
|
|
23
23
|
if (typeof Map < "u")
|
|
24
24
|
return Map;
|
|
25
|
-
function e(t,
|
|
26
|
-
var
|
|
25
|
+
function e(t, n) {
|
|
26
|
+
var r = -1;
|
|
27
27
|
return t.some(function(i, o) {
|
|
28
|
-
return i[0] ===
|
|
29
|
-
}),
|
|
28
|
+
return i[0] === n ? (r = o, !0) : !1;
|
|
29
|
+
}), r;
|
|
30
30
|
}
|
|
31
31
|
return (
|
|
32
32
|
/** @class */
|
|
@@ -43,58 +43,58 @@ var I = function() {
|
|
|
43
43
|
},
|
|
44
44
|
enumerable: !0,
|
|
45
45
|
configurable: !0
|
|
46
|
-
}), t.prototype.get = function(
|
|
47
|
-
var
|
|
46
|
+
}), t.prototype.get = function(n) {
|
|
47
|
+
var r = e(this.__entries__, n), i = this.__entries__[r];
|
|
48
48
|
return i && i[1];
|
|
49
|
-
}, t.prototype.set = function(
|
|
50
|
-
var i = e(this.__entries__,
|
|
51
|
-
~i ? this.__entries__[i][1] =
|
|
52
|
-
}, t.prototype.delete = function(
|
|
53
|
-
var
|
|
54
|
-
~i &&
|
|
55
|
-
}, t.prototype.has = function(
|
|
56
|
-
return !!~e(this.__entries__,
|
|
49
|
+
}, t.prototype.set = function(n, r) {
|
|
50
|
+
var i = e(this.__entries__, n);
|
|
51
|
+
~i ? this.__entries__[i][1] = r : this.__entries__.push([n, r]);
|
|
52
|
+
}, t.prototype.delete = function(n) {
|
|
53
|
+
var r = this.__entries__, i = e(r, n);
|
|
54
|
+
~i && r.splice(i, 1);
|
|
55
|
+
}, t.prototype.has = function(n) {
|
|
56
|
+
return !!~e(this.__entries__, n);
|
|
57
57
|
}, t.prototype.clear = function() {
|
|
58
58
|
this.__entries__.splice(0);
|
|
59
|
-
}, t.prototype.forEach = function(
|
|
60
|
-
|
|
59
|
+
}, t.prototype.forEach = function(n, r) {
|
|
60
|
+
r === void 0 && (r = null);
|
|
61
61
|
for (var i = 0, o = this.__entries__; i < o.length; i++) {
|
|
62
62
|
var s = o[i];
|
|
63
|
-
|
|
63
|
+
n.call(r, s[1], s[0]);
|
|
64
64
|
}
|
|
65
65
|
}, t;
|
|
66
66
|
}()
|
|
67
67
|
);
|
|
68
68
|
}(), z = typeof window < "u" && typeof document < "u" && window.document === document, _ = function() {
|
|
69
69
|
return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
|
|
70
|
-
}(),
|
|
70
|
+
}(), fe = function() {
|
|
71
71
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(_) : function(e) {
|
|
72
72
|
return setTimeout(function() {
|
|
73
73
|
return e(Date.now());
|
|
74
74
|
}, 1e3 / 60);
|
|
75
75
|
};
|
|
76
|
-
}(),
|
|
76
|
+
}(), ce = 2;
|
|
77
77
|
function he(e, t) {
|
|
78
|
-
var
|
|
78
|
+
var n = !1, r = !1, i = 0;
|
|
79
79
|
function o() {
|
|
80
|
-
|
|
80
|
+
n && (n = !1, e()), r && f();
|
|
81
81
|
}
|
|
82
82
|
function s() {
|
|
83
|
-
|
|
83
|
+
fe(o);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function f() {
|
|
86
86
|
var u = Date.now();
|
|
87
|
-
if (
|
|
88
|
-
if (u - i <
|
|
87
|
+
if (n) {
|
|
88
|
+
if (u - i < ce)
|
|
89
89
|
return;
|
|
90
|
-
|
|
90
|
+
r = !0;
|
|
91
91
|
} else
|
|
92
|
-
|
|
92
|
+
n = !0, r = !1, setTimeout(s, t);
|
|
93
93
|
i = u;
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return f;
|
|
96
96
|
}
|
|
97
|
-
var de = 20,
|
|
97
|
+
var de = 20, le = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], ve = typeof MutationObserver < "u", pe = (
|
|
98
98
|
/** @class */
|
|
99
99
|
function() {
|
|
100
100
|
function e() {
|
|
@@ -103,20 +103,20 @@ var de = 20, ve = ["top", "right", "bottom", "left", "width", "height", "size",
|
|
|
103
103
|
return e.prototype.addObserver = function(t) {
|
|
104
104
|
~this.observers_.indexOf(t) || this.observers_.push(t), this.connected_ || this.connect_();
|
|
105
105
|
}, e.prototype.removeObserver = function(t) {
|
|
106
|
-
var
|
|
107
|
-
~
|
|
106
|
+
var n = this.observers_, r = n.indexOf(t);
|
|
107
|
+
~r && n.splice(r, 1), !n.length && this.connected_ && this.disconnect_();
|
|
108
108
|
}, e.prototype.refresh = function() {
|
|
109
109
|
var t = this.updateObservers_();
|
|
110
110
|
t && this.refresh();
|
|
111
111
|
}, e.prototype.updateObservers_ = function() {
|
|
112
|
-
var t = this.observers_.filter(function(
|
|
113
|
-
return
|
|
112
|
+
var t = this.observers_.filter(function(n) {
|
|
113
|
+
return n.gatherActive(), n.hasActive();
|
|
114
114
|
});
|
|
115
|
-
return t.forEach(function(
|
|
116
|
-
return
|
|
115
|
+
return t.forEach(function(n) {
|
|
116
|
+
return n.broadcastActive();
|
|
117
117
|
}), t.length > 0;
|
|
118
118
|
}, e.prototype.connect_ = function() {
|
|
119
|
-
!z || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh),
|
|
119
|
+
!z || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), ve ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
|
|
120
120
|
attributes: !0,
|
|
121
121
|
childList: !0,
|
|
122
122
|
characterData: !0,
|
|
@@ -125,8 +125,8 @@ var de = 20, ve = ["top", "right", "bottom", "left", "width", "height", "size",
|
|
|
125
125
|
}, e.prototype.disconnect_ = function() {
|
|
126
126
|
!z || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
|
|
127
127
|
}, e.prototype.onTransitionEnd_ = function(t) {
|
|
128
|
-
var
|
|
129
|
-
return !!~
|
|
128
|
+
var n = t.propertyName, r = n === void 0 ? "" : n, i = le.some(function(o) {
|
|
129
|
+
return !!~r.indexOf(o);
|
|
130
130
|
});
|
|
131
131
|
i && this.refresh();
|
|
132
132
|
}, e.getInstance = function() {
|
|
@@ -134,8 +134,8 @@ var de = 20, ve = ["top", "right", "bottom", "left", "width", "height", "size",
|
|
|
134
134
|
}, e.instance_ = null, e;
|
|
135
135
|
}()
|
|
136
136
|
), L = function(e, t) {
|
|
137
|
-
for (var
|
|
138
|
-
var i = n
|
|
137
|
+
for (var n = 0, r = Object.keys(t); n < r.length; n++) {
|
|
138
|
+
var i = r[n];
|
|
139
139
|
Object.defineProperty(e, i, {
|
|
140
140
|
value: t[i],
|
|
141
141
|
enumerable: !1,
|
|
@@ -152,36 +152,36 @@ function g(e) {
|
|
|
152
152
|
return parseFloat(e) || 0;
|
|
153
153
|
}
|
|
154
154
|
function P(e) {
|
|
155
|
-
for (var t = [],
|
|
156
|
-
t[
|
|
157
|
-
return t.reduce(function(
|
|
155
|
+
for (var t = [], n = 1; n < arguments.length; n++)
|
|
156
|
+
t[n - 1] = arguments[n];
|
|
157
|
+
return t.reduce(function(r, i) {
|
|
158
158
|
var o = e["border-" + i + "-width"];
|
|
159
|
-
return
|
|
159
|
+
return r + g(o);
|
|
160
160
|
}, 0);
|
|
161
161
|
}
|
|
162
162
|
function be(e) {
|
|
163
|
-
for (var t = ["top", "right", "bottom", "left"],
|
|
164
|
-
var o = i[
|
|
165
|
-
|
|
163
|
+
for (var t = ["top", "right", "bottom", "left"], n = {}, r = 0, i = t; r < i.length; r++) {
|
|
164
|
+
var o = i[r], s = e["padding-" + o];
|
|
165
|
+
n[o] = g(s);
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return n;
|
|
168
168
|
}
|
|
169
169
|
function me(e) {
|
|
170
170
|
var t = e.getBBox();
|
|
171
171
|
return y(0, 0, t.width, t.height);
|
|
172
172
|
}
|
|
173
173
|
function _e(e) {
|
|
174
|
-
var t = e.clientWidth,
|
|
175
|
-
if (!t && !
|
|
174
|
+
var t = e.clientWidth, n = e.clientHeight;
|
|
175
|
+
if (!t && !n)
|
|
176
176
|
return V;
|
|
177
|
-
var
|
|
178
|
-
if (
|
|
179
|
-
var
|
|
180
|
-
Math.abs(
|
|
177
|
+
var r = p(e).getComputedStyle(e), i = be(r), o = i.left + i.right, s = i.top + i.bottom, f = g(r.width), u = g(r.height);
|
|
178
|
+
if (r.boxSizing === "border-box" && (Math.round(f + o) !== t && (f -= P(r, "left", "right") + o), Math.round(u + s) !== n && (u -= P(r, "top", "bottom") + s)), !ye(e)) {
|
|
179
|
+
var c = Math.round(f + o) - t, l = Math.round(u + s) - n;
|
|
180
|
+
Math.abs(c) !== 1 && (f -= c), Math.abs(l) !== 1 && (u -= l);
|
|
181
181
|
}
|
|
182
|
-
return y(i.left, i.top,
|
|
182
|
+
return y(i.left, i.top, f, u);
|
|
183
183
|
}
|
|
184
|
-
var ge = function() {
|
|
184
|
+
var ge = /* @__PURE__ */ function() {
|
|
185
185
|
return typeof SVGGraphicsElement < "u" ? function(e) {
|
|
186
186
|
return e instanceof p(e).SVGGraphicsElement;
|
|
187
187
|
} : function(e) {
|
|
@@ -195,20 +195,20 @@ function Re(e) {
|
|
|
195
195
|
return z ? ge(e) ? me(e) : _e(e) : V;
|
|
196
196
|
}
|
|
197
197
|
function we(e) {
|
|
198
|
-
var t = e.x,
|
|
198
|
+
var t = e.x, n = e.y, r = e.width, i = e.height, o = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, s = Object.create(o.prototype);
|
|
199
199
|
return L(s, {
|
|
200
200
|
x: t,
|
|
201
|
-
y:
|
|
202
|
-
width:
|
|
201
|
+
y: n,
|
|
202
|
+
width: r,
|
|
203
203
|
height: i,
|
|
204
|
-
top:
|
|
205
|
-
right: t +
|
|
206
|
-
bottom: i +
|
|
204
|
+
top: n,
|
|
205
|
+
right: t + r,
|
|
206
|
+
bottom: i + n,
|
|
207
207
|
left: t
|
|
208
208
|
}), s;
|
|
209
209
|
}
|
|
210
|
-
function y(e, t,
|
|
211
|
-
return { x: e, y: t, width:
|
|
210
|
+
function y(e, t, n, r) {
|
|
211
|
+
return { x: e, y: t, width: n, height: r };
|
|
212
212
|
}
|
|
213
213
|
var Ee = (
|
|
214
214
|
/** @class */
|
|
@@ -226,20 +226,20 @@ var Ee = (
|
|
|
226
226
|
}()
|
|
227
227
|
), Oe = (
|
|
228
228
|
/** @class */
|
|
229
|
-
function() {
|
|
230
|
-
function e(t,
|
|
231
|
-
var
|
|
232
|
-
L(this, { target: t, contentRect:
|
|
229
|
+
/* @__PURE__ */ function() {
|
|
230
|
+
function e(t, n) {
|
|
231
|
+
var r = we(n);
|
|
232
|
+
L(this, { target: t, contentRect: r });
|
|
233
233
|
}
|
|
234
234
|
return e;
|
|
235
235
|
}()
|
|
236
236
|
), ze = (
|
|
237
237
|
/** @class */
|
|
238
238
|
function() {
|
|
239
|
-
function e(t,
|
|
239
|
+
function e(t, n, r) {
|
|
240
240
|
if (this.activeObservations_ = [], this.observations_ = new I(), typeof t != "function")
|
|
241
241
|
throw new TypeError("The callback provided as parameter 1 is not a function.");
|
|
242
|
-
this.callback_ = t, this.controller_ =
|
|
242
|
+
this.callback_ = t, this.controller_ = n, this.callbackCtx_ = r;
|
|
243
243
|
}
|
|
244
244
|
return e.prototype.observe = function(t) {
|
|
245
245
|
if (!arguments.length)
|
|
@@ -247,8 +247,8 @@ var Ee = (
|
|
|
247
247
|
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
248
248
|
if (!(t instanceof p(t).Element))
|
|
249
249
|
throw new TypeError('parameter 1 is not of type "Element".');
|
|
250
|
-
var
|
|
251
|
-
|
|
250
|
+
var n = this.observations_;
|
|
251
|
+
n.has(t) || (n.set(t, new Ee(t)), this.controller_.addObserver(this), this.controller_.refresh());
|
|
252
252
|
}
|
|
253
253
|
}, e.prototype.unobserve = function(t) {
|
|
254
254
|
if (!arguments.length)
|
|
@@ -256,22 +256,22 @@ var Ee = (
|
|
|
256
256
|
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
257
257
|
if (!(t instanceof p(t).Element))
|
|
258
258
|
throw new TypeError('parameter 1 is not of type "Element".');
|
|
259
|
-
var
|
|
260
|
-
|
|
259
|
+
var n = this.observations_;
|
|
260
|
+
n.has(t) && (n.delete(t), n.size || this.controller_.removeObserver(this));
|
|
261
261
|
}
|
|
262
262
|
}, e.prototype.disconnect = function() {
|
|
263
263
|
this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
|
|
264
264
|
}, e.prototype.gatherActive = function() {
|
|
265
265
|
var t = this;
|
|
266
|
-
this.clearActive(), this.observations_.forEach(function(
|
|
267
|
-
|
|
266
|
+
this.clearActive(), this.observations_.forEach(function(n) {
|
|
267
|
+
n.isActive() && t.activeObservations_.push(n);
|
|
268
268
|
});
|
|
269
269
|
}, e.prototype.broadcastActive = function() {
|
|
270
270
|
if (this.hasActive()) {
|
|
271
|
-
var t = this.callbackCtx_,
|
|
272
|
-
return new Oe(
|
|
271
|
+
var t = this.callbackCtx_, n = this.activeObservations_.map(function(r) {
|
|
272
|
+
return new Oe(r.target, r.broadcastRect());
|
|
273
273
|
});
|
|
274
|
-
this.callback_.call(t,
|
|
274
|
+
this.callback_.call(t, n, t), this.clearActive();
|
|
275
275
|
}
|
|
276
276
|
}, e.prototype.clearActive = function() {
|
|
277
277
|
this.activeObservations_.splice(0);
|
|
@@ -281,14 +281,14 @@ var Ee = (
|
|
|
281
281
|
}()
|
|
282
282
|
), j = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new I(), B = (
|
|
283
283
|
/** @class */
|
|
284
|
-
function() {
|
|
284
|
+
/* @__PURE__ */ function() {
|
|
285
285
|
function e(t) {
|
|
286
286
|
if (!(this instanceof e))
|
|
287
287
|
throw new TypeError("Cannot call a class as a function.");
|
|
288
288
|
if (!arguments.length)
|
|
289
289
|
throw new TypeError("1 argument required, but only 0 present.");
|
|
290
|
-
var
|
|
291
|
-
j.set(this,
|
|
290
|
+
var n = pe.getInstance(), r = new ze(t, n, this);
|
|
291
|
+
j.set(this, r);
|
|
292
292
|
}
|
|
293
293
|
return e;
|
|
294
294
|
}()
|
|
@@ -308,9 +308,9 @@ var Ce = function() {
|
|
|
308
308
|
}(), d = /* @__PURE__ */ new Map();
|
|
309
309
|
function F(e) {
|
|
310
310
|
e.forEach(function(t) {
|
|
311
|
-
var
|
|
312
|
-
(
|
|
313
|
-
return i(
|
|
311
|
+
var n, r = t.target;
|
|
312
|
+
(n = d.get(r)) === null || n === void 0 || n.forEach(function(i) {
|
|
313
|
+
return i(r);
|
|
314
314
|
});
|
|
315
315
|
});
|
|
316
316
|
}
|
|
@@ -324,28 +324,28 @@ function xe(e, t) {
|
|
|
324
324
|
d.has(e) && (d.get(e).delete(t), d.get(e).size || (G.unobserve(e), d.delete(e)));
|
|
325
325
|
}
|
|
326
326
|
var Ae = /* @__PURE__ */ function(e) {
|
|
327
|
-
te(
|
|
328
|
-
var t =
|
|
329
|
-
function
|
|
330
|
-
return
|
|
327
|
+
te(n, e);
|
|
328
|
+
var t = ne(n);
|
|
329
|
+
function n() {
|
|
330
|
+
return re(this, n), t.apply(this, arguments);
|
|
331
331
|
}
|
|
332
|
-
return ie(
|
|
332
|
+
return ie(n, [{
|
|
333
333
|
key: "render",
|
|
334
334
|
value: function() {
|
|
335
335
|
return this.props.children;
|
|
336
336
|
}
|
|
337
|
-
}]),
|
|
337
|
+
}]), n;
|
|
338
338
|
}(a.Component);
|
|
339
339
|
function De(e, t) {
|
|
340
|
-
var
|
|
340
|
+
var n = e.children, r = e.disabled, i = a.useRef(null), o = a.useRef(null), s = a.useContext(O), f = typeof n == "function", u = f ? n(i) : n, c = a.useRef({
|
|
341
341
|
width: -1,
|
|
342
342
|
height: -1,
|
|
343
343
|
offsetWidth: -1,
|
|
344
344
|
offsetHeight: -1
|
|
345
|
-
}),
|
|
346
|
-
var
|
|
345
|
+
}), l = !f && /* @__PURE__ */ a.isValidElement(u) && oe(u), K = l ? se(u) : null, Y = ae(K, i), C = function() {
|
|
346
|
+
var v;
|
|
347
347
|
return E(i.current) || // Support `nativeElement` format
|
|
348
|
-
(i.current && U(i.current) === "object" ? E((
|
|
348
|
+
(i.current && U(i.current) === "object" ? E((v = i.current) === null || v === void 0 ? void 0 : v.nativeElement) : null) || E(o.current);
|
|
349
349
|
};
|
|
350
350
|
a.useImperativeHandle(t, function() {
|
|
351
351
|
return C();
|
|
@@ -353,15 +353,15 @@ function De(e, t) {
|
|
|
353
353
|
var M = a.useRef(e);
|
|
354
354
|
M.current = e;
|
|
355
355
|
var x = a.useCallback(function(h) {
|
|
356
|
-
var
|
|
357
|
-
if (
|
|
356
|
+
var v = M.current, A = v.onResize, X = v.data, D = h.getBoundingClientRect(), R = D.width, w = D.height, b = h.offsetWidth, m = h.offsetHeight, N = Math.floor(R), S = Math.floor(w);
|
|
357
|
+
if (c.current.width !== N || c.current.height !== S || c.current.offsetWidth !== b || c.current.offsetHeight !== m) {
|
|
358
358
|
var T = {
|
|
359
359
|
width: N,
|
|
360
360
|
height: S,
|
|
361
361
|
offsetWidth: b,
|
|
362
362
|
offsetHeight: m
|
|
363
363
|
};
|
|
364
|
-
|
|
364
|
+
c.current = T;
|
|
365
365
|
var J = b === Math.round(R) ? R : b, Q = m === Math.round(w) ? w : m, W = k(k({}, T), {}, {
|
|
366
366
|
offsetWidth: J,
|
|
367
367
|
offsetHeight: Q
|
|
@@ -373,12 +373,12 @@ function De(e, t) {
|
|
|
373
373
|
}, []);
|
|
374
374
|
return a.useEffect(function() {
|
|
375
375
|
var h = C();
|
|
376
|
-
return h && !
|
|
376
|
+
return h && !r && Me(h, x), function() {
|
|
377
377
|
return xe(h, x);
|
|
378
378
|
};
|
|
379
|
-
}, [i.current,
|
|
379
|
+
}, [i.current, r]), /* @__PURE__ */ a.createElement(Ae, {
|
|
380
380
|
ref: o
|
|
381
|
-
},
|
|
381
|
+
}, l ? /* @__PURE__ */ a.cloneElement(u, {
|
|
382
382
|
ref: Y
|
|
383
383
|
}) : u);
|
|
384
384
|
}
|
|
@@ -386,8 +386,8 @@ var $ = /* @__PURE__ */ a.forwardRef(De);
|
|
|
386
386
|
process.env.NODE_ENV !== "production" && ($.displayName = "SingleObserver");
|
|
387
387
|
var Ne = "rc-observer-key";
|
|
388
388
|
function Se(e, t) {
|
|
389
|
-
var
|
|
390
|
-
return process.env.NODE_ENV !== "production" && (
|
|
389
|
+
var n = e.children, r = typeof n == "function" ? [n] : ee(n);
|
|
390
|
+
return process.env.NODE_ENV !== "production" && (r.length > 1 ? H(!1, "Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.") : r.length === 0 && H(!1, "`children` of ResizeObserver is empty. Nothing is in observe.")), r.map(function(i, o) {
|
|
391
391
|
var s = (i == null ? void 0 : i.key) || "".concat(Ne, "-").concat(o);
|
|
392
392
|
return /* @__PURE__ */ a.createElement($, Z({}, e, {
|
|
393
393
|
key: s,
|