5.1.3 • Published 7 months ago

@forter/table v5.1.3

Weekly downloads
286
License
Apache-2.0
Repository
github
Last release
7 months ago

fc-sort-control

Provides a box with a search input and a scrollable div with checkboxes derived from the given objects

Properties

PropertyAttributeTypeDefaultDescription
objectsobjectsany[]The objects to display
searchTextsearchTextstring""The text inside the search box

Events

Event
change
sort

fc-sort-control

Provides a binary "Ascending/Descending" control for sortable tables.

Properties

PropertyAttributeTypeDefaultDescription
ascHTMLInputElementThe ascending control
checkedHTMLInputElementThe control for the selected direction
descHTMLInputElementThe descending control
directiondirection"asc" \| "desc" \| "none"The current sort direction
levellevelnumberThe sort level that will be displayed in a label
preventSecondarySortprevent-secondary-sortbooleanfalseWhether or not multiple column sort is enabled. example: true

Events

Event
sort

fc-table

A table accepting rows and columns. Rows represent actual data, columns describe the data types in the table.

Usage

<script>
   import '@forter/table';
</script>

<fc-table
      multi
      row-actions
      columns-draggable
      columns-removable
      columns=[{"insertable":true,"label":"First Name","fromKey":"firstName","pinned":true,"removable":false,"sortable":true,"sort":"asc","sortLevel":1,"type":"TEXT","filterable":true,"defaultVisibility":false,"defaultIndex":2,"filter":{"operator":"Matches","searchValues":["lala","abcdefghijklmnopqrstuvwxyz"]}},{"insertable":true,"editable":true,"required":true,"label":"Last Name","fromKey":"lastName","type":"TEXT","sort":"desc","sortLevel":2,"sortable":true,"defaultVisibility":true,"filterable":true,"filter":{"values":[{"label":"Yosef","checked":false,"color":"blue"},{"label":"Anati","checked":false,"color":"green"},{"label":"Weingart","checked":false,"color":"purple"},{"label":"Feder","checked":false,"color":"blue"}]}},{"label":"Payment Method","fromKey":"paymentMethod","type":"CUSTOM","renderer":"moneyRenderer","sortable":true,"defaultIndex":4,"visible":true,"filterable":true,"filter":{"values":[{"label":"PayPal","checked":true},{"label":"Amex","checked":false},{"label":"MasterCard","checked":false},{"label":"Visa","checked":true},{"label":"Bank Transfer","checked":true},{"label":"ApplePay","checked":true},{"label":"Google Pay","checked":false},{"label":"Android Pay","checked":false},{"label":"Amazon Pay","checked":false}],"valuesRenderer":"baba"}},{"label":"Text Column","fromKey":"textData","type":"TEXT","defaultIndex":3,"sortable":true,"visible":false,"filterable":true,"defaultVisibility":true},{"insertable":true,"multipleEditable":true,"editable":true,"required":true,"maskType":"number","label":"Order Amount","fromKey":"orderAmount","type":"TEXT","custom":"moneyRenderer","visible":true,"filterable":true,"defaultVisibility":true,"filter":{"type":"NUMBER","operator":"Greater Than","searchValues":["1"]}},{"maskType":"date","mask":"DD MMM YYYY HH:mm","required":true,"insertable":true,"editable":true,"label":"Date Column","fromKey":"dateData","type":"DATE","defaultVisibility":false},{"label":"Icon Column","fromKey":"iconData","type":"ICON","visible":true,"defaultIndex":5,"sortable":true,"filterable":true,"defaultVisibility":true}]
      rows=[{"firstName":false,"selected":true,"lastName":"Yosef","orderAmount":"12","rowActions":["claims","feedback"],"dateData":1557834321099,"paymentMethod":"Amex","iconData":{"icon":"copy"}},{"firstName":true,"selected":false,"lastName":"Anati","orderAmount":"132.5","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Paypal","rowActions":["claims","feedback"]},{"firstName":"Ori","lastName":"Weingart","orderAmount":"17","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Visa","rowActions":["claims","feedback"]},{"firstName":"Gilad","lastName":"Feder","orderAmount":"987.6","dateData":1557834321099,"iconData":{"icon":"copy"},"paymentMethod":"MasterCard"},{"firstName":false,"lastName":"Yosef","orderAmount":"12","dateData":1557834321099,"paymentMethod":"Amex","iconData":{"icon":"copy"}},{"firstName":true,"lastName":"Anati","orderAmount":"132.5","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Paypal","rowActions":["claims","feedback"]},{"firstName":"Ori","lastName":"Weingart","orderAmount":"17","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Visa","rowActions":["claims","feedback"]},{"firstName":"Gilad","lastName":"Feder","orderAmount":"987.6","dateData":1557834321099,"iconData":{"icon":"copy"},"paymentMethod":"MasterCard"},{"firstName":false,"lastName":"Yosef","orderAmount":"12","dateData":1557834321099,"paymentMethod":"Amex","iconData":{"icon":"copy"}},{"firstName":true,"lastName":"Anati","orderAmount":"132.5","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Paypal","rowActions":["claims","feedback"]}]>
      <div slot="footer"><fc-button>Export</fc-button></div>
