New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@libria/gridstack

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libria/gridstack

Angular 8 wrapper for gridstack.js

latest
Source
npmnpm
Version
9.0.1
Version published
Weekly downloads
766
-10.93%
Maintainers
1
Weekly downloads
 
Created
Source

lb-gridstack

Angular 9 wrapper for Gridstack.js.

Getting started

npm install @libria/gridstack --save

Then import the library on your root module (AppModule, for instance):

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';


import { AppComponent } from './app.component';
import { GridstackModule } from '@libria/gridstack';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    GridstackModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Since this library is a wrapper for a jquery plugin, you need to define some global plugins and styles.

Using Angular-cli:

  • Add the following to the .angular.json file
{
  ...,
  "apps": [{
    ...
    "styles": [
        "../node_modules/gridstack/dist/gridstack.css",
        ...
    ],
    "scripts": [
        "../node_modules/lodash/lodash.min.js",
        "../node_modules/jquery/dist/jquery.min.js",
        "../node_modules/jquery-ui-dist/jquery-ui.js",
        "../node_modules/gridstack/dist/gridstack.js",
        "../node_modules/gridstack/dist/gridstack.jQueryUI.js",
        ...
    ],
  }]
}

Basic library usage

<div lb-gridstack
     width="5">
    <div lb-gridstack-item
         x="0"
         y="0"
         width="3">
        Widget 1
    </div>
    <div lb-gridstack-item
         x="3"
         y="0"
         width="2">
        Widget 2
    </div>
</div>

Options

All attribute options match the gridstack.js data-gs-* attributes unless explicitly stated.

lb-gridstack

NameDescriptionAdditional Information
optionsgeneral options for the grid. See https://github.com/gridstack/gridstack.js/tree/master/doc#optionsThe option 'acceptWidgets' is not fully supported yet
animateturns animation on-
widthamount of columnsThe library supports up to 24 columns without having to manually change the CSS
heightmaximum rows amount-

lb-gridstack-item

NameDescriptionAdditional Information
idgood for quick identification-
xelement position-
yelement position-
widthelement size-
heightelement size-
max-widthelement size constraint-
max-heightelement size constraint-
min-widthelement size constraint-
min-heightelement size constraint-
no-resizedisable element resizing-
no-movedisable element moving-
auto-positiontells to ignore data-gs-x and data-gs-y attributes and to place element to the first available position-
lockedthe widget will be locked. It means another widget wouldn't be able to move it during dragging or resizing. The widget can still be dragged or resized. You need to add data-gs-no-resize and data-gs-no-move attributes to completely lock the widget.-

FAQs

Package last updated on 23 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts