import { storiesOf } from '@storybook/vue';

storiesOf('Common', module)
  .add('Filter', () => ({
    components: {
    },
    data() {
      return {
        options: {
          keys: [{
            name: 'Choose Key',
            id: -99
          },{
            name: 'Crash Number',
            id: 134
          },{
            name: 'Daily Startup',
            id: 256
          }],
          operators: [{
            name: 'Choose Operator',
            id: -99
          },{
            name: 'equal to',
            id: '>'
          },{
            name: 'not equal to',
            id: '='
          },{
            name: 'less',
            id: '<'
          }]
        },
        isVisible: false,
        isItemEdit: false,
        from: '2021-01-16',
        to: null,
        dates: [],
        customDays: {
          '2021-10-21': { text: '🎉', class: 'test' }
        },
        filter: {},
        filterFields: [
          {
            type: 'list',
            text: 'Status',
            options: [
              { title: 'Active', value: 'active' },
              { title: 'Inactive', value: 'inactive' },
            ]
          },
          {
            type: 'employee',
            text: 'Employee'
          },
        ]
      }
    },
    methods: {
      submit() {
        console.info('saved');
      },
      reset() {
        this.$refs.form.resetValidation();
      }
    },
    template: `<div>
      <p>You need wrap whole application with this tag</p>

      <h2>Usage</h2>

  <pre>

  </pre>


      <filters-list />

      {{filter}}

    </div>`,
  }));
