@moda/om 19.4.2 → 19.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/index.cjs.js +166 -188
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +166 -188
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/AspectRatioBox/AspectRatioBox.d.ts +5 -5
- package/dist/src/components/Field/Field.d.ts +1 -1
- package/dist/src/components/Overlay/Overlay.d.ts +1 -1
- package/dist/src/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/src/components/SearchInput/SearchInput.d.ts +1 -0
- package/dist/src/components/SearchInput/SearchInput.stories.d.ts +1 -0
- package/dist/src/components/Select/useSelect.d.ts +0 -1
- package/dist/src/hooks/useKeyboardListNavigation.d.ts +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/utilities/States/isRenderProps.d.ts +0 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -6
- package/src/components/SearchInput/SearchInput.scss +5 -1
- package/src/components/SearchInput/SearchInput.stories.tsx +6 -0
- package/src/components/SearchInput/SearchInput.tsx +4 -1
- package/src/components/Select/Select.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1001,6 +1001,85 @@ var colorStringExports = colorString.exports;
|
|
|
1001
1001
|
__exportStar(helpers, exports);
|
|
1002
1002
|
})(dist$4);
|
|
1003
1003
|
|
|
1004
|
+
function _arrayLikeToArray(r, a) {
|
|
1005
|
+
(null == a || a > r.length) && (a = r.length);
|
|
1006
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
1007
|
+
return n;
|
|
1008
|
+
}
|
|
1009
|
+
function _arrayWithHoles(r) {
|
|
1010
|
+
if (Array.isArray(r)) return r;
|
|
1011
|
+
}
|
|
1012
|
+
function _arrayWithoutHoles(r) {
|
|
1013
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
1014
|
+
}
|
|
1015
|
+
function _createForOfIteratorHelper(r, e) {
|
|
1016
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
1017
|
+
if (!t) {
|
|
1018
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
|
|
1019
|
+
t && (r = t);
|
|
1020
|
+
var n = 0,
|
|
1021
|
+
F = function () {};
|
|
1022
|
+
return {
|
|
1023
|
+
s: F,
|
|
1024
|
+
n: function () {
|
|
1025
|
+
return n >= r.length ? {
|
|
1026
|
+
done: !0
|
|
1027
|
+
} : {
|
|
1028
|
+
done: !1,
|
|
1029
|
+
value: r[n++]
|
|
1030
|
+
};
|
|
1031
|
+
},
|
|
1032
|
+
e: function (r) {
|
|
1033
|
+
throw r;
|
|
1034
|
+
},
|
|
1035
|
+
f: F
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1039
|
+
}
|
|
1040
|
+
var o,
|
|
1041
|
+
a = !0,
|
|
1042
|
+
u = !1;
|
|
1043
|
+
return {
|
|
1044
|
+
s: function () {
|
|
1045
|
+
t = t.call(r);
|
|
1046
|
+
},
|
|
1047
|
+
n: function () {
|
|
1048
|
+
var r = t.next();
|
|
1049
|
+
return a = r.done, r;
|
|
1050
|
+
},
|
|
1051
|
+
e: function (r) {
|
|
1052
|
+
u = !0, o = r;
|
|
1053
|
+
},
|
|
1054
|
+
f: function () {
|
|
1055
|
+
try {
|
|
1056
|
+
a || null == t.return || t.return();
|
|
1057
|
+
} finally {
|
|
1058
|
+
if (u) throw o;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
function _defineProperty$1(e, r, t) {
|
|
1064
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1065
|
+
value: t,
|
|
1066
|
+
enumerable: !0,
|
|
1067
|
+
configurable: !0,
|
|
1068
|
+
writable: !0
|
|
1069
|
+
}) : e[r] = t, e;
|
|
1070
|
+
}
|
|
1071
|
+
function _extends$1() {
|
|
1072
|
+
return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
|
|
1073
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
1074
|
+
var t = arguments[e];
|
|
1075
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
1076
|
+
}
|
|
1077
|
+
return n;
|
|
1078
|
+
}, _extends$1.apply(null, arguments);
|
|
1079
|
+
}
|
|
1080
|
+
function _iterableToArray(r) {
|
|
1081
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
1082
|
+
}
|
|
1004
1083
|
function _iterableToArrayLimit(r, l) {
|
|
1005
1084
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
1006
1085
|
if (null != t) {
|
|
@@ -1028,6 +1107,15 @@ function _iterableToArrayLimit(r, l) {
|
|
|
1028
1107
|
return a;
|
|
1029
1108
|
}
|
|
1030
1109
|
}
|
|
1110
|
+
function _nonIterableRest() {
|
|
1111
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1112
|
+
}
|
|
1113
|
+
function _nonIterableSpread() {
|
|
1114
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1115
|
+
}
|
|
1116
|
+
function _objectDestructuringEmpty(t) {
|
|
1117
|
+
if (null == t) throw new TypeError("Cannot destructure " + t);
|
|
1118
|
+
}
|
|
1031
1119
|
function ownKeys(e, r) {
|
|
1032
1120
|
var t = Object.keys(e);
|
|
1033
1121
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1049,6 +1137,32 @@ function _objectSpread2(e) {
|
|
|
1049
1137
|
}
|
|
1050
1138
|
return e;
|
|
1051
1139
|
}
|
|
1140
|
+
function _objectWithoutProperties(e, t) {
|
|
1141
|
+
if (null == e) return {};
|
|
1142
|
+
var o,
|
|
1143
|
+
r,
|
|
1144
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
1145
|
+
if (Object.getOwnPropertySymbols) {
|
|
1146
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
1147
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
1148
|
+
}
|
|
1149
|
+
return i;
|
|
1150
|
+
}
|
|
1151
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
1152
|
+
if (null == r) return {};
|
|
1153
|
+
var t = {};
|
|
1154
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
1155
|
+
if (e.includes(n)) continue;
|
|
1156
|
+
t[n] = r[n];
|
|
1157
|
+
}
|
|
1158
|
+
return t;
|
|
1159
|
+
}
|
|
1160
|
+
function _slicedToArray(r, e) {
|
|
1161
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
1162
|
+
}
|
|
1163
|
+
function _toConsumableArray(r) {
|
|
1164
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
1165
|
+
}
|
|
1052
1166
|
function _toPrimitive(t, r) {
|
|
1053
1167
|
if ("object" != typeof t || !t) return t;
|
|
1054
1168
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1072,147 +1186,12 @@ function _typeof$1(o) {
|
|
|
1072
1186
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
1073
1187
|
}, _typeof$1(o);
|
|
1074
1188
|
}
|
|
1075
|
-
function
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
enumerable: true,
|
|
1081
|
-
configurable: true,
|
|
1082
|
-
writable: true
|
|
1083
|
-
});
|
|
1084
|
-
} else {
|
|
1085
|
-
obj[key] = value;
|
|
1086
|
-
}
|
|
1087
|
-
return obj;
|
|
1088
|
-
}
|
|
1089
|
-
function _extends$1() {
|
|
1090
|
-
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
1091
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
1092
|
-
var source = arguments[i];
|
|
1093
|
-
for (var key in source) {
|
|
1094
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1095
|
-
target[key] = source[key];
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
return target;
|
|
1100
|
-
};
|
|
1101
|
-
return _extends$1.apply(this, arguments);
|
|
1102
|
-
}
|
|
1103
|
-
function _objectDestructuringEmpty(obj) {
|
|
1104
|
-
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
|
1105
|
-
}
|
|
1106
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1107
|
-
if (source == null) return {};
|
|
1108
|
-
var target = {};
|
|
1109
|
-
for (var key in source) {
|
|
1110
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1111
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1112
|
-
target[key] = source[key];
|
|
1113
|
-
}
|
|
1189
|
+
function _unsupportedIterableToArray(r, a) {
|
|
1190
|
+
if (r) {
|
|
1191
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
1192
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
1193
|
+
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;
|
|
1114
1194
|
}
|
|
1115
|
-
return target;
|
|
1116
|
-
}
|
|
1117
|
-
function _objectWithoutProperties(source, excluded) {
|
|
1118
|
-
if (source == null) return {};
|
|
1119
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
1120
|
-
var key, i;
|
|
1121
|
-
if (Object.getOwnPropertySymbols) {
|
|
1122
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1123
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1124
|
-
key = sourceSymbolKeys[i];
|
|
1125
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
1126
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1127
|
-
target[key] = source[key];
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
return target;
|
|
1131
|
-
}
|
|
1132
|
-
function _slicedToArray(arr, i) {
|
|
1133
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1134
|
-
}
|
|
1135
|
-
function _toConsumableArray(arr) {
|
|
1136
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
1137
|
-
}
|
|
1138
|
-
function _arrayWithoutHoles(arr) {
|
|
1139
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
1140
|
-
}
|
|
1141
|
-
function _arrayWithHoles(arr) {
|
|
1142
|
-
if (Array.isArray(arr)) return arr;
|
|
1143
|
-
}
|
|
1144
|
-
function _iterableToArray(iter) {
|
|
1145
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1146
|
-
}
|
|
1147
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
1148
|
-
if (!o) return;
|
|
1149
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1150
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1151
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1152
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1153
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1154
|
-
}
|
|
1155
|
-
function _arrayLikeToArray(arr, len) {
|
|
1156
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
1157
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1158
|
-
return arr2;
|
|
1159
|
-
}
|
|
1160
|
-
function _nonIterableSpread() {
|
|
1161
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1162
|
-
}
|
|
1163
|
-
function _nonIterableRest() {
|
|
1164
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1165
|
-
}
|
|
1166
|
-
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
1167
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
1168
|
-
if (!it) {
|
|
1169
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike ) {
|
|
1170
|
-
if (it) o = it;
|
|
1171
|
-
var i = 0;
|
|
1172
|
-
var F = function () {};
|
|
1173
|
-
return {
|
|
1174
|
-
s: F,
|
|
1175
|
-
n: function () {
|
|
1176
|
-
if (i >= o.length) return {
|
|
1177
|
-
done: true
|
|
1178
|
-
};
|
|
1179
|
-
return {
|
|
1180
|
-
done: false,
|
|
1181
|
-
value: o[i++]
|
|
1182
|
-
};
|
|
1183
|
-
},
|
|
1184
|
-
e: function (e) {
|
|
1185
|
-
throw e;
|
|
1186
|
-
},
|
|
1187
|
-
f: F
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1191
|
-
}
|
|
1192
|
-
var normalCompletion = true,
|
|
1193
|
-
didErr = false,
|
|
1194
|
-
err;
|
|
1195
|
-
return {
|
|
1196
|
-
s: function () {
|
|
1197
|
-
it = it.call(o);
|
|
1198
|
-
},
|
|
1199
|
-
n: function () {
|
|
1200
|
-
var step = it.next();
|
|
1201
|
-
normalCompletion = step.done;
|
|
1202
|
-
return step;
|
|
1203
|
-
},
|
|
1204
|
-
e: function (e) {
|
|
1205
|
-
didErr = true;
|
|
1206
|
-
err = e;
|
|
1207
|
-
},
|
|
1208
|
-
f: function () {
|
|
1209
|
-
try {
|
|
1210
|
-
if (!normalCompletion && it.return != null) it.return();
|
|
1211
|
-
} finally {
|
|
1212
|
-
if (didErr) throw err;
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
};
|
|
1216
1195
|
}
|
|
1217
1196
|
|
|
1218
1197
|
var isRenderProps = function isRenderProps(children) {
|
|
@@ -3345,24 +3324,24 @@ var isInert = function isInert(node) {
|
|
|
3345
3324
|
var isVisibleUncached = function isVisibleUncached(node, checkParent) {
|
|
3346
3325
|
return !node || isTopNode(node) || !isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node));
|
|
3347
3326
|
};
|
|
3348
|
-
var
|
|
3327
|
+
var _isVisibleCached = function isVisibleCached(visibilityCache, node) {
|
|
3349
3328
|
var cached = visibilityCache.get(node);
|
|
3350
3329
|
if (cached !== undefined) {
|
|
3351
3330
|
return cached;
|
|
3352
3331
|
}
|
|
3353
|
-
var result = isVisibleUncached(node,
|
|
3332
|
+
var result = isVisibleUncached(node, _isVisibleCached.bind(undefined, visibilityCache));
|
|
3354
3333
|
visibilityCache.set(node, result);
|
|
3355
3334
|
return result;
|
|
3356
3335
|
};
|
|
3357
3336
|
var isAutoFocusAllowedUncached = function isAutoFocusAllowedUncached(node, checkParent) {
|
|
3358
3337
|
return node && !isTopNode(node) ? isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false : true;
|
|
3359
3338
|
};
|
|
3360
|
-
var
|
|
3339
|
+
var _isAutoFocusAllowedCached = function isAutoFocusAllowedCached(cache, node) {
|
|
3361
3340
|
var cached = cache.get(node);
|
|
3362
3341
|
if (cached !== undefined) {
|
|
3363
3342
|
return cached;
|
|
3364
3343
|
}
|
|
3365
|
-
var result = isAutoFocusAllowedUncached(node,
|
|
3344
|
+
var result = isAutoFocusAllowedUncached(node, _isAutoFocusAllowedCached.bind(undefined, cache));
|
|
3366
3345
|
cache.set(node, result);
|
|
3367
3346
|
return result;
|
|
3368
3347
|
};
|
|
@@ -3446,9 +3425,9 @@ var tabbables = ['button:enabled', 'select:enabled', 'textarea:enabled', 'input:
|
|
|
3446
3425
|
|
|
3447
3426
|
var queryTabbables = tabbables.join(',');
|
|
3448
3427
|
var queryGuardTabbables = "".concat(queryTabbables, ", [data-focus-guard]");
|
|
3449
|
-
var
|
|
3428
|
+
var _getFocusablesWithShadowDom = function getFocusablesWithShadowDom(parent, withGuards) {
|
|
3450
3429
|
return toArray((parent.shadowRoot || parent).children).reduce(function (acc, child) {
|
|
3451
|
-
return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [],
|
|
3430
|
+
return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], _getFocusablesWithShadowDom(child));
|
|
3452
3431
|
}, []);
|
|
3453
3432
|
};
|
|
3454
3433
|
var getFocusablesWithIFrame = function getFocusablesWithIFrame(parent, withGuards) {
|
|
@@ -3462,7 +3441,7 @@ var getFocusablesWithIFrame = function getFocusablesWithIFrame(parent, withGuard
|
|
|
3462
3441
|
var getFocusables = function getFocusables(parents, withGuards) {
|
|
3463
3442
|
return parents.reduce(function (acc, parent) {
|
|
3464
3443
|
var _a;
|
|
3465
|
-
var focusableWithShadowDom =
|
|
3444
|
+
var focusableWithShadowDom = _getFocusablesWithShadowDom(parent, withGuards);
|
|
3466
3445
|
var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) {
|
|
3467
3446
|
return getFocusablesWithIFrame(node, withGuards);
|
|
3468
3447
|
}));
|
|
@@ -3495,7 +3474,7 @@ var getParentAutofocusables = function getParentAutofocusables(parent) {
|
|
|
3495
3474
|
*/
|
|
3496
3475
|
var filterFocusable = function filterFocusable(nodes, visibilityCache) {
|
|
3497
3476
|
return toArray(nodes).filter(function (node) {
|
|
3498
|
-
return
|
|
3477
|
+
return _isVisibleCached(visibilityCache, node);
|
|
3499
3478
|
}).filter(function (node) {
|
|
3500
3479
|
return notHiddenInput(node);
|
|
3501
3480
|
});
|
|
@@ -3505,7 +3484,7 @@ var filterAutoFocusable = function filterAutoFocusable(nodes, cache) {
|
|
|
3505
3484
|
cache = new Map();
|
|
3506
3485
|
}
|
|
3507
3486
|
return toArray(nodes).filter(function (node) {
|
|
3508
|
-
return
|
|
3487
|
+
return _isAutoFocusAllowedCached(cache, node);
|
|
3509
3488
|
});
|
|
3510
3489
|
};
|
|
3511
3490
|
/**
|
|
@@ -3545,9 +3524,9 @@ var parentAutofocusables = function parentAutofocusables(topNode, visibilityCach
|
|
|
3545
3524
|
/*
|
|
3546
3525
|
* Determines if element is contained in scope, including nested shadow DOMs
|
|
3547
3526
|
*/
|
|
3548
|
-
var
|
|
3527
|
+
var _contains = function contains(scope, element) {
|
|
3549
3528
|
if (scope.shadowRoot) {
|
|
3550
|
-
return
|
|
3529
|
+
return _contains(scope.shadowRoot, element);
|
|
3551
3530
|
} else {
|
|
3552
3531
|
if (Object.getPrototypeOf(scope).contains !== undefined && Object.getPrototypeOf(scope).contains.call(scope, element)) {
|
|
3553
3532
|
return true;
|
|
@@ -3557,11 +3536,11 @@ var contains$1 = function contains(scope, element) {
|
|
|
3557
3536
|
if (child instanceof HTMLIFrameElement) {
|
|
3558
3537
|
var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body;
|
|
3559
3538
|
if (iframeBody) {
|
|
3560
|
-
return
|
|
3539
|
+
return _contains(iframeBody, element);
|
|
3561
3540
|
}
|
|
3562
3541
|
return false;
|
|
3563
3542
|
}
|
|
3564
|
-
return
|
|
3543
|
+
return _contains(child, element);
|
|
3565
3544
|
});
|
|
3566
3545
|
}
|
|
3567
3546
|
};
|
|
@@ -3598,8 +3577,8 @@ var filterNested = function filterNested(nodes) {
|
|
|
3598
3577
|
* @param node
|
|
3599
3578
|
* @returns {*}
|
|
3600
3579
|
*/
|
|
3601
|
-
var
|
|
3602
|
-
return node.parentNode ?
|
|
3580
|
+
var _getTopParent = function getTopParent(node) {
|
|
3581
|
+
return node.parentNode ? _getTopParent(node.parentNode) : node;
|
|
3603
3582
|
};
|
|
3604
3583
|
/**
|
|
3605
3584
|
* returns all "focus containers" inside a given node
|
|
@@ -3610,7 +3589,7 @@ var getAllAffectedNodes = function getAllAffectedNodes(node) {
|
|
|
3610
3589
|
var nodes = asArray(node);
|
|
3611
3590
|
return nodes.filter(Boolean).reduce(function (acc, currentNode) {
|
|
3612
3591
|
var group = currentNode.getAttribute(FOCUS_GROUP);
|
|
3613
|
-
acc.push.apply(acc, group ? filterNested(toArray(
|
|
3592
|
+
acc.push.apply(acc, group ? filterNested(toArray(_getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, "=\"").concat(group, "\"]:not([").concat(FOCUS_DISABLED, "=\"disabled\"])")))) : [currentNode]);
|
|
3614
3593
|
return acc;
|
|
3615
3594
|
}, []);
|
|
3616
3595
|
};
|
|
@@ -3630,7 +3609,7 @@ var safeProbe = function safeProbe(cb) {
|
|
|
3630
3609
|
* returns current active element. If the active element is a "container" itself(shadowRoot or iframe) returns active element inside it
|
|
3631
3610
|
* @param [inDocument]
|
|
3632
3611
|
*/
|
|
3633
|
-
var
|
|
3612
|
+
var _getActiveElement = function getActiveElement(inDocument) {
|
|
3634
3613
|
if (inDocument === void 0) {
|
|
3635
3614
|
inDocument = document;
|
|
3636
3615
|
}
|
|
@@ -3638,9 +3617,9 @@ var getActiveElement = function getActiveElement(inDocument) {
|
|
|
3638
3617
|
return undefined;
|
|
3639
3618
|
}
|
|
3640
3619
|
var activeElement = inDocument.activeElement;
|
|
3641
|
-
return activeElement.shadowRoot ?
|
|
3620
|
+
return activeElement.shadowRoot ? _getActiveElement(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function () {
|
|
3642
3621
|
return activeElement.contentWindow.document;
|
|
3643
|
-
}) ?
|
|
3622
|
+
}) ? _getActiveElement(activeElement.contentWindow.document) : activeElement;
|
|
3644
3623
|
};
|
|
3645
3624
|
|
|
3646
3625
|
var focusInFrame = function focusInFrame(frame, activeElement) {
|
|
@@ -3658,13 +3637,13 @@ var focusInsideIframe = function focusInsideIframe(topNode, activeElement) {
|
|
|
3658
3637
|
var focusInside = function focusInside(topNode, activeElement) {
|
|
3659
3638
|
// const activeElement = document && getActiveElement();
|
|
3660
3639
|
if (activeElement === void 0) {
|
|
3661
|
-
activeElement =
|
|
3640
|
+
activeElement = _getActiveElement(getFirst(topNode).ownerDocument);
|
|
3662
3641
|
}
|
|
3663
3642
|
if (!activeElement || activeElement.dataset && activeElement.dataset.focusGuard) {
|
|
3664
3643
|
return false;
|
|
3665
3644
|
}
|
|
3666
3645
|
return getAllAffectedNodes(topNode).some(function (node) {
|
|
3667
|
-
return
|
|
3646
|
+
return _contains(node, activeElement) || focusInsideIframe(node, activeElement);
|
|
3668
3647
|
});
|
|
3669
3648
|
};
|
|
3670
3649
|
|
|
@@ -3680,13 +3659,13 @@ var focusIsHidden = function focusIsHidden(inDocument) {
|
|
|
3680
3659
|
if (inDocument === void 0) {
|
|
3681
3660
|
inDocument = document;
|
|
3682
3661
|
}
|
|
3683
|
-
var activeElement =
|
|
3662
|
+
var activeElement = _getActiveElement(inDocument);
|
|
3684
3663
|
if (!activeElement) {
|
|
3685
3664
|
return false;
|
|
3686
3665
|
}
|
|
3687
3666
|
// this does not support setting FOCUS_ALLOW within shadow dom
|
|
3688
3667
|
return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function (node) {
|
|
3689
|
-
return
|
|
3668
|
+
return _contains(node, activeElement);
|
|
3690
3669
|
});
|
|
3691
3670
|
};
|
|
3692
3671
|
|
|
@@ -3839,13 +3818,13 @@ var pickAutofocus = function pickAutofocus(nodesIndexes, orderedNodes, groups) {
|
|
|
3839
3818
|
return pickFirstFocus(filterAutoFocusable(orderedNodes));
|
|
3840
3819
|
};
|
|
3841
3820
|
|
|
3842
|
-
var
|
|
3821
|
+
var _getParents = function getParents(node, parents) {
|
|
3843
3822
|
if (parents === void 0) {
|
|
3844
3823
|
parents = [];
|
|
3845
3824
|
}
|
|
3846
3825
|
parents.push(node);
|
|
3847
3826
|
if (node.parentNode) {
|
|
3848
|
-
|
|
3827
|
+
_getParents(node.parentNode.host || node.parentNode, parents);
|
|
3849
3828
|
}
|
|
3850
3829
|
return parents;
|
|
3851
3830
|
};
|
|
@@ -3856,8 +3835,8 @@ var getParents = function getParents(node, parents) {
|
|
|
3856
3835
|
* @returns {boolean|*}
|
|
3857
3836
|
*/
|
|
3858
3837
|
var getCommonParent = function getCommonParent(nodeA, nodeB) {
|
|
3859
|
-
var parentsA =
|
|
3860
|
-
var parentsB =
|
|
3838
|
+
var parentsA = _getParents(nodeA);
|
|
3839
|
+
var parentsB = _getParents(nodeB);
|
|
3861
3840
|
// tslint:disable-next-line:prefer-for-of
|
|
3862
3841
|
for (var i = 0; i < parentsA.length; i += 1) {
|
|
3863
3842
|
var currentParent = parentsA[i];
|
|
@@ -3877,7 +3856,7 @@ var getTopCommonParent = function getTopCommonParent(baseActiveElement, leftEntr
|
|
|
3877
3856
|
rightEntries.filter(Boolean).forEach(function (subEntry) {
|
|
3878
3857
|
var common = getCommonParent(activeElement, subEntry);
|
|
3879
3858
|
if (common) {
|
|
3880
|
-
if (!topCommon ||
|
|
3859
|
+
if (!topCommon || _contains(common, topCommon)) {
|
|
3881
3860
|
topCommon = common;
|
|
3882
3861
|
} else {
|
|
3883
3862
|
topCommon = getCommonParent(common, topCommon);
|
|
@@ -3921,7 +3900,7 @@ var reorderNodes = function reorderNodes(srcNodes, dstNodes) {
|
|
|
3921
3900
|
* @param lastNode
|
|
3922
3901
|
*/
|
|
3923
3902
|
var focusSolver = function focusSolver(topNode, lastNode) {
|
|
3924
|
-
var activeElement =
|
|
3903
|
+
var activeElement = _getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
|
|
3925
3904
|
var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
|
|
3926
3905
|
var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);
|
|
3927
3906
|
var visibilityCache = new Map();
|
|
@@ -4154,7 +4133,7 @@ var getRelativeFocusable = function getRelativeFocusable(element, scope, useTabb
|
|
|
4154
4133
|
}
|
|
4155
4134
|
var shards = asArray(scope);
|
|
4156
4135
|
if (shards.every(function (shard) {
|
|
4157
|
-
return !
|
|
4136
|
+
return !_contains(shard, element);
|
|
4158
4137
|
})) {
|
|
4159
4138
|
console.error('Active element is not contained in the scope');
|
|
4160
4139
|
return {};
|
|
@@ -4770,9 +4749,9 @@ var handleScroll = function handleScroll(axis, endTarget, event, sourceDelta, no
|
|
|
4770
4749
|
// self content
|
|
4771
4750
|
targetInLock && (endTarget.contains(target) || endTarget === target));
|
|
4772
4751
|
// handle epsilon around 0 (non standard zoom levels)
|
|
4773
|
-
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || !noOverscroll
|
|
4752
|
+
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || !noOverscroll)) {
|
|
4774
4753
|
shouldCancelScroll = true;
|
|
4775
|
-
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || !noOverscroll
|
|
4754
|
+
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || !noOverscroll)) {
|
|
4776
4755
|
shouldCancelScroll = true;
|
|
4777
4756
|
}
|
|
4778
4757
|
return shouldCancelScroll;
|
|
@@ -4966,15 +4945,15 @@ var counterMap = new WeakMap();
|
|
|
4966
4945
|
var uncontrolledNodes = new WeakMap();
|
|
4967
4946
|
var markerMap = {};
|
|
4968
4947
|
var lockCount = 0;
|
|
4969
|
-
var
|
|
4970
|
-
return node && (node.host ||
|
|
4948
|
+
var _unwrapHost = function unwrapHost(node) {
|
|
4949
|
+
return node && (node.host || _unwrapHost(node.parentNode));
|
|
4971
4950
|
};
|
|
4972
4951
|
var correctTargets = function correctTargets(parent, targets) {
|
|
4973
4952
|
return targets.map(function (target) {
|
|
4974
4953
|
if (parent.contains(target)) {
|
|
4975
4954
|
return target;
|
|
4976
4955
|
}
|
|
4977
|
-
var correctedTarget =
|
|
4956
|
+
var correctedTarget = _unwrapHost(target);
|
|
4978
4957
|
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
4979
4958
|
return correctedTarget;
|
|
4980
4959
|
}
|
|
@@ -5001,21 +4980,21 @@ var applyAttributeToOthers = function applyAttributeToOthers(originalTarget, par
|
|
|
5001
4980
|
var hiddenNodes = [];
|
|
5002
4981
|
var elementsToKeep = new Set();
|
|
5003
4982
|
var elementsToStop = new Set(targets);
|
|
5004
|
-
var
|
|
4983
|
+
var _keep = function keep(el) {
|
|
5005
4984
|
if (!el || elementsToKeep.has(el)) {
|
|
5006
4985
|
return;
|
|
5007
4986
|
}
|
|
5008
4987
|
elementsToKeep.add(el);
|
|
5009
|
-
|
|
4988
|
+
_keep(el.parentNode);
|
|
5010
4989
|
};
|
|
5011
|
-
targets.forEach(
|
|
5012
|
-
var
|
|
4990
|
+
targets.forEach(_keep);
|
|
4991
|
+
var _deep = function deep(parent) {
|
|
5013
4992
|
if (!parent || elementsToStop.has(parent)) {
|
|
5014
4993
|
return;
|
|
5015
4994
|
}
|
|
5016
4995
|
Array.prototype.forEach.call(parent.children, function (node) {
|
|
5017
4996
|
if (elementsToKeep.has(node)) {
|
|
5018
|
-
|
|
4997
|
+
_deep(node);
|
|
5019
4998
|
} else {
|
|
5020
4999
|
var attr = node.getAttribute(controlAttribute);
|
|
5021
5000
|
var alreadyHidden = attr !== null && attr !== 'false';
|
|
@@ -5036,7 +5015,7 @@ var applyAttributeToOthers = function applyAttributeToOthers(originalTarget, par
|
|
|
5036
5015
|
}
|
|
5037
5016
|
});
|
|
5038
5017
|
};
|
|
5039
|
-
|
|
5018
|
+
_deep(parentNode);
|
|
5040
5019
|
elementsToKeep.clear();
|
|
5041
5020
|
lockCount++;
|
|
5042
5021
|
return function () {
|
|
@@ -5500,12 +5479,8 @@ var T = function T() {
|
|
|
5500
5479
|
return true;
|
|
5501
5480
|
};
|
|
5502
5481
|
|
|
5503
|
-
var _placeholder = {
|
|
5504
|
-
'@@functional/placeholder': true
|
|
5505
|
-
};
|
|
5506
|
-
|
|
5507
5482
|
function _isPlaceholder(a) {
|
|
5508
|
-
return a ===
|
|
5483
|
+
return a != null && _typeof$1(a) === 'object' && a['@@functional/placeholder'] === true;
|
|
5509
5484
|
}
|
|
5510
5485
|
|
|
5511
5486
|
/**
|
|
@@ -10167,7 +10142,7 @@ var Search20 = function Search20(_a) {
|
|
|
10167
10142
|
};
|
|
10168
10143
|
Search20.displayName = 'Search20';
|
|
10169
10144
|
|
|
10170
|
-
var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "value"];
|
|
10145
|
+
var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "noBorders", "value"];
|
|
10171
10146
|
var DEFAULT_INPUT_VALUE = '';
|
|
10172
10147
|
var SearchInput = function SearchInput(_ref) {
|
|
10173
10148
|
var className = _ref.className,
|
|
@@ -10175,6 +10150,8 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
10175
10150
|
onClear = _ref.onClear,
|
|
10176
10151
|
_ref$roundBorders = _ref.roundBorders,
|
|
10177
10152
|
roundBorders = _ref$roundBorders === void 0 ? false : _ref$roundBorders,
|
|
10153
|
+
_ref$noBorders = _ref.noBorders,
|
|
10154
|
+
noBorders = _ref$noBorders === void 0 ? false : _ref$noBorders,
|
|
10178
10155
|
_ref$value = _ref.value,
|
|
10179
10156
|
value = _ref$value === void 0 ? DEFAULT_INPUT_VALUE : _ref$value,
|
|
10180
10157
|
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
@@ -10203,7 +10180,8 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
10203
10180
|
className: "SearchInput__icon"
|
|
10204
10181
|
}, /*#__PURE__*/React__default.createElement(Search20, null)), /*#__PURE__*/React__default.createElement(TextInput, _extends$1({
|
|
10205
10182
|
className: classNames('SearchInput__input', {
|
|
10206
|
-
'SearchInput__input--round-borders': roundBorders
|
|
10183
|
+
'SearchInput__input--round-borders': roundBorders,
|
|
10184
|
+
'SearchInput__input--no-borders': noBorders
|
|
10207
10185
|
}),
|
|
10208
10186
|
onChange: handleChange,
|
|
10209
10187
|
value: controlledValue,
|