Skip to content

Commit 5d153fc

Browse files
committed
remove svelte dispatcher
1 parent 3d87d07 commit 5d153fc

File tree

4 files changed

+46
-64
lines changed

4 files changed

+46
-64
lines changed

dist/build/crud-table.js

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@
663663
return child_ctx;
664664
}
665665

666-
// (194:4) {#if (table_data !== undefined)}
666+
// (189:4) {#if (table_data !== undefined)}
667667
function create_if_block(ctx) {
668668
let show_if = Array.isArray(/*table_data*/ ctx[0]);
669669
let if_block_anchor;
@@ -701,7 +701,7 @@
701701
};
702702
}
703703

704-
// (196:8) {#if Array.isArray(table_data)}
704+
// (191:8) {#if Array.isArray(table_data)}
705705
function create_if_block_1(ctx) {
706706
let div2;
707707
let div1;
@@ -835,7 +835,7 @@
835835
};
836836
}
837837

838-
// (201:20) {#each table_config.columns_setting as elem, index}
838+
// (196:20) {#each table_config.columns_setting as elem, index}
839839
function create_each_block_3(ctx) {
840840
let div;
841841
let span;
@@ -912,7 +912,7 @@
912912
};
913913
}
914914

915-
// (218:24) {#if options.includes(CREATE)}
915+
// (213:24) {#if options.includes(CREATE)}
916916
function create_if_block_11(ctx) {
917917
let div;
918918
let mounted;
@@ -942,7 +942,7 @@
942942
};
943943
}
944944

945-
// (234:32) {#if (column_order.name === genericCrudTableService.getKey(elem))}
945+
// (229:32) {#if (column_order.name === genericCrudTableService.getKey(elem))}
946946
function create_if_block_9(ctx) {
947947
let div1;
948948
let div0;
@@ -1058,7 +1058,7 @@
10581058
};
10591059
}
10601060

1061-
// (245:44) {:else}
1061+
// (240:44) {:else}
10621062
function create_else_block_1(ctx) {
10631063
let t_value = /*table_data*/ ctx[0][/*i*/ ctx[42]][/*column_order*/ ctx[43].name] + "";
10641064
let t;
@@ -1079,7 +1079,7 @@
10791079
};
10801080
}
10811081

1082-
// (243:44) {#if column_order.type === 'html'}
1082+
// (238:44) {#if column_order.type === 'html'}
10831083
function create_if_block_10(ctx) {
10841084
let html_tag;
10851085
let raw_value = /*table_data*/ ctx[0][/*i*/ ctx[42]][/*column_order*/ ctx[43].name] + "";
@@ -1104,7 +1104,7 @@
11041104
};
11051105
}
11061106

1107-
// (255:32) {#if table_config.columns_setting.length - 1 === j && Object.entries(tableRow).length - 1 === k }
1107+
// (250:32) {#if table_config.columns_setting.length - 1 === j && Object.entries(tableRow).length - 1 === k }
11081108
function create_if_block_2(ctx) {
11091109
let div3;
11101110
let div0;
@@ -1277,7 +1277,7 @@
12771277
};
12781278
}
12791279

1280-
// (261:44) {#if options.includes(DELETE)}
1280+
// (256:44) {#if options.includes(DELETE)}
12811281
function create_if_block_8(ctx) {
12821282
let div;
12831283
let div_aria_label_value;
@@ -1320,7 +1320,7 @@
13201320
};
13211321
}
13221322

1323-
// (269:44) {#if options.includes(EDIT)}
1323+
// (264:44) {#if options.includes(EDIT)}
13241324
function create_if_block_7(ctx) {
13251325
let div;
13261326
let mounted;
@@ -1357,7 +1357,7 @@
13571357
};
13581358
}
13591359

1360-
// (276:44) {#if options.includes(DETAILS)}
1360+
// (271:44) {#if options.includes(DETAILS)}
13611361
function create_if_block_5(ctx) {
13621362
let div;
13631363
let div_title_value;
@@ -1427,7 +1427,7 @@
14271427
};
14281428
}
14291429

1430-
// (282:52) {:else}
1430+
// (277:52) {:else}
14311431
function create_else_block(ctx) {
14321432
let html_tag;
14331433
let html_anchor;
@@ -1449,7 +1449,7 @@
14491449
};
14501450
}
14511451

1452-
// (280:52) {#if table_config.details_text !== undefined}
1452+
// (275:52) {#if table_config.details_text !== undefined}
14531453
function create_if_block_6(ctx) {
14541454
let t_value = /*table_config*/ ctx[1].details_text + "";
14551455
let t;
@@ -1470,7 +1470,7 @@
14701470
};
14711471
}
14721472

1473-
// (291:44) {#if options.includes(EDIT)}
1473+
// (286:44) {#if options.includes(EDIT)}
14741474
function create_if_block_4(ctx) {
14751475
let div0;
14761476
let t;
@@ -1533,7 +1533,7 @@
15331533
};
15341534
}
15351535