</fc-table>

Examples

<!-- empty -->
<fc-table></fc-table>

<!-- simpleTable -->
<fc-table
      columns=[{"label":"Text_Column","fromKey":"textData","type":"TEXT"},{"label":"Date_Column","fromKey":"dateData","type":"DATE"},{"label":"Icon_Column","fromKey":"iconData","type":"ICON"}]
      rows=[{"textData":"Some_Long_Text_Data","dateData":1557834321063,"iconData":{"icon":"edit"}},{"textData":"more_data","dateData":1557834321099,"iconData":{"icon":"copy"}}]>
</fc-table>

<!-- noRows -->
<fc-table
      columns=[{"label":"Text_Column","fromKey":"textData","type":"TEXT"},{"label":"Date_Column","fromKey":"dateData","type":"DATE"},{"label":"Icon_Column","fromKey":"iconData","type":"ICON"}]>
</fc-table>

<!-- row color -->
<fc-table
      multi
      row-actions
      columns-draggable
      columns-removable
      columns=[{"label":"First Name","fromKey":"firstName","pinned":true,"removable":false,"sortable":true,"sort":"asc","sortLevel":1,"type":"TEXT","filterable":true,"defaultVisibility":false,"defaultIndex":2,"filter":{"operator":"Matches","searchValues":["lala","abcdefghijklmnopqrstuvwxyz"]}},{"label":"Last Name","fromKey":"lastName","type":"TEXT","sort":"desc","sortLevel":2,"sortable":true,"defaultVisibility":true,"filterable":true,"filter":{"values":[{"label":"Yosef","checked":false,"color":"blue"},{"label":"Anati","checked":false,"color":"green"},{"label":"Weingart","checked":false,"color":"purple"},{"label":"Feder","checked":false,"color":"blue"}]}},{"label":"Payment Method","fromKey":"paymentMethod","type":"CUSTOM","renderer":"moneyRenderer","sortable":true,"defaultIndex":4,"visible":true,"filterable":true,"filter":{"values":[{"label":"PayPal","checked":true},{"label":"Amex","checked":false},{"label":"MasterCard","checked":false},{"label":"Visa","checked":true},{"label":"Bank Transfer","checked":true},{"label":"ApplePay","checked":true},{"label":"Google Pay","checked":false},{"label":"Android Pay","checked":false},{"label":"Amazon Pay","checked":false}],"valuesRenderer":"baba"}},{"label":"Text Column","fromKey":"textData","type":"TEXT","defaultIndex":3,"sortable":true,"visible":false,"filterable":true,"defaultVisibility":true},{"label":"Order Amount","fromKey":"orderAmount","type":"TEXT","custom":"moneyRenderer","visible":true,"filterable":true,"defaultVisibility":true,"filter":{"type":"NUMBER","operator":"Greater Than","searchValues":["1"]}},{"label":"Date Column","fromKey":"dateData","type":"DATE","defaultVisibility":false},{"label":"Icon Column","fromKey":"iconData","type":"ICON","visible":true,"defaultIndex":5,"sortable":true,"filterable":true,"defaultVisibility":true}]
      rows=[{"firstName":false,"color":"#cde5f3","selected":true,"lastName":"Yosef","orderAmount":"12","rowActions":["claims","feedback"],"dateData":1557834321099,"paymentMethod":"Amex","iconData":{"icon":"copy"}},{"firstName":true,"selected":false,"lastName":"Anati","orderAmount":"132.5","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Paypal","rowActions":["claims","feedback"]},{"firstName":"Ori","lastName":"Weingart","orderAmount":"17","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Visa","rowActions":["claims","feedback"]},{"firstName":"Gilad","lastName":"Feder","orderAmount":"987.6","dateData":1557834321099,"iconData":{"icon":"copy"},"paymentMethod":"MasterCard"},{"firstName":false,"lastName":"Yosef","orderAmount":"12","dateData":1557834321099,"paymentMethod":"Amex","iconData":{"icon":"copy"}},{"firstName":true,"lastName":"Anati","orderAmount":"132.5","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Paypal","rowActions":["claims","feedback"]},{"firstName":"Ori","lastName":"Weingart","orderAmount":"17","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Visa","rowActions":["claims","feedback"]},{"firstName":"Gilad","lastName":"Feder","orderAmount":"987.6","dateData":1557834321099,"iconData":{"icon":"copy"},"paymentMethod":"MasterCard"},{"firstName":false,"lastName":"Yosef","orderAmount":"12","dateData":1557834321099,"paymentMethod":"Amex","iconData":{"icon":"copy"}},{"firstName":true,"lastName":"Anati","orderAmount":"132.5","dateData":1557834321063,"iconData":{"icon":"edit"},"paymentMethod":"Paypal","rowActions":["claims","feedback"]}]>
      <div slot="footer"><fc-button>Export</fc-button></div>
