-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ng-gridstack library and move logics
- Loading branch information
Showing
27 changed files
with
272 additions
and
65 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,24 @@ | ||
# NgGridstack | ||
|
||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name --project ng-gridstack` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ng-gridstack`. | ||
> Note: Don't forget to add `--project ng-gridstack` or else it will be added to the default project in your `angular.json` file. | ||
## Build | ||
|
||
Run `ng build ng-gridstack` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
## Publishing | ||
|
||
After building your library with `ng build ng-gridstack`, go to the dist folder `cd dist/ng-gridstack` and run `npm publish`. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test ng-gridstack` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). |
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,32 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/1.0/config/configuration-file.html | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular-devkit/build-angular'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage-istanbul-reporter'), | ||
require('@angular-devkit/build-angular/plugins/karma') | ||
], | ||
client: { | ||
clearContext: false // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
coverageIstanbulReporter: { | ||
dir: require('path').join(__dirname, '../../coverage/ng-gridstack'), | ||
reports: ['html', 'lcovonly', 'text-summary'], | ||
fixWebpackSourcePaths: true | ||
}, | ||
reporters: ['progress', 'kjhtml'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome'], | ||
singleRun: false, | ||
restartOnFileChange: true | ||
}); | ||
}; |
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,7 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/ng-gridstack", | ||
"lib": { | ||
"entryFile": "src/public-api.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,8 @@ | ||
{ | ||
"name": "ng-gridstack", | ||
"version": "0.0.1", | ||
"peerDependencies": { | ||
"@angular/common": "^8.2.14", | ||
"@angular/core": "^8.2.14" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
...ack-item/gridstack-item.component.spec.ts → ...-item/ng-gridstack-item.component.spec.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
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
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
projects/ng-gridstack/src/lib/components/ng-gridstack/ng-gridstack.component.scss
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,3 @@ | ||
:host(*) { | ||
display: block; | ||
} |
12 changes: 6 additions & 6 deletions
12
...ack/gridstack/gridstack.component.spec.ts → ...-gridstack/ng-gridstack.component.spec.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
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,23 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { NgGridstackService } from './services/ng-gridstack.service'; | ||
import { NgGridstackItemComponent } from './components/ng-gridstack-item/ng-gridstack-item.component'; | ||
import { NgGridstackComponent } from './components/ng-gridstack/ng-gridstack.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
NgGridstackComponent, | ||
NgGridstackItemComponent | ||
], | ||
imports: [ | ||
CommonModule | ||
], | ||
exports: [ | ||
NgGridstackComponent, | ||
NgGridstackItemComponent | ||
], | ||
providers: [ | ||
NgGridstackService | ||
] | ||
}) | ||
export class NgGridstackModule { } |
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,10 @@ | ||
/* | ||
* Public API Surface of ng-gridstack | ||
*/ | ||
|
||
export * from './lib/ng-gridstack.module'; | ||
|
||
// Components | ||
|
||
export * from './lib/components/ng-gridstack/ng-gridstack.component'; | ||
export * from './lib/components/ng-gridstack-item/ng-gridstack-item.component'; |
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,21 @@ | ||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files | ||
|
||
import 'zone.js/dist/zone'; | ||
import 'zone.js/dist/zone-testing'; | ||
import { getTestBed } from '@angular/core/testing'; | ||
import { | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting | ||
} from '@angular/platform-browser-dynamic/testing'; | ||
|
||
declare const require: any; | ||
|
||
// First, initialize the Angular testing environment. | ||
getTestBed().initTestEnvironment( | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting() | ||
); | ||
// Then we find all the tests. | ||
const context = require.context('./', true, /\.spec\.ts$/); | ||
// And load the modules. | ||
context.keys().map(context); |
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,26 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../out-tsc/lib", | ||
"target": "es2015", | ||
"declaration": true, | ||
"inlineSources": true, | ||
"types": [], | ||
"lib": [ | ||
"dom", | ||
"es2018" | ||
] | ||
}, | ||
"angularCompilerOptions": { | ||
"annotateForClosureCompiler": true, | ||
"skipTemplateCodegen": true, | ||
"strictMetadataEmit": true, | ||
"fullTemplateTypeCheck": true, | ||
"strictInjectionParameters": true, | ||
"enableResourceInlining": true | ||
}, | ||
"exclude": [ | ||
"src/test.ts", | ||
"**/*.spec.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,17 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../out-tsc/spec", | ||
"types": [ | ||
"jasmine", | ||
"node" | ||
] | ||
}, | ||
"files": [ | ||
"src/test.ts" | ||
], | ||
"include": [ | ||
"**/*.spec.ts", | ||
"**/*.d.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,17 @@ | ||
{ | ||
"extends": "../../tslint.json", | ||
"rules": { | ||
"directive-selector": [ | ||
true, | ||
"attribute", | ||
"ng", | ||
"camelCase" | ||
], | ||
"component-selector": [ | ||
true, | ||
"element", | ||
"ng", | ||
"kebab-case" | ||
] | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<div> | ||
<app-gridstack [options]="options"> | ||
<app-gridstack-item *ngFor="let item of items; index as index" [x]="item.x" [y]="item.y" [width]="item.width" [height]="item.height" [id]="item.id"> | ||
<ng-gridstack [options]="options"> | ||
<ng-gridstack-item *ngFor="let item of items; index as index" [x]="item.x" [y]="item.y" [width]="item.width" [height]="item.height" [id]="item.id"> | ||
Id: {{item.id}} | ||
</app-gridstack-item> | ||
</app-gridstack> | ||
</ng-gridstack-item> | ||
</ng-gridstack> | ||
</div> |
Oops, something went wrong.