-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,018 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- ignore the following lines, they are not important to this demo --> | ||
<jigsaw-demo-description [summary]="summary" [content]="description"> | ||
</jigsaw-demo-description> | ||
|
||
|
||
<!-- start to learn the demo from here --> | ||
|
||
<div class="live-demo-wrap"> | ||
<h2>Transfer</h2> | ||
<div class="demo-1 live-demo"> | ||
<h3>普通数据</h3> | ||
<j-transfer width="100%" height="500" [data]="data" labelField="zhName" subLabelField="shortName" | ||
[searchable]="true" (selectedItemsChange)="handleSelectChange($event)" | ||
[selectedItems]="selectedCountries"></j-transfer> | ||
<p class="message">选择的地区:{{selectedCountriesStr}}</p> | ||
</div> | ||
</div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {Component} from "@angular/core"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {ArrayCollection, LocalPageableArray} from "jigsaw/core/data/array-collection"; | ||
import {TableData} from "jigsaw/core/data/table-data"; | ||
|
||
@Component({ | ||
templateUrl: './demo.component.html' | ||
}) | ||
export class TransferArrayDemoComponent { | ||
constructor(private _http: HttpClient) { | ||
this.data = new ArrayCollection(); | ||
this.data.http = _http; | ||
this.data.fromAjax('mock-data/countries'); | ||
this.data.dataReviser = (td: TableData) => TableData.toArray(td); | ||
|
||
this.selectedCountries = new ArrayCollection(); | ||
this.selectedCountries.http = _http; | ||
this.selectedCountries.fromAjax('mock-data/countries'); | ||
this.selectedCountries.dataReviser = (td: TableData) => TableData.toArray(td).slice(0,5); | ||
} | ||
|
||
data: ArrayCollection<any>; | ||
selectedCountries: ArrayCollection<any>; | ||
selectedCountriesStr: string; | ||
|
||
handleSelectChange($event) { | ||
this.selectedCountriesStr = $event.map(item => item.zhName).join(','); | ||
} | ||
|
||
// ==================================================================== | ||
// ignore the following lines, they are not important to this demo | ||
// ==================================================================== | ||
summary: string = ''; | ||
description: string = ''; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {NgModule} from "@angular/core"; | ||
import {JigsawDemoDescriptionModule} from "app/demo-description/demo-description"; | ||
import {TransferArrayDemoComponent} from "./demo.component"; | ||
import {JigsawTransferModule} from "jigsaw/component/transfer/transfer"; | ||
|
||
@NgModule({ | ||
declarations: [TransferArrayDemoComponent], | ||
exports: [ TransferArrayDemoComponent ], | ||
imports: [JigsawDemoDescriptionModule, JigsawTransferModule] | ||
}) | ||
export class TransferArrayDemoModule{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {NgModule} from "@angular/core"; | ||
import {RouterModule} from "@angular/router"; | ||
import {TransferArrayDemoComponent} from "./basic/demo.component"; | ||
import {TransferArrayDemoModule} from "./basic/demo.module"; | ||
import {TransferLocalPageableArrayComponent} from "./local-pageable-array/demo.component"; | ||
import {TransferLocalPageableArrayDemoModule} from "./local-pageable-array/demo.module"; | ||
import {TransferPageableArrayComponent} from "./pageable-array/demo.component"; | ||
import {TransferPageableArrayDemoModule} from "./pageable-array/demo.module"; | ||
import {TransferItemDisabledDemoComponent} from "./item-disabled/demo.component"; | ||
import {TransferItemDisabledDemoModule} from "./item-disabled/demo.module"; | ||
|
||
export const routerConfig = [ | ||
{ | ||
path: 'basic', component: TransferArrayDemoComponent | ||
}, | ||
{ | ||
path: 'local-pageable-array', component: TransferLocalPageableArrayComponent | ||
}, | ||
{ | ||
path: 'pageable-array', component: TransferPageableArrayComponent | ||
}, | ||
{ | ||
path: 'item-disabled', component: TransferItemDisabledDemoComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ | ||
RouterModule.forChild(routerConfig), | ||
TransferArrayDemoModule, | ||
TransferLocalPageableArrayDemoModule, | ||
TransferPageableArrayDemoModule, | ||
TransferItemDisabledDemoModule | ||
] | ||
}) | ||
export class TransferDemoModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- ignore the following lines, they are not important to this demo --> | ||
<jigsaw-demo-description [summary]="summary" [content]="description"> | ||
</jigsaw-demo-description> | ||
|
||
|
||
<!-- start to learn the demo from here --> | ||
|
||
<div class="live-demo-wrap"> | ||
<h2>Transfer</h2> | ||
<div class="demo-1 live-demo"> | ||
<h3>随机设置不可操作条目</h3> | ||
<j-transfer width="100%" height="500" [data]="data" labelField="zhName" subLabelField="enName"></j-transfer> | ||
</div> | ||
</div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import {Component} from "@angular/core"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {ArrayCollection} from "jigsaw/core/data/array-collection"; | ||
import {TableData} from "jigsaw/core/data/table-data"; | ||
|
||
@Component({ | ||
templateUrl: './demo.component.html' | ||
}) | ||
export class TransferItemDisabledDemoComponent { | ||
constructor(private _http: HttpClient) { | ||
this.data = new ArrayCollection(); | ||
this.data.http = _http; | ||
this.data.fromAjax('mock-data/countries'); | ||
this.data.dataReviser = (td: TableData) => { | ||
return TableData.toArray(td).map(item => { | ||
item.disabled = Math.random() > 0.8; | ||
return item; | ||
}) | ||
} | ||
} | ||
|
||
data: ArrayCollection<any>; | ||
|
||
// ==================================================================== | ||
// ignore the following lines, they are not important to this demo | ||
// ==================================================================== | ||
summary: string = ''; | ||
description: string = ''; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {NgModule} from "@angular/core"; | ||
import {JigsawTransferModule} from "jigsaw/component/transfer/transfer"; | ||
import {JigsawDemoDescriptionModule} from "app/demo-description/demo-description"; | ||
import {TransferItemDisabledDemoComponent} from "./demo.component"; | ||
|
||
@NgModule({ | ||
declarations: [TransferItemDisabledDemoComponent], | ||
exports: [ TransferItemDisabledDemoComponent ], | ||
imports: [JigsawDemoDescriptionModule, JigsawTransferModule] | ||
}) | ||
export class TransferItemDisabledDemoModule{ | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/app/demo/transfer/local-pageable-array/demo.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- ignore the following lines, they are not important to this demo --> | ||
<jigsaw-demo-description [summary]="summary" [content]="description"> | ||
</jigsaw-demo-description> | ||
|
||
|
||
<!-- start to learn the demo from here --> | ||
|
||
<div class="live-demo-wrap"> | ||
<h2>Transfer</h2> | ||
<div class="demo-1 live-demo"> | ||
<h3>本地分页数据</h3> | ||
<j-transfer width="100%" height="500" [data]="data" labelField="zhName" subLabelField="shortName" | ||
[searchable]="true" (selectedItemsChange)="handleSelectChange($event)" | ||
[selectedItems]="selectedCountries"></j-transfer> | ||
<p class="message">选择的地区:{{selectedCountriesStr}}</p> | ||
</div> | ||
</div> | ||
|
||
|
||
|
38 changes: 38 additions & 0 deletions
38
src/app/demo/transfer/local-pageable-array/demo.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {Component} from "@angular/core"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {ArrayCollection, LocalPageableArray} from "jigsaw/core/data/array-collection"; | ||
import {TableData} from "jigsaw/core/data/table-data"; | ||
|
||
@Component({ | ||
templateUrl: './demo.component.html' | ||
}) | ||
export class TransferLocalPageableArrayComponent { | ||
constructor(private _http: HttpClient) { | ||
this.data = new LocalPageableArray(); | ||
this.data.http = _http; | ||
this.data.pagingInfo.pageSize = 15; | ||
this.data.fromAjax('mock-data/countries'); | ||
this.data.dataReviser = (td: TableData) => TableData.toArray(td); | ||
|
||
this.selectedCountries = new ArrayCollection(); | ||
this.selectedCountries.http = _http; | ||
this.selectedCountries.fromAjax('mock-data/countries'); | ||
this.selectedCountries.dataReviser = (td: TableData) => TableData.toArray(td).slice(0,5); | ||
} | ||
|
||
data: LocalPageableArray<any>; | ||
selectedCountries: ArrayCollection<any>; | ||
selectedCountriesStr: string; | ||
|
||
handleSelectChange($event) { | ||
this.selectedCountriesStr = $event.map(item => item.zhName).join(','); | ||
} | ||
|
||
// ==================================================================== | ||
// ignore the following lines, they are not important to this demo | ||
// ==================================================================== | ||
summary: string = ''; | ||
description: string = ''; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {NgModule} from "@angular/core"; | ||
import {JigsawDemoDescriptionModule} from "app/demo-description/demo-description"; | ||
import {TransferLocalPageableArrayComponent} from "./demo.component"; | ||
import {JigsawTransferModule} from "jigsaw/component/transfer/transfer"; | ||
|
||
@NgModule({ | ||
declarations: [TransferLocalPageableArrayComponent], | ||
exports: [ TransferLocalPageableArrayComponent ], | ||
imports: [JigsawDemoDescriptionModule, JigsawTransferModule] | ||
}) | ||
export class TransferLocalPageableArrayDemoModule{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- ignore the following lines, they are not important to this demo --> | ||
<jigsaw-demo-description [summary]="summary" [content]="description"> | ||
</jigsaw-demo-description> | ||
|
||
|
||
<!-- start to learn the demo from here --> | ||
|
||
<div class="live-demo-wrap"> | ||
<h2>Transfer</h2> | ||
<div class="demo-1 live-demo"> | ||
<h3>服务端分页数据</h3> | ||
<j-transfer width="100%" height="500" [data]="data" labelField="zhName" subLabelField="shortName" | ||
[searchable]="true" (selectedItemsChange)="handleSelectChange($event)" | ||
[selectedItems]="selectedCountries"></j-transfer> | ||
<p class="message">选择的地区:{{selectedCountriesStr}}</p> | ||
</div> | ||
</div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import {Component} from "@angular/core"; | ||
import {HttpClient} from "@angular/common/http"; | ||
import {ArrayCollection, PageableArray} from "jigsaw/core/data/array-collection"; | ||
import {TableData} from "jigsaw/core/data/table-data"; | ||
|
||
@Component({ | ||
templateUrl: './demo.component.html' | ||
}) | ||
export class TransferPageableArrayComponent { | ||
constructor(private _http: HttpClient) { | ||
this.data = new PageableArray(_http, { | ||
url: '/rdk/service/app/example/server/my_service', | ||
method: 'post' | ||
}); | ||
this.data.fromAjax(); | ||
|
||
this.selectedCountries = new ArrayCollection(); | ||
this.selectedCountries.http = _http; | ||
this.selectedCountries.fromAjax('/rdk/service/app/example/server/my_service'); | ||
this.selectedCountries.dataReviser = (td: TableData) => TableData.toArray(td).slice(10,15); | ||
} | ||
|
||
data: PageableArray; | ||
selectedCountries: ArrayCollection<any>; | ||
selectedCountriesStr: string; | ||
|
||
handleSelectChange($event) { | ||
this.selectedCountriesStr = $event.map(item => item.zhName).join(','); | ||
} | ||
|
||
// ==================================================================== | ||
// ignore the following lines, they are not important to this demo | ||
// ==================================================================== | ||
summary: string = ''; | ||
description: string = ''; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {NgModule} from "@angular/core"; | ||
import {JigsawDemoDescriptionModule} from "app/demo-description/demo-description"; | ||
import {TransferPageableArrayComponent} from "./demo.component"; | ||
import {JigsawTransferModule} from "jigsaw/component/transfer/transfer"; | ||
|
||
@NgModule({ | ||
declarations: [TransferPageableArrayComponent], | ||
exports: [ TransferPageableArrayComponent ], | ||
imports: [JigsawDemoDescriptionModule, JigsawTransferModule] | ||
}) | ||
export class TransferPageableArrayDemoModule{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.