</fc-table>

<!-- loading -->
<fc-table loading
columns=[{"label":"Text_Column","fromKey":"textData","type":"TEXT"},{"label":"Date_Column","fromKey":"dateData","type":"DATE"},{"label":"Icon_Column","fromKey":"iconData","type":"ICON"}]
      rows=[{"textData":"Some_Long_Text_Data","dateData":1557834321063,"iconData":{"icon":"edit"}},{"textData":"more_data","dateData":1557834321099,"iconData":{"icon":"copy"}}]>
</fc-table>

<!-- rowSingleSelect -->
<fc-table select
columns=[{"label":"Text_Column","fromKey":"textData","type":"TEXT"},{"label":"Date_Column","fromKey":"dateData","type":"DATE"},{"label":"Icon_Column","fromKey":"iconData","type":"ICON"}]
      rows=[{"textData":"Some_Long_Text_Data","dateData":1557834321063,"iconData":{"icon":"edit"}},{"textData":"more_data","dateData":1557834321099,"iconData":{"icon":"copy"}}]>
</fc-table>

  * <!-- rowMultiSelect -->
<fc-table
    select
    multi
   columns=[{"label":"Text_Column","fromKey":"textData","type":"TEXT"},{"label":"Date_Column","fromKey":"dateData","type":"DATE"},{"label":"Icon_Column","fromKey":"iconData","type":"ICON"}]
      rows=[{"textData":"Some_Long_Text_Data","dateData":1557834321063,"iconData":{"icon":"edit"}},{"textData":"more_data","dateData":1557834321099,"iconData":{"icon":"copy"}}]>
</fc-table>

Properties

PropertyAttributeTypeDefaultDescription
checkedany[]
columnscolumnsany[]Column descriptors. example: [{ "label": "Text Column", "fromKey": "textData", "type": "TEXT" }, { "label": "Date Column", "fromKey": "dateData", "type": "DATE" },{ "label": "Icon Column", "fromKey": "iconData", "type": "ICON" }]
columnsDraggablecolumns-draggablebooleanWhether or not dragging columns is enabled
columnsRemovablecolumns-removable"" \| TemplateResult
compactCellscompact-cellsbooleanfalseWhether or not to make the cells of the table compact (with white space wrapping). example: true
displayNoData({ loading, rows }: { loading: any; rows: any; }) => TemplateResult
editableeditablebooleanfalseWhether or not to show create button for editing. example: true
editingeditingbooleanfalseWhether or not grid support editing of a selected row. example: true
escapeNoLocalizeescapeNoLocalizebooleanfalseWhether to translate cells
fetchingfetchingbooleanWhether the table is fetching new data
filterable"" \| TemplateResult
filtersnever[]
hideColumnOptionshide-column-optionsbooleanfalseWhether or not to display the column options button. example: true
hideColumnSaveButtonshide-column-save-buttonsbooleanfalseWhether or not to display the column save buttons. example: true
hideFooterhide-footerbooleanfalseWhether or not to show the footer. example: true
loadingloading"" \| TemplateResult
multimultibooleanWhether selecting multiple rows is enabled.
noRowsstring
preventSecondarySortprevent-secondary-sortbooleanfalseWhether or not multiple column sort is enabled. example: true
removableremovablebooleanfalseWhether or not to show delete button. example: true
renderNoDataPlaceHolder({ loading, rows, totalColumnsNum }: { loading: any; rows: any; totalColumnsNum: any; }) => TemplateResult
renderersrenderersanyCustom renderer class. Used in custom columns
resultTemplateResult \| null
rowActionsrow-actionsbooleanWhether or not the row actions button is enabled
rowLimitrow-limitnumber10Whether or not to show create button for editing. example: 10
rowsrowsany[]Row Descriptors. example: [{"textData": "Some Long Text Data","dateData": 1557834321063,"iconData": { "icon": "3dots" }}];
selectselectbooleanWhether selecting rows is enabled.
translatetranslatebooleanWhether to translate cells
wrapwrapbooleanfalseIf table should fit in it's area or should have a scrollbar
zebrazebrabooleanWhether or not the row table has a striped pattern on the rows

