Work in progress on migration to Bootstrap 4 and CoreUI admin theme

This commit is contained in:
Tomas Bures 2018-12-27 14:42:21 +01:00
parent 366bd09f2a
commit 3425e2c16a
85 changed files with 2093 additions and 10564 deletions

View file

@ -12,7 +12,7 @@ import jQuery
import '../../vendor/jquery/jquery-ui-1.12.1.min.js';
import '../../vendor/fancytree/jquery.fancytree-all.min.js';
import '../../vendor/fancytree/skin-bootstrap/ui.fancytree.min.css';
import './tree.css';
import './tree.scss';
import axios
from './axios';
@ -91,7 +91,8 @@ class TreeTable extends Component {
withHeader: PropTypes.bool,
withDescription: PropTypes.bool,
noTable: PropTypes.bool,
withIcons: PropTypes.bool
withIcons: PropTypes.bool,
className: PropTypes.string
}
componentWillReceiveProps(nextProps) {
@ -106,7 +107,7 @@ class TreeTable extends Component {
}
shouldComponentUpdate(nextProps, nextState) {
return this.props.selection !== nextProps.selection || this.state.treeData != nextState.treeData;
return this.props.selection !== nextProps.selection || this.state.treeData != nextState.treeData || this.props.className !== nextProps.className;
}
// XSS protection
@ -183,17 +184,16 @@ class TreeTable extends Component {
extensions: ['glyph'],
glyph: {
map: {
expanderClosed: 'glyphicon glyphicon-menu-right',
expanderLazy: 'glyphicon glyphicon-menu-right', // glyphicon-plus-sign
expanderOpen: 'glyphicon glyphicon-menu-down', // glyphicon-collapse-down
checkbox: 'glyphicon glyphicon-unchecked',
checkboxSelected: 'glyphicon glyphicon-check',
checkboxUnknown: 'glyphicon glyphicon-share',
expanderClosed: 'fas fa-angle-right',
expanderLazy: 'fas fa-angle-right', // glyphicon-plus-sign
expanderOpen: 'fas fa-angle-down', // glyphicon-collapse-down
checkbox: 'fas fa-square',
checkboxSelected: 'fas fa-check-square',
folder: 'glyphicon glyphicon-folder-close',
folderOpen: 'glyphicon glyphicon-folder-open',
doc: 'glyphicon glyphicon-file',
docOpen: 'glyphicon glyphicon-file'
folder: 'fas fa-folder',
folderOpen: 'fas fa-folder-open',
doc: 'fas fa-file',
docOpen: 'fas fa-file'
}
},
selectMode: (this.selectMode === TreeSelectMode.MULTI ? 2 : 1),
@ -220,9 +220,14 @@ class TreeTable extends Component {
this.updateSelection();
}
componentDidUpdate() {
this.tree.reload(this.sanitizeTreeData(this.state.treeData));
this.updateSelection();
componentDidUpdate(prevProps, prevState) {
if (this.props.selection !== prevProps.selection || this.state.treeData != prevState.treeData) {
if (this.state.treeData != prevState.treeData) {
this.tree.reload(this.sanitizeTreeData(this.state.treeData));
}
this.updateSelection();
}
}
updateSelection() {
@ -303,7 +308,7 @@ class TreeTable extends Component {
const withHeader = props.withHeader;
const withDescription = props.withDescription;
let containerClass = 'mt-treetable-container';
let containerClass = 'mt-treetable-container ' + (this.props.className || '');
if (this.selectMode === TreeSelectMode.NONE) {
containerClass += ' mt-treetable-inactivable';
} else {