@mamrp/components 1.6.9 → 1.7.0
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.js +75 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1411,6 +1411,10 @@ var JalaliDatePicker = ({
|
|
|
1411
1411
|
},
|
|
1412
1412
|
"& .MuiInputBase-root": {
|
|
1413
1413
|
height: size === "small" ? 40 : 56
|
|
1414
|
+
},
|
|
1415
|
+
// Fix for extra 'ا' in calendar header month name
|
|
1416
|
+
"& .MuiPickersCalendarHeader-label": {
|
|
1417
|
+
fontSize: "1rem"
|
|
1414
1418
|
}
|
|
1415
1419
|
},
|
|
1416
1420
|
slots: {
|
|
@@ -1418,6 +1422,77 @@ var JalaliDatePicker = ({
|
|
|
1418
1422
|
clearButton: React8.Fragment,
|
|
1419
1423
|
clearIcon: React8.Fragment
|
|
1420
1424
|
},
|
|
1425
|
+
calendarHeader: (props) => {
|
|
1426
|
+
let labelText = props.currentMonth.format("jMMMM jYYYY");
|
|
1427
|
+
const persianMonths = [
|
|
1428
|
+
"\u0641\u0631\u0648\u0631\u062F\u06CC\u0646",
|
|
1429
|
+
"\u0627\u0631\u062F\u06CC\u0628\u0647\u0634\u062A",
|
|
1430
|
+
"\u062E\u0631\u062F\u0627\u062F",
|
|
1431
|
+
"\u062A\u06CC\u0631",
|
|
1432
|
+
"\u0645\u0631\u062F\u0627\u062F",
|
|
1433
|
+
"\u0634\u0647\u0631\u06CC\u0648\u0631",
|
|
1434
|
+
"\u0645\u0647\u0631",
|
|
1435
|
+
"\u0622\u0628\u0627\u0646",
|
|
1436
|
+
"\u0622\u0630\u0631",
|
|
1437
|
+
"\u062F\u06CC",
|
|
1438
|
+
"\u0628\u0647\u0645\u0646",
|
|
1439
|
+
"\u0627\u0633\u0641\u0646\u062F"
|
|
1440
|
+
];
|
|
1441
|
+
const parts = labelText.split(" ");
|
|
1442
|
+
if (parts.length > 0 && parts[0].startsWith("\u0627")) {
|
|
1443
|
+
const withoutAlef = parts[0].substring(1);
|
|
1444
|
+
if (persianMonths.includes(withoutAlef)) {
|
|
1445
|
+
parts[0] = withoutAlef;
|
|
1446
|
+
labelText = parts.join(" ");
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1450
|
+
Box7,
|
|
1451
|
+
{
|
|
1452
|
+
sx: {
|
|
1453
|
+
display: "flex",
|
|
1454
|
+
alignItems: "center",
|
|
1455
|
+
justifyContent: "space-between",
|
|
1456
|
+
padding: "8px 16px",
|
|
1457
|
+
minHeight: "40px"
|
|
1458
|
+
}
|
|
1459
|
+
},
|
|
1460
|
+
/* @__PURE__ */ React8.createElement(
|
|
1461
|
+
IconButton4,
|
|
1462
|
+
{
|
|
1463
|
+
onClick: () => props.onMonthChange(
|
|
1464
|
+
props.currentMonth.clone().subtract(1, "month"),
|
|
1465
|
+
"left"
|
|
1466
|
+
),
|
|
1467
|
+
title: "\u0645\u0627\u0647 \u0642\u0628\u0644"
|
|
1468
|
+
},
|
|
1469
|
+
/* @__PURE__ */ React8.createElement(MdChevronRight, null)
|
|
1470
|
+
),
|
|
1471
|
+
/* @__PURE__ */ React8.createElement(
|
|
1472
|
+
Typography3,
|
|
1473
|
+
{
|
|
1474
|
+
variant: "body1",
|
|
1475
|
+
onClick: props.onViewChange ? () => props.onViewChange?.("year") : void 0,
|
|
1476
|
+
sx: {
|
|
1477
|
+
cursor: props.onViewChange ? "pointer" : "default",
|
|
1478
|
+
fontWeight: 500
|
|
1479
|
+
}
|
|
1480
|
+
},
|
|
1481
|
+
labelText
|
|
1482
|
+
),
|
|
1483
|
+
/* @__PURE__ */ React8.createElement(
|
|
1484
|
+
IconButton4,
|
|
1485
|
+
{
|
|
1486
|
+
onClick: () => props.onMonthChange(
|
|
1487
|
+
props.currentMonth.clone().add(1, "month"),
|
|
1488
|
+
"right"
|
|
1489
|
+
),
|
|
1490
|
+
title: "\u0645\u0627\u0647 \u0628\u0639\u062F"
|
|
1491
|
+
},
|
|
1492
|
+
/* @__PURE__ */ React8.createElement(MdChevronLeft, null)
|
|
1493
|
+
)
|
|
1494
|
+
);
|
|
1495
|
+
},
|
|
1421
1496
|
toolbar: () => {
|
|
1422
1497
|
const currentDate = moment(field.value);
|
|
1423
1498
|
let formattedDate = currentDate.format("dddd, jDD jMMMM");
|