@blueprint-ts/core 4.1.0-beta.1 → 4.1.0-beta.3
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/dist/bulkRequests/BulkRequestEvent.enum.d.ts +4 -0
- package/dist/bulkRequests/BulkRequestEvent.enum.js +5 -0
- package/dist/bulkRequests/BulkRequestSender.d.ts +31 -0
- package/dist/bulkRequests/BulkRequestSender.js +161 -0
- package/dist/bulkRequests/BulkRequestWrapper.d.ts +15 -0
- package/dist/bulkRequests/BulkRequestWrapper.js +50 -0
- package/dist/bulkRequests/index.d.ts +5 -0
- package/dist/bulkRequests/index.js +5 -0
- package/{src/laravel/pagination/contracts/PaginationResponseBodyContract.ts → dist/laravel/pagination/contracts/PaginationResponseBodyContract.d.ts} +4 -4
- package/dist/laravel/pagination/contracts/PaginationResponseBodyContract.js +1 -0
- package/dist/laravel/pagination/dataDrivers/RequestDriver.d.ts +10 -0
- package/dist/laravel/pagination/dataDrivers/RequestDriver.js +18 -0
- package/dist/laravel/pagination/index.d.ts +4 -0
- package/dist/laravel/pagination/index.js +2 -0
- package/dist/laravel/requests/JsonBaseRequest.d.ts +14 -0
- package/dist/laravel/requests/JsonBaseRequest.js +15 -0
- package/dist/laravel/requests/PaginationJsonBaseRequest.d.ts +8 -0
- package/dist/laravel/requests/PaginationJsonBaseRequest.js +13 -0
- package/dist/laravel/requests/index.d.ts +7 -0
- package/dist/laravel/requests/index.js +5 -0
- package/dist/laravel/requests/responses/JsonResponse.d.ts +5 -0
- package/dist/laravel/requests/responses/JsonResponse.js +6 -0
- package/dist/laravel/requests/responses/PaginationResponse.d.ts +7 -0
- package/dist/laravel/requests/responses/PaginationResponse.js +9 -0
- package/dist/pagination/BasePaginator.d.ts +19 -0
- package/dist/pagination/BasePaginator.js +65 -0
- package/dist/pagination/InfiniteScroller.d.ts +6 -0
- package/dist/pagination/InfiniteScroller.js +17 -0
- package/dist/pagination/PageAwarePaginator.d.ts +32 -0
- package/dist/pagination/PageAwarePaginator.js +86 -0
- package/dist/pagination/StatePaginator.d.ts +25 -0
- package/dist/pagination/StatePaginator.js +55 -0
- package/dist/pagination/contracts/BaseViewDriverContract.d.ts +6 -0
- package/dist/pagination/contracts/BaseViewDriverContract.js +1 -0
- package/{src/pagination/contracts/BaseViewDriverFactoryContract.ts → dist/pagination/contracts/BaseViewDriverFactoryContract.d.ts} +2 -3
- package/dist/pagination/contracts/BaseViewDriverFactoryContract.js +1 -0
- package/dist/pagination/contracts/PaginateableRequestContract.d.ts +4 -0
- package/dist/pagination/contracts/PaginateableRequestContract.js +1 -0
- package/dist/pagination/contracts/PaginationDataDriverContract.d.ts +4 -0
- package/dist/pagination/contracts/PaginationDataDriverContract.js +1 -0
- package/{src/pagination/contracts/PaginationResponseContract.ts → dist/pagination/contracts/PaginationResponseContract.d.ts} +3 -5
- package/dist/pagination/contracts/PaginationResponseContract.js +1 -0
- package/{src/pagination/contracts/PaginatorLoadDataOptions.ts → dist/pagination/contracts/PaginatorLoadDataOptions.d.ts} +2 -2
- package/dist/pagination/contracts/PaginatorLoadDataOptions.js +1 -0
- package/{src/pagination/contracts/StatePaginationDataDriverContract.ts → dist/pagination/contracts/StatePaginationDataDriverContract.d.ts} +2 -3
- package/dist/pagination/contracts/StatePaginationDataDriverContract.js +1 -0
- package/dist/pagination/contracts/ViewDriverContract.d.ts +9 -0
- package/dist/pagination/contracts/ViewDriverContract.js +1 -0
- package/dist/pagination/contracts/ViewDriverFactoryContract.d.ts +4 -0
- package/dist/pagination/contracts/ViewDriverFactoryContract.js +1 -0
- package/dist/pagination/dataDrivers/ArrayDriver.d.ts +9 -0
- package/dist/pagination/dataDrivers/ArrayDriver.js +20 -0
- package/dist/pagination/dtos/PaginationDataDto.d.ts +7 -0
- package/dist/pagination/dtos/PaginationDataDto.js +12 -0
- package/dist/pagination/dtos/StatePaginationDataDto.d.ts +7 -0
- package/dist/pagination/dtos/StatePaginationDataDto.js +13 -0
- package/dist/pagination/factories/VueBaseViewDriverFactory.d.ts +5 -0
- package/dist/pagination/factories/VueBaseViewDriverFactory.js +6 -0
- package/dist/pagination/factories/VuePaginationDriverFactory.d.ts +5 -0
- package/dist/pagination/factories/VuePaginationDriverFactory.js +6 -0
- package/dist/pagination/frontendDrivers/VueBaseViewDriver.d.ts +11 -0
- package/dist/pagination/frontendDrivers/VueBaseViewDriver.js +19 -0
- package/dist/pagination/frontendDrivers/VuePaginationDriver.d.ts +21 -0
- package/dist/pagination/frontendDrivers/VuePaginationDriver.js +41 -0
- package/dist/pagination/index.d.ts +22 -0
- package/dist/pagination/index.js +13 -0
- package/dist/persistenceDrivers/LocalStorageDriver.d.ts +9 -0
- package/dist/persistenceDrivers/LocalStorageDriver.js +18 -0
- package/dist/persistenceDrivers/NonPersistentDriver.d.ts +7 -0
- package/dist/persistenceDrivers/NonPersistentDriver.js +8 -0
- package/dist/persistenceDrivers/SessionStorageDriver.d.ts +9 -0
- package/dist/persistenceDrivers/SessionStorageDriver.js +18 -0
- package/dist/persistenceDrivers/index.d.ts +6 -0
- package/dist/persistenceDrivers/index.js +4 -0
- package/dist/persistenceDrivers/types/PersistenceDriver.d.ts +5 -0
- package/dist/persistenceDrivers/types/PersistenceDriver.js +1 -0
- package/dist/requests/BaseRequest.d.ts +62 -0
- package/dist/requests/BaseRequest.js +224 -0
- package/dist/requests/ErrorHandler.d.ts +11 -0
- package/dist/requests/ErrorHandler.js +127 -0
- package/dist/requests/RequestConcurrencyMode.enum.d.ts +6 -0
- package/dist/requests/RequestConcurrencyMode.enum.js +7 -0
- package/dist/requests/RequestErrorRouter.d.ts +38 -0
- package/dist/requests/RequestErrorRouter.js +38 -0
- package/dist/requests/RequestEvents.enum.d.ts +4 -0
- package/dist/requests/RequestEvents.enum.js +5 -0
- package/dist/requests/RequestMethod.enum.d.ts +8 -0
- package/dist/requests/RequestMethod.enum.js +9 -0
- package/dist/requests/bodies/BinaryBody.d.ts +10 -0
- package/dist/requests/bodies/BinaryBody.js +22 -0
- package/dist/requests/bodies/FormDataBody.d.ts +14 -0
- package/dist/requests/bodies/FormDataBody.js +60 -0
- package/dist/requests/bodies/JsonBody.d.ts +8 -0
- package/dist/requests/bodies/JsonBody.js +13 -0
- package/{src/requests/contracts/AbortableRequestContract.ts → dist/requests/contracts/AbortableRequestContract.d.ts} +1 -1
- package/dist/requests/contracts/AbortableRequestContract.js +1 -0
- package/dist/requests/contracts/BaseRequestContract.d.ts +23 -0
- package/dist/requests/contracts/BaseRequestContract.js +1 -0
- package/dist/requests/contracts/BodyContract.d.ts +6 -0
- package/dist/requests/contracts/BodyContract.js +1 -0
- package/dist/requests/contracts/BodyFactoryContract.d.ts +4 -0
- package/dist/requests/contracts/BodyFactoryContract.js +1 -0
- package/dist/requests/contracts/DriverConfigContract.d.ts +8 -0
- package/dist/requests/contracts/DriverConfigContract.js +1 -0
- package/dist/requests/contracts/HeadersContract.d.ts +7 -0
- package/dist/requests/contracts/HeadersContract.js +1 -0
- package/dist/requests/contracts/RequestDriverContract.d.ts +8 -0
- package/dist/requests/contracts/RequestDriverContract.js +1 -0
- package/dist/requests/contracts/RequestLoaderContract.d.ts +4 -0
- package/dist/requests/contracts/RequestLoaderContract.js +1 -0
- package/{src/requests/contracts/RequestLoaderFactoryContract.ts → dist/requests/contracts/RequestLoaderFactoryContract.d.ts} +2 -3
- package/dist/requests/contracts/RequestLoaderFactoryContract.js +1 -0
- package/dist/requests/contracts/ResponseContract.d.ts +5 -0
- package/dist/requests/contracts/ResponseContract.js +1 -0
- package/dist/requests/drivers/contracts/ResponseHandlerContract.d.ts +9 -0
- package/dist/requests/drivers/contracts/ResponseHandlerContract.js +1 -0
- package/dist/requests/drivers/fetch/FetchDriver.d.ts +26 -0
- package/dist/requests/drivers/fetch/FetchDriver.js +73 -0
- package/dist/requests/drivers/fetch/FetchResponse.d.ts +12 -0
- package/dist/requests/drivers/fetch/FetchResponse.js +38 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestDriver.d.ts +13 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestDriver.js +107 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestResponse.d.ts +17 -0
- package/dist/requests/drivers/xhr/XMLHttpRequestResponse.js +84 -0
- package/dist/requests/exceptions/BadGatewayException.d.ts +3 -0
- package/dist/requests/exceptions/BadGatewayException.js +3 -0
- package/dist/requests/exceptions/BadRequestException.d.ts +3 -0
- package/dist/requests/exceptions/BadRequestException.js +3 -0
- package/dist/requests/exceptions/ConflictException.d.ts +3 -0
- package/dist/requests/exceptions/ConflictException.js +3 -0
- package/dist/requests/exceptions/ForbiddenException.d.ts +3 -0
- package/dist/requests/exceptions/ForbiddenException.js +3 -0
- package/dist/requests/exceptions/GatewayTimeoutException.d.ts +3 -0
- package/dist/requests/exceptions/GatewayTimeoutException.js +3 -0
- package/dist/requests/exceptions/GoneException.d.ts +3 -0
- package/dist/requests/exceptions/GoneException.js +3 -0
- package/dist/requests/exceptions/InvalidJsonException.d.ts +7 -0
- package/dist/requests/exceptions/InvalidJsonException.js +10 -0
- package/dist/requests/exceptions/LockedException.d.ts +3 -0
- package/dist/requests/exceptions/LockedException.js +3 -0
- package/dist/requests/exceptions/MethodNotAllowedException.d.ts +3 -0
- package/dist/requests/exceptions/MethodNotAllowedException.js +3 -0
- package/dist/requests/exceptions/NoResponseReceivedException.d.ts +3 -0
- package/{src/requests/exceptions/NoResponseReceivedException.ts → dist/requests/exceptions/NoResponseReceivedException.js} +3 -3
- package/dist/requests/exceptions/NotFoundException.d.ts +3 -0
- package/dist/requests/exceptions/NotFoundException.js +3 -0
- package/dist/requests/exceptions/NotImplementedException.d.ts +3 -0
- package/dist/requests/exceptions/NotImplementedException.js +3 -0
- package/dist/requests/exceptions/PageExpiredException.d.ts +3 -0
- package/dist/requests/exceptions/PageExpiredException.js +3 -0
- package/dist/requests/exceptions/PayloadTooLargeException.d.ts +3 -0
- package/dist/requests/exceptions/PayloadTooLargeException.js +3 -0
- package/dist/requests/exceptions/PreconditionFailedException.d.ts +3 -0
- package/dist/requests/exceptions/PreconditionFailedException.js +3 -0
- package/dist/requests/exceptions/RequestTimeoutException.d.ts +3 -0
- package/dist/requests/exceptions/RequestTimeoutException.js +3 -0
- package/dist/requests/exceptions/ResponseBodyException.d.ts +7 -0
- package/dist/requests/exceptions/ResponseBodyException.js +10 -0
- package/dist/requests/exceptions/ResponseException.d.ts +6 -0
- package/dist/requests/exceptions/ResponseException.js +9 -0
- package/dist/requests/exceptions/ServerErrorException.d.ts +3 -0
- package/dist/requests/exceptions/ServerErrorException.js +3 -0
- package/dist/requests/exceptions/ServiceUnavailableException.d.ts +3 -0
- package/dist/requests/exceptions/ServiceUnavailableException.js +3 -0
- package/dist/requests/exceptions/StaleResponseException.d.ts +5 -0
- package/dist/requests/exceptions/StaleResponseException.js +10 -0
- package/dist/requests/exceptions/TooManyRequestsException.d.ts +3 -0
- package/dist/requests/exceptions/TooManyRequestsException.js +3 -0
- package/dist/requests/exceptions/UnauthorizedException.d.ts +3 -0
- package/dist/requests/exceptions/UnauthorizedException.js +3 -0
- package/dist/requests/exceptions/UnsupportedMediaTypeException.d.ts +3 -0
- package/dist/requests/exceptions/UnsupportedMediaTypeException.js +3 -0
- package/dist/requests/exceptions/ValidationException.d.ts +3 -0
- package/dist/requests/exceptions/ValidationException.js +3 -0
- package/dist/requests/exceptions/index.d.ts +25 -0
- package/dist/requests/exceptions/index.js +25 -0
- package/dist/requests/factories/BinaryBodyFactory.d.ts +8 -0
- package/dist/requests/factories/BinaryBodyFactory.js +9 -0
- package/dist/requests/factories/FormDataFactory.d.ts +12 -0
- package/dist/requests/factories/FormDataFactory.js +6 -0
- package/dist/requests/factories/JsonBodyFactory.d.ts +5 -0
- package/dist/requests/factories/JsonBodyFactory.js +6 -0
- package/dist/requests/index.d.ts +31 -0
- package/dist/requests/index.js +19 -0
- package/dist/requests/responses/BaseResponse.d.ts +14 -0
- package/dist/requests/responses/BaseResponse.js +36 -0
- package/dist/requests/responses/BlobResponse.d.ts +7 -0
- package/dist/requests/responses/BlobResponse.js +16 -0
- package/dist/requests/responses/JsonResponse.d.ts +5 -0
- package/dist/requests/responses/JsonResponse.js +12 -0
- package/dist/requests/responses/PlainTextResponse.d.ts +5 -0
- package/dist/requests/responses/PlainTextResponse.js +12 -0
- package/{src/requests/types/RequestConcurrencyOptions.ts → dist/requests/types/RequestConcurrencyOptions.d.ts} +4 -5
- package/dist/requests/types/RequestConcurrencyOptions.js +1 -0
- package/dist/requests/types/RequestUploadProgress.d.ts +6 -0
- package/dist/requests/types/RequestUploadProgress.js +1 -0
- package/dist/support/DeferredPromise.d.ts +37 -0
- package/dist/support/DeferredPromise.js +55 -0
- package/dist/support/helpers.d.ts +5 -0
- package/dist/support/helpers.js +69 -0
- package/{src/support/index.ts → dist/support/index.d.ts} +3 -4
- package/dist/support/index.js +3 -0
- package/dist/vue/composables/useConfirmDialog.d.ts +20 -0
- package/dist/vue/composables/useConfirmDialog.js +52 -0
- package/dist/vue/composables/useGlobalCheckbox.d.ts +13 -0
- package/dist/vue/composables/useGlobalCheckbox.js +123 -0
- package/dist/vue/composables/useIsEmpty.d.ts +4 -0
- package/dist/vue/composables/useIsEmpty.js +27 -0
- package/dist/vue/composables/useIsOpen.d.ts +5 -0
- package/dist/vue/composables/useIsOpen.js +25 -0
- package/dist/vue/composables/useIsOpenFromVar.d.ts +6 -0
- package/dist/vue/composables/useIsOpenFromVar.js +45 -0
- package/dist/vue/composables/useModelWrapper.d.ts +9 -0
- package/dist/vue/composables/useModelWrapper.js +18 -0
- package/dist/vue/composables/useOnOpen.d.ts +7 -0
- package/dist/vue/composables/useOnOpen.js +25 -0
- package/{src/vue/contracts/ModelValueOptions.ts → dist/vue/contracts/ModelValueOptions.d.ts} +1 -1
- package/dist/vue/contracts/ModelValueOptions.js +1 -0
- package/dist/vue/contracts/ModelValueProps.d.ts +3 -0
- package/dist/vue/contracts/ModelValueProps.js +1 -0
- package/dist/vue/forms/BaseForm.d.ts +162 -0
- package/dist/vue/forms/BaseForm.js +997 -0
- package/dist/vue/forms/PropertyAwareArray.d.ts +53 -0
- package/dist/vue/forms/PropertyAwareArray.js +54 -0
- package/{src/vue/forms/index.ts → dist/vue/forms/index.d.ts} +9 -11
- package/dist/vue/forms/index.js +6 -0
- package/dist/vue/forms/types/PersistedForm.d.ts +6 -0
- package/dist/vue/forms/types/PersistedForm.js +1 -0
- package/dist/vue/forms/validation/ValidationMode.enum.d.ts +11 -0
- package/dist/vue/forms/validation/ValidationMode.enum.js +14 -0
- package/dist/vue/forms/validation/index.d.ts +12 -0
- package/dist/vue/forms/validation/index.js +9 -0
- package/dist/vue/forms/validation/rules/BaseRule.d.ts +5 -0
- package/dist/vue/forms/validation/rules/BaseRule.js +5 -0
- package/dist/vue/forms/validation/rules/ConfirmedRule.d.ts +10 -0
- package/dist/vue/forms/validation/rules/ConfirmedRule.js +26 -0
- package/dist/vue/forms/validation/rules/EmailRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/EmailRule.js +19 -0
- package/dist/vue/forms/validation/rules/JsonRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/JsonRule.js +25 -0
- package/dist/vue/forms/validation/rules/MinRule.d.ts +26 -0
- package/dist/vue/forms/validation/rules/MinRule.js +52 -0
- package/dist/vue/forms/validation/rules/RequiredRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/RequiredRule.js +16 -0
- package/dist/vue/forms/validation/rules/UrlRule.d.ts +7 -0
- package/dist/vue/forms/validation/rules/UrlRule.js +22 -0
- package/{src/vue/forms/validation/types/BidirectionalRule.ts → dist/vue/forms/validation/types/BidirectionalRule.d.ts} +4 -4
- package/dist/vue/forms/validation/types/BidirectionalRule.js +1 -0
- package/dist/vue/forms/validation/types/ValidationRules.d.ts +11 -0
- package/dist/vue/forms/validation/types/ValidationRules.js +1 -0
- package/dist/vue/index.d.ts +11 -0
- package/dist/vue/index.js +10 -0
- package/dist/vue/requests/factories/VueRequestLoaderFactory.d.ts +6 -0
- package/dist/vue/requests/factories/VueRequestLoaderFactory.js +6 -0
- package/{src/vue/requests/index.ts → dist/vue/requests/index.d.ts} +4 -5
- package/dist/vue/requests/index.js +4 -0
- package/dist/vue/requests/loaders/VueRequestBatchLoader.d.ts +12 -0
- package/dist/vue/requests/loaders/VueRequestBatchLoader.js +29 -0
- package/dist/vue/requests/loaders/VueRequestLoader.d.ts +8 -0
- package/dist/vue/requests/loaders/VueRequestLoader.js +12 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceBoundView.d.ts +57 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceBoundView.js +135 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceRequestResolver.d.ts +6 -0
- package/dist/vue/router/routeResourceBinding/RouteResourceRequestResolver.js +20 -0
- package/dist/vue/router/routeResourceBinding/defineRoute.d.ts +23 -0
- package/dist/vue/router/routeResourceBinding/defineRoute.js +42 -0
- package/dist/vue/router/routeResourceBinding/index.d.ts +8 -0
- package/dist/vue/router/routeResourceBinding/index.js +6 -0
- package/dist/vue/router/routeResourceBinding/installRouteInjection.d.ts +14 -0
- package/dist/vue/router/routeResourceBinding/installRouteInjection.js +133 -0
- package/dist/vue/router/routeResourceBinding/types.d.ts +55 -0
- package/dist/vue/router/routeResourceBinding/types.js +1 -0
- package/dist/vue/router/routeResourceBinding/useRouteResource.d.ts +8 -0
- package/dist/vue/router/routeResourceBinding/useRouteResource.js +29 -0
- package/dist/vue/state/State.d.ts +75 -0
- package/dist/vue/state/State.js +267 -0
- package/dist/vue/state/index.d.ts +2 -0
- package/dist/vue/state/index.js +2 -0
- package/package.json +81 -23
- package/.editorconfig +0 -508
- package/.eslintrc.cjs +0 -15
- package/.prettierrc.json +0 -8
- package/CHANGELOG.md +0 -213
- package/docker-compose.yaml +0 -8
- package/docs/.vitepress/config.ts +0 -124
- package/docs/index.md +0 -13
- package/docs/laravel/pagination.md +0 -67
- package/docs/laravel/requests.md +0 -62
- package/docs/services/pagination/index.md +0 -46
- package/docs/services/pagination/infinite-scroller.md +0 -20
- package/docs/services/pagination/page-aware.md +0 -51
- package/docs/services/pagination/state-pagination.md +0 -77
- package/docs/services/pagination/updating-rows.md +0 -52
- package/docs/services/persistence/index.md +0 -46
- package/docs/services/requests/abort-requests.md +0 -29
- package/docs/services/requests/bulk-requests.md +0 -70
- package/docs/services/requests/concurrency.md +0 -58
- package/docs/services/requests/drivers.md +0 -115
- package/docs/services/requests/error-handling.md +0 -153
- package/docs/services/requests/events.md +0 -53
- package/docs/services/requests/file-uploads.md +0 -105
- package/docs/services/requests/getting-started.md +0 -201
- package/docs/services/requests/headers.md +0 -40
- package/docs/services/requests/loading.md +0 -63
- package/docs/services/requests/request-bodies.md +0 -61
- package/docs/services/requests/responses.md +0 -34
- package/docs/services/support/deferred-promise.md +0 -63
- package/docs/services/support/helpers.md +0 -77
- package/docs/services/support/index.md +0 -6
- package/docs/upgrading/v1-to-v2.md +0 -64
- package/docs/upgrading/v2-to-v3.md +0 -52
- package/docs/upgrading/v3-to-v4.md +0 -214
- package/docs/upgrading.md +0 -0
- package/docs/vue/composables/use-confirm-dialog.md +0 -96
- package/docs/vue/composables/use-global-checkbox.md +0 -73
- package/docs/vue/composables/use-is-empty.md +0 -26
- package/docs/vue/composables/use-is-open-from-var.md +0 -32
- package/docs/vue/composables/use-is-open.md +0 -28
- package/docs/vue/composables/use-model-wrapper.md +0 -29
- package/docs/vue/composables/use-on-open.md +0 -26
- package/docs/vue/forms/arrays.md +0 -102
- package/docs/vue/forms/errors.md +0 -52
- package/docs/vue/forms/index.md +0 -99
- package/docs/vue/forms/payloads.md +0 -99
- package/docs/vue/forms/persistence.md +0 -19
- package/docs/vue/forms/state-and-properties.md +0 -26
- package/docs/vue/forms/utilities.md +0 -27
- package/docs/vue/forms/validation.md +0 -189
- package/docs/vue/requests/loading.md +0 -51
- package/docs/vue/router/route-resource-binding.md +0 -240
- package/docs/vue/state.md +0 -309
- package/env.d.ts +0 -1
- package/eslint.config.js +0 -15
- package/release-tool.json +0 -26
- package/src/bulkRequests/BulkRequestEvent.enum.ts +0 -4
- package/src/bulkRequests/BulkRequestSender.ts +0 -196
- package/src/bulkRequests/BulkRequestWrapper.ts +0 -49
- package/src/bulkRequests/index.ts +0 -6
- package/src/laravel/pagination/dataDrivers/RequestDriver.ts +0 -30
- package/src/laravel/pagination/index.ts +0 -6
- package/src/laravel/requests/JsonBaseRequest.ts +0 -35
- package/src/laravel/requests/PaginationJsonBaseRequest.ts +0 -29
- package/src/laravel/requests/index.ts +0 -9
- package/src/laravel/requests/responses/JsonResponse.ts +0 -8
- package/src/laravel/requests/responses/PaginationResponse.ts +0 -16
- package/src/pagination/BasePaginator.ts +0 -94
- package/src/pagination/InfiniteScroller.ts +0 -22
- package/src/pagination/PageAwarePaginator.ts +0 -132
- package/src/pagination/StatePaginator.ts +0 -86
- package/src/pagination/contracts/BaseViewDriverContract.ts +0 -6
- package/src/pagination/contracts/PaginateableRequestContract.ts +0 -13
- package/src/pagination/contracts/PaginationDataDriverContract.ts +0 -5
- package/src/pagination/contracts/ViewDriverContract.ts +0 -10
- package/src/pagination/contracts/ViewDriverFactoryContract.ts +0 -5
- package/src/pagination/dataDrivers/ArrayDriver.ts +0 -28
- package/src/pagination/dtos/PaginationDataDto.ts +0 -14
- package/src/pagination/dtos/StatePaginationDataDto.ts +0 -19
- package/src/pagination/factories/VueBaseViewDriverFactory.ts +0 -9
- package/src/pagination/factories/VuePaginationDriverFactory.ts +0 -9
- package/src/pagination/frontendDrivers/VueBaseViewDriver.ts +0 -28
- package/src/pagination/frontendDrivers/VuePaginationDriver.ts +0 -61
- package/src/pagination/index.ts +0 -46
- package/src/persistenceDrivers/LocalStorageDriver.ts +0 -22
- package/src/persistenceDrivers/NonPersistentDriver.ts +0 -12
- package/src/persistenceDrivers/SessionStorageDriver.ts +0 -22
- package/src/persistenceDrivers/index.ts +0 -8
- package/src/persistenceDrivers/types/PersistenceDriver.ts +0 -5
- package/src/requests/BaseRequest.ts +0 -321
- package/src/requests/ErrorHandler.ts +0 -144
- package/src/requests/RequestConcurrencyMode.enum.ts +0 -6
- package/src/requests/RequestErrorRouter.ts +0 -89
- package/src/requests/RequestEvents.enum.ts +0 -4
- package/src/requests/RequestMethod.enum.ts +0 -8
- package/src/requests/bodies/FormDataBody.ts +0 -81
- package/src/requests/bodies/JsonBody.ts +0 -16
- package/src/requests/contracts/BaseRequestContract.ts +0 -39
- package/src/requests/contracts/BodyContract.ts +0 -7
- package/src/requests/contracts/BodyFactoryContract.ts +0 -5
- package/src/requests/contracts/DriverConfigContract.ts +0 -9
- package/src/requests/contracts/HeadersContract.ts +0 -5
- package/src/requests/contracts/RequestDriverContract.ts +0 -15
- package/src/requests/contracts/RequestLoaderContract.ts +0 -5
- package/src/requests/contracts/ResponseContract.ts +0 -7
- package/src/requests/drivers/contracts/ResponseHandlerContract.ts +0 -10
- package/src/requests/drivers/fetch/FetchDriver.ts +0 -115
- package/src/requests/drivers/fetch/FetchResponse.ts +0 -30
- package/src/requests/drivers/xhr/XMLHttpRequestDriver.ts +0 -138
- package/src/requests/drivers/xhr/XMLHttpRequestResponse.ts +0 -95
- package/src/requests/exceptions/BadGatewayException.ts +0 -3
- package/src/requests/exceptions/BadRequestException.ts +0 -3
- package/src/requests/exceptions/ConflictException.ts +0 -3
- package/src/requests/exceptions/ForbiddenException.ts +0 -3
- package/src/requests/exceptions/GatewayTimeoutException.ts +0 -3
- package/src/requests/exceptions/GoneException.ts +0 -3
- package/src/requests/exceptions/InvalidJsonException.ts +0 -15
- package/src/requests/exceptions/LockedException.ts +0 -3
- package/src/requests/exceptions/MethodNotAllowedException.ts +0 -3
- package/src/requests/exceptions/NotFoundException.ts +0 -3
- package/src/requests/exceptions/NotImplementedException.ts +0 -3
- package/src/requests/exceptions/PageExpiredException.ts +0 -3
- package/src/requests/exceptions/PayloadTooLargeException.ts +0 -3
- package/src/requests/exceptions/PreconditionFailedException.ts +0 -3
- package/src/requests/exceptions/RequestTimeoutException.ts +0 -3
- package/src/requests/exceptions/ResponseBodyException.ts +0 -15
- package/src/requests/exceptions/ResponseException.ts +0 -11
- package/src/requests/exceptions/ServerErrorException.ts +0 -3
- package/src/requests/exceptions/ServiceUnavailableException.ts +0 -3
- package/src/requests/exceptions/StaleResponseException.ts +0 -13
- package/src/requests/exceptions/TooManyRequestsException.ts +0 -3
- package/src/requests/exceptions/UnauthorizedException.ts +0 -3
- package/src/requests/exceptions/UnsupportedMediaTypeException.ts +0 -3
- package/src/requests/exceptions/ValidationException.ts +0 -3
- package/src/requests/exceptions/index.ts +0 -51
- package/src/requests/factories/FormDataFactory.ts +0 -17
- package/src/requests/factories/JsonBodyFactory.ts +0 -9
- package/src/requests/index.ts +0 -61
- package/src/requests/responses/BaseResponse.ts +0 -41
- package/src/requests/responses/BlobResponse.ts +0 -19
- package/src/requests/responses/JsonResponse.ts +0 -15
- package/src/requests/responses/PlainTextResponse.ts +0 -15
- package/src/requests/types/RequestUploadProgress.ts +0 -6
- package/src/support/DeferredPromise.ts +0 -67
- package/src/support/helpers.ts +0 -78
- package/src/vue/composables/useConfirmDialog.ts +0 -63
- package/src/vue/composables/useGlobalCheckbox.ts +0 -145
- package/src/vue/composables/useIsEmpty.ts +0 -34
- package/src/vue/composables/useIsOpen.ts +0 -37
- package/src/vue/composables/useIsOpenFromVar.ts +0 -61
- package/src/vue/composables/useModelWrapper.ts +0 -27
- package/src/vue/composables/useOnOpen.ts +0 -34
- package/src/vue/contracts/ModelValueProps.ts +0 -3
- package/src/vue/forms/BaseForm.ts +0 -1192
- package/src/vue/forms/PropertyAwareArray.ts +0 -81
- package/src/vue/forms/types/PersistedForm.ts +0 -6
- package/src/vue/forms/validation/ValidationMode.enum.ts +0 -14
- package/src/vue/forms/validation/index.ts +0 -15
- package/src/vue/forms/validation/rules/BaseRule.ts +0 -7
- package/src/vue/forms/validation/rules/ConfirmedRule.ts +0 -39
- package/src/vue/forms/validation/rules/EmailRule.ts +0 -23
- package/src/vue/forms/validation/rules/JsonRule.ts +0 -28
- package/src/vue/forms/validation/rules/MinRule.ts +0 -61
- package/src/vue/forms/validation/rules/RequiredRule.ts +0 -19
- package/src/vue/forms/validation/rules/UrlRule.ts +0 -24
- package/src/vue/forms/validation/types/ValidationRules.ts +0 -15
- package/src/vue/index.ts +0 -14
- package/src/vue/requests/factories/VueRequestLoaderFactory.ts +0 -10
- package/src/vue/requests/loaders/VueRequestBatchLoader.ts +0 -35
- package/src/vue/requests/loaders/VueRequestLoader.ts +0 -18
- package/src/vue/router/routeResourceBinding/RouteResourceBoundView.ts +0 -145
- package/src/vue/router/routeResourceBinding/RouteResourceRequestResolver.ts +0 -11
- package/src/vue/router/routeResourceBinding/defineRoute.ts +0 -59
- package/src/vue/router/routeResourceBinding/index.ts +0 -11
- package/src/vue/router/routeResourceBinding/installRouteInjection.ts +0 -164
- package/src/vue/router/routeResourceBinding/types.ts +0 -53
- package/src/vue/router/routeResourceBinding/useRouteResource.ts +0 -24
- package/src/vue/state/State.ts +0 -380
- package/src/vue/state/index.ts +0 -3
- package/tests/service/bulkRequests/BulkRequestSender.test.ts +0 -76
- package/tests/service/bulkRequests/BulkRequestWrapper.test.ts +0 -51
- package/tests/service/helpers/mergeDeep.test.ts +0 -53
- package/tests/service/laravel/pagination/dataDrivers/RequestDriver.test.ts +0 -84
- package/tests/service/laravel/requests/JsonBaseRequest.test.ts +0 -43
- package/tests/service/laravel/requests/PaginationJsonBaseRequest.test.ts +0 -58
- package/tests/service/laravel/requests/responses/JsonResponse.test.ts +0 -59
- package/tests/service/laravel/requests/responses/PaginationResponse.test.ts +0 -127
- package/tests/service/pagination/BasePaginator.test.ts +0 -100
- package/tests/service/pagination/InfiniteScroller.test.ts +0 -101
- package/tests/service/pagination/PageAwarePaginator.test.ts +0 -133
- package/tests/service/pagination/StatePaginator.test.ts +0 -76
- package/tests/service/pagination/VueViewDrivers.test.ts +0 -46
- package/tests/service/pagination/dtos/PaginationDataDto.test.ts +0 -35
- package/tests/service/pagination/dtos/StatePaginationDataDto.test.ts +0 -14
- package/tests/service/pagination/factories/VuePaginationDriverFactory.test.ts +0 -32
- package/tests/service/pagination/frontendDrivers/VuePaginationDriver.test.ts +0 -66
- package/tests/service/persistenceDrivers/PersistenceDrivers.test.ts +0 -56
- package/tests/service/requests/BaseRequest.test.ts +0 -250
- package/tests/service/requests/BodiesAndFactories.test.ts +0 -28
- package/tests/service/requests/Enums.test.ts +0 -20
- package/tests/service/requests/ErrorHandler.test.ts +0 -188
- package/tests/service/requests/FormDataBody.test.ts +0 -63
- package/tests/service/requests/RequestErrorRouter.test.ts +0 -44
- package/tests/service/requests/Responses.test.ts +0 -83
- package/tests/service/requests/exceptions/Exceptions.test.ts +0 -43
- package/tests/service/requests/fetch/FetchDriver.test.ts +0 -76
- package/tests/service/requests/fetch/FetchResponse.test.ts +0 -21
- package/tests/service/requests/xhr/XMLHttpRequestDriver.test.ts +0 -178
- package/tests/service/support/DeferredPromise.test.ts +0 -40
- package/tests/service/support/helpers.test.ts +0 -37
- package/tests/vue/composables/useConfirmDialog.test.ts +0 -77
- package/tests/vue/composables/useGlobalCheckbox.test.ts +0 -126
- package/tests/vue/composables/useIsEmpty.test.ts +0 -18
- package/tests/vue/composables/useIsOpen.test.ts +0 -25
- package/tests/vue/composables/useIsOpenFromVar.test.ts +0 -22
- package/tests/vue/composables/useModelWrapper.test.ts +0 -30
- package/tests/vue/composables/useOnOpen.test.ts +0 -26
- package/tests/vue/forms/BaseForm.behavior.test.ts +0 -98
- package/tests/vue/forms/BaseForm.transformers.test.ts +0 -109
- package/tests/vue/forms/PropertyAwareArray.test.ts +0 -30
- package/tests/vue/forms/validation/ValidationRules.test.ts +0 -79
- package/tests/vue/requests/VueRequestLoaders.test.ts +0 -48
- package/tests/vue/router/routeResourceBinding/RouteResourceBoundView.test.ts +0 -344
- package/tests/vue/router/routeResourceBinding/RouteResourceUtils.test.ts +0 -70
- package/tests/vue/router/routeResourceBinding/installRouteInjection.test.ts +0 -450
- package/tests/vue/state/State.test.ts +0 -151
- package/tsconfig.json +0 -114
- package/vite.config.ts +0 -34
- package/vitest.config.ts +0 -23
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ValidationException } from './ValidationException'
|
|
2
|
-
import { NotFoundException } from './NotFoundException'
|
|
3
|
-
import { NoResponseReceivedException } from './NoResponseReceivedException'
|
|
4
|
-
import { UnauthorizedException } from './UnauthorizedException'
|
|
5
|
-
import { ForbiddenException } from './ForbiddenException'
|
|
6
|
-
import { BadRequestException } from './BadRequestException'
|
|
7
|
-
import { MethodNotAllowedException } from './MethodNotAllowedException'
|
|
8
|
-
import { RequestTimeoutException } from './RequestTimeoutException'
|
|
9
|
-
import { ConflictException } from './ConflictException'
|
|
10
|
-
import { GoneException } from './GoneException'
|
|
11
|
-
import { PreconditionFailedException } from './PreconditionFailedException'
|
|
12
|
-
import { PayloadTooLargeException } from './PayloadTooLargeException'
|
|
13
|
-
import { UnsupportedMediaTypeException } from './UnsupportedMediaTypeException'
|
|
14
|
-
import { PageExpiredException } from './PageExpiredException'
|
|
15
|
-
import { ServerErrorException } from './ServerErrorException'
|
|
16
|
-
import { NotImplementedException } from './NotImplementedException'
|
|
17
|
-
import { BadGatewayException } from './BadGatewayException'
|
|
18
|
-
import { ServiceUnavailableException } from './ServiceUnavailableException'
|
|
19
|
-
import { GatewayTimeoutException } from './GatewayTimeoutException'
|
|
20
|
-
import { TooManyRequestsException } from './TooManyRequestsException'
|
|
21
|
-
import { LockedException } from './LockedException'
|
|
22
|
-
import { InvalidJsonException } from './InvalidJsonException'
|
|
23
|
-
import { ResponseException } from './ResponseException'
|
|
24
|
-
import { ResponseBodyException } from './ResponseBodyException'
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
ValidationException,
|
|
28
|
-
NotFoundException,
|
|
29
|
-
NoResponseReceivedException,
|
|
30
|
-
UnauthorizedException,
|
|
31
|
-
PageExpiredException,
|
|
32
|
-
ServerErrorException,
|
|
33
|
-
NotImplementedException,
|
|
34
|
-
BadGatewayException,
|
|
35
|
-
ServiceUnavailableException,
|
|
36
|
-
GatewayTimeoutException,
|
|
37
|
-
TooManyRequestsException,
|
|
38
|
-
LockedException,
|
|
39
|
-
InvalidJsonException,
|
|
40
|
-
ResponseException,
|
|
41
|
-
ResponseBodyException,
|
|
42
|
-
ForbiddenException,
|
|
43
|
-
BadRequestException,
|
|
44
|
-
MethodNotAllowedException,
|
|
45
|
-
RequestTimeoutException,
|
|
46
|
-
ConflictException,
|
|
47
|
-
GoneException,
|
|
48
|
-
PreconditionFailedException,
|
|
49
|
-
PayloadTooLargeException,
|
|
50
|
-
UnsupportedMediaTypeException
|
|
51
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FormDataBody } from '../bodies/FormDataBody'
|
|
2
|
-
import { type BodyFactoryContract } from '../contracts/BodyFactoryContract'
|
|
3
|
-
import { type BodyContract } from '../contracts/BodyContract'
|
|
4
|
-
|
|
5
|
-
type FormDataPrimitive = string | number | boolean | null | Date | Blob
|
|
6
|
-
|
|
7
|
-
export type FormDataValue = FormDataPrimitive | FormDataValue[] | { [key: string]: FormDataValue }
|
|
8
|
-
|
|
9
|
-
export class FormDataFactory<
|
|
10
|
-
RequestBodyInterface extends {
|
|
11
|
-
[K in keyof RequestBodyInterface]: FormDataValue | undefined
|
|
12
|
-
}
|
|
13
|
-
> implements BodyFactoryContract<RequestBodyInterface> {
|
|
14
|
-
public make(body: RequestBodyInterface): BodyContract {
|
|
15
|
-
return new FormDataBody<RequestBodyInterface>(body)
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { JsonBody } from '../bodies/JsonBody'
|
|
2
|
-
import { type BodyFactoryContract } from '../contracts/BodyFactoryContract'
|
|
3
|
-
import { type BodyContract } from '../contracts/BodyContract'
|
|
4
|
-
|
|
5
|
-
export class JsonBodyFactory<RequestBodyInterface> implements BodyFactoryContract<RequestBodyInterface> {
|
|
6
|
-
public make(body: RequestBodyInterface): BodyContract {
|
|
7
|
-
return new JsonBody<RequestBodyInterface>(body)
|
|
8
|
-
}
|
|
9
|
-
}
|
package/src/requests/index.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { FetchDriver } from './drivers/fetch/FetchDriver'
|
|
2
|
-
import { BaseResponse } from './responses/BaseResponse'
|
|
3
|
-
import { JsonResponse } from './responses/JsonResponse'
|
|
4
|
-
import { PlainTextResponse } from './responses/PlainTextResponse'
|
|
5
|
-
import { BlobResponse } from './responses/BlobResponse'
|
|
6
|
-
import { BaseRequest } from './BaseRequest'
|
|
7
|
-
import { ErrorHandler } from './ErrorHandler'
|
|
8
|
-
import { RequestErrorRouter } from './RequestErrorRouter'
|
|
9
|
-
import { RequestEvents } from './RequestEvents.enum'
|
|
10
|
-
import { RequestMethodEnum } from './RequestMethod.enum'
|
|
11
|
-
import { RequestConcurrencyMode } from './RequestConcurrencyMode.enum'
|
|
12
|
-
import { JsonBodyFactory } from './factories/JsonBodyFactory'
|
|
13
|
-
import { FormDataFactory } from './factories/FormDataFactory'
|
|
14
|
-
import { type BodyContract } from './contracts/BodyContract'
|
|
15
|
-
import { type RequestLoaderContract } from './contracts/RequestLoaderContract'
|
|
16
|
-
import { type RequestDriverContract } from './contracts/RequestDriverContract'
|
|
17
|
-
import { type RequestLoaderFactoryContract } from './contracts/RequestLoaderFactoryContract'
|
|
18
|
-
import { type DriverConfigContract } from './contracts/DriverConfigContract'
|
|
19
|
-
import { type BodyFactoryContract } from './contracts/BodyFactoryContract'
|
|
20
|
-
import { type ResponseHandlerContract } from './drivers/contracts/ResponseHandlerContract'
|
|
21
|
-
import { type BaseRequestContract } from './contracts/BaseRequestContract'
|
|
22
|
-
import { ResponseException } from './exceptions/ResponseException'
|
|
23
|
-
import { StaleResponseException } from './exceptions/StaleResponseException'
|
|
24
|
-
import { type HeaderValue, type HeadersContract } from './contracts/HeadersContract'
|
|
25
|
-
import { type RequestConcurrencyOptions } from './types/RequestConcurrencyOptions'
|
|
26
|
-
import { type RequestUploadProgress } from './types/RequestUploadProgress'
|
|
27
|
-
import { XMLHttpRequestDriver } from './drivers/xhr/XMLHttpRequestDriver'
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
FetchDriver,
|
|
31
|
-
BaseResponse,
|
|
32
|
-
JsonResponse,
|
|
33
|
-
BlobResponse,
|
|
34
|
-
PlainTextResponse,
|
|
35
|
-
BaseRequest,
|
|
36
|
-
ErrorHandler,
|
|
37
|
-
RequestErrorRouter,
|
|
38
|
-
RequestEvents,
|
|
39
|
-
RequestMethodEnum,
|
|
40
|
-
RequestConcurrencyMode,
|
|
41
|
-
ResponseException,
|
|
42
|
-
StaleResponseException,
|
|
43
|
-
JsonBodyFactory,
|
|
44
|
-
FormDataFactory,
|
|
45
|
-
XMLHttpRequestDriver
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type {
|
|
49
|
-
RequestDriverContract,
|
|
50
|
-
RequestLoaderContract,
|
|
51
|
-
BodyContract,
|
|
52
|
-
RequestLoaderFactoryContract,
|
|
53
|
-
DriverConfigContract,
|
|
54
|
-
BodyFactoryContract,
|
|
55
|
-
ResponseHandlerContract,
|
|
56
|
-
BaseRequestContract,
|
|
57
|
-
HeaderValue,
|
|
58
|
-
HeadersContract,
|
|
59
|
-
RequestConcurrencyOptions,
|
|
60
|
-
RequestUploadProgress
|
|
61
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type ResponseHandlerContract } from '../drivers/contracts/ResponseHandlerContract'
|
|
2
|
-
import { type HeadersContract } from '../contracts/HeadersContract'
|
|
3
|
-
import { type ResponseContract } from '../contracts/ResponseContract'
|
|
4
|
-
|
|
5
|
-
export abstract class BaseResponse<ResponseInterface> implements ResponseContract<ResponseInterface> {
|
|
6
|
-
private body?: ResponseInterface
|
|
7
|
-
|
|
8
|
-
protected response?: ResponseHandlerContract
|
|
9
|
-
|
|
10
|
-
public abstract getAcceptHeader(): string
|
|
11
|
-
|
|
12
|
-
protected abstract resolveBody(): Promise<ResponseInterface>
|
|
13
|
-
|
|
14
|
-
public async setResponse(response: ResponseHandlerContract): Promise<ResponseInterface> {
|
|
15
|
-
this.response = response
|
|
16
|
-
|
|
17
|
-
this.body = await this.resolveBody()
|
|
18
|
-
|
|
19
|
-
return this.body
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public getRawResponse(): Response | undefined {
|
|
23
|
-
return this.response?.getRawResponse()
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public getStatusCode(): number | undefined {
|
|
27
|
-
return this.response?.getStatusCode()
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public getHeaders(): HeadersContract | undefined {
|
|
31
|
-
return this.response?.getHeaders()
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public getBody(): ResponseInterface {
|
|
35
|
-
if (this.body === undefined) {
|
|
36
|
-
throw new Error('Response body is not set')
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return this.body
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BaseResponse } from './BaseResponse'
|
|
2
|
-
|
|
3
|
-
export class BlobResponse extends BaseResponse<Blob> {
|
|
4
|
-
public constructor(protected mimeType: string = 'application/octet-stream') {
|
|
5
|
-
super()
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
public getAcceptHeader(): string {
|
|
9
|
-
return this.mimeType
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
protected resolveBody(): Promise<Blob> {
|
|
13
|
-
if (!this.response) {
|
|
14
|
-
throw new Error('Response is not set')
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return this.response.blob()
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseResponse } from './BaseResponse'
|
|
2
|
-
|
|
3
|
-
export class JsonResponse<ResponseBodyInterface> extends BaseResponse<ResponseBodyInterface> {
|
|
4
|
-
public getAcceptHeader(): string {
|
|
5
|
-
return 'application/json'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
protected resolveBody(): Promise<ResponseBodyInterface> {
|
|
9
|
-
if (!this.response) {
|
|
10
|
-
throw new Error('Response is not set')
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return this.response.json<ResponseBodyInterface>()
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseResponse } from './BaseResponse'
|
|
2
|
-
|
|
3
|
-
export class PlainTextResponse extends BaseResponse<string> {
|
|
4
|
-
public getAcceptHeader(): string {
|
|
5
|
-
return 'text/plain'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
protected resolveBody(): Promise<string> {
|
|
9
|
-
if (!this.response) {
|
|
10
|
-
throw new Error('Response is not set')
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return this.response.text()
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A new instance of deferred is constructed by calling `new DeferredPromse<T>()`.
|
|
3
|
-
* The purpose of the deferred object is to expose the associated Promise
|
|
4
|
-
* instance APIs that can be used for signaling the successful
|
|
5
|
-
* or unsuccessful completion, as well as the state of the task.
|
|
6
|
-
* @export
|
|
7
|
-
* @class DeferredPromise
|
|
8
|
-
* @implements {Promise<T>}
|
|
9
|
-
* @template T
|
|
10
|
-
* @example
|
|
11
|
-
* const deferred = new DeferredPromse<string>();
|
|
12
|
-
* console.log(deferred.state); // 'pending'
|
|
13
|
-
*
|
|
14
|
-
* deferred
|
|
15
|
-
* .then(str => console.log(str))
|
|
16
|
-
* .catch(err => console.error(err));
|
|
17
|
-
*
|
|
18
|
-
* deferred.resolve('Foo');
|
|
19
|
-
* console.log(deferred.state); // 'fulfilled'
|
|
20
|
-
* // deferred.reject('Bar');
|
|
21
|
-
*
|
|
22
|
-
* https://gist.github.com/GFoley83/5877f6c09fbcfd62569c51dc91444cf0
|
|
23
|
-
*/
|
|
24
|
-
export class DeferredPromise<T> implements Promise<T> {
|
|
25
|
-
readonly [Symbol.toStringTag] = 'Promise' as const
|
|
26
|
-
|
|
27
|
-
private _promise: Promise<T>
|
|
28
|
-
private _resolve!: (value: T | PromiseLike<T>) => void
|
|
29
|
-
private _reject!: (reason?: unknown) => void
|
|
30
|
-
private _state: 'pending' | 'fulfilled' | 'rejected' = 'pending'
|
|
31
|
-
|
|
32
|
-
public get state(): 'pending' | 'fulfilled' | 'rejected' {
|
|
33
|
-
return this._state
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public constructor() {
|
|
37
|
-
this._promise = new Promise<T>((resolve, reject) => {
|
|
38
|
-
this._resolve = resolve
|
|
39
|
-
this._reject = reject
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public then<TResult1 = T, TResult2 = never>(
|
|
44
|
-
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
|
45
|
-
onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null
|
|
46
|
-
): Promise<TResult1 | TResult2> {
|
|
47
|
-
return this._promise.then(onfulfilled, onrejected)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult> {
|
|
51
|
-
return this._promise.catch(onrejected)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public finally(onfinally?: (() => void) | null): Promise<T> {
|
|
55
|
-
return this._promise.finally(onfinally)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public resolve(value: T | PromiseLike<T>): void {
|
|
59
|
-
this._resolve(value)
|
|
60
|
-
this._state = 'fulfilled'
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public reject(reason?: unknown): void {
|
|
64
|
-
this._reject(reason)
|
|
65
|
-
this._state = 'rejected'
|
|
66
|
-
}
|
|
67
|
-
}
|
package/src/support/helpers.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
export const getCookie = (cname: string) => {
|
|
2
|
-
const name = cname + '='
|
|
3
|
-
const decodedCookie = decodeURIComponent(document.cookie)
|
|
4
|
-
const ca = decodedCookie.split(';')
|
|
5
|
-
for (let i = 0; i < ca.length; i++) {
|
|
6
|
-
let c = ca[i]
|
|
7
|
-
|
|
8
|
-
if (c === undefined) {
|
|
9
|
-
return ''
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
while (c.charAt(0) == ' ') {
|
|
13
|
-
c = c.substring(1)
|
|
14
|
-
}
|
|
15
|
-
if (c.indexOf(name) == 0) {
|
|
16
|
-
return c.substring(name.length, c.length)
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return ''
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const isObject = (item: unknown): boolean => {
|
|
23
|
-
if (!item) {
|
|
24
|
-
return false
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (Array.isArray(item)) {
|
|
28
|
-
return false
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return typeof item === 'object'
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const mergeDeep = (target: object, ...sources: object[]): object => {
|
|
35
|
-
if (!sources.length) return target
|
|
36
|
-
const source = sources.shift()
|
|
37
|
-
|
|
38
|
-
if (isObject(target) && isObject(source)) {
|
|
39
|
-
for (const key in source) {
|
|
40
|
-
// @ts-expect-error unknown structure
|
|
41
|
-
if (isObject(source[key])) {
|
|
42
|
-
// @ts-expect-error unknown structure
|
|
43
|
-
if (!target[key]) Object.assign(target, { [key]: {} })
|
|
44
|
-
// @ts-expect-error unknown structure
|
|
45
|
-
mergeDeep(target[key], source[key])
|
|
46
|
-
} else {
|
|
47
|
-
// @ts-expect-error unknown structure
|
|
48
|
-
Object.assign(target, { [key]: source[key] })
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return mergeDeep(target, ...sources)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export const getDisplayablePages = (totalPages: number, pageNumber: number, displayPages: number = 4) => {
|
|
57
|
-
if (totalPages < displayPages) {
|
|
58
|
-
displayPages = totalPages
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
let offset = 0
|
|
62
|
-
|
|
63
|
-
const middlePage = Math.ceil(displayPages / 2)
|
|
64
|
-
|
|
65
|
-
if (pageNumber <= middlePage) {
|
|
66
|
-
offset = 0
|
|
67
|
-
} else if (pageNumber > totalPages - middlePage) {
|
|
68
|
-
offset = totalPages - displayPages
|
|
69
|
-
} else {
|
|
70
|
-
offset = pageNumber - middlePage
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return [...Array(displayPages).keys()].map((i) => i + 1 + offset)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const isAtBottom = (scrollHeight: number, scrollTop: number, clientHeight: number): boolean => {
|
|
77
|
-
return Math.abs(scrollHeight - scrollTop - clientHeight) <= 3.0
|
|
78
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance, h, onUnmounted, render } from 'vue'
|
|
2
|
-
import { type Component } from 'vue'
|
|
3
|
-
|
|
4
|
-
export enum ConfirmDialogSeverity {
|
|
5
|
-
INFO = 'info',
|
|
6
|
-
WARNING = 'warning',
|
|
7
|
-
DANGER = 'danger'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ConfirmDialogOptions {
|
|
11
|
-
getMessage(): string
|
|
12
|
-
|
|
13
|
-
getSeverity(): ConfirmDialogSeverity
|
|
14
|
-
|
|
15
|
-
getTitle(): string
|
|
16
|
-
|
|
17
|
-
getOkText(): string
|
|
18
|
-
|
|
19
|
-
getCancelText(): string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The provided component needs to expose an "open" method, which
|
|
24
|
-
* should return a promise resolving into true or false.
|
|
25
|
-
*/
|
|
26
|
-
export default function (confirmDialogComponent: Component, querySelector: string = 'body') {
|
|
27
|
-
const self = getCurrentInstance()
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* https://stackoverflow.com/a/78448128
|
|
31
|
-
*/
|
|
32
|
-
function mountConfirmDialog(options: ConfirmDialogOptions) {
|
|
33
|
-
if (!self?.appContext) {
|
|
34
|
-
throw new Error('ConfirmationDialog: useConfirmDialog must be called inside a setup function')
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const vNode = h(confirmDialogComponent, { options })
|
|
38
|
-
vNode.key = Symbol()
|
|
39
|
-
vNode.appContext = self.appContext
|
|
40
|
-
render(vNode, document.querySelector(querySelector) as Element)
|
|
41
|
-
return vNode.component
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function unmountConfirmDialog() {
|
|
45
|
-
render(null, document.querySelector(querySelector) as Element)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
onUnmounted(() => {
|
|
49
|
-
unmountConfirmDialog()
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
async function openConfirmDialog(options: ConfirmDialogOptions): Promise<boolean> {
|
|
53
|
-
const dialogComponent = mountConfirmDialog(options)
|
|
54
|
-
|
|
55
|
-
if (dialogComponent?.exposed == undefined || dialogComponent?.exposed['open'] === undefined) {
|
|
56
|
-
throw new Error('ConfirmationDialog: Provided component does not expose an "open" method')
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return dialogComponent?.exposed['open']
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return { openConfirmDialog }
|
|
63
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance, shallowRef, computed, type Component, type Ref, type ComputedRef, h, render, onUnmounted } from 'vue'
|
|
2
|
-
|
|
3
|
-
interface UseGlobalCheckboxOptions<T> {
|
|
4
|
-
getAll: () => Promise<T[]>
|
|
5
|
-
getPage: () => T[]
|
|
6
|
-
totalCount: () => number
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export default function <T>(
|
|
10
|
-
dialog: Component,
|
|
11
|
-
options: UseGlobalCheckboxOptions<T>,
|
|
12
|
-
querySelector: string = 'body'
|
|
13
|
-
): {
|
|
14
|
-
selectedRows: Ref<T[]>
|
|
15
|
-
indeterminate: ComputedRef<boolean>
|
|
16
|
-
checked: ComputedRef<boolean>
|
|
17
|
-
handleGlobalCheckboxChange: (event: Event) => void
|
|
18
|
-
} {
|
|
19
|
-
const self = getCurrentInstance()
|
|
20
|
-
const selectedRows = shallowRef<T[]>([])
|
|
21
|
-
|
|
22
|
-
function mountDialog() {
|
|
23
|
-
if (!self?.appContext) {
|
|
24
|
-
throw new Error('useGlobalCheckbox must be called inside a setup function')
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const vNode = h(dialog, {
|
|
28
|
-
indeterminate: indeterminate.value,
|
|
29
|
-
checked: checked.value
|
|
30
|
-
})
|
|
31
|
-
vNode.key = Symbol()
|
|
32
|
-
vNode.appContext = self.appContext
|
|
33
|
-
render(vNode, document.querySelector(querySelector) as Element)
|
|
34
|
-
return vNode.component
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function unmountConfirmDialog() {
|
|
38
|
-
render(null, document.querySelector(querySelector) as Element)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
onUnmounted(() => {
|
|
42
|
-
unmountConfirmDialog()
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const indeterminate = computed(() => {
|
|
46
|
-
const totalCount: number = options.totalCount()
|
|
47
|
-
return selectedRows.value.length > 0 && selectedRows.value.length < totalCount
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
const checked = computed({
|
|
51
|
-
get: () => {
|
|
52
|
-
const totalCount: number = options.totalCount()
|
|
53
|
-
|
|
54
|
-
return selectedRows.value.length > 0 && selectedRows.value.length === totalCount
|
|
55
|
-
},
|
|
56
|
-
set: (value: boolean) => {
|
|
57
|
-
if (!value) {
|
|
58
|
-
selectedRows.value = []
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
// Check if all elements are already displayed on the current page
|
|
64
|
-
const isAllElementsOnCurrentPage = (): boolean => {
|
|
65
|
-
return options.getPage().length === options.totalCount()
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async function handleGlobalCheckboxChange(event: Event) {
|
|
69
|
-
if (!(event.target instanceof HTMLInputElement)) {
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const pageData: T[] = options.getPage()
|
|
74
|
-
|
|
75
|
-
// If all elements are on the current page, we can skip the dialog
|
|
76
|
-
// as both options would result in the same selection
|
|
77
|
-
const allElementsOnPage = isAllElementsOnCurrentPage()
|
|
78
|
-
|
|
79
|
-
// Case 1: Nothing is selected (unchecked state)
|
|
80
|
-
if (!checked.value && !indeterminate.value) {
|
|
81
|
-
if (allElementsOnPage) {
|
|
82
|
-
// All elements are already on the current page, just select them
|
|
83
|
-
selectedRows.value = [...pageData]
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// We need preventDefault() here because we're showing a dialog
|
|
88
|
-
// and don't want the checkbox to be checked until the user makes a choice
|
|
89
|
-
event.preventDefault()
|
|
90
|
-
|
|
91
|
-
const mountedDialog = mountDialog()
|
|
92
|
-
if (!mountedDialog?.exposed) return
|
|
93
|
-
|
|
94
|
-
// When clicking the empty checkbox, ask if user wants current page or all entries
|
|
95
|
-
if (await mountedDialog.exposed['open']) {
|
|
96
|
-
// User clicked "All Elements" button
|
|
97
|
-
selectedRows.value = await options.getAll()
|
|
98
|
-
} else {
|
|
99
|
-
// User clicked "Current Page" button
|
|
100
|
-
selectedRows.value = [...pageData]
|
|
101
|
-
}
|
|
102
|
-
return
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Case 2: Indeterminate state (some items selected, not all)
|
|
106
|
-
if (indeterminate.value) {
|
|
107
|
-
if (allElementsOnPage) {
|
|
108
|
-
// If all elements are on the page, just select them all
|
|
109
|
-
selectedRows.value = [...pageData]
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// We need preventDefault() here because we're showing a dialog
|
|
114
|
-
// and don't want the checkbox to be checked until the user makes a choice
|
|
115
|
-
event.preventDefault()
|
|
116
|
-
|
|
117
|
-
const mountedDialog = mountDialog()
|
|
118
|
-
if (!mountedDialog?.exposed) return
|
|
119
|
-
|
|
120
|
-
// When clicking the indeterminate checkbox, ask if the user wants all entries or unselect all
|
|
121
|
-
if (await mountedDialog.exposed['open']) {
|
|
122
|
-
// User clicked "All Elements" button
|
|
123
|
-
selectedRows.value = await options.getAll()
|
|
124
|
-
} else {
|
|
125
|
-
// User clicked "Discard" button
|
|
126
|
-
selectedRows.value = []
|
|
127
|
-
}
|
|
128
|
-
return
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Case 3: Checked state (all items selected)
|
|
132
|
-
if (checked.value) {
|
|
133
|
-
// When all items are selected, we just clear the selection without a dialog
|
|
134
|
-
selectedRows.value = []
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return {
|
|
140
|
-
selectedRows,
|
|
141
|
-
indeterminate,
|
|
142
|
-
checked,
|
|
143
|
-
handleGlobalCheckboxChange
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { isEmpty as _isEmpty } from 'lodash-es'
|
|
2
|
-
|
|
3
|
-
export default function () {
|
|
4
|
-
function isObject(value: unknown) {
|
|
5
|
-
return typeof value === 'object' && !Array.isArray(value) && value !== null
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function isEmpty(value: unknown) {
|
|
9
|
-
// Check objects with lodash
|
|
10
|
-
if (isObject(value)) {
|
|
11
|
-
return _isEmpty(value)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Check objects against their length property
|
|
15
|
-
if (Array.isArray(value)) {
|
|
16
|
-
return value.length === 0
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (value === '' || value === null) {
|
|
20
|
-
return true
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return value === undefined
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function isNotEmpty(value: unknown) {
|
|
27
|
-
return !isEmpty(value)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
isEmpty,
|
|
32
|
-
isNotEmpty
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ref, computed, type Ref, type WritableComputedRef } from 'vue'
|
|
2
|
-
|
|
3
|
-
export default function (
|
|
4
|
-
callback: (value: boolean) => void = () => {},
|
|
5
|
-
delay: number = 500
|
|
6
|
-
): {
|
|
7
|
-
isOpenKey: Ref<number>
|
|
8
|
-
isOpen: WritableComputedRef<boolean>
|
|
9
|
-
} {
|
|
10
|
-
const internalIsOpen = ref<boolean>(false)
|
|
11
|
-
|
|
12
|
-
const isOpenKey = ref<number>(0)
|
|
13
|
-
|
|
14
|
-
const isOpen = computed({
|
|
15
|
-
get(): boolean {
|
|
16
|
-
return internalIsOpen.value
|
|
17
|
-
},
|
|
18
|
-
set(value: boolean): void {
|
|
19
|
-
// False means we close, so we increment the key
|
|
20
|
-
// Add delay to preserve the closing animation.
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
if (!value) {
|
|
23
|
-
isOpenKey.value++
|
|
24
|
-
}
|
|
25
|
-
}, delay)
|
|
26
|
-
|
|
27
|
-
internalIsOpen.value = value
|
|
28
|
-
|
|
29
|
-
callback(value)
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
isOpenKey,
|
|
35
|
-
isOpen
|
|
36
|
-
}
|
|
37
|
-
}
|