@gobolt/genesis 0.0.7
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 +86 -0
- package/dist/AntdIcon-Bsnbyy6g.js +200 -0
- package/dist/CheckOutlined-DAynWe12.js +527 -0
- package/dist/CloseCircleFilled-ZIY-u-27.js +13 -0
- package/dist/Compact-CJBo3f0u.js +185 -0
- package/dist/ContextIsolator-CGkdKtc3.js +20 -0
- package/dist/ExclamationCircleFilled-BICVVQIg.js +21 -0
- package/dist/Form-Cylpi4M4.js +1815 -0
- package/dist/Overflow-CP1M4Z0s.js +369 -0
- package/dist/SearchOutlined-DuzJkIiQ.js +52 -0
- package/dist/TextArea-3MOYYuAQ.js +1680 -0
- package/dist/bundle.css +1 -0
- package/dist/button-BNV2qdrP.js +1392 -0
- package/dist/compact-item-DH13cl8A.js +61 -0
- package/dist/components/atoms/button/Button.d.ts +12 -0
- package/dist/components/atoms/button/Button.js +27 -0
- package/dist/components/atoms/button/__stories__/Button.stories.d.ts +13 -0
- package/dist/components/atoms/button/index.d.ts +2 -0
- package/dist/components/atoms/button/index.js +4 -0
- package/dist/components/atoms/button/styles.d.ts +12 -0
- package/dist/components/atoms/button/styles.js +71 -0
- package/dist/components/atoms/checkbox/Checkbox.d.ts +10 -0
- package/dist/components/atoms/checkbox/Checkbox.js +13 -0
- package/dist/components/atoms/checkbox/__stories__/Checkbox.stories.d.ts +8 -0
- package/dist/components/atoms/checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/components/atoms/checkbox/__tests__/Checkbox.test.js +18 -0
- package/dist/components/atoms/checkbox/index.d.ts +2 -0
- package/dist/components/atoms/checkbox/index.js +4 -0
- package/dist/components/atoms/checkbox/styles.d.ts +11 -0
- package/dist/components/atoms/checkbox/styles.js +582 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/atoms/index.js +3 -0
- package/dist/components/atoms/input/Input.d.ts +11 -0
- package/dist/components/atoms/input/Input.js +12 -0
- package/dist/components/atoms/input/__stories__/Input.stories.d.ts +10 -0
- package/dist/components/atoms/input/__tests__/Input.test.d.ts +1 -0
- package/dist/components/atoms/input/__tests__/Input.test.js +28 -0
- package/dist/components/atoms/input/index.d.ts +2 -0
- package/dist/components/atoms/input/index.js +4 -0
- package/dist/components/atoms/input/styles.d.ts +14 -0
- package/dist/components/atoms/input/styles.js +415 -0
- package/dist/components/atoms/select/Select.d.ts +11 -0
- package/dist/components/atoms/select/Select.js +24 -0
- package/dist/components/atoms/select/__stories__/Select.stories.d.ts +8 -0
- package/dist/components/atoms/select/__tests__/Select.test.d.ts +1 -0
- package/dist/components/atoms/select/__tests__/Select.test.js +10735 -0
- package/dist/components/atoms/select/index.d.ts +2 -0
- package/dist/components/atoms/select/index.js +4 -0
- package/dist/components/atoms/select/styles.d.ts +15 -0
- package/dist/components/atoms/select/styles.js +3868 -0
- package/dist/components/atoms/typography/Typography.d.ts +11 -0
- package/dist/components/atoms/typography/Typography.js +44 -0
- package/dist/components/atoms/typography/__stories__/Typography.stories.d.ts +12 -0
- package/dist/components/atoms/typography/__tests__/Typography.test.d.ts +1 -0
- package/dist/components/atoms/typography/__tests__/Typography.test.js +16 -0
- package/dist/components/atoms/typography/index.d.ts +2 -0
- package/dist/components/atoms/typography/index.js +4 -0
- package/dist/components/atoms/typography/styles.d.ts +11 -0
- package/dist/components/atoms/typography/styles.js +28 -0
- package/dist/components/index.d.js +1 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.js +16 -0
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.d.ts +10 -0
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.js +35 -0
- package/dist/components/molecules/error-boundary-fallback/__stories__/ErrorBoundaryFallback.stories.d.ts +8 -0
- package/dist/components/molecules/error-boundary-fallback/index.d.ts +1 -0
- package/dist/components/molecules/error-boundary-fallback/index.js +4 -0
- package/dist/components/molecules/error-boundary-fallback/styles.d.ts +1 -0
- package/dist/components/molecules/error-boundary-fallback/styles.js +930 -0
- package/dist/components/molecules/form/Form.d.ts +15 -0
- package/dist/components/molecules/form/Form.js +7 -0
- package/dist/components/molecules/form/__stories__/Form.stories.d.ts +7 -0
- package/dist/components/molecules/form/__stories__/FormStory.d.ts +1 -0
- package/dist/components/molecules/form/__stories__/FormStory.js +90 -0
- package/dist/components/molecules/form/index.d.ts +2 -0
- package/dist/components/molecules/form/index.js +4 -0
- package/dist/constants/index.d.ts +51 -0
- package/dist/constants/index.js +54 -0
- package/dist/context-CZsFJmh6.js +2093 -0
- package/dist/declaration.d.js +1 -0
- package/dist/genesis/GenesisThemeBreakdown.d.ts +4 -0
- package/dist/genesis/GenesisThemeBreakdown.js +56 -0
- package/dist/genesis/GenesisThemeDemo.d.ts +8 -0
- package/dist/genesis/GenesisThemeDemo.js +8 -0
- package/dist/genesis/GenesisThemeDemo.stories.d.ts +7 -0
- package/dist/genesis/styles.d.ts +12 -0
- package/dist/genesis/styles.js +4038 -0
- package/dist/index-3MWkSVA1.js +96 -0
- package/dist/index-BPtFqhcp.js +19110 -0
- package/dist/index-BQO27mgE.js +402 -0
- package/dist/index-BWys7dkb.js +4462 -0
- package/dist/index-C7kFNqp2.js +276 -0
- package/dist/index-D1v_7IIx.js +1057 -0
- package/dist/index-SAAXFt-P.js +946 -0
- package/dist/index-VDH3iLaC.js +884 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -0
- package/dist/isVisible-CNQjrJPN.js +366 -0
- package/dist/magic-string.es-BkUFmFT4.js +858 -0
- package/dist/presetColors-Cl8UP3Nw.js +4 -0
- package/dist/providers/GenesisProvider.d.ts +8 -0
- package/dist/providers/GenesisProvider.js +7 -0
- package/dist/providers/ThemeProvider.d.ts +9 -0
- package/dist/providers/ThemeProvider.js +18 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +6 -0
- package/dist/reactNode-sKPeiqPL.js +12 -0
- package/dist/setup-CMYVZCPF.js +33883 -0
- package/dist/styled-components.browser.esm-CZ1XM4o4.js +1144 -0
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.d.ts +1 -0
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +37 -0
- package/dist/styles/design-tokens/border-tokens/BorderTokens.stories.d.ts +6 -0
- package/dist/styles/design-tokens/color-tokens/ColorTokens.stories.d.ts +7 -0
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.d.ts +3 -0
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +36 -0
- package/dist/styles/design-tokens/sizing-tokens/index.stories.d.ts +7 -0
- package/dist/styles/design-tokens/typography/TypographyTokens.stories.d.ts +7 -0
- package/dist/styles/design-tokens/variables.d.ts +704 -0
- package/dist/styles/design-tokens/variables.js +697 -0
- package/dist/styles/global-styles.d.ts +1 -0
- package/dist/styles/global-styles.js +35 -0
- package/dist/styles/theme/genesis-theme.d.ts +75 -0
- package/dist/styles/theme/genesis-theme.js +896 -0
- package/dist/styles/theme/genesis-theme.types.d.ts +162 -0
- package/dist/styles/theme/genesis-theme.types.js +4 -0
- package/dist/styles/theme/global-styles.d.ts +1 -0
- package/dist/styles/theme/global-styles.js +35 -0
- package/dist/styles/theme/index.d.ts +1 -0
- package/dist/styles/theme/index.js +9 -0
- package/dist/test/setup.d.ts +5 -0
- package/dist/test/setup.js +7 -0
- package/dist/useVariants-CEpw6Ww6.js +29 -0
- package/dist/utils/getAppointmentColor.d.ts +4 -0
- package/dist/utils/getAppointmentColor.js +91 -0
- package/dist/utils/isAllEnglishString.d.ts +1 -0
- package/dist/utils/isAllEnglishString.js +8 -0
- package/dist/utils/isAllEnglishString.test.d.ts +1 -0
- package/dist/utils/isAllEnglishString.test.js +8 -0
- package/dist/utils/parseAddress.d.ts +3 -0
- package/dist/utils/parseAddress.js +19 -0
- package/dist/vite-env.d.js +1 -0
- package/package.json +115 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { o as U, p as Z, q as ee, r as te, s as ne, t as re, v as ie, a as H, x as E, b as oe, y as P, _ as se } from "./index-BWys7dkb.js";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { t as ae } from "./isVisible-CNQjrJPN.js";
|
|
4
|
+
var O = /* @__PURE__ */ a.createContext(null);
|
|
5
|
+
function ue(e) {
|
|
6
|
+
var t = e.children, n = e.onBatchResize, r = a.useRef(0), i = a.useRef([]), o = a.useContext(O), s = a.useCallback(function(c, u, f) {
|
|
7
|
+
r.current += 1;
|
|
8
|
+
var l = r.current;
|
|
9
|
+
i.current.push({
|
|
10
|
+
size: c,
|
|
11
|
+
element: u,
|
|
12
|
+
data: f
|
|
13
|
+
}), Promise.resolve().then(function() {
|
|
14
|
+
l === r.current && (n == null || n(i.current), i.current = []);
|
|
15
|
+
}), o == null || o(c, u, f);
|
|
16
|
+
}, [n, o]);
|
|
17
|
+
return /* @__PURE__ */ a.createElement(O.Provider, {
|
|
18
|
+
value: s
|
|
19
|
+
}, t);
|
|
20
|
+
}
|
|
21
|
+
var I = function() {
|
|
22
|
+
if (typeof Map < "u")
|
|
23
|
+
return Map;
|
|
24
|
+
function e(t, n) {
|
|
25
|
+
var r = -1;
|
|
26
|
+
return t.some(function(i, o) {
|
|
27
|
+
return i[0] === n ? (r = o, !0) : !1;
|
|
28
|
+
}), r;
|
|
29
|
+
}
|
|
30
|
+
return (
|
|
31
|
+
/** @class */
|
|
32
|
+
function() {
|
|
33
|
+
function t() {
|
|
34
|
+
this.__entries__ = [];
|
|
35
|
+
}
|
|
36
|
+
return Object.defineProperty(t.prototype, "size", {
|
|
37
|
+
/**
|
|
38
|
+
* @returns {boolean}
|
|
39
|
+
*/
|
|
40
|
+
get: function() {
|
|
41
|
+
return this.__entries__.length;
|
|
42
|
+
},
|
|
43
|
+
enumerable: !0,
|
|
44
|
+
configurable: !0
|
|
45
|
+
}), t.prototype.get = function(n) {
|
|
46
|
+
var r = e(this.__entries__, n), i = this.__entries__[r];
|
|
47
|
+
return i && i[1];
|
|
48
|
+
}, t.prototype.set = function(n, r) {
|
|
49
|
+
var i = e(this.__entries__, n);
|
|
50
|
+
~i ? this.__entries__[i][1] = r : this.__entries__.push([n, r]);
|
|
51
|
+
}, t.prototype.delete = function(n) {
|
|
52
|
+
var r = this.__entries__, i = e(r, n);
|
|
53
|
+
~i && r.splice(i, 1);
|
|
54
|
+
}, t.prototype.has = function(n) {
|
|
55
|
+
return !!~e(this.__entries__, n);
|
|
56
|
+
}, t.prototype.clear = function() {
|
|
57
|
+
this.__entries__.splice(0);
|
|
58
|
+
}, t.prototype.forEach = function(n, r) {
|
|
59
|
+
r === void 0 && (r = null);
|
|
60
|
+
for (var i = 0, o = this.__entries__; i < o.length; i++) {
|
|
61
|
+
var s = o[i];
|
|
62
|
+
n.call(r, s[1], s[0]);
|
|
63
|
+
}
|
|
64
|
+
}, t;
|
|
65
|
+
}()
|
|
66
|
+
);
|
|
67
|
+
}(), z = typeof window < "u" && typeof document < "u" && window.document === document, m = function() {
|
|
68
|
+
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")();
|
|
69
|
+
}(), ce = function() {
|
|
70
|
+
return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(m) : function(e) {
|
|
71
|
+
return setTimeout(function() {
|
|
72
|
+
return e(Date.now());
|
|
73
|
+
}, 1e3 / 60);
|
|
74
|
+
};
|
|
75
|
+
}(), fe = 2;
|
|
76
|
+
function he(e, t) {
|
|
77
|
+
var n = !1, r = !1, i = 0;
|
|
78
|
+
function o() {
|
|
79
|
+
n && (n = !1, e()), r && c();
|
|
80
|
+
}
|
|
81
|
+
function s() {
|
|
82
|
+
ce(o);
|
|
83
|
+
}
|
|
84
|
+
function c() {
|
|
85
|
+
var u = Date.now();
|
|
86
|
+
if (n) {
|
|
87
|
+
if (u - i < fe)
|
|
88
|
+
return;
|
|
89
|
+
r = !0;
|
|
90
|
+
} else
|
|
91
|
+
n = !0, r = !1, setTimeout(s, t);
|
|
92
|
+
i = u;
|
|
93
|
+
}
|
|
94
|
+
return c;
|
|
95
|
+
}
|
|
96
|
+
var de = 20, le = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], ve = typeof MutationObserver < "u", pe = (
|
|
97
|
+
/** @class */
|
|
98
|
+
function() {
|
|
99
|
+
function e() {
|
|
100
|
+
this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = he(this.refresh.bind(this), de);
|
|
101
|
+
}
|
|
102
|
+
return e.prototype.addObserver = function(t) {
|
|
103
|
+
~this.observers_.indexOf(t) || this.observers_.push(t), this.connected_ || this.connect_();
|
|
104
|
+
}, e.prototype.removeObserver = function(t) {
|
|
105
|
+
var n = this.observers_, r = n.indexOf(t);
|
|
106
|
+
~r && n.splice(r, 1), !n.length && this.connected_ && this.disconnect_();
|
|
107
|
+
}, e.prototype.refresh = function() {
|
|
108
|
+
var t = this.updateObservers_();
|
|
109
|
+
t && this.refresh();
|
|
110
|
+
}, e.prototype.updateObservers_ = function() {
|
|
111
|
+
var t = this.observers_.filter(function(n) {
|
|
112
|
+
return n.gatherActive(), n.hasActive();
|
|
113
|
+
});
|
|
114
|
+
return t.forEach(function(n) {
|
|
115
|
+
return n.broadcastActive();
|
|
116
|
+
}), t.length > 0;
|
|
117
|
+
}, e.prototype.connect_ = function() {
|
|
118
|
+
!z || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), ve ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
|
|
119
|
+
attributes: !0,
|
|
120
|
+
childList: !0,
|
|
121
|
+
characterData: !0,
|
|
122
|
+
subtree: !0
|
|
123
|
+
})) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
|
|
124
|
+
}, e.prototype.disconnect_ = function() {
|
|
125
|
+
!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);
|
|
126
|
+
}, e.prototype.onTransitionEnd_ = function(t) {
|
|
127
|
+
var n = t.propertyName, r = n === void 0 ? "" : n, i = le.some(function(o) {
|
|
128
|
+
return !!~r.indexOf(o);
|
|
129
|
+
});
|
|
130
|
+
i && this.refresh();
|
|
131
|
+
}, e.getInstance = function() {
|
|
132
|
+
return this.instance_ || (this.instance_ = new e()), this.instance_;
|
|
133
|
+
}, e.instance_ = null, e;
|
|
134
|
+
}()
|
|
135
|
+
), L = function(e, t) {
|
|
136
|
+
for (var n = 0, r = Object.keys(t); n < r.length; n++) {
|
|
137
|
+
var i = r[n];
|
|
138
|
+
Object.defineProperty(e, i, {
|
|
139
|
+
value: t[i],
|
|
140
|
+
enumerable: !1,
|
|
141
|
+
writable: !1,
|
|
142
|
+
configurable: !0
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return e;
|
|
146
|
+
}, p = function(e) {
|
|
147
|
+
var t = e && e.ownerDocument && e.ownerDocument.defaultView;
|
|
148
|
+
return t || m;
|
|
149
|
+
}, V = y(0, 0, 0, 0);
|
|
150
|
+
function g(e) {
|
|
151
|
+
return parseFloat(e) || 0;
|
|
152
|
+
}
|
|
153
|
+
function k(e) {
|
|
154
|
+
for (var t = [], n = 1; n < arguments.length; n++)
|
|
155
|
+
t[n - 1] = arguments[n];
|
|
156
|
+
return t.reduce(function(r, i) {
|
|
157
|
+
var o = e["border-" + i + "-width"];
|
|
158
|
+
return r + g(o);
|
|
159
|
+
}, 0);
|
|
160
|
+
}
|
|
161
|
+
function be(e) {
|
|
162
|
+
for (var t = ["top", "right", "bottom", "left"], n = {}, r = 0, i = t; r < i.length; r++) {
|
|
163
|
+
var o = i[r], s = e["padding-" + o];
|
|
164
|
+
n[o] = g(s);
|
|
165
|
+
}
|
|
166
|
+
return n;
|
|
167
|
+
}
|
|
168
|
+
function _e(e) {
|
|
169
|
+
var t = e.getBBox();
|
|
170
|
+
return y(0, 0, t.width, t.height);
|
|
171
|
+
}
|
|
172
|
+
function me(e) {
|
|
173
|
+
var t = e.clientWidth, n = e.clientHeight;
|
|
174
|
+
if (!t && !n)
|
|
175
|
+
return V;
|
|
176
|
+
var r = p(e).getComputedStyle(e), i = be(r), o = i.left + i.right, s = i.top + i.bottom, c = g(r.width), u = g(r.height);
|
|
177
|
+
if (r.boxSizing === "border-box" && (Math.round(c + o) !== t && (c -= k(r, "left", "right") + o), Math.round(u + s) !== n && (u -= k(r, "top", "bottom") + s)), !ye(e)) {
|
|
178
|
+
var f = Math.round(c + o) - t, l = Math.round(u + s) - n;
|
|
179
|
+
Math.abs(f) !== 1 && (c -= f), Math.abs(l) !== 1 && (u -= l);
|
|
180
|
+
}
|
|
181
|
+
return y(i.left, i.top, c, u);
|
|
182
|
+
}
|
|
183
|
+
var ge = /* @__PURE__ */ function() {
|
|
184
|
+
return typeof SVGGraphicsElement < "u" ? function(e) {
|
|
185
|
+
return e instanceof p(e).SVGGraphicsElement;
|
|
186
|
+
} : function(e) {
|
|
187
|
+
return e instanceof p(e).SVGElement && typeof e.getBBox == "function";
|
|
188
|
+
};
|
|
189
|
+
}();
|
|
190
|
+
function ye(e) {
|
|
191
|
+
return e === p(e).document.documentElement;
|
|
192
|
+
}
|
|
193
|
+
function Re(e) {
|
|
194
|
+
return z ? ge(e) ? _e(e) : me(e) : V;
|
|
195
|
+
}
|
|
196
|
+
function we(e) {
|
|
197
|
+
var t = e.x, n = e.y, r = e.width, i = e.height, o = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, s = Object.create(o.prototype);
|
|
198
|
+
return L(s, {
|
|
199
|
+
x: t,
|
|
200
|
+
y: n,
|
|
201
|
+
width: r,
|
|
202
|
+
height: i,
|
|
203
|
+
top: n,
|
|
204
|
+
right: t + r,
|
|
205
|
+
bottom: i + n,
|
|
206
|
+
left: t
|
|
207
|
+
}), s;
|
|
208
|
+
}
|
|
209
|
+
function y(e, t, n, r) {
|
|
210
|
+
return { x: e, y: t, width: n, height: r };
|
|
211
|
+
}
|
|
212
|
+
var Ee = (
|
|
213
|
+
/** @class */
|
|
214
|
+
function() {
|
|
215
|
+
function e(t) {
|
|
216
|
+
this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = y(0, 0, 0, 0), this.target = t;
|
|
217
|
+
}
|
|
218
|
+
return e.prototype.isActive = function() {
|
|
219
|
+
var t = Re(this.target);
|
|
220
|
+
return this.contentRect_ = t, t.width !== this.broadcastWidth || t.height !== this.broadcastHeight;
|
|
221
|
+
}, e.prototype.broadcastRect = function() {
|
|
222
|
+
var t = this.contentRect_;
|
|
223
|
+
return this.broadcastWidth = t.width, this.broadcastHeight = t.height, t;
|
|
224
|
+
}, e;
|
|
225
|
+
}()
|
|
226
|
+
), Oe = (
|
|
227
|
+
/** @class */
|
|
228
|
+
/* @__PURE__ */ function() {
|
|
229
|
+
function e(t, n) {
|
|
230
|
+
var r = we(n);
|
|
231
|
+
L(this, { target: t, contentRect: r });
|
|
232
|
+
}
|
|
233
|
+
return e;
|
|
234
|
+
}()
|
|
235
|
+
), ze = (
|
|
236
|
+
/** @class */
|
|
237
|
+
function() {
|
|
238
|
+
function e(t, n, r) {
|
|
239
|
+
if (this.activeObservations_ = [], this.observations_ = new I(), typeof t != "function")
|
|
240
|
+
throw new TypeError("The callback provided as parameter 1 is not a function.");
|
|
241
|
+
this.callback_ = t, this.controller_ = n, this.callbackCtx_ = r;
|
|
242
|
+
}
|
|
243
|
+
return e.prototype.observe = function(t) {
|
|
244
|
+
if (!arguments.length)
|
|
245
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
246
|
+
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
247
|
+
if (!(t instanceof p(t).Element))
|
|
248
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
249
|
+
var n = this.observations_;
|
|
250
|
+
n.has(t) || (n.set(t, new Ee(t)), this.controller_.addObserver(this), this.controller_.refresh());
|
|
251
|
+
}
|
|
252
|
+
}, e.prototype.unobserve = function(t) {
|
|
253
|
+
if (!arguments.length)
|
|
254
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
255
|
+
if (!(typeof Element > "u" || !(Element instanceof Object))) {
|
|
256
|
+
if (!(t instanceof p(t).Element))
|
|
257
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
258
|
+
var n = this.observations_;
|
|
259
|
+
n.has(t) && (n.delete(t), n.size || this.controller_.removeObserver(this));
|
|
260
|
+
}
|
|
261
|
+
}, e.prototype.disconnect = function() {
|
|
262
|
+
this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
|
|
263
|
+
}, e.prototype.gatherActive = function() {
|
|
264
|
+
var t = this;
|
|
265
|
+
this.clearActive(), this.observations_.forEach(function(n) {
|
|
266
|
+
n.isActive() && t.activeObservations_.push(n);
|
|
267
|
+
});
|
|
268
|
+
}, e.prototype.broadcastActive = function() {
|
|
269
|
+
if (this.hasActive()) {
|
|
270
|
+
var t = this.callbackCtx_, n = this.activeObservations_.map(function(r) {
|
|
271
|
+
return new Oe(r.target, r.broadcastRect());
|
|
272
|
+
});
|
|
273
|
+
this.callback_.call(t, n, t), this.clearActive();
|
|
274
|
+
}
|
|
275
|
+
}, e.prototype.clearActive = function() {
|
|
276
|
+
this.activeObservations_.splice(0);
|
|
277
|
+
}, e.prototype.hasActive = function() {
|
|
278
|
+
return this.activeObservations_.length > 0;
|
|
279
|
+
}, e;
|
|
280
|
+
}()
|
|
281
|
+
), B = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new I(), j = (
|
|
282
|
+
/** @class */
|
|
283
|
+
/* @__PURE__ */ function() {
|
|
284
|
+
function e(t) {
|
|
285
|
+
if (!(this instanceof e))
|
|
286
|
+
throw new TypeError("Cannot call a class as a function.");
|
|
287
|
+
if (!arguments.length)
|
|
288
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
289
|
+
var n = pe.getInstance(), r = new ze(t, n, this);
|
|
290
|
+
B.set(this, r);
|
|
291
|
+
}
|
|
292
|
+
return e;
|
|
293
|
+
}()
|
|
294
|
+
);
|
|
295
|
+
[
|
|
296
|
+
"observe",
|
|
297
|
+
"unobserve",
|
|
298
|
+
"disconnect"
|
|
299
|
+
].forEach(function(e) {
|
|
300
|
+
j.prototype[e] = function() {
|
|
301
|
+
var t;
|
|
302
|
+
return (t = B.get(this))[e].apply(t, arguments);
|
|
303
|
+
};
|
|
304
|
+
});
|
|
305
|
+
var Ce = function() {
|
|
306
|
+
return typeof m.ResizeObserver < "u" ? m.ResizeObserver : j;
|
|
307
|
+
}(), d = /* @__PURE__ */ new Map();
|
|
308
|
+
function F(e) {
|
|
309
|
+
e.forEach(function(t) {
|
|
310
|
+
var n, r = t.target;
|
|
311
|
+
(n = d.get(r)) === null || n === void 0 || n.forEach(function(i) {
|
|
312
|
+
return i(r);
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
var G = new Ce(F);
|
|
317
|
+
process.env.NODE_ENV;
|
|
318
|
+
process.env.NODE_ENV;
|
|
319
|
+
function Me(e, t) {
|
|
320
|
+
d.has(e) || (d.set(e, /* @__PURE__ */ new Set()), G.observe(e)), d.get(e).add(t);
|
|
321
|
+
}
|
|
322
|
+
function xe(e, t) {
|
|
323
|
+
d.has(e) && (d.get(e).delete(t), d.get(e).size || (G.unobserve(e), d.delete(e)));
|
|
324
|
+
}
|
|
325
|
+
var Ae = /* @__PURE__ */ function(e) {
|
|
326
|
+
U(n, e);
|
|
327
|
+
var t = Z(n);
|
|
328
|
+
function n() {
|
|
329
|
+
return ee(this, n), t.apply(this, arguments);
|
|
330
|
+
}
|
|
331
|
+
return te(n, [{
|
|
332
|
+
key: "render",
|
|
333
|
+
value: function() {
|
|
334
|
+
return this.props.children;
|
|
335
|
+
}
|
|
336
|
+
}]), n;
|
|
337
|
+
}(a.Component);
|
|
338
|
+
function De(e, t) {
|
|
339
|
+
var n = e.children, r = e.disabled, i = a.useRef(null), o = a.useRef(null), s = a.useContext(O), c = typeof n == "function", u = c ? n(i) : n, f = a.useRef({
|
|
340
|
+
width: -1,
|
|
341
|
+
height: -1,
|
|
342
|
+
offsetWidth: -1,
|
|
343
|
+
offsetHeight: -1
|
|
344
|
+
}), l = !c && /* @__PURE__ */ a.isValidElement(u) && ne(u), K = l ? re(u) : null, Y = ie(K, i), C = function() {
|
|
345
|
+
var v;
|
|
346
|
+
return E(i.current) || // Support `nativeElement` format
|
|
347
|
+
(i.current && oe(i.current) === "object" ? E((v = i.current) === null || v === void 0 ? void 0 : v.nativeElement) : null) || E(o.current);
|
|
348
|
+
};
|
|
349
|
+
a.useImperativeHandle(t, function() {
|
|
350
|
+
return C();
|
|
351
|
+
});
|
|
352
|
+
var M = a.useRef(e);
|
|
353
|
+
M.current = e;
|
|
354
|
+
var x = a.useCallback(function(h) {
|
|
355
|
+
var v = M.current, A = v.onResize, X = v.data, D = h.getBoundingClientRect(), R = D.width, w = D.height, b = h.offsetWidth, _ = h.offsetHeight, N = Math.floor(R), S = Math.floor(w);
|
|
356
|
+
if (f.current.width !== N || f.current.height !== S || f.current.offsetWidth !== b || f.current.offsetHeight !== _) {
|
|
357
|
+
var T = {
|
|
358
|
+
width: N,
|
|
359
|
+
height: S,
|
|
360
|
+
offsetWidth: b,
|
|
361
|
+
offsetHeight: _
|
|
362
|
+
};
|
|
363
|
+
f.current = T;
|
|
364
|
+
var J = b === Math.round(R) ? R : b, Q = _ === Math.round(w) ? w : _, W = H(H({}, T), {}, {
|
|
365
|
+
offsetWidth: J,
|
|
366
|
+
offsetHeight: Q
|
|
367
|
+
});
|
|
368
|
+
s == null || s(W, h, X), A && Promise.resolve().then(function() {
|
|
369
|
+
A(W, h);
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}, []);
|
|
373
|
+
return a.useEffect(function() {
|
|
374
|
+
var h = C();
|
|
375
|
+
return h && !r && Me(h, x), function() {
|
|
376
|
+
return xe(h, x);
|
|
377
|
+
};
|
|
378
|
+
}, [i.current, r]), /* @__PURE__ */ a.createElement(Ae, {
|
|
379
|
+
ref: o
|
|
380
|
+
}, l ? /* @__PURE__ */ a.cloneElement(u, {
|
|
381
|
+
ref: Y
|
|
382
|
+
}) : u);
|
|
383
|
+
}
|
|
384
|
+
var q = /* @__PURE__ */ a.forwardRef(De);
|
|
385
|
+
process.env.NODE_ENV !== "production" && (q.displayName = "SingleObserver");
|
|
386
|
+
var Ne = "rc-observer-key";
|
|
387
|
+
function Se(e, t) {
|
|
388
|
+
var n = e.children, r = typeof n == "function" ? [n] : ae(n);
|
|
389
|
+
return process.env.NODE_ENV !== "production" && (r.length > 1 ? P(!1, "Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead.") : r.length === 0 && P(!1, "`children` of ResizeObserver is empty. Nothing is in observe.")), r.map(function(i, o) {
|
|
390
|
+
var s = (i == null ? void 0 : i.key) || "".concat(Ne, "-").concat(o);
|
|
391
|
+
return /* @__PURE__ */ a.createElement(q, se({}, e, {
|
|
392
|
+
key: s,
|
|
393
|
+
ref: o === 0 ? t : void 0
|
|
394
|
+
}), i);
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
var $ = /* @__PURE__ */ a.forwardRef(Se);
|
|
398
|
+
process.env.NODE_ENV !== "production" && ($.displayName = "ResizeObserver");
|
|
399
|
+
$.Collection = ue;
|
|
400
|
+
export {
|
|
401
|
+
$ as R
|
|
402
|
+
};
|