guestbell-forms 3.0.38 → 3.0.40
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/.env.bat +1 -0
- package/.eslintrc.json +21 -14
- package/build/components/base/input/BaseInput.d.ts +99 -99
- package/build/components/base/input/BaseInput.js +4 -0
- package/build/components/base/input/BaseInput.js.map +1 -1
- package/build/components/base/input/index.d.ts +1 -1
- package/build/components/bookingCalendar/BookingCalendar.d.ts +45 -46
- package/build/components/bookingCalendar/BookingCalendar.js +4 -5
- package/build/components/bookingCalendar/BookingCalendar.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.d.ts +17 -17
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js +12 -12
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/classes.d.ts +9 -9
- package/build/components/bookingCalendar/bookingCalendarControls/index.d.ts +2 -2
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.d.ts +13 -13
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js +3 -3
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/classes.d.ts +5 -5
- package/build/components/bookingCalendar/bookingCalendarDatePicker/index.d.ts +2 -2
- package/build/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.d.ts +10 -10
- package/build/components/bookingCalendar/bookingCalendarGrid/classes.d.ts +5 -5
- package/build/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.d.ts +57 -57
- package/build/components/bookingCalendar/bookingCalendarItem/classes.d.ts +4 -4
- package/build/components/bookingCalendar/bookingCalendarItem/index.d.ts +2 -2
- package/build/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.d.ts +16 -16
- package/build/components/bookingCalendar/bookingCalendarLane/classes.d.ts +4 -4
- package/build/components/bookingCalendar/bookingCalendarLane/index.d.ts +2 -2
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.d.ts +7 -7
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/classes.d.ts +4 -4
- package/build/components/bookingCalendar/bookingCalendarLaneHeader/index.d.ts +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.d.ts +11 -11
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js +3 -3
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.d.ts +4 -5
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/classes.d.ts +5 -5
- package/build/components/bookingCalendar/bookingCalendarLanesHeader/index.d.ts +2 -2
- package/build/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.d.ts +9 -9
- package/build/components/bookingCalendar/bookingCalendarRenderItem/classes.d.ts +6 -6
- package/build/components/bookingCalendar/bookingCalendarRenderItem/index.d.ts +1 -1
- package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.d.ts +38 -37
- package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js +2 -0
- package/build/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.d.ts +11 -11
- package/build/components/bookingCalendar/bookingCalendarTimeAxis/classes.d.ts +5 -5
- package/build/components/bookingCalendar/classes.d.ts +11 -11
- package/build/components/bookingCalendar/common.d.ts +23 -23
- package/build/components/bookingCalendar/common.js +3 -4
- package/build/components/bookingCalendar/common.js.map +1 -1
- package/build/components/bookingCalendar/index.d.ts +3 -3
- package/build/components/bookingCalendar/utils.d.ts +52 -50
- package/build/components/bookingCalendar/utils.js.map +1 -1
- package/build/components/button/Button.d.ts +81 -81
- package/build/components/button/Button.js +1 -0
- package/build/components/button/Button.js.map +1 -1
- package/build/components/button/index.d.ts +2 -2
- package/build/components/checkbox/Checkbox.d.ts +23 -23
- package/build/components/checkbox/index.d.ts +2 -2
- package/build/components/dropdown/Dropdown.d.ts +44 -44
- package/build/components/dropdown/index.d.ts +2 -2
- package/build/components/dynamicSubmit/DynamicSubmit.d.ts +54 -54
- package/build/components/dynamicSubmit/DynamicSubmit.js.map +1 -1
- package/build/components/dynamicSubmit/index.d.ts +2 -2
- package/build/components/externalValidationComponent/ExternalValidationComponent.d.ts +15 -15
- package/build/components/externalValidationComponent/index.d.ts +2 -2
- package/build/components/form/Form.d.ts +47 -47
- package/build/components/form/FormContext.d.ts +30 -30
- package/build/components/form/FormValidationSummary.d.ts +38 -38
- package/build/components/form/FormValidationSummary.js.map +1 -1
- package/build/components/form/index.d.ts +5 -5
- package/build/components/form/withFormContext.d.ts +3 -3
- package/build/components/inputGroup/InputGroup.d.ts +15 -17
- package/build/components/inputGroup/index.d.ts +2 -2
- package/build/components/inputHeader/InputHeader.d.ts +97 -97
- package/build/components/inputHeader/InputHeader.js.map +1 -1
- package/build/components/inputHeader/InputHeaderContext.d.ts +24 -24
- package/build/components/inputHeader/index.d.ts +2 -2
- package/build/components/inputHeader/withInputHeaderContext.d.ts +3 -3
- package/build/components/money/Money.d.ts +78 -78
- package/build/components/money/Money.js.map +1 -1
- package/build/components/money/index.d.ts +2 -2
- package/build/components/numberInput/NumberInput.d.ts +28 -28
- package/build/components/numberInput/index.d.ts +2 -2
- package/build/components/openingHours/openingHoursDay/OpeningHoursDay.d.ts +84 -84
- package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js +3 -3
- package/build/components/openingHours/openingHoursDay/OpeningHoursDay.js.map +1 -1
- package/build/components/openingHours/openingHoursDay/index.d.ts +2 -2
- package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.d.ts +92 -90
- package/build/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.js.map +1 -1
- package/build/components/openingHours/openingHoursSpecial/index.d.ts +2 -2
- package/build/components/openingHours/openingHoursWeek/OpeningHoursWeek.d.ts +109 -109
- package/build/components/openingHours/openingHoursWeek/index.d.ts +2 -2
- package/build/components/openingHours/utils/OpeningHoursUtil.d.ts +21 -21
- package/build/components/radio/Radio.d.ts +20 -20
- package/build/components/radio/index.d.ts +2 -2
- package/build/components/radioContainer/RadioContainer.d.ts +17 -16
- package/build/components/radioContainer/RadioContainer.js.map +1 -1
- package/build/components/radioContainer/index.d.ts +2 -2
- package/build/components/select/Select.d.ts +79 -79
- package/build/components/select/index.d.ts +2 -2
- package/build/components/submit/Submit.d.ts +137 -137
- package/build/components/submit/index.d.ts +2 -2
- package/build/components/submit/subComponents/SubmitValidationSummary.d.ts +5 -5
- package/build/components/tags/Tags.d.ts +92 -92
- package/build/components/tags/Tags.js +2 -0
- package/build/components/tags/Tags.js.map +1 -1
- package/build/components/tags/index.d.ts +2 -2
- package/build/components/tags/subComponents/TagsSuggestions.d.ts +34 -34
- package/build/components/tags/subComponents/TagsSuggestions.js +2 -2
- package/build/components/tags/subComponents/TagsSuggestions.js.map +1 -1
- package/build/components/text/Text.d.ts +31 -31
- package/build/components/text/index.d.ts +2 -2
- package/build/components/textArea/TextArea.d.ts +28 -28
- package/build/components/textArea/TextArea.js +1 -0
- package/build/components/textArea/TextArea.js.map +1 -1
- package/build/components/textArea/index.d.ts +2 -2
- package/build/components/themeProvider/ThemeContext.d.ts +9 -9
- package/build/components/themeProvider/ThemeProvider.d.ts +8 -7
- package/build/components/themeProvider/ThemeProvider.js.map +1 -1
- package/build/components/themeProvider/index.d.ts +4 -4
- package/build/components/themeProvider/withThemeContext.d.ts +4 -4
- package/build/components/time/Time.d.ts +32 -32
- package/build/components/time/Time.js +3 -3
- package/build/components/time/Time.js.map +1 -1
- package/build/components/time/index.d.ts +2 -2
- package/build/components/timeSpan/TimeSpan.d.ts +46 -46
- package/build/components/timeSpan/TimeSpan.js +6 -6
- package/build/components/timeSpan/TimeSpan.js.map +1 -1
- package/build/components/timeSpan/index.d.ts +2 -2
- package/build/components/utils/Guid.d.ts +2 -2
- package/build/components/utils/ShallowEqual.d.ts +16 -16
- package/build/components/utils/TimeUtil.d.ts +6 -6
- package/build/components/utils/Typescript.d.ts +5 -5
- package/build/dist/guestbell-forms.css +157 -171
- package/build/dist/guestbell-forms.css.map +1 -1
- package/build/dist/guestbell-forms.js +15 -24
- package/build/dist/guestbell-forms.js.map +1 -1
- package/build/dist/guestbell-forms.min.css +1 -1
- package/build/dist/guestbell-forms.min.js +1 -1
- package/build/dist/guestbell-forms.min.js.map +1 -1
- package/build/dist/report.html +3 -3
- package/build/index.d.ts +24 -24
- package/build/scss/components/bookingCalendar/bookingCalendar.scss +30 -7
- package/build/scss/components/inputHeader/inputHeader.scss +7 -1
- package/build/types/ElementOverrideProp.d.ts +3 -3
- package/build/types/Theme.d.ts +4 -4
- package/build/types/ThemeOverrides.d.ts +45 -45
- package/build/validators/EmailValidator.d.ts +4 -4
- package/build/validators/LatitudeValidator.d.ts +4 -4
- package/build/validators/LongitudeValidator.d.ts +4 -4
- package/build/validators/NumberValidator.d.ts +12 -12
- package/build/validators/NumberValidator.js +1 -0
- package/build/validators/NumberValidator.js.map +1 -1
- package/build/validators/UrlValidator.d.ts +4 -4
- package/build/validators/base.d.ts +4 -4
- package/build/validators/index.d.ts +6 -6
- package/package.json +130 -136
- package/src/lib/components/base/input/BaseInput.tsx +526 -0
- package/src/lib/components/base/input/index.tsx +1 -0
- package/src/lib/components/bookingCalendar/BookingCalendar.tsx +327 -0
- package/src/lib/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.tsx +249 -0
- package/src/lib/components/bookingCalendar/bookingCalendarControls/classes.ts +20 -0
- package/src/lib/components/bookingCalendar/bookingCalendarControls/index.ts +2 -0
- package/src/lib/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.tsx +104 -0
- package/src/lib/components/bookingCalendar/bookingCalendarDatePicker/classes.ts +9 -0
- package/src/lib/components/bookingCalendar/bookingCalendarDatePicker/index.ts +2 -0
- package/src/lib/components/bookingCalendar/bookingCalendarGrid/BookingCalendarGrid.tsx +56 -0
- package/src/lib/components/bookingCalendar/bookingCalendarGrid/classes.ts +9 -0
- package/src/lib/components/bookingCalendar/bookingCalendarItem/BookingCalendarItem.tsx +97 -0
- package/src/lib/components/bookingCalendar/bookingCalendarItem/classes.ts +7 -0
- package/src/lib/components/bookingCalendar/bookingCalendarItem/index.ts +2 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLane/BookingCalendarLane.tsx +69 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLane/classes.ts +7 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLane/index.ts +2 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLaneHeader/BookingCalendarLaneHeader.tsx +28 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLaneHeader/classes.ts +7 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLaneHeader/index.ts +1 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeader.tsx +57 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLanesHeader/BookingCalendarLanesHeaderRenderItem.tsx +53 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLanesHeader/classes.ts +9 -0
- package/src/lib/components/bookingCalendar/bookingCalendarLanesHeader/index.ts +2 -0
- package/src/lib/components/bookingCalendar/bookingCalendarRenderItem/BookingCalendarRenderItem.tsx +57 -0
- package/src/lib/components/bookingCalendar/bookingCalendarRenderItem/classes.ts +11 -0
- package/src/lib/components/bookingCalendar/bookingCalendarRenderItem/index.ts +1 -0
- package/src/lib/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.tsx +217 -0
- package/src/lib/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.tsx +53 -0
- package/src/lib/components/bookingCalendar/bookingCalendarTimeAxis/classes.ts +9 -0
- package/src/lib/components/bookingCalendar/classes.ts +21 -0
- package/src/lib/components/bookingCalendar/common.ts +61 -0
- package/src/lib/components/bookingCalendar/index.ts +3 -0
- package/src/lib/components/bookingCalendar/utils.ts +348 -0
- package/src/lib/components/button/Button.tsx +193 -0
- package/src/lib/components/button/index.tsx +2 -0
- package/src/lib/components/checkbox/Checkbox.tsx +178 -0
- package/src/lib/components/checkbox/index.tsx +2 -0
- package/src/lib/components/dropdown/Dropdown.tsx +135 -0
- package/src/lib/components/dropdown/index.tsx +2 -0
- package/src/lib/components/dynamicSubmit/DynamicSubmit.tsx +153 -0
- package/src/lib/components/dynamicSubmit/index.tsx +2 -0
- package/src/lib/components/externalValidationComponent/ExternalValidationComponent.tsx +78 -0
- package/src/lib/components/externalValidationComponent/index.tsx +2 -0
- package/src/lib/components/form/Form.tsx +276 -0
- package/src/lib/components/form/FormContext.ts +49 -0
- package/src/lib/components/form/FormValidationSummary.tsx +122 -0
- package/src/lib/components/form/index.tsx +5 -0
- package/src/lib/components/form/withFormContext.tsx +20 -0
- package/src/lib/components/inputGroup/InputGroup.tsx +60 -0
- package/src/lib/components/inputGroup/index.tsx +2 -0
- package/src/lib/components/inputHeader/InputHeader.tsx +448 -0
- package/src/lib/components/inputHeader/InputHeaderContext.ts +42 -0
- package/src/lib/components/inputHeader/index.tsx +2 -0
- package/src/lib/components/inputHeader/withInputHeaderContext.tsx +24 -0
- package/src/lib/components/money/Money.tsx +298 -0
- package/src/lib/components/money/index.tsx +2 -0
- package/src/lib/components/numberInput/NumberInput.tsx +186 -0
- package/src/lib/components/numberInput/index.tsx +2 -0
- package/src/lib/components/openingHours/openingHoursDay/OpeningHoursDay.tsx +394 -0
- package/src/lib/components/openingHours/openingHoursDay/index.tsx +2 -0
- package/src/lib/components/openingHours/openingHoursSpecial/OpeningHoursSpecial.tsx +227 -0
- package/src/lib/components/openingHours/openingHoursSpecial/index.tsx +2 -0
- package/src/lib/components/openingHours/openingHoursWeek/OpeningHoursWeek.tsx +283 -0
- package/src/lib/components/openingHours/openingHoursWeek/index.tsx +2 -0
- package/src/lib/components/openingHours/utils/OpeningHoursUtil.tsx +111 -0
- package/src/lib/components/radio/Radio.tsx +87 -0
- package/src/lib/components/radio/index.tsx +2 -0
- package/src/lib/components/radioContainer/RadioContainer.tsx +50 -0
- package/src/lib/components/radioContainer/index.tsx +2 -0
- package/src/lib/components/select/Select.tsx +335 -0
- package/src/lib/components/select/index.tsx +2 -0
- package/src/lib/components/submit/Submit.tsx +117 -0
- package/src/lib/components/submit/index.tsx +2 -0
- package/src/lib/components/submit/subComponents/SubmitValidationSummary.tsx +55 -0
- package/src/lib/components/tags/Tags.tsx +702 -0
- package/src/lib/components/tags/index.tsx +2 -0
- package/src/lib/components/tags/subComponents/TagsSuggestions.tsx +150 -0
- package/src/lib/components/text/Text.tsx +200 -0
- package/src/lib/components/text/index.tsx +2 -0
- package/src/lib/components/textArea/TextArea.tsx +109 -0
- package/src/lib/components/textArea/index.tsx +2 -0
- package/src/lib/components/themeProvider/ThemeContext.ts +16 -0
- package/src/lib/components/themeProvider/ThemeProvider.tsx +21 -0
- package/src/lib/components/themeProvider/index.tsx +4 -0
- package/src/lib/components/themeProvider/withThemeContext.tsx +30 -0
- package/src/lib/components/time/Time.tsx +296 -0
- package/src/lib/components/time/index.tsx +2 -0
- package/src/lib/components/timeSpan/TimeSpan.tsx +378 -0
- package/src/lib/components/timeSpan/index.tsx +2 -0
- package/src/lib/components/utils/Guid.ts +9 -0
- package/src/lib/components/utils/ShallowEqual.ts +75 -0
- package/src/lib/components/utils/TimeUtil.ts +22 -0
- package/src/lib/components/utils/Typescript.ts +11 -0
- package/src/lib/declarations/import.d.ts +1 -0
- package/src/lib/index.ts +24 -0
- package/src/lib/scss/components/base/index.scss +1 -0
- package/src/lib/scss/components/base/input/index.scss +1 -0
- package/src/lib/scss/components/base/input/input.scss +237 -0
- package/src/lib/scss/components/bookingCalendar/bookingCalendar.scss +272 -0
- package/src/lib/scss/components/bookingCalendar/index.scss +1 -0
- package/src/lib/scss/components/button/buttons.scss +161 -0
- package/src/lib/scss/components/button/index.scss +1 -0
- package/src/lib/scss/components/checkbox/checkbox.scss +115 -0
- package/src/lib/scss/components/checkbox/index.scss +1 -0
- package/src/lib/scss/components/dropdown/dropdown.scss +111 -0
- package/src/lib/scss/components/dropdown/index.scss +1 -0
- package/src/lib/scss/components/dynamicSubmit/dynamicSubmit.scss +1 -0
- package/src/lib/scss/components/dynamicSubmit/index.scss +1 -0
- package/src/lib/scss/components/form/form.scss +1 -0
- package/src/lib/scss/components/form/formValidationSummary.scss +55 -0
- package/src/lib/scss/components/form/index.scss +2 -0
- package/src/lib/scss/components/index.scss +21 -0
- package/src/lib/scss/components/inputGroup/index.scss +1 -0
- package/src/lib/scss/components/inputGroup/inputGroup.scss +67 -0
- package/src/lib/scss/components/inputHeader/index.scss +1 -0
- package/src/lib/scss/components/inputHeader/inputHeader.scss +132 -0
- package/src/lib/scss/components/money/index.scss +1 -0
- package/src/lib/scss/components/money/money.scss +51 -0
- package/src/lib/scss/components/numberInput/index.scss +1 -0
- package/src/lib/scss/components/numberInput/numberInput.scss +116 -0
- package/src/lib/scss/components/openingHours/index.scss +3 -0
- package/src/lib/scss/components/openingHours/openingHoursDay/index.scss +1 -0
- package/src/lib/scss/components/openingHours/openingHoursDay/openingHoursDay.scss +127 -0
- package/src/lib/scss/components/openingHours/openingHoursSpecial/index.scss +1 -0
- package/src/lib/scss/components/openingHours/openingHoursSpecial/openingHoursSpecial.scss +93 -0
- package/src/lib/scss/components/openingHours/openingHoursWeek/index.scss +1 -0
- package/src/lib/scss/components/openingHours/openingHoursWeek/openingHoursWeek.scss +23 -0
- package/src/lib/scss/components/radio/index.scss +1 -0
- package/src/lib/scss/components/radio/radio.scss +68 -0
- package/src/lib/scss/components/radioContainer/index.scss +1 -0
- package/src/lib/scss/components/radioContainer/radioContainer.scss +15 -0
- package/src/lib/scss/components/select/index.scss +1 -0
- package/src/lib/scss/components/select/select.scss +64 -0
- package/src/lib/scss/components/submit/index.scss +1 -0
- package/src/lib/scss/components/submit/submitValidationSummary.scss +35 -0
- package/src/lib/scss/components/tags/index.scss +1 -0
- package/src/lib/scss/components/tags/tags.scss +128 -0
- package/src/lib/scss/components/text/index.scss +1 -0
- package/src/lib/scss/components/text/text.scss +42 -0
- package/src/lib/scss/components/textArea/index.scss +1 -0
- package/src/lib/scss/components/textArea/textArea.scss +32 -0
- package/src/lib/scss/components/time/index.scss +1 -0
- package/src/lib/scss/components/time/time.scss +111 -0
- package/src/lib/scss/components/timeSpan/index.scss +1 -0
- package/src/lib/scss/components/timeSpan/timeSpan.scss +115 -0
- package/src/lib/scss/index.scss +8 -0
- package/src/lib/scss/styles/base.scss +7 -0
- package/src/lib/scss/styles/index.scss +2 -0
- package/src/lib/scss/styles/react-tippy.scss +4 -0
- package/src/lib/scss/variables/_buttons.scss +6 -0
- package/src/lib/scss/variables/_colors.scss +1 -0
- package/src/lib/scss/variables/_common.scss +12 -0
- package/src/lib/tsconfig.json +19 -0
- package/src/lib/types/ElementOverrideProp.ts +3 -0
- package/src/lib/types/Theme.ts +5 -0
- package/src/lib/types/ThemeOverrides.ts +46 -0
- package/src/lib/validators/EmailValidator.ts +15 -0
- package/src/lib/validators/LatitudeValidator.ts +25 -0
- package/src/lib/validators/LongitudeValidator.ts +25 -0
- package/src/lib/validators/NumberValidator.ts +50 -0
- package/src/lib/validators/UrlValidator.ts +20 -0
- package/src/lib/validators/base.ts +15 -0
- package/src/lib/validators/index.ts +6 -0
- package/src/stories/Basic.stories.ts +17 -0
- package/src/stories/Basic.tsx +1065 -0
- package/src/stories/Schedule.stories.ts +16 -0
- package/src/stories/Schedule.tsx +73 -0
- package/src/stories/ValidationPage.tsx +417 -0
- package/tsconfig.json +9 -22
- package/typedoc.json +6 -0
- package/webpack/webpack.config.base.js +139 -0
- package/webpack/webpack.config.dev.js +78 -0
- package/webpack/webpack.config.gh-pages.js +78 -0
- package/webpack/webpack.config.js +21 -0
- package/webpack/webpack.config.min.js +100 -0
- package/.vscode/launch.json +0 -15
- package/.vscode/settings.json +0 -27
- package/.vscode/tasks.json +0 -12
package/src/lib/components/bookingCalendar/bookingCalendarSelection/BookingCalendarSelection.tsx
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
|
3
|
+
export type BookingCalendarSelectionCoordinates = [number, number];
|
4
|
+
export interface BookingCalendarSelectionData {
|
5
|
+
origin: BookingCalendarSelectionCoordinates;
|
6
|
+
target: BookingCalendarSelectionCoordinates;
|
7
|
+
}
|
8
|
+
export interface BookingCalendarSelectionProps {
|
9
|
+
disabled?: boolean;
|
10
|
+
onSelecting?: (data: {
|
11
|
+
origin: BookingCalendarSelectionCoordinates;
|
12
|
+
target: BookingCalendarSelectionCoordinates;
|
13
|
+
}) => void;
|
14
|
+
onSelected?: (data: {
|
15
|
+
origin: BookingCalendarSelectionCoordinates;
|
16
|
+
target: BookingCalendarSelectionCoordinates;
|
17
|
+
}) => void;
|
18
|
+
dataRowsCount: number;
|
19
|
+
minSelectionSize: number;
|
20
|
+
children?: React.ReactNode;
|
21
|
+
}
|
22
|
+
|
23
|
+
export interface BookingCalendarSelectionState {
|
24
|
+
selectionBoxOrigin: BookingCalendarSelectionCoordinates;
|
25
|
+
selectionBoxTarget: BookingCalendarSelectionCoordinates;
|
26
|
+
hold: boolean;
|
27
|
+
animation: string;
|
28
|
+
selectionBox: boolean;
|
29
|
+
}
|
30
|
+
|
31
|
+
export default class BookingCalendarSelection extends React.Component<
|
32
|
+
BookingCalendarSelectionProps,
|
33
|
+
BookingCalendarSelectionState
|
34
|
+
> {
|
35
|
+
private animationInProgress: number;
|
36
|
+
private containerRef: React.RefObject<HTMLDivElement>;
|
37
|
+
|
38
|
+
constructor(props) {
|
39
|
+
super(props);
|
40
|
+
this.animationInProgress = null;
|
41
|
+
this.containerRef = React.createRef();
|
42
|
+
this.state = {
|
43
|
+
hold: false,
|
44
|
+
selectionBox: false,
|
45
|
+
selectionBoxOrigin: [0, 0],
|
46
|
+
selectionBoxTarget: [0, 0],
|
47
|
+
animation: '',
|
48
|
+
};
|
49
|
+
this.handleMouseUp = this.handleMouseUp.bind(this);
|
50
|
+
this.handleMouseDown = this.handleMouseDown.bind(this);
|
51
|
+
this.handleMouseMove = this.handleMouseMove.bind(this);
|
52
|
+
this.handleMouseLeave = this.handleMouseLeave.bind(this);
|
53
|
+
}
|
54
|
+
|
55
|
+
handleTransformBox() {
|
56
|
+
const { selectionBoxOrigin, selectionBoxTarget } = this.state;
|
57
|
+
if (
|
58
|
+
selectionBoxOrigin[1] > selectionBoxTarget[1] &&
|
59
|
+
selectionBoxOrigin[0] > selectionBoxTarget[0]
|
60
|
+
) {
|
61
|
+
return 'scaleY(-1) scaleX(-1)';
|
62
|
+
}
|
63
|
+
|
64
|
+
if (selectionBoxOrigin[1] > selectionBoxTarget[1]) {
|
65
|
+
return 'scaleY(-1)';
|
66
|
+
}
|
67
|
+
if (selectionBoxOrigin[0] > selectionBoxTarget[0]) {
|
68
|
+
return 'scaleX(-1)';
|
69
|
+
}
|
70
|
+
return null;
|
71
|
+
}
|
72
|
+
|
73
|
+
handleMouseLeave(evt: React.MouseEvent<HTMLElement>) {
|
74
|
+
/*if (this.state.hold) {
|
75
|
+
this.setState({
|
76
|
+
hold: false,
|
77
|
+
animation: 'bookingCalendar__selection--fadeout',
|
78
|
+
});
|
79
|
+
this.animationInProgress = (setTimeout(() => {
|
80
|
+
this.setState({
|
81
|
+
selectionBox: false,
|
82
|
+
animation: '',
|
83
|
+
selectionBoxOrigin: [0, 0],
|
84
|
+
selectionBoxTarget: [0, 0],
|
85
|
+
});
|
86
|
+
this.animationInProgress = null;
|
87
|
+
}, 300) as unknown) as number;
|
88
|
+
}*/
|
89
|
+
}
|
90
|
+
|
91
|
+
handleMouseUp(evt: React.MouseEvent<HTMLElement>) {
|
92
|
+
if (this.state.hold) {
|
93
|
+
const distance = Math.sqrt(
|
94
|
+
Math.pow(
|
95
|
+
this.state.selectionBoxTarget[1] - this.state.selectionBoxOrigin[1],
|
96
|
+
2
|
97
|
+
) +
|
98
|
+
Math.pow(
|
99
|
+
this.state.selectionBoxTarget[0] - this.state.selectionBoxOrigin[0],
|
100
|
+
2
|
101
|
+
)
|
102
|
+
);
|
103
|
+
this.setState({
|
104
|
+
hold: false,
|
105
|
+
animation: 'bookingCalendar__selection--fadeout',
|
106
|
+
});
|
107
|
+
this.animationInProgress = setTimeout(() => {
|
108
|
+
this.setState({
|
109
|
+
selectionBox: false,
|
110
|
+
animation: '',
|
111
|
+
selectionBoxOrigin: [0, 0],
|
112
|
+
selectionBoxTarget: [0, 0],
|
113
|
+
});
|
114
|
+
this.animationInProgress = null;
|
115
|
+
}, 300) as unknown as number;
|
116
|
+
if (distance < this.props.minSelectionSize) {
|
117
|
+
return;
|
118
|
+
}
|
119
|
+
this.props.onSelected?.({
|
120
|
+
origin: this.state.selectionBoxOrigin,
|
121
|
+
target: this.state.selectionBoxTarget,
|
122
|
+
});
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
handleMouseDown(e: React.MouseEvent<HTMLDivElement>) {
|
127
|
+
if (this.props.disabled || e.nativeEvent.button !== 0) {
|
128
|
+
return;
|
129
|
+
}
|
130
|
+
clearTimeout(this.animationInProgress);
|
131
|
+
this.animationInProgress = null;
|
132
|
+
this.setState({ selectionBox: false, animation: '' });
|
133
|
+
|
134
|
+
const bb = this.containerRef.current?.getBoundingClientRect();
|
135
|
+
this.setState({
|
136
|
+
hold: true,
|
137
|
+
selectionBoxOrigin: [
|
138
|
+
e.nativeEvent.pageX - bb.x,
|
139
|
+
e.nativeEvent.pageY - bb.y,
|
140
|
+
],
|
141
|
+
selectionBoxTarget: [
|
142
|
+
e.nativeEvent.pageX - bb.x,
|
143
|
+
e.nativeEvent.pageY - bb.y,
|
144
|
+
],
|
145
|
+
});
|
146
|
+
}
|
147
|
+
|
148
|
+
private handleMouseMove(evt: React.MouseEvent<HTMLDivElement>) {
|
149
|
+
if (this.state.hold && !this.state.selectionBox) {
|
150
|
+
this.setState({ selectionBox: true });
|
151
|
+
}
|
152
|
+
if (this.state.selectionBox && !this.animationInProgress) {
|
153
|
+
const bb = this.containerRef.current?.getBoundingClientRect();
|
154
|
+
this.setState({
|
155
|
+
selectionBoxTarget: [
|
156
|
+
evt.nativeEvent.pageX - bb?.x,
|
157
|
+
evt.nativeEvent.pageY - bb?.y,
|
158
|
+
],
|
159
|
+
});
|
160
|
+
|
161
|
+
this.props.onSelecting?.({
|
162
|
+
origin: this.state.selectionBoxOrigin,
|
163
|
+
target: this.state.selectionBoxTarget,
|
164
|
+
});
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
render() {
|
169
|
+
const baseStyle: React.CSSProperties = {
|
170
|
+
zIndex: 10,
|
171
|
+
left: this.state.selectionBoxOrigin[0],
|
172
|
+
top: this.state.selectionBoxOrigin[1],
|
173
|
+
height: Math.abs(
|
174
|
+
this.state.selectionBoxTarget[1] - this.state.selectionBoxOrigin[1] - 1
|
175
|
+
),
|
176
|
+
width: Math.abs(
|
177
|
+
this.state.selectionBoxTarget[0] - this.state.selectionBoxOrigin[0] - 1
|
178
|
+
),
|
179
|
+
userSelect: 'none',
|
180
|
+
transformOrigin: 'top left',
|
181
|
+
transform: this.handleTransformBox(),
|
182
|
+
};
|
183
|
+
const boxVisible =
|
184
|
+
Math.sqrt(
|
185
|
+
Math.pow(
|
186
|
+
this.state.selectionBoxTarget[1] - this.state.selectionBoxOrigin[1],
|
187
|
+
2
|
188
|
+
) +
|
189
|
+
Math.pow(
|
190
|
+
this.state.selectionBoxTarget[0] - this.state.selectionBoxOrigin[0],
|
191
|
+
2
|
192
|
+
)
|
193
|
+
) > this.props.minSelectionSize;
|
194
|
+
return (
|
195
|
+
<div
|
196
|
+
ref={this.containerRef}
|
197
|
+
className="bookingCalendar__selection__container"
|
198
|
+
style={{
|
199
|
+
zIndex: this.state.selectionBox ? 99999 : undefined,
|
200
|
+
gridRowEnd: `span ${this.props.dataRowsCount}`,
|
201
|
+
}}
|
202
|
+
onMouseDown={this.handleMouseDown}
|
203
|
+
onMouseUp={this.handleMouseUp}
|
204
|
+
onMouseMove={this.handleMouseMove}
|
205
|
+
onMouseLeave={this.handleMouseLeave}
|
206
|
+
>
|
207
|
+
{boxVisible && this.state.selectionBox && (
|
208
|
+
<div
|
209
|
+
className={`bookingCalendar__selection ${this.state.animation}`}
|
210
|
+
style={baseStyle}
|
211
|
+
/>
|
212
|
+
)}
|
213
|
+
{this.props.children}
|
214
|
+
</div>
|
215
|
+
);
|
216
|
+
}
|
217
|
+
}
|
package/src/lib/components/bookingCalendar/bookingCalendarTimeAxis/BookingCalendarTimeAxis.tsx
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import {
|
3
|
+
BookingCalendarTimeAxisClasses,
|
4
|
+
bookingCalendarTimeAxisDefaultClasses,
|
5
|
+
} from './classes';
|
6
|
+
import classNames from 'classnames';
|
7
|
+
import { GridItem } from '../utils';
|
8
|
+
import { Duration } from 'moment';
|
9
|
+
import { GetMomentFormatFunctionType } from '..';
|
10
|
+
|
11
|
+
export interface BookingCalendarTimeAxisProps
|
12
|
+
extends BookingCalendarTimeAxisClasses {
|
13
|
+
items: GridItem[];
|
14
|
+
bestStep: Duration;
|
15
|
+
getMomentFormatFunction: GetMomentFormatFunctionType;
|
16
|
+
}
|
17
|
+
|
18
|
+
export function BookingCalendarTimeAxis(props: BookingCalendarTimeAxisProps) {
|
19
|
+
const {
|
20
|
+
className,
|
21
|
+
timeAxisItemClassName,
|
22
|
+
items,
|
23
|
+
getMomentFormatFunction,
|
24
|
+
bestStep,
|
25
|
+
} = props;
|
26
|
+
const svgRef = React.useRef<SVGSVGElement>();
|
27
|
+
return (
|
28
|
+
<svg
|
29
|
+
className={classNames(
|
30
|
+
bookingCalendarTimeAxisDefaultClasses.className,
|
31
|
+
className
|
32
|
+
)}
|
33
|
+
ref={svgRef}
|
34
|
+
height="100"
|
35
|
+
>
|
36
|
+
<g>
|
37
|
+
{items.map((item, key) => (
|
38
|
+
<svg key={key} x={`${item.left * 100}%`}>
|
39
|
+
<text
|
40
|
+
transform="translate(-7) rotate(90)"
|
41
|
+
className={classNames(
|
42
|
+
bookingCalendarTimeAxisDefaultClasses.timeAxisItemClassName,
|
43
|
+
timeAxisItemClassName
|
44
|
+
)}
|
45
|
+
>
|
46
|
+
{item.date.format(getMomentFormatFunction?.(item.date, bestStep))}
|
47
|
+
</text>
|
48
|
+
</svg>
|
49
|
+
))}
|
50
|
+
</g>
|
51
|
+
</svg>
|
52
|
+
);
|
53
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export interface BookingCalendarTimeAxisClasses {
|
2
|
+
className?: string;
|
3
|
+
timeAxisItemClassName?: string;
|
4
|
+
}
|
5
|
+
|
6
|
+
export const bookingCalendarTimeAxisDefaultClasses: BookingCalendarTimeAxisClasses = {
|
7
|
+
className: 'bookingCalendar__timeAxis',
|
8
|
+
timeAxisItemClassName: 'bookingCalendar__timeAxis__item',
|
9
|
+
};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { BookingCalendarControlsClasses } from './bookingCalendarControls/classes';
|
2
|
+
|
3
|
+
export interface BookingCalendarClasses {
|
4
|
+
className?: string;
|
5
|
+
laneContainerClassName?: string;
|
6
|
+
laneHeaderContainerClassName?: string;
|
7
|
+
lanesHeaderHeaderContainerClassName?: string;
|
8
|
+
lanesHeaderContainerClassName?: string;
|
9
|
+
tableClassName?: string;
|
10
|
+
controlsClasses?: BookingCalendarControlsClasses;
|
11
|
+
}
|
12
|
+
|
13
|
+
export const bookingCalendarDefaultClasses: BookingCalendarClasses = {
|
14
|
+
className: 'bookingCalendar',
|
15
|
+
laneContainerClassName: 'bookingCalendar__laneContainer',
|
16
|
+
laneHeaderContainerClassName: 'bookingCalendar__laneHeaderContainer',
|
17
|
+
lanesHeaderContainerClassName: 'bookingCalendar__lanesHeaderContainer',
|
18
|
+
lanesHeaderHeaderContainerClassName:
|
19
|
+
'bookingCalendar__lanesHeaderHeaderContainer',
|
20
|
+
tableClassName: 'bookingCalendar__table',
|
21
|
+
};
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import moment, { Moment, Duration } from 'moment';
|
2
|
+
|
3
|
+
export interface BookingCalendarItemT {
|
4
|
+
from: Moment;
|
5
|
+
till: Moment;
|
6
|
+
/*
|
7
|
+
Optional index that identifies the lane
|
8
|
+
*/
|
9
|
+
laneKey?: string | number;
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface BookingCalendarItemWithOriginalIndexT {
|
13
|
+
originalIndex: number;
|
14
|
+
}
|
15
|
+
|
16
|
+
export interface BookingCalendarDateRange {
|
17
|
+
from: Moment;
|
18
|
+
till: Moment;
|
19
|
+
}
|
20
|
+
|
21
|
+
export interface ZoomLevel {
|
22
|
+
step: Duration;
|
23
|
+
label: React.ReactNode;
|
24
|
+
}
|
25
|
+
|
26
|
+
export const defaultGetMomentFormatFunction = (
|
27
|
+
date: Moment,
|
28
|
+
bestStep: Duration
|
29
|
+
) => {
|
30
|
+
if (!date || !bestStep) {
|
31
|
+
return undefined;
|
32
|
+
}
|
33
|
+
if (date.valueOf() === date.clone().startOf('day').valueOf()) {
|
34
|
+
return 'MMM Do';
|
35
|
+
}
|
36
|
+
return 'h:mm a';
|
37
|
+
};
|
38
|
+
|
39
|
+
export type GetMomentFormatFunctionType = typeof defaultGetMomentFormatFunction;
|
40
|
+
|
41
|
+
export const defaultGetNewMomentFunction = (date: Date) => {
|
42
|
+
return moment(date);
|
43
|
+
};
|
44
|
+
|
45
|
+
export type GetNewMomentFunctionType = typeof defaultGetNewMomentFunction;
|
46
|
+
|
47
|
+
export const defaultGridAvailableSteps: Duration[] = [
|
48
|
+
moment.duration(1, 'minute'),
|
49
|
+
moment.duration(5, 'minute'),
|
50
|
+
moment.duration(10, 'minute'),
|
51
|
+
moment.duration(15, 'minute'),
|
52
|
+
moment.duration(20, 'minute'),
|
53
|
+
moment.duration(30, 'minute'),
|
54
|
+
moment.duration(1, 'hour'),
|
55
|
+
moment.duration(2, 'hour'),
|
56
|
+
moment.duration(4, 'hour'),
|
57
|
+
moment.duration(6, 'hour'),
|
58
|
+
moment.duration(8, 'hour'),
|
59
|
+
moment.duration(12, 'hour'),
|
60
|
+
moment.duration(1, 'day'),
|
61
|
+
];
|