linear-react-components-ui 2.2.0-beta.0 → 2.2.0-beta.10

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 (73) hide show
  1. package/lib/assets/styles/datepicker2.css +81 -11
  2. package/lib/form2/useForm/index.js +0 -1
  3. package/lib/form2/useForm/index.js.map +1 -1
  4. package/lib/hooks/useScrollEndReached/index.d.ts +8 -0
  5. package/lib/hooks/useScrollEndReached/index.js +69 -0
  6. package/lib/hooks/useScrollEndReached/index.js.map +1 -0
  7. package/lib/hooks/useScrollEndReached/types.d.ts +7 -0
  8. package/lib/inputs/select/Dropdown.js +11 -1
  9. package/lib/inputs/select/Dropdown.js.map +1 -1
  10. package/lib/inputs/select/multiple/index.js +5 -2
  11. package/lib/inputs/select/multiple/index.js.map +1 -1
  12. package/lib/inputs/select/simple/index.js +5 -2
  13. package/lib/inputs/select/simple/index.js.map +1 -1
  14. package/lib/inputs/select/types.d.ts +3 -2
  15. package/lib/inputs/types.d.ts +2 -1
  16. package/lib/inputs2/date/calendarbox.d.ts +23 -0
  17. package/lib/inputs2/date/calendarbox.js +254 -0
  18. package/lib/inputs2/date/calendarbox.js.map +1 -0
  19. package/lib/inputs2/date/datefield/base.js +691 -214
  20. package/lib/inputs2/date/datefield/base.js.map +1 -1
  21. package/lib/inputs2/date/datefield/triggers.js +4 -4
  22. package/lib/inputs2/date/datefield/triggers.js.map +1 -1
  23. package/lib/inputs2/date/datefield/types.d.ts +5 -12
  24. package/lib/inputs2/date/dateperiodfield/base.js +694 -809
  25. package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
  26. package/lib/inputs2/date/dateperiodfield/triggers.js +21 -9
  27. package/lib/inputs2/date/dateperiodfield/triggers.js.map +1 -1
  28. package/lib/inputs2/date/dateperiodfield/types.d.ts +13 -23
  29. package/lib/inputs2/date/helpers.d.ts +44 -4
  30. package/lib/inputs2/date/helpers.js +200 -4
  31. package/lib/inputs2/date/helpers.js.map +1 -1
  32. package/lib/inputs2/date/{base/constants.d.ts → hooks/useCalendarPosition.d.ts} +1 -1
  33. package/lib/inputs2/date/hooks/useCalendarPosition.js +93 -0
  34. package/lib/inputs2/date/hooks/useCalendarPosition.js.map +1 -0
  35. package/lib/inputs2/date/hooks/useDateCalendarState.d.ts +14 -0
  36. package/lib/inputs2/date/hooks/useDateCalendarState.js +250 -0
  37. package/lib/inputs2/date/hooks/useDateCalendarState.js.map +1 -0
  38. package/lib/inputs2/date/hooks/useDateMask.d.ts +22 -0
  39. package/lib/inputs2/date/hooks/useDateMask.js +143 -0
  40. package/lib/inputs2/date/hooks/useDateMask.js.map +1 -0
  41. package/lib/inputs2/date/timeselector.d.ts +17 -0
  42. package/lib/inputs2/date/timeselector.js +226 -0
  43. package/lib/inputs2/date/timeselector.js.map +1 -0
  44. package/lib/inputs2/date/types.d.ts +22 -1
  45. package/lib/inputs2/date/types.js.map +1 -1
  46. package/lib/inputs2/selectfield/base.js +4 -1
  47. package/lib/inputs2/selectfield/base.js.map +1 -1
  48. package/lib/inputs2/selectfield/listbox.d.ts +2 -1
  49. package/lib/inputs2/selectfield/listbox.js +10 -0
  50. package/lib/inputs2/selectfield/listbox.js.map +1 -1
  51. package/lib/inputs2/selectfield/types.d.ts +2 -1
  52. package/lib/inputs2/selectfield/types.js.map +1 -1
  53. package/lib/node_modules/lodash/lodash.js +2 -2
  54. package/lib/node_modules/lodash/lodash.js.map +1 -1
  55. package/lib/node_modules/moment/dist/locale/pt-br.js +54 -0
  56. package/lib/node_modules/moment/dist/locale/pt-br.js.map +1 -0
  57. package/lib/panel/Content.js +28 -82
  58. package/lib/panel/Content.js.map +1 -1
  59. package/lib/panel/Default.d.ts +1 -1
  60. package/lib/panel/Default.js +60 -54
  61. package/lib/panel/Default.js.map +1 -1
  62. package/lib/panel/helpers.js +1 -16
  63. package/lib/panel/helpers.js.map +1 -1
  64. package/lib/panel/types.d.ts +3 -6
  65. package/package.json +1 -1
  66. package/lib/inputs2/date/base/constants.js +0 -69
  67. package/lib/inputs2/date/base/constants.js.map +0 -1
  68. package/lib/inputs2/date/datefield/calendarbox.d.ts +0 -6
  69. package/lib/inputs2/date/datefield/calendarbox.js +0 -228
  70. package/lib/inputs2/date/datefield/calendarbox.js.map +0 -1
  71. package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +0 -6
  72. package/lib/inputs2/date/dateperiodfield/calendarbox.js +0 -282
  73. package/lib/inputs2/date/dateperiodfield/calendarbox.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/lib/inputs/select/simple/index.tsx"],"sourcesContent":["import { KeyboardEvent as KeyboardEventReact, useEffect, useRef, useState } from 'react';\nimport * as uuid from 'uuid';\nimport _ from 'lodash';\nimport Dropdown from '../Dropdown';\nimport ActionButtons from '../ActionButtons';\nimport * as constants from '../../../internals/constants';\nimport { getFilteredSimpleDataCombo } from '../helper';\nimport { DataCombo } from '../../../@types/DataCombo';\nimport { OnDenied } from '../../../@types/PermissionAttr';\nimport InputTextBase from '../../base/InputTextBase';\nimport { ISimpleSelectProps } from '../types';\nimport { CustomInputEvent } from '../../base/types';\n\nconst SimpleSelect = (props: ISimpleSelectProps) => {\n const {\n value, descriptionKey, dataSource = [], gridLayout, onSearch, disabled, readOnly,\n openDropdownOnFocus = true, selectFirstOnEnter = false, idKey, remoteSearch = false, name = '',\n undigitable, searchOnDropdown = false, allOptions = undefined, showClearButton = false,\n searchNotFoundText, rightElements = [], customClassForWrapper, customClassForInputContent, \n customClassForLabel, customClassForSideButtons, dropdownMaxWidth = undefined,\n } = props;\n\n const descriptionKeyIsString = typeof descriptionKey === 'string';\n const dataSourceWithAllOptions = allOptions\n ? [{\n [idKey]: allOptions.idValue,\n [descriptionKeyIsString ?\n descriptionKey :\n descriptionKey(allOptions.label)]: allOptions.label,\n }, ...dataSource]\n : dataSource;\n const [dataCombo, setDataCombo] = useState<DataCombo[]>(dataSourceWithAllOptions);\n const [selected, setSelected] = useState<DataCombo | null>(null);\n const [inputText, setInputText] = useState('');\n const [opened, setOpened] = useState(false);\n const [dropdownWidth, setDropdownWidth] = useState(0);\n const [insideComponent, setInsideComponent] = useState(false);\n const [onDenied, setOnDeniedSelect] = useState<OnDenied>();\n const [isTyping, setIsTyping] = useState(false);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const componentId = `select-component-${name}-${uuid.v1()}`;\n const componentRef = useRef<HTMLInputElement>(null);\n const selectWrapper = useRef<HTMLDivElement>(null);\n const gridElement = useRef<Element>(null);\n const inputTextRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n const onScreenResize = () => {\n if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);\n };\n\n const onClickOutside = (event: MouseEvent) => {\n const { target } = event;\n if (target !== selectWrapper.current && !selectWrapper.current?.contains(target as Node) &&\n !dropdownRef.current?.contains(target as Node)) {\n setOpened(false);\n }\n };\n\n const onMouseMove = (event: MouseEvent) => {\n const target = event.target as Element;\n const idDropdown = dropdownRef.current?.parentElement?.id || '';\n const dropdownElement = document.getElementById(idDropdown);\n const keepDropdownOpen = Boolean(dropdownElement?.contains(target));\n setInsideComponent(keepDropdownOpen);\n };\n\n const getSelectEvent = (selectedEvent?: DataCombo) => (\n {\n target: {\n value: selectedEvent ? selectedEvent[idKey] : undefined,\n name,\n },\n }\n );\n\n const onChange = (selectedChange?: DataCombo) => {\n if (props.onChange) {\n const event = getSelectEvent(selectedChange);\n props.onChange(event);\n }\n };\n\n const onFilter = (valueFilter: string) => {\n let selectedFilter = null;\n if (remoteSearch) {\n if (onSearch) onSearch(valueFilter);\n } else {\n const dataComboFilter = getFilteredSimpleDataCombo({\n inputText: valueFilter,\n descriptionKey,\n dataSource: dataSourceWithAllOptions,\n });\n\n if (dataComboFilter && dataComboFilter.length > 0) {\n selectedFilter = dataComboFilter[0];\n setSelected(selectedFilter);\n }\n setDataCombo(dataComboFilter);\n }\n setOpened(true);\n setInputText(valueFilter);\n if (selectedFilter) {\n if ((descriptionKeyIsString && valueFilter === selectedFilter[descriptionKey])\n || (!descriptionKeyIsString && valueFilter === descriptionKey(selectedFilter))) {\n onChange(selectedFilter);\n }\n }\n };\n\n const onSelect = (selectedDropdown: DataCombo) => {\n if (!selectedDropdown) return;\n setSelected(selectedDropdown);\n\n if (descriptionKeyIsString) setInputText(selectedDropdown[descriptionKey]);\n else setInputText(descriptionKey(selectedDropdown));\n new Promise((resolve) => {\n resolve(onChange(selectedDropdown));\n }).finally(() => {\n if (inputTextRef && inputTextRef.current) inputTextRef.current.focus();\n setOpened(false);\n });\n dropdownRef.current?.focus();\n };\n\n const onOpenClose = () => {\n setOpened(prevState => !prevState);\n if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);\n };\n\n const onFocus = () => {\n if (openDropdownOnFocus) setOpened(true);\n if (selectWrapper) {\n const dropdownWidthFocus = selectWrapper.current ? selectWrapper.current.clientWidth : 0;\n setDropdownWidth(dropdownWidthFocus);\n }\n };\n\n const onBlur = () => {\n if (props.onBlur) {\n const event = getSelectEvent(selected);\n props.onBlur(event);\n if (selected && (descriptionKeyIsString && inputText !== selected[descriptionKey])\n || (!descriptionKeyIsString && inputText !== descriptionKey(selected))) {\n setSelected(null);\n setInputText(inputText);\n new Promise((resolve) => {\n resolve(onChange(null));\n }).finally(() => {\n onChange();\n });\n }\n }\n if (!insideComponent) {\n setOpened(false);\n setIsTyping(false);\n setDataCombo(dataSourceWithAllOptions);\n }\n };\n\n const onInputKeyDown = (e: CustomInputEvent | KeyboardEventReact) => {\n if (e.keyCode) {\n if ((e.keyCode === constants.keyCodes.ENTER || e.key === constants.keys.TAB) && \n selected && opened) {\n if (e.keyCode === constants.keyCodes.ENTER) e.preventDefault?.();\n onSelect(selected);\n } else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {\n if (!opened) setOpened(true);\n let index = dataCombo.length > 0\n ? dataCombo.findIndex(d => selected &&\n d[idKey] === selected[idKey])\n : 0;\n if (e.keyCode === constants.keyCodes.ARROW_DOWN) {\n index = (dataCombo\n && index === dataCombo.length - 1\n ? 0\n : index + 1);\n } else {\n index = (dataCombo\n && index === 0\n ? dataCombo?.length - 1\n : index - 1);\n }\n setSelected(dataCombo[index]);\n if (descriptionKeyIsString) setInputText(dataCombo[index][descriptionKey]);\n if (!descriptionKeyIsString) setInputText(descriptionKey(dataCombo[index]));\n }\n }\n if (!isTyping) setIsTyping(true);\n };\n\n const onClearClick = () => {\n new Promise((resolve) => {\n resolve(onChange(null));\n }).finally(() => {\n setSelected(null);\n setInputText('');\n onChange();\n if (inputTextRef && inputTextRef.current) inputTextRef.current.focus();\n setOpened(false);\n });\n };\n\n const setOnDenied = (onDeniedSelect: OnDenied) => {\n setOnDeniedSelect(onDeniedSelect);\n };\n\n const shouldDisable = () =>\n disabled || (onDenied && (onDenied.disabled || onDenied.hideContent));\n\n const shouldBeReadOnly = () => readOnly || (onDenied && (onDenied.readOnly));\n\n useEffect(() => {\n window.addEventListener('resize', onScreenResize);\n document.addEventListener('click', onClickOutside);\n document.addEventListener('mousemove', onMouseMove);\n\n return () => {\n window.removeEventListener('resize', onScreenResize);\n document.removeEventListener('click', onClickOutside);\n document.removeEventListener('mousemove', onMouseMove);\n };\n }, []);\n\n useEffect(() => {\n if (gridLayout) {\n const gridEl = document.querySelector(`#${componentId}>.-withinput.grid-container`);\n if (gridElement.current !== gridEl && gridEl) gridElement.current = gridEl;\n }\n }, [gridLayout]);\n\n useEffect(() => {\n if (dataSourceWithAllOptions.length > 0) {\n let newCurrent = null;\n if (value || value === 0) {\n newCurrent = dataSourceWithAllOptions.find(i => (value || value === 0)\n && i[idKey]?.toString().toLowerCase() === value?.toString().toLowerCase());\n } else if (dataSourceWithAllOptions.length > 0 && selectFirstOnEnter) {\n newCurrent = dataSourceWithAllOptions[0];\n }\n\n setSelected(newCurrent);\n if (descriptionKeyIsString) setInputText(newCurrent ? newCurrent[descriptionKey] : '');\n else setInputText(newCurrent ? descriptionKey(newCurrent) : '');\n }\n\n if (dataSourceWithAllOptions.length === 0 && inputText) {\n setInputText('');\n }\n }, [dataSourceWithAllOptions.length, value]);\n\n useEffect(() => {\n if (!_.isEqual(dataCombo, dataSourceWithAllOptions)) {\n const dataComboFilteredSimple = (undigitable || remoteSearch || !isTyping) ?\n dataSourceWithAllOptions\n : getFilteredSimpleDataCombo({\n inputText, dataSource: dataSourceWithAllOptions, descriptionKey,\n });\n setDataCombo(dataComboFilteredSimple);\n if (dataSourceWithAllOptions.length > 0 && remoteSearch) {\n const data = dataSourceWithAllOptions[0];\n setSelected(data);\n }\n }\n\n if (allOptions) {\n setDataCombo([\n {\n [idKey]: allOptions.idValue,\n [descriptionKeyIsString ?\n descriptionKey :\n descriptionKey(allOptions.label)]: allOptions.label,\n },\n ...dataSource,\n ]);\n }\n }, [JSON.stringify(dataSourceWithAllOptions)]);\n\n return (\n <span\n id={componentId}\n ref={componentRef}\n className=\"select-component\">\n <InputTextBase\n {...props}\n inputRef={(ref) => {\n if (props.inputRef) {\n if (!_.isFunction(props.inputRef)) {\n props.inputRef.current = ref;\n } else {\n props.inputRef(ref);\n }\n }\n inputTextRef.current = ref;\n }}\n autoComplete=\"off\"\n readOnly={undigitable || shouldBeReadOnly()}\n value={inputText}\n onFocus={onFocus}\n onBlur={onBlur}\n onChange={(e?: CustomInputEvent) => {\n if (e) onFilter(e.target.value);\n }}\n onClick={onFocus}\n onKeyDown={onInputKeyDown}\n customClassForLabel={customClassForLabel}\n customClassForWrapper={\n `selectwrapper ${(undigitable || searchOnDropdown || shouldBeReadOnly()) && ' -undigitable'} ${customClassForWrapper}`\n }\n customClassForInputContent={`multiselect ${customClassForInputContent}`}\n inputBaseRef={(r: HTMLDivElement) => { selectWrapper.current = r; }}\n handlerSetOnDenied={(inputOnDenied: OnDenied) => setOnDenied(inputOnDenied)}\n rightElements={[\n ...rightElements,\n <ActionButtons\n key=\"action-buttons-simpleselect\"\n disabled={shouldDisable() || shouldBeReadOnly()}\n showClearButton={showClearButton}\n dropDownOpened={opened}\n handlerClear={() => {\n if (shouldDisable()) return null;\n return onClearClick();\n }}\n handlerOpenClose={onOpenClose}\n customClassForSideButtons={customClassForSideButtons} />,\n ]} />\n {opened &&\n <Dropdown\n {...props}\n opened={opened}\n selected={selected}\n inputValue={inputText}\n selectFieldRef={componentRef}\n dropdownRef={dropdownRef}\n searchOnDropdown={searchOnDropdown}\n gridWrapperStyle={gridLayout && gridElement.current ?\n window.getComputedStyle(gridElement.current)\n : undefined}\n handleOnSelect={(dataSelected?: DataCombo) => {\n if (dataSelected) onSelect(dataSelected);\n }}\n handleOnFilter={(valueFilter: string) => onFilter(valueFilter)}\n handleOnKeydown={onInputKeyDown}\n handleOnBlur={() => onBlur}\n handleOnFocus={onFocus}\n dataCombo={dataCombo}\n searchNotFoundText={searchNotFoundText}\n dropdownWidth={dropdownMaxWidth || dropdownWidth || 0} />\n }\n </span>\n );\n};\nexport default SimpleSelect;\n"],"names":["SimpleSelect","props","value","descriptionKey","dataSource","gridLayout","onSearch","disabled","readOnly","openDropdownOnFocus","selectFirstOnEnter","idKey","remoteSearch","name","undigitable","searchOnDropdown","allOptions","undefined","showClearButton","searchNotFoundText","rightElements","customClassForWrapper","customClassForInputContent","customClassForLabel","customClassForSideButtons","dropdownMaxWidth","descriptionKeyIsString","dataSourceWithAllOptions","idValue","label","dataCombo","setDataCombo","useState","selected","setSelected","inputText","setInputText","opened","setOpened","dropdownWidth","setDropdownWidth","insideComponent","setInsideComponent","onDenied","setOnDeniedSelect","isTyping","setIsTyping","dropdownRef","useRef","componentId","uuid","componentRef","selectWrapper","gridElement","inputTextRef","onScreenResize","current","clientWidth","onClickOutside","event","target","contains","onMouseMove","idDropdown","parentElement","id","dropdownElement","document","getElementById","keepDropdownOpen","Boolean","getSelectEvent","selectedEvent","onChange","selectedChange","onFilter","valueFilter","selectedFilter","dataComboFilter","getFilteredSimpleDataCombo","length","onSelect","selectedDropdown","Promise","resolve","finally","focus","onOpenClose","prevState","onFocus","dropdownWidthFocus","onBlur","onInputKeyDown","e","keyCode","constants","ENTER","key","TAB","preventDefault","ARROW_UP","ARROW_DOWN","includes","index","findIndex","d","onClearClick","setOnDenied","onDeniedSelect","shouldDisable","hideContent","shouldBeReadOnly","useEffect","window","addEventListener","removeEventListener","gridEl","querySelector","newCurrent","find","i","toString","toLowerCase","_","isEqual","dataComboFilteredSimple","data","JSON","stringify","ref","inputRef","isFunction","r","inputOnDenied","getComputedStyle","dataSelected"],"mappings":";;;;;;;;;AAaA,MAAMA,eAAeA,CAACC,UAA8B;AAClD,QAAM;AAAA,IACJC;AAAAA,IAAOC;AAAAA,IAAgBC,aAAa,CAAA;AAAA,IAAIC;AAAAA,IAAYC;AAAAA,IAAUC;AAAAA,IAAUC;AAAAA,IACxEC,sBAAsB;AAAA,IAAMC,qBAAqB;AAAA,IAAOC;AAAAA,IAAOC,eAAe;AAAA,IAAOC,OAAO;AAAA,IAC5FC;AAAAA,IAAaC,mBAAmB;AAAA,IAAOC,aAAaC;AAAAA,IAAWC,kBAAkB;AAAA,IACjFC;AAAAA,IAAoBC,gBAAgB,CAAA;AAAA,IAAIC;AAAAA,IAAuBC;AAAAA,IAC/DC;AAAAA,IAAqBC;AAAAA,IAA2BC,mBAAmBR;AAAAA,EAAAA,IACjEhB;AAEJ,QAAMyB,yBAAyB,OAAOvB,mBAAmB;AACzD,QAAMwB,2BAA2BX,aAC7B,CAAC;AAAA,IACC,CAACL,KAAK,GAAGK,WAAWY;AAAAA,IACpB,CAACF,yBACCvB,iBACEA,eAAea,WAAWa,KAAK,CAAC,GAAGb,WAAWa;AAAAA,EAAAA,GACjD,GAAGzB,UAAU,IAChBA;AACJ,QAAM,CAAC0B,WAAWC,YAAY,IAAIC,SAAsBL,wBAAwB;AAChF,QAAM,CAACM,UAAUC,WAAW,IAAIF,SAA2B,IAAI;AAC/D,QAAM,CAACG,WAAWC,YAAY,IAAIJ,SAAS,EAAE;AAC7C,QAAM,CAACK,QAAQC,SAAS,IAAI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AIwE,cAAAA,EAAiB,QAAO;AAC5B,aAAOH,aAAAA;AAAAA,IACT,GACA,kBAAkBnB,aAClB,0BAAA,GATI,6BASiD,CAAG,GAC1D;AAAA,IACHlD,UACC,oBAAC,UAAA,EACC,GAAIpC,OACJ,QACA,UACA,YAAYkC,WACZ,gBAAgBgB,cAChB,aACA,kBACA,kBAAkB9C,cAAcgD,YAAYG,UACxCyD,OAAOqB,iBAAiBjF,YAAYG,OAAO,IAC3CvC,QACJ,gBAAgB,CAACsH,iBAA6B;AAC5C,UAAIA,uBAAuBA,YAAY;AAAA,IACzC,GACA,gBAAgB,CAAC3D,kBAAwBD,SAASC,aAAW,GAC7D,iBAAiBgB,gBACjB,cAAc,MAAMD,QACpB,eAAeF,SACf,WACA,oBACA,eAAehE,oBAAoBc,iBAAiB,EAAA,CAAE;AAAA,EAAA,GAE5D;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/lib/inputs/select/simple/index.tsx"],"sourcesContent":["import { KeyboardEvent as KeyboardEventReact, useEffect, useRef, useState } from 'react';\nimport * as uuid from 'uuid';\nimport _ from 'lodash';\nimport Dropdown from '../Dropdown';\nimport ActionButtons from '../ActionButtons';\nimport * as constants from '../../../internals/constants';\nimport { getFilteredSimpleDataCombo } from '../helper';\nimport { DataCombo } from '../../../@types/DataCombo';\nimport { OnDenied } from '../../../@types/PermissionAttr';\nimport InputTextBase from '../../base/InputTextBase';\nimport { ISimpleSelectProps } from '../types';\nimport { CustomInputEvent } from '../../base/types';\n\nconst SimpleSelect = (props: ISimpleSelectProps) => {\n const {\n value, descriptionKey, dataSource = [], gridLayout, onSearch, disabled, readOnly,\n openDropdownOnFocus = true, selectFirstOnEnter = false, idKey, remoteSearch = false, name = '',\n undigitable, searchOnDropdown = false, allOptions = undefined, showClearButton = false,\n searchNotFoundText, rightElements = [], customClassForWrapper, customClassForInputContent, \n customClassForLabel, customClassForSideButtons, dropdownMaxWidth = undefined,\n onEndReached, onEndReachedThreshold, itemsCount,\n } = props;\n\n const descriptionKeyIsString = typeof descriptionKey === 'string';\n const dataSourceWithAllOptions = allOptions\n ? [{\n [idKey]: allOptions.idValue,\n [descriptionKeyIsString ?\n descriptionKey :\n descriptionKey(allOptions.label)]: allOptions.label,\n }, ...dataSource]\n : dataSource;\n const [dataCombo, setDataCombo] = useState<DataCombo[]>(dataSourceWithAllOptions);\n const [selected, setSelected] = useState<DataCombo | null>(null);\n const [inputText, setInputText] = useState('');\n const [opened, setOpened] = useState(false);\n const [dropdownWidth, setDropdownWidth] = useState(0);\n const [insideComponent, setInsideComponent] = useState(false);\n const [onDenied, setOnDeniedSelect] = useState<OnDenied>();\n const [isTyping, setIsTyping] = useState(false);\n\n const dropdownRef = useRef<HTMLDivElement>(null);\n const componentId = `select-component-${name}-${uuid.v1()}`;\n const componentRef = useRef<HTMLInputElement>(null);\n const selectWrapper = useRef<HTMLDivElement>(null);\n const gridElement = useRef<Element>(null);\n const inputTextRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n const onScreenResize = () => {\n if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);\n };\n\n const onClickOutside = (event: MouseEvent) => {\n const { target } = event;\n if (target !== selectWrapper.current && !selectWrapper.current?.contains(target as Node) &&\n !dropdownRef.current?.contains(target as Node)) {\n setOpened(false);\n }\n };\n\n const onMouseMove = (event: MouseEvent) => {\n const target = event.target as Element;\n const idDropdown = dropdownRef.current?.parentElement?.id || '';\n const dropdownElement = document.getElementById(idDropdown);\n const keepDropdownOpen = Boolean(dropdownElement?.contains(target));\n setInsideComponent(keepDropdownOpen);\n };\n\n const getSelectEvent = (selectedEvent?: DataCombo) => (\n {\n target: {\n value: selectedEvent ? selectedEvent[idKey] : undefined,\n name,\n },\n }\n );\n\n const onChange = (selectedChange?: DataCombo) => {\n if (props.onChange) {\n const event = getSelectEvent(selectedChange);\n props.onChange(event);\n }\n };\n\n const onFilter = (valueFilter: string) => {\n let selectedFilter = null;\n if (remoteSearch) {\n if (onSearch) onSearch(valueFilter);\n } else {\n const dataComboFilter = getFilteredSimpleDataCombo({\n inputText: valueFilter,\n descriptionKey,\n dataSource: dataSourceWithAllOptions,\n });\n\n if (dataComboFilter && dataComboFilter.length > 0) {\n selectedFilter = dataComboFilter[0];\n setSelected(selectedFilter);\n }\n setDataCombo(dataComboFilter);\n }\n setOpened(true);\n setInputText(valueFilter);\n if (selectedFilter) {\n if ((descriptionKeyIsString && valueFilter === selectedFilter[descriptionKey])\n || (!descriptionKeyIsString && valueFilter === descriptionKey(selectedFilter))) {\n onChange(selectedFilter);\n }\n }\n };\n\n const onSelect = (selectedDropdown: DataCombo) => {\n if (!selectedDropdown) return;\n setSelected(selectedDropdown);\n\n if (descriptionKeyIsString) setInputText(selectedDropdown[descriptionKey]);\n else setInputText(descriptionKey(selectedDropdown));\n new Promise((resolve) => {\n resolve(onChange(selectedDropdown));\n }).finally(() => {\n if (inputTextRef && inputTextRef.current) inputTextRef.current.focus();\n setOpened(false);\n });\n dropdownRef.current?.focus();\n };\n\n const onOpenClose = () => {\n setOpened(prevState => !prevState);\n if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);\n };\n\n const onFocus = () => {\n if (openDropdownOnFocus) setOpened(true);\n if (selectWrapper) {\n const dropdownWidthFocus = selectWrapper.current ? selectWrapper.current.clientWidth : 0;\n setDropdownWidth(dropdownWidthFocus);\n }\n };\n\n const onBlur = () => {\n if (props.onBlur) {\n const event = getSelectEvent(selected);\n props.onBlur(event);\n if (selected && (descriptionKeyIsString && inputText !== selected[descriptionKey])\n || (!descriptionKeyIsString && inputText !== descriptionKey(selected))) {\n setSelected(null);\n setInputText(inputText);\n new Promise((resolve) => {\n resolve(onChange(null));\n }).finally(() => {\n onChange();\n });\n }\n }\n if (!insideComponent) {\n setOpened(false);\n setIsTyping(false);\n setDataCombo(dataSourceWithAllOptions);\n }\n };\n\n const onInputKeyDown = (e: CustomInputEvent | KeyboardEventReact) => {\n if (e.keyCode) {\n if ((e.keyCode === constants.keyCodes.ENTER || e.key === constants.keys.TAB) && \n selected && opened) {\n if (e.keyCode === constants.keyCodes.ENTER) e.preventDefault?.();\n onSelect(selected);\n } else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {\n if (!opened) setOpened(true);\n let index = dataCombo.length > 0\n ? dataCombo.findIndex(d => selected &&\n d[idKey] === selected[idKey])\n : 0;\n if (e.keyCode === constants.keyCodes.ARROW_DOWN) {\n index = (dataCombo\n && index === dataCombo.length - 1\n ? 0\n : index + 1);\n } else {\n index = (dataCombo\n && index === 0\n ? dataCombo?.length - 1\n : index - 1);\n }\n setSelected(dataCombo[index]);\n if (descriptionKeyIsString) setInputText(dataCombo[index][descriptionKey]);\n if (!descriptionKeyIsString) setInputText(descriptionKey(dataCombo[index]));\n }\n }\n if (!isTyping) setIsTyping(true);\n };\n\n const onClearClick = () => {\n new Promise((resolve) => {\n resolve(onChange(null));\n }).finally(() => {\n setSelected(null);\n setInputText('');\n onChange();\n if (inputTextRef && inputTextRef.current) inputTextRef.current.focus();\n setOpened(false);\n });\n };\n\n const setOnDenied = (onDeniedSelect: OnDenied) => {\n setOnDeniedSelect(onDeniedSelect);\n };\n\n const shouldDisable = () =>\n disabled || (onDenied && (onDenied.disabled || onDenied.hideContent));\n\n const shouldBeReadOnly = () => readOnly || (onDenied && (onDenied.readOnly));\n\n useEffect(() => {\n window.addEventListener('resize', onScreenResize);\n document.addEventListener('click', onClickOutside);\n document.addEventListener('mousemove', onMouseMove);\n\n return () => {\n window.removeEventListener('resize', onScreenResize);\n document.removeEventListener('click', onClickOutside);\n document.removeEventListener('mousemove', onMouseMove);\n };\n }, []);\n\n useEffect(() => {\n if (gridLayout) {\n const gridEl = document.querySelector(`#${componentId}>.-withinput.grid-container`);\n if (gridElement.current !== gridEl && gridEl) gridElement.current = gridEl;\n }\n }, [gridLayout]);\n\n useEffect(() => {\n if (dataSourceWithAllOptions.length > 0) {\n let newCurrent = null;\n if (value || value === 0) {\n newCurrent = dataSourceWithAllOptions.find(i => (value || value === 0)\n && i[idKey]?.toString().toLowerCase() === value?.toString().toLowerCase());\n } else if (dataSourceWithAllOptions.length > 0 && selectFirstOnEnter) {\n newCurrent = dataSourceWithAllOptions[0];\n }\n\n setSelected(newCurrent);\n if (descriptionKeyIsString) setInputText(newCurrent ? newCurrent[descriptionKey] : '');\n else setInputText(newCurrent ? descriptionKey(newCurrent) : '');\n }\n\n if (dataSourceWithAllOptions.length === 0 && inputText) {\n setInputText('');\n }\n }, [dataSourceWithAllOptions.length, value]);\n\n useEffect(() => {\n if (!_.isEqual(dataCombo, dataSourceWithAllOptions)) {\n const dataComboFilteredSimple = (undigitable || remoteSearch || !isTyping) ?\n dataSourceWithAllOptions\n : getFilteredSimpleDataCombo({\n inputText, dataSource: dataSourceWithAllOptions, descriptionKey,\n });\n setDataCombo(dataComboFilteredSimple);\n if (dataSourceWithAllOptions.length > 0 && remoteSearch) {\n const data = dataSourceWithAllOptions[0];\n setSelected(data);\n }\n }\n\n if (allOptions) {\n setDataCombo([\n {\n [idKey]: allOptions.idValue,\n [descriptionKeyIsString ?\n descriptionKey :\n descriptionKey(allOptions.label)]: allOptions.label,\n },\n ...dataSource,\n ]);\n }\n }, [JSON.stringify(dataSourceWithAllOptions)]);\n\n return (\n <span\n id={componentId}\n ref={componentRef}\n className=\"select-component\">\n <InputTextBase\n {...props}\n inputRef={(ref) => {\n if (props.inputRef) {\n if (!_.isFunction(props.inputRef)) {\n props.inputRef.current = ref;\n } else {\n props.inputRef(ref);\n }\n }\n inputTextRef.current = ref;\n }}\n autoComplete=\"off\"\n readOnly={undigitable || shouldBeReadOnly()}\n value={inputText}\n onFocus={onFocus}\n onBlur={onBlur}\n onChange={(e?: CustomInputEvent) => {\n if (e) onFilter(e.target.value);\n }}\n onClick={onFocus}\n onKeyDown={onInputKeyDown}\n customClassForLabel={customClassForLabel}\n customClassForWrapper={\n `selectwrapper ${(undigitable || searchOnDropdown || shouldBeReadOnly()) && ' -undigitable'} ${customClassForWrapper}`\n }\n customClassForInputContent={`multiselect ${customClassForInputContent}`}\n inputBaseRef={(r: HTMLDivElement) => { selectWrapper.current = r; }}\n handlerSetOnDenied={(inputOnDenied: OnDenied) => setOnDenied(inputOnDenied)}\n rightElements={[\n ...rightElements,\n <ActionButtons\n key=\"action-buttons-simpleselect\"\n disabled={shouldDisable() || shouldBeReadOnly()}\n showClearButton={showClearButton}\n dropDownOpened={opened}\n handlerClear={() => {\n if (shouldDisable()) return null;\n return onClearClick();\n }}\n handlerOpenClose={onOpenClose}\n customClassForSideButtons={customClassForSideButtons} />,\n ]} />\n {opened &&\n <Dropdown\n {...props}\n opened={opened}\n selected={selected}\n inputValue={inputText}\n selectFieldRef={componentRef}\n dropdownRef={dropdownRef}\n searchOnDropdown={searchOnDropdown}\n gridWrapperStyle={gridLayout && gridElement.current ?\n window.getComputedStyle(gridElement.current)\n : undefined}\n handleOnSelect={(dataSelected?: DataCombo) => {\n if (dataSelected) onSelect(dataSelected);\n }}\n handleOnFilter={(valueFilter: string) => onFilter(valueFilter)}\n handleOnKeydown={onInputKeyDown}\n handleOnBlur={() => onBlur}\n handleOnFocus={onFocus}\n dataCombo={dataCombo}\n searchNotFoundText={searchNotFoundText}\n dropdownWidth={dropdownMaxWidth || dropdownWidth || 0}\n onEndReached={onEndReached}\n onEndReachedThreshold={onEndReachedThreshold}\n itemsCount={itemsCount} />\n }\n </span>\n );\n};\nexport default SimpleSelect;\n"],"names":["SimpleSelect","props","value","descriptionKey","dataSource","gridLayout","onSearch","disabled","readOnly","openDropdownOnFocus","selectFirstOnEnter","idKey","remoteSearch","name","undigitable","searchOnDropdown","allOptions","undefined","showClearButton","searchNotFoundText","rightElements","customClassForWrapper","customClassForInputContent","customClassForLabel","customClassForSideButtons","dropdownMaxWidth","onEndReached","onEndReachedThreshold","itemsCount","descriptionKeyIsString","dataSourceWithAllOptions","idValue","label","dataCombo","setDataCombo","useState","selected","setSelected","inputText","setInputText","opened","setOpened","dropdownWidth","setDropdownWidth","insideComponent","setInsideComponent","onDenied","setOnDeniedSelect","isTyping","setIsTyping","dropdownRef","useRef","componentId","uuid","componentRef","selectWrapper","gridElement","inputTextRef","onScreenResize","current","clientWidth","onClickOutside","event","target","contains","onMouseMove","idDropdown","parentElement","id","dropdownElement","document","getElementById","keepDropdownOpen","Boolean","getSelectEvent","selectedEvent","onChange","selectedChange","onFilter","valueFilter","selectedFilter","dataComboFilter","getFilteredSimpleDataCombo","length","onSelect","selectedDropdown","Promise","resolve","finally","focus","onOpenClose","prevState","onFocus","dropdownWidthFocus","onBlur","onInputKeyDown","e","keyCode","constants","ENTER","key","TAB","preventDefault","ARROW_UP","ARROW_DOWN","includes","index","findIndex","d","onClearClick","setOnDenied","onDeniedSelect","shouldDisable","hideContent","shouldBeReadOnly","useEffect","window","addEventListener","removeEventListener","gridEl","querySelector","newCurrent","find","i","toString","toLowerCase","_","isEqual","dataComboFilteredSimple","data","JSON","stringify","ref","inputRef","isFunction","r","inputOnDenied","getComputedStyle","dataSelected"],"mappings":";;;;;;;;;AAaA,MAAMA,eAAeA,CAACC,UAA8B;AAClD,QAAM;AAAA,IACJC;AAAAA,IAAOC;AAAAA,IAAgBC,aAAa,CAAA;AAAA,IAAIC;AAAAA,IAAYC;AAAAA,IAAUC;AAAAA,IAAUC;AAAAA,IACxEC,sBAAsB;AAAA,IAAMC,qBAAqB;AAAA,IAAOC;AAAAA,IAAOC,eAAe;AAAA,IAAOC,OAAO;AAAA,IAC5FC;AAAAA,IAAaC,mBAAmB;AAAA,IAAOC,aAAaC;AAAAA,IAAWC,kBAAkB;AAAA,IACjFC;AAAAA,IAAoBC,gBAAgB,CAAA;AAAA,IAAIC;AAAAA,IAAuBC;AAAAA,IAC/DC;AAAAA,IAAqBC;AAAAA,IAA2BC,mBAAmBR;AAAAA,IACnES;AAAAA,IAAcC;AAAAA,IAAuBC;AAAAA,EAAAA,IACnC3B;AAEJ,QAAM4B,yBAAyB,OAAO1B,mBAAmB;A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C,OAAO7D,KAAK;AAAA,IAChC,GACA,SAAS0F,SACT,WAAWG,gBACX,qBACA,uBACE,kBAAkBjF,eAAeC,oBAAoBmG,uBAAuB,eAAe,IAAI7F,qBAAqB,IAEtH,4BAA4B,eAAeC,0BAA0B,IACrE,cAAc,CAACiH,MAAsB;AAAEhF,oBAAcI,UAAU4E;AAAAA,IAAG,GAClE,oBAAoB,CAACC,kBAA4B1B,YAAY0B,aAAa,GAC1E,eAAe,CACb,GAAGpH,mCACF,eAAA,EAEC,UAAU4F,mBAAmBE,iBAAAA,GAC7B,iBACA,gBAAgB1E,QAChB,cAAc,MAAM;AAClB,UAAIwE,cAAAA,EAAiB,QAAO;AAC5B,aAAOH,aAAAA;AAAAA,IACT,GACA,kBAAkBnB,aAClB,0BAAA,GATI,6BASiD,CAAG,GAC1D;AAAA,IACHlD,UACC,oBAAC,UAAA,EACC,GAAIvC,OACJ,QACA,UACA,YAAYqC,WACZ,gBAAgBgB,cAChB,aACA,kBACA,kBAAkBjD,cAAcmD,YAAYG,UACxCyD,OAAOqB,iBAAiBjF,YAAYG,OAAO,IAC3C1C,QACJ,gBAAgB,CAACyH,iBAA6B;AAC5C,UAAIA,uBAAuBA,YAAY;AAAA,IACzC,GACA,gBAAgB,CAAC3D,kBAAwBD,SAASC,aAAW,GAC7D,iBAAiBgB,gBACjB,cAAc,MAAMD,QACpB,eAAeF,SACf,WACA,oBACA,eAAenE,oBAAoBiB,iBAAiB,GACpD,cACA,uBACA,WAAA,CAAuB;AAAA,EAAA,GAE7B;AAEJ;"}