Events

EventDescription
column-change{ actionType: String }
reset-column
row-action{ rowIndex: Number, actionName: String }
row-selected{ selected: Row }
sort-table{ column: Number, direction: 'asc'\|'desc' }
table-action{ columnIndex: Number, rowIndex: Number, index: Number }
table-row-click

CSS Custom Properties

PropertyDescription
--fc-table-backgrounddefault: white
--fc-table-cell-paddingdefault: 15px 25px
--fc-table-header-cell-paddingdefault: 10px 25px
--fc-table-min-col-widthdefault: 100px
--fc-table-paddingdefault: 0
--fc-table-zebra-colordefault: #f8f9fa
4.0.0

9 months ago

5.0.2

8 months ago

5.0.1

9 months ago

5.0.0

9 months ago

5.1.3

7 months ago

5.1.2

7 months ago

5.1.1

7 months ago

5.1.0

8 months ago

3.9.1

11 months ago

3.9.0

11 months ago

3.10.1

11 months ago

3.10.0

11 months ago

3.10.2

11 months ago

3.8.4

12 months ago

3.8.3

12 months ago

3.8.2

12 months ago

3.8.5

11 months ago

3.8.0

1 year ago

3.8.1

12 months ago

3.7.2

1 year ago

3.7.1

1 year ago

3.7.0

1 year ago

3.6.0

1 year ago

3.5.1

1 year ago

3.5.0

1 year ago

3.4.0

1 year ago

3.4.1

1 year ago

3.3.0

1 year ago

3.2.3

2 years ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.46

2 years ago

3.0.45

2 years ago

3.0.44

2 years ago

3.0.43

2 years ago

3.0.41

2 years ago

3.0.42

2 years ago

3.0.40

2 years ago

3.0.39

2 years ago

3.0.34

2 years ago

3.0.35

2 years ago

3.0.33

3 years ago

3.0.38

2 years ago

3.0.36

2 years ago

3.0.37

2 years ago

3.0.23

3 years ago

3.0.24

3 years ago

3.0.21

3 years ago

3.0.22

3 years ago

3.0.27

3 years ago

3.0.28

3 years ago

3.0.25

3 years ago

3.0.26

3 years ago

3.0.20

3 years ago

3.0.18

3 years ago

3.0.19

3 years ago

3.0.32

3 years ago

3.0.30

3 years ago

3.0.31

3 years ago

3.0.29

3 years ago

3.0.16

3 years ago

3.0.17

3 years ago

3.0.14

3 years ago

3.0.15

3 years ago

3.0.12

3 years ago

3.0.13

3 years ago

3.0.11

3 years ago

3.0.4

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.9

3 years ago

3.0.10

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.35.8

3 years ago

2.35.5

3 years ago

2.35.4

3 years ago

2.35.7

3 years ago

2.35.6

3 years ago

2.35.1

3 years ago

2.35.3

3 years ago

2.35.2

3 years ago

2.35.0

3 years ago

2.34.12

3 years ago

2.34.13

3 years ago

2.34.11

3 years ago

2.34.14

3 years ago

2.34.0

3 years ago

2.34.9

3 years ago

2.34.6

3 years ago

2.34.5

3 years ago

2.34.8

3 years ago

2.34.7

3 years ago

2.34.2

3 years ago

2.34.1

3 years ago

2.34.4

3 years ago

2.34.3

3 years ago

2.34.10

3 years ago

2.33.30

3 years ago

2.33.26

4 years ago

2.33.27

4 years ago

2.33.25

4 years ago

2.33.22

4 years ago

2.33.23

4 years ago

2.33.24

4 years ago

2.33.15

4 years ago

2.33.16

4 years ago

2.33.14

4 years ago

2.33.19

4 years ago

2.33.17

4 years ago

2.33.18

4 years ago

2.33.20

4 years ago

2.33.21

4 years ago

2.33.13

4 years ago

2.33.11

4 years ago

2.33.12

4 years ago

2.33.10

4 years ago

2.33.7

4 years ago

2.33.9

4 years ago

2.33.8

4 years ago

