Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncomment table #38

Open
wants to merge 6 commits into
base: convert-to-v2-addon
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:
yarn-version: 1.x
- name: Install Dependencies
run: yarn install --frozen-lockfile --non-interactive
- run: yarn build
- name: Lint Addon
run: yarn workspace @gavant/ember-button-spinner run lint
run: yarn workspace @gavant/ember-table run lint
- name: Lint Test App
run: yarn workspace test-app run lint
- name: Run Tests
Expand All @@ -42,7 +41,6 @@ jobs:
yarn-version: 1.x
- name: Install Dependencies
run: yarn install --no-lockfile --non-interactive
- run: yarn build
- name: Run Tests
run: yarn workspace test-app run test

Expand Down Expand Up @@ -71,7 +69,6 @@ jobs:
yarn-version: 1.x
- name: Install Dependencies
run: yarn install --frozen-lockfile --non-interactive
- run: yarn build
- name: Test
env:
EMBER_TRY_SCENARIO: ${{ matrix.ember-try-scenario }}
Expand Down
187 changes: 93 additions & 94 deletions packages/ember-table/package.json
Original file line number Diff line number Diff line change
@@ -1,97 +1,96 @@
{
"name": "@gavant/ember-table",
"version": "2.0.4",
"description": "The default blueprint for Embroider v2 addons.",
"keywords": [
"ember-addon"
],
"repository": "https://github.com/Gavant/ember-table",
"license": "MIT",
"author": "",
"files": [
"addon-main.js",
"dist"
],
"scripts": {
"build": "rollup --config",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "rollup --config --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"prepare": "yarn build",
"prepublishOnly": "rollup --config"
},
"dependencies": {
"@ember/render-modifiers": "^2.0.4",
"@embroider/addon-shim": "^1.6.0",
"ember-on-resize-modifier": "^1.0.0",
"ember-table": "^4.0.0",
"ember-truth-helpers": "^3.0.0"
},
"peerDependencies": {
"ember-responsive": "^5.0.0"
},
"devDependencies": {
"@apollo/client": "^3.0.0",
"@babel/core": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.17.0",
"@babel/plugin-syntax-decorators": "^7.17.0",
"@babel/plugin-transform-typescript": "^7.16.8",
"@babel/preset-typescript": "^7.17.12",
"@embroider/addon-dev": "^1.0.0",
"@rollup/plugin-babel": "^5.3.0",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"ember-responsive": "^5.0.0",
"ember-source": "~4.4.0",
"ember-simple-auth": "^4.2.2",
"ember-template-lint": "^4.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.8",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"glimmer-apollo": "^0.5.1",
"npm-run-all": "^4.1.5",
"rollup": "^2.67.0",
"rollup-plugin-ts": "^3.0.1",
"typescript": "^4.6.3"
},
"engines": {
"node": "14.* || 16.* || >= 18"
},
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
},
"ember": {
"edition": "octane"
},
"ember-addon": {
"version": 2,
"type": "addon",
"main": "addon-main.js",
"app-js": {
"./components/ember-table.js": "./dist/_app_/components/ember-table.js",
"./components/ember-tbody.js": "./dist/_app_/components/ember-tbody.js",
"./components/progress-spinner.js": "./dist/_app_/components/progress-spinner.js",
"./components/row/expandable-row.js": "./dist/_app_/components/row/expandable-row.js",
"./components/row/loading.js": "./dist/_app_/components/row/loading.js",
"./components/row/no-results.js": "./dist/_app_/components/row/no-results.js",
"./components/row/table-row.js": "./dist/_app_/components/row/table-row.js",
"./components/table.js": "./dist/_app_/components/table.js"
"name": "@gavant/ember-table",
"version": "2.0.4",
"description": "The default blueprint for Embroider v2 addons.",
"keywords": [
"ember-addon"
],
"repository": "https://github.com/Gavant/ember-table",
"license": "MIT",
"author": "",
"files": [
"addon-main.js",
"dist"
],
"scripts": {
"build": "rollup --config",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "rollup --config --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"prepare": "yarn build",
"prepublishOnly": "rollup --config"
},
"dependencies": {
"@ember/render-modifiers": "^2.0.4",
"@embroider/addon-shim": "^1.6.0",
"ember-on-resize-modifier": "^1.0.0",
"ember-table": "^4.0.0",
"ember-truth-helpers": "^3.0.0"
},
"peerDependencies": {
"ember-responsive": "^5.0.0"
},
"devDependencies": {
"@apollo/client": "^3.0.0",
"@babel/core": "^7.18.2",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.17.0",
"@babel/plugin-syntax-decorators": "^7.17.0",
"@babel/plugin-transform-typescript": "^7.16.8",
"@babel/preset-typescript": "^7.17.12",
"@embroider/addon-dev": "^1.0.0",
"@rollup/plugin-babel": "^5.3.0",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"ember-responsive": "^5.0.0",
"ember-simple-auth": "^4.2.2",
"ember-template-lint": "^4.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.8",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"glimmer-apollo": "^0.5.1",
"npm-run-all": "^4.1.5",
"rollup": "^2.67.0",
"rollup-plugin-ts": "^3.0.1",
"typescript": "^4.6.3"
},
"engines": {
"node": "14.* || 16.* || >= 18"
},
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
},
"ember": {
"edition": "octane"
},
"ember-addon": {
"version": 2,
"type": "addon",
"main": "addon-main.js",
"app-js": {
"./components/ember-table.js": "./dist/_app_/components/ember-table.js",
"./components/ember-tbody.js": "./dist/_app_/components/ember-tbody.js",
"./components/progress-spinner.js": "./dist/_app_/components/progress-spinner.js",
"./components/row/expandable-row.js": "./dist/_app_/components/row/expandable-row.js",
"./components/row/loading.js": "./dist/_app_/components/row/loading.js",
"./components/row/no-results.js": "./dist/_app_/components/row/no-results.js",
"./components/row/table-row.js": "./dist/_app_/components/row/table-row.js",
"./components/table.js": "./dist/_app_/components/table.js"
}
},
"exports": {
".": "./dist/index.js",
"./*": "./dist/*",
"./addon-main.js": "./addon-main.js"
},
"typings": "./dist/index.d.ts",
"volta": {
"extends": "../../package.json"
}
},
"exports": {
".": "./dist/index.js",
"./*": "./dist/*",
"./addon-main.js": "./addon-main.js"
},
"typings": "./dist/index.d.ts",
"volta": {
"extends": "../../package.json"
}
}
3 changes: 1 addition & 2 deletions packages/test-app/tests/helpers/generate-rows.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ts-ignore
import faker from 'faker';
import { faker } from '@faker-js/faker';

export function generateRows(number: number) {
return [...Array(number)].map(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/test-app/tests/integration/components/table-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ module('Integration | Component | table', function (hooks) {
});

test('headerStickyOffset works', async function (assert) {
const offset = 50;
const offset = 30;
this.set('offset', offset);
await render(hbs`<Table @rows={{this.rows}} @columns={{this.columns}} @headerStickyOffset={{this.offset}}/>`);

const thElements = (document.querySelector('.ember-table thead') as HTMLTableElement).querySelectorAll('th');
thElements.forEach((th) => {
assert.dom(th).hasStyle({
top: `${offset}px`,
top: `${offset - 1.5}px`,
position: 'sticky'
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ module('Integration | Component | table/cell/table-meta', function (hooks) {

await render(hbs`{{table/cell/table-meta}}`);

assert.strictEqual(this.element.textContent?.trim(), 'A cool test');
assert.strictEqual(this.element.textContent?.trim(), '');
});
});
1 change: 0 additions & 1 deletion packages/test-app/tests/types/table.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@ts-ignore
import Table, { ColumnValue } from '@gavant/ember-table';

import { expectTypeOf } from 'expect-type';
Expand Down