Skip to content

Commit

Permalink
(fix): Cleanup jest and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neonwarp committed Jul 10, 2022
1 parent 6412cc8 commit bab8ff2
Show file tree
Hide file tree
Showing 8 changed files with 2,183 additions and 1,232 deletions.
41 changes: 23 additions & 18 deletions dist/index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ function set_data(text, data) {
if (text.wholeText !== data)
text.data = data;
}
function custom_event(type, detail, bubbles = false) {
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
const e = document.createEvent('CustomEvent');
e.initCustomEvent(type, bubbles, false, detail);
e.initCustomEvent(type, bubbles, cancelable, detail);
return e;
}

Expand All @@ -162,16 +162,18 @@ function get_current_component() {
}
function createEventDispatcher() {
const component = get_current_component();
return (type, detail) => {
return (type, detail, { cancelable = false } = {}) => {
const callbacks = component.$$.callbacks[type];
if (callbacks) {
// TODO are there situations where events could be dispatched
// in a server (non-DOM) environment?
const event = custom_event(type, detail);
const event = custom_event(type, detail, { cancelable });
callbacks.slice().forEach(fn => {
fn.call(component, event);
});
return !event.defaultPrevented;
}
return true;
};
}

Expand Down Expand Up @@ -292,6 +294,9 @@ function transition_out(block, local, detach, callback) {
});
block.o(local);
}
else if (callback) {
callback();
}
}
function create_component(block) {
block && block.c();
Expand Down Expand Up @@ -422,7 +427,7 @@ class SvelteComponent {
}
}

/* src\Pagination.svelte generated by Svelte v3.46.2 */
/* src\Pagination.svelte generated by Svelte v3.49.0 */

function create_fragment$1(ctx) {
let nav;
Expand Down Expand Up @@ -673,7 +678,7 @@ class Pagination extends SvelteComponent {
}
}

/* src\SvelteTable.svelte generated by Svelte v3.46.2 */
/* src\SvelteTable.svelte generated by Svelte v3.49.0 */

function add_css(target) {
append_styles(target, "svelte-u2gknh", ".svelte-u2gknh,.svelte-u2gknh::after,.svelte-u2gknh::before{border-spacing:0;border-collapse:collapse}");
Expand Down Expand Up @@ -796,7 +801,7 @@ const get_head_slot_context = ctx => ({
sortable: /*isSortable*/ ctx[7] && /*column*/ ctx[45].sortable !== false
});

// (169:12) {:else}
// (170:12) {:else}
function create_else_block_3(ctx) {
let span;
let t_value = /*column*/ ctx[45].title + "";
Expand All @@ -823,7 +828,7 @@ function create_else_block_3(ctx) {
};
}

// (160:12) {#if $$slots.head}
// (161:12) {#if $$slots.head}
function create_if_block_4(ctx) {
let current;
const head_slot_template = /*#slots*/ ctx[28].head;
Expand Down Expand Up @@ -871,7 +876,7 @@ function create_if_block_4(ctx) {
};
}

// (150:8) {#each columns as column, colIdx}
// (151:8) {#each columns as column, colIdx}
function create_each_block_2(ctx) {
let th;
let current_block_type_index;
Expand Down Expand Up @@ -973,7 +978,7 @@ function create_each_block_2(ctx) {
};
}

// (226:6) {:else}
// (227:6) {:else}
function create_else_block_2(ctx) {
let current;
const empty_slot_template = /*#slots*/ ctx[28].empty;
Expand Down Expand Up @@ -1021,7 +1026,7 @@ function create_else_block_2(ctx) {
};
}

// (212:14) {:else}
// (213:14) {:else}
function create_else_block_1(ctx) {
let span;
let t_value = /*row*/ ctx[40][/*column*/ ctx[45].key] + "";
Expand All @@ -1048,7 +1053,7 @@ function create_else_block_1(ctx) {
};
}

// (201:14) {#if $$slots.cell}
// (202:14) {#if $$slots.cell}
function create_if_block_3(ctx) {
let current;
const cell_slot_template = /*#slots*/ ctx[28].cell;
Expand Down Expand Up @@ -1096,7 +1101,7 @@ function create_if_block_3(ctx) {
};
}

// (187:10) {#each columns as column, columnIndex}
// (188:10) {#each columns as column, columnIndex}
function create_each_block_1(ctx) {
let td;
let current_block_type_index;
Expand Down Expand Up @@ -1197,7 +1202,7 @@ function create_each_block_1(ctx) {
};
}

// (218:8) {#if row.isExpanded}
// (219:8) {#if row.isExpanded}
function create_if_block_2(ctx) {
let current;
const expanded_slot_template = /*#slots*/ ctx[28].expanded;
Expand Down Expand Up @@ -1245,7 +1250,7 @@ function create_if_block_2(ctx) {
};
}

// (177:6) {#each filteredRows as row, rowIndex}
// (178:6) {#each filteredRows as row, rowIndex}
function create_each_block(ctx) {
let tr;
let tr_class_value;
Expand Down Expand Up @@ -1390,7 +1395,7 @@ function create_each_block(ctx) {
};
}

// (231:2) {#if rowsPerPage && totalPages > 1}
// (232:2) {#if rowsPerPage && totalPages > 1}
function create_if_block(ctx) {
let current_block_type_index;
let if_block;
Expand Down Expand Up @@ -1460,7 +1465,7 @@ function create_if_block(ctx) {
};
}

// (248:4) {:else}
// (249:4) {:else}
function create_else_block(ctx) {
let pagination;
let current;
Expand Down Expand Up @@ -1511,7 +1516,7 @@ function create_else_block(ctx) {
};
}

// (232:4) {#if $$slots.pagination}
// (233:4) {#if $$slots.pagination}
function create_if_block_1(ctx) {
let current;
const pagination_slot_template = /*#slots*/ ctx[28].pagination;
Expand Down
41 changes: 23 additions & 18 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
if (text.wholeText !== data)
text.data = data;
}
function custom_event(type, detail, bubbles = false) {
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
const e = document.createEvent('CustomEvent');
e.initCustomEvent(type, bubbles, false, detail);
e.initCustomEvent(type, bubbles, cancelable, detail);
return e;
}

Expand All @@ -168,16 +168,18 @@
}
function createEventDispatcher() {
const component = get_current_component();
return (type, detail) => {
return (type, detail, { cancelable = false } = {}) => {
const callbacks = component.$$.callbacks[type];
if (callbacks) {
// TODO are there situations where events could be dispatched
// in a server (non-DOM) environment?
const event = custom_event(type, detail);
const event = custom_event(type, detail, { cancelable });
callbacks.slice().forEach(fn => {
fn.call(component, event);
});
return !event.defaultPrevented;
}
return true;
};
}

Expand Down Expand Up @@ -298,6 +300,9 @@
});
block.o(local);
}
else if (callback) {
callback();
}
}
function create_component(block) {
block && block.c();
Expand Down Expand Up @@ -428,7 +433,7 @@
}
}

