plataforma-fundacao-componentes 2.23.14 → 2.23.16

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,8 @@ 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.pointer-cursor:hover {
9886
+ cursor: pointer; }
9879
9887
 
9880
9888
  .calendar-month-day:not(.pocket) {
9881
9889
  height: 125px;
@@ -9904,6 +9912,8 @@ nav.component-tabs {
9904
9912
  cursor: pointer; }
9905
9913
  .calendar-month-day:not(.pocket) button.calendar-month-day-button:not(:disabled):active span {
9906
9914
  transform: scale(0.95); }
9915
+ .calendar-month-day:not(.pocket) button.calendar-month-day-button:disabled {
9916
+ color: #828a82; }
9907
9917
  .calendar-month-day:not(.pocket) button.calendar-month-day-button svg {
9908
9918
  width: 13px;
9909
9919
  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,
@@ -13271,49 +13265,61 @@ var CalendarChip$1 = React.memo(CalendarChip);
13271
13265
  var rootClassName$32 = 'calendar-month-day';
13272
13266
 
13273
13267
  function CalendarMonthDay(props) {
13274
- var _props$eventos, _props$eventos2, _props$eventos3, _props$eventos4, _props$eventos4$slice;
13268
+ var _props$eventos, _props$eventos3, _props$eventos4, _props$eventos5, _props$eventos6, _props$eventos6$slice;
13275
13269
 
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: getMergedClassNames([classNames, ((_props$eventos = props.eventos) === null || _props$eventos === void 0 ? void 0 : _props$eventos.length) > 2 ? 'pointer-cursor' : undefined]),
13277
+ onClick: function onClick(evt) {
13278
+ var _props$eventos2;
13279
+
13280
+ if (((_props$eventos2 = props.eventos) === null || _props$eventos2 === void 0 ? void 0 : _props$eventos2.length) > 2 && typeof props.onDateClick === 'function') {
13281
+ props.onDateClick(props.day, evt);
13282
+ evt.stopPropagation();
13283
+ }
13284
+ }
13281
13285
  }, React__default.createElement("div", {
13282
13286
  className: rootClassName$32 + "-label-line"
13283
13287
  }, React__default.createElement("div", {
13284
13288
  className: rootClassName$32 + "-day nunito",
13285
13289
  onClick: function onClick(evt) {
13286
- if (props.pocket && !props.disabled && typeof props.onAddButtonClick === 'function') {
13287
- props.onAddButtonClick(props.day, evt);
13290
+ if (props.pocket && !props.disabled && typeof props.onPlusButtonClick === 'function') {
13291
+ props.onPlusButtonClick(props.day, evt);
13288
13292
  }
13289
13293
  }
13290
13294
  }, React__default.createElement(Notification, {
13291
- count: props.pocket ? (_props$eventos = props.eventos) === null || _props$eventos === void 0 ? void 0 : _props$eventos.length : 0,
13295
+ count: props.pocket ? (_props$eventos3 = props.eventos) === null || _props$eventos3 === void 0 ? void 0 : _props$eventos3.length : 0,
13292
13296
  type: props.disabled ? exports.NotificationType.Disabled : exports.NotificationType.Primary,
13293
13297
  verticalOuter: 11,
13294
13298
  horizontalOuter: 14
13295
- }, getTwoNumbersIfNotTen(props.day.getDate()))), React__default.createElement("div", null, !props.pocket && props.showPlusIcon && Boolean(props.eventos) && ((_props$eventos2 = props.eventos) === null || _props$eventos2 === void 0 ? void 0 : _props$eventos2.length) > 2 ? React__default.createElement(CalendarChip$1, {
13296
- num: ((_props$eventos3 = props.eventos) === null || _props$eventos3 === void 0 ? void 0 : _props$eventos3.length) - 2,
13299
+ }, getTwoNumbersIfNotTen(props.day.getDate()))), React__default.createElement("div", null, !props.pocket && props.showPlusIcon && Boolean(props.eventos) && ((_props$eventos4 = props.eventos) === null || _props$eventos4 === void 0 ? void 0 : _props$eventos4.length) > 2 ? React__default.createElement(CalendarChip$1, {
13300
+ num: ((_props$eventos5 = props.eventos) === null || _props$eventos5 === void 0 ? void 0 : _props$eventos5.length) - 2,
13297
13301
  onClick: function onClick(evt) {
13298
13302
  if (typeof props.onPlusButtonClick === 'function') {
13299
13303
  props.onPlusButtonClick(props.day, evt);
13304
+ evt.stopPropagation();
13300
13305
  }
13301
13306
  },
13302
13307
  disabled: props.disabled
13303
13308
  }) : undefined)), !props.pocket ? React__default.createElement(React.Fragment, null, React__default.createElement("div", {
13304
13309
  className: rootClassName$32 + "-eventos"
13305
- }, (_props$eventos4 = props.eventos) === null || _props$eventos4 === void 0 ? void 0 : (_props$eventos4$slice = _props$eventos4.slice(0, 2)) === null || _props$eventos4$slice === void 0 ? void 0 : _props$eventos4$slice.map(function (e) {
13310
+ }, (_props$eventos6 = props.eventos) === null || _props$eventos6 === void 0 ? void 0 : (_props$eventos6$slice = _props$eventos6.slice(0, 2)) === null || _props$eventos6$slice === void 0 ? void 0 : _props$eventos6$slice.map(function (e) {
13306
13311
  return React__default.createElement(CalendarEvent$1, Object.assign({
13307
13312
  key: e.id
13308
13313
  }, e, {
13309
13314
  disabled: props.disabled
13310
13315
  }));
13311
13316
  })), props.showAddButton ? React__default.createElement("button", {
13312
- disabled: props.disabled,
13317
+ disabled: props.disabledPrevAddButton ? props.day < date ? true : false : false,
13313
13318
  className: rootClassName$32 + "-button",
13314
13319
  onClick: function onClick(evt) {
13315
13320
  if (typeof props.onAddButtonClick === 'function') {
13316
13321
  props.onAddButtonClick(props.day, evt);
13322
+ evt.stopPropagation();
13317
13323
  }
13318
13324
  }
13319
13325
  }, React__default.createElement("span", null, React__default.createElement(AddCircleIcon, null), props.language.addNew)) : undefined) : undefined);
@@ -13346,7 +13352,7 @@ function CalendarDays(props) {
13346
13352
  }, days.map(function (d) {
13347
13353
  var _props$eventos;
13348
13354
 
13349
- var k = "" + d.getFullYear() + (d.getMonth() + 1) + d.getDate();
13355
+ var k = "" + d.getFullYear() + getTwoNumbersIfNotTen(d.getMonth() + 1) + getTwoNumbersIfNotTen(d.getDate());
13350
13356
  var eventos = (_props$eventos = props.eventos) === null || _props$eventos === void 0 ? void 0 : _props$eventos.get(k);
13351
13357
  return React__default.createElement(CalendarMonthDay$1, {
13352
13358
  pocket: props.pocket,
@@ -13356,10 +13362,12 @@ function CalendarDays(props) {
13356
13362
  eventos: eventos,
13357
13363
  isToday: d.getDate() === today.getDate() && d.getMonth() === today.getMonth() && d.getFullYear() === today.getFullYear(),
13358
13364
  disabled: disabledDay(d) || props.loading,
13365
+ disabledPrevAddButton: props.disabledPrevAddButton,
13359
13366
  showAddButton: props.showAddButton,
13360
13367
  onAddButtonClick: props.onAddButtonClick,
13361
13368
  showPlusIcon: props.showPlusIcon,
13362
13369
  onPlusButtonClick: props.onPlusButtonClick,
13370
+ onDateClick: props.onDateClick,
13363
13371
  highlightWeekends: props.highlightWeekends
13364
13372
  });
13365
13373
  }));
@@ -13415,11 +13423,13 @@ function Calendar(props) {
13415
13423
  referencia: props.referencia,
13416
13424
  disabledNextMonth: props.disabledNextMonth,
13417
13425
  disabledPrevMonth: props.disabledPrevMonth,
13426
+ disabledPrevAddButton: props.disabledPrevAddButton,
13418
13427
  language: props.language,
13419
13428
  showAddButton: props.showAddButton,
13420
13429
  onAddButtonClick: props.onAddButtonClick,
13421
13430
  showPlusIcon: props.showPlusIcon,
13422
13431
  onPlusButtonClick: props.onPlusButtonClick,
13432
+ onDateClick: props.onDateClick,
13423
13433
  highlightWeekends: props.highlightWeekends,
13424
13434
  loading: props.loading,
13425
13435
  eventos: props.eventos
@@ -13431,6 +13441,7 @@ Calendar.defaultProps = {
13431
13441
  loading: false,
13432
13442
  disabledNextMonth: true,
13433
13443
  disabledPrevMonth: true,
13444
+ disabledPrevAddButton: true,
13434
13445
  highlightWeekends: true,
13435
13446
  showAddButton: true,
13436
13447
  showPlusIcon: true,