1536-
// (309:44) {#if options.includes(DELETE)}
1536+
// (304:44) {#if options.includes(DELETE)}
15371537
function create_if_block_3(ctx) {
15381538
let div0;
15391539
let div0_aria_label_value;
@@ -1602,7 +1602,7 @@
16021602
};
16031603
}
16041604

1605-
// (232:28) {#each Object.entries(tableRow) as elem, k}
1605+
// (227:28) {#each Object.entries(tableRow) as elem, k}
16061606
function create_each_block_2(ctx) {
16071607
let show_if_1 = /*column_order*/ ctx[43].name === /*genericCrudTableService*/ ctx[4].getKey(/*elem*/ ctx[46]);
16081608
let t;
@@ -1664,7 +1664,7 @@
16641664
};
16651665
}
16661666

1667-
// (231:24) {#each table_config.columns_setting as column_order, j}
1667+
// (226:24) {#each table_config.columns_setting as column_order, j}
16681668
function create_each_block_1(ctx) {
16691669
let each_1_anchor;
16701670
let each_value_2 = Object.entries(/*tableRow*/ ctx[40]);
@@ -1720,7 +1720,7 @@
17201720
};
17211721
}
17221722

1723-
// (228:16) {#each table_data as tableRow, i (tableRow)}
1723+
// (223:16) {#each table_data as tableRow, i (tableRow)}
17241724
function create_each_block(key_1, ctx) {
17251725
let div;
17261726
let t;
@@ -1847,7 +1847,7 @@
18471847

18481848
function instance($$self, $$props, $$invalidate) {
18491849
let { shadowed = false } = $$props;
1850-
const dispatch = createEventDispatcher();
1850+
createEventDispatcher();
18511851

18521852
const table_config_default = {
18531853
name: "crud-table",
@@ -1918,12 +1918,7 @@
19181918
}
19191919

19201920
function dispatcher(name, details, event) {
1921-
/* istanbul ignore next */
1922-
if (shadowed) {
1923-
event.target.dispatchEvent(new CustomEvent(name, { composed: true, detail: details }));
1924-
} else {
1925-
dispatch(name, details);
1926-
}
1921+
event.target.dispatchEvent(new CustomEvent(name, { composed: true, detail: details }));
19271922
}
19281923

19291924
function handleDetails(id, event) {

dist/build/crud-table.mjs

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ function get_each_context_3(ctx, list, i) {
657657
return child_ctx;
658658
}
659659

660-
// (194:4) {#if (table_data !== undefined)}
660+
// (189:4) {#if (table_data !== undefined)}
661661
function create_if_block(ctx) {
662662
let show_if = Array.isArray(/*table_data*/ ctx[0]);
663663
let if_block_anchor;
@@ -695,7 +695,7 @@ function create_if_block(ctx) {
695695
};
696696
}
697697

698-
// (196:8) {#if Array.isArray(table_data)}
698+
// (191:8) {#if Array.isArray(table_data)}
699699
function create_if_block_1(ctx) {
700700
let div2;
701701
let div1;
@@ -829,7 +829,7 @@ function create_if_block_1(ctx) {
829829
};
830830
}
831831

832-
// (201:20) {#each table_config.columns_setting as elem, index}
832+
// (196:20) {#each table_config.columns_setting as elem, index}
833833
function create_each_block_3(ctx) {
834834
let div;
835835
let span;
@@ -906,7 +906,7 @@ function create_each_block_3(ctx) {
906906
};
907907
}
908908

909-
// (218:24) {#if options.includes(CREATE)}
909+
// (213:24) {#if options.includes(CREATE)}
910910
function create_if_block_11(ctx) {
911911
let div;
912912
let mounted;
@@ -936,7 +936,7 @@ function create_if_block_11(ctx) {
936936
};
937937
}
938938

939-
// (234:32) {#if (column_order.name === genericCrudTableService.getKey(elem))}
939+
// (229:32) {#if (column_order.name === genericCrudTableService.getKey(elem))}
940940
function create_if_block_9(ctx) {
941941
let div1;
942942
let div0;
@@ -1052,7 +1052,7 @@ function create_if_block_9(ctx) {
10521052
};
10531053
}
10541054

1055-
// (245:44) {:else}
1055+
// (240:44) {:else}
10561056
function create_else_block_1(ctx) {
10571057
let t_value = /*table_data*/ ctx[0][/*i*/ ctx[42]][/*column_order*/ ctx[43].name] + "";
10581058
let t;
@@ -1073,7 +1073,7 @@ function create_else_block_1(ctx) {
10731073
};
10741074
}
10751075

1076-
// (243:44) {#if column_order.type === 'html'}
1076+
// (238:44) {#if column_order.type === 'html'}
10771077
function create_if_block_10(ctx) {
10781078
let html_tag;
10791079
let raw_value = /*table_data*/ ctx[0][/*i*/ ctx[42]][/*column_order*/ ctx[43].name] + "";
@@ -1098,7 +1098,7 @@ function create_if_block_10(ctx) {
10981098
};
10991099
}
11001100

1101-
// (255:32) {#if table_config.columns_setting.length - 1 === j && Object.entries(tableRow).length - 1 === k }
1101+
// (250:32) {#if table_config.columns_setting.length - 1 === j && Object.entries(tableRow).length - 1 === k }
11021102
function create_if_block_2(ctx) {
11031103
let div3;
11041104
let div0;
@@ -1271,7 +1271,7 @@ function create_if_block_2(ctx) {
12711271
};
12721272
}
12731273

1274-
// (261:44) {#if options.includes(DELETE)}
1274+
// (256:44) {#if options.includes(DELETE)}
12751275
function create_if_block_8(ctx) {
12761276
let div;
12771277
let div_aria_label_value;
@@ -1314,7 +1314,7 @@ function create_if_block_8(ctx) {
13141314
};
13151315
}
13161316

1317-
// (269:44) {#if options.includes(EDIT)}
1317+
// (264:44) {#if options.includes(EDIT)}
13181318
function create_if_block_7(ctx) {
13191319
let div;
13201320
let mounted;
@@ -1351,7 +1351,7 @@ function create_if_block_7(ctx) {
13511351
};
13521352
}
13531353

1354-
// (276:44) {#if options.includes(DETAILS)}
1354+
// (271:44) {#if options.includes(DETAILS)}
13551355
function create_if_block_5(ctx) {
13561356
let div;
13571357
let div_title_value;
@@ -1421,7 +1421,7 @@ function create_if_block_5(ctx) {
14211421
};
14221422
}
14231423

1424-
// (282:52) {:else}
1424+
// (277:52) {:else}
14251425
function create_else_block(ctx) {
14261426
let html_tag;
14271427
let html_anchor;
@@ -1443,7 +1443,7 @@ function create_else_block(ctx) {
14431443
};
14441444
}
14451445

1446-
// (280:52) {#if table_config.details_text !== undefined}
1446+
// (275:52) {#if table_config.details_text !== undefined}
14471447
function create_if_block_6(ctx) {
14481448
let t_value = /*table_config*/ ctx[1].details_text + "";
14491449
let t;
@@ -1464,7 +1464,7 @@ function create_if_block_6(ctx) {
14641464
};
14651465
}
14661466

1467-
// (291:44) {#if options.includes(EDIT)}
1467+
// (286:44) {#if options.includes(EDIT)}
14681468
function create_if_block_4(ctx) {
14691469
let div0;
14701470
let t;
@@ -1527,7 +1527,7 @@ function create_if_block_4(ctx) {
15271527
};
15281528
}
15291529

1530-
// (309:44) {#if options.includes(DELETE)}
1530+
// (304:44) {#if options.includes(DELETE)}
15311531
function create_if_block_3(ctx) {
15321532
let div0;
15331533
let div0_aria_label_value;
@@ -1596,7 +1596,7 @@ function create_if_block_3(ctx) {
15961596
};
15971597
}
15981598

1599-
// (232:28) {#each Object.entries(tableRow) as elem, k}
1599+
// (227:28) {#each Object.entries(tableRow) as elem, k}
16001600
function create_each_block_2(ctx) {
16011601
let show_if_1 = /*column_order*/ ctx[43].name === /*genericCrudTableService*/ ctx[4].getKey(/*elem*/ ctx[46]);
16021602
let t;
@@ -1658,7 +1658,7 @@ function create_each_block_2(ctx) {
16581658
};
16591659
}
16601660

1661-
// (231:24) {#each table_config.columns_setting as column_order, j}
1661+
// (226:24) {#each table_config.columns_setting as column_order, j}
16621662
function create_each_block_1(ctx) {
16631663
let each_1_anchor;
16641664
let each_value_2 = Object.entries(/*tableRow*/ ctx[40]);
@@ -1714,7 +1714,7 @@ function create_each_block_1(ctx) {
17141714
};
17151715
}
17161716

1717-
// (228:16) {#each table_data as tableRow, i (tableRow)}
1717+
// (223:16) {#each table_data as tableRow, i (tableRow)}
17181718
function create_each_block(key_1, ctx) {
17191719
let div;
17201720
let t;
@@ -1841,7 +1841,7 @@ const DETAILS = "DETAILS";
18411841

18421842
function instance($$self, $$props, $$invalidate) {
18431843
let { shadowed = false } = $$props;
1844-
const dispatch = createEventDispatcher();
1844+
createEventDispatcher();
18451845

18461846
const table_config_default = {
18471847
name: "crud-table",
@@ -1912,12 +1912,7 @@ function instance($$self, $$props, $$invalidate) {
19121912
}
19131913

19141914
function dispatcher(name, details, event) {
1915-
/* istanbul ignore next */
1916-
if (shadowed) {
1917-
event.target.dispatchEvent(new CustomEvent(name, { composed: true, detail: details }));
1918-
} else {
1919-
dispatch(name, details);
1920-
}
1915+
event.target.dispatchEvent(new CustomEvent(name, { composed: true, detail: details }));
19211916
}
19221917

19231918
function handleDetails(id, event) {

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.80",
3+
"version": "1.5.81",
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",

0 commit comments

Comments
 (0)