@ntbjs/react-components 1.1.13 → 1.1.15
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/.eslintrc +7 -8
- package/{ActionButton-46735b89.js → ActionButton-b2345555.js} +19 -16
- package/{Alert-13b75102.js → Alert-d69a3f95.js} +20 -24
- package/{AssetGallery-f62e16b2.js → AssetAction-2e2d496e.js} +585 -650
- package/AssetPreviewTopBar-b1fe3188.js +104 -0
- package/{Badge-757b0a39.js → Badge-e984e6f5.js} +28 -49
- package/{Button-49f82b31.js → Button-39607724.js} +53 -65
- package/{Checkbox-68dc38a8.js → Checkbox-ad9c9e54.js} +30 -35
- package/{CompactAutocompleteSelect-96137f48.js → CompactAutocompleteSelect-7d05d707.js} +82 -114
- package/{CompactStarRating-15c1b812.js → CompactStarRating-d4cfae17.js} +71 -87
- package/{CompactTextInput-a43aea28.js → CompactTextInput-f89988be.js} +95 -105
- package/{ContextMenu-4ec3d9f3.js → ContextMenu-4eb8fdc5.js} +6 -6
- package/{ContextMenuItem-ba2b697e.js → ContextMenuItem-c536b460.js} +22 -26
- package/{InputGroup-49fbc423.js → InputGroup-a89a0ea3.js} +6 -6
- package/{Instructions-9a0fd247.js → Instructions-c8502398.js} +97 -81
- package/{MultiLevelCheckboxSelect-e6e5cb90.js → MultiLevelCheckboxSelect-6be69491.js} +102 -164
- package/{MultiSelect-efd60232.js → MultiSelect-81e7016c.js} +71 -101
- package/{Popover-569cd272.js → Popover-c5e425a7.js} +19 -21
- package/{Radio-32d0513a.js → Radio-55db4781.js} +21 -22
- package/{SectionSeparator-259a22ed.js → SectionSeparator-af8dc1ce.js} +6 -6
- package/{Switch-4a41585f.js → Switch-04ecd8d0.js} +25 -27
- package/{Tab-f499ecbc.js → Tab-e43241f0.js} +7 -7
- package/{Tabs-116aa951.js → Tabs-cfc08c6b.js} +21 -33
- package/{TextArea-a869b1a9.js → TextArea-6e15b44f.js} +110 -135
- package/{TextInput-0d109708.js → TextInput-9a995449.js} +41 -48
- package/{Tooltip-66daf6e3.js → Tooltip-a68a7e49.js} +13 -13
- package/{VerificationStatusIcon-d5bfb67a.js → VerificationStatusIcon-7b0e23fe.js} +20 -30
- package/{close-ebf2f3cf.js → close-1751121a.js} +8 -12
- package/data/Alert/index.js +2 -2
- package/data/Badge/index.js +2 -2
- package/data/Popover/index.js +3 -3
- package/data/Tab/index.js +2 -2
- package/data/Tabs/index.js +3 -3
- package/data/Tooltip/index.js +3 -3
- package/data/index.js +9 -9
- package/{defaultTheme-ea44e34a.js → defaultTheme-cd01e6c2.js} +212 -260
- package/edit-note-cefe2215.js +37 -0
- package/{expand-more-94585605.js → expand-more-d74e2bd2.js} +8 -12
- package/inputs/ActionButton/index.js +2 -2
- package/inputs/Button/index.js +6 -6
- package/inputs/Checkbox/index.js +2 -2
- package/inputs/CompactAutocompleteSelect/index.js +13 -13
- package/inputs/CompactStarRating/index.js +10 -10
- package/inputs/CompactTextInput/index.js +11 -11
- package/inputs/MultiSelect/index.js +4 -4
- package/inputs/Radio/index.js +2 -2
- package/inputs/Switch/index.js +2 -2
- package/inputs/TextArea/index.js +11 -11
- package/inputs/TextInput/index.js +3 -3
- package/inputs/index.js +28 -28
- package/layout/InputGroup/index.js +2 -2
- package/layout/SectionSeparator/index.js +2 -2
- package/layout/index.js +3 -3
- package/package.json +2 -1
- package/{react-select-creatable.esm-2f23d6c6.js → react-select-creatable.esm-9745dc34.js} +1502 -1281
- package/{shift-away-subtle-0bed9a3c.js → shift-away-subtle-631cd794.js} +1 -1
- package/ssr/index.js +1 -3
- package/widgets/AssetGallery/index.js +34 -32
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +3 -3
- package/widgets/ContextMenu/ContextMenuItem/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +6 -6
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +16 -17
- package/widgets/index.js +37 -35
- package/AssetPreviewTopBar-912c3469.js +0 -99
- package/edit-note-c47d292e.js +0 -41
- package/warning-circle-24522402.js +0 -41
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
+
var defaultTheme$1 = require('./defaultTheme-cd01e6c2.js');
|
|
4
5
|
var reactDom = require('react-dom');
|
|
5
6
|
|
|
6
7
|
function _interopNamespace(e) {
|
|
@@ -12,228 +13,190 @@ function _interopNamespace(e) {
|
|
|
12
13
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
14
|
Object.defineProperty(n, k, d.get ? d : {
|
|
14
15
|
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return e[k];
|
|
17
|
-
}
|
|
16
|
+
get: function () { return e[k]; }
|
|
18
17
|
});
|
|
19
18
|
}
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
|
-
n[
|
|
21
|
+
n["default"] = e;
|
|
23
22
|
return Object.freeze(n);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
26
|
|
|
28
27
|
function _extends() {
|
|
29
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
30
|
-
for (var
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
for (var key in source) {
|
|
34
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
35
|
-
target[key] = source[key];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
28
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
29
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
30
|
+
var t = arguments[e];
|
|
31
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
38
32
|
}
|
|
33
|
+
return n;
|
|
34
|
+
}, _extends.apply(null, arguments);
|
|
35
|
+
}
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
function _typeof(o) {
|
|
38
|
+
"@babel/helpers - typeof";
|
|
39
|
+
|
|
40
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
41
|
+
return typeof o;
|
|
42
|
+
} : function (o) {
|
|
43
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
44
|
+
}, _typeof(o);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
obj[key] = value;
|
|
47
|
+
function toPrimitive(t, r) {
|
|
48
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
49
|
+
var e = t[Symbol.toPrimitive];
|
|
50
|
+
if (void 0 !== e) {
|
|
51
|
+
var i = e.call(t, r || "default");
|
|
52
|
+
if ("object" != _typeof(i)) return i;
|
|
53
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
55
54
|
}
|
|
55
|
+
return ("string" === r ? String : Number)(t);
|
|
56
|
+
}
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
function toPropertyKey(t) {
|
|
59
|
+
var i = toPrimitive(t, "string");
|
|
60
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
function
|
|
61
|
-
|
|
63
|
+
function _defineProperty(e, r, t) {
|
|
64
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
65
|
+
value: t,
|
|
66
|
+
enumerable: !0,
|
|
67
|
+
configurable: !0,
|
|
68
|
+
writable: !0
|
|
69
|
+
}) : e[r] = t, e;
|
|
70
|
+
}
|
|
62
71
|
|
|
72
|
+
function ownKeys(e, r) {
|
|
73
|
+
var t = Object.keys(e);
|
|
63
74
|
if (Object.getOwnPropertySymbols) {
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
return Object.getOwnPropertyDescriptor(
|
|
67
|
-
})),
|
|
75
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
76
|
+
r && (o = o.filter(function (r) {
|
|
77
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
78
|
+
})), t.push.apply(t, o);
|
|
68
79
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
79
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
80
|
+
return t;
|
|
81
|
+
}
|
|
82
|
+
function _objectSpread2(e) {
|
|
83
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
84
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
85
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
86
|
+
_defineProperty(e, r, t[r]);
|
|
87
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
88
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
80
89
|
});
|
|
81
90
|
}
|
|
82
|
-
|
|
83
|
-
return target;
|
|
91
|
+
return e;
|
|
84
92
|
}
|
|
85
93
|
|
|
86
|
-
function _classCallCheck(
|
|
87
|
-
if (!(
|
|
88
|
-
throw new TypeError("Cannot call a class as a function");
|
|
89
|
-
}
|
|
94
|
+
function _classCallCheck(a, n) {
|
|
95
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
90
96
|
}
|
|
91
97
|
|
|
92
|
-
function _defineProperties(
|
|
93
|
-
for (var
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
descriptor.configurable = true;
|
|
97
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
98
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
98
|
+
function _defineProperties(e, r) {
|
|
99
|
+
for (var t = 0; t < r.length; t++) {
|
|
100
|
+
var o = r[t];
|
|
101
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
106
|
-
writable: false
|
|
107
|
-
});
|
|
108
|
-
return Constructor;
|
|
104
|
+
function _createClass(e, r, t) {
|
|
105
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
106
|
+
writable: !1
|
|
107
|
+
}), e;
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
function _setPrototypeOf(
|
|
112
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
};
|
|
116
|
-
return _setPrototypeOf(o, p);
|
|
110
|
+
function _setPrototypeOf(t, e) {
|
|
111
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
112
|
+
return t.__proto__ = e, t;
|
|
113
|
+
}, _setPrototypeOf(t, e);
|
|
117
114
|
}
|
|
118
115
|
|
|
119
|
-
function _inherits(
|
|
120
|
-
if (typeof
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
116
|
+
function _inherits(t, e) {
|
|
117
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
118
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
125
119
|
constructor: {
|
|
126
|
-
value:
|
|
127
|
-
writable:
|
|
128
|
-
configurable:
|
|
120
|
+
value: t,
|
|
121
|
+
writable: !0,
|
|
122
|
+
configurable: !0
|
|
129
123
|
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
});
|
|
134
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
124
|
+
}), Object.defineProperty(t, "prototype", {
|
|
125
|
+
writable: !1
|
|
126
|
+
}), e && _setPrototypeOf(t, e);
|
|
135
127
|
}
|
|
136
128
|
|
|
137
|
-
function _getPrototypeOf(
|
|
138
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function
|
|
139
|
-
return
|
|
140
|
-
};
|
|
141
|
-
return _getPrototypeOf(o);
|
|
129
|
+
function _getPrototypeOf(t) {
|
|
130
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
131
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
132
|
+
}, _getPrototypeOf(t);
|
|
142
133
|
}
|
|
143
134
|
|
|
144
135
|
function _isNativeReflectConstruct() {
|
|
145
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
146
|
-
if (Reflect.construct.sham) return false;
|
|
147
|
-
if (typeof Proxy === "function") return true;
|
|
148
|
-
|
|
149
136
|
try {
|
|
150
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function _typeof(obj) {
|
|
158
|
-
"@babel/helpers - typeof";
|
|
159
|
-
|
|
160
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
161
|
-
return typeof obj;
|
|
162
|
-
} : function (obj) {
|
|
163
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
164
|
-
}, _typeof(obj);
|
|
137
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
138
|
+
} catch (t) {}
|
|
139
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
140
|
+
return !!t;
|
|
141
|
+
})();
|
|
165
142
|
}
|
|
166
143
|
|
|
167
|
-
function _assertThisInitialized(
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return self;
|
|
144
|
+
function _assertThisInitialized(e) {
|
|
145
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
146
|
+
return e;
|
|
173
147
|
}
|
|
174
148
|
|
|
175
|
-
function _possibleConstructorReturn(
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return _assertThisInitialized(self);
|
|
149
|
+
function _possibleConstructorReturn(t, e) {
|
|
150
|
+
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
151
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
152
|
+
return _assertThisInitialized(t);
|
|
183
153
|
}
|
|
184
154
|
|
|
185
|
-
function _createSuper(
|
|
186
|
-
var
|
|
187
|
-
return function
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
result = Super.apply(this, arguments);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return _possibleConstructorReturn(this, result);
|
|
155
|
+
function _createSuper(t) {
|
|
156
|
+
var r = _isNativeReflectConstruct();
|
|
157
|
+
return function () {
|
|
158
|
+
var e,
|
|
159
|
+
o = _getPrototypeOf(t);
|
|
160
|
+
if (r) {
|
|
161
|
+
var s = _getPrototypeOf(this).constructor;
|
|
162
|
+
e = Reflect.construct(o, arguments, s);
|
|
163
|
+
} else e = o.apply(this, arguments);
|
|
164
|
+
return _possibleConstructorReturn(this, e);
|
|
199
165
|
};
|
|
200
166
|
}
|
|
201
167
|
|
|
202
|
-
function _arrayLikeToArray(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
arr2[i] = arr[i];
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return arr2;
|
|
168
|
+
function _arrayLikeToArray(r, a) {
|
|
169
|
+
(null == a || a > r.length) && (a = r.length);
|
|
170
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
171
|
+
return n;
|
|
210
172
|
}
|
|
211
173
|
|
|
212
|
-
function _arrayWithoutHoles(
|
|
213
|
-
if (Array.isArray(
|
|
174
|
+
function _arrayWithoutHoles(r) {
|
|
175
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
214
176
|
}
|
|
215
177
|
|
|
216
|
-
function _iterableToArray(
|
|
217
|
-
if (typeof Symbol
|
|
178
|
+
function _iterableToArray(r) {
|
|
179
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
218
180
|
}
|
|
219
181
|
|
|
220
|
-
function _unsupportedIterableToArray(
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
182
|
+
function _unsupportedIterableToArray(r, a) {
|
|
183
|
+
if (r) {
|
|
184
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
185
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
186
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
187
|
+
}
|
|
227
188
|
}
|
|
228
189
|
|
|
229
190
|
function _nonIterableSpread() {
|
|
230
191
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
231
192
|
}
|
|
232
193
|
|
|
233
|
-
function _toConsumableArray(
|
|
234
|
-
return _arrayWithoutHoles(
|
|
194
|
+
function _toConsumableArray(r) {
|
|
195
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
235
196
|
}
|
|
236
197
|
|
|
198
|
+
var isDevelopment$2 = false;
|
|
199
|
+
|
|
237
200
|
/*
|
|
238
201
|
|
|
239
202
|
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
@@ -256,10 +219,9 @@ styleSheet.flush()
|
|
|
256
219
|
- empties the stylesheet of all its contents
|
|
257
220
|
|
|
258
221
|
*/
|
|
259
|
-
|
|
222
|
+
|
|
260
223
|
function sheetForTag(tag) {
|
|
261
224
|
if (tag.sheet) {
|
|
262
|
-
// $FlowFixMe
|
|
263
225
|
return tag.sheet;
|
|
264
226
|
} // this weirdness brought to you by firefox
|
|
265
227
|
|
|
@@ -268,10 +230,13 @@ function sheetForTag(tag) {
|
|
|
268
230
|
|
|
269
231
|
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
270
232
|
if (document.styleSheets[i].ownerNode === tag) {
|
|
271
|
-
// $FlowFixMe
|
|
272
233
|
return document.styleSheets[i];
|
|
273
234
|
}
|
|
274
|
-
}
|
|
235
|
+
} // this function should always return with a value
|
|
236
|
+
// TS can't understand it though so we make it stop complaining here
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
return undefined;
|
|
275
240
|
}
|
|
276
241
|
|
|
277
242
|
function createStyleElement(options) {
|
|
@@ -312,7 +277,7 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
312
277
|
_this.tags.push(tag);
|
|
313
278
|
};
|
|
314
279
|
|
|
315
|
-
this.isSpeedy = options.speedy === undefined ?
|
|
280
|
+
this.isSpeedy = options.speedy === undefined ? !isDevelopment$2 : options.speedy;
|
|
316
281
|
this.tags = [];
|
|
317
282
|
this.ctr = 0;
|
|
318
283
|
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
@@ -340,18 +305,6 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
340
305
|
|
|
341
306
|
var tag = this.tags[this.tags.length - 1];
|
|
342
307
|
|
|
343
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
344
|
-
var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
345
|
-
|
|
346
|
-
if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
|
|
347
|
-
// this would only cause problem in speedy mode
|
|
348
|
-
// but we don't want enabling speedy to affect the observable behavior
|
|
349
|
-
// so we report this error at all times
|
|
350
|
-
console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
|
|
351
|
-
}
|
|
352
|
-
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
308
|
if (this.isSpeedy) {
|
|
356
309
|
var sheet = sheetForTag(tag);
|
|
357
310
|
|
|
@@ -360,9 +313,6 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
360
313
|
// the big drawback is that the css won't be editable in devtools
|
|
361
314
|
sheet.insertRule(rule, sheet.cssRules.length);
|
|
362
315
|
} catch (e) {
|
|
363
|
-
if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
|
|
364
|
-
console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
|
|
365
|
-
}
|
|
366
316
|
}
|
|
367
317
|
} else {
|
|
368
318
|
tag.appendChild(document.createTextNode(rule));
|
|
@@ -372,16 +322,13 @@ var StyleSheet = /*#__PURE__*/function () {
|
|
|
372
322
|
};
|
|
373
323
|
|
|
374
324
|
_proto.flush = function flush() {
|
|
375
|
-
// $FlowFixMe
|
|
376
325
|
this.tags.forEach(function (tag) {
|
|
377
|
-
|
|
326
|
+
var _tag$parentNode;
|
|
327
|
+
|
|
328
|
+
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
378
329
|
});
|
|
379
330
|
this.tags = [];
|
|
380
331
|
this.ctr = 0;
|
|
381
|
-
|
|
382
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
383
|
-
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
384
|
-
}
|
|
385
332
|
};
|
|
386
333
|
|
|
387
334
|
return StyleSheet;
|
|
@@ -986,11 +933,11 @@ function rulesheet (callback) {
|
|
|
986
933
|
}
|
|
987
934
|
|
|
988
935
|
var weakMemoize = function weakMemoize(func) {
|
|
989
|
-
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
|
|
990
936
|
var cache = new WeakMap();
|
|
991
937
|
return function (arg) {
|
|
992
938
|
if (cache.has(arg)) {
|
|
993
|
-
//
|
|
939
|
+
// Use non-null assertion because we just checked that the cache `has` it
|
|
940
|
+
// This allows us to remove `undefined` from the return value
|
|
994
941
|
return cache.get(arg);
|
|
995
942
|
}
|
|
996
943
|
|
|
@@ -1000,7 +947,7 @@ var weakMemoize = function weakMemoize(func) {
|
|
|
1000
947
|
};
|
|
1001
948
|
};
|
|
1002
949
|
|
|
1003
|
-
function memoize
|
|
950
|
+
function memoize(fn) {
|
|
1004
951
|
var cache = Object.create(null);
|
|
1005
952
|
return function (arg) {
|
|
1006
953
|
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
@@ -1008,6 +955,8 @@ function memoize$1(fn) {
|
|
|
1008
955
|
};
|
|
1009
956
|
}
|
|
1010
957
|
|
|
958
|
+
var isBrowser$3 = typeof document !== 'undefined';
|
|
959
|
+
|
|
1011
960
|
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
1012
961
|
var previous = 0;
|
|
1013
962
|
var character = 0;
|
|
@@ -1132,114 +1081,6 @@ var removeLabel = function removeLabel(element) {
|
|
|
1132
1081
|
}
|
|
1133
1082
|
}
|
|
1134
1083
|
};
|
|
1135
|
-
var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
|
|
1136
|
-
|
|
1137
|
-
var isIgnoringComment = function isIgnoringComment(element) {
|
|
1138
|
-
return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
|
|
1139
|
-
};
|
|
1140
|
-
|
|
1141
|
-
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
|
|
1142
|
-
return function (element, index, children) {
|
|
1143
|
-
if (element.type !== 'rule' || cache.compat) return;
|
|
1144
|
-
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
1145
|
-
|
|
1146
|
-
if (unsafePseudoClasses) {
|
|
1147
|
-
var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
|
|
1148
|
-
//
|
|
1149
|
-
// considering this input:
|
|
1150
|
-
// .a {
|
|
1151
|
-
// .b /* comm */ {}
|
|
1152
|
-
// color: hotpink;
|
|
1153
|
-
// }
|
|
1154
|
-
// we get output corresponding to this:
|
|
1155
|
-
// .a {
|
|
1156
|
-
// & {
|
|
1157
|
-
// /* comm */
|
|
1158
|
-
// color: hotpink;
|
|
1159
|
-
// }
|
|
1160
|
-
// .b {}
|
|
1161
|
-
// }
|
|
1162
|
-
|
|
1163
|
-
var commentContainer = isNested ? element.parent.children : // global rule at the root level
|
|
1164
|
-
children;
|
|
1165
|
-
|
|
1166
|
-
for (var i = commentContainer.length - 1; i >= 0; i--) {
|
|
1167
|
-
var node = commentContainer[i];
|
|
1168
|
-
|
|
1169
|
-
if (node.line < element.line) {
|
|
1170
|
-
break;
|
|
1171
|
-
} // it is quite weird but comments are *usually* put at `column: element.column - 1`
|
|
1172
|
-
// so we seek *from the end* for the node that is earlier than the rule's `element` and check that
|
|
1173
|
-
// this will also match inputs like this:
|
|
1174
|
-
// .a {
|
|
1175
|
-
// /* comm */
|
|
1176
|
-
// .b {}
|
|
1177
|
-
// }
|
|
1178
|
-
//
|
|
1179
|
-
// but that is fine
|
|
1180
|
-
//
|
|
1181
|
-
// it would be the easiest to change the placement of the comment to be the first child of the rule:
|
|
1182
|
-
// .a {
|
|
1183
|
-
// .b { /* comm */ }
|
|
1184
|
-
// }
|
|
1185
|
-
// with such inputs we wouldn't have to search for the comment at all
|
|
1186
|
-
// TODO: consider changing this comment placement in the next major version
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
if (node.column < element.column) {
|
|
1190
|
-
if (isIgnoringComment(node)) {
|
|
1191
|
-
return;
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
break;
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
|
|
1199
|
-
console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
};
|
|
1203
|
-
};
|
|
1204
|
-
|
|
1205
|
-
var isImportRule = function isImportRule(element) {
|
|
1206
|
-
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
1207
|
-
};
|
|
1208
|
-
|
|
1209
|
-
var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
|
|
1210
|
-
for (var i = index - 1; i >= 0; i--) {
|
|
1211
|
-
if (!isImportRule(children[i])) {
|
|
1212
|
-
return true;
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
return false;
|
|
1217
|
-
}; // use this to remove incorrect elements from further processing
|
|
1218
|
-
// so they don't get handed to the `sheet` (or anything else)
|
|
1219
|
-
// as that could potentially lead to additional logs which in turn could be overhelming to the user
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
var nullifyElement = function nullifyElement(element) {
|
|
1223
|
-
element.type = '';
|
|
1224
|
-
element.value = '';
|
|
1225
|
-
element["return"] = '';
|
|
1226
|
-
element.children = '';
|
|
1227
|
-
element.props = '';
|
|
1228
|
-
};
|
|
1229
|
-
|
|
1230
|
-
var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
|
|
1231
|
-
if (!isImportRule(element)) {
|
|
1232
|
-
return;
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
if (element.parent) {
|
|
1236
|
-
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
|
|
1237
|
-
nullifyElement(element);
|
|
1238
|
-
} else if (isPrependedWithRegularRules(index, children)) {
|
|
1239
|
-
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
1240
|
-
nullifyElement(element);
|
|
1241
|
-
}
|
|
1242
|
-
};
|
|
1243
1084
|
|
|
1244
1085
|
/* eslint-disable no-fallthrough */
|
|
1245
1086
|
|
|
@@ -1453,9 +1294,22 @@ var prefixer = function prefixer(element, index, children, callback) {
|
|
|
1453
1294
|
}
|
|
1454
1295
|
};
|
|
1455
1296
|
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1297
|
+
/* import type { StylisPlugin } from './types' */
|
|
1298
|
+
|
|
1299
|
+
/*
|
|
1300
|
+
export type Options = {
|
|
1301
|
+
nonce?: string,
|
|
1302
|
+
stylisPlugins?: StylisPlugin[],
|
|
1303
|
+
key: string,
|
|
1304
|
+
container?: HTMLElement,
|
|
1305
|
+
speedy?: boolean,
|
|
1306
|
+
prepend?: boolean,
|
|
1307
|
+
insertionPoint?: HTMLElement
|
|
1308
|
+
}
|
|
1309
|
+
*/
|
|
1310
|
+
|
|
1311
|
+
var getServerStylisCache = isBrowser$3 ? undefined : weakMemoize(function () {
|
|
1312
|
+
return memoize(function () {
|
|
1459
1313
|
var cache = {};
|
|
1460
1314
|
return function (name) {
|
|
1461
1315
|
return cache[name];
|
|
@@ -1464,20 +1318,22 @@ var getServerStylisCache = isBrowser$4 ? undefined : weakMemoize(function () {
|
|
|
1464
1318
|
});
|
|
1465
1319
|
var defaultStylisPlugins = [prefixer];
|
|
1466
1320
|
|
|
1467
|
-
var createCache = function
|
|
1321
|
+
var createCache = function
|
|
1322
|
+
/*: EmotionCache */
|
|
1323
|
+
createCache(options
|
|
1324
|
+
/*: Options */
|
|
1325
|
+
) {
|
|
1468
1326
|
var key = options.key;
|
|
1469
1327
|
|
|
1470
|
-
if (
|
|
1471
|
-
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
if (isBrowser$4 && key === 'css') {
|
|
1328
|
+
if (isBrowser$3 && key === 'css') {
|
|
1475
1329
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
1476
1330
|
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
1477
1331
|
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
1478
1332
|
// that creating a cache works inside of render of a React component
|
|
1479
1333
|
|
|
1480
|
-
Array.prototype.forEach.call(ssrStyles, function (node
|
|
1334
|
+
Array.prototype.forEach.call(ssrStyles, function (node
|
|
1335
|
+
/*: HTMLStyleElement */
|
|
1336
|
+
) {
|
|
1481
1337
|
// we want to only move elements which have a space in the data-emotion attribute value
|
|
1482
1338
|
// because that indicates that it is an Emotion 11 server-side rendered style elements
|
|
1483
1339
|
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
|
|
@@ -1489,6 +1345,7 @@ var createCache = function createCache(options) {
|
|
|
1489
1345
|
if (dataEmotionAttribute.indexOf(' ') === -1) {
|
|
1490
1346
|
return;
|
|
1491
1347
|
}
|
|
1348
|
+
|
|
1492
1349
|
document.head.appendChild(node);
|
|
1493
1350
|
node.setAttribute('data-s', '');
|
|
1494
1351
|
});
|
|
@@ -1496,23 +1353,20 @@ var createCache = function createCache(options) {
|
|
|
1496
1353
|
|
|
1497
1354
|
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
1498
1355
|
|
|
1499
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1500
|
-
// $FlowFixMe
|
|
1501
|
-
if (/[^a-z-]/.test(key)) {
|
|
1502
|
-
throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
1356
|
var inserted = {};
|
|
1507
1357
|
var container;
|
|
1358
|
+
/* : Node */
|
|
1359
|
+
|
|
1508
1360
|
var nodesToHydrate = [];
|
|
1509
1361
|
|
|
1510
|
-
if (isBrowser$
|
|
1362
|
+
if (isBrowser$3) {
|
|
1511
1363
|
container = options.container || document.head;
|
|
1512
1364
|
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
1513
1365
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
1514
|
-
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
|
|
1515
|
-
|
|
1366
|
+
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
|
|
1367
|
+
/*: HTMLStyleElement */
|
|
1368
|
+
) {
|
|
1369
|
+
var attrib = node.getAttribute("data-emotion").split(' ');
|
|
1516
1370
|
|
|
1517
1371
|
for (var i = 1; i < attrib.length; i++) {
|
|
1518
1372
|
inserted[attrib[i]] = true;
|
|
@@ -1523,31 +1377,19 @@ var createCache = function createCache(options) {
|
|
|
1523
1377
|
}
|
|
1524
1378
|
|
|
1525
1379
|
var _insert;
|
|
1380
|
+
/*: (
|
|
1381
|
+
selector: string,
|
|
1382
|
+
serialized: SerializedStyles,
|
|
1383
|
+
sheet: StyleSheet,
|
|
1384
|
+
shouldCache: boolean
|
|
1385
|
+
) => string | void */
|
|
1526
1386
|
|
|
1527
|
-
var omnipresentPlugins = [compat, removeLabel];
|
|
1528
1387
|
|
|
1529
|
-
|
|
1530
|
-
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
1531
|
-
get compat() {
|
|
1532
|
-
return cache.compat;
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
}), incorrectImportAlarm);
|
|
1536
|
-
}
|
|
1388
|
+
var omnipresentPlugins = [compat, removeLabel];
|
|
1537
1389
|
|
|
1538
|
-
if (isBrowser$
|
|
1390
|
+
if (isBrowser$3) {
|
|
1539
1391
|
var currentSheet;
|
|
1540
|
-
var finalizingPlugins = [stringify,
|
|
1541
|
-
if (!element.root) {
|
|
1542
|
-
if (element["return"]) {
|
|
1543
|
-
currentSheet.insert(element["return"]);
|
|
1544
|
-
} else if (element.value && element.type !== COMMENT) {
|
|
1545
|
-
// insert empty rule in non-production environments
|
|
1546
|
-
// so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
|
|
1547
|
-
currentSheet.insert(element.value + "{}");
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
} : rulesheet(function (rule) {
|
|
1392
|
+
var finalizingPlugins = [stringify, rulesheet(function (rule) {
|
|
1551
1393
|
currentSheet.insert(rule);
|
|
1552
1394
|
})];
|
|
1553
1395
|
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
@@ -1556,17 +1398,19 @@ var createCache = function createCache(options) {
|
|
|
1556
1398
|
return serialize(compile(styles), serializer);
|
|
1557
1399
|
};
|
|
1558
1400
|
|
|
1559
|
-
_insert = function
|
|
1401
|
+
_insert = function
|
|
1402
|
+
/*: void */
|
|
1403
|
+
insert(selector
|
|
1404
|
+
/*: string */
|
|
1405
|
+
, serialized
|
|
1406
|
+
/*: SerializedStyles */
|
|
1407
|
+
, sheet
|
|
1408
|
+
/*: StyleSheet */
|
|
1409
|
+
, shouldCache
|
|
1410
|
+
/*: boolean */
|
|
1411
|
+
) {
|
|
1560
1412
|
currentSheet = sheet;
|
|
1561
1413
|
|
|
1562
|
-
if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
|
|
1563
|
-
currentSheet = {
|
|
1564
|
-
insert: function insert(rule) {
|
|
1565
|
-
sheet.insert(rule + serialized.map);
|
|
1566
|
-
}
|
|
1567
|
-
};
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
1414
|
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
1571
1415
|
|
|
1572
1416
|
if (shouldCache) {
|
|
@@ -1580,12 +1424,17 @@ var createCache = function createCache(options) {
|
|
|
1580
1424
|
|
|
1581
1425
|
var _stylis = function _stylis(styles) {
|
|
1582
1426
|
return serialize(compile(styles), _serializer);
|
|
1583
|
-
};
|
|
1584
|
-
|
|
1427
|
+
};
|
|
1585
1428
|
|
|
1586
1429
|
var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
|
|
1587
1430
|
|
|
1588
|
-
var getRules = function
|
|
1431
|
+
var getRules = function
|
|
1432
|
+
/*: string */
|
|
1433
|
+
getRules(selector
|
|
1434
|
+
/*: string */
|
|
1435
|
+
, serialized
|
|
1436
|
+
/*: SerializedStyles */
|
|
1437
|
+
) {
|
|
1589
1438
|
var name = serialized.name;
|
|
1590
1439
|
|
|
1591
1440
|
if (serverStylisCache[name] === undefined) {
|
|
@@ -1595,7 +1444,17 @@ var createCache = function createCache(options) {
|
|
|
1595
1444
|
return serverStylisCache[name];
|
|
1596
1445
|
};
|
|
1597
1446
|
|
|
1598
|
-
_insert = function
|
|
1447
|
+
_insert = function
|
|
1448
|
+
/*: string | void */
|
|
1449
|
+
_insert(selector
|
|
1450
|
+
/*: string */
|
|
1451
|
+
, serialized
|
|
1452
|
+
/*: SerializedStyles */
|
|
1453
|
+
, sheet
|
|
1454
|
+
/*: StyleSheet */
|
|
1455
|
+
, shouldCache
|
|
1456
|
+
/*: boolean */
|
|
1457
|
+
) {
|
|
1599
1458
|
var name = serialized.name;
|
|
1600
1459
|
var rules = getRules(selector, serialized);
|
|
1601
1460
|
|
|
@@ -1607,12 +1466,6 @@ var createCache = function createCache(options) {
|
|
|
1607
1466
|
cache.inserted[name] = true;
|
|
1608
1467
|
}
|
|
1609
1468
|
|
|
1610
|
-
if ( // using === development instead of !== production
|
|
1611
|
-
// because if people do ssr in tests, the source maps showing up would be annoying
|
|
1612
|
-
process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
|
|
1613
|
-
return rules + serialized.map;
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
1469
|
return rules;
|
|
1617
1470
|
} else {
|
|
1618
1471
|
// in compat mode, we put the styles on the inserted cache so
|
|
@@ -1631,7 +1484,9 @@ var createCache = function createCache(options) {
|
|
|
1631
1484
|
};
|
|
1632
1485
|
}
|
|
1633
1486
|
|
|
1634
|
-
var cache
|
|
1487
|
+
var cache
|
|
1488
|
+
/*: EmotionCache */
|
|
1489
|
+
= {
|
|
1635
1490
|
key: key,
|
|
1636
1491
|
sheet: new StyleSheet({
|
|
1637
1492
|
key: key,
|
|
@@ -1650,213 +1505,7 @@ var createCache = function createCache(options) {
|
|
|
1650
1505
|
return cache;
|
|
1651
1506
|
};
|
|
1652
1507
|
|
|
1653
|
-
var reactIs
|
|
1654
|
-
|
|
1655
|
-
var reactIs_production_min = {};
|
|
1656
|
-
|
|
1657
|
-
/** @license React v16.13.1
|
|
1658
|
-
* react-is.production.min.js
|
|
1659
|
-
*
|
|
1660
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1661
|
-
*
|
|
1662
|
-
* This source code is licensed under the MIT license found in the
|
|
1663
|
-
* LICENSE file in the root directory of this source tree.
|
|
1664
|
-
*/
|
|
1665
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
1666
|
-
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w$1=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
1667
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
1668
|
-
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
1669
|
-
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
1670
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w$1||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
1671
|
-
|
|
1672
|
-
var reactIs_development = {};
|
|
1673
|
-
|
|
1674
|
-
/** @license React v16.13.1
|
|
1675
|
-
* react-is.development.js
|
|
1676
|
-
*
|
|
1677
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1678
|
-
*
|
|
1679
|
-
* This source code is licensed under the MIT license found in the
|
|
1680
|
-
* LICENSE file in the root directory of this source tree.
|
|
1681
|
-
*/
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1686
|
-
(function() {
|
|
1687
|
-
|
|
1688
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
1689
|
-
// nor polyfill, then a plain number is used for performance.
|
|
1690
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
1691
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
1692
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
1693
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
1694
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
1695
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
1696
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
1697
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
1698
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
1699
|
-
|
|
1700
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
1701
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
1702
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
1703
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
1704
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
1705
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
1706
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
1707
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
1708
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
1709
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
1710
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
1711
|
-
|
|
1712
|
-
function isValidElementType(type) {
|
|
1713
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1714
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
function typeOf(object) {
|
|
1718
|
-
if (typeof object === 'object' && object !== null) {
|
|
1719
|
-
var $$typeof = object.$$typeof;
|
|
1720
|
-
|
|
1721
|
-
switch ($$typeof) {
|
|
1722
|
-
case REACT_ELEMENT_TYPE:
|
|
1723
|
-
var type = object.type;
|
|
1724
|
-
|
|
1725
|
-
switch (type) {
|
|
1726
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
1727
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
1728
|
-
case REACT_FRAGMENT_TYPE:
|
|
1729
|
-
case REACT_PROFILER_TYPE:
|
|
1730
|
-
case REACT_STRICT_MODE_TYPE:
|
|
1731
|
-
case REACT_SUSPENSE_TYPE:
|
|
1732
|
-
return type;
|
|
1733
|
-
|
|
1734
|
-
default:
|
|
1735
|
-
var $$typeofType = type && type.$$typeof;
|
|
1736
|
-
|
|
1737
|
-
switch ($$typeofType) {
|
|
1738
|
-
case REACT_CONTEXT_TYPE:
|
|
1739
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1740
|
-
case REACT_LAZY_TYPE:
|
|
1741
|
-
case REACT_MEMO_TYPE:
|
|
1742
|
-
case REACT_PROVIDER_TYPE:
|
|
1743
|
-
return $$typeofType;
|
|
1744
|
-
|
|
1745
|
-
default:
|
|
1746
|
-
return $$typeof;
|
|
1747
|
-
}
|
|
1748
|
-
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
case REACT_PORTAL_TYPE:
|
|
1752
|
-
return $$typeof;
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
return undefined;
|
|
1757
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
1758
|
-
|
|
1759
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
1760
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
1761
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
1762
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1763
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
1764
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
1765
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
1766
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
1767
|
-
var Memo = REACT_MEMO_TYPE;
|
|
1768
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
1769
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
1770
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1771
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
1772
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
1773
|
-
|
|
1774
|
-
function isAsyncMode(object) {
|
|
1775
|
-
{
|
|
1776
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
1777
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1778
|
-
|
|
1779
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
|
|
1783
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
1784
|
-
}
|
|
1785
|
-
function isConcurrentMode(object) {
|
|
1786
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
1787
|
-
}
|
|
1788
|
-
function isContextConsumer(object) {
|
|
1789
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
1790
|
-
}
|
|
1791
|
-
function isContextProvider(object) {
|
|
1792
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
1793
|
-
}
|
|
1794
|
-
function isElement(object) {
|
|
1795
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1796
|
-
}
|
|
1797
|
-
function isForwardRef(object) {
|
|
1798
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
1799
|
-
}
|
|
1800
|
-
function isFragment(object) {
|
|
1801
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
1802
|
-
}
|
|
1803
|
-
function isLazy(object) {
|
|
1804
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
1805
|
-
}
|
|
1806
|
-
function isMemo(object) {
|
|
1807
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
1808
|
-
}
|
|
1809
|
-
function isPortal(object) {
|
|
1810
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
1811
|
-
}
|
|
1812
|
-
function isProfiler(object) {
|
|
1813
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
1814
|
-
}
|
|
1815
|
-
function isStrictMode(object) {
|
|
1816
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
1817
|
-
}
|
|
1818
|
-
function isSuspense(object) {
|
|
1819
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
1823
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
1824
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
1825
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
1826
|
-
reactIs_development.Element = Element;
|
|
1827
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
1828
|
-
reactIs_development.Fragment = Fragment;
|
|
1829
|
-
reactIs_development.Lazy = Lazy;
|
|
1830
|
-
reactIs_development.Memo = Memo;
|
|
1831
|
-
reactIs_development.Portal = Portal;
|
|
1832
|
-
reactIs_development.Profiler = Profiler;
|
|
1833
|
-
reactIs_development.StrictMode = StrictMode;
|
|
1834
|
-
reactIs_development.Suspense = Suspense;
|
|
1835
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
1836
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
1837
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
1838
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
1839
|
-
reactIs_development.isElement = isElement;
|
|
1840
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
1841
|
-
reactIs_development.isFragment = isFragment;
|
|
1842
|
-
reactIs_development.isLazy = isLazy;
|
|
1843
|
-
reactIs_development.isMemo = isMemo;
|
|
1844
|
-
reactIs_development.isPortal = isPortal;
|
|
1845
|
-
reactIs_development.isProfiler = isProfiler;
|
|
1846
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
1847
|
-
reactIs_development.isSuspense = isSuspense;
|
|
1848
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
1849
|
-
reactIs_development.typeOf = typeOf;
|
|
1850
|
-
})();
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1854
|
-
reactIs$1.exports = reactIs_production_min;
|
|
1855
|
-
} else {
|
|
1856
|
-
reactIs$1.exports = reactIs_development;
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
var reactIs = reactIs$1.exports;
|
|
1508
|
+
var reactIs = defaultTheme$1.reactIs.exports;
|
|
1860
1509
|
var FORWARD_REF_STATICS = {
|
|
1861
1510
|
'$$typeof': true,
|
|
1862
1511
|
render: true,
|
|
@@ -1876,13 +1525,14 @@ var TYPE_STATICS = {};
|
|
|
1876
1525
|
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
1877
1526
|
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
1878
1527
|
|
|
1879
|
-
var isBrowser$
|
|
1528
|
+
var isBrowser$2 = typeof document !== 'undefined';
|
|
1529
|
+
|
|
1880
1530
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
1881
1531
|
var rawClassName = '';
|
|
1882
1532
|
classNames.split(' ').forEach(function (className) {
|
|
1883
1533
|
if (registered[className] !== undefined) {
|
|
1884
1534
|
registeredStyles.push(registered[className] + ";");
|
|
1885
|
-
} else {
|
|
1535
|
+
} else if (className) {
|
|
1886
1536
|
rawClassName += className + " ";
|
|
1887
1537
|
}
|
|
1888
1538
|
});
|
|
@@ -1900,7 +1550,7 @@ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
|
1900
1550
|
// in node since emotion-server relies on whether a style is in
|
|
1901
1551
|
// the registered cache to know whether a style is global or not
|
|
1902
1552
|
// also, note that this check will be dead code eliminated in the browser
|
|
1903
|
-
isBrowser$
|
|
1553
|
+
isBrowser$2 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
|
|
1904
1554
|
cache.registered[className] = serialized.styles;
|
|
1905
1555
|
}
|
|
1906
1556
|
};
|
|
@@ -1915,14 +1565,14 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
|
1915
1565
|
do {
|
|
1916
1566
|
var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
1917
1567
|
|
|
1918
|
-
if (!isBrowser$
|
|
1568
|
+
if (!isBrowser$2 && maybeStyles !== undefined) {
|
|
1919
1569
|
stylesForSSR += maybeStyles;
|
|
1920
1570
|
}
|
|
1921
1571
|
|
|
1922
1572
|
current = current.next;
|
|
1923
1573
|
} while (current !== undefined);
|
|
1924
1574
|
|
|
1925
|
-
if (!isBrowser$
|
|
1575
|
+
if (!isBrowser$2 && stylesForSSR.length !== 0) {
|
|
1926
1576
|
return stylesForSSR;
|
|
1927
1577
|
}
|
|
1928
1578
|
}
|
|
@@ -2016,6 +1666,7 @@ var unitlessKeys = {
|
|
|
2016
1666
|
opacity: 1,
|
|
2017
1667
|
order: 1,
|
|
2018
1668
|
orphans: 1,
|
|
1669
|
+
scale: 1,
|
|
2019
1670
|
tabSize: 1,
|
|
2020
1671
|
widows: 1,
|
|
2021
1672
|
zIndex: 1,
|
|
@@ -2032,16 +1683,8 @@ var unitlessKeys = {
|
|
|
2032
1683
|
strokeWidth: 1
|
|
2033
1684
|
};
|
|
2034
1685
|
|
|
2035
|
-
|
|
2036
|
-
var cache = Object.create(null);
|
|
2037
|
-
return function (arg) {
|
|
2038
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
2039
|
-
return cache[arg];
|
|
2040
|
-
};
|
|
2041
|
-
}
|
|
1686
|
+
var isDevelopment$1 = false;
|
|
2042
1687
|
|
|
2043
|
-
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
|
|
2044
|
-
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
|
2045
1688
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
2046
1689
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
2047
1690
|
|
|
@@ -2082,34 +1725,6 @@ var processStyleValue = function processStyleValue(key, value) {
|
|
|
2082
1725
|
return value;
|
|
2083
1726
|
};
|
|
2084
1727
|
|
|
2085
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2086
|
-
var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
2087
|
-
var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
|
|
2088
|
-
var oldProcessStyleValue = processStyleValue;
|
|
2089
|
-
var msPattern = /^-ms-/;
|
|
2090
|
-
var hyphenPattern = /-(.)/g;
|
|
2091
|
-
var hyphenatedCache = {};
|
|
2092
|
-
|
|
2093
|
-
processStyleValue = function processStyleValue(key, value) {
|
|
2094
|
-
if (key === 'content') {
|
|
2095
|
-
if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
2096
|
-
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
2097
|
-
}
|
|
2098
|
-
}
|
|
2099
|
-
|
|
2100
|
-
var processed = oldProcessStyleValue(key, value);
|
|
2101
|
-
|
|
2102
|
-
if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
|
|
2103
|
-
hyphenatedCache[key] = true;
|
|
2104
|
-
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
|
|
2105
|
-
return _char.toUpperCase();
|
|
2106
|
-
}) + "?");
|
|
2107
|
-
}
|
|
2108
|
-
|
|
2109
|
-
return processed;
|
|
2110
|
-
};
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
1728
|
var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
|
|
2114
1729
|
|
|
2115
1730
|
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
@@ -2117,12 +1732,11 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2117
1732
|
return '';
|
|
2118
1733
|
}
|
|
2119
1734
|
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
}
|
|
1735
|
+
var componentSelector = interpolation;
|
|
1736
|
+
|
|
1737
|
+
if (componentSelector.__emotion_styles !== undefined) {
|
|
2124
1738
|
|
|
2125
|
-
return
|
|
1739
|
+
return componentSelector;
|
|
2126
1740
|
}
|
|
2127
1741
|
|
|
2128
1742
|
switch (typeof interpolation) {
|
|
@@ -2133,17 +1747,21 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2133
1747
|
|
|
2134
1748
|
case 'object':
|
|
2135
1749
|
{
|
|
2136
|
-
|
|
1750
|
+
var keyframes = interpolation;
|
|
1751
|
+
|
|
1752
|
+
if (keyframes.anim === 1) {
|
|
2137
1753
|
cursor = {
|
|
2138
|
-
name:
|
|
2139
|
-
styles:
|
|
1754
|
+
name: keyframes.name,
|
|
1755
|
+
styles: keyframes.styles,
|
|
2140
1756
|
next: cursor
|
|
2141
1757
|
};
|
|
2142
|
-
return
|
|
1758
|
+
return keyframes.name;
|
|
2143
1759
|
}
|
|
2144
1760
|
|
|
2145
|
-
|
|
2146
|
-
|
|
1761
|
+
var serializedStyles = interpolation;
|
|
1762
|
+
|
|
1763
|
+
if (serializedStyles.styles !== undefined) {
|
|
1764
|
+
var next = serializedStyles.next;
|
|
2147
1765
|
|
|
2148
1766
|
if (next !== undefined) {
|
|
2149
1767
|
// not the most efficient thing ever but this is a pretty rare case
|
|
@@ -2158,11 +1776,7 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2158
1776
|
}
|
|
2159
1777
|
}
|
|
2160
1778
|
|
|
2161
|
-
var styles =
|
|
2162
|
-
|
|
2163
|
-
if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
|
|
2164
|
-
styles += interpolation.map;
|
|
2165
|
-
}
|
|
1779
|
+
var styles = serializedStyles.styles + ";";
|
|
2166
1780
|
|
|
2167
1781
|
return styles;
|
|
2168
1782
|
}
|
|
@@ -2177,37 +1791,21 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2177
1791
|
var result = interpolation(mergedProps);
|
|
2178
1792
|
cursor = previousCursor;
|
|
2179
1793
|
return handleInterpolation(mergedProps, registered, result);
|
|
2180
|
-
} else if (process.env.NODE_ENV !== 'production') {
|
|
2181
|
-
console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
|
|
2182
1794
|
}
|
|
2183
1795
|
|
|
2184
1796
|
break;
|
|
2185
1797
|
}
|
|
2186
|
-
|
|
2187
|
-
case 'string':
|
|
2188
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2189
|
-
var matched = [];
|
|
2190
|
-
var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
|
|
2191
|
-
var fakeVarName = "animation" + matched.length;
|
|
2192
|
-
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
|
|
2193
|
-
return "${" + fakeVarName + "}";
|
|
2194
|
-
});
|
|
2195
|
-
|
|
2196
|
-
if (matched.length) {
|
|
2197
|
-
console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
|
|
2201
|
-
break;
|
|
2202
1798
|
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
2203
1799
|
|
|
2204
1800
|
|
|
1801
|
+
var asString = interpolation;
|
|
1802
|
+
|
|
2205
1803
|
if (registered == null) {
|
|
2206
|
-
return
|
|
1804
|
+
return asString;
|
|
2207
1805
|
}
|
|
2208
1806
|
|
|
2209
|
-
var cached = registered[
|
|
2210
|
-
return cached !== undefined ? cached :
|
|
1807
|
+
var cached = registered[asString];
|
|
1808
|
+
return cached !== undefined ? cached : asString;
|
|
2211
1809
|
}
|
|
2212
1810
|
|
|
2213
1811
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
@@ -2218,44 +1816,43 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
2218
1816
|
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
2219
1817
|
}
|
|
2220
1818
|
} else {
|
|
2221
|
-
for (var
|
|
2222
|
-
var value = obj[
|
|
1819
|
+
for (var key in obj) {
|
|
1820
|
+
var value = obj[key];
|
|
2223
1821
|
|
|
2224
1822
|
if (typeof value !== 'object') {
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
string +=
|
|
1823
|
+
var asString = value;
|
|
1824
|
+
|
|
1825
|
+
if (registered != null && registered[asString] !== undefined) {
|
|
1826
|
+
string += key + "{" + registered[asString] + "}";
|
|
1827
|
+
} else if (isProcessableValue(asString)) {
|
|
1828
|
+
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
2229
1829
|
}
|
|
2230
1830
|
} else {
|
|
2231
|
-
if (
|
|
1831
|
+
if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment$1) {
|
|
2232
1832
|
throw new Error(noComponentSelectorMessage);
|
|
2233
1833
|
}
|
|
2234
1834
|
|
|
2235
1835
|
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
2236
1836
|
for (var _i = 0; _i < value.length; _i++) {
|
|
2237
1837
|
if (isProcessableValue(value[_i])) {
|
|
2238
|
-
string += processStyleName(
|
|
1838
|
+
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
2239
1839
|
}
|
|
2240
1840
|
}
|
|
2241
1841
|
} else {
|
|
2242
1842
|
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
2243
1843
|
|
|
2244
|
-
switch (
|
|
1844
|
+
switch (key) {
|
|
2245
1845
|
case 'animation':
|
|
2246
1846
|
case 'animationName':
|
|
2247
1847
|
{
|
|
2248
|
-
string += processStyleName(
|
|
1848
|
+
string += processStyleName(key) + ":" + interpolated + ";";
|
|
2249
1849
|
break;
|
|
2250
1850
|
}
|
|
2251
1851
|
|
|
2252
1852
|
default:
|
|
2253
1853
|
{
|
|
2254
|
-
if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
|
|
2255
|
-
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
2256
|
-
}
|
|
2257
1854
|
|
|
2258
|
-
string +=
|
|
1855
|
+
string += key + "{" + interpolated + "}";
|
|
2259
1856
|
}
|
|
2260
1857
|
}
|
|
2261
1858
|
}
|
|
@@ -2266,17 +1863,12 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
2266
1863
|
return string;
|
|
2267
1864
|
}
|
|
2268
1865
|
|
|
2269
|
-
var labelPattern = /label:\s*([^\s
|
|
2270
|
-
var sourceMapPattern;
|
|
2271
|
-
|
|
2272
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2273
|
-
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
2274
|
-
} // this is the cursor for keyframes
|
|
1866
|
+
var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g;
|
|
2275
1867
|
// keyframes are stored on the SerializedStyles object as a linked list
|
|
2276
1868
|
|
|
2277
1869
|
|
|
2278
1870
|
var cursor;
|
|
2279
|
-
|
|
1871
|
+
function serializeStyles(args, registered, mergedProps) {
|
|
2280
1872
|
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
|
2281
1873
|
return args[0];
|
|
2282
1874
|
}
|
|
@@ -2290,11 +1882,9 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
2290
1882
|
stringMode = false;
|
|
2291
1883
|
styles += handleInterpolation(mergedProps, registered, strings);
|
|
2292
1884
|
} else {
|
|
2293
|
-
|
|
2294
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
2295
|
-
}
|
|
1885
|
+
var asTemplateStringsArr = strings;
|
|
2296
1886
|
|
|
2297
|
-
styles +=
|
|
1887
|
+
styles += asTemplateStringsArr[0];
|
|
2298
1888
|
} // we start at 1 since we've already handled the first arg
|
|
2299
1889
|
|
|
2300
1890
|
|
|
@@ -2302,69 +1892,47 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
2302
1892
|
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
2303
1893
|
|
|
2304
1894
|
if (stringMode) {
|
|
2305
|
-
|
|
2306
|
-
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
2307
|
-
}
|
|
1895
|
+
var templateStringsArr = strings;
|
|
2308
1896
|
|
|
2309
|
-
styles +=
|
|
1897
|
+
styles += templateStringsArr[i];
|
|
2310
1898
|
}
|
|
2311
1899
|
}
|
|
2312
1900
|
|
|
2313
|
-
var sourceMap;
|
|
2314
|
-
|
|
2315
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2316
|
-
styles = styles.replace(sourceMapPattern, function (match) {
|
|
2317
|
-
sourceMap = match;
|
|
2318
|
-
return '';
|
|
2319
|
-
});
|
|
2320
|
-
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
2321
|
-
|
|
2322
1901
|
|
|
2323
1902
|
labelPattern.lastIndex = 0;
|
|
2324
1903
|
var identifierName = '';
|
|
2325
1904
|
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
|
2326
1905
|
|
|
2327
1906
|
while ((match = labelPattern.exec(styles)) !== null) {
|
|
2328
|
-
identifierName += '-' +
|
|
2329
|
-
match[1];
|
|
1907
|
+
identifierName += '-' + match[1];
|
|
2330
1908
|
}
|
|
2331
1909
|
|
|
2332
1910
|
var name = murmur2(styles) + identifierName;
|
|
2333
1911
|
|
|
2334
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2335
|
-
// $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
|
|
2336
|
-
return {
|
|
2337
|
-
name: name,
|
|
2338
|
-
styles: styles,
|
|
2339
|
-
map: sourceMap,
|
|
2340
|
-
next: cursor,
|
|
2341
|
-
toString: function toString() {
|
|
2342
|
-
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
2343
|
-
}
|
|
2344
|
-
};
|
|
2345
|
-
}
|
|
2346
|
-
|
|
2347
1912
|
return {
|
|
2348
1913
|
name: name,
|
|
2349
1914
|
styles: styles,
|
|
2350
1915
|
next: cursor
|
|
2351
1916
|
};
|
|
2352
|
-
}
|
|
1917
|
+
}
|
|
2353
1918
|
|
|
2354
|
-
var isBrowser$
|
|
1919
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
2355
1920
|
|
|
2356
1921
|
var syncFallback = function syncFallback(create) {
|
|
2357
1922
|
return create();
|
|
2358
1923
|
};
|
|
2359
1924
|
|
|
2360
1925
|
var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false;
|
|
2361
|
-
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$
|
|
2362
|
-
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React__namespace.useLayoutEffect;
|
|
1926
|
+
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$1 ? syncFallback : useInsertionEffect || syncFallback;
|
|
2363
1927
|
|
|
2364
|
-
var
|
|
2365
|
-
|
|
1928
|
+
var isDevelopment = false;
|
|
1929
|
+
|
|
1930
|
+
var isBrowser = typeof document !== 'undefined';
|
|
2366
1931
|
|
|
2367
|
-
|
|
1932
|
+
/* import { type EmotionCache } from '@emotion/utils' */
|
|
1933
|
+
var EmotionCacheContext
|
|
1934
|
+
/*: React.Context<EmotionCache | null> */
|
|
1935
|
+
= /* #__PURE__ */React__namespace.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2368
1936
|
// because this module is primarily intended for the browser and node
|
|
2369
1937
|
// but it's also required in react native and similar environments sometimes
|
|
2370
1938
|
// and we could have a special build just for that
|
|
@@ -2374,24 +1942,37 @@ typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
|
2374
1942
|
key: 'css'
|
|
2375
1943
|
}) : null);
|
|
2376
1944
|
|
|
2377
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2378
|
-
EmotionCacheContext.displayName = 'EmotionCacheContext';
|
|
2379
|
-
}
|
|
2380
|
-
|
|
2381
1945
|
EmotionCacheContext.Provider;
|
|
2382
1946
|
|
|
2383
|
-
var withEmotionCache = function withEmotionCache
|
|
2384
|
-
|
|
2385
|
-
|
|
1947
|
+
var withEmotionCache = function withEmotionCache
|
|
1948
|
+
/* <Props, Ref: React.Ref<*>> */
|
|
1949
|
+
(func
|
|
1950
|
+
/*: (props: Props, cache: EmotionCache, ref: Ref) => React.Node */
|
|
1951
|
+
)
|
|
1952
|
+
/*: React.AbstractComponent<Props> */
|
|
1953
|
+
{
|
|
1954
|
+
return /*#__PURE__*/React.forwardRef(function (props
|
|
1955
|
+
/*: Props */
|
|
1956
|
+
, ref
|
|
1957
|
+
/*: Ref */
|
|
1958
|
+
) {
|
|
2386
1959
|
// the cache will never be null in the browser
|
|
2387
1960
|
var cache = React.useContext(EmotionCacheContext);
|
|
2388
1961
|
return func(props, cache, ref);
|
|
2389
1962
|
});
|
|
2390
1963
|
};
|
|
2391
1964
|
|
|
2392
|
-
if (!isBrowser
|
|
2393
|
-
withEmotionCache = function withEmotionCache
|
|
2394
|
-
|
|
1965
|
+
if (!isBrowser) {
|
|
1966
|
+
withEmotionCache = function withEmotionCache
|
|
1967
|
+
/* <Props> */
|
|
1968
|
+
(func
|
|
1969
|
+
/*: (props: Props, cache: EmotionCache) => React.Node */
|
|
1970
|
+
)
|
|
1971
|
+
/*: React.StatelessFunctionalComponent<Props> */
|
|
1972
|
+
{
|
|
1973
|
+
return function (props
|
|
1974
|
+
/*: Props */
|
|
1975
|
+
) {
|
|
2395
1976
|
var cache = React.useContext(EmotionCacheContext);
|
|
2396
1977
|
|
|
2397
1978
|
if (cache === null) {
|
|
@@ -2415,81 +1996,31 @@ if (!isBrowser$1) {
|
|
|
2415
1996
|
|
|
2416
1997
|
var ThemeContext = /* #__PURE__ */React__namespace.createContext({});
|
|
2417
1998
|
|
|
2418
|
-
|
|
2419
|
-
ThemeContext.displayName = 'EmotionThemeContext';
|
|
2420
|
-
}
|
|
2421
|
-
|
|
2422
|
-
var getLastPart = function getLastPart(functionName) {
|
|
2423
|
-
// The match may be something like 'Object.createEmotionProps' or
|
|
2424
|
-
// 'Loader.prototype.render'
|
|
2425
|
-
var parts = functionName.split('.');
|
|
2426
|
-
return parts[parts.length - 1];
|
|
2427
|
-
};
|
|
2428
|
-
|
|
2429
|
-
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
|
|
2430
|
-
// V8
|
|
2431
|
-
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
|
|
2432
|
-
if (match) return getLastPart(match[1]); // Safari / Firefox
|
|
2433
|
-
|
|
2434
|
-
match = /^([A-Za-z0-9$.]+)@/.exec(line);
|
|
2435
|
-
if (match) return getLastPart(match[1]);
|
|
2436
|
-
return undefined;
|
|
2437
|
-
};
|
|
2438
|
-
|
|
2439
|
-
var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
|
|
2440
|
-
// identifiers, thus we only need to replace what is a valid character for JS,
|
|
2441
|
-
// but not for CSS.
|
|
2442
|
-
|
|
2443
|
-
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
|
|
2444
|
-
return identifier.replace(/\$/g, '-');
|
|
2445
|
-
};
|
|
2446
|
-
|
|
2447
|
-
var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
|
|
2448
|
-
if (!stackTrace) return undefined;
|
|
2449
|
-
var lines = stackTrace.split('\n');
|
|
2450
|
-
|
|
2451
|
-
for (var i = 0; i < lines.length; i++) {
|
|
2452
|
-
var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
|
|
2453
|
-
|
|
2454
|
-
if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
|
|
2455
|
-
|
|
2456
|
-
if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
|
|
2457
|
-
// uppercase letter
|
|
2458
|
-
|
|
2459
|
-
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
|
|
2460
|
-
}
|
|
2461
|
-
|
|
2462
|
-
return undefined;
|
|
2463
|
-
};
|
|
1999
|
+
var hasOwn = {}.hasOwnProperty;
|
|
2464
2000
|
|
|
2465
2001
|
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
2466
|
-
var
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
}
|
|
2002
|
+
var createEmotionProps = function createEmotionProps(type
|
|
2003
|
+
/*: React.ElementType */
|
|
2004
|
+
, props
|
|
2005
|
+
/*: Object */
|
|
2006
|
+
) {
|
|
2472
2007
|
|
|
2473
|
-
var newProps
|
|
2008
|
+
var newProps
|
|
2009
|
+
/*: any */
|
|
2010
|
+
= {};
|
|
2474
2011
|
|
|
2475
2012
|
for (var key in props) {
|
|
2476
|
-
if (
|
|
2013
|
+
if (hasOwn.call(props, key)) {
|
|
2477
2014
|
newProps[key] = props[key];
|
|
2478
2015
|
}
|
|
2479
2016
|
}
|
|
2480
2017
|
|
|
2481
|
-
newProps[typePropName] = type; //
|
|
2482
|
-
// the label hasn't already been computed
|
|
2483
|
-
|
|
2484
|
-
if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {
|
|
2485
|
-
var label = getLabelFromStackTrace(new Error().stack);
|
|
2486
|
-
if (label) newProps[labelPropName] = label;
|
|
2487
|
-
}
|
|
2018
|
+
newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:
|
|
2488
2019
|
|
|
2489
2020
|
return newProps;
|
|
2490
2021
|
};
|
|
2491
2022
|
|
|
2492
|
-
var Insertion
|
|
2023
|
+
var Insertion = function Insertion(_ref) {
|
|
2493
2024
|
var cache = _ref.cache,
|
|
2494
2025
|
serialized = _ref.serialized,
|
|
2495
2026
|
isStringTag = _ref.isStringTag;
|
|
@@ -2498,7 +2029,7 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
2498
2029
|
return insertStyles(cache, serialized, isStringTag);
|
|
2499
2030
|
});
|
|
2500
2031
|
|
|
2501
|
-
if (!isBrowser
|
|
2032
|
+
if (!isBrowser && rules !== undefined) {
|
|
2502
2033
|
var _ref2;
|
|
2503
2034
|
|
|
2504
2035
|
var serializedNames = serialized.name;
|
|
@@ -2517,7 +2048,9 @@ var Insertion$1 = function Insertion(_ref) {
|
|
|
2517
2048
|
return null;
|
|
2518
2049
|
};
|
|
2519
2050
|
|
|
2520
|
-
var Emotion = /* #__PURE__ */withEmotionCache(
|
|
2051
|
+
var Emotion = /* #__PURE__ */withEmotionCache(
|
|
2052
|
+
/* <any, any> */
|
|
2053
|
+
function (props, cache, ref) {
|
|
2521
2054
|
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
|
|
2522
2055
|
// not passing the registered cache to serializeStyles because it would
|
|
2523
2056
|
// make certain babel optimisations not possible
|
|
@@ -2538,175 +2071,42 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
2538
2071
|
|
|
2539
2072
|
var serialized = serializeStyles(registeredStyles, undefined, React__namespace.useContext(ThemeContext));
|
|
2540
2073
|
|
|
2541
|
-
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
|
|
2542
|
-
var labelFromStack = props[labelPropName];
|
|
2543
|
-
|
|
2544
|
-
if (labelFromStack) {
|
|
2545
|
-
serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
|
|
2549
2074
|
className += cache.key + "-" + serialized.name;
|
|
2550
2075
|
var newProps = {};
|
|
2551
2076
|
|
|
2552
2077
|
for (var key in props) {
|
|
2553
|
-
if (
|
|
2078
|
+
if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (!isDevelopment )) {
|
|
2554
2079
|
newProps[key] = props[key];
|
|
2555
2080
|
}
|
|
2556
2081
|
}
|
|
2557
2082
|
|
|
2558
|
-
newProps.ref = ref;
|
|
2559
2083
|
newProps.className = className;
|
|
2560
|
-
|
|
2084
|
+
|
|
2085
|
+
if (ref) {
|
|
2086
|
+
newProps.ref = ref;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
|
|
2561
2090
|
cache: cache,
|
|
2562
2091
|
serialized: serialized,
|
|
2563
2092
|
isStringTag: typeof WrappedComponent === 'string'
|
|
2564
2093
|
}), /*#__PURE__*/React__namespace.createElement(WrappedComponent, newProps));
|
|
2565
2094
|
});
|
|
2566
2095
|
|
|
2567
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2568
|
-
Emotion.displayName = 'EmotionCssPropInternal';
|
|
2569
|
-
}
|
|
2570
|
-
|
|
2571
2096
|
var Emotion$1 = Emotion;
|
|
2572
2097
|
|
|
2573
|
-
var
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
".": {
|
|
2583
|
-
module: {
|
|
2584
|
-
worker: "./dist/emotion-react.worker.esm.js",
|
|
2585
|
-
browser: "./dist/emotion-react.browser.esm.js",
|
|
2586
|
-
"default": "./dist/emotion-react.esm.js"
|
|
2587
|
-
},
|
|
2588
|
-
"import": "./dist/emotion-react.cjs.mjs",
|
|
2589
|
-
"default": "./dist/emotion-react.cjs.js"
|
|
2590
|
-
},
|
|
2591
|
-
"./jsx-runtime": {
|
|
2592
|
-
module: {
|
|
2593
|
-
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
|
|
2594
|
-
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
2595
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
2596
|
-
},
|
|
2597
|
-
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
|
|
2598
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
2599
|
-
},
|
|
2600
|
-
"./_isolated-hnrs": {
|
|
2601
|
-
module: {
|
|
2602
|
-
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
|
|
2603
|
-
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
2604
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
2605
|
-
},
|
|
2606
|
-
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
|
|
2607
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
2608
|
-
},
|
|
2609
|
-
"./jsx-dev-runtime": {
|
|
2610
|
-
module: {
|
|
2611
|
-
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
|
|
2612
|
-
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
2613
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
2614
|
-
},
|
|
2615
|
-
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
|
|
2616
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
2617
|
-
},
|
|
2618
|
-
"./package.json": "./package.json",
|
|
2619
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2620
|
-
"./macro": {
|
|
2621
|
-
types: {
|
|
2622
|
-
"import": "./macro.d.mts",
|
|
2623
|
-
"default": "./macro.d.ts"
|
|
2624
|
-
},
|
|
2625
|
-
"default": "./macro.js"
|
|
2626
|
-
}
|
|
2627
|
-
},
|
|
2628
|
-
types: "types/index.d.ts",
|
|
2629
|
-
files: [
|
|
2630
|
-
"src",
|
|
2631
|
-
"dist",
|
|
2632
|
-
"jsx-runtime",
|
|
2633
|
-
"jsx-dev-runtime",
|
|
2634
|
-
"_isolated-hnrs",
|
|
2635
|
-
"types/*.d.ts",
|
|
2636
|
-
"macro.*"
|
|
2637
|
-
],
|
|
2638
|
-
sideEffects: false,
|
|
2639
|
-
author: "Emotion Contributors",
|
|
2640
|
-
license: "MIT",
|
|
2641
|
-
scripts: {
|
|
2642
|
-
"test:typescript": "dtslint types"
|
|
2643
|
-
},
|
|
2644
|
-
dependencies: {
|
|
2645
|
-
"@babel/runtime": "^7.18.3",
|
|
2646
|
-
"@emotion/babel-plugin": "^11.11.0",
|
|
2647
|
-
"@emotion/cache": "^11.11.0",
|
|
2648
|
-
"@emotion/serialize": "^1.1.2",
|
|
2649
|
-
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
2650
|
-
"@emotion/utils": "^1.2.1",
|
|
2651
|
-
"@emotion/weak-memoize": "^0.3.1",
|
|
2652
|
-
"hoist-non-react-statics": "^3.3.1"
|
|
2653
|
-
},
|
|
2654
|
-
peerDependencies: {
|
|
2655
|
-
react: ">=16.8.0"
|
|
2656
|
-
},
|
|
2657
|
-
peerDependenciesMeta: {
|
|
2658
|
-
"@types/react": {
|
|
2659
|
-
optional: true
|
|
2660
|
-
}
|
|
2661
|
-
},
|
|
2662
|
-
devDependencies: {
|
|
2663
|
-
"@definitelytyped/dtslint": "0.0.112",
|
|
2664
|
-
"@emotion/css": "11.11.0",
|
|
2665
|
-
"@emotion/css-prettifier": "1.1.3",
|
|
2666
|
-
"@emotion/server": "11.11.0",
|
|
2667
|
-
"@emotion/styled": "11.11.0",
|
|
2668
|
-
"html-tag-names": "^1.1.2",
|
|
2669
|
-
react: "16.14.0",
|
|
2670
|
-
"svg-tag-names": "^1.1.1",
|
|
2671
|
-
typescript: "^4.5.5"
|
|
2672
|
-
},
|
|
2673
|
-
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
2674
|
-
publishConfig: {
|
|
2675
|
-
access: "public"
|
|
2676
|
-
},
|
|
2677
|
-
"umd:main": "dist/emotion-react.umd.min.js",
|
|
2678
|
-
preconstruct: {
|
|
2679
|
-
entrypoints: [
|
|
2680
|
-
"./index.js",
|
|
2681
|
-
"./jsx-runtime.js",
|
|
2682
|
-
"./jsx-dev-runtime.js",
|
|
2683
|
-
"./_isolated-hnrs.js"
|
|
2684
|
-
],
|
|
2685
|
-
umdName: "emotionReact",
|
|
2686
|
-
exports: {
|
|
2687
|
-
envConditions: [
|
|
2688
|
-
"browser",
|
|
2689
|
-
"worker"
|
|
2690
|
-
],
|
|
2691
|
-
extra: {
|
|
2692
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
2693
|
-
"./macro": {
|
|
2694
|
-
types: {
|
|
2695
|
-
"import": "./macro.d.mts",
|
|
2696
|
-
"default": "./macro.d.ts"
|
|
2697
|
-
},
|
|
2698
|
-
"default": "./macro.js"
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
};
|
|
2704
|
-
|
|
2705
|
-
var jsx = function jsx(type, props) {
|
|
2098
|
+
var jsx
|
|
2099
|
+
/*: typeof React.createElement */
|
|
2100
|
+
= function jsx
|
|
2101
|
+
/*: typeof React.createElement */
|
|
2102
|
+
(type
|
|
2103
|
+
/*: React.ElementType */
|
|
2104
|
+
, props
|
|
2105
|
+
/*: Object */
|
|
2106
|
+
) {
|
|
2706
2107
|
var args = arguments;
|
|
2707
2108
|
|
|
2708
|
-
if (props == null || !
|
|
2709
|
-
// $FlowFixMe
|
|
2109
|
+
if (props == null || !hasOwn.call(props, 'css')) {
|
|
2710
2110
|
return React__namespace.createElement.apply(undefined, args);
|
|
2711
2111
|
}
|
|
2712
2112
|
|
|
@@ -2717,413 +2117,1147 @@ var jsx = function jsx(type, props) {
|
|
|
2717
2117
|
|
|
2718
2118
|
for (var i = 2; i < argsLength; i++) {
|
|
2719
2119
|
createElementArgArray[i] = args[i];
|
|
2720
|
-
}
|
|
2721
|
-
|
|
2120
|
+
}
|
|
2722
2121
|
|
|
2723
2122
|
return React__namespace.createElement.apply(null, createElementArgArray);
|
|
2724
2123
|
};
|
|
2725
2124
|
|
|
2726
|
-
|
|
2727
|
-
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
|
|
2728
|
-
// initial client-side render from SSR, use place of hydrating tag
|
|
2729
|
-
|
|
2730
|
-
var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
2731
|
-
if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
|
|
2732
|
-
// probably using the custom createElement which
|
|
2733
|
-
// means it will be turned into a className prop
|
|
2734
|
-
// $FlowFixMe I don't really want to add it to the type since it shouldn't be used
|
|
2735
|
-
props.className || props.css)) {
|
|
2736
|
-
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
2737
|
-
warnedAboutCssPropForGlobal = true;
|
|
2738
|
-
}
|
|
2125
|
+
/* import type { Interpolation, SerializedStyles } from '@emotion/utils' */
|
|
2739
2126
|
|
|
2740
|
-
|
|
2741
|
-
|
|
2127
|
+
function css$2()
|
|
2128
|
+
/*: SerializedStyles */
|
|
2129
|
+
{
|
|
2130
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2131
|
+
args[_key] = arguments[_key];
|
|
2132
|
+
}
|
|
2742
2133
|
|
|
2743
|
-
|
|
2744
|
-
|
|
2134
|
+
return serializeStyles(args);
|
|
2135
|
+
}
|
|
2745
2136
|
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2137
|
+
/*
|
|
2138
|
+
type Keyframes = {|
|
|
2139
|
+
name: string,
|
|
2140
|
+
styles: string,
|
|
2141
|
+
anim: 1,
|
|
2142
|
+
toString: () => string
|
|
2143
|
+
|} & string
|
|
2144
|
+
*/
|
|
2749
2145
|
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2146
|
+
var keyframes = function
|
|
2147
|
+
/*: Keyframes */
|
|
2148
|
+
keyframes() {
|
|
2149
|
+
var insertable = css$2.apply(void 0, arguments);
|
|
2150
|
+
var name = "animation-" + insertable.name;
|
|
2151
|
+
return {
|
|
2152
|
+
name: name,
|
|
2153
|
+
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
2154
|
+
anim: 1,
|
|
2155
|
+
toString: function toString() {
|
|
2156
|
+
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
|
2754
2157
|
}
|
|
2158
|
+
};
|
|
2159
|
+
};
|
|
2755
2160
|
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
styles: serializedStyles
|
|
2760
|
-
}, cache.sheet, shouldCache);
|
|
2161
|
+
function _arrayWithHoles(r) {
|
|
2162
|
+
if (Array.isArray(r)) return r;
|
|
2163
|
+
}
|
|
2761
2164
|
|
|
2762
|
-
|
|
2763
|
-
|
|
2165
|
+
function _iterableToArrayLimit(r, l) {
|
|
2166
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
2167
|
+
if (null != t) {
|
|
2168
|
+
var e,
|
|
2169
|
+
n,
|
|
2170
|
+
i,
|
|
2171
|
+
u,
|
|
2172
|
+
a = [],
|
|
2173
|
+
f = !0,
|
|
2174
|
+
o = !1;
|
|
2175
|
+
try {
|
|
2176
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
2177
|
+
if (Object(t) !== t) return;
|
|
2178
|
+
f = !1;
|
|
2179
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
2180
|
+
} catch (r) {
|
|
2181
|
+
o = !0, n = r;
|
|
2182
|
+
} finally {
|
|
2183
|
+
try {
|
|
2184
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
2185
|
+
} finally {
|
|
2186
|
+
if (o) throw n;
|
|
2187
|
+
}
|
|
2764
2188
|
}
|
|
2189
|
+
return a;
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2765
2192
|
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
} // yes, i know these hooks are used conditionally
|
|
2770
|
-
// but it is based on a constant that will never change at runtime
|
|
2771
|
-
// it's effectively like having two implementations and switching them out
|
|
2772
|
-
// so it's not actually breaking anything
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
var sheetRef = React__namespace.useRef();
|
|
2776
|
-
useInsertionEffectWithLayoutFallback(function () {
|
|
2777
|
-
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
|
|
2778
|
-
|
|
2779
|
-
var sheet = new cache.sheet.constructor({
|
|
2780
|
-
key: key,
|
|
2781
|
-
nonce: cache.sheet.nonce,
|
|
2782
|
-
container: cache.sheet.container,
|
|
2783
|
-
speedy: cache.sheet.isSpeedy
|
|
2784
|
-
});
|
|
2785
|
-
var rehydrating = false; // $FlowFixMe
|
|
2786
|
-
|
|
2787
|
-
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
|
|
2788
|
-
|
|
2789
|
-
if (cache.sheet.tags.length) {
|
|
2790
|
-
sheet.before = cache.sheet.tags[0];
|
|
2791
|
-
}
|
|
2193
|
+
function _nonIterableRest() {
|
|
2194
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2195
|
+
}
|
|
2792
2196
|
|
|
2793
|
-
|
|
2794
|
-
|
|
2197
|
+
function _slicedToArray(r, e) {
|
|
2198
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
2199
|
+
}
|
|
2795
2200
|
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2201
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
2202
|
+
if (null == r) return {};
|
|
2203
|
+
var t = {};
|
|
2204
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
2205
|
+
if (e.includes(n)) continue;
|
|
2206
|
+
t[n] = r[n];
|
|
2207
|
+
}
|
|
2208
|
+
return t;
|
|
2209
|
+
}
|
|
2799
2210
|
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
var
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
sheetRefCurrent[1] = false;
|
|
2812
|
-
return;
|
|
2813
|
-
}
|
|
2211
|
+
function _objectWithoutProperties(e, t) {
|
|
2212
|
+
if (null == e) return {};
|
|
2213
|
+
var o,
|
|
2214
|
+
r,
|
|
2215
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
2216
|
+
if (Object.getOwnPropertySymbols) {
|
|
2217
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
2218
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
2219
|
+
}
|
|
2220
|
+
return i;
|
|
2221
|
+
}
|
|
2814
2222
|
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2223
|
+
function _taggedTemplateLiteral(e, t) {
|
|
2224
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
2225
|
+
raw: {
|
|
2226
|
+
value: Object.freeze(t)
|
|
2818
2227
|
}
|
|
2228
|
+
}));
|
|
2229
|
+
}
|
|
2819
2230
|
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
sheet.flush();
|
|
2825
|
-
}
|
|
2231
|
+
/**
|
|
2232
|
+
* Custom positioning reference element.
|
|
2233
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
2234
|
+
*/
|
|
2826
2235
|
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2236
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
2237
|
+
const alignments = ['start', 'end'];
|
|
2238
|
+
const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
2239
|
+
const min = Math.min;
|
|
2240
|
+
const max = Math.max;
|
|
2241
|
+
const round = Math.round;
|
|
2242
|
+
const floor = Math.floor;
|
|
2243
|
+
const createCoords = v => ({
|
|
2244
|
+
x: v,
|
|
2245
|
+
y: v
|
|
2830
2246
|
});
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2247
|
+
const oppositeSideMap = {
|
|
2248
|
+
left: 'right',
|
|
2249
|
+
right: 'left',
|
|
2250
|
+
bottom: 'top',
|
|
2251
|
+
top: 'bottom'
|
|
2252
|
+
};
|
|
2253
|
+
const oppositeAlignmentMap = {
|
|
2254
|
+
start: 'end',
|
|
2255
|
+
end: 'start'
|
|
2256
|
+
};
|
|
2257
|
+
function clamp(start, value, end) {
|
|
2258
|
+
return max(start, min(value, end));
|
|
2834
2259
|
}
|
|
2835
|
-
|
|
2836
|
-
function
|
|
2837
|
-
|
|
2838
|
-
|
|
2260
|
+
function evaluate(value, param) {
|
|
2261
|
+
return typeof value === 'function' ? value(param) : value;
|
|
2262
|
+
}
|
|
2263
|
+
function getSide(placement) {
|
|
2264
|
+
return placement.split('-')[0];
|
|
2265
|
+
}
|
|
2266
|
+
function getAlignment(placement) {
|
|
2267
|
+
return placement.split('-')[1];
|
|
2268
|
+
}
|
|
2269
|
+
function getOppositeAxis(axis) {
|
|
2270
|
+
return axis === 'x' ? 'y' : 'x';
|
|
2271
|
+
}
|
|
2272
|
+
function getAxisLength(axis) {
|
|
2273
|
+
return axis === 'y' ? 'height' : 'width';
|
|
2274
|
+
}
|
|
2275
|
+
function getSideAxis(placement) {
|
|
2276
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
2277
|
+
}
|
|
2278
|
+
function getAlignmentAxis(placement) {
|
|
2279
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
2280
|
+
}
|
|
2281
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
2282
|
+
if (rtl === void 0) {
|
|
2283
|
+
rtl = false;
|
|
2284
|
+
}
|
|
2285
|
+
const alignment = getAlignment(placement);
|
|
2286
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
2287
|
+
const length = getAxisLength(alignmentAxis);
|
|
2288
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
2289
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
2290
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
2839
2291
|
}
|
|
2292
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
2293
|
+
}
|
|
2294
|
+
function getExpandedPlacements(placement) {
|
|
2295
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
2296
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
2297
|
+
}
|
|
2298
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
2299
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
2300
|
+
}
|
|
2301
|
+
function getSideList(side, isStart, rtl) {
|
|
2302
|
+
const lr = ['left', 'right'];
|
|
2303
|
+
const rl = ['right', 'left'];
|
|
2304
|
+
const tb = ['top', 'bottom'];
|
|
2305
|
+
const bt = ['bottom', 'top'];
|
|
2306
|
+
switch (side) {
|
|
2307
|
+
case 'top':
|
|
2308
|
+
case 'bottom':
|
|
2309
|
+
if (rtl) return isStart ? rl : lr;
|
|
2310
|
+
return isStart ? lr : rl;
|
|
2311
|
+
case 'left':
|
|
2312
|
+
case 'right':
|
|
2313
|
+
return isStart ? tb : bt;
|
|
2314
|
+
default:
|
|
2315
|
+
return [];
|
|
2316
|
+
}
|
|
2317
|
+
}
|
|
2318
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
2319
|
+
const alignment = getAlignment(placement);
|
|
2320
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
2321
|
+
if (alignment) {
|
|
2322
|
+
list = list.map(side => side + "-" + alignment);
|
|
2323
|
+
if (flipAlignment) {
|
|
2324
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
return list;
|
|
2328
|
+
}
|
|
2329
|
+
function getOppositePlacement(placement) {
|
|
2330
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
2331
|
+
}
|
|
2332
|
+
function expandPaddingObject(padding) {
|
|
2333
|
+
return {
|
|
2334
|
+
top: 0,
|
|
2335
|
+
right: 0,
|
|
2336
|
+
bottom: 0,
|
|
2337
|
+
left: 0,
|
|
2338
|
+
...padding
|
|
2339
|
+
};
|
|
2340
|
+
}
|
|
2341
|
+
function getPaddingObject(padding) {
|
|
2342
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
2343
|
+
top: padding,
|
|
2344
|
+
right: padding,
|
|
2345
|
+
bottom: padding,
|
|
2346
|
+
left: padding
|
|
2347
|
+
};
|
|
2348
|
+
}
|
|
2349
|
+
function rectToClientRect(rect) {
|
|
2350
|
+
const {
|
|
2351
|
+
x,
|
|
2352
|
+
y,
|
|
2353
|
+
width,
|
|
2354
|
+
height
|
|
2355
|
+
} = rect;
|
|
2356
|
+
return {
|
|
2357
|
+
width,
|
|
2358
|
+
height,
|
|
2359
|
+
top: y,
|
|
2360
|
+
left: x,
|
|
2361
|
+
right: x + width,
|
|
2362
|
+
bottom: y + height,
|
|
2363
|
+
x,
|
|
2364
|
+
y
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2840
2367
|
|
|
2841
|
-
|
|
2368
|
+
/**
|
|
2369
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
2370
|
+
* element is overflowing a given clipping boundary on each side.
|
|
2371
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
2372
|
+
* - negative = how many pixels left before it will overflow
|
|
2373
|
+
* - 0 = lies flush with the boundary
|
|
2374
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
2375
|
+
*/
|
|
2376
|
+
async function detectOverflow(state, options) {
|
|
2377
|
+
var _await$platform$isEle;
|
|
2378
|
+
if (options === void 0) {
|
|
2379
|
+
options = {};
|
|
2380
|
+
}
|
|
2381
|
+
const {
|
|
2382
|
+
x,
|
|
2383
|
+
y,
|
|
2384
|
+
platform,
|
|
2385
|
+
rects,
|
|
2386
|
+
elements,
|
|
2387
|
+
strategy
|
|
2388
|
+
} = state;
|
|
2389
|
+
const {
|
|
2390
|
+
boundary = 'clippingAncestors',
|
|
2391
|
+
rootBoundary = 'viewport',
|
|
2392
|
+
elementContext = 'floating',
|
|
2393
|
+
altBoundary = false,
|
|
2394
|
+
padding = 0
|
|
2395
|
+
} = evaluate(options, state);
|
|
2396
|
+
const paddingObject = getPaddingObject(padding);
|
|
2397
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
2398
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
2399
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
2400
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
2401
|
+
boundary,
|
|
2402
|
+
rootBoundary,
|
|
2403
|
+
strategy
|
|
2404
|
+
}));
|
|
2405
|
+
const rect = elementContext === 'floating' ? {
|
|
2406
|
+
x,
|
|
2407
|
+
y,
|
|
2408
|
+
width: rects.floating.width,
|
|
2409
|
+
height: rects.floating.height
|
|
2410
|
+
} : rects.reference;
|
|
2411
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
2412
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
2413
|
+
x: 1,
|
|
2414
|
+
y: 1
|
|
2415
|
+
} : {
|
|
2416
|
+
x: 1,
|
|
2417
|
+
y: 1
|
|
2418
|
+
};
|
|
2419
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2420
|
+
elements,
|
|
2421
|
+
rect,
|
|
2422
|
+
offsetParent,
|
|
2423
|
+
strategy
|
|
2424
|
+
}) : rect);
|
|
2425
|
+
return {
|
|
2426
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
2427
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
2428
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
2429
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
2430
|
+
};
|
|
2842
2431
|
}
|
|
2843
2432
|
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2433
|
+
/**
|
|
2434
|
+
* Provides data to position an inner element of the floating element so that it
|
|
2435
|
+
* appears centered to the reference element.
|
|
2436
|
+
* @see https://floating-ui.com/docs/arrow
|
|
2437
|
+
*/
|
|
2438
|
+
const arrow = options => ({
|
|
2439
|
+
name: 'arrow',
|
|
2440
|
+
options,
|
|
2441
|
+
async fn(state) {
|
|
2442
|
+
const {
|
|
2443
|
+
x,
|
|
2444
|
+
y,
|
|
2445
|
+
placement,
|
|
2446
|
+
rects,
|
|
2447
|
+
platform,
|
|
2448
|
+
elements,
|
|
2449
|
+
middlewareData
|
|
2450
|
+
} = state;
|
|
2451
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
2452
|
+
const {
|
|
2453
|
+
element,
|
|
2454
|
+
padding = 0
|
|
2455
|
+
} = evaluate(options, state) || {};
|
|
2456
|
+
if (element == null) {
|
|
2457
|
+
return {};
|
|
2458
|
+
}
|
|
2459
|
+
const paddingObject = getPaddingObject(padding);
|
|
2460
|
+
const coords = {
|
|
2461
|
+
x,
|
|
2462
|
+
y
|
|
2463
|
+
};
|
|
2464
|
+
const axis = getAlignmentAxis(placement);
|
|
2465
|
+
const length = getAxisLength(axis);
|
|
2466
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
2467
|
+
const isYAxis = axis === 'y';
|
|
2468
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
2469
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
2470
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
2471
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
2472
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
2473
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
2474
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
2475
|
+
|
|
2476
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
2477
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
2478
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
2479
|
+
}
|
|
2480
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
2481
|
+
|
|
2482
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
2483
|
+
// centered, modify the padding so that it is centered.
|
|
2484
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
2485
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
2486
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
2487
|
+
|
|
2488
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
2489
|
+
// point is outside the floating element's bounds.
|
|
2490
|
+
const min$1 = minPadding;
|
|
2491
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
2492
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
2493
|
+
const offset = clamp(min$1, center, max);
|
|
2494
|
+
|
|
2495
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
2496
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
2497
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
2498
|
+
// a single reset is performed when this is true.
|
|
2499
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
2500
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
2501
|
+
return {
|
|
2502
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
2503
|
+
data: {
|
|
2504
|
+
[axis]: offset,
|
|
2505
|
+
centerOffset: center - offset - alignmentOffset,
|
|
2506
|
+
...(shouldAddOffset && {
|
|
2507
|
+
alignmentOffset
|
|
2508
|
+
})
|
|
2509
|
+
},
|
|
2510
|
+
reset: shouldAddOffset
|
|
2511
|
+
};
|
|
2512
|
+
}
|
|
2513
|
+
});
|
|
2847
2514
|
|
|
2515
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
2516
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);
|
|
2517
|
+
return allowedPlacementsSortedByAlignment.filter(placement => {
|
|
2518
|
+
if (alignment) {
|
|
2519
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
2520
|
+
}
|
|
2521
|
+
return true;
|
|
2522
|
+
});
|
|
2523
|
+
}
|
|
2524
|
+
/**
|
|
2525
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
2526
|
+
* that has the most space available automatically, without needing to specify a
|
|
2527
|
+
* preferred placement. Alternative to `flip`.
|
|
2528
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
2529
|
+
*/
|
|
2530
|
+
const autoPlacement = function (options) {
|
|
2531
|
+
if (options === void 0) {
|
|
2532
|
+
options = {};
|
|
2533
|
+
}
|
|
2848
2534
|
return {
|
|
2849
|
-
name:
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2535
|
+
name: 'autoPlacement',
|
|
2536
|
+
options,
|
|
2537
|
+
async fn(state) {
|
|
2538
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
2539
|
+
const {
|
|
2540
|
+
rects,
|
|
2541
|
+
middlewareData,
|
|
2542
|
+
placement,
|
|
2543
|
+
platform,
|
|
2544
|
+
elements
|
|
2545
|
+
} = state;
|
|
2546
|
+
const {
|
|
2547
|
+
crossAxis = false,
|
|
2548
|
+
alignment,
|
|
2549
|
+
allowedPlacements = placements,
|
|
2550
|
+
autoAlignment = true,
|
|
2551
|
+
...detectOverflowOptions
|
|
2552
|
+
} = evaluate(options, state);
|
|
2553
|
+
const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
2554
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2555
|
+
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
2556
|
+
const currentPlacement = placements$1[currentIndex];
|
|
2557
|
+
if (currentPlacement == null) {
|
|
2558
|
+
return {};
|
|
2559
|
+
}
|
|
2560
|
+
const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
2561
|
+
|
|
2562
|
+
// Make `computeCoords` start from the right place.
|
|
2563
|
+
if (placement !== currentPlacement) {
|
|
2564
|
+
return {
|
|
2565
|
+
reset: {
|
|
2566
|
+
placement: placements$1[0]
|
|
2567
|
+
}
|
|
2568
|
+
};
|
|
2569
|
+
}
|
|
2570
|
+
const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
|
|
2571
|
+
const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
|
|
2572
|
+
placement: currentPlacement,
|
|
2573
|
+
overflows: currentOverflows
|
|
2574
|
+
}];
|
|
2575
|
+
const nextPlacement = placements$1[currentIndex + 1];
|
|
2576
|
+
|
|
2577
|
+
// There are more placements to check.
|
|
2578
|
+
if (nextPlacement) {
|
|
2579
|
+
return {
|
|
2580
|
+
data: {
|
|
2581
|
+
index: currentIndex + 1,
|
|
2582
|
+
overflows: allOverflows
|
|
2583
|
+
},
|
|
2584
|
+
reset: {
|
|
2585
|
+
placement: nextPlacement
|
|
2586
|
+
}
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
const placementsSortedByMostSpace = allOverflows.map(d => {
|
|
2590
|
+
const alignment = getAlignment(d.placement);
|
|
2591
|
+
return [d.placement, alignment && crossAxis ?
|
|
2592
|
+
// Check along the mainAxis and main crossAxis side.
|
|
2593
|
+
d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
|
|
2594
|
+
// Check only the mainAxis.
|
|
2595
|
+
d.overflows[0], d.overflows];
|
|
2596
|
+
}).sort((a, b) => a[1] - b[1]);
|
|
2597
|
+
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
|
|
2598
|
+
// Aligned placements should not check their opposite crossAxis
|
|
2599
|
+
// side.
|
|
2600
|
+
getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
|
|
2601
|
+
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
2602
|
+
if (resetPlacement !== placement) {
|
|
2603
|
+
return {
|
|
2604
|
+
data: {
|
|
2605
|
+
index: currentIndex + 1,
|
|
2606
|
+
overflows: allOverflows
|
|
2607
|
+
},
|
|
2608
|
+
reset: {
|
|
2609
|
+
placement: resetPlacement
|
|
2610
|
+
}
|
|
2611
|
+
};
|
|
2612
|
+
}
|
|
2613
|
+
return {};
|
|
2854
2614
|
}
|
|
2855
2615
|
};
|
|
2856
2616
|
};
|
|
2857
2617
|
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2618
|
+
/**
|
|
2619
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
2620
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
2621
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
2622
|
+
* @see https://floating-ui.com/docs/flip
|
|
2623
|
+
*/
|
|
2624
|
+
const flip = function (options) {
|
|
2625
|
+
if (options === void 0) {
|
|
2626
|
+
options = {};
|
|
2627
|
+
}
|
|
2628
|
+
return {
|
|
2629
|
+
name: 'flip',
|
|
2630
|
+
options,
|
|
2631
|
+
async fn(state) {
|
|
2632
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
2633
|
+
const {
|
|
2634
|
+
placement,
|
|
2635
|
+
middlewareData,
|
|
2636
|
+
rects,
|
|
2637
|
+
initialPlacement,
|
|
2638
|
+
platform,
|
|
2639
|
+
elements
|
|
2640
|
+
} = state;
|
|
2641
|
+
const {
|
|
2642
|
+
mainAxis: checkMainAxis = true,
|
|
2643
|
+
crossAxis: checkCrossAxis = true,
|
|
2644
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
2645
|
+
fallbackStrategy = 'bestFit',
|
|
2646
|
+
fallbackAxisSideDirection = 'none',
|
|
2647
|
+
flipAlignment = true,
|
|
2648
|
+
...detectOverflowOptions
|
|
2649
|
+
} = evaluate(options, state);
|
|
2650
|
+
|
|
2651
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
2652
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
2653
|
+
// work.
|
|
2654
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
2655
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
2656
|
+
return {};
|
|
2657
|
+
}
|
|
2658
|
+
const side = getSide(placement);
|
|
2659
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
2660
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
2661
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
2662
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
2663
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
2664
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
2665
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
2666
|
+
}
|
|
2667
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
2668
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
2669
|
+
const overflows = [];
|
|
2670
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
2671
|
+
if (checkMainAxis) {
|
|
2672
|
+
overflows.push(overflow[side]);
|
|
2673
|
+
}
|
|
2674
|
+
if (checkCrossAxis) {
|
|
2675
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
2676
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
2677
|
+
}
|
|
2678
|
+
overflowsData = [...overflowsData, {
|
|
2679
|
+
placement,
|
|
2680
|
+
overflows
|
|
2681
|
+
}];
|
|
2682
|
+
|
|
2683
|
+
// One or more sides is overflowing.
|
|
2684
|
+
if (!overflows.every(side => side <= 0)) {
|
|
2685
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
2686
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
2687
|
+
const nextPlacement = placements[nextIndex];
|
|
2688
|
+
if (nextPlacement) {
|
|
2689
|
+
// Try next placement and re-run the lifecycle.
|
|
2690
|
+
return {
|
|
2691
|
+
data: {
|
|
2692
|
+
index: nextIndex,
|
|
2693
|
+
overflows: overflowsData
|
|
2694
|
+
},
|
|
2695
|
+
reset: {
|
|
2696
|
+
placement: nextPlacement
|
|
2879
2697
|
}
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2880
2700
|
|
|
2881
|
-
|
|
2701
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
2702
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
2703
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
2882
2704
|
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2705
|
+
// Otherwise fallback.
|
|
2706
|
+
if (!resetPlacement) {
|
|
2707
|
+
switch (fallbackStrategy) {
|
|
2708
|
+
case 'bestFit':
|
|
2709
|
+
{
|
|
2710
|
+
var _overflowsData$filter2;
|
|
2711
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
2712
|
+
if (hasFallbackAxisSideDirection) {
|
|
2713
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
2714
|
+
return currentSideAxis === initialSideAxis ||
|
|
2715
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
2716
|
+
// reading directions favoring greater width.
|
|
2717
|
+
currentSideAxis === 'y';
|
|
2718
|
+
}
|
|
2719
|
+
return true;
|
|
2720
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
2721
|
+
if (placement) {
|
|
2722
|
+
resetPlacement = placement;
|
|
2723
|
+
}
|
|
2724
|
+
break;
|
|
2887
2725
|
}
|
|
2888
|
-
|
|
2726
|
+
case 'initialPlacement':
|
|
2727
|
+
resetPlacement = initialPlacement;
|
|
2728
|
+
break;
|
|
2889
2729
|
}
|
|
2890
|
-
|
|
2891
|
-
break;
|
|
2892
2730
|
}
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2731
|
+
if (placement !== resetPlacement) {
|
|
2732
|
+
return {
|
|
2733
|
+
reset: {
|
|
2734
|
+
placement: resetPlacement
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2897
2737
|
}
|
|
2738
|
+
}
|
|
2739
|
+
return {};
|
|
2898
2740
|
}
|
|
2899
|
-
|
|
2900
|
-
if (toAdd) {
|
|
2901
|
-
cls && (cls += ' ');
|
|
2902
|
-
cls += toAdd;
|
|
2903
|
-
}
|
|
2904
|
-
}
|
|
2905
|
-
|
|
2906
|
-
return cls;
|
|
2741
|
+
};
|
|
2907
2742
|
};
|
|
2908
2743
|
|
|
2909
|
-
function
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
}
|
|
2916
|
-
|
|
2917
|
-
return rawClassName + css(registeredStyles);
|
|
2744
|
+
function getSideOffsets(overflow, rect) {
|
|
2745
|
+
return {
|
|
2746
|
+
top: overflow.top - rect.height,
|
|
2747
|
+
right: overflow.right - rect.width,
|
|
2748
|
+
bottom: overflow.bottom - rect.height,
|
|
2749
|
+
left: overflow.left - rect.width
|
|
2750
|
+
};
|
|
2918
2751
|
}
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2752
|
+
function isAnySideFullyClipped(overflow) {
|
|
2753
|
+
return sides.some(side => overflow[side] >= 0);
|
|
2754
|
+
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
2757
|
+
* when it is not in the same clipping context as the reference element.
|
|
2758
|
+
* @see https://floating-ui.com/docs/hide
|
|
2759
|
+
*/
|
|
2760
|
+
const hide = function (options) {
|
|
2761
|
+
if (options === void 0) {
|
|
2762
|
+
options = {};
|
|
2763
|
+
}
|
|
2764
|
+
return {
|
|
2765
|
+
name: 'hide',
|
|
2766
|
+
options,
|
|
2767
|
+
async fn(state) {
|
|
2768
|
+
const {
|
|
2769
|
+
rects
|
|
2770
|
+
} = state;
|
|
2771
|
+
const {
|
|
2772
|
+
strategy = 'referenceHidden',
|
|
2773
|
+
...detectOverflowOptions
|
|
2774
|
+
} = evaluate(options, state);
|
|
2775
|
+
switch (strategy) {
|
|
2776
|
+
case 'referenceHidden':
|
|
2777
|
+
{
|
|
2778
|
+
const overflow = await detectOverflow(state, {
|
|
2779
|
+
...detectOverflowOptions,
|
|
2780
|
+
elementContext: 'reference'
|
|
2781
|
+
});
|
|
2782
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
2783
|
+
return {
|
|
2784
|
+
data: {
|
|
2785
|
+
referenceHiddenOffsets: offsets,
|
|
2786
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
}
|
|
2790
|
+
case 'escaped':
|
|
2791
|
+
{
|
|
2792
|
+
const overflow = await detectOverflow(state, {
|
|
2793
|
+
...detectOverflowOptions,
|
|
2794
|
+
altBoundary: true
|
|
2795
|
+
});
|
|
2796
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
2797
|
+
return {
|
|
2798
|
+
data: {
|
|
2799
|
+
escapedOffsets: offsets,
|
|
2800
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
2801
|
+
}
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
default:
|
|
2805
|
+
{
|
|
2806
|
+
return {};
|
|
2807
|
+
}
|
|
2931
2808
|
}
|
|
2932
2809
|
}
|
|
2933
|
-
|
|
2934
|
-
if (!isBrowser$1) {
|
|
2935
|
-
return rules;
|
|
2936
|
-
}
|
|
2937
|
-
});
|
|
2938
|
-
|
|
2939
|
-
if (!isBrowser$1 && rules.length !== 0) {
|
|
2940
|
-
var _ref2;
|
|
2941
|
-
|
|
2942
|
-
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
|
|
2943
|
-
return serialized.name;
|
|
2944
|
-
}).join(' '), _ref2.dangerouslySetInnerHTML = {
|
|
2945
|
-
__html: rules
|
|
2946
|
-
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
2947
|
-
}
|
|
2948
|
-
|
|
2949
|
-
return null;
|
|
2810
|
+
};
|
|
2950
2811
|
};
|
|
2951
2812
|
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2813
|
+
function getBoundingRect(rects) {
|
|
2814
|
+
const minX = min(...rects.map(rect => rect.left));
|
|
2815
|
+
const minY = min(...rects.map(rect => rect.top));
|
|
2816
|
+
const maxX = max(...rects.map(rect => rect.right));
|
|
2817
|
+
const maxY = max(...rects.map(rect => rect.bottom));
|
|
2818
|
+
return {
|
|
2819
|
+
x: minX,
|
|
2820
|
+
y: minY,
|
|
2821
|
+
width: maxX - minX,
|
|
2822
|
+
height: maxY - minY
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
function getRectsByLine(rects) {
|
|
2826
|
+
const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
|
|
2827
|
+
const groups = [];
|
|
2828
|
+
let prevRect = null;
|
|
2829
|
+
for (let i = 0; i < sortedRects.length; i++) {
|
|
2830
|
+
const rect = sortedRects[i];
|
|
2831
|
+
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
|
|
2832
|
+
groups.push([rect]);
|
|
2833
|
+
} else {
|
|
2834
|
+
groups[groups.length - 1].push(rect);
|
|
2959
2835
|
}
|
|
2836
|
+
prevRect = rect;
|
|
2837
|
+
}
|
|
2838
|
+
return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
|
|
2839
|
+
}
|
|
2840
|
+
/**
|
|
2841
|
+
* Provides improved positioning for inline reference elements that can span
|
|
2842
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
2843
|
+
* @see https://floating-ui.com/docs/inline
|
|
2844
|
+
*/
|
|
2845
|
+
const inline = function (options) {
|
|
2846
|
+
if (options === void 0) {
|
|
2847
|
+
options = {};
|
|
2848
|
+
}
|
|
2849
|
+
return {
|
|
2850
|
+
name: 'inline',
|
|
2851
|
+
options,
|
|
2852
|
+
async fn(state) {
|
|
2853
|
+
const {
|
|
2854
|
+
placement,
|
|
2855
|
+
elements,
|
|
2856
|
+
rects,
|
|
2857
|
+
platform,
|
|
2858
|
+
strategy
|
|
2859
|
+
} = state;
|
|
2860
|
+
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
2861
|
+
// ClientRect's bounds, despite the event listener being triggered. A
|
|
2862
|
+
// padding of 2 seems to handle this issue.
|
|
2863
|
+
const {
|
|
2864
|
+
padding = 2,
|
|
2865
|
+
x,
|
|
2866
|
+
y
|
|
2867
|
+
} = evaluate(options, state);
|
|
2868
|
+
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
|
|
2869
|
+
const clientRects = getRectsByLine(nativeClientRects);
|
|
2870
|
+
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
2871
|
+
const paddingObject = getPaddingObject(padding);
|
|
2872
|
+
function getBoundingClientRect() {
|
|
2873
|
+
// There are two rects and they are disjoined.
|
|
2874
|
+
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
2875
|
+
// Find the first rect in which the point is fully inside.
|
|
2876
|
+
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
2877
|
+
}
|
|
2960
2878
|
|
|
2961
|
-
|
|
2962
|
-
|
|
2879
|
+
// There are 2 or more connected rects.
|
|
2880
|
+
if (clientRects.length >= 2) {
|
|
2881
|
+
if (getSideAxis(placement) === 'y') {
|
|
2882
|
+
const firstRect = clientRects[0];
|
|
2883
|
+
const lastRect = clientRects[clientRects.length - 1];
|
|
2884
|
+
const isTop = getSide(placement) === 'top';
|
|
2885
|
+
const top = firstRect.top;
|
|
2886
|
+
const bottom = lastRect.bottom;
|
|
2887
|
+
const left = isTop ? firstRect.left : lastRect.left;
|
|
2888
|
+
const right = isTop ? firstRect.right : lastRect.right;
|
|
2889
|
+
const width = right - left;
|
|
2890
|
+
const height = bottom - top;
|
|
2891
|
+
return {
|
|
2892
|
+
top,
|
|
2893
|
+
bottom,
|
|
2894
|
+
left,
|
|
2895
|
+
right,
|
|
2896
|
+
width,
|
|
2897
|
+
height,
|
|
2898
|
+
x: left,
|
|
2899
|
+
y: top
|
|
2900
|
+
};
|
|
2901
|
+
}
|
|
2902
|
+
const isLeftSide = getSide(placement) === 'left';
|
|
2903
|
+
const maxRight = max(...clientRects.map(rect => rect.right));
|
|
2904
|
+
const minLeft = min(...clientRects.map(rect => rect.left));
|
|
2905
|
+
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
2906
|
+
const top = measureRects[0].top;
|
|
2907
|
+
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
2908
|
+
const left = minLeft;
|
|
2909
|
+
const right = maxRight;
|
|
2910
|
+
const width = right - left;
|
|
2911
|
+
const height = bottom - top;
|
|
2912
|
+
return {
|
|
2913
|
+
top,
|
|
2914
|
+
bottom,
|
|
2915
|
+
left,
|
|
2916
|
+
right,
|
|
2917
|
+
width,
|
|
2918
|
+
height,
|
|
2919
|
+
x: left,
|
|
2920
|
+
y: top
|
|
2921
|
+
};
|
|
2922
|
+
}
|
|
2923
|
+
return fallback;
|
|
2924
|
+
}
|
|
2925
|
+
const resetRects = await platform.getElementRects({
|
|
2926
|
+
reference: {
|
|
2927
|
+
getBoundingClientRect
|
|
2928
|
+
},
|
|
2929
|
+
floating: elements.floating,
|
|
2930
|
+
strategy
|
|
2931
|
+
});
|
|
2932
|
+
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
2933
|
+
return {
|
|
2934
|
+
reset: {
|
|
2935
|
+
rects: resetRects
|
|
2936
|
+
}
|
|
2937
|
+
};
|
|
2938
|
+
}
|
|
2939
|
+
return {};
|
|
2963
2940
|
}
|
|
2964
|
-
|
|
2965
|
-
var serialized = serializeStyles(args, cache.registered);
|
|
2966
|
-
serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
|
|
2967
|
-
|
|
2968
|
-
registerStyles(cache, serialized, false);
|
|
2969
|
-
return cache.key + "-" + serialized.name;
|
|
2970
2941
|
};
|
|
2942
|
+
};
|
|
2971
2943
|
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
throw new Error('cx can only be used during render');
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2978
|
-
args[_key2] = arguments[_key2];
|
|
2979
|
-
}
|
|
2944
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
2945
|
+
// Derivable.
|
|
2980
2946
|
|
|
2981
|
-
|
|
2947
|
+
async function convertValueToCoords(state, options) {
|
|
2948
|
+
const {
|
|
2949
|
+
placement,
|
|
2950
|
+
platform,
|
|
2951
|
+
elements
|
|
2952
|
+
} = state;
|
|
2953
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
2954
|
+
const side = getSide(placement);
|
|
2955
|
+
const alignment = getAlignment(placement);
|
|
2956
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
2957
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
2958
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
2959
|
+
const rawValue = evaluate(options, state);
|
|
2960
|
+
|
|
2961
|
+
// eslint-disable-next-line prefer-const
|
|
2962
|
+
let {
|
|
2963
|
+
mainAxis,
|
|
2964
|
+
crossAxis,
|
|
2965
|
+
alignmentAxis
|
|
2966
|
+
} = typeof rawValue === 'number' ? {
|
|
2967
|
+
mainAxis: rawValue,
|
|
2968
|
+
crossAxis: 0,
|
|
2969
|
+
alignmentAxis: null
|
|
2970
|
+
} : {
|
|
2971
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
2972
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
2973
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
2982
2974
|
};
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2975
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
2976
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
2977
|
+
}
|
|
2978
|
+
return isVertical ? {
|
|
2979
|
+
x: crossAxis * crossAxisMulti,
|
|
2980
|
+
y: mainAxis * mainAxisMulti
|
|
2981
|
+
} : {
|
|
2982
|
+
x: mainAxis * mainAxisMulti,
|
|
2983
|
+
y: crossAxis * crossAxisMulti
|
|
2988
2984
|
};
|
|
2989
|
-
var ele = props.children(content);
|
|
2990
|
-
hasRendered = true;
|
|
2991
|
-
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
|
|
2992
|
-
cache: cache,
|
|
2993
|
-
serializedArr: serializedArr
|
|
2994
|
-
}), ele);
|
|
2995
|
-
});
|
|
2996
|
-
|
|
2997
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
2998
|
-
ClassNames.displayName = 'EmotionClassNames';
|
|
2999
2985
|
}
|
|
3000
2986
|
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
|
|
3012
|
-
|
|
3013
|
-
if (globalContext[globalKey]) {
|
|
3014
|
-
console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');
|
|
3015
|
-
}
|
|
3016
|
-
|
|
3017
|
-
globalContext[globalKey] = true;
|
|
2987
|
+
/**
|
|
2988
|
+
* Modifies the placement by translating the floating element along the
|
|
2989
|
+
* specified axes.
|
|
2990
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
2991
|
+
* object may be passed.
|
|
2992
|
+
* @see https://floating-ui.com/docs/offset
|
|
2993
|
+
*/
|
|
2994
|
+
const offset = function (options) {
|
|
2995
|
+
if (options === void 0) {
|
|
2996
|
+
options = 0;
|
|
3018
2997
|
}
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
try {
|
|
3046
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
3047
|
-
} finally {
|
|
3048
|
-
if (_d) throw _e;
|
|
2998
|
+
return {
|
|
2999
|
+
name: 'offset',
|
|
3000
|
+
options,
|
|
3001
|
+
async fn(state) {
|
|
3002
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
3003
|
+
const {
|
|
3004
|
+
x,
|
|
3005
|
+
y,
|
|
3006
|
+
placement,
|
|
3007
|
+
middlewareData
|
|
3008
|
+
} = state;
|
|
3009
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
3010
|
+
|
|
3011
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
3012
|
+
// then we don't need to change the positioning coordinates.
|
|
3013
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
3014
|
+
return {};
|
|
3015
|
+
}
|
|
3016
|
+
return {
|
|
3017
|
+
x: x + diffCoords.x,
|
|
3018
|
+
y: y + diffCoords.y,
|
|
3019
|
+
data: {
|
|
3020
|
+
...diffCoords,
|
|
3021
|
+
placement
|
|
3022
|
+
}
|
|
3023
|
+
};
|
|
3049
3024
|
}
|
|
3050
|
-
}
|
|
3051
|
-
|
|
3052
|
-
return _arr;
|
|
3053
|
-
}
|
|
3054
|
-
|
|
3055
|
-
function _nonIterableRest() {
|
|
3056
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3057
|
-
}
|
|
3058
|
-
|
|
3059
|
-
function _slicedToArray(arr, i) {
|
|
3060
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3061
|
-
}
|
|
3062
|
-
|
|
3063
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
3064
|
-
if (source == null) return {};
|
|
3065
|
-
var target = {};
|
|
3066
|
-
var sourceKeys = Object.keys(source);
|
|
3067
|
-
var key, i;
|
|
3025
|
+
};
|
|
3026
|
+
};
|
|
3068
3027
|
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3028
|
+
/**
|
|
3029
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
3030
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
3031
|
+
* @see https://floating-ui.com/docs/shift
|
|
3032
|
+
*/
|
|
3033
|
+
const shift = function (options) {
|
|
3034
|
+
if (options === void 0) {
|
|
3035
|
+
options = {};
|
|
3073
3036
|
}
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3037
|
+
return {
|
|
3038
|
+
name: 'shift',
|
|
3039
|
+
options,
|
|
3040
|
+
async fn(state) {
|
|
3041
|
+
const {
|
|
3042
|
+
x,
|
|
3043
|
+
y,
|
|
3044
|
+
placement
|
|
3045
|
+
} = state;
|
|
3046
|
+
const {
|
|
3047
|
+
mainAxis: checkMainAxis = true,
|
|
3048
|
+
crossAxis: checkCrossAxis = false,
|
|
3049
|
+
limiter = {
|
|
3050
|
+
fn: _ref => {
|
|
3051
|
+
let {
|
|
3052
|
+
x,
|
|
3053
|
+
y
|
|
3054
|
+
} = _ref;
|
|
3055
|
+
return {
|
|
3056
|
+
x,
|
|
3057
|
+
y
|
|
3058
|
+
};
|
|
3059
|
+
}
|
|
3060
|
+
},
|
|
3061
|
+
...detectOverflowOptions
|
|
3062
|
+
} = evaluate(options, state);
|
|
3063
|
+
const coords = {
|
|
3064
|
+
x,
|
|
3065
|
+
y
|
|
3066
|
+
};
|
|
3067
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
3068
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
3069
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
3070
|
+
let mainAxisCoord = coords[mainAxis];
|
|
3071
|
+
let crossAxisCoord = coords[crossAxis];
|
|
3072
|
+
if (checkMainAxis) {
|
|
3073
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
3074
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
3075
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
3076
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
3077
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
3078
|
+
}
|
|
3079
|
+
if (checkCrossAxis) {
|
|
3080
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
3081
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
3082
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
3083
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
3084
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
3085
|
+
}
|
|
3086
|
+
const limitedCoords = limiter.fn({
|
|
3087
|
+
...state,
|
|
3088
|
+
[mainAxis]: mainAxisCoord,
|
|
3089
|
+
[crossAxis]: crossAxisCoord
|
|
3090
|
+
});
|
|
3091
|
+
return {
|
|
3092
|
+
...limitedCoords,
|
|
3093
|
+
data: {
|
|
3094
|
+
x: limitedCoords.x - x,
|
|
3095
|
+
y: limitedCoords.y - y,
|
|
3096
|
+
enabled: {
|
|
3097
|
+
[mainAxis]: checkMainAxis,
|
|
3098
|
+
[crossAxis]: checkCrossAxis
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
};
|
|
3091
3102
|
}
|
|
3103
|
+
};
|
|
3104
|
+
};
|
|
3105
|
+
/**
|
|
3106
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
3107
|
+
*/
|
|
3108
|
+
const limitShift = function (options) {
|
|
3109
|
+
if (options === void 0) {
|
|
3110
|
+
options = {};
|
|
3092
3111
|
}
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3112
|
+
return {
|
|
3113
|
+
options,
|
|
3114
|
+
fn(state) {
|
|
3115
|
+
const {
|
|
3116
|
+
x,
|
|
3117
|
+
y,
|
|
3118
|
+
placement,
|
|
3119
|
+
rects,
|
|
3120
|
+
middlewareData
|
|
3121
|
+
} = state;
|
|
3122
|
+
const {
|
|
3123
|
+
offset = 0,
|
|
3124
|
+
mainAxis: checkMainAxis = true,
|
|
3125
|
+
crossAxis: checkCrossAxis = true
|
|
3126
|
+
} = evaluate(options, state);
|
|
3127
|
+
const coords = {
|
|
3128
|
+
x,
|
|
3129
|
+
y
|
|
3130
|
+
};
|
|
3131
|
+
const crossAxis = getSideAxis(placement);
|
|
3132
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
3133
|
+
let mainAxisCoord = coords[mainAxis];
|
|
3134
|
+
let crossAxisCoord = coords[crossAxis];
|
|
3135
|
+
const rawOffset = evaluate(offset, state);
|
|
3136
|
+
const computedOffset = typeof rawOffset === 'number' ? {
|
|
3137
|
+
mainAxis: rawOffset,
|
|
3138
|
+
crossAxis: 0
|
|
3139
|
+
} : {
|
|
3140
|
+
mainAxis: 0,
|
|
3141
|
+
crossAxis: 0,
|
|
3142
|
+
...rawOffset
|
|
3143
|
+
};
|
|
3144
|
+
if (checkMainAxis) {
|
|
3145
|
+
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
3146
|
+
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
3147
|
+
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
3148
|
+
if (mainAxisCoord < limitMin) {
|
|
3149
|
+
mainAxisCoord = limitMin;
|
|
3150
|
+
} else if (mainAxisCoord > limitMax) {
|
|
3151
|
+
mainAxisCoord = limitMax;
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
if (checkCrossAxis) {
|
|
3155
|
+
var _middlewareData$offse, _middlewareData$offse2;
|
|
3156
|
+
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
3157
|
+
const isOriginSide = ['top', 'left'].includes(getSide(placement));
|
|
3158
|
+
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
3159
|
+
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
3160
|
+
if (crossAxisCoord < limitMin) {
|
|
3161
|
+
crossAxisCoord = limitMin;
|
|
3162
|
+
} else if (crossAxisCoord > limitMax) {
|
|
3163
|
+
crossAxisCoord = limitMax;
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
return {
|
|
3167
|
+
[mainAxis]: mainAxisCoord,
|
|
3168
|
+
[crossAxis]: crossAxisCoord
|
|
3169
|
+
};
|
|
3105
3170
|
}
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3171
|
+
};
|
|
3172
|
+
};
|
|
3108
3173
|
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3174
|
+
/**
|
|
3175
|
+
* Provides data that allows you to change the size of the floating element —
|
|
3176
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
3177
|
+
* width of the reference element.
|
|
3178
|
+
* @see https://floating-ui.com/docs/size
|
|
3179
|
+
*/
|
|
3180
|
+
const size = function (options) {
|
|
3181
|
+
if (options === void 0) {
|
|
3182
|
+
options = {};
|
|
3183
|
+
}
|
|
3118
3184
|
return {
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3185
|
+
name: 'size',
|
|
3186
|
+
options,
|
|
3187
|
+
async fn(state) {
|
|
3188
|
+
var _state$middlewareData, _state$middlewareData2;
|
|
3189
|
+
const {
|
|
3190
|
+
placement,
|
|
3191
|
+
rects,
|
|
3192
|
+
platform,
|
|
3193
|
+
elements
|
|
3194
|
+
} = state;
|
|
3195
|
+
const {
|
|
3196
|
+
apply = () => {},
|
|
3197
|
+
...detectOverflowOptions
|
|
3198
|
+
} = evaluate(options, state);
|
|
3199
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
3200
|
+
const side = getSide(placement);
|
|
3201
|
+
const alignment = getAlignment(placement);
|
|
3202
|
+
const isYAxis = getSideAxis(placement) === 'y';
|
|
3203
|
+
const {
|
|
3204
|
+
width,
|
|
3205
|
+
height
|
|
3206
|
+
} = rects.floating;
|
|
3207
|
+
let heightSide;
|
|
3208
|
+
let widthSide;
|
|
3209
|
+
if (side === 'top' || side === 'bottom') {
|
|
3210
|
+
heightSide = side;
|
|
3211
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
3212
|
+
} else {
|
|
3213
|
+
widthSide = side;
|
|
3214
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
3215
|
+
}
|
|
3216
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
3217
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
3218
|
+
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
3219
|
+
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
3220
|
+
const noShift = !state.middlewareData.shift;
|
|
3221
|
+
let availableHeight = overflowAvailableHeight;
|
|
3222
|
+
let availableWidth = overflowAvailableWidth;
|
|
3223
|
+
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
3224
|
+
availableWidth = maximumClippingWidth;
|
|
3225
|
+
}
|
|
3226
|
+
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
3227
|
+
availableHeight = maximumClippingHeight;
|
|
3228
|
+
}
|
|
3229
|
+
if (noShift && !alignment) {
|
|
3230
|
+
const xMin = max(overflow.left, 0);
|
|
3231
|
+
const xMax = max(overflow.right, 0);
|
|
3232
|
+
const yMin = max(overflow.top, 0);
|
|
3233
|
+
const yMax = max(overflow.bottom, 0);
|
|
3234
|
+
if (isYAxis) {
|
|
3235
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
3236
|
+
} else {
|
|
3237
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
await apply({
|
|
3241
|
+
...state,
|
|
3242
|
+
availableWidth,
|
|
3243
|
+
availableHeight
|
|
3244
|
+
});
|
|
3245
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
3246
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
3247
|
+
return {
|
|
3248
|
+
reset: {
|
|
3249
|
+
rects: true
|
|
3250
|
+
}
|
|
3251
|
+
};
|
|
3252
|
+
}
|
|
3253
|
+
return {};
|
|
3254
|
+
}
|
|
3124
3255
|
};
|
|
3125
|
-
}
|
|
3256
|
+
};
|
|
3126
3257
|
|
|
3258
|
+
function hasWindow() {
|
|
3259
|
+
return typeof window !== 'undefined';
|
|
3260
|
+
}
|
|
3127
3261
|
function getNodeName(node) {
|
|
3128
3262
|
if (isNode(node)) {
|
|
3129
3263
|
return (node.nodeName || '').toLowerCase();
|
|
@@ -3135,24 +3269,32 @@ function getNodeName(node) {
|
|
|
3135
3269
|
}
|
|
3136
3270
|
function getWindow(node) {
|
|
3137
3271
|
var _node$ownerDocument;
|
|
3138
|
-
return (node == null
|
|
3272
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
3139
3273
|
}
|
|
3140
3274
|
function getDocumentElement(node) {
|
|
3141
3275
|
var _ref;
|
|
3142
3276
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
3143
3277
|
}
|
|
3144
3278
|
function isNode(value) {
|
|
3279
|
+
if (!hasWindow()) {
|
|
3280
|
+
return false;
|
|
3281
|
+
}
|
|
3145
3282
|
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
3146
3283
|
}
|
|
3147
3284
|
function isElement(value) {
|
|
3285
|
+
if (!hasWindow()) {
|
|
3286
|
+
return false;
|
|
3287
|
+
}
|
|
3148
3288
|
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
3149
3289
|
}
|
|
3150
3290
|
function isHTMLElement(value) {
|
|
3291
|
+
if (!hasWindow()) {
|
|
3292
|
+
return false;
|
|
3293
|
+
}
|
|
3151
3294
|
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
3152
3295
|
}
|
|
3153
3296
|
function isShadowRoot(value) {
|
|
3154
|
-
|
|
3155
|
-
if (typeof ShadowRoot === 'undefined') {
|
|
3297
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
3156
3298
|
return false;
|
|
3157
3299
|
}
|
|
3158
3300
|
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
@@ -3213,10 +3355,14 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
3213
3355
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
3214
3356
|
const win = getWindow(scrollableAncestor);
|
|
3215
3357
|
if (isBody) {
|
|
3216
|
-
|
|
3358
|
+
const frameElement = getFrameElement(win);
|
|
3359
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
3217
3360
|
}
|
|
3218
3361
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
3219
3362
|
}
|
|
3363
|
+
function getFrameElement(win) {
|
|
3364
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
3365
|
+
}
|
|
3220
3366
|
|
|
3221
3367
|
function getCssDimensions(element) {
|
|
3222
3368
|
const css = getComputedStyle$1(element);
|
|
@@ -3319,8 +3465,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3319
3465
|
if (domElement) {
|
|
3320
3466
|
const win = getWindow(domElement);
|
|
3321
3467
|
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
3322
|
-
let
|
|
3323
|
-
|
|
3468
|
+
let currentWin = win;
|
|
3469
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
3470
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
3324
3471
|
const iframeScale = getScale(currentIFrame);
|
|
3325
3472
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
3326
3473
|
const css = getComputedStyle$1(currentIFrame);
|
|
@@ -3332,7 +3479,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
3332
3479
|
height *= iframeScale.y;
|
|
3333
3480
|
x += left;
|
|
3334
3481
|
y += top;
|
|
3335
|
-
|
|
3482
|
+
currentWin = getWindow(currentIFrame);
|
|
3483
|
+
currentIFrame = getFrameElement(currentWin);
|
|
3336
3484
|
}
|
|
3337
3485
|
}
|
|
3338
3486
|
return rectToClientRect({
|
|
@@ -3349,8 +3497,9 @@ function observeMove(element, onMove) {
|
|
|
3349
3497
|
let timeoutId;
|
|
3350
3498
|
const root = getDocumentElement(element);
|
|
3351
3499
|
function cleanup() {
|
|
3500
|
+
var _io;
|
|
3352
3501
|
clearTimeout(timeoutId);
|
|
3353
|
-
io
|
|
3502
|
+
(_io = io) == null || _io.disconnect();
|
|
3354
3503
|
io = null;
|
|
3355
3504
|
}
|
|
3356
3505
|
function refresh(skip, threshold) {
|
|
@@ -3390,9 +3539,11 @@ function observeMove(element, onMove) {
|
|
|
3390
3539
|
return refresh();
|
|
3391
3540
|
}
|
|
3392
3541
|
if (!ratio) {
|
|
3542
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
3543
|
+
// to prevent an infinite loop of updates.
|
|
3393
3544
|
timeoutId = setTimeout(() => {
|
|
3394
3545
|
refresh(false, 1e-7);
|
|
3395
|
-
},
|
|
3546
|
+
}, 1000);
|
|
3396
3547
|
} else {
|
|
3397
3548
|
refresh(false, ratio);
|
|
3398
3549
|
}
|
|
@@ -3456,7 +3607,8 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3456
3607
|
resizeObserver.unobserve(floating);
|
|
3457
3608
|
cancelAnimationFrame(reobserveFrame);
|
|
3458
3609
|
reobserveFrame = requestAnimationFrame(() => {
|
|
3459
|
-
|
|
3610
|
+
var _resizeObserver;
|
|
3611
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
3460
3612
|
});
|
|
3461
3613
|
}
|
|
3462
3614
|
update();
|
|
@@ -3481,12 +3633,13 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3481
3633
|
}
|
|
3482
3634
|
update();
|
|
3483
3635
|
return () => {
|
|
3636
|
+
var _resizeObserver2;
|
|
3484
3637
|
ancestors.forEach(ancestor => {
|
|
3485
3638
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
3486
3639
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
3487
3640
|
});
|
|
3488
|
-
cleanupIo
|
|
3489
|
-
resizeObserver
|
|
3641
|
+
cleanupIo == null || cleanupIo();
|
|
3642
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
3490
3643
|
resizeObserver = null;
|
|
3491
3644
|
if (animationFrame) {
|
|
3492
3645
|
cancelAnimationFrame(frameId);
|
|
@@ -3494,6 +3647,72 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3494
3647
|
};
|
|
3495
3648
|
}
|
|
3496
3649
|
|
|
3650
|
+
/**
|
|
3651
|
+
* Modifies the placement by translating the floating element along the
|
|
3652
|
+
* specified axes.
|
|
3653
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
3654
|
+
* object may be passed.
|
|
3655
|
+
* @see https://floating-ui.com/docs/offset
|
|
3656
|
+
*/
|
|
3657
|
+
offset;
|
|
3658
|
+
|
|
3659
|
+
/**
|
|
3660
|
+
* Optimizes the visibility of the floating element by choosing the placement
|
|
3661
|
+
* that has the most space available automatically, without needing to specify a
|
|
3662
|
+
* preferred placement. Alternative to `flip`.
|
|
3663
|
+
* @see https://floating-ui.com/docs/autoPlacement
|
|
3664
|
+
*/
|
|
3665
|
+
autoPlacement;
|
|
3666
|
+
|
|
3667
|
+
/**
|
|
3668
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
3669
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
3670
|
+
* @see https://floating-ui.com/docs/shift
|
|
3671
|
+
*/
|
|
3672
|
+
shift;
|
|
3673
|
+
|
|
3674
|
+
/**
|
|
3675
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
3676
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
3677
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
3678
|
+
* @see https://floating-ui.com/docs/flip
|
|
3679
|
+
*/
|
|
3680
|
+
flip;
|
|
3681
|
+
|
|
3682
|
+
/**
|
|
3683
|
+
* Provides data that allows you to change the size of the floating element —
|
|
3684
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
3685
|
+
* width of the reference element.
|
|
3686
|
+
* @see https://floating-ui.com/docs/size
|
|
3687
|
+
*/
|
|
3688
|
+
size;
|
|
3689
|
+
|
|
3690
|
+
/**
|
|
3691
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
3692
|
+
* when it is not in the same clipping context as the reference element.
|
|
3693
|
+
* @see https://floating-ui.com/docs/hide
|
|
3694
|
+
*/
|
|
3695
|
+
hide;
|
|
3696
|
+
|
|
3697
|
+
/**
|
|
3698
|
+
* Provides data to position an inner element of the floating element so that it
|
|
3699
|
+
* appears centered to the reference element.
|
|
3700
|
+
* @see https://floating-ui.com/docs/arrow
|
|
3701
|
+
*/
|
|
3702
|
+
arrow;
|
|
3703
|
+
|
|
3704
|
+
/**
|
|
3705
|
+
* Provides improved positioning for inline reference elements that can span
|
|
3706
|
+
* over multiple lines, such as hyperlinks or range selections.
|
|
3707
|
+
* @see https://floating-ui.com/docs/inline
|
|
3708
|
+
*/
|
|
3709
|
+
inline;
|
|
3710
|
+
|
|
3711
|
+
/**
|
|
3712
|
+
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
3713
|
+
*/
|
|
3714
|
+
limitShift;
|
|
3715
|
+
|
|
3497
3716
|
var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
3498
3717
|
|
|
3499
3718
|
var _excluded$4 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
|
|
@@ -6203,10 +6422,12 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
|
6203
6422
|
var lastSelectedValue = selectValue[selectValue.length - 1];
|
|
6204
6423
|
var newValueArray = selectValue.slice(0, selectValue.length - 1);
|
|
6205
6424
|
var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null);
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6425
|
+
if (lastSelectedValue) {
|
|
6426
|
+
_this.onChange(newValue, {
|
|
6427
|
+
action: 'pop-value',
|
|
6428
|
+
removedValue: lastSelectedValue
|
|
6429
|
+
});
|
|
6430
|
+
}
|
|
6210
6431
|
};
|
|
6211
6432
|
_this.getFocusedOptionId = function (focusedOption) {
|
|
6212
6433
|
return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
|