@oliasoft-open-source/react-ui-library 4.15.1-beta-9 → 4.15.1-beta-11
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/dist/index.js +270 -254
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19768,182 +19768,6 @@ const NativeSelect = ({
|
|
|
19768
19768
|
}
|
|
19769
19769
|
);
|
|
19770
19770
|
};
|
|
19771
|
-
var reactKeyboardEventHandler = { exports: {} };
|
|
19772
|
-
(function(module, exports) {
|
|
19773
|
-
!function(e2, t) {
|
|
19774
|
-
module.exports = t(React__default, PropTypes__default);
|
|
19775
|
-
}(window, function(e2, t) {
|
|
19776
|
-
return function(e3) {
|
|
19777
|
-
var t2 = {};
|
|
19778
|
-
function n2(r2) {
|
|
19779
|
-
if (t2[r2]) return t2[r2].exports;
|
|
19780
|
-
var o = t2[r2] = { i: r2, l: false, exports: {} };
|
|
19781
|
-
return e3[r2].call(o.exports, o, o.exports, n2), o.l = true, o.exports;
|
|
19782
|
-
}
|
|
19783
|
-
return n2.m = e3, n2.c = t2, n2.d = function(e4, t3, r2) {
|
|
19784
|
-
n2.o(e4, t3) || Object.defineProperty(e4, t3, { enumerable: true, get: r2 });
|
|
19785
|
-
}, n2.r = function(e4) {
|
|
19786
|
-
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e4, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e4, "__esModule", { value: true });
|
|
19787
|
-
}, n2.t = function(e4, t3) {
|
|
19788
|
-
if (1 & t3 && (e4 = n2(e4)), 8 & t3) return e4;
|
|
19789
|
-
if (4 & t3 && "object" == typeof e4 && e4 && e4.__esModule) return e4;
|
|
19790
|
-
var r2 = /* @__PURE__ */ Object.create(null);
|
|
19791
|
-
if (n2.r(r2), Object.defineProperty(r2, "default", { enumerable: true, value: e4 }), 2 & t3 && "string" != typeof e4) for (var o in e4) n2.d(r2, o, (function(t4) {
|
|
19792
|
-
return e4[t4];
|
|
19793
|
-
}).bind(null, o));
|
|
19794
|
-
return r2;
|
|
19795
|
-
}, n2.n = function(e4) {
|
|
19796
|
-
var t3 = e4 && e4.__esModule ? function() {
|
|
19797
|
-
return e4.default;
|
|
19798
|
-
} : function() {
|
|
19799
|
-
return e4;
|
|
19800
|
-
};
|
|
19801
|
-
return n2.d(t3, "a", t3), t3;
|
|
19802
|
-
}, n2.o = function(e4, t3) {
|
|
19803
|
-
return Object.prototype.hasOwnProperty.call(e4, t3);
|
|
19804
|
-
}, n2.p = "", n2(n2.s = 0);
|
|
19805
|
-
}([function(e3, t2, n2) {
|
|
19806
|
-
Object.defineProperty(t2, "__esModule", { value: true });
|
|
19807
|
-
var r2 = n2(1);
|
|
19808
|
-
Object.defineProperty(t2, "default", { enumerable: true, get: function() {
|
|
19809
|
-
return function(e4) {
|
|
19810
|
-
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
19811
|
-
}(r2).default;
|
|
19812
|
-
} }), e3.exports = t2.default;
|
|
19813
|
-
}, function(e3, t2, n2) {
|
|
19814
|
-
Object.defineProperty(t2, "__esModule", { value: true });
|
|
19815
|
-
var r2 = Object.assign || function(e4) {
|
|
19816
|
-
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
19817
|
-
var n3 = arguments[t3];
|
|
19818
|
-
for (var r3 in n3) Object.prototype.hasOwnProperty.call(n3, r3) && (e4[r3] = n3[r3]);
|
|
19819
|
-
}
|
|
19820
|
-
return e4;
|
|
19821
|
-
}, o = /* @__PURE__ */ function() {
|
|
19822
|
-
function e4(e5, t3) {
|
|
19823
|
-
for (var n3 = 0; n3 < t3.length; n3++) {
|
|
19824
|
-
var r3 = t3[n3];
|
|
19825
|
-
r3.enumerable = r3.enumerable || false, r3.configurable = true, "value" in r3 && (r3.writable = true), Object.defineProperty(e5, r3.key, r3);
|
|
19826
|
-
}
|
|
19827
|
-
}
|
|
19828
|
-
return function(t3, n3, r3) {
|
|
19829
|
-
return n3 && e4(t3.prototype, n3), r3 && e4(t3, r3), t3;
|
|
19830
|
-
};
|
|
19831
|
-
}(), i = l(n2(2)), u = l(n2(3)), a2 = n2(4);
|
|
19832
|
-
function l(e4) {
|
|
19833
|
-
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
19834
|
-
}
|
|
19835
|
-
var s = [], c2 = function(e4) {
|
|
19836
|
-
function t3(e5) {
|
|
19837
|
-
!function(e6, t4) {
|
|
19838
|
-
if (!(e6 instanceof t4)) throw new TypeError("Cannot call a class as a function");
|
|
19839
|
-
}(this, t3);
|
|
19840
|
-
var n3 = function(e6, t4) {
|
|
19841
|
-
if (!e6) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
19842
|
-
return !t4 || "object" != typeof t4 && "function" != typeof t4 ? e6 : t4;
|
|
19843
|
-
}(this, (t3.__proto__ || Object.getPrototypeOf(t3)).call(this, e5));
|
|
19844
|
-
return n3.handleKeyboardEvent = n3.handleKeyboardEvent.bind(n3), n3.registerExclusiveHandler = n3.registerExclusiveHandler.bind(n3), n3.deregisterExclusiveHandler = n3.deregisterExclusiveHandler.bind(n3), n3;
|
|
19845
|
-
}
|
|
19846
|
-
return function(e5, t4) {
|
|
19847
|
-
if ("function" != typeof t4 && null !== t4) throw new TypeError("Super expression must either be null or a function, not " + typeof t4);
|
|
19848
|
-
e5.prototype = Object.create(t4 && t4.prototype, { constructor: { value: e5, enumerable: false, writable: true, configurable: true } }), t4 && (Object.setPrototypeOf ? Object.setPrototypeOf(e5, t4) : e5.__proto__ = t4);
|
|
19849
|
-
}(t3, i.default.Component), o(t3, [{ key: "componentDidMount", value: function() {
|
|
19850
|
-
document.addEventListener("keydown", this.handleKeyboardEvent, false), document.addEventListener("keyup", this.handleKeyboardEvent, false), document.addEventListener("keypress", this.handleKeyboardEvent, false);
|
|
19851
|
-
var e5 = this.props, t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
19852
|
-
t4 && !n3 && this.registerExclusiveHandler();
|
|
19853
|
-
} }, { key: "componentWillUnmount", value: function() {
|
|
19854
|
-
document.removeEventListener("keydown", this.handleKeyboardEvent, false), document.removeEventListener("keyup", this.handleKeyboardEvent, false), document.removeEventListener("keypress", this.handleKeyboardEvent, false), this.deregisterExclusiveHandler();
|
|
19855
|
-
} }, { key: "componentDidUpdate", value: function(e5) {
|
|
19856
|
-
var t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
19857
|
-
(this.props.isExclusive !== t4 || this.props.isDisabled !== n3) && (this.props.isExclusive && !this.props.isDisabled ? this.registerExclusiveHandler() : this.deregisterExclusiveHandler());
|
|
19858
|
-
} }, { key: "registerExclusiveHandler", value: function() {
|
|
19859
|
-
this.deregisterExclusiveHandler(), s.unshift(this);
|
|
19860
|
-
} }, { key: "deregisterExclusiveHandler", value: function() {
|
|
19861
|
-
var e5 = this;
|
|
19862
|
-
s.includes(this) && (s = s.filter(function(t4) {
|
|
19863
|
-
return t4 !== e5;
|
|
19864
|
-
}));
|
|
19865
|
-
} }, { key: "handleKeyboardEvent", value: function(e5) {
|
|
19866
|
-
var t4 = this.props, n3 = t4.isDisabled, r3 = t4.handleKeys, o2 = t4.onKeyEvent, i2 = t4.handleEventType, u2 = t4.children, l2 = t4.handleFocusableElements;
|
|
19867
|
-
if (n3) return false;
|
|
19868
|
-
if (!(i2 === e5.type)) return false;
|
|
19869
|
-
if (s.length > 0 && s[0] !== this) return false;
|
|
19870
|
-
var c3 = e5.target === document.body || l2, d2 = this.childrenContainer && this.childrenContainer.contains(e5.target);
|
|
19871
|
-
if (!(u2 ? d2 : c3)) return false;
|
|
19872
|
-
var f2 = (0, a2.findMatchedKey)(e5, r3);
|
|
19873
|
-
return !!f2 && (o2(f2, e5), true);
|
|
19874
|
-
} }, { key: "render", value: function() {
|
|
19875
|
-
var e5 = this, n3 = this.props.children, o2 = Object.assign({}, this.props), u2 = true, a3 = false, l2 = void 0;
|
|
19876
|
-
try {
|
|
19877
|
-
for (var s2, c3 = Object.keys(t3.propTypes)[Symbol.iterator](); !(u2 = (s2 = c3.next()).done); u2 = true) {
|
|
19878
|
-
delete o2[s2.value];
|
|
19879
|
-
}
|
|
19880
|
-
} catch (e6) {
|
|
19881
|
-
a3 = true, l2 = e6;
|
|
19882
|
-
} finally {
|
|
19883
|
-
try {
|
|
19884
|
-
!u2 && c3.return && c3.return();
|
|
19885
|
-
} finally {
|
|
19886
|
-
if (a3) throw l2;
|
|
19887
|
-
}
|
|
19888
|
-
}
|
|
19889
|
-
return n3 ? i.default.createElement("span", r2({ ref: function(t4) {
|
|
19890
|
-
e5.childrenContainer = t4;
|
|
19891
|
-
} }, o2), n3) : null;
|
|
19892
|
-
} }]), t3;
|
|
19893
|
-
}();
|
|
19894
|
-
t2.default = c2, c2.propTypes = { handleKeys: u.default.array, handleEventType: u.default.oneOf(["keydown", "keyup", "keypress"]), handleFocusableElements: u.default.bool, onKeyEvent: u.default.func, isDisabled: u.default.bool, isExclusive: u.default.bool, children: u.default.any }, c2.defaultProps = { handleKeys: [], handleFocusableElements: false, handleEventType: "keydown", onKeyEvent: function() {
|
|
19895
|
-
return null;
|
|
19896
|
-
} }, e3.exports = t2.default;
|
|
19897
|
-
}, function(t2, n2) {
|
|
19898
|
-
t2.exports = e2;
|
|
19899
|
-
}, function(e3, n2) {
|
|
19900
|
-
e3.exports = t;
|
|
19901
|
-
}, function(e3, t2, n2) {
|
|
19902
|
-
function r2(e4, t3, n3) {
|
|
19903
|
-
return t3 in e4 ? Object.defineProperty(e4, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e4[t3] = n3, e4;
|
|
19904
|
-
}
|
|
19905
|
-
Object.defineProperty(t2, "__esModule", { value: true }), t2.matchKeyEvent = p, t2.findMatchedKey = function(e4, t3) {
|
|
19906
|
-
var n3 = t3.map(function(e5) {
|
|
19907
|
-
var t4 = e5.toLowerCase(), n4 = f2[t4];
|
|
19908
|
-
return n4 || [e5];
|
|
19909
|
-
}).reduce(function(e5, t4) {
|
|
19910
|
-
return e5.concat(t4);
|
|
19911
|
-
}, []).find(function(t4) {
|
|
19912
|
-
return p(e4, t4);
|
|
19913
|
-
});
|
|
19914
|
-
!n3 && t3.includes("all") && (n3 = "other");
|
|
19915
|
-
return n3;
|
|
19916
|
-
};
|
|
19917
|
-
var o = { backspace: [8], del: [46], delete: [46], ins: [45], insert: [45], tab: [9], enter: [13], return: [13], esc: [27], space: [32], pageup: [33], pagedown: [34], end: [35], home: [36], left: [37], up: [38], right: [39], down: [40], shift: [16], ctrl: [17], alt: [18], cap: [20], num: [144], clear: [12], meta: [91], ";": [186, 59], "=": [187, 61], ",": [188, 44], "-": [189, 45, 173, 109], minus: [189, 45, 173, 109], ".": [190, 110], "/": [191, 111], "`": [192], "[": [219], "\\": [220], "]": [221], "*": [106], "+": [107], plus: [107], "'": [222], quote: [222] }, i = Object.keys(o).reduce(function(e4, t3) {
|
|
19918
|
-
return Object.assign(e4, r2({}, t3.toUpperCase(), o[t3]));
|
|
19919
|
-
}, {}), u = "0123456789".split("").reduce(function(e4, t3, n3) {
|
|
19920
|
-
return Object.assign(e4, r2({}, t3, [n3 + 48, n3 + 96]));
|
|
19921
|
-
}, {}), a2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce(function(e4, t3, n3) {
|
|
19922
|
-
return Object.assign(e4, r2({}, t3.toLowerCase(), [n3 + 65]), r2({}, t3, [n3 + 65]));
|
|
19923
|
-
}, {}), l = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19".split(",").reduce(function(e4, t3, n3) {
|
|
19924
|
-
return Object.assign(e4, r2({}, "f" + t3, [n3 + 112]));
|
|
19925
|
-
}, {}), s = { control: "ctrl", ctrl: "ctrl", shift: "shift", meta: "meta", cmd: "meta", command: "meta", option: "alt", alt: "alt" }, c2 = t2.AllKeys = Object.assign({}, o, i, u, a2, l), d2 = Object.assign({}, u, a2), f2 = { all: Object.keys(c2), alphanumeric: Object.keys(d2), numeric: Object.keys(u), alphabetic: Object.keys(a2), function: Object.keys(l) };
|
|
19926
|
-
function p(e4, t3) {
|
|
19927
|
-
var n3 = e4.which || e4.keyCode, r3 = e4.type, o2 = Object.keys(s).filter(function(t4) {
|
|
19928
|
-
return e4[t4 + "Key"];
|
|
19929
|
-
}).sort(), i2 = t3.toLowerCase().trim(), u2 = "+" === i2 ? ["+"] : i2.split(/\s?\+\s?/), a3 = u2.pop(), l2 = c2[a3], d3 = u2;
|
|
19930
|
-
if ("keypress" === r3) return t3 == String.fromCharCode(n3).toLowerCase();
|
|
19931
|
-
if (0 === d3.length && 0 === o2.length) return l2.indexOf(n3) >= 0;
|
|
19932
|
-
if (d3.length > 0 && o2.length > 0) {
|
|
19933
|
-
var f3 = d3.map(function(e5) {
|
|
19934
|
-
return s[e5];
|
|
19935
|
-
}).sort(), p2 = f3.length === o2.length && f3.every(function(e5, t4) {
|
|
19936
|
-
return o2[t4] === e5;
|
|
19937
|
-
});
|
|
19938
|
-
return l2.indexOf(n3) >= 0 && p2;
|
|
19939
|
-
}
|
|
19940
|
-
return 0 == d3.length && 1 === o2.length && a3 === o2[0];
|
|
19941
|
-
}
|
|
19942
|
-
}]);
|
|
19943
|
-
});
|
|
19944
|
-
})(reactKeyboardEventHandler);
|
|
19945
|
-
var reactKeyboardEventHandlerExports = reactKeyboardEventHandler.exports;
|
|
19946
|
-
const KeyboardEventHandler = /* @__PURE__ */ getDefaultExportFromCjs(reactKeyboardEventHandlerExports);
|
|
19947
19771
|
const useFocus = () => {
|
|
19948
19772
|
const ref2 = useRef(null);
|
|
19949
19773
|
const setFocus = () => {
|
|
@@ -20647,10 +20471,12 @@ const Layer = ({
|
|
|
20647
20471
|
small: small2,
|
|
20648
20472
|
firstSelectedOptionIndex,
|
|
20649
20473
|
closeLayer,
|
|
20474
|
+
isMounted,
|
|
20650
20475
|
testId
|
|
20651
20476
|
}) => {
|
|
20652
20477
|
useEffect(() => {
|
|
20653
|
-
if (
|
|
20478
|
+
if (!isMounted.current) return;
|
|
20479
|
+
if (firstSelectedOptionIndex !== void 0 && firstSelectedOptionIndex !== null && listRef.current !== null && typeof listRef.current.scrollToItem === "function") {
|
|
20654
20480
|
listRef.current.scrollToItem(firstSelectedOptionIndex, "start");
|
|
20655
20481
|
}
|
|
20656
20482
|
}, [firstSelectedOptionIndex, listRef]);
|
|
@@ -20886,6 +20712,7 @@ const Trigger = ({
|
|
|
20886
20712
|
maxTooltipWidth,
|
|
20887
20713
|
placeholder: placeholder3,
|
|
20888
20714
|
right: right2,
|
|
20715
|
+
isMounted,
|
|
20889
20716
|
testId
|
|
20890
20717
|
}) => {
|
|
20891
20718
|
var _a2;
|
|
@@ -20932,7 +20759,9 @@ const Trigger = ({
|
|
|
20932
20759
|
onClickTrigger(evt);
|
|
20933
20760
|
if (typeof setInputFocus === "function") {
|
|
20934
20761
|
requestAnimationFrame(() => {
|
|
20935
|
-
|
|
20762
|
+
if (isMounted == null ? void 0 : isMounted.current) {
|
|
20763
|
+
setInputFocus();
|
|
20764
|
+
}
|
|
20936
20765
|
});
|
|
20937
20766
|
}
|
|
20938
20767
|
},
|
|
@@ -21188,21 +21017,27 @@ const useCustomSelectLogic = ({
|
|
|
21188
21017
|
firstSelectedOptionIndex,
|
|
21189
21018
|
createAble,
|
|
21190
21019
|
listRef,
|
|
21191
|
-
autoLayerWidth
|
|
21020
|
+
autoLayerWidth,
|
|
21021
|
+
isMounted
|
|
21192
21022
|
}) => {
|
|
21023
|
+
const safeDispatch = (action2) => {
|
|
21024
|
+
if (isMounted.current) {
|
|
21025
|
+
dispatch(action2);
|
|
21026
|
+
}
|
|
21027
|
+
};
|
|
21193
21028
|
const closeLayer = () => {
|
|
21194
21029
|
if (state.isLayerOpen) {
|
|
21195
|
-
|
|
21030
|
+
safeDispatch({ type: ActionTypes.CLOSE_LAYER });
|
|
21196
21031
|
}
|
|
21197
21032
|
setTriggerFocus();
|
|
21198
21033
|
};
|
|
21199
|
-
const openLayer = () =>
|
|
21034
|
+
const openLayer = () => safeDispatch({ type: ActionTypes.OPEN_LAYER });
|
|
21200
21035
|
const isFirstRun = useRef(true);
|
|
21201
21036
|
useEffect(() => {
|
|
21202
21037
|
if (isFirstRun.current) {
|
|
21203
21038
|
isFirstRun.current = false;
|
|
21204
21039
|
} else {
|
|
21205
|
-
|
|
21040
|
+
safeDispatch({ type: ActionTypes.SET_VISIBLE_OPTIONS, options });
|
|
21206
21041
|
}
|
|
21207
21042
|
}, [options]);
|
|
21208
21043
|
const onSelectOption = (evt, option2, close2) => {
|
|
@@ -21240,7 +21075,7 @@ const useCustomSelectLogic = ({
|
|
|
21240
21075
|
}
|
|
21241
21076
|
}
|
|
21242
21077
|
}
|
|
21243
|
-
|
|
21078
|
+
safeDispatch({ type: ActionTypes.CLEAR_SEARCH, options });
|
|
21244
21079
|
setTriggerFocus();
|
|
21245
21080
|
}
|
|
21246
21081
|
};
|
|
@@ -21276,7 +21111,7 @@ const useCustomSelectLogic = ({
|
|
|
21276
21111
|
closeLayer();
|
|
21277
21112
|
return;
|
|
21278
21113
|
}
|
|
21279
|
-
|
|
21114
|
+
safeDispatch({
|
|
21280
21115
|
type: ActionTypes.RESET_LAYER_FOCUS,
|
|
21281
21116
|
options,
|
|
21282
21117
|
firstSelectedOptionIndex
|
|
@@ -21289,7 +21124,7 @@ const useCustomSelectLogic = ({
|
|
|
21289
21124
|
isFirstRender.current = false;
|
|
21290
21125
|
} else {
|
|
21291
21126
|
if (!state.isLayerOpen) {
|
|
21292
|
-
|
|
21127
|
+
safeDispatch({ type: ActionTypes.CLEAR_SEARCH, options });
|
|
21293
21128
|
}
|
|
21294
21129
|
}
|
|
21295
21130
|
}, [state.isLayerOpen]);
|
|
@@ -21305,7 +21140,7 @@ const useCustomSelectLogic = ({
|
|
|
21305
21140
|
onChange(evt, newSelectedOptions);
|
|
21306
21141
|
}
|
|
21307
21142
|
};
|
|
21308
|
-
const onChangeSearch = (value) =>
|
|
21143
|
+
const onChangeSearch = (value) => safeDispatch({
|
|
21309
21144
|
type: ActionTypes.ON_CHANGE_SEARCH,
|
|
21310
21145
|
options,
|
|
21311
21146
|
value,
|
|
@@ -21313,7 +21148,7 @@ const useCustomSelectLogic = ({
|
|
|
21313
21148
|
});
|
|
21314
21149
|
const clickTrigger = () => {
|
|
21315
21150
|
openLayer();
|
|
21316
|
-
|
|
21151
|
+
safeDispatch({ type: ActionTypes.BLUR_TRIGGER_INPUTS });
|
|
21317
21152
|
};
|
|
21318
21153
|
const scrollToItem = (index2) => {
|
|
21319
21154
|
if (listRef.current && Number.isInteger(index2)) {
|
|
@@ -21322,11 +21157,14 @@ const useCustomSelectLogic = ({
|
|
|
21322
21157
|
};
|
|
21323
21158
|
const focusNextLayerOption = (ICustomSelectDirection2) => {
|
|
21324
21159
|
const next2 = nextLayerFocus(ICustomSelectDirection2, state.layerFocus);
|
|
21325
|
-
|
|
21160
|
+
safeDispatch({
|
|
21161
|
+
type: ActionTypes.FOCUS_LAYER_OPTIONS,
|
|
21162
|
+
nextLayerFocus: next2
|
|
21163
|
+
});
|
|
21326
21164
|
scrollToItem(next2.current);
|
|
21327
21165
|
};
|
|
21328
21166
|
const focusTriggerInputs = (ICustomSelectDirection2) => {
|
|
21329
|
-
|
|
21167
|
+
safeDispatch({
|
|
21330
21168
|
type: ActionTypes.FOCUS_TRIGGER_INPUTS,
|
|
21331
21169
|
ICustomSelectDirection: ICustomSelectDirection2,
|
|
21332
21170
|
selectedOptions
|
|
@@ -21447,6 +21285,12 @@ const CustomSelect = (props) => {
|
|
|
21447
21285
|
isLayerOpen: false
|
|
21448
21286
|
})
|
|
21449
21287
|
);
|
|
21288
|
+
const isMounted = useRef(true);
|
|
21289
|
+
useEffect(() => {
|
|
21290
|
+
return () => {
|
|
21291
|
+
isMounted.current = false;
|
|
21292
|
+
};
|
|
21293
|
+
}, []);
|
|
21450
21294
|
const {
|
|
21451
21295
|
getTriggerWidth,
|
|
21452
21296
|
onKeyEvent,
|
|
@@ -21470,73 +21314,69 @@ const CustomSelect = (props) => {
|
|
|
21470
21314
|
disabledContext,
|
|
21471
21315
|
isFontLoaded,
|
|
21472
21316
|
createAble,
|
|
21473
|
-
listRef
|
|
21317
|
+
listRef,
|
|
21318
|
+
isMounted
|
|
21474
21319
|
});
|
|
21475
|
-
return /* @__PURE__ */
|
|
21476
|
-
|
|
21477
|
-
|
|
21478
|
-
|
|
21479
|
-
|
|
21480
|
-
|
|
21481
|
-
|
|
21482
|
-
|
|
21483
|
-
|
|
21484
|
-
|
|
21485
|
-
|
|
21486
|
-
|
|
21487
|
-
|
|
21488
|
-
|
|
21489
|
-
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
|
|
21493
|
-
|
|
21494
|
-
|
|
21495
|
-
|
|
21496
|
-
|
|
21497
|
-
|
|
21498
|
-
|
|
21499
|
-
|
|
21500
|
-
|
|
21501
|
-
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
|
|
21510
|
-
|
|
21511
|
-
|
|
21512
|
-
|
|
21513
|
-
|
|
21514
|
-
|
|
21515
|
-
|
|
21516
|
-
|
|
21517
|
-
|
|
21518
|
-
|
|
21519
|
-
|
|
21520
|
-
|
|
21521
|
-
|
|
21522
|
-
|
|
21523
|
-
},
|
|
21524
|
-
closeLayer: () => {
|
|
21525
|
-
if (closeOnOptionActionClick) {
|
|
21526
|
-
closeLayer();
|
|
21527
|
-
}
|
|
21528
|
-
},
|
|
21529
|
-
width: getLayerWidth(triggerBounds),
|
|
21530
|
-
small: small2,
|
|
21531
|
-
focusedOptionIndex: state.layerFocus.current,
|
|
21532
|
-
firstSelectedOptionIndex: firstSelectedOptionIndex ?? 0,
|
|
21533
|
-
testId: testId && `${testId}-layer`
|
|
21320
|
+
return /* @__PURE__ */ jsxs("div", { style: { width: getTriggerWidth() }, children: [
|
|
21321
|
+
/* @__PURE__ */ jsx(
|
|
21322
|
+
Trigger,
|
|
21323
|
+
{
|
|
21324
|
+
selectedOptions,
|
|
21325
|
+
searchValue: state.searchValue,
|
|
21326
|
+
isOpen: state.isLayerOpen,
|
|
21327
|
+
focusedSelectedOptionIndex: state.triggerFocus.currentOption,
|
|
21328
|
+
clearAllIsFocused,
|
|
21329
|
+
searchable,
|
|
21330
|
+
triggerRef: mergeRefs(triggerRef, triggerProps.ref),
|
|
21331
|
+
error: error2,
|
|
21332
|
+
warning: warning2,
|
|
21333
|
+
tooltip: tooltip2,
|
|
21334
|
+
small: small2,
|
|
21335
|
+
isInTable: isInTable2,
|
|
21336
|
+
disabled: disabled2 || disabledContext,
|
|
21337
|
+
clearable,
|
|
21338
|
+
tabIndex,
|
|
21339
|
+
onClickTrigger,
|
|
21340
|
+
onChangeSearch,
|
|
21341
|
+
onClickDeselect: onClickDeselectOption,
|
|
21342
|
+
onClickClear: onClickClearAll,
|
|
21343
|
+
onFocus,
|
|
21344
|
+
onBlur,
|
|
21345
|
+
groupOrder,
|
|
21346
|
+
maxTooltipWidth,
|
|
21347
|
+
placeholder: placeholder3,
|
|
21348
|
+
right: right2,
|
|
21349
|
+
testId,
|
|
21350
|
+
isMounted
|
|
21351
|
+
}
|
|
21352
|
+
),
|
|
21353
|
+
state.isLayerOpen && renderLayer(
|
|
21354
|
+
/* @__PURE__ */ jsx("div", { ...layerProps, className: styles$n.layerContainer, children: /* @__PURE__ */ jsx(
|
|
21355
|
+
Layer,
|
|
21356
|
+
{
|
|
21357
|
+
listRef,
|
|
21358
|
+
isMulti: isMulti2,
|
|
21359
|
+
sections: state.visibleOptions,
|
|
21360
|
+
selectedOptions,
|
|
21361
|
+
onSelectOption: (evt, option2) => {
|
|
21362
|
+
const close2 = !isMulti2 ? closeLayer : void 0;
|
|
21363
|
+
onSelectOption(evt, option2, close2);
|
|
21364
|
+
},
|
|
21365
|
+
closeLayer: () => {
|
|
21366
|
+
if (closeOnOptionActionClick) {
|
|
21367
|
+
closeLayer();
|
|
21534
21368
|
}
|
|
21535
|
-
|
|
21536
|
-
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21369
|
+
},
|
|
21370
|
+
width: getLayerWidth(triggerBounds),
|
|
21371
|
+
small: small2,
|
|
21372
|
+
focusedOptionIndex: state.layerFocus.current,
|
|
21373
|
+
firstSelectedOptionIndex: firstSelectedOptionIndex ?? 0,
|
|
21374
|
+
isMounted,
|
|
21375
|
+
testId: testId && `${testId}-layer`
|
|
21376
|
+
}
|
|
21377
|
+
) })
|
|
21378
|
+
)
|
|
21379
|
+
] });
|
|
21540
21380
|
};
|
|
21541
21381
|
const isEmptyNullOrUndefined = (value) => value === null || value === void 0 || value === "";
|
|
21542
21382
|
const isMulti = (selectedOptions) => selectedOptions instanceof Array;
|
|
@@ -55636,6 +55476,182 @@ const roundNumberCosmetic = (value) => {
|
|
|
55636
55476
|
roundToPrecision(toNum(value), COSMETIC_ROUNDING_DEFAULT_PRECISION)
|
|
55637
55477
|
) : value;
|
|
55638
55478
|
};
|
|
55479
|
+
var reactKeyboardEventHandler = { exports: {} };
|
|
55480
|
+
(function(module, exports) {
|
|
55481
|
+
!function(e2, t) {
|
|
55482
|
+
module.exports = t(React__default, PropTypes__default);
|
|
55483
|
+
}(window, function(e2, t) {
|
|
55484
|
+
return function(e3) {
|
|
55485
|
+
var t2 = {};
|
|
55486
|
+
function n2(r2) {
|
|
55487
|
+
if (t2[r2]) return t2[r2].exports;
|
|
55488
|
+
var o = t2[r2] = { i: r2, l: false, exports: {} };
|
|
55489
|
+
return e3[r2].call(o.exports, o, o.exports, n2), o.l = true, o.exports;
|
|
55490
|
+
}
|
|
55491
|
+
return n2.m = e3, n2.c = t2, n2.d = function(e4, t3, r2) {
|
|
55492
|
+
n2.o(e4, t3) || Object.defineProperty(e4, t3, { enumerable: true, get: r2 });
|
|
55493
|
+
}, n2.r = function(e4) {
|
|
55494
|
+
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e4, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e4, "__esModule", { value: true });
|
|
55495
|
+
}, n2.t = function(e4, t3) {
|
|
55496
|
+
if (1 & t3 && (e4 = n2(e4)), 8 & t3) return e4;
|
|
55497
|
+
if (4 & t3 && "object" == typeof e4 && e4 && e4.__esModule) return e4;
|
|
55498
|
+
var r2 = /* @__PURE__ */ Object.create(null);
|
|
55499
|
+
if (n2.r(r2), Object.defineProperty(r2, "default", { enumerable: true, value: e4 }), 2 & t3 && "string" != typeof e4) for (var o in e4) n2.d(r2, o, (function(t4) {
|
|
55500
|
+
return e4[t4];
|
|
55501
|
+
}).bind(null, o));
|
|
55502
|
+
return r2;
|
|
55503
|
+
}, n2.n = function(e4) {
|
|
55504
|
+
var t3 = e4 && e4.__esModule ? function() {
|
|
55505
|
+
return e4.default;
|
|
55506
|
+
} : function() {
|
|
55507
|
+
return e4;
|
|
55508
|
+
};
|
|
55509
|
+
return n2.d(t3, "a", t3), t3;
|
|
55510
|
+
}, n2.o = function(e4, t3) {
|
|
55511
|
+
return Object.prototype.hasOwnProperty.call(e4, t3);
|
|
55512
|
+
}, n2.p = "", n2(n2.s = 0);
|
|
55513
|
+
}([function(e3, t2, n2) {
|
|
55514
|
+
Object.defineProperty(t2, "__esModule", { value: true });
|
|
55515
|
+
var r2 = n2(1);
|
|
55516
|
+
Object.defineProperty(t2, "default", { enumerable: true, get: function() {
|
|
55517
|
+
return function(e4) {
|
|
55518
|
+
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
55519
|
+
}(r2).default;
|
|
55520
|
+
} }), e3.exports = t2.default;
|
|
55521
|
+
}, function(e3, t2, n2) {
|
|
55522
|
+
Object.defineProperty(t2, "__esModule", { value: true });
|
|
55523
|
+
var r2 = Object.assign || function(e4) {
|
|
55524
|
+
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
55525
|
+
var n3 = arguments[t3];
|
|
55526
|
+
for (var r3 in n3) Object.prototype.hasOwnProperty.call(n3, r3) && (e4[r3] = n3[r3]);
|
|
55527
|
+
}
|
|
55528
|
+
return e4;
|
|
55529
|
+
}, o = /* @__PURE__ */ function() {
|
|
55530
|
+
function e4(e5, t3) {
|
|
55531
|
+
for (var n3 = 0; n3 < t3.length; n3++) {
|
|
55532
|
+
var r3 = t3[n3];
|
|
55533
|
+
r3.enumerable = r3.enumerable || false, r3.configurable = true, "value" in r3 && (r3.writable = true), Object.defineProperty(e5, r3.key, r3);
|
|
55534
|
+
}
|
|
55535
|
+
}
|
|
55536
|
+
return function(t3, n3, r3) {
|
|
55537
|
+
return n3 && e4(t3.prototype, n3), r3 && e4(t3, r3), t3;
|
|
55538
|
+
};
|
|
55539
|
+
}(), i = l(n2(2)), u = l(n2(3)), a2 = n2(4);
|
|
55540
|
+
function l(e4) {
|
|
55541
|
+
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
55542
|
+
}
|
|
55543
|
+
var s = [], c2 = function(e4) {
|
|
55544
|
+
function t3(e5) {
|
|
55545
|
+
!function(e6, t4) {
|
|
55546
|
+
if (!(e6 instanceof t4)) throw new TypeError("Cannot call a class as a function");
|
|
55547
|
+
}(this, t3);
|
|
55548
|
+
var n3 = function(e6, t4) {
|
|
55549
|
+
if (!e6) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
55550
|
+
return !t4 || "object" != typeof t4 && "function" != typeof t4 ? e6 : t4;
|
|
55551
|
+
}(this, (t3.__proto__ || Object.getPrototypeOf(t3)).call(this, e5));
|
|
55552
|
+
return n3.handleKeyboardEvent = n3.handleKeyboardEvent.bind(n3), n3.registerExclusiveHandler = n3.registerExclusiveHandler.bind(n3), n3.deregisterExclusiveHandler = n3.deregisterExclusiveHandler.bind(n3), n3;
|
|
55553
|
+
}
|
|
55554
|
+
return function(e5, t4) {
|
|
55555
|
+
if ("function" != typeof t4 && null !== t4) throw new TypeError("Super expression must either be null or a function, not " + typeof t4);
|
|
55556
|
+
e5.prototype = Object.create(t4 && t4.prototype, { constructor: { value: e5, enumerable: false, writable: true, configurable: true } }), t4 && (Object.setPrototypeOf ? Object.setPrototypeOf(e5, t4) : e5.__proto__ = t4);
|
|
55557
|
+
}(t3, i.default.Component), o(t3, [{ key: "componentDidMount", value: function() {
|
|
55558
|
+
document.addEventListener("keydown", this.handleKeyboardEvent, false), document.addEventListener("keyup", this.handleKeyboardEvent, false), document.addEventListener("keypress", this.handleKeyboardEvent, false);
|
|
55559
|
+
var e5 = this.props, t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
55560
|
+
t4 && !n3 && this.registerExclusiveHandler();
|
|
55561
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
55562
|
+
document.removeEventListener("keydown", this.handleKeyboardEvent, false), document.removeEventListener("keyup", this.handleKeyboardEvent, false), document.removeEventListener("keypress", this.handleKeyboardEvent, false), this.deregisterExclusiveHandler();
|
|
55563
|
+
} }, { key: "componentDidUpdate", value: function(e5) {
|
|
55564
|
+
var t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
55565
|
+
(this.props.isExclusive !== t4 || this.props.isDisabled !== n3) && (this.props.isExclusive && !this.props.isDisabled ? this.registerExclusiveHandler() : this.deregisterExclusiveHandler());
|
|
55566
|
+
} }, { key: "registerExclusiveHandler", value: function() {
|
|
55567
|
+
this.deregisterExclusiveHandler(), s.unshift(this);
|
|
55568
|
+
} }, { key: "deregisterExclusiveHandler", value: function() {
|
|
55569
|
+
var e5 = this;
|
|
55570
|
+
s.includes(this) && (s = s.filter(function(t4) {
|
|
55571
|
+
return t4 !== e5;
|
|
55572
|
+
}));
|
|
55573
|
+
} }, { key: "handleKeyboardEvent", value: function(e5) {
|
|
55574
|
+
var t4 = this.props, n3 = t4.isDisabled, r3 = t4.handleKeys, o2 = t4.onKeyEvent, i2 = t4.handleEventType, u2 = t4.children, l2 = t4.handleFocusableElements;
|
|
55575
|
+
if (n3) return false;
|
|
55576
|
+
if (!(i2 === e5.type)) return false;
|
|
55577
|
+
if (s.length > 0 && s[0] !== this) return false;
|
|
55578
|
+
var c3 = e5.target === document.body || l2, d2 = this.childrenContainer && this.childrenContainer.contains(e5.target);
|
|
55579
|
+
if (!(u2 ? d2 : c3)) return false;
|
|
55580
|
+
var f2 = (0, a2.findMatchedKey)(e5, r3);
|
|
55581
|
+
return !!f2 && (o2(f2, e5), true);
|
|
55582
|
+
} }, { key: "render", value: function() {
|
|
55583
|
+
var e5 = this, n3 = this.props.children, o2 = Object.assign({}, this.props), u2 = true, a3 = false, l2 = void 0;
|
|
55584
|
+
try {
|
|
55585
|
+
for (var s2, c3 = Object.keys(t3.propTypes)[Symbol.iterator](); !(u2 = (s2 = c3.next()).done); u2 = true) {
|
|
55586
|
+
delete o2[s2.value];
|
|
55587
|
+
}
|
|
55588
|
+
} catch (e6) {
|
|
55589
|
+
a3 = true, l2 = e6;
|
|
55590
|
+
} finally {
|
|
55591
|
+
try {
|
|
55592
|
+
!u2 && c3.return && c3.return();
|
|
55593
|
+
} finally {
|
|
55594
|
+
if (a3) throw l2;
|
|
55595
|
+
}
|
|
55596
|
+
}
|
|
55597
|
+
return n3 ? i.default.createElement("span", r2({ ref: function(t4) {
|
|
55598
|
+
e5.childrenContainer = t4;
|
|
55599
|
+
} }, o2), n3) : null;
|
|
55600
|
+
} }]), t3;
|
|
55601
|
+
}();
|
|
55602
|
+
t2.default = c2, c2.propTypes = { handleKeys: u.default.array, handleEventType: u.default.oneOf(["keydown", "keyup", "keypress"]), handleFocusableElements: u.default.bool, onKeyEvent: u.default.func, isDisabled: u.default.bool, isExclusive: u.default.bool, children: u.default.any }, c2.defaultProps = { handleKeys: [], handleFocusableElements: false, handleEventType: "keydown", onKeyEvent: function() {
|
|
55603
|
+
return null;
|
|
55604
|
+
} }, e3.exports = t2.default;
|
|
55605
|
+
}, function(t2, n2) {
|
|
55606
|
+
t2.exports = e2;
|
|
55607
|
+
}, function(e3, n2) {
|
|
55608
|
+
e3.exports = t;
|
|
55609
|
+
}, function(e3, t2, n2) {
|
|
55610
|
+
function r2(e4, t3, n3) {
|
|
55611
|
+
return t3 in e4 ? Object.defineProperty(e4, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e4[t3] = n3, e4;
|
|
55612
|
+
}
|
|
55613
|
+
Object.defineProperty(t2, "__esModule", { value: true }), t2.matchKeyEvent = p, t2.findMatchedKey = function(e4, t3) {
|
|
55614
|
+
var n3 = t3.map(function(e5) {
|
|
55615
|
+
var t4 = e5.toLowerCase(), n4 = f2[t4];
|
|
55616
|
+
return n4 || [e5];
|
|
55617
|
+
}).reduce(function(e5, t4) {
|
|
55618
|
+
return e5.concat(t4);
|
|
55619
|
+
}, []).find(function(t4) {
|
|
55620
|
+
return p(e4, t4);
|
|
55621
|
+
});
|
|
55622
|
+
!n3 && t3.includes("all") && (n3 = "other");
|
|
55623
|
+
return n3;
|
|
55624
|
+
};
|
|
55625
|
+
var o = { backspace: [8], del: [46], delete: [46], ins: [45], insert: [45], tab: [9], enter: [13], return: [13], esc: [27], space: [32], pageup: [33], pagedown: [34], end: [35], home: [36], left: [37], up: [38], right: [39], down: [40], shift: [16], ctrl: [17], alt: [18], cap: [20], num: [144], clear: [12], meta: [91], ";": [186, 59], "=": [187, 61], ",": [188, 44], "-": [189, 45, 173, 109], minus: [189, 45, 173, 109], ".": [190, 110], "/": [191, 111], "`": [192], "[": [219], "\\": [220], "]": [221], "*": [106], "+": [107], plus: [107], "'": [222], quote: [222] }, i = Object.keys(o).reduce(function(e4, t3) {
|
|
55626
|
+
return Object.assign(e4, r2({}, t3.toUpperCase(), o[t3]));
|
|
55627
|
+
}, {}), u = "0123456789".split("").reduce(function(e4, t3, n3) {
|
|
55628
|
+
return Object.assign(e4, r2({}, t3, [n3 + 48, n3 + 96]));
|
|
55629
|
+
}, {}), a2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce(function(e4, t3, n3) {
|
|
55630
|
+
return Object.assign(e4, r2({}, t3.toLowerCase(), [n3 + 65]), r2({}, t3, [n3 + 65]));
|
|
55631
|
+
}, {}), l = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19".split(",").reduce(function(e4, t3, n3) {
|
|
55632
|
+
return Object.assign(e4, r2({}, "f" + t3, [n3 + 112]));
|
|
55633
|
+
}, {}), s = { control: "ctrl", ctrl: "ctrl", shift: "shift", meta: "meta", cmd: "meta", command: "meta", option: "alt", alt: "alt" }, c2 = t2.AllKeys = Object.assign({}, o, i, u, a2, l), d2 = Object.assign({}, u, a2), f2 = { all: Object.keys(c2), alphanumeric: Object.keys(d2), numeric: Object.keys(u), alphabetic: Object.keys(a2), function: Object.keys(l) };
|
|
55634
|
+
function p(e4, t3) {
|
|
55635
|
+
var n3 = e4.which || e4.keyCode, r3 = e4.type, o2 = Object.keys(s).filter(function(t4) {
|
|
55636
|
+
return e4[t4 + "Key"];
|
|
55637
|
+
}).sort(), i2 = t3.toLowerCase().trim(), u2 = "+" === i2 ? ["+"] : i2.split(/\s?\+\s?/), a3 = u2.pop(), l2 = c2[a3], d3 = u2;
|
|
55638
|
+
if ("keypress" === r3) return t3 == String.fromCharCode(n3).toLowerCase();
|
|
55639
|
+
if (0 === d3.length && 0 === o2.length) return l2.indexOf(n3) >= 0;
|
|
55640
|
+
if (d3.length > 0 && o2.length > 0) {
|
|
55641
|
+
var f3 = d3.map(function(e5) {
|
|
55642
|
+
return s[e5];
|
|
55643
|
+
}).sort(), p2 = f3.length === o2.length && f3.every(function(e5, t4) {
|
|
55644
|
+
return o2[t4] === e5;
|
|
55645
|
+
});
|
|
55646
|
+
return l2.indexOf(n3) >= 0 && p2;
|
|
55647
|
+
}
|
|
55648
|
+
return 0 == d3.length && 1 === o2.length && a3 === o2[0];
|
|
55649
|
+
}
|
|
55650
|
+
}]);
|
|
55651
|
+
});
|
|
55652
|
+
})(reactKeyboardEventHandler);
|
|
55653
|
+
var reactKeyboardEventHandlerExports = reactKeyboardEventHandler.exports;
|
|
55654
|
+
const KeyboardEventHandler = /* @__PURE__ */ getDefaultExportFromCjs(reactKeyboardEventHandlerExports);
|
|
55639
55655
|
const getStringName$1 = (name2) => {
|
|
55640
55656
|
if (!name2) return "";
|
|
55641
55657
|
if (typeof name2 === "string") {
|