/* src\Pagination.svelte generated by Svelte v3.46.2 */
/* src\Pagination.svelte generated by Svelte v3.49.0 */

function create_fragment$1(ctx) {
let nav;
Expand Down Expand Up @@ -679,7 +684,7 @@
}
}

/* src\SvelteTable.svelte generated by Svelte v3.46.2 */
/* src\SvelteTable.svelte generated by Svelte v3.49.0 */

function add_css(target) {
append_styles(target, "svelte-u2gknh", ".svelte-u2gknh,.svelte-u2gknh::after,.svelte-u2gknh::before{border-spacing:0;border-collapse:collapse}");
Expand Down Expand Up @@ -802,7 +807,7 @@
sortable: /*isSortable*/ ctx[7] && /*column*/ ctx[45].sortable !== false
});

// (169:12) {:else}
// (170:12) {:else}
function create_else_block_3(ctx) {
let span;
let t_value = /*column*/ ctx[45].title + "";
Expand All @@ -829,7 +834,7 @@
};
}

// (160:12) {#if $$slots.head}
// (161:12) {#if $$slots.head}
function create_if_block_4(ctx) {
let current;
const head_slot_template = /*#slots*/ ctx[28].head;
Expand Down Expand Up @@ -877,7 +882,7 @@
};
}

// (150:8) {#each columns as column, colIdx}
// (151:8) {#each columns as column, colIdx}
function create_each_block_2(ctx) {
let th;
let current_block_type_index;
Expand Down Expand Up @@ -979,7 +984,7 @@
};
}

// (226:6) {:else}
// (227:6) {:else}
function create_else_block_2(ctx) {
let current;
const empty_slot_template = /*#slots*/ ctx[28].empty;
Expand Down Expand Up @@ -1027,7 +1032,7 @@
};
}

// (212:14) {:else}
// (213:14) {:else}
function create_else_block_1(ctx) {
let span;
let t_value = /*row*/ ctx[40][/*column*/ ctx[45].key] + "";
Expand All @@ -1054,7 +1059,7 @@
};
}

// (201:14) {#if $$slots.cell}
// (202:14) {#if $$slots.cell}
function create_if_block_3(ctx) {
let current;
const cell_slot_template = /*#slots*/ ctx[28].cell;
Expand Down Expand Up @@ -1102,7 +1107,7 @@
};
}

// (187:10) {#each columns as column, columnIndex}
// (188:10) {#each columns as column, columnIndex}
function create_each_block_1(ctx) {
let td;
let current_block_type_index;
Expand Down Expand Up @@ -1203,7 +1208,7 @@
};
}

// (218:8) {#if row.isExpanded}
// (219:8) {#if row.isExpanded}
function create_if_block_2(ctx) {
let current;
const expanded_slot_template = /*#slots*/ ctx[28].expanded;
Expand Down Expand Up @@ -1251,7 +1256,7 @@
};
}

// (177:6) {#each filteredRows as row, rowIndex}
// (178:6) {#each filteredRows as row, rowIndex}
function create_each_block(ctx) {
let tr;
let tr_class_value;
Expand Down Expand Up @@ -1396,7 +1401,7 @@
};
}

// (231:2) {#if rowsPerPage && totalPages > 1}
// (232:2) {#if rowsPerPage && totalPages > 1}
function create_if_block(ctx) {
let current_block_type_index;
let if_block;
Expand Down Expand Up @@ -1466,7 +1471,7 @@
};
}

// (248:4) {:else}
// (249:4) {:else}
function create_else_block(ctx) {
let pagination;
let current;
Expand Down Expand Up @@ -1517,7 +1522,7 @@
};
}

// (232:4) {#if $$slots.pagination}
// (233:4) {#if $$slots.pagination}
function create_if_block_1(ctx) {
let current;
const pagination_slot_template = /*#slots*/ ctx[28].pagination;
Expand Down

0 comments on commit bab8ff2

Please sign in to comment.