brut 0.3.1 → 0.5.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +46 -0
- data/Gemfile.lock +1 -1
- data/assets/MetroIcon.graffle +0 -0
- data/brut-css/package-lock.json +2 -2
- data/brut-css/package.json +1 -1
- data/brut-css/src/css/flex.css +1 -1
- data/brut-css/src/docs/includes/body-and-header.html.ejs +1 -1
- data/brut-js/package-lock.json +2 -2
- data/brut-js/package.json +1 -1
- data/brut-js/specs/AjaxSubmit.spec.js +100 -7
- data/brut-js/specs/ConstraintViolationMessage.spec.js +1 -1
- data/brut-js/specs/ConstraintViolationMessages.spec.js +2 -2
- data/brut-js/specs/Form.spec.js +5 -5
- data/brut-js/src/AjaxSubmit.js +76 -40
- data/brut-js/src/ConstraintViolationMessage.js +3 -3
- data/brut-js/src/ConstraintViolationMessages.js +2 -2
- data/brutrb.com/adrs.md +1 -0
- data/brutrb.com/database-schema.md +22 -2
- data/brutrb.com/dev-environment.md +1 -0
- data/brutrb.com/form-constraints.md +2 -2
- data/brutrb.com/handlers.md +1 -1
- data/brutrb.com/i18n.md +2 -2
- data/brutrb.com/layouts.md +1 -1
- data/docs/404.html +2 -2
- data/docs/adrs.html +5 -5
- data/docs/ai.html +3 -3
- data/docs/api/Brut/BackEnd/SeedData.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server/FlushSpans.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares.html +1 -1
- data/docs/api/Brut/BackEnd/Sidekiq.html +1 -1
- data/docs/api/Brut/BackEnd/Validators/FormValidator.html +1 -1
- data/docs/api/Brut/BackEnd/Validators.html +1 -1
- data/docs/api/Brut/BackEnd.html +1 -1
- data/docs/api/Brut/CLI/App.html +1 -1
- data/docs/api/Brut/CLI/AppRunner.html +1 -1
- data/docs/api/Brut/CLI/Apps/BuildAssets/All.html +2 -2
- data/docs/api/Brut/CLI/Apps/BuildAssets/CSS.html +6 -6
- data/docs/api/Brut/CLI/Apps/BuildAssets/Images.html +1 -1
- data/docs/api/Brut/CLI/Apps/BuildAssets/JS.html +6 -6
- data/docs/api/Brut/CLI/Apps/BuildAssets.html +2 -2
- data/docs/api/Brut/CLI/Apps/DB/Create.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Drop.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Migrate.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/NewMigration.html +6 -2
- data/docs/api/Brut/CLI/Apps/DB/Rebuild.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Seed.html +1 -1
- data/docs/api/Brut/CLI/Apps/DB/Status.html +9 -9
- data/docs/api/Brut/CLI/Apps/DB.html +1 -1
- data/docs/api/Brut/CLI/Apps/DeployBase/GitChecks.html +1 -1
- data/docs/api/Brut/CLI/Apps/DeployBase.html +1 -1
- data/docs/api/Brut/CLI/Apps/HerokuContainerBasedDeploy/Deploy.html +1 -1
- data/docs/api/Brut/CLI/Apps/HerokuContainerBasedDeploy.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Action/Route.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Action.html +8 -12
- data/docs/api/Brut/CLI/Apps/Scaffold/Component.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/CustomElementTest.html +5 -5
- data/docs/api/Brut/CLI/Apps/Scaffold/DbModel.html +384 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/E2ETest.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Form.html +5 -5
- data/docs/api/Brut/CLI/Apps/Scaffold/Page/Route.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/Page.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold/RoutesEditor.html +36 -36
- data/docs/api/Brut/CLI/Apps/Scaffold/Test.html +1 -1
- data/docs/api/Brut/CLI/Apps/Scaffold.html +2 -2
- data/docs/api/Brut/CLI/Apps/Test/Audit.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test/E2e.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test/JS.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test/Run.html +1 -1
- data/docs/api/Brut/CLI/Apps/Test.html +1 -1
- data/docs/api/Brut/CLI/Apps.html +1 -1
- data/docs/api/Brut/CLI/Command.html +29 -31
- data/docs/api/Brut/CLI/Error.html +1 -1
- data/docs/api/Brut/CLI/ExecutionResults/Result.html +1 -1
- data/docs/api/Brut/CLI/ExecutionResults.html +1 -1
- data/docs/api/Brut/CLI/Executor.html +1 -1
- data/docs/api/Brut/CLI/InvalidOption.html +1 -1
- data/docs/api/Brut/CLI/Options.html +1 -1
- data/docs/api/Brut/CLI/Output.html +1 -1
- data/docs/api/Brut/CLI/SystemExecError.html +1 -1
- data/docs/api/Brut/CLI.html +1 -1
- data/docs/api/Brut/FactoryBot.html +1 -1
- data/docs/api/Brut/Framework/App.html +1 -1
- data/docs/api/Brut/Framework/Config.html +16 -2
- data/docs/api/Brut/Framework/Container.html +1 -1
- data/docs/api/Brut/Framework/Error.html +1 -1
- data/docs/api/Brut/Framework/Errors/AbstractMethod.html +1 -1
- data/docs/api/Brut/Framework/Errors/Bug.html +1 -1
- data/docs/api/Brut/Framework/Errors/MissingConfiguration.html +1 -1
- data/docs/api/Brut/Framework/Errors/MissingParameter.html +1 -1
- data/docs/api/Brut/Framework/Errors/NoClassForPath.html +1 -1
- data/docs/api/Brut/Framework/Errors/NotFound.html +1 -1
- data/docs/api/Brut/Framework/Errors/NotImplemented.html +1 -1
- data/docs/api/Brut/Framework/Errors.html +1 -1
- data/docs/api/Brut/Framework/FussyTypeEnforcement.html +1 -1
- data/docs/api/Brut/Framework/MCP.html +1 -1
- data/docs/api/Brut/Framework/ProjectEnvironment.html +1 -1
- data/docs/api/Brut/Framework.html +1 -1
- data/docs/api/Brut/FrontEnd/AssetPathResolver.html +1 -1
- data/docs/api/Brut/FrontEnd/Component/Helpers.html +86 -2
- data/docs/api/Brut/FrontEnd/Component.html +78 -9
- data/docs/api/Brut/FrontEnd/Components/ConstraintViolations.html +5 -5
- data/docs/api/Brut/FrontEnd/Components/FormTag.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/I18nTranslations.html +12 -16
- data/docs/api/Brut/FrontEnd/Components/Input.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/Inputs/CsrfToken.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/Inputs/InputTag.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/Inputs/RadioButton.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/Inputs/SelectTagWithOptions.html +5 -5
- data/docs/api/Brut/FrontEnd/Components/Inputs/TextareaTag.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/Inputs.html +1 -1
- data/docs/api/Brut/FrontEnd/Components/LocaleDetection.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/PageIdentifier.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/TimeTag.html +3 -3
- data/docs/api/Brut/FrontEnd/Components/Traceparent.html +3 -3
- data/docs/api/Brut/FrontEnd/Components.html +1 -1
- data/docs/api/Brut/FrontEnd/Download.html +1 -1
- data/docs/api/Brut/FrontEnd/Flash.html +1 -1
- data/docs/api/Brut/FrontEnd/Form.html +92 -20
- data/docs/api/Brut/FrontEnd/Forms/ConstraintViolation.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/Input/Color.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/Input/TimeOfDay.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/Input.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/InputDeclarations.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/InputDefinition.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInput.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInputDefinition.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/SelectInput.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/SelectInputDefinition.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms/ValidityState.html +1 -1
- data/docs/api/Brut/FrontEnd/Forms.html +1 -1
- data/docs/api/Brut/FrontEnd/GenericResponse.html +1 -1
- data/docs/api/Brut/FrontEnd/Handler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/CspReportingHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler/TraceParent.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/LocaleDetectionHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers/MissingHandler/Form.html +2 -2
- data/docs/api/Brut/FrontEnd/Handlers/MissingHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Handlers.html +1 -1
- data/docs/api/Brut/FrontEnd/HandlingResults.html +1 -1
- data/docs/api/Brut/FrontEnd/HttpMethod.html +1 -1
- data/docs/api/Brut/FrontEnd/HttpStatus.html +1 -1
- data/docs/api/Brut/FrontEnd/InlineSvgLocator.html +1 -1
- data/docs/api/Brut/FrontEnd/Layout.html +3 -3
- data/docs/api/Brut/FrontEnd/Middleware.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/AnnotateBrutOwnedPaths.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/Favicon.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/OpenTelemetrySpan.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares/ReloadApp.html +1 -1
- data/docs/api/Brut/FrontEnd/Middlewares.html +1 -1
- data/docs/api/Brut/FrontEnd/Page.html +31 -23
- data/docs/api/Brut/FrontEnd/Pages/MissingPage.html +3 -3
- data/docs/api/Brut/FrontEnd/Pages.html +1 -1
- data/docs/api/Brut/FrontEnd/RequestContext.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHook.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/AgeFlash.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineScripts.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts/ReportOnly.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/LocaleDetection.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks/SetupRequestContext.html +1 -1
- data/docs/api/Brut/FrontEnd/RouteHooks.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/FormHandlerRoute.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/FormRoute.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingForm.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingHandler.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingPage.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/MissingPath.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/PageRoute.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing/Route.html +1 -1
- data/docs/api/Brut/FrontEnd/Routing.html +1 -1
- data/docs/api/Brut/FrontEnd/Session.html +1 -1
- data/docs/api/Brut/FrontEnd.html +1 -1
- data/docs/api/Brut/I18n/BaseMethods.html +1 -1
- data/docs/api/Brut/I18n/ForBackEnd.html +1 -1
- data/docs/api/Brut/I18n/ForCLI.html +1 -1
- data/docs/api/Brut/I18n/ForHTML.html +1 -1
- data/docs/api/Brut/I18n/HTTPAcceptLanguage/AlwaysEnglish.html +1 -1
- data/docs/api/Brut/I18n/HTTPAcceptLanguage.html +1 -1
- data/docs/api/Brut/I18n.html +1 -1
- data/docs/api/Brut/Instrumentation/LoggerSpanExporter.html +1 -1
- data/docs/api/Brut/Instrumentation/OpenTelemetry/NormalizedAttributes.html +1 -1
- data/docs/api/Brut/Instrumentation/OpenTelemetry/Span.html +1 -1
- data/docs/api/Brut/Instrumentation/OpenTelemetry.html +1 -1
- data/docs/api/Brut/Instrumentation.html +1 -1
- data/docs/api/Brut/SinatraHelpers/ClassMethods.html +13 -11
- data/docs/api/Brut/SinatraHelpers.html +1 -1
- data/docs/api/Brut/SpecSupport/ClockSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/ComponentSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/E2ETestServer.html +1 -1
- data/docs/api/Brut/SpecSupport/E2eSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/EnhancedNode.html +1 -1
- data/docs/api/Brut/SpecSupport/FlashSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/GeneralSupport/ClassMethods.html +1 -1
- data/docs/api/Brut/SpecSupport/GeneralSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/HandlerSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/BeABug.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/BePageFor.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/BeRoutingFor.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveConstraintViolation.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveGenerated.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveHTMLAttribute.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveI18nString.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveLinkTo.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveRedirectedTo.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveReturnedHttpStatus.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers/HaveReturnedRackResponse.html +1 -1
- data/docs/api/Brut/SpecSupport/Matchers.html +1 -1
- data/docs/api/Brut/SpecSupport/RSpecSetup/OptionalSidekiqSupport.html +1 -1
- data/docs/api/Brut/SpecSupport/RSpecSetup.html +1 -1
- data/docs/api/Brut/SpecSupport/SessionSupport.html +1 -1
- data/docs/api/Brut/SpecSupport.html +1 -1
- data/docs/api/Brut.html +1 -1
- data/docs/api/Clock.html +1 -1
- data/docs/api/ModuleName.html +595 -0
- data/docs/api/RichString.html +1 -1
- data/docs/api/SemanticLogger/Appender/Async.html +1 -1
- data/docs/api/Sequel/Extensions/BrutInstrumentation.html +1 -1
- data/docs/api/Sequel/Extensions/BrutMigrations.html +1 -1
- data/docs/api/Sequel/Extensions.html +1 -1
- data/docs/api/Sequel/Plugins/CreatedAt/InstanceMethods.html +1 -1
- data/docs/api/Sequel/Plugins/CreatedAt.html +1 -1
- data/docs/api/Sequel/Plugins/ExternalId/ClassMethods.html +1 -1
- data/docs/api/Sequel/Plugins/ExternalId/InstanceMethods.html +1 -1
- data/docs/api/Sequel/Plugins/ExternalId.html +1 -1
- data/docs/api/Sequel/Plugins/FindBang/ClassMethods.html +1 -1
- data/docs/api/Sequel/Plugins/FindBang.html +1 -1
- data/docs/api/Sequel/Plugins.html +1 -1
- data/docs/api/Sequel.html +1 -1
- data/docs/api/_index.html +24 -12
- data/docs/api/class_list.html +1 -1
- data/docs/api/file.README.html +1 -1
- data/docs/api/index.html +1 -1
- data/docs/api/method_list.html +416 -328
- data/docs/api/top-level-namespace.html +2 -2
- data/docs/assets/{adrs.md.JRxZ5uYE.js → adrs.md.BxjHi9-8.js} +1 -1
- data/docs/assets/adrs.md.BxjHi9-8.lean.js +1 -0
- data/docs/assets/{app.C0n_5kBs.js → app.D6BuVHo9.js} +1 -1
- data/docs/assets/chunks/@localSearchIndexroot.COP2Bcmp.js +1 -0
- data/docs/assets/chunks/{VPLocalSearchBox.yICoU-Ly.js → VPLocalSearchBox.BpvHMbx6.js} +1 -1
- data/docs/assets/chunks/{theme.gMVDgzXI.js → theme.wlAOvi2f.js} +2 -2
- data/docs/assets/{components.md.DGVPNB9a.js → components.md.iLiv2E9X.js} +3 -3
- data/docs/assets/{configuration.md.DK3YrtYn.js → configuration.md.DmuAdsli.js} +1 -1
- data/docs/assets/{database-schema.md.CSYk6E6v.js → database-schema.md.C5gXexJi.js} +10 -3
- data/docs/assets/{database-schema.md.CSYk6E6v.lean.js → database-schema.md.C5gXexJi.lean.js} +1 -1
- data/docs/assets/{dev-environment.md.Dy6EldaM.js → dev-environment.md.DRH2D2-O.js} +3 -3
- data/docs/assets/dev-environment.md.DRH2D2-O.lean.js +1 -0
- data/docs/assets/{form-constraints.md.x5tNpTTI.js → form-constraints.md.DK5adCgM.js} +2 -2
- data/docs/assets/{forms.md.DwdQGwOK.js → forms.md.D8aa_qI-.js} +1 -1
- data/docs/assets/{getting-started.md.DuiTvmpG.js → getting-started.md.DLplsDUd.js} +3 -3
- data/docs/assets/{getting-started.md.DuiTvmpG.lean.js → getting-started.md.DLplsDUd.lean.js} +1 -1
- data/docs/assets/{handlers.md.Chyri6KA.js → handlers.md.h84MMB1R.js} +1 -1
- data/docs/assets/{i18n.md.xQhiGo1G.js → i18n.md.BAm9t9JJ.js} +1 -1
- data/docs/assets/{layouts.md.CJGDFY-m.js → layouts.md.CVGl9xIO.js} +1 -1
- data/docs/assets.html +3 -3
- data/docs/brut-css/brut.max.css +1 -1
- data/docs/brut-css/classes/appearances.html +1 -1
- data/docs/brut-css/classes/background-colors.html +1 -1
- data/docs/brut-css/classes/border-colors.html +1 -1
- data/docs/brut-css/classes/borders.html +1 -1
- data/docs/brut-css/classes/dimensions.html +1 -1
- data/docs/brut-css/classes/flex.html +3 -3
- data/docs/brut-css/classes/foreground-colors.html +1 -1
- data/docs/brut-css/classes/junk-drawer.html +1 -1
- data/docs/brut-css/classes/layout.html +1 -1
- data/docs/brut-css/classes/lists.html +1 -1
- data/docs/brut-css/classes/positioning.html +1 -1
- data/docs/brut-css/classes/spacings.html +1 -1
- data/docs/brut-css/classes/typography.html +1 -1
- data/docs/brut-css/customization/advanced-configuration.html +1 -1
- data/docs/brut-css/customization/breakpoints.html +1 -1
- data/docs/brut-css/customization/design-system.html +1 -1
- data/docs/brut-css/customization/pseudo-classes.html +1 -1
- data/docs/brut-css/getting-started/core-concepts.html +1 -1
- data/docs/brut-css/getting-started/installation.html +1 -1
- data/docs/brut-css/getting-started/overview.html +1 -1
- data/docs/brut-css/getting-started/simple-example.html +1 -1
- data/docs/brut-css/index.html +1 -1
- data/docs/brut-css/properties/colors.html +1 -1
- data/docs/brut-css/properties/spacings.html +1 -1
- data/docs/brut-css/properties/typography.html +1 -1
- data/docs/brut-js/api/AjaxSubmit.html +56 -7
- data/docs/brut-js/api/AjaxSubmit.js.html +77 -41
- data/docs/brut-js/api/Autosubmit.html +1 -1
- data/docs/brut-js/api/Autosubmit.js.html +1 -1
- data/docs/brut-js/api/BaseCustomElement.html +1 -1
- data/docs/brut-js/api/BaseCustomElement.js.html +1 -1
- data/docs/brut-js/api/BrutCustomElements.html +1 -1
- data/docs/brut-js/api/BufferedLogger.html +1 -1
- data/docs/brut-js/api/ConfirmSubmit.html +1 -1
- data/docs/brut-js/api/ConfirmSubmit.js.html +1 -1
- data/docs/brut-js/api/ConfirmationDialog.html +1 -1
- data/docs/brut-js/api/ConfirmationDialog.js.html +1 -1
- data/docs/brut-js/api/ConstraintViolationMessage.html +2 -2
- data/docs/brut-js/api/ConstraintViolationMessage.js.html +4 -4
- data/docs/brut-js/api/ConstraintViolationMessages.html +3 -3
- data/docs/brut-js/api/ConstraintViolationMessages.js.html +3 -3
- data/docs/brut-js/api/CopyToClipboard.html +1 -1
- data/docs/brut-js/api/CopyToClipboard.js.html +1 -1
- data/docs/brut-js/api/Form.html +1 -1
- data/docs/brut-js/api/Form.js.html +1 -1
- data/docs/brut-js/api/I18nTranslation.html +1 -1
- data/docs/brut-js/api/I18nTranslation.js.html +1 -1
- data/docs/brut-js/api/LocaleDetection.html +1 -1
- data/docs/brut-js/api/LocaleDetection.js.html +1 -1
- data/docs/brut-js/api/Logger.html +1 -1
- data/docs/brut-js/api/Logger.js.html +1 -1
- data/docs/brut-js/api/Message.html +1 -1
- data/docs/brut-js/api/Message.js.html +1 -1
- data/docs/brut-js/api/PrefixedLogger.html +1 -1
- data/docs/brut-js/api/RichString.html +1 -1
- data/docs/brut-js/api/RichString.js.html +1 -1
- data/docs/brut-js/api/Tabs.html +1 -1
- data/docs/brut-js/api/Tabs.js.html +1 -1
- data/docs/brut-js/api/Tracing.html +1 -1
- data/docs/brut-js/api/Tracing.js.html +1 -1
- data/docs/brut-js/api/external-CustomElementRegistry.html +1 -1
- data/docs/brut-js/api/external-Performance.html +1 -1
- data/docs/brut-js/api/external-Promise.html +1 -1
- data/docs/brut-js/api/external-ValidityState.html +1 -1
- data/docs/brut-js/api/external-Window.html +1 -1
- data/docs/brut-js/api/external-fetch.html +1 -1
- data/docs/brut-js/api/global.html +1 -1
- data/docs/brut-js/api/index.html +1 -1
- data/docs/brut-js/api/index.js.html +1 -1
- data/docs/brut-js/api/module-testing.html +1 -1
- data/docs/brut-js/api/testing.AssetMetadata.html +1 -1
- data/docs/brut-js/api/testing.AssetMetadataLoader.html +1 -1
- data/docs/brut-js/api/testing.CustomElementTest.html +1 -1
- data/docs/brut-js/api/testing.DOMCreator.html +1 -1
- data/docs/brut-js/api/testing_AssetMetadata.js.html +1 -1
- data/docs/brut-js/api/testing_AssetMetadataLoader.js.html +1 -1
- data/docs/brut-js/api/testing_CustomElementTest.js.html +1 -1
- data/docs/brut-js/api/testing_DOMCreator.js.html +1 -1
- data/docs/brut-js/api/testing_index.js.html +1 -1
- data/docs/brut-js.html +3 -3
- data/docs/business-logic.html +3 -3
- data/docs/cli.html +3 -3
- data/docs/components.html +7 -7
- data/docs/configuration.html +5 -5
- data/docs/css.html +3 -3
- data/docs/custom-element-tests.html +3 -3
- data/docs/database-access.html +3 -3
- data/docs/database-schema.html +12 -5
- data/docs/deployment.html +3 -3
- data/docs/dev-environment.html +5 -5
- data/docs/dir-structure.html +3 -3
- data/docs/doc-conventions.html +3 -3
- data/docs/end-to-end-tests.html +3 -3
- data/docs/features.html +3 -3
- data/docs/flash-and-session.html +3 -3
- data/docs/form-constraints.html +6 -6
- data/docs/forms.html +5 -5
- data/docs/getting-started.html +6 -6
- data/docs/handlers.html +5 -5
- data/docs/hashmap.json +1 -1
- data/docs/hooks.html +3 -3
- data/docs/i18n.html +5 -5
- data/docs/index.html +3 -3
- data/docs/instrumentation.html +3 -3
- data/docs/javascript.html +3 -3
- data/docs/jobs.html +3 -3
- data/docs/keyword-injection.html +3 -3
- data/docs/layouts.html +5 -5
- data/docs/lsp.html +3 -3
- data/docs/markdown-examples.html +3 -3
- data/docs/middleware.html +3 -3
- data/docs/overview.html +3 -3
- data/docs/pages.html +3 -3
- data/docs/recipes/alternate-layouts.html +3 -3
- data/docs/recipes/authentication.html +3 -3
- data/docs/recipes/blank-layouts.html +3 -3
- data/docs/recipes/custom-flash.html +3 -3
- data/docs/recipes/indexed-forms.html +3 -3
- data/docs/recipes/migrations.html +3 -3
- data/docs/recipes/text-field-component.html +3 -3
- data/docs/roadmap.html +3 -3
- data/docs/routes.html +3 -3
- data/docs/security.html +3 -3
- data/docs/seed-data.html +3 -3
- data/docs/space-time-continuum.html +3 -3
- data/docs/tutorial.html +3 -3
- data/docs/unit-tests.html +3 -3
- data/docs/why.html +3 -3
- data/lib/brut/cli/apps/scaffold.rb +77 -0
- data/lib/brut/cli/command.rb +1 -2
- data/lib/brut/framework/config.rb +7 -0
- data/lib/brut/front_end/component.rb +19 -0
- data/lib/brut/front_end/components/constraint_violations.rb +2 -2
- data/lib/brut/front_end/components/i18n_translations.rb +6 -10
- data/lib/brut/front_end/form.rb +5 -2
- data/lib/brut/front_end/page.rb +11 -7
- data/lib/brut/junk_drawer.rb +53 -0
- data/lib/brut/sinatra_helpers.rb +1 -0
- data/lib/brut/version.rb +1 -1
- metadata +30 -27
- data/docs/assets/adrs.md.JRxZ5uYE.lean.js +0 -1
- data/docs/assets/chunks/@localSearchIndexroot.BF2caq1f.js +0 -1
- data/docs/assets/dev-environment.md.Dy6EldaM.lean.js +0 -1
- /data/docs/assets/{components.md.DGVPNB9a.lean.js → components.md.iLiv2E9X.lean.js} +0 -0
- /data/docs/assets/{configuration.md.DK3YrtYn.lean.js → configuration.md.DmuAdsli.lean.js} +0 -0
- /data/docs/assets/{form-constraints.md.x5tNpTTI.lean.js → form-constraints.md.DK5adCgM.lean.js} +0 -0
- /data/docs/assets/{forms.md.DwdQGwOK.lean.js → forms.md.D8aa_qI-.lean.js} +0 -0
- /data/docs/assets/{handlers.md.Chyri6KA.lean.js → handlers.md.h84MMB1R.lean.js} +0 -0
- /data/docs/assets/{i18n.md.xQhiGo1G.lean.js → i18n.md.BAm9t9JJ.lean.js} +0 -0
- /data/docs/assets/{layouts.md.CJGDFY-m.lean.js → layouts.md.CVGl9xIO.lean.js} +0 -0
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
data/docs/brut-css/index.html
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="flex gap-3 justify-between items-center">
|
12
12
|
<h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
|
13
13
|
<ul class="lst-none pl-0 flex gap-2 justify-end items-center">
|
14
|
-
<form class="flex items-center gap-1 mr-3">
|
14
|
+
<form class="dn flex items-center gap-1 mr-3">
|
15
15
|
<label>
|
16
16
|
<input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
|
17
17
|
<span class="sr-only">Search term</span>
|
@@ -44,9 +44,18 @@ the form it's a part of via AJAX. It accounts for network failures and timeouts.
|
|
44
44
|
<ul>
|
45
45
|
<li><code>requesting</code> will be removed and <code>submitted</code> will be added.</li>
|
46
46
|
<li><code>submitted</code> will be removed after <code>submitted-lifetime</code> ms.</li>
|
47
|
+
<li>the <code>brut:submitok</code> event will be fired with the response text, <strong>parsed as HTML</strong>, as <code>event.detail</code>.</li>
|
48
|
+
</ul>
|
49
|
+
</li>
|
50
|
+
<li>If the request returned a 422:
|
51
|
+
<ul>
|
52
|
+
<li>If you have set <code>no-server-side-error-parsing</code>, the results will be included in the
|
53
|
+
detail field of the <code>brut:submitinvalid</code> event.</li>
|
54
|
+
<li>If you have NOT set <code>no-server-side-error-parsing</code>, the response is parsed as
|
55
|
+
errors to be inserted into the DOM. See below for how that works. In this case,
|
56
|
+
<code>brut:submitinvalid</code>'s detail bill be null.</li>
|
47
57
|
</ul>
|
48
58
|
</li>
|
49
|
-
<li>If the request returned a 422, error messages are parsed. See below.</li>
|
50
59
|
<li>If the request returns not OK and not 422:
|
51
60
|
<ul>
|
52
61
|
<li>if it has been <code>request-timeout</code> ms or more since the button was first clicked, the operation is aborted (see below).</li>
|
@@ -58,7 +67,8 @@ the form it's a part of via AJAX. It accounts for network failures and timeouts.
|
|
58
67
|
</ol>
|
59
68
|
<p>Aborting the operation will submit the form in the normal way, allowing the browser to deal with whatever the issue is. You can set
|
60
69
|
<code>log-request-errors</code> to introspect this process.</p>
|
61
|
-
<p>For a 422 response
|
70
|
+
<p>For a 422 response (where <code>no-server-side-error-parsing</code> is <em>not</em> set),
|
71
|
+
this element assumes the response is <code>text/html</code> and contains one or more <code><brut-cv></code>
|
62
72
|
elements. These elements will be inserted into the proper <code><brut-cv-messages></code> element, as follows:</p>
|
63
73
|
<ol>
|
64
74
|
<li>The <code>input-name</code> is examined.</li>
|
@@ -71,7 +81,23 @@ elements. These elements will be inserted into the proper <code><brut-cv-mes
|
|
71
81
|
<li>validity is reported</li>
|
72
82
|
<li>The first input located is scrolled into view</li>
|
73
83
|
<li>If the input is modified after this all happens, custom validity is cleared</li>
|
74
|
-
</ol
|
84
|
+
</ol>
|
85
|
+
<p>For the server you are contacting, this element has a few requirements:</p>
|
86
|
+
<ul>
|
87
|
+
<li>If everything is OK/the operation did what it was intended to do:
|
88
|
+
<ul>
|
89
|
+
<li>the server will respond with a 2xx</li>
|
90
|
+
<li>the response body, if it contains anything, be <code>text/html</code> (this is provided in the event detail)</li>
|
91
|
+
</ul>
|
92
|
+
</li>
|
93
|
+
<li>If there are server-side constraint violations.
|
94
|
+
<ul>
|
95
|
+
<li>the server will return 422</li>
|
96
|
+
<li>the response body will be <code>text/html</code></li>
|
97
|
+
<li>the response body will contain one or more <code><brut-cv></code> elements</li>
|
98
|
+
</ul>
|
99
|
+
</li>
|
100
|
+
</ul></div>
|
75
101
|
|
76
102
|
|
77
103
|
</header>
|
@@ -129,6 +155,29 @@ elements. These elements will be inserted into the proper <code><brut-cv-mes
|
|
129
155
|
<tbody>
|
130
156
|
|
131
157
|
|
158
|
+
<tr>
|
159
|
+
|
160
|
+
<td class="name"><code>no-server-side-error-parsing</code></td>
|
161
|
+
|
162
|
+
|
163
|
+
<td class="type">
|
164
|
+
|
165
|
+
|
166
|
+
<span class="param-type">boolean</span>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</td>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
<td class="description last"><p>if set, the response body for a 422 will not be parsed and inserted into the DOM. Instead, the body will be part of the detail of the <code>brut:submitinvalid</code> event.</p></td>
|
177
|
+
</tr>
|
178
|
+
|
179
|
+
|
180
|
+
|
132
181
|
<tr>
|
133
182
|
|
134
183
|
<td class="name"><code>request-timeout</code></td>
|
@@ -279,7 +328,7 @@ cause any form submission to be delayed by 2s to allow you to read the console.<
|
|
279
328
|
|
280
329
|
<dt class="tag-source">Source:</dt>
|
281
330
|
<dd class="tag-source"><ul class="dummy"><li>
|
282
|
-
<a href="AjaxSubmit.js.html">AjaxSubmit.js</a>, <a href="AjaxSubmit.js.html#
|
331
|
+
<a href="AjaxSubmit.js.html">AjaxSubmit.js</a>, <a href="AjaxSubmit.js.html#line79">line 79</a>
|
283
332
|
</li></ul></dd>
|
284
333
|
|
285
334
|
|
@@ -296,9 +345,9 @@ cause any form submission to be delayed by 2s to allow you to read the console.<
|
|
296
345
|
|
297
346
|
<h5>Fires:</h5>
|
298
347
|
<ul>
|
299
|
-
<li>brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed
|
348
|
+
<li>brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed.event: The detail will include the *parsed document* of the HTML returned in the response.</li>
|
300
349
|
|
301
|
-
<li>brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed
|
350
|
+
<li>brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed. The detail will be null unless `no-server-side-error-parsing` is set,event: in which case it will be the parsed document of the HTML returned in the response.</li>
|
302
351
|
</ul>
|
303
352
|
|
304
353
|
|
@@ -365,7 +414,7 @@ cause any form submission to be delayed by 2s to allow you to read the console.<
|
|
365
414
|
<br class="clear">
|
366
415
|
|
367
416
|
<footer>
|
368
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
417
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
369
418
|
</footer>
|
370
419
|
|
371
420
|
<script> prettyPrint(); </script>
|
@@ -41,7 +41,13 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
|
|
41
41
|
* 4. If the request returns OK:
|
42
42
|
* - `requesting` will be removed and `submitted` will be added.
|
43
43
|
* - `submitted` will be removed after `submitted-lifetime` ms.
|
44
|
-
*
|
44
|
+
* - the `brut:submitok` event will be fired with the response text, **parsed as HTML**, as `event.detail`.
|
45
|
+
* 5. If the request returned a 422:
|
46
|
+
* - If you have set `no-server-side-error-parsing`, the results will be included in the
|
47
|
+
* detail field of the `brut:submitinvalid` event.
|
48
|
+
* - If you have NOT set `no-server-side-error-parsing`, the response is parsed as
|
49
|
+
* errors to be inserted into the DOM. See below for how that works. In this case,
|
50
|
+
* `brut:submitinvalid`'s detail bill be null.
|
45
51
|
* 6. If the request returns not OK and not 422:
|
46
52
|
* - if it has been `request-timeout` ms or more since the button was first clicked, the operation is aborted (see below).
|
47
53
|
* - if it has been less than `request-timeout` ms and the HTTP status code was 5xx, the operation is retried.
|
@@ -51,7 +57,8 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
|
|
51
57
|
* Aborting the operation will submit the form in the normal way, allowing the browser to deal with whatever the issue is. You can set
|
52
58
|
* `log-request-errors` to introspect this process.
|
53
59
|
*
|
54
|
-
* For a 422 response
|
60
|
+
* For a 422 response (where `no-server-side-error-parsing` is *not* set),
|
61
|
+
* this element assumes the response is `text/html` and contains one or more `<brut-cv>`
|
55
62
|
* elements. These elements will be inserted into the proper `<brut-cv-messages>` element, as follows:
|
56
63
|
*
|
57
64
|
* 1. The `input-name` is examined.
|
@@ -65,6 +72,17 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
|
|
65
72
|
* 9. The first input located is scrolled into view
|
66
73
|
* 10. If the input is modified after this all happens, custom validity is cleared
|
67
74
|
*
|
75
|
+
* For the server you are contacting, this element has a few requirements:
|
76
|
+
*
|
77
|
+
* - If everything is OK/the operation did what it was intended to do:
|
78
|
+
* - the server will respond with a 2xx
|
79
|
+
* - the response body, if it contains anything, be `text/html` (this is provided in the event detail)
|
80
|
+
* - If there are server-side constraint violations.
|
81
|
+
* - the server will return 422
|
82
|
+
* - the response body will be `text/html`
|
83
|
+
* - the response body will contain one or more `<brut-cv>` elements
|
84
|
+
*
|
85
|
+
* @property {boolean} no-server-side-error-parsing - if set, the response body for a 422 will not be parsed and inserted into the DOM. Instead, the body will be part of the detail of the `brut:submitinvalid` event.
|
68
86
|
* @property {number} request-timeout - number of ms that the entire operation is expected to complete within. Default is 5000
|
69
87
|
* @property {number} submitted-lifetime - number of ms that "submitted" should remain on the element after the form has completed. Default is 2000
|
70
88
|
* @property {boolean} requesting - boolean attribute that indicates the request has been made, but not yet returned. Don't set this yourself outside of development. It will be set and removed by this element.
|
@@ -72,8 +90,8 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
|
|
72
90
|
* @property {boolean} log-request-errors - if set, logging related to request error handling will appear in the console. It will also
|
73
91
|
* cause any form submission to be delayed by 2s to allow you to read the console.
|
74
92
|
*
|
75
|
-
* @fires brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed
|
76
|
-
* @fires brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed
|
93
|
+
* @fires brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed. The detail will include the *parsed document* of the HTML returned in the response.
|
94
|
+
* @fires brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed. The detail will be null unless `no-server-side-error-parsing` is set, in which case it will be the parsed document of the HTML returned in the response.
|
77
95
|
*
|
78
96
|
* @example
|
79
97
|
* <form action="/widgets" method="post">
|
@@ -96,6 +114,7 @@ class AjaxSubmit extends BaseCustomElement {
|
|
96
114
|
"request-timeout",
|
97
115
|
"max-retry-attempts",
|
98
116
|
"log-request-errors",
|
117
|
+
"no-server-side-error-parsing",
|
99
118
|
]
|
100
119
|
|
101
120
|
#requestErrorLogger = () => {}
|
@@ -103,6 +122,12 @@ class AjaxSubmit extends BaseCustomElement {
|
|
103
122
|
#submittedLifetime = 2000
|
104
123
|
#requestTimeout = 5000
|
105
124
|
#maxRetryAttempts = 25
|
125
|
+
#serverSideErrorParsing = true
|
126
|
+
|
127
|
+
constructor() {
|
128
|
+
super()
|
129
|
+
this.domParser = new DOMParser()
|
130
|
+
}
|
106
131
|
|
107
132
|
submittedLifetimeChangedCallback({newValue}) {
|
108
133
|
const newValueAsInt = parseInt(newValue)
|
@@ -112,6 +137,10 @@ class AjaxSubmit extends BaseCustomElement {
|
|
112
137
|
this.#submittedLifetime = newValueAsInt
|
113
138
|
}
|
114
139
|
|
140
|
+
noServerSideErrorParsingChangedCallback({newValueAsBoolean}) {
|
141
|
+
this.#serverSideErrorParsing = !newValueAsBoolean
|
142
|
+
}
|
143
|
+
|
115
144
|
maxRetryAttemptsChangedCallback({newValue}) {
|
116
145
|
const num = parseInt(newValue)
|
117
146
|
if (isNaN(num)) {
|
@@ -215,7 +244,10 @@ class AjaxSubmit extends BaseCustomElement {
|
|
215
244
|
this.setAttribute("submitted",true)
|
216
245
|
|
217
246
|
setTimeout( () => this.removeAttribute("submitted"), this.#submittedLifetime )
|
218
|
-
|
247
|
+
response.text().then( (text) => {
|
248
|
+
const parsedDocument = this.domParser.parseFromString(text,"text/html")
|
249
|
+
this.dispatchEvent(new CustomEvent("brut:submitok", { detail: parsedDocument }))
|
250
|
+
})
|
219
251
|
}
|
220
252
|
else {
|
221
253
|
|
@@ -278,49 +310,53 @@ class AjaxSubmit extends BaseCustomElement {
|
|
278
310
|
#handleConstraintViolations(response) {
|
279
311
|
let resubmit = false
|
280
312
|
response.text().then( (text) => {
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
313
|
+
const parsedDocument = this.domParser.parseFromString(text,"text/html")
|
314
|
+
let event
|
315
|
+
if (this.#serverSideErrorParsing) {
|
316
|
+
event = new CustomEvent("brut:submitinvalid")
|
317
|
+
}
|
318
|
+
else {
|
319
|
+
event = new CustomEvent("brut:submitinvalid", { detail: parsedDocument })
|
320
|
+
}
|
321
|
+
this.dispatchEvent(event)
|
322
|
+
if (this.#serverSideErrorParsing) {
|
323
|
+
const constraintViolationNodes = parsedDocument.querySelectorAll(ConstraintViolationMessage.tagName)
|
324
|
+
try {
|
325
|
+
const inputsToMessages = ErrorMessagesForInput.mapInputsToErrorMessages(
|
326
|
+
constraintViolationNodes,
|
327
|
+
this.#requestErrorLogger
|
328
|
+
)
|
329
|
+
|
330
|
+
let inputToScrollToAfterReportingValidity
|
331
|
+
for (const [inputName, {input, messagesElement, errorMessages}] of Object.entries(inputsToMessages)) {
|
332
|
+
if (!inputToScrollToAfterReportingValidity) {
|
333
|
+
inputToScrollToAfterReportingValidity = input
|
334
|
+
}
|
335
|
+
messagesElement.clearServerSideMessages()
|
336
|
+
errorMessages.forEach( (element) => {
|
337
|
+
ConstraintViolationMessage.markServerSide(element)
|
338
|
+
messagesElement.appendChild(element)
|
339
|
+
})
|
340
|
+
this.#setCustomValidityThatClearsOnChange(input,errorMessages)
|
341
|
+
}
|
286
342
|
|
287
|
-
|
288
|
-
|
289
|
-
if (!inputToScrollToAfterReportingValidity) {
|
290
|
-
inputToScrollToAfterReportingValidity = input
|
343
|
+
if (inputToScrollToAfterReportingValidity) {
|
344
|
+
inputToScrollToAfterReportingValidity.scrollIntoView()
|
291
345
|
}
|
292
|
-
|
293
|
-
|
294
|
-
ConstraintViolationMessage.markServerSide(element)
|
295
|
-
messagesElement.appendChild(element)
|
296
|
-
})
|
297
|
-
this.#setCustomValidityThatClearsOnChange(input,errorMessages)
|
346
|
+
resubmit = false
|
347
|
+
this.removeAttribute("requesting")
|
298
348
|
}
|
299
|
-
|
300
|
-
|
301
|
-
|
349
|
+
catch (e) {
|
350
|
+
this.#requestErrorLogger("While parsing %s, got %s", text, e)
|
351
|
+
resubmit = true
|
352
|
+
}
|
353
|
+
if (resubmit) {
|
354
|
+
this.#submitFormThroughBrowser(form)
|
302
355
|
}
|
303
|
-
resubmit = false
|
304
|
-
this.removeAttribute("requesting")
|
305
|
-
this.dispatchEvent(new CustomEvent("brut:submitinvalid"))
|
306
|
-
}
|
307
|
-
catch (e) {
|
308
|
-
this.#requestErrorLogger("While parsing %s, got %s", text, e)
|
309
|
-
resubmit = true
|
310
|
-
}
|
311
|
-
if (resubmit) {
|
312
|
-
this.#submitFormThroughBrowser(form)
|
313
356
|
}
|
314
357
|
})
|
315
358
|
}
|
316
359
|
|
317
|
-
#errorMessagesFromServer(text) {
|
318
|
-
const parser = new DOMParser()
|
319
|
-
const fragment = parser.parseFromString(text,"text/html")
|
320
|
-
|
321
|
-
return fragment.querySelectorAll(ConstraintViolationMessage.tagName)
|
322
|
-
}
|
323
|
-
|
324
360
|
#setCustomValidityThatClearsOnChange(input,errorMessages) {
|
325
361
|
input.setCustomValidity(errorMessages[0].textContent)
|
326
362
|
input.reportValidity()
|
@@ -426,7 +462,7 @@ export default AjaxSubmit
|
|
426
462
|
<br class="clear">
|
427
463
|
|
428
464
|
<footer>
|
429
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
465
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
430
466
|
</footer>
|
431
467
|
|
432
468
|
<script> prettyPrint(); </script>
|
@@ -183,7 +183,7 @@ That means if your input/textarea/select uses the <code>form</code> attribute, t
|
|
183
183
|
<br class="clear">
|
184
184
|
|
185
185
|
<footer>
|
186
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
186
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
187
187
|
</footer>
|
188
188
|
|
189
189
|
<script> prettyPrint(); </script>
|
@@ -105,7 +105,7 @@ export default Autosubmit
|
|
105
105
|
<br class="clear">
|
106
106
|
|
107
107
|
<footer>
|
108
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
108
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
109
109
|
</footer>
|
110
110
|
|
111
111
|
<script> prettyPrint(); </script>
|
@@ -1082,7 +1082,7 @@ this inside a <code>DOMContentLoaded</code> event, or after the page's HTML has
|
|
1082
1082
|
<br class="clear">
|
1083
1083
|
|
1084
1084
|
<footer>
|
1085
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
1085
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
1086
1086
|
</footer>
|
1087
1087
|
|
1088
1088
|
<script> prettyPrint(); </script>
|
@@ -303,7 +303,7 @@ export default BaseCustomElement
|
|
303
303
|
<br class="clear">
|
304
304
|
|
305
305
|
<footer>
|
306
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
306
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
307
307
|
</footer>
|
308
308
|
|
309
309
|
<script> prettyPrint(); </script>
|
@@ -163,7 +163,7 @@ elements.</p></div>
|
|
163
163
|
<br class="clear">
|
164
164
|
|
165
165
|
<footer>
|
166
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
166
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
167
167
|
</footer>
|
168
168
|
|
169
169
|
<script> prettyPrint(); </script>
|
@@ -164,7 +164,7 @@ information captured before warnings were turned on.</p></div>
|
|
164
164
|
<br class="clear">
|
165
165
|
|
166
166
|
<footer>
|
167
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
167
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
168
168
|
</footer>
|
169
169
|
|
170
170
|
<script> prettyPrint(); </script>
|
@@ -269,7 +269,7 @@ If there is no such dialog or the id references the wrong element type,
|
|
269
269
|
<br class="clear">
|
270
270
|
|
271
271
|
<footer>
|
272
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
272
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
273
273
|
</footer>
|
274
274
|
|
275
275
|
<script> prettyPrint(); </script>
|
@@ -158,7 +158,7 @@ export default ConfirmSubmit
|
|
158
158
|
<br class="clear">
|
159
159
|
|
160
160
|
<footer>
|
161
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
161
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
162
162
|
</footer>
|
163
163
|
|
164
164
|
<script> prettyPrint(); </script>
|
@@ -416,7 +416,7 @@ denied, respectively.</p></td>
|
|
416
416
|
<br class="clear">
|
417
417
|
|
418
418
|
<footer>
|
419
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
419
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
420
420
|
</footer>
|
421
421
|
|
422
422
|
<script> prettyPrint(); </script>
|
@@ -185,7 +185,7 @@ export default ConfirmationDialog
|
|
185
185
|
<br class="clear">
|
186
186
|
|
187
187
|
<footer>
|
188
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
188
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
189
189
|
</footer>
|
190
190
|
|
191
191
|
<script> prettyPrint(); </script>
|
@@ -37,7 +37,7 @@
|
|
37
37
|
of an input field via <code>input-name</code>, which can be used to locate the field's localized name.</p>
|
38
38
|
<p>Here is how the field's name is determined:</p>
|
39
39
|
<ol>
|
40
|
-
<li>It will look for a <code><brut-i18n-translation></code> element with the <code>key</code> <code>cv.
|
40
|
+
<li>It will look for a <code><brut-i18n-translation></code> element with the <code>key</code> <code>cv.cs.fieldNames.«input-name»</code>.</li>
|
41
41
|
<li>If that's not found, it will attempt to use "this field" by locating a <code><brut-i18n-translation></code> element with the <code>key</code>
|
42
42
|
<code>cv.this_field</code> (the underscore being what is used on Brut's server side).</li>
|
43
43
|
<li>If that is not found, it will use the literaly string "this field" and emit a console warning.</li>
|
@@ -439,7 +439,7 @@ are managed.</p>
|
|
439
439
|
<br class="clear">
|
440
440
|
|
441
441
|
<footer>
|
442
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
442
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
443
443
|
</footer>
|
444
444
|
|
445
445
|
<script> prettyPrint(); </script>
|
@@ -35,7 +35,7 @@ import I18nTranslation from "./I18nTranslation"
|
|
35
35
|
*
|
36
36
|
* Here is how the field's name is determined:
|
37
37
|
*
|
38
|
-
* 1. It will look for a `<brut-i18n-translation>` element with the `key` `cv.
|
38
|
+
* 1. It will look for a `<brut-i18n-translation>` element with the `key` `cv.cs.fieldNames.«input-name»`.
|
39
39
|
* 2. If that's not found, it will attempt to use "this field" by locating a `<brut-i18n-translation>` element with the `key`
|
40
40
|
* `cv.this_field` (the underscore being what is used on Brut's server side).
|
41
41
|
* 3. If that is not found, it will use the literaly string "this field" and emit a console warning.
|
@@ -65,7 +65,7 @@ class ConstraintViolationMessage extends BaseCustomElement {
|
|
65
65
|
|
66
66
|
static createElement(document,attributes) {
|
67
67
|
const element = document.createElement(ConstraintViolationMessage.tagName)
|
68
|
-
element.setAttribute("key",this.i18nKey("
|
68
|
+
element.setAttribute("key",this.i18nKey("cs", attributes.key))
|
69
69
|
element.setAttribute("input-name",attributes["input-name"])
|
70
70
|
if (Object.hasOwn(attributes,"show-warnings")) {
|
71
71
|
element.setAttribute("show-warnings",attributes["show-warnings"])
|
@@ -107,7 +107,7 @@ class ConstraintViolationMessage extends BaseCustomElement {
|
|
107
107
|
}
|
108
108
|
|
109
109
|
inputNameChangedCallback({newValue}) {
|
110
|
-
this.#inputNameKey = this.#i18nKey("
|
110
|
+
this.#inputNameKey = this.#i18nKey("cs", "fieldNames", newValue)
|
111
111
|
}
|
112
112
|
|
113
113
|
serverSideChangedCallback({newValueAsBoolean}) {
|
@@ -167,7 +167,7 @@ export default ConstraintViolationMessage
|
|
167
167
|
<br class="clear">
|
168
168
|
|
169
169
|
<footer>
|
170
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
170
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
171
171
|
</footer>
|
172
172
|
|
173
173
|
<script> prettyPrint(); </script>
|
@@ -412,8 +412,8 @@ This is useful to remove potentially out-of-date messages to replace with up-to-
|
|
412
412
|
<p>This should be called as part of a Form validation event to provide a customized UX for
|
413
413
|
the error messages, beyond what the browser would do by default. The keys used are the same
|
414
414
|
as the attributes of a <code>ValidityState</code>, so for example, a range underflow would mean that <code>validity.rangeUnderflow</code> would return
|
415
|
-
true. Thus, a <code><brut-cv></code> would be created with <code>key="cv.
|
416
|
-
<p>The <code>cv.
|
415
|
+
true. Thus, a <code><brut-cv></code> would be created with <code>key="cv.cs.rangeUnderflow"</code>.</p>
|
416
|
+
<p>The <code>cv.cs</code> is hard-coded to be consistent with Brut's server-side translation management.</p>
|
417
417
|
</div>
|
418
418
|
|
419
419
|
|
@@ -581,7 +581,7 @@ true. Thus, a <code><brut-cv></code> would be created with <code>key=&quo
|
|
581
581
|
<br class="clear">
|
582
582
|
|
583
583
|
<footer>
|
584
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on
|
584
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
|
585
585
|
</footer>
|
586
586
|
|
587
587
|
<script> prettyPrint(); </script>
|