3.1.2 • Published 5 years ago

@igoodbad/responsive-table v3.1.2

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
5 years ago

\<responsive-table>

Table full responsive in any devices
Published on webcomponents.org Platform Build Status

Demo

<responsive-table></responsive-table>

Properties

Public properties

NameTypeDescriptionDefault
breakResizeNumberDeclare minimum value in pixels to change view between table and list, this property only accept number.601
columnsArrayContains the array of value, the values are display into body of table.Empty
editTableBooleanBoolean value to indicate if the component contains a edit button.false
headersArrayContains the array of headers, shows in the first row in the table.Empty
searchBooleanBoolean value to indicate if the component contains search input.false
searchPlaceholderStringWord that show in placeholder of input search."Ingresa la palabra a buscar"
styleTableStringSelector of table style, by default "stripped" style is selected."stripped"
textCancelBtnStringWord that show in button cancel."Cancelar"
textEditBtnStringWord that show in button edit."Editar"
textNoSelectedRowStringText displayed when user don't select row and click/tap in edit button."Debe seleccionar una fila para poder editarla"
textSaveBtnStringWord that show in button save."Guardar"

Private properties

NameTypeDescriptionDefault
_bodyTableElementObjectContain the body node of table.HTMLElement
_columnValuesArrayContains processed data array columns.Calculated value
_headerTableElementObjectContain the header node of table.HTMLElement
_listElementObjectContain the list node.HTMLElement
_modalElementObjectContain the node of div formated at modal.HTMLElement
_rowSelectedElementArrayContain the full data of row selected, the array only contains a one Object element.Empty
_valueSearchStringContain the word to filter the rows shown into table and list.''

Coming soon properties

NameTypeDescriptionDefault
_numberPageNumberPage indicator, modified by preview/next.1
_paginationBooleanBoolean value to indicate if the component contains pagination.false
_rowsOptionArrayValues to shown in select max rows by page.10, 20, 30
_textPaginatorStringText to display in page indicator."Página"
_textRowsSelectorStringText to display in selector of max rows by page."Filas por página"

Events

EventTypeDescriptionReturn
edited-rowCustomEventReturn data of row editedObject
info-rowCustomEventReturn original object of select row in table or list, when user don´t select any row, return a textObject / String

Styling

Custom propertyDescriptionTypeDefault
--table-background-colorBackground color of tableVariable#fff
--stripped-table-header-customStyling of header tableMixinbackground-color:#a6ccff;color:#333;border-bottom: 0.15em solid #f3f3f3;
--striped-table-body-customStyling of body tableMixinbackground-color: #ededed;
--lineal-table-header-customStyling of header tableMixinborder-bottom: 0.15em solid #b7b7b7;
--lineal-table-body-customStyling of body tableMixinborder-bottom: 0.08em solid #b7b7b7;
--all-lines-table-header-customStyling of header table, this style affected all cellsMixinborder: 0.1em solid black;
--all-lines-table-body-customStyling of body table, this style affected all cellsMixinborder: 0.1em solid black;
--table-row-selectedBackground color of selected row, also when user mouse over any rowVariable#a6ccff
--table-header-sort-indicator-upIndicator of sort ascendingVariable" ▲"
--table-header-sort-indicator-downIndicator of sort ascendingVariable" ▼"
--list-style-customStyling base of listMixinlist-style-type: none; margin: 0px 0px; padding: 0; border: 0.07em solid #bababa;
--list-li-customStyling li element of listMixinborder-top: 0.07em solid black; background-color: #fff; padding: 3px 6px; cursor: pointer;
--list-li-hover-background-colorBackground color to highlight element when mouse overVariable#a6ccff
--detail-open-customStyling to element when it's openedMixinbackground-color: #cfeaf2;
--detail-open-summary-customStyling to element when details it's openedMixinanimation: sweep .5s ease-in-out;
--input-search-customStyling of input searchMixindisplay: relative; width: 80%; border: none; border-bottom: 2px solid #bababa; margin-bottom: 5px; margin-top: 5px; padding: 5px 10px; font-size: 1rem; font-family: verdana;
--modal-background-colorBackground color of the modal windowVariablergba(62, 62, 62, 0.7);
--modal-window-customStyling of modal windowMixinmin-width: 200px; max-width: 450px; position: relative; margin: 10% auto; padding: 5px 20px 13px 20px; border-radius: 10px; background: #fff; background: -moz-linear-gradient(rgb(175, 202, 218), rgb(126, 160, 192)); background: -webkit-linear-gradient(rgb(175, 202, 218), rgb(126, 160, 192)); background: -o-linear-gradient(rgb(175, 202, 218), rgb(126, 160, 192));
--modal-input-customStyle of the element within the modalMixin-
--footer-btn-editStyling for edit button, button are visible when editTable is trueMixinbackground-color:#a6ccff; padding: 8px 30px; border: 0.06em groove; border-radius: 2rem; font-family: verdana; font-size: 1rem;
--modal-btn-cancelStyling to cancel button into modalMixinborder: 0.05em solid #757575; padding: 8px 15px; background-color: #ededed; color: #000; border-radius: 2em; font-family: verdana; font-size: 14px; font-weight: bolder;
--modal-btn-saveStyling to save button into modalMixinborder: 0.05em solid #757575; padding: 8px 15px; background-color: #51c839; color: #232323; border-radius: 2em; font-family: verdana; font-size: 14px; font-weight: bolder;

Slots

Id slotDescription
slot-over-tableThis element is located over the table
slot-footer-tableThis element is located into footer of table
slot-bottom-tableThis element is located in bottom of table
slot-top-content-modalThis element is located in top of content modal
slot-bottom-content-modalThis element is located in bottom of content modal
slot-footer-modalThis element is located in footer of content modal

License

Apache License 2004