@mlw-packages/react-components 1.10.23 → 1.10.25

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.d.mts CHANGED
@@ -1018,6 +1018,7 @@ interface EventCalendarProps$1 {
1018
1018
  className?: string;
1019
1019
  initialView?: CalendarViewAgenda;
1020
1020
  initialDate?: Date;
1021
+ optionsViewEvents?: CalendarViewAgenda[];
1021
1022
  onClick?: ((event: CalendarEventAgenda, e?: React__default.MouseEvent) => void) | React__default.ReactElement<ModalLikeProps>;
1022
1023
  showYearView?: boolean;
1023
1024
  noTime?: boolean;
@@ -1033,7 +1034,7 @@ interface ModalLikeProps {
1033
1034
  onClose?: () => void;
1034
1035
  [key: string]: unknown;
1035
1036
  }
1036
- declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
1037
+ declare function EventAgenda({ events, optionsViewEvents, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
1037
1038
 
1038
1039
  interface EventItemProps$1 {
1039
1040
  event: CalendarEventAgenda;
package/dist/index.d.ts CHANGED
@@ -1018,6 +1018,7 @@ interface EventCalendarProps$1 {
1018
1018
  className?: string;
1019
1019
  initialView?: CalendarViewAgenda;
1020
1020
  initialDate?: Date;
1021
+ optionsViewEvents?: CalendarViewAgenda[];
1021
1022
  onClick?: ((event: CalendarEventAgenda, e?: React__default.MouseEvent) => void) | React__default.ReactElement<ModalLikeProps>;
1022
1023
  showYearView?: boolean;
1023
1024
  noTime?: boolean;
@@ -1033,7 +1034,7 @@ interface ModalLikeProps {
1033
1034
  onClose?: () => void;
1034
1035
  [key: string]: unknown;
1035
1036
  }
1036
- declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
1037
+ declare function EventAgenda({ events, optionsViewEvents, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
1037
1038
 
1038
1039
  interface EventItemProps$1 {
1039
1040
  event: CalendarEventAgenda;
package/dist/index.js CHANGED
@@ -10227,6 +10227,7 @@ function Select({
10227
10227
  }
10228
10228
  function EventAgenda({
10229
10229
  events = [],
10230
+ optionsViewEvents,
10230
10231
  onEventUpdate,
10231
10232
  className,
10232
10233
  initialView = "month",
@@ -10239,7 +10240,7 @@ function EventAgenda({
10239
10240
  onlyWeek,
10240
10241
  onlyAgenda,
10241
10242
  onlyYear,
10242
- allowCellClick = false
10243
+ allowCellClick = true
10243
10244
  }) {
10244
10245
  const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
10245
10246
  const [currentDate, setCurrentDate] = React32.useState(
@@ -10334,7 +10335,11 @@ function EventAgenda({
10334
10335
  }
10335
10336
  return capitalize2(dateFns.format(currentDate, "MMMM yyyy", { locale: locale.ptBR }));
10336
10337
  }, [currentDate, activeView]);
10337
- const availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
10338
+ let availableViews;
10339
+ if (optionsViewEvents?.length == 0 || !optionsViewEvents)
10340
+ availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
10341
+ else
10342
+ availableViews = [...new Set(optionsViewEvents.map((options) => options))];
10338
10343
  const selectItems = availableViews.map(
10339
10344
  (v) => ({
10340
10345
  label: viewLabel(v),
package/dist/index.mjs CHANGED
@@ -10185,6 +10185,7 @@ function Select({
10185
10185
  }
10186
10186
  function EventAgenda({
10187
10187
  events = [],
10188
+ optionsViewEvents,
10188
10189
  onEventUpdate,
10189
10190
  className,
10190
10191
  initialView = "month",
@@ -10197,7 +10198,7 @@ function EventAgenda({
10197
10198
  onlyWeek,
10198
10199
  onlyAgenda,
10199
10200
  onlyYear,
10200
- allowCellClick = false
10201
+ allowCellClick = true
10201
10202
  }) {
10202
10203
  const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
10203
10204
  const [currentDate, setCurrentDate] = useState(
@@ -10292,7 +10293,11 @@ function EventAgenda({
10292
10293
  }
10293
10294
  return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
10294
10295
  }, [currentDate, activeView]);
10295
- const availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
10296
+ let availableViews;
10297
+ if (optionsViewEvents?.length == 0 || !optionsViewEvents)
10298
+ availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
10299
+ else
10300
+ availableViews = [...new Set(optionsViewEvents.map((options) => options))];
10296
10301
  const selectItems = availableViews.map(
10297
10302
  (v) => ({
10298
10303
  label: viewLabel(v),
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "access": "public",
6
6
  "type": "module"
7
7
  },
8
- "version": "1.10.23",
8
+ "version": "1.10.25",
9
9
  "homepage": "https://main--68e80310a069c2f10b546ef3.chromatic.com/",
10
10
  "repository": {
11
11
  "type": "git",