Skip to content

Commit

Permalink
Merge branch 'feat/dataview-apply-row-selections-all-pages' of https:…
Browse files Browse the repository at this point in the history
…//github.com/ghiscoding/slickgrid-universal into feat/dataview-apply-row-selections-all-pages
  • Loading branch information
ghiscoding committed Feb 4, 2023
2 parents 53778af + 03c8a4b commit 5080fc2
Show file tree
Hide file tree
Showing 33 changed files with 546 additions and 329 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:

steps:
- name: Check out repository
uses: actions/checkout@master
uses: actions/checkout@v3

- name: Use latest version of Node.js
uses: actions/setup-node@master
uses: actions/setup-node@v3
with:
node-version: "*"

Expand All @@ -41,14 +41,14 @@ jobs:

- run: pnpm --version

- name: TSC Build (cjs)
- name: TSC Build (esm)
run: pnpm build

- name: Website Prod Build (GitHub demo site)
run: pnpm build:demo

- name: Run Cypress E2E tests
uses: cypress-io/github-action@v2
uses: cypress-io/github-action@v5
with:
install: false
# working-directory: packages/dnd
Expand All @@ -57,7 +57,6 @@ jobs:
config-file: test/cypress.config.ts
browser: chrome
record: true
headless: true
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{
"label": "Start Library Development",
"type": "shell",
"command": "pnpm dev:watch",
"command": "pnpm dev",
"problemMatcher": []
},
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ and is written in plain TypeScript without being bound to any framework. The imp
It could be used as a guideline to implement it for other framework ports.

```bash
pnpm run dev:watch
pnpm run dev
```

### Tests
Expand Down
4 changes: 2 additions & 2 deletions examples/webpack-demo-vanilla-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
"html-loader": "^4.2.0",
"html-webpack-plugin": "5.5.0",
"mini-css-extract-plugin": "^2.7.2",
"sass": "^1.57.1",
"sass": "^1.58.0",
"sass-loader": "^13.2.0",
"style-loader": "^3.3.1",
"typescript": "^4.9.4",
"typescript": "^4.9.5",
"url-loader": "^4.1.1",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@slickgrid-universal/common';
import { ExcelExportService } from '@slickgrid-universal/excel-export';
import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle';
import * as DOMPurify from 'dompurify';
import DOMPurify from 'dompurify';

