x25 17.7.0 → 17.7.2
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/index.d.ts +7 -1
- package/package.json +3 -3
- package/utility/normalize.test.d.ts +1 -0
- package/utility/normalize.test.js +40 -0
- package/utility/normalize.test.js.map +1 -0
- package/utility/strings.test.d.ts +1 -0
- package/utility/strings.test.js +104 -0
- package/utility/strings.test.js.map +1 -0
- package/utility/validation/validate/email.test.d.ts +1 -0
- package/utility/validation/validate/email.test.js +24 -0
- package/utility/validation/validate/email.test.js.map +1 -0
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -350
- package/.vscode/settings.json +0 -61
- package/conf/dev.js +0 -19
- package/conf/dist.js +0 -19
- package/conf/polyfills/tempPolyfills.js +0 -7
- package/cspell.json +0 -18
- package/dist/index.d.ts +0 -7
- package/dist/package.json +0 -137
- package/script/check.js +0 -15
- package/src/Account/Load.tsx +0 -61
- package/src/Account/actions.ts +0 -45
- package/src/Account/index.ts +0 -4
- package/src/Account/reducer.ts +0 -103
- package/src/Async/InitModule.tsx +0 -44
- package/src/Async/RouteLoading.tsx +0 -79
- package/src/Async/SimulatedException.ts +0 -15
- package/src/Async/helpers.ts +0 -58
- package/src/Async/index.tsx +0 -72
- package/src/Async/types.ts +0 -39
- package/src/Async/util.ts +0 -110
- package/src/Developer/JSONSyntaxFromData.tsx +0 -24
- package/src/Developer/JSONSyntaxFromText.tsx +0 -33
- package/src/Developer/types.ts +0 -14
- package/src/Developer/util.ts +0 -41
- package/src/Inputs/CaptchaBox.tsx +0 -78
- package/src/Inputs/DateInput.tsx +0 -124
- package/src/Inputs/DateTemplate.tsx +0 -147
- package/src/Inputs/DelayInputChange.tsx +0 -104
- package/src/Inputs/InputTemplate.tsx +0 -68
- package/src/Inputs/LabelTemplate.tsx +0 -46
- package/src/Inputs/NumericInput.tsx +0 -130
- package/src/Inputs/NumericTemplate.tsx +0 -126
- package/src/Inputs/Selects/Custom.tsx +0 -49
- package/src/Inputs/Selects/Simple.tsx +0 -63
- package/src/Inputs/Selects/index.tsx +0 -26
- package/src/Inputs/SimpleInput.tsx +0 -42
- package/src/Inputs/SimpleTextarea.tsx +0 -43
- package/src/Inputs/TextareaTemplate.tsx +0 -49
- package/src/Inputs/common.ts +0 -44
- package/src/Inputs/index.ts +0 -13
- package/src/Loader/LoaderRender.tsx +0 -88
- package/src/Loader/index.ts +0 -195
- package/src/Messages/CenterLoading.tsx +0 -48
- package/src/Messages/Error.tsx +0 -77
- package/src/Messages/Loading.tsx +0 -55
- package/src/Messages/Update.tsx +0 -32
- package/src/Messages/index.ts +0 -2
- package/src/Modal/ConfirmationModal.tsx +0 -120
- package/src/Modal/ModalWindow.tsx +0 -167
- package/src/Modal/Root.tsx +0 -64
- package/src/Modal/actions.ts +0 -12
- package/src/Modal/getComponent.tsx +0 -24
- package/src/Modal/index.ts +0 -5
- package/src/Modal/reducer.ts +0 -52
- package/src/Modal/types.ts +0 -47
- package/src/Modal/util.ts +0 -12
- package/src/Payment/Modal/BankTransfer.tsx +0 -117
- package/src/Payment/Modal/BankTransferDoneModal.tsx +0 -27
- package/src/Payment/Modal/index.ts +0 -11
- package/src/Payment/Pieces/BankTransferForm/BankTransferForm.tsx +0 -91
- package/src/Payment/Pieces/BankTransferForm/BankTransferFormWrapper.tsx +0 -56
- package/src/Payment/Pieces/BankTransferForm/BankTransferNumberField.tsx +0 -33
- package/src/Payment/Pieces/BankTransferForm/validate.ts +0 -14
- package/src/Payment/Pieces/MobilPayForm.tsx +0 -47
- package/src/Payment/Pieces/Payment.tsx +0 -91
- package/src/Payment/core/actions.ts +0 -17
- package/src/Payment/core/codes.ts +0 -31
- package/src/Payment/core/request.ts +0 -39
- package/src/Payment/core/types.d.ts +0 -19
- package/src/Payment/core/util/info.ts +0 -10
- package/src/Payment/core/util/util.ts +0 -41
- package/src/Payment/index.ts +0 -9
- package/src/UI/Collapse.tsx +0 -80
- package/src/UI/LoadImages.tsx +0 -58
- package/src/UI/NewFeature.tsx +0 -23
- package/src/UI/Things.tsx +0 -30
- package/src/actions.ts +0 -48
- package/src/config.ts +0 -19
- package/src/index.ts +0 -16
- package/src/node_modules/.vitest/results.json +0 -1
- package/src/reducer/captchas.ts +0 -34
- package/src/reducer/index.ts +0 -17
- package/src/reducer/module.ts +0 -31
- package/src/styles/_json.scss +0 -48
- package/src/styles/index.scss +0 -1
- package/src/types.ts +0 -27
- package/src/utility/breakpoint.tsx +0 -88
- package/src/utility/calendar.ts +0 -23
- package/src/utility/date.ts +0 -108
- package/src/utility/dev/ErrorBoundary.tsx +0 -90
- package/src/utility/dev/TheError.tsx +0 -74
- package/src/utility/dev/index.ts +0 -109
- package/src/utility/dev/types.ts +0 -8
- package/src/utility/hooks.ts +0 -32
- package/src/utility/index.ts +0 -17
- package/src/utility/languages/date.ts +0 -2
- package/src/utility/languages/english.ts +0 -127
- package/src/utility/languages/ro.ts +0 -123
- package/src/utility/normalize.test.ts +0 -43
- package/src/utility/normalize.ts +0 -75
- package/src/utility/numbers.ts +0 -62
- package/src/utility/numeric.ts +0 -103
- package/src/utility/others.tsx +0 -53
- package/src/utility/strings.test.ts +0 -123
- package/src/utility/strings.ts +0 -22
- package/src/utility/uuid.ts +0 -30
- package/src/utility/validation/common.ts +0 -255
- package/src/utility/validation/index.ts +0 -24
- package/src/utility/validation/specific.ts +0 -18
- package/src/utility/validation/types.ts +0 -53
- package/src/utility/validation/validate/date.ts +0 -52
- package/src/utility/validation/validate/email.test.ts +0 -26
- package/src/utility/validation/validate/email.ts +0 -3
- package/src/utility/validation/validate/index.ts +0 -2
- package/src/utility/words.ts +0 -82
- package/tsconfig.json +0 -95
- package/vite.config.ts +0 -10
- package/webpack.config.js +0 -67
- package/x25.wiki/Account.md +0 -41
- package/x25.wiki/Company.md +0 -39
- package/x25.wiki/Header.md +0 -21
- package/x25.wiki/Home.md +0 -1
- package/x25.wiki/Inputs.md +0 -32
- package/x25.wiki/Messages.md +0 -27
- package/x25.wiki/Payment.md +0 -42
- /package/{dist/Account → Account}/Load.d.ts +0 -0
- /package/{dist/Account → Account}/Load.js +0 -0
- /package/{dist/Account → Account}/Load.js.map +0 -0
- /package/{dist/Account → Account}/actions.d.ts +0 -0
- /package/{dist/Account → Account}/actions.js +0 -0
- /package/{dist/Account → Account}/actions.js.map +0 -0
- /package/{dist/Account → Account}/index.d.ts +0 -0
- /package/{dist/Account → Account}/index.js +0 -0
- /package/{dist/Account → Account}/index.js.map +0 -0
- /package/{dist/Account → Account}/reducer.d.ts +0 -0
- /package/{dist/Account → Account}/reducer.js +0 -0
- /package/{dist/Account → Account}/reducer.js.map +0 -0
- /package/{dist/Async → Async}/InitModule.d.ts +0 -0
- /package/{dist/Async → Async}/InitModule.js +0 -0
- /package/{dist/Async → Async}/InitModule.js.map +0 -0
- /package/{dist/Async → Async}/RouteLoading.d.ts +0 -0
- /package/{dist/Async → Async}/RouteLoading.js +0 -0
- /package/{dist/Async → Async}/RouteLoading.js.map +0 -0
- /package/{dist/Async → Async}/SimulatedException.d.ts +0 -0
- /package/{dist/Async → Async}/SimulatedException.js +0 -0
- /package/{dist/Async → Async}/SimulatedException.js.map +0 -0
- /package/{dist/Async → Async}/helpers.d.ts +0 -0
- /package/{dist/Async → Async}/helpers.js +0 -0
- /package/{dist/Async → Async}/helpers.js.map +0 -0
- /package/{dist/Async → Async}/index.d.ts +0 -0
- /package/{dist/Async → Async}/index.js +0 -0
- /package/{dist/Async → Async}/index.js.map +0 -0
- /package/{dist/Async → Async}/types.d.ts +0 -0
- /package/{dist/Async → Async}/types.js +0 -0
- /package/{dist/Async → Async}/types.js.map +0 -0
- /package/{dist/Async → Async}/util.d.ts +0 -0
- /package/{dist/Async → Async}/util.js +0 -0
- /package/{dist/Async → Async}/util.js.map +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromData.d.ts +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromData.js +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromData.js.map +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromText.d.ts +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromText.js +0 -0
- /package/{dist/Developer → Developer}/JSONSyntaxFromText.js.map +0 -0
- /package/{dist/Developer → Developer}/types.d.ts +0 -0
- /package/{dist/Developer → Developer}/types.js +0 -0
- /package/{dist/Developer → Developer}/types.js.map +0 -0
- /package/{dist/Developer → Developer}/util.d.ts +0 -0
- /package/{dist/Developer → Developer}/util.js +0 -0
- /package/{dist/Developer → Developer}/util.js.map +0 -0
- /package/{dist/Inputs → Inputs}/CaptchaBox.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/CaptchaBox.js +0 -0
- /package/{dist/Inputs → Inputs}/CaptchaBox.js.map +0 -0
- /package/{dist/Inputs → Inputs}/DateInput.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/DateInput.js +0 -0
- /package/{dist/Inputs → Inputs}/DateInput.js.map +0 -0
- /package/{dist/Inputs → Inputs}/DateTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/DateTemplate.js +0 -0
- /package/{dist/Inputs → Inputs}/DateTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/DelayInputChange.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/DelayInputChange.js +0 -0
- /package/{dist/Inputs → Inputs}/DelayInputChange.js.map +0 -0
- /package/{dist/Inputs → Inputs}/InputTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/InputTemplate.js +0 -0
- /package/{dist/Inputs → Inputs}/InputTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/LabelTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/LabelTemplate.js +0 -0
- /package/{dist/Inputs → Inputs}/LabelTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/NumericInput.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/NumericInput.js +0 -0
- /package/{dist/Inputs → Inputs}/NumericInput.js.map +0 -0
- /package/{dist/Inputs → Inputs}/NumericTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/NumericTemplate.js +0 -0
- /package/{dist/Inputs → Inputs}/NumericTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Custom.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Custom.js +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Custom.js.map +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Simple.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Simple.js +0 -0
- /package/{dist/Inputs → Inputs}/Selects/Simple.js.map +0 -0
- /package/{dist/Inputs → Inputs}/Selects/index.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/Selects/index.js +0 -0
- /package/{dist/Inputs → Inputs}/Selects/index.js.map +0 -0
- /package/{dist/Inputs → Inputs}/SimpleInput.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/SimpleInput.js +0 -0
- /package/{dist/Inputs → Inputs}/SimpleInput.js.map +0 -0
- /package/{dist/Inputs → Inputs}/SimpleTextarea.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/SimpleTextarea.js +0 -0
- /package/{dist/Inputs → Inputs}/SimpleTextarea.js.map +0 -0
- /package/{dist/Inputs → Inputs}/TextareaTemplate.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/TextareaTemplate.js +0 -0
- /package/{dist/Inputs → Inputs}/TextareaTemplate.js.map +0 -0
- /package/{dist/Inputs → Inputs}/common.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/common.js +0 -0
- /package/{dist/Inputs → Inputs}/common.js.map +0 -0
- /package/{dist/Inputs → Inputs}/index.d.ts +0 -0
- /package/{dist/Inputs → Inputs}/index.js +0 -0
- /package/{dist/Inputs → Inputs}/index.js.map +0 -0
- /package/{dist/Loader → Loader}/LoaderRender.d.ts +0 -0
- /package/{dist/Loader → Loader}/LoaderRender.js +0 -0
- /package/{dist/Loader → Loader}/LoaderRender.js.map +0 -0
- /package/{dist/Loader → Loader}/index.d.ts +0 -0
- /package/{dist/Loader → Loader}/index.js +0 -0
- /package/{dist/Loader → Loader}/index.js.map +0 -0
- /package/{dist/Messages → Messages}/CenterLoading.d.ts +0 -0
- /package/{dist/Messages → Messages}/CenterLoading.js +0 -0
- /package/{dist/Messages → Messages}/CenterLoading.js.map +0 -0
- /package/{dist/Messages → Messages}/Error.d.ts +0 -0
- /package/{dist/Messages → Messages}/Error.js +0 -0
- /package/{dist/Messages → Messages}/Error.js.map +0 -0
- /package/{dist/Messages → Messages}/Loading.d.ts +0 -0
- /package/{dist/Messages → Messages}/Loading.js +0 -0
- /package/{dist/Messages → Messages}/Loading.js.map +0 -0
- /package/{dist/Messages → Messages}/Update.d.ts +0 -0
- /package/{dist/Messages → Messages}/Update.js +0 -0
- /package/{dist/Messages → Messages}/Update.js.map +0 -0
- /package/{dist/Messages → Messages}/index.d.ts +0 -0
- /package/{dist/Messages → Messages}/index.js +0 -0
- /package/{dist/Messages → Messages}/index.js.map +0 -0
- /package/{dist/Modal → Modal}/ConfirmationModal.d.ts +0 -0
- /package/{dist/Modal → Modal}/ConfirmationModal.js +0 -0
- /package/{dist/Modal → Modal}/ConfirmationModal.js.map +0 -0
- /package/{dist/Modal → Modal}/ModalWindow.d.ts +0 -0
- /package/{dist/Modal → Modal}/ModalWindow.js +0 -0
- /package/{dist/Modal → Modal}/ModalWindow.js.map +0 -0
- /package/{dist/Modal → Modal}/Root.d.ts +0 -0
- /package/{dist/Modal → Modal}/Root.js +0 -0
- /package/{dist/Modal → Modal}/Root.js.map +0 -0
- /package/{dist/Modal → Modal}/actions.d.ts +0 -0
- /package/{dist/Modal → Modal}/actions.js +0 -0
- /package/{dist/Modal → Modal}/actions.js.map +0 -0
- /package/{dist/Modal → Modal}/getComponent.d.ts +0 -0
- /package/{dist/Modal → Modal}/getComponent.js +0 -0
- /package/{dist/Modal → Modal}/getComponent.js.map +0 -0
- /package/{dist/Modal → Modal}/index.d.ts +0 -0
- /package/{dist/Modal → Modal}/index.js +0 -0
- /package/{dist/Modal → Modal}/index.js.map +0 -0
- /package/{dist/Modal → Modal}/reducer.d.ts +0 -0
- /package/{dist/Modal → Modal}/reducer.js +0 -0
- /package/{dist/Modal → Modal}/reducer.js.map +0 -0
- /package/{dist/Modal → Modal}/types.d.ts +0 -0
- /package/{dist/Modal → Modal}/types.js +0 -0
- /package/{dist/Modal → Modal}/types.js.map +0 -0
- /package/{dist/Modal → Modal}/util.d.ts +0 -0
- /package/{dist/Modal → Modal}/util.js +0 -0
- /package/{dist/Modal → Modal}/util.js.map +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransfer.d.ts +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransfer.js +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransfer.js.map +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransferDoneModal.d.ts +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransferDoneModal.js +0 -0
- /package/{dist/Payment → Payment}/Modal/BankTransferDoneModal.js.map +0 -0
- /package/{dist/Payment → Payment}/Modal/index.d.ts +0 -0
- /package/{dist/Payment → Payment}/Modal/index.js +0 -0
- /package/{dist/Payment → Payment}/Modal/index.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferForm.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferForm.js +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferForm.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferFormWrapper.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferFormWrapper.js +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferFormWrapper.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferNumberField.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferNumberField.js +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/BankTransferNumberField.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/validate.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/validate.js +0 -0
- /package/{dist/Payment → Payment}/Pieces/BankTransferForm/validate.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/MobilPayForm.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/MobilPayForm.js +0 -0
- /package/{dist/Payment → Payment}/Pieces/MobilPayForm.js.map +0 -0
- /package/{dist/Payment → Payment}/Pieces/Payment.d.ts +0 -0
- /package/{dist/Payment → Payment}/Pieces/Payment.js +0 -0
- /package/{dist/Payment → Payment}/Pieces/Payment.js.map +0 -0
- /package/{dist/Payment → Payment}/core/actions.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/actions.js +0 -0
- /package/{dist/Payment → Payment}/core/actions.js.map +0 -0
- /package/{dist/Payment → Payment}/core/codes.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/codes.js +0 -0
- /package/{dist/Payment → Payment}/core/codes.js.map +0 -0
- /package/{dist/Payment → Payment}/core/request.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/request.js +0 -0
- /package/{dist/Payment → Payment}/core/request.js.map +0 -0
- /package/{dist/Payment → Payment}/core/util/info.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/util/info.js +0 -0
- /package/{dist/Payment → Payment}/core/util/info.js.map +0 -0
- /package/{dist/Payment → Payment}/core/util/util.d.ts +0 -0
- /package/{dist/Payment → Payment}/core/util/util.js +0 -0
- /package/{dist/Payment → Payment}/core/util/util.js.map +0 -0
- /package/{dist/Payment → Payment}/index.d.ts +0 -0
- /package/{dist/Payment → Payment}/index.js +0 -0
- /package/{dist/Payment → Payment}/index.js.map +0 -0
- /package/{dist/UI → UI}/Collapse.d.ts +0 -0
- /package/{dist/UI → UI}/Collapse.js +0 -0
- /package/{dist/UI → UI}/Collapse.js.map +0 -0
- /package/{dist/UI → UI}/LoadImages.d.ts +0 -0
- /package/{dist/UI → UI}/LoadImages.js +0 -0
- /package/{dist/UI → UI}/LoadImages.js.map +0 -0
- /package/{dist/UI → UI}/NewFeature.d.ts +0 -0
- /package/{dist/UI → UI}/NewFeature.js +0 -0
- /package/{dist/UI → UI}/NewFeature.js.map +0 -0
- /package/{dist/UI → UI}/Things.d.ts +0 -0
- /package/{dist/UI → UI}/Things.js +0 -0
- /package/{dist/UI → UI}/Things.js.map +0 -0
- /package/{dist/actions.d.ts → actions.d.ts} +0 -0
- /package/{dist/actions.js → actions.js} +0 -0
- /package/{dist/actions.js.map → actions.js.map} +0 -0
- /package/{dist/config.d.ts → config.d.ts} +0 -0
- /package/{dist/config.js → config.js} +0 -0
- /package/{dist/config.js.map → config.js.map} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/index.js.map → index.js.map} +0 -0
- /package/{dist/reducer → reducer}/captchas.d.ts +0 -0
- /package/{dist/reducer → reducer}/captchas.js +0 -0
- /package/{dist/reducer → reducer}/captchas.js.map +0 -0
- /package/{dist/reducer → reducer}/index.d.ts +0 -0
- /package/{dist/reducer → reducer}/index.js +0 -0
- /package/{dist/reducer → reducer}/index.js.map +0 -0
- /package/{dist/reducer → reducer}/module.d.ts +0 -0
- /package/{dist/reducer → reducer}/module.js +0 -0
- /package/{dist/reducer → reducer}/module.js.map +0 -0
- /package/{dist/styles → styles}/index.css +0 -0
- /package/{dist/types.d.ts → types.d.ts} +0 -0
- /package/{dist/types.js → types.js} +0 -0
- /package/{dist/types.js.map → types.js.map} +0 -0
- /package/{dist/utility → utility}/breakpoint.d.ts +0 -0
- /package/{dist/utility → utility}/breakpoint.js +0 -0
- /package/{dist/utility → utility}/breakpoint.js.map +0 -0
- /package/{dist/utility → utility}/calendar.d.ts +0 -0
- /package/{dist/utility → utility}/calendar.js +0 -0
- /package/{dist/utility → utility}/calendar.js.map +0 -0
- /package/{dist/utility → utility}/date.d.ts +0 -0
- /package/{dist/utility → utility}/date.js +0 -0
- /package/{dist/utility → utility}/date.js.map +0 -0
- /package/{dist/utility → utility}/dev/ErrorBoundary.d.ts +0 -0
- /package/{dist/utility → utility}/dev/ErrorBoundary.js +0 -0
- /package/{dist/utility → utility}/dev/ErrorBoundary.js.map +0 -0
- /package/{dist/utility → utility}/dev/TheError.d.ts +0 -0
- /package/{dist/utility → utility}/dev/TheError.js +0 -0
- /package/{dist/utility → utility}/dev/TheError.js.map +0 -0
- /package/{dist/utility → utility}/dev/index.d.ts +0 -0
- /package/{dist/utility → utility}/dev/index.js +0 -0
- /package/{dist/utility → utility}/dev/index.js.map +0 -0
- /package/{dist/utility → utility}/dev/types.d.ts +0 -0
- /package/{dist/utility → utility}/dev/types.js +0 -0
- /package/{dist/utility → utility}/dev/types.js.map +0 -0
- /package/{dist/utility → utility}/hooks.d.ts +0 -0
- /package/{dist/utility → utility}/hooks.js +0 -0
- /package/{dist/utility → utility}/hooks.js.map +0 -0
- /package/{dist/utility → utility}/index.d.ts +0 -0
- /package/{dist/utility → utility}/index.js +0 -0
- /package/{dist/utility → utility}/index.js.map +0 -0
- /package/{dist/utility → utility}/languages/date.d.ts +0 -0
- /package/{dist/utility → utility}/languages/date.js +0 -0
- /package/{dist/utility → utility}/languages/date.js.map +0 -0
- /package/{dist/utility → utility}/languages/english.d.ts +0 -0
- /package/{dist/utility → utility}/languages/english.js +0 -0
- /package/{dist/utility → utility}/languages/english.js.map +0 -0
- /package/{dist/utility → utility}/languages/ro.d.ts +0 -0
- /package/{dist/utility → utility}/languages/ro.js +0 -0
- /package/{dist/utility → utility}/languages/ro.js.map +0 -0
- /package/{dist/utility → utility}/normalize.d.ts +0 -0
- /package/{dist/utility → utility}/normalize.js +0 -0
- /package/{dist/utility → utility}/normalize.js.map +0 -0
- /package/{dist/utility → utility}/numbers.d.ts +0 -0
- /package/{dist/utility → utility}/numbers.js +0 -0
- /package/{dist/utility → utility}/numbers.js.map +0 -0
- /package/{dist/utility → utility}/numeric.d.ts +0 -0
- /package/{dist/utility → utility}/numeric.js +0 -0
- /package/{dist/utility → utility}/numeric.js.map +0 -0
- /package/{dist/utility → utility}/others.d.ts +0 -0
- /package/{dist/utility → utility}/others.js +0 -0
- /package/{dist/utility → utility}/others.js.map +0 -0
- /package/{dist/utility → utility}/strings.d.ts +0 -0
- /package/{dist/utility → utility}/strings.js +0 -0
- /package/{dist/utility → utility}/strings.js.map +0 -0
- /package/{dist/utility → utility}/uuid.d.ts +0 -0
- /package/{dist/utility → utility}/uuid.js +0 -0
- /package/{dist/utility → utility}/uuid.js.map +0 -0
- /package/{dist/utility → utility}/validation/common.d.ts +0 -0
- /package/{dist/utility → utility}/validation/common.js +0 -0
- /package/{dist/utility → utility}/validation/common.js.map +0 -0
- /package/{dist/utility → utility}/validation/index.d.ts +0 -0
- /package/{dist/utility → utility}/validation/index.js +0 -0
- /package/{dist/utility → utility}/validation/index.js.map +0 -0
- /package/{dist/utility → utility}/validation/specific.d.ts +0 -0
- /package/{dist/utility → utility}/validation/specific.js +0 -0
- /package/{dist/utility → utility}/validation/specific.js.map +0 -0
- /package/{dist/utility → utility}/validation/types.d.ts +0 -0
- /package/{dist/utility → utility}/validation/types.js +0 -0
- /package/{dist/utility → utility}/validation/types.js.map +0 -0
- /package/{dist/utility → utility}/validation/validate/date.d.ts +0 -0
- /package/{dist/utility → utility}/validation/validate/date.js +0 -0
- /package/{dist/utility → utility}/validation/validate/date.js.map +0 -0
- /package/{dist/utility → utility}/validation/validate/email.d.ts +0 -0
- /package/{dist/utility → utility}/validation/validate/email.js +0 -0
- /package/{dist/utility → utility}/validation/validate/email.js.map +0 -0
- /package/{dist/utility → utility}/validation/validate/index.d.ts +0 -0
- /package/{dist/utility → utility}/validation/validate/index.js +0 -0
- /package/{dist/utility → utility}/validation/validate/index.js.map +0 -0
- /package/{dist/utility → utility}/words.d.ts +0 -0
- /package/{dist/utility → utility}/words.js +0 -0
- /package/{dist/utility → utility}/words.js.map +0 -0
package/src/Async/types.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// import * as React from "react";
|
|
2
|
-
import type { ModalsTypes } from "../Modal/types";
|
|
3
|
-
import type { State } from "src/types";
|
|
4
|
-
|
|
5
|
-
export type Reducer = (state: State, action: any) => any;
|
|
6
|
-
|
|
7
|
-
// export type Reducers = {
|
|
8
|
-
// [key : string] : Reducer
|
|
9
|
-
// }
|
|
10
|
-
export type Reducers = any;
|
|
11
|
-
|
|
12
|
-
export type ReducerOptionsType = {
|
|
13
|
-
key: string;
|
|
14
|
-
func: Reducer;
|
|
15
|
-
};
|
|
16
|
-
export type PaginatorType = {
|
|
17
|
-
key: string;
|
|
18
|
-
itemsReducer: Reducer;
|
|
19
|
-
pagesReducer: Reducer;
|
|
20
|
-
};
|
|
21
|
-
export type ReducersTypes = Array<ReducerOptionsType> | ReducerOptionsType;
|
|
22
|
-
export type PaginatorsTypes = Array<PaginatorType> | PaginatorType;
|
|
23
|
-
|
|
24
|
-
export type ModuleParts = {
|
|
25
|
-
module: string;
|
|
26
|
-
Component: any;
|
|
27
|
-
|
|
28
|
-
reducers?: ReducersTypes;
|
|
29
|
-
modals?: ModalsTypes;
|
|
30
|
-
paginators?: PaginatorsTypes;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type Loaded = {
|
|
34
|
-
default : ModuleParts;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export type InitModule = (module: ModuleParts, moduleIsLoadedCb: () => any) => any;
|
|
39
|
-
|
package/src/Async/util.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-prototype-builtins */
|
|
2
|
-
import { createStore, combineReducers } from "redux";
|
|
3
|
-
import { injectModals as performInjectModals } from "../Modal/util";
|
|
4
|
-
import { CombineReducersError, has, set } from "./helpers";
|
|
5
|
-
import { InitModule, PaginatorType, Reducer, Reducers } from "./types";
|
|
6
|
-
|
|
7
|
-
let
|
|
8
|
-
store : any = {
|
|
9
|
-
injectedReducers: {},
|
|
10
|
-
},
|
|
11
|
-
combine = combineReducers;
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
combineReducersRecurse = (reducers : any) => {
|
|
15
|
-
// If this is a leaf or already combined.
|
|
16
|
-
if (typeof reducers === "function") {
|
|
17
|
-
return reducers;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// If this is an object of functions, combine reducers.
|
|
21
|
-
if (typeof reducers === "object") {
|
|
22
|
-
const combinedReducers : Reducers = {};
|
|
23
|
-
|
|
24
|
-
for (const key of Object.keys(reducers)) {
|
|
25
|
-
combinedReducers[key] = combineReducersRecurse(reducers[key]);
|
|
26
|
-
}
|
|
27
|
-
return combine(combinedReducers);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// If we get here we have an invalid item in the reducer path.
|
|
31
|
-
throw new CombineReducersError("Invalid item in reducer tree", reducers);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const
|
|
35
|
-
createInjectStore = (initialReducers: Reducers, ...args: any[]) => {
|
|
36
|
-
// If last item is an object, it is overrides.
|
|
37
|
-
if (typeof args[args.length - 1] === "object") {
|
|
38
|
-
const
|
|
39
|
-
overrides = args.pop(),
|
|
40
|
-
overridesExists = (
|
|
41
|
-
overrides.hasOwnProperty("combineReducers") &&
|
|
42
|
-
typeof overrides.combineReducers === "function"
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
if (overridesExists) {
|
|
46
|
-
combine = overrides.combineReducers;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
store = createStore(
|
|
51
|
-
combineReducersRecurse(initialReducers),
|
|
52
|
-
...args,
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
store.injectedReducers = initialReducers;
|
|
56
|
-
|
|
57
|
-
return store;
|
|
58
|
-
},
|
|
59
|
-
initModule : InitModule = ({ reducers, modals, paginators }, moduleIsLoadedCb) => {
|
|
60
|
-
const
|
|
61
|
-
injectReducer = (key : string, reducer : Reducer, force = false) => {
|
|
62
|
-
if (has(store.injectedReducers, key) || force) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
set(store.injectedReducers, key, reducer);
|
|
67
|
-
store.replaceReducer(combineReducersRecurse(store.injectedReducers));
|
|
68
|
-
},
|
|
69
|
-
injectReducers = () => {
|
|
70
|
-
if (reducers) {
|
|
71
|
-
if (Array.isArray(reducers)) {
|
|
72
|
-
for (const { key, func } of reducers) {
|
|
73
|
-
injectReducer(key, func);
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
const { key, func } = reducers;
|
|
77
|
-
|
|
78
|
-
injectReducer(key, func);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
injectModals = () => {
|
|
83
|
-
if (modals) {
|
|
84
|
-
performInjectModals(modals);
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
injectPaginators = () => {
|
|
88
|
-
const injectPaginator = ({ key, itemsReducer, pagesReducer }: PaginatorType) => {
|
|
89
|
-
injectReducer(`entities.${key}`, itemsReducer);
|
|
90
|
-
injectReducer(`paginations.${key}`, pagesReducer);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
if (paginators) {
|
|
94
|
-
if (Array.isArray(paginators)) {
|
|
95
|
-
for (const paginator of paginators) {
|
|
96
|
-
injectPaginator(paginator);
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
injectPaginator(paginators);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
injectReducers();
|
|
105
|
-
injectModals();
|
|
106
|
-
injectPaginators();
|
|
107
|
-
|
|
108
|
-
moduleIsLoadedCb();
|
|
109
|
-
};
|
|
110
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import JSONSyntaxFromText from "./JSONSyntaxFromText";
|
|
5
|
-
import { InnerDataProps } from "./types";
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
JSONSyntaxFromDataInner = (props : InnerDataProps) => {
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
{ data, isImmutable = false, height } = props,
|
|
12
|
-
text = React.useMemo(() => JSON.stringify((
|
|
13
|
-
isImmutable ? data.toJS() : data
|
|
14
|
-
), null,
|
|
15
|
-
" "), [data]);
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<JSONSyntaxFromText height={height} text={text} />
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
JSONSyntaxFromData = React.memo(JSONSyntaxFromDataInner);
|
|
23
|
-
|
|
24
|
-
export default JSONSyntaxFromData;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/no-danger */
|
|
2
|
-
/* eslint-disable no-magic-numbers */
|
|
3
|
-
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { InnerTextProps } from "./types";
|
|
6
|
-
import { getJSONTags } from "./util";
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
InnerText = ({ text, height, divClass } : InnerTextProps) => {
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
data = React.useMemo(() => getJSONTags(text), [text]);
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<pre
|
|
16
|
-
className={`alert alert-secondary ${divClass ? divClass : ""}`} style={{
|
|
17
|
-
height: height ? height : 200,
|
|
18
|
-
}}>
|
|
19
|
-
<span
|
|
20
|
-
className="json-object"
|
|
21
|
-
dangerouslySetInnerHTML={{
|
|
22
|
-
__html: data,
|
|
23
|
-
}}
|
|
24
|
-
/>
|
|
25
|
-
</pre>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
JSONSyntaxFromText = React.memo(InnerText);
|
|
30
|
-
|
|
31
|
-
export default JSONSyntaxFromText;
|
|
32
|
-
|
|
33
|
-
|
package/src/Developer/types.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type CommonJSON = {
|
|
2
|
-
readonly height?: number;
|
|
3
|
-
readonly divClass? : string
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export type InnerDataProps = CommonJSON & {
|
|
7
|
-
readonly data : any;
|
|
8
|
-
readonly isImmutable?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type InnerTextProps = CommonJSON & {
|
|
12
|
-
readonly text : string;
|
|
13
|
-
}
|
|
14
|
-
|
package/src/Developer/util.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-magic-numbers */
|
|
2
|
-
/* eslint-disable react/no-danger */
|
|
3
|
-
/* eslint-disable prefer-named-capture-group */
|
|
4
|
-
|
|
5
|
-
export const
|
|
6
|
-
getJSONTags = (json : string) => {
|
|
7
|
-
try {
|
|
8
|
-
let data = json;
|
|
9
|
-
|
|
10
|
-
if (!data || data === "") {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
data = data.
|
|
15
|
-
replace(/&/gu, "&").
|
|
16
|
-
replace(/</gu, "<").
|
|
17
|
-
replace(/>/gu, ">");
|
|
18
|
-
|
|
19
|
-
return data.replace(
|
|
20
|
-
/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\\-]?\d+)?)/gu,
|
|
21
|
-
(match) => {
|
|
22
|
-
let cls = "number";
|
|
23
|
-
|
|
24
|
-
if ((/^"/u).test(match)) {
|
|
25
|
-
if ((/:$/u).test(match)) {
|
|
26
|
-
cls = "key";
|
|
27
|
-
} else {
|
|
28
|
-
cls = "string";
|
|
29
|
-
}
|
|
30
|
-
} else if ((/true|false/u).test(match)) {
|
|
31
|
-
cls = "boolean";
|
|
32
|
-
} else if ((/null/u).test(match)) {
|
|
33
|
-
cls = "null";
|
|
34
|
-
}
|
|
35
|
-
return `<span class="${cls}">${match}</span>`;
|
|
36
|
-
},
|
|
37
|
-
);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
return json;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import Tooltip from "rc-tooltip";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { words } from "../utility";
|
|
6
|
-
import { MetaProps } from "src/types";
|
|
7
|
-
|
|
8
|
-
type CaptchaPropTypes = {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly tabIndex?: string;
|
|
11
|
-
readonly field?: any;
|
|
12
|
-
readonly label?: string;
|
|
13
|
-
readonly autoFocus?: boolean;
|
|
14
|
-
readonly left?: string;
|
|
15
|
-
readonly right?: string;
|
|
16
|
-
readonly meta?: MetaProps;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const InfoIcon = () => (
|
|
21
|
-
<div className="d-inline float-end">
|
|
22
|
-
<Tooltip
|
|
23
|
-
arrowContent={<div className="rc-tooltip-arrow-inner" />}
|
|
24
|
-
destroyTooltipOnHide
|
|
25
|
-
overlay={words.CaptchaDescription}
|
|
26
|
-
placement="top">
|
|
27
|
-
<i className="fa fa-info-circle fa-2x text-info pull-end" id="TooltipExample" />
|
|
28
|
-
</Tooltip>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export const OldCaptchaBox = (props: CaptchaPropTypes) => {
|
|
33
|
-
const { autoFocus, id, field, tabIndex, label, left, right, meta = {} as MetaProps } = props;
|
|
34
|
-
|
|
35
|
-
if (typeof id === "undefined" || id === "") {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div className="form-group row d-flex">
|
|
41
|
-
<label
|
|
42
|
-
className={`${left ? `${left} align-self-center` : "col-md-4 text-md-end"} form-control-label align-self-center`}
|
|
43
|
-
htmlFor={field.name}>
|
|
44
|
-
{`${words.CaptchaVerify} `}
|
|
45
|
-
<InfoIcon />
|
|
46
|
-
</label>
|
|
47
|
-
<div className={right ? `${right} align-self-center` : "col-md-8 align-self-center"}>
|
|
48
|
-
<div className="custom-class">
|
|
49
|
-
<span className="custom-control-description text-muted">
|
|
50
|
-
{words.CaptchaTypeNumbers}
|
|
51
|
-
</span>
|
|
52
|
-
<div className="text-center my-1">
|
|
53
|
-
<img alt="CaptchaBox" src={`/captcha/${id}.png`} />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
<input
|
|
57
|
-
{...field}
|
|
58
|
-
aria-label={label}
|
|
59
|
-
autoFocus={autoFocus}
|
|
60
|
-
className={classnames("form-control", {
|
|
61
|
-
"is-invalid": meta?.touched && meta?.error,
|
|
62
|
-
})}
|
|
63
|
-
disabled={meta?.submitting}
|
|
64
|
-
id={field.name}
|
|
65
|
-
placeholder={words.CaptchaTypeNumbers}
|
|
66
|
-
tabIndex={tabIndex}
|
|
67
|
-
/>
|
|
68
|
-
<div className="invalid-feedback">
|
|
69
|
-
{meta?.touched && meta?.error ? (
|
|
70
|
-
<span>
|
|
71
|
-
{meta?.error}
|
|
72
|
-
</span>
|
|
73
|
-
) : null}
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
};
|
package/src/Inputs/DateInput.tsx
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { MetaProps } from "../types";
|
|
5
|
-
import { formatDate, normalizeDate, words } from "../utility";
|
|
6
|
-
import { isValidDate } from "../utility/validation";
|
|
7
|
-
|
|
8
|
-
type DateInputPropTypes = {
|
|
9
|
-
readonly currency?: boolean;
|
|
10
|
-
readonly customClass?: any;
|
|
11
|
-
readonly input: any;
|
|
12
|
-
readonly meta: MetaProps;
|
|
13
|
-
readonly placeholder?: string;
|
|
14
|
-
readonly tabIndex?: string;
|
|
15
|
-
readonly value?: string;
|
|
16
|
-
readonly formatValue: (raw: string) => string;
|
|
17
|
-
readonly normalizeValue: (raw: string) => any;
|
|
18
|
-
readonly onBlur?: () => void;
|
|
19
|
-
readonly onChange?: (event: any) => void;
|
|
20
|
-
readonly onRegisterRef?: (callback: (node: any) => void) => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
addZeroIfNeeded = (raw : string) => {
|
|
25
|
-
const
|
|
26
|
-
nrOfElements = 3,
|
|
27
|
-
canAddZero = (
|
|
28
|
-
(typeof raw === "string") &&
|
|
29
|
-
(raw.split(".").length === nrOfElements)
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
if (!canAddZero) {
|
|
33
|
-
return raw;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
perform = (value : string) => (
|
|
38
|
-
value.length === 1 ? `0${value}` : value
|
|
39
|
-
),
|
|
40
|
-
parts = raw.split("."),
|
|
41
|
-
part1 = perform(parts[0]),
|
|
42
|
-
part2 = perform(parts[1]),
|
|
43
|
-
[, , part3] = parts,
|
|
44
|
-
|
|
45
|
-
newValue = [part1, part2, part3].join(".");
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (isValidDate(newValue)) {
|
|
49
|
-
return newValue;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return raw;
|
|
53
|
-
},
|
|
54
|
-
normalizeRawDate = (raw: string): string => {
|
|
55
|
-
if (isValidDate(raw)) {
|
|
56
|
-
return normalizeDate(raw);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return "";
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
formatRawDate = (raw: string): string => {
|
|
63
|
-
if (typeof raw !== "undefined") {
|
|
64
|
-
return formatDate(raw);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return "";
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const OldDateInput = (props : DateInputPropTypes) => {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
{ customClass, input = {}, onRegisterRef, tabIndex, placeholder,
|
|
74
|
-
meta = {} as MetaProps } = props,
|
|
75
|
-
|
|
76
|
-
[value, setValue] = React.useState(input.value),
|
|
77
|
-
|
|
78
|
-
valueToShow = formatRawDate(value),
|
|
79
|
-
|
|
80
|
-
updateValue = (targetValue : string) => {
|
|
81
|
-
|
|
82
|
-
const normalizedValue = normalizeRawDate(addZeroIfNeeded(targetValue));
|
|
83
|
-
|
|
84
|
-
setValue(targetValue);
|
|
85
|
-
input.onChange(normalizedValue);
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
handleBlur = (event : any) => {
|
|
90
|
-
const
|
|
91
|
-
{ target: { value : targetValue } } = event,
|
|
92
|
-
newValue = addZeroIfNeeded(targetValue),
|
|
93
|
-
hasChanged = targetValue !== newValue;
|
|
94
|
-
|
|
95
|
-
if (hasChanged) {
|
|
96
|
-
updateValue(newValue);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
input.onBlur(event);
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
handleChange = ({ target: { value : targetValue } }: any) => {
|
|
103
|
-
updateValue(targetValue);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<input
|
|
108
|
-
{...input}
|
|
109
|
-
className={classnames(`form-control ${customClass || ""}`, {
|
|
110
|
-
"is-invalid": meta.touched && meta.error,
|
|
111
|
-
})}
|
|
112
|
-
disabled={meta.submitting}
|
|
113
|
-
id={input.name}
|
|
114
|
-
onBlur={handleBlur}
|
|
115
|
-
onChange={handleChange}
|
|
116
|
-
placeholder={placeholder || words.DateFormat}
|
|
117
|
-
ref={onRegisterRef}
|
|
118
|
-
tabIndex={tabIndex}
|
|
119
|
-
type="text"
|
|
120
|
-
value={valueToShow}
|
|
121
|
-
/>
|
|
122
|
-
);
|
|
123
|
-
};
|
|
124
|
-
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { MetaProps } from "../types";
|
|
5
|
-
import { formatDate, normalizeDate, words } from "../utility";
|
|
6
|
-
import { isValidDate } from "../utility/validation";
|
|
7
|
-
|
|
8
|
-
type DateInputPropTypes = {
|
|
9
|
-
readonly currency?: boolean;
|
|
10
|
-
readonly customClass?: any;
|
|
11
|
-
readonly input: any;
|
|
12
|
-
readonly label:string;
|
|
13
|
-
readonly left?: string;
|
|
14
|
-
readonly meta: MetaProps;
|
|
15
|
-
readonly placeholder?: string;
|
|
16
|
-
readonly right?: string;
|
|
17
|
-
readonly tabIndex?: string;
|
|
18
|
-
readonly value?: string;
|
|
19
|
-
readonly formatValue: (raw: string) => string;
|
|
20
|
-
readonly normalizeValue: (raw: string) => any;
|
|
21
|
-
readonly onBlur?: () => void;
|
|
22
|
-
readonly onChange?: (event: any) => void;
|
|
23
|
-
readonly onRegisterRef?: (callback: (node: any) => void) => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
addZeroIfNeeded = (raw : string) => {
|
|
28
|
-
const
|
|
29
|
-
nrOfElements = 3,
|
|
30
|
-
canAddZero = (
|
|
31
|
-
(typeof raw === "string") &&
|
|
32
|
-
(raw.split(".").length === nrOfElements)
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
if (!canAddZero) {
|
|
36
|
-
return raw;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
perform = (value : string) => (
|
|
41
|
-
value.length === 1 ? `0${value}` : value
|
|
42
|
-
),
|
|
43
|
-
parts = raw.split("."),
|
|
44
|
-
part1 = perform(parts[0]),
|
|
45
|
-
part2 = perform(parts[1]),
|
|
46
|
-
[, , part3] = parts,
|
|
47
|
-
|
|
48
|
-
newValue = [part1, part2, part3].join(".");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (isValidDate(newValue)) {
|
|
52
|
-
return newValue;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return raw;
|
|
56
|
-
},
|
|
57
|
-
normalizeRawDate = (raw: string): string => {
|
|
58
|
-
if (isValidDate(raw)) {
|
|
59
|
-
return normalizeDate(raw);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return "";
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
formatRawDate = (raw: string): string => {
|
|
66
|
-
if (typeof raw !== "undefined") {
|
|
67
|
-
return formatDate(raw);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return "";
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const OldDateTemplate = (props : DateInputPropTypes) => {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
{ customClass, input = {}, onRegisterRef, tabIndex, placeholder,
|
|
77
|
-
meta = {} as MetaProps, right, left, label } = props,
|
|
78
|
-
|
|
79
|
-
[value, setValue] = React.useState(input.value),
|
|
80
|
-
|
|
81
|
-
valueToShow = formatRawDate(value),
|
|
82
|
-
|
|
83
|
-
updateValue = (targetValue : string) => {
|
|
84
|
-
|
|
85
|
-
const normalizedValue = normalizeRawDate(addZeroIfNeeded(targetValue));
|
|
86
|
-
|
|
87
|
-
setValue(targetValue);
|
|
88
|
-
input.onChange(normalizedValue);
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
handleBlur = (event: any) => {
|
|
93
|
-
const
|
|
94
|
-
{ target: { value : targetValue } } = event,
|
|
95
|
-
newValue = addZeroIfNeeded(targetValue),
|
|
96
|
-
hasChanged = targetValue !== newValue;
|
|
97
|
-
|
|
98
|
-
if (hasChanged) {
|
|
99
|
-
updateValue(newValue);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
input.onBlur(event);
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
handleChange = ({ target: { value : targetValue } }: any) => {
|
|
106
|
-
updateValue(targetValue);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<div
|
|
111
|
-
className={classnames("form-group mt-md-2 row d-flex", { "is-invalid": meta.touched && meta.error })}>
|
|
112
|
-
<label
|
|
113
|
-
className={`${left ? `${left} align-self-center` : "col-md-4 text-md-end"} form-control-label`}
|
|
114
|
-
htmlFor={input.name}>
|
|
115
|
-
{label}
|
|
116
|
-
</label>
|
|
117
|
-
<div className={right ? `${right} align-self-center` : "col-md-8"}>
|
|
118
|
-
<input
|
|
119
|
-
{...input}
|
|
120
|
-
aria-label={label}
|
|
121
|
-
className={classnames(`form-control ${customClass || ""}`, {
|
|
122
|
-
"is-invalid": meta.touched && meta.error,
|
|
123
|
-
})}
|
|
124
|
-
disabled={meta.submitting}
|
|
125
|
-
id={input.name}
|
|
126
|
-
onBlur={handleBlur}
|
|
127
|
-
onChange={handleChange}
|
|
128
|
-
placeholder={placeholder || words.DateFormat}
|
|
129
|
-
ref={onRegisterRef}
|
|
130
|
-
tabIndex={tabIndex}
|
|
131
|
-
type="text"
|
|
132
|
-
value={valueToShow}
|
|
133
|
-
/>
|
|
134
|
-
<div
|
|
135
|
-
className="invalid-feedback">
|
|
136
|
-
{meta.touched && meta.error ? (
|
|
137
|
-
<span>
|
|
138
|
-
{meta.error}
|
|
139
|
-
</span>
|
|
140
|
-
) : null}
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
|