linear-react-components-ui 2.2.0-beta.8 → 2.2.0

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.
Files changed (61) hide show
  1. package/lib/assets/styles/datepicker2.css +81 -11
  2. package/lib/hooks/useScrollEndReached/index.d.ts +1 -1
  3. package/lib/hooks/useScrollEndReached/index.js +14 -3
  4. package/lib/hooks/useScrollEndReached/index.js.map +1 -1
  5. package/lib/hooks/useScrollEndReached/types.d.ts +1 -0
  6. package/lib/inputs/select/Dropdown.js +4 -2
  7. package/lib/inputs/select/Dropdown.js.map +1 -1
  8. package/lib/inputs/select/multiple/index.js +3 -2
  9. package/lib/inputs/select/multiple/index.js.map +1 -1
  10. package/lib/inputs/select/simple/index.js +3 -2
  11. package/lib/inputs/select/simple/index.js.map +1 -1
  12. package/lib/inputs2/date/calendarbox.d.ts +23 -0
  13. package/lib/inputs2/date/calendarbox.js +254 -0
  14. package/lib/inputs2/date/calendarbox.js.map +1 -0
  15. package/lib/inputs2/date/datefield/base.js +691 -214
  16. package/lib/inputs2/date/datefield/base.js.map +1 -1
  17. package/lib/inputs2/date/datefield/triggers.js +4 -4
  18. package/lib/inputs2/date/datefield/triggers.js.map +1 -1
  19. package/lib/inputs2/date/datefield/types.d.ts +5 -12
  20. package/lib/inputs2/date/dateperiodfield/base.js +694 -809
  21. package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
  22. package/lib/inputs2/date/dateperiodfield/triggers.js +21 -9
  23. package/lib/inputs2/date/dateperiodfield/triggers.js.map +1 -1
  24. package/lib/inputs2/date/dateperiodfield/types.d.ts +13 -23
  25. package/lib/inputs2/date/helpers.d.ts +44 -4
  26. package/lib/inputs2/date/helpers.js +200 -4
  27. package/lib/inputs2/date/helpers.js.map +1 -1
  28. package/lib/inputs2/date/{base/constants.d.ts → hooks/useCalendarPosition.d.ts} +1 -1
  29. package/lib/inputs2/date/hooks/useCalendarPosition.js +93 -0
  30. package/lib/inputs2/date/hooks/useCalendarPosition.js.map +1 -0
  31. package/lib/inputs2/date/hooks/useDateCalendarState.d.ts +14 -0
  32. package/lib/inputs2/date/hooks/useDateCalendarState.js +250 -0
  33. package/lib/inputs2/date/hooks/useDateCalendarState.js.map +1 -0
  34. package/lib/inputs2/date/hooks/useDateMask.d.ts +22 -0
  35. package/lib/inputs2/date/hooks/useDateMask.js +143 -0
  36. package/lib/inputs2/date/hooks/useDateMask.js.map +1 -0
  37. package/lib/inputs2/date/timeselector.d.ts +17 -0
  38. package/lib/inputs2/date/timeselector.js +226 -0
  39. package/lib/inputs2/date/timeselector.js.map +1 -0
  40. package/lib/inputs2/date/types.d.ts +22 -1
  41. package/lib/inputs2/date/types.js.map +1 -1
  42. package/lib/inputs2/selectfield/base.js +2 -1
  43. package/lib/inputs2/selectfield/base.js.map +1 -1
  44. package/lib/inputs2/selectfield/listbox.js +3 -1
  45. package/lib/inputs2/selectfield/listbox.js.map +1 -1
  46. package/lib/node_modules/moment/dist/locale/pt-br.js +54 -0
  47. package/lib/node_modules/moment/dist/locale/pt-br.js.map +1 -0
  48. package/lib/panel/Content.js +18 -15
  49. package/lib/panel/Content.js.map +1 -1
  50. package/lib/panel/Default.d.ts +1 -1
  51. package/lib/panel/Default.js +60 -54
  52. package/lib/panel/Default.js.map +1 -1
  53. package/package.json +1 -1
  54. package/lib/inputs2/date/base/constants.js +0 -69
  55. package/lib/inputs2/date/base/constants.js.map +0 -1
  56. package/lib/inputs2/date/datefield/calendarbox.d.ts +0 -6
  57. package/lib/inputs2/date/datefield/calendarbox.js +0 -228
  58. package/lib/inputs2/date/datefield/calendarbox.js.map +0 -1
  59. package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +0 -6
  60. package/lib/inputs2/date/dateperiodfield/calendarbox.js +0 -282
  61. package/lib/inputs2/date/dateperiodfield/calendarbox.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Default.js","sources":["../../src/lib/panel/Default.tsx"],"sourcesContent":["import { useState } from 'react';\nimport Grid from '../gridlayout';\nimport Header from './Header';\nimport PanelContext from './helpers';\nimport { actionsOnPermissionDenied, OPTIONS_ON_DENIED } from '../permissionValidations';\nimport { IPanelProps, ContextProps } from './types';\nimport { OnDenied } from '../@types/PermissionAttr';\n\nconst DefaultPanel = ({\n startOpened = true, toggleable, customClass, children, title, gridCols, onEndReached,\n onEndReachedThreshold = 0.1, permissionAttr, colorStyle, ...rest\n}: IPanelProps) => {\n const [opened, setOpened] = useState(startOpened);\n const { hideContent, unvisible } = OPTIONS_ON_DENIED;\n const [onDenied] =\n useState<OnDenied>(actionsOnPermissionDenied([hideContent, unvisible], permissionAttr));\n\n const getCssClass = () => {\n let cssClass = `panel-component ${customClass}`;\n cssClass += colorStyle !== '' ? ` -${colorStyle}` : '';\n return cssClass;\n };\n\n const renderContent = () => (\n <div className={getCssClass()} {...rest}>\n {title && <Header title={title} />}\n {children}\n </div>\n );\n\n const contextValues = () => ({\n toggleable,\n handlerToggleable: () => { setOpened(!opened); },\n opened,\n onEndReached,\n onEndReachedThreshold,\n hideContent: onDenied.hideContent,\n unvisible: onDenied.unvisible,\n }) as ContextProps;\n\n if (onDenied.unvisible) return null;\n\n return (\n <PanelContext.Provider value={contextValues()}>\n { gridCols\n ? (\n <Grid cols={gridCols}>{renderContent()}</Grid>\n )\n : (\n renderContent()\n )}\n </PanelContext.Provider>\n );\n};\n\nexport default DefaultPanel;\n"],"names":["DefaultPanel","t0","$","_c","children","colorStyle","customClass","gridCols","onEndReached","permissionAttr","rest","t1","t2","title","toggleable","startOpened","onEndReachedThreshold","undefined","opened","setOpened","useState","hideContent","unvisible","OPTIONS_ON_DENIED","t3","actionsOnPermissionDenied","onDenied","t4","cssClass","getCssClass","t5","Header","renderContent","t6","handlerToggleable","contextValues","t7","t8","Grid","t9"],"mappings":";;;;;;;AAQA,MAAMA,eAAeC,CAAAA,OAAA;AAAA,QAAAC,IAAAC,uBAAAA,EAAA,EAAA;AAAA,MAAAC;AAAA,MAAAC;AAAA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,aAInCK,SAAQL;AAAAA,MAAYC,WACtBI,SAAQJ;AAAAA,IAAAA;AACHpB,MAAA,EAAA,IAAAwB,SAAAL;AAAAnB,MAAA,EAAA,IAAAwB,SAAAJ;AAAApB,YAAAM;AAAAN,YAAAc;AAAAd,YAAAgB;AAAAhB,YAAAY;AAAAZ,YAAA+B;AAAAA,EAAA,OAAA;AAAAA,SAAA/B,EAAA,EAAA;AAAA,EAAA;AARlB,QAAAiC,gBAAsBF;AAUtB,MAAIP,SAAQJ,WAAU;AAAA,WAAS;AAAA,EAAI;AAAC,MAAAc;AAAA,MAAAlC,UAAAiC,eAAA;AAGJC,SAAAD,cAAAA;AAAejC,YAAAiC;AAAAjC,YAAAkC;AAAAA,EAAA,OAAA;AAAAA,SAAAlC,EAAA,EAAA;AAAA,EAAA;AAAA,MAAAmC;AAAA,MAAAnC,EAAA,EAAA,MAAAK,YAAAL,UAAA8B,eAAA;AACzCK,SAAA9B,+BAEG+B,SAAA,EAAW/B,MAAAA,UAAWyB,UAAAA,gBAAc,CAAE,IAGrCA,cAAAA;AACD9B,YAAAK;AAAAL,YAAA8B;AAAA9B,YAAAmC;AAAAA,EAAA,OAAA;AAAAA,SAAAnC,EAAA,EAAA;AAAA,EAAA;AAAA,MAAAqC;AAAA,MAAArC,EAAA,EAAA,MAAAkC,MAAAlC,UAAAmC,IAAA;AAPPE,6BAAA,aAAA,UAAA,EAA8B,OAAAH,IAC1BC,UAAAA,IAOJ;AAAwBnC,YAAAkC;AAAAlC,YAAAmC;AAAAnC,YAAAqC;AAAAA,EAAA,OAAA;AAAAA,SAAArC,EAAA,EAAA;AAAA,EAAA;AAAA,SARxBqC;AAQwB;"}
