JSPM

  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q38207F

A nice plugin to add filter component to your application 🎨

Package Exports

  • @baldeepsinghkwatra/v-filter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@baldeepsinghkwatra/v-filter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

vfilter

Importing the plugin in main.js

import VFilter from '@baldeepsinghkwatra/v-filter'
Vue.use(VFilter);

Importing styles in App.vue

@import "../node_modules/@baldeepsinghkwatra/v-filter/dist/vfilter.css";

Using the filter in any component

 <v-filter @apply="onFilter" v-model="filters" />
 @apply event occurs when user clicks on apply button
 Create a data property filters:
  filters: [{
                name: "registrationDate",
                label: "Registration Date",
                type: "date",
                dateType: "date",
                value: new Date(),
                enabled: true,
                applied: true,
                readonly: true,
                rules: [v => !!v || "Item is required"],
                showCondition: false,
                clearable: false,
                condition: "_eq"
            },
            {
                name: "username",
                label: "Username",
                type: "text",
                value: '',
                enabled: false,
                applied: false,
                clearable: false,
                showCondition: false,
                condition: "_eq"
            },
            {
                name: "status",
                label: "Account Status",
                type: "multiselect",
                value: ["SUCCESS"],
                defaultValue: ["SUCCESS"],
                enabled: true,
                applied: true,
                values: [{
                        text: "Pending",
                        value: "PENDING"
                    },
                    {
                        text: "Blocked",
                        value: "BLOCKED"
                    },
                    {
                        text: "Approved",
                        value: "APPROVED"
                    }
                ]
            }
        ]

Create Build Bundle

npm run build-bundle

Deploying to NPM

npm publish --access public