-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test project for Theme Builder
- Loading branch information
1 parent
3e48a62
commit fb41f98
Showing
13 changed files
with
236 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env node | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const del = (file) => { | ||
if (fs.existsSync(file)) { | ||
fs.rmSync(file); | ||
} | ||
} | ||
del('./package-lock.json'); | ||
del(path.join(__dirname, 'package-lock.json')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
styles-compiled.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ag-Grid Sass Styling API Example | ||
|
||
<p>This project demonstrates the Sass styling API using the Sass command line tool to compile Sass to CSS.</p> | ||
|
||
## Usage | ||
|
||
- Run `npm install && npm start` | ||
- The project should automatically open in your browser. If it does not, look at the console messages to find the URL. | ||
- Open `styles.scss`. There are optional sections that you can try uncommenting to try different features of the API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"start": "live-server src --mount=/node_modules:node_modules", | ||
"postinstall": "node ../../delete-package-lock.js" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"ag-grid-community": "latest", | ||
"ag-grid-enterprise": "latest", | ||
"live-server": "^1.2.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
/* | ||
This project is for testing the exported CSS of the AG Grid Theme Builder. | ||
Export a CSS file from the Theme Builder and replace the content of this file with it. | ||
*/ | ||
|
||
|
||
body::before { | ||
display: block; | ||
font-size: 40px; | ||
max-width: 800px; | ||
margin: 50px; | ||
content: "To test a Theme Builder export, replace the content of the file ag-grid-theme-builder.css with the CSS exported from the Theme Builder"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
// create cols, one for each letter | ||
var columnDefs = [{ | ||
headerName: 'Country', | ||
field: 'country', | ||
enableRowGroup: true, | ||
filter: true, | ||
width: 200, | ||
rowDrag: true | ||
}].concat('ABCDEFG'.split('').map(letter => ({ field: letter }))); | ||
|
||
columnDefs[0].checkboxSelection = true; | ||
|
||
// create 100 rows, and fill with random numbers | ||
var rowData = []; | ||
var countries = ['United Kingdom', 'Ireland', 'United States', 'India', 'Brazil', 'China', 'Russia']; | ||
|
||
for (var i = 0; i < 100; i++) { | ||
var item = {}; | ||
|
||
item.country = countries[i % countries.length]; | ||
|
||
for (var j = 1; j < columnDefs.length; j++) { | ||
var colDef = columnDefs[j]; | ||
item[colDef.field] = Math.floor(Math.random() * 100000); | ||
} | ||
|
||
rowData.push(item); | ||
} | ||
|
||
var gridOptions = { | ||
// we do not hide the menu icons, so easier to see any style changes that impact the icons | ||
suppressMenuHide: true, | ||
|
||
defaultColDef: { | ||
// make all cols more narrow | ||
width: 100, | ||
filter: 'number', | ||
sortable: true, | ||
resizable: true | ||
}, | ||
enableCharts: true, | ||
animateRows: true, | ||
// enable these, so they can be demonstrated | ||
enableRangeSelection: true, | ||
rowDragManaged: true, | ||
rowGroupPanelShow: 'always', | ||
pivotPanelShow: 'always', | ||
pivotColumnGroupTotals: 'before', | ||
pivotRowTotals: 'before', | ||
sideBar: { | ||
toolPanels: [ | ||
{ | ||
id: 'columns', | ||
labelDefault: 'Columns', | ||
labelKey: 'columns', | ||
iconKey: 'columns', | ||
toolPanel: 'agColumnsToolPanel' | ||
}, | ||
{ | ||
id: 'filters', | ||
labelDefault: 'Filters', | ||
labelKey: 'filters', | ||
iconKey: 'filter', | ||
toolPanel: 'agFiltersToolPanel' | ||
} | ||
], | ||
defaultToolPanel: 'filters' | ||
}, | ||
|
||
columnDefs: columnDefs, | ||
rowData: rowData, | ||
enableFillHandle: true, | ||
rowSelection: 'multiple' | ||
}; | ||
|
||
new agGrid.Grid(document.querySelector('#myGrid'), gridOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="ag-grid-theme-builder.css"> | ||
<script> | ||
function setDarkMode(on) { | ||
if (on) { | ||
document.body.classList.add("dark"); | ||
document.getElementById("myGrid").className = "ag-theme-custom-dark"; | ||
} else { | ||
document.body.classList.remove("dark"); | ||
document.getElementById("myGrid").className = "ag-theme-custom"; | ||
} | ||
} | ||
</script> | ||
<style> | ||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100%; | ||
} | ||
|
||
#myGrid { | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="myGrid"></div> | ||
<script src="https://unpkg.com/ag-grid-community/dist/ag-grid-community.min.noStyle.js"></script> | ||
<script src="https://unpkg.com/ag-grid-enterprise/dist/ag-grid-enterprise.min.noStyle.js"></script> | ||
<script src="grid.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// config/webpack.dev.js | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
|
||
module.exports = { | ||
mode: 'none', | ||
entry: './grid.js', | ||
devtool: 'eval-cheap-module-source-map', | ||
|
||
output: { | ||
filename: 'bundle.js' | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
loader: 'ts-loader' | ||
}, | ||
{ | ||
test: /\.html$/, | ||
loader: 'html-loader' | ||
}, | ||
{ | ||
test: /\.scss$/, | ||
use: [ | ||
'style-loader', | ||
{ | ||
loader: 'css-loader', | ||
options: { | ||
sourceMap: true | ||
} | ||
}, | ||
'resolve-url-loader', | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sourceMap: true | ||
} | ||
} | ||
] | ||
}, | ||
] | ||
}, | ||
|
||
plugins: [ | ||
new HtmlWebpackPlugin({ | ||
template: 'index.html' | ||
}) | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters