diff --git a/delete-package-lock.js b/delete-package-lock.js new file mode 100755 index 0000000..5d0c539 --- /dev/null +++ b/delete-package-lock.js @@ -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')); diff --git a/src/angular/package.json b/src/angular/package.json index c65305d..24c272c 100644 --- a/src/angular/package.json +++ b/src/angular/package.json @@ -6,7 +6,8 @@ "build": "ng build", "test": "ng test", "lint": "ng lint", - "e2e": "ng e2e" + "e2e": "ng e2e", + "postinstall": "node ../../delete-package-lock.js" }, "dependencies": { "@angular/animations": "14.0.4", @@ -17,9 +18,9 @@ "@angular/platform-browser": "14.0.4", "@angular/platform-browser-dynamic": "14.0.4", "@angular/router": "14.0.4", - "ag-grid-angular": "31.2.1", - "ag-grid-community": "31.2.1", - "ag-grid-enterprise": "31.2.1", + "ag-grid-angular": "latest", + "ag-grid-community": "latest", + "ag-grid-enterprise": "latest", "rxjs": "7.5.1", "tslib": "^2.3.1", "zone.js": "0.11.4" diff --git a/src/react/package.json b/src/react/package.json index 156acca..e6f9972 100644 --- a/src/react/package.json +++ b/src/react/package.json @@ -4,9 +4,9 @@ "@testing-library/jest-dom": "^5.7.0", "@testing-library/react": "^10.0.4", "@testing-library/user-event": "^10.2.4", - "ag-grid-community": "31.2.1", - "ag-grid-enterprise": "31.2.1", - "ag-grid-react": "31.2.1", + "ag-grid-community": "latest", + "ag-grid-enterprise": "latest", + "ag-grid-react": "latest", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "3.4.1", @@ -16,7 +16,8 @@ "start": "PORT=8080 NODE_OPTIONS=--openssl-legacy-provider react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "postinstall": "node ../../delete-package-lock.js" }, "eslintConfig": { "extends": "react-app" diff --git a/src/theme-builder/.gitignore b/src/theme-builder/.gitignore new file mode 100644 index 0000000..768f32d --- /dev/null +++ b/src/theme-builder/.gitignore @@ -0,0 +1 @@ +styles-compiled.* \ No newline at end of file diff --git a/src/theme-builder/README.md b/src/theme-builder/README.md new file mode 100644 index 0000000..554d62e --- /dev/null +++ b/src/theme-builder/README.md @@ -0,0 +1,9 @@ +# ag-Grid Sass Styling API Example + +
This project demonstrates the Sass styling API using the Sass command line tool to compile Sass to CSS.
+ +## 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. \ No newline at end of file diff --git a/src/theme-builder/package.json b/src/theme-builder/package.json new file mode 100644 index 0000000..14d4a50 --- /dev/null +++ b/src/theme-builder/package.json @@ -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" + } +} \ No newline at end of file diff --git a/src/theme-builder/src/ag-grid-theme-builder.css b/src/theme-builder/src/ag-grid-theme-builder.css new file mode 100644 index 0000000..b588107 --- /dev/null +++ b/src/theme-builder/src/ag-grid-theme-builder.css @@ -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"; +} \ No newline at end of file diff --git a/src/theme-builder/src/grid.js b/src/theme-builder/src/grid.js new file mode 100644 index 0000000..0837bd0 --- /dev/null +++ b/src/theme-builder/src/grid.js @@ -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); \ No newline at end of file diff --git a/src/theme-builder/src/index.html b/src/theme-builder/src/index.html new file mode 100644 index 0000000..5dad365 --- /dev/null +++ b/src/theme-builder/src/index.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + diff --git a/src/theme-builder/webpack.config.js b/src/theme-builder/webpack.config.js new file mode 100644 index 0000000..f4bb202 --- /dev/null +++ b/src/theme-builder/webpack.config.js @@ -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' + }) + ] +}; diff --git a/src/vanilla-webpack/package.json b/src/vanilla-webpack/package.json index ff24c4b..c592243 100644 --- a/src/vanilla-webpack/package.json +++ b/src/vanilla-webpack/package.json @@ -1,13 +1,14 @@ { "private": true, "scripts": { - "start": "webpack-dev-server --open" + "start": "webpack-dev-server --open", + "postinstall": "node ../../delete-package-lock.js" }, "author": "", "license": "ISC", "dependencies": { - "ag-grid-community": "31.2.1", - "ag-grid-enterprise": "31.2.1", + "ag-grid-community": "latest", + "ag-grid-enterprise": "latest", "@fortawesome/fontawesome-free": "5.15.4", "sass": "1.45.2", "sass-loader": "12.4.0", diff --git a/src/vanilla/package.json b/src/vanilla/package.json index 2f5419d..fc11ba6 100644 --- a/src/vanilla/package.json +++ b/src/vanilla/package.json @@ -4,15 +4,16 @@ "start": "npm run sass:build; npm-run-all --parallel sass:watch serve", "sass:build": "sass --load-path node_modules src/styles.scss:src/styles-compiled.css", "sass:watch": "npm run sass:build -- --watch", - "serve": "live-server src --mount=/node_modules:node_modules" + "serve": "live-server src --mount=/node_modules:node_modules", + "postinstall": "node ../../delete-package-lock.js" }, "author": "", "license": "ISC", "dependencies": { "@fortawesome/fontawesome-free": "^6.1.1", - "ag-grid-community": "31.2.1", - "@ag-grid-community/styles": "31.2.1", - "ag-grid-enterprise": "31.2.1", + "ag-grid-community": "latest", + "@ag-grid-community/styles": "latest", + "ag-grid-enterprise": "latest", "live-server": "^1.2.2", "npm-run-all": "^4.1.5", "sass": "^1.51.0" diff --git a/src/vue/package.json b/src/vue/package.json index c49361b..fe3b156 100644 --- a/src/vue/package.json +++ b/src/vue/package.json @@ -3,12 +3,13 @@ "scripts": { "start": "vue-cli-service serve --open --port 8080", "serve": "vue-cli-service serve", - "build": "vue-cli-service build" + "build": "vue-cli-service build", + "postinstall": "node ../../delete-package-lock.js" }, "dependencies": { - "ag-grid-community": "31.2.1", - "ag-grid-enterprise": "31.2.1", - "ag-grid-vue": "31.2.1", + "ag-grid-community": "latest", + "ag-grid-enterprise": "latest", + "ag-grid-vue": "latest", "core-js": "3.17.3", "vue": "2.6.14", "vue-property-decorator": "^8.4.2"