Skip to content

Commit 3d87d07

Browse files
committed
fix tableName as Id
1 parent eda6a3a commit 3d87d07

File tree

6 files changed

+16
-19
lines changed

6 files changed

+16
-19
lines changed

dist/build/crud-table.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@
436436

437437
class SvelteGenericCrudTableService {
438438

439-
constructor(table_config) {
440-
this.name = table_config.name;
439+
constructor(table_config, name) {
440+
this.name = name;
441441
this.table_config = table_config;
442442
}
443443

@@ -453,7 +453,6 @@
453453
return elem[1];
454454
}
455455

456-
457456
resetEditMode(id, event) {
458457
let parentrow = this.getTable(event);
459458
this.table_config.columns_setting.forEach((toEdit) => {
@@ -1864,7 +1863,7 @@
18641863
let options = [];
18651864
const NO_ROW_IN_EDIT_MODE = -1;
18661865
let cursor = NO_ROW_IN_EDIT_MODE;
1867-
let genericCrudTableService = new SvelteGenericCrudTableService(table_config);
1866+
let genericCrudTableService = new SvelteGenericCrudTableService(table_config, name);
18681867

18691868
function handleEdit(id, event) {
18701869
resetRawInEditMode(id, event);
@@ -2055,8 +2054,8 @@
20552054
: []);
20562055
}
20572056

2058-
if ($$self.$$.dirty[0] & /*table_config*/ 2) {
2059-
$$invalidate(4, genericCrudTableService = new SvelteGenericCrudTableService(table_config));
2057+
if ($$self.$$.dirty[0] & /*table_config, name*/ 6) {
2058+
$$invalidate(4, genericCrudTableService = new SvelteGenericCrudTableService(table_config, name));
20602059
}
20612060
};
20622061

dist/build/crud-table.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,8 @@ if (typeof HTMLElement === 'function') {
430430

431431
class SvelteGenericCrudTableService {
432432

433-
constructor(table_config) {
434-
this.name = table_config.name;
433+
constructor(table_config, name) {
434+
this.name = name;
435435
this.table_config = table_config;
436436
}
437437

@@ -447,7 +447,6 @@ class SvelteGenericCrudTableService {
447447
return elem[1];
448448
}
449449

450-
451450
resetEditMode(id, event) {
452451
let parentrow = this.getTable(event);
453452
this.table_config.columns_setting.forEach((toEdit) => {
@@ -1858,7 +1857,7 @@ function instance($$self, $$props, $$invalidate) {
18581857
let options = [];
18591858
const NO_ROW_IN_EDIT_MODE = -1;
18601859
let cursor = NO_ROW_IN_EDIT_MODE;
1861-
let genericCrudTableService = new SvelteGenericCrudTableService(table_config);
1860+
let genericCrudTableService = new SvelteGenericCrudTableService(table_config, name);
18621861

18631862
function handleEdit(id, event) {
18641863
resetRawInEditMode(id, event);
@@ -2049,8 +2048,8 @@ function instance($$self, $$props, $$invalidate) {
20492048
: []);
20502049
}
20512050

2052-
if ($$self.$$.dirty[0] & /*table_config*/ 2) {
2053-
$$invalidate(4, genericCrudTableService = new SvelteGenericCrudTableService(table_config));
2051+
if ($$self.$$.dirty[0] & /*table_config, name*/ 6) {
2052+
$$invalidate(4, genericCrudTableService = new SvelteGenericCrudTableService(table_config, name));
20542053
}
20552054
};
20562055

dist/crud-table-1-config-html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//config crud-table
22

33
let table_config = {
4-
name: 'Awesome',
4+
name: 'Awesome:',
55
options: ['CREATE', 'EDIT', 'DELETE', 'DETAILS'],
66
columns_setting: [
77
{name: 'name', show: true, edit: true, width: '150px', tooltip: true},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-generic-crud-table",
3-
"version": "1.5.79",
3+
"version": "1.5.80",
44
"description": "<crud-table> renders object-arrays with options-panel and inline edit per row. Dispatches events for ongoing data handling. As self-containing webcomponent or for Svelte in 60KB",
55
"main": "dist/build/crud-table.js",
66
"module": "dist/build/crud-table.mjs",

src/SvelteGenericCrudTable.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
4545
const NO_ROW_IN_EDIT_MODE = -1;
4646
let cursor = NO_ROW_IN_EDIT_MODE;
47-
let genericCrudTableService = new SvelteGenericCrudTableService(table_config);
48-
$: genericCrudTableService = new SvelteGenericCrudTableService(table_config);
47+
let genericCrudTableService = new SvelteGenericCrudTableService(table_config, name);
48+
$: genericCrudTableService = new SvelteGenericCrudTableService(table_config, name);
4949
5050
5151
function handleEdit(id, event) {

src/SvelteGenericCrudTableService.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export class SvelteGenericCrudTableService {
22

3-
constructor(table_config) {
4-
this.name = table_config.name;
3+
constructor(table_config, name) {
4+
this.name = name;
55
this.table_config = table_config;
66
}
77

@@ -17,7 +17,6 @@ export class SvelteGenericCrudTableService {
1717
return elem[1];
1818
}
1919

20-
2120
resetEditMode(id, event) {
2221
let parentrow = this.getTable(event);
2322
this.table_config.columns_setting.forEach((toEdit) => {

0 commit comments

Comments
 (0)