Skip to content

Commit

Permalink
feat: add loadGuides method daybrush#6
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Feb 7, 2020
1 parent 68188bb commit 96a96c5
Show file tree
Hide file tree
Showing 26 changed files with 243 additions and 192 deletions.
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scena/guides",
"version": "0.4.4",
"version": "0.5.2",
"description": "A Vanilla Guides component that can draw ruler and manage guidelines.",
"main": "./dist/guides.cjs.js",
"module": "./dist/guides.esm.js",
Expand Down Expand Up @@ -64,6 +64,6 @@
"typescript": "^3.5.2"
},
"dependencies": {
"react-compat-guides": "^0.1.2"
"react-compat-guides": "^0.2.1"
}
}
38 changes: 19 additions & 19 deletions packages/ngx-guides/projects/ngx-guides/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/ngx-guides/projects/ngx-guides/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-guides",
"version": "0.3.4",
"version": "0.4.2",
"description": "An Angular Guides component that can draw ruler and manage guidelines.",
"keywords": [
"scene",
Expand Down Expand Up @@ -28,6 +28,6 @@
"@angular/core": "^8.2.13"
},
"dependencies": {
"@scena/guides": "^0.4.4"
"@scena/guides": "^0.5.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, OnInit, Input, AfterViewInit, ViewChild, ElementRef, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
import Guides, { GuidesInterface, GuidesProps } from '@scena/guides';
import Guides, { GuidesProps } from '@scena/guides';
import { IObject } from '@daybrush/utils';
import { NgxGuidesInterface } from './ngx-guides.interface';

@Component({
selector: 'ngx-guides',
Expand All @@ -9,7 +10,7 @@ import { IObject } from '@daybrush/utils';
`,
styles: []
})
export class NgxGuidesComponent implements GuidesInterface, GuidesProps, AfterViewInit, OnChanges, OnDestroy {
export class NgxGuidesComponent extends NgxGuidesInterface implements GuidesProps, AfterViewInit, OnChanges, OnDestroy {
@ViewChild('guidesRef', { static: false }) private guidesRef: ElementRef;
@Input() public className?: string;
@Input() public type?: 'horizontal' | 'vertical';
Expand All @@ -23,19 +24,7 @@ export class NgxGuidesComponent implements GuidesInterface, GuidesProps, AfterVi
@Input() public textColor?: string;
@Input() public setGuides?: (guides: number[]) => any;
@Input() public rulerStyle?: IObject<any>;
private guides: Guides;
public getGuides(): number[] {
return this.guides.getGuides();
}
public scrollGuides(pos: number): void {
this.guides.scrollGuides(pos);
}
public scroll(scrollPos: number) {
this.guides.scroll(scrollPos);
}
public resize() {
this.guides.resize();
}

ngOnChanges(changes: SimpleChanges): void {
const guides = this.guides;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import VanillaGuides, { METHODS, GuidesInterface } from '@scena/guides';
import { withMethods, MethodInterface } from 'framework-utils';
import { NgxGuidesComponent } from './ngx-guides.component';

export class NgxGuidesInterface {
@withMethods(METHODS as any)
protected guides!: VanillaGuides;
}
export interface NgxGuidesInterface extends MethodInterface<GuidesInterface, VanillaGuides, NgxGuidesComponent> {}
56 changes: 22 additions & 34 deletions packages/preact-guides/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/preact-guides/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "preact-guides",
"version": "0.3.2",
"version": "0.4.1",
"description": "A Preact Guides component that can draw ruler and manage guidelines.",
"main": "./dist/guides.cjs.js",
"module": "./dist/guides.esm.js",
Expand Down Expand Up @@ -46,7 +46,7 @@
"typescript": "^3.4.5"
},
"dependencies": {
"@scena/react-guides": "^0.3.1",
"@scena/react-guides": "^0.4.1",
"preact-css-styled": "^0.1.2",
"preact-ruler": "^0.2.1"
},
Expand Down
20 changes: 10 additions & 10 deletions packages/react-compat-guides/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 96a96c5

Please sign in to comment.