aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/CollectionSchemaView.scss29
-rw-r--r--src/client/views/collections/CollectionSchemaView.tsx3
-rw-r--r--src/client/views/collections/CollectionStackingView.scss1
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx2
-rw-r--r--src/client/views/collections/CollectionStackingViewFieldColumn.tsx2
-rw-r--r--src/client/views/collections/CollectionView.tsx21
-rw-r--r--src/client/views/collections/CollectionViewChromes.scss7
7 files changed, 41 insertions, 24 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 053d6452c..b1e98b162 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -6,7 +6,8 @@
border-style: solid;
border-radius: $border-radius;
box-sizing: border-box;
- // position: absolute;
+ position: absolute;
+ top: 0;
width: 100%;
transition: height .5s;
height: 100%;
@@ -14,7 +15,6 @@
// overflow-x: scroll;
// border: none;
overflow: hidden;
- transition: top 0.5s;
// .collectionSchemaView-cellContents {
// height: $MAX_ROW_HEIGHT;
@@ -79,7 +79,7 @@
overflow-x: auto;
height: 100%;
display: -webkit-inline-box;
- direction: ltr;
+ direction: ltr;
}
.rt-thead {
@@ -123,7 +123,7 @@
font-size: 13px;
text-align: center;
background-color: $light-color-secondary;
-
+
&:last-child {
overflow: visible;
}
@@ -148,7 +148,7 @@
// &:nth-child(even) {
// background-color: $light-color;
// }
-
+
// &:nth-child(odd) {
// background-color: $light-color-secondary;
// }
@@ -176,7 +176,7 @@
padding: 0;
font-size: 13px;
text-align: center;
-
+
// white-space: normal;
.imageBox-cont {
@@ -213,18 +213,19 @@
background: $light-color;
}
-.collectionSchema-col{
+.collectionSchema-col {
height: 100%;
.collectionSchema-col-wrapper {
&.col-before {
border-left: 2px solid red;
}
+
&.col-after {
border-right: 2px solid red;
}
}
-}
+}
.collectionSchemaView-header {
@@ -291,7 +292,7 @@ button.add-column {
background-color: $light-color;
border: 1px solid $light-color-secondary;
padding: 2px 3px;
-
+
&:not(:last-child) {
border-top: 0;
}
@@ -318,7 +319,7 @@ button.add-column {
input[type="radio"] {
display: none;
}
-
+
.columnMenu-colorPicker {
width: 20px;
height: 20px;
@@ -332,7 +333,7 @@ button.add-column {
background-color: white;
&.row-focused .rt-tr {
- background-color: rgb(255, 246, 246);//$light-color-secondary;
+ background-color: rgb(255, 246, 246); //$light-color-secondary;
}
&.row-wrapped {
@@ -377,9 +378,11 @@ button.add-column {
&.row-above {
border-top: 1px solid red;
}
+
&.row-below {
border-bottom: 1px solid red;
}
+
&.row-inside {
border: 1px solid red;
}
@@ -480,7 +483,9 @@ button.add-column {
.rt-table {
overflow-x: hidden; // todo; this shouldnt be like this :((
overflow-y: visible;
- } // TODO fix
+ }
+
+ // TODO fix
.row-dragger {
background-color: rgb(252, 252, 252);
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 53dd9523b..996118c00 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -72,7 +72,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
@observable private _node: HTMLDivElement | null = null;
@observable private _focusedTable: Doc = this.props.Document;
- @computed get chromeCollapsed() { return this.props.chromeCollapsed; }
@computed get previewWidth() { return () => NumCast(this.props.Document.schemaPreviewWidth); }
@computed get previewHeight() { return () => this.props.PanelHeight() - 2 * this.borderWidth; }
@computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
@@ -237,7 +236,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
// if (SelectionManager.SelectedDocuments().length > 0) console.log(StrCast(SelectionManager.SelectedDocuments()[0].Document.title));
// if (DocumentManager.Instance.getDocumentView(this.props.Document)) console.log(StrCast(this.props.Document.title), SelectionManager.IsSelected(DocumentManager.Instance.getDocumentView(this.props.Document)!))
return (
- <div className="collectionSchemaView-container" style={{ height: this.chromeCollapsed ? "100%" : "calc(100% - 70px" }}
+ <div className="collectionSchemaView-container"
onPointerDown={this.onPointerDown} onWheel={this.onWheel} onDrop={(e: React.DragEvent) => this.onDrop(e, {})} ref={this.createTarget}>
{this.schemaTable}
{this.dividerDragger}
diff --git a/src/client/views/collections/CollectionStackingView.scss b/src/client/views/collections/CollectionStackingView.scss
index 9dbe4ccb8..004b57eff 100644
--- a/src/client/views/collections/CollectionStackingView.scss
+++ b/src/client/views/collections/CollectionStackingView.scss
@@ -5,6 +5,7 @@
width: 100%;
position: absolute;
display: flex;
+ top: 0;
overflow-y: auto;
flex-wrap: wrap;
transition: top .5s;
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index f647da8f0..287c8a461 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -278,7 +278,7 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
};
// let uniqueHeadings = headings.map((i, idx) => headings.indexOf(i) === idx);
return (
- <div className="collectionStackingView" style={{ top: this.chromeCollapsed ? 0 : 100 }}
+ <div className="collectionStackingView"
ref={this.createRef} onDrop={this.onDrop.bind(this)} onWheel={(e: React.WheelEvent) => e.stopPropagation()} >
{/* {sectionFilter as boolean ? [
["width > height", this.filteredChildren.filter(f => f[WidthSym]() >= 1 + f[HeightSym]())],
diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
index 387e189e7..c45b0c60a 100644
--- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
+++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
@@ -266,7 +266,7 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
{headingView}
<div key={`${heading}-stack`} className={`collectionStackingView-masonry${singleColumn ? "Single" : "Grid"}`}
style={{
- padding: singleColumn ? `${style.yMargin}px ${0}px ${style.yMargin}px ${0}px` : `${style.yMargin}px ${0}px`,
+ padding: singleColumn ? `${style.yMargin}px ${5}px ${style.yMargin}px ${5}px` : `${style.yMargin}px ${0}px`,
margin: "auto",
width: "max-content", //singleColumn ? undefined : `${cols * (style.columnWidth + style.gridGap) + 2 * style.xMargin - style.gridGap}px`,
height: 'max-content',
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 34363b11a..55e014c66 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -18,7 +18,7 @@ import { CollectionTreeView } from "./CollectionTreeView";
import { StrCast, PromiseValue } from '../../../new_fields/Types';
import { DocumentType } from '../../documents/Documents';
import { CollectionStackingViewChrome, CollectionViewBaseChrome } from './CollectionViewChromes';
-import { observable, action, runInAction } from 'mobx';
+import { observable, action, runInAction, IReactionDisposer, reaction } from 'mobx';
import { faEye } from '@fortawesome/free-regular-svg-icons';
export const COLLECTION_BORDER_WIDTH = 2;
@@ -37,14 +37,23 @@ library.add(faImage, faEye);
export class CollectionView extends React.Component<FieldViewProps> {
@observable private _collapsed = false;
+ private _reactionDisposer: IReactionDisposer | undefined;
+
public static LayoutString(fieldStr: string = "data", fieldExt: string = "") { return FieldView.LayoutString(CollectionView, fieldStr, fieldExt); }
componentDidMount = () => {
- // chrome status is one of disabled, collapsed, or visible. this determines initial state from document
- let chromeStatus = this.props.Document.chromeStatus;
- if (chromeStatus && (chromeStatus === "disabled" || chromeStatus === "collapsed")) {
- runInAction(() => this._collapsed = true);
- }
+ this._reactionDisposer = reaction(() => StrCast(this.props.Document.chromeStatus),
+ () => {
+ // chrome status is one of disabled, collapsed, or visible. this determines initial state from document
+ let chromeStatus = this.props.Document.chromeStatus;
+ if (chromeStatus && (chromeStatus === "disabled" || chromeStatus === "collapsed")) {
+ runInAction(() => this._collapsed = true);
+ }
+ });
+ }
+
+ componentWillUnmount = () => {
+ this._reactionDisposer && this._reactionDisposer();
}
private SubViewHelper = (type: CollectionViewType, renderProps: CollectionRenderProps) => {
diff --git a/src/client/views/collections/CollectionViewChromes.scss b/src/client/views/collections/CollectionViewChromes.scss
index f9f3ce473..989315194 100644
--- a/src/client/views/collections/CollectionViewChromes.scss
+++ b/src/client/views/collections/CollectionViewChromes.scss
@@ -3,16 +3,19 @@
.collectionViewChrome-cont {
position: relative;
+ opacity: 0.9;
z-index: 9001;
+ transition: top .5s;
+ background: lightgrey;
transition: margin-top .5s;
- background: lightslategray;
+ background: lightgray;
padding: 10px;
.collectionViewChrome {
display: grid;
grid-template-columns: 1fr auto;
padding-bottom: 10px;
- border-bottom: .5px solid lightgrey;
+ border-bottom: .5px solid rgb(180, 180, 180);
.collectionViewBaseChrome {
display: flex;