plataforma-fundacao-componentes 2.23.14 → 2.23.15

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,11 +1,5 @@
1
1
  import React from 'react';
2
2
  import './AssembleiaItem.scss';
3
- export declare enum AssembleiaModo {
4
- Presencial = 1,
5
- TabletDigital = 2,
6
- AgenciaDigital = 3,
7
- Digital = 4
8
- }
9
3
  interface AssembleiaItemProps {
10
4
  nomeCooperativa: string;
11
5
  presencial?: {
@@ -15,7 +9,7 @@ interface AssembleiaItemProps {
15
9
  };
16
10
  dataInicio?: string;
17
11
  dataTermino?: string;
18
- modo?: AssembleiaModo;
12
+ modo?: number;
19
13
  onClick?: (evt: any) => void;
20
14
  language: {
21
15
  dataInicio: string;
@@ -10,11 +10,13 @@ export interface CalendarProps {
10
10
  referencia?: Date;
11
11
  disabledNextMonth?: boolean;
12
12
  disabledPrevMonth?: boolean;
13
+ disabledPrevAddButton?: boolean;
13
14
  highlightWeekends?: boolean;
14
15
  showAddButton?: boolean;
15
16
  onAddButtonClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
16
17
  showPlusIcon?: boolean;
17
18
  onPlusButtonClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
19
+ onDateClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
18
20
  }
19
21
  declare function Calendar(props: CalendarProps): JSX.Element;
20
22
  declare namespace Calendar {
@@ -13,9 +13,11 @@ interface CalendarDaysProps {
13
13
  highlightWeekends: boolean;
14
14
  loading: boolean;
15
15
  showAddButton?: boolean;
16
+ disabledPrevAddButton?: boolean;
16
17
  onAddButtonClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
17
18
  showPlusIcon?: boolean;
18
19
  onPlusButtonClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
20
+ onDateClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
19
21
  }
20
22
  declare function CalendarDays(props: CalendarDaysProps): JSX.Element;
21
23
  declare const _default: React.MemoExoticComponent<typeof CalendarDays>;
@@ -7,11 +7,13 @@ export interface CalendarMonthDayProps {
7
7
  pocket?: boolean;
8
8
  isToday?: boolean;
9
9
  disabled?: boolean;
10
+ disabledPrevAddButton?: boolean;
10
11
  language: CalendarLanguage;
11
12
  eventos?: CalendarEventProps[];
12
13
  showAddButton?: boolean;
13
14
  onAddButtonClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
14
15
  onPlusButtonClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
16
+ onDateClick?: (day: Date, evt: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
15
17
  showPlusIcon?: boolean;
16
18
  highlightWeekends: boolean;
17
19
  }
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.css CHANGED
@@ -8350,8 +8350,8 @@ tr:first-child th:last-child {
8350
8350
  .component-table-with-overflow .component-table-with-overflow-wrapper th[data-draggable='true'],
8351
8351
  .component-table-with-overflow .component-table-with-overflow-wrapper td[data-draggable='true'] {
8352
8352
  -webkit-user-select: none;
8353
- -moz-user-select: none;
8354
- user-select: none;
8353
+ -moz-user-select: none;
8354
+ user-select: none;
8355
8355
  cursor: -webkit-grab;
8356
8356
  cursor: grab; }
8357
8357
  .component-table-with-overflow .component-table-with-overflow-wrapper table:active th[data-draggable='true'],
@@ -8363,17 +8363,20 @@ tr:first-child th:last-child {
8363
8363
  .component-table-with-overflow .component-table-with-overflow-wrapper .left-0 {
8364
8364
  left: 0;
8365
8365
  width: 8px;
8366
- height: 44px; }
8366
+ min-height: 44px;
8367
+ height: -webkit-fit-content;
8368
+ height: -moz-fit-content;
8369
+ height: fit-content; }
8367
8370
  .component-table-with-overflow .component-table-with-overflow-wrapper .right-0 {
8368
8371
  right: 0;
8369
8372
  width: 8px;
8370
- height: 44px; } }
8373
+ min-height: 44px; } }
8371
8374
  .component-table-with-overflow .component-table-with-overflow-wrapper.no-result {
8372
8375
  padding-bottom: 44px; }
8373
8376
  .component-table-with-overflow .component-table-with-overflow-no-result {
8374
8377
  -webkit-user-select: none;
8375
- -moz-user-select: none;
8376
- user-select: none;
8378
+ -moz-user-select: none;
8379
+ user-select: none;
8377
8380
  position: absolute;
8378
8381
  left: 0;
8379
8382
  width: 100%;
@@ -9833,12 +9836,15 @@ nav.component-tabs {
9833
9836
  max-width: calc(100% / 7);
9834
9837
  background-color: #fefefe;
9835
9838
  -webkit-user-select: none;
9836
- -moz-user-select: none;
9837
- user-select: none;
9839
+ -moz-user-select: none;
9840
+ user-select: none;
9838
9841
  display: flex;
9839
9842
  flex-direction: column;
9843
+ z-index: 1;
9840
9844
  border-right: 1px solid #cdd3cd;
9841
9845
  border-bottom: 1px solid #cdd3cd; }
9846
+ .calendar-month-day.disabled {
9847
+ cursor: default; }
9842
9848
  .calendar-month-day .calendar-month-day-day {
9843
9849
  display: flex;
9844
9850
  align-items: center;
@@ -9876,6 +9882,10 @@ nav.component-tabs {
9876
9882
  box-shadow: 0 0 0 2px inset #d7e6c8; }
9877
9883
  .calendar-month-day.today.disabled .calendar-month-day-day {
9878
9884
  opacity: 0.4; }
9885
+ .calendar-month-day:hover {
9886
+ cursor: pointer; }
9887
+ .calendar-month-day.default-cursor {
9888
+ cursor: default; }
9879
9889
 
9880
9890
  .calendar-month-day:not(.pocket) {
9881
9891
  height: 125px;
@@ -9904,6 +9914,8 @@ nav.component-tabs {
9904
9914
  cursor: pointer; }
9905
9915
  .calendar-month-day:not(.pocket) button.calendar-month-day-button:not(:disabled):active span {
9906
9916
  transform: scale(0.95); }
9917
+ .calendar-month-day:not(.pocket) button.calendar-month-day-button:disabled {
9918
+ color: #828a82; }
9907
9919
  .calendar-month-day:not(.pocket) button.calendar-month-day-button svg {
9908
9920
  width: 13px;
9909
9921
  height: 13px;
package/dist/index.js CHANGED
@@ -4865,30 +4865,22 @@ AnimatedLink.defaultProps = {
4865
4865
  var AnimatedLink$1 = React.memo(AnimatedLink);
4866
4866
 
4867
4867
  var rootClassName$1F = 'assembleia-item';
4868
- var AssembleiaModo;
4869
-
4870
- (function (AssembleiaModo) {
4871
- AssembleiaModo[AssembleiaModo["Presencial"] = 1] = "Presencial";
4872
- AssembleiaModo[AssembleiaModo["TabletDigital"] = 2] = "TabletDigital";
4873
- AssembleiaModo[AssembleiaModo["AgenciaDigital"] = 3] = "AgenciaDigital";
4874
- AssembleiaModo[AssembleiaModo["Digital"] = 4] = "Digital";
4875
- })(AssembleiaModo || (AssembleiaModo = {}));
4876
4868
 
4877
4869
  function AssembleiaItem(props) {
4878
4870
  var _props$presencial;
4879
4871
 
4880
4872
  return React__default.createElement("div", {
4881
- className: getMergedClassNames([rootClassName$1F, props.modo === AssembleiaModo.Presencial ? 'presencial' : ''])
4873
+ className: getMergedClassNames([rootClassName$1F, props.modo === 1 ? 'presencial' : ''])
4882
4874
  }, React__default.createElement("div", {
4883
4875
  onClick: props.onClick,
4884
- className: getMergedClassNames([rootClassName$1F + "-first", props.modo === AssembleiaModo.Presencial ? 'presencial' : ''])
4876
+ className: getMergedClassNames([rootClassName$1F + "-first", props.modo === 1 ? 'presencial' : ''])
4885
4877
  }, React__default.createElement("div", {
4886
4878
  className: rootClassName$1F + "-left"
4887
4879
  }, React__default.createElement("div", {
4888
4880
  className: rootClassName$1F + "-coop"
4889
- }, props.nomeCooperativa, props.modo === AssembleiaModo.Presencial ? " - " + props.language.presencial : ''), React__default.createElement("div", {
4881
+ }, props.nomeCooperativa, props.modo === 1 ? " - " + props.language.presencial : ''), React__default.createElement("div", {
4890
4882
  className: rootClassName$1F + "-endereco nunito"
4891
- }, props.modo === AssembleiaModo.Presencial ? (_props$presencial = props.presencial) === null || _props$presencial === void 0 ? void 0 : _props$presencial.endereco : props.language.enderecoDigital)), React__default.createElement("div", {
4883
+ }, props.modo === 1 ? (_props$presencial = props.presencial) === null || _props$presencial === void 0 ? void 0 : _props$presencial.endereco : props.language.enderecoDigital)), React__default.createElement("div", {
4892
4884
  className: rootClassName$1F + "-right"
4893
4885
  }, React__default.createElement("div", {
4894
4886
  className: rootClassName$1F + "-col-data"
@@ -4904,7 +4896,7 @@ function AssembleiaItem(props) {
4904
4896
  className: rootClassName$1F + "-value-data nunito"
4905
4897
  }, props.dataTermino)), React__default.createElement("div", {
4906
4898
  className: rootClassName$1F + "-icon"
4907
- }, React__default.createElement(ChevronArrowRightIcon, null)))), props.presencial && props.modo !== AssembleiaModo.Presencial && React__default.createElement("div", {
4899
+ }, React__default.createElement(ChevronArrowRightIcon, null)))), props.presencial && props.modo !== 1 && React__default.createElement("div", {
4908
4900
  className: rootClassName$1F + "-second"
4909
4901
  }, React__default.createElement("div", {
4910
4902
  className: rootClassName$1F + "-left"
@@ -13223,7 +13215,7 @@ function CalendarEvent(props) {
13223
13215
  ref: ref,
13224
13216
  className: useMergedClassNames([rootClassName$30, props.size, props.borderStyle]),
13225
13217
  disabled: props.disabled,
13226
- onClick: function onClick() {
13218
+ onClick: function onClick(evt) {
13227
13219
  if (typeof props.onClick === 'function') {
13228
13220
  props.onClick();
13229
13221
  }
@@ -13231,6 +13223,8 @@ function CalendarEvent(props) {
13231
13223
  if (!props.forceExpanded && props.expansible) {
13232
13224
  setExpanded(!expanded);
13233
13225
  }
13226
+
13227
+ evt.stopPropagation();
13234
13228
  },
13235
13229
  style: {
13236
13230
  color: props.color,
@@ -13276,15 +13270,23 @@ function CalendarMonthDay(props) {
13276
13270
  var classNames = React.useMemo(function () {
13277
13271
  return getMergedClassNames([rootClassName$32, props.pocket ? 'pocket' : '', props.isToday ? 'today' : '', props.disabled ? 'disabled' : '', props.highlightWeekends && (props.day.getDay() === 0 || props.day.getDay() === 6) ? 'highlight' : '']);
13278
13272
  }, [props.day, props.disabled, props.highlightWeekends, props.isToday, props.pocket]);
13273
+ var date = new Date();
13274
+ date.setDate(date.getDate() - 1);
13279
13275
  return React__default.createElement("div", {
13280
- className: classNames
13276
+ className: classNames,
13277
+ onClick: function onClick(evt) {
13278
+ if (typeof props.onDateClick === 'function') {
13279
+ props.onDateClick(props.day, evt);
13280
+ evt.stopPropagation();
13281
+ }
13282
+ }
13281
13283
  }, React__default.createElement("div", {
13282
13284
  className: rootClassName$32 + "-label-line"
13283
13285
  }, React__default.createElement("div", {
13284
13286
  className: rootClassName$32 + "-day nunito",
13285
13287
  onClick: function onClick(evt) {
13286
- if (props.pocket && !props.disabled && typeof props.onAddButtonClick === 'function') {
13287
- props.onAddButtonClick(props.day, evt);
13288
+ if (props.pocket && !props.disabled && typeof props.onPlusButtonClick === 'function') {
13289
+ props.onPlusButtonClick(props.day, evt);
13288
13290
  }
13289
13291
  }
13290
13292
  }, React__default.createElement(Notification, {
@@ -13297,6 +13299,7 @@ function CalendarMonthDay(props) {
13297
13299
  onClick: function onClick(evt) {
13298
13300
  if (typeof props.onPlusButtonClick === 'function') {
13299
13301
  props.onPlusButtonClick(props.day, evt);
13302
+ evt.stopPropagation();
13300
13303
  }
13301
13304
  },
13302
13305
  disabled: props.disabled
@@ -13309,11 +13312,12 @@ function CalendarMonthDay(props) {
13309
13312
  disabled: props.disabled
13310
13313
  }));
13311
13314
  })), props.showAddButton ? React__default.createElement("button", {
13312
- disabled: props.disabled,
13315
+ disabled: props.disabledPrevAddButton ? props.day < date ? true : false : false,
13313
13316
  className: rootClassName$32 + "-button",
13314
13317
  onClick: function onClick(evt) {
13315
13318
  if (typeof props.onAddButtonClick === 'function') {
13316
13319
  props.onAddButtonClick(props.day, evt);
13320
+ evt.stopPropagation();
13317
13321
  }
13318
13322
  }
13319
13323
  }, React__default.createElement("span", null, React__default.createElement(AddCircleIcon, null), props.language.addNew)) : undefined) : undefined);
@@ -13346,7 +13350,7 @@ function CalendarDays(props) {
13346
13350
  }, days.map(function (d) {
13347
13351
  var _props$eventos;
13348
13352
 
13349
- var k = "" + d.getFullYear() + (d.getMonth() + 1) + d.getDate();
13353
+ var k = "" + d.getFullYear() + getTwoNumbersIfNotTen(d.getMonth()) + getTwoNumbersIfNotTen(d.getDate());
13350
13354
  var eventos = (_props$eventos = props.eventos) === null || _props$eventos === void 0 ? void 0 : _props$eventos.get(k);
13351
13355
  return React__default.createElement(CalendarMonthDay$1, {
13352
13356
  pocket: props.pocket,
@@ -13356,10 +13360,12 @@ function CalendarDays(props) {
13356
13360
  eventos: eventos,
13357
13361
  isToday: d.getDate() === today.getDate() && d.getMonth() === today.getMonth() && d.getFullYear() === today.getFullYear(),
13358
13362
  disabled: disabledDay(d) || props.loading,
13363
+ disabledPrevAddButton: props.disabledPrevAddButton,
13359
13364
  showAddButton: props.showAddButton,
13360
13365
  onAddButtonClick: props.onAddButtonClick,
13361
13366
  showPlusIcon: props.showPlusIcon,
13362
13367
  onPlusButtonClick: props.onPlusButtonClick,
13368
+ onDateClick: props.onDateClick,
13363
13369
  highlightWeekends: props.highlightWeekends
13364
13370
  });
13365
13371
  }));
@@ -13415,11 +13421,13 @@ function Calendar(props) {
13415
13421
  referencia: props.referencia,
13416
13422
  disabledNextMonth: props.disabledNextMonth,
13417
13423
  disabledPrevMonth: props.disabledPrevMonth,
13424
+ disabledPrevAddButton: props.disabledPrevAddButton,
13418
13425
  language: props.language,
13419
13426
  showAddButton: props.showAddButton,
13420
13427
  onAddButtonClick: props.onAddButtonClick,
13421
13428
  showPlusIcon: props.showPlusIcon,
13422
13429
  onPlusButtonClick: props.onPlusButtonClick,
13430
+ onDateClick: props.onDateClick,
13423
13431
  highlightWeekends: props.highlightWeekends,
13424
13432
  loading: props.loading,
13425
13433
  eventos: props.eventos
@@ -13431,6 +13439,7 @@ Calendar.defaultProps = {
13431
13439
  loading: false,
13432
13440
  disabledNextMonth: true,
13433
13441
  disabledPrevMonth: true,
13442
+ disabledPrevAddButton: true,
13434
13443
  highlightWeekends: true,
13435
13444
  showAddButton: true,
13436
13445
  showPlusIcon: true,