@oliasoft-open-source/react-ui-library 4.20.8 → 4.20.9
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 +3 -1
- package/dist/index.js +111 -284
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { FocusEventHandler } from 'react';
|
|
|
9
9
|
import { Id } from 'react-toastify';
|
|
10
10
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
11
|
import { KeyboardEvent as KeyboardEvent_2 } from 'react';
|
|
12
|
+
import { KeyboardEventHandler } from 'react';
|
|
12
13
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
13
14
|
import { MouseEventHandler } from 'react';
|
|
14
15
|
import { MutableRefObject } from 'react';
|
|
@@ -528,10 +529,11 @@ export declare interface IInputProps {
|
|
|
528
529
|
name?: string;
|
|
529
530
|
type?: string;
|
|
530
531
|
onChange?: TChangeEventHandler;
|
|
531
|
-
onKeyPress?:
|
|
532
|
+
onKeyPress?: KeyboardEventHandler<HTMLInputElement>;
|
|
532
533
|
onFocus?: (evt: FocusEvent_2<HTMLInputElement>) => void;
|
|
533
534
|
onBlur?: (evt: FocusEvent_2<HTMLInputElement>) => void;
|
|
534
535
|
onPaste?: default_2.ClipboardEventHandler<HTMLInputElement>;
|
|
536
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
535
537
|
selectOnFocus?: boolean;
|
|
536
538
|
small?: boolean;
|
|
537
539
|
placeholder?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -9092,6 +9092,8 @@ const Input$1 = forwardRef(
|
|
|
9092
9092
|
},
|
|
9093
9093
|
onPaste = () => {
|
|
9094
9094
|
},
|
|
9095
|
+
onKeyDown = () => {
|
|
9096
|
+
},
|
|
9095
9097
|
selectOnFocus = true,
|
|
9096
9098
|
name: name2 = void 0,
|
|
9097
9099
|
type = "text",
|
|
@@ -9146,6 +9148,7 @@ const Input$1 = forwardRef(
|
|
|
9146
9148
|
value: value ?? "",
|
|
9147
9149
|
onChange,
|
|
9148
9150
|
onKeyPress,
|
|
9151
|
+
onKeyDown,
|
|
9149
9152
|
onFocus: handleFocus,
|
|
9150
9153
|
onBlur,
|
|
9151
9154
|
onPaste,
|
|
@@ -9807,9 +9810,9 @@ function isKeyboardEvent(event) {
|
|
|
9807
9810
|
return false;
|
|
9808
9811
|
}
|
|
9809
9812
|
const {
|
|
9810
|
-
KeyboardEvent
|
|
9813
|
+
KeyboardEvent
|
|
9811
9814
|
} = getWindow(event.target);
|
|
9812
|
-
return
|
|
9815
|
+
return KeyboardEvent && event instanceof KeyboardEvent;
|
|
9813
9816
|
}
|
|
9814
9817
|
function isTouchEvent$2(event) {
|
|
9815
9818
|
if (!event) {
|
|
@@ -15495,182 +15498,6 @@ const NativeSelect = ({
|
|
|
15495
15498
|
}
|
|
15496
15499
|
);
|
|
15497
15500
|
};
|
|
15498
|
-
var reactKeyboardEventHandler = { exports: {} };
|
|
15499
|
-
(function(module, exports) {
|
|
15500
|
-
!function(e2, t) {
|
|
15501
|
-
module.exports = t(React__default, PropTypes__default);
|
|
15502
|
-
}(window, function(e2, t) {
|
|
15503
|
-
return function(e3) {
|
|
15504
|
-
var t2 = {};
|
|
15505
|
-
function n2(r2) {
|
|
15506
|
-
if (t2[r2]) return t2[r2].exports;
|
|
15507
|
-
var o = t2[r2] = { i: r2, l: false, exports: {} };
|
|
15508
|
-
return e3[r2].call(o.exports, o, o.exports, n2), o.l = true, o.exports;
|
|
15509
|
-
}
|
|
15510
|
-
return n2.m = e3, n2.c = t2, n2.d = function(e4, t3, r2) {
|
|
15511
|
-
n2.o(e4, t3) || Object.defineProperty(e4, t3, { enumerable: true, get: r2 });
|
|
15512
|
-
}, n2.r = function(e4) {
|
|
15513
|
-
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e4, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e4, "__esModule", { value: true });
|
|
15514
|
-
}, n2.t = function(e4, t3) {
|
|
15515
|
-
if (1 & t3 && (e4 = n2(e4)), 8 & t3) return e4;
|
|
15516
|
-
if (4 & t3 && "object" == typeof e4 && e4 && e4.__esModule) return e4;
|
|
15517
|
-
var r2 = /* @__PURE__ */ Object.create(null);
|
|
15518
|
-
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) {
|
|
15519
|
-
return e4[t4];
|
|
15520
|
-
}).bind(null, o));
|
|
15521
|
-
return r2;
|
|
15522
|
-
}, n2.n = function(e4) {
|
|
15523
|
-
var t3 = e4 && e4.__esModule ? function() {
|
|
15524
|
-
return e4.default;
|
|
15525
|
-
} : function() {
|
|
15526
|
-
return e4;
|
|
15527
|
-
};
|
|
15528
|
-
return n2.d(t3, "a", t3), t3;
|
|
15529
|
-
}, n2.o = function(e4, t3) {
|
|
15530
|
-
return Object.prototype.hasOwnProperty.call(e4, t3);
|
|
15531
|
-
}, n2.p = "", n2(n2.s = 0);
|
|
15532
|
-
}([function(e3, t2, n2) {
|
|
15533
|
-
Object.defineProperty(t2, "__esModule", { value: true });
|
|
15534
|
-
var r2 = n2(1);
|
|
15535
|
-
Object.defineProperty(t2, "default", { enumerable: true, get: function() {
|
|
15536
|
-
return function(e4) {
|
|
15537
|
-
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
15538
|
-
}(r2).default;
|
|
15539
|
-
} }), e3.exports = t2.default;
|
|
15540
|
-
}, function(e3, t2, n2) {
|
|
15541
|
-
Object.defineProperty(t2, "__esModule", { value: true });
|
|
15542
|
-
var r2 = Object.assign || function(e4) {
|
|
15543
|
-
for (var t3 = 1; t3 < arguments.length; t3++) {
|
|
15544
|
-
var n3 = arguments[t3];
|
|
15545
|
-
for (var r3 in n3) Object.prototype.hasOwnProperty.call(n3, r3) && (e4[r3] = n3[r3]);
|
|
15546
|
-
}
|
|
15547
|
-
return e4;
|
|
15548
|
-
}, o = /* @__PURE__ */ function() {
|
|
15549
|
-
function e4(e5, t3) {
|
|
15550
|
-
for (var n3 = 0; n3 < t3.length; n3++) {
|
|
15551
|
-
var r3 = t3[n3];
|
|
15552
|
-
r3.enumerable = r3.enumerable || false, r3.configurable = true, "value" in r3 && (r3.writable = true), Object.defineProperty(e5, r3.key, r3);
|
|
15553
|
-
}
|
|
15554
|
-
}
|
|
15555
|
-
return function(t3, n3, r3) {
|
|
15556
|
-
return n3 && e4(t3.prototype, n3), r3 && e4(t3, r3), t3;
|
|
15557
|
-
};
|
|
15558
|
-
}(), i = l(n2(2)), u = l(n2(3)), a2 = n2(4);
|
|
15559
|
-
function l(e4) {
|
|
15560
|
-
return e4 && e4.__esModule ? e4 : { default: e4 };
|
|
15561
|
-
}
|
|
15562
|
-
var s = [], c2 = function(e4) {
|
|
15563
|
-
function t3(e5) {
|
|
15564
|
-
!function(e6, t4) {
|
|
15565
|
-
if (!(e6 instanceof t4)) throw new TypeError("Cannot call a class as a function");
|
|
15566
|
-
}(this, t3);
|
|
15567
|
-
var n3 = function(e6, t4) {
|
|
15568
|
-
if (!e6) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
15569
|
-
return !t4 || "object" != typeof t4 && "function" != typeof t4 ? e6 : t4;
|
|
15570
|
-
}(this, (t3.__proto__ || Object.getPrototypeOf(t3)).call(this, e5));
|
|
15571
|
-
return n3.handleKeyboardEvent = n3.handleKeyboardEvent.bind(n3), n3.registerExclusiveHandler = n3.registerExclusiveHandler.bind(n3), n3.deregisterExclusiveHandler = n3.deregisterExclusiveHandler.bind(n3), n3;
|
|
15572
|
-
}
|
|
15573
|
-
return function(e5, t4) {
|
|
15574
|
-
if ("function" != typeof t4 && null !== t4) throw new TypeError("Super expression must either be null or a function, not " + typeof t4);
|
|
15575
|
-
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);
|
|
15576
|
-
}(t3, i.default.Component), o(t3, [{ key: "componentDidMount", value: function() {
|
|
15577
|
-
document.addEventListener("keydown", this.handleKeyboardEvent, false), document.addEventListener("keyup", this.handleKeyboardEvent, false), document.addEventListener("keypress", this.handleKeyboardEvent, false);
|
|
15578
|
-
var e5 = this.props, t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
15579
|
-
t4 && !n3 && this.registerExclusiveHandler();
|
|
15580
|
-
} }, { key: "componentWillUnmount", value: function() {
|
|
15581
|
-
document.removeEventListener("keydown", this.handleKeyboardEvent, false), document.removeEventListener("keyup", this.handleKeyboardEvent, false), document.removeEventListener("keypress", this.handleKeyboardEvent, false), this.deregisterExclusiveHandler();
|
|
15582
|
-
} }, { key: "componentDidUpdate", value: function(e5) {
|
|
15583
|
-
var t4 = e5.isExclusive, n3 = e5.isDisabled;
|
|
15584
|
-
(this.props.isExclusive !== t4 || this.props.isDisabled !== n3) && (this.props.isExclusive && !this.props.isDisabled ? this.registerExclusiveHandler() : this.deregisterExclusiveHandler());
|
|
15585
|
-
} }, { key: "registerExclusiveHandler", value: function() {
|
|
15586
|
-
this.deregisterExclusiveHandler(), s.unshift(this);
|
|
15587
|
-
} }, { key: "deregisterExclusiveHandler", value: function() {
|
|
15588
|
-
var e5 = this;
|
|
15589
|
-
s.includes(this) && (s = s.filter(function(t4) {
|
|
15590
|
-
return t4 !== e5;
|
|
15591
|
-
}));
|
|
15592
|
-
} }, { key: "handleKeyboardEvent", value: function(e5) {
|
|
15593
|
-
var t4 = this.props, n3 = t4.isDisabled, r3 = t4.handleKeys, o2 = t4.onKeyEvent, i2 = t4.handleEventType, u2 = t4.children, l2 = t4.handleFocusableElements;
|
|
15594
|
-
if (n3) return false;
|
|
15595
|
-
if (!(i2 === e5.type)) return false;
|
|
15596
|
-
if (s.length > 0 && s[0] !== this) return false;
|
|
15597
|
-
var c3 = e5.target === document.body || l2, d2 = this.childrenContainer && this.childrenContainer.contains(e5.target);
|
|
15598
|
-
if (!(u2 ? d2 : c3)) return false;
|
|
15599
|
-
var f2 = (0, a2.findMatchedKey)(e5, r3);
|
|
15600
|
-
return !!f2 && (o2(f2, e5), true);
|
|
15601
|
-
} }, { key: "render", value: function() {
|
|
15602
|
-
var e5 = this, n3 = this.props.children, o2 = Object.assign({}, this.props), u2 = true, a3 = false, l2 = void 0;
|
|
15603
|
-
try {
|
|
15604
|
-
for (var s2, c3 = Object.keys(t3.propTypes)[Symbol.iterator](); !(u2 = (s2 = c3.next()).done); u2 = true) {
|
|
15605
|
-
delete o2[s2.value];
|
|
15606
|
-
}
|
|
15607
|
-
} catch (e6) {
|
|
15608
|
-
a3 = true, l2 = e6;
|
|
15609
|
-
} finally {
|
|
15610
|
-
try {
|
|
15611
|
-
!u2 && c3.return && c3.return();
|
|
15612
|
-
} finally {
|
|
15613
|
-
if (a3) throw l2;
|
|
15614
|
-
}
|
|
15615
|
-
}
|
|
15616
|
-
return n3 ? i.default.createElement("span", r2({ ref: function(t4) {
|
|
15617
|
-
e5.childrenContainer = t4;
|
|
15618
|
-
} }, o2), n3) : null;
|
|
15619
|
-
} }]), t3;
|
|
15620
|
-
}();
|
|
15621
|
-
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() {
|
|
15622
|
-
return null;
|
|
15623
|
-
} }, e3.exports = t2.default;
|
|
15624
|
-
}, function(t2, n2) {
|
|
15625
|
-
t2.exports = e2;
|
|
15626
|
-
}, function(e3, n2) {
|
|
15627
|
-
e3.exports = t;
|
|
15628
|
-
}, function(e3, t2, n2) {
|
|
15629
|
-
function r2(e4, t3, n3) {
|
|
15630
|
-
return t3 in e4 ? Object.defineProperty(e4, t3, { value: n3, enumerable: true, configurable: true, writable: true }) : e4[t3] = n3, e4;
|
|
15631
|
-
}
|
|
15632
|
-
Object.defineProperty(t2, "__esModule", { value: true }), t2.matchKeyEvent = p, t2.findMatchedKey = function(e4, t3) {
|
|
15633
|
-
var n3 = t3.map(function(e5) {
|
|
15634
|
-
var t4 = e5.toLowerCase(), n4 = f2[t4];
|
|
15635
|
-
return n4 || [e5];
|
|
15636
|
-
}).reduce(function(e5, t4) {
|
|
15637
|
-
return e5.concat(t4);
|
|
15638
|
-
}, []).find(function(t4) {
|
|
15639
|
-
return p(e4, t4);
|
|
15640
|
-
});
|
|
15641
|
-
!n3 && t3.includes("all") && (n3 = "other");
|
|
15642
|
-
return n3;
|
|
15643
|
-
};
|
|
15644
|
-
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) {
|
|
15645
|
-
return Object.assign(e4, r2({}, t3.toUpperCase(), o[t3]));
|
|
15646
|
-
}, {}), u = "0123456789".split("").reduce(function(e4, t3, n3) {
|
|
15647
|
-
return Object.assign(e4, r2({}, t3, [n3 + 48, n3 + 96]));
|
|
15648
|
-
}, {}), a2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").reduce(function(e4, t3, n3) {
|
|
15649
|
-
return Object.assign(e4, r2({}, t3.toLowerCase(), [n3 + 65]), r2({}, t3, [n3 + 65]));
|
|
15650
|
-
}, {}), 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) {
|
|
15651
|
-
return Object.assign(e4, r2({}, "f" + t3, [n3 + 112]));
|
|
15652
|
-
}, {}), 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) };
|
|
15653
|
-
function p(e4, t3) {
|
|
15654
|
-
var n3 = e4.which || e4.keyCode, r3 = e4.type, o2 = Object.keys(s).filter(function(t4) {
|
|
15655
|
-
return e4[t4 + "Key"];
|
|
15656
|
-
}).sort(), i2 = t3.toLowerCase().trim(), u2 = "+" === i2 ? ["+"] : i2.split(/\s?\+\s?/), a3 = u2.pop(), l2 = c2[a3], d3 = u2;
|
|
15657
|
-
if ("keypress" === r3) return t3 == String.fromCharCode(n3).toLowerCase();
|
|
15658
|
-
if (0 === d3.length && 0 === o2.length) return l2.indexOf(n3) >= 0;
|
|
15659
|
-
if (d3.length > 0 && o2.length > 0) {
|
|
15660
|
-
var f3 = d3.map(function(e5) {
|
|
15661
|
-
return s[e5];
|
|
15662
|
-
}).sort(), p2 = f3.length === o2.length && f3.every(function(e5, t4) {
|
|
15663
|
-
return o2[t4] === e5;
|
|
15664
|
-
});
|
|
15665
|
-
return l2.indexOf(n3) >= 0 && p2;
|
|
15666
|
-
}
|
|
15667
|
-
return 0 == d3.length && 1 === o2.length && a3 === o2[0];
|
|
15668
|
-
}
|
|
15669
|
-
}]);
|
|
15670
|
-
});
|
|
15671
|
-
})(reactKeyboardEventHandler);
|
|
15672
|
-
var reactKeyboardEventHandlerExports = reactKeyboardEventHandler.exports;
|
|
15673
|
-
const KeyboardEventHandler = /* @__PURE__ */ getDefaultExportFromCjs(reactKeyboardEventHandlerExports);
|
|
15674
15501
|
const useFocus = () => {
|
|
15675
15502
|
const ref = useRef(null);
|
|
15676
15503
|
const setFocus = () => {
|
|
@@ -16946,13 +16773,13 @@ var ActionTypes$1 = /* @__PURE__ */ ((ActionTypes2) => {
|
|
|
16946
16773
|
return ActionTypes2;
|
|
16947
16774
|
})(ActionTypes$1 || {});
|
|
16948
16775
|
var EventKey = /* @__PURE__ */ ((EventKey2) => {
|
|
16949
|
-
EventKey2["RIGHT"] = "
|
|
16950
|
-
EventKey2["LEFT"] = "
|
|
16951
|
-
EventKey2["UP"] = "
|
|
16952
|
-
EventKey2["DOWN"] = "
|
|
16953
|
-
EventKey2["ENTER"] = "
|
|
16954
|
-
EventKey2["ESC"] = "
|
|
16955
|
-
EventKey2["TAB"] = "
|
|
16776
|
+
EventKey2["RIGHT"] = "ArrowRight";
|
|
16777
|
+
EventKey2["LEFT"] = "ArrowLeft";
|
|
16778
|
+
EventKey2["UP"] = "ArrowUp";
|
|
16779
|
+
EventKey2["DOWN"] = "ArrowDown";
|
|
16780
|
+
EventKey2["ENTER"] = "Enter";
|
|
16781
|
+
EventKey2["ESC"] = "Escape";
|
|
16782
|
+
EventKey2["TAB"] = "Tab";
|
|
16956
16783
|
return EventKey2;
|
|
16957
16784
|
})(EventKey || {});
|
|
16958
16785
|
const useCustomSelectLogic = ({
|
|
@@ -17140,20 +16967,23 @@ const useCustomSelectLogic = ({
|
|
|
17140
16967
|
const onKeyEvent = (key2, evt) => {
|
|
17141
16968
|
switch (key2) {
|
|
17142
16969
|
case EventKey.UP: {
|
|
17143
|
-
focusNextLayerOption(
|
|
16970
|
+
focusNextLayerOption("up");
|
|
17144
16971
|
break;
|
|
17145
16972
|
}
|
|
17146
16973
|
case EventKey.DOWN: {
|
|
17147
16974
|
if (state.isLayerOpen) {
|
|
17148
|
-
focusNextLayerOption(
|
|
16975
|
+
focusNextLayerOption("down");
|
|
17149
16976
|
} else {
|
|
17150
16977
|
clickTrigger();
|
|
17151
16978
|
}
|
|
17152
16979
|
break;
|
|
17153
16980
|
}
|
|
17154
|
-
case EventKey.LEFT:
|
|
16981
|
+
case EventKey.LEFT: {
|
|
16982
|
+
focusTriggerInputs("left");
|
|
16983
|
+
break;
|
|
16984
|
+
}
|
|
17155
16985
|
case EventKey.RIGHT: {
|
|
17156
|
-
focusTriggerInputs(
|
|
16986
|
+
focusTriggerInputs("right");
|
|
17157
16987
|
break;
|
|
17158
16988
|
}
|
|
17159
16989
|
case EventKey.ENTER: {
|
|
@@ -17264,71 +17094,69 @@ const CustomSelect = (props) => {
|
|
|
17264
17094
|
createAble,
|
|
17265
17095
|
listRef
|
|
17266
17096
|
});
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
handleKeys: Object.values(EventKey),
|
|
17271
|
-
onKeyEvent,
|
|
17272
|
-
children: [
|
|
17273
|
-
/* @__PURE__ */ jsx(
|
|
17274
|
-
Trigger,
|
|
17275
|
-
{
|
|
17276
|
-
selectedOptions,
|
|
17277
|
-
searchValue: state.searchValue,
|
|
17278
|
-
isOpen: state.isLayerOpen,
|
|
17279
|
-
focusedSelectedOptionIndex: state.triggerFocus.currentOption,
|
|
17280
|
-
clearAllIsFocused,
|
|
17281
|
-
searchable,
|
|
17282
|
-
triggerRef: mergeRefs(triggerRef, triggerProps.ref),
|
|
17283
|
-
error: error2,
|
|
17284
|
-
warning: warning2,
|
|
17285
|
-
tooltip: tooltip2,
|
|
17286
|
-
small: small2,
|
|
17287
|
-
isInTable: isInTable2,
|
|
17288
|
-
disabled: disabled2 || disabledContext,
|
|
17289
|
-
clearable,
|
|
17290
|
-
tabIndex,
|
|
17291
|
-
onClickTrigger,
|
|
17292
|
-
onChangeSearch,
|
|
17293
|
-
onClickDeselect: onClickDeselectOption,
|
|
17294
|
-
onClickClear: onClickClearAll,
|
|
17295
|
-
onFocus,
|
|
17296
|
-
onBlur,
|
|
17297
|
-
groupOrder,
|
|
17298
|
-
maxTooltipWidth,
|
|
17299
|
-
placeholder: placeholder2,
|
|
17300
|
-
right: right2,
|
|
17301
|
-
testId
|
|
17302
|
-
}
|
|
17303
|
-
),
|
|
17304
|
-
state.isLayerOpen && renderLayer(
|
|
17305
|
-
/* @__PURE__ */ jsx("div", { ...layerProps, className: styles$o.layerContainer, children: /* @__PURE__ */ jsx(
|
|
17306
|
-
Layer,
|
|
17307
|
-
{
|
|
17308
|
-
listRef,
|
|
17309
|
-
isMulti: isMulti2,
|
|
17310
|
-
sections: state.visibleOptions,
|
|
17311
|
-
selectedOptions,
|
|
17312
|
-
onSelectOption: (evt, option2) => {
|
|
17313
|
-
const close2 = !isMulti2 ? closeLayer : void 0;
|
|
17314
|
-
onSelectOption(evt, option2, close2);
|
|
17315
|
-
},
|
|
17316
|
-
closeLayer: () => {
|
|
17317
|
-
if (closeOnOptionActionClick) {
|
|
17318
|
-
closeLayer();
|
|
17319
|
-
}
|
|
17320
|
-
},
|
|
17321
|
-
width: getLayerWidth(triggerBounds),
|
|
17322
|
-
small: small2,
|
|
17323
|
-
focusedOptionIndex: state.layerFocus.current,
|
|
17324
|
-
firstSelectedOptionIndex: firstSelectedOptionIndex ?? 0,
|
|
17325
|
-
testId: testId && `${testId}-layer`
|
|
17326
|
-
}
|
|
17327
|
-
) })
|
|
17328
|
-
)
|
|
17329
|
-
]
|
|
17097
|
+
const onKeyDown = (evt) => {
|
|
17098
|
+
if (Object.values(EventKey).includes(evt.key)) {
|
|
17099
|
+
onKeyEvent(evt.key, evt);
|
|
17330
17100
|
}
|
|
17331
|
-
|
|
17101
|
+
};
|
|
17102
|
+
return /* @__PURE__ */ jsxs("div", { style: { width: getTriggerWidth() }, onKeyDown, children: [
|
|
17103
|
+
/* @__PURE__ */ jsx(
|
|
17104
|
+
Trigger,
|
|
17105
|
+
{
|
|
17106
|
+
selectedOptions,
|
|
17107
|
+
searchValue: state.searchValue,
|
|
17108
|
+
isOpen: state.isLayerOpen,
|
|
17109
|
+
focusedSelectedOptionIndex: state.triggerFocus.currentOption,
|
|
17110
|
+
clearAllIsFocused,
|
|
17111
|
+
searchable,
|
|
17112
|
+
triggerRef: mergeRefs(triggerRef, triggerProps.ref),
|
|
17113
|
+
error: error2,
|
|
17114
|
+
warning: warning2,
|
|
17115
|
+
tooltip: tooltip2,
|
|
17116
|
+
small: small2,
|
|
17117
|
+
isInTable: isInTable2,
|
|
17118
|
+
disabled: disabled2 || disabledContext,
|
|
17119
|
+
clearable,
|
|
17120
|
+
tabIndex,
|
|
17121
|
+
onClickTrigger,
|
|
17122
|
+
onChangeSearch,
|
|
17123
|
+
onClickDeselect: onClickDeselectOption,
|
|
17124
|
+
onClickClear: onClickClearAll,
|
|
17125
|
+
onFocus,
|
|
17126
|
+
onBlur,
|
|
17127
|
+
groupOrder,
|
|
17128
|
+
maxTooltipWidth,
|
|
17129
|
+
placeholder: placeholder2,
|
|
17130
|
+
right: right2,
|
|
17131
|
+
testId
|
|
17132
|
+
}
|
|
17133
|
+
),
|
|
17134
|
+
state.isLayerOpen && renderLayer(
|
|
17135
|
+
/* @__PURE__ */ jsx("div", { ...layerProps, className: styles$o.layerContainer, children: /* @__PURE__ */ jsx(
|
|
17136
|
+
Layer,
|
|
17137
|
+
{
|
|
17138
|
+
listRef,
|
|
17139
|
+
isMulti: isMulti2,
|
|
17140
|
+
sections: state.visibleOptions,
|
|
17141
|
+
selectedOptions,
|
|
17142
|
+
onSelectOption: (evt, option2) => {
|
|
17143
|
+
const close2 = !isMulti2 ? closeLayer : void 0;
|
|
17144
|
+
onSelectOption(evt, option2, close2);
|
|
17145
|
+
},
|
|
17146
|
+
closeLayer: () => {
|
|
17147
|
+
if (closeOnOptionActionClick) {
|
|
17148
|
+
closeLayer();
|
|
17149
|
+
}
|
|
17150
|
+
},
|
|
17151
|
+
width: getLayerWidth(triggerBounds),
|
|
17152
|
+
small: small2,
|
|
17153
|
+
focusedOptionIndex: state.layerFocus.current,
|
|
17154
|
+
firstSelectedOptionIndex: firstSelectedOptionIndex ?? 0,
|
|
17155
|
+
testId: testId && `${testId}-layer`
|
|
17156
|
+
}
|
|
17157
|
+
) })
|
|
17158
|
+
)
|
|
17159
|
+
] });
|
|
17332
17160
|
};
|
|
17333
17161
|
const isEmptyNullOrUndefined = (value) => value === null || value === void 0 || value === "";
|
|
17334
17162
|
const isMulti = (selectedOptions) => selectedOptions instanceof Array;
|
|
@@ -51551,7 +51379,7 @@ const NumberInput = ({
|
|
|
51551
51379
|
}, [focus2, valid, error2]);
|
|
51552
51380
|
const onChangeValue = (evt) => {
|
|
51553
51381
|
var _a2, _b;
|
|
51554
|
-
const value2 =
|
|
51382
|
+
const value2 = "key" in evt ? displayValue : (_a2 = evt == null ? void 0 : evt.target) == null ? void 0 : _a2.value;
|
|
51555
51383
|
const inputValue = cleanNumStr(
|
|
51556
51384
|
value2.replaceAll(" ", "").replaceAll("|", "")
|
|
51557
51385
|
);
|
|
@@ -51590,38 +51418,37 @@ const NumberInput = ({
|
|
|
51590
51418
|
const defaultDisplayRound = (value2) => isInTable2 ? roundToFixed(value2, 2) : roundByMagnitude(value2, 4);
|
|
51591
51419
|
const shouldDisplayRound = enableDisplayRounding && !focus2 && valid;
|
|
51592
51420
|
const valueWithDisplayRounding = shouldDisplayRound ? roundDisplayValue ? safeToString(roundDisplayValue(displayValue)) : defaultDisplayRound(value) : displayValue;
|
|
51421
|
+
const onKeyDown = (evt) => {
|
|
51422
|
+
if (evt.key === EventKey.ENTER) {
|
|
51423
|
+
onChangeValue(evt);
|
|
51424
|
+
}
|
|
51425
|
+
};
|
|
51593
51426
|
return /* @__PURE__ */ jsx(
|
|
51594
|
-
|
|
51427
|
+
Input$1,
|
|
51595
51428
|
{
|
|
51596
|
-
|
|
51597
|
-
|
|
51598
|
-
|
|
51599
|
-
|
|
51600
|
-
|
|
51601
|
-
|
|
51602
|
-
|
|
51603
|
-
|
|
51604
|
-
|
|
51605
|
-
|
|
51606
|
-
|
|
51607
|
-
|
|
51608
|
-
|
|
51609
|
-
|
|
51610
|
-
|
|
51611
|
-
|
|
51612
|
-
|
|
51613
|
-
|
|
51614
|
-
|
|
51615
|
-
|
|
51616
|
-
|
|
51617
|
-
|
|
51618
|
-
|
|
51619
|
-
tooltip: tooltip2,
|
|
51620
|
-
ref: inputRef
|
|
51621
|
-
},
|
|
51622
|
-
stringName
|
|
51623
|
-
)
|
|
51624
|
-
}
|
|
51429
|
+
type: "text",
|
|
51430
|
+
name: stringName,
|
|
51431
|
+
testId,
|
|
51432
|
+
disabled: disabled2,
|
|
51433
|
+
placeholder: placeholder2,
|
|
51434
|
+
value: valueWithDisplayRounding,
|
|
51435
|
+
onChange: onChangeValue,
|
|
51436
|
+
onFocus: onInputFocus,
|
|
51437
|
+
onBlur: onInputBlur,
|
|
51438
|
+
onKeyDown,
|
|
51439
|
+
error: firstError || error2,
|
|
51440
|
+
warning: warning2,
|
|
51441
|
+
right: !left2,
|
|
51442
|
+
small: small2,
|
|
51443
|
+
width: width2,
|
|
51444
|
+
isInTable: isInTable2,
|
|
51445
|
+
groupOrder,
|
|
51446
|
+
selectOnFocus,
|
|
51447
|
+
tabIndex,
|
|
51448
|
+
tooltip: tooltip2,
|
|
51449
|
+
ref: inputRef
|
|
51450
|
+
},
|
|
51451
|
+
stringName
|
|
51625
51452
|
);
|
|
51626
51453
|
};
|
|
51627
51454
|
const NumberInputCell = ({
|