Skip to content

Commit 51e0818

Browse files
authored
Merge pull request #1267 from grid-js/functional
Grid.js v6 - Functional Components
2 parents ddc61d4 + 95d8564 commit 51e0818

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+8582
-10389
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"parser": "@typescript-eslint/parser",
88
"parserOptions": {
9-
"project": ["tsconfig.json", "*/tsconfig.release.json", "plugins/*/tsconfig.release.json", "tests/cypress/tsconfig.json"],
9+
"project": ["tsconfig.json", "*/tsconfig.json", "plugins/*/tsconfig.json", "tests/cypress/tsconfig.json"],
1010
"sourceType": "module"
1111
},
1212
"plugins": [

.github/workflows/coverage.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Code Coverage
2-
1+
name: 'coverage'
32
on:
4-
pull_request:
5-
branches:
6-
- master
7-
- main
8-
3+
pull_request:
4+
branches:
5+
- master
6+
- main
97
jobs:
10-
coverage:
11-
runs-on: ubuntu-latest
12-
env:
13-
CI_JOB_NUMBER: 1
14-
steps:
15-
- uses: actions/checkout@v2
16-
- run: npm install
17-
- run: npm run install:plugins
18-
- uses: artiomtr/[email protected]
19-
with:
20-
github_token: ${{ secrets.GITHUB_TOKEN }}
21-
test_script: npm run test:jest
8+
coverage:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- run: npm install
13+
- run: npm run install:plugins
14+
- uses: ArtiomTr/jest-coverage-report-action@v2
15+
id: coverage
16+
with:
17+
output: report-markdown
18+
test-script: npm run test:jest
19+
- uses: marocchino/sticky-pull-request-comment@v2
20+
with:
21+
message: ${{ steps.coverage.outputs.report }}

.github/workflows/nodejs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [12.x, 14.x, 16.x]
12+
node-version: [14.x, 16.x]
1313

1414
steps:
1515
- uses: actions/checkout@v2

index.ts

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,34 @@
11
import Grid from './src/grid';
2-
32
import { html } from './src/util/html';
43
import { h, createElement, Component, createRef } from 'preact';
5-
import { useEffect, useRef } from 'preact/hooks';
6-
import { UserConfig, Config } from './src/config';
7-
import { BaseComponent, BaseProps } from './src/view/base';
8-
import {
9-
PluginPosition,
10-
PluginBaseComponent,
11-
PluginBaseProps,
12-
} from './src/plugin';
13-
import { BaseActions } from './src/view/base/actions';
4+
import { useEffect, useRef, useState } from 'preact/hooks';
5+
import { Config } from './src/config';
6+
import { PluginPosition } from './src/plugin';
147
import { ID } from './src/util/id';
158
import { className } from './src/util/className';
169
import Row from './src/row';
1710
import Cell from './src/cell';
18-
import BaseStore from './src/view/base/store';
19-
import Dispatcher from './src/util/dispatcher';
11+
import { useConfig } from './src/hooks/useConfig';
12+
import { useStore } from './src/hooks/useStore';
13+
import useSelector from './src/hooks/useSelector';
2014

2115
export {
2216
Grid,
2317
ID,
24-
Dispatcher,
2518
Row,
2619
Cell,
27-
BaseActions,
28-
BaseStore,
2920
className,
3021
html,
31-
UserConfig,
3222
Config,
33-
BaseComponent,
34-
BaseProps,
3523
PluginPosition,
36-
PluginBaseComponent,
37-
PluginBaseProps,
3824
h,
3925
createElement,
4026
Component,
4127
createRef,
4228
useEffect,
43-
useRef
29+
useRef,
30+
useStore,
31+
useConfig,
32+
useState,
33+
useSelector,
4434
};

jest.config.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ module.exports = {
77
testEnvironment: 'node',
88
setupFilesAfterEnv: ["jest-extended/all"],
99
roots: roots,
10-
globals: {
11-
'ts-jest': {
12-
tsconfig: 'tsconfig.test.json',
13-
},
14-
},
1510
transform: {
16-
'^.+\\.tsx?$': 'ts-jest',
11+
'^.+\\.tsx?$': ['ts-jest', {
12+
...require('./tsconfig.test.json')
13+
}],
1714
},
1815
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
1916
setupFiles: ['./tests/jest/setup.ts'],

l10n/cs_CZ.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
export default {
2-
search: {
3-
placeholder: 'Napište klíčové slovo...',
4-
},
5-
sort: {
6-
sortAsc: 'Seřadit sloupec vzestupně',
7-
sortDesc: 'Seřadit sloupec sestupně',
8-
},
9-
pagination: {
10-
firstPage: 'První stránka',
11-
previous: 'Předchozí',
12-
next: 'Další',
13-
navigate: (page, pages) => `Stránka ${page} z ${pages}`,
14-
page: (page) => `Stránka ${page}`,
15-
showing: 'Zobrazeno',
16-
of: 'z',
17-
to: 'až',
18-
results: 'výsledků',
19-
},
20-
loading: 'Načítám...',
21-
noRecordsFound: 'Nebyly nalezeny žádné odpovídající záznamy',
22-
error: 'Při načítání dat došlo k chybě',
2+
search: {
3+
placeholder: 'Napište klíčové slovo...',
4+
},
5+
sort: {
6+
sortAsc: 'Seřadit sloupec vzestupně',
7+
sortDesc: 'Seřadit sloupec sestupně',
8+
},
9+
pagination: {
10+
previous: 'Předchozí',
11+
next: 'Další',
12+
navigate: (page, pages) => `Stránka ${page} z ${pages}`,
13+
page: (page) => `Stránka ${page}`,
14+
showing: 'Zobrazeno',
15+
of: 'z',
16+
to: 'až',
17+
results: 'výsledků',
18+
},
19+
loading: 'Načítám...',
20+
noRecordsFound: 'Nebyly nalezeny žádné odpovídající záznamy',
21+
error: 'Při načítání dat došlo k chybě',
2322
};

l10n/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import ptBR from './pt_BR';
1414
import faIR from './fa_IR';
1515
import nbNO from './nb_NO';
1616
import uaUA from './ua_UA';
17+
import csCZ from './cs_CZ';
1718

1819
export {
1920
esES,
@@ -31,5 +32,6 @@ export {
3132
ptBR,
3233
faIR,
3334
nbNO,
34-
uaUA
35+
uaUA,
36+
csCZ,
3537
};

l10n/tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": ".",
5+
"removeComments": true
6+
},
7+
"include": [
8+
"index.ts",
9+
"src/**/*",
10+
"tests/**/*"
11+
]
12+
}

l10n/tsconfig.release.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"removeComments": true
66
},
77
"include": [
8-
"index.ts"
8+
"index.ts",
9+
"src/**/*"
910
],
1011
"exclude": [
11-
"tests/**/*",
12-
"src/**/*"
12+
"tests/**/*"
1313
]
1414
}

l10n/tsconfig.test.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"types": ["jest"],
5+
"esModuleInterop": true
6+
}
7+
}

0 commit comments

Comments
 (0)