sapp-common-package-test-final 1.0.4 → 1.0.6

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IEvent, INorm } from '../../types';
2
+ import { IEvent, IFilter, INorm } from '../../types';
3
3
  interface IAntdCalendarProps {
4
4
  events: IEvent[];
5
5
  norms?: INorm[];
@@ -12,6 +12,7 @@ interface IAntdCalendarProps {
12
12
  onEventDetail?: (event: IEvent) => void;
13
13
  loading?: boolean;
14
14
  type?: 'normal' | 'filter';
15
+ onFilter?: (filter: IFilter, events: IEvent[]) => void;
15
16
  }
16
- declare const SAPPCalendar: ({ teacherName, events, norms, showTeacherName, showWeeklyNorm, onOpenDetail, onOpenCreate, onRefetchAPI, onEventDetail, loading, type }: IAntdCalendarProps) => React.JSX.Element;
17
+ declare const SAPPCalendar: ({ teacherName, events, norms, showTeacherName, showWeeklyNorm, onOpenDetail, onOpenCreate, onRefetchAPI, onEventDetail, loading, type, onFilter }: IAntdCalendarProps) => React.JSX.Element;
17
18
  export default SAPPCalendar;
package/dist/index.css CHANGED
@@ -609,7 +609,7 @@ div._12I9I {
609
609
  }
610
610
 
611
611
  ._3EiSs {
612
- @apply py-3 px-5 rounded-[6px] text-sm hover:bg-primary hover:text-white cursor-pointer;
612
+ @apply py-3 px-5 rounded-[6px] text-[14px] hover:bg-primary hover:text-white cursor-pointer;
613
613
  }
614
614
 
615
615
  ._3fS4I {
@@ -661,7 +661,7 @@ div._2Uj7C {
661
661
  }
662
662
 
663
663
  ._2OOkM div._pki6z input {
664
- @apply !w-[150px] !text-lg !font-semibold !text-black !cursor-pointer focus-within:border-none;
664
+ @apply !w-[150px] !text-[18px] !font-semibold !text-black !cursor-pointer focus-within:border-none;
665
665
  }
666
666
 
667
667
  ._3HZUA {
@@ -687,7 +687,7 @@ div._US4AW {
687
687
  }
688
688
 
689
689
  ._2244F {
690
- @apply text-center font-semibold text-xs;
690
+ @apply text-center font-semibold text-[12px];
691
691
  }
692
692
 
693
693
  ._3gTTi
@@ -731,7 +731,7 @@ div._30qaU > div {
731
731
  }
732
732
 
733
733
  ._33-xY > div {
734
- @apply w-fit pt-2 px-2 text-sm font-normal line-clamp-1;
734
+ @apply w-fit pt-2 px-2 text-[14px] font-normal line-clamp-1;
735
735
  }
736
736
 
737
737
  ._33-xY > ul,
@@ -761,7 +761,7 @@ div._30qaU > div {
761
761
  }
762
762
 
763
763
  ._3HaWW {
764
- @apply flex flex-col gap-y-0.5 text-center font-semibold text-xs;
764
+ @apply flex flex-col gap-y-0.5 text-center font-semibold text-[12px];
765
765
  }
766
766
 
767
767
  ._1JsGC thead th:first-child > ._3HaWW {
@@ -773,7 +773,7 @@ div._30qaU > div {
773
773
  }
774
774
 
775
775
  ._1JsGC tbody td:first-child > div {
776
- @apply text-center text-xs;
776
+ @apply text-center text-[12px];
777
777
  }
778
778
 
779
779
  ._1tvYg {
@@ -781,7 +781,7 @@ div._30qaU > div {
781
781
  }
782
782
 
783
783
  ._1tvYg > div {
784
- @apply absolute z-10 left-[5%] w-[90%] !border-l-2 !border-solid rounded-sm p-3 cursor-pointer;
784
+ @apply absolute z-10 left-[5%] w-[90%] !border-l-2 !border-solid rounded-[14px] p-3 cursor-pointer;
785
785
  }
786
786
 
787
787
  ._35RRs {
@@ -789,11 +789,11 @@ div._30qaU > div {
789
789
  }
790
790
 
791
791
  ._1VuQw {
792
- @apply text-sm font-semibold;
792
+ @apply text-[14px] font-semibold;
793
793
  }
794
794
 
795
795
  ._1D_PH {
796
- @apply text-sm font-normal;
796
+ @apply text-[14px] font-normal;
797
797
  }
798
798
 
799
799
  ._16clH,
package/dist/index.js CHANGED
@@ -860,17 +860,26 @@ var FilterCalendar = function FilterCalendar(_ref) {
860
860
  });
861
861
  break;
862
862
  }
863
+ case 'day':
864
+ {
865
+ setFilter(function (prev) {
866
+ return _extends({}, prev, {
867
+ day: value
868
+ });
869
+ });
870
+ break;
871
+ }
863
872
  }
864
873
  };
865
- var handleFilterday = function handleFilterday(date, mode) {
866
- console.log('filterDate:', date, mode);
874
+ var handleFilterday = function handleFilterday(date) {
875
+ handleFilter('day', date.toString());
867
876
  };
868
877
  return React__default.createElement("div", {
869
878
  className: styles$1['calendar-filter']
870
879
  }, React__default.createElement(antd.Calendar, {
871
880
  mode: 'month',
872
881
  fullscreen: false,
873
- onPanelChange: handleFilterday
882
+ onChange: handleFilterday
874
883
  }), React__default.createElement("div", null, React__default.createElement("div", {
875
884
  className: styles$1['calendar-filter_title']
876
885
  }, React__default.createElement(TagIcon, null), React__default.createElement("h3", null, "Notes")), React__default.createElement("div", null, noteFilter.map(function (item) {
@@ -1092,7 +1101,8 @@ var SAPPCalendar = function SAPPCalendar(_ref) {
1092
1101
  onEventDetail = _ref.onEventDetail,
1093
1102
  loading = _ref.loading,
1094
1103
  _ref$type = _ref.type,
1095
- type = _ref$type === void 0 ? 'normal' : _ref$type;
1104
+ type = _ref$type === void 0 ? 'normal' : _ref$type,
1105
+ onFilter = _ref.onFilter;
1096
1106
  var _useState = React.useState(dayjs()),
1097
1107
  currentDate = _useState[0],
1098
1108
  setCurrentDate = _useState[1];
@@ -1134,7 +1144,7 @@ var SAPPCalendar = function SAPPCalendar(_ref) {
1134
1144
  }, [startDate, endDate]);
1135
1145
  React.useEffect(function () {
1136
1146
  if (type === 'filter') {
1137
- console.log('filter', events);
1147
+ onFilter && onFilter(filter, events);
1138
1148
  }
1139
1149
  }, [filter, events]);
1140
1150
  return React__default.createElement("div", {