Giter VIP home page Giter VIP logo

vue2-simplert's Introduction

⚠️ vue2-simplert

Vue 2 Simple Alert Component (SweetAlert Inspired)

License minified version Travis codecov

❗️❗️❗️ Vue2-Simplert Now Coming as Vue.js Plugin

Please use the plugin version: https://github.com/mazipan/vue2-simplert-plugin

Demo

https://mazipan.github.io/vue2-simplert/

Documentation

See docs in GitBook: https://vue2-simplert.gitbook.io

Credit

Icon from SweetAlert

Contributing

If you'd like to contribute, head to the contributing guidelines. Inside you'll find directions for opening issues, coding standards, and notes on development.

vue2-simplert

Copyright © 2017 by Irfan Maulana

vue2-simplert's People

Contributors

bertzzie avatar dependabot[bot] avatar imgbot[bot] avatar irfan-maulana-tkp avatar mazipan avatar tamtamchik 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  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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vue2-simplert's Issues

Add custom icon

SweetAlert support custom icon, if code is easy I think will be good for us to add this feature.

Installation issue - Module not found: Error: Can't resolve 'scss-loader'

Hi,

Tried to install your wonderful package but error occurs as follow:

{ [Error: ./~/vue2-simplert/src/components/simplert/index.vue
Module not found: Error: Can't resolve 'scss-loader' in '/var/www/html/project/node_modules/vue2-simplert/src/components/simplert'
resolve 'scss-loader' in '/var/www/html/project/node_modules/vue2-simplert/src/components/simplert'
  Parsed request is a module
  using description file: /var/www/html/project/node_modules/vue2-simplert/package.json (relative path: ./src/components/simplert)
  after using description file: /var/www/html/project/node_modules/vue2-simplert/package.json (relative path: ./src/components/simplert)
    resolve as module
      module variation scss-loader-loader

I am using Laravel 5.3 and here is my package.json:

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "axios": "^0.15.3",
    "bootstrap-sass": "^3.3.7",
    "gulp": "^3.9.1",
    "jquery": "^3.1.0",
    "laravel-elixir": "^6.0.0-9",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.17.4",
    "vue": "^2.1.10",
    "vue-resource": "^1.0.3"
  },
  "dependencies": {
    "laravel-echo": "^1.2.5",
    "node-sass": "^4.5.3",
    "pusher-js": "^4.0.0",
    "sass-loader": "^6.0.6",
    "scss-loader": "0.0.1",
    "vue2-dropzone": "^2.3.5",
    "vue2-simplert": "^0.3.0"
  }
}

My node's version is v8.0.0 and npm is 5.0.0

I did run npm install node-sass scss-loader --save and it does not work

please do assist

Regards

Can't get it to work with webpack 2.2.0

I get

Uncaught TypeError: Cannot assign to read only property 'exports' of object '#'
at Object. (vue2-simplert.js:6)
at Object. (vue2-simplert.js:6)
at e (vue2-simplert.js:6)
at n.exports.n (vue2-simplert.js:6)
at vue2-simplert.js:6
at webpackJsonp.491.t (vue2-simplert.js:6)
at Object.491 (vue2-simplert.js:6)
at webpack_require (bootstrap 3a212dd…:54)
at Object.165 (customers.js:1)
at webpack_require (bootstrap 3a212dd…:54)

Cover entire SPA with Simplert modal

Hi all,

screen shot 2017-08-05 at 6 41 08 pm

Currently, I'm doing a Single Page Application (SPA) project, and am using Simplert. The navigation bar, sidebar and the contents are all different components.

I'm currently invoking the Simplert from the content component. So, is there a way to cover the entire browser page (including the sidebar and navigation bar) with the Simplert modal?

Disable click on modal FR

As a feature, it would be nice if we could disable the click on modal event so the user is forced to click on a button to continue. This makes more sense now that the second button is a feature.

Is there a way to use 2 alert components, one after another?

Hi,

So basically what I want to do is show an alert saying "Do you want to delete this record?" --> Confirm or Cancel. If the user clicks "Confirm", another alert will appear and says "Successfully deleted!"
I'm having an issue where i'm unable to show the 2nd alert component which says "Successfully deleted."

HTML code:

      <!-- Simplert Notification -->
      <simplert 
        :useRadius="true"
        :useIcon="true"
        ref="simplert">
      </simplert>

This is my Vue code:

  methods: {
    deleteBtn () {
      let confirmFn = function () {
        let obj2 = {
          title: 'Success',
          message: 'Staff record successfully deleted!',
          type: 'success'
        }
        this.$refs.simplert.openSimplert(obj2)
      }
      let obj = {
        title: 'Warning',
        message: 'Are you sure you want to delete staff record?',
        type: 'warning',
        useConfirmBtn: true,
        onConfirm: confirmFn
      }
      this.$refs.simplert.openSimplert(obj)
    }
  }

