Skip to content

Commit

Permalink
qontu#136 Added Angular 7+ lib building support
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelaverkiev committed Feb 11, 2019
1 parent d53d2f7 commit 768d0f6
Show file tree
Hide file tree
Showing 19 changed files with 459 additions and 291 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Native UI Inline-editor Angular (version 4+) component ([demo](demos))
# Native UI Inline-editor Angular (version 7+) component ([demo](demos))

Follow me [![twitter](https://img.shields.io/twitter/follow/carlillo.svg?style=social&label=%20carlillo)](https://twitter.com/carlillo) to be notified about new releases.

ngx-inline-editor is a library of Angular (version 4+) that allows you to create editable elements.
ngx-inline-editor is a library of Angular (version 7+) that allows you to create editable elements.
Such technique is also known as *click-to-edit* or *edit-in-place*.
It is based on ideas of [angular-xeditable](https://github.com/vitalets/angular-xeditable) which is developed in AngularJS.


![Version 0.1.0](https://github.com/qontu/ngx-inline-editor/raw/master/demos/basic/0.1.0.gif)
## Dependencies

Basically it does not depend on any libraries except Angular4 itself.
It depends on Font awesome v4.7.0 to show the icons.
For themes you may need to include Twitter Bootstrap CSS.

### Angular 4+ Version
### Angular 7+ Version

Angular 4 is now stable. Therefore, if encountering errors using this
lib, ensure your version of Angular is compatible. The current version used to develop this lib is angular4 **^4.0.0**.
Angular 7 is now stable. Therefore, if encountering errors using this
lib, ensure your version of Angular is compatible. The current version used to develop this lib is angular4 **^7.2.0**.

## Controls & Features

Expand Down Expand Up @@ -336,7 +336,7 @@ If the type is `select` then the default selected element is the first element o
The `inline-editor` has the following basic theme which you can find in `dist/themes/bootstrap.css`:
```CSS
a.c-inline-editor {
:not([class='is-editing']) a.c-inline-editor {
text-decoration: none;
color: #428bca;
border-bottom: dashed 1px #428bca;
Expand All @@ -345,6 +345,9 @@ a.c-inline-editor {
margin-right: 5px;
margin-left: 5px;
}
.btn {
margin-left:5px;
}
.c-inline-editor.editable-empty,
.c-inline-editor.editable-empty:hover,
.c-inline-editor.editable-empty:focus,
Expand Down Expand Up @@ -411,11 +414,7 @@ Thanks for understanding!
1. To generate all `*.js`, `*.js.map` and `*.d.ts` files:
`npm run build`
2. To debug :
`npm run build:watch`
`yarn build`
## Authors
Carlos Caballero - [https://github.com/caballerog](hhttps://github.com/caballerog)
Expand Down
76 changes: 76 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "./",
"projects": {
"ngx-inline-editor": {
"root": "",
"sourceRoot": "src",
"projectType": "library",
"prefix": "ngx",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "tsconfig.json",
"project": "ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.json",
"tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ngx-inline-editor-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "ngx-inline-editor:serve"
},
"configurations": {
"production": {
"devServerTarget": "ngx-inline-editor:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "ngx-inline-editor"
}
28 changes: 28 additions & 0 deletions e2e/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
23 changes: 23 additions & 0 deletions e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;

beforeEach(() => {
page = new AppPage();
});

it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to ngx-inline-editor!');
});

afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
}));
});
});
11 changes: 11 additions & 0 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';

export class AppPage {
navigateTo() {
return browser.get('/');
}

getTitleText() {
return element(by.css('app-root h1')).getText();
}
}
13 changes: 13 additions & 0 deletions e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
7 changes: 7 additions & 0 deletions ng-package.json
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",
"lib": {
"entryFile": "./public_api.ts"
}
}
Loading

0 comments on commit 768d0f6

Please sign in to comment.