Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass some layout props to panel's content container #415

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client-app/src/admin/tests/Select/SelectTestPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const SelectTestPanel = hoistCmp({
return panel({
title: 'Select tests',
className: 'select-test-panel xh-tiled-bg',
padding: 10,
item: hbox(
vbox(
example({
Expand Down
1 change: 0 additions & 1 deletion client-app/src/admin/tests/Select/SelectTestPanel.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.select-test-panel {
.xh-vbox {
margin: var(--xh-pad-px);
padding: var(--xh-pad-px);
border: var(--xh-border-solid);
background: var(--xh-bg);
}
Expand Down
15 changes: 6 additions & 9 deletions client-app/src/admin/tests/fetch/FetchApiTestPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,10 @@ export const FetchApiTestPanel = hoistCmp({
panel({
title: 'Response',
className: 'xh-border-left',
item: vframe({
item: jsonInput({
flex: 1,
width: '100%',
value: model.response
}),
padding: 10
item: jsonInput({
flex: 1,
width: '100%',
value: model.response
})
}),
mask({
Expand All @@ -76,7 +73,7 @@ export const FetchApiTestPanel = hoistCmp({

const individualBtns = hoistCmp.factory(
({model}) => vbox({
style: {overflowY: 'scroll'},
style: {overflowY: 'auto'},
items: model.codes.map(it => hframe({
className: 'http-status-code-frame',
overflow: 'unset',
Expand All @@ -99,7 +96,7 @@ const individualBtns = hoistCmp.factory(

const codeGroupBtns = hoistCmp.factory(
({model}) => vframe({
style: {overflowY: 'scroll'},
style: {overflowY: 'auto'},
items: model.codes
.filter(it => !(it.code % 100))
.map(it => button({
Expand Down
5 changes: 4 additions & 1 deletion client-app/src/admin/tests/fetch/FetchApiTestStyles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
}
}

.http-status-code-group-button,
.http-status-code-button {
justify-content: left;
margin-right: 1px;
Expand All @@ -22,3 +21,7 @@
white-space: nowrap;
}
}

.http-status-code-group-button {
justify-content: left;
}
1 change: 1 addition & 0 deletions client-app/src/admin/tests/localDate/LocalDateTestPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const LocalDateTestPanel = hoistCmp({

return panel({
className: 'local-date-test-panel xh-tiled-bg',
overflowY: 'auto',
items
});
}
Expand Down
4 changes: 0 additions & 4 deletions client-app/src/admin/tests/localDate/LocalDateTestPanel.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.local-date-test-panel {
& > .xh-vframe {
overflow-y: auto !important;
}

p {
margin: var(--xh-pad-px);
font-size: var(--xh-font-size-large-px);
Expand Down
59 changes: 20 additions & 39 deletions client-app/src/admin/tests/panels/PanelResizingTestPanel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {creates, hoistCmp, XH} from '@xh/hoist/core';
import {Icon} from '@xh/hoist/icon';
import {box, filler, hbox} from '@xh/hoist/cmp/layout';
import {filler, hbox} from '@xh/hoist/cmp/layout';
import {toolbar} from '@xh/hoist/desktop/cmp/toolbar';
import {button} from '@xh/hoist/desktop/cmp/button';
import {panel} from '@xh/hoist/desktop/cmp/panel';
Expand Down Expand Up @@ -30,10 +30,8 @@ export const PanelResizingTestPanel = hoistCmp({
model: model.topPanel1Model,
key: model.topPanel1Model.xhId,
compactHeader: true,
item: box({
padding: 10,
item: `Collapsible Top (minSize: ${model.topPanel1Model.minSize}px)`
}),
padding: 10,
item: `Collapsible Top (minSize: ${model.topPanel1Model.minSize}px)`,
headerItems: [
relativeTimestamp({
options: { prefix: 'Rendered' },
Expand All @@ -53,10 +51,8 @@ export const PanelResizingTestPanel = hoistCmp({
model: model.topPanel2Model,
key: model.topPanel2Model.xhId,
compactHeader: true,
item: box({
padding: 10,
item: 'Collapsible Top'
})
padding: 10,
item: 'Collapsible Top'
}),
hbox({
flex: 1,
Expand All @@ -68,29 +64,22 @@ export const PanelResizingTestPanel = hoistCmp({
model: model.leftPanel1Model,
key: model.leftPanel1Model.xhId,
compactHeader: true,
item: box({
className: 'xh-pad',
item: 'Collapsible Left'
})
padding: 10,
item: 'Collapsible Left'
}),
panel({
title: 'Left Panel 2',
icon: Icon.arrowToLeft(),
model: model.leftPanel2Model,
key: model.leftPanel2Model.xhId,
compactHeader: true,
item: box({
className: 'xh-pad',
item: `Collapsible Left (minSize: ${model.leftPanel2Model.minSize}px)`
})
padding: 10,
item: `Collapsible Left (minSize: ${model.leftPanel2Model.minSize}px)`
}),
panel({
item: box({
items: model.explanation,
padding: '0 6 6 6',
display: 'block',
overflowY: 'auto'
}),
items: model.explanation,
padding: '0 10 10',
overflowY: 'auto',
tbar: [
filler(),
button({
Expand All @@ -111,21 +100,17 @@ export const PanelResizingTestPanel = hoistCmp({
model: model.rightPanel2Model,
key: model.rightPanel2Model.xhId,
compactHeader: true,
item: box({
className: 'xh-pad',
item: 'Collapsible Right'
})
padding: 10,
item: 'Collapsible Right'
}),
panel({
title: 'Right Panel 1',
icon: Icon.disabled(),
model: model.rightPanel1Model,
key: model.rightPanel1Model.xhId,
compactHeader: true,
item: box({
className: 'xh-pad',
item: `Collapsible Right (minSize: ${model.rightPanel1Model.minSize}px)`
})
padding: 10,
item: `Collapsible Right (minSize: ${model.rightPanel1Model.minSize}px)`
})
]
}),
Expand All @@ -135,21 +120,17 @@ export const PanelResizingTestPanel = hoistCmp({
model: model.bottomPanel2Model,
key: model.bottomPanel2Model.xhId,
compactHeader: true,
item: box({
padding: 10,
item: `Collapsible Bottom (minSize: ${model.bottomPanel2Model.minSize}px)`
})
padding: 10,
item: `Collapsible Bottom (minSize: ${model.bottomPanel2Model.minSize}px)`
}),
panel({
title: 'Bottom Panel 1',
icon: Icon.arrowToBottom(),
model: model.bottomPanel1Model,
key: model.bottomPanel1Model.xhId,
compactHeader: true,
item: box({
padding: 10,
item: 'Collapsible Bottom'
})
padding: 10,
item: 'Collapsible Bottom'
})
]
});
Expand Down
11 changes: 4 additions & 7 deletions client-app/src/admin/wip/WipTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*
* Copyright © 2020 Extremely Heavy Industries Inc.
*/
import {box} from '@xh/hoist/cmp/layout';
import {panel} from '@xh/hoist/desktop/cmp/panel';
import {hoistCmp} from '@xh/hoist/core';
import {tabContainer} from '@xh/hoist/cmp/tab';
Expand All @@ -24,11 +23,9 @@ export const WipTab = hoistCmp({
});
}

return panel(
box({
margin: 20,
item: 'No WIP examples at the moment...'
})
);
return panel({
padding: 20,
item: 'No WIP examples at the moment...'
});
}
});
7 changes: 2 additions & 5 deletions client-app/src/desktop/tabs/charts/LineChartPanel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {chart} from '@xh/hoist/cmp/chart';
import {box, vframe} from '@xh/hoist/cmp/layout';
import {box} from '@xh/hoist/cmp/layout';
import {creates, hoistCmp} from '@xh/hoist/core';
import {select} from '@xh/hoist/desktop/cmp/input';
import {panel} from '@xh/hoist/desktop/cmp/panel';
Expand All @@ -18,10 +18,7 @@ export const lineChartPanel = hoistCmp.factory({
icon: Icon.chartLine(),
width: 800,
height: 600,
item: vframe({
className: 'toolbox-example-container',
item: chart()
}),
item: chart(),
tbar: [
box('Symbol: '),
select({
Expand Down
9 changes: 3 additions & 6 deletions client-app/src/desktop/tabs/charts/OHLCChartPanel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {creates, hoistCmp, XH} from '@xh/hoist/core';
import {Icon} from '@xh/hoist/icon';
import {filler, span, vframe} from '@xh/hoist/cmp/layout';
import {filler, span} from '@xh/hoist/cmp/layout';
import {panel} from '@xh/hoist/desktop/cmp/panel';
import {numberInput, select} from '@xh/hoist/desktop/cmp/input';
import {chart} from '@xh/hoist/cmp/chart';
Expand Down Expand Up @@ -29,11 +29,8 @@ export const ohlcChartPanel = hoistCmp.factory({
});

const example = hoistCmp.factory(
({model}) => vframe({
className: 'toolbox-example-container',
item: chart({
aspectRatio: model.aspectRatio
})
({model}) => chart({
aspectRatio: model.aspectRatio
})
);

Expand Down
9 changes: 4 additions & 5 deletions client-app/src/desktop/tabs/examples/ExamplesTab.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {hoistCmp} from '@xh/hoist/core';
import {a, code, hbox, p, vframe} from '@xh/hoist/cmp/layout';
import {a, code, hbox, p} from '@xh/hoist/cmp/layout';
import {button} from '@xh/hoist/desktop/cmp/button';
import {Icon} from '@xh/hoist/icon';
import {panel} from '@xh/hoist/desktop/cmp/panel';
Expand All @@ -19,10 +19,9 @@ export const examplesTab = hoistCmp.factory(
width: 300,
height: 300,
margin: 20,
item: vframe({
className: 'example-tile-text',
items: e.text
}),
padding: 10,
overflowY: 'auto',
item: e.text,
bbar: [
button({
text: 'Launch app',
Expand Down
6 changes: 0 additions & 6 deletions client-app/src/desktop/tabs/examples/ExamplesTab.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
.example-tile-text {
flex: auto;
overflow-y: auto !important;
padding: var(--xh-pad-px);
}

.example-tile-container {
justify-content: center;
width: 800px;
Expand Down
62 changes: 30 additions & 32 deletions client-app/src/desktop/tabs/forms/FormPanel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {creates, hoistCmp} from '@xh/hoist/core';
import {Icon} from '@xh/hoist/icon';
import {filler, hbox, hframe, vbox, vframe} from '@xh/hoist/cmp/layout';
import {filler, hbox, hframe, vbox} from '@xh/hoist/cmp/layout';
import {panel} from '@xh/hoist/desktop/cmp/panel';
import {button} from '@xh/hoist/desktop/cmp/button';
import {form} from '@xh/hoist/cmp/form';
Expand Down Expand Up @@ -51,43 +51,41 @@ export const formPanel = hoistCmp.factory({
const formContent = hoistCmp.factory(
({model}) => panel({
flex: 1,
padding: 10,
item: form({
fieldDefaults: {
inline: model.inline,
minimal: model.minimal,
commitOnChange: model.commitOnChange
},
item: vframe({
padding: 10,
items: [
hbox({
flex: 'none',
items: [
vbox({
flex: 1,
marginRight: 30,
items: [
lastName(),
region(),
email(),
tags()
]
}),
vbox({
flex: 1,
items: [
startAndEndDate(),
reasonForLeaving(),
managerAndYearsExperience(),
notes()
]
})
]
}),
'References',
references()
]
})
items: [
hbox({
flex: 'none',
items: [
vbox({
flex: 1,
marginRight: 30,
items: [
lastName(),
region(),
email(),
tags()
]
}),
vbox({
flex: 1,
items: [
startAndEndDate(),
reasonForLeaving(),
managerAndYearsExperience(),
notes()
]
})
]
}),
'References',
references()
]
}),
bbar: bbar()
})
Expand Down
Loading