1
+ {"version":3,"file":"Default.js","sources":["../../src/lib/panel/Default.tsx"],"sourcesContent":["import { useState } from 'react';\nimport Grid from '../gridlayout';\nimport Header from './Header';\nimport PanelContext from './helpers';\nimport { actionsOnPermissionDenied, OPTIONS_ON_DENIED } from '../permissionValidations';\nimport { IPanelProps, ContextProps } from './types';\nimport { OnDenied } from '../@types/PermissionAttr';\n\nconst DefaultPanel = ({\n startOpened = true, toggleable, customClass, children, title, gridCols, onEndReached,\n onEndReachedThreshold = 0.1, itemsCount, permissionAttr, colorStyle, ...rest\n}: IPanelProps) => {\n const [opened, setOpened] = useState(startOpened);\n const { hideContent, unvisible } = OPTIONS_ON_DENIED;\n const [onDenied] =\n useState<OnDenied>(actionsOnPermissionDenied([hideContent, unvisible], permissionAttr));\n\n const getCssClass = () => {\n let cssClass = `panel-component ${customClass}`;\n cssClass += colorStyle !== '' ? ` -${colorStyle}` : '';\n return cssClass;\n };\n\n const renderContent = () => (\n <div className={getCssClass()} {...rest}>\n {title && <Header title={title} />}\n {children}\n </div>\n );\n\n const contextValues = () => ({\n toggleable,\n handlerToggleable: () => { setOpened(!opened); },\n opened,\n onEndReached,\n onEndReachedThreshold,\n itemsCount,\n hideContent: onDenied.hideContent,\n unvisible: onDenied.unvisible,\n }) as ContextProps;\n\n if (onDenied.unvisible) return null;\n\n return (\n <PanelContext.Provider value={contextValues()}>\n { gridCols\n ? (\n <Grid cols={gridCols}>{renderContent()}</Grid>\n )\n : (\n renderContent()\n )}\n </PanelContext.Provider>\n );\n};\n\nexport default DefaultPanel;\n"],"names":["DefaultPanel","t0","$","_c","children","colorStyle","customClass","gridCols","itemsCount","onEndReached","permissionAttr","rest","t1","t2","title","toggleable","startOpened","onEndReachedThreshold","undefined","opened","setOpened","useState","hideContent","unvisible","OPTIONS_ON_DENIED","t3","actionsOnPermissionDenied","onDenied","t4","cssClass","getCssClass","t5","Header","renderContent","t6","handlerToggleable","contextValues","t7","t8","Grid","t9"],"mappings":";;;;;;;AAQA,MAAMA,eAAeC,CAAAA,OAAA;AAAA,QAAAC,IAAAC,uBAAAA,EAAA,EAAA;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC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AA,MAAAc,aAKnCK,SAAQL;AAAAA,MAAYC,WACtBI,SAAQJ;AAAAA,IAAAA;AACHrB,YAAAM;AAAAN,MAAA,EAAA,IAAAyB,SAAAL;AAAApB,MAAA,EAAA,IAAAyB,SAAAJ;AAAArB,YAAAO;AAAAP,YAAAe;AAAAf,YAAAiB;AAAAjB,YAAAa;AAAAb,YAAAgC;AAAAA,EAAA,OAAA;AAAAA,SAAAhC,EAAA,EAAA;AAAA,EAAA;AATlB,QAAAkC,gBAAsBF;AAWtB,MAAIP,SAAQJ,WAAU;AAAA,WAAS;AAAA,EAAI;AAAC,MAAAc;AAAA,MAAAnC,UAAAkC,eAAA;AAGJC,SAAAD,cAAAA;AAAelC,YAAAkC;AAAAlC,YAAAmC;AAAAA,EAAA,OAAA;AAAAA,SAAAnC,EAAA,EAAA;AAAA,EAAA;AAAA,MAAAoC;AAAA,MAAApC,EAAA,EAAA,MAAAK,YAAAL,UAAA+B,eAAA;AACzCK,SAAA/B,+BAEGgC,SAAA,EAAWhC,MAAAA,UAAW0B,UAAAA,gBAAc,CAAE,IAGrCA,cAAAA;AACD/B,YAAAK;AAAAL,YAAA+B;AAAA/B,YAAAoC;AAAAA,EAAA,OAAA;AAAAA,SAAApC,EAAA,EAAA;AAAA,EAAA;AAAA,MAAAsC;AAAA,MAAAtC,EAAA,EAAA,MAAAmC,MAAAnC,UAAAoC,IAAA;AAPPE,6BAAA,aAAA,UAAA,EAA8B,OAAAH,IAC1BC,UAAAA,IAOJ;AAAwBpC,YAAAmC;AAAAnC,YAAAoC;AAAApC,YAAAsC;AAAAA,EAAA,OAAA;AAAAA,SAAAtC,EAAA,EAAA;AAAA,EAAA;AAAA,SARxBsC;AAQwB;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "2.2.0-beta.8",
3
+ "version": "2.2.0",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -1,69 +0,0 @@
1
- import { c as compilerRuntimeExports } from "../../../_virtual/compiler-runtime.js";
2
- import { useState, useEffect } from "react";
3
- const useCalendarPosition = (calendarBoxOpen, containerRef) => {
4
- const $ = compilerRuntimeExports.c(7);
5
- let t0;
6
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
7
- t0 = {};
8
- $[0] = t0;
9
- } else {
10
- t0 = $[0];
11
- }
12
- const [calendarBoxStyles, setCalendarBoxStyles] = useState(t0);
13
- let t1;
14
- let t2;
15
- if ($[1] !== calendarBoxOpen || $[2] !== containerRef) {
16
- t1 = () => {
17
- const updatePosition = () => {
18
- const selectPositionOnScreen = containerRef.current?.getBoundingClientRect();
19
- if (selectPositionOnScreen) {
20
- const {
21
- top,
22
- left,
23
- width,
24
- height
25
- } = selectPositionOnScreen;
26
- setCalendarBoxStyles({
27
- top: top + height + window.scrollY,
28
- left: left + window.scrollX,
29
- width,
30
- position: "absolute"
31
- });
32
- }
33
- };
34
- if (calendarBoxOpen) {
35
- updatePosition();
36
- window.addEventListener("resize", updatePosition);
37
- window.addEventListener("scroll", updatePosition, true);
38
- }
39
- return () => {
40
- window.removeEventListener("resize", updatePosition);
41
- window.removeEventListener("scroll", updatePosition, true);
42
- };
43
- };
44
- t2 = [calendarBoxOpen, containerRef];
45
- $[1] = calendarBoxOpen;
46
- $[2] = containerRef;
47
- $[3] = t1;
48
- $[4] = t2;
49
- } else {
50
- t1 = $[3];
51
- t2 = $[4];
52
- }
53
- useEffect(t1, t2);
54
- let t3;
55
- if ($[5] !== calendarBoxStyles) {
56
- t3 = {
57
- calendarBoxStyles
58
- };
59
- $[5] = calendarBoxStyles;
60
- $[6] = t3;
61
- } else {
62
- t3 = $[6];
63
- }
64
- return t3;
65
- };
66
- export {
67
- useCalendarPosition
68
- };
69
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/lib/inputs2/date/base/constants.ts"],"sourcesContent":["import { CSSProperties, RefObject, useEffect, useState } from \"react\";\n\nexport const useCalendarPosition = (\n calendarBoxOpen: boolean,\n containerRef: RefObject<HTMLDivElement | null>,\n) => {\n const [calendarBoxStyles, setCalendarBoxStyles] = useState<CSSProperties>({});\n\n useEffect(() => {\n const updatePosition = () => {\n const selectPositionOnScreen = containerRef.current?.getBoundingClientRect();\n if (selectPositionOnScreen) {\n const { top, left, width, height } = selectPositionOnScreen;\n setCalendarBoxStyles({\n top: top + height + window.scrollY,\n left: left + window.scrollX,\n width: width,\n position: 'absolute',\n });\n }\n };\n\n if (calendarBoxOpen) {\n updatePosition();\n window.addEventListener('resize', updatePosition);\n window.addEventListener('scroll', updatePosition, true);\n }\n\n return () => {\n window.removeEventListener('resize', updatePosition);\n window.removeEventListener('scroll', updatePosition, true);\n };\n }, [calendarBoxOpen, containerRef]);\n\n return { calendarBoxStyles };\n};\n"],"names":["useCalendarPosition","calendarBoxOpen","containerRef","$","_c","t0","Symbol","for","calendarBoxStyles","setCalendarBoxStyles","useState","t1","t2","updatePosition","selectPositionOnScreen","current","getBoundingClientRect","top","left","width","height","window","scrollY","scrollX","position","addEventListener","removeEventListener","useEffect","t3"],"mappings":";;AAEO,MAAMA,sBAAsBA,CAAAC,iBAAAC,iBAAA;AAAA,QAAAC,IAAAC,uBAAAA,EAAA,CAAA;AAAA,MAAAC;AAAA,MAAAF,EAAA,CAAA,MAAAG,OAAAC,IAAA,2BAAA,GAAA;AAIyCF;AAAEF,WAAAE;AAAAA,EAAA,OAAA;AAAAA,SAAAF,EAAA,CAAA;AAAA,EAAA;AAA5E,QAAA,CAAAK,mBAAAC,oBAAA,IAAkDC,SAAwBL,EAAE;AAAE,MAAAM;AAAA,MAAAC;AAAA,MAAAT,EAAA,CAAA,MAAAF,mBAAAE,SAAAD,cAAA;AAEpES,SAAAA,MAAA;AACR,YAAAE,iBAAuBA,MAAA;AACrB,cAAAC,yBAA+BZ,aAAYa,SAA+BC,sBAAAA;AAC1E,YAAIF,wBAAsB;AACxB,gBAAA;AAAA,YAAAG;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,YAAAC;AAAAA,UAAAA,IAAqCN;AACrCL,+BAAqB;AAAA,YAAAQ,KACdA,MAAMG,SAASC,OAAMC;AAAAA,YAAQJ,MAC5BA,OAAOG,OAAME;AAAAA,YAAQJ;AAAAA,YAAAK,UAEjB;AAAA,UAAA,CACX;AAAA,QAAC;AAAA,MACH;AAGH,UAAIvB,iBAAe;AACjBY,uBAAAA;AACAQ,eAAMI,iBAAkB,UAAUZ,cAAc;AAChDQ,eAAMI,iBAAkB,UAAUZ,gBAAgB,IAAI;AAAA,MAAC;AACxD,aAEM,MAAA;AACLQ,eAAMK,oBAAqB,UAAUb,cAAc;AACnDQ,eAAMK,oBAAqB,UAAUb,gBAAgB,IAAI;AAAA,MAAC;AAAA,IAC3D;AACAD,SAAA,CAACX,iBAAiBC,YAAY;AAACC,WAAAF;AAAAE,WAAAD;AAAAC,WAAAQ;AAAAR,WAAAS;AAAAA,EAAA,OAAA;AAAAD,SAAAR,EAAA,CAAA;AAAAS,SAAAT,EAAA,CAAA;AAAA,EAAA;AAxBlCwB,YAAUhB,IAwBPC,EAA+B;AAAC,MAAAgB;AAAA,MAAAzB,SAAAK,mBAAA;AAE5BoB,SAAA;AAAA,MAAApB;AAAAA,IAAAA;AAAqBL,WAAAK;AAAAL,WAAAyB;AAAAA,EAAA,OAAA;AAAAA,SAAAzB,EAAA,CAAA;AAAA,EAAA;AAAA,SAArByB;AAAqB;"}
@@ -1,6 +0,0 @@
1
- import { ComponentProps } from 'react';
2
- interface DateFieldCalendarBoxProps extends ComponentProps<'div'> {
3
- }
4
- declare const CalendarBox: import('react').ForwardRefExoticComponent<Omit<DateFieldCalendarBoxProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
5
- export { CalendarBox };
6
- export type { DateFieldCalendarBoxProps };
@@ -1,228 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c as compilerRuntimeExports } from "../../../_virtual/compiler-runtime.js";
3
- import _ from "../../../_virtual/lodash.js";
4
- import hooks from "../../../node_modules/moment/dist/moment.js";
5
- import { forwardRef } from "react";
6
- import Button from "../../../buttons/Button.js";
7
- import '../../../assets/styles/button.css';/* empty css */
8
- import TextContent from "../../../textContent/index.js";
9
- import { useDateFieldContext } from "./context.js";
10
- import { generateCalendarWeeks, TOKEN_ISO_FORMAT } from "../helpers.js";
11
- import { useCalendarPosition } from "../base/constants.js";
12
- const CalendarBox = forwardRef((__, ref) => {
13
- const $ = compilerRuntimeExports.c(63);
14
- const {
15
- inputFieldId,
16
- calendarDisplayDate,
17
- calendarBoxOpen,
18
- dateContainerRef,
19
- handlePreviousMonth,
20
- handleNextMonth,
21
- selectedDate,
22
- handleSelectDate,
23
- activeDescendant
24
- } = useDateFieldContext();
25
- const {
26
- calendarBoxStyles
27
- } = useCalendarPosition(calendarBoxOpen, dateContainerRef);
28
- let t0;
29
- let t1;
30
- let t10;
31
- let t11;
32
- let t2;
33
- let t3;
34
- let t4;
35
- let t5;
36
- let t6;
37
- let t7;
38
- let t8;
39
- let t9;
40
- if ($[0] !== activeDescendant || $[1] !== calendarBoxOpen || $[2] !== calendarBoxStyles || $[3] !== calendarDisplayDate || $[4] !== handleNextMonth || $[5] !== handlePreviousMonth || $[6] !== handleSelectDate || $[7] !== inputFieldId || $[8] !== ref || $[9] !== selectedDate) {
41
- const weeks = generateCalendarWeeks(calendarDisplayDate);
42
- const handleOnMouseDown = _temp;
43
- t5 = ref;
44
- t6 = calendarBoxStyles;
45
- t7 = calendarBoxOpen;
46
- t8 = "date-calendar-box";
47
- t9 = "test-date-field-calendar-box";
48
- let t122;
49
- if ($[22] !== handlePreviousMonth) {
50
- t122 = /* @__PURE__ */ jsx(Button, { boxShadow: false, type: "button", iconName: "arrow_left", title: "Mês anterior", className: "previous-month", "aria-label": "Mês anterior", onClick: handlePreviousMonth, onMouseDown: handleOnMouseDown });
51
- $[22] = handlePreviousMonth;
52
- $[23] = t122;
53
- } else {
54
- t122 = $[23];
55
- }
56
- let t132;
57
- if ($[24] !== calendarDisplayDate) {
58
- t132 = calendarDisplayDate.format("MMMM YYYY");
59
- $[24] = calendarDisplayDate;
60
- $[25] = t132;
61
- } else {
62
- t132 = $[25];
63
- }
64
- let t142;
65
- if ($[26] !== calendarDisplayDate) {
66
- t142 = calendarDisplayDate.format("MMMM YYYY");
67
- $[26] = calendarDisplayDate;
68
- $[27] = t142;
69
- } else {
70
- t142 = $[27];
71
- }
72
- let t152;
73
- if ($[28] !== t132 || $[29] !== t142) {
74
- t152 = /* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "month-year", children: /* @__PURE__ */ jsx(TextContent, { "aria-label": t132, as: "p", "data-testid": "test-date-field-calendar-box-month-description", children: t142 }) });
75
- $[28] = t132;
76
- $[29] = t142;
77
- $[30] = t152;
78
- } else {
79
- t152 = $[30];
80
- }
81
- let t16;
82
- if ($[31] !== handleNextMonth) {
83
- t16 = /* @__PURE__ */ jsx(Button, { boxShadow: false, type: "button", iconName: "arrow_right", title: "Próximo mês", className: "next-month", "aria-label": "Próximo mês", onClick: handleNextMonth, onMouseDown: handleOnMouseDown });
84
- $[31] = handleNextMonth;
85
- $[32] = t16;
86
- } else {
87
- t16 = $[32];
88
- }
89
- if ($[33] !== inputFieldId || $[34] !== t122 || $[35] !== t152 || $[36] !== t16) {
90
- t10 = /* @__PURE__ */ jsxs("div", { id: inputFieldId, className: "date-calendar-box-header", children: [
91
- t122,
92
- t152,
93
- t16
94
- ] });
95
- $[33] = inputFieldId;
96
- $[34] = t122;
97
- $[35] = t152;
98
- $[36] = t16;
99
- $[37] = t10;
100
- } else {
101
- t10 = $[37];
102
- }
103
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
104
- t11 = /* @__PURE__ */ jsx("div", { "aria-label": "Dias da Semana", role: "grid", className: "date-calendar-box-days-of-week", children: hooks.weekdaysShort(true).map(_temp2) });
105
- $[38] = t11;
106
- } else {
107
- t11 = $[38];
108
- }
109
- t4 = "date-calendar-box-grid-of-days";
110
- t2 = "Calendário";
111
- t3 = "grid";
112
- t0 = "weeks";
113
- let t17;
114
- if ($[39] !== activeDescendant || $[40] !== calendarDisplayDate || $[41] !== handleSelectDate || $[42] !== selectedDate) {
115
- t17 = (week, weekIndex) => /* @__PURE__ */ jsx("tr", { role: "row", children: week.map((date, dateIndex) => {
116
- const isToday = _.isEqual(hooks().format(TOKEN_ISO_FORMAT), date.format(TOKEN_ISO_FORMAT));
117
- const hasFocus = _.isEqual(activeDescendant, date.format(TOKEN_ISO_FORMAT));
118
- const isSelected = selectedDate ? date.isSame(selectedDate, "day") : false;
119
- const isCurrentMonth = date.month() === calendarDisplayDate.month();
120
- const idActiveDescendant = date.format(TOKEN_ISO_FORMAT);
121
- const descriptionDate = date.format("LL");
122
- return /* @__PURE__ */ jsx("td", { role: "gridcell", children: /* @__PURE__ */ jsx(Button, { id: idActiveDescendant, type: "button", className: "day-button", boxShadow: false, tabIndex: -1, title: descriptionDate, "aria-label": descriptionDate, "aria-selected": isSelected, "data-testid": "test-date-field-day-button", "data-state-is-today": isToday, "data-state-has-focus": hasFocus, "data-state-is-current-month": isCurrentMonth, label: date.date().toString(), onMouseDown: handleOnMouseDown, onClick: () => handleSelectDate(date) }) }, dateIndex);
123
- }) }, weekIndex + 1);
124
- $[39] = activeDescendant;
125
- $[40] = calendarDisplayDate;
126
- $[41] = handleSelectDate;
127
- $[42] = selectedDate;
128
- $[43] = t17;
129
- } else {
130
- t17 = $[43];
131
- }
132
- t1 = weeks.map(t17);
133
- $[0] = activeDescendant;
134
- $[1] = calendarBoxOpen;
135
- $[2] = calendarBoxStyles;
136
- $[3] = calendarDisplayDate;
137
- $[4] = handleNextMonth;
138
- $[5] = handlePreviousMonth;
139
- $[6] = handleSelectDate;
140
- $[7] = inputFieldId;
141
- $[8] = ref;
142
- $[9] = selectedDate;
143
- $[10] = t0;
144
- $[11] = t1;
145
- $[12] = t10;
146
- $[13] = t11;
147
- $[14] = t2;
148
- $[15] = t3;
149
- $[16] = t4;
150
- $[17] = t5;
151
- $[18] = t6;
152
- $[19] = t7;
153
- $[20] = t8;
154
- $[21] = t9;
155
- } else {
156
- t0 = $[10];
157
- t1 = $[11];
158
- t10 = $[12];
159
- t11 = $[13];
160
- t2 = $[14];
161
- t3 = $[15];
162
- t4 = $[16];
163
- t5 = $[17];
164
- t6 = $[18];
165
- t7 = $[19];
166
- t8 = $[20];
167
- t9 = $[21];
168
- }
169
- let t12;
170
- if ($[44] !== t0 || $[45] !== t1) {
171
- t12 = /* @__PURE__ */ jsx("tbody", { className: t0, children: t1 });
172
- $[44] = t0;
173
- $[45] = t1;
174
- $[46] = t12;
175
- } else {
176
- t12 = $[46];
177
- }
178
- let t13;
179
- if ($[47] !== t12 || $[48] !== t2 || $[49] !== t3) {
180
- t13 = /* @__PURE__ */ jsx("table", { "aria-label": t2, role: t3, children: t12 });
181
- $[47] = t12;
182
- $[48] = t2;
183
- $[49] = t3;
184
- $[50] = t13;
185
- } else {
186
- t13 = $[50];
187
- }
188
- let t14;
189
- if ($[51] !== t13 || $[52] !== t4) {
190
- t14 = /* @__PURE__ */ jsx("div", { className: t4, children: t13 });
191
- $[51] = t13;
192
- $[52] = t4;
193
- $[53] = t14;
194
- } else {
195
- t14 = $[53];
196
- }
197
- let t15;
198
- if ($[54] !== t10 || $[55] !== t11 || $[56] !== t14 || $[57] !== t5 || $[58] !== t6 || $[59] !== t7 || $[60] !== t8 || $[61] !== t9) {
199
- t15 = /* @__PURE__ */ jsxs("div", { ref: t5, style: t6, "aria-expanded": t7, className: t8, "data-testid": t9, children: [
200
- t10,
201
- t11,
202
- t14
203
- ] });
204
- $[54] = t10;
205
- $[55] = t11;
206
- $[56] = t14;
207
- $[57] = t5;
208
- $[58] = t6;
209
- $[59] = t7;
210
- $[60] = t8;
211
- $[61] = t9;
212
- $[62] = t15;
213
- } else {
214
- t15 = $[62];
215
- }
216
- return t15;
217
- });
218
- CalendarBox.displayName = "DateFieldCalendarBox";
219
- function _temp(event) {
220
- event?.preventDefault?.();
221
- }
222
- function _temp2(day, idx) {
223
- return /* @__PURE__ */ jsx("span", { title: day, role: "columnheader", children: day }, `day-of-week-${idx + 1}`);
224
- }
225
- export {
226
- CalendarBox
227
- };
228
- //# sourceMappingURL=calendarbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calendarbox.js","sources":["../../../../src/lib/inputs2/date/datefield/calendarbox.tsx"],"sourcesContent":["import _ from 'lodash';\nimport moment from 'moment';\nimport { ComponentProps, forwardRef, MouseEvent } from 'react';\nimport Button from '../../../buttons';\nimport TextContent from '../../../textContent';\nimport { useDateFieldContext } from './context';\nimport { generateCalendarWeeks, TOKEN_ISO_FORMAT } from '../helpers';\nimport { useCalendarPosition } from '../base/constants';\n\ninterface DateFieldCalendarBoxProps extends ComponentProps<'div'> { }\n\nconst CalendarBox = forwardRef<HTMLDivElement, DateFieldCalendarBoxProps>((__, ref) => {\n const {\n inputFieldId, calendarDisplayDate, calendarBoxOpen, dateContainerRef, handlePreviousMonth, \n handleNextMonth, selectedDate, handleSelectDate, activeDescendant,\n } = useDateFieldContext();\n const { calendarBoxStyles } = useCalendarPosition(calendarBoxOpen, dateContainerRef);\n\n const weeks = generateCalendarWeeks(calendarDisplayDate);\n\n const handleOnMouseDown = (event: MouseEvent<HTMLButtonElement>) => {\n event?.preventDefault?.();\n };\n\n return (\n <div\n ref={ref}\n style={calendarBoxStyles}\n aria-expanded={calendarBoxOpen}\n className=\"date-calendar-box\"\n data-testid=\"test-date-field-calendar-box\">\n <div id={inputFieldId} className=\"date-calendar-box-header\">\n <Button\n boxShadow={false}\n type=\"button\"\n iconName=\"arrow_left\"\n title=\"Mês anterior\"\n className=\"previous-month\"\n aria-label=\"Mês anterior\"\n onClick={handlePreviousMonth}\n onMouseDown={handleOnMouseDown} />\n <div aria-live=\"polite\" className=\"month-year\">\n <TextContent\n aria-label={calendarDisplayDate.format('MMMM YYYY')}\n as=\"p\"\n data-testid=\"test-date-field-calendar-box-month-description\">\n {calendarDisplayDate.format('MMMM YYYY')}\n </TextContent>\n </div>\n <Button\n boxShadow={false}\n type=\"button\"\n iconName=\"arrow_right\"\n title=\"Próximo mês\"\n className=\"next-month\"\n aria-label=\"Próximo mês\"\n onClick={handleNextMonth}\n onMouseDown={handleOnMouseDown} />\n </div>\n <div aria-label=\"Dias da Semana\" role=\"grid\" className=\"date-calendar-box-days-of-week\">\n {moment.weekdaysShort(true).map((day, idx) => (\n <span\n title={day}\n role=\"columnheader\" \n key={`day-of-week-${idx + 1}`}>\n {day}\n </span>\n ))}\n </div>\n <div className=\"date-calendar-box-grid-of-days\">\n <table aria-label=\"Calendário\" role=\"grid\">\n <tbody className=\"weeks\">\n {weeks.map((week, weekIndex) => (\n <tr role=\"row\" key={weekIndex + 1}>\n {week.map((date, dateIndex) => {\n const isToday = _.isEqual(\n moment().format(TOKEN_ISO_FORMAT), date.format(TOKEN_ISO_FORMAT),\n );\n const hasFocus = _.isEqual(activeDescendant, date.format(TOKEN_ISO_FORMAT));\n const isSelected = selectedDate ? date.isSame(selectedDate, 'day') : false;\n const isCurrentMonth = date.month() === calendarDisplayDate.month();\n const idActiveDescendant = date.format(TOKEN_ISO_FORMAT);\n const descriptionDate = date.format('LL');\n return (\n <td role=\"gridcell\" key={dateIndex}>\n <Button\n id={idActiveDescendant}\n type=\"button\"\n className=\"day-button\"\n boxShadow={false}\n tabIndex={-1}\n title={descriptionDate}\n aria-label={descriptionDate}\n aria-selected={isSelected}\n data-testid=\"test-date-field-day-button\"\n data-state-is-today={isToday}\n data-state-has-focus={hasFocus}\n data-state-is-current-month={isCurrentMonth}\n label={date.date().toString()}\n onMouseDown={handleOnMouseDown}\n onClick={() => handleSelectDate(date)} />\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </div>\n );\n});\n\nCalendarBox.displayName = 'DateFieldCalendarBox';\n\nexport { CalendarBox };\nexport type { DateFieldCalendarBoxProps };\n"],"names":["CalendarBox","forwardRef","__","ref","$","_c","inputFieldId","calendarDisplayDate","calendarBoxOpen","dateContainerRef","handlePreviousMonth","handleNextMonth","selectedDate","handleSelectDate","activeDescendant","useDateFieldContext","calendarBoxStyles","useCalendarPosition","t0","t1","t10","t11","t2","t3","t4","t5","t6","t7","t8","t9","weeks","generateCalendarWeeks","handleOnMouseDown","_temp","t12","t13","format","t14","t15","t16","Symbol","for","moment","weekdaysShort","map","_temp2","t17","week","weekIndex","date","dateIndex","isToday","_","isEqual","TOKEN_ISO_FORMAT","hasFocus","isSelected","isSame","isCurrentMonth","month","idActiveDescendant","descriptionDate","toString","displayName","event","preventDefault","day","idx"],"mappings":";;;;;;;;;;;AAWA,MAAMA,cAAcC,WAAsD,CAAAC,IAAAC,QAAA;AAAA,QAAAC,IAAAC,uBAAAA,EAAA,EAAA;AACxE,QAAA;AAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAGIC,oBAAAA;AACJ,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAA8BC,oBAAoBT,iBAAiBC,gBAAgB;AAAE,MAAAS;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAC;AAAA,MAAAzB,EAAA,CAAA,MAAAU,oBAAAV,SAAAI,mBAAAJ,EAAA,CAAA,MAAAY,qBAAAZ,SAAAG,uBAAAH,EAAA,CAAA,MAAAO,mBAAAP,SAAAM,uBAAAN,EAAA,CAAA,MAAAS,oBAAAT,EAAA,CAAA,MAAAE,gBAAAF,EAAA,CAAA,MAAAD,OAAAC,SAAAQ,cAAA;AAErF,UAAAkB,QAAcC,sBAAsBxB,mBAAmB;AAEvD,UAAAyB,oBAA0BC;AAMjB9B,SA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wCF;AAAMjC,YAAAgB;AAAAhB,YAAAiB;AAAAjB,YAAAiC;AAAAjC,YAAAqB;AAAArB,YAAAsB;AAAAtB,YAAAuB;AAAAvB,YAAAwB;AAAAxB,YAAAyB;AAAAzB,YAAAkC;AAAAA,EAAA,OAAA;AAAAA,UAAAlC,EAAA,EAAA;AAAA,EAAA;AAAA,SApFNkC;AAoFM,CAET;AAEDtC,YAAY+D,cAAc;AAtGgD,SAAA9B,MAAA+B,OAAA;AAUtEA,SAAKC,iBAAAA;AAAoB;AAV6C,SAAApB,OAAAqB,KAAAC,KAAA;AAAA,SAkDhE,oBAAA,QAAA,EACSD,YACF,MAAA,gBAEJA,UAAAA,IAAAA,GADI,eAAeC,MAAM,CAAC,EAE7B;AAAO;"}
@@ -1,6 +0,0 @@
1
- import { ComponentProps } from 'react';
2
- interface DateFieldCalendarBoxProps extends ComponentProps<'div'> {
3
- }
4
- declare const CalendarBox: import('react').ForwardRefExoticComponent<Omit<DateFieldCalendarBoxProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
5
- export { CalendarBox };
6
- export type { DateFieldCalendarBoxProps };
@@ -1,282 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c as compilerRuntimeExports } from "../../../_virtual/compiler-runtime.js";
3
- import _ from "../../../_virtual/lodash.js";
4
- import hooks from "../../../node_modules/moment/dist/moment.js";
5
- import { forwardRef } from "react";
6
- import Button from "../../../buttons/Button.js";
7
- import '../../../assets/styles/button.css';/* empty css */
8
- import TextContent from "../../../textContent/index.js";
9
- import { useDatePeriodFieldContext } from "./context.js";
10
- import { generateCalendarWeeks, TOKEN_ISO_FORMAT } from "../helpers.js";
11
- import { useCalendarPosition } from "../base/constants.js";
12
- const CalendarBox = forwardRef((__, ref) => {
13
- const $ = compilerRuntimeExports.c(75);
14
- const {
15
- initialInputId,
16
- finalInputId,
17
- activeDescendant,
18
- calendarBoxOpen,
19
- dateContainerRef,
20
- calendarDisplayDate,
21
- selectedDate,
22
- handleChangeNextMonth,
23
- handleChangePreviousMonth,
24
- handleChangeUpdateDateState,
25
- handleChangeActiveDescendant
26
- } = useDatePeriodFieldContext();
27
- const {
28
- calendarBoxStyles
29
- } = useCalendarPosition(calendarBoxOpen, dateContainerRef);
30
- let t0;
31
- let t1;
32
- let t10;
33
- let t11;
34
- let t2;
35
- let t3;
36
- let t4;
37
- let t5;
38
- let t6;
39
- let t7;
40
- let t8;
41
- let t9;
42
- if ($[0] !== activeDescendant || $[1] !== calendarBoxOpen || $[2] !== calendarBoxStyles || $[3] !== calendarDisplayDate || $[4] !== finalInputId || $[5] !== handleChangeActiveDescendant || $[6] !== handleChangeNextMonth || $[7] !== handleChangePreviousMonth || $[8] !== handleChangeUpdateDateState || $[9] !== initialInputId || $[10] !== ref || $[11] !== selectedDate) {
43
- const weeks = generateCalendarWeeks(calendarDisplayDate);
44
- let t122;
45
- if ($[24] !== selectedDate) {
46
- t122 = (day) => selectedDate.inicial && selectedDate.final && day.isAfter(selectedDate.inicial, "day") && day.isBefore(selectedDate.final, "day");
47
- $[24] = selectedDate;
48
- $[25] = t122;
49
- } else {
50
- t122 = $[25];
51
- }
52
- const isInRange = t122;
53
- let t132;
54
- if ($[26] !== selectedDate) {
55
- t132 = (day_0) => selectedDate.inicial && day_0.isSame(selectedDate.inicial, "day") || selectedDate.final && day_0.isSame(selectedDate.final, "day");
56
- $[26] = selectedDate;
57
- $[27] = t132;
58
- } else {
59
- t132 = $[27];
60
- }
61
- const isSelected = t132;
62
- const handleOnMouseDown = _temp;
63
- let t142;
64
- if ($[28] !== finalInputId || $[29] !== handleChangeActiveDescendant || $[30] !== handleChangeUpdateDateState || $[31] !== initialInputId) {
65
- t142 = (___, daySelected) => {
66
- const inputActive = document.activeElement;
67
- let inputType = void 0;
68
- if (inputActive?.id === initialInputId) {
69
- inputType = "initial";
70
- }
71
- if (inputActive?.id === finalInputId) {
72
- inputType = "final";
73
- }
74
- if (!_.isUndefined(inputType)) {
75
- handleChangeUpdateDateState({
76
- date: daySelected,
77
- inputType
78
- });
79
- handleChangeActiveDescendant(daySelected.format(TOKEN_ISO_FORMAT));
80
- }
81
- };
82
- $[28] = finalInputId;
83
- $[29] = handleChangeActiveDescendant;
84
- $[30] = handleChangeUpdateDateState;
85
- $[31] = initialInputId;
86
- $[32] = t142;
87
- } else {
88
- t142 = $[32];
89
- }
90
- const handleOnClick = t142;
91
- t5 = ref;
92
- t6 = calendarBoxStyles;
93
- t7 = calendarBoxOpen;
94
- t8 = "date-calendar-box";
95
- t9 = "test-date-period-field-calendar-box";
96
- let t152;
97
- if ($[33] !== handleChangePreviousMonth) {
98
- t152 = /* @__PURE__ */ jsx(Button, { boxShadow: false, type: "button", iconName: "arrow_left", title: "Mês anterior", className: "previous-month", "aria-label": "Mês anterior", onClick: handleChangePreviousMonth, onMouseDown: handleOnMouseDown });
99
- $[33] = handleChangePreviousMonth;
100
- $[34] = t152;
101
- } else {
102
- t152 = $[34];
103
- }
104
- let t16;
105
- if ($[35] !== calendarDisplayDate) {
106
- t16 = calendarDisplayDate.format("MMMM YYYY");
107
- $[35] = calendarDisplayDate;
108
- $[36] = t16;
109
- } else {
110
- t16 = $[36];
111
- }
112
- let t17;
113
- if ($[37] !== calendarDisplayDate) {
114
- t17 = calendarDisplayDate.format("MMMM YYYY");
115
- $[37] = calendarDisplayDate;
116
- $[38] = t17;
117
- } else {
118
- t17 = $[38];
119
- }
120
- let t18;
121
- if ($[39] !== t16 || $[40] !== t17) {
122
- t18 = /* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "month-year", children: /* @__PURE__ */ jsx(TextContent, { "aria-label": t16, as: "p", "data-testid": "test-date-period-field-calendar-box-month-description", children: t17 }) });
123
- $[39] = t16;
124
- $[40] = t17;
125
- $[41] = t18;
126
- } else {
127
- t18 = $[41];
128
- }
129
- let t19;
130
- if ($[42] !== handleChangeNextMonth) {
131
- t19 = /* @__PURE__ */ jsx(Button, { boxShadow: false, type: "button", iconName: "arrow_right", title: "Próximo mês", className: "next-month", "aria-label": "Próximo mês", onClick: handleChangeNextMonth, onMouseDown: handleOnMouseDown });
132
- $[42] = handleChangeNextMonth;
133
- $[43] = t19;
134
- } else {
135
- t19 = $[43];
136
- }
137
- if ($[44] !== initialInputId || $[45] !== t152 || $[46] !== t18 || $[47] !== t19) {
138
- t10 = /* @__PURE__ */ jsxs("div", { id: initialInputId, className: "date-calendar-box-header", children: [
139
- t152,
140
- t18,
141
- t19
142
- ] });
143
- $[44] = initialInputId;
144
- $[45] = t152;
145
- $[46] = t18;
146
- $[47] = t19;
147
- $[48] = t10;
148
- } else {
149
- t10 = $[48];
150
- }
151
- if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
152
- t11 = /* @__PURE__ */ jsx("div", { "aria-label": "Dias da Semana", role: "grid", className: "date-calendar-box-days-of-week", children: hooks.weekdaysShort(true).map(_temp2) });
153
- $[49] = t11;
154
- } else {
155
- t11 = $[49];
156
- }
157
- t4 = "date-calendar-box-grid-of-days";
158
- t2 = "Calendário";
159
- t3 = "grid";
160
- t0 = "weeks";
161
- let t20;
162
- if ($[50] !== activeDescendant || $[51] !== calendarDisplayDate || $[52] !== handleOnClick || $[53] !== isInRange || $[54] !== isSelected) {
163
- t20 = (week, weekIndex) => /* @__PURE__ */ jsx("tr", { role: "row", children: week.map((day_2, dateIndex) => {
164
- const idActiveDescendant = day_2.format(TOKEN_ISO_FORMAT);
165
- const isToday = _.isEqual(hooks().format(TOKEN_ISO_FORMAT), day_2.format(TOKEN_ISO_FORMAT));
166
- const inRange = isInRange(day_2) ?? false;
167
- const hasFocus = _.isEqual(activeDescendant, day_2.format(TOKEN_ISO_FORMAT));
168
- const hasSelected = isSelected(day_2) ?? false;
169
- const isCurrentMonth = day_2.month() === calendarDisplayDate.month();
170
- const descriptionDate = day_2.format("LL");
171
- return /* @__PURE__ */ jsx("td", { role: "gridcell", children: /* @__PURE__ */ jsx(Button, { id: idActiveDescendant, type: "button", className: "day-button", boxShadow: false, tabIndex: -1, title: descriptionDate, "aria-label": descriptionDate, "aria-selected": hasSelected, "data-testid": "test-date-period-field-day-button", "data-state-is-today": isToday, "data-state-has-focus": hasFocus, "data-state-is-in-range": inRange, "data-state-is-current-month": isCurrentMonth, label: day_2.date().toString(), onMouseDown: handleOnMouseDown, onClick: (event_0) => {
172
- handleOnClick(event_0, day_2);
173
- } }) }, dateIndex);
174
- }) }, weekIndex + 1);
175
- $[50] = activeDescendant;
176
- $[51] = calendarDisplayDate;
177
- $[52] = handleOnClick;
178
- $[53] = isInRange;
179
- $[54] = isSelected;
180
- $[55] = t20;
181
- } else {
182
- t20 = $[55];
183
- }
184
- t1 = weeks.map(t20);
185
- $[0] = activeDescendant;
186
- $[1] = calendarBoxOpen;
187
- $[2] = calendarBoxStyles;
188
- $[3] = calendarDisplayDate;
189
- $[4] = finalInputId;
190
- $[5] = handleChangeActiveDescendant;
191
- $[6] = handleChangeNextMonth;
192
- $[7] = handleChangePreviousMonth;
193
- $[8] = handleChangeUpdateDateState;
194
- $[9] = initialInputId;
195
- $[10] = ref;
196
- $[11] = selectedDate;
197
- $[12] = t0;
198
- $[13] = t1;
199
- $[14] = t10;
200
- $[15] = t11;
201
- $[16] = t2;
202
- $[17] = t3;
203
- $[18] = t4;
204
- $[19] = t5;
205
- $[20] = t6;
206
- $[21] = t7;
207
- $[22] = t8;
208
- $[23] = t9;
209
- } else {
210
- t0 = $[12];
211
- t1 = $[13];
212
- t10 = $[14];
213
- t11 = $[15];
214
- t2 = $[16];
215
- t3 = $[17];
216
- t4 = $[18];
217
- t5 = $[19];
218
- t6 = $[20];
219
- t7 = $[21];
220
- t8 = $[22];
221
- t9 = $[23];
222
- }
223
- let t12;
224
- if ($[56] !== t0 || $[57] !== t1) {
225
- t12 = /* @__PURE__ */ jsx("tbody", { className: t0, children: t1 });
226
- $[56] = t0;
227
- $[57] = t1;
228
- $[58] = t12;
229
- } else {
230
- t12 = $[58];
231
- }
232
- let t13;
233
- if ($[59] !== t12 || $[60] !== t2 || $[61] !== t3) {
234
- t13 = /* @__PURE__ */ jsx("table", { "aria-label": t2, role: t3, children: t12 });
235
- $[59] = t12;
236
- $[60] = t2;
237
- $[61] = t3;
238
- $[62] = t13;
239
- } else {
240
- t13 = $[62];
241
- }
242
- let t14;
243
- if ($[63] !== t13 || $[64] !== t4) {
244
- t14 = /* @__PURE__ */ jsx("div", { className: t4, children: t13 });
245
- $[63] = t13;
246
- $[64] = t4;
247
- $[65] = t14;
248
- } else {
249
- t14 = $[65];
250
- }
251
- let t15;
252
- if ($[66] !== t10 || $[67] !== t11 || $[68] !== t14 || $[69] !== t5 || $[70] !== t6 || $[71] !== t7 || $[72] !== t8 || $[73] !== t9) {
253
- t15 = /* @__PURE__ */ jsxs("div", { ref: t5, style: t6, "aria-expanded": t7, className: t8, "data-testid": t9, children: [
254
- t10,
255
- t11,
256
- t14
257
- ] });
258
- $[66] = t10;
259
- $[67] = t11;
260
- $[68] = t14;
261
- $[69] = t5;
262
- $[70] = t6;
263
- $[71] = t7;
264
- $[72] = t8;
265
- $[73] = t9;
266
- $[74] = t15;
267
- } else {
268
- t15 = $[74];
269
- }
270
- return t15;
271
- });
272
- CalendarBox.displayName = "DatePeriodFieldCalendarBox";
273
- function _temp(event) {
274
- event?.preventDefault?.();
275
- }
276
- function _temp2(day_1, idx) {
277
- return /* @__PURE__ */ jsx("span", { title: day_1, role: "columnheader", children: day_1 }, `day-of-week-${idx + 1}`);
278
- }
279
- export {
280
- CalendarBox
281
- };
282
- //# sourceMappingURL=calendarbox.js.map