import { TranslateService } from '../translate.service';
import { ExampleGridOptions } from './example-grid-options';
Expand Down
2 changes: 1 addition & 1 deletion examples/webpack-demo-vanilla-bundle/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = ({ production } = {}) => ({
resolve: {
extensions: ['.ts', '.js'],
modules: [srcDir, 'node_modules'],
mainFields: ['browser', 'module', 'main'],
mainFields: ['module', 'main'],
fallback: {
http: false,
https: false,
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"loglevel": "info",
"command": {
"publish": {
"cleanupTempFiles": true,
"removePackageFields": [
"browser",
"devDependencies",
"scripts"
]
Expand Down
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
"clean": "rimraf --maxBusyTries=10 packages/*/dist dist",
"cypress": "cypress open --config-file test/cypress.config.ts",
"cypress:ci": "cypress run --config-file test/cypress.config.ts",
"dev": "cross-env TSC_WATCHFILE=UseFsEventsWithFallbackDynamicPolling pnpm -r --parallel run dev:watch",
"dev:watch": "run-p dev sass:watch",
"sass:watch": "lerna watch --scope=@slickgrid-universal/common --glob=\"src/**/*.scss\" -- cross-env-shell pnpm run -r --filter $LERNA_PACKAGE_NAME sass:copy",
"predev": "pnpm run -r build:incremental && pnpm run -r sass:copy",
"dev": "run-p dev:watch build:watch sass:copy:watch",
"build:watch": "lerna watch --glob=\"src/**/*.ts\" --ignored=\"src/**/*.spec.ts\" --stream -- cross-env-shell pnpm run -r --filter $LERNA_PACKAGE_NAME build:incremental",
"dev:watch": "pnpm -r --parallel run dev:watch",
"sass:copy:watch": "lerna watch --scope=@slickgrid-universal/common --glob=\"src/**/*.scss\" -- cross-env-shell pnpm run -r --filter $LERNA_PACKAGE_NAME sass:copy",
"preview:publish": "lerna publish from-package --dry-run",
"preview:version": "lerna version --dry-run",
"preview:roll-new-release": "pnpm bundle && pnpm new-version --dry-run && pnpm new-publish --dry-run",
Expand All @@ -48,16 +50,16 @@
"devDependencies": {
"@4tw/cypress-drag-drop": "^2.2.3",
"@jest/types": "^29.4.1",
"@lerna-lite/cli": "^1.14.2",
"@lerna-lite/run": "^1.14.2",
"@lerna-lite/watch": "^1.14.2",
"@lerna-lite/cli": "^1.15.0",
"@lerna-lite/run": "^1.15.0",
"@lerna-lite/watch": "^1.15.0",
"@types/jest": "^29.4.0",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"cross-env": "^7.0.3",
"cypress": "^12.4.1",
"eslint": "^8.32.0",
"cypress": "^12.5.1",
"eslint": "^8.33.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prefer-arrow": "^1.2.3",
"jest": "^29.4.1",
Expand All @@ -69,18 +71,18 @@
"jsdom-global": "^3.0.2",
"moment-mini": "^2.29.4",
"npm-run-all2": "^6.0.4",
"pnpm": "^7.26.0",
"pnpm": "^7.26.3",
"rimraf": "^3.0.2",
"rxjs": "^7.5.7",
"serve": "^14.2.0",
"slickgrid": "^3.0.3",
"sortablejs": "^1.15.0",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.4",
"typescript": "^4.9.5",
"whatwg-fetch": "^3.6.2"
},
"packageManager": "[email protected].0",
"packageManager": "[email protected].3",
"engines": {
"node": ">=14.17.0",
"npm": ">=6.14.13"
Expand Down
23 changes: 17 additions & 6 deletions packages/binding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@
"version": "2.3.0",
"description": "Simple Vanilla Implementation of a Binding Engine & Helper to add properties/events 2 way bindings",
"main": "dist/commonjs/index.js",
"browser": "src/index.ts",
"module": "dist/esm/index.js",
"types": "dist/commonjs/index.d.ts",
"typings": "dist/commonjs/index.d.ts",
"exports": {
".": {
"browser": "./dist/esm/index.js",
"import": "./dist/esm/index.d.ts",
"require": "./dist/commonjs/index.js"
},
"./*": "./*"
},
"typesVersions": {
"*": {
"*": ["./dist/esm/index.d.ts"]
}
},
"types": "dist/esm/index.d.ts",
"publishConfig": {
"access": "public"
},
Expand All @@ -15,11 +26,11 @@
],
"scripts": {
"prebuild": "pnpm run clean",
"build": "pnpm run bundle:commonjs",
"build": "pnpm run bundle:esm",
"build:incremental": "tsc --incremental",
"build:watch": "tsc --incremental --watch",
"clean": "rimraf --maxBusyTries=10 packages/*/dist dist",
"clean": "rimraf dist",
"dev": "pnpm run bundle:commonjs",
"dev:watch": "tsc --incremental --watch",
"prebundle": "pnpm run clean",
"bundle": "run-p bundle:commonjs bundle:esm",
"bundle:commonjs": "tsc --project tsconfig.bundle.json --outDir dist/commonjs --module commonjs",
Expand Down
4 changes: 3 additions & 1 deletion packages/binding/src/binding.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable no-bitwise */
import * as DOMPurify from 'dompurify';
import * as DOMPurify_ from 'dompurify';
const DOMPurify = ((DOMPurify_ as any)?.['default'] ?? DOMPurify_); // patch for rollup

import { Binding, BoundedEventWithListener, ElementBinding, ElementBindingWithListener } from './interfaces';

/**
Expand Down
28 changes: 20 additions & 8 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@
"version": "2.3.0",
"description": "SlickGrid-Universal Common Code",
"main": "dist/commonjs/index.js",
"browser": "src/index.ts",
"module": "dist/esm/index.js",
"types": "dist/commonjs/index.d.ts",
"typings": "dist/commonjs/index.d.ts",
"exports": {
".": {
"browser": "./dist/esm/index.js",
"import": "./dist/esm/index.d.ts",
"require": "./dist/commonjs/index.js"
},
"./*": "./*"
},
"typesVersions": {
"*": {
"*": ["./dist/esm/index.d.ts"]
}
},
"types": "dist/esm/index.d.ts",
"license": "MIT",
"author": "Ghislain B.",
"homepage": "https://github.com/ghiscoding/slickgrid-universal",
Expand All @@ -26,12 +37,13 @@
],
"scripts": {
"prebuild": "pnpm run clean",
"build": "pnpm run bundle:commonjs",
"build": "pnpm run bundle:esm",
"postbuild": "run-s sass:build sass:copy",
"build:incremental": "tsc --incremental",
"build:watch": "tsc --incremental --watch",
"clean": "rimraf --maxBusyTries=10 packages/*/dist dist",
"dev": "run-s build sass:build sass:copy",
"dev:watch": "run-p build:watch sass:watch",
"clean": "rimraf dist",
"dev": "run-s bundle:commonjs sass:copy",
"dev:watch": "pnpm run sass:watch",
"prebundle": "pnpm run clean",
"bundle": "run-p bundle:commonjs bundle:esm",
"postbundle": "run-s sass:build sass:copy",
Expand Down Expand Up @@ -85,7 +97,7 @@
"postcss": "^8.4.21",
"postcss-cli": "^10.1.0",
"rimraf": "^3.0.2",
"sass": "^1.57.1"
"sass": "^1.58.0"
},
"engines": {
"node": ">=14.17.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/editorValidators/floatValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ export function floatValidator(inputValue: any, options: FloatValidatorOptions):
// when decimal value is 0 (which is the default), we accept 0 or more decimal values
isValid = false;
outputMsg = errorMsg || Constants.VALIDATION_EDITOR_VALID_NUMBER;
} else if (minValue !== undefined && maxValue !== undefined && floatNumber !== null && ((operatorConditionalType === 'exclusive' && (floatNumber <= minValue || floatNumber >= maxValue)) || (operatorConditionalType === 'inclusive' && (floatNumber < minValue || floatNumber > maxValue)))) {
} else if (minValue !== undefined && maxValue !== undefined && floatNumber !== null && ((operatorConditionalType === 'exclusive' && (floatNumber <= +minValue || floatNumber >= +maxValue)) || (operatorConditionalType === 'inclusive' && (floatNumber < +minValue || floatNumber > +maxValue)))) {
// MIN & MAX Values provided
// when decimal value is bigger than 0, we only accept the decimal values as that value set
// for example if we set decimalPlaces to 2, we will only accept numbers between 0 and 2 decimals
isValid = false;
outputMsg = errorMsg || Constants.VALIDATION_EDITOR_NUMBER_BETWEEN.replace(/{{minValue}}|{{maxValue}}/gi, (matched) => (mapValidation as any)[matched]);
} else if (minValue !== undefined && floatNumber !== null && ((operatorConditionalType === 'exclusive' && floatNumber <= minValue) || (operatorConditionalType === 'inclusive' && floatNumber < minValue))) {
} else if (minValue !== undefined && floatNumber !== null && ((operatorConditionalType === 'exclusive' && floatNumber <= +minValue) || (operatorConditionalType === 'inclusive' && floatNumber < +minValue))) {
// MIN VALUE ONLY
// when decimal value is bigger than 0, we only accept the decimal values as that value set
// for example if we set decimalPlaces to 2, we will only accept numbers between 0 and 2 decimals
isValid = false;
const defaultErrorMsg = operatorConditionalType === 'inclusive' ? Constants.VALIDATION_EDITOR_NUMBER_MIN_INCLUSIVE : Constants.VALIDATION_EDITOR_NUMBER_MIN;
outputMsg = errorMsg || defaultErrorMsg.replace(/{{minValue}}/gi, (matched) => (mapValidation as any)[matched]);
} else if (maxValue !== undefined && floatNumber !== null && ((operatorConditionalType === 'exclusive' && floatNumber >= maxValue) || (operatorConditionalType === 'inclusive' && floatNumber > maxValue))) {
} else if (maxValue !== undefined && floatNumber !== null && ((operatorConditionalType === 'exclusive' && floatNumber >= +maxValue) || (operatorConditionalType === 'inclusive' && floatNumber > +maxValue))) {
// MAX VALUE ONLY
// when decimal value is bigger than 0, we only accept the decimal values as that value set
// for example if we set decimalPlaces to 2, we will only accept numbers between 0 and 2 decimals
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/editorValidators/integerValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ export function integerValidator(inputValue: any, options: IntegerValidatorOptio
} else if (inputValue !== '' && ((isNaN(inputValue as number) || !/^[+-]?\d+$/.test(inputValue)))) {
isValid = false;
outputMsg = errorMsg || Constants.VALIDATION_EDITOR_VALID_INTEGER;
} else if (minValue !== undefined && maxValue !== undefined && intNumber !== null && ((operatorConditionalType === 'exclusive' && (intNumber <= minValue || intNumber >= maxValue)) || (operatorConditionalType === 'inclusive' && (intNumber < minValue || intNumber > maxValue)))) {
} else if (minValue !== undefined && maxValue !== undefined && intNumber !== null && ((operatorConditionalType === 'exclusive' && (intNumber <= +minValue || intNumber >= +maxValue)) || (operatorConditionalType === 'inclusive' && (intNumber < +minValue || intNumber > +maxValue)))) {
// MIN & MAX Values provided (between)
// when decimal value is bigger than 0, we only accept the decimal values as that value set
// for example if we set decimalPlaces to 2, we will only accept numbers between 0 and 2 decimals
isValid = false;
outputMsg = errorMsg || Constants.VALIDATION_EDITOR_INTEGER_BETWEEN.replace(/{{minValue}}|{{maxValue}}/gi, (matched) => (mapValidation as any)[matched]);
} else if (minValue !== undefined && intNumber !== null && ((operatorConditionalType === 'exclusive' && intNumber <= minValue) || (operatorConditionalType === 'inclusive' && intNumber !== null && intNumber < minValue))) {
} else if (minValue !== undefined && intNumber !== null && ((operatorConditionalType === 'exclusive' && intNumber <= +minValue) || (operatorConditionalType === 'inclusive' && intNumber !== null && intNumber < +minValue))) {
// MIN VALUE ONLY
// when decimal value has to be higher then provided minValue
isValid = false;
const defaultErrorMsg = operatorConditionalType === 'inclusive' ? Constants.VALIDATION_EDITOR_INTEGER_MIN_INCLUSIVE : Constants.VALIDATION_EDITOR_INTEGER_MIN;
outputMsg = errorMsg || defaultErrorMsg.replace(/{{minValue}}/gi, (matched) => (mapValidation as any)[matched]);
} else if (maxValue !== undefined && intNumber !== null && ((operatorConditionalType === 'exclusive' && intNumber >= maxValue) || (operatorConditionalType === 'inclusive' && intNumber !== null && intNumber > maxValue))) {
} else if (maxValue !== undefined && intNumber !== null && ((operatorConditionalType === 'exclusive' && intNumber >= +maxValue) || (operatorConditionalType === 'inclusive' && intNumber !== null && intNumber > +maxValue))) {
// MAX VALUE ONLY
// when decimal value has to be lower then provided maxValue
isValid = false;
Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/services/domUtilities.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { deepMerge } from '@slickgrid-universal/utils';
import * as DOMPurify_ from 'dompurify';
const DOMPurify = ((DOMPurify_ as any)?.['default'] ?? DOMPurify_); // patch for rollup

import * as DOMPurify from 'dompurify';
import { InferDOMType, SearchTerm } from '../enums/index';
import { Column, GridOption, HtmlElementPosition, SelectOption, SlickGrid, } from '../interfaces/index';
import { TranslaterService } from './translater.service';
Expand Down
23 changes: 17 additions & 6 deletions packages/composite-editor-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@
"version": "2.3.0",
"description": "Slick Composite Editor Component - Vanilla Implementation of a Composite Editor Modal Window Component",
"main": "dist/commonjs/index.js",
"browser": "src/index.ts",
"module": "dist/esm/index.js",
"types": "dist/commonjs/index.d.ts",
"typings": "dist/commonjs/index.d.ts",
"exports": {
".": {
"browser": "./dist/esm/index.js",
"import": "./dist/esm/index.d.ts",
"require": "./dist/commonjs/index.js"
},
"./*": "./*"
},
"typesVersions": {
"*": {
"*": ["./dist/esm/index.d.ts"]
}
},
"types": "dist/esm/index.d.ts",
"publishConfig": {
"access": "public"
},
Expand All @@ -15,11 +26,11 @@
],
"scripts": {
"prebuild": "pnpm run clean",
"build": "pnpm run bundle:commonjs",
"build": "pnpm run bundle:esm",
"build:incremental": "tsc --incremental",
"build:watch": "tsc --incremental --watch",
"clean": "rimraf --maxBusyTries=10 packages/*/dist dist",
"clean": "rimraf dist",
"dev": "pnpm run bundle:commonjs",
"dev:watch": "tsc --incremental --watch",
"prebundle": "pnpm run clean",
"bundle": "run-p bundle:commonjs bundle:esm",
"bundle:commonjs": "tsc --project tsconfig.bundle.json --outDir dist/commonjs --module commonjs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export class SlickCompositeEditorComponent implements ExternalResource {
this._modalElm = createDomElement('div', { className: `slick-editor-modal ${gridUid}` });
const modalContentElm = createDomElement('div', { className: 'slick-editor-modal-content' });

if (viewColumnLayout > 1 || (viewColumnLayout === 'auto' && layoutColCount > 1)) {
if ((!isNaN(viewColumnLayout as number) && +viewColumnLayout > 1) || (viewColumnLayout === 'auto' && layoutColCount > 1)) {
const splitClassName = layoutColCount === 2 ? 'split-view' : 'triple-split-view';
modalContentElm.classList.add(splitClassName);
}
Expand Down
Loading

0 comments on commit 5080fc2

Please sign in to comment.