ag-grid-polymer
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -16,4 +16,4 @@ var gulp = require('gulp'); | ||
function tscWebMake() { | ||
webmake('./lib/AgGridPolymer.js', { | ||
output: './lib/AgGridPolymer.web.js', | ||
webmake('./lib/sample/my-grid.js', { | ||
output: './lib/sample/my-grid.web.js', | ||
sourceMap: true, | ||
@@ -20,0 +20,0 @@ cache: false |
@@ -1,2 +0,2 @@ | ||
// ag-grid-polymer v0.0.1 | ||
// ag-grid-polymer v0.0.5 | ||
/// <reference path="../../polymer-ts/polymer-ts.d.ts" /> | ||
@@ -3,0 +3,0 @@ import { GridOptions } from 'ag-grid/main'; |
@@ -1,2 +0,2 @@ | ||
// ag-grid-polymer v0.0.1 | ||
// ag-grid-polymer v0.0.5 | ||
"use strict"; | ||
@@ -100,4 +100,6 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
AgGridPolymer.prototype.detached = function () { | ||
if (this._initialised) | ||
if (this._initialised) { | ||
this.gridOptions.api.destroy(); | ||
this._initialised = false; | ||
} | ||
}; | ||
@@ -104,0 +106,0 @@ AgGridPolymer.prototype.attributeChanged = function (attrName, oldVal, newVal) { |
export * from './lib/AgGridPolymer'; | ||
export * from './lib/features/AgGridFeature'; | ||
export * from './lib/features/ThemeFeature'; | ||
export * from './lib/features/CLIFeature'; | ||
export * from './lib/features/CLITransportationOptionsFeature'; | ||
export * from './lib/features/CLIDOMConsoleOptionsFeature'; | ||
export * from './lib/features/CLIShowHideColumnsFeature'; | ||
export * from './lib/features/CLIRowSelectionFeature'; | ||
export * from './lib/behaviours/EnterpriseBehaviour'; | ||
export * from './lib/behaviours/ThemeBehaviour'; | ||
export * from './lib/behaviours/CLIBehaviour'; | ||
export * from './lib/behaviours/CLITransportationBehaviour'; | ||
export * from './lib/behaviours/CLIDOMConsoleBehaviour'; | ||
export * from './lib/behaviours/CLIShowHideColumnsBehaviour'; | ||
export * from './lib/behaviours/CLIRowSelectionBehaviour'; |
14
main.js
exports.AgGridPolymer = require('./lib/AgGridPolymer').AgGridPolymer; | ||
exports.AgGridFeature = require('./lib/features/AgGridFeature').AgGridFeature; | ||
exports.ThemeFeature = require('./lib/features/ThemeFeature').ThemeFeature; | ||
exports.CLIFeature = require('./lib/features/CLIFeature').CLIFeature | ||
exports.CLITransportationOptionsFeature = require('./lib/features/CLITransportationOptionsFeature').CLITransportationOptionsFeature | ||
exports.CLIDOMConsoleOptionsFeature = require('./lib/features/CLIDOMConsoleOptionsFeature').CLIDOMConsoleOptionsFeature | ||
exports.CLIShowHideColumnsFeature = require('./lib/features/CLIShowHideColumnsFeature').CLIShowHideColumnsFeature | ||
exports.CLIRowSelectionFeature = require('./lib/features/CLIRowSelectionFeature').CLIRowSelectionFeature | ||
exports.EnterpriseBehaviour = require('./lib/behaviours/EnterpriseBehaviour').EnterpriseBehaviour; | ||
exports.ThemeBehaviour = require('./lib/behaviours/ThemeBehaviour').ThemeBehaviour; | ||
exports.CLIBehaviour = require('./lib/behaviours/CLIBehaviour').CLIBehaviour | ||
exports.CLITransportationBehaviour = require('./lib/behaviours/CLITransportationBehaviour').CLITransportationBehaviour | ||
exports.CLIDOMConsoleBehaviour = require('./lib/behaviours/CLIDOMConsoleBehaviour').CLIDOMConsoleBehaviour | ||
exports.CLIShowHideColumnsBehaviour = require('./lib/behaviours/CLIShowHideColumnsBehaviour').CLIShowHideColumnsBehaviour | ||
exports.CLIRowSelectionBehaviour = require('./lib/behaviours/CLIRowSelectionBehaviour').CLIRowSelectionBehaviour |
{ | ||
"name": "ag-grid-polymer", | ||
"description": "ag-Grid Polymer Component", | ||
"version": "0.0.4", | ||
"description": "ag-Grid Polymer Element", | ||
"version": "0.0.5", | ||
"author": { | ||
@@ -10,11 +10,10 @@ "name": "Alexander Mazuruk" | ||
"main": "main.js", | ||
"dependencies": { | ||
"Polymer": "1.4.0", | ||
"dependencies": { | ||
"Polymer": "^1.4.0", | ||
"polymer-ts": "0.1.26", | ||
"ag-grid": "4.0.5" | ||
}, | ||
"optionalDependencies": { | ||
"ag-grid": "4.0.5", | ||
"ag-grid-enterprise": "4.0.7" | ||
}, | ||
"devDependencies": { | ||
"webcomponentsjs": "1.0.2", | ||
"webmake": "^0.3.40", | ||
@@ -24,3 +23,3 @@ "gulp": "3.9.1", | ||
"gulp-typescript": "2.13.0", | ||
"typescript": "1.8.10", | ||
"typescript": "1.8.10", | ||
"merge2": "1.0.2" | ||
@@ -33,8 +32,16 @@ }, | ||
"table", | ||
"element", | ||
"polymer" | ||
], | ||
"maintainers": [ | ||
{ | ||
"name": "kpaxian", | ||
"email": "leybniz@gmail.com" | ||
} | ||
], | ||
"directories": {}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "echo \"Error: no test specified yet\" && exit 1", | ||
"gulp": "gulp" | ||
} | ||
} |
175
README.md
@@ -0,12 +1,171 @@ | ||
# Ag-Grid Polymer Element | ||
ag-Grid Polymer Component | ||
========================= | ||
Use Ag-grid.com as Polymer Element. | ||
This project contains ag-Grid as Polymer Component. | ||
# Table of contents | ||
Building | ||
======== | ||
- [Installation](#install) | ||
- [Supported behaviours](#behaviours) | ||
- [Sample](#sample) | ||
To build: | ||
- 'npm install' | ||
- 'gulp' | ||
# Installation <a name="install"></a> | ||
Install via npm: | ||
``` | ||
npm install -g ag-grid-polymer | ||
``` | ||
You'll get the following files in `node_modules/ag-grid-polymer/src`: | ||
- `AgGridPolymer.ts` the base class for own/custom grid configurations | ||
- `behaviours` the folder contains behaviour classes to compliment grid configuration classes via @behaviour decorator | ||
- `sample` the folder contains example of simple usage of the AgGridPolymer class, to build your own grid element | ||
To Install all needed dependencies: | ||
``` | ||
cd .\ag-grid-polymer | ||
npm install | ||
``` | ||
# Supported behaviours <a name="behaviours"></a> | ||
- ThemeBehaviour - let's you load grid css files in runtime, provides easy to use grid element attribute "theme", value can be one of ['blue', 'dark', 'fresh'] | ||
- EnterpriseBehaviour - let's you specify which version of Ag-grid this should be, basic or Enterprise. Provides easy to use grid element attribute "enterprise" value can be one of ['true', 'false'] | ||
- CLIBehaviour - is used to add "Smart" Command Line text Input control above Grid header and manipulate grids's content via keyboard only. Extendable by other behaviours providing command line options to choose from. | ||
- CLIRowSelectionBehaviour - adds grid rows selection options to the command line interface | ||
- CLIShowHideColumnsBehaviour - adds grid columns show/hide options to the command line interface | ||
# Sample grid element configuration <a name="sample"></a> | ||
'src/sample' folder contains an example of the basic Grid element usage pattern. | ||
'src/sample/index.html' contains: | ||
```HTML | ||
<html> | ||
<head> | ||
<title>Ag-Grid Polymer Element Sample</title> | ||
<!-- Polymer stuff --> | ||
<script src="../../node_modules/webcomponentsjs/lite.js"></script> | ||
<link rel="import" href="../../node_modules/Polymer/polymer.html"> | ||
<link rel="import" href="../../node_modules/polymer-ts/polymer-ts.min.html"> | ||
<!-- Custom Polymer Grid Elements --> | ||
<link rel="import" href="../../lib/sample/grid-components.html"> | ||
</head> | ||
<body> | ||
<!-- Example of a Command Line interfaced Grid configuration, | ||
Use command line in the Grid header to type some text commands | ||
feel free to Select rows, show/hide columns via Keyboard commands, easy fast elegant (: --> | ||
<my-cli-grid | ||
theme="blue" | ||
styles="../../node_modules/ag-grid/dist/styles/" | ||
enterprise="true" | ||
debug="false" | ||
rowHeight="22" | ||
rowSelection="multiple" | ||
enableColResize | ||
suppressRowClickSelection> | ||
</my-cli-grid> | ||
</body> | ||
</html> | ||
``` | ||
Just throw this index.html in your web browser and try to type some text commands in the grid header command line | ||
like "hide column ..., select all rows, select even rows, etc." | ||
Example of the grid configuration provided in the (`src/sample/my-grid.ts`) file: | ||
```TypeScript | ||
/// <reference path="./../../node_modules/polymer-ts/polymer-ts.d.ts" /> | ||
import {AgGridPolymer, | ||
EnterpriseBehaviour, | ||
ThemeBehaviour, | ||
CLIBehaviour, | ||
CLIShowHideColumnsBehaviour, | ||
CLIRowSelectionBehaviour} from 'ag-grid-polymer/main'; | ||
import {GridOptions} from 'ag-grid/main'; | ||
import {RefData} from './dummyData'; | ||
@behavior(EnterpriseBehaviour) | ||
@behavior(ThemeBehaviour) | ||
@behavior(CLIBehaviour) | ||
@behavior(CLIShowHideColumnsBehaviour) | ||
@behavior(CLIRowSelectionBehaviour) | ||
@component("my-cli-grid") | ||
class myGrid extends AgGridPolymer { | ||
protected createOptions():GridOptions { | ||
let result:GridOptions = super.createOptions(); | ||
result.rowData = RefData.FundData; | ||
return result; | ||
} | ||
public getColumnDefinitions():any[] { | ||
return [ | ||
{ | ||
headerName: '#', | ||
width: 30, | ||
checkboxSelection: true, | ||
suppressSorting: true, | ||
suppressSizeToFit: true, | ||
suppressMenu: true, | ||
pinned: true | ||
}, | ||
{ | ||
headerName: '', | ||
field: "flagged" | ||
}, | ||
{ | ||
headerName: 'Notification Date', | ||
field: "notificationDate" | ||
}, | ||
{ | ||
headerName: 'SSI ID', | ||
field: "ssiId" | ||
}, | ||
{ | ||
headerName: 'MP ID', | ||
field: "mpId" | ||
}, { | ||
headerName: 'Bulk ID', | ||
field: "bulkId" | ||
}, | ||
{ | ||
headerName: 'Parent', | ||
field: "parent" | ||
}, | ||
{ | ||
headerName: 'LegalEntity', | ||
field: "legalEntity" | ||
}, | ||
{ | ||
headerName: 'Product', | ||
field: "product" | ||
}, | ||
{ | ||
headerName: 'CCY', | ||
field: "ccy" | ||
}, | ||
{ | ||
headerName: 'Effective Date', | ||
field: "effectiveDate" | ||
}, | ||
{ | ||
headerName: 'Intermediary Bank', | ||
field: "intermediaryBank" | ||
}, | ||
{ | ||
headerName: 'Beneficiary Bank', | ||
field: "beneficiaryBank" | ||
}, | ||
{ | ||
headerName: 'Final Beneficiary Bank', | ||
field: "finalBeneficiaryBank" | ||
}, | ||
]; | ||
} | ||
} | ||
myGrid.register(); | ||
``` |
@@ -12,3 +12,3 @@ /// <reference path="./../../polymer-ts/polymer-ts.d.ts" /> | ||
protected gridOptions:GridOptions = {}; | ||
protected gridOptions:GridOptions = <GridOptions>{}; | ||
@@ -114,4 +114,6 @@ // not intended for user to interact with. so putting _ in so if user gets reference | ||
detached() { | ||
if (this._initialised) | ||
if (this._initialised) { | ||
this.gridOptions.api.destroy(); | ||
this._initialised = false; | ||
} | ||
} | ||
@@ -118,0 +120,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1147647
39
7018
172
7
104
110
+ Addedag-grid-enterprise@4.0.7
+ AddedPolymer@1.6.2(transitive)
- RemovedPolymer@1.4.0(transitive)
UpdatedPolymer@^1.4.0