@oliasoft-open-source/react-ui-library 4.15.1-beta-11 → 4.15.1-beta-13
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.d.ts +2 -1
- package/dist/index.js +258 -273
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19559,6 +19559,7 @@ const OptionDropdown = ({
|
|
|
19559
19559
|
label: label2,
|
|
19560
19560
|
options,
|
|
19561
19561
|
onChange,
|
|
19562
|
+
small: small2 = false,
|
|
19562
19563
|
showHeader = true,
|
|
19563
19564
|
maxHeight = "40vh"
|
|
19564
19565
|
}) => {
|
|
@@ -19566,6 +19567,7 @@ const OptionDropdown = ({
|
|
|
19566
19567
|
Menu,
|
|
19567
19568
|
{
|
|
19568
19569
|
menu: {
|
|
19570
|
+
small: small2,
|
|
19569
19571
|
label: label2,
|
|
19570
19572
|
trigger: TriggerType.DROP_DOWN_BUTTON,
|
|
19571
19573
|
possiblePlacements: ["top-start", "bottom-start"],
|
|
@@ -19768,6 +19770,182 @@ const NativeSelect = ({
|
|
|
19768
19770
|
}
|
|
19769
19771
|
);
|
|
19770
19772
|
};
|
|
19773
|
+
var reactKeyboardEventHandler = { exports: {} };
|
|
19774
|
+
(function(module, exports) {
|
|
19775
|
+
!function(e2, t) {
|
|
19776
|
+
module.exports = t(React__default, PropTypes__default);
|
|
19777
|
+
}(window, function(e2, t) {
|
|
19778
|
+
return function(e3) {
|
|
19779
|
+
var t2 = {};
|
|
19780
|
+
function n2(r2) {
|
|
19781
|
+
if (t2[r2]) return t2[r2].exports;
|
|
19782
|
+
var o = t2[r2] = { i: r2, l: false, exports: {} };
|
|
19783
|
+
return e3[r2].call(o.exports, o, o.exports, n2), o.l = true, o.exports;
|
|
19784
|
+
}
|
|
19785
|
+
return n2.m = e3, n2.c = t2, n2.d = function(e4, t3, r2) {
|
|
19786
|
+
n2.o(e4, t3) || Object.defineProperty(e4, t3, { enumerable: true, get: r2 });
|
|
19787
|
+
}, n2.r = function(e4) {
|
|
19788
|
+
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e4, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e4, "__esModule", { value: true });
|
|
19789
|
+
}, n2.t = function(e4, t3) {
|
|
19790
|
+
if (1 & t3 && (e4 = n2(e4)), 8 & t3) return e4;
|
|
19791
|
+
if (4 & t3 && "object" == typeof e4 && e4 && e4.__esModule) return e4;
|
|
19792
|
+
var r2 = /* @__PURE__ */ Object.create(null);
|
|
19793
|
+
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) {
|
|
19794
|
+
return e4[t4];
|
|
19795
|
+
}).bind(null, o));
|
|
19796
|
+
return r2;
|
|
19797
|
+
}, n2.n = function(e4) {
|
|
19798
|
+
var t3 = e4 && e4.__esModule ? function() {
|
|
19799
|
+
return e4.default;
|
|
19800
|
+
} : function() {
|
|
19801
|
+
return e4;
|
|
19802
|
+
};
|
|
19803
|
+
return n2.d(t3, "a", t3), t3;
|
|
19804
|
+
}, n2.o = function(e4, t3) {
|
|
19805
|
+
return Object.prototype.hasOwnProperty.call(e4, t3);
|
|
19806
|
+
}, n2.p = "", n2(n2.s = 0);
|
|
19807
|
+
}([function(e3, t2, n2) {
|
|
19808
|
+
Object.defineProperty(t2, "__esModule", { value: true });
|
|
19809
|
+
var r2 = n2(1);
|
|
19810
|
+
Object.defineProperty(t2, "default", { enumerable: true, get: function() {
|
|
19811
|
+
return function(e4) {
|
|
19812
|
+
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
19813
|
+
}(r2).default;
|
|
19814
|
+
} }), e3.exports = t2.default;
|
|
19815
|
+
}, function(e3, t2, n2) {
|
|
19816
|
+
Object.defineProperty(t2, "__esModule", { value: true });
|
|
19817
|
+
var r2 = Object.assign || function(e4) {
|
|
19818
|
+
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
19819
|
+
var n3 = arguments[t3];
|
|
19820
|
+
for (var r3 in n3) Object.prototype.hasOwnProperty.call(n3, r3) && (e4[r3] = n3[r3]);
|
|
19821
|
+
}
|
|
19822
|
+
return e4;
|
|
19823
|
+
}, o = /* @__PURE__ */ function() {
|
|
19824
|
+
function e4(e5, t3) {
|
|
19825
|
+
for (var n3 = 0; n3 < t3.length; n3++) {
|
|
19826
|
+
var r3 = t3[n3];
|
|
19827
|
+
r3.enumerable = r3.enumerable || false, r3.configurable = true, "value" in r3 && (r3.writable = true), Object.defineProperty(e5, r3.key, r3);
|
|
19828
|
+
}
|
|
19829
|
+
}
|
|
19830
|
+
return function(t3, n3, r3) {
|
|
19831
|
+
return n3 && e4(t3.prototype, n3), r3 && e4(t3, r3), t3;
|
|
19832
|
+
};
|
|
19833
|
+
}(), i = l(n2(2)), u = l(n2(3)), a2 = n2(4);
|
|
19834
|
+
function l(e4) {
|
|
19835
|
+
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
19836
|
+
}
|
|
19837
|
+
var s = [], c2 = function(e4) {
|
|
19838
|
+
function t3(e5) {
|
|
19839
|
+
!function(e6, t4) {
|
|
19840
|
+
if (!(e6 instanceof t4)) throw new TypeError("Cannot call a class as a function");
|
|
19841
|
+
}(this, t3);
|
|
19842
|
+
var n3 = function(e6, t4) {
|
|
19843
|
+
if (!e6) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
19844
|
+
return !t4 || "object" != typeof t4 && "function" != typeof t4 ? e6 : t4;
|
|
19845
|
+
}(this, (t3.__proto__ || Object.getPrototypeOf(t3)).call(this, e5));
|
|
19846
|
+
return n3.handleKeyboardEvent = n3.handleKeyboardEvent.bind(n3), n3.registerExclusiveHandler = n3.registerExclusiveHandler.bind(n3), n3.deregisterExclusiveHandler = n3.deregisterExclusiveHandler.bind(n3), n3;
|
|
19847
|
+
}
|
|
19848
|
+
return function(e5, t4) {
|
|
19849
|
+
if ("function" != typeof t4 && null !== t4) throw new TypeError("Super expression must either be null or a function, not " + typeof t4);
|
|
19850
|
+
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);
|
|
19851
|
+
}(t3, i.default.Component), o(t3, [{ key: "componentDidMount", value: function() {
|
|
19852
|
+
document.addEventListener("keydown", this.handleKeyboardEvent, false), document.addEventListener("keyup", this.handleKeyboardEvent, false), document.addEventListener("keypress", this.handleKeyboardEvent, false);
|
|
19853
|
+
var e5 = this.props, t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
19854
|
+
t4 && !n3 && this.registerExclusiveHandler();
|
|
19855
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
19856
|
+
document.removeEventListener("keydown", this.handleKeyboardEvent, false), document.removeEventListener("keyup", this.handleKeyboardEvent, false), document.removeEventListener("keypress", this.handleKeyboardEvent, false), this.deregisterExclusiveHandler();
|
|
19857
|
+
} }, { key: "componentDidUpdate", value: function(e5) {
|
|
19858
|
+
var t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
19859
|
+
(this.props.isExclusive !== t4 || this.props.isDisabled !== n3) && (this.props.isExclusive && !this.props.isDisabled ? this.registerExclusiveHandler() : this.deregisterExclusiveHandler());
|
|
19860
|
+
} }, { key: "registerExclusiveHandler", value: function() {
|
|
19861
|
+
this.deregisterExclusiveHandler(), s.unshift(this);
|
|
19862
|
+
} }, { key: "deregisterExclusiveHandler", value: function() {
|
|
19863
|
+
var e5 = this;
|
|
19864
|
+
s.includes(this) && (s = s.filter(function(t4) {
|
|
19865
|
+
return t4 !== e5;
|
|
19866
|
+
}));
|
|
19867
|
+
} }, { key: "handleKeyboardEvent", value: function(e5) {
|
|
19868
|
+
var t4 = this.props, n3 = t4.isDisabled, r3 = t4.handleKeys, o2 = t4.onKeyEvent, i2 = t4.handleEventType, u2 = t4.children, l2 = t4.handleFocusableElements;
|
|
19869
|
+
if (n3) return false;
|
|
19870
|
+
if (!(i2 === e5.type)) return false;
|
|
19871
|
+
if (s.length > 0 && s[0] !== this) return false;
|
|
19872
|
+
var c3 = e5.target === document.body || l2, d2 = this.childrenContainer && this.childrenContainer.contains(e5.target);
|
|
19873
|
+
if (!(u2 ? d2 : c3)) return false;
|
|
19874
|
+
var f2 = (0, a2.findMatchedKey)(e5, r3);
|
|
19875
|
+
return !!f2 && (o2(f2, e5), true);
|
|
19876
|
+
} }, { key: "render", value: function() {
|
|
19877
|
+
var e5 = this, n3 = this.props.children, o2 = Object.assign({}, this.props), u2 = true, a3 = false, l2 = void 0;
|
|
19878
|
+
try {
|
|
19879
|
+
for (var s2, c3 = Object.keys(t3.propTypes)[Symbol.iterator](); !(u2 = (s2 = c3.next()).done); u2 = true) {
|
|
19880
|
+
delete o2[s2.value];
|
|
19881
|
+
}
|
|
19882
|
+
} catch (e6) {
|
|
19883
|
+
a3 = true, l2 = e6;
|
|
19884
|
+
} finally {
|
|
19885
|
+
try {
|
|
19886
|
+
!u2 && c3.return && c3.return();
|
|
19887
|
+
} finally {
|
|
19888
|
+
if (a3) throw l2;
|
|
19889
|
+
}
|
|
19890
|
+
}
|
|
19891
|
+
return n3 ? i.default.createElement("span", r2({ ref: function(t4) {
|
|
19892
|
+
e5.childrenContainer = t4;
|
|
19893
|
+
} }, o2), n3) : null;
|
|
19894
|
+
} }]), t3;
|
|
19895
|
+
}();
|
|
19896
|
+
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() {
|
|
19897
|
+
return null;
|
|
19898
|
+
} }, e3.exports = t2.default;
|
|
19899
|
+
}, function(t2, n2) {
|
|
19900
|
+
t2.exports = e2;
|
|
19901
|
+
}, function(e3, n2) {
|
|
19902
|
+
e3.exports = t;
|
|
19903
|
+
}, function(e3, t2, n2) {
|
|
19904
|
+
function r2(e4, t3, n3) {
|
|
19905
|
+
return t3 in e4 ? Object.defineProperty(e4, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e4[t3] = n3, e4;
|
|
19906
|
+
}
|
|
19907
|
+
Object.defineProperty(t2, "__esModule", { value: true }), t2.matchKeyEvent = p, t2.findMatchedKey = function(e4, t3) {
|
|
19908
|
+
var n3 = t3.map(function(e5) {
|
|
19909
|
+
var t4 = e5.toLowerCase(), n4 = f2[t4];
|
|
19910
|
+
return n4 || [e5];
|
|
19911
|
+
}).reduce(function(e5, t4) {
|
|
19912
|
+
return e5.concat(t4);
|
|
19913
|
+
}, []).find(function(t4) {
|
|
19914
|
+
return p(e4, t4);
|
|
19915
|
+
});
|
|
19916
|
+
!n3 && t3.includes("all") && (n3 = "other");
|
|
19917
|
+
return n3;
|
|
19918
|
+
};
|
|
19919
|
+
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) {
|
|
19920
|
+
return Object.assign(e4, r2({}, t3.toUpperCase(), o[t3]));
|
|
19921
|
+
}, {}), u = "0123456789".split("").reduce(function(e4, t3, n3) {
|
|
19922
|
+
return Object.assign(e4, r2({}, t3, [n3 + 48, n3 + 96]));
|
|
19923
|
+
}, {}), a2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce(function(e4, t3, n3) {
|
|
19924
|
+
return Object.assign(e4, r2({}, t3.toLowerCase(), [n3 + 65]), r2({}, t3, [n3 + 65]));
|
|
19925
|
+
}, {}), 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) {
|
|
19926
|
+
return Object.assign(e4, r2({}, "f" + t3, [n3 + 112]));
|
|
19927
|
+
}, {}), 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) };
|
|
19928
|
+
function p(e4, t3) {
|
|
19929
|
+
var n3 = e4.which || e4.keyCode, r3 = e4.type, o2 = Object.keys(s).filter(function(t4) {
|
|
19930
|
+
return e4[t4 + "Key"];
|
|
19931
|
+
}).sort(), i2 = t3.toLowerCase().trim(), u2 = "+" === i2 ? ["+"] : i2.split(/\s?\+\s?/), a3 = u2.pop(), l2 = c2[a3], d3 = u2;
|
|
19932
|
+
if ("keypress" === r3) return t3 == String.fromCharCode(n3).toLowerCase();
|
|
19933
|
+
if (0 === d3.length && 0 === o2.length) return l2.indexOf(n3) >= 0;
|
|
19934
|
+
if (d3.length > 0 && o2.length > 0) {
|
|
19935
|
+
var f3 = d3.map(function(e5) {
|
|
19936
|
+
return s[e5];
|
|
19937
|
+
}).sort(), p2 = f3.length === o2.length && f3.every(function(e5, t4) {
|
|
19938
|
+
return o2[t4] === e5;
|
|
19939
|
+
});
|
|
19940
|
+
return l2.indexOf(n3) >= 0 && p2;
|
|
19941
|
+
}
|
|
19942
|
+
return 0 == d3.length && 1 === o2.length && a3 === o2[0];
|
|
19943
|
+
}
|
|
19944
|
+
}]);
|
|
19945
|
+
});
|
|
19946
|
+
})(reactKeyboardEventHandler);
|
|
19947
|
+
var reactKeyboardEventHandlerExports = reactKeyboardEventHandler.exports;
|
|
19948
|
+
const KeyboardEventHandler = /* @__PURE__ */ getDefaultExportFromCjs(reactKeyboardEventHandlerExports);
|
|
19771
19949
|
const useFocus = () => {
|
|
19772
19950
|
const ref2 = useRef(null);
|
|
19773
19951
|
const setFocus = () => {
|
|
@@ -20471,12 +20649,10 @@ const Layer = ({
|
|
|
20471
20649
|
small: small2,
|
|
20472
20650
|
firstSelectedOptionIndex,
|
|
20473
20651
|
closeLayer,
|
|
20474
|
-
isMounted,
|
|
20475
20652
|
testId
|
|
20476
20653
|
}) => {
|
|
20477
20654
|
useEffect(() => {
|
|
20478
|
-
if (
|
|
20479
|
-
if (firstSelectedOptionIndex !== void 0 && firstSelectedOptionIndex !== null && listRef.current !== null && typeof listRef.current.scrollToItem === "function") {
|
|
20655
|
+
if (firstSelectedOptionIndex && firstSelectedOptionIndex !== null && listRef.current !== null) {
|
|
20480
20656
|
listRef.current.scrollToItem(firstSelectedOptionIndex, "start");
|
|
20481
20657
|
}
|
|
20482
20658
|
}, [firstSelectedOptionIndex, listRef]);
|
|
@@ -20712,7 +20888,6 @@ const Trigger = ({
|
|
|
20712
20888
|
maxTooltipWidth,
|
|
20713
20889
|
placeholder: placeholder3,
|
|
20714
20890
|
right: right2,
|
|
20715
|
-
isMounted,
|
|
20716
20891
|
testId
|
|
20717
20892
|
}) => {
|
|
20718
20893
|
var _a2;
|
|
@@ -20756,14 +20931,11 @@ const Trigger = ({
|
|
|
20756
20931
|
order2
|
|
20757
20932
|
),
|
|
20758
20933
|
onClick: (evt) => {
|
|
20759
|
-
|
|
20934
|
+
evt.stopPropagation();
|
|
20760
20935
|
if (typeof setInputFocus === "function") {
|
|
20761
|
-
|
|
20762
|
-
if (isMounted == null ? void 0 : isMounted.current) {
|
|
20763
|
-
setInputFocus();
|
|
20764
|
-
}
|
|
20765
|
-
});
|
|
20936
|
+
setInputFocus();
|
|
20766
20937
|
}
|
|
20938
|
+
onClickTrigger(evt);
|
|
20767
20939
|
},
|
|
20768
20940
|
onFocus,
|
|
20769
20941
|
onBlur,
|
|
@@ -21017,27 +21189,21 @@ const useCustomSelectLogic = ({
|
|
|
21017
21189
|
firstSelectedOptionIndex,
|
|
21018
21190
|
createAble,
|
|
21019
21191
|
listRef,
|
|
21020
|
-
autoLayerWidth
|
|
21021
|
-
isMounted
|
|
21192
|
+
autoLayerWidth
|
|
21022
21193
|
}) => {
|
|
21023
|
-
const safeDispatch = (action2) => {
|
|
21024
|
-
if (isMounted.current) {
|
|
21025
|
-
dispatch(action2);
|
|
21026
|
-
}
|
|
21027
|
-
};
|
|
21028
21194
|
const closeLayer = () => {
|
|
21029
21195
|
if (state.isLayerOpen) {
|
|
21030
|
-
|
|
21196
|
+
dispatch({ type: ActionTypes.CLOSE_LAYER });
|
|
21031
21197
|
}
|
|
21032
21198
|
setTriggerFocus();
|
|
21033
21199
|
};
|
|
21034
|
-
const openLayer = () =>
|
|
21200
|
+
const openLayer = () => dispatch({ type: ActionTypes.OPEN_LAYER });
|
|
21035
21201
|
const isFirstRun = useRef(true);
|
|
21036
21202
|
useEffect(() => {
|
|
21037
21203
|
if (isFirstRun.current) {
|
|
21038
21204
|
isFirstRun.current = false;
|
|
21039
21205
|
} else {
|
|
21040
|
-
|
|
21206
|
+
dispatch({ type: ActionTypes.SET_VISIBLE_OPTIONS, options });
|
|
21041
21207
|
}
|
|
21042
21208
|
}, [options]);
|
|
21043
21209
|
const onSelectOption = (evt, option2, close2) => {
|
|
@@ -21075,7 +21241,7 @@ const useCustomSelectLogic = ({
|
|
|
21075
21241
|
}
|
|
21076
21242
|
}
|
|
21077
21243
|
}
|
|
21078
|
-
|
|
21244
|
+
dispatch({ type: ActionTypes.CLEAR_SEARCH, options });
|
|
21079
21245
|
setTriggerFocus();
|
|
21080
21246
|
}
|
|
21081
21247
|
};
|
|
@@ -21111,7 +21277,7 @@ const useCustomSelectLogic = ({
|
|
|
21111
21277
|
closeLayer();
|
|
21112
21278
|
return;
|
|
21113
21279
|
}
|
|
21114
|
-
|
|
21280
|
+
dispatch({
|
|
21115
21281
|
type: ActionTypes.RESET_LAYER_FOCUS,
|
|
21116
21282
|
options,
|
|
21117
21283
|
firstSelectedOptionIndex
|
|
@@ -21124,7 +21290,7 @@ const useCustomSelectLogic = ({
|
|
|
21124
21290
|
isFirstRender.current = false;
|
|
21125
21291
|
} else {
|
|
21126
21292
|
if (!state.isLayerOpen) {
|
|
21127
|
-
|
|
21293
|
+
dispatch({ type: ActionTypes.CLEAR_SEARCH, options });
|
|
21128
21294
|
}
|
|
21129
21295
|
}
|
|
21130
21296
|
}, [state.isLayerOpen]);
|
|
@@ -21140,7 +21306,7 @@ const useCustomSelectLogic = ({
|
|
|
21140
21306
|
onChange(evt, newSelectedOptions);
|
|
21141
21307
|
}
|
|
21142
21308
|
};
|
|
21143
|
-
const onChangeSearch = (value) =>
|
|
21309
|
+
const onChangeSearch = (value) => dispatch({
|
|
21144
21310
|
type: ActionTypes.ON_CHANGE_SEARCH,
|
|
21145
21311
|
options,
|
|
21146
21312
|
value,
|
|
@@ -21148,7 +21314,7 @@ const useCustomSelectLogic = ({
|
|
|
21148
21314
|
});
|
|
21149
21315
|
const clickTrigger = () => {
|
|
21150
21316
|
openLayer();
|
|
21151
|
-
|
|
21317
|
+
dispatch({ type: ActionTypes.BLUR_TRIGGER_INPUTS });
|
|
21152
21318
|
};
|
|
21153
21319
|
const scrollToItem = (index2) => {
|
|
21154
21320
|
if (listRef.current && Number.isInteger(index2)) {
|
|
@@ -21157,14 +21323,11 @@ const useCustomSelectLogic = ({
|
|
|
21157
21323
|
};
|
|
21158
21324
|
const focusNextLayerOption = (ICustomSelectDirection2) => {
|
|
21159
21325
|
const next2 = nextLayerFocus(ICustomSelectDirection2, state.layerFocus);
|
|
21160
|
-
|
|
21161
|
-
type: ActionTypes.FOCUS_LAYER_OPTIONS,
|
|
21162
|
-
nextLayerFocus: next2
|
|
21163
|
-
});
|
|
21326
|
+
dispatch({ type: ActionTypes.FOCUS_LAYER_OPTIONS, nextLayerFocus: next2 });
|
|
21164
21327
|
scrollToItem(next2.current);
|
|
21165
21328
|
};
|
|
21166
21329
|
const focusTriggerInputs = (ICustomSelectDirection2) => {
|
|
21167
|
-
|
|
21330
|
+
dispatch({
|
|
21168
21331
|
type: ActionTypes.FOCUS_TRIGGER_INPUTS,
|
|
21169
21332
|
ICustomSelectDirection: ICustomSelectDirection2,
|
|
21170
21333
|
selectedOptions
|
|
@@ -21285,12 +21448,6 @@ const CustomSelect = (props) => {
|
|
|
21285
21448
|
isLayerOpen: false
|
|
21286
21449
|
})
|
|
21287
21450
|
);
|
|
21288
|
-
const isMounted = useRef(true);
|
|
21289
|
-
useEffect(() => {
|
|
21290
|
-
return () => {
|
|
21291
|
-
isMounted.current = false;
|
|
21292
|
-
};
|
|
21293
|
-
}, []);
|
|
21294
21451
|
const {
|
|
21295
21452
|
getTriggerWidth,
|
|
21296
21453
|
onKeyEvent,
|
|
@@ -21314,69 +21471,73 @@ const CustomSelect = (props) => {
|
|
|
21314
21471
|
disabledContext,
|
|
21315
21472
|
isFontLoaded,
|
|
21316
21473
|
createAble,
|
|
21317
|
-
listRef
|
|
21318
|
-
isMounted
|
|
21474
|
+
listRef
|
|
21319
21475
|
});
|
|
21320
|
-
return /* @__PURE__ */
|
|
21321
|
-
|
|
21322
|
-
|
|
21323
|
-
|
|
21324
|
-
|
|
21325
|
-
|
|
21326
|
-
|
|
21327
|
-
|
|
21328
|
-
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
|
|
21332
|
-
|
|
21333
|
-
|
|
21334
|
-
|
|
21335
|
-
|
|
21336
|
-
|
|
21337
|
-
|
|
21338
|
-
|
|
21339
|
-
|
|
21340
|
-
|
|
21341
|
-
|
|
21342
|
-
|
|
21343
|
-
|
|
21344
|
-
|
|
21345
|
-
|
|
21346
|
-
|
|
21347
|
-
|
|
21348
|
-
|
|
21349
|
-
|
|
21350
|
-
|
|
21351
|
-
|
|
21352
|
-
|
|
21353
|
-
|
|
21354
|
-
|
|
21355
|
-
|
|
21356
|
-
|
|
21357
|
-
|
|
21358
|
-
|
|
21359
|
-
|
|
21360
|
-
|
|
21361
|
-
|
|
21362
|
-
|
|
21363
|
-
|
|
21364
|
-
|
|
21365
|
-
|
|
21366
|
-
|
|
21367
|
-
|
|
21476
|
+
return /* @__PURE__ */ jsx("div", { style: { width: getTriggerWidth() }, children: /* @__PURE__ */ jsxs(
|
|
21477
|
+
KeyboardEventHandler,
|
|
21478
|
+
{
|
|
21479
|
+
handleKeys: Object.values(EventKey),
|
|
21480
|
+
onKeyEvent,
|
|
21481
|
+
children: [
|
|
21482
|
+
/* @__PURE__ */ jsx(
|
|
21483
|
+
Trigger,
|
|
21484
|
+
{
|
|
21485
|
+
selectedOptions,
|
|
21486
|
+
searchValue: state.searchValue,
|
|
21487
|
+
isOpen: state.isLayerOpen,
|
|
21488
|
+
focusedSelectedOptionIndex: state.triggerFocus.currentOption,
|
|
21489
|
+
clearAllIsFocused,
|
|
21490
|
+
searchable,
|
|
21491
|
+
triggerRef: mergeRefs(triggerRef, triggerProps.ref),
|
|
21492
|
+
error: error2,
|
|
21493
|
+
warning: warning2,
|
|
21494
|
+
tooltip: tooltip2,
|
|
21495
|
+
small: small2,
|
|
21496
|
+
isInTable: isInTable2,
|
|
21497
|
+
disabled: disabled2 || disabledContext,
|
|
21498
|
+
clearable,
|
|
21499
|
+
tabIndex,
|
|
21500
|
+
onClickTrigger,
|
|
21501
|
+
onChangeSearch,
|
|
21502
|
+
onClickDeselect: onClickDeselectOption,
|
|
21503
|
+
onClickClear: onClickClearAll,
|
|
21504
|
+
onFocus,
|
|
21505
|
+
onBlur,
|
|
21506
|
+
groupOrder,
|
|
21507
|
+
maxTooltipWidth,
|
|
21508
|
+
placeholder: placeholder3,
|
|
21509
|
+
right: right2,
|
|
21510
|
+
testId
|
|
21511
|
+
}
|
|
21512
|
+
),
|
|
21513
|
+
state.isLayerOpen && renderLayer(
|
|
21514
|
+
/* @__PURE__ */ jsx("div", { ...layerProps, className: styles$n.layerContainer, children: /* @__PURE__ */ jsx(
|
|
21515
|
+
Layer,
|
|
21516
|
+
{
|
|
21517
|
+
listRef,
|
|
21518
|
+
isMulti: isMulti2,
|
|
21519
|
+
sections: state.visibleOptions,
|
|
21520
|
+
selectedOptions,
|
|
21521
|
+
onSelectOption: (evt, option2) => {
|
|
21522
|
+
const close2 = !isMulti2 ? closeLayer : void 0;
|
|
21523
|
+
onSelectOption(evt, option2, close2);
|
|
21524
|
+
},
|
|
21525
|
+
closeLayer: () => {
|
|
21526
|
+
if (closeOnOptionActionClick) {
|
|
21527
|
+
closeLayer();
|
|
21528
|
+
}
|
|
21529
|
+
},
|
|
21530
|
+
width: getLayerWidth(triggerBounds),
|
|
21531
|
+
small: small2,
|
|
21532
|
+
focusedOptionIndex: state.layerFocus.current,
|
|
21533
|
+
firstSelectedOptionIndex: firstSelectedOptionIndex ?? 0,
|
|
21534
|
+
testId: testId && `${testId}-layer`
|
|
21368
21535
|
}
|
|
21369
|
-
}
|
|
21370
|
-
|
|
21371
|
-
|
|
21372
|
-
|
|
21373
|
-
|
|
21374
|
-
isMounted,
|
|
21375
|
-
testId: testId && `${testId}-layer`
|
|
21376
|
-
}
|
|
21377
|
-
) })
|
|
21378
|
-
)
|
|
21379
|
-
] });
|
|
21536
|
+
) })
|
|
21537
|
+
)
|
|
21538
|
+
]
|
|
21539
|
+
}
|
|
21540
|
+
) });
|
|
21380
21541
|
};
|
|
21381
21542
|
const isEmptyNullOrUndefined = (value) => value === null || value === void 0 || value === "";
|
|
21382
21543
|
const isMulti = (selectedOptions) => selectedOptions instanceof Array;
|
|
@@ -55476,182 +55637,6 @@ const roundNumberCosmetic = (value) => {
|
|
|
55476
55637
|
roundToPrecision(toNum(value), COSMETIC_ROUNDING_DEFAULT_PRECISION)
|
|
55477
55638
|
) : value;
|
|
55478
55639
|
};
|
|
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);
|
|
55655
55640
|
const getStringName$1 = (name2) => {
|
|
55656
55641
|
if (!name2) return "";
|
|
55657
55642
|
if (typeof name2 === "string") {
|