@@ -1,5 +1,6 @@
1
1
  import { TextAlign } from 'src/lib/@types/Align';
2
2
  import { JSX, MutableRefObject } from 'react';
3
+ import { UseScrollEndReachedParams } from 'src/lib/hooks/useScrollEndReached/types';
3
4
  import { DataCombo } from '../../@types/DataCombo';
4
5
  import { PermissionAttr } from '../../@types/PermissionAttr';
5
6
  import { CustomInputEvent } from '../base/types';
@@ -8,7 +9,7 @@ export type AllOptions = {
8
9
  label: string;
9
10
  };
10
11
  export type DescriptionKey = string | ((dataSelected: DataCombo) => string);
11
- export interface ISimpleSelectProps {
12
+ export interface ISimpleSelectProps extends UseScrollEndReachedParams {
12
13
  idKey: string;
13
14
  descriptionKey: DescriptionKey;
14
15
  dataSource?: DataCombo[];
@@ -79,7 +80,7 @@ export interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'v
79
80
  required?: boolean;
80
81
  onSelect?: (data?: string | string[]) => DataCombo;
81
82
  }
82
- export interface IMultipleSelectProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
83
+ export interface IMultipleSelectProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'>, UseScrollEndReachedParams {
83
84
  descriptionKey: DescriptionKey;
84
85
  idKey: string;
85
86
  dataSource: DataCombo[];
@@ -4,6 +4,7 @@ import { DataCombo } from '../@types/DataCombo';
4
4
  import { CustomInputEvent, IBaseProps } from './base/types';
5
5
  import { IDrawerProps } from '../drawer/types';
6
6
  import { TextAlign } from '../@types/Align';
7
+ import { UseScrollEndReachedParams } from '../hooks/useScrollEndReached/types';
7
8
  type DescriptionKey = string | ((dataSelected: DataCombo) => string);
8
9
  export interface IAdvancedFilterProps extends Omit<IDrawerProps, 'content'> {
9
10
  onStateChange?: (value?: boolean) => void;
@@ -94,7 +95,7 @@ export interface IMaskHOCProps {
94
95
  isDateField?: boolean;
95
96
  autoCompleteMask?: 'left' | 'right';
96
97
  }
97
- export interface IDropdownSelectProps {
98
+ export interface IDropdownSelectProps extends UseScrollEndReachedParams {
98
99
  idKey: string;
99
100
  descriptionKey: DescriptionKey;
100
101
  dropdownWidth: number;
@@ -0,0 +1,23 @@
1
+ import { Moment } from 'moment';
2
+ import { ReactNode, RefObject } from 'react';
3
+ interface CalendarDayState {
4
+ isSelected: boolean;
5
+ isInRange?: boolean;
6
+ isDisabled?: boolean;
7
+ }
8
+ interface CalendarBoxProps {
9
+ testIdPrefix: string;
10
+ headerId: string;
11
+ calendarBoxOpen: boolean;
12
+ activeDescendant: string;
13
+ calendarDisplayDate: Moment;
14
+ containerRef: RefObject<HTMLDivElement | null>;
15
+ onNextMonth: () => void;
16
+ onPreviousMonth: () => void;
17
+ getDayState: (day: Moment) => CalendarDayState;
18
+ onSelectDay: (day: Moment) => void;
19
+ children?: ReactNode;
20
+ }
21
+ declare const CalendarBox: import('react').ForwardRefExoticComponent<CalendarBoxProps & import('react').RefAttributes<HTMLDivElement>>;
22
+ export { CalendarBox };
23
+ export type { CalendarBoxProps, CalendarDayState };
@@ -0,0 +1,254 @@
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, useRef } from "react";
6
+ import Button from "../../buttons/Button.js";
7
+ import '../../assets/styles/button.css';/* empty css */
8
+ import { mergeRefs } from "../../form2/helpers.js";
9
+ import TextContent from "../../textContent/index.js";
10
+ import { generateCalendarWeeks, TOKEN_ISO_FORMAT } from "./helpers.js";
11
+ import { useCalendarPosition } from "./hooks/useCalendarPosition.js";
12
+ const CalendarBox = forwardRef((props, ref) => {
13
+ const $ = compilerRuntimeExports.c(69);
14
+ const {
15
+ testIdPrefix,
16
+ headerId,
17
+ calendarBoxOpen,
18
+ activeDescendant,
19
+ calendarDisplayDate,
20
+ containerRef,
21
+ onNextMonth,
22
+ onPreviousMonth,
23
+ getDayState,
24
+ onSelectDay,
25
+ children
26
+ } = props;
27
+ const calendarBoxRef = useRef(null);
28
+ const {
29
+ calendarBoxStyles
30
+ } = useCalendarPosition(calendarBoxOpen, containerRef, calendarBoxRef);
31
+ let t0;
32
+ let t1;
33
+ let t10;
34
+ let t11;
35
+ let t2;
36
+ let t3;
37
+ let t4;
38
+ let t5;
39
+ let t6;
40
+ let t7;
41
+ let t8;
42
+ let t9;
43
+ if ($[0] !== activeDescendant || $[1] !== calendarBoxOpen || $[2] !== calendarBoxStyles || $[3] !== calendarDisplayDate || $[4] !== getDayState || $[5] !== headerId || $[6] !== onNextMonth || $[7] !== onPreviousMonth || $[8] !== onSelectDay || $[9] !== ref || $[10] !== testIdPrefix) {
44
+ const weeks = generateCalendarWeeks(calendarDisplayDate);
45
+ const handleOnMouseDown = _temp;
46
+ if ($[23] !== ref) {
47
+ t5 = mergeRefs(ref, calendarBoxRef);
48
+ $[23] = ref;
49
+ $[24] = t5;
50
+ } else {
51
+ t5 = $[24];
52
+ }
53
+ t6 = calendarBoxStyles;
54
+ t7 = calendarBoxOpen;
55
+ t8 = "date-calendar-box";
56
+ t9 = `${testIdPrefix}-calendar-box`;
57
+ let t122;
58
+ if ($[25] !== onPreviousMonth) {
59
+ t122 = /* @__PURE__ */ jsx(Button, { boxShadow: false, type: "button", iconName: "arrow_left", title: "Mês anterior", className: "previous-month", "aria-label": "Mês anterior", onClick: onPreviousMonth, onMouseDown: handleOnMouseDown });
60
+ $[25] = onPreviousMonth;
61
+ $[26] = t122;
62
+ } else {
63
+ t122 = $[26];
64
+ }
65
+ let t132;
66
+ if ($[27] !== calendarDisplayDate) {
67
+ t132 = calendarDisplayDate.format("MMMM YYYY");
68
+ $[27] = calendarDisplayDate;
69
+ $[28] = t132;
70
+ } else {
71
+ t132 = $[28];
72
+ }
73
+ const t142 = `${testIdPrefix}-calendar-box-month-description`;
74
+ let t152;
75
+ if ($[29] !== calendarDisplayDate) {
76
+ t152 = calendarDisplayDate.format("MMMM YYYY");
77
+ $[29] = calendarDisplayDate;
78
+ $[30] = t152;
79
+ } else {
80
+ t152 = $[30];
81
+ }
82
+ let t16;
83
+ if ($[31] !== t132 || $[32] !== t142 || $[33] !== t152) {
84
+ t16 = /* @__PURE__ */ jsx("div", { "aria-live": "polite", className: "month-year", children: /* @__PURE__ */ jsx(TextContent, { "aria-label": t132, as: "p", "data-testid": t142, children: t152 }) });
85
+ $[31] = t132;
86
+ $[32] = t142;
87
+ $[33] = t152;
88
+ $[34] = t16;
89
+ } else {
90
+ t16 = $[34];
91
+ }
92
+ let t17;
93
+ if ($[35] !== onNextMonth) {
94
+ t17 = /* @__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: onNextMonth, onMouseDown: handleOnMouseDown });
95
+ $[35] = onNextMonth;
96
+ $[36] = t17;
97
+ } else {
98
+ t17 = $[36];
99
+ }
100
+ if ($[37] !== headerId || $[38] !== t122 || $[39] !== t16 || $[40] !== t17) {
101
+ t10 = /* @__PURE__ */ jsxs("div", { id: headerId, className: "date-calendar-box-header", children: [
102
+ t122,
103
+ t16,
104
+ t17
105
+ ] });
106
+ $[37] = headerId;
107
+ $[38] = t122;
108
+ $[39] = t16;
109
+ $[40] = t17;
110
+ $[41] = t10;
111
+ } else {
112
+ t10 = $[41];
113
+ }
114
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
115
+ t11 = /* @__PURE__ */ jsx("div", { "aria-label": "Dias da Semana", role: "grid", className: "date-calendar-box-days-of-week", children: hooks.weekdaysShort(true).map(_temp2) });
116
+ $[42] = t11;
117
+ } else {
118
+ t11 = $[42];
119
+ }
120
+ t4 = "date-calendar-box-grid-of-days";
121
+ t2 = "Calendário";
122
+ t3 = "grid";
123
+ t0 = "weeks";
124
+ let t18;
125
+ if ($[43] !== activeDescendant || $[44] !== calendarDisplayDate || $[45] !== getDayState || $[46] !== onSelectDay || $[47] !== testIdPrefix) {
126
+ t18 = (week, weekIndex) => /* @__PURE__ */ jsx("tr", { role: "row", children: week.map((day_0, dateIndex) => {
127
+ const idActiveDescendant = day_0.format(TOKEN_ISO_FORMAT);
128
+ const {
129
+ isSelected,
130
+ isInRange,
131
+ isDisabled
132
+ } = getDayState(day_0);
133
+ const isToday = _.isEqual(hooks().format(TOKEN_ISO_FORMAT), idActiveDescendant);
134
+ const hasFocus = _.isEqual(activeDescendant, idActiveDescendant);
135
+ const isCurrentMonth = day_0.month() === calendarDisplayDate.month();
136
+ const descriptionDate = day_0.format("LL");
137
+ const rangeAttribute = _.isUndefined(isInRange) ? {} : {
138
+ "data-state-is-in-range": isInRange
139
+ };
140
+ const boundsAttribute = _.isUndefined(isDisabled) ? {} : {
141
+ "data-state-out-of-bounds": isDisabled,
142
+ "aria-disabled": isDisabled
143
+ };
144
+ return /* @__PURE__ */ jsx("td", { role: "gridcell", children: /* @__PURE__ */ jsx(Button, { ...rangeAttribute, ...boundsAttribute, id: idActiveDescendant, type: "button", className: "day-button", boxShadow: false, tabIndex: -1, title: descriptionDate, disabled: isDisabled, "aria-label": descriptionDate, "aria-selected": isSelected, "data-testid": `${testIdPrefix}-day-button`, "data-state-is-today": isToday, "data-state-has-focus": hasFocus, "data-state-is-current-month": isCurrentMonth, label: day_0.date().toString(), onMouseDown: handleOnMouseDown, onClick: () => onSelectDay(day_0) }) }, dateIndex);
145
+ }) }, weekIndex + 1);
146
+ $[43] = activeDescendant;
147
+ $[44] = calendarDisplayDate;
148
+ $[45] = getDayState;
149
+ $[46] = onSelectDay;
150
+ $[47] = testIdPrefix;
151
+ $[48] = t18;
152
+ } else {
153
+ t18 = $[48];
154
+ }
155
+ t1 = weeks.map(t18);
156
+ $[0] = activeDescendant;
157
+ $[1] = calendarBoxOpen;
158
+ $[2] = calendarBoxStyles;
159
+ $[3] = calendarDisplayDate;
160
+ $[4] = getDayState;
161
+ $[5] = headerId;
162
+ $[6] = onNextMonth;
163
+ $[7] = onPreviousMonth;
164
+ $[8] = onSelectDay;
165
+ $[9] = ref;
166
+ $[10] = testIdPrefix;
167
+ $[11] = t0;
168
+ $[12] = t1;
169
+ $[13] = t10;
170
+ $[14] = t11;
171
+ $[15] = t2;
172
+ $[16] = t3;
173
+ $[17] = t4;
174
+ $[18] = t5;
175
+ $[19] = t6;
176
+ $[20] = t7;
177
+ $[21] = t8;
178
+ $[22] = t9;
179
+ } else {
180
+ t0 = $[11];
181
+ t1 = $[12];
182
+ t10 = $[13];
183
+ t11 = $[14];
184
+ t2 = $[15];
185
+ t3 = $[16];
186
+ t4 = $[17];
187
+ t5 = $[18];
188
+ t6 = $[19];
189
+ t7 = $[20];
190
+ t8 = $[21];
191
+ t9 = $[22];
192
+ }
193
+ let t12;
194
+ if ($[49] !== t0 || $[50] !== t1) {
195
+ t12 = /* @__PURE__ */ jsx("tbody", { className: t0, children: t1 });
196
+ $[49] = t0;
197
+ $[50] = t1;
198
+ $[51] = t12;
199
+ } else {
200
+ t12 = $[51];
201
+ }
202
+ let t13;
203
+ if ($[52] !== t12 || $[53] !== t2 || $[54] !== t3) {
204
+ t13 = /* @__PURE__ */ jsx("table", { "aria-label": t2, role: t3, children: t12 });
205
+ $[52] = t12;
206
+ $[53] = t2;
207
+ $[54] = t3;
208
+ $[55] = t13;
209
+ } else {
210
+ t13 = $[55];
211
+ }
212
+ let t14;
213
+ if ($[56] !== t13 || $[57] !== t4) {
214
+ t14 = /* @__PURE__ */ jsx("div", { className: t4, children: t13 });
215
+ $[56] = t13;
216
+ $[57] = t4;
217
+ $[58] = t14;
218
+ } else {
219
+ t14 = $[58];
220
+ }
221
+ let t15;
222
+ if ($[59] !== children || $[60] !== t10 || $[61] !== t11 || $[62] !== t14 || $[63] !== t5 || $[64] !== t6 || $[65] !== t7 || $[66] !== t8 || $[67] !== t9) {
223
+ t15 = /* @__PURE__ */ jsxs("div", { ref: t5, style: t6, "aria-expanded": t7, className: t8, "data-testid": t9, children: [
224
+ t10,
225
+ t11,
226
+ t14,
227
+ children
228
+ ] });
229
+ $[59] = children;
230
+ $[60] = t10;
231
+ $[61] = t11;
232
+ $[62] = t14;
233
+ $[63] = t5;
234
+ $[64] = t6;
235
+ $[65] = t7;
236
+ $[66] = t8;
237
+ $[67] = t9;
238
+ $[68] = t15;
239
+ } else {
240
+ t15 = $[68];
241
+ }
242
+ return t15;
243
+ });
244
+ CalendarBox.displayName = "DateCalendarBox";
245
+ function _temp(event) {
246
+ event?.preventDefault?.();
247
+ }
248
+ function _temp2(day, idx) {
249
+ return /* @__PURE__ */ jsx("span", { title: day, role: "columnheader", children: day }, `day-of-week-${idx + 1}`);
250
+ }
251
+ export {
252
+ CalendarBox
253
+ };
254
+ //# sourceMappingURL=calendarbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendarbox.js","sources":["../../../src/lib/inputs2/date/calendarbox.tsx"],"sourcesContent":["import _ from 'lodash';\nimport moment, { type Moment } from 'moment';\nimport { forwardRef, MouseEvent, useRef, type ReactNode, type RefObject } from 'react';\nimport Button from '../../buttons';\nimport { mergeRefs } from '../../form2/helpers';\nimport TextContent from '../../textContent';\nimport { generateCalendarWeeks, TOKEN_ISO_FORMAT } from './helpers';\nimport { useCalendarPosition } from './hooks/useCalendarPosition';\n\ninterface CalendarDayState {\n isSelected: boolean;\n isInRange?: boolean;\n isDisabled?: boolean;\n}\n\ninterface CalendarBoxProps {\n testIdPrefix: string;\n headerId: string;\n calendarBoxOpen: boolean;\n activeDescendant: string;\n calendarDisplayDate: Moment;\n containerRef: RefObject<HTMLDivElement | null>;\n onNextMonth: () => void;\n onPreviousMonth: () => void;\n getDayState: (day: Moment) => CalendarDayState;\n onSelectDay: (day: Moment) => void;\n children?: ReactNode;\n}\n\nconst CalendarBox = forwardRef<HTMLDivElement, CalendarBoxProps>((props, ref) => {\n const {\n testIdPrefix, headerId, calendarBoxOpen, activeDescendant, calendarDisplayDate,\n containerRef, onNextMonth, onPreviousMonth, getDayState, onSelectDay, children,\n } = props;\n const calendarBoxRef = useRef<HTMLDivElement | null>(null);\n const { calendarBoxStyles } = useCalendarPosition(calendarBoxOpen, containerRef, calendarBoxRef);\n\n const weeks = generateCalendarWeeks(calendarDisplayDate);\n\n const handleOnMouseDown = (event: MouseEvent<HTMLButtonElement>) => {\n event?.preventDefault?.();\n };\n\n return (\n <div\n ref={mergeRefs(ref, calendarBoxRef)}\n style={calendarBoxStyles}\n aria-expanded={calendarBoxOpen}\n className=\"date-calendar-box\"\n data-testid={`${testIdPrefix}-calendar-box`}>\n <div id={headerId} 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={onPreviousMonth}\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={`${testIdPrefix}-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={onNextMonth}\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((day, dateIndex) => {\n const idActiveDescendant = day.format(TOKEN_ISO_FORMAT);\n const { isSelected, isInRange, isDisabled } = getDayState(day);\n const isToday = _.isEqual(moment().format(TOKEN_ISO_FORMAT), idActiveDescendant);\n const hasFocus = _.isEqual(activeDescendant, idActiveDescendant);\n const isCurrentMonth = day.month() === calendarDisplayDate.month();\n const descriptionDate = day.format('LL');\n const rangeAttribute = _.isUndefined(isInRange)\n ? {}\n : { 'data-state-is-in-range': isInRange };\n const boundsAttribute = _.isUndefined(isDisabled)\n ? {}\n : { 'data-state-out-of-bounds': isDisabled, 'aria-disabled': isDisabled };\n return (\n <td role=\"gridcell\" key={dateIndex}>\n <Button\n {...rangeAttribute}\n {...boundsAttribute}\n id={idActiveDescendant}\n type=\"button\"\n className=\"day-button\"\n boxShadow={false}\n tabIndex={-1}\n title={descriptionDate}\n disabled={isDisabled}\n aria-label={descriptionDate}\n aria-selected={isSelected}\n data-testid={`${testIdPrefix}-day-button`}\n data-state-is-today={isToday}\n data-state-has-focus={hasFocus}\n data-state-is-current-month={isCurrentMonth}\n label={day.date().toString()}\n onMouseDown={handleOnMouseDown}\n onClick={() => onSelectDay(day)} />\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n {children}\n </div>\n );\n});\n\nCalendarBox.displayName = 'DateCalendarBox';\n\nexport { CalendarBox };\nexport type { CalendarBoxProps, CalendarDayState };\n"],"names":["CalendarBox","forwardRef","props","ref","$","_c","testIdPrefix","headerId","calendarBoxOpen","activeDescendant","calendarDisplayDate","containerRef","onNextMonth","onPreviousMonth","getDayState","onSelectDay","children","calendarBoxRef","useRef","calendarBoxStyles","useCalendarPosition","t0","t1","t10","t11","t2","t3","t4","t5","t6","t7","t8","t9","weeks","generateCalendarWeeks","handleOnMouseDown","_temp","mergeRefs","t12","t13","format","t14","t15","t16","t17","Symbol","for","moment","weekdaysShort","map","_temp2","t18","week","weekIndex","day_0","dateIndex","idActiveDescendant","day","TOKEN_ISO_FORMAT","isSelected","isInRange","isDisabled","isToday","_","isEqual","hasFocus","isCurrentMonth","month","descriptionDate","rangeAttribute","isUndefined","boundsAttribute","date","toString","displayName","event","preventDefault","idx"],"mappings":";;;;;;;;;;;AA6BA,MAAMA,cAAcC,WAA6C,CAAAC,OAAAC,QAAA;AAAA,QAAAC,IAAAC,uBAAAA,EAAA,EAAA;AAC/D,QAAA;AAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAGId;AACJ,QAAAe,iBAAuBC,OAA8B,IAA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