guestbell-forms 3.0.39 → 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 +152 -170
- 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/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
@@ -0,0 +1,128 @@
|
|
1
|
+
.tags-input {
|
2
|
+
display: inline-block;
|
3
|
+
margin-top: 20px;
|
4
|
+
max-width: 37.5rem;
|
5
|
+
/*align-items: center;
|
6
|
+
display: flex;
|
7
|
+
min-height: 2.25rem;*/
|
8
|
+
.tags-input__text-input {
|
9
|
+
margin: 0;
|
10
|
+
padding-right: 0;
|
11
|
+
border-bottom: none;
|
12
|
+
}
|
13
|
+
.tags-input__tag {
|
14
|
+
position: relative;
|
15
|
+
display: inline-flex;
|
16
|
+
align-items: center;
|
17
|
+
padding-left: 0.25rem;
|
18
|
+
margin-right: 0.25rem;
|
19
|
+
margin-bottom: 0.125rem;
|
20
|
+
margin-top: 0.125rem;
|
21
|
+
&.tags-input__tag-chip {
|
22
|
+
border: 1px solid;
|
23
|
+
border-radius: 1.5rem;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
.tags-input__tags__wrapper {
|
27
|
+
display: flex;
|
28
|
+
align-items: center;
|
29
|
+
}
|
30
|
+
.tags-input__tag__wrapper {
|
31
|
+
display: inline-flex;
|
32
|
+
flex-wrap: wrap;
|
33
|
+
padding-top: 0.25rem;
|
34
|
+
padding-bottom: 0.125rem;
|
35
|
+
}
|
36
|
+
&.tags-input--readOnly {
|
37
|
+
border-bottom-color: transparent !important;
|
38
|
+
input:focus ~ .bar:before,
|
39
|
+
input:focus ~ .bar:after,
|
40
|
+
select:focus ~ .bar:before,
|
41
|
+
select:focus ~ .bar:after,
|
42
|
+
label:focus ~ .bar:before,
|
43
|
+
label:focus ~ .bar:after,
|
44
|
+
.bar.focused:before,
|
45
|
+
.bar.focused:after {
|
46
|
+
width: initial;
|
47
|
+
}
|
48
|
+
input:focus ~ .highlight,
|
49
|
+
select:focus ~ .highlight {
|
50
|
+
animation: none;
|
51
|
+
}
|
52
|
+
.tags-input__tag__wrapper {
|
53
|
+
min-height: 34px;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
&.input__base label,
|
57
|
+
&.input__base span.label-classname {
|
58
|
+
top: calc(100% - 32px);
|
59
|
+
}
|
60
|
+
&.input__base {
|
61
|
+
label.label--focused,
|
62
|
+
&.tags-input--hasPlaceholder label {
|
63
|
+
top: -1rem;
|
64
|
+
font-size: 14px;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
&.tags-input--mobile {
|
68
|
+
z-index: 9999;
|
69
|
+
position: fixed;
|
70
|
+
top: 0;
|
71
|
+
left: 0.5rem;
|
72
|
+
right: 0.5rem;
|
73
|
+
width: calc(100vw - 1rem);
|
74
|
+
margin-bottom: 1rem;
|
75
|
+
margin-top: 1.25rem;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
.tags-input__leaveMobileTagsButton {
|
80
|
+
padding-right: 0;
|
81
|
+
}
|
82
|
+
|
83
|
+
.tags-input__mobileBackdrop {
|
84
|
+
position: fixed;
|
85
|
+
top: 0;
|
86
|
+
bottom: 0;
|
87
|
+
right: 0;
|
88
|
+
left: 0;
|
89
|
+
background-color: $input-bg-color;
|
90
|
+
}
|
91
|
+
|
92
|
+
.tags-input__suggestions {
|
93
|
+
/*position: absolute;
|
94
|
+
top: 100%;
|
95
|
+
left: 0;
|
96
|
+
right: 0;*/
|
97
|
+
background-color: white;
|
98
|
+
box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.06), 0 2px 5px 0 rgba(0, 0, 0, 0.16);
|
99
|
+
z-index: 999;
|
100
|
+
.tags-input__suggestion {
|
101
|
+
text-transform: initial;
|
102
|
+
&.tags-input__suggestion--preselected {
|
103
|
+
background-color: $input-border-color;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
> ul {
|
107
|
+
padding: 0;
|
108
|
+
margin: 0;
|
109
|
+
> li {
|
110
|
+
list-style: none;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
.tags-input__suggestions__defaultLoading {
|
114
|
+
position: absolute;
|
115
|
+
top: -3px;
|
116
|
+
left: 0;
|
117
|
+
right: 0;
|
118
|
+
height: 2px;
|
119
|
+
}
|
120
|
+
/*&.tags-input__suggestions--loading::after {
|
121
|
+
content: '';
|
122
|
+
position: absolute;
|
123
|
+
top: 0;
|
124
|
+
left: 0;
|
125
|
+
right: 0;
|
126
|
+
height: 2px;
|
127
|
+
}*/
|
128
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import './text.scss';
|
@@ -0,0 +1,42 @@
|
|
1
|
+
.text-input {
|
2
|
+
display: inline-block;
|
3
|
+
max-width: 37.5rem;
|
4
|
+
&.text-input--readOnly {
|
5
|
+
border-bottom-color: transparent !important;
|
6
|
+
input:focus ~ .bar:before,
|
7
|
+
input:focus ~ .bar:after,
|
8
|
+
select:focus ~ .bar:before,
|
9
|
+
select:focus ~ .bar:after,
|
10
|
+
label:focus ~ .bar:before,
|
11
|
+
label:focus ~ .bar:after,
|
12
|
+
.bar.focused:before,
|
13
|
+
.bar.focused:after {
|
14
|
+
width: initial;
|
15
|
+
}
|
16
|
+
input:focus ~ .highlight,
|
17
|
+
select:focus ~ .highlight {
|
18
|
+
animation: none;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
.text-input__textWrapper {
|
22
|
+
width: 100%;
|
23
|
+
display: flex;
|
24
|
+
flex-direction: row;
|
25
|
+
}
|
26
|
+
input {
|
27
|
+
padding: 5px;
|
28
|
+
color: inherit;
|
29
|
+
outline: 0;
|
30
|
+
border: none;
|
31
|
+
flex: 1;
|
32
|
+
background-color: transparent;
|
33
|
+
text-overflow: ellipsis;
|
34
|
+
}
|
35
|
+
.text-input__clearButton {
|
36
|
+
padding-left: 0;
|
37
|
+
}
|
38
|
+
.text-input__clearButton--hidden {
|
39
|
+
opacity: 0;
|
40
|
+
pointer-events: none;
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import './textArea.scss';
|
@@ -0,0 +1,32 @@
|
|
1
|
+
.textArea-input {
|
2
|
+
max-width: 37.5rem;
|
3
|
+
&.textArea-input--readOnly {
|
4
|
+
border-bottom-color: transparent !important;
|
5
|
+
input:focus ~ .bar:before,
|
6
|
+
input:focus ~ .bar:after,
|
7
|
+
textarea:focus ~ .bar:before,
|
8
|
+
textarea:focus ~ .bar:after,
|
9
|
+
select:focus ~ .bar:before,
|
10
|
+
select:focus ~ .bar:after,
|
11
|
+
label:focus ~ .bar:before,
|
12
|
+
label:focus ~ .bar:after,
|
13
|
+
.bar.focused:before,
|
14
|
+
.bar.focused:after {
|
15
|
+
width: initial;
|
16
|
+
}
|
17
|
+
textarea:focus ~ .highlight,
|
18
|
+
select:focus ~ .highlight {
|
19
|
+
animation: none;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
textarea {
|
23
|
+
padding: 6px 10px 5px 5px;
|
24
|
+
color: $input-text-color;
|
25
|
+
outline: 0;
|
26
|
+
border: none;
|
27
|
+
width: 100%;
|
28
|
+
background-color: transparent;
|
29
|
+
text-overflow: ellipsis;
|
30
|
+
display: block;
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import './time.scss';
|
@@ -0,0 +1,111 @@
|
|
1
|
+
.time-input {
|
2
|
+
padding-top: 0.5rem;
|
3
|
+
padding-bottom: 0.5rem;
|
4
|
+
max-width: 37.5rem;
|
5
|
+
> div,
|
6
|
+
> span {
|
7
|
+
display: inline-block;
|
8
|
+
position: relative;
|
9
|
+
align-self: baseline;
|
10
|
+
}
|
11
|
+
display: inline-flex !important;
|
12
|
+
align-items: center;
|
13
|
+
// justify-content: center;
|
14
|
+
// border-bottom: none !important;
|
15
|
+
// width: initial !important;
|
16
|
+
.input-padding {
|
17
|
+
margin: 10px 5px 10px 5px;
|
18
|
+
position: relative;
|
19
|
+
}
|
20
|
+
input {
|
21
|
+
padding: 0;
|
22
|
+
color: $input-text-color;
|
23
|
+
outline: 0;
|
24
|
+
border: none;
|
25
|
+
width: 100%;
|
26
|
+
text-align: center;
|
27
|
+
border: 1px solid $input-border-color;
|
28
|
+
height: 26px;
|
29
|
+
line-height: 0;
|
30
|
+
background-color: transparent;
|
31
|
+
}
|
32
|
+
.highlight {
|
33
|
+
position: absolute;
|
34
|
+
left: 3px;
|
35
|
+
right: 3px;
|
36
|
+
top: 3px;
|
37
|
+
bottom: 3px;
|
38
|
+
width: initial;
|
39
|
+
height: initial;
|
40
|
+
pointer-events: none;
|
41
|
+
opacity: 0.5;
|
42
|
+
}
|
43
|
+
input[type='number'] {
|
44
|
+
-webkit-appearance: textfield;
|
45
|
+
-moz-appearance: textfield;
|
46
|
+
appearance: textfield;
|
47
|
+
}
|
48
|
+
input[type='number']::-webkit-inner-spin-button,
|
49
|
+
input[type='number']::-webkit-outer-spin-button {
|
50
|
+
-webkit-appearance: none;
|
51
|
+
}
|
52
|
+
.time-input__arrows__container {
|
53
|
+
position: relative;
|
54
|
+
display: inline-block;
|
55
|
+
}
|
56
|
+
input:focus ~ label,
|
57
|
+
input.filled ~ label,
|
58
|
+
select:focus ~ label,
|
59
|
+
select.filled ~ label,
|
60
|
+
label.label--focused {
|
61
|
+
top: -17px;
|
62
|
+
font-size: 14px;
|
63
|
+
color: $primary-color;
|
64
|
+
}
|
65
|
+
button {
|
66
|
+
&.plus {
|
67
|
+
top: -12px;
|
68
|
+
svg {
|
69
|
+
transform: rotate(180deg);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
&.minus {
|
73
|
+
bottom: -12px;
|
74
|
+
}
|
75
|
+
padding: 0 5px;
|
76
|
+
line-height: 0;
|
77
|
+
overflow: hidden;
|
78
|
+
border: none;
|
79
|
+
background: transparent;
|
80
|
+
position: absolute;
|
81
|
+
left: 1px;
|
82
|
+
/* Styling the down arrow */
|
83
|
+
border: none;
|
84
|
+
cursor: pointer;
|
85
|
+
&:focus {
|
86
|
+
outline: 0;
|
87
|
+
}
|
88
|
+
&:focus-visible {
|
89
|
+
outline: 1px dotted;
|
90
|
+
outline: 5px auto -webkit-focus-ring-color;
|
91
|
+
}
|
92
|
+
svg {
|
93
|
+
transition: 0.2s all;
|
94
|
+
fill: $input-label-color;
|
95
|
+
}
|
96
|
+
&:hover,
|
97
|
+
&:active,
|
98
|
+
&:focus {
|
99
|
+
svg {
|
100
|
+
fill: $primary-color;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
.time-input__time {
|
105
|
+
width: 26px;
|
106
|
+
display: inline-block;
|
107
|
+
}
|
108
|
+
.time-input__am-pm {
|
109
|
+
color: $input-label-color;
|
110
|
+
}
|
111
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
@import './timeSpan.scss';
|
@@ -0,0 +1,115 @@
|
|
1
|
+
.timeSpan-input {
|
2
|
+
padding-top: 0.5rem;
|
3
|
+
padding-bottom: 0.5rem;
|
4
|
+
max-width: 37.5rem;
|
5
|
+
> div,
|
6
|
+
> span {
|
7
|
+
display: inline-block;
|
8
|
+
position: relative;
|
9
|
+
align-self: baseline;
|
10
|
+
}
|
11
|
+
display: inline-flex !important;
|
12
|
+
align-items: center;
|
13
|
+
// border-bottom: none !important;
|
14
|
+
// width: initial !important;
|
15
|
+
.input-padding {
|
16
|
+
margin: 10px 5px 10px 5px;
|
17
|
+
position: relative;
|
18
|
+
}
|
19
|
+
input {
|
20
|
+
padding: 0;
|
21
|
+
color: $input-text-color;
|
22
|
+
outline: 0;
|
23
|
+
border: none;
|
24
|
+
width: 100%;
|
25
|
+
text-align: center;
|
26
|
+
border: 1px solid $input-border-color;
|
27
|
+
height: 26px;
|
28
|
+
line-height: 0;
|
29
|
+
background-color: transparent;
|
30
|
+
}
|
31
|
+
.highlight {
|
32
|
+
position: absolute;
|
33
|
+
left: 3px;
|
34
|
+
right: 3px;
|
35
|
+
top: 3px;
|
36
|
+
bottom: 3px;
|
37
|
+
width: initial;
|
38
|
+
height: initial;
|
39
|
+
pointer-events: none;
|
40
|
+
opacity: 0.5;
|
41
|
+
}
|
42
|
+
input[type='number'] {
|
43
|
+
-webkit-appearance: textfield;
|
44
|
+
-moz-appearance: textfield;
|
45
|
+
appearance: textfield;
|
46
|
+
}
|
47
|
+
input[type='number']::-webkit-inner-spin-button,
|
48
|
+
input[type='number']::-webkit-outer-spin-button {
|
49
|
+
-webkit-appearance: none;
|
50
|
+
}
|
51
|
+
.timeSpan-input__arrows__container {
|
52
|
+
position: relative;
|
53
|
+
display: inline-block;
|
54
|
+
}
|
55
|
+
input:focus ~ label,
|
56
|
+
input.filled ~ label,
|
57
|
+
select:focus ~ label,
|
58
|
+
select.filled ~ label,
|
59
|
+
label.label--focused {
|
60
|
+
top: -17px;
|
61
|
+
font-size: 14px;
|
62
|
+
color: $primary-color;
|
63
|
+
}
|
64
|
+
button {
|
65
|
+
&.plus {
|
66
|
+
top: -12px;
|
67
|
+
svg {
|
68
|
+
transform: rotate(180deg);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
&.minus {
|
72
|
+
bottom: -12px;
|
73
|
+
}
|
74
|
+
padding: 0 5px;
|
75
|
+
line-height: 0;
|
76
|
+
overflow: hidden;
|
77
|
+
border: none;
|
78
|
+
background: transparent;
|
79
|
+
position: absolute;
|
80
|
+
left: 50%;
|
81
|
+
transform: translateX(-50%);
|
82
|
+
/* Styling the down arrow */
|
83
|
+
border: none;
|
84
|
+
cursor: pointer;
|
85
|
+
&:focus {
|
86
|
+
outline: 0;
|
87
|
+
}
|
88
|
+
&:focus-visible {
|
89
|
+
outline: 1px dotted;
|
90
|
+
outline: 5px auto -webkit-focus-ring-color;
|
91
|
+
}
|
92
|
+
svg {
|
93
|
+
transition: 0.2s all;
|
94
|
+
fill: $input-label-color;
|
95
|
+
}
|
96
|
+
&:hover,
|
97
|
+
&:active,
|
98
|
+
&:focus {
|
99
|
+
svg {
|
100
|
+
fill: $primary-color;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
.timeSpan-input__time {
|
105
|
+
width: 26px;
|
106
|
+
display: inline-block;
|
107
|
+
}
|
108
|
+
.timeSpan-input__time--ms {
|
109
|
+
width: 40px;
|
110
|
+
display: inline-block;
|
111
|
+
}
|
112
|
+
.timeSpan-input__am-pm {
|
113
|
+
color: $input-label-color;
|
114
|
+
}
|
115
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
$primary-color: #10bdc7;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
$input-bg-color: white;
|
2
|
+
$input-divider-color: lighten(#000, 97.5%);
|
3
|
+
$input-border-color: lighten(#000, 93.5%);
|
4
|
+
$input-label-color: lighten(#000, 60%);
|
5
|
+
$input-text-color: lighten(#000, 33.5%);
|
6
|
+
$input-text-color--white: white;
|
7
|
+
$link-color: $primary-color;
|
8
|
+
$hover-color: rgba(black, 0.01);
|
9
|
+
$input-validation-color: #ff5d5d;
|
10
|
+
$input-validation-fontsize: 12px;
|
11
|
+
$input-validation-error-bar-color: #ff5d5d;
|
12
|
+
$input-validation-error-border-color: #ffbbbb;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"outDir": "../../build",
|
4
|
+
"moduleResolution": "node",
|
5
|
+
"target": "es5",
|
6
|
+
"module": "esnext",
|
7
|
+
"jsx": "react",
|
8
|
+
"allowSyntheticDefaultImports": true,
|
9
|
+
"experimentalDecorators": true,
|
10
|
+
"sourceMap": true,
|
11
|
+
"skipLibCheck": true,
|
12
|
+
"skipDefaultLibCheck": true,
|
13
|
+
"noUnusedLocals": true,
|
14
|
+
"declaration": true,
|
15
|
+
"lib": ["es7", "dom"],
|
16
|
+
"types": ["node"]
|
17
|
+
},
|
18
|
+
"exclude": ["bin", "node_modules"]
|
19
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { TextProps } from '../components/text';
|
2
|
+
import { ElementOverrideProp } from './ElementOverrideProp';
|
3
|
+
import { ButtonProps } from '../components/button';
|
4
|
+
import { CheckboxProps } from '../components/checkbox';
|
5
|
+
import { DropdownProps } from '../components/dropdown';
|
6
|
+
import { DynamicSubmitProps } from '../components/dynamicSubmit';
|
7
|
+
import { FormProps } from '../components/form';
|
8
|
+
import { InputGroupProps } from '../components/inputGroup';
|
9
|
+
import { InputHeaderProps } from '../components/inputHeader';
|
10
|
+
import { MoneyProps } from '../components/money';
|
11
|
+
import { NumberInputProps } from '../components/numberInput';
|
12
|
+
import { RadioContainerProps } from '../components/radioContainer';
|
13
|
+
import { OpeningHoursDayProps } from '../components/openingHours/openingHoursDay';
|
14
|
+
import { OpeningHoursWeekProps } from '../components/openingHours/openingHoursWeek';
|
15
|
+
import { OpeningHoursSpecialProps } from '../components/openingHours/openingHoursSpecial';
|
16
|
+
import { SubmitProps } from '../components/submit';
|
17
|
+
import { TagsProps } from '../components/tags';
|
18
|
+
import { TextAreaProps } from '../components/textArea';
|
19
|
+
import { TimeProps } from '../components/time';
|
20
|
+
import { TimeSpanProps } from '../components/timeSpan';
|
21
|
+
import { RadioProps } from '../components/radio';
|
22
|
+
import { SelectProps } from '../components/select';
|
23
|
+
|
24
|
+
export type ThemeOverrides = {
|
25
|
+
button?: ElementOverrideProp<ButtonProps>;
|
26
|
+
checkbox?: ElementOverrideProp<CheckboxProps>;
|
27
|
+
dropdown?: ElementOverrideProp<DropdownProps>;
|
28
|
+
dynamicSubmit?: ElementOverrideProp<DynamicSubmitProps>;
|
29
|
+
form?: ElementOverrideProp<FormProps>;
|
30
|
+
inputGroup?: ElementOverrideProp<InputGroupProps>;
|
31
|
+
inputHeader?: ElementOverrideProp<InputHeaderProps>;
|
32
|
+
money?: ElementOverrideProp<MoneyProps>;
|
33
|
+
numberInput?: ElementOverrideProp<NumberInputProps>;
|
34
|
+
radio?: ElementOverrideProp<RadioProps>;
|
35
|
+
radioContainer?: ElementOverrideProp<RadioContainerProps>;
|
36
|
+
openingHoursDay?: ElementOverrideProp<OpeningHoursDayProps>;
|
37
|
+
openingHoursWeek?: ElementOverrideProp<OpeningHoursWeekProps>;
|
38
|
+
openingHoursSpecial?: ElementOverrideProp<OpeningHoursSpecialProps>;
|
39
|
+
select?: ElementOverrideProp<SelectProps>;
|
40
|
+
submit?: ElementOverrideProp<SubmitProps>;
|
41
|
+
tags?: ElementOverrideProp<TagsProps>;
|
42
|
+
text?: ElementOverrideProp<TextProps>;
|
43
|
+
textArea?: ElementOverrideProp<TextAreaProps>;
|
44
|
+
time?: ElementOverrideProp<TimeProps>;
|
45
|
+
timeSpan?: ElementOverrideProp<TimeSpanProps>;
|
46
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { IBaseValidator } from './base';
|
2
|
+
|
3
|
+
export class EmailValidator implements IBaseValidator {
|
4
|
+
public Validate(
|
5
|
+
value: string,
|
6
|
+
isRequired: boolean,
|
7
|
+
addError: (error: string) => void
|
8
|
+
): boolean {
|
9
|
+
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value)) {
|
10
|
+
return true;
|
11
|
+
}
|
12
|
+
addError('Invalid email');
|
13
|
+
return false;
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { IBaseValidator } from './base';
|
2
|
+
import { NumberValidator } from './NumberValidator';
|
3
|
+
|
4
|
+
export class LatitudeValidator implements IBaseValidator {
|
5
|
+
public Validate(
|
6
|
+
value: string,
|
7
|
+
isRequired: boolean,
|
8
|
+
addError: (error: string) => void
|
9
|
+
): boolean {
|
10
|
+
let validNumber = new NumberValidator().Validate(
|
11
|
+
value,
|
12
|
+
isRequired,
|
13
|
+
addError
|
14
|
+
);
|
15
|
+
if (validNumber) {
|
16
|
+
let num = Number(value);
|
17
|
+
if (-90 > num || num > 90) {
|
18
|
+
addError('Invalid latitude');
|
19
|
+
return false;
|
20
|
+
}
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
return false;
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { IBaseValidator } from './base';
|
2
|
+
import { NumberValidator } from './NumberValidator';
|
3
|
+
|
4
|
+
export class LongitudeValidator implements IBaseValidator {
|
5
|
+
public Validate(
|
6
|
+
value: string,
|
7
|
+
isRequired: boolean,
|
8
|
+
addError: (error: string) => void
|
9
|
+
): boolean {
|
10
|
+
let validNumber = new NumberValidator().Validate(
|
11
|
+
value,
|
12
|
+
isRequired,
|
13
|
+
addError
|
14
|
+
);
|
15
|
+
if (validNumber) {
|
16
|
+
let num = Number(value);
|
17
|
+
if (-180 > num || num > 180) {
|
18
|
+
addError('Invalid longitude');
|
19
|
+
return false;
|
20
|
+
}
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
return false;
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import { IBaseValidator } from './base';
|
2
|
+
export interface NumberValidatorConfig {
|
3
|
+
min?: number;
|
4
|
+
max?: number;
|
5
|
+
minInclusive?: number;
|
6
|
+
maxInclusive?: number;
|
7
|
+
}
|
8
|
+
|
9
|
+
export class NumberValidator implements IBaseValidator {
|
10
|
+
private config: NumberValidatorConfig;
|
11
|
+
constructor(
|
12
|
+
config: NumberValidatorConfig = { min: undefined, max: undefined }
|
13
|
+
) {
|
14
|
+
this.config = config;
|
15
|
+
}
|
16
|
+
public Validate(
|
17
|
+
value: string,
|
18
|
+
isRequired: boolean,
|
19
|
+
addError: (error: string) => void
|
20
|
+
): boolean {
|
21
|
+
let num = Number(value);
|
22
|
+
if (!isNaN(num)) {
|
23
|
+
if (this.config.min !== undefined && num <= this.config.min) {
|
24
|
+
addError('Min: ' + this.config.min);
|
25
|
+
return false;
|
26
|
+
}
|
27
|
+
if (this.config.max !== undefined && num >= this.config.max) {
|
28
|
+
addError('Max: ' + (this.config.max - 1));
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
if (
|
32
|
+
this.config.minInclusive !== undefined &&
|
33
|
+
num < this.config.minInclusive
|
34
|
+
) {
|
35
|
+
addError('Min: ' + this.config.minInclusive);
|
36
|
+
return false;
|
37
|
+
}
|
38
|
+
if (
|
39
|
+
this.config.maxInclusive !== undefined &&
|
40
|
+
num >= this.config.maxInclusive
|
41
|
+
) {
|
42
|
+
addError('Max: ' + (this.config.maxInclusive - 1));
|
43
|
+
return false;
|
44
|
+
}
|
45
|
+
return true;
|
46
|
+
}
|
47
|
+
addError('Invalid number');
|
48
|
+
return false;
|
49
|
+
}
|
50
|
+
}
|