1.0.6 • Published 1 year ago

@barbieswimcrew/stimulus-components v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@barbieswimcrew/stimulus-components

This package contains a list of useful stimulus components that can be conveniently reused in numerous projects.

Components

  • AjaxModal - This component makes it easy to fetch html from any URL to display in a modal window.
  • AjaxSortable - This component uses "Stimulus Sortable" and sends an ajax request "onUpdate" to save the changed items order.
  • DirtyForm - If there is a form on the current page, this component checks if there are unsaved changes and warns the user when leaving the page that the changes will be lost.
  • ThemeSwitch - Provides a function to switch the theme between "light" and "dark" and stores the selected configuration in the localStorage.

Installation

yarn add @barbieswimcrew/stimulus-components

Usage

To use one of the included controllers simply consume in bootstrap.js as follows:

import { startStimulusApp } from "@symfony/stimulus-bridge";
//...
import ThemeSwitchController from "@barbieswimcrew/stimulus-components/src/controllers/theme-switch/theme_switch";
//...
export const app = startStimulusApp(
    require.context(
        "@symfony/stimulus-bridge/lazy-controller-loader!./controllers",
        true,
        /\.(j|t)sx?$/
    )
);
//...
app.register("theme-switch", ThemeSwitchController);
//...
1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago