@ringcentral/juno 2.21.1 → 2.21.2

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.
@@ -307,7 +307,7 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
307
307
  maxLength: maxLength, containerRef: inputContainerRef }, getInputAriaProps(TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.inputProps)),
308
308
  }, rest), { value: inputValue, clearBtn: false })),
309
309
  !helperText && screenReaderText && (react_1.default.createElement(VisuallyHidden_1.RcVisuallyHidden, { id: describedbyId }, screenReaderText)),
310
- react_1.default.createElement(styles_1.StyledPopper, tslib_1.__assign({ open: open, position: position, component: PopperComponent, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef,
310
+ react_1.default.createElement(styles_1.StyledPopper, tslib_1.__assign({ open: open, position: position, component: PopperComponent, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef, modifiers: { fixOffsets: utils_1.fixOffsetsModifer },
311
311
  // * view type in popper.js
312
312
  popperOptions: {
313
313
  onUpdate: function (e) {
@@ -0,0 +1,5 @@
1
+ export declare const fixOffsetsModifer: {
2
+ order: number;
3
+ enabled: boolean;
4
+ fn: (data: any) => any;
5
+ };
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ exports.fixOffsetsModifer = {
5
+ order: 890,
6
+ enabled: true,
7
+ fn: function (data) {
8
+ var e_1, _a;
9
+ try {
10
+ for (var _b = tslib_1.__values([
11
+ 'transform',
12
+ 'msTransform',
13
+ 'WebkitTransform',
14
+ 'MozTransform',
15
+ 'OTransform',
16
+ ]), _c = _b.next(); !_c.done; _c = _b.next()) {
17
+ var property = _c.value;
18
+ var tranformValue = data.styles[property];
19
+ if (tranformValue) {
20
+ var matchValue = tranformValue.match(/translate3d\((\d+)px, (\d+)px, 0\)/);
21
+ if (matchValue) {
22
+ var dpr = window.devicePixelRatio;
23
+ var x = Math.round(Number(matchValue[1]) * dpr) / dpr;
24
+ var y = Math.round(Number(matchValue[2]) * dpr) / dpr;
25
+ data.styles.transform = "translate3d(" + x + "px, " + y + "px, 0)";
26
+ }
27
+ }
28
+ }
29
+ }
30
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
31
+ finally {
32
+ try {
33
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
34
+ }
35
+ finally { if (e_1) throw e_1.error; }
36
+ }
37
+ return data;
38
+ },
39
+ };
@@ -5,3 +5,4 @@ export * from './useDownshift';
5
5
  export * from './useDownshiftError';
6
6
  export * from './useDownshiftGroup';
7
7
  export * from './useDownshiftTag';
8
+ export * from './fixOffsetsModifer';
@@ -6,3 +6,4 @@ tslib_1.__exportStar(require("./useDownshift"), exports);
6
6
  tslib_1.__exportStar(require("./useDownshiftError"), exports);
7
7
  tslib_1.__exportStar(require("./useDownshiftGroup"), exports);
8
8
  tslib_1.__exportStar(require("./useDownshiftTag"), exports);
9
+ tslib_1.__exportStar(require("./fixOffsetsModifer"), exports);
@@ -9,7 +9,7 @@ import { ClearIconButton } from '../Forms/TextField/styles/ClearIconButton';
9
9
  import { RcVisuallyHidden } from '../VisuallyHidden';
10
10
  import { ArrowDownButton, DownshiftStyle, EndAdornment, RcDownshiftInput, StyledPopper, StyledTextField, } from './styles';
11
11
  import { RcSuggestionList } from './SuggestionList';
12
- import { DEFAULT_GET_OPTION_LABEL, DEFAULT_KEY_TO_CHIPS, DEFAULT_LIMIT_CHIPS, RcDownshiftDefaultFilterOptions, RcDownshiftInputClasses, useDownshift, useDownshiftError, } from './utils';
12
+ import { DEFAULT_GET_OPTION_LABEL, DEFAULT_KEY_TO_CHIPS, DEFAULT_LIMIT_CHIPS, fixOffsetsModifer, RcDownshiftDefaultFilterOptions, RcDownshiftInputClasses, useDownshift, useDownshiftError, } from './utils';
13
13
  /**
14
14
  * default transition style for grow when not virtualize
15
15
  */
@@ -303,7 +303,7 @@ var _RcDownshift = memo(forwardRef(function (inProps, ref) {
303
303
  maxLength: maxLength, containerRef: inputContainerRef }, getInputAriaProps(TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.inputProps)),
304
304
  }, rest), { value: inputValue, clearBtn: false })),
305
305
  !helperText && screenReaderText && (React.createElement(RcVisuallyHidden, { id: describedbyId }, screenReaderText)),
306
- React.createElement(StyledPopper, __assign({ open: open, position: position, component: PopperComponent, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef,
306
+ React.createElement(StyledPopper, __assign({ open: open, position: position, component: PopperComponent, placement: "bottom-start", anchorEl: anchorElRef.current, "data-test-automation-id": "suggestions-list", popperRef: popperRef, modifiers: { fixOffsets: fixOffsetsModifer },
307
307
  // * view type in popper.js
308
308
  popperOptions: {
309
309
  onUpdate: function (e) {
@@ -0,0 +1,37 @@
1
+ import { __values } from "tslib";
2
+ export var fixOffsetsModifer = {
3
+ order: 890,
4
+ enabled: true,
5
+ fn: function (data) {
6
+ var e_1, _a;
7
+ try {
8
+ for (var _b = __values([
9
+ 'transform',
10
+ 'msTransform',
11
+ 'WebkitTransform',
12
+ 'MozTransform',
13
+ 'OTransform',
14
+ ]), _c = _b.next(); !_c.done; _c = _b.next()) {
15
+ var property = _c.value;
16
+ var tranformValue = data.styles[property];
17
+ if (tranformValue) {
18
+ var matchValue = tranformValue.match(/translate3d\((\d+)px, (\d+)px, 0\)/);
19
+ if (matchValue) {
20
+ var dpr = window.devicePixelRatio;
21
+ var x = Math.round(Number(matchValue[1]) * dpr) / dpr;
22
+ var y = Math.round(Number(matchValue[2]) * dpr) / dpr;
23
+ data.styles.transform = "translate3d(" + x + "px, " + y + "px, 0)";
24
+ }
25
+ }
26
+ }
27
+ }
28
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
29
+ finally {
30
+ try {
31
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
32
+ }
33
+ finally { if (e_1) throw e_1.error; }
34
+ }
35
+ return data;
36
+ },
37
+ };
@@ -3,3 +3,4 @@ export * from './useDownshift';
3
3
  export * from './useDownshiftError';
4
4
  export * from './useDownshiftGroup';
5
5
  export * from './useDownshiftTag';
6
+ export * from './fixOffsetsModifer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ringcentral/juno",
3
- "version": "2.21.1",
3
+ "version": "2.21.2",
4
4
  "author": "RingCentral",
5
5
  "license": "MIT",
6
6
  "main": "./index.js",