Swiftpack.co - Package - nodes-vapor/admin-panel

admin-panel

A description of this package.

Confirm Modal

Admin Panel includes a generic confirmation modal for links, out of the box. Using HTML data attributes on <a>-tags the modal can be configured in different ways. Just add a data attribute to your link and you're all set.

Triggering the modal will append a HTML-element form to the DOM, containing title, text, confirm button and dismiss button.

By default confirm submits the form and dismiss will remove the HTML-element from the DOM

Basic usage

<a href="#" data-confirm="true">Open modal</a>

Data Attributes

|Attribute|Description|example| |---------|-----------|-------| |data-confirm|Initialize the modal|data-confirm="true"| |data-title|Sets the title of the modal|data-title="Please confirm"| |data-text|Sets the text of the modal|data-text="Are you sure you want to continue?"| |data-button|Sets bootstrap css selector for the confirm button|data-button="danger" [primary,secondary,success,danger,warning,info,light,dark]| |data-confirm-btn|Set the text label on the "confirm"-button|data-confirm-btn="Yes"| |data-dismiss-btn|Set the text label on the "dismiss"-button|data-confirm-btn="No"|

Override default behavior

// Override modal confirm action
modalConfirmation.actions.confirm = function(event) {
    alert("Confirmed");
}

// Overríde modal dismiss action
modalConfirmation.actions.dismiss = function(event) {
    alert("Dismissed");
}

Github

link
Stars: 46
Help us keep the lights on

Releases

2.0.0-rc.4 - Apr 16, 2019

Added

  • AdminPanelUserRole now conform to CaseIterable

2.0.0-rc.3 - Apr 9, 2019

Fixed

  • Initializers for AdminPanelConfig are now public as expected.

2.0.0-rc.2 - Apr 2, 2019

Changed

  • handleValidationError is now public (thanks @MrMage)

2.0.0-rc.1 - Mar 6, 2019

Changed:

  • updated to latest packages
  • AdminPanelProvider now accepts a config factory to support async middleware and signers
  • allow specifying reset endpoints
  • registers bootstrap tags automatically

Fixed:

  • hash password when seeding

2.0.0-beta.15 - Dec 11, 2018

Changed

  • Correctly specified 4.1 as the minimum required Swift version.

Removed

  • This package no longer uses the MutableLeafTagConfig. Please use useAdminPanelLeafTags() for registering this package's Leaf tags (see readme for more info).