svelte-onsenui
Version:
Svelte component bindings for Onsen UI
1,776 lines (1,606 loc) • 144 kB
JavaScript
function noop() { }
function assign(tar, src) {
// @ts-ignore
for (const k in src)
tar[k] = src[k];
return tar;
}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function is_empty(obj) {
return Object.keys(obj).length === 0;
}
function create_slot(definition, ctx, $$scope, fn) {
if (definition) {
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
return definition[0](slot_ctx);
}
}
function get_slot_context(definition, ctx, $$scope, fn) {
return definition[1] && fn
? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
: $$scope.ctx;
}
function get_slot_changes(definition, $$scope, dirty, fn) {
if (definition[2] && fn) {
const lets = definition[2](fn(dirty));
if ($$scope.dirty === undefined) {
return lets;
}
if (typeof lets === 'object') {
const merged = [];
const len = Math.max($$scope.dirty.length, lets.length);
for (let i = 0; i < len; i += 1) {
merged[i] = $$scope.dirty[i] | lets[i];
}
return merged;
}
return $$scope.dirty | lets;
}
return $$scope.dirty;
}
function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
if (slot_changes) {
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
slot.p(slot_context, slot_changes);
}
}
function get_all_dirty_from_scope($$scope) {
if ($$scope.ctx.length > 32) {
const dirty = [];
const length = $$scope.ctx.length / 32;
for (let i = 0; i < length; i++) {
dirty[i] = -1;
}
return dirty;
}
return -1;
}
function exclude_internal_props(props) {
const result = {};
for (const k in props)
if (k[0] !== '$')
result[k] = props[k];
return result;
}
function compute_rest_props(props, keys) {
const rest = {};
keys = new Set(keys);
for (const k in props)
if (!keys.has(k) && k[0] !== '$')
rest[k] = props[k];
return rest;
}
function compute_slots(slots) {
const result = {};
for (const key in slots) {
result[key] = true;
}
return result;
}
function action_destroyer(action_result) {
return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
}
function append(target, node) {
target.appendChild(node);
}
function insert(target, node, anchor) {
target.insertBefore(node, anchor || null);
}
function detach(node) {
node.parentNode.removeChild(node);
}
function destroy_each(iterations, detaching) {
for (let i = 0; i < iterations.length; i += 1) {
if (iterations[i])
iterations[i].d(detaching);
}
}
function element(name) {
return document.createElement(name);
}
function text(data) {
return document.createTextNode(data);
}
function space() {
return text(' ');
}
function empty() {
return text('');
}
function listen(node, event, handler, options) {
node.addEventListener(event, handler, options);
return () => node.removeEventListener(event, handler, options);
}
function self(fn) {
return function (event) {
// @ts-ignore
if (event.target === this)
fn.call(this, event);
};
}
function attr(node, attribute, value) {
if (value == null)
node.removeAttribute(attribute);
else if (node.getAttribute(attribute) !== value)
node.setAttribute(attribute, value);
}
function set_attributes(node, attributes) {
// @ts-ignore
const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
for (const key in attributes) {
if (attributes[key] == null) {
node.removeAttribute(key);
}
else if (key === 'style') {
node.style.cssText = attributes[key];
}
else if (key === '__value') {
node.value = node[key] = attributes[key];
}
else if (descriptors[key] && descriptors[key].set) {
node[key] = attributes[key];
}
else {
attr(node, key, attributes[key]);
}
}
}
function set_custom_element_data(node, prop, value) {
if (prop in node) {
node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
}
else {
attr(node, prop, value);
}
}
function children(element) {
return Array.from(element.childNodes);
}
function set_data(text, data) {
data = '' + data;
if (text.wholeText !== data)
text.data = data;
}
function toggle_class(element, name, toggle) {
element.classList[toggle ? 'add' : 'remove'](name);
}
let current_component;
function set_current_component(component) {
current_component = component;
}
function get_current_component() {
if (!current_component)
throw new Error('Function called outside component initialization');
return current_component;
}
function onMount(fn) {
get_current_component().$$.on_mount.push(fn);
}
// TODO figure out if we still want to support
// shorthand events, or if we want to implement
// a real bubbling mechanism
function bubble(component, event) {
const callbacks = component.$$.callbacks[event.type];
if (callbacks) {
// @ts-ignore
callbacks.slice().forEach(fn => fn.call(this, event));
}
}
const dirty_components = [];
const binding_callbacks = [];
const render_callbacks = [];
const flush_callbacks = [];
const resolved_promise = Promise.resolve();
let update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function tick() {
schedule_update();
return resolved_promise;
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
let flushing = false;
const seen_callbacks = new Set();
function flush() {
if (flushing)
return;
flushing = true;
do {
// first, call beforeUpdate functions
// and update components
for (let i = 0; i < dirty_components.length; i += 1) {
const component = dirty_components[i];
set_current_component(component);
update(component.$$);
}
set_current_component(null);
dirty_components.length = 0;
while (binding_callbacks.length)
binding_callbacks.pop()();
// then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
for (let i = 0; i < render_callbacks.length; i += 1) {
const callback = render_callbacks[i];
if (!seen_callbacks.has(callback)) {
// ...so guard against infinite loops
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
flushing = false;
seen_callbacks.clear();
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
const dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
const outroing = new Set();
let outros;
function group_outros() {
outros = {
r: 0,
c: [],
p: outros // parent group
};
}
function check_outros() {
if (!outros.r) {
run_all(outros.c);
}
outros = outros.p;
}
function transition_in(block, local) {
if (block && block.i) {
outroing.delete(block);
block.i(local);
}
}
function transition_out(block, local, detach, callback) {
if (block && block.o) {
if (outroing.has(block))
return;
outroing.add(block);
outros.c.push(() => {
outroing.delete(block);
if (callback) {
if (detach)
block.d(1);
callback();
}
});
block.o(local);
}
}
function get_spread_update(levels, updates) {
const update = {};
const to_null_out = {};
const accounted_for = { $$scope: 1 };
let i = levels.length;
while (i--) {
const o = levels[i];
const n = updates[i];
if (n) {
for (const key in o) {
if (!(key in n))
to_null_out[key] = 1;
}
for (const key in n) {
if (!accounted_for[key]) {
update[key] = n[key];
accounted_for[key] = 1;
}
}
levels[i] = n;
}
else {
for (const key in o) {
accounted_for[key] = 1;
}
}
}
for (const key in to_null_out) {
if (!(key in update))
update[key] = undefined;
}
return update;
}
function get_spread_object(spread_props) {
return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
}
function create_component(block) {
block && block.c();
}
function mount_component(component, target, anchor, customElement) {
const { fragment, on_mount, on_destroy, after_update } = component.$$;
fragment && fragment.m(target, anchor);
if (!customElement) {
// onMount happens before the initial afterUpdate
add_render_callback(() => {
const new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push(...new_on_destroy);
}
else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
}
after_update.forEach(add_render_callback);
}
function destroy_component(component, detaching) {
const $$ = component.$$;
if ($$.fragment !== null) {
run_all($$.on_destroy);
$$.fragment && $$.fragment.d(detaching);
// TODO null out other refs, including component.$$ (but need to
// preserve final state?)
$$.on_destroy = $$.fragment = null;
$$.ctx = [];
}
}
function make_dirty(component, i) {
if (component.$$.dirty[0] === -1) {
dirty_components.push(component);
schedule_update();
component.$$.dirty.fill(0);
}
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
}
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
const parent_component = current_component;
set_current_component(component);
const $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props,
update: noop,
not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
on_disconnect: [],
before_update: [],
after_update: [],
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
// everything else
callbacks: blank_object(),
dirty,
skip_bound: false,
root: options.target || parent_component.$$.root
};
append_styles && append_styles($$.root);
let ready = false;
$$.ctx = instance
? instance(component, options.props || {}, (i, ret, ...rest) => {
const value = rest.length ? rest[0] : ret;
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
if (!$$.skip_bound && $$.bound[i])
$$.bound[i](value);
if (ready)
make_dirty(component, i);
}
return ret;
})
: [];
$$.update();
ready = true;
run_all($$.before_update);
// `false` as a special case of no DOM component
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
if (options.target) {
if (options.hydrate) {
const nodes = children(options.target);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.l(nodes);
nodes.forEach(detach);
}
else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment && $$.fragment.c();
}
if (options.intro)
transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor, options.customElement);
flush();
}
set_current_component(parent_component);
}
/**
* Base class for Svelte components. Used when dev=false.
*/
class SvelteComponent {
$destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
$on(type, callback) {
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
callbacks.push(callback);
return () => {
const index = callbacks.indexOf(callback);
if (index !== -1)
callbacks.splice(index, 1);
};
}
$set($$props) {
if (this.$$set && !is_empty($$props)) {
this.$$.skip_bound = true;
this.$$set($$props);
this.$$.skip_bound = false;
}
}
}
/* eslint camelcase: "off", no-prototype-builtins: "off" */
function getEventsAction(comp) {
const component = comp===undefined ? get_current_component() : comp;
return node => {
const events = Object.keys(component.$$.callbacks);
const listeners = [];
events.forEach( event => listeners.push( listen(node, event, e => bubble(component, e)) ) );
return {
destroy: () => {
listeners.forEach( listener => listener() );
}
};
};
}
const normalize = key => {
if (/^is[A-Z]/.test(key)) { key = key.slice(2); }
return key.replace(/([a-zA-Z])([A-Z])/g, '$1-$2').toLowerCase();
};
// animation-options={{ duration: 0.6, delay: 0.1, timing: 'ease-in' }}
// getAttrs(el, props = el.props, nameMap = {}) {
function getAttribs(props, nameMap={}){
const jsProperties = {};
const validProps = {}; // el.constructor.propTypes || {};
const ignoredProps = ['isOpen'];
Object.keys(props).forEach(reactName => {
const reactValue = props[reactName];
// onClick and anything that isn't a valid React prop get added immediately
if (!validProps.hasOwnProperty(reactName) || reactName === 'onClick') {
jsProperties[reactName] = reactValue;
// don't add any props we specifically want to ignore
} else if (ignoredProps.indexOf(reactName) === -1) {
const jsName = nameMap[reactName] || normalize(reactName);
const type = typeof reactValue;
if (type === 'boolean' && reactValue) {
jsProperties[jsName] = '';
} else if (type === 'string') {
if (reactName === 'animationOptions') {
jsProperties[jsName] = JSON.stringify(reactValue);
} else {
jsProperties[jsName] = reactValue;
}
} else if (type === 'number') {
if (/(height|width)/i.test(reactName)) {
jsProperties[jsName] = reactValue + 'px';
} else {
jsProperties[jsName] = reactValue;
}
}
}
});
return jsProperties;
}
/* src\ActionSheet.svelte generated by Svelte v3.43.2 */
function create_fragment(ctx) {
let ons_action_sheet;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[5].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null);
let ons_action_sheet_levels = [{ visible: /*visible*/ ctx[0] }, /*attrs*/ ctx[2]];
let ons_action_sheet_data = {};
for (let i = 0; i < ons_action_sheet_levels.length; i += 1) {
ons_action_sheet_data = assign(ons_action_sheet_data, ons_action_sheet_levels[i]);
}
return {
c() {
ons_action_sheet = element("ons-action-sheet");
if (default_slot) default_slot.c();
set_attributes(ons_action_sheet, ons_action_sheet_data);
},
m(target, anchor) {
insert(target, ons_action_sheet, anchor);
if (default_slot) {
default_slot.m(ons_action_sheet, null);
}
/*ons_action_sheet_binding*/ ctx[6](ons_action_sheet);
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[3].call(null, ons_action_sheet));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[4],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[4])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null),
null
);
}
}
set_attributes(ons_action_sheet, ons_action_sheet_data = get_spread_update(ons_action_sheet_levels, [
(!current || dirty & /*visible*/ 1) && { visible: /*visible*/ ctx[0] },
dirty & /*attrs*/ 4 && /*attrs*/ ctx[2]
]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_action_sheet);
if (default_slot) default_slot.d(detaching);
/*ons_action_sheet_binding*/ ctx[6](null);
mounted = false;
dispose();
}
};
}
function instance($$self, $$props, $$invalidate) {
let attrs;
const omit_props_names = ["visible"];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
let { visible } = $$props;
let node;
let isOpen = visible;
onMount(() => {
});
function toggleDialog(wantOpen) {
console.log('toggle', wantOpen);
if (wantOpen && !isOpen) node.show(); else if (!wantOpen && isOpen) node.hide();
isOpen = wantOpen;
}
function ons_action_sheet_binding($$value) {
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
node = $$value;
$$invalidate(1, node);
});
}
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(11, $$restProps = compute_rest_props($$props, omit_props_names));
if ('visible' in $$new_props) $$invalidate(0, visible = $$new_props.visible);
if ('$$scope' in $$new_props) $$invalidate(4, $$scope = $$new_props.$$scope);
};
$$self.$$.update = () => {
console.log('visible11', visible, $$restProps);
if ($$self.$$.dirty & /*visible*/ 1) {
toggleDialog(visible);
}
$$invalidate(2, attrs = getAttribs($$restProps));
};
return [visible, node, attrs, events, $$scope, slots, ons_action_sheet_binding];
}
class ActionSheet extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { visible: 0 });
}
}
/* src\ActionSheetButton.svelte generated by Svelte v3.43.2 */
function create_fragment$1(ctx) {
let ons_action_sheet_button;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[3].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);
let ons_action_sheet_button_levels = [/*$$restProps*/ ctx[1]];
let ons_action_sheet_button_data = {};
for (let i = 0; i < ons_action_sheet_button_levels.length; i += 1) {
ons_action_sheet_button_data = assign(ons_action_sheet_button_data, ons_action_sheet_button_levels[i]);
}
return {
c() {
ons_action_sheet_button = element("ons-action-sheet-button");
if (default_slot) default_slot.c();
set_attributes(ons_action_sheet_button, ons_action_sheet_button_data);
},
m(target, anchor) {
insert(target, ons_action_sheet_button, anchor);
if (default_slot) {
default_slot.m(ons_action_sheet_button, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[0].call(null, ons_action_sheet_button));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[2],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[2])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null),
null
);
}
}
set_attributes(ons_action_sheet_button, ons_action_sheet_button_data = get_spread_update(ons_action_sheet_button_levels, [dirty & /*$$restProps*/ 2 && /*$$restProps*/ ctx[1]]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_action_sheet_button);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function instance$1($$self, $$props, $$invalidate) {
const omit_props_names = [];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(1, $$restProps = compute_rest_props($$props, omit_props_names));
if ('$$scope' in $$new_props) $$invalidate(2, $$scope = $$new_props.$$scope);
};
return [events, $$restProps, $$scope, slots];
}
class ActionSheetButton extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
}
}
/* src\AlertDialog.svelte generated by Svelte v3.43.2 */
function create_fragment$2(ctx) {
let ons_alert_dialog;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[5].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null);
let ons_alert_dialog_levels = [{ visible: /*visible*/ ctx[0] }, /*$$restProps*/ ctx[3]];
let ons_alert_dialog_data = {};
for (let i = 0; i < ons_alert_dialog_levels.length; i += 1) {
ons_alert_dialog_data = assign(ons_alert_dialog_data, ons_alert_dialog_levels[i]);
}
return {
c() {
ons_alert_dialog = element("ons-alert-dialog");
if (default_slot) default_slot.c();
set_attributes(ons_alert_dialog, ons_alert_dialog_data);
},
m(target, anchor) {
insert(target, ons_alert_dialog, anchor);
if (default_slot) {
default_slot.m(ons_alert_dialog, null);
}
/*ons_alert_dialog_binding*/ ctx[6](ons_alert_dialog);
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[2].call(null, ons_alert_dialog));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[4],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[4])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null),
null
);
}
}
set_attributes(ons_alert_dialog, ons_alert_dialog_data = get_spread_update(ons_alert_dialog_levels, [
(!current || dirty & /*visible*/ 1) && { visible: /*visible*/ ctx[0] },
dirty & /*$$restProps*/ 8 && /*$$restProps*/ ctx[3]
]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_alert_dialog);
if (default_slot) default_slot.d(detaching);
/*ons_alert_dialog_binding*/ ctx[6](null);
mounted = false;
dispose();
}
};
}
function instance$2($$self, $$props, $$invalidate) {
const omit_props_names = ["visible"];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
let { visible } = $$props;
let isOpen = visible;
let node;
// $: attrs = getAttribs($$restProps)
function toggleDialog(wantOpen) {
console.log('toggle', wantOpen);
if (wantOpen && !isOpen) node.show(); else if (!wantOpen && isOpen) node.hide();
isOpen = wantOpen;
}
function ons_alert_dialog_binding($$value) {
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
node = $$value;
$$invalidate(1, node);
});
}
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(3, $$restProps = compute_rest_props($$props, omit_props_names));
if ('visible' in $$new_props) $$invalidate(0, visible = $$new_props.visible);
if ('$$scope' in $$new_props) $$invalidate(4, $$scope = $$new_props.$$scope);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*visible*/ 1) {
toggleDialog(visible);
}
};
return [visible, node, events, $$restProps, $$scope, slots, ons_alert_dialog_binding];
}
class AlertDialog extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$2, create_fragment$2, safe_not_equal, { visible: 0 });
}
}
/* src\AlertDialogButton.svelte generated by Svelte v3.43.2 */
function create_fragment$3(ctx) {
let ons_alert_dialog_button;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[3].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);
let ons_alert_dialog_button_levels = [/*$$restProps*/ ctx[1]];
let ons_alert_dialog_button_data = {};
for (let i = 0; i < ons_alert_dialog_button_levels.length; i += 1) {
ons_alert_dialog_button_data = assign(ons_alert_dialog_button_data, ons_alert_dialog_button_levels[i]);
}
return {
c() {
ons_alert_dialog_button = element("ons-alert-dialog-button");
if (default_slot) default_slot.c();
set_attributes(ons_alert_dialog_button, ons_alert_dialog_button_data);
},
m(target, anchor) {
insert(target, ons_alert_dialog_button, anchor);
if (default_slot) {
default_slot.m(ons_alert_dialog_button, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[0].call(null, ons_alert_dialog_button));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[2],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[2])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null),
null
);
}
}
set_attributes(ons_alert_dialog_button, ons_alert_dialog_button_data = get_spread_update(ons_alert_dialog_button_levels, [dirty & /*$$restProps*/ 2 && /*$$restProps*/ ctx[1]]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_alert_dialog_button);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function instance$3($$self, $$props, $$invalidate) {
const omit_props_names = [];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(1, $$restProps = compute_rest_props($$props, omit_props_names));
if ('$$scope' in $$new_props) $$invalidate(2, $$scope = $$new_props.$$scope);
};
return [events, $$restProps, $$scope, slots];
}
class AlertDialogButton extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$3, create_fragment$3, safe_not_equal, {});
}
}
/* src\BackButton.svelte generated by Svelte v3.43.2 */
function create_fragment$4(ctx) {
let ons_back_button;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[3].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);
let ons_back_button_levels = [/*$$restProps*/ ctx[1]];
let ons_back_button_data = {};
for (let i = 0; i < ons_back_button_levels.length; i += 1) {
ons_back_button_data = assign(ons_back_button_data, ons_back_button_levels[i]);
}
return {
c() {
ons_back_button = element("ons-back-button");
if (default_slot) default_slot.c();
set_attributes(ons_back_button, ons_back_button_data);
},
m(target, anchor) {
insert(target, ons_back_button, anchor);
if (default_slot) {
default_slot.m(ons_back_button, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[0].call(null, ons_back_button));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[2],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[2])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null),
null
);
}
}
set_attributes(ons_back_button, ons_back_button_data = get_spread_update(ons_back_button_levels, [dirty & /*$$restProps*/ 2 && /*$$restProps*/ ctx[1]]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_back_button);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function instance$4($$self, $$props, $$invalidate) {
const omit_props_names = [];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(1, $$restProps = compute_rest_props($$props, omit_props_names));
if ('$$scope' in $$new_props) $$invalidate(2, $$scope = $$new_props.$$scope);
};
return [events, $$restProps, $$scope, slots];
}
class BackButton extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$4, create_fragment$4, safe_not_equal, {});
}
}
/* src\BottomToolbar.svelte generated by Svelte v3.43.2 */
function create_fragment$5(ctx) {
let ons_bottom_toolbar;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[3].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);
let ons_bottom_toolbar_levels = [/*$$restProps*/ ctx[1]];
let ons_bottom_toolbar_data = {};
for (let i = 0; i < ons_bottom_toolbar_levels.length; i += 1) {
ons_bottom_toolbar_data = assign(ons_bottom_toolbar_data, ons_bottom_toolbar_levels[i]);
}
return {
c() {
ons_bottom_toolbar = element("ons-bottom-toolbar");
if (default_slot) default_slot.c();
set_attributes(ons_bottom_toolbar, ons_bottom_toolbar_data);
},
m(target, anchor) {
insert(target, ons_bottom_toolbar, anchor);
if (default_slot) {
default_slot.m(ons_bottom_toolbar, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[0].call(null, ons_bottom_toolbar));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[2],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[2])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null),
null
);
}
}
set_attributes(ons_bottom_toolbar, ons_bottom_toolbar_data = get_spread_update(ons_bottom_toolbar_levels, [dirty & /*$$restProps*/ 2 && /*$$restProps*/ ctx[1]]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_bottom_toolbar);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function instance$5($$self, $$props, $$invalidate) {
const omit_props_names = [];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(1, $$restProps = compute_rest_props($$props, omit_props_names));
if ('$$scope' in $$new_props) $$invalidate(2, $$scope = $$new_props.$$scope);
};
return [events, $$restProps, $$scope, slots];
}
class BottomToolbar extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$5, create_fragment$5, safe_not_equal, {});
}
}
/* src\Button.svelte generated by Svelte v3.43.2 */
function create_fragment$6(ctx) {
let ons_button;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[3].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);
let ons_button_levels = [/*$$restProps*/ ctx[1]];
let ons_button_data = {};
for (let i = 0; i < ons_button_levels.length; i += 1) {
ons_button_data = assign(ons_button_data, ons_button_levels[i]);
}
return {
c() {
ons_button = element("ons-button");
if (default_slot) default_slot.c();
set_attributes(ons_button, ons_button_data);
},
m(target, anchor) {
insert(target, ons_button, anchor);
if (default_slot) {
default_slot.m(ons_button, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[0].call(null, ons_button));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[2],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[2])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null),
null
);
}
}
set_attributes(ons_button, ons_button_data = get_spread_update(ons_button_levels, [dirty & /*$$restProps*/ 2 && /*$$restProps*/ ctx[1]]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_button);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function instance$6($$self, $$props, $$invalidate) {
const omit_props_names = [];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(1, $$restProps = compute_rest_props($$props, omit_props_names));
if ('$$scope' in $$new_props) $$invalidate(2, $$scope = $$new_props.$$scope);
};
return [events, $$restProps, $$scope, slots];
}
class Button extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$6, create_fragment$6, safe_not_equal, {});
}
}
/* src\Card.svelte generated by Svelte v3.43.2 */
function create_fragment$7(ctx) {
let ons_card;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[3].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);
let ons_card_levels = [/*$$restProps*/ ctx[1]];
let ons_card_data = {};
for (let i = 0; i < ons_card_levels.length; i += 1) {
ons_card_data = assign(ons_card_data, ons_card_levels[i]);
}
return {
c() {
ons_card = element("ons-card");
if (default_slot) default_slot.c();
set_attributes(ons_card, ons_card_data);
},
m(target, anchor) {
insert(target, ons_card, anchor);
if (default_slot) {
default_slot.m(ons_card, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[0].call(null, ons_card));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[2],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[2])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null),
null
);
}
}
set_attributes(ons_card, ons_card_data = get_spread_update(ons_card_levels, [dirty & /*$$restProps*/ 2 && /*$$restProps*/ ctx[1]]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_card);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function instance$7($$self, $$props, $$invalidate) {
const omit_props_names = [];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(1, $$restProps = compute_rest_props($$props, omit_props_names));
if ('$$scope' in $$new_props) $$invalidate(2, $$scope = $$new_props.$$scope);
};
return [events, $$restProps, $$scope, slots];
}
class Card extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$7, create_fragment$7, safe_not_equal, {});
}
}
/* src\Col.svelte generated by Svelte v3.43.2 */
function create_fragment$8(ctx) {
let ons_col;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[5].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null);
let ons_col_levels = [{ width: /*width*/ ctx[0] }, /*$$restProps*/ ctx[3]];
let ons_col_data = {};
for (let i = 0; i < ons_col_levels.length; i += 1) {
ons_col_data = assign(ons_col_data, ons_col_levels[i]);
}
return {
c() {
ons_col = element("ons-col");
if (default_slot) default_slot.c();
set_attributes(ons_col, ons_col_data);
},
m(target, anchor) {
insert(target, ons_col, anchor);
if (default_slot) {
default_slot.m(ons_col, null);
}
/*ons_col_binding*/ ctx[6](ons_col);
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[2].call(null, ons_col));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[4],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[4])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null),
null
);
}
}
set_attributes(ons_col, ons_col_data = get_spread_update(ons_col_levels, [
(!current || dirty & /*width*/ 1) && { width: /*width*/ ctx[0] },
dirty & /*$$restProps*/ 8 && /*$$restProps*/ ctx[3]
]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_col);
if (default_slot) default_slot.d(detaching);
/*ons_col_binding*/ ctx[6](null);
mounted = false;
dispose();
}
};
}
function instance$8($$self, $$props, $$invalidate) {
const omit_props_names = ["width"];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
let { width = undefined } = $$props;
let node;
function ons_col_binding($$value) {
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
node = $$value;
$$invalidate(1, node);
});
}
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(3, $$restProps = compute_rest_props($$props, omit_props_names));
if ('width' in $$new_props) $$invalidate(0, width = $$new_props.width);
if ('$$scope' in $$new_props) $$invalidate(4, $$scope = $$new_props.$$scope);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*node, width*/ 3) {
if (node) node._updateWidth(width);
}
};
return [width, node, events, $$restProps, $$scope, slots, ons_col_binding];
}
class Col extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$8, create_fragment$8, safe_not_equal, { width: 0 });
}
}
/* src\Dialog.svelte generated by Svelte v3.43.2 */
function create_fragment$9(ctx) {
let ons_dialog;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[5].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null);
let ons_dialog_levels = [{ visible: /*visible*/ ctx[0] }, /*$$restProps*/ ctx[3]];
let ons_dialog_data = {};
for (let i = 0; i < ons_dialog_levels.length; i += 1) {
ons_dialog_data = assign(ons_dialog_data, ons_dialog_levels[i]);
}
return {
c() {
ons_dialog = element("ons-dialog");
if (default_slot) default_slot.c();
set_attributes(ons_dialog, ons_dialog_data);
},
m(target, anchor) {
insert(target, ons_dialog, anchor);
if (default_slot) {
default_slot.m(ons_dialog, null);
}
/*ons_dialog_binding*/ ctx[6](ons_dialog);
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[2].call(null, ons_dialog));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 16)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[4],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[4])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[4], dirty, null),
null
);
}
}
set_attributes(ons_dialog, ons_dialog_data = get_spread_update(ons_dialog_levels, [
(!current || dirty & /*visible*/ 1) && { visible: /*visible*/ ctx[0] },
dirty & /*$$restProps*/ 8 && /*$$restProps*/ ctx[3]
]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_dialog);
if (default_slot) default_slot.d(detaching);
/*ons_dialog_binding*/ ctx[6](null);
mounted = false;
dispose();
}
};
}
function instance$9($$self, $$props, $$invalidate) {
const omit_props_names = ["visible"];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
let { visible } = $$props;
let isOpen = visible;
let node;
// $: attrs = getAttribs($$restProps)
function toggleDialog(wantOpen) {
console.log('toggle', wantOpen);
if (wantOpen && !isOpen) node.show(); else if (!wantOpen && isOpen) node.hide();
isOpen = wantOpen;
}
function ons_dialog_binding($$value) {
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
node = $$value;
$$invalidate(1, node);
});
}
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(3, $$restProps = compute_rest_props($$props, omit_props_names));
if ('visible' in $$new_props) $$invalidate(0, visible = $$new_props.visible);
if ('$$scope' in $$new_props) $$invalidate(4, $$scope = $$new_props.$$scope);
};
$$self.$$.update = () => {
if ($$self.$$.dirty & /*visible*/ 1) {
toggleDialog(visible);
}
};
return [visible, node, events, $$restProps, $$scope, slots, ons_dialog_binding];
}
class Dialog extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$9, create_fragment$9, safe_not_equal, { visible: 0 });
}
}
/* src\Fab.svelte generated by Svelte v3.43.2 */
function create_fragment$a(ctx) {
let ons_fab;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[3].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[2], null);
let ons_fab_levels = [/*$$restProps*/ ctx[1]];
let ons_fab_data = {};
for (let i = 0; i < ons_fab_levels.length; i += 1) {
ons_fab_data = assign(ons_fab_data, ons_fab_levels[i]);
}
return {
c() {
ons_fab = element("ons-fab");
if (default_slot) default_slot.c();
set_attributes(ons_fab, ons_fab_data);
},
m(target, anchor) {
insert(target, ons_fab, anchor);
if (default_slot) {
default_slot.m(ons_fab, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[0].call(null, ons_fab));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 4)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[2],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[2])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[2], dirty, null),
null
);
}
}
set_attributes(ons_fab, ons_fab_data = get_spread_update(ons_fab_levels, [dirty & /*$$restProps*/ 2 && /*$$restProps*/ ctx[1]]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_fab);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function instance$a($$self, $$props, $$invalidate) {
const omit_props_names = [];
let $$restProps = compute_rest_props($$props, omit_props_names);
let { $$slots: slots = {}, $$scope } = $$props;
const events = getEventsAction();
$$self.$$set = $$new_props => {
$$props = assign(assign({}, $$props), exclude_internal_props($$new_props));
$$invalidate(1, $$restProps = compute_rest_props($$props, omit_props_names));
if ('$$scope' in $$new_props) $$invalidate(2, $$scope = $$new_props.$$scope);
};
return [events, $$restProps, $$scope, slots];
}
class Fab extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance$a, create_fragment$a, safe_not_equal, {});
}
}
/* src\Icon.svelte generated by Svelte v3.43.2 */
function create_fragment$b(ctx) {
let ons_icon;
let events_action;
let current;
let mounted;
let dispose;
const default_slot_template = /*#slots*/ ctx[7].default;
const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[6], null);
let ons_icon_levels = [{ size: /*_size*/ ctx[1] }, { icon: /*_icon*/ ctx[0] }, /*$$restProps*/ ctx[3]];
let ons_icon_data = {};
for (let i = 0; i < ons_icon_levels.length; i += 1) {
ons_icon_data = assign(ons_icon_data, ons_icon_levels[i]);
}
return {
c() {
ons_icon = element("ons-icon");
if (default_slot) default_slot.c();
set_attributes(ons_icon, ons_icon_data);
},
m(target, anchor) {
insert(target, ons_icon, anchor);
if (default_slot) {
default_slot.m(ons_icon, null);
}
current = true;
if (!mounted) {
dispose = action_destroyer(events_action = /*events*/ ctx[2].call(null, ons_icon));
mounted = true;
}
},
p(ctx, [dirty]) {
if (default_slot) {
if (default_slot.p && (!current || dirty & /*$$scope*/ 64)) {
update_slot_base(
default_slot,
default_slot_template,
ctx,
/*$$scope*/ ctx[6],
!current
? get_all_dirty_from_scope(/*$$scope*/ ctx[6])
: get_slot_changes(default_slot_template, /*$$scope*/ ctx[6], dirty, null),
null
);
}
}
set_attributes(ons_icon, ons_icon_data = get_spread_update(ons_icon_levels, [
(!current || dirty & /*_size*/ 2) && { size: /*_size*/ ctx[1] },
(!current || dirty & /*_icon*/ 1) && { icon: /*_icon*/ ctx[0] },
dirty & /*$$restProps*/ 8 && /*$$restProps*/ ctx[3]
]));
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (detaching) detach(ons_icon);
if (default_slot) default_slot.d(detaching);
mounted = false;
dispose();
}
};
}
function getIcon(i