1
0
Fork 0
mirror of synced 2024-09-17 09:49:11 +12:00
budibase/packages/server/appPackages/testApp/public/unauthenticated/index.js

2010 lines
150 KiB
JavaScript
Raw Normal View History

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 create_slot(definition, ctx, fn) {
if (definition) {
const slot_ctx = get_slot_context(definition, ctx, fn);
return definition[0](slot_ctx);
}
}
function get_slot_context(definition, ctx, fn) {
return definition[1]
? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {})))
: ctx.$$scope.ctx;
}
function get_slot_changes(definition, ctx, changed, fn) {
return definition[1]
? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})))
: ctx.$$scope.changed || {};
}
function null_to_empty(value) {
return value == null ? '' : value;
}
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 svg_element(name) {
return document.createElementNS('http://www.w3.org/2000/svg', 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 attr(node, attribute, value) {
if (value == null)
node.removeAttribute(attribute);
else
node.setAttribute(attribute, value);
}
function children(element) {
return Array.from(element.childNodes);
}
function claim_element(nodes, name, attributes, svg) {
for (let i = 0; i < nodes.length; i += 1) {
const node = nodes[i];
if (node.nodeName === name) {
for (let j = 0; j < node.attributes.length; j += 1) {
const attribute = node.attributes[j];
if (!attributes[attribute.name])
node.removeAttribute(attribute.name);
}
return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes
}
}
return svg ? svg_element(name) : element(name);
}
function claim_text(nodes, data) {
for (let i = 0; i < nodes.length; i += 1) {
const node = nodes[i];
if (node.nodeType === 3) {
node.data = '' + data;
return nodes.splice(i, 1)[0];
}
}
return text(data);
}
function claim_space(nodes) {
return claim_text(nodes, ' ');
}
function set_data(text, data) {
data = '' + data;
if (text.data !== data)
text.data = data;
}
function set_input_value(input, value) {
if (value != null || input.value) {
input.value = value;
}
}
function set_style(node, key, value, important) {
node.style.setProperty(key, value, important ? 'important' : '');
}
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) {
callbacks.slice().forEach(fn => fn(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 add_render_callback(fn) {
render_callbacks.push(fn);
}
function flush() {
const seen_callbacks = new Set();
do {
// first, call beforeUpdate functions
// and update components
while (dirty_components.length) {
const component = dirty_components.shift();
set_current_component(component);
update(component.$$);
}
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)) {
callback();
// ...so guard against infinite loops
seen_callbacks.add(callback);
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
}
function update($$) {
if ($$.fragment) {
$$.update($$.dirty);
run_all($$.before_update);
$$.fragment.p($$.dirty, $$.ctx);
$$.dirty = null;
$$.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 mount_component(component, target, anchor) {
const { fragment, on_mount, on_destroy, after_update } = component.$$;
fragment.m(target, anchor);
// 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) {
if (component.$$.fragment) {
run_all(component.$$.on_destroy);
component.$$.fragment.d(detaching);
// TODO null out other refs, including component.$$ (but need to
// preserve final state?)
component.$$.on_destroy = component.$$.fragment = null;
component.$$.ctx = {};
}
}
function make_dirty(component, key) {
if (!component.$$.dirty) {
dirty_components.push(component);
schedule_update();
component.$$.dirty = blank_object();
}
component.$$.dirty[key] = true;
}
function init(component, options, instance, create_fragment, not_equal, prop_names) {
const parent_component = current_component;
set_current_component(component);
const props = options.props || {};
const $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: prop_names,
update: noop,
not_equal,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_update: [],
after_update: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: null
};
let ready = false;
$$.ctx = instance
? instance(component, props, (key, ret, value = ret) => {
if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) {
if ($$.bound[key])
$$.bound[key](value);
if (ready)
make_dirty(component, key);
}
return ret;
})
: props;
$$.update();
ready = true;
run_all($$.before_update);
$$.fragment = create_fragment($$.ctx);
if (options.target) {
if (options.hydrate) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment.l(children(options.target));
}
else {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
$$.fragment.c();
}
if (options.intro)
transition_in(component.$$.fragment);
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
let SvelteElement;
if (typeof HTMLElement !== 'undefined') {
SvelteElement = class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
// @ts-ignore todo: improve typings
for (const key in this.$$.slotted) {
// @ts-ignore todo: improve typings
this.appendChild(this.$$.slotted[key]);
}
}
attributeChangedCallback(attr, _oldValue, newValue) {
this[attr] = newValue;
}
$destroy() {
destroy_component(this, 1);
this.$destroy = noop;
}
$on(type, callback) {
// TODO should this delegate to addEventListener?
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() {
// overridden by instance, if it has props
}
};
}
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() {
// overridden by instance, if it has props
}
}
/* src\Button.svelte generated by Svelte v3.12.1 */
function add_css() {
var style = element("style");
style.id = 'svelte-1q8lga0-style';
style.textContent = ".default.svelte-1q8lga0{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default.svelte-1q8lga0:active{background-color:#ddd}.default.svelte-1q8lga0:focus{border-color:#666}";
append(document.head, style);
}
// (30:4) {:else}
function create_else_block(ctx) {
var current;
const default_slot_template = ctx.$$slots.default;
const default_slot = create_slot(default_slot_template, ctx, null);
return {
c() {
if (default_slot) default_slot.c();
},
l(nodes) {
if (default_slot) default_slot.l(nodes);
},
m(target, anchor) {
if (default_slot) {
default_slot.m(target, anchor);
}
current = true;
},
p(changed, ctx) {
if (default_slot && default_slot.p && changed.$$scope) {
default_slot.p(
get_slot_changes(default_slot_template, ctx, changed, null),
get_slot_context(default_slot_template, ctx, null)
);
}
},
i(local) {
if (current) return;
transition_in(default_slot, local);
current = true;
},
o(local) {
transition_out(default_slot, local);
current = false;
},
d(detaching) {
if (default_slot) default_slot.d(detaching);
}
};
}
// (28:26)
function create_if_block_1(ctx) {
var t;
return {
c() {
t = text(ctx.contentText);
},
l(nodes) {
t = claim_text(nodes, ctx.contentText);
},
m(target, anchor) {
insert(target, t, anchor);
},
p(changed, ctx) {
if (changed.contentText) {
set_data(t, ctx.contentText);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(t);
}
}
};
}
// (25:4) {#if contentComponent && contentComponent._component}
function create_if_block(ctx) {
var div;
return {
c() {
div = element("div");
},
l(nodes) {
div = claim_element(nodes, "DIV", {}, false);
var div_nodes = children(div);
div_nodes.forEach(detach);
},
m(target, anchor) {
insert(target, div, anchor);
ctx.div_binding(div);
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div);
}
ctx.div_binding(null);
}
};
}
function create_fragment(ctx) {
var button, current_block_type_index, if_block, button_class_value, current, dispose;
var if_block_creators = [
create_if_block,
create_if_block_1,
create_else_block
];
var if_blocks = [];
function select_block_type(changed, ctx) {
if (ctx.contentComponent && ctx.contentComponent._component) return 0;
if (ctx.contentText) return 1;
return 2;
}
current_block_type_index = select_block_type(null, ctx);
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
return {
c() {
button = element("button");
if_block.c();
this.h();
},
l(nodes) {
button = claim_element(nodes, "BUTTON", { class: true, disabled: true }, false);
var button_nodes = children(button);
if_block.l(button_nodes);
button_nodes.forEach(detach);
this.h();
},
h() {
attr(button, "class", button_class_value = "" + null_to_empty(ctx.className) + " svelte-1q8lga0");
button.disabled = ctx.disabled;
dispose = listen(button, "click", ctx.clickHandler);
},
m(target, anchor) {
insert(target, button, anchor);
if_blocks[current_block_type_index].m(button, null);
current = true;
},
p(changed, ctx) {
var previous_block_index = current_block_type_index;
current_block_type_index = select_block_type(changed, ctx);
if (current_block_type_index === previous_block_index) {
if_blocks[current_block_type_index].p(changed, ctx);
} else {
group_outros();
transition_out(if_blocks[previous_block_index], 1, 1, () => {
if_blocks[previous_block_index] = null;
});
check_outros();
if_block = if_blocks[current_block_type_index];
if (!if_block) {
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
if_block.c();
}
transition_in(if_block, 1);
if_block.m(button, null);
}
if ((!current || changed.className) && button_class_value !== (button_class_value = "" + null_to_empty(ctx.className) + " svelte-1q8lga0")) {
attr(button, "class", button_class_value);
}
if (!current || changed.disabled) {
button.disabled = ctx.disabled;
}
},
i(local) {
if (current) return;
transition_in(if_block);
current = true;
},
o(local) {
transition_out(if_block);
current = false;
},
d(detaching) {
if (detaching) {
detach(button);
}
if_blocks[current_block_type_index].d();
dispose();
}
};
}
function instance($$self, $$props, $$invalidate) {
let { className = "default", disabled = false, contentText, contentComponent, onClick = () => {} } = $$props;
let { _bb } = $$props;
let contentComponentContainer;
const clickHandler = () => {
if(onClick) onClick();
};
let { $$slots = {}, $$scope } = $$props;
function div_binding($$value) {
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
$$invalidate('contentComponentContainer', contentComponentContainer = $$value);
});
}
$$self.$set = $$props => {
if ('className' in $$props) $$invalidate('className', className = $$props.className);
if ('disabled' in $$props) $$invalidate('disabled', disabled = $$props.disabled);
if ('contentText' in $$props) $$invalidate('contentText', contentText = $$props.contentText);
if ('contentComponent' in $$props) $$invalidate('contentComponent', contentComponent = $$props.contentComponent);
if ('onClick' in $$props) $$invalidate('onClick', onClick = $$props.onClick);
if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb);
if ('$$scope' in $$props) $$invalidate('$$scope', $$scope = $$props.$$scope);
};
$$self.$$.update = ($$dirty = { _bb: 1, contentComponentContainer: 1, contentComponent: 1 }) => {
if ($$dirty._bb || $$dirty.contentComponentContainer || $$dirty.contentComponent) { {
if(_bb && contentComponentContainer && contentComponent._component)
_bb.initialiseComponent(contentComponent, contentComponentContainer);
} }
};
return {
className,
disabled,
contentText,
contentComponent,
onClick,
_bb,
contentComponentContainer,
clickHandler,
div_binding,
$$slots,
$$scope
};
}
class Button extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-1q8lga0-style")) add_css();
init(this, options, instance, create_fragment, safe_not_equal, ["className", "disabled", "contentText", "contentComponent", "onClick", "_bb"]);
}
}
/* src\Textbox.svelte generated by Svelte v3.12.1 */
function add_css$1() {
var style = element("style");
style.id = 'svelte-1ec4wqj-style';
style.textContent = ".default.svelte-1ec4wqj{width:100%;font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default.svelte-1ec4wqj:disabled{color:#ccc}";
append(document.head, style);
}
// (32:0) {:else}
function create_else_block$1(ctx) {
var input, input_class_value;
return {
c() {
input = element("input");
this.h();
},
l(nodes) {
input = claim_element(nodes, "INPUT", { class: true, type: true, value: true }, false);
var input_nodes = children(input);
input_nodes.forEach(detach);
this.h();
},
h() {
attr(input, "class", input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj");
attr(input, "type", "text");
input.value = ctx.actualValue;
},
m(target, anchor) {
insert(target, input, anchor);
},
p(changed, ctx) {
if ((changed.className) && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj")) {
attr(input, "class", input_class_value);
}
if (changed.actualValue) {
input.value = ctx.actualValue;
}
},
d(detaching) {
if (detaching) {
detach(input);
}
}
};
}
// (28:0) {#if hideValue}
function create_if_block$1(ctx) {
var input, input_class_value, dispose;
return {
c() {
input = element("input");
this.h();
},
l(nodes) {
input = claim_element(nodes, "INPUT", { class: true, type: true, value: true }, false);
var input_nodes = children(input);
input_nodes.forEach(detach);
this.h();
},
h() {
attr(input, "class", input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj");
attr(input, "type", "password");
input.value = ctx.actualValue;
dispose = listen(input, "change", ctx.change_handler);
},
m(target, anchor) {
insert(target, input, anchor);
},
p(changed, ctx) {
if ((changed.className) && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj")) {
attr(input, "class", input_class_value);
}
if (changed.actualValue) {
input.value = ctx.actualValue;
}
},
d(detaching) {
if (detaching) {
detach(input);
}
dispose();
}
};
}
function create_fragment$1(ctx) {
var if_block_anchor;
function select_block_type(changed, ctx) {
if (ctx.hideValue) return create_if_block$1;
return create_else_block$1;
}
var current_block_type = select_block_type(null, ctx);
var if_block = current_block_type(ctx);
return {
c() {
if_block.c();
if_block_anchor = empty();
},
l(nodes) {
if_block.l(nodes);
if_block_anchor = empty();
},
m(target, anchor) {
if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
},
p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type(changed, ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(ctx);
if (if_block) {
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
}
},
i: noop,
o: noop,
d(detaching) {
if_block.d(detaching);
if (detaching) {
detach(if_block_anchor);
}
}
};
}
function instance$1($$self, $$props, $$invalidate) {
let { value="", hideValue = false, className = "default", _bb } = $$props;
let actualValue = "";
function change_handler(event) {
bubble($$self, event);
}
$$self.$set = $$props => {
if ('value' in $$props) $$invalidate('value', value = $$props.value);
if ('hideValue' in $$props) $$invalidate('hideValue', hideValue = $$props.hideValue);
if ('className' in $$props) $$invalidate('className', className = $$props.className);
if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb);
};
$$self.$$.update = ($$dirty = { _bb: 1, value: 1 }) => {
if ($$dirty._bb || $$dirty.value) { {
if(_bb && value._isstate) {
_bb.store.subscribe(s => {
$$invalidate('actualValue', actualValue = _bb.store.getValue(s, value));
});
}
} }
};
return {
value,
hideValue,
className,
_bb,
actualValue,
change_handler
};
}
class Textbox extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-1ec4wqj-style")) add_css$1();
init(this, options, instance$1, create_fragment$1, safe_not_equal, ["value", "hideValue", "className", "_bb"]);
}
}
/* src\Form.svelte generated by Svelte v3.12.1 */
function add_css$2() {
var style = element("style");
style.id = 'svelte-m9d6ue-style';
style.textContent = ".form-root.svelte-m9d6ue{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-m9d6ue{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-m9d6ue{grid-column-start:control;padding:5px 10px}.overflow.svelte-m9d6ue{grid-column-start:overflow}.full-width.svelte-m9d6ue{width:100%}";
append(document.head, style);
}
function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx);
child_ctx.child = list[i];
child_ctx.index = i;
return child_ctx;
}
// (30:4) {#each formControls as child, index}
function create_each_block(ctx) {
var div0, t0_value = ctx.labels[ctx.index] + "", t0, t1, div1, index = ctx.index;
const assign_div1 = () => ctx.div1_binding(div1, index);
const unassign_div1 = () => ctx.div1_binding(null, index);
return {
c() {
div0 = element("div");
t0 = text(t0_value);
t1 = space();
div1 = element("div");
this.h();
},
l(nodes) {
div0 = claim_element(nodes, "DIV", { class: true }, false);
var div0_nodes = children(div0);
t0 = claim_text(div0_nodes, t0_value);
div0_nodes.forEach(detach);
t1 = claim_space(nodes);
div1 = claim_element(nodes, "DIV", { class: true }, false);
var div1_nodes = children(div1);
div1_nodes.forEach(detach);
this.h();
},
h() {
attr(div0, "class", "label svelte-m9d6ue");
attr(div1, "class", "control svelte-m9d6ue");
},
m(target, anchor) {
insert(target, div0, anchor);
append(div0, t0);
insert(target, t1, anchor);
insert(target, div1, anchor);
assign_div1();
},
p(changed, new_ctx) {
ctx = new_ctx;
if ((changed.labels) && t0_value !== (t0_value = ctx.labels[ctx.index] + "")) {
set_data(t0, t0_value);
}
if (index !== ctx.index) {
unassign_div1();
index = ctx.index;
assign_div1();
}
},
d(detaching) {
if (detaching) {
detach(div0);
detach(t1);
detach(div1);
}
unassign_div1();
}
};
}
function create_fragment$2(ctx) {
var div, div_class_value;
let each_value = ctx.formControls;
let each_blocks = [];
for (let i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
}
return {
c() {
div = element("div");
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
this.h();
},
l(nodes) {
div = claim_element(nodes, "DIV", { class: true }, false);
var div_nodes = children(div);
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(div_nodes);
}
div_nodes.forEach(detach);
this.h();
},
h() {
attr(div, "class", div_class_value = "form-root " + ctx.containerClass + " svelte-m9d6ue");
},
m(target, anchor) {
insert(target, div, anchor);
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div, null);
}
},
p(changed, ctx) {
if (changed.htmlElements || changed.labels || changed.formControls) {
each_value = ctx.formControls;
let i;
for (i = 0; i < each_value.length; i += 1) {
const child_ctx = get_each_context(ctx, each_value, i);
if (each_blocks[i]) {
each_blocks[i].p(changed, child_ctx);
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(div, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if ((changed.containerClass) && div_class_value !== (div_class_value = "form-root " + ctx.containerClass + " svelte-m9d6ue")) {
attr(div, "class", div_class_value);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div);
}
destroy_each(each_blocks, detaching);
}
};
}
function instance$2($$self, $$props, $$invalidate) {
let { containerClass = "", formControls = [], _bb } = $$props;
let htmlElements = {};
let labels = {};
function div1_binding($$value, index) {
if (htmlElements[index] === $$value) return;
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
htmlElements[index] = $$value;
$$invalidate('htmlElements', htmlElements);
});
}
$$self.$set = $$props => {
if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass);
if ('formControls' in $$props) $$invalidate('formControls', formControls = $$props.formControls);
if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb);
};
$$self.$$.update = ($$dirty = { formControls: 1, _bb: 1, htmlElements: 1 }) => {
if ($$dirty.formControls || $$dirty._bb || $$dirty.htmlElements) { {
let cIndex = 0;
for(let c of formControls) {
$$invalidate('labels', labels[cIndex] = c.label, labels);
cIndex++;
}
if(_bb && htmlElements) {
for(let el in htmlElements) {
_bb.initialiseComponent(
formControls[el].control,
htmlElements[el]
);
}
}
} }
};
return {
containerClass,
formControls,
_bb,
htmlElements,
labels,
div1_binding
};
}
class Form extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-m9d6ue-style")) add_css$2();
init(this, options, instance$2, create_fragment$2, safe_not_equal, ["containerClass", "formControls", "_bb"]);
}
}
/* src\Login.svelte generated by Svelte v3.12.1 */
function add_css$3() {
var style = element("style");
style.id = 'svelte-crnq0a-style';
style.textContent = ".root.svelte-crnq0a{height:100%;display:grid;grid-template-columns:[left] 1fr [middle] auto [right] 1fr;grid-template-rows:[top] 1fr [center] auto [bottom] 1fr}.content.svelte-crnq0a{grid-column-start:middle;grid-row-start:center;width:400px}.logo-container.svelte-crnq0a{margin-bottom:20px\n}.logo-container.svelte-crnq0a>img.svelte-crnq0a{max-width:100%}.login-button-container.svelte-crnq0a{text-align:right;margin-top:20px}.incorrect-details-panel.svelte-crnq0a{margin-top:30px;padding:10px;border-style:solid;border-width:1px;border-color:maroon;border-radius:1px;text-align:center;color:maroon;background-color:mistyrose}.form-root.svelte-crnq0a{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-crnq0a{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-crnq0a{grid-column-start:control;padding:5px 10px}.default-input.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default-button.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default-button.svelte-crnq0a:active{background-color:#ddd}.default-button.svelte-crnq0a:focus{border-color:#666}";
append(document.head, style);
}
// (57:8) {#if _logo}
function create_if_block_1$1(ctx) {
var div, img;
return {
c() {
div = element("div");
img = element("img");
this.h();
},
l(nodes) {
div = claim_element(nodes, "DIV", { class: true }, false);
var div_nodes = children(div);
img = claim_element(div_nodes, "IMG", { src: true, alt: true, class: true }, false);
var img_nodes = children(img);
img_nodes.forEach(detach);
div_nodes.forEach(detach);
this.h();
},
h() {
attr(img, "src", ctx._logo);
attr(img, "alt", "logo");
attr(img, "class", "svelte-crnq0a");
attr(div, "class", "logo-container svelte-crnq0a");
},
m(target, anchor) {
insert(target, div, anchor);
append(div, img);
},
p(changed, ctx) {
if (changed._logo) {
attr(img, "src", ctx._logo);
}
},
d(detaching) {
if (detaching) {
detach(div);
}
}
};
}
// (86:8) {#if incorrect}
function create_if_block$2(ctx) {
var div, t;
return {
c() {
div = element("div");
t = text("Incorrect username or password");
this.h();
},
l(nodes) {
div = claim_element(nodes, "DIV", { class: true }, false);
var div_nodes = children(div);
t = claim_text(div_nodes, "Incorrect username or password");
div_nodes.forEach(detach);
this.h();
},
h() {
attr(div, "class", "incorrect-details-panel svelte-crnq0a");
},
m(target, anchor) {
insert(target, div, anchor);
append(div, t);
},
d(detaching) {
if (detaching) {
detach(div);
}
}
};
}
function create_fragment$3(ctx) {
var div7, div6, t0, div4, div0, t1, t2, div1, input0, input0_class_value, t3, div2, t4, t5, div3, input1, input1_class_value, t6, div5, button, t7, button_class_value, t8, dispose;
var if_block0 = (ctx._logo) && create_if_block_1$1(ctx);
var if_block1 = (ctx.incorrect) && create_if_block$2();
return {
c() {
div7 = element("div");
div6 = element("div");
if (if_block0) if_block0.c();
t0 = space();
div4 = element("div");
div0 = element("div");
t1 = text(ctx.usernameLabel);
t2 = space();
div1 = element("div");
input0 = element("input");
t3 = space();
div2 = element("div");
t4 = text(ctx.passwordLabel);
t5 = space();
div3 = element("div");
input1 = element("input");
t6 = space();
div5 = element("div");
button = element("button");
t7 = text(ctx.loginButtonLabel);
t8 = space();
if (if_block1) if_block1.c();
this.h();
},
l(nodes) {
div7 = claim_element(nodes, "DIV", { class: true }, false);
var div7_nodes = children(div7);
div6 = claim_element(div7_nodes, "DIV", { class: true }, false);
var div6_nodes = children(div6);
if (if_block0) if_block0.l(div6_nodes);
t0 = claim_space(div6_nodes);
div4 = claim_element(div6_nodes, "DIV", { class: true }, false);
var div4_nodes = children(div4);
div0 = claim_element(div4_nodes, "DIV", { class: true }, false);
var div0_nodes = children(div0);
t1 = claim_text(div0_nodes, ctx.usernameLabel);
div0_nodes.forEach(detach);
t2 = claim_space(div4_nodes);
div1 = claim_element(div4_nodes, "DIV", { class: true }, false);
var div1_nodes = children(div1);
input0 = claim_element(div1_nodes, "INPUT", { type: true, class: true }, false);
var input0_nodes = children(input0);
input0_nodes.forEach(detach);
div1_nodes.forEach(detach);
t3 = claim_space(div4_nodes);
div2 = claim_element(div4_nodes, "DIV", { class: true }, false);
var div2_nodes = children(div2);
t4 = claim_text(div2_nodes, ctx.passwordLabel);
div2_nodes.forEach(detach);
t5 = claim_space(div4_nodes);
div3 = claim_element(div4_nodes, "DIV", { class: true }, false);
var div3_nodes = children(div3);
input1 = claim_element(div3_nodes, "INPUT", { type: true, class: true }, false);
var input1_nodes = children(input1);
input1_nodes.forEach(detach);
div3_nodes.forEach(detach);
div4_nodes.forEach(detach);
t6 = claim_space(div6_nodes);
div5 = claim_element(div6_nodes, "DIV", { class: true }, false);
var div5_nodes = children(div5);
button = claim_element(div5_nodes, "BUTTON", { disabled: true, class: true }, false);
var button_nodes = children(button);
t7 = claim_text(button_nodes, ctx.loginButtonLabel);
button_nodes.forEach(detach);
div5_nodes.forEach(detach);
t8 = claim_space(div6_nodes);
if (if_block1) if_block1.l(div6_nodes);
div6_nodes.forEach(detach);
div7_nodes.forEach(detach);
this.h();
},
h() {
attr(div0, "class", "label svelte-crnq0a");
attr(input0, "type", "text");
attr(input0, "class", input0_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a");
attr(div1, "class", "control svelte-crnq0a");
attr(div2, "class", "label svelte-crnq0a");
attr(input1, "type", "password");
attr(input1, "class", input1_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a");
attr(div3, "class", "control svelte-crnq0a");
attr(div4, "class", "form-root svelte-crnq0a");
button.disabled = ctx.busy;
attr(button, "class", button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a");
attr(div5, "class", "login-button-container svelte-crnq0a");
attr(div6, "class", "content svelte-crnq0a");
attr(div7, "class", "root svelte-crnq0a");
dispose = [
listen(input0, "input", ctx.input0_input_handler),
listen(input1, "input", ctx.input1_input_handler),
listen(button, "click", ctx.login)
];
},
m(target, anchor) {
insert(target, div7, anchor);
append(div7, div6);
if (if_block0) if_block0.m(div6, null);
append(div6, t0);
append(div6, div4);
append(div4, div0);
append(div0, t1);
append(div4, t2);
append(div4, div1);
append(div1, input0);
set_input_value(input0, ctx.username);
append(div4, t3);
append(div4, div2);
append(div2, t4);
append(div4, t5);
append(div4, div3);
append(div3, input1);
set_input_value(input1, ctx.password);
append(div6, t6);
append(div6, div5);
append(div5, button);
append(button, t7);
append(div6, t8);
if (if_block1) if_block1.m(div6, null);
},
p(changed, ctx) {
if (ctx._logo) {
if (if_block0) {
if_block0.p(changed, ctx);
} else {
if_block0 = create_if_block_1$1(ctx);
if_block0.c();
if_block0.m(div6, t0);
}
} else if (if_block0) {
if_block0.d(1);
if_block0 = null;
}
if (changed.usernameLabel) {
set_data(t1, ctx.usernameLabel);
}
if (changed.username && (input0.value !== ctx.username)) set_input_value(input0, ctx.username);
if ((changed._inputClass) && input0_class_value !== (input0_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a")) {
attr(input0, "class", input0_class_value);
}
if (changed.passwordLabel) {
set_data(t4, ctx.passwordLabel);
}
if (changed.password && (input1.value !== ctx.password)) set_input_value(input1, ctx.password);
if ((changed._inputClass) && input1_class_value !== (input1_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a")) {
attr(input1, "class", input1_class_value);
}
if (changed.loginButtonLabel) {
set_data(t7, ctx.loginButtonLabel);
}
if (changed.busy) {
button.disabled = ctx.busy;
}
if ((changed._buttonClass) && button_class_value !== (button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a")) {
attr(button, "class", button_class_value);
}
if (ctx.incorrect) {
if (!if_block1) {
if_block1 = create_if_block$2();
if_block1.c();
if_block1.m(div6, null);
}
} else if (if_block1) {
if_block1.d(1);
if_block1 = null;
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div7);
}
if (if_block0) if_block0.d();
if (if_block1) if_block1.d();
run_all(dispose);
}
};
}
function instance$3($$self, $$props, $$invalidate) {
let { usernameLabel = "Username", passwordLabel = "Password", loginButtonLabel = "Login", loginRedirect = "", logo = "", buttonClass = "", inputClass="", _bb } = $$props;
let username = "";
let password = "";
let busy = false;
let incorrect = false;
let _logo = "";
let _buttonClass = "";
let _inputClass = "";
const login = () => {
$$invalidate('busy', busy = true);
_bb.api.post("/api/authenticate", {username, password})
.then(r => {
$$invalidate('busy', busy = false);
if(r.status === 200) {
return r.json();
} else {
$$invalidate('incorrect', incorrect = true);
return;
}
})
.then(user => {
if(user) {
localStorage.setItem("budibase:user", user);
location.reload();
}
});
};
function input0_input_handler() {
username = this.value;
$$invalidate('username', username);
}
function input1_input_handler() {
password = this.value;
$$invalidate('password', password);
}
$$self.$set = $$props => {
if ('usernameLabel' in $$props) $$invalidate('usernameLabel', usernameLabel = $$props.usernameLabel);
if ('passwordLabel' in $$props) $$invalidate('passwordLabel', passwordLabel = $$props.passwordLabel);
if ('loginButtonLabel' in $$props) $$invalidate('loginButtonLabel', loginButtonLabel = $$props.loginButtonLabel);
if ('loginRedirect' in $$props) $$invalidate('loginRedirect', loginRedirect = $$props.loginRedirect);
if ('logo' in $$props) $$invalidate('logo', logo = $$props.logo);
if ('buttonClass' in $$props) $$invalidate('buttonClass', buttonClass = $$props.buttonClass);
if ('inputClass' in $$props) $$invalidate('inputClass', inputClass = $$props.inputClass);
if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb);
};
$$self.$$.update = ($$dirty = { _bb: 1, logo: 1, buttonClass: 1, inputClass: 1 }) => {
if ($$dirty._bb || $$dirty.logo || $$dirty.buttonClass || $$dirty.inputClass) { {
$$invalidate('_logo', _logo = _bb.relativeUrl(logo));
$$invalidate('_buttonClass', _buttonClass = buttonClass || "default-button");
$$invalidate('_inputClass', _inputClass = inputClass || "default-input");
} }
};
return {
usernameLabel,
passwordLabel,
loginButtonLabel,
loginRedirect,
logo,
buttonClass,
inputClass,
_bb,
username,
password,
busy,
incorrect,
_logo,
_buttonClass,
_inputClass,
login,
input0_input_handler,
input1_input_handler
};
}
class Login extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-crnq0a-style")) add_css$3();
init(this, options, instance$3, create_fragment$3, safe_not_equal, ["usernameLabel", "passwordLabel", "loginButtonLabel", "loginRedirect", "logo", "buttonClass", "inputClass", "_bb"]);
}
}
const buildStyle = (styles) => {
let str = "";
for(let s in styles) {
if(styles[s]) {
str += `${s}: ${styles[s]}; `;
}
}
return str;
};
/* src\Grid.svelte generated by Svelte v3.12.1 */
function add_css$4() {
var style = element("style");
style.id = 'svelte-10kw8to-style';
style.textContent = ".root.svelte-10kw8to{display:grid}";
append(document.head, style);
}
function get_each_context$1(ctx, list, i) {
const child_ctx = Object.create(ctx);
child_ctx.child = list[i];
child_ctx.index = i;
return child_ctx;
}
// (49:4) {#each children as child, index}
function create_each_block$1(ctx) {
var div, index = ctx.index, div_class_value, div_style_value;
const assign_div = () => ctx.div_binding(div, index);
const unassign_div = () => ctx.div_binding(null, index);
return {
c() {
div = element("div");
this.h();
},
l(nodes) {
div = claim_element(nodes, "DIV", { class: true, style: true }, false);
var div_nodes = children(div);
div_nodes.forEach(detach);
this.h();
},
h() {
attr(div, "class", div_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to");
attr(div, "style", div_style_value = ctx.childStyle(ctx.child));
},
m(target, anchor) {
insert(target, div, anchor);
assign_div();
},
p(changed, new_ctx) {
ctx = new_ctx;
if (index !== ctx.index) {
unassign_div();
index = ctx.index;
assign_div();
}
if ((changed.itemContainerClass) && div_class_value !== (div_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to")) {
attr(div, "class", div_class_value);
}
if ((changed.children) && div_style_value !== (div_style_value = ctx.childStyle(ctx.child))) {
attr(div, "style", div_style_value);
}
},
d(detaching) {
if (detaching) {
detach(div);
}
unassign_div();
}
};
}
function create_fragment$4(ctx) {
var div, div_class_value;
let each_value = ctx.children;
let each_blocks = [];
for (let i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
}
return {
c() {
div = element("div");
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
this.h();
},
l(nodes) {
div = claim_element(nodes, "DIV", { class: true, style: true }, false);
var div_nodes = children(div);
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(div_nodes);
}
div_nodes.forEach(detach);
this.h();
},
h() {
attr(div, "class", div_class_value = "root " + ctx.containerClass + " svelte-10kw8to");
set_style(div, "width", ctx.width);
set_style(div, "height", ctx.height);
set_style(div, "grid-template-columns", ctx.gridTemplateColumns);
set_style(div, "grid-template-rows", ctx.gridTemplateRows);
},
m(target, anchor) {
insert(target, div, anchor);
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div, null);
}
},
p(changed, ctx) {
if (changed.itemContainerClass || changed.childStyle || changed.children || changed.htmlElements) {
each_value = ctx.children;
let i;
for (i = 0; i < each_value.length; i += 1) {
const child_ctx = get_each_context$1(ctx, each_value, i);
if (each_blocks[i]) {
each_blocks[i].p(changed, child_ctx);
} else {
each_blocks[i] = create_each_block$1(child_ctx);
each_blocks[i].c();
each_blocks[i].m(div, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if ((changed.containerClass) && div_class_value !== (div_class_value = "root " + ctx.containerClass + " svelte-10kw8to")) {
attr(div, "class", div_class_value);
}
if (changed.width) {
set_style(div, "width", ctx.width);
}
if (changed.height) {
set_style(div, "height", ctx.height);
}
if (changed.gridTemplateColumns) {
set_style(div, "grid-template-columns", ctx.gridTemplateColumns);
}
if (changed.gridTemplateRows) {
set_style(div, "grid-template-rows", ctx.gridTemplateRows);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div);
}
destroy_each(each_blocks, detaching);
}
};
}
function instance$4($$self, $$props, $$invalidate) {
let { gridTemplateRows ="", gridTemplateColumns ="", children = [], width = "auto", height = "auto", containerClass="", itemContainerClass="", _bb } = $$props;
let htmlElements = {};
const childStyle = child =>
buildStyle({
"grid-column-start": child.gridColumnStart,
"grid-column-end": child.gridColumnEnd,
"grid-column": child.gridColumn,
"grid-row-start": child.gridRowStart,
"grid-row-end": child.gridRowStart,
"grid-row": child.gridRow,
});
function div_binding($$value, index) {
if (htmlElements[index] === $$value) return;
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
htmlElements[index] = $$value;
$$invalidate('htmlElements', htmlElements);
});
}
$$self.$set = $$props => {
if ('gridTemplateRows' in $$props) $$invalidate('gridTemplateRows', gridTemplateRows = $$props.gridTemplateRows);
if ('gridTemplateColumns' in $$props) $$invalidate('gridTemplateColumns', gridTemplateColumns = $$props.gridTemplateColumns);
if ('children' in $$props) $$invalidate('children', children = $$props.children);
if ('width' in $$props) $$invalidate('width', width = $$props.width);
if ('height' in $$props) $$invalidate('height', height = $$props.height);
if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass);
if ('itemContainerClass' in $$props) $$invalidate('itemContainerClass', itemContainerClass = $$props.itemContainerClass);
if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb);
};
$$self.$$.update = ($$dirty = { _bb: 1, htmlElements: 1, children: 1 }) => {
if ($$dirty._bb || $$dirty.htmlElements || $$dirty.children) { {
if(_bb && htmlElements) {
for(let el in htmlElements) {
_bb.initialiseComponent(
children[el].control,
htmlElements[el]
);
}
}
} }
};
return {
gridTemplateRows,
gridTemplateColumns,
children,
width,
height,
containerClass,
itemContainerClass,
_bb,
htmlElements,
childStyle,
div_binding
};
}
class Grid extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-10kw8to-style")) add_css$4();
init(this, options, instance$4, create_fragment$4, safe_not_equal, ["gridTemplateRows", "gridTemplateColumns", "children", "width", "height", "containerClass", "itemContainerClass", "_bb"]);
}
}
/* src\StackPanel.svelte generated by Svelte v3.12.1 */
function add_css$5() {
var style = element("style");
style.id = 'svelte-osi0db-style';
style.textContent = ".horizontal.svelte-osi0db{display:inline-block}.vertical.svelte-osi0db{display:block}";
append(document.head, style);
}
function get_each_context$2(ctx, list, i) {
const child_ctx = Object.create(ctx);
child_ctx.child = list[i];
child_ctx.index = i;
return child_ctx;
}
// (32:4) {#each children as child, index}
function create_each_block$2(ctx) {
var div1, div0, index = ctx.index, div0_class_value, t, div1_class_value;
const assign_div0 = () => ctx.div0_binding(div0, index);
const unassign_div0 = () => ctx.div0_binding(null, index);
return {
c() {
div1 = element("div");
div0 = element("div");
t = space();
this.h();
},
l(nodes) {
div1 = claim_element(nodes, "DIV", { class: true }, false);
var div1_nodes = children(div1);
div0 = claim_element(div1_nodes, "DIV", { class: true }, false);
var div0_nodes = children(div0);
div0_nodes.forEach(detach);
t = claim_space(div1_nodes);
div1_nodes.forEach(detach);
this.h();
},
h() {
attr(div0, "class", div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db");
attr(div1, "class", div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db");
},
m(target, anchor) {
insert(target, div1, anchor);
append(div1, div0);
assign_div0();
append(div1, t);
},
p(changed, new_ctx) {
ctx = new_ctx;
if (index !== ctx.index) {
unassign_div0();
index = ctx.index;
assign_div0();
}
if ((changed.itemContainerClass) && div0_class_value !== (div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db")) {
attr(div0, "class", div0_class_value);
}
if ((changed.direction) && div1_class_value !== (div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db")) {
attr(div1, "class", div1_class_value);
}
},
d(detaching) {
if (detaching) {
detach(div1);
}
unassign_div0();
}
};
}
function create_fragment$5(ctx) {
var div, div_class_value;
let each_value = ctx.children;
let each_blocks = [];
for (let i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
}
return {
c() {
div = element("div");
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
this.h();
},
l(nodes) {
div = claim_element(nodes, "DIV", { class: true, style: true }, false);
var div_nodes = children(div);
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].l(div_nodes);
}
div_nodes.forEach(detach);
this.h();
},
h() {
attr(div, "class", div_class_value = "root " + ctx.containerClass + " svelte-osi0db");
set_style(div, "width", ctx.width);
set_style(div, "height", ctx.height);
},
m(target, anchor) {
insert(target, div, anchor);
for (let i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div, null);
}
},
p(changed, ctx) {
if (changed.direction || changed.itemContainerClass || changed.htmlElements || changed.children) {
each_value = ctx.children;
let i;
for (i = 0; i < each_value.length; i += 1) {
const child_ctx = get_each_context$2(ctx, each_value, i);
if (each_blocks[i]) {
each_blocks[i].p(changed, child_ctx);
} else {
each_blocks[i] = create_each_block$2(child_ctx);
each_blocks[i].c();
each_blocks[i].m(div, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if ((changed.containerClass) && div_class_value !== (div_class_value = "root " + ctx.containerClass + " svelte-osi0db")) {
attr(div, "class", div_class_value);
}
if (changed.width) {
set_style(div, "width", ctx.width);
}
if (changed.height) {
set_style(div, "height", ctx.height);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(div);
}
destroy_each(each_blocks, detaching);
}
};
}
function instance$5($$self, $$props, $$invalidate) {
let { direction = "horizontal", children = [], width = "auto", height = "auto", containerClass="", itemContainerClass="", _bb } = $$props;
let htmlElements = {};
onMount(() => {
if(_bb && htmlElements) {
for(let el in htmlElements) {
_bb.initialiseComponent(
children[el].control,
htmlElements[el]
);
}
}
});
function div0_binding($$value, index) {
if (htmlElements[index] === $$value) return;
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
htmlElements[index] = $$value;
$$invalidate('htmlElements', htmlElements);
});
}
$$self.$set = $$props => {
if ('direction' in $$props) $$invalidate('direction', direction = $$props.direction);
if ('children' in $$props) $$invalidate('children', children = $$props.children);
if ('width' in $$props) $$invalidate('width', width = $$props.width);
if ('height' in $$props) $$invalidate('height', height = $$props.height);
if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass);
if ('itemContainerClass' in $$props) $$invalidate('itemContainerClass', itemContainerClass = $$props.itemContainerClass);
if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb);
};
return {
direction,
children,
width,
height,
containerClass,
itemContainerClass,
_bb,
htmlElements,
div0_binding
};
}
class StackPanel extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-osi0db-style")) add_css$5();
init(this, options, instance$5, create_fragment$5, safe_not_equal, ["direction", "children", "width", "height", "containerClass", "itemContainerClass", "_bb"]);
}
}
export { Button as button, Form as form, Grid as grid, Login as login, StackPanel as stackpanel, Textbox as textbox };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9zdmVsdGUvaW50ZXJuYWwvaW5kZXgubWpzIiwiLi4vc3JjL0J1dHRvbi5zdmVsdGUiLCIuLi9zcmMvVGV4dGJveC5zdmVsdGUiLCIuLi9zcmMvRm9ybS5zdmVsdGUiLCIuLi9zcmMvTG9naW4uc3ZlbHRlIiwiLi4vc3JjL2J1aWxkU3R5bGUuanMiLCIuLi9zcmMvR3JpZC5zdmVsdGUiLCIuLi9zcmMvU3RhY2tQYW5lbC5zdmVsdGUiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gbm9vcCgpIHsgfVxuY29uc3QgaWRlbnRpdHkgPSB4ID0+IHg7XG5mdW5jdGlvbiBhc3NpZ24odGFyLCBzcmMpIHtcbiAgICAvLyBAdHMtaWdub3JlXG4gICAgZm9yIChjb25zdCBrIGluIHNyYylcbiAgICAgICAgdGFyW2tdID0gc3JjW2tdO1xuICAgIHJldHVybiB0YXI7XG59XG5mdW5jdGlvbiBpc19wcm9taXNlKHZhbHVlKSB7XG4gICAgcmV0dXJuIHZhbHVlICYmIHR5cGVvZiB2YWx1ZSA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIHZhbHVlLnRoZW4gPT09ICdmdW5jdGlvbic7XG59XG5mdW5jdGlvbiBhZGRfbG9jYXRpb24oZWxlbWVudCwgZmlsZSwgbGluZSwgY29sdW1uLCBjaGFyKSB7XG4gICAgZWxlbWVudC5fX3N2ZWx0ZV9tZXRhID0ge1xuICAgICAgICBsb2M6IHsgZmlsZSwgbGluZSwgY29sdW1uLCBjaGFyIH1cbiAgICB9O1xufVxuZnVuY3Rpb24gcnVuKGZuKSB7XG4gICAgcmV0dXJuIGZuKCk7XG59XG5mdW5jdGl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