@razorpay/blade 10.2.1 → 10.3.1
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/build/components/index.d.ts +17 -12
- package/build/components/index.development.web.js +153 -282
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +9 -4
- package/build/components/index.native.js +10 -10
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +154 -283
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/build/tokens/index.d.ts +2 -0
- package/build/tokens/index.development.web.js +2 -0
- package/build/tokens/index.development.web.js.map +1 -1
- package/build/tokens/index.native.d.ts +2 -0
- package/build/tokens/index.native.js +1 -1
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.production.web.js +2 -0
- package/build/tokens/index.production.web.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,12 +5,11 @@ import _toConsumableArray$1 from '@babel/runtime/helpers/toConsumableArray';
|
|
|
5
5
|
import _objectWithoutProperties$1 from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
7
|
import styled, { ThemeProvider, css, keyframes } from 'styled-components';
|
|
8
|
-
import { FloatingDelayGroup, useFloating,
|
|
8
|
+
import { FloatingDelayGroup, useFloating, offset, flip, size as size$1, autoUpdate, useTransitionStyles, FloatingOverlay, FloatingPortal, FloatingFocusManager, shift, arrow, useDelayGroup, useDelayGroupContext, useHover, useFocus, useRole, useInteractions, FloatingArrow } from '@floating-ui/react';
|
|
9
9
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
12
12
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
13
|
-
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
14
13
|
|
|
15
14
|
/*
|
|
16
15
|
* This content is licensed according to the W3C Software License at
|
|
@@ -740,6 +739,9 @@ var DropdownContext = /*#__PURE__*/React__default.createContext({
|
|
|
740
739
|
},
|
|
741
740
|
triggererRef: {
|
|
742
741
|
current: null
|
|
742
|
+
},
|
|
743
|
+
triggererWrapperRef: {
|
|
744
|
+
current: null
|
|
743
745
|
}
|
|
744
746
|
});
|
|
745
747
|
var searchTimeout;
|
|
@@ -1355,27 +1357,6 @@ var fontWeight = {
|
|
|
1355
1357
|
}
|
|
1356
1358
|
});
|
|
1357
1359
|
|
|
1358
|
-
/**
|
|
1359
|
-
* When any of the values are changed here, do change the jsdoc comments in BaseBox/types/spacingTypes.ts as well
|
|
1360
|
-
*
|
|
1361
|
-
* {@link ../../components/Box/BaseBox/types/spacingTypes.ts}
|
|
1362
|
-
*/
|
|
1363
|
-
|
|
1364
|
-
var spacing = {
|
|
1365
|
-
0: 0,
|
|
1366
|
-
1: 2,
|
|
1367
|
-
2: 4,
|
|
1368
|
-
3: 8,
|
|
1369
|
-
4: 12,
|
|
1370
|
-
5: 16,
|
|
1371
|
-
6: 20,
|
|
1372
|
-
7: 24,
|
|
1373
|
-
8: 32,
|
|
1374
|
-
9: 40,
|
|
1375
|
-
10: 48,
|
|
1376
|
-
11: 56
|
|
1377
|
-
};
|
|
1378
|
-
|
|
1379
1360
|
/**
|
|
1380
1361
|
* Size tokens are currently not exposed for users (therefore not available in theme)
|
|
1381
1362
|
*/
|
|
@@ -1432,6 +1413,8 @@ var size = {
|
|
|
1432
1413
|
160: 160,
|
|
1433
1414
|
/** 200 px */
|
|
1434
1415
|
200: 200,
|
|
1416
|
+
/** 240 px */
|
|
1417
|
+
240: 240,
|
|
1435
1418
|
/** 300 px */
|
|
1436
1419
|
300: 300,
|
|
1437
1420
|
/** 360 px */
|
|
@@ -14970,33 +14953,55 @@ var SelectorSupportText = function SelectorSupportText(_ref) {
|
|
|
14970
14953
|
});
|
|
14971
14954
|
};
|
|
14972
14955
|
|
|
14956
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14957
|
+
function assignRef(ref, value) {
|
|
14958
|
+
if (ref == null) return;
|
|
14959
|
+
if (typeof ref === 'function') {
|
|
14960
|
+
ref(value);
|
|
14961
|
+
return;
|
|
14962
|
+
}
|
|
14963
|
+
try {
|
|
14964
|
+
ref.current = value;
|
|
14965
|
+
} catch (error) {
|
|
14966
|
+
throwBladeError({
|
|
14967
|
+
moduleName: 'useMergeRefs',
|
|
14968
|
+
message: "Cannot assign value '".concat(value, "' to ref '").concat(ref, "'")
|
|
14969
|
+
});
|
|
14970
|
+
}
|
|
14971
|
+
}
|
|
14972
|
+
function mergeRefs() {
|
|
14973
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14974
|
+
refs[_key] = arguments[_key];
|
|
14975
|
+
}
|
|
14976
|
+
return function (node) {
|
|
14977
|
+
refs.forEach(function (ref) {
|
|
14978
|
+
assignRef(ref, node);
|
|
14979
|
+
});
|
|
14980
|
+
};
|
|
14981
|
+
}
|
|
14982
|
+
|
|
14973
14983
|
/**
|
|
14974
|
-
*
|
|
14984
|
+
* Merged two or more refs into a single ref callback.
|
|
14985
|
+
*
|
|
14986
|
+
* Usage:
|
|
14987
|
+
* ```ts
|
|
14988
|
+
* const internalRef = React.useRef()
|
|
14989
|
+
* const ref = useMergeRefs(incomingRef, internalRef);
|
|
14990
|
+
* ```
|
|
14975
14991
|
*
|
|
14976
|
-
*
|
|
14977
|
-
*
|
|
14992
|
+
*
|
|
14993
|
+
* Taken from ChakraUI:
|
|
14994
|
+
* https://github.com/chakra-ui/chakra-ui/blob/f3c4a492e5636d2745b438d10794fa4e7999b6de/packages/hooks/use-merge-refs/src/index.ts#L31
|
|
14978
14995
|
*/
|
|
14979
|
-
|
|
14980
|
-
var
|
|
14981
|
-
|
|
14982
|
-
|
|
14983
|
-
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
scrollIntoView: function scrollIntoView(opts) {
|
|
14989
|
-
var _element$scrollIntoVi;
|
|
14990
|
-
return element === null || element === void 0 ? void 0 : (_element$scrollIntoVi = element.scrollIntoView) === null || _element$scrollIntoVi === void 0 ? void 0 : _element$scrollIntoVi.call(element, opts);
|
|
14991
|
-
},
|
|
14992
|
-
getBoundingClientRect: function getBoundingClientRect() {
|
|
14993
|
-
return element === null || element === void 0 ? void 0 : element.getBoundingClientRect();
|
|
14994
|
-
},
|
|
14995
|
-
clientHeight: element.clientHeight
|
|
14996
|
-
};
|
|
14997
|
-
}, [innerRef, handlers]);
|
|
14998
|
-
return innerRef;
|
|
14999
|
-
};
|
|
14996
|
+
function useMergeRefs() {
|
|
14997
|
+
for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
14998
|
+
refs[_key2] = arguments[_key2];
|
|
14999
|
+
}
|
|
15000
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15001
|
+
return useMemo(function () {
|
|
15002
|
+
return mergeRefs.apply(void 0, refs);
|
|
15003
|
+
}, refs);
|
|
15004
|
+
}
|
|
15000
15005
|
|
|
15001
15006
|
function ownKeys$1n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15002
15007
|
function _objectSpread$1m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1n(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -15051,7 +15056,10 @@ var _SelectorInput = function _SelectorInput(_ref3, ref) {
|
|
|
15051
15056
|
hoverTokens = _ref3.hoverTokens,
|
|
15052
15057
|
tabIndex = _ref3.tabIndex,
|
|
15053
15058
|
accessibilityLabel = _ref3.accessibilityLabel;
|
|
15054
|
-
|
|
15059
|
+
// merging both refs because inputProps.ref needs to have access to indeterminate state
|
|
15060
|
+
// to be able to set the mixed value via setMixed() function
|
|
15061
|
+
// TODO: replace with a generic `mergeRefs()` util if we do this in other places
|
|
15062
|
+
var mergedRef = useMergeRefs(ref, inputProps.ref);
|
|
15055
15063
|
return /*#__PURE__*/jsx(StyledInput, _objectSpread$1m(_objectSpread$1m(_objectSpread$1m({
|
|
15056
15064
|
id: id,
|
|
15057
15065
|
isChecked: isChecked,
|
|
@@ -15062,13 +15070,7 @@ var _SelectorInput = function _SelectorInput(_ref3, ref) {
|
|
|
15062
15070
|
}, inputProps), makeAccessible({
|
|
15063
15071
|
label: accessibilityLabel
|
|
15064
15072
|
})), {}, {
|
|
15065
|
-
|
|
15066
|
-
// to be able to set the mixed value via setMixed() function
|
|
15067
|
-
// TODO: replace with a generic `mergeRefs()` util if we do this in other places
|
|
15068
|
-
ref: function ref(value) {
|
|
15069
|
-
inputProps.ref.current = value;
|
|
15070
|
-
inputRef.current = value;
|
|
15071
|
-
}
|
|
15073
|
+
ref: mergedRef
|
|
15072
15074
|
}));
|
|
15073
15075
|
};
|
|
15074
15076
|
var SelectorInput = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_SelectorInput), {
|
|
@@ -19277,6 +19279,11 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
19277
19279
|
shouldIgnoreBlurAnimation = _React$useState14[0],
|
|
19278
19280
|
setShouldIgnoreBlurAnimation = _React$useState14[1];
|
|
19279
19281
|
var triggererRef = React__default.useRef(null);
|
|
19282
|
+
/**
|
|
19283
|
+
* In inputs, actual input is smaller than the visible input wrapper.
|
|
19284
|
+
* You can set this reference in such cases so floating ui calculations happen correctly
|
|
19285
|
+
* */
|
|
19286
|
+
var triggererWrapperRef = React__default.useRef(null);
|
|
19280
19287
|
var actionListItemRef = React__default.useRef(null);
|
|
19281
19288
|
var _React$useState15 = React__default.useState(false),
|
|
19282
19289
|
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
@@ -19361,6 +19368,7 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
19361
19368
|
setIsKeydownPressed: setIsKeydownPressed,
|
|
19362
19369
|
dropdownBaseId: dropdownBaseId,
|
|
19363
19370
|
triggererRef: triggererRef,
|
|
19371
|
+
triggererWrapperRef: triggererWrapperRef,
|
|
19364
19372
|
actionListItemRef: actionListItemRef,
|
|
19365
19373
|
selectionType: selectionType,
|
|
19366
19374
|
hasFooterAction: hasFooterAction,
|
|
@@ -19425,157 +19433,75 @@ var StyledDropdownOverlay = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19425
19433
|
|
|
19426
19434
|
function ownKeys$W(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19427
19435
|
function _objectSpread$V(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$W(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$W(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19428
|
-
function _regeneratorRuntime() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
19429
|
-
var
|
|
19430
|
-
var
|
|
19431
|
-
var AnimatedOverlay = /*#__PURE__*/styled(StyledDropdownOverlay).withConfig({
|
|
19432
|
-
displayName: "DropdownOverlayweb__AnimatedOverlay",
|
|
19433
|
-
componentId: "sc-9pwxtx-0"
|
|
19434
|
-
})(function (props) {
|
|
19435
|
-
return css(["", " transform:translateY(", ");opacity:0;z-index:99;pointer-events:", ";"], props.transition, makeSize(props.theme.spacing[3]), props.isOpen ? 'all' : 'none');
|
|
19436
|
-
});
|
|
19437
|
-
|
|
19438
|
-
/**
|
|
19439
|
-
* This function calculates the position of dropdown overlay with respect to dropdown trigger element.
|
|
19440
|
-
* For non-menus (e.g SelectInput), position is flipped if overflow is on bottom.
|
|
19441
|
-
* For menus (e.g. DropdownButton), position is flipped if overflow is on right or bottom.
|
|
19442
|
-
* Additional spacing is added to clientHeight to provide spacing above the dropdown trigger.
|
|
19443
|
-
*/
|
|
19444
|
-
var getDropdownOverlayPosition = function getDropdownOverlayPosition(_ref) {
|
|
19445
|
-
var position = _ref.overflow,
|
|
19446
|
-
isMenu = _ref.isMenu,
|
|
19447
|
-
triggererEl = _ref.triggererEl,
|
|
19448
|
-
actionListItemEl = _ref.actionListItemEl;
|
|
19449
|
-
var zeroSpacing = 'spacing.0';
|
|
19450
|
-
var top = position.top,
|
|
19451
|
-
bottom = position.bottom,
|
|
19452
|
-
right = position.right;
|
|
19453
|
-
var newPosition = {
|
|
19454
|
-
left: zeroSpacing
|
|
19455
|
-
};
|
|
19456
|
-
|
|
19457
|
-
/**
|
|
19458
|
-
* Calculating thresholds using the height & width of action list element with offset of 16px
|
|
19459
|
-
*/
|
|
19460
|
-
var WIDTH_THRESHOLD = (Number(actionListItemEl === null || actionListItemEl === void 0 ? void 0 : actionListItemEl.clientWidth) + Number(size[16])) * -1;
|
|
19461
|
-
var HEIGHT_THRESHOLD = (Number(actionListItemEl === null || actionListItemEl === void 0 ? void 0 : actionListItemEl.clientHeight) + Number(size[16])) * -1;
|
|
19462
|
-
if (!isMenu) {
|
|
19463
|
-
// In SelectInput, we set position wrt to right so that leftLabel position can be accomodated
|
|
19464
|
-
// without additional offset calculation from left
|
|
19465
|
-
newPosition.left = undefined;
|
|
19466
|
-
newPosition.right = zeroSpacing;
|
|
19467
|
-
if (bottom > HEIGHT_THRESHOLD) {
|
|
19468
|
-
newPosition.bottom = "".concat(Number(triggererEl === null || triggererEl === void 0 ? void 0 : triggererEl.clientHeight) + Number(size[32]), "px");
|
|
19469
|
-
newPosition.top = undefined;
|
|
19470
|
-
}
|
|
19471
|
-
if (top > HEIGHT_THRESHOLD) {
|
|
19472
|
-
newPosition.top = zeroSpacing;
|
|
19473
|
-
newPosition.bottom = undefined;
|
|
19474
|
-
}
|
|
19475
|
-
return newPosition;
|
|
19476
|
-
}
|
|
19477
|
-
if (right > WIDTH_THRESHOLD) {
|
|
19478
|
-
newPosition.right = zeroSpacing;
|
|
19479
|
-
newPosition.left = undefined;
|
|
19480
|
-
}
|
|
19481
|
-
if (bottom > HEIGHT_THRESHOLD) {
|
|
19482
|
-
newPosition.bottom = "".concat(Number(triggererEl === null || triggererEl === void 0 ? void 0 : triggererEl.clientHeight) + Number(size[20]), "px");
|
|
19483
|
-
newPosition.top = undefined;
|
|
19484
|
-
}
|
|
19485
|
-
if (top > HEIGHT_THRESHOLD) {
|
|
19486
|
-
newPosition.top = zeroSpacing;
|
|
19487
|
-
newPosition.bottom = undefined;
|
|
19488
|
-
}
|
|
19489
|
-
return newPosition;
|
|
19490
|
-
};
|
|
19491
|
-
var getDropdownOverflowMiddleware = function getDropdownOverflowMiddleware(_ref2) {
|
|
19492
|
-
var isMenu = _ref2.isMenu,
|
|
19493
|
-
triggererRef = _ref2.triggererRef,
|
|
19494
|
-
actionListItemRef = _ref2.actionListItemRef,
|
|
19495
|
-
setDropdownPosition = _ref2.setDropdownPosition;
|
|
19496
|
-
return {
|
|
19497
|
-
name: 'detectOverflowMiddleware',
|
|
19498
|
-
fn: function fn(state) {
|
|
19499
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
19500
|
-
var overflow, position;
|
|
19501
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
19502
|
-
while (1) switch (_context.prev = _context.next) {
|
|
19503
|
-
case 0:
|
|
19504
|
-
_context.next = 2;
|
|
19505
|
-
return detectOverflow(state, {
|
|
19506
|
-
elementContext: 'reference'
|
|
19507
|
-
});
|
|
19508
|
-
case 2:
|
|
19509
|
-
overflow = _context.sent;
|
|
19510
|
-
position = getDropdownOverlayPosition({
|
|
19511
|
-
overflow: overflow,
|
|
19512
|
-
isMenu: isMenu,
|
|
19513
|
-
triggererEl: triggererRef.current,
|
|
19514
|
-
actionListItemEl: actionListItemRef.current
|
|
19515
|
-
});
|
|
19516
|
-
setDropdownPosition(position);
|
|
19517
|
-
return _context.abrupt("return", {});
|
|
19518
|
-
case 6:
|
|
19519
|
-
case "end":
|
|
19520
|
-
return _context.stop();
|
|
19521
|
-
}
|
|
19522
|
-
}, _callee);
|
|
19523
|
-
}))();
|
|
19524
|
-
}
|
|
19525
|
-
};
|
|
19526
|
-
};
|
|
19436
|
+
var OVERLAY_OFFSET = size['8'];
|
|
19437
|
+
var OVERLAY_PADDING = size['12']; // doesn't have to be exact. Just rough padding for floating ui to decide to show overlay on top or bottom
|
|
19438
|
+
var OVERLAY_ZINDEX = 1001;
|
|
19527
19439
|
|
|
19528
19440
|
/**
|
|
19529
19441
|
* Overlay of dropdown
|
|
19530
19442
|
*
|
|
19531
19443
|
* Wrap your ActionList within this component
|
|
19532
19444
|
*/
|
|
19533
|
-
var _DropdownOverlay = function _DropdownOverlay(
|
|
19534
|
-
var
|
|
19535
|
-
|
|
19445
|
+
var _DropdownOverlay = function _DropdownOverlay(_ref) {
|
|
19446
|
+
var _triggererWrapperRef$;
|
|
19447
|
+
var children = _ref.children,
|
|
19448
|
+
testID = _ref.testID,
|
|
19449
|
+
_ref$zIndex = _ref.zIndex,
|
|
19450
|
+
zIndex = _ref$zIndex === void 0 ? OVERLAY_ZINDEX : _ref$zIndex;
|
|
19536
19451
|
var _useDropdown = useDropdown(),
|
|
19537
19452
|
isOpen = _useDropdown.isOpen,
|
|
19538
19453
|
triggererRef = _useDropdown.triggererRef,
|
|
19539
|
-
|
|
19454
|
+
triggererWrapperRef = _useDropdown.triggererWrapperRef,
|
|
19540
19455
|
dropdownTriggerer = _useDropdown.dropdownTriggerer,
|
|
19541
|
-
setIsOpen = _useDropdown.setIsOpen
|
|
19542
|
-
actionListItemRef = _useDropdown.actionListItemRef;
|
|
19456
|
+
setIsOpen = _useDropdown.setIsOpen;
|
|
19543
19457
|
var _useTheme = useTheme(),
|
|
19544
19458
|
theme = _useTheme.theme;
|
|
19545
19459
|
var bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();
|
|
19546
|
-
var _React$useState = React__default.useState(false),
|
|
19547
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19548
|
-
showFadeOutAnimation = _React$useState2[0],
|
|
19549
|
-
setShowFadeOutAnimation = _React$useState2[1];
|
|
19550
|
-
var _React$useState3 = React__default.useState('100%'),
|
|
19551
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
19552
|
-
width = _React$useState4[0],
|
|
19553
|
-
setWidth = _React$useState4[1];
|
|
19554
|
-
var _React$useState5 = React__default.useState({}),
|
|
19555
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
19556
|
-
dropdownPosition = _React$useState6[0],
|
|
19557
|
-
setDropdownPosition = _React$useState6[1];
|
|
19558
19460
|
var isMenu = dropdownTriggerer !== 'SelectInput';
|
|
19559
19461
|
var _useFloating = useFloating({
|
|
19560
19462
|
open: isOpen,
|
|
19561
19463
|
onOpenChange: setIsOpen,
|
|
19562
|
-
strategy: '
|
|
19464
|
+
strategy: 'fixed',
|
|
19563
19465
|
placement: 'bottom-start',
|
|
19564
19466
|
elements: {
|
|
19565
|
-
|
|
19467
|
+
// Input triggers have their ref on internal input element but we want width height of overall visible input hence wrapperRef is needed
|
|
19468
|
+
// We fallback to use `triggererRef` for triggers like button and link where wrapper is not needed
|
|
19469
|
+
// Checkout: https://github.com/razorpay/blade/pull/1559#discussion_r1305438920
|
|
19470
|
+
reference: (_triggererWrapperRef$ = triggererWrapperRef.current) !== null && _triggererWrapperRef$ !== void 0 ? _triggererWrapperRef$ : triggererRef.current
|
|
19566
19471
|
},
|
|
19567
|
-
middleware: [
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
|
|
19472
|
+
middleware: [offset({
|
|
19473
|
+
mainAxis: OVERLAY_OFFSET
|
|
19474
|
+
}), flip({
|
|
19475
|
+
padding: OVERLAY_OFFSET + OVERLAY_PADDING
|
|
19476
|
+
}), size$1({
|
|
19477
|
+
apply: function apply(_ref2) {
|
|
19478
|
+
var rects = _ref2.rects,
|
|
19479
|
+
elements = _ref2.elements;
|
|
19480
|
+
Object.assign(elements.floating.style, {
|
|
19481
|
+
// in menu, we have flexible width between min and max
|
|
19482
|
+
// in input triggers, we just take width of trigger
|
|
19483
|
+
width: isMenu ? undefined : makeSize(rects.reference.width),
|
|
19484
|
+
minWidth: isMenu ? makeSize(size['240']) : undefined,
|
|
19485
|
+
maxWidth: isMenu ? makeSize(size['400']) : undefined
|
|
19486
|
+
});
|
|
19487
|
+
}
|
|
19572
19488
|
})],
|
|
19573
19489
|
whileElementsMounted: autoUpdate
|
|
19574
19490
|
}),
|
|
19575
|
-
refs = _useFloating.refs
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
var
|
|
19491
|
+
refs = _useFloating.refs,
|
|
19492
|
+
floatingStyles = _useFloating.floatingStyles,
|
|
19493
|
+
context = _useFloating.context;
|
|
19494
|
+
var _useTransitionStyles = useTransitionStyles(context, {
|
|
19495
|
+
duration: theme.motion.duration.quick,
|
|
19496
|
+
initial: function initial() {
|
|
19497
|
+
return {
|
|
19498
|
+
transform: "translateY(-".concat(makeSize(size['8']), ")"),
|
|
19499
|
+
opacity: 0
|
|
19500
|
+
};
|
|
19501
|
+
}
|
|
19502
|
+
}),
|
|
19503
|
+
isMounted = _useTransitionStyles.isMounted,
|
|
19504
|
+
styles = _useTransitionStyles.styles;
|
|
19579
19505
|
React__default.useEffect(function () {
|
|
19580
19506
|
if (isOpen) {
|
|
19581
19507
|
var _triggererRef$current;
|
|
@@ -19584,88 +19510,24 @@ var _DropdownOverlay = function _DropdownOverlay(_ref3) {
|
|
|
19584
19510
|
}
|
|
19585
19511
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19586
19512
|
}, [isOpen]);
|
|
19587
|
-
|
|
19588
|
-
//
|
|
19589
|
-
|
|
19590
|
-
|
|
19591
|
-
|
|
19592
|
-
|
|
19593
|
-
|
|
19594
|
-
|
|
19595
|
-
|
|
19596
|
-
|
|
19597
|
-
|
|
19598
|
-
|
|
19599
|
-
|
|
19600
|
-
|
|
19601
|
-
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
// We don't have to worry about setting the custom width when label is on top since we can just 100% width of parent div
|
|
19606
|
-
setWidth('100%');
|
|
19607
|
-
window.removeEventListener('resize', setOverlayWidth);
|
|
19608
|
-
}
|
|
19609
|
-
}, 1000);
|
|
19610
|
-
setOverlayWidth();
|
|
19611
|
-
window.addEventListener('resize', setOverlayWidth);
|
|
19612
|
-
return function () {
|
|
19613
|
-
window.removeEventListener('resize', setOverlayWidth);
|
|
19614
|
-
};
|
|
19615
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19616
|
-
}, [setWidth, triggererRef, hasLabelOnLeft]);
|
|
19617
|
-
var onAnimationEnd = React__default.useCallback(function () {
|
|
19618
|
-
if (isOpen) {
|
|
19619
|
-
setShowFadeOutAnimation(true);
|
|
19620
|
-
} else {
|
|
19621
|
-
setShowFadeOutAnimation(false);
|
|
19622
|
-
}
|
|
19623
|
-
}, [isOpen]);
|
|
19624
|
-
var styles = React__default.useMemo(function () {
|
|
19625
|
-
return {
|
|
19626
|
-
opacity: isOpen ? 1 : 0
|
|
19627
|
-
};
|
|
19628
|
-
}, [isOpen]);
|
|
19629
|
-
return (
|
|
19630
|
-
/*#__PURE__*/
|
|
19631
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19632
|
-
jsxs(BaseBox, {
|
|
19633
|
-
position: "relative",
|
|
19634
|
-
ref: refs.setFloating,
|
|
19635
|
-
children: [isOpen ? /*#__PURE__*/jsx(BaseBox, {
|
|
19636
|
-
position: 'fixed',
|
|
19637
|
-
top: "spacing.0",
|
|
19638
|
-
left: "spacing.0",
|
|
19639
|
-
height: "100%",
|
|
19640
|
-
width: "100%",
|
|
19641
|
-
onClick: function onClick() {
|
|
19642
|
-
return setIsOpen(false);
|
|
19643
|
-
}
|
|
19644
|
-
}) : null, /*#__PURE__*/jsx(AnimatedOverlay, _objectSpread$V(_objectSpread$V({
|
|
19645
|
-
isInBottomSheet: bottomSheetAndDropdownGlue === null || bottomSheetAndDropdownGlue === void 0 ? void 0 : bottomSheetAndDropdownGlue.dropdownHasBottomSheet,
|
|
19646
|
-
width: isMenu ? 'max-content' : width
|
|
19647
|
-
// In SelectInput, Overlay should always take width of Input
|
|
19648
|
-
,
|
|
19649
|
-
minWidth: isMenu ? '240px' : undefined
|
|
19650
|
-
// in SelectInput, we don't want to set maxWidth because it takes width according to the trigger
|
|
19651
|
-
,
|
|
19652
|
-
maxWidth: isMenu ? '400px' : undefined,
|
|
19653
|
-
left: dropdownPosition.left,
|
|
19654
|
-
right: dropdownPosition.right,
|
|
19655
|
-
bottom: dropdownPosition.bottom,
|
|
19656
|
-
style: styles,
|
|
19657
|
-
isOpen: isOpen,
|
|
19658
|
-
position: "absolute",
|
|
19659
|
-
transition: isOpen ? fadeIn : showFadeOutAnimation ? fadeOut : noAnimation,
|
|
19660
|
-
onAnimationEnd: onAnimationEnd
|
|
19661
|
-
}, metaAttribute({
|
|
19662
|
-
name: MetaConstants.DropdownOverlay,
|
|
19663
|
-
testID: testID
|
|
19664
|
-
})), {}, {
|
|
19665
|
-
children: children
|
|
19666
|
-
}))]
|
|
19667
|
-
})
|
|
19668
|
-
);
|
|
19513
|
+
return /*#__PURE__*/jsx(BaseBox
|
|
19514
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19515
|
+
, {
|
|
19516
|
+
ref: refs.setFloating,
|
|
19517
|
+
style: floatingStyles,
|
|
19518
|
+
zIndex: zIndex,
|
|
19519
|
+
display: isMounted ? 'flex' : 'none',
|
|
19520
|
+
children: /*#__PURE__*/jsx(StyledDropdownOverlay, _objectSpread$V(_objectSpread$V({
|
|
19521
|
+
isInBottomSheet: bottomSheetAndDropdownGlue === null || bottomSheetAndDropdownGlue === void 0 ? void 0 : bottomSheetAndDropdownGlue.dropdownHasBottomSheet,
|
|
19522
|
+
style: _objectSpread$V({}, styles),
|
|
19523
|
+
width: "100%"
|
|
19524
|
+
}, metaAttribute({
|
|
19525
|
+
name: MetaConstants.DropdownOverlay,
|
|
19526
|
+
testID: testID
|
|
19527
|
+
})), {}, {
|
|
19528
|
+
children: children
|
|
19529
|
+
}))
|
|
19530
|
+
});
|
|
19669
19531
|
};
|
|
19670
19532
|
var DropdownOverlay = /*#__PURE__*/assignWithoutSideEffects(_DropdownOverlay, {
|
|
19671
19533
|
componentId: componentIds$1.DropdownOverlay
|
|
@@ -20646,7 +20508,7 @@ var BaseInputAnimatedBorder = function BaseInputAnimatedBorder(_ref2) {
|
|
|
20646
20508
|
});
|
|
20647
20509
|
};
|
|
20648
20510
|
|
|
20649
|
-
var _excluded$k = ["children", "validationState", "currentInteraction", "isLabelLeftPositioned", "isTextArea"];
|
|
20511
|
+
var _excluded$k = ["children", "validationState", "currentInteraction", "isLabelLeftPositioned", "isTextArea", "setInputWrapperRef"];
|
|
20650
20512
|
function ownKeys$M(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20651
20513
|
function _objectSpread$L(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$M(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$M(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20652
20514
|
var StyledBaseInputWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
@@ -20684,8 +20546,12 @@ var BaseInputWrapper = function BaseInputWrapper(_ref) {
|
|
|
20684
20546
|
currentInteraction = _ref.currentInteraction;
|
|
20685
20547
|
_ref.isLabelLeftPositioned;
|
|
20686
20548
|
var isTextArea = _ref.isTextArea,
|
|
20549
|
+
setInputWrapperRef = _ref.setInputWrapperRef,
|
|
20687
20550
|
props = _objectWithoutProperties$1(_ref, _excluded$k);
|
|
20688
|
-
return /*#__PURE__*/jsxs(StyledBaseInputWrapper
|
|
20551
|
+
return /*#__PURE__*/jsxs(StyledBaseInputWrapper
|
|
20552
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion, @typescript-eslint/no-explicit-any
|
|
20553
|
+
, _objectSpread$L(_objectSpread$L({
|
|
20554
|
+
ref: setInputWrapperRef,
|
|
20689
20555
|
display: "flex",
|
|
20690
20556
|
flexDirection: "row",
|
|
20691
20557
|
width: "100%",
|
|
@@ -20701,7 +20567,7 @@ var BaseInputWrapper = function BaseInputWrapper(_ref) {
|
|
|
20701
20567
|
}));
|
|
20702
20568
|
};
|
|
20703
20569
|
|
|
20704
|
-
var _excluded$j = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "shouldIgnoreBlurAnimation", "autoCapitalize", "testID"];
|
|
20570
|
+
var _excluded$j = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "shouldIgnoreBlurAnimation", "autoCapitalize", "setInputWrapperRef", "testID"];
|
|
20705
20571
|
function ownKeys$L(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20706
20572
|
function _objectSpread$K(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$L(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$L(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
20707
20573
|
var autoCompleteSuggestionTypeValues = ['none', 'on', 'name', 'email', 'username', 'password', 'newPassword', 'oneTimeCode', 'telephone', 'postalCode', 'countryName', 'creditCardNumber', 'creditCardCSC', 'creditCardExpiry', 'creditCardExpiryMonth', 'creditCardExpiryYear'];
|
|
@@ -20936,6 +20802,7 @@ var BaseInput = /*#__PURE__*/React__default.forwardRef(function (_ref11, ref) {
|
|
|
20936
20802
|
isPopupExpanded = _ref11.isPopupExpanded,
|
|
20937
20803
|
shouldIgnoreBlurAnimation = _ref11.shouldIgnoreBlurAnimation,
|
|
20938
20804
|
autoCapitalize = _ref11.autoCapitalize,
|
|
20805
|
+
setInputWrapperRef = _ref11.setInputWrapperRef,
|
|
20939
20806
|
testID = _ref11.testID,
|
|
20940
20807
|
styledProps = _objectWithoutProperties$1(_ref11, _excluded$j);
|
|
20941
20808
|
var _useTheme = useTheme(),
|
|
@@ -21036,6 +20903,7 @@ var BaseInput = /*#__PURE__*/React__default.forwardRef(function (_ref11, ref) {
|
|
|
21036
20903
|
validationState: validationState,
|
|
21037
20904
|
currentInteraction: currentInteraction,
|
|
21038
20905
|
isLabelLeftPositioned: isLabelLeftPositioned,
|
|
20906
|
+
setInputWrapperRef: setInputWrapperRef,
|
|
21039
20907
|
children: [/*#__PURE__*/jsx(BaseInputVisuals, {
|
|
21040
20908
|
leadingIcon: leadingIcon,
|
|
21041
20909
|
prefix: prefix,
|
|
@@ -21261,7 +21129,8 @@ var _TextInput = function _TextInput(_ref2, ref) {
|
|
|
21261
21129
|
autoCapitalize = _ref2.autoCapitalize,
|
|
21262
21130
|
testID = _ref2.testID,
|
|
21263
21131
|
styledProps = _objectWithoutProperties$1(_ref2, _excluded$h);
|
|
21264
|
-
var textInputRef =
|
|
21132
|
+
var textInputRef = React__default.useRef(null);
|
|
21133
|
+
var mergedRef = useMergeRefs(ref, textInputRef);
|
|
21265
21134
|
var _useState = useState(false),
|
|
21266
21135
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21267
21136
|
shouldShowClearButton = _useState2[0],
|
|
@@ -21304,7 +21173,7 @@ var _TextInput = function _TextInput(_ref2, ref) {
|
|
|
21304
21173
|
return /*#__PURE__*/jsx(BaseInput, _objectSpread$I(_objectSpread$I({
|
|
21305
21174
|
id: "textinput",
|
|
21306
21175
|
componentName: MetaConstants.TextInput,
|
|
21307
|
-
ref:
|
|
21176
|
+
ref: mergedRef,
|
|
21308
21177
|
label: label,
|
|
21309
21178
|
accessibilityLabel: accessibilityLabel,
|
|
21310
21179
|
hideLabelText: !Boolean(label),
|
|
@@ -21406,7 +21275,6 @@ var _PasswordInput = function _PasswordInput(_ref, ref) {
|
|
|
21406
21275
|
autoCompleteSuggestionType = _ref.autoCompleteSuggestionType,
|
|
21407
21276
|
testID = _ref.testID,
|
|
21408
21277
|
styledProps = _objectWithoutProperties$1(_ref, _excluded$g);
|
|
21409
|
-
var inputRef = useBladeInnerRef(ref);
|
|
21410
21278
|
var _React$useState = React__default.useState(false),
|
|
21411
21279
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
21412
21280
|
isRevealed = _React$useState2[0],
|
|
@@ -21441,7 +21309,7 @@ var _PasswordInput = function _PasswordInput(_ref, ref) {
|
|
|
21441
21309
|
}) : null;
|
|
21442
21310
|
};
|
|
21443
21311
|
return /*#__PURE__*/jsx(BaseInput, _objectSpread$H({
|
|
21444
|
-
ref:
|
|
21312
|
+
ref: ref,
|
|
21445
21313
|
componentName: MetaConstants.PasswordInput,
|
|
21446
21314
|
id: "password-field",
|
|
21447
21315
|
label: label,
|
|
@@ -21517,7 +21385,8 @@ var _TextArea = function _TextArea(_ref, ref) {
|
|
|
21517
21385
|
numberOfLines = _ref$numberOfLines === void 0 ? 2 : _ref$numberOfLines,
|
|
21518
21386
|
testID = _ref.testID,
|
|
21519
21387
|
styledProps = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
21520
|
-
var inputRef =
|
|
21388
|
+
var inputRef = React__default.useRef(null);
|
|
21389
|
+
var mergedRef = useMergeRefs(ref, inputRef);
|
|
21521
21390
|
var _React$useState = React__default.useState(false),
|
|
21522
21391
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
21523
21392
|
shouldShowClearButton = _React$useState2[0],
|
|
@@ -21560,7 +21429,7 @@ var _TextArea = function _TextArea(_ref, ref) {
|
|
|
21560
21429
|
id: "textarea",
|
|
21561
21430
|
componentName: MetaConstants.TextArea,
|
|
21562
21431
|
autoFocus: autoFocus,
|
|
21563
|
-
ref:
|
|
21432
|
+
ref: mergedRef,
|
|
21564
21433
|
label: label,
|
|
21565
21434
|
accessibilityLabel: accessibilityLabel,
|
|
21566
21435
|
hideLabelText: !Boolean(label),
|
|
@@ -21988,13 +21857,8 @@ var _SelectInput = function _SelectInput(props, ref) {
|
|
|
21988
21857
|
isControlled = _useDropdown.isControlled,
|
|
21989
21858
|
setIsControlled = _useDropdown.setIsControlled,
|
|
21990
21859
|
selectionType = _useDropdown.selectionType,
|
|
21991
|
-
selectedIndices = _useDropdown.selectedIndices
|
|
21992
|
-
|
|
21993
|
-
onFocus: function onFocus(opts) {
|
|
21994
|
-
var _triggererRef$current;
|
|
21995
|
-
(_triggererRef$current = triggererRef.current) === null || _triggererRef$current === void 0 ? void 0 : _triggererRef$current.focus(opts);
|
|
21996
|
-
}
|
|
21997
|
-
});
|
|
21860
|
+
selectedIndices = _useDropdown.selectedIndices,
|
|
21861
|
+
triggererWrapperRef = _useDropdown.triggererWrapperRef;
|
|
21998
21862
|
var icon = props.icon;
|
|
21999
21863
|
props.onChange;
|
|
22000
21864
|
props.defaultValue;
|
|
@@ -22085,7 +21949,11 @@ var _SelectInput = function _SelectInput(props, ref) {
|
|
|
22085
21949
|
position: "relative",
|
|
22086
21950
|
children: [!isReactNative$4() ? /*#__PURE__*/jsx(VisuallyHidden, {
|
|
22087
21951
|
children: /*#__PURE__*/jsx("input", {
|
|
22088
|
-
|
|
21952
|
+
onFocus: function onFocus() {
|
|
21953
|
+
var _triggererRef$current;
|
|
21954
|
+
(_triggererRef$current = triggererRef.current) === null || _triggererRef$current === void 0 ? void 0 : _triggererRef$current.focus();
|
|
21955
|
+
},
|
|
21956
|
+
ref: ref,
|
|
22089
21957
|
tabIndex: -1,
|
|
22090
21958
|
required: props.isRequired,
|
|
22091
21959
|
name: props.name,
|
|
@@ -22104,6 +21972,9 @@ var _SelectInput = function _SelectInput(props, ref) {
|
|
|
22104
21972
|
hideLabelText: ((_props$label = props.label) === null || _props$label === void 0 ? void 0 : _props$label.length) === 0,
|
|
22105
21973
|
componentName: MetaConstants.SelectInput,
|
|
22106
21974
|
ref: !isReactNative$4() ? triggererRef : null,
|
|
21975
|
+
setInputWrapperRef: function setInputWrapperRef(wrapperNode) {
|
|
21976
|
+
triggererWrapperRef.current = wrapperNode;
|
|
21977
|
+
},
|
|
22107
21978
|
textAlign: "left",
|
|
22108
21979
|
value: displayValue,
|
|
22109
21980
|
placeholder: placeholder,
|