@aleen42/calendar 1.0.0-beta.1 → 1.0.0-beta.3

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/demo.html CHANGED
@@ -5,12 +5,19 @@
5
5
  <html lang="en">
6
6
  <head>
7
7
  <script src="./node_modules/jquery/dist/jquery.js"></script>
8
+ <script>
9
+ var X = {};
10
+ var CM_LOCALE = new URLSearchParams(location.search).get('locale') ?? 'en_US'
11
+ var CM_USER = {};
12
+ var CF_USER = {isRtl : /^(ar|ug)$/.test(self.CM_LOCALE)};
13
+ </script>
8
14
  <script src="./dist/calendar.js"></script>
9
15
  <link rel="stylesheet" href="./dist/iconfont.css" />
10
16
  <link rel="stylesheet" href="./dist/calendar.css" />
11
17
  <style>
12
18
  body {
13
19
  margin: 0;
20
+ font-size: 14px;
14
21
  }
15
22
 
16
23
  .cal-aside {
package/dist/calendar.css CHANGED
@@ -1570,7 +1570,7 @@ body p {
1570
1570
  border-radius: 3px;
1571
1571
  padding: 2px 4px 2px 10px;
1572
1572
  box-sizing: border-box;
1573
- z-index: 1;
1573
+ z-index: 2;
1574
1574
  position: relative;
1575
1575
  cursor: pointer;
1576
1576
  }
@@ -1685,7 +1685,7 @@ body p {
1685
1685
  }
1686
1686
  .m-cal-day .content-wrapper .main-content .calendar .events li.now,
1687
1687
  .m-cal-week .content-wrapper .main-content .calendar .events li.now {
1688
- z-index: 2;
1688
+ z-index: 3;
1689
1689
  }
1690
1690
  .m-cal-day .content-wrapper .main-content .calendar .events li:not(.slim) .event_icon,
1691
1691
  .m-cal-week .content-wrapper .main-content .calendar .events li:not(.slim) .event_icon {
@@ -1754,7 +1754,6 @@ body p {
1754
1754
  .m-cal-week .content-wrapper .main-content .calendar table td {
1755
1755
  border-style: solid;
1756
1756
  border-color: #e8e8e8;
1757
- border-width: 0 1px;
1758
1757
  }
1759
1758
  .m-cal-day .content-wrapper .main-content .calendar table th:first-child,
1760
1759
  .m-cal-week .content-wrapper .main-content .calendar table th:first-child,
@@ -1773,6 +1772,18 @@ body p {
1773
1772
  border-width: 0 0 0 1px;
1774
1773
  }
1775
1774
  .m-cal-day .content-wrapper .main-content .calendar table th,
1775
+ .m-cal-week .content-wrapper .main-content .calendar table th {
1776
+ border-width: 0 0 0 1px;
1777
+ }
1778
+ .m-cal-day .content-wrapper .main-content .calendar table th.cal-today,
1779
+ .m-cal-week .content-wrapper .main-content .calendar table th.cal-today {
1780
+ border-top-width: 4px;
1781
+ }
1782
+ .m-cal-day .content-wrapper .main-content .calendar table td,
1783
+ .m-cal-week .content-wrapper .main-content .calendar table td {
1784
+ border-width: 0 1px;
1785
+ }
1786
+ .m-cal-day .content-wrapper .main-content .calendar table th,
1776
1787
  .m-cal-week .content-wrapper .main-content .calendar table th {
1777
1788
  height: 60px;
1778
1789
  font-size: 12px;
@@ -1795,9 +1806,6 @@ body p {
1795
1806
  line-height: 28px;
1796
1807
  margin-top: 4px;
1797
1808
  }
1798
- .m-cal-day .content-wrapper .main-content .calendar table th {
1799
- border-width: 0 0 0 1px;
1800
- }
1801
1809
  .m-cal-month .content-wrapper .main-content.aside {
1802
1810
  margin-right: 340px /** gap = */;
1803
1811
  }
@@ -1827,6 +1835,7 @@ body p {
1827
1835
  width: 100%;
1828
1836
  box-sizing: border-box;
1829
1837
  padding: 8px 0 4px 14px;
1838
+ line-height: 16px;
1830
1839
  }
1831
1840
  .m-cal-month .content-wrapper .main-content .calendar table td .MonthEvent {
1832
1841
  padding: 0 2px;
package/dist/calendar.js CHANGED
@@ -32377,11 +32377,6 @@ function addIcon($parent, icon, iconStyle) {
32377
32377
 
32378
32378
 
32379
32379
 
32380
- self.X = {};
32381
- self.CM_LOCALE = new URLSearchParams(location.search).get('locale') ?? 'en_US'
32382
- self.CM_USER = {};
32383
- self.CF_USER = {isRtl : /^(ar|ug)$/.test(self.CM_LOCALE)};
32384
-
32385
32380
  }();
32386
32381
  // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
32387
32382
  !function() {
@@ -32852,7 +32847,10 @@ const Calendar = ([$context, $datePicker], viewType, options) => {
32852
32847
  const $window = external_$_(window).off(RESIZE_EVENT).on(RESIZE_EVENT, () => {
32853
32848
  if ($thead.is(':visible')) {
32854
32849
  adjustContainer?.();
32855
- $thead.closest('div').css('paddingRight', scrollable($scroll) ? jquery_scrollbarWidth() : 0);
32850
+ $thead.closest('div').css({
32851
+ // paddingLeft | paddingRight
32852
+ [`padding${CF_USER.isRtl ? 'Left' : 'Right'}`] : scrollable($scroll) ? jquery_scrollbarWidth() : 0,
32853
+ });
32856
32854
  }
32857
32855
  }).resize();
32858
32856
 
@@ -32921,7 +32919,10 @@ const Calendar = ([$context, $datePicker], viewType, options) => {
32921
32919
  const $now = external_$_(`<li class=${NOW_CLASS}>`);
32922
32920
  const calcSeconds = mDate => mDate.hour() * 60 * 60 + mDate.minute() * 60 + mDate.second();
32923
32921
  adjustContainer = () => {
32924
- $allDays.css('paddingRight', scrollable($scroll) && !scrollable($allDays) ? jquery_scrollbarWidth() : 0);
32922
+ $allDays.css({
32923
+ // paddingLeft | paddingRight
32924
+ [`padding${CF_USER.isRtl ? 'Left' : 'Right'}`] : scrollable($scroll) && !scrollable($allDays) ? jquery_scrollbarWidth() : 0,
32925
+ });
32925
32926
 
32926
32927
  // 合并全天事件或事件超过一天的事件
32927
32928
  handleHorizontalEvents($allDays, cachedList, 0,