nearpay-datepicker-react 0.3.0 → 0.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/dist/index.cjs.js +13 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +13 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3285,6 +3285,7 @@ const Datepicker = (props) => {
|
|
|
3285
3285
|
const detail = container.getBoundingClientRect();
|
|
3286
3286
|
const screenCenter = window.innerWidth / 2;
|
|
3287
3287
|
const containerCenter = (detail.right - detail.x) / 2 + detail.x;
|
|
3288
|
+
const isRTL = i18n === "ar";
|
|
3288
3289
|
const alignRight = () => {
|
|
3289
3290
|
arrow.classList.add("right-0");
|
|
3290
3291
|
arrow.classList.add("mr-3.5");
|
|
@@ -3296,10 +3297,20 @@ const Datepicker = (props) => {
|
|
|
3296
3297
|
calendarContainer.classList.remove("right-0");
|
|
3297
3298
|
};
|
|
3298
3299
|
if (popoverDirection === "down-left" || popoverDirection === "up-left") {
|
|
3299
|
-
|
|
3300
|
+
if (isRTL) {
|
|
3301
|
+
alignLeft();
|
|
3302
|
+
}
|
|
3303
|
+
else {
|
|
3304
|
+
alignRight();
|
|
3305
|
+
}
|
|
3300
3306
|
}
|
|
3301
3307
|
else if (popoverDirection === "down-right" || popoverDirection === "up-right") {
|
|
3302
|
-
|
|
3308
|
+
if (isRTL) {
|
|
3309
|
+
alignRight();
|
|
3310
|
+
}
|
|
3311
|
+
else {
|
|
3312
|
+
alignLeft();
|
|
3313
|
+
}
|
|
3303
3314
|
}
|
|
3304
3315
|
else {
|
|
3305
3316
|
if (containerCenter > screenCenter) {
|