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/UI/Things.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Notifications from "react-notification-system-redux2";
|
|
3
|
-
import { connect } from "react-redux";
|
|
4
|
-
import ModalRoot from "../Modal/Root";
|
|
5
|
-
import { deleteNotification } from "../actions";
|
|
6
|
-
import { getNotificationState } from "../config";
|
|
7
|
-
import type { Dispatch, State } from "src/types";
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
mapStateToProps = (state: State) => ({
|
|
11
|
-
notifications: getNotificationState(state) || [],
|
|
12
|
-
}),
|
|
13
|
-
mapDispatchToProps = (dispatch: Dispatch) => ({
|
|
14
|
-
handleDismiss: (notification : { key : number }) => {
|
|
15
|
-
dispatch(deleteNotification(notification.key));
|
|
16
|
-
},
|
|
17
|
-
}),
|
|
18
|
-
|
|
19
|
-
NotificationsContainer = connect(mapStateToProps, mapDispatchToProps)(Notifications),
|
|
20
|
-
|
|
21
|
-
Things = () => (
|
|
22
|
-
<>
|
|
23
|
-
<div className="d-print-none">
|
|
24
|
-
<NotificationsContainer />
|
|
25
|
-
</div>
|
|
26
|
-
<ModalRoot />
|
|
27
|
-
</>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
export default Things;
|
package/src/actions.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import Notifications from "react-notification-system-redux2";
|
|
2
|
-
import type { Action } from "src/types";
|
|
3
|
-
|
|
4
|
-
type NotificationOptions = {
|
|
5
|
-
seconds?: number;
|
|
6
|
-
persistent?: boolean;
|
|
7
|
-
position?: "tr" | "tl" | "tc" | "br" | "bl" | "bc";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
type CreateNotification = (
|
|
11
|
-
(level : string) => (title : string | JSX.Element, options?: NotificationOptions) => Action
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
autoDismissDelay = 6,
|
|
16
|
-
createNotification : CreateNotification = (level) => (title, options) => Notifications.show({
|
|
17
|
-
title,
|
|
18
|
-
position : "bc",
|
|
19
|
-
autoDismiss : options?.persistent ? 0 : (options?.seconds ? options.seconds : autoDismissDelay),
|
|
20
|
-
...options,
|
|
21
|
-
}, level);
|
|
22
|
-
|
|
23
|
-
export const
|
|
24
|
-
notify = createNotification("success"),
|
|
25
|
-
notifyWarning = createNotification("warning"),
|
|
26
|
-
notifyError = createNotification("error"),
|
|
27
|
-
deleteNotification = (position: number): Action => ({
|
|
28
|
-
type : "DELETE_NOTIFICATION",
|
|
29
|
-
payload : position,
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
// captcha
|
|
33
|
-
|
|
34
|
-
showCaptcha = (payload: {
|
|
35
|
-
id: string;
|
|
36
|
-
name: string;
|
|
37
|
-
}): Action => ({
|
|
38
|
-
type: "SHOW_CAPTCHA",
|
|
39
|
-
payload,
|
|
40
|
-
}),
|
|
41
|
-
hideCaptcha = (payload: string): Action => ({
|
|
42
|
-
type: "HIDE_CAPTCHA",
|
|
43
|
-
payload,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export * from "./Account/actions";
|
|
47
|
-
export * from "./Modal/actions";
|
|
48
|
-
|
package/src/config.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export let config: any = {};
|
|
2
|
-
|
|
3
|
-
const getReducerState = (module: string) => (state : any) => {
|
|
4
|
-
if (config.isMutable) {
|
|
5
|
-
return state[module];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return state.get(module);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const
|
|
12
|
-
setConfiguration = (current: any) => {
|
|
13
|
-
config = current;
|
|
14
|
-
},
|
|
15
|
-
getAccountState = getReducerState("account"),
|
|
16
|
-
getModulesState = getReducerState("module"),
|
|
17
|
-
getModalsState = getReducerState("modal"),
|
|
18
|
-
getNotificationState = getReducerState("notifications");
|
|
19
|
-
|
package/src/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// UI
|
|
4
|
-
export { default as NewFeature } from "./UI/NewFeature";
|
|
5
|
-
|
|
6
|
-
// Developer
|
|
7
|
-
export { default as JSONSyntaxFromData } from "./Developer/JSONSyntaxFromData";
|
|
8
|
-
export { default as JSONSyntaxFromText } from "./Developer/JSONSyntaxFromText";
|
|
9
|
-
|
|
10
|
-
// utility
|
|
11
|
-
export { default as normalize } from "./utility/normalize";
|
|
12
|
-
export { default as words } from "./utility/words";
|
|
13
|
-
|
|
14
|
-
export { default as paymentUtils } from "./Payment/index";
|
|
15
|
-
export { default as Payment } from "./Payment/Pieces/Payment";
|
|
16
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"0.34.6","results":[[":utility/strings.test.ts",{"duration":0,"failed":true}],[":utility/normalize.test.ts",{"duration":0,"failed":true}],[":utility/validation/validate/email.test.ts",{"duration":0,"failed":true}]]}
|
package/src/reducer/captchas.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as Immutable from "immutable";
|
|
2
|
-
import type { State } from "src/types";
|
|
3
|
-
|
|
4
|
-
const initialState = Immutable.Map(),
|
|
5
|
-
|
|
6
|
-
showCaptcha = (state: any, {
|
|
7
|
-
payload: {
|
|
8
|
-
name,
|
|
9
|
-
id,
|
|
10
|
-
},
|
|
11
|
-
} : { payload : { name : string, id : string }}) => state.set(name, id),
|
|
12
|
-
hideCaptcha = (state: any, {
|
|
13
|
-
payload,
|
|
14
|
-
} : { payload : any }) => state.delete(payload),
|
|
15
|
-
|
|
16
|
-
captchasReducer = (state: any = initialState, action: any) => {
|
|
17
|
-
switch (action.type) {
|
|
18
|
-
case "SHOW_CAPTCHA":
|
|
19
|
-
return showCaptcha(state, action);
|
|
20
|
-
|
|
21
|
-
case "HIDE_CAPTCHA":
|
|
22
|
-
return hideCaptcha(state, action);
|
|
23
|
-
|
|
24
|
-
default:
|
|
25
|
-
return state;
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
getCaptcha = (state: State, name: string) => state.getIn(["captchas", name]) || "";
|
|
30
|
-
|
|
31
|
-
export const selectors = {
|
|
32
|
-
getCaptcha,
|
|
33
|
-
};
|
|
34
|
-
export default captchasReducer;
|
package/src/reducer/index.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import modal, { selectors as modalSelectors } from "../Modal/reducer";
|
|
2
|
-
import account, { selectors as accountSelectors } from "../Account/reducer";
|
|
3
|
-
import captchas, { selectors as captchasReducer } from "./captchas";
|
|
4
|
-
import module from "./module";
|
|
5
|
-
|
|
6
|
-
const state = {
|
|
7
|
-
module,
|
|
8
|
-
account,
|
|
9
|
-
captchas,
|
|
10
|
-
modal,
|
|
11
|
-
},
|
|
12
|
-
selectors = { ...captchasReducer,
|
|
13
|
-
...accountSelectors,
|
|
14
|
-
...modalSelectors,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { state, selectors };
|
package/src/reducer/module.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as Immutable from "immutable";
|
|
2
|
-
import { getModulesState } from "../config";
|
|
3
|
-
|
|
4
|
-
const initialState = Immutable.Map(),
|
|
5
|
-
|
|
6
|
-
initModule = (state: any, {
|
|
7
|
-
payload,
|
|
8
|
-
} : { payload : any }) => state.set(payload, true),
|
|
9
|
-
|
|
10
|
-
reducer = (state: any = initialState, action: any) => {
|
|
11
|
-
switch (action.type) {
|
|
12
|
-
case "INIT_MODULE":
|
|
13
|
-
return initModule(state, action);
|
|
14
|
-
|
|
15
|
-
default:
|
|
16
|
-
return state;
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
getIsModuleReady = (state: any, id: string) => getModulesState(state).get(id) || false,
|
|
21
|
-
|
|
22
|
-
moduleIsReadyAction = (payload: string) => ({
|
|
23
|
-
type: "INIT_MODULE",
|
|
24
|
-
payload,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
getIsModuleReady,
|
|
29
|
-
moduleIsReadyAction,
|
|
30
|
-
};
|
|
31
|
-
export default reducer;
|
package/src/styles/_json.scss
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
.json-object {
|
|
2
|
-
.string {
|
|
3
|
-
color: #50a14f;
|
|
4
|
-
font-weight: 400;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.number {
|
|
8
|
-
font-weight: bold;
|
|
9
|
-
color: #986801;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.boolean {
|
|
13
|
-
font-weight: bold;
|
|
14
|
-
color: #0184bc;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.null {
|
|
18
|
-
font-weight: bold;
|
|
19
|
-
color: #0184bc;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.key {
|
|
23
|
-
color: #e45649;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[data-bs-theme="dark"] {
|
|
28
|
-
.string {
|
|
29
|
-
color: #f1fa76;
|
|
30
|
-
font-weight: 400;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.number {
|
|
34
|
-
color: #bd93ec;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.boolean {
|
|
38
|
-
color: #bd93ec;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.null {
|
|
42
|
-
color: magenta;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.key {
|
|
46
|
-
color: #72e9fd
|
|
47
|
-
}
|
|
48
|
-
}
|
package/src/styles/index.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import '_json';
|
package/src/types.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { List as ListType, Map as MapType } from "immutable";
|
|
2
|
-
|
|
3
|
-
export type State = any;
|
|
4
|
-
export type Action = any;
|
|
5
|
-
export type ErrorType = string;
|
|
6
|
-
export type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;
|
|
7
|
-
export type Dispatch = (action: any | ThunkAction | PromiseAction) => any;
|
|
8
|
-
export type GetState = () => State;
|
|
9
|
-
export type PromiseAction = Promise<any>;
|
|
10
|
-
export type ModalActionType = string;
|
|
11
|
-
export type NullUInt = {
|
|
12
|
-
Valid: boolean;
|
|
13
|
-
UInt: number;
|
|
14
|
-
};
|
|
15
|
-
export type ModalPayload = {
|
|
16
|
-
modalType: ModalActionType;
|
|
17
|
-
modalProps: any;
|
|
18
|
-
};
|
|
19
|
-
export type NormalizedResult = {
|
|
20
|
-
entities: MapType<string, any>;
|
|
21
|
-
result: ListType<string>;
|
|
22
|
-
};
|
|
23
|
-
export type MetaProps = {
|
|
24
|
-
touched: boolean;
|
|
25
|
-
error?: any;
|
|
26
|
-
submitting: boolean;
|
|
27
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, createContext, useContext } from "react";
|
|
2
|
-
|
|
3
|
-
// type BreakPoints = {
|
|
4
|
-
// hideMenu : boolean;
|
|
5
|
-
// }
|
|
6
|
-
|
|
7
|
-
type BreakpointProviderProps = {
|
|
8
|
-
readonly children: any;
|
|
9
|
-
readonly queries: any;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type Queries = {
|
|
13
|
-
[key in keyof typeof mainQueries] : boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
defaultValue = {} as Queries,
|
|
18
|
-
BreakpointContext = createContext(defaultValue);
|
|
19
|
-
|
|
20
|
-
export const
|
|
21
|
-
mainQueries = {
|
|
22
|
-
sm: "(max-width: 576px)",
|
|
23
|
-
// xs : "(max-width: 320px)",
|
|
24
|
-
// md : "(max-width: 1024px)",
|
|
25
|
-
// or : "(orientation: portrait)",
|
|
26
|
-
},
|
|
27
|
-
BreakpointProvider = ({ children, queries } : BreakpointProviderProps) => {
|
|
28
|
-
const [queryMatch, setQueryMatch] = useState({} as Queries);
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
const mediaQueryLists : any = {},
|
|
32
|
-
keys = Object.keys(queries);
|
|
33
|
-
let isAttached = false;
|
|
34
|
-
|
|
35
|
-
const handleQueryListener = () => {
|
|
36
|
-
const updatedMatches = keys.reduce((acc : any, media : any) => {
|
|
37
|
-
acc[media] = Boolean(mediaQueryLists[media] && mediaQueryLists[media].matches);
|
|
38
|
-
return acc;
|
|
39
|
-
}, {});
|
|
40
|
-
|
|
41
|
-
setQueryMatch(updatedMatches);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
if (window && window.matchMedia) {
|
|
45
|
-
const matches : any = {};
|
|
46
|
-
|
|
47
|
-
keys.forEach((media) => {
|
|
48
|
-
if (typeof queries[media] === "string") {
|
|
49
|
-
mediaQueryLists[media] = window.matchMedia(queries[media]);
|
|
50
|
-
matches[media] = mediaQueryLists[media].matches;
|
|
51
|
-
} else {
|
|
52
|
-
matches[media] = false;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
setQueryMatch(matches);
|
|
56
|
-
isAttached = true;
|
|
57
|
-
keys.forEach((media) => {
|
|
58
|
-
if (typeof queries[media] === "string") {
|
|
59
|
-
mediaQueryLists[media].addListener(handleQueryListener);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return () => {
|
|
65
|
-
if (isAttached) {
|
|
66
|
-
keys.forEach((media) => {
|
|
67
|
-
if (typeof queries[media] === "string") {
|
|
68
|
-
mediaQueryLists[media].removeListener(handleQueryListener);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}, [queries]);
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<BreakpointContext.Provider value={queryMatch}>
|
|
77
|
-
{children}
|
|
78
|
-
</BreakpointContext.Provider>
|
|
79
|
-
);
|
|
80
|
-
},
|
|
81
|
-
useBreakpoint = () => {
|
|
82
|
-
const context = useContext(BreakpointContext);
|
|
83
|
-
|
|
84
|
-
if (context === defaultValue) {
|
|
85
|
-
throw new Error("useBreakpoint must be used within BreakpointProvider");
|
|
86
|
-
}
|
|
87
|
-
return context;
|
|
88
|
-
};
|
package/src/utility/calendar.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
import { toTitle } from "./strings";
|
|
3
|
-
|
|
4
|
-
const now = new Date(),
|
|
5
|
-
currentMonth = now.getMonth(),
|
|
6
|
-
currentYear = now.getFullYear();
|
|
7
|
-
|
|
8
|
-
export const
|
|
9
|
-
calendar = {
|
|
10
|
-
month : currentMonth,
|
|
11
|
-
year : currentYear,
|
|
12
|
-
currentMonth : {
|
|
13
|
-
firstDay : new Date(Date.UTC(currentYear, currentMonth, 1)).toISOString(),
|
|
14
|
-
lastDay : new Date(Date.UTC(currentYear, currentMonth + 1, 0)).toISOString(),
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
newDate = (year: any, month: any, day: any = 1) => (
|
|
18
|
-
new Date(Date.UTC(Number(year), Number(month), day))
|
|
19
|
-
),
|
|
20
|
-
monthYearToDate = (data: { Year: string; Month: string;}) => ({ ...data,
|
|
21
|
-
Date: newDate(data.Year, data.Month),
|
|
22
|
-
}),
|
|
23
|
-
getMonthName = (data: Date) => toTitle(moment.months(data.getMonth()));
|
package/src/utility/date.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
type MonthAndYear = {
|
|
2
|
-
year: string;
|
|
3
|
-
month: string;
|
|
4
|
-
};
|
|
5
|
-
import moment from "moment";
|
|
6
|
-
import { isValidDate } from "./validation/validate";
|
|
7
|
-
|
|
8
|
-
const ten = 10;
|
|
9
|
-
|
|
10
|
-
export const
|
|
11
|
-
pattern = "y-MM-DDTHH:mm:ss",
|
|
12
|
-
golangDateToMoment = (input : string) => moment(String(input).replace("Z", ""), pattern, "Europe/Bucharest"),
|
|
13
|
-
|
|
14
|
-
dateToGoFormat = (theValue : Date | string) => {
|
|
15
|
-
const theMoment = moment(theValue);
|
|
16
|
-
|
|
17
|
-
if (theMoment.isValid()) {
|
|
18
|
-
return `${theMoment.format("y-MM-DDTHH:mm:ss")}Z`;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return "";
|
|
22
|
-
},
|
|
23
|
-
getPreviousMonth = (year: string, month: string) => {
|
|
24
|
-
if (month === "0") {
|
|
25
|
-
return {
|
|
26
|
-
previousMonth : "11",
|
|
27
|
-
previousYear : String(Number(year) - 1),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
previousMonth : String(Number(month) - 1),
|
|
33
|
-
previousYear : String(year),
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export const getLastMonthAndYear = (): MonthAndYear => {
|
|
37
|
-
const currentDate = new Date(),
|
|
38
|
-
currentYear = String(currentDate.getFullYear()),
|
|
39
|
-
currentMonth = String(currentDate.getMonth()),
|
|
40
|
-
{
|
|
41
|
-
previousMonth,
|
|
42
|
-
previousYear,
|
|
43
|
-
} = getPreviousMonth(currentYear, currentMonth);
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
month : previousMonth,
|
|
47
|
-
year : previousYear,
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
// new Date("2016-08-25T00:00:00Z") ---> 25.08.2016
|
|
51
|
-
export const formatDateObject = (date: Date): string => {
|
|
52
|
-
const
|
|
53
|
-
dd = date.getDate(),
|
|
54
|
-
mm = date.getMonth() + 1,
|
|
55
|
-
yyyy = date.getFullYear(),
|
|
56
|
-
addZero = (value : number) => {
|
|
57
|
-
if (value < ten) {
|
|
58
|
-
return `0${value}`;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return value;
|
|
62
|
-
},
|
|
63
|
-
newDD = addZero(dd),
|
|
64
|
-
newMM = addZero(mm);
|
|
65
|
-
|
|
66
|
-
return `${newDD}.${newMM}.${yyyy}`;
|
|
67
|
-
};
|
|
68
|
-
// "2016-08-25T00:00:00Z" ---> 25.08.2016
|
|
69
|
-
export const formatDate = (normalizedValue: string): string => {
|
|
70
|
-
const parts = normalizedValue.split("T");
|
|
71
|
-
|
|
72
|
-
if (parts.length !== 2) {
|
|
73
|
-
return normalizedValue;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const dateParts = parts[0].split("-"),
|
|
77
|
-
nrOfParts = 3;
|
|
78
|
-
|
|
79
|
-
if (dateParts.length !== nrOfParts) {
|
|
80
|
-
return normalizedValue;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const [yyyy, mm, dd] = dateParts;
|
|
84
|
-
|
|
85
|
-
if (!isValidDate(`${dd}.${mm}.${yyyy}`)) {
|
|
86
|
-
return normalizedValue;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const date = new Date(Number(yyyy), Number(mm) - 1, Number(dd), 0, 0, 0, 0);
|
|
90
|
-
|
|
91
|
-
return formatDateObject(date);
|
|
92
|
-
};
|
|
93
|
-
// 25.08.2016 ---> 2016-08-25T00:00:00Z
|
|
94
|
-
export const normalizeDate = (currentValue: string): string => {
|
|
95
|
-
const normalizeCurrent = (): string => {
|
|
96
|
-
const
|
|
97
|
-
parts = currentValue.split("."),
|
|
98
|
-
[dd, mm, yyyy] = parts;
|
|
99
|
-
|
|
100
|
-
return `${yyyy}-${mm}-${dd}T00:00:00Z`;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
if (isValidDate(currentValue)) {
|
|
104
|
-
return normalizeCurrent();
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return currentValue;
|
|
108
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type ErrorBoundaryProps = {
|
|
4
|
-
readonly error?: ErrorType;
|
|
5
|
-
readonly status?: InfoType;
|
|
6
|
-
readonly children: any;
|
|
7
|
-
readonly info?: string;
|
|
8
|
-
};
|
|
9
|
-
type ErrorBoundaryState = {
|
|
10
|
-
status: string | null | undefined;
|
|
11
|
-
error: ErrorType | null | undefined;
|
|
12
|
-
info: InfoType | null | undefined;
|
|
13
|
-
};
|
|
14
|
-
import React from "react";
|
|
15
|
-
import { words } from "..";
|
|
16
|
-
import TheError from "./TheError";
|
|
17
|
-
import type { ErrorType, InfoType } from "./types";
|
|
18
|
-
|
|
19
|
-
const refreshKeyCode = 82,
|
|
20
|
-
timeoutDelay = 200;
|
|
21
|
-
|
|
22
|
-
class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
23
|
-
handleKey: (event: KeyboardEvent) => void;
|
|
24
|
-
refresh: () => void;
|
|
25
|
-
|
|
26
|
-
componentDidCatch (error: ErrorType, info: InfoType) {
|
|
27
|
-
this.setState({
|
|
28
|
-
error,
|
|
29
|
-
info,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
constructor (props: ErrorBoundaryProps) {
|
|
34
|
-
super(props);
|
|
35
|
-
this.state = {
|
|
36
|
-
status : null,
|
|
37
|
-
error : null,
|
|
38
|
-
info : null,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
this.handleKey = (event: KeyboardEvent) => {
|
|
42
|
-
if (event.keyCode === refreshKeyCode) {
|
|
43
|
-
this.refresh();
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
this.refresh = () => {
|
|
48
|
-
this.setState({
|
|
49
|
-
status : words.TryingToRecover,
|
|
50
|
-
error : null,
|
|
51
|
-
info : null,
|
|
52
|
-
}, () => {
|
|
53
|
-
setTimeout(() => {
|
|
54
|
-
this.setState({
|
|
55
|
-
status : null,
|
|
56
|
-
error : null,
|
|
57
|
-
info : null,
|
|
58
|
-
});
|
|
59
|
-
}, timeoutDelay);
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
render () {
|
|
65
|
-
const {
|
|
66
|
-
info,
|
|
67
|
-
error,
|
|
68
|
-
status,
|
|
69
|
-
} = this.state;
|
|
70
|
-
|
|
71
|
-
// render fallback UI
|
|
72
|
-
if (error) {
|
|
73
|
-
return (
|
|
74
|
-
<TheError
|
|
75
|
-
error={error}
|
|
76
|
-
handleKey={this.handleKey}
|
|
77
|
-
info={info}
|
|
78
|
-
refresh={this.refresh}
|
|
79
|
-
status={status}
|
|
80
|
-
/>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// when there's not an error, render children untouched
|
|
85
|
-
return this.props.children;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export default ErrorBoundary;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type TheErrorProps = {
|
|
4
|
-
readonly error: ErrorType | null | undefined;
|
|
5
|
-
readonly handleKey?: (event: KeyboardEvent) => void;
|
|
6
|
-
readonly info?: InfoType | null | undefined;
|
|
7
|
-
readonly status?: string | null | undefined;
|
|
8
|
-
readonly refresh: () => any;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
import React from "react";
|
|
12
|
-
import type { ErrorType, InfoType } from "./types";
|
|
13
|
-
|
|
14
|
-
const TheError = (props: TheErrorProps) => {
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
if (props.handleKey) {
|
|
17
|
-
document.addEventListener("keydown", props.handleKey);
|
|
18
|
-
}
|
|
19
|
-
return () => {
|
|
20
|
-
if (props.handleKey) {
|
|
21
|
-
document.removeEventListener("keydown", props.handleKey);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
}, []);
|
|
25
|
-
|
|
26
|
-
const { error, info, status, refresh } = props;
|
|
27
|
-
|
|
28
|
-
// render fallback UI
|
|
29
|
-
return (
|
|
30
|
-
<div className="small" tabIndex={0}>
|
|
31
|
-
<div className=" m-2">
|
|
32
|
-
{status ? (
|
|
33
|
-
<div className="text-fancy">{"Trying to recover app..."}</div>
|
|
34
|
-
) : (
|
|
35
|
-
<div>
|
|
36
|
-
<button className="btn btn-block btn-sm btn-primary" onClick={refresh} type="button">
|
|
37
|
-
{"Recover the app"}
|
|
38
|
-
</button>
|
|
39
|
-
<div className="mt-2 mb-2">
|
|
40
|
-
{"Press "}
|
|
41
|
-
<kbd>{"R"}</kbd>
|
|
42
|
-
{" to recover the app, after you've done the changes"}
|
|
43
|
-
</div>
|
|
44
|
-
<hr />
|
|
45
|
-
{error ? (
|
|
46
|
-
<>
|
|
47
|
-
<h5 className="text-danger">{error.message}</h5>
|
|
48
|
-
<b>{"Stack:"}</b>
|
|
49
|
-
<pre>
|
|
50
|
-
{error.stack ? (
|
|
51
|
-
error.stack.split("↵").map((line, index) => (
|
|
52
|
-
<div key={index}>{line}</div>
|
|
53
|
-
))
|
|
54
|
-
) : null}
|
|
55
|
-
</pre>
|
|
56
|
-
</>
|
|
57
|
-
) : null}
|
|
58
|
-
<br />
|
|
59
|
-
{info && info.componentStack ? (
|
|
60
|
-
<>
|
|
61
|
-
<b>{"React info:"}</b>
|
|
62
|
-
<pre>
|
|
63
|
-
{info.componentStack.split("↵").map((line, index) => <div key={index}>{line}</div>)}
|
|
64
|
-
</pre>
|
|
65
|
-
</>
|
|
66
|
-
) : null}
|
|
67
|
-
</div>
|
|
68
|
-
)}
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export default TheError;
|