Coder Social home page Coder Social logo

blazored / autosaveeditform Goto Github PK

View Code? Open in Web Editor NEW
49.0 9.0 11.0 4.31 MB

A replacement for the default EditForm component which will auto save a form until it is successfully submitted

Home Page: https://blazored.github.io/AutoSaveEditForm/

License: MIT License

C# 99.56% HTML 0.44%
blazor blazored blazor-server blazor-client blazor-component blazor-webassembly blazor-form blazor-editform blazor-autosave

autosaveeditform's Introduction

Blazored AutoSaveEditForm

A replacement for the default EditForm component which will auto save a form until it is successfully submitted.

Screenshot of the component in action

Currently in development

This project is currently in development and hasn't been released yet. If you would like to help or have any suggestions for features please raise an issue.

autosaveeditform's People

Contributors

chrissainty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autosaveeditform's Issues

Ability to choose between local and session storage

We don't currently allow the developer to choose where to store the saved form model, it's hardcoded to local storage.

This should be configurable by the developer via a parameter on the BlazoredAutoSaveEditForm component.

[Parameter] public StorageTypes StorageType { get; set; }

public enum StorageTypes
{
    LocalStorage,
    SessionStorage
}

Create better unique identifiers for saved forms

Currently, we just use a string Id provided by the user. This isn't unique enough to be used application-wide. We need to come up with a better way to generate this Id, perhaps something like the hash of the object type and the user provided id?

Only saves after leaving textbox

While user is typing, it does not actually auto-save. The user must leave the textbox by clicking somewhere else, then it gets saved. In real world scenario, I occasionally lose SignalR connection to the server and require a reload. In this case, the text already typed is all lost. Would be great if the auto-save works as the user is typing.

[Feature Request] Expose Save method

Is your feature request related to a problem? Please describe.
Please expose the save method.

Additional context
The ability to save the form from another piece of code. Mainly complex auto complete and dynamically adding fields in the form from outside the form.

What I am using:

private async void SaveToStorage(object sender, FieldChangedEventArgs args)
{
	await SaveToStorage();
}

public async Task SaveToStorage()
{
	var model = Model ?? _fixedEditContext.Model;
	var serializedData = JsonSerializer.Serialize(model);
	await _jsRuntime.InvokeVoidAsync($"{GetSelectedStorageType()}.setItem", Id, serializedData);
}

I can create a PR if you would like.

Placeholder: Complex forms

We need to be able to handle complex forms which contain both primitive and complex types. This is a placeholder issue to discuss that.

Build out CI pipeline

  • Get build working on Azure Pipelines
  • Register package on NuGet
  • Add release pipeline to NuGet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.