The error is shown for obj2:
Uncaught TypeError: Cannot read property 'openSimplert' of undefined

How should I go about doing this?

Thank you!

Import won't work in modular env

When I am following your example and do in app.vue import Simplert from './simplert.vue' I get:

This dependency was not found in node_modules:

  • ./simplert.vue

Did you forget to run npm install --save for it?

However, if I try import Simplert from 'vue2-simplert/dist/vue2-simplert.js' it will work but it seems I cannot get the modal to appear.

Project created with vue-cli wepback template
Thanks.

ButtonText slot?

Hi,

I try to add some elements under buttons, just like

<button class="btn btn-danger">
    <i class="fa fa-trash"></i> Delete!
</button>

Unfortunately, customConfirmBtnText would do this, <i class="fa fa-trash"> Delete!</i>, as TEXT instead of HTML.

But it a little bit fall away from spirit of MVVM ,if it could be done by customConfirmBtnText.

I'm wondering whether the slot of Vue is in this project?
So, I can custom child elements under Button, even components!

<simplert id="simplert" :useRadius="true" :useIcon="true" ref="simplert">
    <template slot="confirmBtn" slot-scope="data">
        <icon :name="data.iconName"></icon>
        {{data.customConfirmBtnText}}
    </template>
</simplert>

Thanks.

Webpack build error

Hi, I set up empty vuejs webpack project and add vue2-simplert component. But when I build project, I get error:
ERROR in static/js/vendor.9cdb516fd1e83e5588b9.js from UglifyJs
Unexpected token: operator (>) [./node_modules/vue2-simplert/src/main-dist.js:4,0][static/js/vendor.9cdb516fd1e83e5588b9.js:27114,16]

How to reproduce:

vue init webpack my-project
cd my-project
npm install
npm install vue2-simplert --save

use simplert in App.vue

npm run dev   -> app works

npm run build  -> build fails

SSR

Hello!
I trying integrate server side rendering in my project.
When I add vue2-simplert

import Simplert from 'vue2-simplert'

I get error

ReferenceError: document is not defined

Does have way for use vue2-simplert with server side rendering?

Thank you

ERROR can't load Simplert.vue

HI,
tried to install your wonderful package but error occurs as follow

ERROR in ./node_modules/vue2-simplert/src/Simplert.vue
    Module parse failed: [...]\node_modules\vue2-simplert\src\Simplert.vue Unexpected token (1:0)
    You may need an appropriate loader to handle this file type.
    | <template>
    |   <div class="simplert" role="modal" :class="classSimplert" @click="closeOverlay">
    |     <div class="simplert__content" :class="classContent">
     @ ./node_modules/vue2-simplert/src/main-dist.js 1:0-37
     @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./_src/views/fields/Index.vue
     @ ./_src/views/fields/Index.vue
     @ ./_src/router/routes.js
     @ ./_src/router/index.js
     @ ./_src/boot-app.js

package.json
"vue2-simplert": "^0.5.5"

Tnx.

Click overlay not working

Now click overlay not close popup, maybe class checking that make it buggy.
Try using indexof instead of ===

Please remove global CSS styles from

Hi,

great lib, but contains some global CSS styles, which changes my site design if I use it.

html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -o-box-sizing: border-box;
  -ms-box-sizing: border-box;
  font-size: 62.5%; }

*, *:before, *:after {
  box-sizing: inherit; }

I think it is not need to use this lib.
Btw, it would be good to extract styles to a CSS file.

Demo site its bugged

I try the demo site but, when clicked, its show all icons at once, with no text and can't click the button. Something its wrong?

Second alert triggers onClose immediately

When using a second Simplert, It triggers the function on close from the first one, not the second one. The second alert is never actually even seen. Perhaps I'm using it incorrectly?

custom button class does not work

I try to use "customConfirmBtnClass" to set up confirm button class, e.g. 'btn-warning'
then the confirm btn class is like "simplert__confirm simplert__confirm--radius btn-warning"

Finally the background-color style is re-write by "simplert__confirm"

Add hideAllButton config

There is condition when we need alert without any button showing, so we need add this configuration

what is the use radius option?

In the documentation it is written that there is a breaking change for useRadius, but nowhere is says what it does. I tried putting it true or false, can't seem to get what is the difference.

use scoped styles instead of global

html {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}

Hi,
Would you like to use scoped styles instead of these global ones.
I don't think it is a good practice that changing box-sizing of the root element in simplert.

Create unit test

Unit test will help us to avoid potential bugs.
Need to implement unit test.

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.