All Projects → swiety85 → Angular2gridster

swiety85 / Angular2gridster

Licence: mit
Angular implementation of well known Gridster (no jQuery, no external libraries, only Angular and Rx.js).

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Angular2gridster

Ngx Datatable
✨ A feature-rich yet lightweight data-table crafted for Angular
Stars: ✭ 4,415 (+2248.4%)
Mutual labels:  grid, angular2
ui-grid-angular2
ui-grid in Angular 2
Stars: ✭ 35 (-81.38%)
Mutual labels:  grid, angular2
ngx-widget-grid
Angular 2.x or in general ng-x module for dashboards
Stars: ✭ 65 (-65.43%)
Mutual labels:  grid, angular2
Angular Generic Table
A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
Stars: ✭ 100 (-46.81%)
Mutual labels:  grid, angular2
Ng2 Nouislider
Angular2 noUiSlider directive
Stars: ✭ 181 (-3.72%)
Mutual labels:  angular2
Augury
Angular Debugging and Visualization Tools
Stars: ✭ 2,050 (+990.43%)
Mutual labels:  angular2
Angular Notifier
A well designed, fully animated, highly customizable, and easy-to-use notification library for your Angular application.
Stars: ✭ 175 (-6.91%)
Mutual labels:  angular2
Ngx Inline Editor
Native UI Inline-editor Angular (4.0+) component
Stars: ✭ 172 (-8.51%)
Mutual labels:  angular2
Graaf
A collection of pure CSS grids for designing your new projects
Stars: ✭ 186 (-1.06%)
Mutual labels:  grid
Bs grid
Bootstrap Datagrid
Stars: ✭ 184 (-2.13%)
Mutual labels:  grid
Grid
This package has moved and renamed
Stars: ✭ 2,079 (+1005.85%)
Mutual labels:  grid
Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (+1054.26%)
Mutual labels:  grid
Angular2 Login Seed
(deprecated) Seed app w/ Angular2, Node, Express, and OAuth login
Stars: ✭ 181 (-3.72%)
Mutual labels:  angular2
Angular Handsontable
Angular Data Grid with Spreadsheet Look & Feel. Official Angular wrapper for Handsontable.
Stars: ✭ 175 (-6.91%)
Mutual labels:  grid
Blazor.flexgrid
GridView component for Blazor
Stars: ✭ 185 (-1.6%)
Mutual labels:  grid
Angular Truffle Starter Dapp
Angular CLI + Truffle Starter Dapp; write, compile & deploy smart contracts on Ethereum blockchains
Stars: ✭ 174 (-7.45%)
Mutual labels:  angular2
Angular2 Hotkeys
Keyboard shortcuts for Angular 2 apps
Stars: ✭ 179 (-4.79%)
Mutual labels:  angular2
Rdash Angular2
RDash admin dashboard theme /w AngularJS2 & TypeScript
Stars: ✭ 184 (-2.13%)
Mutual labels:  angular2
Ngx Socket Io
Socket.IO module for Angular
Stars: ✭ 178 (-5.32%)
Mutual labels:  angular2
Ngx Wig
Angular(...Angular 7, Angular 8, Angular 9, Angular 10, Angular 11) WYSIWYG HTML Rich Text Editor (from ngWig - https://github.com/stevermeister/ngWig)
Stars: ✭ 178 (-5.32%)
Mutual labels:  angular2

angular2gridster

npm version

Angular implementation of well known Gridster (no jQuery, no external libraries, only Angular and Rx.js). Demo.

  1. Getting started
  2. What is Angular2gridster and why to use it?
  3. API Documentation
  4. Roadmap

More comprehensive documentation is available in Wiki.

Development progress can be tracked in Milestones and in Project board.

Versions:

  • Version 9.x works with Angular 9.x.
  • Version 8.x works with Angular 8.x.
  • Version 7.x works with Angular 7.x.
  • Version 6.x works with Angular 6.x.
  • Version 5.x works with Angular 5.x.
  • Version 4.x works with Angular 4.x.

Versions 1.x and 0.x works only with Angular 4.x, but the newest states you can find in v4.x.

Installation

npm install angular2gridster

Once installed you need to import our module:

...
import { GridsterModule } from 'angular2gridster';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    ...
    GridsterModule.forRoot() // .forRoot() is required since version v4+
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

The example it imports in AppModule, but it could also be imported in any other module - depends where you want to use it.

Additional steps for System.js

To make Angular2gridster works with System.js you need to provide dedicated configuration in systemjs.config.js. It requires change in map object and 'packages' as follows:

System.config({
    map: {
        // ...
        rxjs: 'node_modules/rxjs',
        angular2gridster: 'node_modules/angular2gridster',
    },
    packages: {
        // ...
        rxjs: {defaultExtension: 'js'},
        angular2gridster: {main: 'dist/index.js', defaultExtension: 'js'},
    },
});

Example usage

<ngx-gridster [options]="gridsterOptions" [draggableOptions]="{ handlerClass: 'panel-heading' }">
    <ngx-gridster-item
        *ngFor="let widget of widgets"
        [(x)]="widget.x"
        [(y)]="widget.y"
        [(w)]="widget.w"
        [(h)]="widget.h"
    >
        <!-- some content -->
    </ngx-gridster-item>
</ngx-gridster>

For version before 6.0.0:

<gridster [options]="gridsterOptions" [draggableOptions]="{ handlerClass: 'panel-heading' }">
    <gridster-item
        *ngFor="let widget of widgets"
        [(x)]="widget.x"
        [(y)]="widget.y"
        [(w)]="widget.w"
        [(h)]="widget.h"
    >
        <!-- some content -->
    </gridster-item>
</gridster>
widgets: Array<any> = [...];
gridsterOptions = {
  lanes: 2, // how many lines (grid cells) dashboard has
  direction: 'vertical', // items floating direction: vertical/horizontal/none
  floating: false, // default=true - prevents items to float according to the direction (gravity)
  dragAndDrop: false, // possible to change items position by drag n drop
  resizable: false, // possible to resize items by drag n drop by item edge/corner
  useCSSTransforms: true, // Uses CSS3 translate() instead of position top/left - significant performance boost.
  responsiveSizes: true, // allow to set different item sizes for different breakpoints
  // ResponsiveOptions can overwrite default configuration with any option available for specific breakpoint.
  responsiveOptions: [
        {
            breakpoint: 'sm',
            lanes: 3
        },
        {
            breakpoint: 'md',
            minWidth: 768,
            lanes: 4,
            dragAndDrop: true,
            resizable: true
        },
        {
            breakpoint: 'lg',
            lanes: 6,
            dragAndDrop: true,
            resizable: true
        },
        {
            breakpoint: 'xl',
            minWidth: 1800,
            lanes: 8,
            dragAndDrop: true,
            resizable: true
        }
    ]
};

Warning

If you use responsiveOptions, then item coords will be assigned to different breakpoint attributes:

  • till sm (480px), it uses x and y attributes
  • sm (480px - 768px), it uses xSm and ySm attributes
  • md (768px - 1250px), it uses xMd and yMd attributes
  • lg (1250px - 1800px), it uses xLg and yLg attributes
  • from xl (1800px), it uses xXl and yXl attributes

(widths in px are only example and works for `responsiveOptions in example above).

If you set responsiveSizes: true, item size can be different for different breakpoints. In this case size will be binded to following attributes:

  • till sm (480px), it uses w and h attributes
  • sm (480px - 768px), it uses wSm and hSm attributes
  • md (768px - 1250px), it uses wMd and hMd attributes
  • lg (1250px - 1800px), it uses wLg and hLg attributes
  • from xl (1800px), it uses wXl and hXl attributes

Demo

Clone or download this repository and just run:

npm i
npm run build
npm start

Go to: http://localhost:4200/

Compilation problems

If somebody will have compilation problems please add an issue (if not yet created). I will try to fix it as soon as possible. Angular compiler has still some issues opened and it is changing frequently.

As a temporary solution copy files from /projects/angular2gridster/src/lib folder to dedicated folder in your project.

Issues

If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via CodeSandbox:

Edit Angular

The project is in development so don't hesitate to writte any questions or suggestion on issue list. I look forward to get a response from you.

Origin

This project was created on idea of GridList. Great alternative for Gridster.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].