UNPKG

@liedekef/ftable

Version:

Modern, lightweight, jQuery-free CRUD table for dynamic AJAX-powered tables.

432 lines (431 loc) 12.9 kB
/* These file is a start point for who wants to create a fully custom * theme for fTable. ftable_theme_base.less (or css) file is needed * for functionality of fTable. This file does not add any color or shape * modifications. It just shows how to set icons. You can change them too. */ div.ftable-main-container { position: relative; } div.ftable-main-container div.ftable-title { position: relative; text-align: left; } div.ftable-main-container div.ftable-title div.ftable-toolbar { bottom: 0px; right: 0px; position: absolute; display: inline-block; margin-right: 5px; } div.ftable-main-container div.ftable-title div.ftable-toolbar .ftable-toolbar-item { position: relative; display: inline-block; margin: 0px 0px 0px 5px; cursor: pointer; font-size: 0.9em; padding: 2px; vertical-align: bottom; } div.ftable-main-container div.ftable-title div.ftable-toolbar .ftable-toolbar-item span.ftable-toolbar-item-icon { display: inline-block; margin: 2px; vertical-align: middle; width: 16px; height: 16px; } div.ftable-main-container div.ftable-title div.ftable-toolbar .ftable-toolbar-item span.ftable-toolbar-item-icon.ftable-toolbar-item-add-record { display: inline-flex; align-items: center; background-color: transparent; justify-content: center; width: 16px; height: 16px; } div.ftable-main-container div.ftable-title div.ftable-toolbar .ftable-toolbar-item span.ftable-toolbar-item-icon.ftable-toolbar-item-add-record::before { content: "➕"; font-size: 14px; } div.ftable-main-container div.ftable-title div.ftable-toolbar .ftable-toolbar-item span.ftable-toolbar-item-text { display: inline-block; margin: 2px; vertical-align: middle; } div.ftable-main-container table.ftable { width: 100%; } div.ftable-main-container table.ftable thead th { padding: 0px 3px 0px 6px; vertical-align: middle; text-align: left; } div.ftable-main-container table.ftable thead th.ftable-column-header { height: 1px; /* this is so the heigth of the div inside can be set to 100% */ } div.ftable-main-container table.ftable thead th.ftable-column-header div.ftable-column-header-container { position: relative; display: table; /* display table so the inside elements can be easily aligned vertically */ width: 100%; /* width=100% is redundant for regular div, but for display table it is needed */ height: 100% !important; /* height at 100% so the resize bar in it will have full height too */ } div.ftable-main-container table.ftable thead th.ftable-column-header div.ftable-column-header-container span.ftable-column-header-text { display: table-cell; vertical-align: middle; /* this works since we have display=table-cell */ padding-top: 4px; padding-bottom: 3px; } div.ftable-main-container table.ftable thead th.ftable-column-header div.ftable-column-header-container div.ftable-column-resize-handler { position: absolute; display: table-cell; vertical-align: middle; height: 100%; /* so the resize bar fills the whole height */ width: 8px; right: -8px; z-index: 2; cursor: col-resize; } div.ftable-main-container table.ftable thead th.ftable-command-column-header { text-align: center; width: 1%; } div.ftable-main-container table.ftable thead th.ftable-column-header-select { text-align: center; width: 1%; } div.ftable-main-container table.ftable thead th.ftable-column-header-select input { cursor: pointer; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable { cursor: pointer; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable .ftable-sortable-text { padding-right: 20px; /* Space for sort indicator */ } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable .ftable-column-header-container { position: relative; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable .ftable-column-header-container::before, div.ftable-main-container table.ftable thead th.ftable-column-header-sortable .ftable-column-header-container::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.1em; color: #999; opacity: 0.7; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable .ftable-column-header-container::before { content: '▲'; right: 7px; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable .ftable-column-header-container::after { content: '▼'; right: 0px; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable.ftable-column-header-sorted-asc .ftable-column-header-container::before { color: #222; opacity: 1; font-weight: bold; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable.ftable-column-header-sorted-asc .ftable-column-header-container::after { opacity: 0.7; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable.ftable-column-header-sorted-desc .ftable-column-header-container::after { color: #222; opacity: 1; font-weight: bold; } div.ftable-main-container table.ftable thead th.ftable-column-header-sortable.ftable-column-header-sorted-desc .ftable-column-header-container::before { opacity: 0.7; } div.ftable-main-container table.ftable tbody tr > td .ftable-command-button { margin: 5px; padding: 0px; cursor: pointer; border: none; display: inline; } div.ftable-main-container table.ftable tbody tr > td .ftable-command-button span { display: none; } div.ftable-main-container table.ftable tbody tr > td.ftable-command-column { text-align: center; vertical-align: middle; } div.ftable-main-container table.ftable tbody tr > td.ftable-selecting-column { text-align: center; vertical-align: middle; } div.ftable-main-container table.ftable tbody tr > td.ftable-selecting-column input { cursor: pointer; } div.ftable-main-container table.ftable tbody tr > td .ftable-edit-command-button { width: 16px; height: 16px; background-color: transparent; } div.ftable-main-container table.ftable tbody tr > td .ftable-edit-command-button::before { content: "📝"; font-size: 14px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; } div.ftable-main-container table.ftable tbody tr > td .ftable-clone-command-button { width: 16px; height: 16px; background-color: transparent; } div.ftable-main-container table.ftable tbody tr > td .ftable-clone-command-button::before { content: "📋"; font-size: 14px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; } div.ftable-main-container table.ftable tbody tr > td .ftable-delete-command-button { width: 16px; height: 16px; background-color: transparent; } div.ftable-main-container table.ftable tbody tr > td .ftable-delete-command-button::before { content: "🗑️ "; font-size: 14px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; } div.ftable-main-container table.ftable tbody tr.ftable-no-data-row { text-align: center; } div.ftable-main-container > div.ftable-bottom-panel { position: relative; min-height: 24px; text-align: left; } div.ftable-main-container > div.ftable-bottom-panel div.ftable-right-area { right: 0px; top: 0px; bottom: 0px; position: absolute; } div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list { display: inline-block; } div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-space, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-first, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-last, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-previous, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-next, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-active { padding: 2px 5px; display: inline-block; cursor: pointer; } div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-space, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-active, div.ftable-main-container > div.ftable-bottom-panel .ftable-page-list .ftable-page-number-disabled { cursor: default; } div.ftable-main-container > div.ftable-bottom-panel span.ftable-page-size-change { margin-left: 5px; } div.ftable-main-container > div.ftable-bottom-panel span.ftable-goto-page { margin-left: 5px; } div.ftable-main-container > div.ftable-bottom-panel span.ftable-goto-page input[type=text] { width: 22px; } div.ftable-main-container > div.ftable-bottom-panel span.ftable-page-info { vertical-align: middle; } div.ftable-main-container div.ftable-column-resize-bar { opacity: 0.5; filter: alpha(opacity=50); position: absolute; width: 1px; background-color: #000; } form.ftable-dialog-form div.ftable-input-field-container { padding: 2px 0px 3px 0px; border-bottom: 1px solid #ddd; } form.ftable-dialog-form div.ftable-input-field-container:last-child { border: none; } form.ftable-dialog-form div.ftable-input-label { padding: 2px 3px; font-size: 1.1em; color: #666; } form.ftable-dialog-form div.ftable-input { padding: 2px; } form.ftable-dialog-form div.ftable-date-input { /* No additional style */ } form.ftable-dialog-form div.ftable-text-input { /* No additional style */ } form.ftable-dialog-form span.ftable-option-text-clickable { position: relative; top: -2px; } form.ftable-dialog-form div.ftable-textarea-input textarea { width: 300px; min-height: 60px; } form.ftable-dialog-form div.ftable-checkbox-input span, form.ftable-dialog-form div.ftable-radio-input span { padding-left: 4px; } form.ftable-dialog-form div.ftable-radio-input input, form.ftable-dialog-form div.ftable-checkbox-input input, form.ftable-dialog-form span.ftable-option-text-clickable { cursor: pointer; } .ftable-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); z-index: 1000; display: none; } .ftable-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: white; padding: 20px; border-radius: 5px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); z-index: 1001; max-width: 90%; max-height: 90vh; overflow: auto; } .ftable-modal-header { margin-bottom: 15px; margin-top: 0px; padding-bottom: 10px; border-bottom: 1px solid #eee; } .ftable-modal-footer { margin-top: 15px; padding-top: 10px; border-top: 1px solid #eee; text-align: right; } .ftable-modal-close { position: absolute; top: 10px; right: 10px; cursor: pointer; font-size: 28px; font-weight: bold; color: #aaa; } .ftable-busy-modal { padding: 0px; } .ftable-dialog-button { opacity: 0.8; border: 1px solid #ccc; padding: 5px; margin: 5px; } .ftable-dialog-button:hover { background-color: #dedede; } div.ftable-busy-message { cursor: wait; margin: 0px; } div.ftable-contextmenu-overlay { position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 100; } .ftable-table-div { display: block; overflow-x: auto; } .ftable-table-div > table { overflow: hidden; } .ftable-toolbarsearch { width: 90%; min-width: fit-content; } th.ftable-toolbarsearch-reset { text-align: center !important; } div.ftable-column-selection-container { position: absolute; border: 1px solid #C8C8C8; background: #fff; color: #000; z-index: 101; padding: 5px; } div.ftable-column-selection-container ul.ftable-column-select-list { margin: 0px; padding: 0px; list-style: none; } div.ftable-column-selection-container ul.ftable-column-select-list li { margin: 0px; padding: 2px 0px; } div.ftable-column-selection-container ul.ftable-column-select-list li label span { position: relative; top: -1px; margin-left: 4px; } div.ftable-column-selection-container ul.ftable-column-select-list li input[type="checkbox"] { cursor: pointer; } .ftable-yesno-check-wrapper { display: flex; align-items: center; } .ftable-yesno-check-text, .ftable-yesno-check-fixedlabel { margin-left: 4px; } .ftable-yesno-check-text:before { content: attr(data-no); } .ftable-yesno-check-input:checked ~ .ftable-yesno-check-text:before { content: attr(data-yes); } div.ftable-main-container div.ftable-title div.ftable-title-text { font-size: 16px; font-weight: bold; } div.ftable-busy-message { color: #000; background-color: #ddd; font-size: 1.25em; }