2.33.6

4 years ago

2.33.5

4 years ago

2.33.3

4 years ago

2.33.4

4 years ago

2.33.2

4 years ago

2.33.1

4 years ago

2.33.0

4 years ago

2.32.13

4 years ago

2.32.12

4 years ago

2.32.11

4 years ago

2.32.10

4 years ago

2.32.8

4 years ago

2.32.7

4 years ago

2.32.9

4 years ago

2.32.6

4 years ago

2.32.5

4 years ago

2.32.4

4 years ago

2.32.3

4 years ago

2.32.2

4 years ago

2.32.1

4 years ago

2.32.0

4 years ago

2.31.5

4 years ago

2.31.3

4 years ago

2.31.2

4 years ago

2.31.4

4 years ago

2.31.1

5 years ago

2.30.4

5 years ago

2.31.0

5 years ago

2.30.2

5 years ago

2.30.3

5 years ago

2.30.1

5 years ago

2.30.0

5 years ago

2.29.7

5 years ago

2.29.6

5 years ago

2.29.5

5 years ago

2.29.4

5 years ago

2.29.3

5 years ago

2.29.2

5 years ago

2.29.0

5 years ago

2.29.1

5 years ago

2.27.0

5 years ago

2.26.1

5 years ago

2.26.0

5 years ago

2.28.0

5 years ago

2.25.1

5 years ago

2.25.0

5 years ago

2.24.12

5 years ago

2.24.11

5 years ago

2.24.10

5 years ago

2.24.9

5 years ago

2.24.8

5 years ago

2.24.7

5 years ago

2.24.6

5 years ago

2.24.5

5 years ago

2.24.4

5 years ago

2.24.3

5 years ago

2.24.1

5 years ago

2.24.2

5 years ago

2.24.0

5 years ago

2.23.1

5 years ago

2.22.0

5 years ago

2.21.4

5 years ago

2.23.0

5 years ago

2.21.3

5 years ago

2.21.2

5 years ago

2.21.1

5 years ago

2.21.0

5 years ago

2.20.0

5 years ago

2.19.2

5 years ago

2.19.0

5 years ago

2.19.1

5 years ago

2.18.0

5 years ago

2.17.0

5 years ago

2.16.2

5 years ago

2.16.1

5 years ago

2.15.1

5 years ago

2.16.0

5 years ago

2.15.0

5 years ago

2.14.0

5 years ago

2.13.1

5 years ago

2.13.0

5 years ago

2.12.0

5 years ago

2.11.0

5 years ago

2.10.3

5 years ago

2.10.2

5 years ago

2.10.1

5 years ago

2.10.0

5 years ago

2.9.1

5 years ago

2.9.0

5 years ago

2.8.0

5 years ago

2.7.4

5 years ago

2.7.3

5 years ago

2.7.2

5 years ago

2.7.1

5 years ago

2.6.1

5 years ago

2.7.0

5 years ago

2.6.0

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.7

5 years ago

2.3.6

5 years ago

2.3.5

5 years ago

2.3.4

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.17

5 years ago

2.2.15

5 years ago

2.2.16

5 years ago

2.2.14

5 years ago

2.2.13

5 years ago

2.2.12

5 years ago

2.2.11

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.8

5 years ago

2.2.7

5 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

6 years ago

2.1.41

6 years ago

2.1.40

6 years ago

2.1.39

6 years ago

2.1.38

6 years ago

2.1.37

6 years ago

2.1.36

6 years ago

2.1.35

6 years ago

2.1.34

6 years ago

2.1.33

6 years ago

2.1.32

6 years ago

2.1.31

6 years ago

2.1.30

6 years ago

2.1.29

6 years ago

2.1.28

6 years ago

2.1.27

6 years ago

2.1.26

6 years ago

2.1.25

6 years ago

2.1.24

6 years ago

2.1.23

6 years ago

2.1.21

6 years ago

2.1.22

6 years ago

2.1.20

6 years ago

2.1.19

6 years ago

2.1.18

6 years ago

2.1.17

6 years ago

2.1.16

6 years ago

2.1.15

6 years ago

2.1.14

6 years ago

2.1.13

6 years ago

2.1.12

6 years ago

2.1.11

6 years ago

2.1.10

6 years ago

2.1.8

6 years ago

2.1.9

6 years ago

2.1.7

6 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1-beta.336

6 years ago

1.0.1-beta.334

6 years ago

1.0.1-beta.333

6 years ago

1.0.1-beta.329

6 years ago

1.0.1-beta.328

6 years ago

1.0.1-beta.327

6 years ago