Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
25fa5e5
First cut at Dialog Tab Panel in Other main tab.
cnrudd Dec 26, 2019
6782ef7
Reuse formpanel in dialog
cnrudd Dec 27, 2019
356f50e
Revert changes to forms tab
cnrudd Jan 2, 2020
896711e
latest yarn.lock
cnrudd Jan 2, 2020
64f3fb7
Using own form for dialog demo
cnrudd Jan 2, 2020
ebf5ae8
Remove unneeded inDialog prop; add autoFocus: true to first field
cnrudd Jan 2, 2020
dfbe69a
Add autoFocus: true to first field
cnrudd Jan 2, 2020
a0f4716
Use same form in fixed and in draggable demo dialogs.
cnrudd Jan 3, 2020
16167f3
Set size on dialog.
cnrudd Jan 3, 2020
49b4db2
Comment out numberInput from form till bug solved.
cnrudd Jan 3, 2020
cc6667a
latest packages.
cnrudd Jan 3, 2020
4ac7945
But numericInput back in.
cnrudd Jan 6, 2020
594feb0
Moved to using function Dialog comp.
cnrudd Jan 7, 2020
5ca8162
Cleanup model conf
cnrudd Jan 7, 2020
713ecb3
Remove header from form panel.
cnrudd Jan 7, 2020
47770da
Added comment explaining importance of submodel order
cnrudd Jan 8, 2020
7a88e56
Removed dims since dialogs now auto size and auto center.
cnrudd Jan 8, 2020
2ba77fc
Better button texts and removed model prop to test use of context.
cnrudd Jan 8, 2020
6b39c00
Test gettting prop value from modelContext if not passed.
cnrudd Jan 8, 2020
86f2fb1
add charts (OHLC and TreeMap to dialog demo page)
cnrudd Jan 14, 2020
1d5257e
Moved dialogModels into dialog folder, added stateful dialog demo.
cnrudd Jan 17, 2020
a2af25c
Add trackSize false example dialog
cnrudd Jan 17, 2020
b1698c5
Demo x, y props on dialog.
cnrudd Jan 18, 2020
9401139
Merge branch 'develop' into hoistDialog
cnrudd Jan 21, 2020
719ccf5
use factor component
cnrudd Jan 21, 2020
874c89f
Merge branch 'develop' into hoistDialog
cnrudd Jan 21, 2020
2d7d5a2
Dialogs: Added toolbar for props toggling.
cnrudd Feb 2, 2020
fb8f815
Moved dialog tests to admin/tests
cnrudd Feb 7, 2020
ffcc586
Moved dialog tests to admin/tests
cnrudd Feb 7, 2020
ff3fc7d
Add zIndex and Style tests
cnrudd Feb 9, 2020
314eb08
Add RnDOptions zIndex test
cnrudd Feb 10, 2020
be68842
Merge branch 'develop' into hoistDialog
cnrudd Feb 16, 2020
e33376e
Latest yarn.lock
cnrudd Feb 16, 2020
5843136
More helpful button texst
cnrudd Feb 16, 2020
5c5344b
add header tests
cnrudd Feb 17, 2020
b41ea86
Partial Redo of Dailogs Test page.
cnrudd Feb 18, 2020
7db9575
Convert more tests to controlled dialog
cnrudd Feb 19, 2020
de0dc29
add closeOnEscape switch
cnrudd Feb 19, 2020
27bea3b
Finish redo of tests with controlled dialog component.
cnrudd Feb 21, 2020
e1572cc
Merge branch 'develop' into hoistDialog
cnrudd Feb 21, 2020
d93c507
Redo of app/other/dialogs tab
cnrudd Feb 21, 2020
47495a8
WIP
cnrudd Feb 24, 2020
7fd6a67
Use elementFromContent for the dialog content.
cnrudd Feb 24, 2020
f8b0440
Rebuild 9 dialog tests.
cnrudd Feb 24, 2020
1ca22ff
All tests restored
cnrudd Feb 25, 2020
31fbacf
Cleanup
cnrudd Feb 25, 2020
ca6b45b
cleanup
cnrudd Feb 25, 2020
7be8b7c
Add 'not in portal' tests
cnrudd Feb 25, 2020
d00b560
Use form in non-portal dialog to test autofocus on non-portal dialog.
cnrudd Feb 25, 2020
842842a
Merge branch 'develop' into hoistDialogModel
cnrudd Feb 25, 2020
24dc41c
Redo dialog test page to better support dynamic x & y settings
cnrudd Mar 4, 2020
f18165d
Merge branch 'develop' into hoistDialogModel
cnrudd Mar 4, 2020
4dc1c1d
Merge branch 'develop' into hoistDialogModel
cnrudd Mar 16, 2020
e4205ea
Added some model #s to help identify model when testing.
cnrudd Mar 16, 2020
543e493
Set x,y and width,height together.
cnrudd Mar 16, 2020
035d603
added (m4), etc for clarity in testing
cnrudd Mar 16, 2020
e99ea9c
Cleanup
cnrudd Mar 16, 2020
cdab810
Added more tests of resizable.
cnrudd Mar 25, 2020
ac0b316
Merge branch 'develop' into hoistDialogModel
lbwexler Mar 26, 2020
166e726
Refactor Test Page for greater flexibility
lbwexler Mar 27, 2020
abb95bd
Checkpoint
lbwexler Mar 29, 2020
dc4a644
Checkpoint
lbwexler Mar 29, 2020
32ebbad
DRY Example content used in Dialog Testing
lbwexler Mar 30, 2020
e161485
Added buttons to presets - WIP
cnrudd Mar 30, 2020
348786a
Checkpoint
lbwexler Mar 30, 2020
03cdbab
Update dependencies
lbwexler Mar 30, 2020
e5b56bf
Update yarn.lock
lbwexler Mar 30, 2020
ca69a30
Merge branch 'develop' into dialogX
lbwexler Mar 30, 2020
6e10494
Merge branch 'dialogX' of github.com:exhi/toolbox into dialogX
cnrudd Mar 31, 2020
e108a79
Merge branch 'develop' into dialogX
lbwexler Apr 2, 2020
3b812fb
Dialog x with resize fix (#389)
cnrudd Apr 2, 2020
97c32a7
Tweaks to TestBed
lbwexler Apr 3, 2020
9a80248
Merge branch 'develop' into dialogX
lbwexler Apr 11, 2020
0ddec41
Add tooltips
lbwexler Apr 12, 2020
16ff843
More tweaks
lbwexler Apr 13, 2020
63be855
Merge branch 'develop' into dialogX
lbwexler Apr 13, 2020
2935d89
Provide proper renderMode/refreshMode support
lbwexler Apr 14, 2020
3509a6e
Merge branch 'dialogX' of github.com:exhi/toolbox into dialogX
cnrudd Apr 27, 2020
8df7139
latest yarn lock
cnrudd Apr 27, 2020
171609e
Merge branch 'develop' into dialogX
cnrudd Apr 27, 2020
4d59a48
Latest Yarn lock
cnrudd Apr 27, 2020
d192002
Remove Presets Panel.
cnrudd Apr 27, 2020
48f7b40
Merge branch 'develop' into dialogX
lbwexler Jun 3, 2020
0b7f89b
Merge from Parent
lbwexler Jun 3, 2020
79e7644
Merge branch 'develop' into dialogX
cnrudd Jun 26, 2020
08bbd3d
Merge branch 'develop' into dialogX
cnrudd Sep 18, 2020
d022552
Fix to useage of getOHLCChartSeriesAsync
cnrudd Sep 18, 2020
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
4 changes: 3 additions & 1 deletion client-app/src/admin/AppModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export class AppModel extends BaseAppModel {
{name: 'panelResizing', path: '/panelResizing'},
{name: 'fetchAPI', path: '/fetchAPI'},
{name: 'storeEditing', path: '/storeEditing'},
{name: 'select', path: '/select'}
{name: 'select', path: '/select'},
{name: 'dialogs', path: '/dialogs'}

]
},
{
Expand Down
5 changes: 4 additions & 1 deletion client-app/src/admin/tests/TestsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {PanelResizingTestPanel} from './panels/PanelResizingTestPanel';
import {FetchApiTestPanel} from './fetch/FetchApiTestPanel';
import {StoreEditingPanel} from './storeEditing/StoreEditingPanel';
import {SelectTestPanel} from './Select/SelectTestPanel';
import {dialogsPanel} from './dialogs/DialogsPanel';
import {dataViewTestPanel} from './dataview/DataViewTestPanel';

export const TestsTab = hoistCmp(
Expand All @@ -29,7 +30,9 @@ export const TestsTab = hoistCmp(
{id: 'panelResizing', title: 'Panel Resizing', content: PanelResizingTestPanel},
{id: 'fetchAPI', title: 'Fetch API', content: FetchApiTestPanel},
{id: 'storeEditing', title: 'Store Editing', content: StoreEditingPanel},
{id: 'select', title: 'Select', content: SelectTestPanel}
{id: 'select', title: 'Select', content: SelectTestPanel},
{id: 'dialogs', title: 'Dialogs', content: dialogsPanel}

],
switcherPosition: 'left'
}
Expand Down
143 changes: 143 additions & 0 deletions client-app/src/admin/tests/dialogs/DialogsPanel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@

import {vspacer, vframe, vbox, hframe, hbox, filler} from '@xh/hoist/cmp/layout';
import {hoistCmp, creates} from '@xh/hoist/core';
import {button} from '@xh/hoist/desktop/cmp/button';
import {panel} from '@xh/hoist/desktop/cmp/panel';
import {pickBy} from 'lodash';
import {dialog} from '@xh/hoist/desktop/cmp/dialog';
import {codeInput, select, textInput} from '@xh/hoist/desktop/cmp/input';
import {Icon} from '@xh/hoist/icon';
import {DialogsPanelModel} from './DialogsPanelModel';
import {stubPanel} from './StubPanel';
import {form} from '@xh/hoist/cmp/form';
import {formField} from '@xh/hoist/desktop/cmp/form';


export const dialogsPanel = hoistCmp.factory({
model: creates(DialogsPanelModel),
render() {
return hframe(managePanel(), hostPanel());
}
});

const managePanel = hoistCmp.factory({
render: ({model}) => {
const {formModel} = model,
ctrlDefaults = {enableClear: true, placeholder: '[none]'};
return panel({
title: 'Create/Manage',
model: {
showSplitter: true,
defaultSize: 400,
minSize: 400,
side: 'left',
resizable: true
},
item: form({
fieldDefaults: {
inline: false,
minimal: true,
commitOnChange: true
},
items: vbox({
padding: 5,
items: [
hframe(
formField({
field: 'icon',
width: 120,
item: select({
...ctrlDefaults,
options: ['chartLine', 'dollarSign', 'add']
})
}),
formField({
field: 'title',
width: 140,
item: textInput({...ctrlDefaults})
}),
formField({
field: 'content',
width: 120,
item: select({
enableFilter: false,
enableClear: false,
...ctrlDefaults,
options: ['form', 'chart', 'treeMap']
})
})
),
formField({
field: 'modelConfig',
item: codeInput({
...ctrlDefaults,
height: 290,
editorProps: {lineNumbers: false},
mode: 'javascript'
})
}),
hbox(
button({
text: 'Preset 1',
minimal: false,
onClick: () => model.addStub1()
}),
button({
text: 'Preset 2',
minimal: false,
onClick: () => model.addStub2()
}),
filler(),
button({
icon: Icon.reset({className: 'xh-red'}),
minimal: false,
onClick: () => formModel.reset(),
disabled: !formModel.isDirty
}),
button({
text: 'Add from Form',
minimal: false,
icon: Icon.add(),
onClick: () => model.addFormStub()
})
),
vspacer(7),
stubsPanel()
]
})
})
});
}
});

const stubsPanel = hoistCmp.factory({
render({model}) {
return vframe({
items: [...model.stubs.map(stub => stubPanel({key: stub.xhId, model: stub}))]
});
}
});

const hostPanel = hoistCmp.factory({
render({model}) {
return panel({
title: 'Host Panel',
flex: 1,
item: vframe({
items: [
...model.stubs.map(stub => {
const {dialogModel, title, icon, content} = stub,
props = {
key: dialogModel.key,
icon: icon ? Icon[icon]() : null,
title,
model: dialogModel,
item: content
};
return dialog(pickBy(props));
})
]
})
});
}
});
120 changes: 120 additions & 0 deletions client-app/src/admin/tests/dialogs/DialogsPanelModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import {HoistModel, managed, XH} from '@xh/hoist/core';
import {observable, action} from '@xh/hoist/mobx';
import {DialogModel} from '@xh/hoist/desktop/cmp/dialog';

import {without} from 'lodash';
import {StubModel} from './StubModel';
import {FormModel} from '@xh/hoist/cmp/form';

import {formPanel} from './content/FormPanel';
import {chartPanel} from './content/ChartPanel';
import {treeMapPanel} from './content/TreeMapPanel';

@HoistModel
export class DialogsPanelModel {

initialModelConfig = `{
resizable: true,
draggable: true,
// closeOnOutsideClick: false,
// closeOnEscape: false,
// showCloseButton: false,
// showBackgroundMask: false,
inPortal: false,
// renderMode: 'unmountOnHide',
// refreshMode: 'onShowAlways'

// size: {width: 400, height: 600},
// position: {x: 100, y: 100},
// isOpen: false,
// isMaximized: true
}`;

@managed
formModel = new FormModel({
fields: [
{name: 'icon', initialValue: 'add'},
{name: 'content', initialValue: 'form'},
{name: 'title', initialValue: 'My Dialog'},
{
name: 'modelConfig',
initialValue: this.initialModelConfig
}
]
});

@observable.ref
stubs = [];

addFormStub() {
const {values} = this.formModel;
this.addStub(
values.title,
values.icon,
this.getContent(values.content),
new DialogModel(eval('('+ values.modelConfig + ')'))
);
}

@action
addStub(...args) {
this.stubs = [...this.stubs, new StubModel(...args)];
}

@action
removeStub(stub) {
this.stubs = without(this.stubs, stub);
XH.safeDestroy(stub);
}

//--------------------
// Some Useful presets
//--------------------
addStub1() {
this.addStub(
'Resizable TreeMap (s1)',
'box',
treeMapPanel(),
new DialogModel({
resizable: true,
inPortal: false,
size: {
width: 400,
height: 600
}
})
);
}

addStub2() {
this.addStub(
'Resizable Chart (s1)',
'chartLine',
chartPanel(),
new DialogModel({
resizable: true,
inPortal: false,
size: {
width: 400,
height: 600
}
})
);
}

//----------------------
// Implementation
//----------------------
getContent() {
switch (this.formModel.values.content) {
case 'form': return formPanel();
case 'chart': return chartPanel();
case 'treeMap': return treeMapPanel();
}
return null;
}

destroy() {
XH.safeDestroy(this.stubs);
}
}
20 changes: 20 additions & 0 deletions client-app/src/admin/tests/dialogs/StubModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {HoistModel, XH} from '@xh/hoist/core';

@HoistModel
export class StubModel {
title;
icon;
dialogModel;

constructor(title, icon, content, dialogModel) {
this.title = title;
this.icon = icon;
this.content = content;
this.dialogModel = dialogModel;
}

destroy() {
this.dialogModel.close();
XH.safeDestroy(this.dialogModel);
}
}
Loading