primereact 11.0.0-alpha.7 → 11.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/index.mjs +1 -1
- package/checkbox/index.mjs.map +1 -1
- package/colorpicker/ColorPicker.context.d.ts +5 -0
- package/colorpicker/ColorPicker.d.ts +14 -0
- package/colorpicker/ColorPicker.props.d.ts +2 -0
- package/colorpicker/ColorPicker.test.d.ts +0 -0
- package/colorpicker/area/ColorPickerArea.d.ts +2 -0
- package/colorpicker/area/ColorPickerArea.props.d.ts +2 -0
- package/colorpicker/area/index.d.ts +2 -0
- package/colorpicker/area/index.mjs +2 -0
- package/colorpicker/area/index.mjs.map +1 -0
- package/colorpicker/areabackground/ColorPickerAreaBackground.d.ts +2 -0
- package/colorpicker/areabackground/ColorPickerAreaBackground.props.d.ts +2 -0
- package/colorpicker/areabackground/index.d.ts +2 -0
- package/colorpicker/areabackground/index.mjs +2 -0
- package/colorpicker/areabackground/index.mjs.map +1 -0
- package/colorpicker/areathumb/ColorPickerAreaThumb.d.ts +2 -0
- package/colorpicker/areathumb/ColorPickerAreaThumb.props.d.ts +2 -0
- package/colorpicker/areathumb/index.d.ts +2 -0
- package/colorpicker/areathumb/index.mjs +2 -0
- package/colorpicker/areathumb/index.mjs.map +1 -0
- package/colorpicker/eyedropper/ColorPickerEyeDropper.d.ts +2 -0
- package/colorpicker/eyedropper/ColorPickerEyeDropper.props.d.ts +2 -0
- package/colorpicker/eyedropper/index.d.ts +2 -0
- package/colorpicker/eyedropper/index.mjs +2 -0
- package/colorpicker/eyedropper/index.mjs.map +1 -0
- package/colorpicker/index.d.ts +3 -0
- package/colorpicker/index.mjs +2 -0
- package/colorpicker/index.mjs.map +1 -0
- package/colorpicker/input/ColorPickerInput.context.d.ts +5 -0
- package/colorpicker/input/ColorPickerInput.d.ts +2 -0
- package/colorpicker/input/ColorPickerInput.props.d.ts +2 -0
- package/colorpicker/input/index.d.ts +3 -0
- package/colorpicker/input/index.mjs +2 -0
- package/colorpicker/input/index.mjs.map +1 -0
- package/colorpicker/slider/ColorPickerSlider.context.d.ts +5 -0
- package/colorpicker/slider/ColorPickerSlider.d.ts +2 -0
- package/colorpicker/slider/ColorPickerSlider.props.d.ts +2 -0
- package/colorpicker/slider/index.d.ts +3 -0
- package/colorpicker/slider/index.mjs +2 -0
- package/colorpicker/slider/index.mjs.map +1 -0
- package/colorpicker/sliderthumb/ColorPickerSliderThumb.d.ts +2 -0
- package/colorpicker/sliderthumb/ColorPickerSliderThumb.props.d.ts +2 -0
- package/colorpicker/sliderthumb/index.d.ts +2 -0
- package/colorpicker/sliderthumb/index.mjs +2 -0
- package/colorpicker/sliderthumb/index.mjs.map +1 -0
- package/colorpicker/slidertrack/ColorPickerSliderTrack.d.ts +2 -0
- package/colorpicker/slidertrack/ColorPickerSliderTrack.props.d.ts +2 -0
- package/colorpicker/slidertrack/index.d.ts +2 -0
- package/colorpicker/slidertrack/index.mjs +2 -0
- package/colorpicker/slidertrack/index.mjs.map +1 -0
- package/colorpicker/swatch/ColorPickerSwatch.d.ts +2 -0
- package/colorpicker/swatch/ColorPickerSwatch.props.d.ts +2 -0
- package/colorpicker/swatch/index.d.ts +2 -0
- package/colorpicker/swatch/index.mjs +2 -0
- package/colorpicker/swatch/index.mjs.map +1 -0
- package/colorpicker/swatchbackground/ColorPickerSwatchBackground.d.ts +2 -0
- package/colorpicker/swatchbackground/ColorPickerSwatchBackground.props.d.ts +2 -0
- package/colorpicker/swatchbackground/index.d.ts +2 -0
- package/colorpicker/swatchbackground/index.mjs +2 -0
- package/colorpicker/swatchbackground/index.mjs.map +1 -0
- package/colorpicker/transparencygrid/ColorPickerTransparencyGrid.d.ts +2 -0
- package/colorpicker/transparencygrid/ColorPickerTransparencyGrid.props.d.ts +2 -0
- package/colorpicker/transparencygrid/index.d.ts +2 -0
- package/colorpicker/transparencygrid/index.mjs +2 -0
- package/colorpicker/transparencygrid/index.mjs.map +1 -0
- package/confirmdialog/action/index.mjs +1 -1
- package/confirmdialog/action/index.mjs.map +1 -1
- package/confirmdialog/cancel/index.mjs +1 -1
- package/confirmdialog/cancel/index.mjs.map +1 -1
- package/confirmdialog/close/index.mjs +1 -1
- package/confirmdialog/close/index.mjs.map +1 -1
- package/confirmdialog/content/index.mjs +1 -1
- package/confirmdialog/content/index.mjs.map +1 -1
- package/confirmdialog/footer/index.mjs +1 -1
- package/confirmdialog/footer/index.mjs.map +1 -1
- package/confirmdialog/header/index.mjs +1 -1
- package/confirmdialog/header/index.mjs.map +1 -1
- package/confirmdialog/headeractions/index.mjs +1 -1
- package/confirmdialog/headeractions/index.mjs.map +1 -1
- package/confirmdialog/index.mjs +1 -1
- package/confirmdialog/index.mjs.map +1 -1
- package/confirmdialog/portal/index.mjs +1 -1
- package/confirmdialog/portal/index.mjs.map +1 -1
- package/confirmdialog/title/index.mjs +1 -1
- package/confirmdialog/title/index.mjs.map +1 -1
- package/confirmdialog/trigger/index.mjs +1 -1
- package/confirmdialog/trigger/index.mjs.map +1 -1
- package/confirmpopup/index.mjs +1 -1
- package/confirmpopup/index.mjs.map +1 -1
- package/confirmpopup/portal/index.mjs +1 -1
- package/confirmpopup/portal/index.mjs.map +1 -1
- package/datepicker/DatePicker.context.d.ts +5 -0
- package/datepicker/DatePicker.d.ts +42 -0
- package/datepicker/DatePicker.props.d.ts +2 -0
- package/datepicker/DatePicker.test.d.ts +0 -0
- package/datepicker/ampm/DatePickerAmPm.d.ts +2 -0
- package/datepicker/ampm/DatePickerAmPm.props.d.ts +2 -0
- package/datepicker/ampm/index.d.ts +2 -0
- package/datepicker/ampm/index.mjs +2 -0
- package/datepicker/ampm/index.mjs.map +1 -0
- package/datepicker/buttonbar/DatePickerButtonbar.d.ts +2 -0
- package/datepicker/buttonbar/DatePickerButtonbar.props.d.ts +2 -0
- package/datepicker/buttonbar/index.d.ts +2 -0
- package/datepicker/buttonbar/index.mjs +2 -0
- package/datepicker/buttonbar/index.mjs.map +1 -0
- package/datepicker/calendar/DatePickerCalendar.d.ts +2 -0
- package/datepicker/calendar/DatePickerCalendar.props.d.ts +2 -0
- package/datepicker/calendar/index.d.ts +2 -0
- package/datepicker/calendar/index.mjs +2 -0
- package/datepicker/calendar/index.mjs.map +1 -0
- package/datepicker/clear/DatePickerClear.d.ts +2 -0
- package/datepicker/clear/DatePickerClear.props.d.ts +2 -0
- package/datepicker/clear/index.d.ts +2 -0
- package/datepicker/clear/index.mjs +2 -0
- package/datepicker/clear/index.mjs.map +1 -0
- package/datepicker/clearicon/DatePickerClearIcon.d.ts +2 -0
- package/datepicker/clearicon/DatePickerClearIcon.props.d.ts +2 -0
- package/datepicker/clearicon/index.d.ts +2 -0
- package/datepicker/clearicon/index.mjs +2 -0
- package/datepicker/clearicon/index.mjs.map +1 -0
- package/datepicker/container/DatePickerContainer.d.ts +2 -0
- package/datepicker/container/DatePickerContainer.props.d.ts +2 -0
- package/datepicker/container/index.d.ts +2 -0
- package/datepicker/container/index.mjs +2 -0
- package/datepicker/container/index.mjs.map +1 -0
- package/datepicker/decade/DatePickerDecade.d.ts +2 -0
- package/datepicker/decade/DatePickerDecade.props.d.ts +2 -0
- package/datepicker/decade/index.d.ts +2 -0
- package/datepicker/decade/index.mjs +2 -0
- package/datepicker/decade/index.mjs.map +1 -0
- package/datepicker/decrement/DatePickerDecrement.d.ts +2 -0
- package/datepicker/decrement/DatePickerDecrement.props.d.ts +2 -0
- package/datepicker/decrement/index.d.ts +2 -0
- package/datepicker/decrement/index.mjs +2 -0
- package/datepicker/decrement/index.mjs.map +1 -0
- package/datepicker/dropdown/DatePickerDropdown.d.ts +2 -0
- package/datepicker/dropdown/DatePickerDropdown.props.d.ts +2 -0
- package/datepicker/dropdown/index.d.ts +2 -0
- package/datepicker/dropdown/index.mjs +2 -0
- package/datepicker/dropdown/index.mjs.map +1 -0
- package/datepicker/dropdownicon/DatePickerDropdownIcon.d.ts +2 -0
- package/datepicker/dropdownicon/DatePickerDropdownIcon.props.d.ts +2 -0
- package/datepicker/dropdownicon/index.d.ts +2 -0
- package/datepicker/dropdownicon/index.mjs +2 -0
- package/datepicker/dropdownicon/index.mjs.map +1 -0
- package/datepicker/footer/DatePickerFooter.d.ts +2 -0
- package/datepicker/footer/DatePickerFooter.props.d.ts +2 -0
- package/datepicker/footer/index.d.ts +2 -0
- package/datepicker/footer/index.mjs +2 -0
- package/datepicker/footer/index.mjs.map +1 -0
- package/datepicker/header/DatePickerHeader.d.ts +2 -0
- package/datepicker/header/DatePickerHeader.props.d.ts +2 -0
- package/datepicker/header/index.d.ts +2 -0
- package/datepicker/header/index.mjs +2 -0
- package/datepicker/header/index.mjs.map +1 -0
- package/datepicker/hour/DatePickerHour.d.ts +2 -0
- package/datepicker/hour/DatePickerHour.props.d.ts +2 -0
- package/datepicker/hour/index.d.ts +2 -0
- package/datepicker/hour/index.mjs +2 -0
- package/datepicker/hour/index.mjs.map +1 -0
- package/datepicker/increment/DatePickerIncrement.d.ts +2 -0
- package/datepicker/increment/DatePickerIncrement.props.d.ts +2 -0
- package/datepicker/increment/index.d.ts +2 -0
- package/datepicker/increment/index.mjs +2 -0
- package/datepicker/increment/index.mjs.map +1 -0
- package/datepicker/index.d.ts +3 -0
- package/datepicker/index.mjs +2 -0
- package/datepicker/index.mjs.map +1 -0
- package/datepicker/input/DatePickerInput.d.ts +2 -0
- package/datepicker/input/DatePickerInput.props.d.ts +2 -0
- package/datepicker/input/index.d.ts +2 -0
- package/datepicker/input/index.mjs +2 -0
- package/datepicker/input/index.mjs.map +1 -0
- package/datepicker/inputiconcontainer/DatePickerInputIconContainer.context.d.ts +5 -0
- package/datepicker/inputiconcontainer/DatePickerInputIconContainer.d.ts +2 -0
- package/datepicker/inputiconcontainer/DatePickerInputIconContainer.props.d.ts +2 -0
- package/datepicker/inputiconcontainer/index.d.ts +2 -0
- package/datepicker/inputiconcontainer/index.mjs +2 -0
- package/datepicker/inputiconcontainer/index.mjs.map +1 -0
- package/datepicker/minute/DatePickerMinute.d.ts +2 -0
- package/datepicker/minute/DatePickerMinute.props.d.ts +2 -0
- package/datepicker/minute/index.d.ts +2 -0
- package/datepicker/minute/index.mjs +2 -0
- package/datepicker/minute/index.mjs.map +1 -0
- package/datepicker/next/DatePickerNext.d.ts +2 -0
- package/datepicker/next/DatePickerNext.props.d.ts +2 -0
- package/datepicker/next/index.d.ts +2 -0
- package/datepicker/next/index.mjs +2 -0
- package/datepicker/next/index.mjs.map +1 -0
- package/datepicker/panel/DatePickerPanel.d.ts +2 -0
- package/datepicker/panel/DatePickerPanel.props.d.ts +2 -0
- package/datepicker/panel/index.d.ts +2 -0
- package/datepicker/panel/index.mjs +2 -0
- package/datepicker/panel/index.mjs.map +1 -0
- package/datepicker/picker/DatePickerPicker.context.d.ts +5 -0
- package/datepicker/picker/DatePickerPicker.d.ts +2 -0
- package/datepicker/picker/DatePickerPicker.props.d.ts +2 -0
- package/datepicker/picker/index.d.ts +2 -0
- package/datepicker/picker/index.mjs +2 -0
- package/datepicker/picker/index.mjs.map +1 -0
- package/datepicker/portal/DatePickerPortal.d.ts +2 -0
- package/datepicker/portal/DatePickerPortal.props.d.ts +2 -0
- package/datepicker/portal/index.d.ts +2 -0
- package/datepicker/portal/index.mjs +2 -0
- package/datepicker/portal/index.mjs.map +1 -0
- package/datepicker/prev/DatePickerPrev.d.ts +2 -0
- package/datepicker/prev/DatePickerPrev.props.d.ts +2 -0
- package/datepicker/prev/index.d.ts +2 -0
- package/datepicker/prev/index.mjs +2 -0
- package/datepicker/prev/index.mjs.map +1 -0
- package/datepicker/second/DatePickerSecond.d.ts +2 -0
- package/datepicker/second/DatePickerSecond.props.d.ts +2 -0
- package/datepicker/second/index.d.ts +2 -0
- package/datepicker/second/index.mjs +2 -0
- package/datepicker/second/index.mjs.map +1 -0
- package/datepicker/selectmonth/DatePickerSelectMonth.d.ts +2 -0
- package/datepicker/selectmonth/DatePickerSelectMonth.props.d.ts +2 -0
- package/datepicker/selectmonth/index.d.ts +2 -0
- package/datepicker/selectmonth/index.mjs +2 -0
- package/datepicker/selectmonth/index.mjs.map +1 -0
- package/datepicker/selectyear/DatePickerSelectYear.d.ts +2 -0
- package/datepicker/selectyear/DatePickerSelectYear.props.d.ts +2 -0
- package/datepicker/selectyear/index.d.ts +2 -0
- package/datepicker/selectyear/index.mjs +2 -0
- package/datepicker/selectyear/index.mjs.map +1 -0
- package/datepicker/separator/DatePickerSeparator.d.ts +2 -0
- package/datepicker/separator/DatePickerSeparator.props.d.ts +2 -0
- package/datepicker/separator/index.d.ts +2 -0
- package/datepicker/separator/index.mjs +2 -0
- package/datepicker/separator/index.mjs.map +1 -0
- package/datepicker/separatorcontainer/DatePickerSeparatorContainer.d.ts +2 -0
- package/datepicker/separatorcontainer/DatePickerSeparatorContainer.props.d.ts +2 -0
- package/datepicker/separatorcontainer/index.d.ts +2 -0
- package/datepicker/separatorcontainer/index.mjs +2 -0
- package/datepicker/separatorcontainer/index.mjs.map +1 -0
- package/datepicker/table/DatePickerTable.d.ts +2 -0
- package/datepicker/table/DatePickerTable.props.d.ts +2 -0
- package/datepicker/table/index.d.ts +2 -0
- package/datepicker/table/index.mjs +2 -0
- package/datepicker/table/index.mjs.map +1 -0
- package/datepicker/tablebody/DatePickerTableBody.context.d.ts +5 -0
- package/datepicker/tablebody/DatePickerTableBody.d.ts +2 -0
- package/datepicker/tablebody/DatePickerTableBody.props.d.ts +2 -0
- package/datepicker/tablebody/index.d.ts +2 -0
- package/datepicker/tablebody/index.mjs +2 -0
- package/datepicker/tablebody/index.mjs.map +1 -0
- package/datepicker/tablebodycell/DatePickerTableBodyCell.d.ts +2 -0
- package/datepicker/tablebodycell/DatePickerTableBodyCell.props.d.ts +2 -0
- package/datepicker/tablebodycell/index.d.ts +2 -0
- package/datepicker/tablebodycell/index.mjs +2 -0
- package/datepicker/tablebodycell/index.mjs.map +1 -0
- package/datepicker/tablebodyrow/DatePickerTableBodyRow.d.ts +2 -0
- package/datepicker/tablebodyrow/DatePickerTableBodyRow.props.d.ts +2 -0
- package/datepicker/tablebodyrow/index.d.ts +2 -0
- package/datepicker/tablebodyrow/index.mjs +2 -0
- package/datepicker/tablebodyrow/index.mjs.map +1 -0
- package/datepicker/tablebodyweekcell/DatePickerTableBodyWeekCell.d.ts +2 -0
- package/datepicker/tablebodyweekcell/DatePickerTableBodyWeekCell.props.d.ts +2 -0
- package/datepicker/tablebodyweekcell/index.d.ts +2 -0
- package/datepicker/tablebodyweekcell/index.mjs +2 -0
- package/datepicker/tablebodyweekcell/index.mjs.map +1 -0
- package/datepicker/tablehead/DatePickerTableHead.d.ts +2 -0
- package/datepicker/tablehead/DatePickerTableHead.props.d.ts +2 -0
- package/datepicker/tablehead/index.d.ts +2 -0
- package/datepicker/tablehead/index.mjs +2 -0
- package/datepicker/tablehead/index.mjs.map +1 -0
- package/datepicker/tableheadcell/DatePickerTableHeadCell.d.ts +2 -0
- package/datepicker/tableheadcell/DatePickerTableHeadCell.props.d.ts +2 -0
- package/datepicker/tableheadcell/index.d.ts +2 -0
- package/datepicker/tableheadcell/index.mjs +2 -0
- package/datepicker/tableheadcell/index.mjs.map +1 -0
- package/datepicker/tableheadrow/DatePickerTableHeadRow.d.ts +2 -0
- package/datepicker/tableheadrow/DatePickerTableHeadRow.props.d.ts +2 -0
- package/datepicker/tableheadrow/index.d.ts +2 -0
- package/datepicker/tableheadrow/index.mjs +2 -0
- package/datepicker/tableheadrow/index.mjs.map +1 -0
- package/datepicker/tableheadweekcell/DatePickerTableHeadWeekCell.d.ts +2 -0
- package/datepicker/tableheadweekcell/DatePickerTableHeadWeekCell.props.d.ts +2 -0
- package/datepicker/tableheadweekcell/index.d.ts +2 -0
- package/datepicker/tableheadweekcell/index.mjs +2 -0
- package/datepicker/tableheadweekcell/index.mjs.map +1 -0
- package/datepicker/time/DatePickerTime.d.ts +2 -0
- package/datepicker/time/DatePickerTime.props.d.ts +2 -0
- package/datepicker/time/index.d.ts +2 -0
- package/datepicker/time/index.mjs +2 -0
- package/datepicker/time/index.mjs.map +1 -0
- package/datepicker/title/DatePickerTitle.d.ts +2 -0
- package/datepicker/title/DatePickerTitle.props.d.ts +2 -0
- package/datepicker/title/index.d.ts +2 -0
- package/datepicker/title/index.mjs +2 -0
- package/datepicker/title/index.mjs.map +1 -0
- package/datepicker/today/DatePickerToday.d.ts +2 -0
- package/datepicker/today/DatePickerToday.props.d.ts +2 -0
- package/datepicker/today/index.d.ts +2 -0
- package/datepicker/today/index.mjs +2 -0
- package/datepicker/today/index.mjs.map +1 -0
- package/dialog/index.mjs +1 -1
- package/dialog/index.mjs.map +1 -1
- package/dialog/portal/index.mjs +1 -1
- package/dialog/portal/index.mjs.map +1 -1
- package/drawer/index.mjs +1 -1
- package/drawer/index.mjs.map +1 -1
- package/drawer/portal/index.mjs +1 -1
- package/drawer/portal/index.mjs.map +1 -1
- package/listbox/Listbox.context.d.ts +5 -0
- package/listbox/Listbox.d.ts +10 -0
- package/listbox/Listbox.props.d.ts +2 -0
- package/listbox/Listbox.test.d.ts +0 -0
- package/listbox/empty/ListboxEmpty.d.ts +2 -0
- package/listbox/empty/ListboxEmpty.props.d.ts +2 -0
- package/listbox/empty/index.d.ts +2 -0
- package/listbox/empty/index.mjs +2 -0
- package/listbox/empty/index.mjs.map +1 -0
- package/listbox/filter/ListboxFilter.d.ts +2 -0
- package/listbox/filter/ListboxFilter.props.d.ts +2 -0
- package/listbox/filter/index.d.ts +2 -0
- package/listbox/filter/index.mjs +2 -0
- package/listbox/filter/index.mjs.map +1 -0
- package/listbox/footer/ListboxFooter.d.ts +2 -0
- package/listbox/footer/ListboxFooter.props.d.ts +2 -0
- package/listbox/footer/index.d.ts +2 -0
- package/listbox/footer/index.mjs +2 -0
- package/listbox/footer/index.mjs.map +1 -0
- package/listbox/header/ListboxHeader.d.ts +2 -0
- package/listbox/header/ListboxHeader.props.d.ts +2 -0
- package/listbox/header/index.d.ts +2 -0
- package/listbox/header/index.mjs +2 -0
- package/listbox/header/index.mjs.map +1 -0
- package/listbox/index.d.ts +3 -0
- package/listbox/index.mjs +2 -0
- package/listbox/index.mjs.map +1 -0
- package/listbox/option/ListboxOption.context.d.ts +5 -0
- package/listbox/option/ListboxOption.d.ts +2 -0
- package/listbox/option/ListboxOption.props.d.ts +2 -0
- package/listbox/option/index.d.ts +3 -0
- package/listbox/option/index.mjs +2 -0
- package/listbox/option/index.mjs.map +1 -0
- package/listbox/options/ListboxOptions.d.ts +2 -0
- package/listbox/options/ListboxOptions.props.d.ts +2 -0
- package/listbox/options/index.d.ts +2 -0
- package/listbox/options/index.mjs +2 -0
- package/listbox/options/index.mjs.map +1 -0
- package/listbox/selection/ListboxSelection.d.ts +2 -0
- package/listbox/selection/ListboxSelection.props.d.ts +2 -0
- package/listbox/selection/index.d.ts +2 -0
- package/listbox/selection/index.mjs +2 -0
- package/listbox/selection/index.mjs.map +1 -0
- package/orgchart/OrgChart.context.d.ts +5 -0
- package/orgchart/OrgChart.d.ts +8 -0
- package/orgchart/OrgChart.props.d.ts +2 -0
- package/orgchart/OrgChart.test.d.ts +0 -0
- package/orgchart/collapsebutton/OrgChartCollapseButton.d.ts +2 -0
- package/orgchart/collapsebutton/OrgChartCollapseButton.props.d.ts +2 -0
- package/orgchart/collapsebutton/index.d.ts +2 -0
- package/orgchart/collapsebutton/index.mjs +2 -0
- package/orgchart/collapsebutton/index.mjs.map +1 -0
- package/orgchart/index.d.ts +3 -0
- package/orgchart/index.mjs +2 -0
- package/orgchart/index.mjs.map +1 -0
- package/orgchart/node/OrgChartNode.d.ts +2 -0
- package/orgchart/node/OrgChartNode.props.d.ts +2 -0
- package/orgchart/node/index.d.ts +2 -0
- package/orgchart/node/index.mjs +2 -0
- package/orgchart/node/index.mjs.map +1 -0
- package/orgchart/nodecontent/OrgChartNodeContent.d.ts +2 -0
- package/orgchart/nodecontent/OrgChartNodeContent.props.d.ts +2 -0
- package/orgchart/nodecontent/index.d.ts +2 -0
- package/orgchart/nodecontent/index.mjs +2 -0
- package/orgchart/nodecontent/index.mjs.map +1 -0
- package/orgchart/subtree/OrgChartSubtree.d.ts +2 -0
- package/orgchart/subtree/OrgChartSubtree.props.d.ts +2 -0
- package/orgchart/subtree/index.d.ts +2 -0
- package/orgchart/subtree/index.mjs +2 -0
- package/orgchart/subtree/index.mjs.map +1 -0
- package/orgchart/tree/OrgChartTree.context.d.ts +5 -0
- package/orgchart/tree/OrgChartTree.d.ts +2 -0
- package/orgchart/tree/OrgChartTree.props.d.ts +2 -0
- package/orgchart/tree/index.d.ts +3 -0
- package/orgchart/tree/index.mjs +2 -0
- package/orgchart/tree/index.mjs.map +1 -0
- package/overlay/Overlay.context.d.ts +5 -0
- package/overlay/Overlay.d.ts +2 -0
- package/overlay/Overlay.props.d.ts +2 -0
- package/overlay/Overlay.test.d.ts +0 -0
- package/overlay/index.d.ts +3 -0
- package/overlay/index.mjs +2 -0
- package/overlay/index.mjs.map +1 -0
- package/package.json +8 -8
- package/password/Password.context.d.ts +5 -0
- package/password/Password.d.ts +8 -0
- package/password/Password.props.d.ts +2 -0
- package/password/Password.test.d.ts +0 -0
- package/password/clearicon/PasswordClearIcon.d.ts +2 -0
- package/password/clearicon/PasswordClearIcon.props.d.ts +2 -0
- package/password/clearicon/index.d.ts +2 -0
- package/password/clearicon/index.mjs +2 -0
- package/password/clearicon/index.mjs.map +1 -0
- package/password/index.d.ts +3 -0
- package/password/index.mjs +2 -0
- package/password/index.mjs.map +1 -0
- package/password/input/PasswordInput.d.ts +2 -0
- package/password/input/PasswordInput.props.d.ts +2 -0
- package/password/input/index.d.ts +2 -0
- package/password/input/index.mjs +2 -0
- package/password/input/index.mjs.map +1 -0
- package/password/meter/PasswordMeter.d.ts +2 -0
- package/password/meter/PasswordMeter.props.d.ts +2 -0
- package/password/meter/index.d.ts +2 -0
- package/password/meter/index.mjs +2 -0
- package/password/meter/index.mjs.map +1 -0
- package/password/portal/PasswordPortal.d.ts +2 -0
- package/password/portal/PasswordPortal.props.d.ts +2 -0
- package/password/portal/index.d.ts +2 -0
- package/password/portal/index.mjs +2 -0
- package/password/portal/index.mjs.map +1 -0
- package/password/strength/PasswordStrength.d.ts +2 -0
- package/password/strength/PasswordStrength.props.d.ts +2 -0
- package/password/strength/index.d.ts +2 -0
- package/password/strength/index.mjs +2 -0
- package/password/strength/index.mjs.map +1 -0
- package/popover/index.mjs +1 -1
- package/popover/index.mjs.map +1 -1
- package/popover/portal/index.mjs +1 -1
- package/popover/portal/index.mjs.map +1 -1
- package/radiobutton/index.mjs +1 -1
- package/radiobutton/index.mjs.map +1 -1
- package/toast/action/index.mjs +1 -1
- package/toast/action/index.mjs.map +1 -1
- package/toast/close/index.mjs +1 -1
- package/toast/close/index.mjs.map +1 -1
- package/toast/description/index.mjs +1 -1
- package/toast/description/index.mjs.map +1 -1
- package/toast/icon/ToastIcon.d.ts +2 -1
- package/toast/icon/index.mjs +1 -1
- package/toast/icon/index.mjs.map +1 -1
- package/toast/index.css +1 -1
- package/toast/index.css.map +1 -1
- package/toast/index.d.ts +0 -1
- package/toast/index.mjs +1 -1
- package/toast/index.mjs.map +1 -1
- package/toast/item/index.mjs +1 -1
- package/toast/item/index.mjs.map +1 -1
- package/toast/region/index.mjs +1 -1
- package/toast/region/index.mjs.map +1 -1
- package/toast/title/index.mjs +1 -1
- package/toast/title/index.mjs.map +1 -1
- package/toast/toastManager.d.ts +0 -37
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/listbox/selection/ListboxSelection.tsx","../../../src/base/index.ts","../../../src/checkbox/Checkbox.tsx","../../../src/checkbox/Checkbox.context.ts","../../../src/checkbox/Checkbox.props.ts","../../../src/checkbox/group/CheckboxGroup.tsx","../../../src/checkbox/group/CheckboxGroup.context.ts","../../../src/checkbox/group/CheckboxGroup.props.ts","../../../src/listbox/Listbox.context.ts","../../../src/listbox/option/ListboxOption.tsx","../../../src/listbox/option/ListboxOption.context.ts","../../../src/listbox/option/ListboxOption.props.ts","../../../src/listbox/selection/ListboxSelection.props.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { BlankIcon } from '@primereact/icons/blank';\nimport { CheckIcon } from '@primereact/icons/check';\nimport type { ListboxOptionInstance } from '@primereact/types/shared/listbox';\nimport { mergeProps, resolve } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Checkbox } from 'primereact/checkbox';\nimport * as React from 'react';\nimport { useListboxContext } from '../Listbox.context';\nimport { useListboxOptionContext } from '../option';\nimport { defaultSelectionProps } from './ListboxSelection.props';\n\nexport const ListboxSelection = withComponent({\n name: 'ListboxSelection',\n defaultProps: defaultSelectionProps,\n setup() {\n const listbox = useListboxContext();\n const option = useListboxOptionContext() || ({} as ListboxOptionInstance);\n\n return { ...option, listbox };\n },\n render(instance) {\n const { props, ptmi, listbox, selected } = instance;\n const { checkmark, checkbox } = listbox?.props || {};\n\n const rootProps = mergeProps(\n {\n className: listbox?.cx('selection')\n },\n listbox?.ptm('selection'),\n ptmi('root')\n );\n\n const createContent = () => {\n if (checkmark) {\n return selected ? <CheckIcon {...rootProps} /> : <BlankIcon {...rootProps} />;\n } else if (checkbox) {\n return <Checkbox defaultChecked={selected} tabIndex={-1} readOnly pt-root={rootProps} />;\n }\n\n return null;\n };\n\n const content = resolve(props.children, instance) ?? createContent();\n\n return (\n <Component instance={instance} attrs={rootProps}>\n {content}\n </Component>\n );\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useCheckbox } from '@primereact/headless/checkbox';\nimport { CheckIcon } from '@primereact/icons/check';\nimport { MinusIcon } from '@primereact/icons/minus';\nimport { styles } from '@primereact/styles/checkbox';\nimport type { CheckboxChangeEvent } from '@primereact/types/shared/checkbox';\nimport { cn, mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { CheckboxProvider } from './Checkbox.context';\nimport { defaultProps } from './Checkbox.props';\nimport { CheckboxGroup, useCheckboxGroupContext } from './group';\n\nexport const Checkbox = withComponent({\n name: 'Checkbox',\n defaultProps,\n styles,\n setup(instance) {\n const { props, inProps } = instance;\n const group = useCheckboxGroupContext();\n\n const useCheckboxProps = group\n ? {\n ...inProps,\n checked: group.props.value?.includes(props.value),\n defaultChecked: group.props.defaultValue?.includes(props.value),\n onCheckedChange: group.updateChange ? (event: CheckboxChangeEvent) => group.updateChange!({ ...event, value: props.value }) : undefined\n }\n : {\n ...inProps,\n onCheckedChange: props.onCheckedChange ? (event: CheckboxChangeEvent) => props.onCheckedChange!({ ...event, value: props.value }) : undefined\n };\n\n const checkbox = useCheckbox(useCheckboxProps);\n\n return {\n ...checkbox,\n group\n };\n },\n render(instance) {\n const {\n id,\n props,\n state,\n ptmi,\n ptm,\n cx,\n group,\n // methods\n onChange\n } = instance;\n\n const createInputElement = () => {\n const inputProps = mergeProps(\n {\n id: props.inputId,\n type: 'checkbox',\n style: props.inputStyle,\n className: cn(cx('input'), props.inputClassName),\n value: props.value,\n name: props.name ?? group?.props.name,\n checked: state.checked,\n tabIndex: props.tabIndex,\n disabled: props.disabled || group?.props.disabled,\n readOnly: props.readOnly,\n required: props.required,\n 'aria-labelledby': props.ariaLabelledby,\n 'aria-label': props.ariaLabel,\n 'aria-invalid': props.invalid || group?.props.invalid || undefined,\n 'aria-checked': state.indeterminate ? 'mixed' : undefined,\n onFocus: props.onFocus,\n onBlur: props.onBlur,\n onChange: !props.readOnly ? onChange : undefined\n },\n ptm('input')\n );\n\n return <input {...inputProps} />;\n };\n\n const createBoxElement = () => {\n const boxProps = mergeProps(\n {\n className: cx('box')\n },\n ptm('box')\n );\n\n const iconProps = mergeProps(\n {\n className: cx('icon')\n },\n ptm('icon')\n );\n\n const icon = state.checked ? <CheckIcon {...iconProps} /> : state.indeterminate ? <MinusIcon {...iconProps} /> : null;\n\n return <div {...boxProps}>{icon}</div>;\n };\n\n const input = createInputElement();\n const box = createBoxElement();\n\n const rootProps = mergeProps(\n {\n id,\n className: cx('root')\n },\n ptmi('root')\n );\n\n return (\n <CheckboxProvider value={instance}>\n <Component instance={instance} attrs={rootProps}>\n {input}\n {box}\n </Component>\n </CheckboxProvider>\n );\n },\n components: {\n Group: CheckboxGroup\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { CheckboxInstance } from '@primereact/types/shared/checkbox';\n\nexport const [CheckboxProvider, useCheckboxContext] = createOptionalContext<CheckboxInstance>();\n","import * as HeadlessCheckbox from '@primereact/headless/checkbox';\nimport type { CheckboxProps } from '@primereact/types/shared/checkbox';\n\nexport const defaultProps: CheckboxProps = {\n ...HeadlessCheckbox.defaultProps,\n as: 'div',\n value: undefined,\n name: undefined,\n size: undefined,\n variant: undefined,\n tabIndex: undefined,\n disabled: false,\n readOnly: false,\n required: false,\n invalid: false,\n inputId: undefined,\n inputStyle: undefined,\n inputClassName: undefined,\n ariaLabel: undefined,\n ariaLabelledby: undefined,\n onFocus: undefined,\n onBlur: undefined\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { useControlledState } from '@primereact/hooks/use-controlled-state';\nimport { groupStyles } from '@primereact/styles/checkbox';\nimport type { CheckboxGroupUpdateChangeEvent } from '@primereact/types/shared/checkbox';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { CheckboxGroupProvider } from './CheckboxGroup.context';\nimport { defaultGroupProps } from './CheckboxGroup.props';\n\nexport const CheckboxGroup = withComponent({\n name: 'CheckboxGroup',\n defaultProps: defaultGroupProps,\n styles: groupStyles,\n setup(instance) {\n const { value, defaultValue, onValueChange: onChange } = instance.props;\n const [valueState, setValueState] = useControlledState({\n value,\n defaultValue,\n onChange\n });\n\n const state = {\n value: valueState\n };\n\n const updateChange = React.useCallback(\n (event: CheckboxGroupUpdateChangeEvent) => {\n const newValue = event.checked ? [...(valueState || []), event.value] : (valueState || []).filter((v) => v !== event.value);\n\n setValueState?.([newValue, { originalEvent: event.originalEvent, value: newValue }]);\n },\n [valueState, setValueState]\n );\n\n return {\n state,\n updateChange\n };\n },\n render(instance) {\n const { props, ptmi, cx } = instance;\n\n const rootProps = mergeProps(\n {\n className: cx('root')\n },\n ptmi('root')\n );\n\n return (\n <CheckboxGroupProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </CheckboxGroupProvider>\n );\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { CheckboxGroupInstance } from '@primereact/types/shared/checkbox';\n\nexport const [CheckboxGroupProvider, useCheckboxGroupContext] = createOptionalContext<CheckboxGroupInstance>();\n","import type { CheckboxGroupProps } from '@primereact/types/shared/checkbox';\n\nexport const defaultGroupProps: CheckboxGroupProps = {\n as: 'div',\n value: undefined,\n defaultValue: undefined,\n name: undefined,\n disabled: undefined,\n invalid: undefined,\n onValueChange: undefined\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { ListboxInstance } from '@primereact/types/shared/listbox';\n\nexport const [ListboxProvider, useListboxContext] = createOptionalContext<ListboxInstance>();\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useListboxContext } from '../Listbox.context';\nimport { ListboxOptionProvider } from './ListboxOption.context';\nimport { defaultOptionProps } from './ListboxOption.props';\n\nexport const ListboxOption = withComponent({\n name: 'ListboxOption',\n defaultProps: defaultOptionProps,\n setup(instance) {\n const listbox = useListboxContext();\n const options = listbox?.getOptions();\n const index =\n instance.props?.index ??\n options?.findIndex((option: unknown) => {\n if (option && typeof option === 'object' && listbox?.props.optionKey) {\n return (option as Record<string, unknown>)[listbox.props.optionKey] === instance.props.uKey;\n }\n\n return false;\n }) ??\n -1;\n const option = options?.[index];\n const selected = listbox?.isSelected(option);\n const group = instance.props?.group ?? listbox?.isOptionGroup(option);\n\n return { listbox, option, index, group, selected };\n },\n render(instance) {\n const { props, ptmi, listbox, option, index, selected, group } = instance;\n\n const computedProps = group\n ? mergeProps(\n {\n className: listbox?.cx('optionGroup', { index })\n },\n listbox?.ptm('optionGroup')\n )\n : mergeProps(\n {\n className: listbox?.cx('option', { index, selected, disabled: listbox.isOptionDisabled(option) }),\n 'aria-selected': selected,\n 'aria-disabled': listbox?.isOptionDisabled(option),\n 'aria-setsize': listbox?.getAriaSetSize(),\n 'aria-posinset': listbox?.getAriaPosInset(index),\n onClick: (event: React.MouseEvent) => listbox?.onOptionSelect(event, option, index),\n onMouseDown: (event: React.MouseEvent) => listbox?.onOptionMouseDown(event, index),\n onMouseMove: (event: React.MouseEvent) => listbox?.onOptionMouseMove(event, index),\n onTouchEnd: listbox?.onOptionTouchEnd\n },\n listbox?.ptm('option')\n );\n\n const rootProps = mergeProps(\n {\n id: listbox?.getOptionId(index),\n role: 'option'\n },\n computedProps,\n ptmi('root')\n );\n\n return (\n <ListboxOptionProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </ListboxOptionProvider>\n );\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { ListboxOptionInstance } from '@primereact/types/shared/listbox';\n\nexport const [ListboxOptionProvider, useListboxOptionContext] = createOptionalContext<ListboxOptionInstance>();\n","import type { ListboxOptionProps } from '@primereact/types/shared/listbox';\n\nexport const defaultOptionProps: ListboxOptionProps = {\n as: 'li',\n group: false,\n uKey: undefined,\n index: undefined\n};\n","import type { ListboxSelectionProps } from '@primereact/types/shared/listbox';\n\nexport const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CAAU,SAAUf,EAAU,MAAOO,GACjCM,CACL,CAER,CACJ,CAAC","names":["Component","BlankIcon","CheckIcon","mergeProps","resolve","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","Component","useCheckbox","CheckIcon","MinusIcon","styles","cn","mergeProps","React","createOptionalContext","CheckboxProvider","useCheckboxContext","HeadlessCheckbox","defaultProps","__spreadProps","__spreadValues","Component","useControlledState","groupStyles","mergeProps","React","createOptionalContext","CheckboxGroupProvider","useCheckboxGroupContext","defaultGroupProps","CheckboxGroup","withComponent","defaultGroupProps","groupStyles","instance","value","defaultValue","onChange","valueState","setValueState","useControlledState","state","updateChange","event","newValue","v","props","ptmi","cx","rootProps","mergeProps","CheckboxGroupProvider","Component","Checkbox","withComponent","defaultProps","styles","instance","_a","_b","props","inProps","group","useCheckboxGroupContext","useCheckboxProps","__spreadProps","__spreadValues","event","checkbox","useCheckbox","id","state","ptmi","ptm","cx","onChange","createInputElement","inputProps","mergeProps","cn","createBoxElement","boxProps","iconProps","icon","CheckIcon","MinusIcon","input","box","rootProps","CheckboxProvider","Component","CheckboxGroup","React","createOptionalContext","ListboxProvider","useListboxContext","Component","mergeProps","React","createOptionalContext","ListboxOptionProvider","useListboxOptionContext","defaultOptionProps","ListboxOption","withComponent","defaultOptionProps","instance","_a","_b","_c","_d","_e","listbox","useListboxContext","options","index","option","selected","group","props","ptmi","computedProps","mergeProps","event","rootProps","ListboxOptionProvider","Component","defaultSelectionProps","ListboxSelection","withComponent","defaultSelectionProps","listbox","useListboxContext","option","useListboxOptionContext","__spreadProps","__spreadValues","instance","_a","props","ptmi","selected","checkmark","checkbox","rootProps","mergeProps","createContent","CheckIcon","BlankIcon","Checkbox","content","resolve","Component"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OrgChartInstance } from '@primereact/types/shared/orgchart';
|
|
2
|
+
export declare const OrgChartProvider: ({ value, children }: {
|
|
3
|
+
value: OrgChartInstance;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}) => import("react").JSX.Element, useOrgChartContext: () => OrgChartInstance | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const OrgChart: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartProps) | undefined) => React.JSX.Element | null) & {
|
|
3
|
+
Tree: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartTreeProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
4
|
+
Subtree: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartSubtreeProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
5
|
+
Node: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartNodeProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
6
|
+
NodeContent: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartNodeContentProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
7
|
+
CollapseButton: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartCollapseButtonProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
8
|
+
} & React.FC<{}>;
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const OrgChartCollapseButton: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartCollapseButtonProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var k=Object.defineProperty,E=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var y=(e,t,n)=>t in e?k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t)=>{for(var n in t||(t={}))S.call(t,n)&&y(e,n,t[n]);if(u)for(var n of u(t))T.call(t,n)&&y(e,n,t[n]);return e},f=(e,t)=>E(e,R(t));import{Component as N}from"@primereact/core/component";import{ChevronDownIcon as M}from"@primereact/icons/chevrondown";import{ChevronUpIcon as H}from"@primereact/icons/chevronup";import{mergeProps as i}from"@primeuix/utils";import{withComponent as g}from"@primereact/core/component";import{styles as v}from"@primereact/styles/base";var d=({name:e="UnknownComponent",defaultProps:t,styles:n=f(a({},v),{name:"global"}),components:o,setup:l,render:s})=>g({name:e,defaultProps:t,styles:n,components:o,setup:l,render:s});import*as r from"react";import{createOptionalContext as K}from"@primereact/core/utils";var[G,x]=K();import{createOptionalContext as U}from"@primereact/core/utils";var[V,O]=U();var P={as:"button"};var ro=d({name:"OrgChartCollapseButton",defaultProps:P,setup(){let e=x(),t=O();return{orgchart:e,orgcharttree:t}},render(e){var c,C;let{props:t,ptmi:n,orgchart:o,orgcharttree:l}=e,s=l==null?void 0:l.props.item,m=s==null?void 0:s.key,h=o==null?void 0:o.isCollapsed(s),w=o==null?void 0:o.isCollapsible(s),B=r.useCallback(p=>{p.stopPropagation(),o==null||o.toggleNodeCollapse(m)},[m,o]),I=i({role:"button",className:o==null?void 0:o.cx("collapseButton"),onClick:B,onKeyDown:p=>o==null?void 0:o.handleCollapseKeyDown(p,m)},o==null?void 0:o.ptm("collapseButton"),n("root")),D=()=>{let p=i({className:o==null?void 0:o.cx("collapseButtonDownIcon")},o==null?void 0:o.ptm("collapseButtonDownIcon"),n("root"));return r.createElement(M,a({},p))},b=()=>{let p=i({className:o==null?void 0:o.cx("collapseButtonUpIcon")},o==null?void 0:o.ptm("collapseButtonUpIcon"),n("root"));return r.createElement(H,a({},p))};return w?r.createElement(N,{instance:e,attrs:I,children:(C=t.children)!=null?C:h?r.createElement(r.Fragment,null,"+",(c=s==null?void 0:s.children)==null?void 0:c.length,D()):r.createElement(r.Fragment,null,"Collapse",b())}):null}});export{ro as OrgChartCollapseButton,P as defaultCollapseButtonProps};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/orgchart/collapsebutton/OrgChartCollapseButton.tsx","../../../src/base/index.ts","../../../src/orgchart/OrgChart.context.ts","../../../src/orgchart/tree/OrgChartTree.context.ts","../../../src/orgchart/collapsebutton/OrgChartCollapseButton.props.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { ChevronDownIcon } from '@primereact/icons/chevrondown';\nimport { ChevronUpIcon } from '@primereact/icons/chevronup';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree/OrgChartTree.context';\nimport { defaultCollapseButtonProps } from './OrgChartCollapseButton.props';\n\nexport const OrgChartCollapseButton = withComponent({\n name: 'OrgChartCollapseButton',\n defaultProps: defaultCollapseButtonProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n\n const item = orgcharttree?.props.item;\n const itemKey = item?.key;\n const isCollapsed = orgchart?.isCollapsed(item);\n const isCollapsible = orgchart?.isCollapsible(item);\n\n const handleCollapseClick = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n orgchart?.toggleNodeCollapse(itemKey);\n },\n [itemKey, orgchart]\n );\n\n const rootProps = mergeProps(\n {\n role: 'button',\n className: orgchart?.cx('collapseButton'),\n onClick: handleCollapseClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => orgchart?.handleCollapseKeyDown(event, itemKey)\n },\n orgchart?.ptm('collapseButton'),\n ptmi('root')\n );\n\n const createCollapseButtonDownIcon = () => {\n const iconProps = mergeProps(\n {\n className: orgchart?.cx('collapseButtonDownIcon')\n },\n orgchart?.ptm('collapseButtonDownIcon'),\n ptmi('root')\n );\n\n return <ChevronDownIcon {...iconProps} />;\n };\n\n const createCollapseButtonUpIcon = () => {\n const iconProps = mergeProps(\n {\n className: orgchart?.cx('collapseButtonUpIcon')\n },\n orgchart?.ptm('collapseButtonUpIcon'),\n ptmi('root')\n );\n\n return <ChevronUpIcon {...iconProps} />;\n };\n\n if (!isCollapsible) return null;\n\n return (\n <Component\n instance={instance}\n attrs={rootProps}\n children={\n props.children ??\n (isCollapsed ? (\n <>\n +{item?.children?.length}\n {createCollapseButtonDownIcon()}\n </>\n ) : (\n <>\n Collapse\n {createCollapseButtonUpIcon()}\n </>\n ))\n }\n />\n );\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartProvider, useOrgChartContext] = createOptionalContext<OrgChartInstance>();\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartTreeInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartTreeProvider, useOrgChartTreeContext] = createOptionalContext<OrgChartTreeInstance>();\n","import type { OrgChartCollapseButtonProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultCollapseButtonProps: OrgChartCollapseButtonProps = {\n as: 'button'\n};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Q,CACtB,EAEMe,EAAYC,EACd,CACI,KAAM,SACN,UAAWhB,GAAA,YAAAA,EAAU,GAAG,kBACxB,QAASa,EACT,UAAYC,GAAkDd,GAAA,YAAAA,EAAU,sBAAsBc,EAAOJ,EACzG,EACAV,GAAA,YAAAA,EAAU,IAAI,kBACdQ,EAAK,MAAM,CACf,EAEMS,EAA+B,IAAM,CACvC,IAAMC,EAAYF,EACd,CACI,UAAWhB,GAAA,YAAAA,EAAU,GAAG,yBAC5B,EACAA,GAAA,YAAAA,EAAU,IAAI,0BACdQ,EAAK,MAAM,CACf,EAEA,OAAO,gBAACW,EAAAC,EAAA,GAAoBF,EAAW,CAC3C,EAEMG,EAA6B,IAAM,CACrC,IAAMH,EAAYF,EACd,CACI,UAAWhB,GAAA,YAAAA,EAAU,GAAG,uBAC5B,EACAA,GAAA,YAAAA,EAAU,IAAI,wBACdQ,EAAK,MAAM,CACf,EAEA,OAAO,gBAACc,EAAAF,EAAA,GAAkBF,EAAW,CACzC,EAEA,OAAKN,EAGD,gBAACW,EAAA,CACG,SAAUnB,EACV,MAAOW,EACP,UACIT,EAAAC,EAAM,WAAN,KAAAD,EACCK,EACG,gCAAE,KACIN,EAAAI,GAAA,YAAAA,EAAM,WAAN,YAAAJ,EAAgB,OACjBY,EAA6B,CAClC,EAEA,gCAAE,WAEGI,EAA2B,CAChC,EAGZ,EApBuB,IAsB/B,CACJ,CAAC","names":["Component","ChevronDownIcon","ChevronUpIcon","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","createOptionalContext","OrgChartProvider","useOrgChartContext","createOptionalContext","OrgChartTreeProvider","useOrgChartTreeContext","defaultCollapseButtonProps","OrgChartCollapseButton","withComponent","defaultCollapseButtonProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","_a","_b","props","ptmi","item","itemKey","isCollapsed","isCollapsible","handleCollapseClick","event","rootProps","mergeProps","createCollapseButtonDownIcon","iconProps","ChevronDownIcon","__spreadValues","createCollapseButtonUpIcon","ChevronUpIcon","Component"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var Y=Object.defineProperty,Z=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var H=(t,o,s)=>o in t?Y(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,l=(t,o)=>{for(var s in o||(o={}))M.call(o,s)&&H(t,s,o[s]);if(x)for(var s of x(o))U.call(o,s)&&H(t,s,o[s]);return t},y=(t,o)=>Z(t,_(o));var L=(t,o)=>{var s={};for(var e in t)M.call(t,e)&&o.indexOf(e)<0&&(s[e]=t[e]);if(t!=null&&x)for(var e of x(t))o.indexOf(e)<0&&U.call(t,e)&&(s[e]=t[e]);return s};import{Component as Oe}from"@primereact/core/component";import{useOrgChart as Pe}from"@primereact/headless/orgchart";import{styles as he}from"@primereact/styles/orgchart";import{mergeProps as xe}from"@primeuix/utils";import{withComponent as $}from"@primereact/core/component";import{styles as ee}from"@primereact/styles/base";var m=({name:t="UnknownComponent",defaultProps:o,styles:s=y(l({},ee),{name:"global"}),components:e,setup:n,render:r})=>$({name:t,defaultProps:o,styles:s,components:e,setup:n,render:r});import*as w from"react";import{Component as re}from"@primereact/core/component";import{ChevronDownIcon as se}from"@primereact/icons/chevrondown";import{ChevronUpIcon as ne}from"@primereact/icons/chevronup";import{mergeProps as k}from"@primeuix/utils";import*as a from"react";import{createOptionalContext as te}from"@primereact/core/utils";var[j,i]=te();import{createOptionalContext as oe}from"@primereact/core/utils";var[q,f]=oe();var z={as:"button"};var N=m({name:"OrgChartCollapseButton",defaultProps:z,setup(){let t=i(),o=f();return{orgchart:t,orgcharttree:o}},render(t){var h,O;let{props:o,ptmi:s,orgchart:e,orgcharttree:n}=t,r=n==null?void 0:n.props.item,p=r==null?void 0:r.key,d=e==null?void 0:e.isCollapsed(r),c=e==null?void 0:e.isCollapsible(r),B=a.useCallback(u=>{u.stopPropagation(),e==null||e.toggleNodeCollapse(p)},[p,e]),P=k({role:"button",className:e==null?void 0:e.cx("collapseButton"),onClick:B,onKeyDown:u=>e==null?void 0:e.handleCollapseKeyDown(u,p)},e==null?void 0:e.ptm("collapseButton"),s("root")),I=()=>{let u=k({className:e==null?void 0:e.cx("collapseButtonDownIcon")},e==null?void 0:e.ptm("collapseButtonDownIcon"),s("root"));return a.createElement(se,l({},u))},D=()=>{let u=k({className:e==null?void 0:e.cx("collapseButtonUpIcon")},e==null?void 0:e.ptm("collapseButtonUpIcon"),s("root"));return a.createElement(ne,l({},u))};return c?a.createElement(re,{instance:t,attrs:P,children:(O=o.children)!=null?O:d?a.createElement(a.Fragment,null,"+",(h=r==null?void 0:r.children)==null?void 0:h.length,I()):a.createElement(a.Fragment,null,"Collapse",D())}):null}});import{Component as me}from"@primereact/core/component";import{cn as ae,mergeProps as ie}from"@primeuix/utils";import*as g from"react";import{Component as pe}from"@primereact/core/component";import{mergeProps as le}from"@primeuix/utils";import*as E from"react";var A={as:"li",item:void 0};var b=m({name:"OrgChartTree",defaultProps:A,setup(){let t=i(),o=f(),s=(o==null?void 0:o.level)!==void 0?o.level+1:0;return{orgchart:t,level:s}},render(t){let{props:o,ptmi:s,orgchart:e,level:n}=t,r=le({role:"treeitem",className:e==null?void 0:e.cx("tree"),"data-level":n,"data-collapsed":e==null?void 0:e.isCollapsed(o.item),"data-selected":e==null?void 0:e.isSelected(o.item),"data-selectable":e==null?void 0:e.isSelectable(o.item),"data-collapsible":e==null?void 0:e.isCollapsible(o.item),"aria-level":n,"aria-expanded":!(e!=null&&e.isCollapsed(o.item)),"aria-selected":e==null?void 0:e.isSelected(o.item)},e==null?void 0:e.ptm("tree"),s("root"));return E.createElement(q,{value:t},E.createElement(pe,{instance:t,attrs:r,children:o.children}))}});var F={as:"div",item:void 0};var v=m({name:"OrgChartNode",defaultProps:F,setup(){let t=i(),o=f();return{orgchart:t,orgcharttree:o}},render(t){let{props:o,ptmi:s,orgchart:e,orgcharttree:n}=t,r=n==null?void 0:n.props.item,K=(r==null?void 0:r.htmlProps)||{},{className:p,style:d,onClick:c}=K,B=L(K,["className","style","onClick"]),P=e==null?void 0:e.isSelectable(r),I=e==null?void 0:e.isCollapsible(r),D=e==null?void 0:e.isCollapsed(r),h=e==null?void 0:e.isSelected(r),O=r==null?void 0:r.key,u=g.useCallback(R=>{P&&O&&(e==null||e.toggleNodeSelect(O)),c==null||c(R)},[P,O,e,c]),X=ie(l({tabIndex:P?0:-1,className:ae(e==null?void 0:e.cx("node"),p),style:l(l({},d),e==null?void 0:e.sx("node")),"data-collapsible":I,"data-selectable":P,"data-collapsed":D,"data-selected":h,onClick:u,onKeyDown:R=>e==null?void 0:e.handleNodeKeyDown(R,O)},B),e==null?void 0:e.ptm("node"),s("root"));return g.createElement(me,{instance:t,attrs:X,children:o.children})}});import{Component as Ce}from"@primereact/core/component";import{cn as de,mergeProps as ce}from"@primeuix/utils";import*as J from"react";var G={as:"div"};var T=m({name:"OrgChartNodeContent",defaultProps:G,setup(){let t=i(),o=f();return{orgchart:t,orgcharttree:o}},render(t){var d,c;let{props:o,ptmi:s,orgchart:e,orgcharttree:n}=t,r=n==null?void 0:n.props.item,p=ce({className:de(e==null?void 0:e.cx("nodeContent"))},e==null?void 0:e.ptm("nodeContent"),s("root"));return J.createElement(Ce,{instance:t,attrs:p,children:(c=(d=o.children)!=null?d:typeof(r==null?void 0:r.render)=="function"?r.render(r):r==null?void 0:r.render)!=null?c:r==null?void 0:r.label})}});import*as Q from"@primereact/headless/orgchart";var V=y(l({},Q.defaultProps),{as:"div"});import{Component as ue}from"@primereact/core/component";import{mergeProps as fe}from"@primeuix/utils";import*as C from"react";var W={as:"ul",items:[],root:!1};var S=m({name:"OrgChartSubtree",defaultProps:W,setup(){return{orgchart:i()}},render(t){var r;let{props:o,ptmi:s,orgchart:e}=t,n=fe({role:"group",className:e==null?void 0:e.cx("subtree",{root:o.root})},e==null?void 0:e.ptm("subtree"),s("root"));return C.createElement(ue,{instance:t,attrs:n,children:e!=null&&e.props.children?o.children:C.createElement(C.Fragment,null,(r=o.items)==null?void 0:r.map(p=>C.createElement(b,{key:p.key,item:p},C.createElement(v,null,C.createElement(T,null),C.createElement(N,null)),p.children&&p.children.length>0&&!(e!=null&&e.isCollapsed(p))&&C.createElement(S,{items:p.children}))))})}});var _t=m({name:"OrgChart",defaultProps:V,styles:he,setup(t){return Pe(t.inProps)},render(t){var d;let{ptmi:o,cx:s,sx:e,props:n,orgChartStyle:r}=t,p=xe({role:"tree",className:s("root"),style:l(l({},r),e("root")),"aria-multiselectable":n.selectionMode==="multiple"},o("root"));return w.createElement(j,{value:t},w.createElement(Oe,{instance:t,attrs:p,children:(d=n.children)!=null?d:n.value&&n.value.length&&n.value.length>0?w.createElement(S,{items:n.value,root:!0}):null}))},components:{Tree:b,Subtree:S,Node:v,NodeContent:T,CollapseButton:N}});export{_t as OrgChart,j as OrgChartProvider,V as defaultProps,i as useOrgChartContext};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/orgchart/OrgChart.tsx","../../src/base/index.ts","../../src/orgchart/collapsebutton/OrgChartCollapseButton.tsx","../../src/orgchart/OrgChart.context.ts","../../src/orgchart/tree/OrgChartTree.context.ts","../../src/orgchart/collapsebutton/OrgChartCollapseButton.props.ts","../../src/orgchart/node/OrgChartNode.tsx","../../src/orgchart/tree/OrgChartTree.tsx","../../src/orgchart/tree/OrgChartTree.props.ts","../../src/orgchart/node/OrgChartNode.props.ts","../../src/orgchart/nodecontent/OrgChartNodeContent.tsx","../../src/orgchart/nodecontent/OrgChartNodeContent.props.ts","../../src/orgchart/OrgChart.props.ts","../../src/orgchart/subtree/OrgChartSubtree.tsx","../../src/orgchart/subtree/OrgChartSubtree.props.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { useOrgChart } from '@primereact/headless/orgchart';\nimport { styles } from '@primereact/styles/orgchart';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { OrgChartCollapseButton } from './collapsebutton';\nimport { OrgChartNode } from './node';\nimport { OrgChartNodeContent } from './nodecontent';\nimport { OrgChartProvider } from './OrgChart.context';\nimport { defaultProps } from './OrgChart.props';\nimport { OrgChartSubtree } from './subtree';\nimport { OrgChartTree } from './tree';\n\nexport const OrgChart = withComponent({\n name: 'OrgChart',\n defaultProps,\n styles,\n setup(instance) {\n const orgchart = useOrgChart(instance.inProps);\n\n return orgchart;\n },\n render(instance) {\n const { ptmi, cx, sx, props, orgChartStyle } = instance;\n\n const rootProps = mergeProps(\n {\n role: 'tree',\n className: cx('root'),\n style: { ...orgChartStyle, ...sx('root') },\n 'aria-multiselectable': props.selectionMode === 'multiple'\n },\n ptmi('root')\n );\n\n return (\n <OrgChartProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children ?? (props.value && props.value.length && props.value.length > 0 ? <OrgChartSubtree items={props.value} root /> : null)} />\n </OrgChartProvider>\n );\n },\n components: {\n Tree: OrgChartTree,\n Subtree: OrgChartSubtree,\n Node: OrgChartNode,\n NodeContent: OrgChartNodeContent,\n CollapseButton: OrgChartCollapseButton\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { ChevronDownIcon } from '@primereact/icons/chevrondown';\nimport { ChevronUpIcon } from '@primereact/icons/chevronup';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree/OrgChartTree.context';\nimport { defaultCollapseButtonProps } from './OrgChartCollapseButton.props';\n\nexport const OrgChartCollapseButton = withComponent({\n name: 'OrgChartCollapseButton',\n defaultProps: defaultCollapseButtonProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n\n const item = orgcharttree?.props.item;\n const itemKey = item?.key;\n const isCollapsed = orgchart?.isCollapsed(item);\n const isCollapsible = orgchart?.isCollapsible(item);\n\n const handleCollapseClick = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n orgchart?.toggleNodeCollapse(itemKey);\n },\n [itemKey, orgchart]\n );\n\n const rootProps = mergeProps(\n {\n role: 'button',\n className: orgchart?.cx('collapseButton'),\n onClick: handleCollapseClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => orgchart?.handleCollapseKeyDown(event, itemKey)\n },\n orgchart?.ptm('collapseButton'),\n ptmi('root')\n );\n\n const createCollapseButtonDownIcon = () => {\n const iconProps = mergeProps(\n {\n className: orgchart?.cx('collapseButtonDownIcon')\n },\n orgchart?.ptm('collapseButtonDownIcon'),\n ptmi('root')\n );\n\n return <ChevronDownIcon {...iconProps} />;\n };\n\n const createCollapseButtonUpIcon = () => {\n const iconProps = mergeProps(\n {\n className: orgchart?.cx('collapseButtonUpIcon')\n },\n orgchart?.ptm('collapseButtonUpIcon'),\n ptmi('root')\n );\n\n return <ChevronUpIcon {...iconProps} />;\n };\n\n if (!isCollapsible) return null;\n\n return (\n <Component\n instance={instance}\n attrs={rootProps}\n children={\n props.children ??\n (isCollapsed ? (\n <>\n +{item?.children?.length}\n {createCollapseButtonDownIcon()}\n </>\n ) : (\n <>\n Collapse\n {createCollapseButtonUpIcon()}\n </>\n ))\n }\n />\n );\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartProvider, useOrgChartContext] = createOptionalContext<OrgChartInstance>();\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartTreeInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartTreeProvider, useOrgChartTreeContext] = createOptionalContext<OrgChartTreeInstance>();\n","import type { OrgChartCollapseButtonProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultCollapseButtonProps: OrgChartCollapseButtonProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { cn, mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree';\nimport { defaultNodeProps } from './OrgChartNode.props';\n\nexport const OrgChartNode = withComponent({\n name: 'OrgChartNode',\n defaultProps: defaultNodeProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n\n const item = orgcharttree?.props.item;\n\n const { className, style, onClick, ...restHtmlProps } = item?.htmlProps || {};\n\n const isSelectable = orgchart?.isSelectable(item);\n const isCollapsible = orgchart?.isCollapsible(item);\n const isCollapsed = orgchart?.isCollapsed(item);\n const isSelected = orgchart?.isSelected(item);\n\n const nodeKey = item?.key;\n\n const handleNodeClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (isSelectable && nodeKey) {\n orgchart?.toggleNodeSelect(nodeKey);\n }\n\n onClick?.(event);\n },\n [isSelectable, nodeKey, orgchart, onClick]\n );\n\n const rootProps = mergeProps(\n {\n tabIndex: isSelectable ? 0 : -1,\n className: cn(orgchart?.cx('node'), className),\n style: { ...style, ...orgchart?.sx('node') },\n 'data-collapsible': isCollapsible,\n 'data-selectable': isSelectable,\n 'data-collapsed': isCollapsed,\n 'data-selected': isSelected,\n onClick: handleNodeClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => orgchart?.handleNodeKeyDown(event, nodeKey),\n ...restHtmlProps\n },\n orgchart?.ptm('node'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { OrgChartTreeProvider, useOrgChartTreeContext } from './OrgChartTree.context';\nimport { defaultTreeProps } from './OrgChartTree.props';\n\nexport const OrgChartTree = withComponent({\n name: 'OrgChartTree',\n defaultProps: defaultTreeProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n const level = orgcharttree?.level !== undefined ? orgcharttree.level + 1 : 0;\n\n return { orgchart, level };\n },\n render(instance) {\n const { props, ptmi, orgchart, level } = instance;\n\n const rootProps = mergeProps(\n {\n role: 'treeitem',\n className: orgchart?.cx('tree'),\n 'data-level': level,\n 'data-collapsed': orgchart?.isCollapsed(props.item),\n 'data-selected': orgchart?.isSelected(props.item),\n 'data-selectable': orgchart?.isSelectable(props.item),\n 'data-collapsible': orgchart?.isCollapsible(props.item),\n 'aria-level': level,\n 'aria-expanded': !orgchart?.isCollapsed(props.item),\n 'aria-selected': orgchart?.isSelected(props.item)\n },\n orgchart?.ptm('tree'),\n ptmi('root')\n );\n\n return (\n <OrgChartTreeProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </OrgChartTreeProvider>\n );\n }\n});\n","import type { OrgChartTreeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultTreeProps: OrgChartTreeProps = {\n as: 'li',\n item: undefined\n};\n","import type { OrgChartNodeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultNodeProps: OrgChartNodeProps = {\n as: 'div',\n item: undefined\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { TreeNode } from '@primereact/types/shared/orgchart';\nimport { cn, mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree/OrgChartTree.context';\nimport { defaultNodeContentProps } from './OrgChartNodeContent.props';\n\nexport const OrgChartNodeContent = withComponent({\n name: 'OrgChartNodeContent',\n defaultProps: defaultNodeContentProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n const item = orgcharttree?.props.item;\n const rootProps = mergeProps(\n {\n className: cn(orgchart?.cx('nodeContent'))\n },\n orgchart?.ptm('nodeContent'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children ?? (typeof item?.render === 'function' ? item.render(item as TreeNode) : item?.render) ?? item?.label} />;\n }\n});\n","import type { OrgChartNodeContentProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultNodeContentProps: OrgChartNodeContentProps = {\n as: 'div'\n};\n","import * as HeadlessOrgChart from '@primereact/headless/orgchart';\nimport type { OrgChartProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultProps: OrgChartProps = {\n ...HeadlessOrgChart.defaultProps,\n as: 'div'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { OrgChartCollapseButton } from '../collapsebutton';\nimport { OrgChartNode } from '../node/OrgChartNode';\nimport { OrgChartNodeContent } from '../nodecontent';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { OrgChartTree } from '../tree/OrgChartTree';\nimport { defaultSubtreeProps } from './OrgChartSubtree.props';\n\nexport const OrgChartSubtree = withComponent({\n name: 'OrgChartSubtree',\n defaultProps: defaultSubtreeProps,\n setup() {\n const orgchart = useOrgChartContext();\n\n return { orgchart };\n },\n render(instance) {\n const { props, ptmi, orgchart } = instance;\n\n const rootProps = mergeProps(\n {\n role: 'group',\n className: orgchart?.cx('subtree', { root: props.root })\n },\n orgchart?.ptm('subtree'),\n ptmi('root')\n );\n\n return (\n <Component\n instance={instance}\n attrs={rootProps}\n children={\n orgchart?.props.children ? (\n props.children\n ) : (\n <>\n {props.items?.map((item) => (\n <OrgChartTree key={item.key} item={item}>\n <OrgChartNode>\n <OrgChartNodeContent />\n <OrgChartCollapseButton />\n </OrgChartNode>\n {item.children && item.children.length > 0 && !orgchart?.isCollapsed(item) && <OrgChartSubtree items={item.children} />}\n </OrgChartTree>\n ))}\n </>\n )\n }\n />\n );\n }\n});\n","import type { OrgChartSubtreeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultSubtreeProps: OrgChartSubtreeProps = {\n as: 'ul',\n items: [],\n root: false\n};\n"],"mappings":"4lBACA,OAAS,aAAAA,OAAiB,6BAC1B,OAAS,eAAAC,OAAmB,gCAC5B,OAAS,UAAAC,OAAc,8BACvB,OAAS,cAAAC,OAAkB,kBCJ3B,OAAS,iBAAiBC,MAA2B,6BACrD,OAAS,UAAUC,OAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,IADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,EAA4D,CAC/D,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,EDjBL,UA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C,EbzCM,IAAMK,GAAWC,EAAc,CAClC,KAAM,WACN,aAAAC,EACA,OAAAC,GACA,MAAMC,EAAU,CAGZ,OAFiBC,GAAYD,EAAS,OAAO,CAGjD,EACA,OAAOA,EAAU,CAxBrB,IAAAE,EAyBQ,GAAM,CAAE,KAAAC,EAAM,GAAAC,EAAI,GAAAC,EAAI,MAAAC,EAAO,cAAAC,CAAc,EAAIP,EAEzCQ,EAAYC,GACd,CACI,KAAM,OACN,UAAWL,EAAG,MAAM,EACpB,MAAOM,IAAA,GAAKH,GAAkBF,EAAG,MAAM,GACvC,uBAAwBC,EAAM,gBAAkB,UACpD,EACAH,EAAK,MAAM,CACf,EAEA,OACI,gBAACQ,EAAA,CAAiB,MAAOX,GACrB,gBAACY,GAAA,CAAU,SAAUZ,EAAU,MAAOQ,EAAW,UAAUN,EAAAI,EAAM,WAAN,KAAAJ,EAAmBI,EAAM,OAASA,EAAM,MAAM,QAAUA,EAAM,MAAM,OAAS,EAAI,gBAACO,EAAA,CAAgB,MAAOP,EAAM,MAAO,KAAI,GAAC,EAAK,KAAO,CACtM,CAER,EACA,WAAY,CACR,KAAMQ,EACN,QAASD,EACT,KAAME,EACN,YAAaC,EACb,eAAgBC,CACpB,CACJ,CAAC","names":["Component","useOrgChart","styles","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","Component","ChevronDownIcon","ChevronUpIcon","mergeProps","React","createOptionalContext","OrgChartProvider","useOrgChartContext","createOptionalContext","OrgChartTreeProvider","useOrgChartTreeContext","defaultCollapseButtonProps","OrgChartCollapseButton","withComponent","defaultCollapseButtonProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","_a","_b","props","ptmi","item","itemKey","isCollapsed","isCollapsible","handleCollapseClick","event","rootProps","mergeProps","createCollapseButtonDownIcon","iconProps","ChevronDownIcon","__spreadValues","createCollapseButtonUpIcon","ChevronUpIcon","Component","Component","cn","mergeProps","React","Component","mergeProps","React","defaultTreeProps","OrgChartTree","withComponent","defaultTreeProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","level","instance","props","ptmi","rootProps","mergeProps","OrgChartTreeProvider","Component","defaultNodeProps","OrgChartNode","withComponent","defaultNodeProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","props","ptmi","item","_a","className","style","onClick","restHtmlProps","__objRest","isSelectable","isCollapsible","isCollapsed","isSelected","nodeKey","handleNodeClick","event","rootProps","mergeProps","__spreadValues","cn","Component","Component","cn","mergeProps","React","defaultNodeContentProps","OrgChartNodeContent","withComponent","defaultNodeContentProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","_a","_b","props","ptmi","item","rootProps","mergeProps","cn","Component","HeadlessOrgChart","defaultProps","__spreadProps","__spreadValues","Component","mergeProps","React","defaultSubtreeProps","OrgChartSubtree","withComponent","defaultSubtreeProps","useOrgChartContext","instance","_a","props","ptmi","orgchart","rootProps","mergeProps","Component","item","OrgChartTree","OrgChartNode","OrgChartNodeContent","OrgChartCollapseButton","OrgChart","withComponent","defaultProps","styles","instance","useOrgChart","_a","ptmi","cx","sx","props","orgChartStyle","rootProps","mergeProps","__spreadValues","OrgChartProvider","Component","OrgChartSubtree","OrgChartTree","OrgChartNode","OrgChartNodeContent","OrgChartCollapseButton"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const OrgChartNode: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartNodeProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var M=Object.defineProperty,L=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var O=(o,t,r)=>t in o?M(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,n=(o,t)=>{for(var r in t||(t={}))P.call(t,r)&&O(o,r,t[r]);if(m)for(var r of m(t))v.call(t,r)&&O(o,r,t[r]);return o},T=(o,t)=>L(o,g(t));var b=(o,t)=>{var r={};for(var e in o)P.call(o,e)&&t.indexOf(e)<0&&(r[e]=o[e]);if(o!=null&&m)for(var e of m(o))t.indexOf(e)<0&&v.call(o,e)&&(r[e]=o[e]);return r};import{Component as F}from"@primereact/core/component";import{cn as G,mergeProps as J}from"@primeuix/utils";import{withComponent as U}from"@primereact/core/component";import{styles as j}from"@primereact/styles/base";var d=({name:o="UnknownComponent",defaultProps:t,styles:r=T(n({},j),{name:"global"}),components:e,setup:p,render:s})=>U({name:o,defaultProps:t,styles:r,components:e,setup:p,render:s});import*as f from"react";import{createOptionalContext as q}from"@primereact/core/utils";var[_,C]=q();import{Component as A}from"@primereact/core/component";import{mergeProps as B}from"@primeuix/utils";import*as y from"react";import{createOptionalContext as z}from"@primereact/core/utils";var[S,c]=z();var h={as:"li",item:void 0};var ie=d({name:"OrgChartTree",defaultProps:h,setup(){let o=C(),t=c(),r=(t==null?void 0:t.level)!==void 0?t.level+1:0;return{orgchart:o,level:r}},render(o){let{props:t,ptmi:r,orgchart:e,level:p}=o,s=B({role:"treeitem",className:e==null?void 0:e.cx("tree"),"data-level":p,"data-collapsed":e==null?void 0:e.isCollapsed(t.item),"data-selected":e==null?void 0:e.isSelected(t.item),"data-selectable":e==null?void 0:e.isSelectable(t.item),"data-collapsible":e==null?void 0:e.isCollapsible(t.item),"aria-level":p,"aria-expanded":!(e!=null&&e.isCollapsed(t.item)),"aria-selected":e==null?void 0:e.isSelected(t.item)},e==null?void 0:e.ptm("tree"),r("root"));return y.createElement(S,{value:o},y.createElement(A,{instance:o,attrs:s,children:t.children}))}});var w={as:"div",item:void 0};var be=d({name:"OrgChartNode",defaultProps:w,setup(){let o=C(),t=c();return{orgchart:o,orgcharttree:t}},render(o){let{props:t,ptmi:r,orgchart:e,orgcharttree:p}=o,s=p==null?void 0:p.props.item,x=(s==null?void 0:s.htmlProps)||{},{className:N,style:D,onClick:l}=x,I=b(x,["className","style","onClick"]),a=e==null?void 0:e.isSelectable(s),R=e==null?void 0:e.isCollapsible(s),k=e==null?void 0:e.isCollapsed(s),E=e==null?void 0:e.isSelected(s),i=s==null?void 0:s.key,K=f.useCallback(u=>{a&&i&&(e==null||e.toggleNodeSelect(i)),l==null||l(u)},[a,i,e,l]),H=J(n({tabIndex:a?0:-1,className:G(e==null?void 0:e.cx("node"),N),style:n(n({},D),e==null?void 0:e.sx("node")),"data-collapsible":R,"data-selectable":a,"data-collapsed":k,"data-selected":E,onClick:K,onKeyDown:u=>e==null?void 0:e.handleNodeKeyDown(u,i)},I),e==null?void 0:e.ptm("node"),r("root"));return f.createElement(F,{instance:o,attrs:H,children:t.children})}});export{be as OrgChartNode,w as defaultNodeProps};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/orgchart/node/OrgChartNode.tsx","../../../src/base/index.ts","../../../src/orgchart/OrgChart.context.ts","../../../src/orgchart/tree/OrgChartTree.tsx","../../../src/orgchart/tree/OrgChartTree.context.ts","../../../src/orgchart/tree/OrgChartTree.props.ts","../../../src/orgchart/node/OrgChartNode.props.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { cn, mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree';\nimport { defaultNodeProps } from './OrgChartNode.props';\n\nexport const OrgChartNode = withComponent({\n name: 'OrgChartNode',\n defaultProps: defaultNodeProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n\n const item = orgcharttree?.props.item;\n\n const { className, style, onClick, ...restHtmlProps } = item?.htmlProps || {};\n\n const isSelectable = orgchart?.isSelectable(item);\n const isCollapsible = orgchart?.isCollapsible(item);\n const isCollapsed = orgchart?.isCollapsed(item);\n const isSelected = orgchart?.isSelected(item);\n\n const nodeKey = item?.key;\n\n const handleNodeClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (isSelectable && nodeKey) {\n orgchart?.toggleNodeSelect(nodeKey);\n }\n\n onClick?.(event);\n },\n [isSelectable, nodeKey, orgchart, onClick]\n );\n\n const rootProps = mergeProps(\n {\n tabIndex: isSelectable ? 0 : -1,\n className: cn(orgchart?.cx('node'), className),\n style: { ...style, ...orgchart?.sx('node') },\n 'data-collapsible': isCollapsible,\n 'data-selectable': isSelectable,\n 'data-collapsed': isCollapsed,\n 'data-selected': isSelected,\n onClick: handleNodeClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => orgchart?.handleNodeKeyDown(event, nodeKey),\n ...restHtmlProps\n },\n orgchart?.ptm('node'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartProvider, useOrgChartContext] = createOptionalContext<OrgChartInstance>();\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { OrgChartTreeProvider, useOrgChartTreeContext } from './OrgChartTree.context';\nimport { defaultTreeProps } from './OrgChartTree.props';\n\nexport const OrgChartTree = withComponent({\n name: 'OrgChartTree',\n defaultProps: defaultTreeProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n const level = orgcharttree?.level !== undefined ? orgcharttree.level + 1 : 0;\n\n return { orgchart, level };\n },\n render(instance) {\n const { props, ptmi, orgchart, level } = instance;\n\n const rootProps = mergeProps(\n {\n role: 'treeitem',\n className: orgchart?.cx('tree'),\n 'data-level': level,\n 'data-collapsed': orgchart?.isCollapsed(props.item),\n 'data-selected': orgchart?.isSelected(props.item),\n 'data-selectable': orgchart?.isSelectable(props.item),\n 'data-collapsible': orgchart?.isCollapsible(props.item),\n 'aria-level': level,\n 'aria-expanded': !orgchart?.isCollapsed(props.item),\n 'aria-selected': orgchart?.isSelected(props.item)\n },\n orgchart?.ptm('tree'),\n ptmi('root')\n );\n\n return (\n <OrgChartTreeProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </OrgChartTreeProvider>\n );\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartTreeInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartTreeProvider, useOrgChartTreeContext] = createOptionalContext<OrgChartTreeInstance>();\n","import type { OrgChartTreeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultTreeProps: OrgChartTreeProps = {\n as: 'li',\n item: undefined\n};\n","import type { OrgChartNodeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultNodeProps: OrgChartNodeProps = {\n as: 'div',\n item: undefined\n};\n"],"mappings":"4lBACA,OAAS,aAAAA,MAAiB,6BAC1B,OAAS,MAAAC,EAAI,cAAAC,MAAkB,kBCF/B,OAAS,iBAAiBC,MAA2B,6BACrD,OAAS,UAAUC,MAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,GADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,EAA4D,CAC/D,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,EDnBL,UAAYE,MAAW,QEJvB,OAAS,yBAAAC,MAA6B,yBAG/B,GAAM,CAACC,EAAkBC,CAAkB,EAAIF,EAAwC,ECF9F,OAAS,aAAAG,MAAiB,6BAC1B,OAAS,cAAAC,MAAkB,kBAE3B,UAAYC,MAAW,QCJvB,OAAS,yBAAAC,MAA6B,yBAG/B,GAAM,CAACC,EAAsBC,CAAsB,EAAIF,EAA4C,ECDnG,IAAMG,EAAsC,CAC/C,GAAI,KACJ,KAAM,MACV,EFIO,IAAMC,GAAeC,EAAc,CACtC,KAAM,eACN,aAAcC,EACd,OAAQ,CACJ,IAAMC,EAAWC,EAAmB,EAC9BC,EAAeC,EAAuB,EACtCC,GAAQF,GAAA,YAAAA,EAAc,SAAU,OAAYA,EAAa,MAAQ,EAAI,EAE3E,MAAO,CAAE,SAAAF,EAAU,MAAAI,CAAM,CAC7B,EACA,OAAOC,EAAU,CACb,GAAM,CAAE,MAAAC,EAAO,KAAAC,EAAM,SAAAP,EAAU,MAAAI,CAAM,EAAIC,EAEnCG,EAAYC,EACd,CACI,KAAM,WACN,UAAWT,GAAA,YAAAA,EAAU,GAAG,QACxB,aAAcI,EAC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GAA4C,CACrCN,GAAgBI,IAChBlB,GAAA,MAAAA,EAAU,iBAAiBkB,IAG/BP,GAAA,MAAAA,EAAUS,EACd,EACA,CAACN,EAAcI,EAASlB,EAAUW,CAAO,CAC7C,EAEMU,EAAYC,EACdC,EAAA,CACI,SAAUT,EAAe,EAAI,GAC7B,UAAWU,EAAGxB,GAAA,YAAAA,EAAU,GAAG,QAASS,CAAS,EAC7C,MAAOc,IAAA,GAAKb,GAAUV,GAAA,YAAAA,EAAU,GAAG,SACnC,mBAAoBe,EACpB,kBAAmBD,EACnB,iBAAkBE,EAClB,gBAAiBC,EACjB,QAASE,EACT,UAAYC,GAA+CpB,GAAA,YAAAA,EAAU,kBAAkBoB,EAAOF,IAC3FN,GAEPZ,GAAA,YAAAA,EAAU,IAAI,QACdM,EAAK,MAAM,CACf,EAEA,OAAO,gBAACmB,EAAA,CAAU,SAAUrB,EAAU,MAAOiB,EAAW,SAAUhB,EAAM,SAAU,CACtF,CACJ,CAAC","names":["Component","cn","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","createOptionalContext","OrgChartProvider","useOrgChartContext","Component","mergeProps","React","createOptionalContext","OrgChartTreeProvider","useOrgChartTreeContext","defaultTreeProps","OrgChartTree","withComponent","defaultTreeProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","level","instance","props","ptmi","rootProps","mergeProps","OrgChartTreeProvider","Component","defaultNodeProps","OrgChartNode","withComponent","defaultNodeProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","props","ptmi","item","_a","className","style","onClick","restHtmlProps","__objRest","isSelectable","isCollapsible","isCollapsed","isSelected","nodeKey","handleNodeClick","event","rootProps","mergeProps","__spreadValues","cn","Component"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const OrgChartNodeContent: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartNodeContentProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var g=Object.defineProperty,x=Object.defineProperties;var u=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var i=(r,t,e)=>t in r?g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,C=(r,t)=>{for(var e in t||(t={}))P.call(t,e)&&i(r,e,t[e]);if(m)for(var e of m(t))w.call(t,e)&&i(r,e,t[e]);return r},c=(r,t)=>x(r,u(t));import{Component as D}from"@primereact/core/component";import{cn as k,mergeProps as R}from"@primeuix/utils";import{withComponent as N}from"@primereact/core/component";import{styles as I}from"@primereact/styles/base";var d=({name:r="UnknownComponent",defaultProps:t,styles:e=c(C({},I),{name:"global"}),components:n,setup:p,render:o})=>N({name:r,defaultProps:t,styles:e,components:n,setup:p,render:o});import*as l from"react";import{createOptionalContext as S}from"@primereact/core/utils";var[q,h]=S();import{createOptionalContext as T}from"@primereact/core/utils";var[B,f]=T();var y={as:"div"};var W=d({name:"OrgChartNodeContent",defaultProps:y,setup(){let r=h(),t=f();return{orgchart:r,orgcharttree:t}},render(r){var s,a;let{props:t,ptmi:e,orgchart:n,orgcharttree:p}=r,o=p==null?void 0:p.props.item,O=R({className:k(n==null?void 0:n.cx("nodeContent"))},n==null?void 0:n.ptm("nodeContent"),e("root"));return l.createElement(D,{instance:r,attrs:O,children:(a=(s=t.children)!=null?s:typeof(o==null?void 0:o.render)=="function"?o.render(o):o==null?void 0:o.render)!=null?a:o==null?void 0:o.label})}});export{W as OrgChartNodeContent,y as defaultNodeContentProps};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/orgchart/nodecontent/OrgChartNodeContent.tsx","../../../src/base/index.ts","../../../src/orgchart/OrgChart.context.ts","../../../src/orgchart/tree/OrgChartTree.context.ts","../../../src/orgchart/nodecontent/OrgChartNodeContent.props.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { TreeNode } from '@primereact/types/shared/orgchart';\nimport { cn, mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree/OrgChartTree.context';\nimport { defaultNodeContentProps } from './OrgChartNodeContent.props';\n\nexport const OrgChartNodeContent = withComponent({\n name: 'OrgChartNodeContent',\n defaultProps: defaultNodeContentProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n const item = orgcharttree?.props.item;\n const rootProps = mergeProps(\n {\n className: cn(orgchart?.cx('nodeContent'))\n },\n orgchart?.ptm('nodeContent'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children ?? (typeof item?.render === 'function' ? item.render(item as TreeNode) : item?.render) ?? item?.label} />;\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartProvider, useOrgChartContext] = createOptionalContext<OrgChartInstance>();\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartTreeInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartTreeProvider, useOrgChartTreeContext] = createOptionalContext<OrgChartTreeInstance>();\n","import type { OrgChartNodeContentProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultNodeContentProps: OrgChartNodeContentProps = {\n as: 'div'\n};\n"],"mappings":"0bACA,OAAS,aAAAA,MAAiB,6BAE1B,OAAS,MAAAC,EAAI,cAAAC,MAAkB,kBCH/B,OAAS,iBAAiBC,MAA2B,6BACrD,OAAS,UAAUC,MAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,GADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,EAA4D,CAC/D,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,EDlBL,UAAYE,MAAW,QELvB,OAAS,yBAAAC,MAA6B,yBAG/B,GAAM,CAACC,EAAkBC,CAAkB,EAAIF,EAAwC,ECH9F,OAAS,yBAAAG,MAA6B,yBAG/B,GAAM,CAACC,EAAsBC,CAAsB,EAAIF,EAA4C,ECDnG,IAAMG,EAAoD,CAC7D,GAAI,KACR,EJMO,IAAMC,EAAsBC,EAAc,CAC7C,KAAM,sBACN,aAAcC,EACd,OAAQ,CACJ,IAAMC,EAAWC,EAAmB,EAC9BC,EAAeC,EAAuB,EAE5C,MAAO,CAAE,SAAAH,EAAU,aAAAE,CAAa,CACpC,EACA,OAAOE,EAAU,CAnBrB,IAAAC,EAAAC,EAoBQ,GAAM,CAAE,MAAAC,EAAO,KAAAC,EAAM,SAAAR,EAAU,aAAAE,CAAa,EAAIE,EAC1CK,EAAOP,GAAA,YAAAA,EAAc,MAAM,KAC3BQ,EAAYC,EACd,CACI,UAAWC,EAAGZ,GAAA,YAAAA,EAAU,GAAG,cAAc,CAC7C,EACAA,GAAA,YAAAA,EAAU,IAAI,eACdQ,EAAK,MAAM,CACf,EAEA,OAAO,gBAACK,EAAA,CAAU,SAAUT,EAAU,MAAOM,EAAW,UAAUJ,GAAAD,EAAAE,EAAM,WAAN,KAAAF,EAAmB,OAAOI,GAAA,YAAAA,EAAM,SAAW,WAAaA,EAAK,OAAOA,CAAgB,EAAIA,GAAA,YAAAA,EAAM,SAA9F,KAAAH,EAAyGG,GAAA,YAAAA,EAAM,MAAO,CAC5L,CACJ,CAAC","names":["Component","cn","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","createOptionalContext","OrgChartProvider","useOrgChartContext","createOptionalContext","OrgChartTreeProvider","useOrgChartTreeContext","defaultNodeContentProps","OrgChartNodeContent","withComponent","defaultNodeContentProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","_a","_b","props","ptmi","item","rootProps","mergeProps","cn","Component"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const OrgChartSubtree: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartSubtreeProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var J=Object.defineProperty,Q=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var I=(o,t,s)=>t in o?J(o,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[t]=s,c=(o,t)=>{for(var s in t||(t={}))D.call(t,s)&&I(o,s,t[s]);if(y)for(var s of y(t))R.call(t,s)&&I(o,s,t[s]);return o},k=(o,t)=>Q(o,V(t));var g=(o,t)=>{var s={};for(var e in o)D.call(o,e)&&t.indexOf(e)<0&&(s[e]=o[e]);if(o!=null&&y)for(var e of y(o))t.indexOf(e)<0&&R.call(o,e)&&(s[e]=o[e]);return s};import{Component as ae}from"@primereact/core/component";import{mergeProps as ie}from"@primeuix/utils";import{withComponent as W}from"@primereact/core/component";import{styles as X}from"@primereact/styles/base";var m=({name:o="UnknownComponent",defaultProps:t,styles:s=k(c({},X),{name:"global"}),components:e,setup:n,render:r})=>W({name:o,defaultProps:t,styles:s,components:e,setup:n,render:r});import*as i from"react";import{Component as _}from"@primereact/core/component";import{ChevronDownIcon as $}from"@primereact/icons/chevrondown";import{ChevronUpIcon as ee}from"@primereact/icons/chevronup";import{mergeProps as v}from"@primeuix/utils";import*as l from"react";import{createOptionalContext as Y}from"@primereact/core/utils";var[xe,a]=Y();import{createOptionalContext as Z}from"@primereact/core/utils";var[E,u]=Z();var K={as:"button"};var M=m({name:"OrgChartCollapseButton",defaultProps:K,setup(){let o=a(),t=u();return{orgchart:o,orgcharttree:t}},render(o){var x,f;let{props:t,ptmi:s,orgchart:e,orgcharttree:n}=o,r=n==null?void 0:n.props.item,p=r==null?void 0:r.key,P=e==null?void 0:e.isCollapsed(r),d=e==null?void 0:e.isCollapsible(r),b=l.useCallback(C=>{C.stopPropagation(),e==null||e.toggleNodeCollapse(p)},[p,e]),O=v({role:"button",className:e==null?void 0:e.cx("collapseButton"),onClick:b,onKeyDown:C=>e==null?void 0:e.handleCollapseKeyDown(C,p)},e==null?void 0:e.ptm("collapseButton"),s("root")),N=()=>{let C=v({className:e==null?void 0:e.cx("collapseButtonDownIcon")},e==null?void 0:e.ptm("collapseButtonDownIcon"),s("root"));return l.createElement($,c({},C))},T=()=>{let C=v({className:e==null?void 0:e.cx("collapseButtonUpIcon")},e==null?void 0:e.ptm("collapseButtonUpIcon"),s("root"));return l.createElement(ee,c({},C))};return d?l.createElement(_,{instance:o,attrs:O,children:(f=t.children)!=null?f:P?l.createElement(l.Fragment,null,"+",(x=r==null?void 0:r.children)==null?void 0:x.length,N()):l.createElement(l.Fragment,null,"Collapse",T())}):null}});import{Component as re}from"@primereact/core/component";import{cn as se,mergeProps as ne}from"@primeuix/utils";import*as h from"react";import{Component as te}from"@primereact/core/component";import{mergeProps as oe}from"@primeuix/utils";import*as S from"react";var H={as:"li",item:void 0};var U=m({name:"OrgChartTree",defaultProps:H,setup(){let o=a(),t=u(),s=(t==null?void 0:t.level)!==void 0?t.level+1:0;return{orgchart:o,level:s}},render(o){let{props:t,ptmi:s,orgchart:e,level:n}=o,r=oe({role:"treeitem",className:e==null?void 0:e.cx("tree"),"data-level":n,"data-collapsed":e==null?void 0:e.isCollapsed(t.item),"data-selected":e==null?void 0:e.isSelected(t.item),"data-selectable":e==null?void 0:e.isSelectable(t.item),"data-collapsible":e==null?void 0:e.isCollapsible(t.item),"aria-level":n,"aria-expanded":!(e!=null&&e.isCollapsed(t.item)),"aria-selected":e==null?void 0:e.isSelected(t.item)},e==null?void 0:e.ptm("tree"),s("root"));return S.createElement(E,{value:o},S.createElement(te,{instance:o,attrs:r,children:t.children}))}});var L={as:"div",item:void 0};var j=m({name:"OrgChartNode",defaultProps:L,setup(){let o=a(),t=u();return{orgchart:o,orgcharttree:t}},render(o){let{props:t,ptmi:s,orgchart:e,orgcharttree:n}=o,r=n==null?void 0:n.props.item,B=(r==null?void 0:r.htmlProps)||{},{className:p,style:P,onClick:d}=B,b=g(B,["className","style","onClick"]),O=e==null?void 0:e.isSelectable(r),N=e==null?void 0:e.isCollapsible(r),T=e==null?void 0:e.isCollapsed(r),x=e==null?void 0:e.isSelected(r),f=r==null?void 0:r.key,C=h.useCallback(w=>{O&&f&&(e==null||e.toggleNodeSelect(f)),d==null||d(w)},[O,f,e,d]),G=ne(c({tabIndex:O?0:-1,className:se(e==null?void 0:e.cx("node"),p),style:c(c({},P),e==null?void 0:e.sx("node")),"data-collapsible":N,"data-selectable":O,"data-collapsed":T,"data-selected":x,onClick:C,onKeyDown:w=>e==null?void 0:e.handleNodeKeyDown(w,f)},b),e==null?void 0:e.ptm("node"),s("root"));return h.createElement(re,{instance:o,attrs:G,children:t.children})}});import{Component as pe}from"@primereact/core/component";import{cn as le,mergeProps as me}from"@primeuix/utils";import*as z from"react";var q={as:"div"};var A=m({name:"OrgChartNodeContent",defaultProps:q,setup(){let o=a(),t=u();return{orgchart:o,orgcharttree:t}},render(o){var P,d;let{props:t,ptmi:s,orgchart:e,orgcharttree:n}=o,r=n==null?void 0:n.props.item,p=me({className:le(e==null?void 0:e.cx("nodeContent"))},e==null?void 0:e.ptm("nodeContent"),s("root"));return z.createElement(pe,{instance:o,attrs:p,children:(d=(P=t.children)!=null?P:typeof(r==null?void 0:r.render)=="function"?r.render(r):r==null?void 0:r.render)!=null?d:r==null?void 0:r.label})}});var F={as:"ul",items:[],root:!1};var de=m({name:"OrgChartSubtree",defaultProps:F,setup(){return{orgchart:a()}},render(o){var r;let{props:t,ptmi:s,orgchart:e}=o,n=ie({role:"group",className:e==null?void 0:e.cx("subtree",{root:t.root})},e==null?void 0:e.ptm("subtree"),s("root"));return i.createElement(ae,{instance:o,attrs:n,children:e!=null&&e.props.children?t.children:i.createElement(i.Fragment,null,(r=t.items)==null?void 0:r.map(p=>i.createElement(U,{key:p.key,item:p},i.createElement(j,null,i.createElement(A,null),i.createElement(M,null)),p.children&&p.children.length>0&&!(e!=null&&e.isCollapsed(p))&&i.createElement(de,{items:p.children}))))})}});export{de as OrgChartSubtree,F as defaultSubtreeProps};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/orgchart/subtree/OrgChartSubtree.tsx","../../../src/base/index.ts","../../../src/orgchart/collapsebutton/OrgChartCollapseButton.tsx","../../../src/orgchart/OrgChart.context.ts","../../../src/orgchart/tree/OrgChartTree.context.ts","../../../src/orgchart/collapsebutton/OrgChartCollapseButton.props.ts","../../../src/orgchart/node/OrgChartNode.tsx","../../../src/orgchart/tree/OrgChartTree.tsx","../../../src/orgchart/tree/OrgChartTree.props.ts","../../../src/orgchart/node/OrgChartNode.props.ts","../../../src/orgchart/nodecontent/OrgChartNodeContent.tsx","../../../src/orgchart/nodecontent/OrgChartNodeContent.props.ts","../../../src/orgchart/subtree/OrgChartSubtree.props.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { OrgChartCollapseButton } from '../collapsebutton';\nimport { OrgChartNode } from '../node/OrgChartNode';\nimport { OrgChartNodeContent } from '../nodecontent';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { OrgChartTree } from '../tree/OrgChartTree';\nimport { defaultSubtreeProps } from './OrgChartSubtree.props';\n\nexport const OrgChartSubtree = withComponent({\n name: 'OrgChartSubtree',\n defaultProps: defaultSubtreeProps,\n setup() {\n const orgchart = useOrgChartContext();\n\n return { orgchart };\n },\n render(instance) {\n const { props, ptmi, orgchart } = instance;\n\n const rootProps = mergeProps(\n {\n role: 'group',\n className: orgchart?.cx('subtree', { root: props.root })\n },\n orgchart?.ptm('subtree'),\n ptmi('root')\n );\n\n return (\n <Component\n instance={instance}\n attrs={rootProps}\n children={\n orgchart?.props.children ? (\n props.children\n ) : (\n <>\n {props.items?.map((item) => (\n <OrgChartTree key={item.key} item={item}>\n <OrgChartNode>\n <OrgChartNodeContent />\n <OrgChartCollapseButton />\n </OrgChartNode>\n {item.children && item.children.length > 0 && !orgchart?.isCollapsed(item) && <OrgChartSubtree items={item.children} />}\n </OrgChartTree>\n ))}\n </>\n )\n }\n />\n );\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { ChevronDownIcon } from '@primereact/icons/chevrondown';\nimport { ChevronUpIcon } from '@primereact/icons/chevronup';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree/OrgChartTree.context';\nimport { defaultCollapseButtonProps } from './OrgChartCollapseButton.props';\n\nexport const OrgChartCollapseButton = withComponent({\n name: 'OrgChartCollapseButton',\n defaultProps: defaultCollapseButtonProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n\n const item = orgcharttree?.props.item;\n const itemKey = item?.key;\n const isCollapsed = orgchart?.isCollapsed(item);\n const isCollapsible = orgchart?.isCollapsible(item);\n\n const handleCollapseClick = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation();\n orgchart?.toggleNodeCollapse(itemKey);\n },\n [itemKey, orgchart]\n );\n\n const rootProps = mergeProps(\n {\n role: 'button',\n className: orgchart?.cx('collapseButton'),\n onClick: handleCollapseClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => orgchart?.handleCollapseKeyDown(event, itemKey)\n },\n orgchart?.ptm('collapseButton'),\n ptmi('root')\n );\n\n const createCollapseButtonDownIcon = () => {\n const iconProps = mergeProps(\n {\n className: orgchart?.cx('collapseButtonDownIcon')\n },\n orgchart?.ptm('collapseButtonDownIcon'),\n ptmi('root')\n );\n\n return <ChevronDownIcon {...iconProps} />;\n };\n\n const createCollapseButtonUpIcon = () => {\n const iconProps = mergeProps(\n {\n className: orgchart?.cx('collapseButtonUpIcon')\n },\n orgchart?.ptm('collapseButtonUpIcon'),\n ptmi('root')\n );\n\n return <ChevronUpIcon {...iconProps} />;\n };\n\n if (!isCollapsible) return null;\n\n return (\n <Component\n instance={instance}\n attrs={rootProps}\n children={\n props.children ??\n (isCollapsed ? (\n <>\n +{item?.children?.length}\n {createCollapseButtonDownIcon()}\n </>\n ) : (\n <>\n Collapse\n {createCollapseButtonUpIcon()}\n </>\n ))\n }\n />\n );\n }\n});\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartProvider, useOrgChartContext] = createOptionalContext<OrgChartInstance>();\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartTreeInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartTreeProvider, useOrgChartTreeContext] = createOptionalContext<OrgChartTreeInstance>();\n","import type { OrgChartCollapseButtonProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultCollapseButtonProps: OrgChartCollapseButtonProps = {\n as: 'button'\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { cn, mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree';\nimport { defaultNodeProps } from './OrgChartNode.props';\n\nexport const OrgChartNode = withComponent({\n name: 'OrgChartNode',\n defaultProps: defaultNodeProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n\n const item = orgcharttree?.props.item;\n\n const { className, style, onClick, ...restHtmlProps } = item?.htmlProps || {};\n\n const isSelectable = orgchart?.isSelectable(item);\n const isCollapsible = orgchart?.isCollapsible(item);\n const isCollapsed = orgchart?.isCollapsed(item);\n const isSelected = orgchart?.isSelected(item);\n\n const nodeKey = item?.key;\n\n const handleNodeClick = React.useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n if (isSelectable && nodeKey) {\n orgchart?.toggleNodeSelect(nodeKey);\n }\n\n onClick?.(event);\n },\n [isSelectable, nodeKey, orgchart, onClick]\n );\n\n const rootProps = mergeProps(\n {\n tabIndex: isSelectable ? 0 : -1,\n className: cn(orgchart?.cx('node'), className),\n style: { ...style, ...orgchart?.sx('node') },\n 'data-collapsible': isCollapsible,\n 'data-selectable': isSelectable,\n 'data-collapsed': isCollapsed,\n 'data-selected': isSelected,\n onClick: handleNodeClick,\n onKeyDown: (event: React.KeyboardEvent<HTMLDivElement>) => orgchart?.handleNodeKeyDown(event, nodeKey),\n ...restHtmlProps\n },\n orgchart?.ptm('node'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { OrgChartTreeProvider, useOrgChartTreeContext } from './OrgChartTree.context';\nimport { defaultTreeProps } from './OrgChartTree.props';\n\nexport const OrgChartTree = withComponent({\n name: 'OrgChartTree',\n defaultProps: defaultTreeProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n const level = orgcharttree?.level !== undefined ? orgcharttree.level + 1 : 0;\n\n return { orgchart, level };\n },\n render(instance) {\n const { props, ptmi, orgchart, level } = instance;\n\n const rootProps = mergeProps(\n {\n role: 'treeitem',\n className: orgchart?.cx('tree'),\n 'data-level': level,\n 'data-collapsed': orgchart?.isCollapsed(props.item),\n 'data-selected': orgchart?.isSelected(props.item),\n 'data-selectable': orgchart?.isSelectable(props.item),\n 'data-collapsible': orgchart?.isCollapsible(props.item),\n 'aria-level': level,\n 'aria-expanded': !orgchart?.isCollapsed(props.item),\n 'aria-selected': orgchart?.isSelected(props.item)\n },\n orgchart?.ptm('tree'),\n ptmi('root')\n );\n\n return (\n <OrgChartTreeProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </OrgChartTreeProvider>\n );\n }\n});\n","import type { OrgChartTreeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultTreeProps: OrgChartTreeProps = {\n as: 'li',\n item: undefined\n};\n","import type { OrgChartNodeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultNodeProps: OrgChartNodeProps = {\n as: 'div',\n item: undefined\n};\n","'use client';\nimport { Component } from '@primereact/core/component';\nimport { TreeNode } from '@primereact/types/shared/orgchart';\nimport { cn, mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { useOrgChartTreeContext } from '../tree/OrgChartTree.context';\nimport { defaultNodeContentProps } from './OrgChartNodeContent.props';\n\nexport const OrgChartNodeContent = withComponent({\n name: 'OrgChartNodeContent',\n defaultProps: defaultNodeContentProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n\n return { orgchart, orgcharttree };\n },\n render(instance) {\n const { props, ptmi, orgchart, orgcharttree } = instance;\n const item = orgcharttree?.props.item;\n const rootProps = mergeProps(\n {\n className: cn(orgchart?.cx('nodeContent'))\n },\n orgchart?.ptm('nodeContent'),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children ?? (typeof item?.render === 'function' ? item.render(item as TreeNode) : item?.render) ?? item?.label} />;\n }\n});\n","import type { OrgChartNodeContentProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultNodeContentProps: OrgChartNodeContentProps = {\n as: 'div'\n};\n","import type { OrgChartSubtreeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultSubtreeProps: OrgChartSubtreeProps = {\n as: 'ul',\n items: [],\n root: false\n};\n"],"mappings":"4lBACA,OAAS,aAAAA,OAAiB,6BAC1B,OAAS,cAAAC,OAAkB,kBCF3B,OAAS,iBAAiBC,MAA2B,6BACrD,OAAS,UAAUC,MAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,GADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,EAA4D,CAC/D,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,EDnBL,UAAYE,MAAW,QEHvB,OAAS,aAAAC,MAAiB,6BAC1B,OAAS,mBAAAC,MAAuB,gCAChC,OAAS,iBAAAC,OAAqB,8BAC9B,OAAS,cAAAC,MAAkB,kBAE3B,UAAYC,MAAW,QCNvB,OAAS,yBAAAC,MAA6B,yBAG/B,GAAM,CAACC,GAAkBC,CAAkB,EAAIF,EAAwC,ECH9F,OAAS,yBAAAG,MAA6B,yBAG/B,GAAM,CAACC,EAAsBC,CAAsB,EAAIF,EAA4C,ECDnG,IAAMG,EAA0D,CACnE,GAAI,QACR,EHOO,IAAMC,EAAyBC,EAAc,CAChD,KAAM,yBACN,aAAcC,EACd,OAAQ,CACJ,IAAMC,EAAWC,EAAmB,EAC9BC,EAAeC,EAAuB,EAE5C,MAAO,CAAE,SAAAH,EAAU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I,KAAM,QACN,UAAWF,GAAA,YAAAA,EAAU,GAAG,UAAW,CAAE,KAAMF,EAAM,IAAK,EAC1D,EACAE,GAAA,YAAAA,EAAU,IAAI,WACdD,EAAK,MAAM,CACf,EAEA,OACI,gBAACI,GAAA,CACG,SAAUP,EACV,MAAOK,EACP,SACID,GAAA,MAAAA,EAAU,MAAM,SACZF,EAAM,SAEN,iCACKD,EAAAC,EAAM,QAAN,YAAAD,EAAa,IAAKO,GACf,gBAACC,EAAA,CAAa,IAAKD,EAAK,IAAK,KAAMA,GAC/B,gBAACE,EAAA,KACG,gBAACC,EAAA,IAAoB,EACrB,gBAACC,EAAA,IAAuB,CAC5B,EACCJ,EAAK,UAAYA,EAAK,SAAS,OAAS,GAAK,EAACJ,GAAA,MAAAA,EAAU,YAAYI,KAAS,gBAACZ,GAAA,CAAgB,MAAOY,EAAK,SAAU,CACzH,EAER,EAGZ,CAER,CACJ,CAAC","names":["Component","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","Component","ChevronDownIcon","ChevronUpIcon","mergeProps","React","createOptionalContext","OrgChartProvider","useOrgChartContext","createOptionalContext","OrgChartTreeProvider","useOrgChartTreeContext","defaultCollapseButtonProps","OrgChartCollapseButton","withComponent","defaultCollapseButtonProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","_a","_b","props","ptmi","item","itemKey","isCollapsed","isCollapsible","handleCollapseClick","event","rootProps","mergeProps","createCollapseButtonDownIcon","iconProps","ChevronDownIcon","__spreadValues","createCollapseButtonUpIcon","ChevronUpIcon","Component","Component","cn","mergeProps","React","Component","mergeProps","React","defaultTreeProps","OrgChartTree","withComponent","defaultTreeProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","level","instance","props","ptmi","rootProps","mergeProps","OrgChartTreeProvider","Component","defaultNodeProps","OrgChartNode","withComponent","defaultNodeProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","props","ptmi","item","_a","className","style","onClick","restHtmlProps","__objRest","isSelectable","isCollapsible","isCollapsed","isSelected","nodeKey","handleNodeClick","event","rootProps","mergeProps","__spreadValues","cn","Component","Component","cn","mergeProps","React","defaultNodeContentProps","OrgChartNodeContent","withComponent","defaultNodeContentProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","instance","_a","_b","props","ptmi","item","rootProps","mergeProps","cn","Component","defaultSubtreeProps","OrgChartSubtree","withComponent","defaultSubtreeProps","useOrgChartContext","instance","_a","props","ptmi","orgchart","rootProps","mergeProps","Component","item","OrgChartTree","OrgChartNode","OrgChartNodeContent","OrgChartCollapseButton"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OrgChartTreeInstance } from '@primereact/types/shared/orgchart';
|
|
2
|
+
export declare const OrgChartTreeProvider: ({ value, children }: {
|
|
3
|
+
value: OrgChartTreeInstance;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}) => import("react").JSX.Element, useOrgChartTreeContext: () => OrgChartTreeInstance | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const OrgChartTree: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/orgchart").OrgChartTreeProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var O=Object.defineProperty,x=Object.defineProperties;var u=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var i=(r,e,o)=>e in r?O(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,m=(r,e)=>{for(var o in e||(e={}))P.call(e,o)&&i(r,o,e[o]);if(a)for(var o of a(e))h.call(e,o)&&i(r,o,e[o]);return r},l=(r,e)=>x(r,u(e));import{Component as I}from"@primereact/core/component";import{mergeProps as g}from"@primeuix/utils";import{withComponent as T}from"@primereact/core/component";import{styles as v}from"@primereact/styles/base";var C=({name:r="UnknownComponent",defaultProps:e,styles:o=l(m({},v),{name:"global"}),components:t,setup:s,render:p})=>T({name:r,defaultProps:e,styles:o,components:t,setup:s,render:p});import*as n from"react";import{createOptionalContext as w}from"@primereact/core/utils";var[N,d]=w();import{createOptionalContext as S}from"@primereact/core/utils";var[c,f]=S();var y={as:"li",item:void 0};var L=C({name:"OrgChartTree",defaultProps:y,setup(){let r=d(),e=f(),o=(e==null?void 0:e.level)!==void 0?e.level+1:0;return{orgchart:r,level:o}},render(r){let{props:e,ptmi:o,orgchart:t,level:s}=r,p=g({role:"treeitem",className:t==null?void 0:t.cx("tree"),"data-level":s,"data-collapsed":t==null?void 0:t.isCollapsed(e.item),"data-selected":t==null?void 0:t.isSelected(e.item),"data-selectable":t==null?void 0:t.isSelectable(e.item),"data-collapsible":t==null?void 0:t.isCollapsible(e.item),"aria-level":s,"aria-expanded":!(t!=null&&t.isCollapsed(e.item)),"aria-selected":t==null?void 0:t.isSelected(e.item)},t==null?void 0:t.ptm("tree"),o("root"));return n.createElement(c,{value:r},n.createElement(I,{instance:r,attrs:p,children:e.children}))}});export{L as OrgChartTree,c as OrgChartTreeProvider,y as defaultTreeProps,f as useOrgChartTreeContext};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/orgchart/tree/OrgChartTree.tsx","../../../src/base/index.ts","../../../src/orgchart/OrgChart.context.ts","../../../src/orgchart/tree/OrgChartTree.context.ts","../../../src/orgchart/tree/OrgChartTree.props.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { useOrgChartContext } from '../OrgChart.context';\nimport { OrgChartTreeProvider, useOrgChartTreeContext } from './OrgChartTree.context';\nimport { defaultTreeProps } from './OrgChartTree.props';\n\nexport const OrgChartTree = withComponent({\n name: 'OrgChartTree',\n defaultProps: defaultTreeProps,\n setup() {\n const orgchart = useOrgChartContext();\n const orgcharttree = useOrgChartTreeContext();\n const level = orgcharttree?.level !== undefined ? orgcharttree.level + 1 : 0;\n\n return { orgchart, level };\n },\n render(instance) {\n const { props, ptmi, orgchart, level } = instance;\n\n const rootProps = mergeProps(\n {\n role: 'treeitem',\n className: orgchart?.cx('tree'),\n 'data-level': level,\n 'data-collapsed': orgchart?.isCollapsed(props.item),\n 'data-selected': orgchart?.isSelected(props.item),\n 'data-selectable': orgchart?.isSelectable(props.item),\n 'data-collapsible': orgchart?.isCollapsible(props.item),\n 'aria-level': level,\n 'aria-expanded': !orgchart?.isCollapsed(props.item),\n 'aria-selected': orgchart?.isSelected(props.item)\n },\n orgchart?.ptm('tree'),\n ptmi('root')\n );\n\n return (\n <OrgChartTreeProvider value={instance}>\n <Component instance={instance} attrs={rootProps} children={props.children} />\n </OrgChartTreeProvider>\n );\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartProvider, useOrgChartContext] = createOptionalContext<OrgChartInstance>();\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OrgChartTreeInstance } from '@primereact/types/shared/orgchart';\n\nexport const [OrgChartTreeProvider, useOrgChartTreeContext] = createOptionalContext<OrgChartTreeInstance>();\n","import type { OrgChartTreeProps } from '@primereact/types/shared/orgchart';\n\nexport const defaultTreeProps: OrgChartTreeProps = {\n as: 'li',\n item: undefined\n};\n"],"mappings":"0bACA,OAAS,aAAAA,MAAiB,6BAC1B,OAAS,cAAAC,MAAkB,kBCF3B,OAAS,iBAAiBC,MAA2B,6BACrD,OAAS,UAAUC,MAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,GADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,EAA4D,CAC/D,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,EDnBL,UAAYE,MAAW,QEJvB,OAAS,yBAAAC,MAA6B,yBAG/B,GAAM,CAACC,EAAkBC,CAAkB,EAAIF,EAAwC,ECH9F,OAAS,yBAAAG,MAA6B,yBAG/B,GAAM,CAACC,EAAsBC,CAAsB,EAAIF,EAA4C,ECDnG,IAAMG,EAAsC,CAC/C,GAAI,KACJ,KAAM,MACV,EJIO,IAAMC,EAAeC,EAAc,CACtC,KAAM,eACN,aAAcC,EACd,OAAQ,CACJ,IAAMC,EAAWC,EAAmB,EAC9BC,EAAeC,EAAuB,EACtCC,GAAQF,GAAA,YAAAA,EAAc,SAAU,OAAYA,EAAa,MAAQ,EAAI,EAE3E,MAAO,CAAE,SAAAF,EAAU,MAAAI,CAAM,CAC7B,EACA,OAAOC,EAAU,CACb,GAAM,CAAE,MAAAC,EAAO,KAAAC,EAAM,SAAAP,EAAU,MAAAI,CAAM,EAAIC,EAEnCG,EAAYC,EACd,CACI,KAAM,WACN,UAAWT,GAAA,YAAAA,EAAU,GAAG,QACxB,aAAcI,EACd,iBAAkBJ,GAAA,YAAAA,EAAU,YAAYM,EAAM,MAC9C,gBAAiBN,GAAA,YAAAA,EAAU,WAAWM,EAAM,MAC5C,kBAAmBN,GAAA,YAAAA,EAAU,aAAaM,EAAM,MAChD,mBAAoBN,GAAA,YAAAA,EAAU,cAAcM,EAAM,MAClD,aAAcF,EACd,gBAAiB,EAACJ,GAAA,MAAAA,EAAU,YAAYM,EAAM,OAC9C,gBAAiBN,GAAA,YAAAA,EAAU,WAAWM,EAAM,KAChD,EACAN,GAAA,YAAAA,EAAU,IAAI,QACdO,EAAK,MAAM,CACf,EAEA,OACI,gBAACG,EAAA,CAAqB,MAAOL,GACzB,gBAACM,EAAA,CAAU,SAAUN,EAAU,MAAOG,EAAW,SAAUF,EAAM,SAAU,CAC/E,CAER,CACJ,CAAC","names":["Component","mergeProps","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","createOptionalContext","OrgChartProvider","useOrgChartContext","createOptionalContext","OrgChartTreeProvider","useOrgChartTreeContext","defaultTreeProps","OrgChartTree","withComponent","defaultTreeProps","orgchart","useOrgChartContext","orgcharttree","useOrgChartTreeContext","level","instance","props","ptmi","rootProps","mergeProps","OrgChartTreeProvider","Component"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OverlayInstance } from '@primereact/types/shared/overlay';
|
|
2
|
+
export declare const OverlayProvider: ({ value, children }: {
|
|
3
|
+
value: OverlayInstance;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}) => import("react").JSX.Element, useOverlayContext: () => OverlayInstance | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const Overlay: (<I extends import("@primereact/types/core").ComponentInstance, T extends React.ElementType>(inProps?: (import("@primereact/types/core").GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<import("@primereact/types/shared").ExtractProps<T>, keyof import("@primereact/types/core").GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & import("@primereact/types/shared/overlay").OverlayProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
|
|
File without changes
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";var I=Object.defineProperty,E=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var y=(o,e,r)=>e in o?I(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,p=(o,e)=>{for(var r in e||(e={}))b.call(e,r)&&y(o,r,e[r]);if(i)for(var r of i(e))k.call(e,r)&&y(o,r,e[r]);return o},n=(o,e)=>E(o,R(e));import{Motion as q}from"@primereact/core/motion";import{useOverlay as N}from"@primereact/headless/overlay";import{mergeProps as U,resolve as j}from"@primeuix/utils";import{withComponent as T}from"@primereact/core/component";import{styles as g}from"@primereact/styles/base";var m=({name:o="UnknownComponent",defaultProps:e,styles:r=n(p({},g),{name:"global"}),components:a,setup:t,render:s})=>T({name:o,defaultProps:e,styles:r,components:a,setup:t,render:s});import{usePortal as A}from"@primereact/headless/portal";import{resolve as H}from"@primeuix/utils";import{createPortal as K}from"react-dom";import*as f from"@primereact/headless/portal";var c=n(p({},f.defaultProps),{element:void 0,appendTo:"body"});var d=m({name:"Portal",defaultProps:c,setup(o){return A(o.inProps)},render(o){let{props:e,mountedState:r}=o,a=e.element||e.children;if(!a||!r)return null;let t=H(e.appendTo,o);if(t==="self")return a;let s=t?typeof t=="string"?document.querySelector(t)||document.body:t:document.body;return K(a,s)}});import{createOptionalContext as L}from"@primereact/core/utils";var[eo,ro]=L();import*as l from"react";import{createOptionalContext as M}from"@primereact/core/utils";var[P,lo]=M();import*as u from"@primereact/headless/overlay";var v=n(p({},u.defaultProps),{as:"div"});var ho=m({name:"Overlay",defaultProps:v,setup:o=>N(o==null?void 0:o.inProps),render:o=>{let{id:e,props:r,ptmi:a,state:t,containerRef:s,onOverlayEnter:O,onOverlayAfterEnter:x,onLeave:C,onAfterLeave:h,onOverlayClick:w,onOverlayKeyDown:S}=o,D=U({id:e,in:t.visible,name:"p-connected-overlay",onEnter:O,onAfterEnter:x,onLeave:C,onAfterLeave:h,onClick:w,onKeyDown:S,appear:!0},a("root"));return l.createElement(P,{value:o},l.createElement(d,{appendTo:r.appendTo},l.createElement(q,n(p({},D),{ref:s}),j(r.children,o))))}});export{ho as Overlay,P as OverlayProvider,v as defaultProps,lo as useOverlayContext};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/overlay/Overlay.tsx","../../src/base/index.ts","../../src/portal/Portal.tsx","../../src/portal/Portal.props.ts","../../src/portal/Portal.context.ts","../../src/overlay/Overlay.context.ts","../../src/overlay/Overlay.props.ts"],"sourcesContent":["'use client';\nimport { Motion } from '@primereact/core/motion';\nimport { useOverlay } from '@primereact/headless/overlay';\nimport { mergeProps, resolve } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { Portal } from 'primereact/portal';\nimport * as React from 'react';\nimport { OverlayProvider } from './Overlay.context';\nimport { defaultProps } from './Overlay.props';\n\nexport const Overlay = withComponent({\n name: 'Overlay',\n defaultProps,\n setup: (instance) => {\n const overlay = useOverlay(instance?.inProps);\n\n return overlay;\n },\n render: (instance) => {\n const { id, props, ptmi, state, containerRef, onOverlayEnter, onOverlayAfterEnter, onLeave, onAfterLeave, onOverlayClick, onOverlayKeyDown } = instance;\n\n const containerProps = mergeProps(\n {\n id,\n in: state.visible,\n name: 'p-connected-overlay',\n onEnter: onOverlayEnter,\n onAfterEnter: onOverlayAfterEnter,\n onLeave: onLeave,\n onAfterLeave: onAfterLeave,\n onClick: onOverlayClick,\n onKeyDown: onOverlayKeyDown,\n appear: true\n },\n ptmi('root')\n );\n\n return (\n <OverlayProvider value={instance}>\n <Portal appendTo={props.appendTo}>\n <Motion {...containerProps} ref={containerRef}>\n {resolve(props.children, instance)}\n </Motion>\n </Portal>\n </OverlayProvider>\n );\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","'use client';\nimport { usePortal } from '@primereact/headless/portal';\nimport { PortalProps } from '@primereact/types/shared/portal';\nimport { resolve } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport { createPortal } from 'react-dom';\nimport { defaultProps } from './Portal.props';\n\nexport const Portal = withComponent({\n name: 'Portal',\n defaultProps,\n setup(instance) {\n const portal = usePortal(instance.inProps);\n\n return portal;\n },\n render(instance) {\n const { props, mountedState } = instance;\n const element = props.element || (props.children as React.ReactNode);\n\n if (!element || !mountedState) {\n return null;\n }\n\n const appendTo = resolve(props.appendTo, instance) as PortalProps['appendTo'];\n\n if (appendTo === 'self') {\n return element;\n }\n\n const container = !appendTo ? document.body : typeof appendTo === 'string' ? document.querySelector(appendTo) || document.body : appendTo;\n\n return createPortal(element, container);\n }\n});\n","import * as HeadlessPortal from '@primereact/headless/portal';\nimport type { PortalProps } from '@primereact/types/shared/portal';\n\nexport const defaultProps: PortalProps = {\n ...HeadlessPortal.defaultProps,\n element: undefined,\n appendTo: 'body'\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { PortalInstance } from '@primereact/types/shared/portal';\n\nexport const [PortalProvider, usePortalContext] = createOptionalContext<PortalInstance>();\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { OverlayInstance } from '@primereact/types/shared/overlay';\n\nexport const [OverlayProvider, useOverlayContext] = createOptionalContext<OverlayInstance>();\n","import * as HeadlessOverlay from '@primereact/headless/overlay';\nimport type { OverlayProps } from '@primereact/types/shared/overlay';\n\nexport const defaultProps: OverlayProps = {\n ...HeadlessOverlay.defaultProps,\n as: 'div'\n};\n"],"mappings":"0bACA,OAAS,UAAAA,MAAc,0BACvB,OAAS,cAAAC,MAAkB,+BAC3B,OAAS,cAAAC,EAAY,WAAAC,MAAe,kBCHpC,OAAS,iBAAiBC,MAA2B,6BACrD,OAAS,UAAUC,MAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,GADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,EAA4D,CAC/D,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,ECtBL,OAAS,aAAAE,MAAiB,8BAE1B,OAAS,WAAAC,MAAe,kBAExB,OAAS,gBAAAC,MAAoB,YCL7B,UAAYC,MAAoB,8BAGzB,IAAMC,EAA4BC,EAAAC,EAAA,GACnB,gBADmB,CAErC,QAAS,OACT,SAAU,MACd,GDCO,IAAMC,EAASC,EAAc,CAChC,KAAM,SACN,aAAAC,EACA,MAAMC,EAAU,CAGZ,OAFeC,EAAUD,EAAS,OAAO,CAG7C,EACA,OAAOA,EAAU,CACb,GAAM,CAAE,MAAAE,EAAO,aAAAC,CAAa,EAAIH,EAC1BI,EAAUF,EAAM,SAAYA,EAAM,SAExC,G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","useOverlay","mergeProps","resolve","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","usePortal","resolve","createPortal","HeadlessPortal","defaultProps","__spreadProps","__spreadValues","Portal","withComponent","defaultProps","instance","usePortal","props","mountedState","element","appendTo","resolve","container","createPortal","createOptionalContext","PortalProvider","usePortalContext","React","createOptionalContext","OverlayProvider","useOverlayContext","HeadlessOverlay","defaultProps","__spreadProps","__spreadValues","Overlay","withComponent","defaultProps","instance","useOverlay","id","props","ptmi","state","containerRef","onOverlayEnter","onOverlayAfterEnter","onLeave","onAfterLeave","onOverlayClick","onOverlayKeyDown","containerProps","mergeProps","OverlayProvider","Portal","Motion","__spreadProps","__spreadValues","resolve"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primereact",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.8",
|
|
4
4
|
"author": "PrimeTek Informatics",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://primereact.org/",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@primeuix/styled": "^0.7.4",
|
|
36
|
-
"@primeuix/styles": "^1
|
|
37
|
-
"@primeuix/utils": "^0.6.
|
|
38
|
-
"@primeuix/motion": "^0.0.
|
|
39
|
-
"@primereact/headless": "11.0.0-alpha.
|
|
40
|
-
"@primereact/
|
|
41
|
-
"@primereact/
|
|
42
|
-
"@primereact/styles": "11.0.0-alpha.
|
|
36
|
+
"@primeuix/styles": "^1",
|
|
37
|
+
"@primeuix/utils": "^0.6.2",
|
|
38
|
+
"@primeuix/motion": "^0.0.10",
|
|
39
|
+
"@primereact/headless": "11.0.0-alpha.8",
|
|
40
|
+
"@primereact/icons": "11.0.0-alpha.8",
|
|
41
|
+
"@primereact/hooks": "11.0.0-alpha.8",
|
|
42
|
+
"@primereact/styles": "11.0.0-alpha.8"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PasswordInstance } from '@primereact/types/shared/password';
|
|
2
|
+
export declare const PasswordProvider: ({ value, children }: {
|
|
3
|
+
value: PasswordInstance;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}) => import("react").JSX.Element, usePasswordContext: () => PasswordInstance | undefined;
|