@orcado/yoyui 0.0.1
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/.eslintignore +1 -0
- package/.eslintrc.json +273 -0
- package/.gitattributes +1 -0
- package/.prettierignore +9 -0
- package/.prettierrc.json +10 -0
- package/CHANGELOG.md +1142 -0
- package/CHANGELOG_ARCHIVE.md +3641 -0
- package/CODE_OF_CONDUCT.md +35 -0
- package/CODING_STANDARDS.md +265 -0
- package/CONTRIBUTING.md +39 -0
- package/DEVELOPMENT.md +94 -0
- package/LICENSE.md +22 -0
- package/README.md +23 -0
- package/api-scripts/build-apidoc.js +441 -0
- package/api-scripts/build-webtypes.js +435 -0
- package/api-scripts/tsconfig.json +20 -0
- package/components/analytics/analytics.js +44 -0
- package/components/demo/DeferredDemo.js +50 -0
- package/components/doc/accessibility/colorsdoc.js +47 -0
- package/components/doc/accessibility/formcontrolsdoc.js +47 -0
- package/components/doc/accessibility/introductiondoc.js +56 -0
- package/components/doc/accessibility/semantichtmldoc.js +56 -0
- package/components/doc/accessibility/waiariadoc.js +81 -0
- package/components/doc/accessibility/wcagdoc.js +26 -0
- package/components/doc/accordion/accessibilitydoc.js +78 -0
- package/components/doc/accordion/basicdoc.js +144 -0
- package/components/doc/accordion/controlleddoc.js +177 -0
- package/components/doc/accordion/disableddoc.js +148 -0
- package/components/doc/accordion/dynamicdoc.js +123 -0
- package/components/doc/accordion/importdoc.js +17 -0
- package/components/doc/accordion/multipledoc.js +144 -0
- package/components/doc/accordion/pt/wireframe.js +12 -0
- package/components/doc/accordion/styledoc.js +38 -0
- package/components/doc/accordion/templatedoc.js +246 -0
- package/components/doc/accordion/theming/styleddoc.js +35 -0
- package/components/doc/accordion/theming/tailwinddoc.js +111 -0
- package/components/doc/autocomplete/accessibilitydoc.js +150 -0
- package/components/doc/autocomplete/basicdoc.js +71 -0
- package/components/doc/autocomplete/disableddoc.js +49 -0
- package/components/doc/autocomplete/dropdowndoc.js +76 -0
- package/components/doc/autocomplete/filleddoc.js +71 -0
- package/components/doc/autocomplete/floatlabeldoc.js +81 -0
- package/components/doc/autocomplete/forceselectiondoc.js +72 -0
- package/components/doc/autocomplete/groupdoc.js +276 -0
- package/components/doc/autocomplete/importdoc.js +17 -0
- package/components/doc/autocomplete/invaliddoc.js +71 -0
- package/components/doc/autocomplete/multipledoc.js +145 -0
- package/components/doc/autocomplete/objectsdoc.js +142 -0
- package/components/doc/autocomplete/pt/wireframe.js +12 -0
- package/components/doc/autocomplete/styledoc.js +54 -0
- package/components/doc/autocomplete/templatedoc.js +250 -0
- package/components/doc/autocomplete/theming/styleddoc.js +51 -0
- package/components/doc/autocomplete/theming/tailwinddoc.js +118 -0
- package/components/doc/autocomplete/virtualscrolldoc.js +114 -0
- package/components/doc/avatar/accessibilitydoc.js +17 -0
- package/components/doc/avatar/groupdoc.js +83 -0
- package/components/doc/avatar/icondoc.js +125 -0
- package/components/doc/avatar/imagedoc.js +117 -0
- package/components/doc/avatar/importdoc.js +18 -0
- package/components/doc/avatar/labeldoc.js +120 -0
- package/components/doc/avatar/pt/wireframe.js +12 -0
- package/components/doc/avatar/styledoc.js +58 -0
- package/components/doc/avatar/theming/styleddoc.js +55 -0
- package/components/doc/avatar/theming/tailwinddoc.js +99 -0
- package/components/doc/badge/accessibilitydoc.js +16 -0
- package/components/doc/badge/basicdoc.js +49 -0
- package/components/doc/badge/buttondoc.js +70 -0
- package/components/doc/badge/importdoc.js +17 -0
- package/components/doc/badge/positiondoc.js +81 -0
- package/components/doc/badge/pt/wireframe.js +12 -0
- package/components/doc/badge/severitydoc.js +73 -0
- package/components/doc/badge/sizedoc.js +57 -0
- package/components/doc/badge/styledoc.js +62 -0
- package/components/doc/badge/theming/styleddoc.js +59 -0
- package/components/doc/badge/theming/tailwinddoc.js +79 -0
- package/components/doc/blockui/accessibilitydoc.js +17 -0
- package/components/doc/blockui/basicdoc.js +110 -0
- package/components/doc/blockui/documentdoc.js +89 -0
- package/components/doc/blockui/importdoc.js +17 -0
- package/components/doc/blockui/pt/wireframe.js +12 -0
- package/components/doc/blockui/styledoc.js +34 -0
- package/components/doc/blockui/templatedoc.js +113 -0
- package/components/doc/blockui/theming/styleddoc.js +31 -0
- package/components/doc/blockui/theming/tailwinddoc.js +61 -0
- package/components/doc/bootstrap/exampledoc.js +18 -0
- package/components/doc/bootstrap/setupdoc.js +18 -0
- package/components/doc/breadcrumb/accessibilitydoc.js +17 -0
- package/components/doc/breadcrumb/basicdoc.js +55 -0
- package/components/doc/breadcrumb/importdoc.js +17 -0
- package/components/doc/breadcrumb/pt/wireframe.js +12 -0
- package/components/doc/breadcrumb/routerdoc.js +81 -0
- package/components/doc/breadcrumb/styledoc.js +42 -0
- package/components/doc/breadcrumb/templatedoc.js +100 -0
- package/components/doc/breadcrumb/theming/styleddoc.js +39 -0
- package/components/doc/breadcrumb/theming/tailwinddoc.js +61 -0
- package/components/doc/bulma/exampledoc.js +14 -0
- package/components/doc/bulma/setupdoc.js +13 -0
- package/components/doc/button/accessibilitydoc.js +61 -0
- package/components/doc/button/badgesdoc.js +53 -0
- package/components/doc/button/basicdoc.js +49 -0
- package/components/doc/button/buttongroupdoc.js +68 -0
- package/components/doc/button/disableddoc.js +49 -0
- package/components/doc/button/icononlydoc.js +229 -0
- package/components/doc/button/iconsdoc.js +57 -0
- package/components/doc/button/importdoc.js +17 -0
- package/components/doc/button/linkdoc.js +62 -0
- package/components/doc/button/loadingdoc.js +80 -0
- package/components/doc/button/outlineddoc.js +71 -0
- package/components/doc/button/pt/wireframe.js +12 -0
- package/components/doc/button/raiseddoc.js +71 -0
- package/components/doc/button/raisedtextdoc.js +72 -0
- package/components/doc/button/roundeddoc.js +71 -0
- package/components/doc/button/severitydoc.js +71 -0
- package/components/doc/button/sizesdoc.js +57 -0
- package/components/doc/button/styledoc.js +38 -0
- package/components/doc/button/templatedoc.js +55 -0
- package/components/doc/button/textdoc.js +72 -0
- package/components/doc/button/theming/styleddoc.js +35 -0
- package/components/doc/button/theming/tailwinddoc.js +149 -0
- package/components/doc/calendar/accessibilitydoc.js +251 -0
- package/components/doc/calendar/basicdoc.js +69 -0
- package/components/doc/calendar/buttonbardoc.js +57 -0
- package/components/doc/calendar/datetemplatedoc.js +85 -0
- package/components/doc/calendar/disableddoc.js +49 -0
- package/components/doc/calendar/filleddoc.js +57 -0
- package/components/doc/calendar/floatlabeldoc.js +73 -0
- package/components/doc/calendar/formatdoc.js +110 -0
- package/components/doc/calendar/icondoc.js +114 -0
- package/components/doc/calendar/importdoc.js +17 -0
- package/components/doc/calendar/inlinedoc.js +59 -0
- package/components/doc/calendar/invaliddoc.js +49 -0
- package/components/doc/calendar/localedoc.js +98 -0
- package/components/doc/calendar/minmaxdoc.js +111 -0
- package/components/doc/calendar/monthpickerdoc.js +57 -0
- package/components/doc/calendar/multipledoc.js +57 -0
- package/components/doc/calendar/multiplemonthsdoc.js +57 -0
- package/components/doc/calendar/pt/wireframe.js +12 -0
- package/components/doc/calendar/rangedoc.js +58 -0
- package/components/doc/calendar/styledoc.js +74 -0
- package/components/doc/calendar/theming/styleddoc.js +71 -0
- package/components/doc/calendar/theming/tailwinddoc.js +176 -0
- package/components/doc/calendar/timedoc.js +116 -0
- package/components/doc/calendar/touchuidoc.js +57 -0
- package/components/doc/calendar/yearpickerdoc.js +57 -0
- package/components/doc/captcha/accessibilitydoc.js +15 -0
- package/components/doc/captcha/captchadoc.js +73 -0
- package/components/doc/captcha/importdoc.js +17 -0
- package/components/doc/card/accessibilitydoc.js +31 -0
- package/components/doc/card/advanceddoc.js +99 -0
- package/components/doc/card/basicdoc.js +69 -0
- package/components/doc/card/importdoc.js +17 -0
- package/components/doc/card/pt/wireframe.js +12 -0
- package/components/doc/card/styledoc.js +46 -0
- package/components/doc/card/theming/styleddoc.js +43 -0
- package/components/doc/card/theming/tailwinddoc.js +75 -0
- package/components/doc/carousel/accessibilitydoc.js +116 -0
- package/components/doc/carousel/basicdoc.js +275 -0
- package/components/doc/carousel/circulardoc.js +280 -0
- package/components/doc/carousel/importdoc.js +17 -0
- package/components/doc/carousel/numscrolldoc.js +277 -0
- package/components/doc/carousel/pt/wireframe.js +12 -0
- package/components/doc/carousel/responsivedoc.js +279 -0
- package/components/doc/carousel/styledoc.js +55 -0
- package/components/doc/carousel/theming/styleddoc.js +55 -0
- package/components/doc/carousel/theming/tailwinddoc.js +138 -0
- package/components/doc/carousel/verticaldoc.js +213 -0
- package/components/doc/cascadeselect/accessibilitydoc.js +133 -0
- package/components/doc/cascadeselect/basicdoc.js +316 -0
- package/components/doc/cascadeselect/clearicondoc.js +316 -0
- package/components/doc/cascadeselect/disableddoc.js +49 -0
- package/components/doc/cascadeselect/filleddoc.js +316 -0
- package/components/doc/cascadeselect/floatlabeldoc.js +331 -0
- package/components/doc/cascadeselect/importdoc.js +17 -0
- package/components/doc/cascadeselect/invaliddoc.js +316 -0
- package/components/doc/cascadeselect/loadingdoc.js +50 -0
- package/components/doc/cascadeselect/pt/wireframe.js +12 -0
- package/components/doc/cascadeselect/styledoc.js +54 -0
- package/components/doc/cascadeselect/templatedoc.js +350 -0
- package/components/doc/cascadeselect/theming/styleddoc.js +51 -0
- package/components/doc/cascadeselect/theming/tailwinddoc.js +162 -0
- package/components/doc/chart/accessibilitydoc.js +29 -0
- package/components/doc/chart/basicdoc.js +155 -0
- package/components/doc/chart/chartjsdoc.js +21 -0
- package/components/doc/chart/combodoc.js +260 -0
- package/components/doc/chart/doughnutdoc.js +133 -0
- package/components/doc/chart/horizontalbardoc.js +245 -0
- package/components/doc/chart/importdoc.js +17 -0
- package/components/doc/chart/linedoc.js +231 -0
- package/components/doc/chart/linestylesdoc.js +258 -0
- package/components/doc/chart/multiaxisdoc.js +287 -0
- package/components/doc/chart/piechartdoc.js +151 -0
- package/components/doc/chart/polarareadoc.js +180 -0
- package/components/doc/chart/pt/wireframe.js +12 -0
- package/components/doc/chart/radardoc.js +201 -0
- package/components/doc/chart/stackedbardoc.js +263 -0
- package/components/doc/chart/theming/styleddoc.js +27 -0
- package/components/doc/chart/theming/tailwinddoc.js +82 -0
- package/components/doc/chart/verticalbardoc.js +240 -0
- package/components/doc/checkbox/accessibilitydoc.js +54 -0
- package/components/doc/checkbox/basicdoc.js +56 -0
- package/components/doc/checkbox/disableddoc.js +49 -0
- package/components/doc/checkbox/dynamicdoc.js +151 -0
- package/components/doc/checkbox/filleddoc.js +56 -0
- package/components/doc/checkbox/groupdoc.js +158 -0
- package/components/doc/checkbox/importdoc.js +17 -0
- package/components/doc/checkbox/invaliddoc.js +56 -0
- package/components/doc/checkbox/pt/wireframe.js +12 -0
- package/components/doc/checkbox/styledoc.js +38 -0
- package/components/doc/checkbox/theming/styleddoc.js +35 -0
- package/components/doc/checkbox/theming/tailwinddoc.js +66 -0
- package/components/doc/chip/accessibilitydoc.js +40 -0
- package/components/doc/chip/basicdoc.js +61 -0
- package/components/doc/chip/icondoc.js +61 -0
- package/components/doc/chip/imagedoc.js +61 -0
- package/components/doc/chip/importdoc.js +17 -0
- package/components/doc/chip/pt/wireframe.js +12 -0
- package/components/doc/chip/styledoc.js +42 -0
- package/components/doc/chip/templatedoc.js +70 -0
- package/components/doc/chip/theming/styleddoc.js +39 -0
- package/components/doc/chip/theming/tailwinddoc.js +57 -0
- package/components/doc/chips/accessibilitydoc.js +98 -0
- package/components/doc/chips/basicdoc.js +56 -0
- package/components/doc/chips/disableddoc.js +49 -0
- package/components/doc/chips/filleddoc.js +56 -0
- package/components/doc/chips/floatlabeldoc.js +72 -0
- package/components/doc/chips/importdoc.js +17 -0
- package/components/doc/chips/invaliddoc.js +56 -0
- package/components/doc/chips/keyfilterdoc.js +57 -0
- package/components/doc/chips/pt/wireframe.js +12 -0
- package/components/doc/chips/separatordoc.js +56 -0
- package/components/doc/chips/styledoc.js +47 -0
- package/components/doc/chips/templatedoc.js +81 -0
- package/components/doc/chips/theming/styleddoc.js +43 -0
- package/components/doc/chips/theming/tailwinddoc.js +68 -0
- package/components/doc/colorpicker/accessibilitydoc.js +114 -0
- package/components/doc/colorpicker/basicdoc.js +57 -0
- package/components/doc/colorpicker/disableddoc.js +49 -0
- package/components/doc/colorpicker/formatdoc.js +136 -0
- package/components/doc/colorpicker/importdoc.js +17 -0
- package/components/doc/colorpicker/inlinedoc.js +56 -0
- package/components/doc/colorpicker/pt/wireframe.js +12 -0
- package/components/doc/colorpicker/styledoc.js +63 -0
- package/components/doc/colorpicker/theming/styleddoc.js +63 -0
- package/components/doc/colorpicker/theming/tailwinddoc.js +87 -0
- package/components/doc/colors/overviewdoc.js +87 -0
- package/components/doc/colors/palettedoc.js +36 -0
- package/components/doc/colors/surfacesdoc.js +60 -0
- package/components/doc/common/apidoc/index.json +58456 -0
- package/components/doc/common/codeeditor/index.js +102 -0
- package/components/doc/common/codeeditor/services.js +11108 -0
- package/components/doc/common/codeeditor/templates.js +1100 -0
- package/components/doc/common/codehighlight.js +18 -0
- package/components/doc/common/developmentsection.js +13 -0
- package/components/doc/common/docapisection.js +330 -0
- package/components/doc/common/docapitable.js +181 -0
- package/components/doc/common/doccomponent.js +137 -0
- package/components/doc/common/docsectioncode.js +135 -0
- package/components/doc/common/docsectionnav.js +151 -0
- package/components/doc/common/docsections.js +75 -0
- package/components/doc/common/docsectiontext.js +41 -0
- package/components/doc/common/docsubsection.js +18 -0
- package/components/doc/configuration/appendtodoc.js +36 -0
- package/components/doc/configuration/csstransitiondoc.js +35 -0
- package/components/doc/configuration/filtermatchmodedoc.js +37 -0
- package/components/doc/configuration/hideoverlaysdoc.js +44 -0
- package/components/doc/configuration/inputstyledoc.js +38 -0
- package/components/doc/configuration/locale/addlocaledoc.js +31 -0
- package/components/doc/configuration/locale/importdoc.js +22 -0
- package/components/doc/configuration/locale/repositorydoc.js +14 -0
- package/components/doc/configuration/locale/setlocaledoc.js +21 -0
- package/components/doc/configuration/locale/setuplocaledoc.js +61 -0
- package/components/doc/configuration/noncedoc.js +35 -0
- package/components/doc/configuration/nullsortorderdoc.js +36 -0
- package/components/doc/configuration/rippledoc.js +33 -0
- package/components/doc/configuration/stylecontainer.js +39 -0
- package/components/doc/configuration/zindexdoc.js +47 -0
- package/components/doc/confirmdialog/accessibilitydoc.js +110 -0
- package/components/doc/confirmdialog/basicdoc.js +170 -0
- package/components/doc/confirmdialog/declarativedoc.js +104 -0
- package/components/doc/confirmdialog/headlessdoc.js +272 -0
- package/components/doc/confirmdialog/importdoc.js +18 -0
- package/components/doc/confirmdialog/positiondoc.js +179 -0
- package/components/doc/confirmdialog/pt/wireframe.js +12 -0
- package/components/doc/confirmdialog/responsivedoc.js +146 -0
- package/components/doc/confirmdialog/styledoc.js +30 -0
- package/components/doc/confirmdialog/templatedoc.js +143 -0
- package/components/doc/confirmdialog/theming/styleddoc.js +27 -0
- package/components/doc/confirmdialog/theming/tailwinddoc.js +95 -0
- package/components/doc/confirmpopup/accessibilitydoc.js +79 -0
- package/components/doc/confirmpopup/basicdoc.js +173 -0
- package/components/doc/confirmpopup/declarativedoc.js +107 -0
- package/components/doc/confirmpopup/headlessdoc.js +240 -0
- package/components/doc/confirmpopup/importdoc.js +18 -0
- package/components/doc/confirmpopup/pt/wireframe.js +12 -0
- package/components/doc/confirmpopup/styledoc.js +46 -0
- package/components/doc/confirmpopup/templatedoc.js +158 -0
- package/components/doc/confirmpopup/theming/styleddoc.js +43 -0
- package/components/doc/confirmpopup/theming/tailwinddoc.js +104 -0
- package/components/doc/contextmenu/accessibilitydoc.js +89 -0
- package/components/doc/contextmenu/basicdoc.js +73 -0
- package/components/doc/contextmenu/commanddoc.js +328 -0
- package/components/doc/contextmenu/datatabledoc.js +14 -0
- package/components/doc/contextmenu/documentdoc.js +135 -0
- package/components/doc/contextmenu/importdoc.js +17 -0
- package/components/doc/contextmenu/pt/wireframe.js +12 -0
- package/components/doc/contextmenu/routerdoc.js +142 -0
- package/components/doc/contextmenu/styledoc.js +50 -0
- package/components/doc/contextmenu/templatedoc.js +301 -0
- package/components/doc/contextmenu/theming/styleddoc.js +50 -0
- package/components/doc/contextmenu/theming/tailwinddoc.js +78 -0
- package/components/doc/contribution/benefitsdoc.js +14 -0
- package/components/doc/contribution/cladoc.js +9 -0
- package/components/doc/contribution/communicationdoc.js +15 -0
- package/components/doc/contribution/helpneededdoc.js +34 -0
- package/components/doc/contribution/introductiondoc.js +49 -0
- package/components/doc/contribution/keypointsdoc.js +12 -0
- package/components/doc/contribution/pathwaydoc.js +17 -0
- package/components/doc/csslayer/bootstrapdoc.js +21 -0
- package/components/doc/csslayer/normalizedoc.js +19 -0
- package/components/doc/csslayer/resetdoc.js +30 -0
- package/components/doc/csslayer/specificitydoc.js +85 -0
- package/components/doc/csslayer/tailwinddoc.js +32 -0
- package/components/doc/customicons/fontawesomedoc.js +25 -0
- package/components/doc/customicons/imagedoc.js +19 -0
- package/components/doc/customicons/materialdoc.js +23 -0
- package/components/doc/customicons/svgdoc.js +24 -0
- package/components/doc/datascroller/accessibilitydoc.js +16 -0
- package/components/doc/datascroller/basicdoc.js +246 -0
- package/components/doc/datascroller/importdoc.js +17 -0
- package/components/doc/datascroller/inlinedoc.js +246 -0
- package/components/doc/datascroller/loaderdoc.js +254 -0
- package/components/doc/datascroller/pt/wireframe.js +12 -0
- package/components/doc/datascroller/styledoc.js +43 -0
- package/components/doc/datascroller/theming/styleddoc.js +43 -0
- package/components/doc/datascroller/theming/tailwinddoc.js +105 -0
- package/components/doc/datatable/accessibilitydoc.js +200 -0
- package/components/doc/datatable/basicdoc.js +125 -0
- package/components/doc/datatable/cellselection/disableddoc.js +182 -0
- package/components/doc/datatable/cellselection/eventsdoc.js +184 -0
- package/components/doc/datatable/cellselection/multipledoc.js +169 -0
- package/components/doc/datatable/cellselection/singledoc.js +167 -0
- package/components/doc/datatable/colresize/expandmodedoc.js +125 -0
- package/components/doc/datatable/colresize/fitmodedoc.js +126 -0
- package/components/doc/datatable/columngroupdoc.js +345 -0
- package/components/doc/datatable/columntoggledoc.js +176 -0
- package/components/doc/datatable/conditionalstyledoc.js +172 -0
- package/components/doc/datatable/contextmenudoc.js +229 -0
- package/components/doc/datatable/dynamiccolumnsdoc.js +142 -0
- package/components/doc/datatable/edit/celleditdoc.js +313 -0
- package/components/doc/datatable/edit/roweditdoc.js +322 -0
- package/components/doc/datatable/exportdoc.js +328 -0
- package/components/doc/datatable/filter/advanceddoc.js +882 -0
- package/components/doc/datatable/filter/basicdoc.js +633 -0
- package/components/doc/datatable/filter/customdoc.js +722 -0
- package/components/doc/datatable/gridlinesdoc.js +125 -0
- package/components/doc/datatable/importdoc.js +18 -0
- package/components/doc/datatable/lazyloaddoc.js +460 -0
- package/components/doc/datatable/paginator/basicdoc.js +141 -0
- package/components/doc/datatable/paginator/templatedoc.js +171 -0
- package/components/doc/datatable/pt/wireframe.js +12 -0
- package/components/doc/datatable/reorderdoc.js +156 -0
- package/components/doc/datatable/rowexpansiondoc.js +532 -0
- package/components/doc/datatable/rowgroup/expandabledoc.js +368 -0
- package/components/doc/datatable/rowgroup/rowspandoc.js +282 -0
- package/components/doc/datatable/rowgroup/subheaderdoc.js +359 -0
- package/components/doc/datatable/rowselection/checkboxdoc.js +157 -0
- package/components/doc/datatable/rowselection/disableddoc.js +158 -0
- package/components/doc/datatable/rowselection/eventsdoc.js +174 -0
- package/components/doc/datatable/rowselection/multipledoc.js +156 -0
- package/components/doc/datatable/rowselection/radiobuttondoc.js +154 -0
- package/components/doc/datatable/rowselection/singledoc.js +155 -0
- package/components/doc/datatable/samples/customersdoc.js +769 -0
- package/components/doc/datatable/samples/productsdoc.js +1165 -0
- package/components/doc/datatable/scroll/flexibledoc.js +168 -0
- package/components/doc/datatable/scroll/frozencolumnsdoc.js +190 -0
- package/components/doc/datatable/scroll/frozenrowsdoc.js +277 -0
- package/components/doc/datatable/scroll/horizontaldoc.js +173 -0
- package/components/doc/datatable/scroll/verticaldoc.js +131 -0
- package/components/doc/datatable/sizedoc.js +159 -0
- package/components/doc/datatable/sort/multiplecolumnsdoc.js +125 -0
- package/components/doc/datatable/sort/presortdoc.js +154 -0
- package/components/doc/datatable/sort/removablesortdoc.js +125 -0
- package/components/doc/datatable/sort/singlecolumndoc.js +125 -0
- package/components/doc/datatable/statefuldoc.js +519 -0
- package/components/doc/datatable/stripedrowsdoc.js +125 -0
- package/components/doc/datatable/styledoc.js +106 -0
- package/components/doc/datatable/templatedoc.js +274 -0
- package/components/doc/datatable/theming/styleddoc.js +103 -0
- package/components/doc/datatable/theming/tailwinddoc.js +593 -0
- package/components/doc/datatable/virtualscroll/lazydoc.js +235 -0
- package/components/doc/datatable/virtualscroll/preloaddoc.js +115 -0
- package/components/doc/dataview/accessibilitydoc.js +45 -0
- package/components/doc/dataview/basicdoc.js +273 -0
- package/components/doc/dataview/importdoc.js +17 -0
- package/components/doc/dataview/layoutdoc.js +386 -0
- package/components/doc/dataview/loadingdoc.js +316 -0
- package/components/doc/dataview/paginationdoc.js +274 -0
- package/components/doc/dataview/pt/wireframe.js +12 -0
- package/components/doc/dataview/sortingdoc.js +356 -0
- package/components/doc/dataview/styledoc.js +51 -0
- package/components/doc/dataview/theming/styleddoc.js +47 -0
- package/components/doc/dataview/theming/tailwinddoc.js +179 -0
- package/components/doc/deferredcontent/accessibilitydoc.js +28 -0
- package/components/doc/deferredcontent/basicdoc.js +83 -0
- package/components/doc/deferredcontent/datatabledoc.js +134 -0
- package/components/doc/deferredcontent/importdoc.js +17 -0
- package/components/doc/deferredcontent/pt/wireframe.js +12 -0
- package/components/doc/deferredcontent/styledoc.js +11 -0
- package/components/doc/deferredcontent/theming/styleddoc.js +11 -0
- package/components/doc/dialog/accessibilitydoc.js +95 -0
- package/components/doc/dialog/basicdoc.js +97 -0
- package/components/doc/dialog/footerdoc.js +116 -0
- package/components/doc/dialog/headlessdoc.js +208 -0
- package/components/doc/dialog/importdoc.js +17 -0
- package/components/doc/dialog/longcontentdoc.js +201 -0
- package/components/doc/dialog/maximizabledoc.js +98 -0
- package/components/doc/dialog/positiondoc.js +193 -0
- package/components/doc/dialog/pt/wireframe.js +12 -0
- package/components/doc/dialog/responsivedoc.js +102 -0
- package/components/doc/dialog/styledoc.js +50 -0
- package/components/doc/dialog/templatedoc.js +135 -0
- package/components/doc/dialog/theming/styleddoc.js +51 -0
- package/components/doc/dialog/theming/tailwinddoc.js +121 -0
- package/components/doc/dialog/withoutmodaldoc.js +98 -0
- package/components/doc/divider/accessibilitydoc.js +15 -0
- package/components/doc/divider/basicdoc.js +119 -0
- package/components/doc/divider/contentdoc.js +161 -0
- package/components/doc/divider/importdoc.js +17 -0
- package/components/doc/divider/logindoc.js +148 -0
- package/components/doc/divider/pt/wireframe.js +12 -0
- package/components/doc/divider/styledoc.js +70 -0
- package/components/doc/divider/theming/styleddoc.js +67 -0
- package/components/doc/divider/theming/tailwinddoc.js +89 -0
- package/components/doc/divider/typedoc.js +121 -0
- package/components/doc/divider/verticaldoc.js +101 -0
- package/components/doc/dock/accessibilitydoc.js +75 -0
- package/components/doc/dock/advanceddoc.js +1051 -0
- package/components/doc/dock/basicdoc.js +237 -0
- package/components/doc/dock/importdoc.js +17 -0
- package/components/doc/dock/pt/wireframe.js +12 -0
- package/components/doc/dock/styledoc.js +38 -0
- package/components/doc/dock/theming/styleddoc.js +38 -0
- package/components/doc/dock/theming/tailwinddoc.js +150 -0
- package/components/doc/dropdown/accessibilitydoc.js +184 -0
- package/components/doc/dropdown/basicdoc.js +87 -0
- package/components/doc/dropdown/checkmarkdoc.js +83 -0
- package/components/doc/dropdown/clearicondoc.js +85 -0
- package/components/doc/dropdown/disableddoc.js +49 -0
- package/components/doc/dropdown/editabledoc.js +85 -0
- package/components/doc/dropdown/filleddoc.js +85 -0
- package/components/doc/dropdown/filterdoc.js +178 -0
- package/components/doc/dropdown/floatlabeldoc.js +95 -0
- package/components/doc/dropdown/groupdoc.js +201 -0
- package/components/doc/dropdown/importdoc.js +17 -0
- package/components/doc/dropdown/invaliddoc.js +85 -0
- package/components/doc/dropdown/lazyvirtualscrolldoc.js +159 -0
- package/components/doc/dropdown/loadingdoc.js +49 -0
- package/components/doc/dropdown/pt/wireframe.js +12 -0
- package/components/doc/dropdown/styledoc.js +67 -0
- package/components/doc/dropdown/templatedoc.js +237 -0
- package/components/doc/dropdown/theming/styleddoc.js +63 -0
- package/components/doc/dropdown/theming/tailwinddoc.js +123 -0
- package/components/doc/dropdown/virtualscrolldoc.js +73 -0
- package/components/doc/editor/accessibilitydoc.js +9 -0
- package/components/doc/editor/basicdoc.js +56 -0
- package/components/doc/editor/importdoc.js +17 -0
- package/components/doc/editor/pt/wireframe.js +12 -0
- package/components/doc/editor/quilldoc.js +21 -0
- package/components/doc/editor/readonlydoc.js +50 -0
- package/components/doc/editor/styledoc.js +38 -0
- package/components/doc/editor/templatedoc.js +92 -0
- package/components/doc/editor/theming/styleddoc.js +35 -0
- package/components/doc/editor/theming/tailwinddoc.js +54 -0
- package/components/doc/fieldset/accessibilitydoc.js +55 -0
- package/components/doc/fieldset/basicdoc.js +75 -0
- package/components/doc/fieldset/importdoc.js +17 -0
- package/components/doc/fieldset/pt/wireframe.js +12 -0
- package/components/doc/fieldset/styledoc.js +42 -0
- package/components/doc/fieldset/templatedoc.js +97 -0
- package/components/doc/fieldset/theming/styleddoc.js +39 -0
- package/components/doc/fieldset/theming/tailwinddoc.js +87 -0
- package/components/doc/fieldset/toggleabledoc.js +76 -0
- package/components/doc/fileupload/accessibilitydoc.js +18 -0
- package/components/doc/fileupload/advanceddoc.js +50 -0
- package/components/doc/fileupload/autodoc.js +75 -0
- package/components/doc/fileupload/basicdoc.js +75 -0
- package/components/doc/fileupload/customuploaddoc.js +91 -0
- package/components/doc/fileupload/importdoc.js +17 -0
- package/components/doc/fileupload/pt/wireframe.js +12 -0
- package/components/doc/fileupload/styledoc.js +38 -0
- package/components/doc/fileupload/templatedoc.js +374 -0
- package/components/doc/fileupload/theming/styleddoc.js +35 -0
- package/components/doc/fileupload/theming/tailwinddoc.js +72 -0
- package/components/doc/floatlabel/accessibilitydoc.js +13 -0
- package/components/doc/floatlabel/basicdoc.js +69 -0
- package/components/doc/floatlabel/importdoc.js +17 -0
- package/components/doc/floatlabel/pt/wireframe.js +12 -0
- package/components/doc/floatlabel/theming/styleddoc.js +30 -0
- package/components/doc/floatlabel/theming/tailwinddoc.js +63 -0
- package/components/doc/galleria/accessibilitydoc.js +122 -0
- package/components/doc/galleria/advanceddoc.js +656 -0
- package/components/doc/galleria/autoplaydoc.js +151 -0
- package/components/doc/galleria/basicdoc.js +151 -0
- package/components/doc/galleria/captiondoc.js +178 -0
- package/components/doc/galleria/controlleddoc.js +219 -0
- package/components/doc/galleria/fullscreen/customcontentdoc.js +191 -0
- package/components/doc/galleria/fullscreen/withoutthumbnailsdoc.js +120 -0
- package/components/doc/galleria/fullscreen/withthumbnailsdoc.js +179 -0
- package/components/doc/galleria/importdoc.js +17 -0
- package/components/doc/galleria/indicator/clickeventdoc.js +93 -0
- package/components/doc/galleria/indicator/hovereventdoc.js +93 -0
- package/components/doc/galleria/indicator/positiondoc.js +213 -0
- package/components/doc/galleria/indicator/templatedoc.js +139 -0
- package/components/doc/galleria/navigator/hoverdoc.js +151 -0
- package/components/doc/galleria/navigator/indicatorsdoc.js +109 -0
- package/components/doc/galleria/navigator/itemthumbnailsdoc.js +151 -0
- package/components/doc/galleria/navigator/itemwithouthumbnailsdoc.js +106 -0
- package/components/doc/galleria/pt/wireframe.js +12 -0
- package/components/doc/galleria/responsivedoc.js +169 -0
- package/components/doc/galleria/styledoc.js +59 -0
- package/components/doc/galleria/theming/styleddoc.js +59 -0
- package/components/doc/galleria/theming/tailwinddoc.js +154 -0
- package/components/doc/galleria/thumbnaildoc.js +248 -0
- package/components/doc/gmap/accessibilitydoc.js +11 -0
- package/components/doc/gmap/gmapdoc.js +626 -0
- package/components/doc/gmap/importdoc.js +17 -0
- package/components/doc/gmap/styledoc.js +11 -0
- package/components/doc/hooks/useclickoutside/basicdoc.js +97 -0
- package/components/doc/hooks/useclickoutside/importdoc.js +17 -0
- package/components/doc/hooks/usecounter/basicdoc.js +78 -0
- package/components/doc/hooks/usecounter/importdoc.js +17 -0
- package/components/doc/hooks/usecounter/optionsdoc.js +78 -0
- package/components/doc/hooks/usedebounce/basicdoc.js +68 -0
- package/components/doc/hooks/usedebounce/importdoc.js +17 -0
- package/components/doc/hooks/useeventlistener/documentdoc.js +203 -0
- package/components/doc/hooks/useeventlistener/elementdoc.js +160 -0
- package/components/doc/hooks/useeventlistener/importdoc.js +17 -0
- package/components/doc/hooks/usefavicon/basicdoc.js +72 -0
- package/components/doc/hooks/usefavicon/importdoc.js +17 -0
- package/components/doc/hooks/useintersectionobserver/basicdoc.js +82 -0
- package/components/doc/hooks/useintersectionobserver/importdoc.js +17 -0
- package/components/doc/hooks/useintersectionobserver/thresholddoc.js +84 -0
- package/components/doc/hooks/useinterval/basicdoc.js +98 -0
- package/components/doc/hooks/useinterval/importdoc.js +17 -0
- package/components/doc/hooks/usemounteffect/basicdoc.js +79 -0
- package/components/doc/hooks/usemounteffect/importdoc.js +17 -0
- package/components/doc/hooks/usemouse/documentdoc.js +70 -0
- package/components/doc/hooks/usemouse/elementdoc.js +74 -0
- package/components/doc/hooks/usemouse/importdoc.js +17 -0
- package/components/doc/hooks/usemouse/resetdoc.js +76 -0
- package/components/doc/hooks/usemove/basicdoc.js +115 -0
- package/components/doc/hooks/usemove/horizontaldoc.js +112 -0
- package/components/doc/hooks/usemove/importdoc.js +17 -0
- package/components/doc/hooks/usemove/verticaldoc.js +112 -0
- package/components/doc/hooks/useoverlaylistener/basicdoc.js +172 -0
- package/components/doc/hooks/useoverlaylistener/importdoc.js +17 -0
- package/components/doc/hooks/useoverlayscrolllistener/basicdoc.js +143 -0
- package/components/doc/hooks/useoverlayscrolllistener/importdoc.js +17 -0
- package/components/doc/hooks/useprevious/basicdoc.js +93 -0
- package/components/doc/hooks/useprevious/importdoc.js +17 -0
- package/components/doc/hooks/useresizelistener/basicdoc.js +139 -0
- package/components/doc/hooks/useresizelistener/importdoc.js +17 -0
- package/components/doc/hooks/usestorage/importdoc.js +18 -0
- package/components/doc/hooks/usestorage/localdoc.js +68 -0
- package/components/doc/hooks/usestorage/sessiondoc.js +68 -0
- package/components/doc/hooks/usetimeout/basicdoc.js +80 -0
- package/components/doc/hooks/usetimeout/importdoc.js +17 -0
- package/components/doc/hooks/useunmounteffect/basicdoc.js +97 -0
- package/components/doc/hooks/useunmounteffect/importdoc.js +17 -0
- package/components/doc/hooks/useupdateeffect/basicdoc.js +87 -0
- package/components/doc/hooks/useupdateeffect/importdoc.js +17 -0
- package/components/doc/iconfield/accessibilitydoc.js +14 -0
- package/components/doc/iconfield/basicdoc.js +90 -0
- package/components/doc/iconfield/importdoc.js +18 -0
- package/components/doc/iconfield/pt/wireframe.js +12 -0
- package/components/doc/iconfield/templatedoc.js +168 -0
- package/components/doc/iconfield/theming/styleddoc.js +40 -0
- package/components/doc/iconfield/theming/tailwinddoc.js +77 -0
- package/components/doc/icons/basicdoc.js +30 -0
- package/components/doc/icons/colordoc.js +30 -0
- package/components/doc/icons/constantsdoc.js +52 -0
- package/components/doc/icons/downloaddoc.js +19 -0
- package/components/doc/icons/figmadoc.js +18 -0
- package/components/doc/icons/importdoc.js +19 -0
- package/components/doc/icons/listdoc.js +88 -0
- package/components/doc/icons/sizedoc.js +28 -0
- package/components/doc/icons/spindoc.js +26 -0
- package/components/doc/image/accessibilitydoc.js +62 -0
- package/components/doc/image/basicdoc.js +49 -0
- package/components/doc/image/importdoc.js +17 -0
- package/components/doc/image/previewdoc.js +49 -0
- package/components/doc/image/pt/wireframe.js +12 -0
- package/components/doc/image/styledoc.js +59 -0
- package/components/doc/image/templatedoc.js +55 -0
- package/components/doc/image/theming/styleddoc.js +55 -0
- package/components/doc/image/theming/tailwinddoc.js +108 -0
- package/components/doc/image/thumbnaildoc.js +49 -0
- package/components/doc/inplace/accessibilitydoc.js +69 -0
- package/components/doc/inplace/basicdoc.js +84 -0
- package/components/doc/inplace/imagedoc.js +83 -0
- package/components/doc/inplace/importdoc.js +17 -0
- package/components/doc/inplace/inputdoc.js +79 -0
- package/components/doc/inplace/lazydoc.js +135 -0
- package/components/doc/inplace/pt/wireframe.js +12 -0
- package/components/doc/inplace/styledoc.js +39 -0
- package/components/doc/inplace/theming/styleddoc.js +35 -0
- package/components/doc/inplace/theming/tailwinddoc.js +56 -0
- package/components/doc/inputgroup/basicdoc.js +116 -0
- package/components/doc/inputgroup/buttondoc.js +108 -0
- package/components/doc/inputgroup/checkboxdoc.js +154 -0
- package/components/doc/inputgroup/multipledoc.js +87 -0
- package/components/doc/inputmask/accessibilitydoc.js +48 -0
- package/components/doc/inputmask/basicdoc.js +56 -0
- package/components/doc/inputmask/disableddoc.js +49 -0
- package/components/doc/inputmask/filleddoc.js +56 -0
- package/components/doc/inputmask/floatlabeldoc.js +72 -0
- package/components/doc/inputmask/importdoc.js +17 -0
- package/components/doc/inputmask/invaliddoc.js +49 -0
- package/components/doc/inputmask/maskdoc.js +102 -0
- package/components/doc/inputmask/optionaldoc.js +56 -0
- package/components/doc/inputmask/pt/wireframe.js +12 -0
- package/components/doc/inputmask/slotchardoc.js +56 -0
- package/components/doc/inputmask/styledoc.js +34 -0
- package/components/doc/inputmask/theming/styleddoc.js +31 -0
- package/components/doc/inputmask/theming/tailwinddoc.js +70 -0
- package/components/doc/inputnumber/accessibilitydoc.js +73 -0
- package/components/doc/inputnumber/buttonsdoc.js +125 -0
- package/components/doc/inputnumber/currencydoc.js +121 -0
- package/components/doc/inputnumber/disableddoc.js +56 -0
- package/components/doc/inputnumber/filleddoc.js +56 -0
- package/components/doc/inputnumber/floatlabeldoc.js +72 -0
- package/components/doc/inputnumber/importdoc.js +17 -0
- package/components/doc/inputnumber/invaliddoc.js +56 -0
- package/components/doc/inputnumber/localedoc.js +121 -0
- package/components/doc/inputnumber/numberalsdoc.js +121 -0
- package/components/doc/inputnumber/prefixsuffixdoc.js +121 -0
- package/components/doc/inputnumber/pt/wireframe.js +12 -0
- package/components/doc/inputnumber/styledoc.js +63 -0
- package/components/doc/inputnumber/theming/styleddoc.js +59 -0
- package/components/doc/inputnumber/theming/tailwinddoc.js +82 -0
- package/components/doc/inputnumber/verticaldoc.js +69 -0
- package/components/doc/inputotp/accessibilitydoc.js +52 -0
- package/components/doc/inputotp/basicdoc.js +56 -0
- package/components/doc/inputotp/importdoc.js +17 -0
- package/components/doc/inputotp/integeronlydoc.js +56 -0
- package/components/doc/inputotp/maskdoc.js +56 -0
- package/components/doc/inputotp/pt/wireframe.js +12 -0
- package/components/doc/inputotp/sampledoc.js +244 -0
- package/components/doc/inputotp/templatedoc.js +128 -0
- package/components/doc/inputotp/theming/styleddoc.js +31 -0
- package/components/doc/inputotp/theming/tailwinddoc.js +55 -0
- package/components/doc/inputswitch/accessibilitydoc.js +54 -0
- package/components/doc/inputswitch/basicdoc.js +56 -0
- package/components/doc/inputswitch/disableddoc.js +49 -0
- package/components/doc/inputswitch/importdoc.js +17 -0
- package/components/doc/inputswitch/invaliddoc.js +49 -0
- package/components/doc/inputswitch/preselectiondoc.js +56 -0
- package/components/doc/inputswitch/pt/wireframe.js +12 -0
- package/components/doc/inputswitch/styledoc.js +39 -0
- package/components/doc/inputswitch/theming/styleddoc.js +35 -0
- package/components/doc/inputswitch/theming/tailwinddoc.js +66 -0
- package/components/doc/inputtext/accessibilitydoc.js +48 -0
- package/components/doc/inputtext/basicdoc.js +56 -0
- package/components/doc/inputtext/disableddoc.js +49 -0
- package/components/doc/inputtext/filleddoc.js +56 -0
- package/components/doc/inputtext/floatlabeldoc.js +72 -0
- package/components/doc/inputtext/helptextdoc.js +71 -0
- package/components/doc/inputtext/importdoc.js +17 -0
- package/components/doc/inputtext/invaliddoc.js +49 -0
- package/components/doc/inputtext/keyfilterdoc.js +50 -0
- package/components/doc/inputtext/pt/wireframe.js +12 -0
- package/components/doc/inputtext/sizesdoc.js +57 -0
- package/components/doc/inputtext/styledoc.js +30 -0
- package/components/doc/inputtext/theming/styleddoc.js +27 -0
- package/components/doc/inputtext/theming/tailwinddoc.js +70 -0
- package/components/doc/inputtextarea/accessibilitydoc.js +48 -0
- package/components/doc/inputtextarea/autoresizedoc.js +56 -0
- package/components/doc/inputtextarea/basicdoc.js +56 -0
- package/components/doc/inputtextarea/disableddoc.js +49 -0
- package/components/doc/inputtextarea/filleddoc.js +56 -0
- package/components/doc/inputtextarea/floatlabeldoc.js +72 -0
- package/components/doc/inputtextarea/importdoc.js +17 -0
- package/components/doc/inputtextarea/invaliddoc.js +49 -0
- package/components/doc/inputtextarea/keyfilterdoc.js +50 -0
- package/components/doc/inputtextarea/pt/wireframe.js +12 -0
- package/components/doc/inputtextarea/styledoc.js +30 -0
- package/components/doc/inputtextarea/theming/styleddoc.js +27 -0
- package/components/doc/inputtextarea/theming/tailwinddoc.js +53 -0
- package/components/doc/installation/context.js +42 -0
- package/components/doc/installation/downloaddoc.js +25 -0
- package/components/doc/installation/examplesdoc.js +25 -0
- package/components/doc/installation/styleddoc.js +23 -0
- package/components/doc/installation/unstyledmodedoc.js +29 -0
- package/components/doc/installation/usagedoc.js +47 -0
- package/components/doc/installation/videos/nextjsdoc.js +20 -0
- package/components/doc/keyfilter/accessibilitydoc.js +12 -0
- package/components/doc/keyfilter/importdoc.js +17 -0
- package/components/doc/keyfilter/presetsdoc.js +234 -0
- package/components/doc/keyfilter/regexdoc.js +81 -0
- package/components/doc/keyfilter/regexworddoc.js +134 -0
- package/components/doc/knob/accessibilitydoc.js +90 -0
- package/components/doc/knob/basicdoc.js +56 -0
- package/components/doc/knob/colordoc.js +56 -0
- package/components/doc/knob/disableddoc.js +52 -0
- package/components/doc/knob/importdoc.js +17 -0
- package/components/doc/knob/minmaxdoc.js +56 -0
- package/components/doc/knob/pt/wireframe.js +12 -0
- package/components/doc/knob/reactivedoc.js +71 -0
- package/components/doc/knob/readonlydoc.js +52 -0
- package/components/doc/knob/sizedoc.js +56 -0
- package/components/doc/knob/stepdoc.js +56 -0
- package/components/doc/knob/strokedoc.js +57 -0
- package/components/doc/knob/styledoc.js +43 -0
- package/components/doc/knob/templatedoc.js +56 -0
- package/components/doc/knob/theming/styleddoc.js +39 -0
- package/components/doc/knob/theming/tailwinddoc.js +53 -0
- package/components/doc/listbox/accessibilitydoc.js +120 -0
- package/components/doc/listbox/basicdoc.js +84 -0
- package/components/doc/listbox/disableddoc.js +78 -0
- package/components/doc/listbox/filterdoc.js +82 -0
- package/components/doc/listbox/groupdoc.js +204 -0
- package/components/doc/listbox/importdoc.js +17 -0
- package/components/doc/listbox/invaliddoc.js +85 -0
- package/components/doc/listbox/multipledoc.js +83 -0
- package/components/doc/listbox/pt/wireframe.js +12 -0
- package/components/doc/listbox/styledoc.js +47 -0
- package/components/doc/listbox/templatedoc.js +127 -0
- package/components/doc/listbox/theming/styleddoc.js +43 -0
- package/components/doc/listbox/theming/tailwinddoc.js +84 -0
- package/components/doc/listbox/virtualscrolldoc.js +69 -0
- package/components/doc/megamenu/accessibilitydoc.js +95 -0
- package/components/doc/megamenu/basicdoc.js +341 -0
- package/components/doc/megamenu/commanddoc.js +27 -0
- package/components/doc/megamenu/importdoc.js +17 -0
- package/components/doc/megamenu/pt/wireframe.js +12 -0
- package/components/doc/megamenu/routerdoc.js +28 -0
- package/components/doc/megamenu/styledoc.js +51 -0
- package/components/doc/megamenu/templatedoc.js +388 -0
- package/components/doc/megamenu/theming/styleddoc.js +47 -0
- package/components/doc/megamenu/theming/tailwinddoc.js +211 -0
- package/components/doc/megamenu/verticaldoc.js +341 -0
- package/components/doc/mention/accessibilitydoc.js +89 -0
- package/components/doc/mention/autoresizedoc.js +210 -0
- package/components/doc/mention/basicdoc.js +210 -0
- package/components/doc/mention/disableddoc.js +49 -0
- package/components/doc/mention/floatlabeldoc.js +220 -0
- package/components/doc/mention/importdoc.js +17 -0
- package/components/doc/mention/invaliddoc.js +221 -0
- package/components/doc/mention/pt/wireframe.js +12 -0
- package/components/doc/mention/styledoc.js +39 -0
- package/components/doc/mention/theming/styleddoc.js +42 -0
- package/components/doc/mention/theming/tailwinddoc.js +102 -0
- package/components/doc/mention/triggersdoc.js +321 -0
- package/components/doc/menu/accessibilitydoc.js +86 -0
- package/components/doc/menu/basicdoc.js +61 -0
- package/components/doc/menu/commanddoc.js +109 -0
- package/components/doc/menu/groupdoc.js +150 -0
- package/components/doc/menu/importdoc.js +17 -0
- package/components/doc/menu/popupdoc.js +168 -0
- package/components/doc/menu/pt/wireframe.js +12 -0
- package/components/doc/menu/routerdoc.js +112 -0
- package/components/doc/menu/styledoc.js +47 -0
- package/components/doc/menu/templatedoc.js +382 -0
- package/components/doc/menu/theming/styleddoc.js +43 -0
- package/components/doc/menu/theming/tailwinddoc.js +85 -0
- package/components/doc/menubar/accessibilitydoc.js +102 -0
- package/components/doc/menubar/basicdoc.js +191 -0
- package/components/doc/menubar/commanddoc.js +218 -0
- package/components/doc/menubar/importdoc.js +17 -0
- package/components/doc/menubar/pt/wireframe.js +12 -0
- package/components/doc/menubar/routerdoc.js +170 -0
- package/components/doc/menubar/styledoc.js +51 -0
- package/components/doc/menubar/templatedoc.js +293 -0
- package/components/doc/menubar/theming/styleddoc.js +50 -0
- package/components/doc/menubar/theming/tailwinddoc.js +228 -0
- package/components/doc/message/accessibilitydoc.js +45 -0
- package/components/doc/message/basicdoc.js +49 -0
- package/components/doc/message/importdoc.js +17 -0
- package/components/doc/message/pt/wireframe.js +12 -0
- package/components/doc/message/severitydoc.js +69 -0
- package/components/doc/message/styledoc.js +62 -0
- package/components/doc/message/templatedoc.js +106 -0
- package/components/doc/message/theming/styleddoc.js +59 -0
- package/components/doc/message/theming/tailwinddoc.js +57 -0
- package/components/doc/message/validationdoc.js +90 -0
- package/components/doc/messages/accessibilitydoc.js +46 -0
- package/components/doc/messages/basicdoc.js +79 -0
- package/components/doc/messages/closeabledoc.js +90 -0
- package/components/doc/messages/customicon.js +126 -0
- package/components/doc/messages/dynamicdoc.js +110 -0
- package/components/doc/messages/importdoc.js +17 -0
- package/components/doc/messages/pt/wireframe.js +12 -0
- package/components/doc/messages/severitydoc.js +102 -0
- package/components/doc/messages/stickydoc.js +98 -0
- package/components/doc/messages/styledoc.js +63 -0
- package/components/doc/messages/templatedoc.js +112 -0
- package/components/doc/messages/theming/styleddoc.js +59 -0
- package/components/doc/messages/theming/tailwinddoc.js +83 -0
- package/components/doc/metergroup/accessibilitydoc.js +26 -0
- package/components/doc/metergroup/basicdoc.js +55 -0
- package/components/doc/metergroup/icondoc.js +68 -0
- package/components/doc/metergroup/importdoc.js +17 -0
- package/components/doc/metergroup/labeldoc.js +71 -0
- package/components/doc/metergroup/minmaxdoc.js +70 -0
- package/components/doc/metergroup/multipledoc.js +68 -0
- package/components/doc/metergroup/pt/wireframe.js +12 -0
- package/components/doc/metergroup/templatedoc.js +226 -0
- package/components/doc/metergroup/theming/styleddoc.js +76 -0
- package/components/doc/metergroup/verticaldoc.js +70 -0
- package/components/doc/multiselect/accessibilitydoc.js +238 -0
- package/components/doc/multiselect/basicdoc.js +87 -0
- package/components/doc/multiselect/chipsdoc.js +85 -0
- package/components/doc/multiselect/disableddoc.js +49 -0
- package/components/doc/multiselect/filleddoc.js +85 -0
- package/components/doc/multiselect/filterdoc.js +85 -0
- package/components/doc/multiselect/floatlabeldoc.js +98 -0
- package/components/doc/multiselect/groupdoc.js +208 -0
- package/components/doc/multiselect/importdoc.js +17 -0
- package/components/doc/multiselect/invaliddoc.js +85 -0
- package/components/doc/multiselect/loadingdoc.js +49 -0
- package/components/doc/multiselect/pt/wireframe.js +12 -0
- package/components/doc/multiselect/styledoc.js +75 -0
- package/components/doc/multiselect/templatedoc.js +167 -0
- package/components/doc/multiselect/theming/styleddoc.js +71 -0
- package/components/doc/multiselect/theming/tailwinddoc.js +161 -0
- package/components/doc/multiselect/virtualscrolldoc.js +128 -0
- package/components/doc/multistatecheckbox/accessibilitydoc.js +54 -0
- package/components/doc/multistatecheckbox/basicdoc.js +80 -0
- package/components/doc/multistatecheckbox/disableddoc.js +49 -0
- package/components/doc/multistatecheckbox/importdoc.js +17 -0
- package/components/doc/multistatecheckbox/invaliddoc.js +49 -0
- package/components/doc/multistatecheckbox/pt/wireframe.js +12 -0
- package/components/doc/multistatecheckbox/styledoc.js +42 -0
- package/components/doc/multistatecheckbox/theming/styleddoc.js +42 -0
- package/components/doc/multistatecheckbox/theming/tailwinddoc.js +67 -0
- package/components/doc/orderlist/accessibilitydoc.js +149 -0
- package/components/doc/orderlist/basicdoc.js +148 -0
- package/components/doc/orderlist/dragdropdoc.js +149 -0
- package/components/doc/orderlist/filterdoc.js +149 -0
- package/components/doc/orderlist/importdoc.js +17 -0
- package/components/doc/orderlist/pt/wireframe.js +12 -0
- package/components/doc/orderlist/styledoc.js +51 -0
- package/components/doc/orderlist/theming/styleddoc.js +47 -0
- package/components/doc/orderlist/theming/tailwinddoc.js +151 -0
- package/components/doc/organizationchart/accessibilitydoc.js +51 -0
- package/components/doc/organizationchart/basicdoc.js +150 -0
- package/components/doc/organizationchart/coloreddoc.js +285 -0
- package/components/doc/organizationchart/importdoc.js +17 -0
- package/components/doc/organizationchart/pt/wireframe.js +12 -0
- package/components/doc/organizationchart/selectiondoc.js +247 -0
- package/components/doc/organizationchart/styledoc.js +51 -0
- package/components/doc/organizationchart/templatedoc.js +198 -0
- package/components/doc/organizationchart/theming/styleddoc.js +51 -0
- package/components/doc/organizationchart/theming/tailwinddoc.js +136 -0
- package/components/doc/overlaypanel/accessibilitydoc.js +79 -0
- package/components/doc/overlaypanel/basicdoc.js +71 -0
- package/components/doc/overlaypanel/datatabledoc.js +256 -0
- package/components/doc/overlaypanel/importdoc.js +17 -0
- package/components/doc/overlaypanel/pt/wireframe.js +12 -0
- package/components/doc/overlaypanel/styledoc.js +39 -0
- package/components/doc/overlaypanel/theming/styleddoc.js +35 -0
- package/components/doc/overlaypanel/theming/tailwinddoc.js +72 -0
- package/components/doc/paginator/accessibilitydoc.js +73 -0
- package/components/doc/paginator/basicdoc.js +75 -0
- package/components/doc/paginator/imagesdoc.js +82 -0
- package/components/doc/paginator/importdoc.js +17 -0
- package/components/doc/paginator/layoutdoc.js +95 -0
- package/components/doc/paginator/pt/wireframe.js +12 -0
- package/components/doc/paginator/styledoc.js +59 -0
- package/components/doc/paginator/templatedoc.js +507 -0
- package/components/doc/paginator/theming/styleddoc.js +55 -0
- package/components/doc/paginator/theming/tailwinddoc.js +226 -0
- package/components/doc/panel/accessibilitydoc.js +54 -0
- package/components/doc/panel/basicdoc.js +71 -0
- package/components/doc/panel/importdoc.js +17 -0
- package/components/doc/panel/pt/wireframe.js +12 -0
- package/components/doc/panel/styledoc.js +47 -0
- package/components/doc/panel/templatedoc.js +234 -0
- package/components/doc/panel/theming/styleddoc.js +43 -0
- package/components/doc/panel/theming/tailwinddoc.js +86 -0
- package/components/doc/panel/toggleabledoc.js +89 -0
- package/components/doc/panelmenu/accessibilitydoc.js +139 -0
- package/components/doc/panelmenu/basicdoc.js +284 -0
- package/components/doc/panelmenu/commanddoc.js +232 -0
- package/components/doc/panelmenu/controlleddoc.js +342 -0
- package/components/doc/panelmenu/importdoc.js +17 -0
- package/components/doc/panelmenu/multipledoc.js +286 -0
- package/components/doc/panelmenu/pt/wireframe.js +12 -0
- package/components/doc/panelmenu/routerdoc.js +182 -0
- package/components/doc/panelmenu/styledoc.js +59 -0
- package/components/doc/panelmenu/templatedoc.js +304 -0
- package/components/doc/panelmenu/theming/styleddoc.js +55 -0
- package/components/doc/panelmenu/theming/tailwinddoc.js +210 -0
- package/components/doc/passthrough/basicdoc.js +147 -0
- package/components/doc/passthrough/customcss.js +63 -0
- package/components/doc/passthrough/globalptdoc.js +41 -0
- package/components/doc/passthrough/lifecycle.js +73 -0
- package/components/doc/passthrough/usepassthroughdoc.js +128 -0
- package/components/doc/password/accessibilitydoc.js +54 -0
- package/components/doc/password/basicdoc.js +56 -0
- package/components/doc/password/disableddoc.js +49 -0
- package/components/doc/password/filleddoc.js +56 -0
- package/components/doc/password/floatlabeldoc.js +72 -0
- package/components/doc/password/importdoc.js +17 -0
- package/components/doc/password/invaliddoc.js +49 -0
- package/components/doc/password/localedoc.js +61 -0
- package/components/doc/password/meterdoc.js +54 -0
- package/components/doc/password/pt/wireframe.js +12 -0
- package/components/doc/password/styledoc.js +47 -0
- package/components/doc/password/templatedoc.js +98 -0
- package/components/doc/password/theming/styleddoc.js +43 -0
- package/components/doc/password/theming/tailwinddoc.js +82 -0
- package/components/doc/password/togglemaskdoc.js +56 -0
- package/components/doc/picklist/accessibilitydoc.js +148 -0
- package/components/doc/picklist/basicdoc.js +181 -0
- package/components/doc/picklist/filterdoc.js +188 -0
- package/components/doc/picklist/importdoc.js +17 -0
- package/components/doc/picklist/pt/wireframe.js +12 -0
- package/components/doc/picklist/styledoc.js +55 -0
- package/components/doc/picklist/theming/styleddoc.js +51 -0
- package/components/doc/picklist/theming/tailwinddoc.js +224 -0
- package/components/doc/progressbar/accessibilitydoc.js +25 -0
- package/components/doc/progressbar/basicdoc.js +49 -0
- package/components/doc/progressbar/dynamicdoc.js +135 -0
- package/components/doc/progressbar/importdoc.js +17 -0
- package/components/doc/progressbar/indeterminatedoc.js +49 -0
- package/components/doc/progressbar/pt/wireframe.js +12 -0
- package/components/doc/progressbar/styledoc.js +47 -0
- package/components/doc/progressbar/templatedoc.js +74 -0
- package/components/doc/progressbar/theming/styleddoc.js +43 -0
- package/components/doc/progressbar/theming/tailwinddoc.js +116 -0
- package/components/doc/progressspinner/accessibilitydoc.js +21 -0
- package/components/doc/progressspinner/basicdoc.js +47 -0
- package/components/doc/progressspinner/customdoc.js +49 -0
- package/components/doc/progressspinner/importdoc.js +17 -0
- package/components/doc/progressspinner/pt/wireframe.js +12 -0
- package/components/doc/progressspinner/styledoc.js +39 -0
- package/components/doc/progressspinner/theming/styleddoc.js +35 -0
- package/components/doc/progressspinner/theming/tailwinddoc.js +88 -0
- package/components/doc/radiobutton/accessibilitydoc.js +72 -0
- package/components/doc/radiobutton/disableddoc.js +49 -0
- package/components/doc/radiobutton/dynamicdoc.js +113 -0
- package/components/doc/radiobutton/filleddoc.js +49 -0
- package/components/doc/radiobutton/groupdoc.js +132 -0
- package/components/doc/radiobutton/importdoc.js +17 -0
- package/components/doc/radiobutton/invaliddoc.js +49 -0
- package/components/doc/radiobutton/pt/wireframe.js +12 -0
- package/components/doc/radiobutton/styledoc.js +42 -0
- package/components/doc/radiobutton/theming/styleddoc.js +39 -0
- package/components/doc/radiobutton/theming/tailwinddoc.js +90 -0
- package/components/doc/rating/accessibilitydoc.js +60 -0
- package/components/doc/rating/basicdoc.js +56 -0
- package/components/doc/rating/disableddoc.js +49 -0
- package/components/doc/rating/importdoc.js +17 -0
- package/components/doc/rating/numberofstarsdoc.js +56 -0
- package/components/doc/rating/pt/wireframe.js +12 -0
- package/components/doc/rating/readonlydoc.js +49 -0
- package/components/doc/rating/styledoc.js +39 -0
- package/components/doc/rating/templatedoc.js +74 -0
- package/components/doc/rating/theming/styleddoc.js +39 -0
- package/components/doc/rating/theming/tailwinddoc.js +76 -0
- package/components/doc/rating/withoutcanceldoc.js +56 -0
- package/components/doc/ripple/accessibilitydoc.js +15 -0
- package/components/doc/ripple/basicdoc.js +61 -0
- package/components/doc/ripple/configurationdoc.js +36 -0
- package/components/doc/ripple/customdoc.js +141 -0
- package/components/doc/ripple/importdoc.js +17 -0
- package/components/doc/ripple/styledoc.js +34 -0
- package/components/doc/ripple/theming/styleddoc.js +35 -0
- package/components/doc/ripple/theming/tailwinddoc.js +58 -0
- package/components/doc/scrollpanel/accessibilitydoc.js +51 -0
- package/components/doc/scrollpanel/basicdoc.js +102 -0
- package/components/doc/scrollpanel/customdoc.js +221 -0
- package/components/doc/scrollpanel/importdoc.js +17 -0
- package/components/doc/scrollpanel/pt/wireframe.js +12 -0
- package/components/doc/scrollpanel/styledoc.js +51 -0
- package/components/doc/scrollpanel/theming/styleddoc.js +47 -0
- package/components/doc/scrollpanel/theming/tailwinddoc.js +70 -0
- package/components/doc/scrolltop/accessibilitydoc.js +42 -0
- package/components/doc/scrolltop/basicdoc.js +53 -0
- package/components/doc/scrolltop/elementdoc.js +76 -0
- package/components/doc/scrolltop/importdoc.js +17 -0
- package/components/doc/scrolltop/pt/wireframe.js +12 -0
- package/components/doc/scrolltop/styledoc.js +34 -0
- package/components/doc/scrolltop/theming/styleddoc.js +31 -0
- package/components/doc/scrolltop/theming/tailwinddoc.js +64 -0
- package/components/doc/selectbutton/accessibilitydoc.js +39 -0
- package/components/doc/selectbutton/basicdoc.js +61 -0
- package/components/doc/selectbutton/disableddoc.js +81 -0
- package/components/doc/selectbutton/importdoc.js +17 -0
- package/components/doc/selectbutton/invaliddoc.js +59 -0
- package/components/doc/selectbutton/multipledoc.js +76 -0
- package/components/doc/selectbutton/pt/wireframe.js +12 -0
- package/components/doc/selectbutton/templatedoc.js +92 -0
- package/components/doc/selectbutton/theming/styleddoc.js +12 -0
- package/components/doc/selectbutton/theming/tailwinddoc.js +64 -0
- package/components/doc/sidebar/accessibilitydoc.js +89 -0
- package/components/doc/sidebar/basicdoc.js +89 -0
- package/components/doc/sidebar/fullscreendoc.js +89 -0
- package/components/doc/sidebar/headlessdoc.js +821 -0
- package/components/doc/sidebar/importdoc.js +17 -0
- package/components/doc/sidebar/positiondoc.js +216 -0
- package/components/doc/sidebar/pt/wireframe.js +12 -0
- package/components/doc/sidebar/sizedoc.js +89 -0
- package/components/doc/sidebar/styledoc.js +79 -0
- package/components/doc/sidebar/templatedoc.js +132 -0
- package/components/doc/sidebar/theming/styleddoc.js +79 -0
- package/components/doc/sidebar/theming/tailwinddoc.js +145 -0
- package/components/doc/skeleton/accessibilitydoc.js +17 -0
- package/components/doc/skeleton/carddoc.js +103 -0
- package/components/doc/skeleton/datatabledoc.js +79 -0
- package/components/doc/skeleton/importdoc.js +17 -0
- package/components/doc/skeleton/listdoc.js +203 -0
- package/components/doc/skeleton/pt/wireframe.js +12 -0
- package/components/doc/skeleton/shapesdoc.js +178 -0
- package/components/doc/skeleton/styledoc.js +38 -0
- package/components/doc/skeleton/theming/styleddoc.js +35 -0
- package/components/doc/skeleton/theming/tailwinddoc.js +88 -0
- package/components/doc/slider/accessibilitydoc.js +88 -0
- package/components/doc/slider/basicdoc.js +56 -0
- package/components/doc/slider/filterdoc.js +127 -0
- package/components/doc/slider/importdoc.js +17 -0
- package/components/doc/slider/inputdoc.js +67 -0
- package/components/doc/slider/pt/wireframe.js +12 -0
- package/components/doc/slider/rangedoc.js +56 -0
- package/components/doc/slider/stepdoc.js +56 -0
- package/components/doc/slider/styledoc.js +35 -0
- package/components/doc/slider/theming/styleddoc.js +31 -0
- package/components/doc/slider/theming/tailwinddoc.js +71 -0
- package/components/doc/slider/verticaldoc.js +56 -0
- package/components/doc/speeddial/accessibilitydoc.js +108 -0
- package/components/doc/speeddial/circledoc.js +187 -0
- package/components/doc/speeddial/customdoc.js +187 -0
- package/components/doc/speeddial/importdoc.js +17 -0
- package/components/doc/speeddial/lineardoc.js +199 -0
- package/components/doc/speeddial/maskdoc.js +187 -0
- package/components/doc/speeddial/pt/wireframe.js +12 -0
- package/components/doc/speeddial/quartercircledoc.js +198 -0
- package/components/doc/speeddial/semicircledoc.js +199 -0
- package/components/doc/speeddial/styledoc.js +46 -0
- package/components/doc/speeddial/theming/styleddoc.js +43 -0
- package/components/doc/speeddial/theming/tailwinddoc.js +116 -0
- package/components/doc/speeddial/tooltipdoc.js +204 -0
- package/components/doc/splitbutton/accessibilitydoc.js +137 -0
- package/components/doc/splitbutton/basicdoc.js +172 -0
- package/components/doc/splitbutton/disableddoc.js +172 -0
- package/components/doc/splitbutton/iconsdoc.js +172 -0
- package/components/doc/splitbutton/importdoc.js +17 -0
- package/components/doc/splitbutton/loadingdoc.js +192 -0
- package/components/doc/splitbutton/outlineddoc.js +198 -0
- package/components/doc/splitbutton/pt/wireframe.js +12 -0
- package/components/doc/splitbutton/raiseddoc.js +198 -0
- package/components/doc/splitbutton/raisedtextdoc.js +194 -0
- package/components/doc/splitbutton/roundeddoc.js +198 -0
- package/components/doc/splitbutton/severitydoc.js +198 -0
- package/components/doc/splitbutton/sizesdoc.js +180 -0
- package/components/doc/splitbutton/styledoc.js +39 -0
- package/components/doc/splitbutton/templatedoc.js +160 -0
- package/components/doc/splitbutton/textdoc.js +194 -0
- package/components/doc/splitbutton/theming/styleddoc.js +35 -0
- package/components/doc/splitbutton/theming/tailwinddoc.js +118 -0
- package/components/doc/splitter/accessibilitydoc.js +74 -0
- package/components/doc/splitter/horizontaldoc.js +55 -0
- package/components/doc/splitter/importdoc.js +17 -0
- package/components/doc/splitter/nesteddoc.js +127 -0
- package/components/doc/splitter/pt/wireframe.js +12 -0
- package/components/doc/splitter/sizedoc.js +62 -0
- package/components/doc/splitter/styledoc.js +51 -0
- package/components/doc/splitter/theming/styleddoc.js +51 -0
- package/components/doc/splitter/theming/tailwinddoc.js +64 -0
- package/components/doc/splitter/verticaldoc.js +57 -0
- package/components/doc/stepper/accessibilitydoc.js +46 -0
- package/components/doc/stepper/basicdoc.js +167 -0
- package/components/doc/stepper/headerdoc.js +154 -0
- package/components/doc/stepper/importdoc.js +18 -0
- package/components/doc/stepper/lineardoc.js +166 -0
- package/components/doc/stepper/pt/wireframe.js +12 -0
- package/components/doc/stepper/theming/styleddoc.js +83 -0
- package/components/doc/stepper/theming/tailwinddoc.js +13 -0
- package/components/doc/stepper/verticaldoc.js +166 -0
- package/components/doc/steps/accessibilitydoc.js +69 -0
- package/components/doc/steps/basicdoc.js +86 -0
- package/components/doc/steps/controlleddoc.js +109 -0
- package/components/doc/steps/importdoc.js +17 -0
- package/components/doc/steps/interactivedoc.js +144 -0
- package/components/doc/steps/lineardoc.js +86 -0
- package/components/doc/steps/pt/wireframe.js +12 -0
- package/components/doc/steps/styledoc.js +43 -0
- package/components/doc/steps/templatedoc.js +150 -0
- package/components/doc/steps/theming/styleddoc.js +39 -0
- package/components/doc/steps/theming/tailwinddoc.js +79 -0
- package/components/doc/styleclass/animationdoc.js +111 -0
- package/components/doc/styleclass/importdoc.js +17 -0
- package/components/doc/styleclass/toggleclassdoc.js +71 -0
- package/components/doc/tabmenu/accessibilitydoc.js +69 -0
- package/components/doc/tabmenu/basicdoc.js +71 -0
- package/components/doc/tabmenu/commanddoc.js +155 -0
- package/components/doc/tabmenu/controlleddoc.js +86 -0
- package/components/doc/tabmenu/importdoc.js +17 -0
- package/components/doc/tabmenu/pt/wireframe.js +12 -0
- package/components/doc/tabmenu/routerdoc.js +92 -0
- package/components/doc/tabmenu/styledoc.js +51 -0
- package/components/doc/tabmenu/templatedoc.js +129 -0
- package/components/doc/tabmenu/theming/styleddoc.js +47 -0
- package/components/doc/tabmenu/theming/tailwinddoc.js +69 -0
- package/components/doc/tabview/accessibilitydoc.js +70 -0
- package/components/doc/tabview/basicdoc.js +143 -0
- package/components/doc/tabview/closabledoc.js +146 -0
- package/components/doc/tabview/controlleddoc.js +174 -0
- package/components/doc/tabview/disableddoc.js +148 -0
- package/components/doc/tabview/headericondoc.js +144 -0
- package/components/doc/tabview/importdoc.js +17 -0
- package/components/doc/tabview/pt/wireframe.js +12 -0
- package/components/doc/tabview/scrollabledoc.js +86 -0
- package/components/doc/tabview/styledoc.js +47 -0
- package/components/doc/tabview/templatedoc.js +236 -0
- package/components/doc/tabview/theming/styleddoc.js +43 -0
- package/components/doc/tabview/theming/tailwinddoc.js +110 -0
- package/components/doc/tag/accessibilitydoc.js +16 -0
- package/components/doc/tag/basicdoc.js +49 -0
- package/components/doc/tag/icondoc.js +65 -0
- package/components/doc/tag/importdoc.js +17 -0
- package/components/doc/tag/pilldoc.js +73 -0
- package/components/doc/tag/pt/wireframe.js +12 -0
- package/components/doc/tag/severitydoc.js +73 -0
- package/components/doc/tag/styledoc.js +42 -0
- package/components/doc/tag/templatedoc.js +69 -0
- package/components/doc/tag/theming/styleddoc.js +39 -0
- package/components/doc/tag/theming/tailwinddoc.js +67 -0
- package/components/doc/tailwind/csslayerdoc.js +37 -0
- package/components/doc/tailwind/unstyledmode/exampledoc.js +76 -0
- package/components/doc/tailwind/unstyledmode/setupdoc.js +182 -0
- package/components/doc/terminal/accessibilitydoc.js +39 -0
- package/components/doc/terminal/basicdoc.js +223 -0
- package/components/doc/terminal/importdoc.js +18 -0
- package/components/doc/terminal/pt/wireframe.js +12 -0
- package/components/doc/terminal/styledoc.js +46 -0
- package/components/doc/terminal/theming/styleddoc.js +43 -0
- package/components/doc/terminal/theming/tailwinddoc.js +94 -0
- package/components/doc/theming/architecturedoc.js +18 -0
- package/components/doc/theming/builtinthemesdoc.js +64 -0
- package/components/doc/theming/cssvariablesdoc.js +14 -0
- package/components/doc/theming/customthemedoc.js +62 -0
- package/components/doc/theming/primeflexdoc.js +35 -0
- package/components/doc/theming/scaledoc.js +24 -0
- package/components/doc/theming/scopedstyling/cssinjsdoc.js +63 -0
- package/components/doc/theming/scopedstyling/cssmodulesdoc.js +57 -0
- package/components/doc/theming/scopedstyling/namedclassdoc.js +55 -0
- package/components/doc/theming/scopedstyling/paneldemo.module.css +4 -0
- package/components/doc/theming/switchthemesdoc.js +58 -0
- package/components/doc/theming/utilsdoc.js +59 -0
- package/components/doc/tieredmenu/accessibilitydoc.js +106 -0
- package/components/doc/tieredmenu/basicdoc.js +256 -0
- package/components/doc/tieredmenu/commanddoc.js +220 -0
- package/components/doc/tieredmenu/importdoc.js +17 -0
- package/components/doc/tieredmenu/popupdoc.js +271 -0
- package/components/doc/tieredmenu/pt/wireframe.js +12 -0
- package/components/doc/tieredmenu/routerdoc.js +166 -0
- package/components/doc/tieredmenu/styledoc.js +51 -0
- package/components/doc/tieredmenu/templatedoc.js +343 -0
- package/components/doc/tieredmenu/theming/styleddoc.js +47 -0
- package/components/doc/tieredmenu/theming/tailwinddoc.js +214 -0
- package/components/doc/timeline/accessibilitydoc.js +13 -0
- package/components/doc/timeline/alignmentdoc.js +86 -0
- package/components/doc/timeline/basicdoc.js +78 -0
- package/components/doc/timeline/horizontaldoc.js +63 -0
- package/components/doc/timeline/importdoc.js +17 -0
- package/components/doc/timeline/oppositedoc.js +79 -0
- package/components/doc/timeline/pt/wireframe.js +12 -0
- package/components/doc/timeline/styledoc.js +83 -0
- package/components/doc/timeline/templatedoc.js +162 -0
- package/components/doc/timeline/theming/styleddoc.js +79 -0
- package/components/doc/timeline/theming/tailwinddoc.js +108 -0
- package/components/doc/toast/accessibilitydoc.js +45 -0
- package/components/doc/toast/basicdoc.js +76 -0
- package/components/doc/toast/headlessdoc.js +251 -0
- package/components/doc/toast/importdoc.js +17 -0
- package/components/doc/toast/multipledoc.js +90 -0
- package/components/doc/toast/positiondoc.js +146 -0
- package/components/doc/toast/pt/wireframe.js +12 -0
- package/components/doc/toast/severitydoc.js +162 -0
- package/components/doc/toast/stickydoc.js +97 -0
- package/components/doc/toast/styledoc.js +55 -0
- package/components/doc/toast/templatedoc.js +162 -0
- package/components/doc/toast/theming/styleddoc.js +51 -0
- package/components/doc/toast/theming/tailwinddoc.js +96 -0
- package/components/doc/togglebutton/accessibilitydoc.js +52 -0
- package/components/doc/togglebutton/basicdoc.js +56 -0
- package/components/doc/togglebutton/customizeddoc.js +58 -0
- package/components/doc/togglebutton/disableddoc.js +56 -0
- package/components/doc/togglebutton/importdoc.js +17 -0
- package/components/doc/togglebutton/invaliddoc.js +56 -0
- package/components/doc/togglebutton/pt/wireframe.js +12 -0
- package/components/doc/togglebutton/styledoc.js +39 -0
- package/components/doc/togglebutton/theming/styleddoc.js +35 -0
- package/components/doc/togglebutton/theming/tailwinddoc.js +65 -0
- package/components/doc/toolbar/accessibilitydoc.js +27 -0
- package/components/doc/toolbar/basicdoc.js +162 -0
- package/components/doc/toolbar/customdoc.js +197 -0
- package/components/doc/toolbar/importdoc.js +17 -0
- package/components/doc/toolbar/pt/wireframe.js +12 -0
- package/components/doc/toolbar/styledoc.js +43 -0
- package/components/doc/toolbar/theming/styleddoc.js +39 -0
- package/components/doc/toolbar/theming/tailwinddoc.js +94 -0
- package/components/doc/tooltip/accessibilitydoc.js +32 -0
- package/components/doc/tooltip/autohidedoc.js +55 -0
- package/components/doc/tooltip/delaydoc.js +49 -0
- package/components/doc/tooltip/disableddoc.js +73 -0
- package/components/doc/tooltip/eventdoc.js +57 -0
- package/components/doc/tooltip/importdoc.js +17 -0
- package/components/doc/tooltip/mousetrackdoc.js +64 -0
- package/components/doc/tooltip/positiondoc.js +65 -0
- package/components/doc/tooltip/pt/wireframe.js +12 -0
- package/components/doc/tooltip/reactivedoc.js +93 -0
- package/components/doc/tooltip/styledoc.js +35 -0
- package/components/doc/tooltip/targetdoc.js +90 -0
- package/components/doc/tooltip/templatedoc.js +68 -0
- package/components/doc/tooltip/theming/styleddoc.js +35 -0
- package/components/doc/tooltip/theming/tailwinddoc.js +65 -0
- package/components/doc/tree/accessibilitydoc.js +83 -0
- package/components/doc/tree/basicdoc.js +100 -0
- package/components/doc/tree/contextmenudoc.js +219 -0
- package/components/doc/tree/controlleddoc.js +198 -0
- package/components/doc/tree/dragdropdoc.js +101 -0
- package/components/doc/tree/eventsdoc.js +176 -0
- package/components/doc/tree/filterdoc.js +106 -0
- package/components/doc/tree/importdoc.js +17 -0
- package/components/doc/tree/lazydoc.js +217 -0
- package/components/doc/tree/pt/wireframe.js +12 -0
- package/components/doc/tree/selection/checkboxselectiondoc.js +119 -0
- package/components/doc/tree/selection/multipleselectiondoc.js +138 -0
- package/components/doc/tree/selection/singleselectiondoc.js +104 -0
- package/components/doc/tree/styledoc.js +63 -0
- package/components/doc/tree/templatedoc.js +217 -0
- package/components/doc/tree/theming/styleddoc.js +63 -0
- package/components/doc/tree/theming/tailwinddoc.js +111 -0
- package/components/doc/treeselect/accessibilitydoc.js +193 -0
- package/components/doc/treeselect/basicdoc.js +112 -0
- package/components/doc/treeselect/checkboxdoc.js +123 -0
- package/components/doc/treeselect/clearicondoc.js +107 -0
- package/components/doc/treeselect/controlleddoc.js +222 -0
- package/components/doc/treeselect/disableddoc.js +56 -0
- package/components/doc/treeselect/filleddoc.js +107 -0
- package/components/doc/treeselect/filterdoc.js +109 -0
- package/components/doc/treeselect/floatlabeldoc.js +123 -0
- package/components/doc/treeselect/importdoc.js +17 -0
- package/components/doc/treeselect/invaliddoc.js +107 -0
- package/components/doc/treeselect/multipledoc.js +119 -0
- package/components/doc/treeselect/pt/wireframe.js +12 -0
- package/components/doc/treeselect/styledoc.js +47 -0
- package/components/doc/treeselect/theming/styleddoc.js +47 -0
- package/components/doc/treeselect/theming/tailwinddoc.js +82 -0
- package/components/doc/treetable/accessibilitydoc.js +129 -0
- package/components/doc/treetable/basicdoc.js +154 -0
- package/components/doc/treetable/columngroupdoc.js +630 -0
- package/components/doc/treetable/columntoggledoc.js +206 -0
- package/components/doc/treetable/conditionalstyledoc.js +187 -0
- package/components/doc/treetable/contextmenudoc.js +224 -0
- package/components/doc/treetable/controlleddoc.js +195 -0
- package/components/doc/treetable/dynamiccolumnsdoc.js +172 -0
- package/components/doc/treetable/editdoc.js +283 -0
- package/components/doc/treetable/filterdoc.js +241 -0
- package/components/doc/treetable/importdoc.js +18 -0
- package/components/doc/treetable/lazyloaddoc.js +336 -0
- package/components/doc/treetable/paginator/basicdoc.js +163 -0
- package/components/doc/treetable/paginator/templatedoc.js +196 -0
- package/components/doc/treetable/pt/wireframe.js +12 -0
- package/components/doc/treetable/reorderdoc.js +154 -0
- package/components/doc/treetable/resize/expandmodedoc.js +154 -0
- package/components/doc/treetable/resize/fitmodedoc.js +155 -0
- package/components/doc/treetable/scroll/frozencolumnsdoc.js +170 -0
- package/components/doc/treetable/scroll/horizontaldoc.js +164 -0
- package/components/doc/treetable/scroll/verticaldoc.js +154 -0
- package/components/doc/treetable/selection/checkboxdoc.js +173 -0
- package/components/doc/treetable/selection/eventsdoc.js +203 -0
- package/components/doc/treetable/selection/multipledoc.js +190 -0
- package/components/doc/treetable/selection/singledoc.js +182 -0
- package/components/doc/treetable/sort/multiplecolumnsdoc.js +160 -0
- package/components/doc/treetable/sort/singlecolumndoc.js +160 -0
- package/components/doc/treetable/statefuldoc.js +160 -0
- package/components/doc/treetable/styledoc.js +67 -0
- package/components/doc/treetable/templatedoc.js +264 -0
- package/components/doc/treetable/theming/styleddoc.js +63 -0
- package/components/doc/treetable/theming/tailwinddoc.js +205 -0
- package/components/doc/tristatecheckbox/accessibilitydoc.js +59 -0
- package/components/doc/tristatecheckbox/basicdoc.js +59 -0
- package/components/doc/tristatecheckbox/disableddoc.js +47 -0
- package/components/doc/tristatecheckbox/filleddoc.js +56 -0
- package/components/doc/tristatecheckbox/importdoc.js +17 -0
- package/components/doc/tristatecheckbox/invaliddoc.js +59 -0
- package/components/doc/tristatecheckbox/pt/wireframe.js +12 -0
- package/components/doc/tristatecheckbox/styledoc.js +42 -0
- package/components/doc/tristatecheckbox/theming/styleddoc.js +39 -0
- package/components/doc/tristatecheckbox/theming/tailwinddoc.js +67 -0
- package/components/doc/unstyled/architecturedoc.js +20 -0
- package/components/doc/unstyled/exampledoc.js +78 -0
- package/components/doc/unstyled/setupdoc.js +40 -0
- package/components/doc/unstyled/themedoc.js +44 -0
- package/components/doc/virtualscroller/accessibilitydoc.js +16 -0
- package/components/doc/virtualscroller/basicdoc.js +97 -0
- package/components/doc/virtualscroller/delaydoc.js +130 -0
- package/components/doc/virtualscroller/griddoc.js +114 -0
- package/components/doc/virtualscroller/horizontaldoc.js +96 -0
- package/components/doc/virtualscroller/importdoc.js +17 -0
- package/components/doc/virtualscroller/lazydoc.js +237 -0
- package/components/doc/virtualscroller/loadingdoc.js +157 -0
- package/components/doc/virtualscroller/pt/wireframe.js +12 -0
- package/components/doc/virtualscroller/styledoc.js +46 -0
- package/components/doc/virtualscroller/theming/styleddoc.js +43 -0
- package/components/landing/blocksection.js +392 -0
- package/components/landing/featuressection.js +72 -0
- package/components/landing/footersection.js +165 -0
- package/components/landing/getstartedsection.js +38 -0
- package/components/landing/herosection.js +236 -0
- package/components/landing/templatesection.js +136 -0
- package/components/landing/themesection.js +231 -0
- package/components/landing/userssection.js +63 -0
- package/components/layout/appcontentcontext.js +5 -0
- package/components/layout/config.js +368 -0
- package/components/layout/footer.js +16 -0
- package/components/layout/layout.js +93 -0
- package/components/layout/menu.js +44 -0
- package/components/layout/menu.json +724 -0
- package/components/layout/menuitem.js +71 -0
- package/components/layout/topbar.js +270 -0
- package/components/lib/accordion/Accordion.js +349 -0
- package/components/lib/accordion/AccordionBase.js +87 -0
- package/components/lib/accordion/accordion.d.ts +342 -0
- package/components/lib/accordion/package.json +7 -0
- package/components/lib/api/Api.js +13 -0
- package/components/lib/api/FilterMatchMode.js +20 -0
- package/components/lib/api/FilterOperator.js +4 -0
- package/components/lib/api/FilterService.js +267 -0
- package/components/lib/api/Locale.js +233 -0
- package/components/lib/api/MessageSeverity.js +8 -0
- package/components/lib/api/PrimeIcons.js +316 -0
- package/components/lib/api/PrimeReact.js +62 -0
- package/components/lib/api/PrimeReactContext.js +123 -0
- package/components/lib/api/SortOrder.js +5 -0
- package/components/lib/api/api.d.ts +1527 -0
- package/components/lib/api/package.json +7 -0
- package/components/lib/api/test/FilterService.spec.js +331 -0
- package/components/lib/autocomplete/AutoComplete.js +821 -0
- package/components/lib/autocomplete/AutoCompleteBase.js +223 -0
- package/components/lib/autocomplete/AutoCompletePanel.js +309 -0
- package/components/lib/autocomplete/autocomplete.d.ts +611 -0
- package/components/lib/autocomplete/package.json +7 -0
- package/components/lib/avatar/Avatar.js +107 -0
- package/components/lib/avatar/Avatar.spec.js +23 -0
- package/components/lib/avatar/AvatarBase.js +75 -0
- package/components/lib/avatar/__snapshots__/Avatar.spec.js.snap +134 -0
- package/components/lib/avatar/avatar.d.ts +158 -0
- package/components/lib/avatar/package.json +7 -0
- package/components/lib/avatargroup/AvatarGroup.js +39 -0
- package/components/lib/avatargroup/AvatarGroup.spec.js +18 -0
- package/components/lib/avatargroup/AvatarGroupBase.js +31 -0
- package/components/lib/avatargroup/__snapshots__/AvatarGroup.spec.js.snap +67 -0
- package/components/lib/avatargroup/avatargroup.d.ts +82 -0
- package/components/lib/avatargroup/package.json +7 -0
- package/components/lib/badge/Badge.js +42 -0
- package/components/lib/badge/Badge.spec.js +17 -0
- package/components/lib/badge/BadgeBase.js +67 -0
- package/components/lib/badge/__snapshots__/Badge.spec.js.snap +103 -0
- package/components/lib/badge/badge.d.ts +99 -0
- package/components/lib/badge/package.json +7 -0
- package/components/lib/blockui/BlockUI.js +142 -0
- package/components/lib/blockui/BlockUI.spec.js +93 -0
- package/components/lib/blockui/BlockUIBase.js +56 -0
- package/components/lib/blockui/__snapshots__/BlockUI.spec.js.snap +260 -0
- package/components/lib/blockui/blockui.d.ts +142 -0
- package/components/lib/blockui/package.json +7 -0
- package/components/lib/breadcrumb/BreadCrumb.js +275 -0
- package/components/lib/breadcrumb/BreadCrumbBase.js +68 -0
- package/components/lib/breadcrumb/breadcrumb.d.ts +124 -0
- package/components/lib/breadcrumb/package.json +7 -0
- package/components/lib/button/Button.js +142 -0
- package/components/lib/button/Button.spec.js +165 -0
- package/components/lib/button/ButtonBase.js +62 -0
- package/components/lib/button/__snapshots__/Button.spec.js.snap +266 -0
- package/components/lib/button/button.d.ts +199 -0
- package/components/lib/button/package.json +7 -0
- package/components/lib/buttongroup/ButtonGroup.js +40 -0
- package/components/lib/buttongroup/ButtonGroupBase.js +15 -0
- package/components/lib/buttongroup/buttongroup.d.ts +86 -0
- package/components/lib/buttongroup/package.json +7 -0
- package/components/lib/calendar/Calendar.js +4508 -0
- package/components/lib/calendar/Calendar.spec.js +93 -0
- package/components/lib/calendar/CalendarBase.js +339 -0
- package/components/lib/calendar/CalendarPanel.js +56 -0
- package/components/lib/calendar/calendar.d.ts +1048 -0
- package/components/lib/calendar/package.json +7 -0
- package/components/lib/card/Card.js +116 -0
- package/components/lib/card/Card.spec.js +47 -0
- package/components/lib/card/CardBase.js +37 -0
- package/components/lib/card/__snapshots__/Card.spec.js.snap +166 -0
- package/components/lib/card/card.d.ts +118 -0
- package/components/lib/card/package.json +7 -0
- package/components/lib/carousel/Carousel.js +841 -0
- package/components/lib/carousel/CarouselBase.js +157 -0
- package/components/lib/carousel/carousel.d.ts +312 -0
- package/components/lib/carousel/package.json +7 -0
- package/components/lib/cascadeselect/CascadeSelect.js +562 -0
- package/components/lib/cascadeselect/CascadeSelectBase.js +179 -0
- package/components/lib/cascadeselect/CascadeSelectSub.js +327 -0
- package/components/lib/cascadeselect/cascadeselect.d.ts +390 -0
- package/components/lib/cascadeselect/package.json +7 -0
- package/components/lib/chart/Chart.js +127 -0
- package/components/lib/chart/ChartBase.js +39 -0
- package/components/lib/chart/chart.d.ts +141 -0
- package/components/lib/chart/package.json +7 -0
- package/components/lib/checkbox/Checkbox.js +181 -0
- package/components/lib/checkbox/CheckboxBase.js +48 -0
- package/components/lib/checkbox/checkbox.d.ts +261 -0
- package/components/lib/checkbox/package.json +7 -0
- package/components/lib/chip/Chip.js +146 -0
- package/components/lib/chip/Chip.spec.js +43 -0
- package/components/lib/chip/ChipBase.js +60 -0
- package/components/lib/chip/__snapshots__/Chip.spec.js.snap +138 -0
- package/components/lib/chip/chip.d.ts +177 -0
- package/components/lib/chip/package.json +7 -0
- package/components/lib/chips/Chips.js +472 -0
- package/components/lib/chips/ChipsBase.js +138 -0
- package/components/lib/chips/chips.d.ts +320 -0
- package/components/lib/chips/package.json +7 -0
- package/components/lib/colorpicker/ColorPicker.js +685 -0
- package/components/lib/colorpicker/ColorPickerBase.js +155 -0
- package/components/lib/colorpicker/ColorPickerPanel.js +52 -0
- package/components/lib/colorpicker/colorpicker.d.ts +290 -0
- package/components/lib/colorpicker/package.json +7 -0
- package/components/lib/column/Column.js +4 -0
- package/components/lib/column/ColumnBase.js +89 -0
- package/components/lib/column/column.d.ts +1180 -0
- package/components/lib/column/package.json +7 -0
- package/components/lib/columngroup/ColumnGroup.js +3 -0
- package/components/lib/columngroup/ColumnGroupBase.js +11 -0
- package/components/lib/columngroup/columngroup.d.ts +82 -0
- package/components/lib/columngroup/package.json +7 -0
- package/components/lib/componentbase/ComponentBase.js +650 -0
- package/components/lib/componentbase/componentbase.d.ts +25 -0
- package/components/lib/componentbase/package.json +7 -0
- package/components/lib/confirmdialog/ConfirmDialog.js +272 -0
- package/components/lib/confirmdialog/ConfirmDialogBase.js +42 -0
- package/components/lib/confirmdialog/confirmdialog.d.ts +294 -0
- package/components/lib/confirmdialog/package.json +7 -0
- package/components/lib/confirmpopup/ConfirmPopup.js +424 -0
- package/components/lib/confirmpopup/ConfirmPopupBase.js +110 -0
- package/components/lib/confirmpopup/confirmpopup.d.ts +333 -0
- package/components/lib/confirmpopup/package.json +7 -0
- package/components/lib/contextmenu/ContextMenu.js +757 -0
- package/components/lib/contextmenu/ContextMenuBase.js +101 -0
- package/components/lib/contextmenu/ContextMenuSub.js +342 -0
- package/components/lib/contextmenu/contextmenu.d.ts +235 -0
- package/components/lib/contextmenu/package.json +7 -0
- package/components/lib/csstransition/CSSTransition.js +73 -0
- package/components/lib/csstransition/CSSTransitionBase.js +10 -0
- package/components/lib/csstransition/csstransition.d.ts +38 -0
- package/components/lib/csstransition/package.json +7 -0
- package/components/lib/datascroller/DataScroller.js +261 -0
- package/components/lib/datascroller/DataScrollerBase.js +76 -0
- package/components/lib/datascroller/datascroller.d.ts +182 -0
- package/components/lib/datascroller/package.json +7 -0
- package/components/lib/datatable/BodyCell.js +704 -0
- package/components/lib/datatable/BodyRow.js +714 -0
- package/components/lib/datatable/ColumnFilter.js +956 -0
- package/components/lib/datatable/DataTable.js +2122 -0
- package/components/lib/datatable/DataTableBase.js +583 -0
- package/components/lib/datatable/FooterCell.js +108 -0
- package/components/lib/datatable/HeaderCell.js +457 -0
- package/components/lib/datatable/HeaderCheckbox.js +66 -0
- package/components/lib/datatable/RowCheckbox.js +60 -0
- package/components/lib/datatable/RowRadioButton.js +47 -0
- package/components/lib/datatable/RowTogglerButton.js +65 -0
- package/components/lib/datatable/TableBody.js +1185 -0
- package/components/lib/datatable/TableFooter.js +114 -0
- package/components/lib/datatable/TableHeader.js +290 -0
- package/components/lib/datatable/datatable.d.ts +2069 -0
- package/components/lib/datatable/package.json +7 -0
- package/components/lib/dataview/DataView.js +355 -0
- package/components/lib/dataview/DataViewBase.js +101 -0
- package/components/lib/dataview/dataview.d.ts +388 -0
- package/components/lib/dataview/package.json +7 -0
- package/components/lib/deferredcontent/DeferredContent.js +70 -0
- package/components/lib/deferredcontent/DeferredContentBase.js +9 -0
- package/components/lib/deferredcontent/deferredcontent.d.ts +96 -0
- package/components/lib/deferredcontent/package.json +7 -0
- package/components/lib/dialog/Dialog.js +717 -0
- package/components/lib/dialog/DialogBase.js +309 -0
- package/components/lib/dialog/dialog.d.ts +488 -0
- package/components/lib/dialog/package.json +7 -0
- package/components/lib/divider/Divider.js +53 -0
- package/components/lib/divider/Divider.spec.js +16 -0
- package/components/lib/divider/DividerBase.js +131 -0
- package/components/lib/divider/__snapshots__/Divider.spec.js.snap +163 -0
- package/components/lib/divider/divider.d.ts +102 -0
- package/components/lib/divider/package.json +7 -0
- package/components/lib/dock/Dock.js +356 -0
- package/components/lib/dock/DockBase.js +170 -0
- package/components/lib/dock/dock.d.ts +194 -0
- package/components/lib/dock/package.json +7 -0
- package/components/lib/dropdown/Dropdown.js +1302 -0
- package/components/lib/dropdown/DropdownBase.js +244 -0
- package/components/lib/dropdown/DropdownItem.js +90 -0
- package/components/lib/dropdown/DropdownPanel.js +352 -0
- package/components/lib/dropdown/dropdown.d.ts +643 -0
- package/components/lib/dropdown/package.json +7 -0
- package/components/lib/editor/Editor.js +276 -0
- package/components/lib/editor/EditorBase.js +1096 -0
- package/components/lib/editor/editor.d.ts +220 -0
- package/components/lib/editor/package.json +7 -0
- package/components/lib/fieldset/Fieldset.js +220 -0
- package/components/lib/fieldset/Fieldset.spec.js +81 -0
- package/components/lib/fieldset/FieldsetBase.js +58 -0
- package/components/lib/fieldset/__snapshots__/Fieldset.spec.js.snap +378 -0
- package/components/lib/fieldset/fieldset.d.ts +210 -0
- package/components/lib/fieldset/package.json +7 -0
- package/components/lib/fileupload/FileUpload.js +761 -0
- package/components/lib/fileupload/FileUploadBase.js +159 -0
- package/components/lib/fileupload/fileupload.d.ts +706 -0
- package/components/lib/fileupload/package.json +7 -0
- package/components/lib/floatlabel/FloatLabel.js +37 -0
- package/components/lib/floatlabel/FloatLabelBase.js +65 -0
- package/components/lib/floatlabel/floatlabel.d.ts +86 -0
- package/components/lib/floatlabel/package.json +7 -0
- package/components/lib/focustrap/FocusTrap.js +128 -0
- package/components/lib/focustrap/FocusTrapBase.js +16 -0
- package/components/lib/focustrap/package.json +7 -0
- package/components/lib/galleria/Galleria.js +348 -0
- package/components/lib/galleria/GalleriaBase.js +427 -0
- package/components/lib/galleria/GalleriaItem.js +388 -0
- package/components/lib/galleria/GalleriaThumbnails.js +612 -0
- package/components/lib/galleria/galleria.d.ts +419 -0
- package/components/lib/galleria/package.json +7 -0
- package/components/lib/hooks/Hooks.js +52 -0
- package/components/lib/hooks/hooks.d.ts +308 -0
- package/components/lib/hooks/package.json +7 -0
- package/components/lib/hooks/useClickOutside.js +38 -0
- package/components/lib/hooks/useCounter.js +34 -0
- package/components/lib/hooks/useDebounce.js +31 -0
- package/components/lib/hooks/useDisplayOrder.js +37 -0
- package/components/lib/hooks/useEventListener.js +73 -0
- package/components/lib/hooks/useFavicon.js +27 -0
- package/components/lib/hooks/useGlobalOnEscapeKey.js +113 -0
- package/components/lib/hooks/useIntersectionObserver.js +23 -0
- package/components/lib/hooks/useInterval.js +34 -0
- package/components/lib/hooks/useLocale.js +240 -0
- package/components/lib/hooks/useMatchMedia.js +25 -0
- package/components/lib/hooks/useMergeProps.js +14 -0
- package/components/lib/hooks/useMountEffect.js +18 -0
- package/components/lib/hooks/useMouse.js +58 -0
- package/components/lib/hooks/useMove.js +156 -0
- package/components/lib/hooks/useOverlayListener.js +83 -0
- package/components/lib/hooks/useOverlayScrollListener.js +86 -0
- package/components/lib/hooks/usePrevious.js +15 -0
- package/components/lib/hooks/useResizeListener.js +9 -0
- package/components/lib/hooks/useStorage.js +88 -0
- package/components/lib/hooks/useStyle.js +97 -0
- package/components/lib/hooks/useTimeout.js +34 -0
- package/components/lib/hooks/useUnmountEffect.js +5 -0
- package/components/lib/hooks/useUpdateEffect.js +15 -0
- package/components/lib/iconbase/IconBase.js +30 -0
- package/components/lib/iconbase/iconbase.d.ts +9 -0
- package/components/lib/iconbase/package.json +7 -0
- package/components/lib/iconfield/IconField.d.ts +95 -0
- package/components/lib/iconfield/IconField.js +42 -0
- package/components/lib/iconfield/IconFieldBase.js +24 -0
- package/components/lib/iconfield/package.json +7 -0
- package/components/lib/icons/angledoubledown/index.d.ts +19 -0
- package/components/lib/icons/angledoubledown/index.js +21 -0
- package/components/lib/icons/angledoubledown/package.json +7 -0
- package/components/lib/icons/angledoubleleft/index.d.ts +19 -0
- package/components/lib/icons/angledoubleleft/index.js +21 -0
- package/components/lib/icons/angledoubleleft/package.json +7 -0
- package/components/lib/icons/angledoubleright/index.d.ts +19 -0
- package/components/lib/icons/angledoubleright/index.js +21 -0
- package/components/lib/icons/angledoubleright/package.json +7 -0
- package/components/lib/icons/angledoubleup/index.d.ts +19 -0
- package/components/lib/icons/angledoubleup/index.js +21 -0
- package/components/lib/icons/angledoubleup/package.json +7 -0
- package/components/lib/icons/angledown/index.d.ts +19 -0
- package/components/lib/icons/angledown/index.js +19 -0
- package/components/lib/icons/angledown/package.json +7 -0
- package/components/lib/icons/angleleft/index.d.ts +19 -0
- package/components/lib/icons/angleleft/index.js +19 -0
- package/components/lib/icons/angleleft/package.json +7 -0
- package/components/lib/icons/angleright/index.d.ts +19 -0
- package/components/lib/icons/angleright/index.js +19 -0
- package/components/lib/icons/angleright/package.json +7 -0
- package/components/lib/icons/angleup/index.d.ts +19 -0
- package/components/lib/icons/angleup/index.js +19 -0
- package/components/lib/icons/angleup/package.json +7 -0
- package/components/lib/icons/arrowdown/index.d.ts +19 -0
- package/components/lib/icons/arrowdown/index.js +21 -0
- package/components/lib/icons/arrowdown/package.json +7 -0
- package/components/lib/icons/arrowup/index.d.ts +19 -0
- package/components/lib/icons/arrowup/index.js +21 -0
- package/components/lib/icons/arrowup/package.json +7 -0
- package/components/lib/icons/ban/index.d.ts +19 -0
- package/components/lib/icons/ban/index.js +19 -0
- package/components/lib/icons/ban/package.json +7 -0
- package/components/lib/icons/bars/index.d.ts +19 -0
- package/components/lib/icons/bars/index.js +21 -0
- package/components/lib/icons/bars/package.json +7 -0
- package/components/lib/icons/blank/index.d.ts +19 -0
- package/components/lib/icons/blank/index.js +16 -0
- package/components/lib/icons/blank/package.json +7 -0
- package/components/lib/icons/calendar/index.d.ts +19 -0
- package/components/lib/icons/calendar/index.js +19 -0
- package/components/lib/icons/calendar/package.json +7 -0
- package/components/lib/icons/check/index.d.ts +19 -0
- package/components/lib/icons/check/index.js +19 -0
- package/components/lib/icons/check/package.json +7 -0
- package/components/lib/icons/chevrondown/index.d.ts +19 -0
- package/components/lib/icons/chevrondown/index.js +19 -0
- package/components/lib/icons/chevrondown/package.json +7 -0
- package/components/lib/icons/chevronleft/index.d.ts +19 -0
- package/components/lib/icons/chevronleft/index.js +19 -0
- package/components/lib/icons/chevronleft/package.json +7 -0
- package/components/lib/icons/chevronright/index.d.ts +19 -0
- package/components/lib/icons/chevronright/index.js +19 -0
- package/components/lib/icons/chevronright/package.json +7 -0
- package/components/lib/icons/chevronup/index.d.ts +19 -0
- package/components/lib/icons/chevronup/index.js +19 -0
- package/components/lib/icons/chevronup/package.json +7 -0
- package/components/lib/icons/download/index.d.ts +19 -0
- package/components/lib/icons/download/index.js +21 -0
- package/components/lib/icons/download/package.json +7 -0
- package/components/lib/icons/exclamationtriangle/index.d.ts +19 -0
- package/components/lib/icons/exclamationtriangle/index.js +27 -0
- package/components/lib/icons/exclamationtriangle/package.json +7 -0
- package/components/lib/icons/eye/index.d.ts +19 -0
- package/components/lib/icons/eye/index.js +21 -0
- package/components/lib/icons/eye/package.json +7 -0
- package/components/lib/icons/eyeslash/index.d.ts +19 -0
- package/components/lib/icons/eyeslash/index.js +21 -0
- package/components/lib/icons/eyeslash/package.json +7 -0
- package/components/lib/icons/filter/index.d.ts +19 -0
- package/components/lib/icons/filter/index.js +19 -0
- package/components/lib/icons/filter/package.json +7 -0
- package/components/lib/icons/filterslash/index.d.ts +19 -0
- package/components/lib/icons/filterslash/index.js +21 -0
- package/components/lib/icons/filterslash/package.json +7 -0
- package/components/lib/icons/infocircle/index.d.ts +19 -0
- package/components/lib/icons/infocircle/index.js +21 -0
- package/components/lib/icons/infocircle/package.json +7 -0
- package/components/lib/icons/minus/index.d.ts +19 -0
- package/components/lib/icons/minus/index.js +19 -0
- package/components/lib/icons/minus/package.json +7 -0
- package/components/lib/icons/pencil/index.d.ts +19 -0
- package/components/lib/icons/pencil/index.js +19 -0
- package/components/lib/icons/pencil/package.json +7 -0
- package/components/lib/icons/plus/index.d.ts +19 -0
- package/components/lib/icons/plus/index.js +19 -0
- package/components/lib/icons/plus/package.json +7 -0
- package/components/lib/icons/refresh/index.d.ts +19 -0
- package/components/lib/icons/refresh/index.js +21 -0
- package/components/lib/icons/refresh/package.json +7 -0
- package/components/lib/icons/search/index.d.ts +19 -0
- package/components/lib/icons/search/index.js +21 -0
- package/components/lib/icons/search/package.json +7 -0
- package/components/lib/icons/searchminus/index.d.ts +19 -0
- package/components/lib/icons/searchminus/index.js +21 -0
- package/components/lib/icons/searchminus/package.json +7 -0
- package/components/lib/icons/searchplus/index.d.ts +19 -0
- package/components/lib/icons/searchplus/index.js +21 -0
- package/components/lib/icons/searchplus/package.json +7 -0
- package/components/lib/icons/sortalt/index.d.ts +19 -0
- package/components/lib/icons/sortalt/index.js +25 -0
- package/components/lib/icons/sortalt/package.json +7 -0
- package/components/lib/icons/sortamountdown/index.d.ts +19 -0
- package/components/lib/icons/sortamountdown/index.js +19 -0
- package/components/lib/icons/sortamountdown/package.json +7 -0
- package/components/lib/icons/sortamountupalt/index.d.ts +19 -0
- package/components/lib/icons/sortamountupalt/index.js +19 -0
- package/components/lib/icons/sortamountupalt/package.json +7 -0
- package/components/lib/icons/spinner/index.d.ts +19 -0
- package/components/lib/icons/spinner/index.js +19 -0
- package/components/lib/icons/spinner/package.json +7 -0
- package/components/lib/icons/star/index.d.ts +19 -0
- package/components/lib/icons/star/index.js +19 -0
- package/components/lib/icons/star/package.json +7 -0
- package/components/lib/icons/starfill/index.d.ts +19 -0
- package/components/lib/icons/starfill/index.js +19 -0
- package/components/lib/icons/starfill/package.json +7 -0
- package/components/lib/icons/thlarge/index.d.ts +19 -0
- package/components/lib/icons/thlarge/index.js +21 -0
- package/components/lib/icons/thlarge/package.json +7 -0
- package/components/lib/icons/times/index.d.ts +19 -0
- package/components/lib/icons/times/index.js +19 -0
- package/components/lib/icons/times/package.json +7 -0
- package/components/lib/icons/timescircle/index.d.ts +19 -0
- package/components/lib/icons/timescircle/index.js +21 -0
- package/components/lib/icons/timescircle/package.json +7 -0
- package/components/lib/icons/trash/index.d.ts +19 -0
- package/components/lib/icons/trash/index.js +21 -0
- package/components/lib/icons/trash/package.json +7 -0
- package/components/lib/icons/undo/index.d.ts +19 -0
- package/components/lib/icons/undo/index.js +21 -0
- package/components/lib/icons/undo/package.json +7 -0
- package/components/lib/icons/upload/index.d.ts +19 -0
- package/components/lib/icons/upload/index.js +21 -0
- package/components/lib/icons/upload/package.json +7 -0
- package/components/lib/icons/windowmaximize/index.d.ts +19 -0
- package/components/lib/icons/windowmaximize/index.js +21 -0
- package/components/lib/icons/windowmaximize/package.json +7 -0
- package/components/lib/icons/windowminimize/index.d.ts +19 -0
- package/components/lib/icons/windowminimize/index.js +21 -0
- package/components/lib/icons/windowminimize/package.json +7 -0
- package/components/lib/image/Image.js +403 -0
- package/components/lib/image/ImageBase.js +157 -0
- package/components/lib/image/image.d.ts +305 -0
- package/components/lib/image/package.json +7 -0
- package/components/lib/inplace/Inplace.js +170 -0
- package/components/lib/inplace/InplaceBase.js +77 -0
- package/components/lib/inplace/inplace.d.ts +206 -0
- package/components/lib/inplace/package.json +7 -0
- package/components/lib/inputicon/InputIcon.d.ts +78 -0
- package/components/lib/inputicon/InputIcon.js +40 -0
- package/components/lib/inputicon/InputIconBase.js +18 -0
- package/components/lib/inputicon/package.json +7 -0
- package/components/lib/inputmask/InputMask.js +668 -0
- package/components/lib/inputmask/InputMaskBase.js +47 -0
- package/components/lib/inputmask/inputmask.d.ts +161 -0
- package/components/lib/inputmask/package.json +7 -0
- package/components/lib/inputnumber/InputNumber.js +1417 -0
- package/components/lib/inputnumber/InputNumber.spec.js +101 -0
- package/components/lib/inputnumber/InputNumberBase.js +199 -0
- package/components/lib/inputnumber/inputnumber.d.ts +378 -0
- package/components/lib/inputnumber/package.json +7 -0
- package/components/lib/inputotp/BaseInputOtp.js +26 -0
- package/components/lib/inputotp/InputOtp.js +263 -0
- package/components/lib/inputotp/inputotp.d.ts +173 -0
- package/components/lib/inputotp/package.json +7 -0
- package/components/lib/inputswitch/InputSwitch.js +125 -0
- package/components/lib/inputswitch/InputSwitchBase.js +41 -0
- package/components/lib/inputswitch/inputswitch.d.ts +199 -0
- package/components/lib/inputswitch/package.json +7 -0
- package/components/lib/inputtext/InputText.js +103 -0
- package/components/lib/inputtext/InputText.spec.js +141 -0
- package/components/lib/inputtext/InputTextBase.js +36 -0
- package/components/lib/inputtext/__snapshots__/InputText.spec.js.snap +52 -0
- package/components/lib/inputtext/inputtext.d.ts +146 -0
- package/components/lib/inputtext/package.json +7 -0
- package/components/lib/inputtextarea/InputTextarea.js +164 -0
- package/components/lib/inputtextarea/InputTextarea.spec.js +141 -0
- package/components/lib/inputtextarea/InputTextareaBase.js +53 -0
- package/components/lib/inputtextarea/__snapshots__/InputTextarea.spec.js.snap +54 -0
- package/components/lib/inputtextarea/inputtextarea.d.ts +130 -0
- package/components/lib/inputtextarea/package.json +7 -0
- package/components/lib/keyfilter/KeyFilter.js +93 -0
- package/components/lib/keyfilter/keyfilteroptions.d.ts +16 -0
- package/components/lib/keyfilter/package.json +7 -0
- package/components/lib/knob/Knob.js +307 -0
- package/components/lib/knob/KnobBase.js +62 -0
- package/components/lib/knob/knob.d.ts +197 -0
- package/components/lib/knob/package.json +7 -0
- package/components/lib/listbox/ListBox.js +931 -0
- package/components/lib/listbox/ListBoxBase.js +123 -0
- package/components/lib/listbox/ListBoxHeader.js +98 -0
- package/components/lib/listbox/ListBoxItem.js +85 -0
- package/components/lib/listbox/listbox.d.ts +461 -0
- package/components/lib/listbox/package.json +7 -0
- package/components/lib/megamenu/MegaMenu.js +1305 -0
- package/components/lib/megamenu/MegaMenuBase.js +213 -0
- package/components/lib/megamenu/megamenu.d.ts +256 -0
- package/components/lib/megamenu/package.json +7 -0
- package/components/lib/mention/Mention.js +580 -0
- package/components/lib/mention/MentionBase.js +101 -0
- package/components/lib/mention/mention.d.ts +336 -0
- package/components/lib/mention/package.json +7 -0
- package/components/lib/menu/Menu.js +517 -0
- package/components/lib/menu/MenuBase.js +89 -0
- package/components/lib/menu/menu.d.ts +248 -0
- package/components/lib/menu/package.json +7 -0
- package/components/lib/menubar/Menubar.js +699 -0
- package/components/lib/menubar/MenubarBase.js +120 -0
- package/components/lib/menubar/MenubarSub.js +302 -0
- package/components/lib/menubar/menubar.d.ts +236 -0
- package/components/lib/menubar/package.json +7 -0
- package/components/lib/menuitem/menuitem.d.ts +129 -0
- package/components/lib/menuitem/package.json +4 -0
- package/components/lib/message/Message.js +105 -0
- package/components/lib/message/Message.spec.js +20 -0
- package/components/lib/message/MessageBase.js +49 -0
- package/components/lib/message/__snapshots__/Message.spec.js.snap +256 -0
- package/components/lib/message/message.d.ts +109 -0
- package/components/lib/message/package.json +7 -0
- package/components/lib/messages/Messages.js +135 -0
- package/components/lib/messages/MessagesBase.js +87 -0
- package/components/lib/messages/UIMessage.js +189 -0
- package/components/lib/messages/messages.d.ts +225 -0
- package/components/lib/messages/package.json +7 -0
- package/components/lib/metergroup/MeterGroup.js +162 -0
- package/components/lib/metergroup/MeterGroupBase.js +96 -0
- package/components/lib/metergroup/metergroup.d.ts +176 -0
- package/components/lib/metergroup/package.json +7 -0
- package/components/lib/multiselect/MultiSelect.js +1268 -0
- package/components/lib/multiselect/MultiSelectBase.js +293 -0
- package/components/lib/multiselect/MultiSelectHeader.js +206 -0
- package/components/lib/multiselect/MultiSelectItem.js +91 -0
- package/components/lib/multiselect/MultiSelectPanel.js +351 -0
- package/components/lib/multiselect/multiselect.d.ts +817 -0
- package/components/lib/multiselect/package.json +7 -0
- package/components/lib/multistatecheckbox/MultiStateCheckbox.js +211 -0
- package/components/lib/multistatecheckbox/MultiStateCheckboxBase.js +52 -0
- package/components/lib/multistatecheckbox/multistatecheckbox.d.ts +279 -0
- package/components/lib/multistatecheckbox/package.json +7 -0
- package/components/lib/orderlist/OrderList.js +539 -0
- package/components/lib/orderlist/OrderListBase.js +124 -0
- package/components/lib/orderlist/OrderListControls.js +210 -0
- package/components/lib/orderlist/OrderListSubList.js +329 -0
- package/components/lib/orderlist/orderlist.d.ts +317 -0
- package/components/lib/orderlist/package.json +7 -0
- package/components/lib/organizationchart/OrganizationChart.js +112 -0
- package/components/lib/organizationchart/OrganizationChartBase.js +102 -0
- package/components/lib/organizationchart/OrganizationChartNode.js +323 -0
- package/components/lib/organizationchart/organizationchart.d.ts +269 -0
- package/components/lib/organizationchart/package.json +7 -0
- package/components/lib/overlaypanel/OverlayPanel.js +333 -0
- package/components/lib/overlaypanel/OverlayPanelBase.js +122 -0
- package/components/lib/overlaypanel/overlaypanel.d.ts +195 -0
- package/components/lib/overlaypanel/package.json +7 -0
- package/components/lib/overlayservice/OverlayService.js +3 -0
- package/components/lib/overlayservice/overlayservice.d.ts +60 -0
- package/components/lib/overlayservice/package.json +7 -0
- package/components/lib/paginator/CurrentPageReport.js +56 -0
- package/components/lib/paginator/FirstPageLink.js +67 -0
- package/components/lib/paginator/JumpToPageInput.js +43 -0
- package/components/lib/paginator/LastPageLink.js +67 -0
- package/components/lib/paginator/NextPageLink.js +71 -0
- package/components/lib/paginator/PageLinks.js +100 -0
- package/components/lib/paginator/Paginator.js +327 -0
- package/components/lib/paginator/PaginatorBase.js +191 -0
- package/components/lib/paginator/PrevPageLink.js +68 -0
- package/components/lib/paginator/RowsPerPageDropdown.js +56 -0
- package/components/lib/paginator/package.json +7 -0
- package/components/lib/paginator/paginator.d.ts +746 -0
- package/components/lib/panel/Panel.js +269 -0
- package/components/lib/panel/Panel.spec.js +102 -0
- package/components/lib/panel/PanelBase.js +65 -0
- package/components/lib/panel/__snapshots__/Panel.spec.js.snap +463 -0
- package/components/lib/panel/package.json +7 -0
- package/components/lib/panel/panel.d.ts +307 -0
- package/components/lib/panelmenu/PanelMenu.js +448 -0
- package/components/lib/panelmenu/PanelMenuBase.js +93 -0
- package/components/lib/panelmenu/PanelMenuList.js +448 -0
- package/components/lib/panelmenu/PanelMenuSub.js +293 -0
- package/components/lib/panelmenu/package.json +7 -0
- package/components/lib/panelmenu/panelmenu.d.ts +251 -0
- package/components/lib/passthrough/index.d.ts +19 -0
- package/components/lib/passthrough/index.js +18 -0
- package/components/lib/passthrough/package.json +6 -0
- package/components/lib/passthrough/tailwind/index.d.ts +4 -0
- package/components/lib/passthrough/tailwind/index.js +3563 -0
- package/components/lib/passthrough/tailwind/package.json +6 -0
- package/components/lib/password/Password.js +509 -0
- package/components/lib/password/PasswordBase.js +113 -0
- package/components/lib/password/package.json +7 -0
- package/components/lib/password/password.d.ts +344 -0
- package/components/lib/picklist/PickList.js +762 -0
- package/components/lib/picklist/PickListBase.js +142 -0
- package/components/lib/picklist/PickListControls.js +159 -0
- package/components/lib/picklist/PickListItem.js +77 -0
- package/components/lib/picklist/PickListSubList.js +209 -0
- package/components/lib/picklist/PickListTransferControls.js +164 -0
- package/components/lib/picklist/package.json +7 -0
- package/components/lib/picklist/picklist.d.ts +523 -0
- package/components/lib/portal/Portal.js +48 -0
- package/components/lib/portal/PortalBase.js +15 -0
- package/components/lib/portal/package.json +6 -0
- package/components/lib/primereact.all.js +151 -0
- package/components/lib/progressbar/ProgressBar.js +120 -0
- package/components/lib/progressbar/ProgressBar.spec.js +12 -0
- package/components/lib/progressbar/ProgressBarBase.js +141 -0
- package/components/lib/progressbar/__snapshots__/ProgressBar.spec.js.snap +145 -0
- package/components/lib/progressbar/package.json +7 -0
- package/components/lib/progressbar/progressbar.d.ts +123 -0
- package/components/lib/progressspinner/ProgressSpinner.js +72 -0
- package/components/lib/progressspinner/ProgressSpinner.spec.js +11 -0
- package/components/lib/progressspinner/ProgressSpinnerBase.js +105 -0
- package/components/lib/progressspinner/__snapshots__/ProgressSpinner.spec.js.snap +121 -0
- package/components/lib/progressspinner/package.json +7 -0
- package/components/lib/progressspinner/progressspinner.d.ts +106 -0
- package/components/lib/radiobutton/RadioButton.js +188 -0
- package/components/lib/radiobutton/RadioButtonBase.js +43 -0
- package/components/lib/radiobutton/package.json +7 -0
- package/components/lib/radiobutton/radiobutton.d.ts +191 -0
- package/components/lib/rating/Rating.js +222 -0
- package/components/lib/rating/RatingBase.js +61 -0
- package/components/lib/rating/package.json +7 -0
- package/components/lib/rating/rating.d.ts +193 -0
- package/components/lib/ripple/Ripple.js +129 -0
- package/components/lib/ripple/Ripple.spec.js +44 -0
- package/components/lib/ripple/RippleBase.js +52 -0
- package/components/lib/ripple/__snapshots__/Ripple.spec.js.snap +35 -0
- package/components/lib/ripple/package.json +7 -0
- package/components/lib/ripple/ripple.d.ts +72 -0
- package/components/lib/row/Row.js +27 -0
- package/components/lib/row/RowBase.js +12 -0
- package/components/lib/row/package.json +7 -0
- package/components/lib/row/row.d.ts +88 -0
- package/components/lib/scrollpanel/ScrollPanel.js +370 -0
- package/components/lib/scrollpanel/ScrollPanel.spec.js +49 -0
- package/components/lib/scrollpanel/ScrollPanelBase.js +75 -0
- package/components/lib/scrollpanel/__snapshots__/ScrollPanel.spec.js.snap +93 -0
- package/components/lib/scrollpanel/package.json +7 -0
- package/components/lib/scrollpanel/scrollpanel.d.ts +115 -0
- package/components/lib/scrolltop/ScrollTop.js +140 -0
- package/components/lib/scrolltop/ScrollTopBase.js +74 -0
- package/components/lib/scrolltop/package.json +7 -0
- package/components/lib/scrolltop/scrolltop.d.ts +147 -0
- package/components/lib/selectbutton/SelectButton.js +163 -0
- package/components/lib/selectbutton/SelectButtonBase.js +42 -0
- package/components/lib/selectbutton/SelectButtonItem.js +133 -0
- package/components/lib/selectbutton/package.json +7 -0
- package/components/lib/selectbutton/selectbutton.d.ts +210 -0
- package/components/lib/selectitem/package.json +4 -0
- package/components/lib/selectitem/selectitem.d.ts +45 -0
- package/components/lib/sidebar/Sidebar.js +311 -0
- package/components/lib/sidebar/Sidebar.spec.js +15 -0
- package/components/lib/sidebar/SidebarBase.js +294 -0
- package/components/lib/sidebar/package.json +7 -0
- package/components/lib/sidebar/sidebar.d.ts +254 -0
- package/components/lib/skeleton/Skeleton.js +43 -0
- package/components/lib/skeleton/Skeleton.spec.js +16 -0
- package/components/lib/skeleton/SkeletonBase.js +71 -0
- package/components/lib/skeleton/__snapshots__/Skeleton.spec.js.snap +109 -0
- package/components/lib/skeleton/package.json +7 -0
- package/components/lib/skeleton/skeleton.d.ts +112 -0
- package/components/lib/slidemenu/SlideMenu.js +259 -0
- package/components/lib/slidemenu/SlideMenuBase.js +164 -0
- package/components/lib/slidemenu/SlideMenuSub.js +198 -0
- package/components/lib/slidemenu/package.json +7 -0
- package/components/lib/slidemenu/slidemenu.d.ts +290 -0
- package/components/lib/slider/Slider.js +376 -0
- package/components/lib/slider/SliderBase.js +97 -0
- package/components/lib/slider/package.json +7 -0
- package/components/lib/slider/slider.d.ts +165 -0
- package/components/lib/speeddial/SpeedDial.js +616 -0
- package/components/lib/speeddial/SpeedDialBase.js +158 -0
- package/components/lib/speeddial/package.json +7 -0
- package/components/lib/speeddial/speeddial.d.ts +256 -0
- package/components/lib/splitbutton/SplitButton.js +221 -0
- package/components/lib/splitbutton/SplitButtonBase.js +108 -0
- package/components/lib/splitbutton/package.json +7 -0
- package/components/lib/splitbutton/splitbutton.d.ts +283 -0
- package/components/lib/splitter/Splitter.js +493 -0
- package/components/lib/splitter/Splitter.spec.js +83 -0
- package/components/lib/splitter/SplitterBase.js +109 -0
- package/components/lib/splitter/__snapshots__/Splitter.spec.js.snap +387 -0
- package/components/lib/splitter/package.json +7 -0
- package/components/lib/splitter/splitter.d.ts +233 -0
- package/components/lib/stepper/Stepper.js +354 -0
- package/components/lib/stepper/Stepper.spec.js +138 -0
- package/components/lib/stepper/StepperBase.js +148 -0
- package/components/lib/stepper/StepperContent.js +39 -0
- package/components/lib/stepper/StepperHeader.js +42 -0
- package/components/lib/stepper/StepperSeparator.js +19 -0
- package/components/lib/stepper/__snapshots__/Stepper.spec.js.snap +698 -0
- package/components/lib/stepper/package.json +7 -0
- package/components/lib/stepper/stepper.d.ts +190 -0
- package/components/lib/stepperpanel/StepperPanel.js +20 -0
- package/components/lib/stepperpanel/StepperPanelBase.js +14 -0
- package/components/lib/stepperpanel/package.json +7 -0
- package/components/lib/stepperpanel/stepperpanel.d.ts +158 -0
- package/components/lib/steps/Steps.js +326 -0
- package/components/lib/steps/StepsBase.js +89 -0
- package/components/lib/steps/package.json +7 -0
- package/components/lib/steps/steps.d.ts +192 -0
- package/components/lib/styleclass/StyleClass.js +227 -0
- package/components/lib/styleclass/StyleClassBase.js +22 -0
- package/components/lib/styleclass/package.json +7 -0
- package/components/lib/styleclass/styleclass.d.ts +97 -0
- package/components/lib/tabmenu/TabMenu.js +356 -0
- package/components/lib/tabmenu/TabMenuBase.js +83 -0
- package/components/lib/tabmenu/package.json +7 -0
- package/components/lib/tabmenu/tabmenu.d.ts +170 -0
- package/components/lib/tabview/TabView.js +619 -0
- package/components/lib/tabview/TabViewBase.js +81 -0
- package/components/lib/tabview/package.json +7 -0
- package/components/lib/tabview/tabview.d.ts +465 -0
- package/components/lib/tag/Tag.js +60 -0
- package/components/lib/tag/Tag.spec.js +21 -0
- package/components/lib/tag/TagBase.js +49 -0
- package/components/lib/tag/__snapshots__/Tag.spec.js.snap +155 -0
- package/components/lib/tag/package.json +7 -0
- package/components/lib/tag/tag.d.ts +110 -0
- package/components/lib/terminal/Terminal.js +224 -0
- package/components/lib/terminal/TerminalBase.js +54 -0
- package/components/lib/terminal/package.json +7 -0
- package/components/lib/terminal/terminal.d.ts +143 -0
- package/components/lib/terminalservice/TerminalService.js +3 -0
- package/components/lib/terminalservice/package.json +7 -0
- package/components/lib/terminalservice/terminalservice.d.ts +46 -0
- package/components/lib/tieredmenu/TieredMenu.js +753 -0
- package/components/lib/tieredmenu/TieredMenuBase.js +109 -0
- package/components/lib/tieredmenu/TieredMenuSub.js +313 -0
- package/components/lib/tieredmenu/package.json +7 -0
- package/components/lib/tieredmenu/tieredmenu.d.ts +219 -0
- package/components/lib/timeline/Timeline.js +113 -0
- package/components/lib/timeline/TimelineBase.js +150 -0
- package/components/lib/timeline/package.json +7 -0
- package/components/lib/timeline/timeline.d.ts +138 -0
- package/components/lib/toast/Toast.js +181 -0
- package/components/lib/toast/ToastBase.js +145 -0
- package/components/lib/toast/ToastMessage.js +230 -0
- package/components/lib/toast/package.json +7 -0
- package/components/lib/toast/toast.d.ts +348 -0
- package/components/lib/togglebutton/ToggleButton.js +157 -0
- package/components/lib/togglebutton/ToggleButtonBase.js +48 -0
- package/components/lib/togglebutton/package.json +7 -0
- package/components/lib/togglebutton/togglebutton.d.ts +223 -0
- package/components/lib/toolbar/Toolbar.js +71 -0
- package/components/lib/toolbar/ToolbarBase.js +47 -0
- package/components/lib/toolbar/package.json +7 -0
- package/components/lib/toolbar/toolbar.d.ts +118 -0
- package/components/lib/tooltip/Tooltip.js +571 -0
- package/components/lib/tooltip/Tooltip.spec.js +351 -0
- package/components/lib/tooltip/TooltipBase.js +135 -0
- package/components/lib/tooltip/package.json +7 -0
- package/components/lib/tooltip/tooltip.d.ts +179 -0
- package/components/lib/tooltip/tooltipoptions.d.ts +414 -0
- package/components/lib/tree/Tree.js +684 -0
- package/components/lib/tree/TreeBase.js +170 -0
- package/components/lib/tree/UITreeNode.js +1005 -0
- package/components/lib/tree/images/line.gif +0 -0
- package/components/lib/tree/package.json +7 -0
- package/components/lib/tree/tree.d.ts +708 -0
- package/components/lib/treenode/package.json +4 -0
- package/components/lib/treenode/treenode.d.ts +70 -0
- package/components/lib/treeselect/TreeSelect.js +916 -0
- package/components/lib/treeselect/TreeSelectBase.js +202 -0
- package/components/lib/treeselect/TreeSelectPanel.js +80 -0
- package/components/lib/treeselect/package.json +7 -0
- package/components/lib/treeselect/treeselect.d.ts +695 -0
- package/components/lib/treetable/TreeTable.js +1446 -0
- package/components/lib/treetable/TreeTableBase.js +308 -0
- package/components/lib/treetable/TreeTableBody.js +269 -0
- package/components/lib/treetable/TreeTableBodyCell.js +259 -0
- package/components/lib/treetable/TreeTableFooter.js +100 -0
- package/components/lib/treetable/TreeTableHeader.js +431 -0
- package/components/lib/treetable/TreeTableRow.js +675 -0
- package/components/lib/treetable/TreeTableScrollableView.js +220 -0
- package/components/lib/treetable/package.json +7 -0
- package/components/lib/treetable/treetable.d.ts +1052 -0
- package/components/lib/tristatecheckbox/TriStateCheckbox.js +186 -0
- package/components/lib/tristatecheckbox/TriStateCheckboxBase.js +40 -0
- package/components/lib/tristatecheckbox/package.json +7 -0
- package/components/lib/tristatecheckbox/tristatecheckbox.d.ts +175 -0
- package/components/lib/ts-helpers.d.ts +39 -0
- package/components/lib/utils/ClassNames.js +27 -0
- package/components/lib/utils/DomHandler.js +1300 -0
- package/components/lib/utils/EventBus.js +27 -0
- package/components/lib/utils/IconUtils.js +29 -0
- package/components/lib/utils/Mask.js +549 -0
- package/components/lib/utils/MergeProps.js +55 -0
- package/components/lib/utils/ObjectUtils.js +659 -0
- package/components/lib/utils/UniqueComponentId.js +7 -0
- package/components/lib/utils/Utils.js +11 -0
- package/components/lib/utils/ZIndexUtils.js +46 -0
- package/components/lib/utils/package.json +7 -0
- package/components/lib/utils/utils.d.ts +218 -0
- package/components/lib/virtualscroller/VirtualScroller.js +805 -0
- package/components/lib/virtualscroller/VirtualScrollerBase.js +101 -0
- package/components/lib/virtualscroller/package.json +7 -0
- package/components/lib/virtualscroller/virtualscroller.d.ts +532 -0
- package/components/news/newssection.js +55 -0
- package/components/templates/TemplateConfiguration.js +30 -0
- package/components/templates/TemplateFeatures.js +57 -0
- package/components/templates/TemplateIntro.js +15 -0
- package/components/templates/TemplateLicense.js +39 -0
- package/components/templates/TemplateRelated.js +20 -0
- package/components/templates/TemplateSeparator.js +11 -0
- package/components/templates/TemplateYoutube.js +64 -0
- package/components/templates/templateFeaturesAnimation/TemplateFeaturesAnimationInline.js +47 -0
- package/components/templates/templateFeaturesAnimation/index.js +66 -0
- package/components/templates/templateFeaturesAnimation/useAnimatedFeatures.js +72 -0
- package/components/templates/templateFeaturesAnimation/useVisible.js +30 -0
- package/components/templates/templateHero/TemplateHero.js +44 -0
- package/components/templates/templateHero/TemplateHeroLight.js +64 -0
- package/components/templates/templateHero/TemplateHeroRectangle.js +26 -0
- package/components/test/index.js +68 -0
- package/components/utils/utils.js +33 -0
- package/data/news.json +7 -0
- package/jest.config.js +19 -0
- package/jsconfig.json +11 -0
- package/next-env.d.ts +5 -0
- package/next.config.js +25 -0
- package/package.json +93 -0
- package/pages/404.js +22 -0
- package/pages/_app.js +67 -0
- package/pages/_document.js +21 -0
- package/pages/accessibility/index.js +12 -0
- package/pages/accordion/index.js +112 -0
- package/pages/api/data/customers.js +284 -0
- package/pages/api/upload.js +3 -0
- package/pages/autocomplete/index.js +140 -0
- package/pages/avatar/index.js +88 -0
- package/pages/badge/index.js +90 -0
- package/pages/blockui/index.js +78 -0
- package/pages/bootstrap/index.js +28 -0
- package/pages/breadcrumb/index.js +87 -0
- package/pages/bulma/index.js +27 -0
- package/pages/button/index.js +156 -0
- package/pages/calendar/index.js +182 -0
- package/pages/card/index.js +72 -0
- package/pages/carousel/index.js +100 -0
- package/pages/cascadeselect/index.js +116 -0
- package/pages/chart/index.js +146 -0
- package/pages/checkbox/index.js +95 -0
- package/pages/chip/index.js +84 -0
- package/pages/chips/index.js +106 -0
- package/pages/colorpicker/index.js +82 -0
- package/pages/colors/index.js +47 -0
- package/pages/configuration/index.js +115 -0
- package/pages/confirmdialog/index.js +109 -0
- package/pages/confirmpopup/index.js +97 -0
- package/pages/contextmenu/index.js +104 -0
- package/pages/contribution/index.js +70 -0
- package/pages/customicons/index.js +42 -0
- package/pages/datascroller/index.js +87 -0
- package/pages/datatable/index.js +442 -0
- package/pages/dataview/index.js +105 -0
- package/pages/deferredcontent/index.js +70 -0
- package/pages/dialog/index.js +113 -0
- package/pages/divider/index.js +90 -0
- package/pages/dock/index.js +82 -0
- package/pages/dropdown/index.js +152 -0
- package/pages/editor/index.js +82 -0
- package/pages/fieldset/index.js +78 -0
- package/pages/fileupload/index.js +99 -0
- package/pages/floatlabel/index.js +65 -0
- package/pages/galleria/index.js +188 -0
- package/pages/guides/accessibility/index.js +65 -0
- package/pages/guides/csslayer/index.js +66 -0
- package/pages/hooks/useclickoutside/index.js +22 -0
- package/pages/hooks/usecounter/index.js +28 -0
- package/pages/hooks/usedebounce/index.js +22 -0
- package/pages/hooks/useeventlistener/index.js +28 -0
- package/pages/hooks/usefavicon/index.js +22 -0
- package/pages/hooks/useintersectionobserver/index.js +36 -0
- package/pages/hooks/useinterval/index.js +22 -0
- package/pages/hooks/usemounteffect/index.js +22 -0
- package/pages/hooks/usemouse/index.js +34 -0
- package/pages/hooks/usemove/index.js +34 -0
- package/pages/hooks/useoverlaylistener/index.js +22 -0
- package/pages/hooks/useoverlayscrolllistener/index.js +22 -0
- package/pages/hooks/useprevious/index.js +22 -0
- package/pages/hooks/useresizelistener/index.js +22 -0
- package/pages/hooks/usestorage/index.js +28 -0
- package/pages/hooks/usetimeout/index.js +22 -0
- package/pages/hooks/useunmounteffect/index.js +22 -0
- package/pages/hooks/useupdateeffect/index.js +22 -0
- package/pages/iconfield/index.js +82 -0
- package/pages/icons/index.js +64 -0
- package/pages/image/index.js +83 -0
- package/pages/index.js +64 -0
- package/pages/inplace/index.js +94 -0
- package/pages/inputgroup/index.js +34 -0
- package/pages/inputmask/index.js +127 -0
- package/pages/inputnumber/index.js +118 -0
- package/pages/inputotp/index.js +105 -0
- package/pages/inputswitch/index.js +82 -0
- package/pages/inputtext/index.js +116 -0
- package/pages/inputtextarea/index.js +110 -0
- package/pages/installation/index.js +85 -0
- package/pages/keyfilter/index.js +40 -0
- package/pages/knob/index.js +118 -0
- package/pages/listbox/index.js +106 -0
- package/pages/locale/index.js +43 -0
- package/pages/megamenu/index.js +98 -0
- package/pages/mention/index.js +94 -0
- package/pages/menu/index.js +104 -0
- package/pages/menubar/index.js +82 -0
- package/pages/message/index.js +93 -0
- package/pages/messages/index.js +100 -0
- package/pages/metergroup/index.js +88 -0
- package/pages/multiselect/index.js +126 -0
- package/pages/multistatecheckbox/index.js +86 -0
- package/pages/orderlist/index.js +76 -0
- package/pages/organizationchart/index.js +94 -0
- package/pages/overlaypanel/index.js +82 -0
- package/pages/paginator/index.js +93 -0
- package/pages/panel/index.js +89 -0
- package/pages/panelmenu/index.js +94 -0
- package/pages/passthrough/index.js +49 -0
- package/pages/password/index.js +112 -0
- package/pages/picklist/index.js +71 -0
- package/pages/playground/index.js +30 -0
- package/pages/progressbar/index.js +84 -0
- package/pages/progressspinner/index.js +72 -0
- package/pages/radiobutton/index.js +98 -0
- package/pages/rating/index.js +95 -0
- package/pages/ripple/index.js +77 -0
- package/pages/roadmap/index.js +215 -0
- package/pages/scrollpanel/index.js +82 -0
- package/pages/scrolltop/index.js +82 -0
- package/pages/selectbutton/index.js +98 -0
- package/pages/sidebar/index.js +105 -0
- package/pages/skeleton/index.js +84 -0
- package/pages/slider/index.js +94 -0
- package/pages/speeddial/index.js +102 -0
- package/pages/splitbutton/index.js +141 -0
- package/pages/splitter/index.js +89 -0
- package/pages/stepper/index.js +97 -0
- package/pages/steps/index.js +100 -0
- package/pages/styleclass/index.js +36 -0
- package/pages/support/index.js +293 -0
- package/pages/tabmenu/index.js +99 -0
- package/pages/tabview/index.js +118 -0
- package/pages/tag/index.js +90 -0
- package/pages/tailwind/index.js +40 -0
- package/pages/team/index.js +88 -0
- package/pages/templates/apollo/ApolloLogo.js +23 -0
- package/pages/templates/apollo/index.js +234 -0
- package/pages/templates/atlantis/AtlantisLogo.js +37 -0
- package/pages/templates/atlantis/index.js +211 -0
- package/pages/templates/avalon/AvalonLogo.js +14 -0
- package/pages/templates/avalon/AvalonSeparator.js +1270 -0
- package/pages/templates/avalon/index.js +218 -0
- package/pages/templates/diamond/DiamondLogo.js +20 -0
- package/pages/templates/diamond/index.js +222 -0
- package/pages/templates/freya/FreyaLogo.js +23 -0
- package/pages/templates/freya/index.js +206 -0
- package/pages/templates/genesis/GenesisLogo.js +21 -0
- package/pages/templates/genesis/index.js +193 -0
- package/pages/templates/index.js +175 -0
- package/pages/templates/sakai/SakaiLogo.js +28 -0
- package/pages/templates/sakai/index.js +156 -0
- package/pages/templates/ultima/UltimaLogo.js +27 -0
- package/pages/templates/ultima/index.js +209 -0
- package/pages/templates/verona/VeronaLogo.js +33 -0
- package/pages/templates/verona/index.js +221 -0
- package/pages/terminal/index.js +66 -0
- package/pages/theming/index.js +108 -0
- package/pages/tieredmenu/index.js +88 -0
- package/pages/timeline/index.js +89 -0
- package/pages/toast/index.js +100 -0
- package/pages/togglebutton/index.js +84 -0
- package/pages/toolbar/index.js +71 -0
- package/pages/tooltip/index.js +123 -0
- package/pages/tree/index.js +132 -0
- package/pages/treeselect/index.js +128 -0
- package/pages/treetable/index.js +259 -0
- package/pages/tristatecheckbox/index.js +92 -0
- package/pages/uikit/index.js +376 -0
- package/pages/unstyled/index.js +34 -0
- package/pages/virtualscroller/index.js +93 -0
- package/rollup.config.js +406 -0
- package/service/CarService.js +38 -0
- package/service/CountryService.js +252 -0
- package/service/CustomerService.js +9032 -0
- package/service/EventService.js +22 -0
- package/service/IconService.js +18 -0
- package/service/NodeService.js +431 -0
- package/service/PhotoService.js +100 -0
- package/service/ProductService.js +1220 -0
- package/styles/demo/_common.scss +4 -0
- package/styles/demo/_datatable.scss +9 -0
- package/styles/demo/_dock.scss +109 -0
- package/styles/demo/_galleria.scss +62 -0
- package/styles/demo/_organizationchart.scss +41 -0
- package/styles/demo/_scrollpanel.scss +33 -0
- package/styles/demo/_timeline.scss +19 -0
- package/styles/demo/demo.scss +7 -0
- package/styles/doc/index.css +4 -0
- package/styles/layout/_code.scss +143 -0
- package/styles/layout/_config.scss +52 -0
- package/styles/layout/_content.scss +18 -0
- package/styles/layout/_core.scss +107 -0
- package/styles/layout/_doc.scss +452 -0
- package/styles/layout/_docsearch.scss +149 -0
- package/styles/layout/_footer.scss +25 -0
- package/styles/layout/_glow.scss +7 -0
- package/styles/layout/_mixins.scss +13 -0
- package/styles/layout/_news.scss +92 -0
- package/styles/layout/_responsive.scss +177 -0
- package/styles/layout/_sidebar.scss +154 -0
- package/styles/layout/_topbar.scss +54 -0
- package/styles/layout/landing/_blocks.scss +222 -0
- package/styles/layout/landing/_features.scss +10 -0
- package/styles/layout/landing/_footer.scss +5 -0
- package/styles/layout/landing/_getstarted.scss +11 -0
- package/styles/layout/landing/_hero.scss +22 -0
- package/styles/layout/landing/_landing.scss +14 -0
- package/styles/layout/landing/_main.scss +182 -0
- package/styles/layout/landing/_templates.scss +251 -0
- package/styles/layout/landing/_themes.scss +6 -0
- package/styles/layout/landing/_users.scss +49 -0
- package/styles/layout/layout.scss +31 -0
- package/styles/layout/templates/_apollo.scss +32 -0
- package/styles/layout/templates/_atlantis.scss +49 -0
- package/styles/layout/templates/_avalon.scss +60 -0
- package/styles/layout/templates/_babylon.scss +49 -0
- package/styles/layout/templates/_california.scss +49 -0
- package/styles/layout/templates/_diamond.scss +45 -0
- package/styles/layout/templates/_freya.scss +33 -0
- package/styles/layout/templates/_genesis.scss +45 -0
- package/styles/layout/templates/_poseidon.scss +47 -0
- package/styles/layout/templates/_roma.scss +60 -0
- package/styles/layout/templates/_sakai.scss +54 -0
- package/styles/layout/templates/_templates.scss +1550 -0
- package/styles/layout/templates/_ultima.scss +39 -0
- package/styles/layout/templates/_verona.scss +48 -0
- package/styles/layout/variables/_variables.scss +4 -0
- package/styles/layout/variables/landing/_dark.scss +54 -0
- package/styles/layout/variables/landing/_light.scss +53 -0
- package/styles/layout/variables/main/_dark.scss +15 -0
- package/styles/layout/variables/main/_light.scss +15 -0
- package/styles/primereact.css +3 -0
- package/yoyui-icon.svg +32 -0
|
@@ -0,0 +1,4508 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PrimeReact, { PrimeReactContext, localeOption, localeOptions } from '../api/Api';
|
|
3
|
+
import { Button } from '../button/Button';
|
|
4
|
+
import { useHandleStyle } from '../componentbase/ComponentBase';
|
|
5
|
+
import { ESC_KEY_HANDLING_PRIORITIES, useDisplayOrder, useGlobalOnEscapeKey, useMergeProps, useMountEffect, useOverlayListener, usePrevious, useUnmountEffect, useUpdateEffect } from '../hooks/Hooks';
|
|
6
|
+
import { CalendarIcon } from '../icons/calendar';
|
|
7
|
+
import { ChevronDownIcon } from '../icons/chevrondown';
|
|
8
|
+
import { ChevronLeftIcon } from '../icons/chevronleft';
|
|
9
|
+
import { ChevronRightIcon } from '../icons/chevronright';
|
|
10
|
+
import { ChevronUpIcon } from '../icons/chevronup';
|
|
11
|
+
import { InputText } from '../inputtext/InputText';
|
|
12
|
+
import { OverlayService } from '../overlayservice/OverlayService';
|
|
13
|
+
import { Ripple } from '../ripple/Ripple';
|
|
14
|
+
import { DomHandler, IconUtils, ObjectUtils, UniqueComponentId, ZIndexUtils, classNames, mask } from '../utils/Utils';
|
|
15
|
+
import { CalendarBase } from './CalendarBase';
|
|
16
|
+
import { CalendarPanel } from './CalendarPanel';
|
|
17
|
+
|
|
18
|
+
export const Calendar = React.memo(
|
|
19
|
+
React.forwardRef((inProps, ref) => {
|
|
20
|
+
const mergeProps = useMergeProps();
|
|
21
|
+
const context = React.useContext(PrimeReactContext);
|
|
22
|
+
const props = CalendarBase.getProps(inProps, context);
|
|
23
|
+
const [focusedState, setFocusedState] = React.useState(false);
|
|
24
|
+
const [overlayVisibleState, setOverlayVisibleState] = React.useState(false);
|
|
25
|
+
const [viewDateState, setViewDateState] = React.useState(null);
|
|
26
|
+
const [idState, setIdState] = React.useState(props.id);
|
|
27
|
+
const isCloseOnEscape = overlayVisibleState && props.closeOnEscape;
|
|
28
|
+
const overlayDisplayOrder = useDisplayOrder('overlay-panel', isCloseOnEscape);
|
|
29
|
+
|
|
30
|
+
const metaData = {
|
|
31
|
+
props,
|
|
32
|
+
state: {
|
|
33
|
+
focused: focusedState,
|
|
34
|
+
overlayVisible: overlayVisibleState,
|
|
35
|
+
viewDate: viewDateState
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const { ptm, cx, isUnstyled } = CalendarBase.setMetaData(metaData);
|
|
39
|
+
|
|
40
|
+
useGlobalOnEscapeKey({
|
|
41
|
+
callback: () => {
|
|
42
|
+
hide(null, reFocusInputField);
|
|
43
|
+
},
|
|
44
|
+
when: overlayVisibleState && overlayDisplayOrder,
|
|
45
|
+
priority: [ESC_KEY_HANDLING_PRIORITIES.OVERLAY_PANEL, overlayDisplayOrder]
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
useHandleStyle(CalendarBase.css.styles, isUnstyled, { name: 'calendar' });
|
|
49
|
+
const elementRef = React.useRef(null);
|
|
50
|
+
const overlayRef = React.useRef(null);
|
|
51
|
+
const inputRef = React.useRef(props.inputRef);
|
|
52
|
+
const navigation = React.useRef(null);
|
|
53
|
+
const ignoreFocusFunctionality = React.useRef(false);
|
|
54
|
+
const timePickerTimer = React.useRef(null);
|
|
55
|
+
const viewStateChanged = React.useRef(false);
|
|
56
|
+
const touchUIMask = React.useRef(null);
|
|
57
|
+
const overlayEventListener = React.useRef(null);
|
|
58
|
+
const touchUIMaskClickListener = React.useRef(null);
|
|
59
|
+
const isOverlayClicked = React.useRef(false);
|
|
60
|
+
const previousButton = React.useRef(false);
|
|
61
|
+
const nextButton = React.useRef(false);
|
|
62
|
+
const viewChangedWithKeyDown = React.useRef(false);
|
|
63
|
+
const onChangeRef = React.useRef(null);
|
|
64
|
+
const isClearClicked = React.useRef(false);
|
|
65
|
+
const updateInputfieldRef = React.useRef(null);
|
|
66
|
+
|
|
67
|
+
const [currentView, setCurrentView] = React.useState('date');
|
|
68
|
+
const [currentMonth, setCurrentMonth] = React.useState(null);
|
|
69
|
+
const [currentYear, setCurrentYear] = React.useState(null);
|
|
70
|
+
const [yearOptions, setYearOptions] = React.useState([]);
|
|
71
|
+
|
|
72
|
+
const previousValue = usePrevious(props.value);
|
|
73
|
+
const visible = props.inline || (props.onVisibleChange ? props.visible : overlayVisibleState);
|
|
74
|
+
const attributeSelector = UniqueComponentId();
|
|
75
|
+
const panelId = idState + '_panel';
|
|
76
|
+
|
|
77
|
+
const [bindOverlayListener, unbindOverlayListener] = useOverlayListener({
|
|
78
|
+
target: elementRef,
|
|
79
|
+
overlay: overlayRef,
|
|
80
|
+
listener: (event, { type, valid }) => {
|
|
81
|
+
if (valid) {
|
|
82
|
+
if (type === 'outside') {
|
|
83
|
+
if (!isOverlayClicked.current && !isNavIconClicked(event.target)) {
|
|
84
|
+
hide('outside');
|
|
85
|
+
}
|
|
86
|
+
} else if ((context && context.hideOverlaysOnDocumentScrolling) || PrimeReact.hideOverlaysOnDocumentScrolling) {
|
|
87
|
+
hide();
|
|
88
|
+
} else if (!DomHandler.isDocument(event.target)) {
|
|
89
|
+
alignOverlay();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
isOverlayClicked.current = false;
|
|
94
|
+
},
|
|
95
|
+
when: !(props.touchUI || props.inline) && visible,
|
|
96
|
+
type: 'mousedown'
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const getDateFormat = () => {
|
|
100
|
+
return props.dateFormat || localeOption('dateFormat', props.locale);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const onInputClick = () => {
|
|
104
|
+
if (!visible && props.showOnFocus) {
|
|
105
|
+
show();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const onInputFocus = (event) => {
|
|
110
|
+
if (ignoreFocusFunctionality.current) {
|
|
111
|
+
setFocusedState(true);
|
|
112
|
+
ignoreFocusFunctionality.current = false;
|
|
113
|
+
} else {
|
|
114
|
+
if (props.showOnFocus && !visible) {
|
|
115
|
+
show();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
setFocusedState(true);
|
|
119
|
+
props.onFocus && props.onFocus(event);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const onInputBlur = (event) => {
|
|
124
|
+
updateInputfield(props.value);
|
|
125
|
+
props.onBlur && props.onBlur(event);
|
|
126
|
+
setFocusedState(false);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const onInputKeyDown = (event) => {
|
|
130
|
+
switch (event.code) {
|
|
131
|
+
case 'ArrowDown': {
|
|
132
|
+
if (!overlayVisibleState) {
|
|
133
|
+
show();
|
|
134
|
+
} else {
|
|
135
|
+
focusToFirstCell();
|
|
136
|
+
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
case 'Escape': {
|
|
144
|
+
hide();
|
|
145
|
+
props.touchUI && disableModality();
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
case 'Tab': {
|
|
150
|
+
if (overlayRef && overlayRef.current) {
|
|
151
|
+
DomHandler.getFocusableElements(overlayRef.current).forEach((el) => (el.tabIndex = '-1'));
|
|
152
|
+
hide();
|
|
153
|
+
props.touchUI && disableModality();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
default:
|
|
160
|
+
//no op
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const onUserInput = (event) => {
|
|
166
|
+
updateValueOnInput(event, event.target.value);
|
|
167
|
+
props.onInput && props.onInput(event);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const updateValueOnInput = (event, rawValue, invalidCallback) => {
|
|
171
|
+
props.onInput && props.onInput(event);
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
const value = parseValueFromString(props.timeOnly ? rawValue.replace('_', '') : rawValue);
|
|
175
|
+
|
|
176
|
+
if (isValidSelection(value)) {
|
|
177
|
+
validateDate(value);
|
|
178
|
+
updateModel(event, value);
|
|
179
|
+
|
|
180
|
+
const date = value.length ? value[0] : value;
|
|
181
|
+
|
|
182
|
+
updateViewDate(event, date);
|
|
183
|
+
}
|
|
184
|
+
} catch (err) {
|
|
185
|
+
//invalid date
|
|
186
|
+
if (invalidCallback) {
|
|
187
|
+
invalidCallback();
|
|
188
|
+
} else {
|
|
189
|
+
const value = props.keepInvalid ? rawValue : null;
|
|
190
|
+
|
|
191
|
+
updateModel(event, value);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const onViewDateSelect = ({ event, date }) => {
|
|
197
|
+
if (date && props.onSelect) {
|
|
198
|
+
const day = date.getDate();
|
|
199
|
+
const month = date.getMonth();
|
|
200
|
+
const year = date.getFullYear();
|
|
201
|
+
|
|
202
|
+
onDateSelect(event, { day, month, year, selectable: isSelectable(day, month, year) }, null, true);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const reFocusInputField = () => {
|
|
207
|
+
if (!props.inline && inputRef.current) {
|
|
208
|
+
ignoreFocusFunctionality.current = true;
|
|
209
|
+
DomHandler.focus(inputRef.current);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const isValidSelection = (value) => {
|
|
214
|
+
let isValid = true;
|
|
215
|
+
|
|
216
|
+
if (isSingleSelection()) {
|
|
217
|
+
if (!(isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false) && (!props.showTime || isSelectableTime(value)))) {
|
|
218
|
+
isValid = false;
|
|
219
|
+
}
|
|
220
|
+
} else if (value.every((v) => isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false) && isSelectableTime(v))) {
|
|
221
|
+
if (isRangeSelection()) {
|
|
222
|
+
isValid = value.length > 1 && value[1] >= value[0];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return isValid;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const onButtonClick = () => {
|
|
230
|
+
visible ? hide() : show();
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const onPrevButtonClick = (event) => {
|
|
234
|
+
navigation.current = { backward: true, button: true };
|
|
235
|
+
navBackward(event);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
const onNextButtonClick = (event) => {
|
|
239
|
+
navigation.current = { backward: false, button: true };
|
|
240
|
+
navForward(event);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
const onContainerButtonKeydown = (event) => {
|
|
244
|
+
switch (event.code) {
|
|
245
|
+
case 'Tab':
|
|
246
|
+
!props.inline && trapFocus(event);
|
|
247
|
+
break;
|
|
248
|
+
|
|
249
|
+
case 'Escape':
|
|
250
|
+
hide(null, reFocusInputField);
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
|
|
253
|
+
break;
|
|
254
|
+
|
|
255
|
+
default:
|
|
256
|
+
//no op
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const onPickerKeyDown = (event, type, direction) => {
|
|
262
|
+
if (event.key === 'Enter' || event.key === 'Space') {
|
|
263
|
+
onTimePickerElementMouseDown(event, type, direction);
|
|
264
|
+
event.preventDefault();
|
|
265
|
+
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
onContainerButtonKeydown(event);
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const onPickerKeyUp = (event) => {
|
|
273
|
+
if (event.key === 'Enter' || event.key === 'Space') {
|
|
274
|
+
onTimePickerElementMouseUp();
|
|
275
|
+
event.preventDefault();
|
|
276
|
+
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const trapFocus = (event) => {
|
|
282
|
+
event?.preventDefault();
|
|
283
|
+
const focusableElements = DomHandler.getFocusableElements(overlayRef.current);
|
|
284
|
+
|
|
285
|
+
if (focusableElements && focusableElements.length > 0) {
|
|
286
|
+
if (!document.activeElement) {
|
|
287
|
+
focusableElements[0].focus();
|
|
288
|
+
} else {
|
|
289
|
+
const focusedIndex = focusableElements.indexOf(document.activeElement);
|
|
290
|
+
|
|
291
|
+
if (event?.shiftKey) {
|
|
292
|
+
if (focusedIndex === -1 || focusedIndex === 0) {
|
|
293
|
+
focusableElements[focusableElements.length - 1].focus();
|
|
294
|
+
} else {
|
|
295
|
+
focusableElements[focusedIndex - 1].focus();
|
|
296
|
+
}
|
|
297
|
+
} else if (focusedIndex === -1 || focusedIndex === focusableElements.length - 1) {
|
|
298
|
+
focusableElements[0].focus();
|
|
299
|
+
} else {
|
|
300
|
+
focusableElements[focusedIndex + 1].focus();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
const updateFocus = () => {
|
|
307
|
+
if (navigation.current) {
|
|
308
|
+
if (navigation.current.button) {
|
|
309
|
+
initFocusableCell();
|
|
310
|
+
|
|
311
|
+
if (navigation.current.backward) {
|
|
312
|
+
previousButton.current.focus();
|
|
313
|
+
} else {
|
|
314
|
+
nextButton.current.focus();
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
let cell;
|
|
318
|
+
|
|
319
|
+
if (navigation.current.backward) {
|
|
320
|
+
let cells = DomHandler.find(overlayRef.current, 'table td span:not([data-p-disabled="true"])');
|
|
321
|
+
|
|
322
|
+
cell = cells[cells.length - 1];
|
|
323
|
+
} else {
|
|
324
|
+
cell = DomHandler.findSingle(overlayRef.current, 'table td span:not([data-p-disabled="true"])');
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (cell) {
|
|
328
|
+
cell.tabIndex = '0';
|
|
329
|
+
cell.focus();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
navigation.current = null;
|
|
334
|
+
} else {
|
|
335
|
+
initFocusableCell();
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const initFocusableCell = () => {
|
|
340
|
+
let cell;
|
|
341
|
+
|
|
342
|
+
if (currentView === 'month') {
|
|
343
|
+
const cells = DomHandler.find(overlayRef.current, '[data-pc-section="monthpicker"] [data-pc-section="month"]');
|
|
344
|
+
const selectedCell = DomHandler.findSingle(overlayRef.current, '[data-pc-section="monthpicker"] [data-pc-section="month"][data-p-highlight="true"]');
|
|
345
|
+
|
|
346
|
+
cells.forEach((cell) => (cell.tabIndex = -1));
|
|
347
|
+
cell = selectedCell || cells[0];
|
|
348
|
+
} else {
|
|
349
|
+
cell = DomHandler.findSingle(overlayRef.current, 'span[data-p-highlight="true"]');
|
|
350
|
+
|
|
351
|
+
if (!cell) {
|
|
352
|
+
const todayCell = DomHandler.findSingle(overlayRef.current, 'td.p-datepicker-today span:not(.p-disabled)');
|
|
353
|
+
|
|
354
|
+
cell = todayCell || DomHandler.findSingle(overlayRef.current, 'table td span:not([data-p-disabled="true"])');
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (cell) {
|
|
359
|
+
cell.tabIndex = '0';
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
const focusToFirstCell = () => {
|
|
364
|
+
if (currentView) {
|
|
365
|
+
let cell;
|
|
366
|
+
|
|
367
|
+
if (currentView === 'date') {
|
|
368
|
+
cell = DomHandler.findSingle(overlayRef.current, 'span[data-p-highlight="true"]');
|
|
369
|
+
|
|
370
|
+
if (!cell) {
|
|
371
|
+
const todayCell = DomHandler.findSingle(overlayRef.current, 'td.p-datepicker-today span:not(.p-disabled)');
|
|
372
|
+
|
|
373
|
+
cell = todayCell || DomHandler.findSingle(overlayRef.current, 'table td span:not([data-p-disabled="true"])');
|
|
374
|
+
}
|
|
375
|
+
} else if (currentView === 'month' || currentView === 'year') {
|
|
376
|
+
cell = DomHandler.findSingle(overlayRef.current, 'span[data-p-highlight="true"]');
|
|
377
|
+
|
|
378
|
+
if (!cell) {
|
|
379
|
+
cell = DomHandler.findSingle(overlayRef.current, `[data-pc-section="${currentView}picker"] [data-pc-section="${currentView}"]:not([data-p-disabled="true"])`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (cell) {
|
|
384
|
+
cell.tabIndex = '0';
|
|
385
|
+
cell && cell.focus();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
const navBackward = (event) => {
|
|
391
|
+
if (props.disabled) {
|
|
392
|
+
event.preventDefault();
|
|
393
|
+
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
let newViewDate = cloneDate(getViewDate());
|
|
398
|
+
|
|
399
|
+
newViewDate.setDate(1);
|
|
400
|
+
|
|
401
|
+
if (currentView === 'date') {
|
|
402
|
+
if (newViewDate.getMonth() === 0) {
|
|
403
|
+
const newYear = decrementYear();
|
|
404
|
+
|
|
405
|
+
newViewDate.setMonth(11);
|
|
406
|
+
newViewDate.setFullYear(newYear);
|
|
407
|
+
props.onMonthChange && props.onMonthChange({ month: 12, year: newYear });
|
|
408
|
+
setCurrentMonth(11);
|
|
409
|
+
} else {
|
|
410
|
+
newViewDate.setMonth(newViewDate.getMonth() - 1);
|
|
411
|
+
props.onMonthChange && props.onMonthChange({ month: currentMonth, year: currentYear });
|
|
412
|
+
setCurrentMonth((prevState) => prevState - 1);
|
|
413
|
+
}
|
|
414
|
+
} else if (currentView === 'month') {
|
|
415
|
+
let newYear = newViewDate.getFullYear() - 1;
|
|
416
|
+
|
|
417
|
+
if (props.yearNavigator) {
|
|
418
|
+
const minYear = parseInt(props.yearRange.split(':')[0], 10);
|
|
419
|
+
|
|
420
|
+
if (newYear < minYear) {
|
|
421
|
+
newYear = minYear;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
newViewDate.setFullYear(newYear);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (currentView === 'month') {
|
|
429
|
+
newViewDate.setFullYear(decrementYear());
|
|
430
|
+
} else if (currentView === 'year') {
|
|
431
|
+
newViewDate.setFullYear(decrementDecade());
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
updateViewDate(event, newViewDate);
|
|
435
|
+
|
|
436
|
+
event.preventDefault();
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
const navForward = (event) => {
|
|
440
|
+
if (props.disabled) {
|
|
441
|
+
event.preventDefault();
|
|
442
|
+
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
let newViewDate = cloneDate(getViewDate());
|
|
447
|
+
|
|
448
|
+
newViewDate.setDate(1);
|
|
449
|
+
|
|
450
|
+
if (currentView === 'date') {
|
|
451
|
+
if (newViewDate.getMonth() === 11) {
|
|
452
|
+
const newYear = incrementYear();
|
|
453
|
+
|
|
454
|
+
newViewDate.setMonth(0);
|
|
455
|
+
newViewDate.setFullYear(newYear);
|
|
456
|
+
props.onMonthChange && props.onMonthChange({ month: 1, year: newYear });
|
|
457
|
+
setCurrentMonth(0);
|
|
458
|
+
} else {
|
|
459
|
+
newViewDate.setMonth(newViewDate.getMonth() + 1);
|
|
460
|
+
props.onMonthChange && props.onMonthChange({ month: currentMonth + 2, year: currentYear });
|
|
461
|
+
setCurrentMonth((prevState) => prevState + 1);
|
|
462
|
+
}
|
|
463
|
+
} else if (currentView === 'month') {
|
|
464
|
+
let newYear = newViewDate.getFullYear() + 1;
|
|
465
|
+
|
|
466
|
+
if (props.yearNavigator) {
|
|
467
|
+
const maxYear = parseInt(props.yearRange.split(':')[1], 10);
|
|
468
|
+
|
|
469
|
+
if (newYear > maxYear) {
|
|
470
|
+
newYear = maxYear;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
newViewDate.setFullYear(newYear);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (currentView === 'month') {
|
|
478
|
+
newViewDate.setFullYear(incrementYear());
|
|
479
|
+
} else if (currentView === 'year') {
|
|
480
|
+
newViewDate.setFullYear(incrementDecade());
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
updateViewDate(event, newViewDate);
|
|
484
|
+
|
|
485
|
+
event.preventDefault();
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
const populateYearOptions = (start, end) => {
|
|
489
|
+
let _yearOptions = [];
|
|
490
|
+
|
|
491
|
+
for (let i = start; i <= end; i++) {
|
|
492
|
+
yearOptions.push(i);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
setYearOptions(_yearOptions);
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
const decrementYear = () => {
|
|
499
|
+
const year = getViewYear();
|
|
500
|
+
const _currentYear = year - 1;
|
|
501
|
+
|
|
502
|
+
setCurrentYear(_currentYear);
|
|
503
|
+
|
|
504
|
+
if (props.yearNavigator && _currentYear < yearOptions[0]) {
|
|
505
|
+
let difference = yearOptions[yearOptions.length - 1] - yearOptions[0];
|
|
506
|
+
|
|
507
|
+
populateYearOptions(yearOptions[0] - difference, yearOptions[yearOptions.length - 1] - difference);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
return _currentYear;
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
const incrementYear = () => {
|
|
514
|
+
const year = getViewYear();
|
|
515
|
+
const _currentYear = year + 1;
|
|
516
|
+
|
|
517
|
+
setCurrentYear(_currentYear);
|
|
518
|
+
|
|
519
|
+
if (props.yearNavigator && _currentYear.current > yearOptions[yearOptions.length - 1]) {
|
|
520
|
+
let difference = yearOptions[yearOptions.length - 1] - yearOptions[0];
|
|
521
|
+
|
|
522
|
+
populateYearOptions(yearOptions[0] + difference, yearOptions[yearOptions.length - 1] + difference);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return _currentYear;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
const onMonthDropdownChange = (event, value) => {
|
|
529
|
+
const currentViewDate = getViewDate();
|
|
530
|
+
let newViewDate = cloneDate(currentViewDate);
|
|
531
|
+
|
|
532
|
+
newViewDate.setDate(1);
|
|
533
|
+
newViewDate.setMonth(parseInt(value, 10));
|
|
534
|
+
|
|
535
|
+
updateViewDate(event, newViewDate);
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
const onYearDropdownChange = (event, value) => {
|
|
539
|
+
const currentViewDate = getViewDate();
|
|
540
|
+
let newViewDate = cloneDate(currentViewDate);
|
|
541
|
+
|
|
542
|
+
newViewDate.setFullYear(parseInt(value, 10));
|
|
543
|
+
|
|
544
|
+
updateViewDate(event, newViewDate);
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
const onTodayButtonClick = (event) => {
|
|
548
|
+
const today = new Date();
|
|
549
|
+
const dateMeta = {
|
|
550
|
+
day: today.getDate(),
|
|
551
|
+
month: today.getMonth(),
|
|
552
|
+
year: today.getFullYear(),
|
|
553
|
+
today: true,
|
|
554
|
+
selectable: true
|
|
555
|
+
};
|
|
556
|
+
const timeMeta = {
|
|
557
|
+
hours: today.getHours(),
|
|
558
|
+
minutes: today.getMinutes(),
|
|
559
|
+
seconds: props.showSeconds ? today.getSeconds() : 0,
|
|
560
|
+
milliseconds: props.showMillisec ? today.getMilliseconds() : 0
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
updateViewDate(event, today);
|
|
564
|
+
onDateSelect(event, dateMeta, timeMeta);
|
|
565
|
+
|
|
566
|
+
props.onTodayButtonClick && props.onTodayButtonClick(event);
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
const onClearButtonClick = (event) => {
|
|
570
|
+
isClearClicked.current = true;
|
|
571
|
+
|
|
572
|
+
updateModel(event, null);
|
|
573
|
+
updateInputfield(null);
|
|
574
|
+
setCurrentYear(new Date().getFullYear()); // #7581
|
|
575
|
+
hide();
|
|
576
|
+
|
|
577
|
+
props.onClearButtonClick && props.onClearButtonClick(event);
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
const onPanelClick = (event) => {
|
|
581
|
+
if (!props.inline) {
|
|
582
|
+
OverlayService.emit('overlay-click', {
|
|
583
|
+
originalEvent: event,
|
|
584
|
+
target: elementRef.current
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
const onPanelMouseUp = (event) => {
|
|
590
|
+
onPanelClick(event);
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
const onTimePickerElementMouseDown = (event, type, direction) => {
|
|
594
|
+
if (!props.disabled) {
|
|
595
|
+
repeat(event, null, type, direction);
|
|
596
|
+
event.preventDefault();
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
const onTimePickerElementMouseUp = () => {
|
|
601
|
+
if (!props.disabled) {
|
|
602
|
+
clearTimePickerTimer();
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
const onTimePickerElementMouseLeave = () => {
|
|
607
|
+
if (!props.disabled) {
|
|
608
|
+
clearTimePickerTimer();
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
const repeat = (event, interval, type, direction) => {
|
|
613
|
+
clearTimePickerTimer();
|
|
614
|
+
timePickerTimer.current = setTimeout(() => {
|
|
615
|
+
repeat(event, 100, type, direction);
|
|
616
|
+
}, interval || 500);
|
|
617
|
+
|
|
618
|
+
switch (type) {
|
|
619
|
+
case 0:
|
|
620
|
+
if (direction === 1) {
|
|
621
|
+
incrementHour(event);
|
|
622
|
+
} else {
|
|
623
|
+
decrementHour(event);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
break;
|
|
627
|
+
|
|
628
|
+
case 1:
|
|
629
|
+
if (direction === 1) {
|
|
630
|
+
incrementMinute(event);
|
|
631
|
+
} else {
|
|
632
|
+
decrementMinute(event);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
break;
|
|
636
|
+
|
|
637
|
+
case 2:
|
|
638
|
+
if (direction === 1) {
|
|
639
|
+
incrementSecond(event);
|
|
640
|
+
} else {
|
|
641
|
+
decrementSecond(event);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
break;
|
|
645
|
+
|
|
646
|
+
case 3:
|
|
647
|
+
if (direction === 1) {
|
|
648
|
+
incrementMilliSecond(event);
|
|
649
|
+
} else {
|
|
650
|
+
decrementMilliSecond(event);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
break;
|
|
654
|
+
|
|
655
|
+
default:
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
const clearTimePickerTimer = () => {
|
|
661
|
+
if (timePickerTimer.current) {
|
|
662
|
+
clearTimeout(timePickerTimer.current);
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
const roundMinutesToStep = (minutes) => {
|
|
667
|
+
if (props.stepMinute) {
|
|
668
|
+
return Math.round(minutes / props.stepMinute) * props.stepMinute;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
return minutes;
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
const incrementHour = (event) => {
|
|
675
|
+
const currentTime = getCurrentDateTime();
|
|
676
|
+
const currentHour = currentTime.getHours();
|
|
677
|
+
let newHour = currentHour + props.stepHour;
|
|
678
|
+
|
|
679
|
+
newHour = newHour >= 24 ? newHour - 24 : newHour;
|
|
680
|
+
|
|
681
|
+
if (validateHour(newHour, currentTime)) {
|
|
682
|
+
if (props.maxDate && props.maxDate.toDateString() === currentTime.toDateString() && props.maxDate.getHours() === newHour) {
|
|
683
|
+
if (props.maxDate.getMinutes() < currentTime.getMinutes()) {
|
|
684
|
+
if (props.maxDate.getSeconds() < currentTime.getSeconds()) {
|
|
685
|
+
if (props.maxDate.getMilliseconds() < currentTime.getMilliseconds()) {
|
|
686
|
+
updateTime(event, newHour, props.maxDate.getMinutes(), props.maxDate.getSeconds(), props.maxDate.getMilliseconds());
|
|
687
|
+
} else {
|
|
688
|
+
updateTime(event, newHour, props.maxDate.getMinutes(), props.maxDate.getSeconds(), currentTime.getMilliseconds());
|
|
689
|
+
}
|
|
690
|
+
} else {
|
|
691
|
+
updateTime(event, newHour, props.maxDate.getMinutes(), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
692
|
+
}
|
|
693
|
+
} else if (props.maxDate.getMinutes() === currentTime.getMinutes()) {
|
|
694
|
+
if (props.maxDate.getSeconds() < currentTime.getSeconds()) {
|
|
695
|
+
if (props.maxDate.getMilliseconds() < currentTime.getMilliseconds()) {
|
|
696
|
+
updateTime(event, newHour, props.maxDate.getMinutes(), props.maxDate.getSeconds(), props.maxDate.getMilliseconds());
|
|
697
|
+
} else {
|
|
698
|
+
updateTime(event, newHour, props.maxDate.getMinutes(), props.maxDate.getSeconds(), currentTime.getMilliseconds());
|
|
699
|
+
}
|
|
700
|
+
} else {
|
|
701
|
+
updateTime(event, newHour, props.maxDate.getMinutes(), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
702
|
+
}
|
|
703
|
+
} else {
|
|
704
|
+
updateTime(event, newHour, roundMinutesToStep(currentTime.getMinutes()), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
705
|
+
}
|
|
706
|
+
} else {
|
|
707
|
+
updateTime(event, newHour, roundMinutesToStep(currentTime.getMinutes()), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
event.preventDefault();
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
const decrementHour = (event) => {
|
|
715
|
+
const currentTime = getCurrentDateTime();
|
|
716
|
+
const currentHour = currentTime.getHours();
|
|
717
|
+
let newHour = currentHour - props.stepHour;
|
|
718
|
+
|
|
719
|
+
newHour = newHour < 0 ? newHour + 24 : newHour;
|
|
720
|
+
|
|
721
|
+
if (validateHour(newHour, currentTime)) {
|
|
722
|
+
if (props.minDate && props.minDate.toDateString() === currentTime.toDateString() && props.minDate.getHours() === newHour) {
|
|
723
|
+
if (props.minDate.getMinutes() > currentTime.getMinutes()) {
|
|
724
|
+
if (props.minDate.getSeconds() > currentTime.getSeconds()) {
|
|
725
|
+
if (props.minDate.getMilliseconds() > currentTime.getMilliseconds()) {
|
|
726
|
+
updateTime(event, newHour, props.minDate.getMinutes(), props.minDate.getSeconds(), props.minDate.getMilliseconds());
|
|
727
|
+
} else {
|
|
728
|
+
updateTime(event, newHour, props.minDate.getMinutes(), props.minDate.getSeconds(), currentTime.getMilliseconds());
|
|
729
|
+
}
|
|
730
|
+
} else {
|
|
731
|
+
updateTime(event, newHour, props.minDate.getMinutes(), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
732
|
+
}
|
|
733
|
+
} else if (props.minDate.getMinutes() === currentTime.getMinutes()) {
|
|
734
|
+
if (props.minDate.getSeconds() > currentTime.getSeconds()) {
|
|
735
|
+
if (props.minDate.getMilliseconds() > currentTime.getMilliseconds()) {
|
|
736
|
+
updateTime(event, newHour, props.minDate.getMinutes(), props.minDate.getSeconds(), props.minDate.getMilliseconds());
|
|
737
|
+
} else {
|
|
738
|
+
updateTime(event, newHour, props.minDate.getMinutes(), props.minDate.getSeconds(), currentTime.getMilliseconds());
|
|
739
|
+
}
|
|
740
|
+
} else {
|
|
741
|
+
updateTime(event, newHour, props.minDate.getMinutes(), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
742
|
+
}
|
|
743
|
+
} else {
|
|
744
|
+
updateTime(event, newHour, roundMinutesToStep(currentTime.getMinutes()), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
745
|
+
}
|
|
746
|
+
} else {
|
|
747
|
+
updateTime(event, newHour, roundMinutesToStep(currentTime.getMinutes()), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
event.preventDefault();
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
const doStepMinute = (currentMinute, step) => {
|
|
755
|
+
if (props.stepMinute <= 1) {
|
|
756
|
+
return step ? currentMinute + step : currentMinute;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
if (!step) {
|
|
760
|
+
step = props.stepMinute;
|
|
761
|
+
|
|
762
|
+
if (currentMinute % step === 0) {
|
|
763
|
+
return currentMinute;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
return Math.floor((currentMinute + step) / step) * step;
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
const incrementMinute = (event) => {
|
|
771
|
+
const currentTime = getCurrentDateTime();
|
|
772
|
+
const currentMinute = currentTime.getMinutes();
|
|
773
|
+
let newMinute = doStepMinute(currentMinute, props.stepMinute);
|
|
774
|
+
|
|
775
|
+
newMinute = newMinute > 59 ? newMinute - 60 : newMinute;
|
|
776
|
+
|
|
777
|
+
if (validateMinute(newMinute, currentTime)) {
|
|
778
|
+
if (props.maxDate && props.maxDate.toDateString() === currentTime.toDateString() && props.maxDate.getMinutes() === newMinute) {
|
|
779
|
+
if (props.maxDate.getSeconds() < currentTime.getSeconds()) {
|
|
780
|
+
if (props.maxDate.getMilliseconds() < currentTime.getMilliseconds()) {
|
|
781
|
+
updateTime(event, currentTime.getHours(), newMinute, props.maxDate.getSeconds(), props.maxDate.getMilliseconds());
|
|
782
|
+
} else {
|
|
783
|
+
updateTime(event, currentTime.getHours(), newMinute, props.maxDate.getSeconds(), currentTime.getMilliseconds());
|
|
784
|
+
}
|
|
785
|
+
} else {
|
|
786
|
+
updateTime(event, currentTime.getHours(), newMinute, currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
787
|
+
}
|
|
788
|
+
} else {
|
|
789
|
+
updateTime(event, currentTime.getHours(), newMinute, currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
event.preventDefault();
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
const decrementMinute = (event) => {
|
|
797
|
+
const currentTime = getCurrentDateTime();
|
|
798
|
+
const currentMinute = currentTime.getMinutes();
|
|
799
|
+
let newMinute = doStepMinute(currentMinute, -props.stepMinute);
|
|
800
|
+
|
|
801
|
+
newMinute = newMinute < 0 ? newMinute + 60 : newMinute;
|
|
802
|
+
|
|
803
|
+
if (validateMinute(newMinute, currentTime)) {
|
|
804
|
+
if (props.minDate && props.minDate.toDateString() === currentTime.toDateString() && props.minDate.getMinutes() === newMinute) {
|
|
805
|
+
if (props.minDate.getSeconds() > currentTime.getSeconds()) {
|
|
806
|
+
if (props.minDate.getMilliseconds() > currentTime.getMilliseconds()) {
|
|
807
|
+
updateTime(event, currentTime.getHours(), newMinute, props.minDate.getSeconds(), props.minDate.getMilliseconds());
|
|
808
|
+
} else {
|
|
809
|
+
updateTime(event, currentTime.getHours(), newMinute, props.minDate.getSeconds(), currentTime.getMilliseconds());
|
|
810
|
+
}
|
|
811
|
+
} else {
|
|
812
|
+
updateTime(event, currentTime.getHours(), newMinute, currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
813
|
+
}
|
|
814
|
+
} else {
|
|
815
|
+
updateTime(event, currentTime.getHours(), newMinute, currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
event.preventDefault();
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
const incrementSecond = (event) => {
|
|
823
|
+
const currentTime = getCurrentDateTime();
|
|
824
|
+
const currentSecond = currentTime.getSeconds();
|
|
825
|
+
let newSecond = currentSecond + props.stepSecond;
|
|
826
|
+
|
|
827
|
+
newSecond = newSecond > 59 ? newSecond - 60 : newSecond;
|
|
828
|
+
|
|
829
|
+
if (validateSecond(newSecond, currentTime)) {
|
|
830
|
+
if (props.maxDate && props.maxDate.toDateString() === currentTime.toDateString() && props.maxDate.getSeconds() === newSecond) {
|
|
831
|
+
if (props.maxDate.getMilliseconds() < currentTime.getMilliseconds()) {
|
|
832
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), newSecond, props.maxDate.getMilliseconds());
|
|
833
|
+
} else {
|
|
834
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), newSecond, currentTime.getMilliseconds());
|
|
835
|
+
}
|
|
836
|
+
} else {
|
|
837
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), newSecond, currentTime.getMilliseconds());
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
event.preventDefault();
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
const decrementSecond = (event) => {
|
|
845
|
+
const currentTime = getCurrentDateTime();
|
|
846
|
+
const currentSecond = currentTime.getSeconds();
|
|
847
|
+
let newSecond = currentSecond - props.stepSecond;
|
|
848
|
+
|
|
849
|
+
newSecond = newSecond < 0 ? newSecond + 60 : newSecond;
|
|
850
|
+
|
|
851
|
+
if (validateSecond(newSecond, currentTime)) {
|
|
852
|
+
if (props.minDate && props.minDate.toDateString() === currentTime.toDateString() && props.minDate.getSeconds() === newSecond) {
|
|
853
|
+
if (props.minDate.getMilliseconds() > currentTime.getMilliseconds()) {
|
|
854
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), newSecond, props.minDate.getMilliseconds());
|
|
855
|
+
} else {
|
|
856
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), newSecond, currentTime.getMilliseconds());
|
|
857
|
+
}
|
|
858
|
+
} else {
|
|
859
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), newSecond, currentTime.getMilliseconds());
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
event.preventDefault();
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
const incrementMilliSecond = (event) => {
|
|
867
|
+
const currentTime = getCurrentDateTime();
|
|
868
|
+
const currentMillisecond = currentTime.getMilliseconds();
|
|
869
|
+
let newMillisecond = currentMillisecond + props.stepMillisec;
|
|
870
|
+
|
|
871
|
+
newMillisecond = newMillisecond > 999 ? newMillisecond - 1000 : newMillisecond;
|
|
872
|
+
|
|
873
|
+
if (validateMillisecond(newMillisecond, currentTime)) {
|
|
874
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), currentTime.getSeconds(), newMillisecond);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
event.preventDefault();
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
const decrementMilliSecond = (event) => {
|
|
881
|
+
const currentTime = getCurrentDateTime();
|
|
882
|
+
const currentMillisecond = currentTime.getMilliseconds();
|
|
883
|
+
let newMillisecond = currentMillisecond - props.stepMillisec;
|
|
884
|
+
|
|
885
|
+
newMillisecond = newMillisecond < 0 ? newMillisecond + 999 : newMillisecond;
|
|
886
|
+
|
|
887
|
+
if (validateMillisecond(newMillisecond, currentTime)) {
|
|
888
|
+
updateTime(event, currentTime.getHours(), currentTime.getMinutes(), currentTime.getSeconds(), newMillisecond);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
event.preventDefault();
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
const toggleAmPm = (event) => {
|
|
895
|
+
const currentTime = getCurrentDateTime();
|
|
896
|
+
const currentHour = currentTime.getHours();
|
|
897
|
+
const newHour = currentHour >= 12 ? currentHour - 12 : currentHour + 12;
|
|
898
|
+
|
|
899
|
+
if (validateHour(convertTo24Hour(newHour, currentHour > 11), currentTime)) {
|
|
900
|
+
updateTime(event, newHour, currentTime.getMinutes(), currentTime.getSeconds(), currentTime.getMilliseconds());
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
event.preventDefault();
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
const getViewDate = (date) => {
|
|
907
|
+
let propValue = props.value;
|
|
908
|
+
let viewDate = date || (props.onViewDateChange ? props.viewDate : viewDateState);
|
|
909
|
+
|
|
910
|
+
if (Array.isArray(propValue)) {
|
|
911
|
+
propValue = propValue[0];
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
return viewDate && isValidDate(viewDate) ? viewDate : propValue && isValidDate(propValue) ? propValue : new Date();
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
const getCurrentDateTime = () => {
|
|
918
|
+
if (isSingleSelection()) {
|
|
919
|
+
return props.value && props.value instanceof Date ? cloneDate(props.value) : getViewDate();
|
|
920
|
+
} else if (isMultipleSelection()) {
|
|
921
|
+
if (props.value && props.value.length) {
|
|
922
|
+
return cloneDate(props.value[props.value.length - 1]);
|
|
923
|
+
}
|
|
924
|
+
} else if (isRangeSelection()) {
|
|
925
|
+
if (props.value && props.value.length) {
|
|
926
|
+
let startDate = cloneDate(props.value[0]);
|
|
927
|
+
let endDate = cloneDate(props.value[1]);
|
|
928
|
+
|
|
929
|
+
return endDate || startDate;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
return new Date();
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
const cloneDate = (date) => {
|
|
937
|
+
return isValidDate(date) ? new Date(date.valueOf()) : date;
|
|
938
|
+
};
|
|
939
|
+
|
|
940
|
+
const isValidDate = (date) => {
|
|
941
|
+
return date instanceof Date && !isNaN(date);
|
|
942
|
+
};
|
|
943
|
+
|
|
944
|
+
const convertTo24Hour = (hour, pm) => {
|
|
945
|
+
if (props.hourFormat === '12') {
|
|
946
|
+
return hour === 12 ? (pm ? 12 : 0) : pm ? hour + 12 : hour;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
return hour;
|
|
950
|
+
};
|
|
951
|
+
|
|
952
|
+
const validateHour = (hour, value) => {
|
|
953
|
+
let valid = true;
|
|
954
|
+
let valueDateString = value ? value.toDateString() : null;
|
|
955
|
+
|
|
956
|
+
if (props.minDate && valueDateString && props.minDate.toDateString() === valueDateString) {
|
|
957
|
+
if (props.minDate.getHours() > hour) {
|
|
958
|
+
valid = false;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
if (props.maxDate && valueDateString && props.maxDate.toDateString() === valueDateString) {
|
|
963
|
+
if (props.maxDate.getHours() < hour) {
|
|
964
|
+
valid = false;
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
return valid;
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
const validateMinute = (minute, value) => {
|
|
972
|
+
let valid = true;
|
|
973
|
+
let valueDateString = value ? value.toDateString() : null;
|
|
974
|
+
|
|
975
|
+
if (props.minDate && valueDateString && props.minDate.toDateString() === valueDateString) {
|
|
976
|
+
if (value.getHours() === props.minDate.getHours()) {
|
|
977
|
+
if (props.minDate.getMinutes() > minute) {
|
|
978
|
+
valid = false;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
if (props.maxDate && valueDateString && props.maxDate.toDateString() === valueDateString) {
|
|
984
|
+
if (value.getHours() === props.maxDate.getHours()) {
|
|
985
|
+
if (props.maxDate.getMinutes() < minute) {
|
|
986
|
+
valid = false;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
return valid;
|
|
992
|
+
};
|
|
993
|
+
|
|
994
|
+
const validateSecond = (second, value) => {
|
|
995
|
+
let valid = true;
|
|
996
|
+
let valueDateString = value ? value.toDateString() : null;
|
|
997
|
+
|
|
998
|
+
if (props.minDate && valueDateString && props.minDate.toDateString() === valueDateString) {
|
|
999
|
+
if (value.getHours() === props.minDate.getHours() && value.getMinutes() === props.minDate.getMinutes()) {
|
|
1000
|
+
if (props.minDate.getSeconds() > second) {
|
|
1001
|
+
valid = false;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
if (props.maxDate && valueDateString && props.maxDate.toDateString() === valueDateString) {
|
|
1007
|
+
if (value.getHours() === props.maxDate.getHours() && value.getMinutes() === props.maxDate.getMinutes()) {
|
|
1008
|
+
if (props.maxDate.getSeconds() < second) {
|
|
1009
|
+
valid = false;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
return valid;
|
|
1015
|
+
};
|
|
1016
|
+
|
|
1017
|
+
const validateMillisecond = (millisecond, value) => {
|
|
1018
|
+
let valid = true;
|
|
1019
|
+
let valueDateString = value ? value.toDateString() : null;
|
|
1020
|
+
|
|
1021
|
+
if (props.minDate && valueDateString && props.minDate.toDateString() === valueDateString) {
|
|
1022
|
+
if (value.getHours() === props.minDate.getHours() && value.getSeconds() === props.minDate.getSeconds() && value.getMinutes() === props.minDate.getMinutes()) {
|
|
1023
|
+
if (props.minDate.getMilliseconds() > millisecond) {
|
|
1024
|
+
valid = false;
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
if (props.maxDate && valueDateString && props.maxDate.toDateString() === valueDateString) {
|
|
1030
|
+
if (value.getHours() === props.maxDate.getHours() && value.getSeconds() === props.maxDate.getSeconds() && value.getMinutes() === props.maxDate.getMinutes()) {
|
|
1031
|
+
if (props.maxDate.getMilliseconds() < millisecond) {
|
|
1032
|
+
valid = false;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
return valid;
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
const validateDate = (value) => {
|
|
1041
|
+
if (props.yearNavigator) {
|
|
1042
|
+
const [minRangeYear, maxRangeYear] = props.yearRange ? props.yearRange.split(':').map((year) => parseInt(year, 10)) : [null, null];
|
|
1043
|
+
|
|
1044
|
+
let viewYear = value.getFullYear();
|
|
1045
|
+
let minYear = null;
|
|
1046
|
+
let maxYear = null;
|
|
1047
|
+
|
|
1048
|
+
if (minRangeYear !== null) {
|
|
1049
|
+
minYear = props.minDate ? Math.max(props.minDate.getFullYear(), minRangeYear) : minRangeYear;
|
|
1050
|
+
} else {
|
|
1051
|
+
minYear = props.minDate?.getFullYear() || minRangeYear;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if (maxRangeYear !== null) {
|
|
1055
|
+
maxYear = props.maxDate ? Math.min(props.maxDate.getFullYear(), maxRangeYear) : maxRangeYear;
|
|
1056
|
+
} else {
|
|
1057
|
+
maxYear = props.maxDate?.getFullYear() || maxRangeYear;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
if (minYear && minYear > viewYear) viewYear = minYear;
|
|
1061
|
+
|
|
1062
|
+
if (maxYear && maxYear < viewYear) viewYear = maxYear;
|
|
1063
|
+
|
|
1064
|
+
value.setFullYear(viewYear);
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
if (renderMonthsNavigator(0)) {
|
|
1068
|
+
let viewMonth = value.getMonth();
|
|
1069
|
+
let viewMonthWithMinMax = parseInt((isInMinYear(value) && Math.max(props.minDate.getMonth(), viewMonth).toString()) || (isInMaxYear(value) && Math.min(props.maxDate.getMonth(), viewMonth).toString()) || viewMonth);
|
|
1070
|
+
|
|
1071
|
+
value.setMonth(viewMonthWithMinMax);
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
const updateTime = (event, hour, minute, second, millisecond) => {
|
|
1076
|
+
let newDateTime = getCurrentDateTime();
|
|
1077
|
+
|
|
1078
|
+
newDateTime.setHours(hour);
|
|
1079
|
+
newDateTime.setMinutes(minute);
|
|
1080
|
+
newDateTime.setSeconds(second);
|
|
1081
|
+
newDateTime.setMilliseconds(millisecond);
|
|
1082
|
+
|
|
1083
|
+
if (isMultipleSelection()) {
|
|
1084
|
+
if (props.value && props.value.length) {
|
|
1085
|
+
let value = [...props.value];
|
|
1086
|
+
|
|
1087
|
+
value[value.length - 1] = newDateTime;
|
|
1088
|
+
|
|
1089
|
+
newDateTime = value;
|
|
1090
|
+
} else {
|
|
1091
|
+
newDateTime = [newDateTime];
|
|
1092
|
+
}
|
|
1093
|
+
} else if (isRangeSelection()) {
|
|
1094
|
+
if (props.value && props.value.length) {
|
|
1095
|
+
let startDate = props.value[0];
|
|
1096
|
+
let endDate = props.value[1];
|
|
1097
|
+
|
|
1098
|
+
newDateTime = endDate ? [startDate, newDateTime] : [newDateTime, null];
|
|
1099
|
+
} else {
|
|
1100
|
+
newDateTime = [newDateTime, null];
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
updateModel(event, newDateTime);
|
|
1105
|
+
|
|
1106
|
+
if (props.onSelect) {
|
|
1107
|
+
props.onSelect({
|
|
1108
|
+
originalEvent: event,
|
|
1109
|
+
value: newDateTime
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
updateInputfield(newDateTime);
|
|
1114
|
+
};
|
|
1115
|
+
|
|
1116
|
+
const updateViewDate = (event, value) => {
|
|
1117
|
+
validateDate(value);
|
|
1118
|
+
|
|
1119
|
+
if (props.onViewDateChange && event) {
|
|
1120
|
+
props.onViewDateChange({
|
|
1121
|
+
originalEvent: event,
|
|
1122
|
+
value
|
|
1123
|
+
});
|
|
1124
|
+
} else {
|
|
1125
|
+
viewStateChanged.current = true;
|
|
1126
|
+
setViewDateState(value);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
if (!value) onClearButtonClick(event);
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
const setNavigationState = (newViewDate) => {
|
|
1133
|
+
if (!newViewDate || !props.showMinMaxRange || props.view !== 'date' || !overlayRef.current) {
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
const navPrev = DomHandler.findSingle(overlayRef.current, '[data-pc-section="previousbutton"]');
|
|
1138
|
+
const navNext = DomHandler.findSingle(overlayRef.current, '[data-pc-section="nextbutton"]');
|
|
1139
|
+
|
|
1140
|
+
if (props.disabled) {
|
|
1141
|
+
!isUnstyled() && DomHandler.addClass(navPrev, 'p-disabled');
|
|
1142
|
+
navPrev.setAttribute('data-p-disabled', true);
|
|
1143
|
+
!isUnstyled() && DomHandler.addClass(navNext, 'p-disabled');
|
|
1144
|
+
navNext.setAttribute('data-p-disabled', true);
|
|
1145
|
+
|
|
1146
|
+
return;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// previous (check first day of month at 00:00:00)
|
|
1150
|
+
if (props.minDate) {
|
|
1151
|
+
let firstDayOfMonth = cloneDate(newViewDate);
|
|
1152
|
+
|
|
1153
|
+
if (firstDayOfMonth.getMonth() === 0) {
|
|
1154
|
+
firstDayOfMonth.setMonth(11, 1);
|
|
1155
|
+
firstDayOfMonth.setFullYear(firstDayOfMonth.getFullYear() - 1);
|
|
1156
|
+
} else {
|
|
1157
|
+
firstDayOfMonth.setMonth(firstDayOfMonth.getMonth(), 1);
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
firstDayOfMonth.setHours(0);
|
|
1161
|
+
firstDayOfMonth.setMinutes(0);
|
|
1162
|
+
firstDayOfMonth.setSeconds(0);
|
|
1163
|
+
|
|
1164
|
+
if (props.minDate > firstDayOfMonth) {
|
|
1165
|
+
DomHandler.addClass(navPrev, 'p-disabled');
|
|
1166
|
+
} else {
|
|
1167
|
+
DomHandler.removeClass(navPrev, 'p-disabled');
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
// next (check last day of month at 11:59:59)
|
|
1172
|
+
if (props.maxDate) {
|
|
1173
|
+
let lastDayOfMonth = cloneDate(newViewDate);
|
|
1174
|
+
|
|
1175
|
+
if (lastDayOfMonth.getMonth() === 11) {
|
|
1176
|
+
lastDayOfMonth.setMonth(0, 1);
|
|
1177
|
+
lastDayOfMonth.setFullYear(lastDayOfMonth.getFullYear() + 1);
|
|
1178
|
+
} else {
|
|
1179
|
+
lastDayOfMonth.setMonth(lastDayOfMonth.getMonth() + 1, 1);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
lastDayOfMonth.setHours(0);
|
|
1183
|
+
lastDayOfMonth.setMinutes(0);
|
|
1184
|
+
lastDayOfMonth.setSeconds(0);
|
|
1185
|
+
lastDayOfMonth.setSeconds(-1);
|
|
1186
|
+
|
|
1187
|
+
if (props.maxDate < lastDayOfMonth) {
|
|
1188
|
+
DomHandler.addClass(navNext, 'p-disabled');
|
|
1189
|
+
} else {
|
|
1190
|
+
DomHandler.removeClass(navNext, 'p-disabled');
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
|
|
1195
|
+
const onDateCellKeydown = (event, date, groupIndex) => {
|
|
1196
|
+
const cellContent = event.currentTarget;
|
|
1197
|
+
const cell = cellContent.parentElement;
|
|
1198
|
+
const cellIndex = DomHandler.index(cell);
|
|
1199
|
+
|
|
1200
|
+
switch (event.code) {
|
|
1201
|
+
case 'ArrowDown': {
|
|
1202
|
+
cellContent.tabIndex = '-1';
|
|
1203
|
+
|
|
1204
|
+
let nextRow = cell.parentElement.nextElementSibling;
|
|
1205
|
+
|
|
1206
|
+
if (nextRow) {
|
|
1207
|
+
let tableRowIndex = DomHandler.index(cell.parentElement);
|
|
1208
|
+
const tableRows = Array.from(cell.parentElement.parentElement.children);
|
|
1209
|
+
const nextTableRows = tableRows.slice(tableRowIndex + 1);
|
|
1210
|
+
|
|
1211
|
+
let hasNextFocusableDate = nextTableRows.find((el) => {
|
|
1212
|
+
let focusCell = el.children[cellIndex].children[0];
|
|
1213
|
+
|
|
1214
|
+
return !DomHandler.getAttribute(focusCell, 'data-p-disabled');
|
|
1215
|
+
});
|
|
1216
|
+
|
|
1217
|
+
if (hasNextFocusableDate) {
|
|
1218
|
+
let focusCell = hasNextFocusableDate.children[cellIndex].children[0];
|
|
1219
|
+
|
|
1220
|
+
focusCell.tabIndex = '0';
|
|
1221
|
+
focusCell.focus();
|
|
1222
|
+
} else {
|
|
1223
|
+
navigation.current = { backward: false };
|
|
1224
|
+
navForward(event);
|
|
1225
|
+
}
|
|
1226
|
+
} else {
|
|
1227
|
+
navigation.current = { backward: false };
|
|
1228
|
+
navForward(event);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
event.preventDefault();
|
|
1232
|
+
break;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
case 'ArrowUp': {
|
|
1236
|
+
cellContent.tabIndex = '-1';
|
|
1237
|
+
|
|
1238
|
+
if (event.altKey) {
|
|
1239
|
+
hide(null, reFocusInputField);
|
|
1240
|
+
} else {
|
|
1241
|
+
let prevRow = cell.parentElement.previousElementSibling;
|
|
1242
|
+
|
|
1243
|
+
if (prevRow) {
|
|
1244
|
+
let tableRowIndex = DomHandler.index(cell.parentElement);
|
|
1245
|
+
const tableRows = Array.from(cell.parentElement.parentElement.children);
|
|
1246
|
+
const prevTableRows = tableRows.slice(0, tableRowIndex).reverse();
|
|
1247
|
+
|
|
1248
|
+
let hasNextFocusableDate = prevTableRows.find((el) => {
|
|
1249
|
+
let focusCell = el.children[cellIndex].children[0];
|
|
1250
|
+
|
|
1251
|
+
return !DomHandler.getAttribute(focusCell, 'data-p-disabled');
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1254
|
+
if (hasNextFocusableDate) {
|
|
1255
|
+
let focusCell = hasNextFocusableDate.children[cellIndex].children[0];
|
|
1256
|
+
|
|
1257
|
+
focusCell.tabIndex = '0';
|
|
1258
|
+
focusCell.focus();
|
|
1259
|
+
} else {
|
|
1260
|
+
navigation.current = { backward: true };
|
|
1261
|
+
navBackward(event);
|
|
1262
|
+
}
|
|
1263
|
+
} else {
|
|
1264
|
+
navigation.current = { backward: true };
|
|
1265
|
+
navBackward(event);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
event.preventDefault();
|
|
1270
|
+
break;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
case 'ArrowLeft': {
|
|
1274
|
+
cellContent.tabIndex = '-1';
|
|
1275
|
+
let prevCell = cell.previousElementSibling;
|
|
1276
|
+
|
|
1277
|
+
if (prevCell) {
|
|
1278
|
+
const cells = Array.from(cell.parentElement.children);
|
|
1279
|
+
const prevCells = cells.slice(0, cellIndex).reverse();
|
|
1280
|
+
|
|
1281
|
+
let hasNextFocusableDate = prevCells.find((el) => {
|
|
1282
|
+
let focusCell = el.children[0];
|
|
1283
|
+
|
|
1284
|
+
return !DomHandler.getAttribute(focusCell, 'data-p-disabled');
|
|
1285
|
+
});
|
|
1286
|
+
|
|
1287
|
+
if (hasNextFocusableDate) {
|
|
1288
|
+
let focusCell = hasNextFocusableDate.children[0];
|
|
1289
|
+
|
|
1290
|
+
focusCell.tabIndex = '0';
|
|
1291
|
+
focusCell.focus();
|
|
1292
|
+
} else {
|
|
1293
|
+
navigateToMonth(true, groupIndex, event);
|
|
1294
|
+
}
|
|
1295
|
+
} else {
|
|
1296
|
+
navigateToMonth(true, groupIndex, event);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
event.preventDefault();
|
|
1300
|
+
break;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
case 'ArrowRight': {
|
|
1304
|
+
cellContent.tabIndex = '-1';
|
|
1305
|
+
let nextCell = cell.nextElementSibling;
|
|
1306
|
+
|
|
1307
|
+
if (nextCell) {
|
|
1308
|
+
const cells = Array.from(cell.parentElement.children);
|
|
1309
|
+
const nextCells = cells.slice(cellIndex + 1);
|
|
1310
|
+
let hasNextFocusableDate = nextCells.find((el) => {
|
|
1311
|
+
let focusCell = el.children[0];
|
|
1312
|
+
|
|
1313
|
+
return !DomHandler.getAttribute(focusCell, 'data-p-disabled');
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
if (hasNextFocusableDate) {
|
|
1317
|
+
let focusCell = hasNextFocusableDate.children[0];
|
|
1318
|
+
|
|
1319
|
+
focusCell.tabIndex = '0';
|
|
1320
|
+
focusCell.focus();
|
|
1321
|
+
} else {
|
|
1322
|
+
navigateToMonth(false, groupIndex, event);
|
|
1323
|
+
}
|
|
1324
|
+
} else {
|
|
1325
|
+
navigateToMonth(false, groupIndex, event);
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
event.preventDefault();
|
|
1329
|
+
break;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
case 'Enter':
|
|
1333
|
+
case 'NumpadEnter':
|
|
1334
|
+
|
|
1335
|
+
case 'Space': {
|
|
1336
|
+
onDateSelect(event, date);
|
|
1337
|
+
event.preventDefault();
|
|
1338
|
+
break;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
case 'Escape': {
|
|
1342
|
+
hide(null, reFocusInputField);
|
|
1343
|
+
event.preventDefault();
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
case 'Tab': {
|
|
1348
|
+
if (!props.inline) {
|
|
1349
|
+
trapFocus(event);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
break;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
case 'Home': {
|
|
1356
|
+
cellContent.tabIndex = '-1';
|
|
1357
|
+
let currentRow = cell.parentElement;
|
|
1358
|
+
let focusCell = currentRow.children[0].children[0];
|
|
1359
|
+
|
|
1360
|
+
if (DomHandler.getAttribute(focusCell, 'data-p-disabled')) {
|
|
1361
|
+
navigateToMonth(groupIndex, true, event);
|
|
1362
|
+
} else {
|
|
1363
|
+
focusCell.tabIndex = '0';
|
|
1364
|
+
focusCell.focus();
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
event.preventDefault();
|
|
1368
|
+
break;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
case 'End': {
|
|
1372
|
+
cellContent.tabIndex = '-1';
|
|
1373
|
+
let currentRow = cell.parentElement;
|
|
1374
|
+
let focusCell = currentRow.children[currentRow.children.length - 1].children[0];
|
|
1375
|
+
|
|
1376
|
+
if (DomHandler.getAttribute(focusCell, 'data-p-disabled')) {
|
|
1377
|
+
navigateToMonth(groupIndex, false, event);
|
|
1378
|
+
} else {
|
|
1379
|
+
focusCell.tabIndex = '0';
|
|
1380
|
+
focusCell.focus();
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
event.preventDefault();
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
case 'PageUp': {
|
|
1388
|
+
cellContent.tabIndex = '-1';
|
|
1389
|
+
|
|
1390
|
+
if (event.shiftKey) {
|
|
1391
|
+
navigation.current = { backward: true };
|
|
1392
|
+
navBackward(event);
|
|
1393
|
+
} else {
|
|
1394
|
+
navigateToMonth(groupIndex, true, event);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
event.preventDefault();
|
|
1398
|
+
break;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
case 'PageDown': {
|
|
1402
|
+
cellContent.tabIndex = '-1';
|
|
1403
|
+
|
|
1404
|
+
if (event.shiftKey) {
|
|
1405
|
+
navigation.current = { backward: false };
|
|
1406
|
+
navForward(event);
|
|
1407
|
+
} else {
|
|
1408
|
+
navigateToMonth(groupIndex, false, event);
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
event.preventDefault();
|
|
1412
|
+
break;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
default:
|
|
1416
|
+
//no op
|
|
1417
|
+
break;
|
|
1418
|
+
}
|
|
1419
|
+
};
|
|
1420
|
+
|
|
1421
|
+
const navigateToMonth = (prev, groupIndex, event) => {
|
|
1422
|
+
if (prev) {
|
|
1423
|
+
if (props.numberOfMonths === 1 || groupIndex === 0) {
|
|
1424
|
+
navigation.current = { backward: true };
|
|
1425
|
+
navBackward(event);
|
|
1426
|
+
} else {
|
|
1427
|
+
const prevMonthContainer = overlayRef.current.children[0].children[groupIndex - 1];
|
|
1428
|
+
const cells = DomHandler.find(prevMonthContainer, 'table td span:not([data-p-disabled="true"])');
|
|
1429
|
+
const focusCell = cells[cells.length - 1];
|
|
1430
|
+
|
|
1431
|
+
focusCell.tabIndex = '0';
|
|
1432
|
+
focusCell.focus();
|
|
1433
|
+
}
|
|
1434
|
+
} else if (props.numberOfMonths === 1 || groupIndex === props.numberOfMonths - 1) {
|
|
1435
|
+
navigation.current = { backward: false };
|
|
1436
|
+
navForward(event);
|
|
1437
|
+
} else {
|
|
1438
|
+
const nextMonthContainer = overlayRef.current.children[0].children[groupIndex + 1];
|
|
1439
|
+
const focusCell = DomHandler.findSingle(nextMonthContainer, 'table td span:not([data-p-disabled="true"])');
|
|
1440
|
+
|
|
1441
|
+
focusCell.tabIndex = '0';
|
|
1442
|
+
focusCell.focus();
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
|
|
1446
|
+
const onMonthCellKeydown = (event, index) => {
|
|
1447
|
+
const cell = event.currentTarget;
|
|
1448
|
+
|
|
1449
|
+
switch (event.code) {
|
|
1450
|
+
//arrows
|
|
1451
|
+
case 'ArrowUp':
|
|
1452
|
+
|
|
1453
|
+
case 'ArrowDown': {
|
|
1454
|
+
cell.tabIndex = '-1';
|
|
1455
|
+
const cells = cell.parentElement.children;
|
|
1456
|
+
const cellIndex = DomHandler.index(cell);
|
|
1457
|
+
const nextCell = cells[event.which === 40 ? cellIndex + 3 : cellIndex - 3];
|
|
1458
|
+
|
|
1459
|
+
if (nextCell) {
|
|
1460
|
+
nextCell.tabIndex = '0';
|
|
1461
|
+
nextCell.focus();
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
event.preventDefault();
|
|
1465
|
+
break;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
case 'ArrowLeft': {
|
|
1469
|
+
cell.tabIndex = '-1';
|
|
1470
|
+
const prevCell = cell.previousElementSibling;
|
|
1471
|
+
|
|
1472
|
+
if (prevCell) {
|
|
1473
|
+
prevCell.tabIndex = '0';
|
|
1474
|
+
prevCell.focus();
|
|
1475
|
+
} else {
|
|
1476
|
+
navigation.current = { backward: true };
|
|
1477
|
+
navBackward(event);
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
event.preventDefault();
|
|
1481
|
+
break;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
case 'ArrowRight': {
|
|
1485
|
+
cell.tabIndex = '-1';
|
|
1486
|
+
const nextCell = cell.nextElementSibling;
|
|
1487
|
+
|
|
1488
|
+
if (nextCell) {
|
|
1489
|
+
nextCell.tabIndex = '0';
|
|
1490
|
+
nextCell.focus();
|
|
1491
|
+
} else {
|
|
1492
|
+
navigation.current = { backward: false };
|
|
1493
|
+
navForward(event);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
event.preventDefault();
|
|
1497
|
+
break;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
case 'PageUp': {
|
|
1501
|
+
if (event.shiftKey) {
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
navigation.current = { backward: true };
|
|
1506
|
+
navBackward(event);
|
|
1507
|
+
|
|
1508
|
+
break;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
case 'PageDown': {
|
|
1512
|
+
if (event.shiftKey) {
|
|
1513
|
+
return;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
navigation.current = { backward: false };
|
|
1517
|
+
navForward(event);
|
|
1518
|
+
|
|
1519
|
+
break;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
case 'Enter':
|
|
1523
|
+
case 'NumpadEnter':
|
|
1524
|
+
|
|
1525
|
+
case 'Space': {
|
|
1526
|
+
if (props.view !== 'month') {
|
|
1527
|
+
viewChangedWithKeyDown.current = true;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
onMonthSelect(event, index);
|
|
1531
|
+
event.preventDefault();
|
|
1532
|
+
break;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
case 'Escape': {
|
|
1536
|
+
hide(null, reFocusInputField);
|
|
1537
|
+
event.preventDefault();
|
|
1538
|
+
break;
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
case 'Tab': {
|
|
1542
|
+
trapFocus(event);
|
|
1543
|
+
break;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
default:
|
|
1547
|
+
//no op
|
|
1548
|
+
break;
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1551
|
+
|
|
1552
|
+
const onYearCellKeydown = (event, index) => {
|
|
1553
|
+
const cell = event.currentTarget;
|
|
1554
|
+
|
|
1555
|
+
switch (event.code) {
|
|
1556
|
+
//arrows
|
|
1557
|
+
case 'ArrowUp':
|
|
1558
|
+
|
|
1559
|
+
case 'ArrowDown': {
|
|
1560
|
+
cell.tabIndex = '-1';
|
|
1561
|
+
let cells = cell.parentElement.children;
|
|
1562
|
+
let cellIndex = DomHandler.index(cell);
|
|
1563
|
+
let nextCell = cells[event.code === 'ArrowDown' ? cellIndex + 2 : cellIndex - 2];
|
|
1564
|
+
|
|
1565
|
+
if (nextCell) {
|
|
1566
|
+
nextCell.tabIndex = '0';
|
|
1567
|
+
nextCell.focus();
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
event.preventDefault();
|
|
1571
|
+
break;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
case 'ArrowLeft': {
|
|
1575
|
+
cell.tabIndex = '-1';
|
|
1576
|
+
let prevCell = cell.previousElementSibling;
|
|
1577
|
+
|
|
1578
|
+
if (prevCell) {
|
|
1579
|
+
prevCell.tabIndex = '0';
|
|
1580
|
+
prevCell.focus();
|
|
1581
|
+
} else {
|
|
1582
|
+
navigation.current = { backward: true };
|
|
1583
|
+
navBackward(event);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
event.preventDefault();
|
|
1587
|
+
break;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
case 'ArrowRight': {
|
|
1591
|
+
cell.tabIndex = '-1';
|
|
1592
|
+
let nextCell = cell.nextElementSibling;
|
|
1593
|
+
|
|
1594
|
+
if (nextCell) {
|
|
1595
|
+
nextCell.tabIndex = '0';
|
|
1596
|
+
nextCell.focus();
|
|
1597
|
+
} else {
|
|
1598
|
+
navigation.current = { backward: false };
|
|
1599
|
+
navForward(event);
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
event.preventDefault();
|
|
1603
|
+
break;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
case 'PageUp': {
|
|
1607
|
+
if (event.shiftKey) {
|
|
1608
|
+
return;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
navigation.current = { backward: true };
|
|
1612
|
+
navBackward(event);
|
|
1613
|
+
|
|
1614
|
+
break;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
case 'PageDown': {
|
|
1618
|
+
if (event.shiftKey) {
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
navigation.current = { backward: false };
|
|
1623
|
+
navForward(event);
|
|
1624
|
+
|
|
1625
|
+
break;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
case 'Enter':
|
|
1629
|
+
case 'NumpadEnter':
|
|
1630
|
+
|
|
1631
|
+
case 'Space': {
|
|
1632
|
+
if (props.view !== 'year') {
|
|
1633
|
+
viewChangedWithKeyDown.current = true;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
onYearSelect(event, index);
|
|
1637
|
+
event.preventDefault();
|
|
1638
|
+
break;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
case 'Escape': {
|
|
1642
|
+
hide(null, reFocusInputField);
|
|
1643
|
+
event.preventDefault();
|
|
1644
|
+
break;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
case 'Tab': {
|
|
1648
|
+
trapFocus(event);
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
default:
|
|
1653
|
+
//no op
|
|
1654
|
+
break;
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
const onDateSelect = (event, dateMeta, timeMeta, isUpdateViewDate) => {
|
|
1659
|
+
if (!event) {
|
|
1660
|
+
return;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
if (props.disabled || !dateMeta.selectable) {
|
|
1664
|
+
event.preventDefault();
|
|
1665
|
+
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
DomHandler.find(overlayRef.current, 'table td span:not([data-p-disabled="true"])').forEach((cell) => (cell.tabIndex = -1));
|
|
1670
|
+
event.currentTarget.focus();
|
|
1671
|
+
|
|
1672
|
+
if (isMultipleSelection()) {
|
|
1673
|
+
if (isSelected(dateMeta)) {
|
|
1674
|
+
let value = props.value.filter((date) => {
|
|
1675
|
+
return !isDateEquals(date, dateMeta);
|
|
1676
|
+
});
|
|
1677
|
+
|
|
1678
|
+
updateModel(event, value);
|
|
1679
|
+
updateInputfield(value);
|
|
1680
|
+
} else if (!props.maxDateCount || !props.value || props.maxDateCount > props.value.length) {
|
|
1681
|
+
selectDate(event, dateMeta, timeMeta);
|
|
1682
|
+
}
|
|
1683
|
+
} else {
|
|
1684
|
+
selectDate(event, dateMeta, timeMeta);
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
if (!props.inline && isSingleSelection() && (!props.showTime || props.hideOnDateTimeSelect) && !isUpdateViewDate) {
|
|
1688
|
+
setTimeout(() => {
|
|
1689
|
+
hide('dateselect');
|
|
1690
|
+
|
|
1691
|
+
if (props.selectionMode !== 'single') {
|
|
1692
|
+
reFocusInputField();
|
|
1693
|
+
}
|
|
1694
|
+
}, 100);
|
|
1695
|
+
|
|
1696
|
+
if (touchUIMask.current) {
|
|
1697
|
+
disableModality();
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
event.preventDefault();
|
|
1702
|
+
};
|
|
1703
|
+
|
|
1704
|
+
const selectTime = (date, timeMeta) => {
|
|
1705
|
+
if (props.showTime) {
|
|
1706
|
+
let hours;
|
|
1707
|
+
let minutes;
|
|
1708
|
+
let seconds;
|
|
1709
|
+
let milliseconds;
|
|
1710
|
+
|
|
1711
|
+
if (timeMeta) {
|
|
1712
|
+
({ hours, minutes, seconds, milliseconds } = timeMeta);
|
|
1713
|
+
} else {
|
|
1714
|
+
let time = getCurrentDateTime();
|
|
1715
|
+
|
|
1716
|
+
[hours, minutes, seconds, milliseconds] = [time.getHours(), time.getMinutes(), props.showSeconds ? time.getSeconds() : 0, props.showMillisec ? time.getMilliseconds() : 0];
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
date.setHours(hours);
|
|
1720
|
+
date.setMinutes(doStepMinute(minutes));
|
|
1721
|
+
date.setSeconds(seconds);
|
|
1722
|
+
date.setMilliseconds(milliseconds);
|
|
1723
|
+
}
|
|
1724
|
+
};
|
|
1725
|
+
|
|
1726
|
+
const selectDate = (event, dateMeta, timeMeta) => {
|
|
1727
|
+
let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
|
|
1728
|
+
|
|
1729
|
+
selectTime(date, timeMeta);
|
|
1730
|
+
|
|
1731
|
+
if (props.minDate && props.minDate > date) {
|
|
1732
|
+
date = props.minDate;
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
if (props.maxDate && props.maxDate < date) {
|
|
1736
|
+
date = props.maxDate;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
let selectedValues = date;
|
|
1740
|
+
|
|
1741
|
+
if (isSingleSelection()) {
|
|
1742
|
+
updateModel(event, date);
|
|
1743
|
+
} else if (isMultipleSelection()) {
|
|
1744
|
+
selectedValues = props.value ? [...props.value, date] : [date];
|
|
1745
|
+
updateModel(event, selectedValues);
|
|
1746
|
+
} else if (isRangeSelection()) {
|
|
1747
|
+
if (props.value && props.value.length) {
|
|
1748
|
+
let startDate = props.value[0];
|
|
1749
|
+
let endDate = props.value[1];
|
|
1750
|
+
|
|
1751
|
+
if (!endDate) {
|
|
1752
|
+
if (date.getTime() >= startDate.getTime()) {
|
|
1753
|
+
endDate = date;
|
|
1754
|
+
} else {
|
|
1755
|
+
endDate = startDate;
|
|
1756
|
+
startDate = date;
|
|
1757
|
+
}
|
|
1758
|
+
} else {
|
|
1759
|
+
startDate = date;
|
|
1760
|
+
endDate = null;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
selectedValues = [startDate, endDate];
|
|
1764
|
+
updateModel(event, selectedValues);
|
|
1765
|
+
|
|
1766
|
+
if (props.hideOnRangeSelection && endDate !== null) {
|
|
1767
|
+
setTimeout(() => {
|
|
1768
|
+
setOverlayVisibleState(false);
|
|
1769
|
+
}, 150);
|
|
1770
|
+
}
|
|
1771
|
+
} else {
|
|
1772
|
+
selectedValues = [date, null];
|
|
1773
|
+
updateModel(event, selectedValues);
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
if (props.onSelect) {
|
|
1778
|
+
props.onSelect({
|
|
1779
|
+
originalEvent: event,
|
|
1780
|
+
value: date
|
|
1781
|
+
});
|
|
1782
|
+
}
|
|
1783
|
+
};
|
|
1784
|
+
|
|
1785
|
+
const decrementDecade = () => {
|
|
1786
|
+
const _currentYear = currentYear - 10;
|
|
1787
|
+
|
|
1788
|
+
setCurrentYear(_currentYear);
|
|
1789
|
+
|
|
1790
|
+
return _currentYear;
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
const incrementDecade = () => {
|
|
1794
|
+
const _currentYear = currentYear + 10;
|
|
1795
|
+
|
|
1796
|
+
setCurrentYear(_currentYear);
|
|
1797
|
+
|
|
1798
|
+
return _currentYear;
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1801
|
+
const switchToMonthView = (event) => {
|
|
1802
|
+
if (event && event.code && (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space')) {
|
|
1803
|
+
viewChangedWithKeyDown.current = true;
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
setCurrentView('month');
|
|
1807
|
+
event.preventDefault();
|
|
1808
|
+
};
|
|
1809
|
+
|
|
1810
|
+
const switchToYearView = (event) => {
|
|
1811
|
+
if (event && event.code && (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space')) {
|
|
1812
|
+
viewChangedWithKeyDown.current = true;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
setCurrentView('year');
|
|
1816
|
+
event.preventDefault();
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
const onMonthSelect = (event, month) => {
|
|
1820
|
+
if (props.view === 'month') {
|
|
1821
|
+
const year = getViewYear();
|
|
1822
|
+
|
|
1823
|
+
onDateSelect(event, { year, month: month, day: 1, selectable: true });
|
|
1824
|
+
event.preventDefault();
|
|
1825
|
+
} else {
|
|
1826
|
+
setCurrentMonth(month);
|
|
1827
|
+
createMonthsMeta(month, currentYear);
|
|
1828
|
+
const currentDate = cloneDate(getCurrentDateTime());
|
|
1829
|
+
|
|
1830
|
+
currentDate.setDate(1); // #2948 always set to 1st of month
|
|
1831
|
+
currentDate.setMonth(month);
|
|
1832
|
+
currentDate.setYear(currentYear);
|
|
1833
|
+
|
|
1834
|
+
setViewDateState(currentDate);
|
|
1835
|
+
setCurrentView('date');
|
|
1836
|
+
props.onMonthChange && props.onMonthChange({ month: month + 1, year: currentYear });
|
|
1837
|
+
|
|
1838
|
+
updateViewDate(event, currentDate);
|
|
1839
|
+
onViewDateSelect({ event, date: currentDate });
|
|
1840
|
+
}
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
const getViewYear = () => {
|
|
1844
|
+
return props.yearNavigator ? getViewDate().getFullYear() : currentYear;
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1847
|
+
const onYearSelect = (event, year) => {
|
|
1848
|
+
if (props.view === 'year') {
|
|
1849
|
+
onDateSelect(event, { year: year, month: 0, day: 1, selectable: true });
|
|
1850
|
+
} else {
|
|
1851
|
+
setCurrentYear(year);
|
|
1852
|
+
setCurrentView('month');
|
|
1853
|
+
props.onMonthChange && props.onMonthChange({ month: currentMonth + 1, year: year });
|
|
1854
|
+
}
|
|
1855
|
+
};
|
|
1856
|
+
|
|
1857
|
+
const updateModel = (event, value) => {
|
|
1858
|
+
if (props.onChange) {
|
|
1859
|
+
const newValue = cloneDate(value);
|
|
1860
|
+
|
|
1861
|
+
viewStateChanged.current = true;
|
|
1862
|
+
|
|
1863
|
+
onChangeRef.current({
|
|
1864
|
+
originalEvent: event,
|
|
1865
|
+
value: newValue,
|
|
1866
|
+
stopPropagation: () => {
|
|
1867
|
+
event?.stopPropagation();
|
|
1868
|
+
},
|
|
1869
|
+
preventDefault: () => {
|
|
1870
|
+
event?.preventDefault();
|
|
1871
|
+
},
|
|
1872
|
+
target: {
|
|
1873
|
+
name: props.name,
|
|
1874
|
+
id: props.id,
|
|
1875
|
+
value: newValue
|
|
1876
|
+
}
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
const show = (type) => {
|
|
1882
|
+
if (props.onVisibleChange) {
|
|
1883
|
+
props.onVisibleChange({
|
|
1884
|
+
visible: true,
|
|
1885
|
+
type
|
|
1886
|
+
});
|
|
1887
|
+
} else {
|
|
1888
|
+
setOverlayVisibleState(true);
|
|
1889
|
+
|
|
1890
|
+
overlayEventListener.current = (e) => {
|
|
1891
|
+
if (!isOutsideClicked(e) && visible) {
|
|
1892
|
+
isOverlayClicked.current = true;
|
|
1893
|
+
}
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1896
|
+
OverlayService.on('overlay-click', overlayEventListener.current);
|
|
1897
|
+
}
|
|
1898
|
+
};
|
|
1899
|
+
|
|
1900
|
+
const hide = (type, callback) => {
|
|
1901
|
+
const _hideCallback = () => {
|
|
1902
|
+
viewStateChanged.current = false;
|
|
1903
|
+
ignoreFocusFunctionality.current = false;
|
|
1904
|
+
isOverlayClicked.current = false;
|
|
1905
|
+
|
|
1906
|
+
callback && callback();
|
|
1907
|
+
|
|
1908
|
+
OverlayService.off('overlay-click', overlayEventListener.current);
|
|
1909
|
+
overlayEventListener.current = null;
|
|
1910
|
+
};
|
|
1911
|
+
|
|
1912
|
+
props.touchUI && disableModality();
|
|
1913
|
+
|
|
1914
|
+
if (props.onVisibleChange) {
|
|
1915
|
+
props.onVisibleChange({
|
|
1916
|
+
visible: type !== 'dateselect', // false only if selecting a value to close panel
|
|
1917
|
+
type,
|
|
1918
|
+
callback: _hideCallback
|
|
1919
|
+
});
|
|
1920
|
+
} else {
|
|
1921
|
+
setOverlayVisibleState(false);
|
|
1922
|
+
_hideCallback();
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
|
|
1926
|
+
const onOverlayEnter = () => {
|
|
1927
|
+
const styles = props.touchUI
|
|
1928
|
+
? {
|
|
1929
|
+
position: 'fixed',
|
|
1930
|
+
top: '50%',
|
|
1931
|
+
left: '50%',
|
|
1932
|
+
transform: 'translate(-50%, -50%)'
|
|
1933
|
+
}
|
|
1934
|
+
: !props.inline
|
|
1935
|
+
? { position: 'absolute', top: '0', left: '0' }
|
|
1936
|
+
: undefined;
|
|
1937
|
+
|
|
1938
|
+
DomHandler.addStyles(overlayRef.current, styles);
|
|
1939
|
+
|
|
1940
|
+
if (props.autoZIndex) {
|
|
1941
|
+
const key = props.touchUI ? 'modal' : 'overlay';
|
|
1942
|
+
|
|
1943
|
+
ZIndexUtils.set(key, overlayRef.current, (context && context.autoZIndex) || PrimeReact.autoZIndex, props.baseZIndex || (context && context.zIndex[key]) || PrimeReact.zIndex[key]);
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
if (!props.touchUI && overlayRef && overlayRef.current && inputRef && inputRef.current && !appendDisabled()) {
|
|
1947
|
+
let inputWidth = DomHandler.getOuterWidth(inputRef.current);
|
|
1948
|
+
|
|
1949
|
+
// #5435 must have reasonable width if input is too small
|
|
1950
|
+
if (inputWidth < 220) {
|
|
1951
|
+
inputWidth = 220;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
if (props.view === 'date') {
|
|
1955
|
+
overlayRef.current.style.width = DomHandler.getOuterWidth(overlayRef.current) + 'px';
|
|
1956
|
+
} else {
|
|
1957
|
+
overlayRef.current.style.width = inputWidth + 'px';
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
// #5830 Tailwind does not need a min width it breaks the styling
|
|
1961
|
+
if (!isUnstyled()) {
|
|
1962
|
+
overlayRef.current.style.minWidth = inputWidth + 'px';
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
alignOverlay();
|
|
1967
|
+
};
|
|
1968
|
+
|
|
1969
|
+
const onOverlayEntered = () => {
|
|
1970
|
+
bindOverlayListener();
|
|
1971
|
+
props.onShow && props.onShow();
|
|
1972
|
+
setFocusedState(false);
|
|
1973
|
+
};
|
|
1974
|
+
|
|
1975
|
+
const onOverlayExit = () => {
|
|
1976
|
+
unbindOverlayListener();
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
const onOverlayExited = () => {
|
|
1980
|
+
ZIndexUtils.clear(overlayRef.current);
|
|
1981
|
+
|
|
1982
|
+
props.onHide && props.onHide();
|
|
1983
|
+
};
|
|
1984
|
+
|
|
1985
|
+
const appendDisabled = () => {
|
|
1986
|
+
const appendTo = props.appendTo || (context && context.appendTo) || PrimeReact.appendTo;
|
|
1987
|
+
|
|
1988
|
+
return appendTo === 'self' || props.inline;
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
const alignOverlay = () => {
|
|
1992
|
+
if (props.touchUI) {
|
|
1993
|
+
enableModality();
|
|
1994
|
+
} else if (overlayRef && overlayRef.current && inputRef && inputRef.current) {
|
|
1995
|
+
DomHandler.alignOverlay(overlayRef.current, inputRef.current, props.appendTo || (context && context.appendTo) || PrimeReact.appendTo);
|
|
1996
|
+
|
|
1997
|
+
if (appendDisabled()) {
|
|
1998
|
+
DomHandler.relativePosition(overlayRef.current, inputRef.current);
|
|
1999
|
+
} else {
|
|
2000
|
+
DomHandler.absolutePosition(overlayRef.current, inputRef.current);
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
// #6093 Forcibly remove minWidth when in unstyled mode
|
|
2005
|
+
if (isUnstyled()) {
|
|
2006
|
+
overlayRef.current.style.minWidth = '';
|
|
2007
|
+
}
|
|
2008
|
+
};
|
|
2009
|
+
|
|
2010
|
+
const enableModality = () => {
|
|
2011
|
+
if (!touchUIMask.current) {
|
|
2012
|
+
touchUIMask.current = document.createElement('div');
|
|
2013
|
+
touchUIMask.current.style.zIndex = String(ZIndexUtils.get(overlayRef.current) - 1);
|
|
2014
|
+
!isUnstyled() && DomHandler.addMultipleClasses(touchUIMask.current, 'p-component-overlay p-datepicker-mask p-datepicker-mask-scrollblocker p-component-overlay-enter');
|
|
2015
|
+
|
|
2016
|
+
touchUIMaskClickListener.current = () => {
|
|
2017
|
+
disableModality();
|
|
2018
|
+
hide();
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
touchUIMask.current.addEventListener('click', touchUIMaskClickListener.current);
|
|
2022
|
+
|
|
2023
|
+
document.body.appendChild(touchUIMask.current);
|
|
2024
|
+
DomHandler.blockBodyScroll();
|
|
2025
|
+
}
|
|
2026
|
+
};
|
|
2027
|
+
|
|
2028
|
+
const disableModality = () => {
|
|
2029
|
+
if (touchUIMask.current) {
|
|
2030
|
+
if (isUnstyled) {
|
|
2031
|
+
destroyMask();
|
|
2032
|
+
} else {
|
|
2033
|
+
!isUnstyled() && DomHandler.addClass(touchUIMask.current, 'p-component-overlay-leave');
|
|
2034
|
+
|
|
2035
|
+
if (DomHandler.hasCSSAnimation(touchUIMask.current) > 0) {
|
|
2036
|
+
touchUIMask.current.addEventListener('animationend', () => {
|
|
2037
|
+
destroyMask();
|
|
2038
|
+
});
|
|
2039
|
+
} else {
|
|
2040
|
+
destroyMask();
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
};
|
|
2045
|
+
|
|
2046
|
+
const destroyMask = () => {
|
|
2047
|
+
if (touchUIMask.current) {
|
|
2048
|
+
touchUIMask.current.removeEventListener('click', touchUIMaskClickListener.current);
|
|
2049
|
+
touchUIMaskClickListener.current = null;
|
|
2050
|
+
document.body.removeChild(touchUIMask.current);
|
|
2051
|
+
touchUIMask.current = null;
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
let bodyChildren = document.body.children;
|
|
2055
|
+
let hasBlockerMasks;
|
|
2056
|
+
|
|
2057
|
+
for (let i = 0; i < bodyChildren.length; i++) {
|
|
2058
|
+
let bodyChild = bodyChildren[i];
|
|
2059
|
+
|
|
2060
|
+
if (DomHandler.hasClass(bodyChild, 'p-datepicker-mask-scrollblocker')) {
|
|
2061
|
+
hasBlockerMasks = true;
|
|
2062
|
+
break;
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
if (!hasBlockerMasks) {
|
|
2067
|
+
DomHandler.unblockBodyScroll();
|
|
2068
|
+
}
|
|
2069
|
+
};
|
|
2070
|
+
|
|
2071
|
+
const isOutsideClicked = (event) => {
|
|
2072
|
+
return elementRef.current && !(elementRef.current.isSameNode(event.target) || isNavIconClicked(event.target) || elementRef.current.contains(event.target) || (overlayRef.current && overlayRef.current.contains(event.target)));
|
|
2073
|
+
};
|
|
2074
|
+
|
|
2075
|
+
const isNavIconClicked = (target) => {
|
|
2076
|
+
return (previousButton.current && (previousButton.current.isSameNode(target) || previousButton.current.contains(target))) || (nextButton.current && (nextButton.current.isSameNode(target) || nextButton.current.contains(target)));
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
const getFirstDayOfMonthIndex = (month, year) => {
|
|
2080
|
+
let day = new Date();
|
|
2081
|
+
|
|
2082
|
+
day.setDate(1);
|
|
2083
|
+
day.setMonth(month);
|
|
2084
|
+
day.setFullYear(year);
|
|
2085
|
+
|
|
2086
|
+
let dayIndex = day.getDay() + getSundayIndex();
|
|
2087
|
+
|
|
2088
|
+
return dayIndex >= 7 ? dayIndex - 7 : dayIndex;
|
|
2089
|
+
};
|
|
2090
|
+
|
|
2091
|
+
const getDaysCountInMonth = (month, year) => {
|
|
2092
|
+
return 32 - daylightSavingAdjust(new Date(year, month, 32)).getDate();
|
|
2093
|
+
};
|
|
2094
|
+
|
|
2095
|
+
const getDaysCountInPrevMonth = (month, year) => {
|
|
2096
|
+
let prev = getPreviousMonthAndYear(month, year);
|
|
2097
|
+
|
|
2098
|
+
return getDaysCountInMonth(prev.month, prev.year);
|
|
2099
|
+
};
|
|
2100
|
+
|
|
2101
|
+
const daylightSavingAdjust = (date) => {
|
|
2102
|
+
if (!date) {
|
|
2103
|
+
return null;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
|
|
2107
|
+
|
|
2108
|
+
return date;
|
|
2109
|
+
};
|
|
2110
|
+
|
|
2111
|
+
const getPreviousMonthAndYear = (month, year) => {
|
|
2112
|
+
let m;
|
|
2113
|
+
let y;
|
|
2114
|
+
|
|
2115
|
+
if (month === 0) {
|
|
2116
|
+
m = 11;
|
|
2117
|
+
y = year - 1;
|
|
2118
|
+
} else {
|
|
2119
|
+
m = month - 1;
|
|
2120
|
+
y = year;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
return { month: m, year: y };
|
|
2124
|
+
};
|
|
2125
|
+
|
|
2126
|
+
const getNextMonthAndYear = (month, year) => {
|
|
2127
|
+
let m;
|
|
2128
|
+
let y;
|
|
2129
|
+
|
|
2130
|
+
if (month === 11) {
|
|
2131
|
+
m = 0;
|
|
2132
|
+
y = year + 1;
|
|
2133
|
+
} else {
|
|
2134
|
+
m = month + 1;
|
|
2135
|
+
y = year;
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
return { month: m, year: y };
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2141
|
+
const getSundayIndex = () => {
|
|
2142
|
+
const firstDayOfWeek = localeOption('firstDayOfWeek', props.locale);
|
|
2143
|
+
|
|
2144
|
+
return firstDayOfWeek > 0 ? 7 - firstDayOfWeek : 0;
|
|
2145
|
+
};
|
|
2146
|
+
|
|
2147
|
+
const createWeekDaysMeta = () => {
|
|
2148
|
+
let weekDays = [];
|
|
2149
|
+
let { firstDayOfWeek: dayIndex, dayNamesMin } = localeOptions(props.locale);
|
|
2150
|
+
|
|
2151
|
+
for (let i = 0; i < 7; i++) {
|
|
2152
|
+
weekDays.push(dayNamesMin[dayIndex]);
|
|
2153
|
+
dayIndex = dayIndex === 6 ? 0 : ++dayIndex;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
return weekDays;
|
|
2157
|
+
};
|
|
2158
|
+
|
|
2159
|
+
const createMonthsMeta = (month, year) => {
|
|
2160
|
+
let months = [];
|
|
2161
|
+
|
|
2162
|
+
for (let i = 0; i < props.numberOfMonths; i++) {
|
|
2163
|
+
let m = month + i;
|
|
2164
|
+
let y = year;
|
|
2165
|
+
|
|
2166
|
+
if (m > 11) {
|
|
2167
|
+
m = (m % 11) - 1;
|
|
2168
|
+
y = year + 1;
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
months.push(createMonthMeta(m, y));
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
return months;
|
|
2175
|
+
};
|
|
2176
|
+
|
|
2177
|
+
const createMonthMeta = (month, year) => {
|
|
2178
|
+
let dates = [];
|
|
2179
|
+
let firstDay = getFirstDayOfMonthIndex(month, year);
|
|
2180
|
+
let daysLength = getDaysCountInMonth(month, year);
|
|
2181
|
+
let prevMonthDaysLength = getDaysCountInPrevMonth(month, year);
|
|
2182
|
+
let dayNo = 1;
|
|
2183
|
+
let today = new Date();
|
|
2184
|
+
let weekNumbers = [];
|
|
2185
|
+
let monthRows = Math.ceil((daysLength + firstDay) / 7);
|
|
2186
|
+
|
|
2187
|
+
for (let i = 0; i < monthRows; i++) {
|
|
2188
|
+
let week = [];
|
|
2189
|
+
|
|
2190
|
+
if (i === 0) {
|
|
2191
|
+
for (let j = prevMonthDaysLength - firstDay + 1; j <= prevMonthDaysLength; j++) {
|
|
2192
|
+
let prev = getPreviousMonthAndYear(month, year);
|
|
2193
|
+
|
|
2194
|
+
week.push({
|
|
2195
|
+
day: j,
|
|
2196
|
+
month: prev.month,
|
|
2197
|
+
year: prev.year,
|
|
2198
|
+
otherMonth: true,
|
|
2199
|
+
today: isToday(today, j, prev.month, prev.year),
|
|
2200
|
+
selectable: isSelectable(j, prev.month, prev.year, true)
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
let remainingDaysLength = 7 - week.length;
|
|
2205
|
+
|
|
2206
|
+
for (let j = 0; j < remainingDaysLength; j++) {
|
|
2207
|
+
week.push({
|
|
2208
|
+
day: dayNo,
|
|
2209
|
+
month: month,
|
|
2210
|
+
year: year,
|
|
2211
|
+
today: isToday(today, dayNo, month, year),
|
|
2212
|
+
selectable: isSelectable(dayNo, month, year, false)
|
|
2213
|
+
});
|
|
2214
|
+
dayNo++;
|
|
2215
|
+
}
|
|
2216
|
+
} else {
|
|
2217
|
+
for (let j = 0; j < 7; j++) {
|
|
2218
|
+
if (dayNo > daysLength) {
|
|
2219
|
+
let next = getNextMonthAndYear(month, year);
|
|
2220
|
+
|
|
2221
|
+
week.push({
|
|
2222
|
+
day: dayNo - daysLength,
|
|
2223
|
+
month: next.month,
|
|
2224
|
+
year: next.year,
|
|
2225
|
+
otherMonth: true,
|
|
2226
|
+
today: isToday(today, dayNo - daysLength, next.month, next.year),
|
|
2227
|
+
selectable: isSelectable(dayNo - daysLength, next.month, next.year, true)
|
|
2228
|
+
});
|
|
2229
|
+
} else {
|
|
2230
|
+
week.push({
|
|
2231
|
+
day: dayNo,
|
|
2232
|
+
month: month,
|
|
2233
|
+
year: year,
|
|
2234
|
+
today: isToday(today, dayNo, month, year),
|
|
2235
|
+
selectable: isSelectable(dayNo, month, year, false)
|
|
2236
|
+
});
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
dayNo++;
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
if (props.showWeek) {
|
|
2244
|
+
weekNumbers.push(getWeekNumber(new Date(week[0].year, week[0].month, week[0].day)));
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
dates.push(week);
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
return {
|
|
2251
|
+
month: month,
|
|
2252
|
+
year: year,
|
|
2253
|
+
dates: dates,
|
|
2254
|
+
weekNumbers: weekNumbers
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2257
|
+
|
|
2258
|
+
const getWeekNumber = (date) => {
|
|
2259
|
+
let checkDate = cloneDate(date);
|
|
2260
|
+
|
|
2261
|
+
checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
|
|
2262
|
+
let time = checkDate.getTime();
|
|
2263
|
+
|
|
2264
|
+
checkDate.setMonth(0);
|
|
2265
|
+
checkDate.setDate(1);
|
|
2266
|
+
|
|
2267
|
+
return Math.floor(Math.round((time - checkDate.getTime()) / 86400000) / 7) + 1;
|
|
2268
|
+
};
|
|
2269
|
+
|
|
2270
|
+
const isSelectable = (day, month, year, otherMonth) => {
|
|
2271
|
+
let validMin = true;
|
|
2272
|
+
let validMax = true;
|
|
2273
|
+
let validDate = true;
|
|
2274
|
+
let validDay = true;
|
|
2275
|
+
let validMonth = true;
|
|
2276
|
+
|
|
2277
|
+
if (props.minDate) {
|
|
2278
|
+
if (props.minDate.getFullYear() > year) {
|
|
2279
|
+
validMin = false;
|
|
2280
|
+
} else if (props.minDate.getFullYear() === year) {
|
|
2281
|
+
if (month > -1 && props.minDate.getMonth() > month) {
|
|
2282
|
+
validMin = false;
|
|
2283
|
+
} else if (month > -1 && props.minDate.getMonth() === month) {
|
|
2284
|
+
if (day > 0 && props.minDate.getDate() > day) {
|
|
2285
|
+
validMin = false;
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
if (props.maxDate) {
|
|
2292
|
+
if (props.maxDate.getFullYear() < year) {
|
|
2293
|
+
validMax = false;
|
|
2294
|
+
} else if (props.maxDate.getFullYear() === year) {
|
|
2295
|
+
if (month > -1 && props.maxDate.getMonth() < month) {
|
|
2296
|
+
validMax = false;
|
|
2297
|
+
} else if (month > -1 && props.maxDate.getMonth() === month) {
|
|
2298
|
+
if (day > 0 && props.maxDate.getDate() < day) {
|
|
2299
|
+
validMax = false;
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
if (props.disabledDates || props.enabledDates || props.disabledDays) {
|
|
2306
|
+
validDay = !isDayDisabled(day, month, year);
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
if (props.selectOtherMonths === false && otherMonth) {
|
|
2310
|
+
validMonth = false;
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
return validMin && validMax && validDate && validDay && validMonth;
|
|
2314
|
+
};
|
|
2315
|
+
|
|
2316
|
+
const isSelectableTime = (value) => {
|
|
2317
|
+
let validMin = true;
|
|
2318
|
+
let validMax = true;
|
|
2319
|
+
|
|
2320
|
+
if (props.minDate && props.minDate.toDateString() === value.toDateString()) {
|
|
2321
|
+
if (props.minDate.getHours() > value.getHours()) {
|
|
2322
|
+
validMin = false;
|
|
2323
|
+
} else if (props.minDate.getHours() === value.getHours()) {
|
|
2324
|
+
if (props.minDate.getMinutes() > value.getMinutes()) {
|
|
2325
|
+
validMin = false;
|
|
2326
|
+
} else if (props.minDate.getMinutes() === value.getMinutes()) {
|
|
2327
|
+
if (props.showSeconds) {
|
|
2328
|
+
if (props.minDate.getSeconds() > value.getSeconds()) {
|
|
2329
|
+
validMin = false;
|
|
2330
|
+
} else if (props.minDate.getSeconds() === value.getSeconds()) {
|
|
2331
|
+
if (!props.showMillisec || props.minDate.getMilliseconds() > value.getMilliseconds()) {
|
|
2332
|
+
validMin = false;
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
if (props.maxDate && props.maxDate.toDateString() === value.toDateString()) {
|
|
2341
|
+
if (props.maxDate.getHours() < value.getHours()) {
|
|
2342
|
+
validMax = false;
|
|
2343
|
+
} else if (props.maxDate.getHours() === value.getHours()) {
|
|
2344
|
+
if (props.maxDate.getMinutes() < value.getMinutes()) {
|
|
2345
|
+
validMax = false;
|
|
2346
|
+
} else if (props.maxDate.getMinutes() === value.getMinutes()) {
|
|
2347
|
+
if (props.showSeconds) {
|
|
2348
|
+
if (props.maxDate.getSeconds() < value.getSeconds()) {
|
|
2349
|
+
validMax = false;
|
|
2350
|
+
} else if (props.maxDate.getSeconds() === value.getSeconds()) {
|
|
2351
|
+
if (!props.showMillisec || props.maxDate.getMilliseconds() < value.getMilliseconds()) {
|
|
2352
|
+
validMax = false;
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
return validMin && validMax;
|
|
2361
|
+
};
|
|
2362
|
+
|
|
2363
|
+
const isSelected = (dateMeta) => {
|
|
2364
|
+
if (props.value) {
|
|
2365
|
+
if (isSingleSelection()) {
|
|
2366
|
+
return isDateEquals(props.value, dateMeta);
|
|
2367
|
+
} else if (isMultipleSelection()) {
|
|
2368
|
+
let selected = false;
|
|
2369
|
+
|
|
2370
|
+
for (let date of props.value) {
|
|
2371
|
+
selected = isDateEquals(date, dateMeta);
|
|
2372
|
+
|
|
2373
|
+
if (selected) {
|
|
2374
|
+
break;
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
return selected;
|
|
2379
|
+
} else if (isRangeSelection()) {
|
|
2380
|
+
if (props.value[1]) {
|
|
2381
|
+
return isDateEquals(props.value[0], dateMeta) || isDateEquals(props.value[1], dateMeta) || isDateBetween(props.value[0], props.value[1], dateMeta);
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
return isDateEquals(props.value[0], dateMeta);
|
|
2385
|
+
}
|
|
2386
|
+
} else {
|
|
2387
|
+
return false;
|
|
2388
|
+
}
|
|
2389
|
+
};
|
|
2390
|
+
|
|
2391
|
+
const isComparable = () => {
|
|
2392
|
+
return props.value != null && typeof props.value !== 'string';
|
|
2393
|
+
};
|
|
2394
|
+
|
|
2395
|
+
const isMonthSelected = (month) => {
|
|
2396
|
+
if (!isComparable()) return false;
|
|
2397
|
+
|
|
2398
|
+
if (isMultipleSelection()) {
|
|
2399
|
+
return props.value.some((v) => v.getMonth() === month && v.getFullYear() === currentYear);
|
|
2400
|
+
} else if (isRangeSelection()) {
|
|
2401
|
+
const [start, end] = props.value;
|
|
2402
|
+
const startYear = start ? start.getFullYear() : null;
|
|
2403
|
+
const endYear = end ? end.getFullYear() : null;
|
|
2404
|
+
const startMonth = start ? start.getMonth() : null;
|
|
2405
|
+
const endMonth = end ? end.getMonth() : null;
|
|
2406
|
+
|
|
2407
|
+
if (!end) {
|
|
2408
|
+
return startYear === currentYear && startMonth === month;
|
|
2409
|
+
} else {
|
|
2410
|
+
const currentDate = new Date(currentYear, month, 1);
|
|
2411
|
+
const startDate = new Date(startYear, startMonth, 1);
|
|
2412
|
+
const endDate = new Date(endYear, endMonth, 1);
|
|
2413
|
+
|
|
2414
|
+
return currentDate >= startDate && currentDate <= endDate;
|
|
2415
|
+
}
|
|
2416
|
+
} else {
|
|
2417
|
+
return props.value.getMonth() === month && props.value.getFullYear() === currentYear;
|
|
2418
|
+
}
|
|
2419
|
+
};
|
|
2420
|
+
|
|
2421
|
+
const isYearSelected = (year) => {
|
|
2422
|
+
if (!isComparable()) return false;
|
|
2423
|
+
|
|
2424
|
+
if (isMultipleSelection()) {
|
|
2425
|
+
return props.value.some((v) => v.getFullYear() === year);
|
|
2426
|
+
} else if (isRangeSelection()) {
|
|
2427
|
+
const start = props.value[0] ? props.value[0].getFullYear() : null;
|
|
2428
|
+
const end = props.value[1] ? props.value[1].getFullYear() : null;
|
|
2429
|
+
|
|
2430
|
+
return start === year || end === year || (start < year && end > year);
|
|
2431
|
+
} else {
|
|
2432
|
+
return props.value.getFullYear() === year;
|
|
2433
|
+
}
|
|
2434
|
+
};
|
|
2435
|
+
|
|
2436
|
+
const switchViewButtonDisabled = () => {
|
|
2437
|
+
return props.numberOfMonths > 1 || props.disabled;
|
|
2438
|
+
};
|
|
2439
|
+
|
|
2440
|
+
const isDateEquals = (value, dateMeta) => {
|
|
2441
|
+
if (value && value instanceof Date) {
|
|
2442
|
+
return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
return false;
|
|
2446
|
+
};
|
|
2447
|
+
|
|
2448
|
+
const isDateBetween = (start, end, dateMeta) => {
|
|
2449
|
+
let between = false;
|
|
2450
|
+
|
|
2451
|
+
if (start && end) {
|
|
2452
|
+
let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
|
|
2453
|
+
|
|
2454
|
+
return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
return between;
|
|
2458
|
+
};
|
|
2459
|
+
|
|
2460
|
+
const isSingleSelection = () => {
|
|
2461
|
+
return props.selectionMode === 'single';
|
|
2462
|
+
};
|
|
2463
|
+
|
|
2464
|
+
const isRangeSelection = () => {
|
|
2465
|
+
return props.selectionMode === 'range';
|
|
2466
|
+
};
|
|
2467
|
+
|
|
2468
|
+
const isMultipleSelection = () => {
|
|
2469
|
+
return props.selectionMode === 'multiple';
|
|
2470
|
+
};
|
|
2471
|
+
|
|
2472
|
+
const isToday = (today, day, month, year) => {
|
|
2473
|
+
return today.getDate() === day && today.getMonth() === month && today.getFullYear() === year;
|
|
2474
|
+
};
|
|
2475
|
+
|
|
2476
|
+
const isDayDisabled = (day, month, year) => {
|
|
2477
|
+
let isDisabled = false;
|
|
2478
|
+
|
|
2479
|
+
// first check for disabled dates
|
|
2480
|
+
if (props.disabledDates) {
|
|
2481
|
+
if (props.disabledDates.some((d) => d.getFullYear() === year && d.getMonth() === month && d.getDate() === day)) {
|
|
2482
|
+
isDisabled = true;
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
// next if not disabled then check for disabled days
|
|
2487
|
+
if (!isDisabled && props.disabledDays && currentView === 'date') {
|
|
2488
|
+
let weekday = new Date(year, month, day);
|
|
2489
|
+
let weekdayNumber = weekday.getDay();
|
|
2490
|
+
|
|
2491
|
+
if (props.disabledDays.indexOf(weekdayNumber) !== -1) {
|
|
2492
|
+
isDisabled = true;
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
// last check for enabled dates to force dates enabled
|
|
2497
|
+
if (props.enabledDates) {
|
|
2498
|
+
const isEnabled = props.enabledDates.some((d) => d.getFullYear() === year && d.getMonth() === month && d.getDate() === day);
|
|
2499
|
+
|
|
2500
|
+
if (isEnabled) {
|
|
2501
|
+
isDisabled = false;
|
|
2502
|
+
} else if (!props.disabledDays && !props.disabledDates) {
|
|
2503
|
+
// disable other dates when only enabledDates are present
|
|
2504
|
+
isDisabled = true;
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
return isDisabled;
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
const isMonthYearDisabled = (month, year) => {
|
|
2512
|
+
const daysCountInAllMonth = month === -1 ? new Array(12).fill(0).map((_, i) => getDaysCountInMonth(i, year)) : [getDaysCountInMonth(month, year)];
|
|
2513
|
+
|
|
2514
|
+
for (let i = 0; i < daysCountInAllMonth.length; i++) {
|
|
2515
|
+
const monthDays = daysCountInAllMonth[i];
|
|
2516
|
+
const _month = month === -1 ? i : month;
|
|
2517
|
+
|
|
2518
|
+
for (let day = 1; day <= monthDays; day++) {
|
|
2519
|
+
let isDateSelectable = isSelectable(day, _month, year);
|
|
2520
|
+
|
|
2521
|
+
if (isDateSelectable) {
|
|
2522
|
+
return false;
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
return true;
|
|
2528
|
+
};
|
|
2529
|
+
|
|
2530
|
+
const updateInputfield = (value) => {
|
|
2531
|
+
if (!inputRef.current) {
|
|
2532
|
+
return;
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
let formattedValue = '';
|
|
2536
|
+
|
|
2537
|
+
if (value) {
|
|
2538
|
+
try {
|
|
2539
|
+
if (isSingleSelection()) {
|
|
2540
|
+
formattedValue = isValidDate(value) ? formatDateTime(value) : props.keepInvalid ? value : '';
|
|
2541
|
+
} else if (isMultipleSelection()) {
|
|
2542
|
+
for (let i = 0; i < value.length; i++) {
|
|
2543
|
+
let selectedValue = value[i];
|
|
2544
|
+
let dateAsString = isValidDate(selectedValue) ? formatDateTime(selectedValue) : '';
|
|
2545
|
+
|
|
2546
|
+
formattedValue = formattedValue + dateAsString;
|
|
2547
|
+
|
|
2548
|
+
if (i !== value.length - 1) {
|
|
2549
|
+
formattedValue = formattedValue + ', ';
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
} else if (isRangeSelection()) {
|
|
2553
|
+
if (value && value.length) {
|
|
2554
|
+
let startDate = value[0];
|
|
2555
|
+
let endDate = value[1];
|
|
2556
|
+
|
|
2557
|
+
formattedValue = isValidDate(startDate) ? formatDateTime(startDate) : '';
|
|
2558
|
+
|
|
2559
|
+
if (endDate) {
|
|
2560
|
+
formattedValue = formattedValue + (isValidDate(endDate) ? ' - ' + formatDateTime(endDate) : '');
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
} catch (err) {
|
|
2565
|
+
formattedValue = value;
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
inputRef.current.value = formattedValue;
|
|
2570
|
+
};
|
|
2571
|
+
|
|
2572
|
+
updateInputfieldRef.current = updateInputfield;
|
|
2573
|
+
|
|
2574
|
+
const formatDateTime = (date) => {
|
|
2575
|
+
if (props.formatDateTime) {
|
|
2576
|
+
return props.formatDateTime(date);
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
let formattedValue = null;
|
|
2580
|
+
|
|
2581
|
+
if (date) {
|
|
2582
|
+
if (props.timeOnly) {
|
|
2583
|
+
formattedValue = formatTime(date);
|
|
2584
|
+
} else {
|
|
2585
|
+
formattedValue = formatDate(date, getDateFormat());
|
|
2586
|
+
|
|
2587
|
+
if (props.showTime) {
|
|
2588
|
+
formattedValue = formattedValue + (' ' + formatTime(date));
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
return formattedValue;
|
|
2594
|
+
};
|
|
2595
|
+
|
|
2596
|
+
const formatDate = (date, format) => {
|
|
2597
|
+
if (!date) {
|
|
2598
|
+
return '';
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
let iFormat;
|
|
2602
|
+
|
|
2603
|
+
const lookAhead = (match) => {
|
|
2604
|
+
const matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
|
|
2605
|
+
|
|
2606
|
+
if (matches) {
|
|
2607
|
+
iFormat++;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
return matches;
|
|
2611
|
+
};
|
|
2612
|
+
|
|
2613
|
+
const formatNumber = (match, value, len) => {
|
|
2614
|
+
let num = '' + value;
|
|
2615
|
+
|
|
2616
|
+
if (lookAhead(match)) {
|
|
2617
|
+
while (num.length < len) {
|
|
2618
|
+
num = '0' + num;
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
return num;
|
|
2623
|
+
};
|
|
2624
|
+
|
|
2625
|
+
const formatName = (match, value, shortNames, longNames) => {
|
|
2626
|
+
return lookAhead(match) ? longNames[value] : shortNames[value];
|
|
2627
|
+
};
|
|
2628
|
+
|
|
2629
|
+
let output = '';
|
|
2630
|
+
let literal = false;
|
|
2631
|
+
const { dayNamesShort, dayNames, monthNamesShort, monthNames } = localeOptions(props.locale);
|
|
2632
|
+
|
|
2633
|
+
if (date) {
|
|
2634
|
+
for (iFormat = 0; iFormat < format.length; iFormat++) {
|
|
2635
|
+
if (literal) {
|
|
2636
|
+
if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
|
|
2637
|
+
literal = false;
|
|
2638
|
+
} else {
|
|
2639
|
+
output = output + format.charAt(iFormat);
|
|
2640
|
+
}
|
|
2641
|
+
} else {
|
|
2642
|
+
switch (format.charAt(iFormat)) {
|
|
2643
|
+
case 'd':
|
|
2644
|
+
output = output + formatNumber('d', date.getDate(), 2);
|
|
2645
|
+
break;
|
|
2646
|
+
case 'D':
|
|
2647
|
+
output = output + formatName('D', date.getDay(), dayNamesShort, dayNames);
|
|
2648
|
+
break;
|
|
2649
|
+
case 'o':
|
|
2650
|
+
output = output + formatNumber('o', Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
|
|
2651
|
+
break;
|
|
2652
|
+
case 'm':
|
|
2653
|
+
output = output + formatNumber('m', date.getMonth() + 1, 2);
|
|
2654
|
+
break;
|
|
2655
|
+
case 'M':
|
|
2656
|
+
output = output + formatName('M', date.getMonth(), monthNamesShort, monthNames);
|
|
2657
|
+
break;
|
|
2658
|
+
case 'y':
|
|
2659
|
+
output = output + (lookAhead('y') ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100));
|
|
2660
|
+
break;
|
|
2661
|
+
case '@':
|
|
2662
|
+
output = output + date.getTime();
|
|
2663
|
+
break;
|
|
2664
|
+
case '!':
|
|
2665
|
+
output = output + (date.getTime() * 10000 + ticksTo1970);
|
|
2666
|
+
break;
|
|
2667
|
+
case "'":
|
|
2668
|
+
if (lookAhead("'")) {
|
|
2669
|
+
output = output + "'";
|
|
2670
|
+
} else {
|
|
2671
|
+
literal = true;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
break;
|
|
2675
|
+
default:
|
|
2676
|
+
output = output + format.charAt(iFormat);
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
return output;
|
|
2683
|
+
};
|
|
2684
|
+
|
|
2685
|
+
const formatTime = (date) => {
|
|
2686
|
+
if (!date) {
|
|
2687
|
+
return '';
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
let output = '';
|
|
2691
|
+
let hours = date.getHours();
|
|
2692
|
+
let minutes = date.getMinutes();
|
|
2693
|
+
let seconds = date.getSeconds();
|
|
2694
|
+
let milliseconds = date.getMilliseconds();
|
|
2695
|
+
|
|
2696
|
+
if (props.hourFormat === '12' && hours > 11 && hours !== 12) {
|
|
2697
|
+
hours = hours - 12;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
if (props.hourFormat === '12') {
|
|
2701
|
+
output = output + (hours === 0 ? 12 : hours < 10 ? '0' + hours : hours);
|
|
2702
|
+
} else {
|
|
2703
|
+
output = output + (hours < 10 ? '0' + hours : hours);
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
output = output + ':';
|
|
2707
|
+
output = output + (minutes < 10 ? '0' + minutes : minutes);
|
|
2708
|
+
|
|
2709
|
+
if (props.showSeconds) {
|
|
2710
|
+
output = output + ':';
|
|
2711
|
+
output = output + (seconds < 10 ? '0' + seconds : seconds);
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
if (props.showMillisec) {
|
|
2715
|
+
output = output + '.';
|
|
2716
|
+
output = output + (milliseconds < 100 ? (milliseconds < 10 ? '00' : '0') + milliseconds : milliseconds);
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
if (props.hourFormat === '12') {
|
|
2720
|
+
output = output + (date.getHours() > 11 ? ' PM' : ' AM');
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
return output;
|
|
2724
|
+
};
|
|
2725
|
+
|
|
2726
|
+
const parseValueFromString = (text) => {
|
|
2727
|
+
if (!text || text.trim().length === 0) {
|
|
2728
|
+
return null;
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
let value;
|
|
2732
|
+
|
|
2733
|
+
if (isSingleSelection()) {
|
|
2734
|
+
value = parseDateTime(text);
|
|
2735
|
+
} else if (isMultipleSelection()) {
|
|
2736
|
+
let tokens = text.split(',');
|
|
2737
|
+
|
|
2738
|
+
value = [];
|
|
2739
|
+
|
|
2740
|
+
for (let token of tokens) {
|
|
2741
|
+
value.push(parseDateTime(token.trim()));
|
|
2742
|
+
}
|
|
2743
|
+
} else if (isRangeSelection()) {
|
|
2744
|
+
let tokens = text.split(' - ');
|
|
2745
|
+
|
|
2746
|
+
value = [];
|
|
2747
|
+
|
|
2748
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
2749
|
+
value[i] = parseDateTime(tokens[i].trim());
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
return value;
|
|
2754
|
+
};
|
|
2755
|
+
|
|
2756
|
+
const parseDateTime = (text) => {
|
|
2757
|
+
if (props.parseDateTime) {
|
|
2758
|
+
return props.parseDateTime(text);
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
let date;
|
|
2762
|
+
|
|
2763
|
+
if (props.timeOnly) {
|
|
2764
|
+
date = new Date();
|
|
2765
|
+
const match = text.match(/(\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,3})?)\s?(AM|PM)?/i);
|
|
2766
|
+
|
|
2767
|
+
if (match) {
|
|
2768
|
+
populateTime(date, match[1], match[2]);
|
|
2769
|
+
} else {
|
|
2770
|
+
return null;
|
|
2771
|
+
}
|
|
2772
|
+
} else if (props.showTime) {
|
|
2773
|
+
const time12 = /(\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,3})?)\s?(AM|PM)/i;
|
|
2774
|
+
const time24 = /(\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,3})?)$/;
|
|
2775
|
+
|
|
2776
|
+
let match, datePart, timePart, ampm;
|
|
2777
|
+
|
|
2778
|
+
if (props.hourFormat === '12' && (match = text.match(time12))) {
|
|
2779
|
+
timePart = match[1];
|
|
2780
|
+
ampm = match[2];
|
|
2781
|
+
datePart = text.replace(time12, '').trim();
|
|
2782
|
+
} else if (props.hourFormat === '24' && (match = text.match(time24))) {
|
|
2783
|
+
timePart = match[1];
|
|
2784
|
+
datePart = text.replace(time24, '').trim();
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
if (datePart && timePart) {
|
|
2788
|
+
date = parseDate(datePart, getDateFormat());
|
|
2789
|
+
populateTime(date, timePart, ampm);
|
|
2790
|
+
} else {
|
|
2791
|
+
date = parseDate(text, getDateFormat());
|
|
2792
|
+
}
|
|
2793
|
+
} else {
|
|
2794
|
+
date = parseDate(text, getDateFormat());
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
return date;
|
|
2798
|
+
};
|
|
2799
|
+
|
|
2800
|
+
const populateTime = (value, timeString, ampm) => {
|
|
2801
|
+
if (props.hourFormat === '12' && ampm !== 'PM' && ampm !== 'AM') {
|
|
2802
|
+
throw new Error('Invalid Time');
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
let time = parseTime(timeString, ampm);
|
|
2806
|
+
|
|
2807
|
+
value.setHours(time.hour);
|
|
2808
|
+
value.setMinutes(time.minute);
|
|
2809
|
+
value.setSeconds(time.second);
|
|
2810
|
+
value.setMilliseconds(time.millisecond);
|
|
2811
|
+
};
|
|
2812
|
+
|
|
2813
|
+
const parseTime = (value, ampm) => {
|
|
2814
|
+
value = props.showMillisec ? value.replace('.', ':') : value;
|
|
2815
|
+
let tokens = value.split(':');
|
|
2816
|
+
let validTokenLength = props.showSeconds ? 3 : 2;
|
|
2817
|
+
|
|
2818
|
+
validTokenLength = props.showMillisec ? validTokenLength + 1 : validTokenLength;
|
|
2819
|
+
|
|
2820
|
+
if (tokens.length !== validTokenLength || tokens[0].length !== 2 || tokens[1].length !== 2 || (props.showSeconds && tokens[2].length !== 2) || (props.showMillisec && tokens[3].length !== 3)) {
|
|
2821
|
+
throw new Error('Invalid time');
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
let h = parseInt(tokens[0], 10);
|
|
2825
|
+
let m = parseInt(tokens[1], 10);
|
|
2826
|
+
let s = props.showSeconds ? parseInt(tokens[2], 10) : null;
|
|
2827
|
+
let ms = props.showMillisec ? parseInt(tokens[3], 10) : null;
|
|
2828
|
+
|
|
2829
|
+
if (isNaN(h) || isNaN(m) || h > 23 || m > 59 || (props.hourFormat === '12' && h > 12) || (props.showSeconds && (isNaN(s) || s > 59)) || (props.showMillisec && (isNaN(s) || s > 1000))) {
|
|
2830
|
+
throw new Error('Invalid time');
|
|
2831
|
+
} else {
|
|
2832
|
+
if (props.hourFormat === '12') {
|
|
2833
|
+
if (h !== 12 && ampm === 'PM') {
|
|
2834
|
+
h = h + 12;
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
if (h === 12 && ampm === 'AM') {
|
|
2838
|
+
h = h - 12;
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
return { hour: h, minute: m, second: s, millisecond: ms };
|
|
2843
|
+
}
|
|
2844
|
+
};
|
|
2845
|
+
|
|
2846
|
+
// Ported from jquery-ui datepicker parseDate
|
|
2847
|
+
const parseDate = (value, format) => {
|
|
2848
|
+
if (format == null || value == null) {
|
|
2849
|
+
throw new Error('Invalid arguments');
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
value = typeof value === 'object' ? value.toString() : value + '';
|
|
2853
|
+
|
|
2854
|
+
if (value === '') {
|
|
2855
|
+
return null;
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
let iFormat;
|
|
2859
|
+
let dim;
|
|
2860
|
+
let extra;
|
|
2861
|
+
let iValue = 0;
|
|
2862
|
+
let shortYearCutoff = typeof props.shortYearCutoff !== 'string' ? props.shortYearCutoff : (new Date().getFullYear() % 100) + parseInt(props.shortYearCutoff, 10);
|
|
2863
|
+
let year = -1;
|
|
2864
|
+
let month = -1;
|
|
2865
|
+
let day = -1;
|
|
2866
|
+
let doy = -1;
|
|
2867
|
+
let literal = false;
|
|
2868
|
+
let date;
|
|
2869
|
+
|
|
2870
|
+
let lookAhead = (match) => {
|
|
2871
|
+
let matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
|
|
2872
|
+
|
|
2873
|
+
if (matches) {
|
|
2874
|
+
iFormat++;
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
return matches;
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
let getNumber = (match) => {
|
|
2881
|
+
let isDoubled = lookAhead(match);
|
|
2882
|
+
let size = match === '@' ? 14 : match === '!' ? 20 : match === 'y' && isDoubled ? 4 : match === 'o' ? 3 : 2;
|
|
2883
|
+
let minSize = match === 'y' ? size : 1;
|
|
2884
|
+
let digits = new RegExp('^\\d{' + minSize + ',' + size + '}');
|
|
2885
|
+
let num = value.substring(iValue).match(digits);
|
|
2886
|
+
|
|
2887
|
+
if (!num) {
|
|
2888
|
+
throw new Error('Missing number at position ' + iValue);
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
iValue = iValue + num[0].length;
|
|
2892
|
+
|
|
2893
|
+
return parseInt(num[0], 10);
|
|
2894
|
+
};
|
|
2895
|
+
|
|
2896
|
+
let getName = (match, shortNames, longNames) => {
|
|
2897
|
+
let index = -1;
|
|
2898
|
+
let arr = lookAhead(match) ? longNames : shortNames;
|
|
2899
|
+
let names = [];
|
|
2900
|
+
|
|
2901
|
+
for (let i = 0; i < arr.length; i++) {
|
|
2902
|
+
names.push([i, arr[i]]);
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
names.sort((a, b) => {
|
|
2906
|
+
return -(a[1].length - b[1].length);
|
|
2907
|
+
});
|
|
2908
|
+
|
|
2909
|
+
for (let i = 0; i < names.length; i++) {
|
|
2910
|
+
let name = names[i][1];
|
|
2911
|
+
|
|
2912
|
+
if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
|
|
2913
|
+
index = names[i][0];
|
|
2914
|
+
iValue = iValue + name.length;
|
|
2915
|
+
break;
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
if (index !== -1) {
|
|
2920
|
+
return index + 1;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
throw new Error('Unknown name at position ' + iValue);
|
|
2924
|
+
};
|
|
2925
|
+
|
|
2926
|
+
let checkLiteral = () => {
|
|
2927
|
+
if (value.charAt(iValue) !== format.charAt(iFormat)) {
|
|
2928
|
+
throw new Error('Unexpected literal at position ' + iValue);
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
iValue++;
|
|
2932
|
+
};
|
|
2933
|
+
|
|
2934
|
+
if (props.view === 'month') {
|
|
2935
|
+
day = 1;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
if (props.view === 'year') {
|
|
2939
|
+
day = 1;
|
|
2940
|
+
month = 1;
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
const { dayNamesShort, dayNames, monthNamesShort, monthNames } = localeOptions(props.locale);
|
|
2944
|
+
|
|
2945
|
+
for (iFormat = 0; iFormat < format.length; iFormat++) {
|
|
2946
|
+
if (literal) {
|
|
2947
|
+
if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
|
|
2948
|
+
literal = false;
|
|
2949
|
+
} else {
|
|
2950
|
+
checkLiteral();
|
|
2951
|
+
}
|
|
2952
|
+
} else {
|
|
2953
|
+
switch (format.charAt(iFormat)) {
|
|
2954
|
+
case 'd':
|
|
2955
|
+
day = getNumber('d');
|
|
2956
|
+
break;
|
|
2957
|
+
case 'D':
|
|
2958
|
+
getName('D', dayNamesShort, dayNames);
|
|
2959
|
+
break;
|
|
2960
|
+
case 'o':
|
|
2961
|
+
doy = getNumber('o');
|
|
2962
|
+
break;
|
|
2963
|
+
case 'm':
|
|
2964
|
+
month = getNumber('m');
|
|
2965
|
+
break;
|
|
2966
|
+
case 'M':
|
|
2967
|
+
month = getName('M', monthNamesShort, monthNames);
|
|
2968
|
+
break;
|
|
2969
|
+
case 'y':
|
|
2970
|
+
year = getNumber('y');
|
|
2971
|
+
break;
|
|
2972
|
+
case '@':
|
|
2973
|
+
date = new Date(getNumber('@'));
|
|
2974
|
+
year = date.getFullYear();
|
|
2975
|
+
month = date.getMonth() + 1;
|
|
2976
|
+
day = date.getDate();
|
|
2977
|
+
break;
|
|
2978
|
+
case '!':
|
|
2979
|
+
date = new Date((getNumber('!') - ticksTo1970) / 10000);
|
|
2980
|
+
year = date.getFullYear();
|
|
2981
|
+
month = date.getMonth() + 1;
|
|
2982
|
+
day = date.getDate();
|
|
2983
|
+
break;
|
|
2984
|
+
case "'":
|
|
2985
|
+
if (lookAhead("'")) {
|
|
2986
|
+
checkLiteral();
|
|
2987
|
+
} else {
|
|
2988
|
+
literal = true;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
break;
|
|
2992
|
+
default:
|
|
2993
|
+
checkLiteral();
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
if (iValue < value.length) {
|
|
2999
|
+
extra = value.substr(iValue);
|
|
3000
|
+
|
|
3001
|
+
if (!/^\s+/.test(extra)) {
|
|
3002
|
+
throw new Error('Extra/unparsed characters found in date: ' + extra);
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
if (year === -1) {
|
|
3007
|
+
year = new Date().getFullYear();
|
|
3008
|
+
} else if (year < 100) {
|
|
3009
|
+
year = year + (new Date().getFullYear() - (new Date().getFullYear() % 100) + (year <= shortYearCutoff ? 0 : -100));
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
if (doy > -1) {
|
|
3013
|
+
month = 1;
|
|
3014
|
+
day = doy;
|
|
3015
|
+
|
|
3016
|
+
do {
|
|
3017
|
+
dim = getDaysCountInMonth(year, month - 1);
|
|
3018
|
+
|
|
3019
|
+
if (day <= dim) {
|
|
3020
|
+
break;
|
|
3021
|
+
}
|
|
3022
|
+
|
|
3023
|
+
month++;
|
|
3024
|
+
day = day - dim;
|
|
3025
|
+
} while (true);
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
date = daylightSavingAdjust(new Date(year, month - 1, day));
|
|
3029
|
+
|
|
3030
|
+
if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
|
|
3031
|
+
throw new Error('Invalid date'); // E.g. 31/02/00
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
return date;
|
|
3035
|
+
};
|
|
3036
|
+
|
|
3037
|
+
const isInMinYear = (viewDate) => {
|
|
3038
|
+
return props.minDate && props.minDate.getFullYear() === viewDate.getFullYear();
|
|
3039
|
+
};
|
|
3040
|
+
|
|
3041
|
+
const isInMaxYear = (viewDate) => {
|
|
3042
|
+
return props.maxDate && props.maxDate.getFullYear() === viewDate.getFullYear();
|
|
3043
|
+
};
|
|
3044
|
+
|
|
3045
|
+
React.useEffect(() => {
|
|
3046
|
+
ObjectUtils.combinedRefs(inputRef, props.inputRef);
|
|
3047
|
+
}, [inputRef, props.inputRef]);
|
|
3048
|
+
|
|
3049
|
+
React.useEffect(() => {
|
|
3050
|
+
if (props.value !== previousValue) {
|
|
3051
|
+
updateInputfieldRef.current && updateInputfieldRef.current(props.value);
|
|
3052
|
+
}
|
|
3053
|
+
}, [props.value, previousValue]);
|
|
3054
|
+
|
|
3055
|
+
useMountEffect(() => {
|
|
3056
|
+
let viewDate = getViewDate(props.viewDate);
|
|
3057
|
+
|
|
3058
|
+
validateDate(viewDate);
|
|
3059
|
+
setViewDateState(viewDate);
|
|
3060
|
+
|
|
3061
|
+
setCurrentMonth(viewDate.getMonth());
|
|
3062
|
+
setCurrentYear(viewDate.getFullYear());
|
|
3063
|
+
setCurrentView(props.view);
|
|
3064
|
+
|
|
3065
|
+
if (!idState) {
|
|
3066
|
+
const uniqueId = UniqueComponentId();
|
|
3067
|
+
|
|
3068
|
+
!idState && setIdState(uniqueId);
|
|
3069
|
+
}
|
|
3070
|
+
|
|
3071
|
+
if (props.inline) {
|
|
3072
|
+
overlayRef && overlayRef.current.setAttribute(attributeSelector, '');
|
|
3073
|
+
|
|
3074
|
+
if (!props.disabled) {
|
|
3075
|
+
initFocusableCell();
|
|
3076
|
+
|
|
3077
|
+
if (props.numberOfMonths === 1) {
|
|
3078
|
+
overlayRef.current.style.width = DomHandler.getOuterWidth(overlayRef.current) + 'px';
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
} else {
|
|
3082
|
+
// @todo
|
|
3083
|
+
//alignOverlay();
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3086
|
+
if (props.value) {
|
|
3087
|
+
updateInputfield(props.value);
|
|
3088
|
+
setValue(props.value);
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
if (props.autoFocus) {
|
|
3092
|
+
// delay showing until rendered so `alignPanel()` method aligns the popup in the right location
|
|
3093
|
+
setTimeout(() => DomHandler.focus(inputRef.current, props.autoFocus), 200);
|
|
3094
|
+
}
|
|
3095
|
+
});
|
|
3096
|
+
|
|
3097
|
+
React.useEffect(() => {
|
|
3098
|
+
// see https://github.com/primefaces/primereact/issues/4030
|
|
3099
|
+
onChangeRef.current = props.onChange;
|
|
3100
|
+
}, [props.onChange]);
|
|
3101
|
+
|
|
3102
|
+
React.useEffect(() => {
|
|
3103
|
+
let unbindMaskEvents = null;
|
|
3104
|
+
|
|
3105
|
+
if (props.mask) {
|
|
3106
|
+
unbindMaskEvents = mask(inputRef.current, {
|
|
3107
|
+
mask: props.mask,
|
|
3108
|
+
slotChar: props.maskSlotChar,
|
|
3109
|
+
readOnly: props.readOnlyInput || props.disabled,
|
|
3110
|
+
onChange: (e) => {
|
|
3111
|
+
updateValueOnInput(e.originalEvent, e.value, () => {
|
|
3112
|
+
return false;
|
|
3113
|
+
});
|
|
3114
|
+
},
|
|
3115
|
+
onBlur: (e) => {
|
|
3116
|
+
updateValueOnInput(e, e.target.value);
|
|
3117
|
+
}
|
|
3118
|
+
}).unbindEvents;
|
|
3119
|
+
}
|
|
3120
|
+
|
|
3121
|
+
return () => {
|
|
3122
|
+
props.mask && unbindMaskEvents && unbindMaskEvents();
|
|
3123
|
+
};
|
|
3124
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3125
|
+
}, [props.disabled, props.mask, props.readOnlyInput]);
|
|
3126
|
+
|
|
3127
|
+
useUpdateEffect(() => {
|
|
3128
|
+
if (viewChangedWithKeyDown.current) {
|
|
3129
|
+
setCurrentView(props.view);
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
viewChangedWithKeyDown.current = false;
|
|
3133
|
+
}, [props.view]);
|
|
3134
|
+
|
|
3135
|
+
useUpdateEffect(() => {
|
|
3136
|
+
if (visible && !props.inline) {
|
|
3137
|
+
focusToFirstCell();
|
|
3138
|
+
}
|
|
3139
|
+
}, [visible, currentView, props.inline]);
|
|
3140
|
+
|
|
3141
|
+
useUpdateEffect(() => {
|
|
3142
|
+
if (!props.onViewDateChange && !viewStateChanged.current) {
|
|
3143
|
+
setValue(props.value);
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
if (props.viewDate) {
|
|
3147
|
+
const date = getViewDate(props.viewDate);
|
|
3148
|
+
|
|
3149
|
+
updateViewDate(null, date);
|
|
3150
|
+
onViewDateSelect({ event: null, date });
|
|
3151
|
+
}
|
|
3152
|
+
}, [props.onViewDateChange, props.value, props.viewDate]);
|
|
3153
|
+
|
|
3154
|
+
useUpdateEffect(() => {
|
|
3155
|
+
if (overlayVisibleState || props.visible) {
|
|
3156
|
+
// Github #5529
|
|
3157
|
+
setTimeout(() => {
|
|
3158
|
+
alignOverlay();
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3161
|
+
}, [currentView, overlayVisibleState, props.visible]);
|
|
3162
|
+
|
|
3163
|
+
useUpdateEffect(() => {
|
|
3164
|
+
const newDate = props.value;
|
|
3165
|
+
|
|
3166
|
+
if (previousValue !== newDate) {
|
|
3167
|
+
const isInputFocused = document.activeElement === inputRef.current;
|
|
3168
|
+
|
|
3169
|
+
// Do not update value in input if user types something in it:
|
|
3170
|
+
if (!isInputFocused) {
|
|
3171
|
+
updateInputfield(newDate);
|
|
3172
|
+
}
|
|
3173
|
+
|
|
3174
|
+
// #3516 view date not updated when value set programatically
|
|
3175
|
+
if (!newDate) return;
|
|
3176
|
+
|
|
3177
|
+
let viewDate = newDate;
|
|
3178
|
+
|
|
3179
|
+
if (isMultipleSelection()) {
|
|
3180
|
+
if (newDate.length) {
|
|
3181
|
+
viewDate = newDate[newDate.length - 1];
|
|
3182
|
+
}
|
|
3183
|
+
} else if (isRangeSelection()) {
|
|
3184
|
+
if (newDate.length) {
|
|
3185
|
+
let startDate = newDate[0];
|
|
3186
|
+
let endDate = newDate[1];
|
|
3187
|
+
|
|
3188
|
+
viewDate = endDate || startDate;
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
if (viewDate instanceof Date) {
|
|
3193
|
+
validateDate(viewDate);
|
|
3194
|
+
setViewDateState(viewDate);
|
|
3195
|
+
setCurrentMonth(viewDate.getMonth());
|
|
3196
|
+
setCurrentYear(viewDate.getFullYear());
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
}, [props.value, visible]);
|
|
3200
|
+
|
|
3201
|
+
useUpdateEffect(() => {
|
|
3202
|
+
updateInputfield(props.value);
|
|
3203
|
+
}, [props.dateFormat, props.hourFormat, props.timeOnly, props.showSeconds, props.showMillisec, props.showTime, props.locale]);
|
|
3204
|
+
|
|
3205
|
+
useUpdateEffect(() => {
|
|
3206
|
+
if (overlayRef.current) {
|
|
3207
|
+
setNavigationState(viewDateState);
|
|
3208
|
+
updateFocus();
|
|
3209
|
+
}
|
|
3210
|
+
});
|
|
3211
|
+
|
|
3212
|
+
useUnmountEffect(() => {
|
|
3213
|
+
if (touchUIMask.current) {
|
|
3214
|
+
disableModality();
|
|
3215
|
+
touchUIMask.current = null;
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
ZIndexUtils.clear(overlayRef.current);
|
|
3219
|
+
});
|
|
3220
|
+
|
|
3221
|
+
React.useImperativeHandle(ref, () => ({
|
|
3222
|
+
props,
|
|
3223
|
+
show,
|
|
3224
|
+
hide,
|
|
3225
|
+
getCurrentDateTime,
|
|
3226
|
+
getViewDate,
|
|
3227
|
+
updateViewDate,
|
|
3228
|
+
focus: () => DomHandler.focus(inputRef.current),
|
|
3229
|
+
getElement: () => elementRef.current,
|
|
3230
|
+
getOverlay: () => overlayRef.current,
|
|
3231
|
+
getInput: () => inputRef.current
|
|
3232
|
+
}));
|
|
3233
|
+
|
|
3234
|
+
const setValue = (propValue) => {
|
|
3235
|
+
if (Array.isArray(propValue)) {
|
|
3236
|
+
propValue = propValue[0];
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
let prevPropValue = previousValue;
|
|
3240
|
+
|
|
3241
|
+
if (Array.isArray(prevPropValue)) {
|
|
3242
|
+
prevPropValue = prevPropValue[0];
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
let viewDate = props.viewDate && isValidDate(props.viewDate) ? props.viewDate : propValue && isValidDate(propValue) ? propValue : new Date();
|
|
3246
|
+
|
|
3247
|
+
if (isClearClicked.current && props.showTime) {
|
|
3248
|
+
viewDate.setHours(0, 0, 0);
|
|
3249
|
+
|
|
3250
|
+
isClearClicked.current = false;
|
|
3251
|
+
}
|
|
3252
|
+
|
|
3253
|
+
if ((!prevPropValue && propValue) || (propValue && propValue instanceof Date && prevPropValue instanceof Date && propValue.getTime() !== prevPropValue.getTime())) {
|
|
3254
|
+
validateDate(viewDate);
|
|
3255
|
+
}
|
|
3256
|
+
|
|
3257
|
+
setViewDateState(viewDate);
|
|
3258
|
+
viewStateChanged.current = true;
|
|
3259
|
+
};
|
|
3260
|
+
|
|
3261
|
+
const createBackwardNavigator = (isVisible) => {
|
|
3262
|
+
const navigatorProps = isVisible
|
|
3263
|
+
? {
|
|
3264
|
+
onClick: onPrevButtonClick,
|
|
3265
|
+
onKeyDown: (e) => onContainerButtonKeydown(e, trapFocus)
|
|
3266
|
+
}
|
|
3267
|
+
: { style: { visibility: 'hidden' } };
|
|
3268
|
+
const previousIconProps = mergeProps(
|
|
3269
|
+
{
|
|
3270
|
+
className: cx('previousIcon')
|
|
3271
|
+
},
|
|
3272
|
+
ptm('previousIcon')
|
|
3273
|
+
);
|
|
3274
|
+
const icon = props.prevIcon || <ChevronLeftIcon {...previousIconProps} />;
|
|
3275
|
+
const backwardNavigatorIcon = IconUtils.getJSXIcon(icon, { ...previousIconProps }, { props });
|
|
3276
|
+
const { prevDecade, prevYear, prevMonth } = localeOptions(props.locale);
|
|
3277
|
+
const previousButtonLabel = currentView === 'year' ? prevDecade : currentView === 'month' ? prevYear : prevMonth;
|
|
3278
|
+
const previousButtonProps = mergeProps(
|
|
3279
|
+
{
|
|
3280
|
+
type: 'button',
|
|
3281
|
+
className: cx('previousButton'),
|
|
3282
|
+
'aria-label': previousButtonLabel,
|
|
3283
|
+
...navigatorProps
|
|
3284
|
+
},
|
|
3285
|
+
ptm('previousButton')
|
|
3286
|
+
);
|
|
3287
|
+
|
|
3288
|
+
return (
|
|
3289
|
+
<button ref={previousButton} {...previousButtonProps}>
|
|
3290
|
+
{backwardNavigatorIcon}
|
|
3291
|
+
<Ripple />
|
|
3292
|
+
</button>
|
|
3293
|
+
);
|
|
3294
|
+
};
|
|
3295
|
+
|
|
3296
|
+
const createForwardNavigator = (isVisible) => {
|
|
3297
|
+
const navigatorProps = isVisible
|
|
3298
|
+
? {
|
|
3299
|
+
onClick: onNextButtonClick,
|
|
3300
|
+
onKeyDown: (e) => onContainerButtonKeydown(e)
|
|
3301
|
+
}
|
|
3302
|
+
: { style: { visibility: 'hidden' } };
|
|
3303
|
+
const nextIconProps = mergeProps(
|
|
3304
|
+
{
|
|
3305
|
+
className: cx('nextIcon')
|
|
3306
|
+
},
|
|
3307
|
+
ptm('nextIcon')
|
|
3308
|
+
);
|
|
3309
|
+
const icon = props.nextIcon || <ChevronRightIcon {...nextIconProps} />;
|
|
3310
|
+
const forwardNavigatorIcon = IconUtils.getJSXIcon(icon, { ...nextIconProps }, { props });
|
|
3311
|
+
const { nextDecade, nextYear, nextMonth } = localeOptions(props.locale);
|
|
3312
|
+
const nextButtonLabel = currentView === 'year' ? nextDecade : currentView === 'month' ? nextYear : nextMonth;
|
|
3313
|
+
const nextButtonProps = mergeProps(
|
|
3314
|
+
{
|
|
3315
|
+
type: 'button',
|
|
3316
|
+
className: cx('nextButton'),
|
|
3317
|
+
'aria-label': nextButtonLabel,
|
|
3318
|
+
...navigatorProps
|
|
3319
|
+
},
|
|
3320
|
+
ptm('nextButton')
|
|
3321
|
+
);
|
|
3322
|
+
|
|
3323
|
+
return (
|
|
3324
|
+
<button ref={nextButton} {...nextButtonProps}>
|
|
3325
|
+
{forwardNavigatorIcon}
|
|
3326
|
+
<Ripple />
|
|
3327
|
+
</button>
|
|
3328
|
+
);
|
|
3329
|
+
};
|
|
3330
|
+
|
|
3331
|
+
const renderMonthsNavigator = (index) => {
|
|
3332
|
+
return props.monthNavigator && props.view !== 'month' && (props.numberOfMonths === 1 || index === 0);
|
|
3333
|
+
};
|
|
3334
|
+
|
|
3335
|
+
const createTitleMonthElement = (month, monthIndex) => {
|
|
3336
|
+
const monthNames = localeOption('monthNames', props.locale);
|
|
3337
|
+
|
|
3338
|
+
if (renderMonthsNavigator(monthIndex)) {
|
|
3339
|
+
const viewDate = getViewDate();
|
|
3340
|
+
const viewMonth = viewDate.getMonth();
|
|
3341
|
+
const displayedMonthOptions = monthNames
|
|
3342
|
+
.map((month, index) =>
|
|
3343
|
+
(!isInMinYear(viewDate) || index >= props.minDate.getMonth()) && (!isInMaxYear(viewDate) || index <= props.maxDate.getMonth())
|
|
3344
|
+
? {
|
|
3345
|
+
label: month,
|
|
3346
|
+
value: index,
|
|
3347
|
+
index
|
|
3348
|
+
}
|
|
3349
|
+
: null
|
|
3350
|
+
)
|
|
3351
|
+
.filter((option) => !!option);
|
|
3352
|
+
const displayedMonthNames = displayedMonthOptions.map((option) => option.label);
|
|
3353
|
+
const selectProps = mergeProps(
|
|
3354
|
+
{
|
|
3355
|
+
className: cx('select'),
|
|
3356
|
+
onChange: (e) => onMonthDropdownChange(e, e.target.value),
|
|
3357
|
+
value: viewMonth
|
|
3358
|
+
},
|
|
3359
|
+
ptm('select')
|
|
3360
|
+
);
|
|
3361
|
+
const content = (
|
|
3362
|
+
<select {...selectProps}>
|
|
3363
|
+
{displayedMonthOptions.map((option) => {
|
|
3364
|
+
const optionProps = mergeProps(
|
|
3365
|
+
{
|
|
3366
|
+
value: option.value
|
|
3367
|
+
},
|
|
3368
|
+
ptm('option')
|
|
3369
|
+
);
|
|
3370
|
+
|
|
3371
|
+
return (
|
|
3372
|
+
<option {...optionProps} key={option.label}>
|
|
3373
|
+
{option.label}
|
|
3374
|
+
</option>
|
|
3375
|
+
);
|
|
3376
|
+
})}
|
|
3377
|
+
</select>
|
|
3378
|
+
);
|
|
3379
|
+
|
|
3380
|
+
if (props.monthNavigatorTemplate) {
|
|
3381
|
+
const defaultContentOptions = {
|
|
3382
|
+
onChange: onMonthDropdownChange,
|
|
3383
|
+
className: 'p-datepicker-month',
|
|
3384
|
+
value: viewMonth,
|
|
3385
|
+
names: displayedMonthNames,
|
|
3386
|
+
options: displayedMonthOptions,
|
|
3387
|
+
element: content,
|
|
3388
|
+
props
|
|
3389
|
+
};
|
|
3390
|
+
|
|
3391
|
+
return ObjectUtils.getJSXElement(props.monthNavigatorTemplate, defaultContentOptions);
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
return content;
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3397
|
+
const monthTitleProps = mergeProps(
|
|
3398
|
+
{
|
|
3399
|
+
className: cx('monthTitle'),
|
|
3400
|
+
onKeyDown: onContainerButtonKeydown,
|
|
3401
|
+
'aria-label': localeOption('chooseMonth', props.locale),
|
|
3402
|
+
onClick: switchToMonthView,
|
|
3403
|
+
disabled: switchViewButtonDisabled()
|
|
3404
|
+
},
|
|
3405
|
+
ptm('monthTitle')
|
|
3406
|
+
);
|
|
3407
|
+
|
|
3408
|
+
return currentView === 'date' && <button {...monthTitleProps}>{monthNames[month]}</button>;
|
|
3409
|
+
};
|
|
3410
|
+
|
|
3411
|
+
const createTitleYearElement = (metaYear) => {
|
|
3412
|
+
const viewDate = getViewDate();
|
|
3413
|
+
const viewYear = viewDate.getFullYear();
|
|
3414
|
+
const displayYear = props.numberOfMonths > 1 || props.yearNavigator ? metaYear : currentYear;
|
|
3415
|
+
|
|
3416
|
+
if (props.yearNavigator) {
|
|
3417
|
+
let yearOptions = [];
|
|
3418
|
+
|
|
3419
|
+
if (props.yearRange) {
|
|
3420
|
+
const years = props.yearRange.split(':');
|
|
3421
|
+
const yearStart = parseInt(years[0], 10);
|
|
3422
|
+
const yearEnd = parseInt(years[1], 10);
|
|
3423
|
+
|
|
3424
|
+
for (let i = yearStart; i <= yearEnd; i++) {
|
|
3425
|
+
yearOptions.push(i);
|
|
3426
|
+
}
|
|
3427
|
+
} else {
|
|
3428
|
+
const base = viewYear - (viewYear % 10);
|
|
3429
|
+
|
|
3430
|
+
for (let i = 0; i < 10; i++) {
|
|
3431
|
+
yearOptions.push(base + i);
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
const displayedYearNames = yearOptions.filter((year) => !(props.minDate && props.minDate.getFullYear() > year) && !(props.maxDate && props.maxDate.getFullYear() < year));
|
|
3436
|
+
const selectProps = mergeProps(
|
|
3437
|
+
{
|
|
3438
|
+
className: cx('select'),
|
|
3439
|
+
onChange: (e) => onYearDropdownChange(e, e.target.value),
|
|
3440
|
+
value: displayYear
|
|
3441
|
+
},
|
|
3442
|
+
ptm('select')
|
|
3443
|
+
);
|
|
3444
|
+
|
|
3445
|
+
const content = (
|
|
3446
|
+
<select {...selectProps}>
|
|
3447
|
+
{displayedYearNames.map((year) => {
|
|
3448
|
+
const optionProps = mergeProps(
|
|
3449
|
+
{
|
|
3450
|
+
value: year
|
|
3451
|
+
},
|
|
3452
|
+
ptm('option')
|
|
3453
|
+
);
|
|
3454
|
+
|
|
3455
|
+
return (
|
|
3456
|
+
<option {...optionProps} key={year}>
|
|
3457
|
+
{year}
|
|
3458
|
+
</option>
|
|
3459
|
+
);
|
|
3460
|
+
})}
|
|
3461
|
+
</select>
|
|
3462
|
+
);
|
|
3463
|
+
|
|
3464
|
+
if (props.yearNavigatorTemplate) {
|
|
3465
|
+
const options = displayedYearNames.map((name, i) => ({ label: name, value: name, index: i }));
|
|
3466
|
+
const defaultContentOptions = {
|
|
3467
|
+
onChange: onYearDropdownChange,
|
|
3468
|
+
className: 'p-datepicker-year',
|
|
3469
|
+
value: viewYear,
|
|
3470
|
+
names: displayedYearNames,
|
|
3471
|
+
options,
|
|
3472
|
+
element: content,
|
|
3473
|
+
props
|
|
3474
|
+
};
|
|
3475
|
+
|
|
3476
|
+
return ObjectUtils.getJSXElement(props.yearNavigatorTemplate, defaultContentOptions);
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
return content;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
const yearTitleProps = mergeProps(
|
|
3483
|
+
{
|
|
3484
|
+
className: cx('yearTitle'),
|
|
3485
|
+
'aria-label': localeOption('chooseYear', props.locale),
|
|
3486
|
+
onClick: (e) => switchToYearView(e),
|
|
3487
|
+
disabled: switchViewButtonDisabled()
|
|
3488
|
+
},
|
|
3489
|
+
ptm('yearTitle')
|
|
3490
|
+
);
|
|
3491
|
+
|
|
3492
|
+
return currentView !== 'year' && <button {...yearTitleProps}>{displayYear}</button>;
|
|
3493
|
+
};
|
|
3494
|
+
|
|
3495
|
+
const createTitleDecadeElement = () => {
|
|
3496
|
+
const years = yearPickerValues();
|
|
3497
|
+
const decadeTitleProps = mergeProps(
|
|
3498
|
+
{
|
|
3499
|
+
className: cx('decadeTitle')
|
|
3500
|
+
},
|
|
3501
|
+
ptm('decadeTitle')
|
|
3502
|
+
);
|
|
3503
|
+
|
|
3504
|
+
if (currentView === 'year') {
|
|
3505
|
+
const decadeTitleTextProps = mergeProps(ptm('decadeTitleText'));
|
|
3506
|
+
|
|
3507
|
+
return <span {...decadeTitleProps}>{props.decadeTemplate ? props.decadeTemplate(years) : <span {...decadeTitleTextProps}>{`${yearPickerValues()[0]} - ${yearPickerValues()[yearPickerValues().length - 1]}`}</span>}</span>;
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3510
|
+
return null;
|
|
3511
|
+
};
|
|
3512
|
+
|
|
3513
|
+
const createTitle = (monthMetaData, index) => {
|
|
3514
|
+
const month = createTitleMonthElement(monthMetaData.month, index);
|
|
3515
|
+
const year = createTitleYearElement(monthMetaData.year);
|
|
3516
|
+
const decade = createTitleDecadeElement();
|
|
3517
|
+
const titleProps = mergeProps(
|
|
3518
|
+
{
|
|
3519
|
+
className: cx('title')
|
|
3520
|
+
},
|
|
3521
|
+
ptm('title')
|
|
3522
|
+
);
|
|
3523
|
+
const showMonthAfterYear = localeOption('showMonthAfterYear', props.locale);
|
|
3524
|
+
|
|
3525
|
+
return (
|
|
3526
|
+
<div {...titleProps}>
|
|
3527
|
+
{showMonthAfterYear ? year : month}
|
|
3528
|
+
{showMonthAfterYear ? month : year}
|
|
3529
|
+
{decade}
|
|
3530
|
+
</div>
|
|
3531
|
+
);
|
|
3532
|
+
};
|
|
3533
|
+
|
|
3534
|
+
const createDayNames = (weekDays) => {
|
|
3535
|
+
const weekDayProps = mergeProps(ptm('weekDay'));
|
|
3536
|
+
const tableHeaderCellProps = mergeProps(
|
|
3537
|
+
{
|
|
3538
|
+
scope: 'col'
|
|
3539
|
+
},
|
|
3540
|
+
ptm('tableHeaderCell')
|
|
3541
|
+
);
|
|
3542
|
+
const dayNames = weekDays.map((weekDay, index) => (
|
|
3543
|
+
<th {...tableHeaderCellProps} key={`${weekDay}-${index}`}>
|
|
3544
|
+
<span {...weekDayProps}>{weekDay}</span>
|
|
3545
|
+
</th>
|
|
3546
|
+
));
|
|
3547
|
+
|
|
3548
|
+
if (props.showWeek) {
|
|
3549
|
+
const weekHeaderProps = mergeProps(
|
|
3550
|
+
{
|
|
3551
|
+
scope: 'col',
|
|
3552
|
+
className: cx('weekHeader'),
|
|
3553
|
+
'data-p-disabled': props.showWeek
|
|
3554
|
+
},
|
|
3555
|
+
ptm('weekHeader', {
|
|
3556
|
+
context: {
|
|
3557
|
+
disabled: props.showWeek
|
|
3558
|
+
}
|
|
3559
|
+
})
|
|
3560
|
+
);
|
|
3561
|
+
|
|
3562
|
+
const weekLabel = mergeProps(ptm('weekLabel'));
|
|
3563
|
+
|
|
3564
|
+
const weekHeader = (
|
|
3565
|
+
<th {...weekHeaderProps} key="wn">
|
|
3566
|
+
<span {...weekLabel}>{localeOption('weekHeader', props.locale)}</span>
|
|
3567
|
+
</th>
|
|
3568
|
+
);
|
|
3569
|
+
|
|
3570
|
+
return [weekHeader, ...dayNames];
|
|
3571
|
+
}
|
|
3572
|
+
|
|
3573
|
+
return dayNames;
|
|
3574
|
+
};
|
|
3575
|
+
|
|
3576
|
+
const createDateCellContent = (date, className, groupIndex) => {
|
|
3577
|
+
const content = props.dateTemplate ? props.dateTemplate(date) : date.day;
|
|
3578
|
+
|
|
3579
|
+
const selected = isSelected(date);
|
|
3580
|
+
|
|
3581
|
+
const dayLabelProps = mergeProps(
|
|
3582
|
+
{
|
|
3583
|
+
className: cx('dayLabel', { className }),
|
|
3584
|
+
'aria-selected': selected,
|
|
3585
|
+
'aria-disabled': !date.selectable,
|
|
3586
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
3587
|
+
onClick: (e) => onDateSelect(e, date),
|
|
3588
|
+
onKeyDown: (e) => onDateCellKeydown(e, date, groupIndex),
|
|
3589
|
+
'data-p-highlight': selected,
|
|
3590
|
+
'data-p-disabled': !date.selectable
|
|
3591
|
+
},
|
|
3592
|
+
ptm('dayLabel', {
|
|
3593
|
+
context: {
|
|
3594
|
+
selected: selected,
|
|
3595
|
+
disabled: !date.selectable
|
|
3596
|
+
}
|
|
3597
|
+
})
|
|
3598
|
+
);
|
|
3599
|
+
|
|
3600
|
+
return (
|
|
3601
|
+
<span {...dayLabelProps}>
|
|
3602
|
+
{content}
|
|
3603
|
+
{selected && <div aria-live="polite" className="p-hidden-accessible" data-p-hidden-accessible={true} pt={ptm('hiddenSelectedDay')} />}
|
|
3604
|
+
</span>
|
|
3605
|
+
);
|
|
3606
|
+
};
|
|
3607
|
+
|
|
3608
|
+
const createWeek = (weekDates, weekNumber, groupIndex) => {
|
|
3609
|
+
const week = weekDates.map((date) => {
|
|
3610
|
+
const selected = isSelected(date);
|
|
3611
|
+
const dateClassName = classNames({ 'p-highlight': selected, 'p-disabled': !date.selectable });
|
|
3612
|
+
const content = date.otherMonth && !props.showOtherMonths ? null : createDateCellContent(date, dateClassName, groupIndex);
|
|
3613
|
+
const formattedValue = formatDate(new Date(date.year, date.month, date.day), getDateFormat());
|
|
3614
|
+
|
|
3615
|
+
const dayProps = mergeProps(
|
|
3616
|
+
{
|
|
3617
|
+
className: cx('day', { date }),
|
|
3618
|
+
'aria-label': formattedValue,
|
|
3619
|
+
'data-p-today': date.today,
|
|
3620
|
+
'data-p-other-month': date.otherMonth,
|
|
3621
|
+
'data-p-day': date.day,
|
|
3622
|
+
'data-p-month': date.month,
|
|
3623
|
+
'data-p-year': date.year
|
|
3624
|
+
},
|
|
3625
|
+
ptm('day', {
|
|
3626
|
+
context: {
|
|
3627
|
+
date,
|
|
3628
|
+
today: date.today,
|
|
3629
|
+
otherMonth: date.otherMonth
|
|
3630
|
+
}
|
|
3631
|
+
})
|
|
3632
|
+
);
|
|
3633
|
+
|
|
3634
|
+
return (
|
|
3635
|
+
<td {...dayProps} key={date.day}>
|
|
3636
|
+
{content}
|
|
3637
|
+
</td>
|
|
3638
|
+
);
|
|
3639
|
+
});
|
|
3640
|
+
|
|
3641
|
+
if (props.showWeek) {
|
|
3642
|
+
const weekNumberProps = mergeProps(
|
|
3643
|
+
{
|
|
3644
|
+
className: cx('weekNumber')
|
|
3645
|
+
},
|
|
3646
|
+
ptm('weekNumber')
|
|
3647
|
+
);
|
|
3648
|
+
|
|
3649
|
+
const weekLabelContainerProps = mergeProps(
|
|
3650
|
+
{
|
|
3651
|
+
className: cx('weekLabelContainer'),
|
|
3652
|
+
'data-p-disabled': props.showWeek
|
|
3653
|
+
},
|
|
3654
|
+
ptm('weekLabelContainer', {
|
|
3655
|
+
context: {
|
|
3656
|
+
disabled: props.showWeek
|
|
3657
|
+
}
|
|
3658
|
+
})
|
|
3659
|
+
);
|
|
3660
|
+
|
|
3661
|
+
const weekNumberCell = (
|
|
3662
|
+
<td {...weekNumberProps} key={'wn' + weekNumber}>
|
|
3663
|
+
<span {...weekLabelContainerProps}>{weekNumber}</span>
|
|
3664
|
+
</td>
|
|
3665
|
+
);
|
|
3666
|
+
|
|
3667
|
+
return [weekNumberCell, ...week];
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
return week;
|
|
3671
|
+
};
|
|
3672
|
+
|
|
3673
|
+
const createDates = (monthMetaData, groupIndex) => {
|
|
3674
|
+
const tableBodyRowProps = mergeProps(ptm('tableBodyRowProps'));
|
|
3675
|
+
|
|
3676
|
+
return monthMetaData.dates.map((weekDates, index) => (
|
|
3677
|
+
<tr {...tableBodyRowProps} key={index}>
|
|
3678
|
+
{createWeek(weekDates, monthMetaData.weekNumbers[index], groupIndex)}
|
|
3679
|
+
</tr>
|
|
3680
|
+
));
|
|
3681
|
+
};
|
|
3682
|
+
|
|
3683
|
+
const createDateViewGrid = (monthMetaData, weekDays, groupIndex) => {
|
|
3684
|
+
const dayNames = createDayNames(weekDays);
|
|
3685
|
+
const dates = createDates(monthMetaData, groupIndex);
|
|
3686
|
+
const containerProps = mergeProps(
|
|
3687
|
+
{
|
|
3688
|
+
className: cx('container')
|
|
3689
|
+
},
|
|
3690
|
+
ptm('container')
|
|
3691
|
+
);
|
|
3692
|
+
const tableProps = mergeProps(
|
|
3693
|
+
{
|
|
3694
|
+
role: 'grid',
|
|
3695
|
+
className: cx('table')
|
|
3696
|
+
},
|
|
3697
|
+
ptm('table')
|
|
3698
|
+
);
|
|
3699
|
+
const tableHeaderProps = mergeProps(ptm('tableHeader'));
|
|
3700
|
+
const tableHeaderRowProps = mergeProps(ptm('tableHeaderRow'));
|
|
3701
|
+
const tableBodyProps = mergeProps(ptm('tableBody'));
|
|
3702
|
+
|
|
3703
|
+
return (
|
|
3704
|
+
currentView === 'date' && (
|
|
3705
|
+
<div {...containerProps} key={UniqueComponentId('calendar_container_')}>
|
|
3706
|
+
<table {...tableProps}>
|
|
3707
|
+
<thead {...tableHeaderProps}>
|
|
3708
|
+
<tr {...tableHeaderRowProps}>{dayNames}</tr>
|
|
3709
|
+
</thead>
|
|
3710
|
+
<tbody {...tableBodyProps}>{dates}</tbody>
|
|
3711
|
+
</table>
|
|
3712
|
+
</div>
|
|
3713
|
+
)
|
|
3714
|
+
);
|
|
3715
|
+
};
|
|
3716
|
+
|
|
3717
|
+
const createMonth = (monthMetaData, index) => {
|
|
3718
|
+
const weekDays = createWeekDaysMeta();
|
|
3719
|
+
const backwardNavigator = createBackwardNavigator(index === 0);
|
|
3720
|
+
const forwardNavigator = createForwardNavigator(props.numberOfMonths === 1 || index === props.numberOfMonths - 1);
|
|
3721
|
+
const title = createTitle(monthMetaData, index);
|
|
3722
|
+
|
|
3723
|
+
const dateViewGrid = createDateViewGrid(monthMetaData, weekDays, index);
|
|
3724
|
+
const header = props.headerTemplate ? props.headerTemplate() : null;
|
|
3725
|
+
const monthKey = monthMetaData.month + '-' + monthMetaData.year;
|
|
3726
|
+
const groupProps = mergeProps(
|
|
3727
|
+
{
|
|
3728
|
+
className: cx('group')
|
|
3729
|
+
},
|
|
3730
|
+
ptm('group')
|
|
3731
|
+
);
|
|
3732
|
+
|
|
3733
|
+
const headerProps = mergeProps(
|
|
3734
|
+
{
|
|
3735
|
+
className: cx('header')
|
|
3736
|
+
},
|
|
3737
|
+
ptm('header')
|
|
3738
|
+
);
|
|
3739
|
+
|
|
3740
|
+
return (
|
|
3741
|
+
<div {...groupProps} key={monthKey}>
|
|
3742
|
+
<div {...headerProps} key={index}>
|
|
3743
|
+
{header}
|
|
3744
|
+
{backwardNavigator}
|
|
3745
|
+
{title}
|
|
3746
|
+
{forwardNavigator}
|
|
3747
|
+
</div>
|
|
3748
|
+
{dateViewGrid}
|
|
3749
|
+
</div>
|
|
3750
|
+
);
|
|
3751
|
+
};
|
|
3752
|
+
|
|
3753
|
+
const createMonths = (monthsMetaData) => {
|
|
3754
|
+
const groups = monthsMetaData.map(createMonth);
|
|
3755
|
+
|
|
3756
|
+
const groupContainerProps = mergeProps(
|
|
3757
|
+
{
|
|
3758
|
+
className: cx('groupContainer')
|
|
3759
|
+
},
|
|
3760
|
+
ptm('groupContainer')
|
|
3761
|
+
);
|
|
3762
|
+
|
|
3763
|
+
return <div {...groupContainerProps}>{groups}</div>;
|
|
3764
|
+
};
|
|
3765
|
+
|
|
3766
|
+
const createDateView = () => {
|
|
3767
|
+
const viewDate = getViewDate();
|
|
3768
|
+
const monthsMetaData = createMonthsMeta(viewDate.getMonth(), viewDate.getFullYear());
|
|
3769
|
+
const months = createMonths(monthsMetaData);
|
|
3770
|
+
|
|
3771
|
+
return months;
|
|
3772
|
+
};
|
|
3773
|
+
|
|
3774
|
+
const monthPickerValues = () => {
|
|
3775
|
+
let monthPickerValues = [];
|
|
3776
|
+
const monthNamesShort = localeOption('monthNamesShort', props.locale);
|
|
3777
|
+
|
|
3778
|
+
for (let i = 0; i <= 11; i++) {
|
|
3779
|
+
monthPickerValues.push(monthNamesShort[i]);
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
return monthPickerValues;
|
|
3783
|
+
};
|
|
3784
|
+
|
|
3785
|
+
const yearPickerValues = () => {
|
|
3786
|
+
let yearPickerValues = [];
|
|
3787
|
+
let base = currentYear - (currentYear % 10);
|
|
3788
|
+
|
|
3789
|
+
for (let i = 0; i < 10; i++) {
|
|
3790
|
+
yearPickerValues.push(base + i);
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
return yearPickerValues;
|
|
3794
|
+
};
|
|
3795
|
+
|
|
3796
|
+
const createMonthYearView = () => {
|
|
3797
|
+
const backwardNavigator = createBackwardNavigator(true);
|
|
3798
|
+
const forwardNavigator = createForwardNavigator(true);
|
|
3799
|
+
const yearElement = createTitleYearElement(getViewDate().getFullYear());
|
|
3800
|
+
const decade = createTitleDecadeElement();
|
|
3801
|
+
const groupContainerProps = mergeProps(
|
|
3802
|
+
{
|
|
3803
|
+
className: cx('groupContainer')
|
|
3804
|
+
},
|
|
3805
|
+
ptm('groupContainer')
|
|
3806
|
+
);
|
|
3807
|
+
|
|
3808
|
+
const groupProps = mergeProps(
|
|
3809
|
+
{
|
|
3810
|
+
className: cx('group')
|
|
3811
|
+
},
|
|
3812
|
+
ptm('group')
|
|
3813
|
+
);
|
|
3814
|
+
|
|
3815
|
+
const headerProps = mergeProps(
|
|
3816
|
+
{
|
|
3817
|
+
className: cx('header')
|
|
3818
|
+
},
|
|
3819
|
+
ptm('header')
|
|
3820
|
+
);
|
|
3821
|
+
|
|
3822
|
+
const titleProps = mergeProps(
|
|
3823
|
+
{
|
|
3824
|
+
className: cx('title')
|
|
3825
|
+
},
|
|
3826
|
+
ptm('title')
|
|
3827
|
+
);
|
|
3828
|
+
|
|
3829
|
+
return (
|
|
3830
|
+
<>
|
|
3831
|
+
<div {...groupContainerProps}>
|
|
3832
|
+
<div {...groupProps}>
|
|
3833
|
+
<div {...headerProps}>
|
|
3834
|
+
{backwardNavigator}
|
|
3835
|
+
<div {...titleProps}>
|
|
3836
|
+
{yearElement}
|
|
3837
|
+
{decade}
|
|
3838
|
+
</div>
|
|
3839
|
+
{forwardNavigator}
|
|
3840
|
+
</div>
|
|
3841
|
+
</div>
|
|
3842
|
+
</div>
|
|
3843
|
+
</>
|
|
3844
|
+
);
|
|
3845
|
+
};
|
|
3846
|
+
|
|
3847
|
+
const createDatePicker = () => {
|
|
3848
|
+
if (!props.timeOnly) {
|
|
3849
|
+
if (props.view === 'date') {
|
|
3850
|
+
return createDateView();
|
|
3851
|
+
}
|
|
3852
|
+
|
|
3853
|
+
return createMonthYearView();
|
|
3854
|
+
}
|
|
3855
|
+
|
|
3856
|
+
return null;
|
|
3857
|
+
};
|
|
3858
|
+
|
|
3859
|
+
const incrementIconProps = mergeProps(ptm('incrementIcon'));
|
|
3860
|
+
const decrementIconProps = mergeProps(ptm('decrementIcon'));
|
|
3861
|
+
const incrementIcon = IconUtils.getJSXIcon(props.incrementIcon || <ChevronUpIcon {...incrementIconProps} />, { ...incrementIconProps }, { props });
|
|
3862
|
+
const decrementIcon = IconUtils.getJSXIcon(props.decrementIcon || <ChevronDownIcon {...decrementIconProps} />, { ...decrementIconProps }, { props });
|
|
3863
|
+
|
|
3864
|
+
const createHourPicker = () => {
|
|
3865
|
+
const currentTime = getCurrentDateTime();
|
|
3866
|
+
const minute = doStepMinute(currentTime.getMinutes());
|
|
3867
|
+
let hour = currentTime.getHours();
|
|
3868
|
+
|
|
3869
|
+
// #3770 account for step minutes rolling to next hour
|
|
3870
|
+
hour = minute > 59 ? hour + 1 : hour;
|
|
3871
|
+
|
|
3872
|
+
if (props.hourFormat === '12') {
|
|
3873
|
+
if (hour === 0) {
|
|
3874
|
+
hour = 12;
|
|
3875
|
+
} else if (hour > 11 && hour !== 12) {
|
|
3876
|
+
hour = hour - 12;
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
const hourProps = mergeProps(ptm('hour'));
|
|
3881
|
+
const { nextHour, prevHour } = localeOptions(props.locale);
|
|
3882
|
+
const hourDisplay = hour < 10 ? '0' + hour : hour;
|
|
3883
|
+
const hourPickerProps = mergeProps(
|
|
3884
|
+
{
|
|
3885
|
+
className: cx('hourPicker')
|
|
3886
|
+
},
|
|
3887
|
+
ptm('hourPicker')
|
|
3888
|
+
);
|
|
3889
|
+
|
|
3890
|
+
const incrementButtonProps = mergeProps(
|
|
3891
|
+
{
|
|
3892
|
+
type: 'button',
|
|
3893
|
+
className: cx('incrementButton'),
|
|
3894
|
+
'aria-label': nextHour,
|
|
3895
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 0, 1),
|
|
3896
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
3897
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
3898
|
+
onKeyDown: (e) => onPickerKeyDown(e, 0, 1),
|
|
3899
|
+
onKeyUp: onPickerKeyUp
|
|
3900
|
+
},
|
|
3901
|
+
ptm('incrementButton')
|
|
3902
|
+
);
|
|
3903
|
+
|
|
3904
|
+
const decrementButtonProps = mergeProps(
|
|
3905
|
+
{
|
|
3906
|
+
type: 'button',
|
|
3907
|
+
className: cx('decrementButton'),
|
|
3908
|
+
'aria-label': prevHour,
|
|
3909
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 0, -1),
|
|
3910
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
3911
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
3912
|
+
onKeyDown: (e) => onPickerKeyDown(e, 0, -1),
|
|
3913
|
+
onKeyUp: onPickerKeyUp
|
|
3914
|
+
},
|
|
3915
|
+
ptm('decrementButton')
|
|
3916
|
+
);
|
|
3917
|
+
|
|
3918
|
+
return (
|
|
3919
|
+
<div {...hourPickerProps}>
|
|
3920
|
+
<button {...incrementButtonProps}>
|
|
3921
|
+
{incrementIcon}
|
|
3922
|
+
<Ripple />
|
|
3923
|
+
</button>
|
|
3924
|
+
<span {...hourProps}>{hourDisplay}</span>
|
|
3925
|
+
<button {...decrementButtonProps}>
|
|
3926
|
+
{decrementIcon}
|
|
3927
|
+
<Ripple />
|
|
3928
|
+
</button>
|
|
3929
|
+
</div>
|
|
3930
|
+
);
|
|
3931
|
+
};
|
|
3932
|
+
|
|
3933
|
+
const createMinutePicker = () => {
|
|
3934
|
+
const currentTime = getCurrentDateTime();
|
|
3935
|
+
let minute = doStepMinute(currentTime.getMinutes());
|
|
3936
|
+
|
|
3937
|
+
minute = minute > 59 ? minute - 60 : minute;
|
|
3938
|
+
const minuteProps = mergeProps(ptm('minute'));
|
|
3939
|
+
const { nextMinute, prevMinute } = localeOptions(props.locale);
|
|
3940
|
+
const minuteDisplay = minute < 10 ? '0' + minute : minute;
|
|
3941
|
+
const minutePickerProps = mergeProps(
|
|
3942
|
+
{
|
|
3943
|
+
className: cx('minutePicker')
|
|
3944
|
+
},
|
|
3945
|
+
ptm('minutePicker')
|
|
3946
|
+
);
|
|
3947
|
+
|
|
3948
|
+
const incrementButtonProps = mergeProps(
|
|
3949
|
+
{
|
|
3950
|
+
type: 'button',
|
|
3951
|
+
className: cx('incrementButton'),
|
|
3952
|
+
'aria-label': nextMinute,
|
|
3953
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 1, 1),
|
|
3954
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
3955
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
3956
|
+
onKeyDown: (e) => onPickerKeyDown(e, 1, 1),
|
|
3957
|
+
onKeyUp: onPickerKeyUp
|
|
3958
|
+
},
|
|
3959
|
+
ptm('incrementButton')
|
|
3960
|
+
);
|
|
3961
|
+
|
|
3962
|
+
const decrementButtonProps = mergeProps(
|
|
3963
|
+
{
|
|
3964
|
+
type: 'button',
|
|
3965
|
+
className: cx('decrementButton'),
|
|
3966
|
+
'aria-label': prevMinute,
|
|
3967
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 1, -1),
|
|
3968
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
3969
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
3970
|
+
onKeyDown: (e) => onPickerKeyDown(e, 1, -1),
|
|
3971
|
+
onKeyUp: onPickerKeyUp
|
|
3972
|
+
},
|
|
3973
|
+
ptm('decrementButton')
|
|
3974
|
+
);
|
|
3975
|
+
|
|
3976
|
+
return (
|
|
3977
|
+
<div {...minutePickerProps}>
|
|
3978
|
+
<button {...incrementButtonProps}>
|
|
3979
|
+
{incrementIcon}
|
|
3980
|
+
<Ripple />
|
|
3981
|
+
</button>
|
|
3982
|
+
<span {...minuteProps}>{minuteDisplay}</span>
|
|
3983
|
+
<button {...decrementButtonProps}>
|
|
3984
|
+
{decrementIcon}
|
|
3985
|
+
<Ripple />
|
|
3986
|
+
</button>
|
|
3987
|
+
</div>
|
|
3988
|
+
);
|
|
3989
|
+
};
|
|
3990
|
+
|
|
3991
|
+
const createSecondPicker = () => {
|
|
3992
|
+
if (props.showSeconds) {
|
|
3993
|
+
const currentTime = getCurrentDateTime();
|
|
3994
|
+
const { nextSecond, prevSecond } = localeOptions(props.locale);
|
|
3995
|
+
const secondProps = mergeProps(ptm('second'));
|
|
3996
|
+
const second = currentTime.getSeconds();
|
|
3997
|
+
const secondDisplay = second < 10 ? '0' + second : second;
|
|
3998
|
+
const secondPickerProps = mergeProps(
|
|
3999
|
+
{
|
|
4000
|
+
className: cx('secondPicker')
|
|
4001
|
+
},
|
|
4002
|
+
ptm('secondPicker')
|
|
4003
|
+
);
|
|
4004
|
+
|
|
4005
|
+
const incrementButtonProps = mergeProps(
|
|
4006
|
+
{
|
|
4007
|
+
type: 'button',
|
|
4008
|
+
className: cx('incrementButton'),
|
|
4009
|
+
'aria-label': nextSecond,
|
|
4010
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 2, 1),
|
|
4011
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
4012
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
4013
|
+
onKeyDown: (e) => onPickerKeyDown(e, 2, 1),
|
|
4014
|
+
onKeyUp: onPickerKeyUp
|
|
4015
|
+
},
|
|
4016
|
+
ptm('incrementButton')
|
|
4017
|
+
);
|
|
4018
|
+
|
|
4019
|
+
const decrementButtonProps = mergeProps(
|
|
4020
|
+
{
|
|
4021
|
+
type: 'button',
|
|
4022
|
+
className: cx('decrementButton'),
|
|
4023
|
+
'aria-label': prevSecond,
|
|
4024
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 2, -1),
|
|
4025
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
4026
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
4027
|
+
onKeyDown: (e) => onPickerKeyDown(e, 2, -1),
|
|
4028
|
+
onKeyUp: onPickerKeyUp
|
|
4029
|
+
},
|
|
4030
|
+
ptm('decrementButton')
|
|
4031
|
+
);
|
|
4032
|
+
|
|
4033
|
+
return (
|
|
4034
|
+
<div {...secondPickerProps}>
|
|
4035
|
+
<button {...incrementButtonProps}>
|
|
4036
|
+
{incrementIcon}
|
|
4037
|
+
<Ripple />
|
|
4038
|
+
</button>
|
|
4039
|
+
<span {...secondProps}>{secondDisplay}</span>
|
|
4040
|
+
<button {...decrementButtonProps}>
|
|
4041
|
+
{decrementIcon}
|
|
4042
|
+
<Ripple />
|
|
4043
|
+
</button>
|
|
4044
|
+
</div>
|
|
4045
|
+
);
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
return null;
|
|
4049
|
+
};
|
|
4050
|
+
|
|
4051
|
+
const createMiliSecondPicker = () => {
|
|
4052
|
+
if (props.showMillisec) {
|
|
4053
|
+
const currentTime = getCurrentDateTime();
|
|
4054
|
+
const { nextMilliSecond, prevMilliSecond } = localeOptions(props.locale);
|
|
4055
|
+
const millisecondProps = mergeProps(ptm('millisecond'));
|
|
4056
|
+
const millisecond = currentTime.getMilliseconds();
|
|
4057
|
+
const millisecondDisplay = millisecond < 100 ? (millisecond < 10 ? '00' : '0') + millisecond : millisecond;
|
|
4058
|
+
const millisecondPickerProps = mergeProps(
|
|
4059
|
+
{
|
|
4060
|
+
className: cx('millisecondPicker')
|
|
4061
|
+
},
|
|
4062
|
+
ptm('millisecondPicker')
|
|
4063
|
+
);
|
|
4064
|
+
|
|
4065
|
+
const incrementButtonProps = mergeProps(
|
|
4066
|
+
{
|
|
4067
|
+
type: 'button',
|
|
4068
|
+
className: cx('incrementButton'),
|
|
4069
|
+
'aria-label': nextMilliSecond,
|
|
4070
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 3, 1),
|
|
4071
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
4072
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
4073
|
+
onKeyDown: (e) => onPickerKeyDown(e, 3, 1),
|
|
4074
|
+
onKeyUp: onPickerKeyUp
|
|
4075
|
+
},
|
|
4076
|
+
ptm('incrementButton')
|
|
4077
|
+
);
|
|
4078
|
+
|
|
4079
|
+
const decrementButtonProps = mergeProps(
|
|
4080
|
+
{
|
|
4081
|
+
type: 'button',
|
|
4082
|
+
className: cx('decrementButton'),
|
|
4083
|
+
'aria-label': prevMilliSecond,
|
|
4084
|
+
onMouseDown: (e) => onTimePickerElementMouseDown(e, 3, -1),
|
|
4085
|
+
onMouseUp: onTimePickerElementMouseUp,
|
|
4086
|
+
onMouseLeave: onTimePickerElementMouseLeave,
|
|
4087
|
+
onKeyDown: (e) => onPickerKeyDown(e, 3, -1),
|
|
4088
|
+
onKeyUp: onPickerKeyUp
|
|
4089
|
+
},
|
|
4090
|
+
ptm('decrementButton')
|
|
4091
|
+
);
|
|
4092
|
+
|
|
4093
|
+
return (
|
|
4094
|
+
<div {...millisecondPickerProps}>
|
|
4095
|
+
<button {...incrementButtonProps}>
|
|
4096
|
+
{incrementIcon}
|
|
4097
|
+
<Ripple />
|
|
4098
|
+
</button>
|
|
4099
|
+
<span {...millisecondProps}>{millisecondDisplay}</span>
|
|
4100
|
+
<button {...decrementButtonProps}>
|
|
4101
|
+
{decrementIcon}
|
|
4102
|
+
<Ripple />
|
|
4103
|
+
</button>
|
|
4104
|
+
</div>
|
|
4105
|
+
);
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
return null;
|
|
4109
|
+
};
|
|
4110
|
+
|
|
4111
|
+
const createAmPmPicker = () => {
|
|
4112
|
+
if (props.hourFormat === '12') {
|
|
4113
|
+
const currentTime = getCurrentDateTime();
|
|
4114
|
+
const { am, pm } = localeOptions(props.locale);
|
|
4115
|
+
const hour = currentTime.getHours();
|
|
4116
|
+
const display = hour > 11 ? 'PM' : 'AM';
|
|
4117
|
+
const ampmProps = mergeProps(ptm('ampm'));
|
|
4118
|
+
const ampmPickerProps = mergeProps(
|
|
4119
|
+
{
|
|
4120
|
+
className: cx('ampmPicker')
|
|
4121
|
+
},
|
|
4122
|
+
ptm('ampmPicker')
|
|
4123
|
+
);
|
|
4124
|
+
|
|
4125
|
+
const incrementButtonProps = mergeProps(
|
|
4126
|
+
{
|
|
4127
|
+
type: 'button',
|
|
4128
|
+
className: cx('incrementButton'),
|
|
4129
|
+
'aria-label': am,
|
|
4130
|
+
onClick: (e) => toggleAmPm(e)
|
|
4131
|
+
},
|
|
4132
|
+
ptm('incrementButton')
|
|
4133
|
+
);
|
|
4134
|
+
|
|
4135
|
+
const decrementButtonProps = mergeProps(
|
|
4136
|
+
{
|
|
4137
|
+
type: 'button',
|
|
4138
|
+
className: cx('decrementButton'),
|
|
4139
|
+
'aria-label': pm,
|
|
4140
|
+
onClick: (e) => toggleAmPm(e)
|
|
4141
|
+
},
|
|
4142
|
+
ptm('decrementButton')
|
|
4143
|
+
);
|
|
4144
|
+
|
|
4145
|
+
return (
|
|
4146
|
+
<div {...ampmPickerProps}>
|
|
4147
|
+
<button {...incrementButtonProps}>
|
|
4148
|
+
{incrementIcon}
|
|
4149
|
+
<Ripple />
|
|
4150
|
+
</button>
|
|
4151
|
+
<span {...ampmProps}>{display}</span>
|
|
4152
|
+
<button {...decrementButtonProps}>
|
|
4153
|
+
{decrementIcon}
|
|
4154
|
+
<Ripple />
|
|
4155
|
+
</button>
|
|
4156
|
+
</div>
|
|
4157
|
+
);
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
return null;
|
|
4161
|
+
};
|
|
4162
|
+
|
|
4163
|
+
const createSeparator = (separator) => {
|
|
4164
|
+
const separatorContainerProps = mergeProps(
|
|
4165
|
+
{
|
|
4166
|
+
className: cx('separatorContainer')
|
|
4167
|
+
},
|
|
4168
|
+
ptm('separatorContainer')
|
|
4169
|
+
);
|
|
4170
|
+
|
|
4171
|
+
const separatorProps = mergeProps(ptm('separator'));
|
|
4172
|
+
|
|
4173
|
+
return (
|
|
4174
|
+
<div {...separatorContainerProps}>
|
|
4175
|
+
<span {...separatorProps}>{separator}</span>
|
|
4176
|
+
</div>
|
|
4177
|
+
);
|
|
4178
|
+
};
|
|
4179
|
+
|
|
4180
|
+
const createTimePicker = () => {
|
|
4181
|
+
if ((props.showTime || props.timeOnly) && currentView === 'date') {
|
|
4182
|
+
const timePickerProps = mergeProps(
|
|
4183
|
+
{
|
|
4184
|
+
className: cx('timePicker')
|
|
4185
|
+
},
|
|
4186
|
+
ptm('timePicker')
|
|
4187
|
+
);
|
|
4188
|
+
|
|
4189
|
+
return (
|
|
4190
|
+
<div {...timePickerProps}>
|
|
4191
|
+
{createHourPicker()}
|
|
4192
|
+
{createSeparator(':')}
|
|
4193
|
+
{createMinutePicker()}
|
|
4194
|
+
{props.showSeconds && createSeparator(':')}
|
|
4195
|
+
{createSecondPicker()}
|
|
4196
|
+
{props.showMillisec && createSeparator('.')}
|
|
4197
|
+
{createMiliSecondPicker()}
|
|
4198
|
+
{props.hourFormat === '12' && createSeparator(':')}
|
|
4199
|
+
{createAmPmPicker()}
|
|
4200
|
+
</div>
|
|
4201
|
+
);
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
return null;
|
|
4205
|
+
};
|
|
4206
|
+
|
|
4207
|
+
const createInputElement = () => {
|
|
4208
|
+
if (!props.inline) {
|
|
4209
|
+
return (
|
|
4210
|
+
<InputText
|
|
4211
|
+
ref={inputRef}
|
|
4212
|
+
id={props.inputId}
|
|
4213
|
+
name={props.name}
|
|
4214
|
+
type="text"
|
|
4215
|
+
role="combobox"
|
|
4216
|
+
className={classNames(props.inputClassName, cx('input', { context }))}
|
|
4217
|
+
style={props.inputStyle}
|
|
4218
|
+
readOnly={props.readOnlyInput}
|
|
4219
|
+
disabled={props.disabled}
|
|
4220
|
+
required={props.required}
|
|
4221
|
+
autoComplete="off"
|
|
4222
|
+
placeholder={props.placeholder}
|
|
4223
|
+
tabIndex={props.tabIndex}
|
|
4224
|
+
onClick={onInputClick}
|
|
4225
|
+
onInput={onUserInput}
|
|
4226
|
+
onFocus={onInputFocus}
|
|
4227
|
+
onBlur={onInputBlur}
|
|
4228
|
+
onKeyDown={onInputKeyDown}
|
|
4229
|
+
aria-expanded={overlayVisibleState}
|
|
4230
|
+
aria-autocomplete="none"
|
|
4231
|
+
aria-haspopup="dialog"
|
|
4232
|
+
aria-controls={panelId}
|
|
4233
|
+
aria-labelledby={props.ariaLabelledBy}
|
|
4234
|
+
aria-label={props.ariaLabel}
|
|
4235
|
+
inputMode={props.inputMode}
|
|
4236
|
+
tooltip={props.tooltip}
|
|
4237
|
+
tooltipOptions={props.tooltipOptions}
|
|
4238
|
+
pt={ptm('input')}
|
|
4239
|
+
unstyled={props.unstyled}
|
|
4240
|
+
__parentMetadata={{ parent: metaData }}
|
|
4241
|
+
/>
|
|
4242
|
+
);
|
|
4243
|
+
}
|
|
4244
|
+
|
|
4245
|
+
return null;
|
|
4246
|
+
};
|
|
4247
|
+
|
|
4248
|
+
const createButton = () => {
|
|
4249
|
+
if (props.showIcon) {
|
|
4250
|
+
return (
|
|
4251
|
+
<Button
|
|
4252
|
+
type="button"
|
|
4253
|
+
icon={props.icon || <CalendarIcon />}
|
|
4254
|
+
onClick={onButtonClick}
|
|
4255
|
+
tabIndex="-1"
|
|
4256
|
+
disabled={props.disabled}
|
|
4257
|
+
aria-haspopup="dialog"
|
|
4258
|
+
aria-label={localeOption('chooseDate', props.locale)}
|
|
4259
|
+
aria-expanded={overlayVisibleState}
|
|
4260
|
+
aria-controls={panelId}
|
|
4261
|
+
className={cx('dropdownButton')}
|
|
4262
|
+
pt={ptm('dropdownButton')}
|
|
4263
|
+
__parentMetadata={{ parent: metaData }}
|
|
4264
|
+
/>
|
|
4265
|
+
);
|
|
4266
|
+
}
|
|
4267
|
+
|
|
4268
|
+
return null;
|
|
4269
|
+
};
|
|
4270
|
+
|
|
4271
|
+
const createContent = () => {
|
|
4272
|
+
const input = createInputElement();
|
|
4273
|
+
const button = createButton();
|
|
4274
|
+
|
|
4275
|
+
if (props.iconPos === 'left') {
|
|
4276
|
+
return (
|
|
4277
|
+
<>
|
|
4278
|
+
{button}
|
|
4279
|
+
{input}
|
|
4280
|
+
</>
|
|
4281
|
+
);
|
|
4282
|
+
}
|
|
4283
|
+
|
|
4284
|
+
return (
|
|
4285
|
+
<>
|
|
4286
|
+
{input}
|
|
4287
|
+
{button}
|
|
4288
|
+
</>
|
|
4289
|
+
);
|
|
4290
|
+
};
|
|
4291
|
+
|
|
4292
|
+
const isPastMaxDateWithBuffer = (bufferInSeconds = 10) => {
|
|
4293
|
+
const now = new Date();
|
|
4294
|
+
const maxDate = props.maxDate;
|
|
4295
|
+
|
|
4296
|
+
return maxDate < now && Math.abs((now.getTime() - maxDate.getTime()) / 1000) > bufferInSeconds;
|
|
4297
|
+
};
|
|
4298
|
+
|
|
4299
|
+
const createButtonBar = () => {
|
|
4300
|
+
if (props.showButtonBar) {
|
|
4301
|
+
const { today, clear, now } = localeOptions(props.locale);
|
|
4302
|
+
const nowDate = new Date();
|
|
4303
|
+
const isHidden = (props.minDate && props.minDate > nowDate) || (props.maxDate && isPastMaxDateWithBuffer());
|
|
4304
|
+
const buttonbarProps = mergeProps(
|
|
4305
|
+
{
|
|
4306
|
+
className: cx('buttonbar')
|
|
4307
|
+
},
|
|
4308
|
+
ptm('buttonbar')
|
|
4309
|
+
);
|
|
4310
|
+
|
|
4311
|
+
return (
|
|
4312
|
+
<div {...buttonbarProps}>
|
|
4313
|
+
<Button
|
|
4314
|
+
type="button"
|
|
4315
|
+
label={props.showTime ? now : today}
|
|
4316
|
+
onClick={onTodayButtonClick}
|
|
4317
|
+
onKeyDown={(e) => onContainerButtonKeydown(e)}
|
|
4318
|
+
className={classNames(props.todayButtonClassName, cx('todayButton'))}
|
|
4319
|
+
pt={ptm('todayButton')}
|
|
4320
|
+
style={isHidden ? { visibility: 'hidden' } : undefined}
|
|
4321
|
+
/>
|
|
4322
|
+
<Button type="button" label={clear} onClick={onClearButtonClick} onKeyDown={(e) => onContainerButtonKeydown(e)} className={classNames(props.clearButtonClassName, cx('clearButton'))} pt={ptm('clearButton')} />
|
|
4323
|
+
</div>
|
|
4324
|
+
);
|
|
4325
|
+
}
|
|
4326
|
+
|
|
4327
|
+
return null;
|
|
4328
|
+
};
|
|
4329
|
+
|
|
4330
|
+
const createFooter = () => {
|
|
4331
|
+
if (props.footerTemplate) {
|
|
4332
|
+
const content = props.footerTemplate();
|
|
4333
|
+
const footerProps = mergeProps(
|
|
4334
|
+
{
|
|
4335
|
+
className: cx('footer')
|
|
4336
|
+
},
|
|
4337
|
+
ptm('footer')
|
|
4338
|
+
);
|
|
4339
|
+
|
|
4340
|
+
return <div {...footerProps}>{content}</div>;
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
return null;
|
|
4344
|
+
};
|
|
4345
|
+
|
|
4346
|
+
const createMonthPicker = () => {
|
|
4347
|
+
if (currentView === 'month') {
|
|
4348
|
+
const monthPickerProps = mergeProps(
|
|
4349
|
+
{
|
|
4350
|
+
className: cx('monthPicker')
|
|
4351
|
+
},
|
|
4352
|
+
ptm('monthPicker')
|
|
4353
|
+
);
|
|
4354
|
+
|
|
4355
|
+
return (
|
|
4356
|
+
<div {...monthPickerProps}>
|
|
4357
|
+
{monthPickerValues().map((m, i) => {
|
|
4358
|
+
const selected = isMonthSelected(i);
|
|
4359
|
+
const monthProps = mergeProps(
|
|
4360
|
+
{
|
|
4361
|
+
className: cx('month', { isMonthSelected, isMonthYearDisabled, i, currentYear }),
|
|
4362
|
+
onClick: (event) => onMonthSelect(event, i),
|
|
4363
|
+
onKeyDown: (event) => onMonthCellKeydown(event, i),
|
|
4364
|
+
'data-p-disabled': isMonthYearDisabled(i, currentYear),
|
|
4365
|
+
'data-p-highlight': selected
|
|
4366
|
+
},
|
|
4367
|
+
ptm('month', {
|
|
4368
|
+
context: {
|
|
4369
|
+
month: m,
|
|
4370
|
+
monthIndex: i,
|
|
4371
|
+
selected: selected,
|
|
4372
|
+
disabled: isMonthYearDisabled(i, currentYear)
|
|
4373
|
+
}
|
|
4374
|
+
})
|
|
4375
|
+
);
|
|
4376
|
+
|
|
4377
|
+
return (
|
|
4378
|
+
<span {...monthProps} key={`month${i + 1}`}>
|
|
4379
|
+
{m}
|
|
4380
|
+
{selected && (
|
|
4381
|
+
<div aria-live="polite" className="p-hidden-accessible" data-p-hidden-accessible={true} pt={ptm('hiddenMonth')}>
|
|
4382
|
+
{m}
|
|
4383
|
+
</div>
|
|
4384
|
+
)}
|
|
4385
|
+
</span>
|
|
4386
|
+
);
|
|
4387
|
+
})}
|
|
4388
|
+
</div>
|
|
4389
|
+
);
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4392
|
+
return null;
|
|
4393
|
+
};
|
|
4394
|
+
|
|
4395
|
+
const createYearPicker = () => {
|
|
4396
|
+
if (currentView === 'year') {
|
|
4397
|
+
const yearPickerProps = mergeProps(
|
|
4398
|
+
{
|
|
4399
|
+
className: cx('yearPicker')
|
|
4400
|
+
},
|
|
4401
|
+
ptm('yearPicker')
|
|
4402
|
+
);
|
|
4403
|
+
|
|
4404
|
+
return (
|
|
4405
|
+
<div {...yearPickerProps}>
|
|
4406
|
+
{yearPickerValues().map((y, i) => {
|
|
4407
|
+
const selected = isYearSelected(y);
|
|
4408
|
+
|
|
4409
|
+
const yearProps = mergeProps(
|
|
4410
|
+
{
|
|
4411
|
+
className: cx('year', { isYearSelected, isMonthYearDisabled, y }),
|
|
4412
|
+
onClick: (event) => onYearSelect(event, y),
|
|
4413
|
+
onKeyDown: (event) => onYearCellKeydown(event, y),
|
|
4414
|
+
'data-p-highlight': isYearSelected(y),
|
|
4415
|
+
'data-p-disabled': isMonthYearDisabled(-1, y)
|
|
4416
|
+
},
|
|
4417
|
+
ptm('year', {
|
|
4418
|
+
context: {
|
|
4419
|
+
year: y,
|
|
4420
|
+
yearIndex: i,
|
|
4421
|
+
selected,
|
|
4422
|
+
disabled: isMonthYearDisabled(-1, y)
|
|
4423
|
+
}
|
|
4424
|
+
})
|
|
4425
|
+
);
|
|
4426
|
+
|
|
4427
|
+
return (
|
|
4428
|
+
<span {...yearProps} key={`year${i + 1}`}>
|
|
4429
|
+
{y}
|
|
4430
|
+
{selected && (
|
|
4431
|
+
<div aria-live="polite" className="p-hidden-accessible" data-p-hidden-accessible={true} pt={ptm('hiddenYear')}>
|
|
4432
|
+
{y}
|
|
4433
|
+
</div>
|
|
4434
|
+
)}
|
|
4435
|
+
</span>
|
|
4436
|
+
);
|
|
4437
|
+
})}
|
|
4438
|
+
</div>
|
|
4439
|
+
);
|
|
4440
|
+
}
|
|
4441
|
+
|
|
4442
|
+
return null;
|
|
4443
|
+
};
|
|
4444
|
+
|
|
4445
|
+
const panelClassName = classNames('p-datepicker p-component', props.panelClassName, {
|
|
4446
|
+
'p-datepicker-inline': props.inline,
|
|
4447
|
+
'p-disabled': props.disabled,
|
|
4448
|
+
'p-datepicker-timeonly': props.timeOnly,
|
|
4449
|
+
'p-datepicker-multiple-month': props.numberOfMonths > 1,
|
|
4450
|
+
'p-datepicker-monthpicker': currentView === 'month',
|
|
4451
|
+
'p-datepicker-touch-ui': props.touchUI,
|
|
4452
|
+
'p-input-filled': (context && context.inputStyle === 'filled') || PrimeReact.inputStyle === 'filled',
|
|
4453
|
+
'p-ripple-disabled': (context && context.ripple === false) || PrimeReact.ripple === false
|
|
4454
|
+
});
|
|
4455
|
+
const content = createContent();
|
|
4456
|
+
const datePicker = createDatePicker();
|
|
4457
|
+
const timePicker = createTimePicker();
|
|
4458
|
+
const buttonBar = createButtonBar();
|
|
4459
|
+
const footer = createFooter();
|
|
4460
|
+
const monthPicker = createMonthPicker();
|
|
4461
|
+
const yearPicker = createYearPicker();
|
|
4462
|
+
const isFilled = DomHandler.hasClass(inputRef.current, 'p-filled') && inputRef.current.value !== '';
|
|
4463
|
+
const rootProps = mergeProps(
|
|
4464
|
+
{
|
|
4465
|
+
id: props.id,
|
|
4466
|
+
className: classNames(props.className, cx('root', { focusedState, isFilled, panelVisible: visible })),
|
|
4467
|
+
style: props.style
|
|
4468
|
+
},
|
|
4469
|
+
CalendarBase.getOtherProps(props),
|
|
4470
|
+
ptm('root')
|
|
4471
|
+
);
|
|
4472
|
+
|
|
4473
|
+
return (
|
|
4474
|
+
<span ref={elementRef} {...rootProps}>
|
|
4475
|
+
{content}
|
|
4476
|
+
<CalendarPanel
|
|
4477
|
+
hostName="Calendar"
|
|
4478
|
+
id={panelId}
|
|
4479
|
+
locale={props.locale}
|
|
4480
|
+
ref={overlayRef}
|
|
4481
|
+
className={panelClassName}
|
|
4482
|
+
style={props.panelStyle}
|
|
4483
|
+
appendTo={props.appendTo}
|
|
4484
|
+
inline={props.inline}
|
|
4485
|
+
onClick={onPanelClick}
|
|
4486
|
+
onMouseUp={onPanelMouseUp}
|
|
4487
|
+
in={visible}
|
|
4488
|
+
onEnter={onOverlayEnter}
|
|
4489
|
+
onEntered={onOverlayEntered}
|
|
4490
|
+
onExit={onOverlayExit}
|
|
4491
|
+
onExited={onOverlayExited}
|
|
4492
|
+
transitionOptions={props.transitionOptions}
|
|
4493
|
+
ptm={ptm}
|
|
4494
|
+
cx={cx}
|
|
4495
|
+
>
|
|
4496
|
+
{datePicker}
|
|
4497
|
+
{timePicker}
|
|
4498
|
+
{monthPicker}
|
|
4499
|
+
{yearPicker}
|
|
4500
|
+
{buttonBar}
|
|
4501
|
+
{footer}
|
|
4502
|
+
</CalendarPanel>
|
|
4503
|
+
</span>
|
|
4504
|
+
);
|
|
4505
|
+
})
|
|
4506
|
+
);
|
|
4507
|
+
|
|
4508
|
+
Calendar.displayName = 'Calendar';
|