0.0.101 • Published 4 months ago

@tripup-company/element-ui-extended v0.0.101

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Element-ui-extended

Table of Contents

Install

# using in your project
npm i @tripup-company/element-ui-extended

Features

  • Create the table with filters and pagination (CompositeTable)
  • Use directly components:
    • CompositeTable
    • EditableField
    • GenericFilter
    • GenericTable
    • GeneticPaginator
    • NewField
    • PartColumnEdit
    • PartColumnNew
    • PartForm
    • QuickSearchFilter

Usage

CompositeTable

CompositeTable is component that combine such components GenericTable, GenericFilters, GenericTopFilters

CompositeTable diagram

CompositeTable docs

<composite-table :storage-key="key" :fields="fields" :top-filter="topFilter" :filters="filters" :repository="$api.countries()" />
import config from '../settings/config';
import { CompositeTable } from '@tripup-company/element-ui-extended';
export default {
  components: { CompositeTable },
  data () {
    return {
      fields: config.tableFields(this.$router),
      filters: config.filters,
      key: 'storage.key',
      topFilter: {
        name: 'first_name,last_name,email,phone,mobile,position,street,city,state,second_email,department',
        label: 'Search',
        type: 'string',
        operator: 'like_fields',
      }
    };
  }
}

config.js

export default {
  tableFields: ($router) => 
  [
    {
      prop: 'id',
      label: '#',
      width: 70,
      callback: (field, index, row) => {
        $router.push('/cruises/edit/' + row.id);
      },
    },
    {
      prop: 'ship.data.ship', label: 'Ship', callback: (field, index, row) => {
        $router.push('/cruises/edit/' + row.id);
      },
      formatter: row => {
        return row.ship.data.ship;
      },
    },
  ],
  filters: [
    {
      name: 'created_at',
      label: 'Created at',
      type: 'date',
      operator: 'between_date',
    },
    {
      name: 'country',
      label: 'Country',
      type: 'string',
    },
  ]
}

EditableField

NewField, EditableField- components that combine such components of element io: el-checkbox, el-input-number, el-select, el-date-picker, el-input

These components are quickly configurable through the config and are needed to shorten the code, we can render elements use loop

EditableField docs

<editable-field
    v-model="data[prop]"
    :type="'select'"
    :select-list="selectList"
    :select-multiple="selectMultiple"
    :select-key="'value'"
    :select-label="'name'
    :select-value="'value'"
    :field="prop"
    :remote-method="remoteMethod"
    :filterable="filterable"
    @editable:save="updateValue"
/>

GenericFilter

GenericFilter - component for work with filter ( template with checkbox for use selected filters)

GenericFilter docs

<generic-filter
  v-if="filters.length"
  :filters="filters"
  :search="search"
  @apply:filter="handleApplyFilter"
  @reset:filter="handleResetFilter"
/>

PartColumn is component that show part of form with it title and configured column resolution

This component is wrapper for column it need for quick create part of form and transfer errors from backend to form elements

 <part-column
    :data="form.partner"
    :fields="partnerConfig.commissionFields"
    :prop-prefix="'partner.'"
    :errors="errors"
    @save="partnerUpdateValue"
/>

Attributes

Attribute nameDescriptionTypeAccepted valuesDefault
col-resolutioncol resolution for this columnObject{xl: 24, lg: 24, md: 24, sm: 24, xs: 24}
col-inner-resolutioncol resolution for current fieldObject{xl: 24, lg: 24, md: 24, sm: 24, xs: 24}
column-namecolumn label (title)String''
prop-prefixprefix for all fields in columnString''
fieldsfields arrayArray[]
datadata biding values for fieldsObject{}
errorserrors for fieldsObject{}

Attributes

Attribute nameDescriptionTypeDefault
filtersall filters for showArray[]
searchselected filtersArray[]

Example filters:

[
    {
        name: 'state',
        label: 'State',
        type: 'string',
    },
    {
        name: 'created_at',
        label: 'Created at',
        type: 'date',
        operator: 'between_date',
    }
]

Example search:

{
    title: {
        title: Object
        operator: ""
        value: ""
    },
    first_name: {
        operator: "like_fields"
        value: ""
    }
}

Events

@apply:filter

@reset:filter

GenericTable - component for show table

Attributes

Attribute nameDescriptionTypeAccepted valuesDefault
fieldsArray of columnsArray[][]
dataArray of rowsArray[][]

Events

@sort:change

GeneticPaginator - component for pagination

Attributes

Attribute nameDescriptionTypeAccepted valuesDefault
totalTotal rowsNumberNumber0
limitLimit per pageNumberNumber0
current-pageNumber current pageNumberNumber0

Events

@size:change

@page:change

====

0.0.101

4 months ago

0.0.100

4 months ago

0.0.99

9 months ago

0.0.97

10 months ago

0.0.98

10 months ago

0.0.95

1 year ago

0.0.96

1 year ago

0.0.94

1 year ago

0.0.93

1 year ago

0.0.90

1 year ago

0.0.91

1 year ago

0.0.92

1 year ago

0.0.89

1 year ago

0.0.88

1 year ago

0.0.86

3 years ago

0.0.87

2 years ago

0.0.84

3 years ago

0.0.85

3 years ago

0.0.80

3 years ago

0.0.81

3 years ago

0.0.82

3 years ago

0.0.83

3 years ago

0.0.79

3 years ago

0.0.73

3 years ago

0.0.74

3 years ago

0.0.75

3 years ago

0.0.76

3 years ago

0.0.77

3 years ago

0.0.78

3 years ago

0.0.70

3 years ago

0.0.71

3 years ago

0.0.72

3 years ago

0.0.62

3 years ago

0.0.63

3 years ago

0.0.64

3 years ago

0.0.65

3 years ago

0.0.66

3 years ago

0.0.67

3 years ago

0.0.68

3 years ago

0.0.69

3 years ago

0.0.61

3 years ago

0.0.60

3 years ago

0.0.59

3 years ago

0.0.57

3 years ago

0.0.58

3 years ago

0.0.51

3 years ago

0.0.52

3 years ago

0.0.53

3 years ago

0.0.54

3 years ago

0.0.55

3 years ago

0.0.56

3 years ago

0.0.50

3 years ago

0.0.48

3 years ago

0.0.49

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.42

3 years ago

0.0.20

3 years ago

0.0.43

3 years ago

0.0.21

3 years ago

0.0.44

3 years ago

0.0.22

3 years ago

0.0.45

3 years ago

0.0.23

3 years ago

0.0.46

3 years ago

0.0.24

3 years ago

0.0.47

3 years ago

0.0.25

3 years ago

0.0.37

3 years ago

0.0.15

3 years ago

0.0.38

3 years ago

0.0.16

3 years ago

0.0.39

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.10

3 years ago

0.0.33

3 years ago

0.0.11

3 years ago

0.0.34

3 years ago

0.0.12

3 years ago

0.0.35

3 years ago

0.0.13

3 years ago

0.0.36

3 years ago

0.0.14

3 years ago

0.0.26

3 years ago

0.0.9

3 years ago

0.0.27

3 years ago

0.0.8

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago