Skip to content

Commit

Permalink
TreeView作成中
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraKumo001 committed Sep 13, 2019
1 parent fcecc42 commit 4236edb
Show file tree
Hide file tree
Showing 20 changed files with 807 additions and 151 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ JSWindowで囲むだけで、そこが仮想ウインドウ化します

## 3.links

- WebSite
[https://ttis.croud.jp/?uuid=b292d429-dbad-49b5-8fed-6d268f4feaf0](https://ttis.croud.jp/?uuid=b292d429-dbad-49b5-8fed-6d268f4feaf0)

- Source code
[https://github.com/JavaScript-WindowFramework/jswf-react](https://github.com/JavaScript-WindowFramework/jswf-react)

Expand Down Expand Up @@ -113,13 +116,12 @@ ReactDOM.render(<App />, document.getElementById("root") as HTMLElement);
- 重ね合わせ
- 親子ウインドウ
- 画面分割
- リストビュー

## 6.コンポーネント

### 6.1 **JSWindow**

<div style="text-indent:4em">

#### Propsパラメータ

| Name | Type | Info |
Expand Down Expand Up @@ -152,12 +154,8 @@ WindowState.MAX
WindowState.MIN
WindowState.HIDE

</div>

### 6.2 **SplitView**

<div style="text-indent:4em">

#### Propsパラメータ

| Name | Type | Info |
Expand All @@ -169,8 +167,6 @@ WindowState.HIDE
| bold | number | Bar thickness |
| style | React.CSSProperties | CSS |

</div>

## 7.ライセンス

MIT
Binary file added images/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions images/talone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions images/tclose.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions images/topen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jswf/react",
"version": "0.1.1",
"version": "0.2.1",
"description": "Virtual Window for React",
"main": "dist/index.js",
"scripts": {
Expand Down
40 changes: 21 additions & 19 deletions src/JSWindow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface WindowProps {
windowStyle?: number;
windowState?: WindowState;
onUpdate?: ((status: WindowInfo) => void) | null;
clientStyle?:React.CSSProperties;
clientStyle?: React.CSSProperties;
}
type NonNullableType<T, K extends keyof T = keyof T> = {
[P in K]-?: T[P];
Expand Down Expand Up @@ -93,7 +93,7 @@ export class JSWindow extends Component<WindowProps, State> {
overlapped: true,
windowStyle: 0xff,
windowState: WindowState.NORMAL,
clientStyle:{},
clientStyle: {},
onUpdate: null
};

Expand All @@ -119,10 +119,9 @@ export class JSWindow extends Component<WindowProps, State> {
state = {
active: props.active!,
overlapped: props.overlapped!,
titlePrmisson:props.windowStyle!,
titleSize:(props.windowStyle! & WindowStyle.TITLE) === 0
? 0
: props.titleSize!,
titlePrmisson: props.windowStyle!,
titleSize:
(props.windowStyle! & WindowStyle.TITLE) === 0 ? 0 : props.titleSize!,
borderSize: props.borderSize!,
x: props.x!,
y: props.y!,
Expand Down Expand Up @@ -154,7 +153,7 @@ export class JSWindow extends Component<WindowProps, State> {
onUpdate: props.onUpdate!,
clientWidth: 0,
clientHeight: 0,
clientStyle:props.clientStyle!,
clientStyle: props.clientStyle!,
realX: 0,
realY: 0,
realWidth: 0,
Expand Down Expand Up @@ -411,6 +410,7 @@ export class JSWindow extends Component<WindowProps, State> {
/>
))}
<Clinet
id="CLIENT"
ref={this.clientRef}
TitleSize={this.state.titleSize}
Width={clientWidth}
Expand Down Expand Up @@ -589,17 +589,19 @@ export class JSWindow extends Component<WindowProps, State> {
) {
if (Manager.moveNode == null) {
this.foreground();
Manager.moveNode = this.rootRef.current;
let p = Manager.getPos((e as unknown) as MouseEvent | TouchEvent);
Manager.baseX = p.x;
Manager.baseY = p.y;
Manager.nodeX = this.windowInfo.realX;
Manager.nodeY = this.windowInfo.realY;
Manager.nodeWidth = this.windowInfo.realWidth;
Manager.nodeHeight = this.windowInfo.realHeight;
e.stopPropagation();
if (this.props.moveable || Manager.frame) {
Manager.moveNode = this.rootRef.current;
let p = Manager.getPos((e as unknown) as MouseEvent | TouchEvent);
Manager.baseX = p.x;
Manager.baseY = p.y;
Manager.nodeX = this.windowInfo.realX;
Manager.nodeY = this.windowInfo.realY;
Manager.nodeWidth = this.windowInfo.realWidth;
Manager.nodeHeight = this.windowInfo.realHeight;
e.stopPropagation();
}
} else {
e.preventDefault();
// e.preventDefault();
}
}
//フレームクリックイベントの処理
Expand All @@ -626,8 +628,8 @@ export class JSWindow extends Component<WindowProps, State> {
.call(parent.childNodes, 0)
.filter(node => {
return (
(node as typeof node & { _symbol?: JSWindow })
._symbol instanceof JSWindow
(node as typeof node & { _symbol?: JSWindow })._symbol instanceof
JSWindow
);
})
.sort((a, b) => {
Expand Down
Loading

0 comments on commit 4236edb

Please sign in to comment.