1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-04 13:10:09 +02:00

remove node_modules

This commit is contained in:
s2
2018-05-19 20:19:16 +02:00
parent 460c610361
commit a3f65f089b
1856 changed files with 0 additions and 309697 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,295 +0,0 @@
/* src/PNotifyAnimate.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Animate.defaults);
};
var methods = {
initModule (options) {
this.set(options);
this.setUpAnimations();
},
update () {
this.setUpAnimations();
},
setUpAnimations () {
const {_notice, _options, animate} = this.get();
if (animate) {
_notice.set({'animation': 'none'});
if (!_notice._animateIn) {
_notice._animateIn = _notice.animateIn;
}
if (!_notice._animateOut) {
_notice._animateOut = _notice.animateOut;
}
_notice.animateIn = this.animateIn.bind(this);
_notice.animateOut = this.animateOut.bind(this);
var animSpeed = 250;
if (_options.animateSpeed === 'slow') {
animSpeed = 400;
} else if (_options.animateSpeed === 'fast') {
animSpeed = 100;
} else if (_options.animateSpeed > 0) {
animSpeed = _options.animateSpeed;
}
animSpeed = animSpeed / 1000;
_notice.refs.elem.style.WebkitAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.MozAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.animationDuration = animSpeed + 's';
} else if (_notice._animateIn && _notice._animateOut) {
_notice.animateIn = _notice._animateIn;
delete _notice._animateIn;
_notice.animateOut = _notice._animateOut;
delete _notice._animateOut;
}
},
animateIn (callback) {
const {_notice} = this.get();
// Declare that the notice is animating in.
_notice.set({'_animating': 'in'});
const finished = () => {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({'_animatingClass': 'ui-pnotify-in animated'});
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({'_animating': false});
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({'_animatingClass': 'ui-pnotify-in animated ' + this.get().inClass});
},
animateOut (callback) {
const {_notice} = this.get();
// Declare that the notice is animating out.
_notice.set({'_animating': 'out'});
const finished = () => {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({'_animatingClass': 'animated'});
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({'_animating': false});
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({'_animatingClass': 'ui-pnotify-in animated ' + this.get().outClass});
}
};
function setup(Component) {
Component.key = 'Animate';
Component.defaults = {
// Use animate.css to animate the notice.
animate: false,
// The class to use to animate the notice in.
inClass: '',
// The class to use to animate the notice out.
outClass: ''
};
Component.init = (notice) => {
notice.attention = (aniClass, callback) => {
const cb = () => {
notice.refs.container.removeEventListener('webkitAnimationEnd', cb);
notice.refs.container.removeEventListener('mozAnimationEnd', cb);
notice.refs.container.removeEventListener('MSAnimationEnd', cb);
notice.refs.container.removeEventListener('oanimationend', cb);
notice.refs.container.removeEventListener('animationend', cb);
notice.refs.container.classList.remove(aniClass);
if (callback) {
callback.call(notice);
}
};
notice.refs.container.addEventListener('webkitAnimationEnd', cb);
notice.refs.container.addEventListener('mozAnimationEnd', cb);
notice.refs.container.addEventListener('MSAnimationEnd', cb);
notice.refs.container.addEventListener('oanimationend', cb);
notice.refs.container.addEventListener('animationend', cb);
notice.refs.container.classList.add('animated');
notice.refs.container.classList.add(aniClass);
};
return new Component({target: document.body});
};
// Register the module with PNotify.
PNotify.modules.Animate = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyAnimate(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyAnimate.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyAnimate.prototype, methods);
PNotifyAnimate.prototype._recompute = noop;
setup(PNotifyAnimate);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
export default PNotifyAnimate;

File diff suppressed because one or more lines are too long

View File

@@ -1,508 +0,0 @@
/* src/PNotifyButtons.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function _showSticker({ sticker, _notice }) {
return sticker && !(_notice && _notice.refs.elem.classList.contains('nonblock'));
}
function _showCloser({ closer, _notice }) {
return closer && !(_notice && _notice.refs.elem.classList.contains('nonblock'));
}
function _pinUpClass({ classes, _notice }) {
return _notice ? (classes.pinUp === null ? _notice.get()._icons.pinUp : classes.pinUp) : '';
}
function _pinDownClass({ classes, _notice }) {
return _notice ? (classes.pinDown === null ? _notice.get()._icons.pinDown : classes.pinDown) : '';
}
function _closerClass({ classes, _notice }) {
return _notice ? (classes.closer === null ? _notice.get()._icons.closer : classes.closer) : '';
}
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Buttons.defaults);
};
var methods = {
initModule (options) {
this.set(options);
const {_notice} = this.get();
_notice.on('mouseenter', () => this.set({'_mouseIsIn': true}));
_notice.on('mouseleave', () => this.set({'_mouseIsIn': false}));
_notice.on('state', ({changed, current}) => {
if (!changed.hide) {
return;
}
const {sticker} = this.get();
if (!sticker) {
return;
}
// Font Awesome 5 replaces our lovely element with a gross SVG. In
// order to make it play nice with Svelte, we have to clear the
// element and make it again.
const icon = current.hide ? this.get().classes.pinUp : this.get().classes.pinDown;
if (
(this.get()._notice.get().icons === 'fontawesome5') ||
(typeof icon === 'string' && icon.match(/(^| )fa[srlb]($| )/))
) {
this.set({'sticker': false});
this.set({'sticker': true});
}
});
},
handleStickerClick () {
const {_notice} = this.get();
_notice.update({hide: !_notice.get().hide});
},
handleCloserClick () {
this.get()._notice.close(false);
this.set({'_mouseIsIn': false});
}
};
function oncreate() {
this.fire('init', {module: this});
};
function setup(Component) {
Component.key = 'Buttons';
Component.defaults = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closerHover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
stickerHover: true,
// The various displayed text, helps facilitating internationalization.
labels: {
close: 'Close',
stick: 'Stick',
unstick: 'Unstick'
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pinUp: null,
pinDown: null
}
};
// Register the module with PNotify.
PNotify.modules.Buttons = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
// Add button icons to icons objects.
Object.assign(PNotify.icons.brighttheme, {
closer: 'brighttheme-icon-closer',
pinUp: 'brighttheme-icon-sticker',
pinDown: 'brighttheme-icon-sticker brighttheme-icon-stuck'
});
Object.assign(PNotify.icons.bootstrap3, {
closer: 'glyphicon glyphicon-remove',
pinUp: 'glyphicon glyphicon-pause',
pinDown: 'glyphicon glyphicon-play'
});
Object.assign(PNotify.icons.fontawesome4, {
closer: 'fa fa-times',
pinUp: 'fa fa-pause',
pinDown: 'fa fa-play'
});
Object.assign(PNotify.icons.fontawesome5, {
closer: 'fas fa-times',
pinUp: 'fas fa-pause',
pinDown: 'fas fa-play'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1yjle82-style';
style.textContent = ".ui-pnotify-closer.svelte-1yjle82,.ui-pnotify-sticker.svelte-1yjle82{float:right;margin-left:.5em;cursor:pointer}[dir=rtl] .ui-pnotify-closer,[dir=rtl] .ui-pnotify-sticker{float:left;margin-right:.5em;margin-left:0}.ui-pnotify-buttons-hidden.svelte-1yjle82{visibility:hidden}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var text, if_block_1_anchor;
var if_block = (ctx._showCloser) && create_if_block(component, ctx);
var if_block_1 = (ctx._showSticker) && create_if_block_1(component, ctx);
return {
c() {
if (if_block) if_block.c();
text = createText("\n");
if (if_block_1) if_block_1.c();
if_block_1_anchor = createComment();
},
m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(text, target, anchor);
if (if_block_1) if_block_1.m(target, anchor);
insertNode(if_block_1_anchor, target, anchor);
},
p(changed, ctx) {
if (ctx._showCloser) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(text.parentNode, text);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (ctx._showSticker) {
if (if_block_1) {
if_block_1.p(changed, ctx);
} else {
if_block_1 = create_if_block_1(component, ctx);
if_block_1.c();
if_block_1.m(if_block_1_anchor.parentNode, if_block_1_anchor);
}
} else if (if_block_1) {
if_block_1.d(1);
if_block_1 = null;
}
},
d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(text);
}
if (if_block_1) if_block_1.d(detach);
if (detach) {
detachNode(if_block_1_anchor);
}
}
};
}
// (1:0) {#if _showCloser}
function create_if_block(component, ctx) {
var div, span, div_class_value, div_title_value;
function click_handler(event) {
component.handleCloserClick();
}
return {
c() {
div = createElement("div");
span = createElement("span");
span.className = "" + ctx._closerClass + " svelte-1yjle82";
addListener(div, "click", click_handler);
div.className = div_class_value = "ui-pnotify-closer " + ((!ctx.closerHover || ctx._mouseIsIn) ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82";
setAttribute(div, "role", "button");
div.tabIndex = "0";
div.title = div_title_value = ctx.labels.close;
},
m(target, anchor) {
insertNode(div, target, anchor);
appendNode(span, div);
},
p(changed, ctx) {
if (changed._closerClass) {
span.className = "" + ctx._closerClass + " svelte-1yjle82";
}
if ((changed.closerHover || changed._mouseIsIn) && div_class_value !== (div_class_value = "ui-pnotify-closer " + ((!ctx.closerHover || ctx._mouseIsIn) ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82")) {
div.className = div_class_value;
}
if ((changed.labels) && div_title_value !== (div_title_value = ctx.labels.close)) {
div.title = div_title_value;
}
},
d(detach) {
if (detach) {
detachNode(div);
}
removeListener(div, "click", click_handler);
}
};
}
// (11:0) {#if _showSticker}
function create_if_block_1(component, ctx) {
var div, span, span_class_value, div_class_value, div_aria_pressed_value, div_title_value;
function click_handler(event) {
component.handleStickerClick();
}
return {
c() {
div = createElement("div");
span = createElement("span");
span.className = span_class_value = "" + (ctx._options.hide ? ctx._pinUpClass : ctx._pinDownClass) + " svelte-1yjle82";
addListener(div, "click", click_handler);
div.className = div_class_value = "ui-pnotify-sticker " + ((!ctx.stickerHover || ctx._mouseIsIn) ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82";
setAttribute(div, "role", "button");
setAttribute(div, "aria-pressed", div_aria_pressed_value = ctx._options.hide);
div.tabIndex = "0";
div.title = div_title_value = ctx._options.hide ? ctx.labels.stick : ctx.labels.unstick;
},
m(target, anchor) {
insertNode(div, target, anchor);
appendNode(span, div);
},
p(changed, ctx) {
if ((changed._options || changed._pinUpClass || changed._pinDownClass) && span_class_value !== (span_class_value = "" + (ctx._options.hide ? ctx._pinUpClass : ctx._pinDownClass) + " svelte-1yjle82")) {
span.className = span_class_value;
}
if ((changed.stickerHover || changed._mouseIsIn) && div_class_value !== (div_class_value = "ui-pnotify-sticker " + ((!ctx.stickerHover || ctx._mouseIsIn) ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82")) {
div.className = div_class_value;
}
if ((changed._options) && div_aria_pressed_value !== (div_aria_pressed_value = ctx._options.hide)) {
setAttribute(div, "aria-pressed", div_aria_pressed_value);
}
if ((changed._options || changed.labels) && div_title_value !== (div_title_value = ctx._options.hide ? ctx.labels.stick : ctx.labels.unstick)) {
div.title = div_title_value;
}
},
d(detach) {
if (detach) {
detachNode(div);
}
removeListener(div, "click", click_handler);
}
};
}
function PNotifyButtons(options) {
init(this, options);
this._state = assign(data(), options.data);
this._recompute({ sticker: 1, _notice: 1, closer: 1, classes: 1 }, this._state);
this._intro = true;
if (!document.getElementById("svelte-1yjle82-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(() => {
oncreate.call(this);
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyButtons.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyButtons.prototype, methods);
PNotifyButtons.prototype._recompute = function _recompute(changed, state) {
if (changed.sticker || changed._notice) {
if (this._differs(state._showSticker, (state._showSticker = _showSticker(state)))) changed._showSticker = true;
}
if (changed.closer || changed._notice) {
if (this._differs(state._showCloser, (state._showCloser = _showCloser(state)))) changed._showCloser = true;
}
if (changed.classes || changed._notice) {
if (this._differs(state._pinUpClass, (state._pinUpClass = _pinUpClass(state)))) changed._pinUpClass = true;
if (this._differs(state._pinDownClass, (state._pinDownClass = _pinDownClass(state)))) changed._pinDownClass = true;
if (this._differs(state._closerClass, (state._closerClass = _closerClass(state)))) changed._closerClass = true;
}
}
setup(PNotifyButtons);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createText(data) {
return document.createTextNode(data);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function assignTrue(tar, src) {
for (var k in src) tar[k] = 1;
return tar;
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
function noop() {}
export default PNotifyButtons;

File diff suppressed because one or more lines are too long

View File

@@ -1,212 +0,0 @@
/* src/PNotifyCallbacks.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
let _open = PNotify.prototype.open;
let _close = PNotify.prototype.close;
const callbacks = (notice, options, name) => {
let modules = notice ? notice.get().modules : options.modules;
let cbs = (modules && modules.Callbacks) ? modules.Callbacks : {};
return cbs[name] ? cbs[name] : () => true;
};
PNotify.prototype.open = function (...args) {
let ret = callbacks(this, null, 'beforeOpen')(this);
if (ret !== false) {
_open.apply(this, args);
callbacks(this, null, 'afterOpen')(this);
}
};
PNotify.prototype.close = function (timerHide, ...args) {
let ret = callbacks(this, null, 'beforeClose')(this, timerHide);
if (ret !== false) {
_close.apply(this, [timerHide, ...args]);
callbacks(this, null, 'afterClose')(this, timerHide);
}
};
function setup(Component) {
Component.key = 'Callbacks';
Component.getCallbacks = callbacks;
let _alert = PNotify.alert;
let _notice = PNotify.notice;
let _info = PNotify.info;
let _success = PNotify.success;
let _error = PNotify.error;
let init = (original, options) => {
callbacks(null, options, 'beforeInit')(options);
let notice = original(options);
callbacks(notice, null, 'afterInit')(notice);
return notice;
};
PNotify.alert = (options) => {
return init(_alert, options);
};
PNotify.notice = (options) => {
return init(_notice, options);
};
PNotify.info = (options) => {
return init(_info, options);
};
PNotify.success = (options) => {
return init(_success, options);
};
PNotify.error = (options) => {
return init(_error, options);
};
// Register the module with PNotify.
PNotify.modules.Callbacks = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyCallbacks(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyCallbacks.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
PNotifyCallbacks.prototype._recompute = noop;
setup(PNotifyCallbacks);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
export default PNotifyCallbacks;

View File

@@ -1 +0,0 @@
{"version":3,"file":"PNotifyCallbacks.js","sources":["src/PNotifyCallbacks.html"],"sourcesContent":["<script>\n import PNotify from './PNotify.html';\n\n let _open = PNotify.prototype.open;\n let _close = PNotify.prototype.close;\n\n const callbacks = (notice, options, name) => {\n let modules = notice ? notice.get().modules : options.modules;\n let cbs = (modules && modules.Callbacks) ? modules.Callbacks : {};\n return cbs[name] ? cbs[name] : () => true;\n };\n\n PNotify.prototype.open = function (...args) {\n let ret = callbacks(this, null, 'beforeOpen')(this);\n if (ret !== false) {\n _open.apply(this, args);\n callbacks(this, null, 'afterOpen')(this);\n }\n };\n\n PNotify.prototype.close = function (timerHide, ...args) {\n let ret = callbacks(this, null, 'beforeClose')(this, timerHide);\n if (ret !== false) {\n _close.apply(this, [timerHide, ...args]);\n callbacks(this, null, 'afterClose')(this, timerHide);\n }\n };\n\n export default {\n setup (Component) {\n Component.key = 'Callbacks';\n\n Component.getCallbacks = callbacks;\n\n let _alert = PNotify.alert;\n let _notice = PNotify.notice;\n let _info = PNotify.info;\n let _success = PNotify.success;\n let _error = PNotify.error;\n\n let init = (original, options) => {\n callbacks(null, options, 'beforeInit')(options);\n let notice = original(options);\n callbacks(notice, null, 'afterInit')(notice);\n return notice;\n };\n\n PNotify.alert = (options) => {\n return init(_alert, options);\n };\n PNotify.notice = (options) => {\n return init(_notice, options);\n };\n PNotify.info = (options) => {\n return init(_info, options);\n };\n PNotify.success = (options) => {\n return init(_success, options);\n };\n PNotify.error = (options) => {\n return init(_error, options);\n };\n\n // Register the module with PNotify.\n PNotify.modules.Callbacks = Component;\n }\n };\n</script>\n"],"names":[],"mappings":";;;AAGE,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;AACrC,AAAE,IAAI,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;;AAEvC,AAAE,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK;AAC/C,AAAE,EAAE,IAAI,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClE,AAAE,EAAE,IAAI,GAAG,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,GAAG,EAAE,CAAC;AACtE,AAAE,EAAE,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC;AAC9C,AAAE,CAAC,CAAC;;AAEJ,AAAE,OAAO,CAAC,SAAS,CAAC,IAAI,GAAG,UAAU,GAAG,IAAI,EAAE;AAC9C,AAAE,EAAE,IAAI,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC;AACxD,AAAE,EAAE,IAAI,GAAG,KAAK,KAAK,EAAE;AACvB,AAAE,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9B,AAAE,IAAI,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/C,AAAE,GAAG;AACL,AAAE,CAAC,CAAC;;AAEJ,AAAE,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,SAAS,EAAE,GAAG,IAAI,EAAE;AAC1D,AAAE,EAAE,IAAI,GAAG,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACpE,AAAE,EAAE,IAAI,GAAG,KAAK,KAAK,EAAE;AACvB,AAAE,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AAC/C,AAAE,IAAI,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC3D,AAAE,GAAG;AACL,AAAE,CAAC,CAAC;;AAEJ,cACU,CAAC,SAAS,EAAE;AACtB,AAAI,EAAE,SAAS,CAAC,GAAG,GAAG,WAAW,CAAC;;AAElC,AAAI,EAAE,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC;;AAEzC,AAAI,EAAE,IAAI,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;AACjC,AAAI,EAAE,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;AACnC,AAAI,EAAE,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;AAC/B,AAAI,EAAE,IAAI,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;AACrC,AAAI,EAAE,IAAI,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;;AAEjC,AAAI,EAAE,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,OAAO,KAAK;AACxC,AAAI,IAAI,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC;AACxD,AAAI,IAAI,IAAI,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;AACvC,AAAI,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,AAAI,IAAI,OAAO,MAAM,CAAC;AACtB,AAAI,GAAG,CAAC;;AAER,AAAI,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,OAAO,KAAK;AACnC,AAAI,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,AAAI,GAAG,CAAC;AACR,AAAI,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,OAAO,KAAK;AACpC,AAAI,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACtC,AAAI,GAAG,CAAC;AACR,AAAI,EAAE,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,KAAK;AAClC,AAAI,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACpC,AAAI,GAAG,CAAC;AACR,AAAI,EAAE,OAAO,CAAC,OAAO,GAAG,CAAC,OAAO,KAAK;AACrC,AAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvC,AAAI,GAAG,CAAC;AACR,AAAI,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,OAAO,KAAK;AACnC,AAAI,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,AAAI,GAAG,CAAC;;AAER,AAAI;AACJ,AAAI,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;AAC5C,AAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -1,225 +0,0 @@
import PNotify from "./PNotify.js";
// Translate v3 options to v4 options.
const translateOptions = (options, module, moduleName) => {
// Merge the classic default options.
const newOptions = module ? Object.assign({}, moduleName ? PNotifyCompat.prototype.options[moduleName] : {}, options) : Object.assign({}, PNotifyCompat.prototype.options, options);
const translateName = (badName) => {
let goodName = badName;
let underscoreIndex;
while ((underscoreIndex = goodName.indexOf('_')) !== -1) {
goodName = goodName.slice(0, underscoreIndex) + goodName.slice(underscoreIndex + 1, underscoreIndex + 2).toUpperCase() + goodName.slice(underscoreIndex + 2);
}
return goodName;
};
// Translate all options to the new style.
for (let name in newOptions) {
if (newOptions.hasOwnProperty(name) && name.indexOf('_') !== -1) {
const goodName = translateName(name);
newOptions[goodName] = newOptions[name];
delete newOptions[name];
}
}
if (!module) {
// Options that have changed.
if (newOptions.hasOwnProperty('addclass')) {
newOptions.addClass = newOptions.addclass;
delete newOptions.addclass;
}
if (newOptions.hasOwnProperty('cornerclass')) {
newOptions.cornerClass = newOptions.cornerclass;
delete newOptions.cornerClass;
}
if (newOptions.hasOwnProperty('textEscape')) {
newOptions.textTrusted = !newOptions.textEscape;
delete newOptions.textEscape;
}
if (newOptions.hasOwnProperty('titleEscape')) {
newOptions.titleTrusted = !newOptions.titleEscape;
delete newOptions.titleEscape;
}
// Styling and icons.
if (newOptions.hasOwnProperty('styling')) {
if (newOptions.styling === 'bootstrap3') {
newOptions.icons = 'bootstrap3';
} else if (newOptions.styling === 'fontawesome') {
newOptions.styling = 'bootstrap3';
newOptions.icons = 'fontawesome4';
}
}
// Stacks.
if (newOptions.hasOwnProperty('stack')) {
if (newOptions.stack.overlay_close) {
newOptions.stack.overlayClose = newOptions.stack.overlay_close;
}
}
// Translate module options.
newOptions.modules = {};
if (newOptions.hasOwnProperty('animate')) {
newOptions.modules.Animate = translateOptions(newOptions.animate, true, 'animate');
delete newOptions.animate;
}
if (newOptions.hasOwnProperty('buttons')) {
newOptions.modules.Buttons = translateOptions(newOptions.buttons, true, 'buttons');
delete newOptions.buttons;
if (newOptions.modules.Buttons.classes) {
newOptions.modules.Buttons.classes = translateOptions(newOptions.modules.Buttons.classes, true);
}
}
if (newOptions.hasOwnProperty('confirm')) {
newOptions.modules.Confirm = translateOptions(newOptions.confirm, true, 'confirm');
if (newOptions.modules.Confirm.promptDefault) {
newOptions.modules.Confirm.promptValue = newOptions.modules.Confirm.promptDefault;
delete newOptions.modules.Confirm.promptDefault;
}
delete newOptions.confirm;
}
if (newOptions.hasOwnProperty('desktop')) {
newOptions.modules.Desktop = translateOptions(newOptions.desktop, true, 'desktop');
delete newOptions.desktop;
}
if (newOptions.hasOwnProperty('history')) {
newOptions.modules.History = translateOptions(newOptions.history, true, 'history');
delete newOptions.history;
}
if (newOptions.hasOwnProperty('mobile')) {
newOptions.modules.Mobile = translateOptions(newOptions.mobile, true, 'mobile');
delete newOptions.mobile;
}
if (newOptions.hasOwnProperty('nonblock')) {
newOptions.modules.NonBlock = translateOptions(newOptions.nonblock, true, 'nonblock');
delete newOptions.nonblock;
}
if (newOptions.hasOwnProperty('reference')) {
newOptions.modules.Reference = translateOptions(newOptions.reference, true, 'reference');
delete newOptions.reference;
}
if (newOptions.hasOwnProperty('beforeInit')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.beforeInit = newOptions.beforeInit;
delete newOptions.beforeInit;
}
if (newOptions.hasOwnProperty('afterInit')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.afterInit = newOptions.afterInit;
delete newOptions.afterInit;
}
if (newOptions.hasOwnProperty('beforeOpen')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.beforeOpen = newOptions.beforeOpen;
delete newOptions.beforeOpen;
}
if (newOptions.hasOwnProperty('afterOpen')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.afterOpen = newOptions.afterOpen;
delete newOptions.afterOpen;
}
if (newOptions.hasOwnProperty('beforeClose')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.beforeClose = newOptions.beforeClose;
delete newOptions.beforeClose;
}
if (newOptions.hasOwnProperty('afterClose')) {
if (!newOptions.modules.Callbacks) {
newOptions.modules.Callbacks = {};
}
newOptions.modules.Callbacks.afterClose = newOptions.afterClose;
delete newOptions.afterClose;
}
}
return newOptions;
};
// The compatibility class.
class PNotifyCompat extends PNotify {
constructor (options) {
if (typeof options !== 'object') {
options = {'text': options};
}
// These need to be called directly, since we're not using PNotify.alert().
if (PNotify.modules.Callbacks && options.before_init) {
options.before_init(options);
}
options = translateOptions(options);
super({target: document.body, data: options});
// Override the get function to return the element like it did in v3.
const _get = this.get;
this.get = function (option) {
if (option === undefined) {
return Object.assign(window.jQuery ? window.jQuery(this.refs.elem) : this.refs.elem, _get.call(this));
}
return _get.call(this, option);
};
// Confirm module events.
this.on('pnotify.confirm', (e) => {
if (window.jQuery) {
window.jQuery(this.refs.elem).trigger('pnotify.confirm', [this, e.value]);
}
});
this.on('pnotify.cancel', (e) => {
if (window.jQuery) {
window.jQuery(this.refs.elem).trigger('pnotify.cancel', this);
}
});
if (PNotify.modules.Callbacks) {
PNotify.modules.Callbacks.getCallbacks(this, null, 'afterInit')(this);
}
}
update (options) {
options = translateOptions(options);
return super.update(options);
}
}
// Lets you change defaults the old way.
PNotifyCompat.prototype.options = {
text_escape: false,
title_escape: false
};
// Forward static functions.
PNotifyCompat.reload = () => PNotifyCompat;
PNotifyCompat.removeAll = () => PNotify.removeAll();
PNotifyCompat.removeStack = (stack) => PNotify.removeStack(stack);
PNotifyCompat.positionAll = (animate) => PNotify.positionAll(animate);
// Desktop module permission method.
PNotifyCompat.desktop = {
permission: () => {
PNotify.modules.Desktop.permission();
}
};
// Old style showLast() in History module.
if (window.jQuery) {
window.jQuery(() => {
window.jQuery(document.body).on('pnotify.history-last', function () {
PNotify.modules.History.showLast();
});
});
}
export default PNotifyCompat;

View File

@@ -1,753 +0,0 @@
/* src/PNotifyConfirm.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Confirm.defaults);
};
var methods = {
initModule (options) {
this.set(options);
},
afterOpen () {
if (this.get().prompt) {
if (this.get().promptMultiLine) {
this.refs.promptMulti.focus();
} else {
this.refs.promptSingle.focus();
}
}
},
handleClick (button, event) {
if (button.click) {
button.click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
},
handleKeyPress (event) {
if (event.keyCode === 13 && !event.shiftKey) {
event.preventDefault();
const {buttons} = this.get();
for (let i = 0; i < buttons.length; i++) {
if (buttons[i].promptTrigger && buttons[i].click) {
buttons[i].click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
}
}
}
};
function oncreate() {
this.fire('init', {module: this});
};
function setup(Component) {
Component.key = 'Confirm';
Component.defaults = {
// Make a confirmation box.
confirm: false,
// Make a prompt.
prompt: false,
// Classes to add to the input element of the prompt.
promptClass: '',
// The value of the prompt.
promptValue: '',
// Whether the prompt should accept multiple lines of text.
promptMultiLine: false,
// Where to align the buttons. (flex-start, center, flex-end, space-around, space-between)
align: 'flex-end',
// The buttons to display, and their callbacks.
buttons: [
{
text: 'Ok',
textTrusted: false,
addClass: '',
primary: true,
// Whether to trigger this button when the user hits enter in a single line prompt.
promptTrigger: true,
click: (notice, value) => {
notice.close();
notice.fire('pnotify.confirm', {notice, value});
}
},
{
text: 'Cancel',
textTrusted: false,
addClass: '',
click: (notice) => {
notice.close();
notice.fire('pnotify.cancel', {notice});
}
}
]
};
// Register the module with PNotify.
PNotify.modules.Confirm = Component;
// Append this module to the container.
PNotify.modulesAppendContainer.push(Component);
// Add button styles to styling objects.
Object.assign(PNotify.styling.brighttheme, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'brighttheme-primary',
input: ''
});
Object.assign(PNotify.styling.bootstrap3, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-default ui-pnotify-confirm-mx-1',
btnPrimary: 'btn btn-default ui-pnotify-confirm-mx-1 btn-primary',
input: 'form-control'
});
Object.assign(PNotify.styling.bootstrap4, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-secondary mx-1',
btnPrimary: 'btn btn-primary mx-1',
input: 'form-control'
});
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
Object.assign(PNotify.styling.material, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'ui-pnotify-material-primary',
input: ''
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1y9suua-style';
style.textContent = ".ui-pnotify-action-bar.svelte-1y9suua,.ui-pnotify-prompt-bar.svelte-1y9suua{margin-top:5px;clear:both}.ui-pnotify-action-bar.svelte-1y9suua{display:flex;flex-wrap:wrap;justify-content:flex-end}.ui-pnotify-prompt-input.svelte-1y9suua{margin-bottom:5px;display:block;width:100%}.ui-pnotify-confirm-mx-1.svelte-1y9suua{margin:0 5px}.ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml{margin-left:24px}[dir=rtl] .ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml{margin-right:24px;margin-left:0}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var if_block_anchor;
var if_block = (ctx.confirm || ctx.prompt) && create_if_block(component, ctx);
return {
c() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p(changed, ctx) {
if (ctx.confirm || ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
}
}
};
}
// (10:8) {#if promptMultiLine}
function create_if_block_2(component, ctx) {
var textarea, textarea_updating = false, textarea_class_value;
function textarea_input_handler() {
textarea_updating = true;
component.set({ promptValue: textarea.value });
textarea_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c() {
textarea = createElement("textarea");
addListener(textarea, "input", textarea_input_handler);
addListener(textarea, "keypress", keypress_handler);
textarea.rows = "5";
textarea.className = textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m(target, anchor) {
insertNode(textarea, target, anchor);
component.refs.promptMulti = textarea;
textarea.value = ctx.promptValue;
},
p(changed, ctx) {
if (!textarea_updating) textarea.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && textarea_class_value !== (textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
textarea.className = textarea_class_value;
}
},
d(detach) {
if (detach) {
detachNode(textarea);
}
removeListener(textarea, "input", textarea_input_handler);
removeListener(textarea, "keypress", keypress_handler);
if (component.refs.promptMulti === textarea) component.refs.promptMulti = null;
}
};
}
// (21:8) {:else}
function create_if_block_3(component, ctx) {
var input, input_updating = false, input_class_value;
function input_input_handler() {
input_updating = true;
component.set({ promptValue: input.value });
input_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c() {
input = createElement("input");
addListener(input, "input", input_input_handler);
addListener(input, "keypress", keypress_handler);
setAttribute(input, "type", "text");
input.className = input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m(target, anchor) {
insertNode(input, target, anchor);
component.refs.promptSingle = input;
input.value = ctx.promptValue;
},
p(changed, ctx) {
if (!input_updating) input.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && input_class_value !== (input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
input.className = input_class_value;
}
},
d(detach) {
if (detach) {
detachNode(input);
}
removeListener(input, "input", input_input_handler);
removeListener(input, "keypress", keypress_handler);
if (component.refs.promptSingle === input) component.refs.promptSingle = null;
}
};
}
// (3:4) {#if prompt}
function create_if_block_1(component, ctx) {
var div, div_class_value;
function select_block_type(ctx) {
if (ctx.promptMultiLine) return create_if_block_2;
return create_if_block_3;
}
var current_block_type = select_block_type(ctx);
var if_block = current_block_type(component, ctx);
return {
c() {
div = createElement("div");
if_block.c();
div.className = div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
},
m(target, anchor) {
insertNode(div, target, anchor);
if_block.m(div, null);
},
p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(div, null);
}
if ((changed._notice) && div_class_value !== (div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div.className = div_class_value;
}
},
d(detach) {
if (detach) {
detachNode(div);
}
if_block.d();
}
};
}
// (42:6) {#each buttons as button}
function create_each_block(component, ctx) {
var button, button_class_value;
function select_block_type_1(ctx) {
if (ctx.button.textTrusted) return create_if_block_4;
return create_if_block_5;
}
var current_block_type = select_block_type_1(ctx);
var if_block = current_block_type(component, ctx);
return {
c() {
button = createElement("button");
if_block.c();
button._svelte = { component, ctx };
addListener(button, "click", click_handler);
button.type = "button";
button.className = button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? (ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '') : (ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '')) + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua";
},
m(target, anchor) {
insertNode(button, target, anchor);
if_block.m(button, null);
},
p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(button, null);
}
button._svelte.ctx = ctx;
if ((changed.buttons || changed._notice) && button_class_value !== (button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? (ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '') : (ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '')) + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua")) {
button.className = button_class_value;
}
},
d(detach) {
if (detach) {
detachNode(button);
}
if_block.d();
removeListener(button, "click", click_handler);
}
};
}
// (50:14) {#if button.textTrusted}
function create_if_block_4(component, ctx) {
var raw_value = ctx.button.text, raw_before, raw_after;
return {
c() {
raw_before = createElement('noscript');
raw_after = createElement('noscript');
},
m(target, anchor) {
insertNode(raw_before, target, anchor);
raw_before.insertAdjacentHTML("afterend", raw_value);
insertNode(raw_after, target, anchor);
},
p(changed, ctx) {
if ((changed.buttons) && raw_value !== (raw_value = ctx.button.text)) {
detachBetween(raw_before, raw_after);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},
d(detach) {
if (detach) {
detachBetween(raw_before, raw_after);
detachNode(raw_before);
detachNode(raw_after);
}
}
};
}
// (50:57) {:else}
function create_if_block_5(component, ctx) {
var text_value = ctx.button.text, text;
return {
c() {
text = createText(text_value);
},
m(target, anchor) {
insertNode(text, target, anchor);
},
p(changed, ctx) {
if ((changed.buttons) && text_value !== (text_value = ctx.button.text)) {
text.data = text_value;
}
},
d(detach) {
if (detach) {
detachNode(text);
}
}
};
}
// (1:0) {#if confirm || prompt}
function create_if_block(component, ctx) {
var div, text, div_1, div_1_class_value;
var if_block = (ctx.prompt) && create_if_block_1(component, ctx);
var each_value = ctx.buttons;
var each_blocks = [];
for (var i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(component, get_each_context(ctx, each_value, i));
}
return {
c() {
div = createElement("div");
if (if_block) if_block.c();
text = createText("\n ");
div_1 = createElement("div");
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
div_1.className = div_1_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
setStyle(div_1, "justify-content", ctx.align);
div.className = "ui-pnotify-confirm";
},
m(target, anchor) {
insertNode(div, target, anchor);
if (if_block) if_block.m(div, null);
appendNode(text, div);
appendNode(div_1, div);
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div_1, null);
}
},
p(changed, ctx) {
if (ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block_1(component, ctx);
if_block.c();
if_block.m(div, text);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (changed.buttons || changed._notice) {
each_value = ctx.buttons;
for (var 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(component, child_ctx);
each_blocks[i].c();
each_blocks[i].m(div_1, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if ((changed._notice) && div_1_class_value !== (div_1_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div_1.className = div_1_class_value;
}
if (changed.align) {
setStyle(div_1, "justify-content", ctx.align);
}
},
d(detach) {
if (detach) {
detachNode(div);
}
if (if_block) if_block.d();
destroyEach(each_blocks, detach);
}
};
}
function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx);
child_ctx.button = list[i];
child_ctx.each_value = list;
child_ctx.button_index = i;
return child_ctx;
}
function click_handler(event) {
const { component, ctx } = this._svelte;
component.handleClick(ctx.button, event);
}
function PNotifyConfirm(options) {
init(this, options);
this.refs = {};
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1y9suua-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(() => {
oncreate.call(this);
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyConfirm.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyConfirm.prototype, methods);
PNotifyConfirm.prototype._recompute = noop;
setup(PNotifyConfirm);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
}
function detachBetween(before, after) {
while (before.nextSibling && before.nextSibling !== after) {
before.parentNode.removeChild(before.nextSibling);
}
}
function createText(data) {
return document.createTextNode(data);
}
function setStyle(node, key, value) {
node.style.setProperty(key, value);
}
function destroyEach(iterations, detach) {
for (var i = 0; i < iterations.length; i += 1) {
if (iterations[i]) iterations[i].d(detach);
}
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function assignTrue(tar, src) {
for (var k in src) tar[k] = 1;
return tar;
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function noop() {}
function blankObject() {
return Object.create(null);
}
export default PNotifyConfirm;

File diff suppressed because one or more lines are too long

View File

@@ -1,428 +0,0 @@
/* src/PNotifyDesktop.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
let permission;
const Notification = window.Notification;
let notify = (title, options, onclick, onclose) => {
// Memoize based on feature detection.
if ('Notification' in window) {
notify = (title, options, onclick, onclose) => {
const notice = new Notification(title, options);
if ('NotificationEvent' in window) {
notice.addEventListener('notificationclick', onclick);
notice.addEventListener('close', onclose);
} else if ('addEventListener' in notice) {
notice.addEventListener('click', onclick);
notice.addEventListener('close', onclose);
} else {
notice.onclick = onclick;
notice.onclose = onclose;
}
return notice;
};
} else if ('mozNotification' in navigator) {
notify = (title, options, onclick, onclose) => {
// Gecko < 22
const notice = navigator.mozNotification
.createNotification(title, options.body, options.icon)
.show();
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else if ('webkitNotifications' in window) {
notify = (title, options, onclick, onclose) => {
const notice = window.webkitNotifications.createNotification(
options.icon,
title,
options.body
);
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else {
notify = (title, options, onclick, onclose) => {
return null;
};
}
return notify(title, options, onclick, onclose);
};
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Desktop.defaults);
};
var methods = {
initModule (options) {
this.set(options);
const {_notice} = this.get();
// Animation should always be 'none' for desktop notices, but remember
// the old animation so it can be recovered.
this.set({'_oldAnimation': _notice.get().animation});
_notice.on('state', ({changed, current, previous}) => {
if (changed.animation) {
if (
previous.animation === undefined ||
current.animation !== 'none' ||
(
previous.animation === 'none' &&
current.animation !== this.get()._oldAnimation
)
) {
this.set({'_oldAnimation': current.animation});
}
}
// This is necessary so desktop notices don't cause spacing problems
// when positioning.
if (changed._animatingClass) {
if (!(current._animatingClass === '' || (permission !== 0 && this.get().fallback) || !this.get().desktop)) {
_notice.set({'_animatingClass': ''});
}
}
});
if (!this.get().desktop) {
return;
}
permission = PNotify.modules.Desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!this.get().fallback) {
_notice.set({'autoDisplay': false});
}
return;
}
_notice.set({'animation': 'none'});
_notice.addModuleClass('ui-pnotify-desktop-hide');
this.genNotice();
},
update () {
const {_notice} = this.get();
if ((permission !== 0 && this.get().fallback) || !this.get().desktop) {
_notice.set({'animation': this.get()._oldAnimation});
_notice.removeModuleClass('ui-pnotify-desktop-hide');
return;
} else {
_notice.set({'animation': 'none'});
_notice.addModuleClass('ui-pnotify-desktop-hide');
}
this.genNotice();
},
beforeOpen () {
if (this.get().desktop && permission !== 0) {
PNotify.modules.Desktop.permission();
}
if ((permission !== 0 && this.get().fallback) || !this.get().desktop) {
return;
}
const {_desktop} = this.get();
if (_desktop && 'show' in _desktop) {
this.get()._notice.set({'_moduleIsNoticeOpen': true});
_desktop.show();
}
},
beforeClose () {
if ((permission !== 0 && this.get().fallback) || !this.get().desktop) {
return;
}
const {_desktop} = this.get();
if (_desktop && 'close' in _desktop) {
_desktop.close();
this.get()._notice.set({'_moduleIsNoticeOpen': false});
}
},
genNotice () {
const {_notice, icon} = this.get();
if (icon === null) {
switch (_notice.get().type) {
case 'error':
this.set({'_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQg7e6HvQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABr0lEQVRYw8WXu0oDQRSGv7hRSFYrLTTWKihaqUgUJO+gphBLL1jYpPSCVcAggpWthYhC7Ows9An0IbSPkMRCw8ZmFuI6yczs9cAPuzNz5v92brtrESxGARtokkCcAg2hk7jNl4G2R/m4zFPAiwTgWdRFHnmJuaulOAAaPQDqUZvv9DB3tR0lwIcGwHtU5uca5q4qYZvngJbHpAZ8CtU8dS1gLEyAisegBGTFKWiL65KnzVlY5uOSId6VtNuTtMupOu/TAHiQlNmSskHNXCOAGWBeUp7VhFoApoMAXAOWJoCszBJ9+ALY6vL0JiPgjsKmKUAaOOoBZwIAcNxlJLsCrAOTIQJMAWu62y4LOIqT7lGS96TIcYCMDkBZ46h1gB+PHI28ssq8X/G6DaqG8Piz2DrjVjGXbtSBy46F5QAHwJAizwZugKKscs7gSaqS/KpB/qxsFxwafhf6Odb/eblJi8BGwJdW26BtURxQpMU83hmaDQsNiPtvYMSwj3tgAqDgYzU7wJdHjo9+CgBvEW47lV5Tgj5DMtG0xIfESkIAF+522gdWxTzGEX3i9+6KpOMXF5UBt0NKJCAAAAAASUVORK5CYII='});
break;
case 'success':
this.set({'_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQPRj+65AAAAdBJREFUWMPtlzsvRFEQx3+7HmEjoiYKolVJJDRqnS8ggvVIVEQhCIUsEYJGCEH2E4h4FPREaLTbEo1IEJXHrmY2GTf33nPuY7ud5OTenTMz//89Z86ZWShLWf5LB3AOfACFiOMF2AkC3qOc88BXxFEAxlX8ftGdaNCEen8H6oFHYBR4FocwkpTngzzHgF01fwL0aYcp9fVtMW/rsMcWXWijK1Hexgye9smRT6CxaHgjytMYwccNSXqoja9FeVbiZS+OVaeDiUBLAPAJA/i2m5MXgRSQk7llC/DBMOBeBGqAe0eAjQhfvurH3EmgQk6EW6CVEHt+ZFo6J4EU8OoTcF35jhnAl2wSx20LFgyB1yyOWtY2c72ScMAAkPeZy6g4zUBdGAIAcyEq4Z7y7xbdTFgCACMBwPVJqVDHeNqvaplkH5i0sNuUwmaNkQxww20ZSOy7gFvX7SAk0i76jPQQlJoAwAEwq35ngfmwVatSdUMArZZ+K9JQ1Bp6iGqgSt7f/AIOqSzujLEn6AV+JG6zm4HuCZ+AJuAbWAQu5aIJu7JDck0ngDugC/j1c2qPqR13jpxuvWyS8liY/kQcean/lX6ACQ99DdAQYe+Lf0zylMUgf7qDKgzv284QAAAAAElFTkSuQmCC'});
break;
case 'info':
this.set({'_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQ09zRTwAAAAdxJREFUWMPtl88rRFEUxz8zBolRCgsrpOym8TMSO2WplLKwUrKi/B0W7JSFmhVLNlhSlLKx8CtRGpEsJpofpZk3Nkc9b968e++8mdlw6vTeu/edc773nl/3wl+ngOH/zUAf0AN0AmEgB7wCD8AtcFMJoM3ADpAHLHk62RIwL8B0uQwHgXVRnDfkS2DSj/EW4K0Ew05eLMV4O/CuUJwEUvJUgdgwMd4IpBUKl13kVG6aL+ZjJ20DDQqQXy5jKYVMDBhVrb5f069LLrKfGnInqh040HRTvsTAHgei9oGQ7X0YaNNUNCdFKChgQvKtQ1vAkNvEahlSToez9oXad2BCA30ceHZxRxMQMShuvZLmv+hOA32/h+KUwS7MugVhqwb6Go+5nEEwht0ABDUEzyXdFsrQYwqMJjTbdxio9Qkg6QbgvkpnkLw0uQIAZ1UCYNkXawdw4qPCmVBcuADAMZCpAoCVYr3AKtYyHZSWauakjMx50TWwrzJw6lFARjQOt3se8jM6W9TloSCqIb9bRHbN5Fg+KkEZcow/Ak+KFBsD6h3jR8CUabAMlqn7xfxEbAdwWKLhhO3sGPCbOsNSvSyF0Z/5TaCuEleziLhmAOiWG1NWrmZXwIVU1A/+SZO+AcgLC4wt0zD3AAAAAElFTkSuQmCC'});
break;
case 'notice':
default:
this.set({'_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATM4scOJLAAAAcxJREFUWMPtljtLA0EQx3+J0QRfnYqCiCA+MERBrIwgFtoFbMTOR61i5QcQBdEihZWNoEWwsNAvkMJeBLHRQtHC0iIP4utOmw2cx97d7l2SRgcGbufmv/Pf2dmdhb8uIR+YJqAPaBff30AeeAHuxLgqMgRkgS/AAEybGuLfEdBcycCTwKVYmY5mgO6gwdd8BLaqAST9Bs8EDG7VTd3gex4TbgEjwKjQOHDugZlRDb7sMZEJpCS4bYVMJOygsG1cB+wqHN0Gib1RYXFpLwL74nx7Sb3EFlXATQNjTgRagA3FbZIRiCliT5wITGgUaRACA0CPjMC4xtUcDUAgDAzLCCQ0MhALQCAE9MoIdGkQCJIBgE4ZgWiNMvDL10qgUMMMFGQEnjQmkLXbVg38s8y4qtFcTCAnHiJ5oKiJnSoHjVgIXAmHkGIl5yy+YcWruIy9dvqpupIDCfZWEXvh1gsWFVfxIbG9a3RbRwJnYiuqJYfAqxsBgBWFiQyJzfTAlIB1uzEicbwBFoBTl8lSwINoSuXKjrv4F4FBh61zlKUKvgn7/e5ZEngMEDgLdFSieHaAT42LpgTMVbqC24B54Bi4twV9E6cnDcw6PFj+RSo/l6rlSlldhx4AAAAASUVORK5CYII='});
break;
}
} else if (icon === false) {
this.set({'_icon': null});
} else {
this.set({'_icon': icon});
}
let {tag} = this.get();
if (!this.get()._tag || tag !== null) {
this.set({
'_tag': tag === null ? 'PNotify-' + Math.round(Math.random() * 1000000) : tag
});
}
const options = {
body: this.get().text || _notice.get().text,
tag: this.get()._tag
};
if (!_notice.get().hide) {
options.requireInteraction = true;
}
if (this.get()._icon !== null) {
options.icon = this.get()._icon;
}
Object.apply(options, this.get().options);
const _desktop = notify(
this.get().title || _notice.get().title,
options,
() => {
_notice.fire('click', {target: _desktop});
},
() => {
_notice.close();
}
);
_notice.set({'_moduleIsNoticeOpen': true});
this.set({_desktop});
if (!('close' in _desktop) && ('cancel' in _desktop)) {
_desktop.close = () => {
_desktop.cancel();
};
}
}
};
function setup(Component) {
Component.key = 'Desktop';
Component.defaults = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the 'update' function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null,
// Optionally display a different title for the desktop.
title: null,
// Optionally display different text for the desktop.
text: null,
// Any additional options to be passed to the Notification constructor.
options: {}
};
Component.init = (notice) => {
return new Component({target: document.body});
};
Component.permission = () => {
if (typeof Notification !== 'undefined' && 'requestPermission' in Notification) {
Notification.requestPermission();
} else if ('webkitNotifications' in window) {
window.webkitNotifications.requestPermission();
}
};
Component.checkPermission = () => {
if (typeof Notification !== 'undefined' && 'permission' in Notification) {
return (Notification.permission === 'granted' ? 0 : 1);
} else if ('webkitNotifications' in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1; // eslint-disable-line eqeqeq
} else {
return 1;
}
};
permission = Component.checkPermission();
// Register the module with PNotify.
PNotify.modules.Desktop = Component;
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-xbgnx4-style';
style.textContent = "[ui-pnotify].ui-pnotify-desktop-hide.ui-pnotify{left:-10000px !important;display:none !important}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyDesktop(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-xbgnx4-style")) add_css();
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyDesktop.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyDesktop.prototype, methods);
PNotifyDesktop.prototype._recompute = noop;
setup(PNotifyDesktop);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
export default PNotifyDesktop;

File diff suppressed because one or more lines are too long

View File

@@ -1,281 +0,0 @@
/* src/PNotifyHistory.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.History.defaults);
};
var methods = {
initModule (options) {
this.set(options);
if (this.get().history) {
// Don't destroy notices that are in history.
const {_notice} = this.get();
if (_notice.get().destroy) {
_notice.set({'destroy': false});
}
}
},
beforeOpen () {
const {maxInStack, _options} = this.get();
if (maxInStack === Infinity) {
return;
}
const stack = _options.stack;
if (stack === false) {
return;
}
// Remove oldest notifications leaving only maxInStack from the stack.
if (PNotify.notices && (PNotify.notices.length > maxInStack)) {
// Oldest are normally in front of array, or if stack.push=='top' then
// they are at the end of the array!
const top = stack.push === 'top';
const forRemoval = [];
let currentOpen = 0;
for (let i = (top ? 0 : PNotify.notices.length - 1); (top ? i < PNotify.notices.length : i >= 0); (top ? i++ : i--)) {
if (
['opening', 'open'].indexOf(PNotify.notices[i].get()._state) !== -1 &&
PNotify.notices[i].get().stack === stack
) {
if (currentOpen >= maxInStack) {
forRemoval.push(PNotify.notices[i]);
} else {
currentOpen++;
}
}
}
for (let i = 0; i < forRemoval.length; i++) {
forRemoval[i].close(false);
}
}
}
};
function setup(Component) {
Component.key = 'History';
Component.defaults = {
// Place the notice in the history.
history: true,
// Maximum number of notices to have open in its stack.
maxInStack: Infinity
};
Component.init = (notice) => {
return new Component({target: document.body});
};
Component.showLast = (stack) => {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
const top = (stack.push === 'top');
// Look up the last history notice, and display it.
let i = (top ? 0 : PNotify.notices.length - 1);
let notice;
do {
notice = PNotify.notices[i];
if (!notice) {
return;
}
i += (top ? 1 : -1);
} while (
notice.get().stack !== stack ||
!notice.get()._modules.History.get().history ||
notice.get()._state === 'opening' ||
notice.get()._state === 'open'
);
notice.open();
};
Component.showAll = (stack) => {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
// Display all notices. (Disregarding non-history notices.)
for (let i = 0; i < PNotify.notices.length; i++) {
const notice = PNotify.notices[i];
if (
(
stack === true ||
notice.get().stack === stack
) &&
notice.get()._modules.History.get().history
) {
notice.open();
}
}
};
// Register the module with PNotify.
PNotify.modules.History = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyHistory(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyHistory.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyHistory.prototype, methods);
PNotifyHistory.prototype._recompute = noop;
setup(PNotifyHistory);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
export default PNotifyHistory;

File diff suppressed because one or more lines are too long

View File

@@ -1,418 +0,0 @@
/* src/PNotifyMobile.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Mobile.defaults);
};
var methods = {
initModule (options) {
this.set(options);
const {_notice} = this.get();
let origXY = null;
let diffXY = null;
let noticeWidthHeight = null;
let noticeOpacity = null;
let csspos = 'left';
let direction = 'X';
let span = 'Width';
_notice.on('touchstart', (e) => {
if (!this.get().swipeDismiss) {
return;
}
const {stack} = _notice.get();
if (stack !== false) {
switch (stack.dir1) {
case 'up':
case 'down':
csspos = 'left';
direction = 'X';
span = 'Width';
break;
case 'left':
case 'right':
csspos = 'top';
direction = 'Y';
span = 'Height';
break;
}
}
origXY = e.touches[0]['screen' + direction];
noticeWidthHeight = _notice.refs.elem['scroll' + span];
noticeOpacity = window.getComputedStyle(_notice.refs.elem)['opacity'];
_notice.refs.container.style[csspos] = 0;
});
_notice.on('touchmove', (e) => {
if (!origXY || !this.get().swipeDismiss) {
return;
}
const curXY = e.touches[0]['screen' + direction];
diffXY = curXY - origXY;
const opacity = (1 - (Math.abs(diffXY) / noticeWidthHeight)) * noticeOpacity;
_notice.refs.elem.style.opacity = opacity;
_notice.refs.container.style[csspos] = diffXY + 'px';
});
_notice.on('touchend', () => {
if (!origXY || !this.get().swipeDismiss) {
return;
}
_notice.refs.container.classList.add('ui-pnotify-mobile-animate-left');
if (Math.abs(diffXY) > 40) {
const goLeft = (diffXY < 0) ? noticeWidthHeight * -2 : noticeWidthHeight * 2;
_notice.refs.elem.style.opacity = 0;
_notice.refs.container.style[csspos] = goLeft + 'px';
_notice.close();
} else {
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
}
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
_notice.on('touchcancel', () => {
if (!origXY || !this.get().swipeDismiss) {
return;
}
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
this.doMobileStyling();
},
update () {
this.doMobileStyling();
},
beforeOpen () {
// Add an event listener to watch the window resizes.
window.addEventListener('resize', this.get()._doMobileStylingBound);
},
afterClose () {
// Remove the event listener.
window.removeEventListener('resize', this.get()._doMobileStylingBound);
// Remove any styling we added to close it.
if (!this.get().swipeDismiss) {
return;
}
const {_notice} = this.get();
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty('left');
_notice.refs.container.style.removeProperty('top');
},
doMobileStyling () {
const {_notice} = this.get();
const {stack} = _notice.get();
if (this.get().styling) {
if (stack !== false) {
if (window.innerWidth <= 480) {
if (!stack.mobileOrigSpacing1) {
stack.mobileOrigSpacing1 = stack.spacing1;
}
stack.spacing1 = 0;
if (!stack.mobileOrigFirstpos1) {
stack.mobileOrigFirstpos1 = stack.firstpos1;
}
stack.firstpos1 = 0;
if (!stack.mobileOrigSpacing2) {
stack.mobileOrigSpacing2 = stack.spacing2;
}
stack.spacing2 = 0;
if (!stack.mobileOrigFirstpos2) {
stack.mobileOrigFirstpos2 = stack.firstpos2;
}
stack.firstpos2 = 0;
} else {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
switch (stack.dir1) {
case 'down':
_notice.addModuleClass('ui-pnotify-mobile-top');
break;
case 'up':
_notice.addModuleClass('ui-pnotify-mobile-bottom');
break;
case 'left':
_notice.addModuleClass('ui-pnotify-mobile-right');
break;
case 'right':
_notice.addModuleClass('ui-pnotify-mobile-left');
break;
}
}
_notice.addModuleClass('ui-pnotify-mobile-able');
} else {
_notice.removeModuleClass(
'ui-pnotify-mobile-able',
'ui-pnotify-mobile-top',
'ui-pnotify-mobile-bottom',
'ui-pnotify-mobile-right',
'ui-pnotify-mobile-left'
);
if (stack !== false) {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
}
}
};
function oncreate() {
this.set({'_doMobileStylingBound': this.doMobileStyling.bind(this)});
};
function setup(Component) {
Component.key = 'Mobile';
Component.defaults = {
// Let the user swipe the notice away.
swipeDismiss: true,
// Styles the notice to look good on mobile.
styling: true
};
Component.init = (notice) => {
return new Component({target: document.body});
};
// Register the module with PNotify.
PNotify.modules.Mobile = Component;
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-49u8sj-style';
style.textContent = "[ui-pnotify] .ui-pnotify-container{position:relative}[ui-pnotify] .ui-pnotify-mobile-animate-left{transition:left .1s ease}[ui-pnotify] .ui-pnotify-mobile-animate-top{transition:top .1s ease}@media(max-width: 480px){[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able{font-size:1.2em;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;font-smoothing:antialiased}body > [ui-pnotify].ui-pnotify.ui-pnotify-mobile-able{position:fixed}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom{width:100% !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right{height:100% !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-shadow{border-bottom-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-shadow{border-top-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-shadow{border-right-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-shadow{border-left-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-container{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-container,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-container{width:auto !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-container,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-container{height:100% !important}}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyMobile(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-49u8sj-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(() => {
oncreate.call(this);
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyMobile.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyMobile.prototype, methods);
PNotifyMobile.prototype._recompute = noop;
setup(PNotifyMobile);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function assignTrue(tar, src) {
for (var k in src) tar[k] = 1;
return tar;
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
export default PNotifyMobile;

File diff suppressed because one or more lines are too long

View File

@@ -1,195 +0,0 @@
/* src/PNotifyNonBlock.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.NonBlock.defaults);
};
var methods = {
initModule (options) {
this.set(options);
this.doNonBlockClass();
},
update () {
this.doNonBlockClass();
},
doNonBlockClass () {
if (this.get().nonblock) {
this.get()._notice.addModuleClass('nonblock');
} else {
this.get()._notice.removeModuleClass('nonblock');
}
}
};
function setup(Component) {
Component.key = 'NonBlock';
Component.defaults = {
// Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
Component.init = (notice) => {
return new Component({target: document.body,
data: {
'_notice': notice
}});
};
// Register the module with PNotify.
PNotify.modules.NonBlock = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyNonBlock(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyNonBlock.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyNonBlock.prototype, methods);
PNotifyNonBlock.prototype._recompute = noop;
setup(PNotifyNonBlock);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
export default PNotifyNonBlock;

View File

@@ -1 +0,0 @@
{"version":3,"file":"PNotifyNonBlock.js","sources":["src/PNotifyNonBlock.html"],"sourcesContent":["<script>\n import PNotify from './PNotify.html';\n\n export default {\n setup (Component) {\n Component.key = 'NonBlock';\n\n Component.defaults = {\n // Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.\n nonblock: false\n };\n\n Component.init = (notice) => {\n return new Component({target: document.body,\n data: {\n '_notice': notice\n }});\n };\n\n // Register the module with PNotify.\n PNotify.modules.NonBlock = Component;\n },\n\n data () {\n return Object.assign({\n '_notice': null, // The PNotify notice.\n '_options': {} // The options for the notice.\n }, PNotify.modules.NonBlock.defaults);\n },\n\n methods: {\n initModule (options) {\n this.set(options);\n this.doNonBlockClass();\n },\n\n update () {\n this.doNonBlockClass();\n },\n\n doNonBlockClass () {\n if (this.get().nonblock) {\n this.get()._notice.addModuleClass('nonblock');\n } else {\n this.get()._notice.removeModuleClass('nonblock');\n }\n }\n }\n };\n</script>\n"],"names":[],"mappings":";;;aAuBS,GAAG;AACZ,AAAI,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC;AAC3B,AAAI,IAAI,SAAS,EAAE,IAAI;AACvB,AAAI,IAAI,UAAU,EAAE,EAAE;AACtB,AAAI,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5C,AAAI,CAAC;;cAEQ;AACb,AAAI,EAAE,UAAU,CAAC,CAAC,OAAO,EAAE;AAC3B,AAAI,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC1B,AAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;AAC/B,AAAI,GAAG;;AAEP,AAAI,EAAE,MAAM,CAAC,GAAG;AAChB,AAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;AAC/B,AAAI,GAAG;;AAEP,AAAI,EAAE,eAAe,CAAC,GAAG;AACzB,AAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;AACjC,AAAI,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;AACxD,AAAI,KAAK,MAAM;AACf,AAAI,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC3D,AAAI,KAAK;AACT,AAAI,GAAG;AACP,AAAI,CAAC;;cA3CK,CAAC,SAAS,EAAE;AACtB,AAAI,EAAE,SAAS,CAAC,GAAG,GAAG,UAAU,CAAC;;AAEjC,AAAI,EAAE,SAAS,CAAC,QAAQ,GAAG;AAC3B,AAAI;AACJ,AAAI,IAAI,QAAQ,EAAE,KAAK;AACvB,AAAI,GAAG,CAAC;;AAER,AAAI,EAAE,SAAS,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK;AACnC,AAAI,IAAI,OAAO,IAAI,SAAS,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI;AACnD,AAAI,MAAM,IAAI,EAAE;AAChB,AAAI,QAAQ,SAAS,EAAE,MAAM;AAC7B,AAAI,OAAO,CAAC,CAAC,CAAC;AACd,AAAI,GAAG,CAAC;;AAER,AAAI;AACJ,AAAI,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;AAC3C,AAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -1,412 +0,0 @@
/* src/PNotifyReference.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function data() {
return Object.assign({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Reference.defaults);
};
var methods = {
// This method is called from the core to give us our actual options.
// Until it is called, our options will just be the defaults.
initModule (options) {
// Set our options.
this.set(options);
// Now that the notice is available to us, we can listen to events fired
// from it.
const {_notice} = this.get();
_notice.on('mouseenter', () => this.set({'_mouseIsIn': true}));
_notice.on('mouseleave', () => this.set({'_mouseIsIn': false}));
},
doSomething () {
// Spin the notice around.
let curAngle = 0;
const {_notice} = this.get();
const timer = setInterval(() => {
curAngle += 10;
if (curAngle === 360) {
curAngle = 0;
clearInterval(timer);
}
_notice.refs.elem.style.transform = 'rotate(' + curAngle + 'deg)';
}, 20);
},
// I have nothing to put in these, just showing you that they exist. You
// won't need to include them if you aren't using them.
update () {
// Called when the notice is updating its options.
},
beforeOpen () {
// Called before the notice is opened.
},
afterOpen () {
// Called after the notice is opened.
},
beforeClose () {
// Called before the notice is closed.
},
afterClose () {
// Called after the notice is closed.
},
beforeDestroy () {
// Called before the notice is destroyed.
},
afterDestroy () {
// Called after the notice is destroyed.
}
};
function oncreate() {
// This is the second way to init a module. Because we put markup in the
// template, we have to fire this event to tell the core that we are ready
// to receive our options.
this.fire('init', {module: this});
};
function setup(Component) {
// This is the key you use for registering your module with PNotify.
Component.key = 'Reference';
// This if the default values of your options.
Component.defaults = {
// Provide a thing for stuff. Turned off by default.
putThing: false,
// If you are displaying any text, you should use a labels options to
// support internationalization.
labels: {
text: 'Spin Around'
}
};
// This is the first way to init a module. If you aren't placing any
// markup in the template, you would do this.
// Component.init = (_notice) => {
// return new Component({target: document.body, data: {_notice}});
// };
// Register the module with PNotify.
PNotify.modules.Reference = Component;
// Append our markup to the container.
PNotify.modulesAppendContainer.push(Component);
// This is where you would add any styling or icons classes you are using in your code.
Object.assign(PNotify.icons.brighttheme, {
athing: 'bt-icon bt-icon-refresh'
});
Object.assign(PNotify.icons.bootstrap3, {
athing: 'glyphicon glyphicon-refresh'
});
Object.assign(PNotify.icons.fontawesome4, {
athing: 'fa fa-refresh'
});
Object.assign(PNotify.icons.fontawesome5, {
athing: 'fas fa-sync'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
Object.assign(PNotify.icons.material, {
athing: 'material-icons pnotify-material-icon-refresh'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1qy4b0e-style';
style.textContent = ".ui-pnotify-reference-button.svelte-1qy4b0e{float:right}.ui-pnotify-reference-clearing.svelte-1qy4b0e{clear:right;line-height:0}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var if_block_anchor;
var if_block = (ctx.putThing) && create_if_block(component, ctx);
return {
c() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p(changed, ctx) {
if (ctx.putThing) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
}
}
};
}
// (2:0) {#if putThing}
function create_if_block(component, ctx) {
var button, i, i_class_value, text, text_1_value = ctx.labels.text, text_1, button_disabled_value, text_3, div;
function click_handler(event) {
component.doSomething();
}
return {
c() {
button = createElement("button");
i = createElement("i");
text = createText(" ");
text_1 = createText(text_1_value);
text_3 = createText("\n \n ");
div = createElement("div");
i.className = i_class_value = "" + ctx._notice.get()._icons.athing + " svelte-1qy4b0e";
addListener(button, "click", click_handler);
button.className = "ui-pnotify-reference-button btn btn-default svelte-1qy4b0e";
button.type = "button";
button.disabled = button_disabled_value = !ctx._mouseIsIn;
div.className = "ui-pnotify-reference-clearing svelte-1qy4b0e";
},
m(target, anchor) {
insertNode(button, target, anchor);
appendNode(i, button);
appendNode(text, button);
appendNode(text_1, button);
component.refs.thingElem = button;
insertNode(text_3, target, anchor);
insertNode(div, target, anchor);
},
p(changed, ctx) {
if ((changed._notice) && i_class_value !== (i_class_value = "" + ctx._notice.get()._icons.athing + " svelte-1qy4b0e")) {
i.className = i_class_value;
}
if ((changed.labels) && text_1_value !== (text_1_value = ctx.labels.text)) {
text_1.data = text_1_value;
}
if ((changed._mouseIsIn) && button_disabled_value !== (button_disabled_value = !ctx._mouseIsIn)) {
button.disabled = button_disabled_value;
}
},
d(detach) {
if (detach) {
detachNode(button);
}
removeListener(button, "click", click_handler);
if (component.refs.thingElem === button) component.refs.thingElem = null;
if (detach) {
detachNode(text_3);
detachNode(div);
}
}
};
}
function PNotifyReference(options) {
init(this, options);
this.refs = {};
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1qy4b0e-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(() => {
oncreate.call(this);
this.fire("update", { changed: assignTrue({}, this._state), current: this._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyReference.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyReference.prototype, methods);
PNotifyReference.prototype._recompute = noop;
setup(PNotifyReference);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function createText(data) {
return document.createTextNode(data);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function assignTrue(tar, src) {
for (var k in src) tar[k] = 1;
return tar;
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function noop() {}
function blankObject() {
return Object.create(null);
}
export default PNotifyReference;

File diff suppressed because one or more lines are too long

View File

@@ -1,199 +0,0 @@
/* src/PNotifyStyleMaterial.html generated by Svelte v2.6.3 */
import PNotify from "./PNotify.js";
function setup(Component) {
Component.key = 'StyleMaterial';
// Register the module with PNotify.
PNotify.modules.StyleMaterial = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
PNotify.styling.material = Object.assign(PNotify.styling.material, {
container: 'pnotify-material',
notice: 'pnotify-material-notice',
info: 'pnotify-material-info',
success: 'pnotify-material-success',
error: 'pnotify-material-error'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
PNotify.icons.material = Object.assign(PNotify.icons.material, {
notice: 'material-icons pnotify-material-icon-notice',
info: 'material-icons pnotify-material-icon-info',
success: 'material-icons pnotify-material-icon-success',
error: 'material-icons pnotify-material-icon-error',
closer: 'material-icons pnotify-material-icon-closer',
pinUp: 'material-icons pnotify-material-icon-sticker',
pinDown: 'material-icons pnotify-material-icon-sticker pnotify-material-icon-stuck'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-19og8nx-style';
style.textContent = "[ui-pnotify] .pnotify-material{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;font-size:14px}[ui-pnotify] .pnotify-material.ui-pnotify-shadow{-webkit-box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2);-moz-box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2);box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2)}[ui-pnotify] .pnotify-material.ui-pnotify-container{padding:24px}[ui-pnotify] .pnotify-material .ui-pnotify-title{font-size:20px;margin-bottom:20px;line-height:24px}[ui-pnotify] .pnotify-material .ui-pnotify-title:last-child{margin-bottom:0}[ui-pnotify] .pnotify-material .ui-pnotify-text{font-size:16px;line-height:24px}[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title,[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text,[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm{margin-left:32px}[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title,[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text,[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm{margin-right:32px;margin-left:0}[ui-pnotify] .pnotify-material .ui-pnotify-action-bar{margin-top:20px;margin-right:-16px;margin-bottom:-16px}[dir=rtl] [ui-pnotify] .pnotify-material .ui-pnotify-action-bar{margin-left:-16px;margin-right:0}[ui-pnotify] .pnotify-material-notice{background-color:#FFEE58;border:none;color:#000}[ui-pnotify] .pnotify-material-info{background-color:#26C6DA;border:none;color:#000}[ui-pnotify] .pnotify-material-success{background-color:#66BB6A;border:none;color:#fff}[ui-pnotify] .pnotify-material-error{background-color:#EF5350;border:none;color:#fff}[ui-pnotify] .pnotify-material-icon-notice,[ui-pnotify] .pnotify-material-icon-info,[ui-pnotify] .pnotify-material-icon-success,[ui-pnotify] .pnotify-material-icon-error,[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{position:relative}[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{height:20px;width:20px;font-size:20px;line-height:20px;position:relative}[ui-pnotify] .pnotify-material-icon-notice:after,[ui-pnotify] .pnotify-material-icon-info:after,[ui-pnotify] .pnotify-material-icon-success:after,[ui-pnotify] .pnotify-material-icon-error:after,[ui-pnotify] .pnotify-material-icon-closer:after,[ui-pnotify] .pnotify-material-icon-sticker:after{font-family:'Material Icons'}[ui-pnotify] .pnotify-material-icon-notice:after{content:\"announcement\"}[ui-pnotify] .pnotify-material-icon-info:after{content:\"info\"}[ui-pnotify] .pnotify-material-icon-success:after{content:\"check_circle\"}[ui-pnotify] .pnotify-material-icon-error:after{content:\"error\"}[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{display:inline-block}[ui-pnotify] .pnotify-material-icon-closer:after{top:-4px;content:\"close\"}[ui-pnotify] .pnotify-material-icon-sticker:after{top:-5px;content:\"pause\"}[ui-pnotify] .pnotify-material-icon-sticker.pnotify-material-icon-stuck:after{content:\"play_arrow\"}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input{display:block;width:100%;margin-bottom:8px;padding:15px 0 8px;background-color:transparent;color:inherit;border-radius:0;border-top:none;border-left:none;border-right:none;border-bottom-style:solid;border-bottom-color:inherit;border-bottom-width:1px}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input:focus{outline:none;border-bottom-color:#3F51B5;border-bottom-width:2px}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button{position:relative;padding:0 16px;overflow:hidden;border-width:0;outline:none;border-radius:2px;background-color:transparent;color:inherit;transition:background-color .3s;text-transform:uppercase;height:36px;margin:6px;min-width:64px;font-weight:bold}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary{color:#3F51B5}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:hover,[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:focus{background-color:rgba(0, 0, 0, .12);color:inherit}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:hover,[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:focus{color:#303F9F}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:before{content:\"\";position:absolute;top:50%;left:50%;display:block;width:0;padding-top:0;border-radius:100%;background-color:rgba(153, 153, 153, .4);-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);-o-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:active:before{width:120%;padding-top:120%;transition:width .2s ease-out, padding-top .2s ease-out}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyStyleMaterial(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
if (!document.getElementById("svelte-19og8nx-style")) add_css();
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyStyleMaterial.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
PNotifyStyleMaterial.prototype._recompute = noop;
setup(PNotifyStyleMaterial);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) tar[k] = src[k];
return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
export default PNotifyStyleMaterial;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,312 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyAnimate.html generated by Svelte v2.6.3 */
var PNotifyAnimate = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Animate.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
this.setUpAnimations();
},
update: function update() {
this.setUpAnimations();
},
setUpAnimations: function setUpAnimations() {
var _get = this.get(),
_notice = _get._notice,
_options = _get._options,
animate = _get.animate;
if (animate) {
_notice.set({ 'animation': 'none' });
if (!_notice._animateIn) {
_notice._animateIn = _notice.animateIn;
}
if (!_notice._animateOut) {
_notice._animateOut = _notice.animateOut;
}
_notice.animateIn = this.animateIn.bind(this);
_notice.animateOut = this.animateOut.bind(this);
var animSpeed = 250;
if (_options.animateSpeed === 'slow') {
animSpeed = 400;
} else if (_options.animateSpeed === 'fast') {
animSpeed = 100;
} else if (_options.animateSpeed > 0) {
animSpeed = _options.animateSpeed;
}
animSpeed = animSpeed / 1000;
_notice.refs.elem.style.WebkitAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.MozAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.animationDuration = animSpeed + 's';
} else if (_notice._animateIn && _notice._animateOut) {
_notice.animateIn = _notice._animateIn;
delete _notice._animateIn;
_notice.animateOut = _notice._animateOut;
delete _notice._animateOut;
}
},
animateIn: function animateIn(callback) {
var _get2 = this.get(),
_notice = _get2._notice;
// Declare that the notice is animating in.
_notice.set({ '_animating': 'in' });
var finished = function finished() {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated' });
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({ '_animating': false });
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated ' + this.get().inClass });
},
animateOut: function animateOut(callback) {
var _get3 = this.get(),
_notice = _get3._notice;
// Declare that the notice is animating out.
_notice.set({ '_animating': 'out' });
var finished = function finished() {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'animated' });
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({ '_animating': false });
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated ' + this.get().outClass });
}
};
function setup(Component) {
Component.key = 'Animate';
Component.defaults = {
// Use animate.css to animate the notice.
animate: false,
// The class to use to animate the notice in.
inClass: '',
// The class to use to animate the notice out.
outClass: ''
};
Component.init = function (notice) {
notice.attention = function (aniClass, callback) {
var cb = function cb() {
notice.refs.container.removeEventListener('webkitAnimationEnd', cb);
notice.refs.container.removeEventListener('mozAnimationEnd', cb);
notice.refs.container.removeEventListener('MSAnimationEnd', cb);
notice.refs.container.removeEventListener('oanimationend', cb);
notice.refs.container.removeEventListener('animationend', cb);
notice.refs.container.classList.remove(aniClass);
if (callback) {
callback.call(notice);
}
};
notice.refs.container.addEventListener('webkitAnimationEnd', cb);
notice.refs.container.addEventListener('mozAnimationEnd', cb);
notice.refs.container.addEventListener('MSAnimationEnd', cb);
notice.refs.container.addEventListener('oanimationend', cb);
notice.refs.container.addEventListener('animationend', cb);
notice.refs.container.classList.add('animated');
notice.refs.container.classList.add(aniClass);
};
return new Component({ target: document.body });
};
// Register the module with PNotify.
PNotify.modules.Animate = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyAnimate(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyAnimate.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyAnimate.prototype, methods);
PNotifyAnimate.prototype._recompute = noop;
setup(PNotifyAnimate);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyAnimate;
}(PNotify);
//# sourceMappingURL=PNotifyAnimate.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,538 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyButtons.html generated by Svelte v2.6.3 */
var PNotifyButtons = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function _showSticker(_ref) {
var sticker = _ref.sticker,
_notice = _ref._notice;
return sticker && !(_notice && _notice.refs.elem.classList.contains('nonblock'));
}
function _showCloser(_ref2) {
var closer = _ref2.closer,
_notice = _ref2._notice;
return closer && !(_notice && _notice.refs.elem.classList.contains('nonblock'));
}
function _pinUpClass(_ref3) {
var classes = _ref3.classes,
_notice = _ref3._notice;
return _notice ? classes.pinUp === null ? _notice.get()._icons.pinUp : classes.pinUp : '';
}
function _pinDownClass(_ref4) {
var classes = _ref4.classes,
_notice = _ref4._notice;
return _notice ? classes.pinDown === null ? _notice.get()._icons.pinDown : classes.pinDown : '';
}
function _closerClass(_ref5) {
var classes = _ref5.classes,
_notice = _ref5._notice;
return _notice ? classes.closer === null ? _notice.get()._icons.closer : classes.closer : '';
}
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Buttons.defaults);
};
var methods = {
initModule: function initModule(options) {
var _this = this;
this.set(options);
var _get = this.get(),
_notice = _get._notice;
_notice.on('mouseenter', function () {
return _this.set({ '_mouseIsIn': true });
});
_notice.on('mouseleave', function () {
return _this.set({ '_mouseIsIn': false });
});
_notice.on('state', function (_ref6) {
var changed = _ref6.changed,
current = _ref6.current;
if (!changed.hide) {
return;
}
var _get2 = _this.get(),
sticker = _get2.sticker;
if (!sticker) {
return;
}
// Font Awesome 5 replaces our lovely element with a gross SVG. In
// order to make it play nice with Svelte, we have to clear the
// element and make it again.
var icon = current.hide ? _this.get().classes.pinUp : _this.get().classes.pinDown;
if (_this.get()._notice.get().icons === 'fontawesome5' || typeof icon === 'string' && icon.match(/(^| )fa[srlb]($| )/)) {
_this.set({ 'sticker': false });
_this.set({ 'sticker': true });
}
});
},
handleStickerClick: function handleStickerClick() {
var _get3 = this.get(),
_notice = _get3._notice;
_notice.update({ hide: !_notice.get().hide });
},
handleCloserClick: function handleCloserClick() {
this.get()._notice.close(false);
this.set({ '_mouseIsIn': false });
}
};
function oncreate() {
this.fire('init', { module: this });
};
function setup(Component) {
Component.key = 'Buttons';
Component.defaults = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closerHover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
stickerHover: true,
// The various displayed text, helps facilitating internationalization.
labels: {
close: 'Close',
stick: 'Stick',
unstick: 'Unstick'
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pinUp: null,
pinDown: null
}
};
// Register the module with PNotify.
PNotify.modules.Buttons = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
// Add button icons to icons objects.
_extends(PNotify.icons.brighttheme, {
closer: 'brighttheme-icon-closer',
pinUp: 'brighttheme-icon-sticker',
pinDown: 'brighttheme-icon-sticker brighttheme-icon-stuck'
});
_extends(PNotify.icons.bootstrap3, {
closer: 'glyphicon glyphicon-remove',
pinUp: 'glyphicon glyphicon-pause',
pinDown: 'glyphicon glyphicon-play'
});
_extends(PNotify.icons.fontawesome4, {
closer: 'fa fa-times',
pinUp: 'fa fa-pause',
pinDown: 'fa fa-play'
});
_extends(PNotify.icons.fontawesome5, {
closer: 'fas fa-times',
pinUp: 'fas fa-pause',
pinDown: 'fas fa-play'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1yjle82-style';
style.textContent = ".ui-pnotify-closer.svelte-1yjle82,.ui-pnotify-sticker.svelte-1yjle82{float:right;margin-left:.5em;cursor:pointer}[dir=rtl] .ui-pnotify-closer,[dir=rtl] .ui-pnotify-sticker{float:left;margin-right:.5em;margin-left:0}.ui-pnotify-buttons-hidden.svelte-1yjle82{visibility:hidden}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var text, if_block_1_anchor;
var if_block = ctx._showCloser && create_if_block(component, ctx);
var if_block_1 = ctx._showSticker && create_if_block_1(component, ctx);
return {
c: function c() {
if (if_block) if_block.c();
text = createText("\n");
if (if_block_1) if_block_1.c();
if_block_1_anchor = createComment();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(text, target, anchor);
if (if_block_1) if_block_1.m(target, anchor);
insertNode(if_block_1_anchor, target, anchor);
},
p: function p(changed, ctx) {
if (ctx._showCloser) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(text.parentNode, text);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (ctx._showSticker) {
if (if_block_1) {
if_block_1.p(changed, ctx);
} else {
if_block_1 = create_if_block_1(component, ctx);
if_block_1.c();
if_block_1.m(if_block_1_anchor.parentNode, if_block_1_anchor);
}
} else if (if_block_1) {
if_block_1.d(1);
if_block_1 = null;
}
},
d: function d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(text);
}
if (if_block_1) if_block_1.d(detach);
if (detach) {
detachNode(if_block_1_anchor);
}
}
};
}
// (1:0) {#if _showCloser}
function create_if_block(component, ctx) {
var div, span, div_class_value, div_title_value;
function click_handler(event) {
component.handleCloserClick();
}
return {
c: function c() {
div = createElement("div");
span = createElement("span");
span.className = "" + ctx._closerClass + " svelte-1yjle82";
addListener(div, "click", click_handler);
div.className = div_class_value = "ui-pnotify-closer " + (!ctx.closerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82";
setAttribute(div, "role", "button");
div.tabIndex = "0";
div.title = div_title_value = ctx.labels.close;
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
appendNode(span, div);
},
p: function p(changed, ctx) {
if (changed._closerClass) {
span.className = "" + ctx._closerClass + " svelte-1yjle82";
}
if ((changed.closerHover || changed._mouseIsIn) && div_class_value !== (div_class_value = "ui-pnotify-closer " + (!ctx.closerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82")) {
div.className = div_class_value;
}
if (changed.labels && div_title_value !== (div_title_value = ctx.labels.close)) {
div.title = div_title_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
removeListener(div, "click", click_handler);
}
};
}
// (11:0) {#if _showSticker}
function create_if_block_1(component, ctx) {
var div, span, span_class_value, div_class_value, div_aria_pressed_value, div_title_value;
function click_handler(event) {
component.handleStickerClick();
}
return {
c: function c() {
div = createElement("div");
span = createElement("span");
span.className = span_class_value = "" + (ctx._options.hide ? ctx._pinUpClass : ctx._pinDownClass) + " svelte-1yjle82";
addListener(div, "click", click_handler);
div.className = div_class_value = "ui-pnotify-sticker " + (!ctx.stickerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82";
setAttribute(div, "role", "button");
setAttribute(div, "aria-pressed", div_aria_pressed_value = ctx._options.hide);
div.tabIndex = "0";
div.title = div_title_value = ctx._options.hide ? ctx.labels.stick : ctx.labels.unstick;
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
appendNode(span, div);
},
p: function p(changed, ctx) {
if ((changed._options || changed._pinUpClass || changed._pinDownClass) && span_class_value !== (span_class_value = "" + (ctx._options.hide ? ctx._pinUpClass : ctx._pinDownClass) + " svelte-1yjle82")) {
span.className = span_class_value;
}
if ((changed.stickerHover || changed._mouseIsIn) && div_class_value !== (div_class_value = "ui-pnotify-sticker " + (!ctx.stickerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82")) {
div.className = div_class_value;
}
if (changed._options && div_aria_pressed_value !== (div_aria_pressed_value = ctx._options.hide)) {
setAttribute(div, "aria-pressed", div_aria_pressed_value);
}
if ((changed._options || changed.labels) && div_title_value !== (div_title_value = ctx._options.hide ? ctx.labels.stick : ctx.labels.unstick)) {
div.title = div_title_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
removeListener(div, "click", click_handler);
}
};
}
function PNotifyButtons(options) {
var _this2 = this;
init(this, options);
this._state = assign(data(), options.data);
this._recompute({ sticker: 1, _notice: 1, closer: 1, classes: 1 }, this._state);
this._intro = true;
if (!document.getElementById("svelte-1yjle82-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this2);
_this2.fire("update", { changed: assignTrue({}, _this2._state), current: _this2._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyButtons.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyButtons.prototype, methods);
PNotifyButtons.prototype._recompute = function _recompute(changed, state) {
if (changed.sticker || changed._notice) {
if (this._differs(state._showSticker, state._showSticker = _showSticker(state))) changed._showSticker = true;
}
if (changed.closer || changed._notice) {
if (this._differs(state._showCloser, state._showCloser = _showCloser(state))) changed._showCloser = true;
}
if (changed.classes || changed._notice) {
if (this._differs(state._pinUpClass, state._pinUpClass = _pinUpClass(state))) changed._pinUpClass = true;
if (this._differs(state._pinDownClass, state._pinDownClass = _pinDownClass(state))) changed._pinDownClass = true;
if (this._differs(state._closerClass, state._closerClass = _closerClass(state))) changed._closerClass = true;
}
};
setup(PNotifyButtons);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createText(data) {
return document.createTextNode(data);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function noop() {}
return PNotifyButtons;
}(PNotify);
//# sourceMappingURL=PNotifyButtons.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,231 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyCallbacks.html generated by Svelte v2.6.3 */
var PNotifyCallbacks = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
var _open = PNotify.prototype.open;
var _close = PNotify.prototype.close;
var callbacks = function callbacks(notice, options, name) {
var modules = notice ? notice.get().modules : options.modules;
var cbs = modules && modules.Callbacks ? modules.Callbacks : {};
return cbs[name] ? cbs[name] : function () {
return true;
};
};
PNotify.prototype.open = function () {
var ret = callbacks(this, null, 'beforeOpen')(this);
if (ret !== false) {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_open.apply(this, args);
callbacks(this, null, 'afterOpen')(this);
}
};
PNotify.prototype.close = function (timerHide) {
var ret = callbacks(this, null, 'beforeClose')(this, timerHide);
if (ret !== false) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
_close.apply(this, [timerHide].concat(args));
callbacks(this, null, 'afterClose')(this, timerHide);
}
};
function setup(Component) {
Component.key = 'Callbacks';
Component.getCallbacks = callbacks;
var _alert = PNotify.alert;
var _notice = PNotify.notice;
var _info = PNotify.info;
var _success = PNotify.success;
var _error = PNotify.error;
var init = function init(original, options) {
callbacks(null, options, 'beforeInit')(options);
var notice = original(options);
callbacks(notice, null, 'afterInit')(notice);
return notice;
};
PNotify.alert = function (options) {
return init(_alert, options);
};
PNotify.notice = function (options) {
return init(_notice, options);
};
PNotify.info = function (options) {
return init(_info, options);
};
PNotify.success = function (options) {
return init(_success, options);
};
PNotify.error = function (options) {
return init(_error, options);
};
// Register the module with PNotify.
PNotify.modules.Callbacks = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyCallbacks(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyCallbacks.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
PNotifyCallbacks.prototype._recompute = noop;
setup(PNotifyCallbacks);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyCallbacks;
}(PNotify);
//# sourceMappingURL=PNotifyCallbacks.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["src/PNotifyCallbacks.html"],"names":[],"mappings":";;;;;;;;AAGE,KAAI,QAAQ,QAAQ,SAAR,CAAkB,IAA9B;AACA,KAAI,SAAS,QAAQ,SAAR,CAAkB,KAA/B;;AAEA,KAAM,YAAY,SAAZ,SAAY,CAAC,MAAD,EAAS,OAAT,EAAkB,IAAlB,EAA2B;AAC3C,MAAI,UAAU,SAAS,OAAO,GAAP,GAAa,OAAtB,GAAgC,QAAQ,OAAtD;AACA,MAAI,MAAO,WAAW,QAAQ,SAApB,GAAiC,QAAQ,SAAzC,GAAqD,EAA/D;AACA,SAAO,IAAI,IAAJ,IAAY,IAAI,IAAJ,CAAZ,GAAwB;AAAA,UAAM,IAAN;AAAA,GAA/B;AACD,EAJD;;AAMA,SAAQ,SAAR,CAAkB,IAAlB,GAAyB,YAAmB;AAC1C,MAAI,MAAM,UAAU,IAAV,EAAgB,IAAhB,EAAsB,YAAtB,EAAoC,IAApC,CAAV;AACA,MAAI,QAAQ,KAAZ,EAAmB;AAAA,qCAFiB,IAEjB;AAFiB,QAEjB;AAAA;;AACjB,SAAM,KAAN,CAAY,IAAZ,EAAkB,IAAlB;AACA,aAAU,IAAV,EAAgB,IAAhB,EAAsB,WAAtB,EAAmC,IAAnC;AACD;AACF,EAND;;AAQA,SAAQ,SAAR,CAAkB,KAAlB,GAA0B,UAAU,SAAV,EAA8B;AACtD,MAAI,MAAM,UAAU,IAAV,EAAgB,IAAhB,EAAsB,aAAtB,EAAqC,IAArC,EAA2C,SAA3C,CAAV;AACA,MAAI,QAAQ,KAAZ,EAAmB;AAAA,sCAF6B,IAE7B;AAF6B,QAE7B;AAAA;;AACjB,UAAO,KAAP,CAAa,IAAb,GAAoB,SAApB,SAAkC,IAAlC;AACA,aAAU,IAAV,EAAgB,IAAhB,EAAsB,YAAtB,EAAoC,IAApC,EAA0C,SAA1C;AACD;AACF,EAND;;AAQF,UAAA,KAAA,CACW,SADX,EACsB;AAChB,YAAU,GAAV,GAAgB,WAAhB;;AAEA,YAAU,YAAV,GAAyB,SAAzB;;AAEA,MAAI,SAAS,QAAQ,KAArB;AACA,MAAI,UAAU,QAAQ,MAAtB;AACA,MAAI,QAAQ,QAAQ,IAApB;AACA,MAAI,WAAW,QAAQ,OAAvB;AACA,MAAI,SAAS,QAAQ,KAArB;;AAEA,MAAI,OAAO,SAAP,IAAO,CAAC,QAAD,EAAW,OAAX,EAAuB;AAChC,aAAU,IAAV,EAAgB,OAAhB,EAAyB,YAAzB,EAAuC,OAAvC;AACA,OAAI,SAAS,SAAS,OAAT,CAAb;AACA,aAAU,MAAV,EAAkB,IAAlB,EAAwB,WAAxB,EAAqC,MAArC;AACA,UAAO,MAAP;AACD,GALD;;AAOA,UAAQ,KAAR,GAAgB,UAAC,OAAD,EAAa;AAC3B,UAAO,KAAK,MAAL,EAAa,OAAb,CAAP;AACD,GAFD;AAGA,UAAQ,MAAR,GAAiB,UAAC,OAAD,EAAa;AAC5B,UAAO,KAAK,OAAL,EAAc,OAAd,CAAP;AACD,GAFD;AAGA,UAAQ,IAAR,GAAe,UAAC,OAAD,EAAa;AAC1B,UAAO,KAAK,KAAL,EAAY,OAAZ,CAAP;AACD,GAFD;AAGA,UAAQ,OAAR,GAAkB,UAAC,OAAD,EAAa;AAC7B,UAAO,KAAK,QAAL,EAAe,OAAf,CAAP;AACD,GAFD;AAGA,UAAQ,KAAR,GAAgB,UAAC,OAAD,EAAa;AAC3B,UAAO,KAAK,MAAL,EAAa,OAAb,CAAP;AACD,GAFD;;AAIF;AACE,UAAQ,OAAR,CAAgB,SAAhB,GAA4B,SAA5B;AACD","sourcesContent":["<script>\n import PNotify from './PNotify.html';\n\n let _open = PNotify.prototype.open;\n let _close = PNotify.prototype.close;\n\n const callbacks = (notice, options, name) => {\n let modules = notice ? notice.get().modules : options.modules;\n let cbs = (modules && modules.Callbacks) ? modules.Callbacks : {};\n return cbs[name] ? cbs[name] : () => true;\n };\n\n PNotify.prototype.open = function (...args) {\n let ret = callbacks(this, null, 'beforeOpen')(this);\n if (ret !== false) {\n _open.apply(this, args);\n callbacks(this, null, 'afterOpen')(this);\n }\n };\n\n PNotify.prototype.close = function (timerHide, ...args) {\n let ret = callbacks(this, null, 'beforeClose')(this, timerHide);\n if (ret !== false) {\n _close.apply(this, [timerHide, ...args]);\n callbacks(this, null, 'afterClose')(this, timerHide);\n }\n };\n\n export default {\n setup (Component) {\n Component.key = 'Callbacks';\n\n Component.getCallbacks = callbacks;\n\n let _alert = PNotify.alert;\n let _notice = PNotify.notice;\n let _info = PNotify.info;\n let _success = PNotify.success;\n let _error = PNotify.error;\n\n let init = (original, options) => {\n callbacks(null, options, 'beforeInit')(options);\n let notice = original(options);\n callbacks(notice, null, 'afterInit')(notice);\n return notice;\n };\n\n PNotify.alert = (options) => {\n return init(_alert, options);\n };\n PNotify.notice = (options) => {\n return init(_notice, options);\n };\n PNotify.info = (options) => {\n return init(_info, options);\n };\n PNotify.success = (options) => {\n return init(_success, options);\n };\n PNotify.error = (options) => {\n return init(_error, options);\n };\n\n // Register the module with PNotify.\n PNotify.modules.Callbacks = Component;\n }\n };\n</script>\n"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,750 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyConfirm.html generated by Svelte v2.6.3 */
var PNotifyConfirm = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Confirm.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
},
afterOpen: function afterOpen() {
if (this.get().prompt) {
if (this.get().promptMultiLine) {
this.refs.promptMulti.focus();
} else {
this.refs.promptSingle.focus();
}
}
},
handleClick: function handleClick(button, event) {
if (button.click) {
button.click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
},
handleKeyPress: function handleKeyPress(event) {
if (event.keyCode === 13 && !event.shiftKey) {
event.preventDefault();
var _get = this.get(),
buttons = _get.buttons;
for (var i = 0; i < buttons.length; i++) {
if (buttons[i].promptTrigger && buttons[i].click) {
buttons[i].click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
}
}
}
};
function oncreate() {
this.fire('init', { module: this });
};
function setup(Component) {
Component.key = 'Confirm';
Component.defaults = {
// Make a confirmation box.
confirm: false,
// Make a prompt.
prompt: false,
// Classes to add to the input element of the prompt.
promptClass: '',
// The value of the prompt.
promptValue: '',
// Whether the prompt should accept multiple lines of text.
promptMultiLine: false,
// Where to align the buttons. (flex-start, center, flex-end, space-around, space-between)
align: 'flex-end',
// The buttons to display, and their callbacks.
buttons: [{
text: 'Ok',
textTrusted: false,
addClass: '',
primary: true,
// Whether to trigger this button when the user hits enter in a single line prompt.
promptTrigger: true,
click: function click(notice, value) {
notice.close();
notice.fire('pnotify.confirm', { notice: notice, value: value });
}
}, {
text: 'Cancel',
textTrusted: false,
addClass: '',
click: function click(notice) {
notice.close();
notice.fire('pnotify.cancel', { notice: notice });
}
}]
};
// Register the module with PNotify.
PNotify.modules.Confirm = Component;
// Append this module to the container.
PNotify.modulesAppendContainer.push(Component);
// Add button styles to styling objects.
_extends(PNotify.styling.brighttheme, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'brighttheme-primary',
input: ''
});
_extends(PNotify.styling.bootstrap3, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-default ui-pnotify-confirm-mx-1',
btnPrimary: 'btn btn-default ui-pnotify-confirm-mx-1 btn-primary',
input: 'form-control'
});
_extends(PNotify.styling.bootstrap4, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-secondary mx-1',
btnPrimary: 'btn btn-primary mx-1',
input: 'form-control'
});
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
_extends(PNotify.styling.material, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'ui-pnotify-material-primary',
input: ''
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1y9suua-style';
style.textContent = ".ui-pnotify-action-bar.svelte-1y9suua,.ui-pnotify-prompt-bar.svelte-1y9suua{margin-top:5px;clear:both}.ui-pnotify-action-bar.svelte-1y9suua{display:flex;flex-wrap:wrap;justify-content:flex-end}.ui-pnotify-prompt-input.svelte-1y9suua{margin-bottom:5px;display:block;width:100%}.ui-pnotify-confirm-mx-1.svelte-1y9suua{margin:0 5px}.ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml{margin-left:24px}[dir=rtl] .ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml{margin-right:24px;margin-left:0}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var if_block_anchor;
var if_block = (ctx.confirm || ctx.prompt) && create_if_block(component, ctx);
return {
c: function c() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p: function p(changed, ctx) {
if (ctx.confirm || ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d: function d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
}
}
};
}
// (10:8) {#if promptMultiLine}
function create_if_block_2(component, ctx) {
var textarea,
textarea_updating = false,
textarea_class_value;
function textarea_input_handler() {
textarea_updating = true;
component.set({ promptValue: textarea.value });
textarea_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c: function c() {
textarea = createElement("textarea");
addListener(textarea, "input", textarea_input_handler);
addListener(textarea, "keypress", keypress_handler);
textarea.rows = "5";
textarea.className = textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(textarea, target, anchor);
component.refs.promptMulti = textarea;
textarea.value = ctx.promptValue;
},
p: function p(changed, ctx) {
if (!textarea_updating) textarea.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && textarea_class_value !== (textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
textarea.className = textarea_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(textarea);
}
removeListener(textarea, "input", textarea_input_handler);
removeListener(textarea, "keypress", keypress_handler);
if (component.refs.promptMulti === textarea) component.refs.promptMulti = null;
}
};
}
// (21:8) {:else}
function create_if_block_3(component, ctx) {
var input,
input_updating = false,
input_class_value;
function input_input_handler() {
input_updating = true;
component.set({ promptValue: input.value });
input_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c: function c() {
input = createElement("input");
addListener(input, "input", input_input_handler);
addListener(input, "keypress", keypress_handler);
setAttribute(input, "type", "text");
input.className = input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(input, target, anchor);
component.refs.promptSingle = input;
input.value = ctx.promptValue;
},
p: function p(changed, ctx) {
if (!input_updating) input.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && input_class_value !== (input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
input.className = input_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(input);
}
removeListener(input, "input", input_input_handler);
removeListener(input, "keypress", keypress_handler);
if (component.refs.promptSingle === input) component.refs.promptSingle = null;
}
};
}
// (3:4) {#if prompt}
function create_if_block_1(component, ctx) {
var div, div_class_value;
function select_block_type(ctx) {
if (ctx.promptMultiLine) return create_if_block_2;
return create_if_block_3;
}
var current_block_type = select_block_type(ctx);
var if_block = current_block_type(component, ctx);
return {
c: function c() {
div = createElement("div");
if_block.c();
div.className = div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
if_block.m(div, null);
},
p: function p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(div, null);
}
if (changed._notice && div_class_value !== (div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div.className = div_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
if_block.d();
}
};
}
// (42:6) {#each buttons as button}
function create_each_block(component, ctx) {
var button, button_class_value;
function select_block_type_1(ctx) {
if (ctx.button.textTrusted) return create_if_block_4;
return create_if_block_5;
}
var current_block_type = select_block_type_1(ctx);
var if_block = current_block_type(component, ctx);
return {
c: function c() {
button = createElement("button");
if_block.c();
button._svelte = { component: component, ctx: ctx };
addListener(button, "click", click_handler);
button.type = "button";
button.className = button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '' : ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '') + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(button, target, anchor);
if_block.m(button, null);
},
p: function p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(button, null);
}
button._svelte.ctx = ctx;
if ((changed.buttons || changed._notice) && button_class_value !== (button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '' : ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '') + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua")) {
button.className = button_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(button);
}
if_block.d();
removeListener(button, "click", click_handler);
}
};
}
// (50:14) {#if button.textTrusted}
function create_if_block_4(component, ctx) {
var raw_value = ctx.button.text,
raw_before,
raw_after;
return {
c: function c() {
raw_before = createElement('noscript');
raw_after = createElement('noscript');
},
m: function m(target, anchor) {
insertNode(raw_before, target, anchor);
raw_before.insertAdjacentHTML("afterend", raw_value);
insertNode(raw_after, target, anchor);
},
p: function p(changed, ctx) {
if (changed.buttons && raw_value !== (raw_value = ctx.button.text)) {
detachBetween(raw_before, raw_after);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},
d: function d(detach) {
if (detach) {
detachBetween(raw_before, raw_after);
detachNode(raw_before);
detachNode(raw_after);
}
}
};
}
// (50:57) {:else}
function create_if_block_5(component, ctx) {
var text_value = ctx.button.text,
text;
return {
c: function c() {
text = createText(text_value);
},
m: function m(target, anchor) {
insertNode(text, target, anchor);
},
p: function p(changed, ctx) {
if (changed.buttons && text_value !== (text_value = ctx.button.text)) {
text.data = text_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(text);
}
}
};
}
// (1:0) {#if confirm || prompt}
function create_if_block(component, ctx) {
var div, text, div_1, div_1_class_value;
var if_block = ctx.prompt && create_if_block_1(component, ctx);
var each_value = ctx.buttons;
var each_blocks = [];
for (var i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(component, get_each_context(ctx, each_value, i));
}
return {
c: function c() {
div = createElement("div");
if (if_block) if_block.c();
text = createText("\n ");
div_1 = createElement("div");
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
div_1.className = div_1_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
setStyle(div_1, "justify-content", ctx.align);
div.className = "ui-pnotify-confirm";
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
if (if_block) if_block.m(div, null);
appendNode(text, div);
appendNode(div_1, div);
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div_1, null);
}
},
p: function p(changed, ctx) {
if (ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block_1(component, ctx);
if_block.c();
if_block.m(div, text);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (changed.buttons || changed._notice) {
each_value = ctx.buttons;
for (var i = 0; i < each_value.length; i += 1) {
var 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(component, child_ctx);
each_blocks[i].c();
each_blocks[i].m(div_1, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if (changed._notice && div_1_class_value !== (div_1_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div_1.className = div_1_class_value;
}
if (changed.align) {
setStyle(div_1, "justify-content", ctx.align);
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
if (if_block) if_block.d();
destroyEach(each_blocks, detach);
}
};
}
function get_each_context(ctx, list, i) {
var child_ctx = Object.create(ctx);
child_ctx.button = list[i];
child_ctx.each_value = list;
child_ctx.button_index = i;
return child_ctx;
}
function click_handler(event) {
var _svelte = this._svelte,
component = _svelte.component,
ctx = _svelte.ctx;
component.handleClick(ctx.button, event);
}
function PNotifyConfirm(options) {
var _this = this;
init(this, options);
this.refs = {};
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1y9suua-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this);
_this.fire("update", { changed: assignTrue({}, _this._state), current: _this._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyConfirm.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyConfirm.prototype, methods);
PNotifyConfirm.prototype._recompute = noop;
setup(PNotifyConfirm);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
}
function detachBetween(before, after) {
while (before.nextSibling && before.nextSibling !== after) {
before.parentNode.removeChild(before.nextSibling);
}
}
function createText(data) {
return document.createTextNode(data);
}
function setStyle(node, key, value) {
node.style.setProperty(key, value);
}
function destroyEach(iterations, detach) {
for (var i = 0; i < iterations.length; i += 1) {
if (iterations[i]) iterations[i].d(detach);
}
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function noop() {}
function blankObject() {
return Object.create(null);
}
return PNotifyConfirm;
}(PNotify);
//# sourceMappingURL=PNotifyConfirm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,438 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyDesktop.html generated by Svelte v2.6.3 */
var PNotifyDesktop = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
var permission = void 0;
var Notification = window.Notification;
var _notify = function notify(title, options, onclick, onclose) {
// Memoize based on feature detection.
if ('Notification' in window) {
_notify = function notify(title, options, onclick, onclose) {
var notice = new Notification(title, options);
if ('NotificationEvent' in window) {
notice.addEventListener('notificationclick', onclick);
notice.addEventListener('close', onclose);
} else if ('addEventListener' in notice) {
notice.addEventListener('click', onclick);
notice.addEventListener('close', onclose);
} else {
notice.onclick = onclick;
notice.onclose = onclose;
}
return notice;
};
} else if ('mozNotification' in navigator) {
_notify = function notify(title, options, onclick, onclose) {
// Gecko < 22
var notice = navigator.mozNotification.createNotification(title, options.body, options.icon).show();
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else if ('webkitNotifications' in window) {
_notify = function notify(title, options, onclick, onclose) {
var notice = window.webkitNotifications.createNotification(options.icon, title, options.body);
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else {
_notify = function notify(title, options, onclick, onclose) {
return null;
};
}
return _notify(title, options, onclick, onclose);
};
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Desktop.defaults);
};
var methods = {
initModule: function initModule(options) {
var _this = this;
this.set(options);
var _get = this.get(),
_notice = _get._notice;
// Animation should always be 'none' for desktop notices, but remember
// the old animation so it can be recovered.
this.set({ '_oldAnimation': _notice.get().animation });
_notice.on('state', function (_ref) {
var changed = _ref.changed,
current = _ref.current,
previous = _ref.previous;
if (changed.animation) {
if (previous.animation === undefined || current.animation !== 'none' || previous.animation === 'none' && current.animation !== _this.get()._oldAnimation) {
_this.set({ '_oldAnimation': current.animation });
}
}
// This is necessary so desktop notices don't cause spacing problems
// when positioning.
if (changed._animatingClass) {
if (!(current._animatingClass === '' || permission !== 0 && _this.get().fallback || !_this.get().desktop)) {
_notice.set({ '_animatingClass': '' });
}
}
});
if (!this.get().desktop) {
return;
}
permission = PNotify.modules.Desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!this.get().fallback) {
_notice.set({ 'autoDisplay': false });
}
return;
}
_notice.set({ 'animation': 'none' });
_notice.addModuleClass('ui-pnotify-desktop-hide');
this.genNotice();
},
update: function update() {
var _get2 = this.get(),
_notice = _get2._notice;
if (permission !== 0 && this.get().fallback || !this.get().desktop) {
_notice.set({ 'animation': this.get()._oldAnimation });
_notice.removeModuleClass('ui-pnotify-desktop-hide');
return;
} else {
_notice.set({ 'animation': 'none' });
_notice.addModuleClass('ui-pnotify-desktop-hide');
}
this.genNotice();
},
beforeOpen: function beforeOpen() {
if (this.get().desktop && permission !== 0) {
PNotify.modules.Desktop.permission();
}
if (permission !== 0 && this.get().fallback || !this.get().desktop) {
return;
}
var _get3 = this.get(),
_desktop = _get3._desktop;
if (_desktop && 'show' in _desktop) {
this.get()._notice.set({ '_moduleIsNoticeOpen': true });
_desktop.show();
}
},
beforeClose: function beforeClose() {
if (permission !== 0 && this.get().fallback || !this.get().desktop) {
return;
}
var _get4 = this.get(),
_desktop = _get4._desktop;
if (_desktop && 'close' in _desktop) {
_desktop.close();
this.get()._notice.set({ '_moduleIsNoticeOpen': false });
}
},
genNotice: function genNotice() {
var _get5 = this.get(),
_notice = _get5._notice,
icon = _get5.icon;
if (icon === null) {
switch (_notice.get().type) {
case 'error':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQg7e6HvQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABr0lEQVRYw8WXu0oDQRSGv7hRSFYrLTTWKihaqUgUJO+gphBLL1jYpPSCVcAggpWthYhC7Ows9An0IbSPkMRCw8ZmFuI6yczs9cAPuzNz5v92brtrESxGARtokkCcAg2hk7jNl4G2R/m4zFPAiwTgWdRFHnmJuaulOAAaPQDqUZvv9DB3tR0lwIcGwHtU5uca5q4qYZvngJbHpAZ8CtU8dS1gLEyAisegBGTFKWiL65KnzVlY5uOSId6VtNuTtMupOu/TAHiQlNmSskHNXCOAGWBeUp7VhFoApoMAXAOWJoCszBJ9+ALY6vL0JiPgjsKmKUAaOOoBZwIAcNxlJLsCrAOTIQJMAWu62y4LOIqT7lGS96TIcYCMDkBZ46h1gB+PHI28ssq8X/G6DaqG8Piz2DrjVjGXbtSBy46F5QAHwJAizwZugKKscs7gSaqS/KpB/qxsFxwafhf6Odb/eblJi8BGwJdW26BtURxQpMU83hmaDQsNiPtvYMSwj3tgAqDgYzU7wJdHjo9+CgBvEW47lV5Tgj5DMtG0xIfESkIAF+522gdWxTzGEX3i9+6KpOMXF5UBt0NKJCAAAAAASUVORK5CYII=' });
break;
case 'success':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQPRj+65AAAAdBJREFUWMPtlzsvRFEQx3+7HmEjoiYKolVJJDRqnS8ggvVIVEQhCIUsEYJGCEH2E4h4FPREaLTbEo1IEJXHrmY2GTf33nPuY7ud5OTenTMz//89Z86ZWShLWf5LB3AOfACFiOMF2AkC3qOc88BXxFEAxlX8ftGdaNCEen8H6oFHYBR4FocwkpTngzzHgF01fwL0aYcp9fVtMW/rsMcWXWijK1Hexgye9smRT6CxaHgjytMYwccNSXqoja9FeVbiZS+OVaeDiUBLAPAJA/i2m5MXgRSQk7llC/DBMOBeBGqAe0eAjQhfvurH3EmgQk6EW6CVEHt+ZFo6J4EU8OoTcF35jhnAl2wSx20LFgyB1yyOWtY2c72ScMAAkPeZy6g4zUBdGAIAcyEq4Z7y7xbdTFgCACMBwPVJqVDHeNqvaplkH5i0sNuUwmaNkQxww20ZSOy7gFvX7SAk0i76jPQQlJoAwAEwq35ngfmwVatSdUMArZZ+K9JQ1Bp6iGqgSt7f/AIOqSzujLEn6AV+JG6zm4HuCZ+AJuAbWAQu5aIJu7JDck0ngDugC/j1c2qPqR13jpxuvWyS8liY/kQcean/lX6ACQ99DdAQYe+Lf0zylMUgf7qDKgzv284QAAAAAElFTkSuQmCC' });
break;
case 'info':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQ09zRTwAAAAdxJREFUWMPtl88rRFEUxz8zBolRCgsrpOym8TMSO2WplLKwUrKi/B0W7JSFmhVLNlhSlLKx8CtRGpEsJpofpZk3Nkc9b968e++8mdlw6vTeu/edc773nl/3wl+ngOH/zUAf0AN0AmEgB7wCD8AtcFMJoM3ADpAHLHk62RIwL8B0uQwHgXVRnDfkS2DSj/EW4K0Ew05eLMV4O/CuUJwEUvJUgdgwMd4IpBUKl13kVG6aL+ZjJ20DDQqQXy5jKYVMDBhVrb5f069LLrKfGnInqh040HRTvsTAHgei9oGQ7X0YaNNUNCdFKChgQvKtQ1vAkNvEahlSToez9oXad2BCA30ceHZxRxMQMShuvZLmv+hOA32/h+KUwS7MugVhqwb6Go+5nEEwht0ABDUEzyXdFsrQYwqMJjTbdxio9Qkg6QbgvkpnkLw0uQIAZ1UCYNkXawdw4qPCmVBcuADAMZCpAoCVYr3AKtYyHZSWauakjMx50TWwrzJw6lFARjQOt3se8jM6W9TloSCqIb9bRHbN5Fg+KkEZcow/Ak+KFBsD6h3jR8CUabAMlqn7xfxEbAdwWKLhhO3sGPCbOsNSvSyF0Z/5TaCuEleziLhmAOiWG1NWrmZXwIVU1A/+SZO+AcgLC4wt0zD3AAAAAElFTkSuQmCC' });
break;
case 'notice':
default:
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATM4scOJLAAAAcxJREFUWMPtljtLA0EQx3+J0QRfnYqCiCA+MERBrIwgFtoFbMTOR61i5QcQBdEihZWNoEWwsNAvkMJeBLHRQtHC0iIP4utOmw2cx97d7l2SRgcGbufmv/Pf2dmdhb8uIR+YJqAPaBff30AeeAHuxLgqMgRkgS/AAEybGuLfEdBcycCTwKVYmY5mgO6gwdd8BLaqAST9Bs8EDG7VTd3gex4TbgEjwKjQOHDugZlRDb7sMZEJpCS4bYVMJOygsG1cB+wqHN0Gib1RYXFpLwL74nx7Sb3EFlXATQNjTgRagA3FbZIRiCliT5wITGgUaRACA0CPjMC4xtUcDUAgDAzLCCQ0MhALQCAE9MoIdGkQCJIBgE4ZgWiNMvDL10qgUMMMFGQEnjQmkLXbVg38s8y4qtFcTCAnHiJ5oKiJnSoHjVgIXAmHkGIl5yy+YcWruIy9dvqpupIDCfZWEXvh1gsWFVfxIbG9a3RbRwJnYiuqJYfAqxsBgBWFiQyJzfTAlIB1uzEicbwBFoBTl8lSwINoSuXKjrv4F4FBh61zlKUKvgn7/e5ZEngMEDgLdFSieHaAT42LpgTMVbqC24B54Bi4twV9E6cnDcw6PFj+RSo/l6rlSlldhx4AAAAASUVORK5CYII=' });
break;
}
} else if (icon === false) {
this.set({ '_icon': null });
} else {
this.set({ '_icon': icon });
}
var _get6 = this.get(),
tag = _get6.tag;
if (!this.get()._tag || tag !== null) {
this.set({
'_tag': tag === null ? 'PNotify-' + Math.round(Math.random() * 1000000) : tag
});
}
var options = {
body: this.get().text || _notice.get().text,
tag: this.get()._tag
};
if (!_notice.get().hide) {
options.requireInteraction = true;
}
if (this.get()._icon !== null) {
options.icon = this.get()._icon;
}
Object.apply(options, this.get().options);
var _desktop = _notify(this.get().title || _notice.get().title, options, function () {
_notice.fire('click', { target: _desktop });
}, function () {
_notice.close();
});
_notice.set({ '_moduleIsNoticeOpen': true });
this.set({ _desktop: _desktop });
if (!('close' in _desktop) && 'cancel' in _desktop) {
_desktop.close = function () {
_desktop.cancel();
};
}
}
};
function setup(Component) {
Component.key = 'Desktop';
Component.defaults = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the 'update' function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null,
// Optionally display a different title for the desktop.
title: null,
// Optionally display different text for the desktop.
text: null,
// Any additional options to be passed to the Notification constructor.
options: {}
};
Component.init = function (notice) {
return new Component({ target: document.body });
};
Component.permission = function () {
if (typeof Notification !== 'undefined' && 'requestPermission' in Notification) {
Notification.requestPermission();
} else if ('webkitNotifications' in window) {
window.webkitNotifications.requestPermission();
}
};
Component.checkPermission = function () {
if (typeof Notification !== 'undefined' && 'permission' in Notification) {
return Notification.permission === 'granted' ? 0 : 1;
} else if ('webkitNotifications' in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1; // eslint-disable-line eqeqeq
} else {
return 1;
}
};
permission = Component.checkPermission();
// Register the module with PNotify.
PNotify.modules.Desktop = Component;
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-xbgnx4-style';
style.textContent = "[ui-pnotify].ui-pnotify-desktop-hide.ui-pnotify{left:-10000px !important;display:none !important}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyDesktop(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-xbgnx4-style")) add_css();
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyDesktop.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyDesktop.prototype, methods);
PNotifyDesktop.prototype._recompute = noop;
setup(PNotifyDesktop);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyDesktop;
}(PNotify);
//# sourceMappingURL=PNotifyDesktop.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,282 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyHistory.html generated by Svelte v2.6.3 */
var PNotifyHistory = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.History.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
if (this.get().history) {
// Don't destroy notices that are in history.
var _get = this.get(),
_notice = _get._notice;
if (_notice.get().destroy) {
_notice.set({ 'destroy': false });
}
}
},
beforeOpen: function beforeOpen() {
var _get2 = this.get(),
maxInStack = _get2.maxInStack,
_options = _get2._options;
if (maxInStack === Infinity) {
return;
}
var stack = _options.stack;
if (stack === false) {
return;
}
// Remove oldest notifications leaving only maxInStack from the stack.
if (PNotify.notices && PNotify.notices.length > maxInStack) {
// Oldest are normally in front of array, or if stack.push=='top' then
// they are at the end of the array!
var top = stack.push === 'top';
var forRemoval = [];
var currentOpen = 0;
for (var i = top ? 0 : PNotify.notices.length - 1; top ? i < PNotify.notices.length : i >= 0; top ? i++ : i--) {
if (['opening', 'open'].indexOf(PNotify.notices[i].get()._state) !== -1 && PNotify.notices[i].get().stack === stack) {
if (currentOpen >= maxInStack) {
forRemoval.push(PNotify.notices[i]);
} else {
currentOpen++;
}
}
}
for (var _i = 0; _i < forRemoval.length; _i++) {
forRemoval[_i].close(false);
}
}
}
};
function setup(Component) {
Component.key = 'History';
Component.defaults = {
// Place the notice in the history.
history: true,
// Maximum number of notices to have open in its stack.
maxInStack: Infinity
};
Component.init = function (notice) {
return new Component({ target: document.body });
};
Component.showLast = function (stack) {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
var top = stack.push === 'top';
// Look up the last history notice, and display it.
var i = top ? 0 : PNotify.notices.length - 1;
var notice = void 0;
do {
notice = PNotify.notices[i];
if (!notice) {
return;
}
i += top ? 1 : -1;
} while (notice.get().stack !== stack || !notice.get()._modules.History.get().history || notice.get()._state === 'opening' || notice.get()._state === 'open');
notice.open();
};
Component.showAll = function (stack) {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
// Display all notices. (Disregarding non-history notices.)
for (var i = 0; i < PNotify.notices.length; i++) {
var notice = PNotify.notices[i];
if ((stack === true || notice.get().stack === stack) && notice.get()._modules.History.get().history) {
notice.open();
}
}
};
// Register the module with PNotify.
PNotify.modules.History = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyHistory(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyHistory.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyHistory.prototype, methods);
PNotifyHistory.prototype._recompute = noop;
setup(PNotifyHistory);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyHistory;
}(PNotify);
//# sourceMappingURL=PNotifyHistory.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,433 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyMobile.html generated by Svelte v2.6.3 */
var PNotifyMobile = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Mobile.defaults);
};
var methods = {
initModule: function initModule(options) {
var _this = this;
this.set(options);
var _get = this.get(),
_notice = _get._notice;
var origXY = null;
var diffXY = null;
var noticeWidthHeight = null;
var noticeOpacity = null;
var csspos = 'left';
var direction = 'X';
var span = 'Width';
_notice.on('touchstart', function (e) {
if (!_this.get().swipeDismiss) {
return;
}
var _notice$get = _notice.get(),
stack = _notice$get.stack;
if (stack !== false) {
switch (stack.dir1) {
case 'up':
case 'down':
csspos = 'left';
direction = 'X';
span = 'Width';
break;
case 'left':
case 'right':
csspos = 'top';
direction = 'Y';
span = 'Height';
break;
}
}
origXY = e.touches[0]['screen' + direction];
noticeWidthHeight = _notice.refs.elem['scroll' + span];
noticeOpacity = window.getComputedStyle(_notice.refs.elem)['opacity'];
_notice.refs.container.style[csspos] = 0;
});
_notice.on('touchmove', function (e) {
if (!origXY || !_this.get().swipeDismiss) {
return;
}
var curXY = e.touches[0]['screen' + direction];
diffXY = curXY - origXY;
var opacity = (1 - Math.abs(diffXY) / noticeWidthHeight) * noticeOpacity;
_notice.refs.elem.style.opacity = opacity;
_notice.refs.container.style[csspos] = diffXY + 'px';
});
_notice.on('touchend', function () {
if (!origXY || !_this.get().swipeDismiss) {
return;
}
_notice.refs.container.classList.add('ui-pnotify-mobile-animate-left');
if (Math.abs(diffXY) > 40) {
var goLeft = diffXY < 0 ? noticeWidthHeight * -2 : noticeWidthHeight * 2;
_notice.refs.elem.style.opacity = 0;
_notice.refs.container.style[csspos] = goLeft + 'px';
_notice.close();
} else {
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
}
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
_notice.on('touchcancel', function () {
if (!origXY || !_this.get().swipeDismiss) {
return;
}
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
this.doMobileStyling();
},
update: function update() {
this.doMobileStyling();
},
beforeOpen: function beforeOpen() {
// Add an event listener to watch the window resizes.
window.addEventListener('resize', this.get()._doMobileStylingBound);
},
afterClose: function afterClose() {
// Remove the event listener.
window.removeEventListener('resize', this.get()._doMobileStylingBound);
// Remove any styling we added to close it.
if (!this.get().swipeDismiss) {
return;
}
var _get2 = this.get(),
_notice = _get2._notice;
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty('left');
_notice.refs.container.style.removeProperty('top');
},
doMobileStyling: function doMobileStyling() {
var _get3 = this.get(),
_notice = _get3._notice;
var _notice$get2 = _notice.get(),
stack = _notice$get2.stack;
if (this.get().styling) {
if (stack !== false) {
if (window.innerWidth <= 480) {
if (!stack.mobileOrigSpacing1) {
stack.mobileOrigSpacing1 = stack.spacing1;
}
stack.spacing1 = 0;
if (!stack.mobileOrigFirstpos1) {
stack.mobileOrigFirstpos1 = stack.firstpos1;
}
stack.firstpos1 = 0;
if (!stack.mobileOrigSpacing2) {
stack.mobileOrigSpacing2 = stack.spacing2;
}
stack.spacing2 = 0;
if (!stack.mobileOrigFirstpos2) {
stack.mobileOrigFirstpos2 = stack.firstpos2;
}
stack.firstpos2 = 0;
} else {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
switch (stack.dir1) {
case 'down':
_notice.addModuleClass('ui-pnotify-mobile-top');
break;
case 'up':
_notice.addModuleClass('ui-pnotify-mobile-bottom');
break;
case 'left':
_notice.addModuleClass('ui-pnotify-mobile-right');
break;
case 'right':
_notice.addModuleClass('ui-pnotify-mobile-left');
break;
}
}
_notice.addModuleClass('ui-pnotify-mobile-able');
} else {
_notice.removeModuleClass('ui-pnotify-mobile-able', 'ui-pnotify-mobile-top', 'ui-pnotify-mobile-bottom', 'ui-pnotify-mobile-right', 'ui-pnotify-mobile-left');
if (stack !== false) {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
}
}
};
function oncreate() {
this.set({ '_doMobileStylingBound': this.doMobileStyling.bind(this) });
};
function setup(Component) {
Component.key = 'Mobile';
Component.defaults = {
// Let the user swipe the notice away.
swipeDismiss: true,
// Styles the notice to look good on mobile.
styling: true
};
Component.init = function (notice) {
return new Component({ target: document.body });
};
// Register the module with PNotify.
PNotify.modules.Mobile = Component;
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-49u8sj-style';
style.textContent = "[ui-pnotify] .ui-pnotify-container{position:relative}[ui-pnotify] .ui-pnotify-mobile-animate-left{transition:left .1s ease}[ui-pnotify] .ui-pnotify-mobile-animate-top{transition:top .1s ease}@media(max-width: 480px){[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able{font-size:1.2em;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;font-smoothing:antialiased}body > [ui-pnotify].ui-pnotify.ui-pnotify-mobile-able{position:fixed}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom{width:100% !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right{height:100% !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-shadow{border-bottom-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-shadow{border-top-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-shadow{border-right-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-shadow{border-left-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-container{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-container,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-container{width:auto !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-container,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-container{height:100% !important}}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyMobile(options) {
var _this2 = this;
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-49u8sj-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this2);
_this2.fire("update", { changed: assignTrue({}, _this2._state), current: _this2._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyMobile.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyMobile.prototype, methods);
PNotifyMobile.prototype._recompute = noop;
setup(PNotifyMobile);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
return PNotifyMobile;
}(PNotify);
//# sourceMappingURL=PNotifyMobile.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,204 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyNonBlock.html generated by Svelte v2.6.3 */
var PNotifyNonBlock = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.NonBlock.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
this.doNonBlockClass();
},
update: function update() {
this.doNonBlockClass();
},
doNonBlockClass: function doNonBlockClass() {
if (this.get().nonblock) {
this.get()._notice.addModuleClass('nonblock');
} else {
this.get()._notice.removeModuleClass('nonblock');
}
}
};
function setup(Component) {
Component.key = 'NonBlock';
Component.defaults = {
// Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
Component.init = function (notice) {
return new Component({ target: document.body,
data: {
'_notice': notice
} });
};
// Register the module with PNotify.
PNotify.modules.NonBlock = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyNonBlock(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyNonBlock.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyNonBlock.prototype, methods);
PNotifyNonBlock.prototype._recompute = noop;
setup(PNotifyNonBlock);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyNonBlock;
}(PNotify);
//# sourceMappingURL=PNotifyNonBlock.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["src/PNotifyNonBlock.html"],"names":[],"mappings":";;;;;;;;;;UAuBS,I,GAAG;AACN,SAAO,SAAc;AACnB,cAAW,IADQ,EACJ;AACf,eAAY,EAFO,CAEL;AAFK,GAAd,EAGJ,QAAQ,OAAR,CAAgB,QAAhB,CAAyB,QAHrB,CAAP;AAID;;eAEQ;AACP,YADO,sBACK,OADL,EACc;AACnB,QAAK,GAAL,CAAS,OAAT;AACA,QAAK,eAAL;AACD,GAJM;AAMP,QANO,oBAMG;AACR,QAAK,eAAL;AACD,GARM;AAUP,iBAVO,6BAUY;AACjB,OAAI,KAAK,GAAL,GAAW,QAAf,EAAyB;AACvB,SAAK,GAAL,GAAW,OAAX,CAAmB,cAAnB,CAAkC,UAAlC;AACD,IAFD,MAEO;AACL,SAAK,GAAL,GAAW,OAAX,CAAmB,iBAAnB,CAAqC,UAArC;AACD;AACF;AAhBM,E;;UA1BH,K,CAAC,S,EAAW;AAChB,YAAU,GAAV,GAAgB,UAAhB;;AAEA,YAAU,QAAV,GAAqB;AACvB;AACI,aAAU;AAFS,GAArB;;AAKA,YAAU,IAAV,GAAiB,UAAC,MAAD,EAAY;AAC3B,UAAO,IAAI,SAAJ,CAAc,EAAC,QAAQ,SAAS,IAAlB;AACnB,UAAM;AACJ,gBAAW;AADP,KADa,EAAd,CAAP;AAID,GALD;;AAOF;AACE,UAAQ,OAAR,CAAgB,QAAhB,GAA2B,SAA3B;AACD","sourcesContent":["<script>\n import PNotify from './PNotify.html';\n\n export default {\n setup (Component) {\n Component.key = 'NonBlock';\n\n Component.defaults = {\n // Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.\n nonblock: false\n };\n\n Component.init = (notice) => {\n return new Component({target: document.body,\n data: {\n '_notice': notice\n }});\n };\n\n // Register the module with PNotify.\n PNotify.modules.NonBlock = Component;\n },\n\n data () {\n return Object.assign({\n '_notice': null, // The PNotify notice.\n '_options': {} // The options for the notice.\n }, PNotify.modules.NonBlock.defaults);\n },\n\n methods: {\n initModule (options) {\n this.set(options);\n this.doNonBlockClass();\n },\n\n update () {\n this.doNonBlockClass();\n },\n\n doNonBlockClass () {\n if (this.get().nonblock) {\n this.get()._notice.addModuleClass('nonblock');\n } else {\n this.get()._notice.removeModuleClass('nonblock');\n }\n }\n }\n };\n</script>\n"]}

View File

@@ -1,440 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyReference.html generated by Svelte v2.6.3 */
var PNotifyReference = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Reference.defaults);
};
var methods = {
// This method is called from the core to give us our actual options.
// Until it is called, our options will just be the defaults.
initModule: function initModule(options) {
var _this = this;
// Set our options.
this.set(options);
// Now that the notice is available to us, we can listen to events fired
// from it.
var _get = this.get(),
_notice = _get._notice;
_notice.on('mouseenter', function () {
return _this.set({ '_mouseIsIn': true });
});
_notice.on('mouseleave', function () {
return _this.set({ '_mouseIsIn': false });
});
},
doSomething: function doSomething() {
// Spin the notice around.
var curAngle = 0;
var _get2 = this.get(),
_notice = _get2._notice;
var timer = setInterval(function () {
curAngle += 10;
if (curAngle === 360) {
curAngle = 0;
clearInterval(timer);
}
_notice.refs.elem.style.transform = 'rotate(' + curAngle + 'deg)';
}, 20);
},
// I have nothing to put in these, just showing you that they exist. You
// won't need to include them if you aren't using them.
update: function update() {
// Called when the notice is updating its options.
},
beforeOpen: function beforeOpen() {
// Called before the notice is opened.
},
afterOpen: function afterOpen() {
// Called after the notice is opened.
},
beforeClose: function beforeClose() {
// Called before the notice is closed.
},
afterClose: function afterClose() {
// Called after the notice is closed.
},
beforeDestroy: function beforeDestroy() {
// Called before the notice is destroyed.
},
afterDestroy: function afterDestroy() {
// Called after the notice is destroyed.
}
};
function oncreate() {
// This is the second way to init a module. Because we put markup in the
// template, we have to fire this event to tell the core that we are ready
// to receive our options.
this.fire('init', { module: this });
};
function setup(Component) {
// This is the key you use for registering your module with PNotify.
Component.key = 'Reference';
// This if the default values of your options.
Component.defaults = {
// Provide a thing for stuff. Turned off by default.
putThing: false,
// If you are displaying any text, you should use a labels options to
// support internationalization.
labels: {
text: 'Spin Around'
}
};
// This is the first way to init a module. If you aren't placing any
// markup in the template, you would do this.
// Component.init = (_notice) => {
// return new Component({target: document.body, data: {_notice}});
// };
// Register the module with PNotify.
PNotify.modules.Reference = Component;
// Append our markup to the container.
PNotify.modulesAppendContainer.push(Component);
// This is where you would add any styling or icons classes you are using in your code.
_extends(PNotify.icons.brighttheme, {
athing: 'bt-icon bt-icon-refresh'
});
_extends(PNotify.icons.bootstrap3, {
athing: 'glyphicon glyphicon-refresh'
});
_extends(PNotify.icons.fontawesome4, {
athing: 'fa fa-refresh'
});
_extends(PNotify.icons.fontawesome5, {
athing: 'fas fa-sync'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
_extends(PNotify.icons.material, {
athing: 'material-icons pnotify-material-icon-refresh'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1qy4b0e-style';
style.textContent = ".ui-pnotify-reference-button.svelte-1qy4b0e{float:right}.ui-pnotify-reference-clearing.svelte-1qy4b0e{clear:right;line-height:0}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var if_block_anchor;
var if_block = ctx.putThing && create_if_block(component, ctx);
return {
c: function c() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p: function p(changed, ctx) {
if (ctx.putThing) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d: function d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
}
}
};
}
// (2:0) {#if putThing}
function create_if_block(component, ctx) {
var button,
i,
i_class_value,
text,
text_1_value = ctx.labels.text,
text_1,
button_disabled_value,
text_3,
div;
function click_handler(event) {
component.doSomething();
}
return {
c: function c() {
button = createElement("button");
i = createElement("i");
text = createText(" ");
text_1 = createText(text_1_value);
text_3 = createText("\n \n ");
div = createElement("div");
i.className = i_class_value = "" + ctx._notice.get()._icons.athing + " svelte-1qy4b0e";
addListener(button, "click", click_handler);
button.className = "ui-pnotify-reference-button btn btn-default svelte-1qy4b0e";
button.type = "button";
button.disabled = button_disabled_value = !ctx._mouseIsIn;
div.className = "ui-pnotify-reference-clearing svelte-1qy4b0e";
},
m: function m(target, anchor) {
insertNode(button, target, anchor);
appendNode(i, button);
appendNode(text, button);
appendNode(text_1, button);
component.refs.thingElem = button;
insertNode(text_3, target, anchor);
insertNode(div, target, anchor);
},
p: function p(changed, ctx) {
if (changed._notice && i_class_value !== (i_class_value = "" + ctx._notice.get()._icons.athing + " svelte-1qy4b0e")) {
i.className = i_class_value;
}
if (changed.labels && text_1_value !== (text_1_value = ctx.labels.text)) {
text_1.data = text_1_value;
}
if (changed._mouseIsIn && button_disabled_value !== (button_disabled_value = !ctx._mouseIsIn)) {
button.disabled = button_disabled_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(button);
}
removeListener(button, "click", click_handler);
if (component.refs.thingElem === button) component.refs.thingElem = null;
if (detach) {
detachNode(text_3);
detachNode(div);
}
}
};
}
function PNotifyReference(options) {
var _this2 = this;
init(this, options);
this.refs = {};
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1qy4b0e-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this2);
_this2.fire("update", { changed: assignTrue({}, _this2._state), current: _this2._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyReference.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyReference.prototype, methods);
PNotifyReference.prototype._recompute = noop;
setup(PNotifyReference);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function createText(data) {
return document.createTextNode(data);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function noop() {}
function blankObject() {
return Object.create(null);
}
return PNotifyReference;
}(PNotify);
//# sourceMappingURL=PNotifyReference.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,210 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
/* src/PNotifyStyleMaterial.html generated by Svelte v2.6.3 */
var PNotifyStyleMaterial = function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function setup(Component) {
Component.key = 'StyleMaterial';
// Register the module with PNotify.
PNotify.modules.StyleMaterial = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
PNotify.styling.material = _extends(PNotify.styling.material, {
container: 'pnotify-material',
notice: 'pnotify-material-notice',
info: 'pnotify-material-info',
success: 'pnotify-material-success',
error: 'pnotify-material-error'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
PNotify.icons.material = _extends(PNotify.icons.material, {
notice: 'material-icons pnotify-material-icon-notice',
info: 'material-icons pnotify-material-icon-info',
success: 'material-icons pnotify-material-icon-success',
error: 'material-icons pnotify-material-icon-error',
closer: 'material-icons pnotify-material-icon-closer',
pinUp: 'material-icons pnotify-material-icon-sticker',
pinDown: 'material-icons pnotify-material-icon-sticker pnotify-material-icon-stuck'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-19og8nx-style';
style.textContent = "[ui-pnotify] .pnotify-material{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;font-size:14px}[ui-pnotify] .pnotify-material.ui-pnotify-shadow{-webkit-box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2);-moz-box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2);box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2)}[ui-pnotify] .pnotify-material.ui-pnotify-container{padding:24px}[ui-pnotify] .pnotify-material .ui-pnotify-title{font-size:20px;margin-bottom:20px;line-height:24px}[ui-pnotify] .pnotify-material .ui-pnotify-title:last-child{margin-bottom:0}[ui-pnotify] .pnotify-material .ui-pnotify-text{font-size:16px;line-height:24px}[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title,[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text,[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm{margin-left:32px}[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title,[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text,[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm{margin-right:32px;margin-left:0}[ui-pnotify] .pnotify-material .ui-pnotify-action-bar{margin-top:20px;margin-right:-16px;margin-bottom:-16px}[dir=rtl] [ui-pnotify] .pnotify-material .ui-pnotify-action-bar{margin-left:-16px;margin-right:0}[ui-pnotify] .pnotify-material-notice{background-color:#FFEE58;border:none;color:#000}[ui-pnotify] .pnotify-material-info{background-color:#26C6DA;border:none;color:#000}[ui-pnotify] .pnotify-material-success{background-color:#66BB6A;border:none;color:#fff}[ui-pnotify] .pnotify-material-error{background-color:#EF5350;border:none;color:#fff}[ui-pnotify] .pnotify-material-icon-notice,[ui-pnotify] .pnotify-material-icon-info,[ui-pnotify] .pnotify-material-icon-success,[ui-pnotify] .pnotify-material-icon-error,[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{position:relative}[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{height:20px;width:20px;font-size:20px;line-height:20px;position:relative}[ui-pnotify] .pnotify-material-icon-notice:after,[ui-pnotify] .pnotify-material-icon-info:after,[ui-pnotify] .pnotify-material-icon-success:after,[ui-pnotify] .pnotify-material-icon-error:after,[ui-pnotify] .pnotify-material-icon-closer:after,[ui-pnotify] .pnotify-material-icon-sticker:after{font-family:'Material Icons'}[ui-pnotify] .pnotify-material-icon-notice:after{content:\"announcement\"}[ui-pnotify] .pnotify-material-icon-info:after{content:\"info\"}[ui-pnotify] .pnotify-material-icon-success:after{content:\"check_circle\"}[ui-pnotify] .pnotify-material-icon-error:after{content:\"error\"}[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{display:inline-block}[ui-pnotify] .pnotify-material-icon-closer:after{top:-4px;content:\"close\"}[ui-pnotify] .pnotify-material-icon-sticker:after{top:-5px;content:\"pause\"}[ui-pnotify] .pnotify-material-icon-sticker.pnotify-material-icon-stuck:after{content:\"play_arrow\"}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input{display:block;width:100%;margin-bottom:8px;padding:15px 0 8px;background-color:transparent;color:inherit;border-radius:0;border-top:none;border-left:none;border-right:none;border-bottom-style:solid;border-bottom-color:inherit;border-bottom-width:1px}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input:focus{outline:none;border-bottom-color:#3F51B5;border-bottom-width:2px}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button{position:relative;padding:0 16px;overflow:hidden;border-width:0;outline:none;border-radius:2px;background-color:transparent;color:inherit;transition:background-color .3s;text-transform:uppercase;height:36px;margin:6px;min-width:64px;font-weight:bold}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary{color:#3F51B5}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:hover,[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:focus{background-color:rgba(0, 0, 0, .12);color:inherit}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:hover,[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:focus{color:#303F9F}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:before{content:\"\";position:absolute;top:50%;left:50%;display:block;width:0;padding-top:0;border-radius:100%;background-color:rgba(153, 153, 153, .4);-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);-o-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:active:before{width:120%;padding-top:120%;transition:width .2s ease-out, padding-top .2s ease-out}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyStyleMaterial(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
if (!document.getElementById("svelte-19og8nx-style")) add_css();
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyStyleMaterial.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
PNotifyStyleMaterial.prototype._recompute = noop;
setup(PNotifyStyleMaterial);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyStyleMaterial;
}(PNotify);
//# sourceMappingURL=PNotifyStyleMaterial.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,315 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyAnimate.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyAnimate', ["./PNotify"], factory) : global.PNotifyAnimate = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Animate.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
this.setUpAnimations();
},
update: function update() {
this.setUpAnimations();
},
setUpAnimations: function setUpAnimations() {
var _get = this.get(),
_notice = _get._notice,
_options = _get._options,
animate = _get.animate;
if (animate) {
_notice.set({ 'animation': 'none' });
if (!_notice._animateIn) {
_notice._animateIn = _notice.animateIn;
}
if (!_notice._animateOut) {
_notice._animateOut = _notice.animateOut;
}
_notice.animateIn = this.animateIn.bind(this);
_notice.animateOut = this.animateOut.bind(this);
var animSpeed = 250;
if (_options.animateSpeed === 'slow') {
animSpeed = 400;
} else if (_options.animateSpeed === 'fast') {
animSpeed = 100;
} else if (_options.animateSpeed > 0) {
animSpeed = _options.animateSpeed;
}
animSpeed = animSpeed / 1000;
_notice.refs.elem.style.WebkitAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.MozAnimationDuration = animSpeed + 's';
_notice.refs.elem.style.animationDuration = animSpeed + 's';
} else if (_notice._animateIn && _notice._animateOut) {
_notice.animateIn = _notice._animateIn;
delete _notice._animateIn;
_notice.animateOut = _notice._animateOut;
delete _notice._animateOut;
}
},
animateIn: function animateIn(callback) {
var _get2 = this.get(),
_notice = _get2._notice;
// Declare that the notice is animating in.
_notice.set({ '_animating': 'in' });
var finished = function finished() {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated' });
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({ '_animating': false });
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated ' + this.get().inClass });
},
animateOut: function animateOut(callback) {
var _get3 = this.get(),
_notice = _get3._notice;
// Declare that the notice is animating out.
_notice.set({ '_animating': 'out' });
var finished = function finished() {
_notice.refs.elem.removeEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.removeEventListener('mozAnimationEnd', finished);
_notice.refs.elem.removeEventListener('MSAnimationEnd', finished);
_notice.refs.elem.removeEventListener('oanimationend', finished);
_notice.refs.elem.removeEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'animated' });
if (callback) {
callback.call();
}
// Declare that the notice has completed animating.
_notice.set({ '_animating': false });
};
_notice.refs.elem.addEventListener('webkitAnimationEnd', finished);
_notice.refs.elem.addEventListener('mozAnimationEnd', finished);
_notice.refs.elem.addEventListener('MSAnimationEnd', finished);
_notice.refs.elem.addEventListener('oanimationend', finished);
_notice.refs.elem.addEventListener('animationend', finished);
_notice.set({ '_animatingClass': 'ui-pnotify-in animated ' + this.get().outClass });
}
};
function setup(Component) {
Component.key = 'Animate';
Component.defaults = {
// Use animate.css to animate the notice.
animate: false,
// The class to use to animate the notice in.
inClass: '',
// The class to use to animate the notice out.
outClass: ''
};
Component.init = function (notice) {
notice.attention = function (aniClass, callback) {
var cb = function cb() {
notice.refs.container.removeEventListener('webkitAnimationEnd', cb);
notice.refs.container.removeEventListener('mozAnimationEnd', cb);
notice.refs.container.removeEventListener('MSAnimationEnd', cb);
notice.refs.container.removeEventListener('oanimationend', cb);
notice.refs.container.removeEventListener('animationend', cb);
notice.refs.container.classList.remove(aniClass);
if (callback) {
callback.call(notice);
}
};
notice.refs.container.addEventListener('webkitAnimationEnd', cb);
notice.refs.container.addEventListener('mozAnimationEnd', cb);
notice.refs.container.addEventListener('MSAnimationEnd', cb);
notice.refs.container.addEventListener('oanimationend', cb);
notice.refs.container.addEventListener('animationend', cb);
notice.refs.container.classList.add('animated');
notice.refs.container.classList.add(aniClass);
};
return new Component({ target: document.body });
};
// Register the module with PNotify.
PNotify.modules.Animate = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyAnimate(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyAnimate.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyAnimate.prototype, methods);
PNotifyAnimate.prototype._recompute = noop;
setup(PNotifyAnimate);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyAnimate;
});
//# sourceMappingURL=PNotifyAnimate.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,541 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyButtons.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyButtons', ["./PNotify"], factory) : global.PNotifyButtons = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function _showSticker(_ref) {
var sticker = _ref.sticker,
_notice = _ref._notice;
return sticker && !(_notice && _notice.refs.elem.classList.contains('nonblock'));
}
function _showCloser(_ref2) {
var closer = _ref2.closer,
_notice = _ref2._notice;
return closer && !(_notice && _notice.refs.elem.classList.contains('nonblock'));
}
function _pinUpClass(_ref3) {
var classes = _ref3.classes,
_notice = _ref3._notice;
return _notice ? classes.pinUp === null ? _notice.get()._icons.pinUp : classes.pinUp : '';
}
function _pinDownClass(_ref4) {
var classes = _ref4.classes,
_notice = _ref4._notice;
return _notice ? classes.pinDown === null ? _notice.get()._icons.pinDown : classes.pinDown : '';
}
function _closerClass(_ref5) {
var classes = _ref5.classes,
_notice = _ref5._notice;
return _notice ? classes.closer === null ? _notice.get()._icons.closer : classes.closer : '';
}
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Buttons.defaults);
};
var methods = {
initModule: function initModule(options) {
var _this = this;
this.set(options);
var _get = this.get(),
_notice = _get._notice;
_notice.on('mouseenter', function () {
return _this.set({ '_mouseIsIn': true });
});
_notice.on('mouseleave', function () {
return _this.set({ '_mouseIsIn': false });
});
_notice.on('state', function (_ref6) {
var changed = _ref6.changed,
current = _ref6.current;
if (!changed.hide) {
return;
}
var _get2 = _this.get(),
sticker = _get2.sticker;
if (!sticker) {
return;
}
// Font Awesome 5 replaces our lovely element with a gross SVG. In
// order to make it play nice with Svelte, we have to clear the
// element and make it again.
var icon = current.hide ? _this.get().classes.pinUp : _this.get().classes.pinDown;
if (_this.get()._notice.get().icons === 'fontawesome5' || typeof icon === 'string' && icon.match(/(^| )fa[srlb]($| )/)) {
_this.set({ 'sticker': false });
_this.set({ 'sticker': true });
}
});
},
handleStickerClick: function handleStickerClick() {
var _get3 = this.get(),
_notice = _get3._notice;
_notice.update({ hide: !_notice.get().hide });
},
handleCloserClick: function handleCloserClick() {
this.get()._notice.close(false);
this.set({ '_mouseIsIn': false });
}
};
function oncreate() {
this.fire('init', { module: this });
};
function setup(Component) {
Component.key = 'Buttons';
Component.defaults = {
// Provide a button for the user to manually close the notice.
closer: true,
// Only show the closer button on hover.
closerHover: true,
// Provide a button for the user to manually stick the notice.
sticker: true,
// Only show the sticker button on hover.
stickerHover: true,
// The various displayed text, helps facilitating internationalization.
labels: {
close: 'Close',
stick: 'Stick',
unstick: 'Unstick'
},
// The classes to use for button icons. Leave them null to use the classes from the styling you're using.
classes: {
closer: null,
pinUp: null,
pinDown: null
}
};
// Register the module with PNotify.
PNotify.modules.Buttons = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
// Add button icons to icons objects.
_extends(PNotify.icons.brighttheme, {
closer: 'brighttheme-icon-closer',
pinUp: 'brighttheme-icon-sticker',
pinDown: 'brighttheme-icon-sticker brighttheme-icon-stuck'
});
_extends(PNotify.icons.bootstrap3, {
closer: 'glyphicon glyphicon-remove',
pinUp: 'glyphicon glyphicon-pause',
pinDown: 'glyphicon glyphicon-play'
});
_extends(PNotify.icons.fontawesome4, {
closer: 'fa fa-times',
pinUp: 'fa fa-pause',
pinDown: 'fa fa-play'
});
_extends(PNotify.icons.fontawesome5, {
closer: 'fas fa-times',
pinUp: 'fas fa-pause',
pinDown: 'fas fa-play'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1yjle82-style';
style.textContent = ".ui-pnotify-closer.svelte-1yjle82,.ui-pnotify-sticker.svelte-1yjle82{float:right;margin-left:.5em;cursor:pointer}[dir=rtl] .ui-pnotify-closer,[dir=rtl] .ui-pnotify-sticker{float:left;margin-right:.5em;margin-left:0}.ui-pnotify-buttons-hidden.svelte-1yjle82{visibility:hidden}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var text, if_block_1_anchor;
var if_block = ctx._showCloser && create_if_block(component, ctx);
var if_block_1 = ctx._showSticker && create_if_block_1(component, ctx);
return {
c: function c() {
if (if_block) if_block.c();
text = createText("\n");
if (if_block_1) if_block_1.c();
if_block_1_anchor = createComment();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(text, target, anchor);
if (if_block_1) if_block_1.m(target, anchor);
insertNode(if_block_1_anchor, target, anchor);
},
p: function p(changed, ctx) {
if (ctx._showCloser) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(text.parentNode, text);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (ctx._showSticker) {
if (if_block_1) {
if_block_1.p(changed, ctx);
} else {
if_block_1 = create_if_block_1(component, ctx);
if_block_1.c();
if_block_1.m(if_block_1_anchor.parentNode, if_block_1_anchor);
}
} else if (if_block_1) {
if_block_1.d(1);
if_block_1 = null;
}
},
d: function d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(text);
}
if (if_block_1) if_block_1.d(detach);
if (detach) {
detachNode(if_block_1_anchor);
}
}
};
}
// (1:0) {#if _showCloser}
function create_if_block(component, ctx) {
var div, span, div_class_value, div_title_value;
function click_handler(event) {
component.handleCloserClick();
}
return {
c: function c() {
div = createElement("div");
span = createElement("span");
span.className = "" + ctx._closerClass + " svelte-1yjle82";
addListener(div, "click", click_handler);
div.className = div_class_value = "ui-pnotify-closer " + (!ctx.closerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82";
setAttribute(div, "role", "button");
div.tabIndex = "0";
div.title = div_title_value = ctx.labels.close;
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
appendNode(span, div);
},
p: function p(changed, ctx) {
if (changed._closerClass) {
span.className = "" + ctx._closerClass + " svelte-1yjle82";
}
if ((changed.closerHover || changed._mouseIsIn) && div_class_value !== (div_class_value = "ui-pnotify-closer " + (!ctx.closerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82")) {
div.className = div_class_value;
}
if (changed.labels && div_title_value !== (div_title_value = ctx.labels.close)) {
div.title = div_title_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
removeListener(div, "click", click_handler);
}
};
}
// (11:0) {#if _showSticker}
function create_if_block_1(component, ctx) {
var div, span, span_class_value, div_class_value, div_aria_pressed_value, div_title_value;
function click_handler(event) {
component.handleStickerClick();
}
return {
c: function c() {
div = createElement("div");
span = createElement("span");
span.className = span_class_value = "" + (ctx._options.hide ? ctx._pinUpClass : ctx._pinDownClass) + " svelte-1yjle82";
addListener(div, "click", click_handler);
div.className = div_class_value = "ui-pnotify-sticker " + (!ctx.stickerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82";
setAttribute(div, "role", "button");
setAttribute(div, "aria-pressed", div_aria_pressed_value = ctx._options.hide);
div.tabIndex = "0";
div.title = div_title_value = ctx._options.hide ? ctx.labels.stick : ctx.labels.unstick;
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
appendNode(span, div);
},
p: function p(changed, ctx) {
if ((changed._options || changed._pinUpClass || changed._pinDownClass) && span_class_value !== (span_class_value = "" + (ctx._options.hide ? ctx._pinUpClass : ctx._pinDownClass) + " svelte-1yjle82")) {
span.className = span_class_value;
}
if ((changed.stickerHover || changed._mouseIsIn) && div_class_value !== (div_class_value = "ui-pnotify-sticker " + (!ctx.stickerHover || ctx._mouseIsIn ? '' : 'ui-pnotify-buttons-hidden') + " svelte-1yjle82")) {
div.className = div_class_value;
}
if (changed._options && div_aria_pressed_value !== (div_aria_pressed_value = ctx._options.hide)) {
setAttribute(div, "aria-pressed", div_aria_pressed_value);
}
if ((changed._options || changed.labels) && div_title_value !== (div_title_value = ctx._options.hide ? ctx.labels.stick : ctx.labels.unstick)) {
div.title = div_title_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
removeListener(div, "click", click_handler);
}
};
}
function PNotifyButtons(options) {
var _this2 = this;
init(this, options);
this._state = assign(data(), options.data);
this._recompute({ sticker: 1, _notice: 1, closer: 1, classes: 1 }, this._state);
this._intro = true;
if (!document.getElementById("svelte-1yjle82-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this2);
_this2.fire("update", { changed: assignTrue({}, _this2._state), current: _this2._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyButtons.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyButtons.prototype, methods);
PNotifyButtons.prototype._recompute = function _recompute(changed, state) {
if (changed.sticker || changed._notice) {
if (this._differs(state._showSticker, state._showSticker = _showSticker(state))) changed._showSticker = true;
}
if (changed.closer || changed._notice) {
if (this._differs(state._showCloser, state._showCloser = _showCloser(state))) changed._showCloser = true;
}
if (changed.classes || changed._notice) {
if (this._differs(state._pinUpClass, state._pinUpClass = _pinUpClass(state))) changed._pinUpClass = true;
if (this._differs(state._pinDownClass, state._pinDownClass = _pinDownClass(state))) changed._pinDownClass = true;
if (this._differs(state._closerClass, state._closerClass = _closerClass(state))) changed._closerClass = true;
}
};
setup(PNotifyButtons);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createText(data) {
return document.createTextNode(data);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function noop() {}
return PNotifyButtons;
});
//# sourceMappingURL=PNotifyButtons.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,234 +0,0 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyCallbacks.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyCallbacks', ["./PNotify"], factory) : global.PNotifyCallbacks = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
var _open = PNotify.prototype.open;
var _close = PNotify.prototype.close;
var callbacks = function callbacks(notice, options, name) {
var modules = notice ? notice.get().modules : options.modules;
var cbs = modules && modules.Callbacks ? modules.Callbacks : {};
return cbs[name] ? cbs[name] : function () {
return true;
};
};
PNotify.prototype.open = function () {
var ret = callbacks(this, null, 'beforeOpen')(this);
if (ret !== false) {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_open.apply(this, args);
callbacks(this, null, 'afterOpen')(this);
}
};
PNotify.prototype.close = function (timerHide) {
var ret = callbacks(this, null, 'beforeClose')(this, timerHide);
if (ret !== false) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
_close.apply(this, [timerHide].concat(args));
callbacks(this, null, 'afterClose')(this, timerHide);
}
};
function setup(Component) {
Component.key = 'Callbacks';
Component.getCallbacks = callbacks;
var _alert = PNotify.alert;
var _notice = PNotify.notice;
var _info = PNotify.info;
var _success = PNotify.success;
var _error = PNotify.error;
var init = function init(original, options) {
callbacks(null, options, 'beforeInit')(options);
var notice = original(options);
callbacks(notice, null, 'afterInit')(notice);
return notice;
};
PNotify.alert = function (options) {
return init(_alert, options);
};
PNotify.notice = function (options) {
return init(_notice, options);
};
PNotify.info = function (options) {
return init(_info, options);
};
PNotify.success = function (options) {
return init(_success, options);
};
PNotify.error = function (options) {
return init(_error, options);
};
// Register the module with PNotify.
PNotify.modules.Callbacks = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyCallbacks(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyCallbacks.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
PNotifyCallbacks.prototype._recompute = noop;
setup(PNotifyCallbacks);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyCallbacks;
});
//# sourceMappingURL=PNotifyCallbacks.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["src/PNotifyCallbacks.html"],"names":[],"mappings":";;;;;;;;;;AAGE,KAAI,QAAQ,QAAQ,SAAR,CAAkB,IAA9B;AACA,KAAI,SAAS,QAAQ,SAAR,CAAkB,KAA/B;;AAEA,KAAM,YAAY,SAAZ,SAAY,CAAC,MAAD,EAAS,OAAT,EAAkB,IAAlB,EAA2B;AAC3C,MAAI,UAAU,SAAS,OAAO,GAAP,GAAa,OAAtB,GAAgC,QAAQ,OAAtD;AACA,MAAI,MAAO,WAAW,QAAQ,SAApB,GAAiC,QAAQ,SAAzC,GAAqD,EAA/D;AACA,SAAO,IAAI,IAAJ,IAAY,IAAI,IAAJ,CAAZ,GAAwB;AAAA,UAAM,IAAN;AAAA,GAA/B;AACD,EAJD;;AAMA,SAAQ,SAAR,CAAkB,IAAlB,GAAyB,YAAmB;AAC1C,MAAI,MAAM,UAAU,IAAV,EAAgB,IAAhB,EAAsB,YAAtB,EAAoC,IAApC,CAAV;AACA,MAAI,QAAQ,KAAZ,EAAmB;AAAA,qCAFiB,IAEjB;AAFiB,QAEjB;AAAA;;AACjB,SAAM,KAAN,CAAY,IAAZ,EAAkB,IAAlB;AACA,aAAU,IAAV,EAAgB,IAAhB,EAAsB,WAAtB,EAAmC,IAAnC;AACD;AACF,EAND;;AAQA,SAAQ,SAAR,CAAkB,KAAlB,GAA0B,UAAU,SAAV,EAA8B;AACtD,MAAI,MAAM,UAAU,IAAV,EAAgB,IAAhB,EAAsB,aAAtB,EAAqC,IAArC,EAA2C,SAA3C,CAAV;AACA,MAAI,QAAQ,KAAZ,EAAmB;AAAA,sCAF6B,IAE7B;AAF6B,QAE7B;AAAA;;AACjB,UAAO,KAAP,CAAa,IAAb,GAAoB,SAApB,SAAkC,IAAlC;AACA,aAAU,IAAV,EAAgB,IAAhB,EAAsB,YAAtB,EAAoC,IAApC,EAA0C,SAA1C;AACD;AACF,EAND;;AAQF,UAAA,KAAA,CACW,SADX,EACsB;AAChB,YAAU,GAAV,GAAgB,WAAhB;;AAEA,YAAU,YAAV,GAAyB,SAAzB;;AAEA,MAAI,SAAS,QAAQ,KAArB;AACA,MAAI,UAAU,QAAQ,MAAtB;AACA,MAAI,QAAQ,QAAQ,IAApB;AACA,MAAI,WAAW,QAAQ,OAAvB;AACA,MAAI,SAAS,QAAQ,KAArB;;AAEA,MAAI,OAAO,SAAP,IAAO,CAAC,QAAD,EAAW,OAAX,EAAuB;AAChC,aAAU,IAAV,EAAgB,OAAhB,EAAyB,YAAzB,EAAuC,OAAvC;AACA,OAAI,SAAS,SAAS,OAAT,CAAb;AACA,aAAU,MAAV,EAAkB,IAAlB,EAAwB,WAAxB,EAAqC,MAArC;AACA,UAAO,MAAP;AACD,GALD;;AAOA,UAAQ,KAAR,GAAgB,UAAC,OAAD,EAAa;AAC3B,UAAO,KAAK,MAAL,EAAa,OAAb,CAAP;AACD,GAFD;AAGA,UAAQ,MAAR,GAAiB,UAAC,OAAD,EAAa;AAC5B,UAAO,KAAK,OAAL,EAAc,OAAd,CAAP;AACD,GAFD;AAGA,UAAQ,IAAR,GAAe,UAAC,OAAD,EAAa;AAC1B,UAAO,KAAK,KAAL,EAAY,OAAZ,CAAP;AACD,GAFD;AAGA,UAAQ,OAAR,GAAkB,UAAC,OAAD,EAAa;AAC7B,UAAO,KAAK,QAAL,EAAe,OAAf,CAAP;AACD,GAFD;AAGA,UAAQ,KAAR,GAAgB,UAAC,OAAD,EAAa;AAC3B,UAAO,KAAK,MAAL,EAAa,OAAb,CAAP;AACD,GAFD;;AAIF;AACE,UAAQ,OAAR,CAAgB,SAAhB,GAA4B,SAA5B;AACD","sourcesContent":["<script>\n import PNotify from './PNotify.html';\n\n let _open = PNotify.prototype.open;\n let _close = PNotify.prototype.close;\n\n const callbacks = (notice, options, name) => {\n let modules = notice ? notice.get().modules : options.modules;\n let cbs = (modules && modules.Callbacks) ? modules.Callbacks : {};\n return cbs[name] ? cbs[name] : () => true;\n };\n\n PNotify.prototype.open = function (...args) {\n let ret = callbacks(this, null, 'beforeOpen')(this);\n if (ret !== false) {\n _open.apply(this, args);\n callbacks(this, null, 'afterOpen')(this);\n }\n };\n\n PNotify.prototype.close = function (timerHide, ...args) {\n let ret = callbacks(this, null, 'beforeClose')(this, timerHide);\n if (ret !== false) {\n _close.apply(this, [timerHide, ...args]);\n callbacks(this, null, 'afterClose')(this, timerHide);\n }\n };\n\n export default {\n setup (Component) {\n Component.key = 'Callbacks';\n\n Component.getCallbacks = callbacks;\n\n let _alert = PNotify.alert;\n let _notice = PNotify.notice;\n let _info = PNotify.info;\n let _success = PNotify.success;\n let _error = PNotify.error;\n\n let init = (original, options) => {\n callbacks(null, options, 'beforeInit')(options);\n let notice = original(options);\n callbacks(notice, null, 'afterInit')(notice);\n return notice;\n };\n\n PNotify.alert = (options) => {\n return init(_alert, options);\n };\n PNotify.notice = (options) => {\n return init(_notice, options);\n };\n PNotify.info = (options) => {\n return init(_info, options);\n };\n PNotify.success = (options) => {\n return init(_success, options);\n };\n PNotify.error = (options) => {\n return init(_error, options);\n };\n\n // Register the module with PNotify.\n PNotify.modules.Callbacks = Component;\n }\n };\n</script>\n"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,753 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyConfirm.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyConfirm', ["./PNotify"], factory) : global.PNotifyConfirm = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Confirm.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
},
afterOpen: function afterOpen() {
if (this.get().prompt) {
if (this.get().promptMultiLine) {
this.refs.promptMulti.focus();
} else {
this.refs.promptSingle.focus();
}
}
},
handleClick: function handleClick(button, event) {
if (button.click) {
button.click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
},
handleKeyPress: function handleKeyPress(event) {
if (event.keyCode === 13 && !event.shiftKey) {
event.preventDefault();
var _get = this.get(),
buttons = _get.buttons;
for (var i = 0; i < buttons.length; i++) {
if (buttons[i].promptTrigger && buttons[i].click) {
buttons[i].click(this.get()._notice, this.get().prompt ? this.get().promptValue : null, event);
}
}
}
}
};
function oncreate() {
this.fire('init', { module: this });
};
function setup(Component) {
Component.key = 'Confirm';
Component.defaults = {
// Make a confirmation box.
confirm: false,
// Make a prompt.
prompt: false,
// Classes to add to the input element of the prompt.
promptClass: '',
// The value of the prompt.
promptValue: '',
// Whether the prompt should accept multiple lines of text.
promptMultiLine: false,
// Where to align the buttons. (flex-start, center, flex-end, space-around, space-between)
align: 'flex-end',
// The buttons to display, and their callbacks.
buttons: [{
text: 'Ok',
textTrusted: false,
addClass: '',
primary: true,
// Whether to trigger this button when the user hits enter in a single line prompt.
promptTrigger: true,
click: function click(notice, value) {
notice.close();
notice.fire('pnotify.confirm', { notice: notice, value: value });
}
}, {
text: 'Cancel',
textTrusted: false,
addClass: '',
click: function click(notice) {
notice.close();
notice.fire('pnotify.cancel', { notice: notice });
}
}]
};
// Register the module with PNotify.
PNotify.modules.Confirm = Component;
// Append this module to the container.
PNotify.modulesAppendContainer.push(Component);
// Add button styles to styling objects.
_extends(PNotify.styling.brighttheme, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'brighttheme-primary',
input: ''
});
_extends(PNotify.styling.bootstrap3, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-default ui-pnotify-confirm-mx-1',
btnPrimary: 'btn btn-default ui-pnotify-confirm-mx-1 btn-primary',
input: 'form-control'
});
_extends(PNotify.styling.bootstrap4, {
actionBar: 'ui-pnotify-confirm-ml',
promptBar: 'ui-pnotify-confirm-ml',
btn: 'btn btn-secondary mx-1',
btnPrimary: 'btn btn-primary mx-1',
input: 'form-control'
});
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
_extends(PNotify.styling.material, {
actionBar: '',
promptBar: '',
btn: '',
btnPrimary: 'ui-pnotify-material-primary',
input: ''
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1y9suua-style';
style.textContent = ".ui-pnotify-action-bar.svelte-1y9suua,.ui-pnotify-prompt-bar.svelte-1y9suua{margin-top:5px;clear:both}.ui-pnotify-action-bar.svelte-1y9suua{display:flex;flex-wrap:wrap;justify-content:flex-end}.ui-pnotify-prompt-input.svelte-1y9suua{margin-bottom:5px;display:block;width:100%}.ui-pnotify-confirm-mx-1.svelte-1y9suua{margin:0 5px}.ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml{margin-left:24px}[dir=rtl] .ui-pnotify.ui-pnotify-with-icon .ui-pnotify-confirm-ml{margin-right:24px;margin-left:0}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var if_block_anchor;
var if_block = (ctx.confirm || ctx.prompt) && create_if_block(component, ctx);
return {
c: function c() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p: function p(changed, ctx) {
if (ctx.confirm || ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d: function d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
}
}
};
}
// (10:8) {#if promptMultiLine}
function create_if_block_2(component, ctx) {
var textarea,
textarea_updating = false,
textarea_class_value;
function textarea_input_handler() {
textarea_updating = true;
component.set({ promptValue: textarea.value });
textarea_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c: function c() {
textarea = createElement("textarea");
addListener(textarea, "input", textarea_input_handler);
addListener(textarea, "keypress", keypress_handler);
textarea.rows = "5";
textarea.className = textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(textarea, target, anchor);
component.refs.promptMulti = textarea;
textarea.value = ctx.promptValue;
},
p: function p(changed, ctx) {
if (!textarea_updating) textarea.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && textarea_class_value !== (textarea_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
textarea.className = textarea_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(textarea);
}
removeListener(textarea, "input", textarea_input_handler);
removeListener(textarea, "keypress", keypress_handler);
if (component.refs.promptMulti === textarea) component.refs.promptMulti = null;
}
};
}
// (21:8) {:else}
function create_if_block_3(component, ctx) {
var input,
input_updating = false,
input_class_value;
function input_input_handler() {
input_updating = true;
component.set({ promptValue: input.value });
input_updating = false;
}
function keypress_handler(event) {
component.handleKeyPress(event);
}
return {
c: function c() {
input = createElement("input");
addListener(input, "input", input_input_handler);
addListener(input, "keypress", keypress_handler);
setAttribute(input, "type", "text");
input.className = input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(input, target, anchor);
component.refs.promptSingle = input;
input.value = ctx.promptValue;
},
p: function p(changed, ctx) {
if (!input_updating) input.value = ctx.promptValue;
if ((changed._notice || changed.promptClass) && input_class_value !== (input_class_value = "\n ui-pnotify-prompt-input\n " + (ctx._notice.get()._styles.input ? ctx._notice.get()._styles.input : '') + "\n " + ctx.promptClass + "\n " + " svelte-1y9suua")) {
input.className = input_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(input);
}
removeListener(input, "input", input_input_handler);
removeListener(input, "keypress", keypress_handler);
if (component.refs.promptSingle === input) component.refs.promptSingle = null;
}
};
}
// (3:4) {#if prompt}
function create_if_block_1(component, ctx) {
var div, div_class_value;
function select_block_type(ctx) {
if (ctx.promptMultiLine) return create_if_block_2;
return create_if_block_3;
}
var current_block_type = select_block_type(ctx);
var if_block = current_block_type(component, ctx);
return {
c: function c() {
div = createElement("div");
if_block.c();
div.className = div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
if_block.m(div, null);
},
p: function p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(div, null);
}
if (changed._notice && div_class_value !== (div_class_value = "\n ui-pnotify-prompt-bar\n " + (ctx._notice.get()._styles.promptBar ? ctx._notice.get()._styles.promptBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div.className = div_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
if_block.d();
}
};
}
// (42:6) {#each buttons as button}
function create_each_block(component, ctx) {
var button, button_class_value;
function select_block_type_1(ctx) {
if (ctx.button.textTrusted) return create_if_block_4;
return create_if_block_5;
}
var current_block_type = select_block_type_1(ctx);
var if_block = current_block_type(component, ctx);
return {
c: function c() {
button = createElement("button");
if_block.c();
button._svelte = { component: component, ctx: ctx };
addListener(button, "click", click_handler);
button.type = "button";
button.className = button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '' : ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '') + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua";
},
m: function m(target, anchor) {
insertNode(button, target, anchor);
if_block.m(button, null);
},
p: function p(changed, ctx) {
if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block) {
if_block.p(changed, ctx);
} else {
if_block.d(1);
if_block = current_block_type(component, ctx);
if_block.c();
if_block.m(button, null);
}
button._svelte.ctx = ctx;
if ((changed.buttons || changed._notice) && button_class_value !== (button_class_value = "\n ui-pnotify-action-button\n " + (ctx.button.primary ? ctx._notice.get()._styles.btnPrimary ? ctx._notice.get()._styles.btnPrimary : '' : ctx._notice.get()._styles.btn ? ctx._notice.get()._styles.btn : '') + "\n " + (ctx.button.addClass ? ctx.button.addClass : '') + "\n " + " svelte-1y9suua")) {
button.className = button_class_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(button);
}
if_block.d();
removeListener(button, "click", click_handler);
}
};
}
// (50:14) {#if button.textTrusted}
function create_if_block_4(component, ctx) {
var raw_value = ctx.button.text,
raw_before,
raw_after;
return {
c: function c() {
raw_before = createElement('noscript');
raw_after = createElement('noscript');
},
m: function m(target, anchor) {
insertNode(raw_before, target, anchor);
raw_before.insertAdjacentHTML("afterend", raw_value);
insertNode(raw_after, target, anchor);
},
p: function p(changed, ctx) {
if (changed.buttons && raw_value !== (raw_value = ctx.button.text)) {
detachBetween(raw_before, raw_after);
raw_before.insertAdjacentHTML("afterend", raw_value);
}
},
d: function d(detach) {
if (detach) {
detachBetween(raw_before, raw_after);
detachNode(raw_before);
detachNode(raw_after);
}
}
};
}
// (50:57) {:else}
function create_if_block_5(component, ctx) {
var text_value = ctx.button.text,
text;
return {
c: function c() {
text = createText(text_value);
},
m: function m(target, anchor) {
insertNode(text, target, anchor);
},
p: function p(changed, ctx) {
if (changed.buttons && text_value !== (text_value = ctx.button.text)) {
text.data = text_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(text);
}
}
};
}
// (1:0) {#if confirm || prompt}
function create_if_block(component, ctx) {
var div, text, div_1, div_1_class_value;
var if_block = ctx.prompt && create_if_block_1(component, ctx);
var each_value = ctx.buttons;
var each_blocks = [];
for (var i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(component, get_each_context(ctx, each_value, i));
}
return {
c: function c() {
div = createElement("div");
if (if_block) if_block.c();
text = createText("\n ");
div_1 = createElement("div");
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
div_1.className = div_1_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua";
setStyle(div_1, "justify-content", ctx.align);
div.className = "ui-pnotify-confirm";
},
m: function m(target, anchor) {
insertNode(div, target, anchor);
if (if_block) if_block.m(div, null);
appendNode(text, div);
appendNode(div_1, div);
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(div_1, null);
}
},
p: function p(changed, ctx) {
if (ctx.prompt) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block_1(component, ctx);
if_block.c();
if_block.m(div, text);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
if (changed.buttons || changed._notice) {
each_value = ctx.buttons;
for (var i = 0; i < each_value.length; i += 1) {
var 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(component, child_ctx);
each_blocks[i].c();
each_blocks[i].m(div_1, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if (changed._notice && div_1_class_value !== (div_1_class_value = "\n ui-pnotify-action-bar\n " + (ctx._notice.get()._styles.actionBar ? ctx._notice.get()._styles.actionBar : '') + "\n " + (ctx._notice.get()._styles.text ? ctx._notice.get()._styles.text : '') + "\n " + " svelte-1y9suua")) {
div_1.className = div_1_class_value;
}
if (changed.align) {
setStyle(div_1, "justify-content", ctx.align);
}
},
d: function d(detach) {
if (detach) {
detachNode(div);
}
if (if_block) if_block.d();
destroyEach(each_blocks, detach);
}
};
}
function get_each_context(ctx, list, i) {
var child_ctx = Object.create(ctx);
child_ctx.button = list[i];
child_ctx.each_value = list;
child_ctx.button_index = i;
return child_ctx;
}
function click_handler(event) {
var _svelte = this._svelte,
component = _svelte.component,
ctx = _svelte.ctx;
component.handleClick(ctx.button, event);
}
function PNotifyConfirm(options) {
var _this = this;
init(this, options);
this.refs = {};
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1y9suua-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this);
_this.fire("update", { changed: assignTrue({}, _this._state), current: _this._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyConfirm.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyConfirm.prototype, methods);
PNotifyConfirm.prototype._recompute = noop;
setup(PNotifyConfirm);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function setAttribute(node, attribute, value) {
node.setAttribute(attribute, value);
}
function detachBetween(before, after) {
while (before.nextSibling && before.nextSibling !== after) {
before.parentNode.removeChild(before.nextSibling);
}
}
function createText(data) {
return document.createTextNode(data);
}
function setStyle(node, key, value) {
node.style.setProperty(key, value);
}
function destroyEach(iterations, detach) {
for (var i = 0; i < iterations.length; i += 1) {
if (iterations[i]) iterations[i].d(detach);
}
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function noop() {}
function blankObject() {
return Object.create(null);
}
return PNotifyConfirm;
});
//# sourceMappingURL=PNotifyConfirm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,441 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyDesktop.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyDesktop', ["./PNotify"], factory) : global.PNotifyDesktop = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
var permission = void 0;
var Notification = window.Notification;
var _notify = function notify(title, options, onclick, onclose) {
// Memoize based on feature detection.
if ('Notification' in window) {
_notify = function notify(title, options, onclick, onclose) {
var notice = new Notification(title, options);
if ('NotificationEvent' in window) {
notice.addEventListener('notificationclick', onclick);
notice.addEventListener('close', onclose);
} else if ('addEventListener' in notice) {
notice.addEventListener('click', onclick);
notice.addEventListener('close', onclose);
} else {
notice.onclick = onclick;
notice.onclose = onclose;
}
return notice;
};
} else if ('mozNotification' in navigator) {
_notify = function notify(title, options, onclick, onclose) {
// Gecko < 22
var notice = navigator.mozNotification.createNotification(title, options.body, options.icon).show();
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else if ('webkitNotifications' in window) {
_notify = function notify(title, options, onclick, onclose) {
var notice = window.webkitNotifications.createNotification(options.icon, title, options.body);
notice.onclick = onclick;
notice.onclose = onclose;
return notice;
};
} else {
_notify = function notify(title, options, onclick, onclose) {
return null;
};
}
return _notify(title, options, onclick, onclose);
};
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Desktop.defaults);
};
var methods = {
initModule: function initModule(options) {
var _this = this;
this.set(options);
var _get = this.get(),
_notice = _get._notice;
// Animation should always be 'none' for desktop notices, but remember
// the old animation so it can be recovered.
this.set({ '_oldAnimation': _notice.get().animation });
_notice.on('state', function (_ref) {
var changed = _ref.changed,
current = _ref.current,
previous = _ref.previous;
if (changed.animation) {
if (previous.animation === undefined || current.animation !== 'none' || previous.animation === 'none' && current.animation !== _this.get()._oldAnimation) {
_this.set({ '_oldAnimation': current.animation });
}
}
// This is necessary so desktop notices don't cause spacing problems
// when positioning.
if (changed._animatingClass) {
if (!(current._animatingClass === '' || permission !== 0 && _this.get().fallback || !_this.get().desktop)) {
_notice.set({ '_animatingClass': '' });
}
}
});
if (!this.get().desktop) {
return;
}
permission = PNotify.modules.Desktop.checkPermission();
if (permission !== 0) {
// Keep the notice from opening if fallback is false.
if (!this.get().fallback) {
_notice.set({ 'autoDisplay': false });
}
return;
}
_notice.set({ 'animation': 'none' });
_notice.addModuleClass('ui-pnotify-desktop-hide');
this.genNotice();
},
update: function update() {
var _get2 = this.get(),
_notice = _get2._notice;
if (permission !== 0 && this.get().fallback || !this.get().desktop) {
_notice.set({ 'animation': this.get()._oldAnimation });
_notice.removeModuleClass('ui-pnotify-desktop-hide');
return;
} else {
_notice.set({ 'animation': 'none' });
_notice.addModuleClass('ui-pnotify-desktop-hide');
}
this.genNotice();
},
beforeOpen: function beforeOpen() {
if (this.get().desktop && permission !== 0) {
PNotify.modules.Desktop.permission();
}
if (permission !== 0 && this.get().fallback || !this.get().desktop) {
return;
}
var _get3 = this.get(),
_desktop = _get3._desktop;
if (_desktop && 'show' in _desktop) {
this.get()._notice.set({ '_moduleIsNoticeOpen': true });
_desktop.show();
}
},
beforeClose: function beforeClose() {
if (permission !== 0 && this.get().fallback || !this.get().desktop) {
return;
}
var _get4 = this.get(),
_desktop = _get4._desktop;
if (_desktop && 'close' in _desktop) {
_desktop.close();
this.get()._notice.set({ '_moduleIsNoticeOpen': false });
}
},
genNotice: function genNotice() {
var _get5 = this.get(),
_notice = _get5._notice,
icon = _get5.icon;
if (icon === null) {
switch (_notice.get().type) {
case 'error':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQg7e6HvQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAABr0lEQVRYw8WXu0oDQRSGv7hRSFYrLTTWKihaqUgUJO+gphBLL1jYpPSCVcAggpWthYhC7Ows9An0IbSPkMRCw8ZmFuI6yczs9cAPuzNz5v92brtrESxGARtokkCcAg2hk7jNl4G2R/m4zFPAiwTgWdRFHnmJuaulOAAaPQDqUZvv9DB3tR0lwIcGwHtU5uca5q4qYZvngJbHpAZ8CtU8dS1gLEyAisegBGTFKWiL65KnzVlY5uOSId6VtNuTtMupOu/TAHiQlNmSskHNXCOAGWBeUp7VhFoApoMAXAOWJoCszBJ9+ALY6vL0JiPgjsKmKUAaOOoBZwIAcNxlJLsCrAOTIQJMAWu62y4LOIqT7lGS96TIcYCMDkBZ46h1gB+PHI28ssq8X/G6DaqG8Piz2DrjVjGXbtSBy46F5QAHwJAizwZugKKscs7gSaqS/KpB/qxsFxwafhf6Odb/eblJi8BGwJdW26BtURxQpMU83hmaDQsNiPtvYMSwj3tgAqDgYzU7wJdHjo9+CgBvEW47lV5Tgj5DMtG0xIfESkIAF+522gdWxTzGEX3i9+6KpOMXF5UBt0NKJCAAAAAASUVORK5CYII=' });
break;
case 'success':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQPRj+65AAAAdBJREFUWMPtlzsvRFEQx3+7HmEjoiYKolVJJDRqnS8ggvVIVEQhCIUsEYJGCEH2E4h4FPREaLTbEo1IEJXHrmY2GTf33nPuY7ud5OTenTMz//89Z86ZWShLWf5LB3AOfACFiOMF2AkC3qOc88BXxFEAxlX8ftGdaNCEen8H6oFHYBR4FocwkpTngzzHgF01fwL0aYcp9fVtMW/rsMcWXWijK1Hexgye9smRT6CxaHgjytMYwccNSXqoja9FeVbiZS+OVaeDiUBLAPAJA/i2m5MXgRSQk7llC/DBMOBeBGqAe0eAjQhfvurH3EmgQk6EW6CVEHt+ZFo6J4EU8OoTcF35jhnAl2wSx20LFgyB1yyOWtY2c72ScMAAkPeZy6g4zUBdGAIAcyEq4Z7y7xbdTFgCACMBwPVJqVDHeNqvaplkH5i0sNuUwmaNkQxww20ZSOy7gFvX7SAk0i76jPQQlJoAwAEwq35ngfmwVatSdUMArZZ+K9JQ1Bp6iGqgSt7f/AIOqSzujLEn6AV+JG6zm4HuCZ+AJuAbWAQu5aIJu7JDck0ngDugC/j1c2qPqR13jpxuvWyS8liY/kQcean/lX6ACQ99DdAQYe+Lf0zylMUgf7qDKgzv284QAAAAAElFTkSuQmCC' });
break;
case 'info':
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATQ09zRTwAAAAdxJREFUWMPtl88rRFEUxz8zBolRCgsrpOym8TMSO2WplLKwUrKi/B0W7JSFmhVLNlhSlLKx8CtRGpEsJpofpZk3Nkc9b968e++8mdlw6vTeu/edc773nl/3wl+ngOH/zUAf0AN0AmEgB7wCD8AtcFMJoM3ADpAHLHk62RIwL8B0uQwHgXVRnDfkS2DSj/EW4K0Ew05eLMV4O/CuUJwEUvJUgdgwMd4IpBUKl13kVG6aL+ZjJ20DDQqQXy5jKYVMDBhVrb5f069LLrKfGnInqh040HRTvsTAHgei9oGQ7X0YaNNUNCdFKChgQvKtQ1vAkNvEahlSToez9oXad2BCA30ceHZxRxMQMShuvZLmv+hOA32/h+KUwS7MugVhqwb6Go+5nEEwht0ABDUEzyXdFsrQYwqMJjTbdxio9Qkg6QbgvkpnkLw0uQIAZ1UCYNkXawdw4qPCmVBcuADAMZCpAoCVYr3AKtYyHZSWauakjMx50TWwrzJw6lFARjQOt3se8jM6W9TloSCqIb9bRHbN5Fg+KkEZcow/Ak+KFBsD6h3jR8CUabAMlqn7xfxEbAdwWKLhhO3sGPCbOsNSvSyF0Z/5TaCuEleziLhmAOiWG1NWrmZXwIVU1A/+SZO+AcgLC4wt0zD3AAAAAElFTkSuQmCC' });
break;
case 'notice':
default:
this.set({ '_icon': 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gQJATM4scOJLAAAAcxJREFUWMPtljtLA0EQx3+J0QRfnYqCiCA+MERBrIwgFtoFbMTOR61i5QcQBdEihZWNoEWwsNAvkMJeBLHRQtHC0iIP4utOmw2cx97d7l2SRgcGbufmv/Pf2dmdhb8uIR+YJqAPaBff30AeeAHuxLgqMgRkgS/AAEybGuLfEdBcycCTwKVYmY5mgO6gwdd8BLaqAST9Bs8EDG7VTd3gex4TbgEjwKjQOHDugZlRDb7sMZEJpCS4bYVMJOygsG1cB+wqHN0Gib1RYXFpLwL74nx7Sb3EFlXATQNjTgRagA3FbZIRiCliT5wITGgUaRACA0CPjMC4xtUcDUAgDAzLCCQ0MhALQCAE9MoIdGkQCJIBgE4ZgWiNMvDL10qgUMMMFGQEnjQmkLXbVg38s8y4qtFcTCAnHiJ5oKiJnSoHjVgIXAmHkGIl5yy+YcWruIy9dvqpupIDCfZWEXvh1gsWFVfxIbG9a3RbRwJnYiuqJYfAqxsBgBWFiQyJzfTAlIB1uzEicbwBFoBTl8lSwINoSuXKjrv4F4FBh61zlKUKvgn7/e5ZEngMEDgLdFSieHaAT42LpgTMVbqC24B54Bi4twV9E6cnDcw6PFj+RSo/l6rlSlldhx4AAAAASUVORK5CYII=' });
break;
}
} else if (icon === false) {
this.set({ '_icon': null });
} else {
this.set({ '_icon': icon });
}
var _get6 = this.get(),
tag = _get6.tag;
if (!this.get()._tag || tag !== null) {
this.set({
'_tag': tag === null ? 'PNotify-' + Math.round(Math.random() * 1000000) : tag
});
}
var options = {
body: this.get().text || _notice.get().text,
tag: this.get()._tag
};
if (!_notice.get().hide) {
options.requireInteraction = true;
}
if (this.get()._icon !== null) {
options.icon = this.get()._icon;
}
Object.apply(options, this.get().options);
var _desktop = _notify(this.get().title || _notice.get().title, options, function () {
_notice.fire('click', { target: _desktop });
}, function () {
_notice.close();
});
_notice.set({ '_moduleIsNoticeOpen': true });
this.set({ _desktop: _desktop });
if (!('close' in _desktop) && 'cancel' in _desktop) {
_desktop.close = function () {
_desktop.cancel();
};
}
}
};
function setup(Component) {
Component.key = 'Desktop';
Component.defaults = {
// Display the notification as a desktop notification.
desktop: false,
// If desktop notifications are not supported or allowed, fall back to a regular notice.
fallback: true,
// The URL of the icon to display. If false, no icon will show. If null, a default icon will show.
icon: null,
// Using a tag lets you update an existing notice, or keep from duplicating notices between tabs.
// If you leave tag null, one will be generated, facilitating the 'update' function.
// see: http://www.w3.org/TR/notifications/#tags-example
tag: null,
// Optionally display a different title for the desktop.
title: null,
// Optionally display different text for the desktop.
text: null,
// Any additional options to be passed to the Notification constructor.
options: {}
};
Component.init = function (notice) {
return new Component({ target: document.body });
};
Component.permission = function () {
if (typeof Notification !== 'undefined' && 'requestPermission' in Notification) {
Notification.requestPermission();
} else if ('webkitNotifications' in window) {
window.webkitNotifications.requestPermission();
}
};
Component.checkPermission = function () {
if (typeof Notification !== 'undefined' && 'permission' in Notification) {
return Notification.permission === 'granted' ? 0 : 1;
} else if ('webkitNotifications' in window) {
return window.webkitNotifications.checkPermission() == 0 ? 0 : 1; // eslint-disable-line eqeqeq
} else {
return 1;
}
};
permission = Component.checkPermission();
// Register the module with PNotify.
PNotify.modules.Desktop = Component;
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-xbgnx4-style';
style.textContent = "[ui-pnotify].ui-pnotify-desktop-hide.ui-pnotify{left:-10000px !important;display:none !important}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyDesktop(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-xbgnx4-style")) add_css();
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyDesktop.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyDesktop.prototype, methods);
PNotifyDesktop.prototype._recompute = noop;
setup(PNotifyDesktop);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyDesktop;
});
//# sourceMappingURL=PNotifyDesktop.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,285 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyHistory.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyHistory', ["./PNotify"], factory) : global.PNotifyHistory = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.History.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
if (this.get().history) {
// Don't destroy notices that are in history.
var _get = this.get(),
_notice = _get._notice;
if (_notice.get().destroy) {
_notice.set({ 'destroy': false });
}
}
},
beforeOpen: function beforeOpen() {
var _get2 = this.get(),
maxInStack = _get2.maxInStack,
_options = _get2._options;
if (maxInStack === Infinity) {
return;
}
var stack = _options.stack;
if (stack === false) {
return;
}
// Remove oldest notifications leaving only maxInStack from the stack.
if (PNotify.notices && PNotify.notices.length > maxInStack) {
// Oldest are normally in front of array, or if stack.push=='top' then
// they are at the end of the array!
var top = stack.push === 'top';
var forRemoval = [];
var currentOpen = 0;
for (var i = top ? 0 : PNotify.notices.length - 1; top ? i < PNotify.notices.length : i >= 0; top ? i++ : i--) {
if (['opening', 'open'].indexOf(PNotify.notices[i].get()._state) !== -1 && PNotify.notices[i].get().stack === stack) {
if (currentOpen >= maxInStack) {
forRemoval.push(PNotify.notices[i]);
} else {
currentOpen++;
}
}
}
for (var _i = 0; _i < forRemoval.length; _i++) {
forRemoval[_i].close(false);
}
}
}
};
function setup(Component) {
Component.key = 'History';
Component.defaults = {
// Place the notice in the history.
history: true,
// Maximum number of notices to have open in its stack.
maxInStack: Infinity
};
Component.init = function (notice) {
return new Component({ target: document.body });
};
Component.showLast = function (stack) {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
var top = stack.push === 'top';
// Look up the last history notice, and display it.
var i = top ? 0 : PNotify.notices.length - 1;
var notice = void 0;
do {
notice = PNotify.notices[i];
if (!notice) {
return;
}
i += top ? 1 : -1;
} while (notice.get().stack !== stack || !notice.get()._modules.History.get().history || notice.get()._state === 'opening' || notice.get()._state === 'open');
notice.open();
};
Component.showAll = function (stack) {
if (stack === undefined) {
stack = PNotify.defaultStack;
}
if (stack === false) {
return;
}
// Display all notices. (Disregarding non-history notices.)
for (var i = 0; i < PNotify.notices.length; i++) {
var notice = PNotify.notices[i];
if ((stack === true || notice.get().stack === stack) && notice.get()._modules.History.get().history) {
notice.open();
}
}
};
// Register the module with PNotify.
PNotify.modules.History = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyHistory(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyHistory.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyHistory.prototype, methods);
PNotifyHistory.prototype._recompute = noop;
setup(PNotifyHistory);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyHistory;
});
//# sourceMappingURL=PNotifyHistory.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,436 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyMobile.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyMobile', ["./PNotify"], factory) : global.PNotifyMobile = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.Mobile.defaults);
};
var methods = {
initModule: function initModule(options) {
var _this = this;
this.set(options);
var _get = this.get(),
_notice = _get._notice;
var origXY = null;
var diffXY = null;
var noticeWidthHeight = null;
var noticeOpacity = null;
var csspos = 'left';
var direction = 'X';
var span = 'Width';
_notice.on('touchstart', function (e) {
if (!_this.get().swipeDismiss) {
return;
}
var _notice$get = _notice.get(),
stack = _notice$get.stack;
if (stack !== false) {
switch (stack.dir1) {
case 'up':
case 'down':
csspos = 'left';
direction = 'X';
span = 'Width';
break;
case 'left':
case 'right':
csspos = 'top';
direction = 'Y';
span = 'Height';
break;
}
}
origXY = e.touches[0]['screen' + direction];
noticeWidthHeight = _notice.refs.elem['scroll' + span];
noticeOpacity = window.getComputedStyle(_notice.refs.elem)['opacity'];
_notice.refs.container.style[csspos] = 0;
});
_notice.on('touchmove', function (e) {
if (!origXY || !_this.get().swipeDismiss) {
return;
}
var curXY = e.touches[0]['screen' + direction];
diffXY = curXY - origXY;
var opacity = (1 - Math.abs(diffXY) / noticeWidthHeight) * noticeOpacity;
_notice.refs.elem.style.opacity = opacity;
_notice.refs.container.style[csspos] = diffXY + 'px';
});
_notice.on('touchend', function () {
if (!origXY || !_this.get().swipeDismiss) {
return;
}
_notice.refs.container.classList.add('ui-pnotify-mobile-animate-left');
if (Math.abs(diffXY) > 40) {
var goLeft = diffXY < 0 ? noticeWidthHeight * -2 : noticeWidthHeight * 2;
_notice.refs.elem.style.opacity = 0;
_notice.refs.container.style[csspos] = goLeft + 'px';
_notice.close();
} else {
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
}
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
_notice.on('touchcancel', function () {
if (!origXY || !_this.get().swipeDismiss) {
return;
}
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty(csspos);
origXY = null;
diffXY = null;
noticeWidthHeight = null;
noticeOpacity = null;
});
this.doMobileStyling();
},
update: function update() {
this.doMobileStyling();
},
beforeOpen: function beforeOpen() {
// Add an event listener to watch the window resizes.
window.addEventListener('resize', this.get()._doMobileStylingBound);
},
afterClose: function afterClose() {
// Remove the event listener.
window.removeEventListener('resize', this.get()._doMobileStylingBound);
// Remove any styling we added to close it.
if (!this.get().swipeDismiss) {
return;
}
var _get2 = this.get(),
_notice = _get2._notice;
_notice.refs.elem.style.removeProperty('opacity');
_notice.refs.container.style.removeProperty('left');
_notice.refs.container.style.removeProperty('top');
},
doMobileStyling: function doMobileStyling() {
var _get3 = this.get(),
_notice = _get3._notice;
var _notice$get2 = _notice.get(),
stack = _notice$get2.stack;
if (this.get().styling) {
if (stack !== false) {
if (window.innerWidth <= 480) {
if (!stack.mobileOrigSpacing1) {
stack.mobileOrigSpacing1 = stack.spacing1;
}
stack.spacing1 = 0;
if (!stack.mobileOrigFirstpos1) {
stack.mobileOrigFirstpos1 = stack.firstpos1;
}
stack.firstpos1 = 0;
if (!stack.mobileOrigSpacing2) {
stack.mobileOrigSpacing2 = stack.spacing2;
}
stack.spacing2 = 0;
if (!stack.mobileOrigFirstpos2) {
stack.mobileOrigFirstpos2 = stack.firstpos2;
}
stack.firstpos2 = 0;
} else {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
switch (stack.dir1) {
case 'down':
_notice.addModuleClass('ui-pnotify-mobile-top');
break;
case 'up':
_notice.addModuleClass('ui-pnotify-mobile-bottom');
break;
case 'left':
_notice.addModuleClass('ui-pnotify-mobile-right');
break;
case 'right':
_notice.addModuleClass('ui-pnotify-mobile-left');
break;
}
}
_notice.addModuleClass('ui-pnotify-mobile-able');
} else {
_notice.removeModuleClass('ui-pnotify-mobile-able', 'ui-pnotify-mobile-top', 'ui-pnotify-mobile-bottom', 'ui-pnotify-mobile-right', 'ui-pnotify-mobile-left');
if (stack !== false) {
if (stack.mobileOrigSpacing1) {
stack.spacing1 = stack.mobileOrigSpacing1;
delete stack.mobileOrigSpacing1;
}
if (stack.mobileOrigFirstpos1) {
stack.firstpos1 = stack.mobileOrigFirstpos1;
delete stack.mobileOrigFirstpos1;
}
if (stack.mobileOrigSpacing2) {
stack.spacing2 = stack.mobileOrigSpacing2;
delete stack.mobileOrigSpacing2;
}
if (stack.mobileOrigFirstpos2) {
stack.firstpos2 = stack.mobileOrigFirstpos2;
delete stack.mobileOrigFirstpos2;
}
}
}
}
};
function oncreate() {
this.set({ '_doMobileStylingBound': this.doMobileStyling.bind(this) });
};
function setup(Component) {
Component.key = 'Mobile';
Component.defaults = {
// Let the user swipe the notice away.
swipeDismiss: true,
// Styles the notice to look good on mobile.
styling: true
};
Component.init = function (notice) {
return new Component({ target: document.body });
};
// Register the module with PNotify.
PNotify.modules.Mobile = Component;
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-49u8sj-style';
style.textContent = "[ui-pnotify] .ui-pnotify-container{position:relative}[ui-pnotify] .ui-pnotify-mobile-animate-left{transition:left .1s ease}[ui-pnotify] .ui-pnotify-mobile-animate-top{transition:top .1s ease}@media(max-width: 480px){[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able{font-size:1.2em;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;-ms-font-smoothing:antialiased;font-smoothing:antialiased}body > [ui-pnotify].ui-pnotify.ui-pnotify-mobile-able{position:fixed}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom{width:100% !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right{height:100% !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-shadow{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-shadow{border-bottom-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-shadow{border-top-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-shadow{border-right-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-shadow{border-left-width:5px}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able .ui-pnotify-container{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-top .ui-pnotify-container,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-bottom .ui-pnotify-container{width:auto !important}[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-left .ui-pnotify-container,[ui-pnotify].ui-pnotify.ui-pnotify-mobile-able.ui-pnotify-mobile-right .ui-pnotify-container{height:100% !important}}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyMobile(options) {
var _this2 = this;
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-49u8sj-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this2);
_this2.fire("update", { changed: assignTrue({}, _this2._state), current: _this2._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyMobile.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyMobile.prototype, methods);
PNotifyMobile.prototype._recompute = noop;
setup(PNotifyMobile);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
return PNotifyMobile;
});
//# sourceMappingURL=PNotifyMobile.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,207 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyNonBlock.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyNonBlock', ["./PNotify"], factory) : global.PNotifyNonBlock = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {} // The options for the notice.
}, PNotify.modules.NonBlock.defaults);
};
var methods = {
initModule: function initModule(options) {
this.set(options);
this.doNonBlockClass();
},
update: function update() {
this.doNonBlockClass();
},
doNonBlockClass: function doNonBlockClass() {
if (this.get().nonblock) {
this.get()._notice.addModuleClass('nonblock');
} else {
this.get()._notice.removeModuleClass('nonblock');
}
}
};
function setup(Component) {
Component.key = 'NonBlock';
Component.defaults = {
// Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.
nonblock: false
};
Component.init = function (notice) {
return new Component({ target: document.body,
data: {
'_notice': notice
} });
};
// Register the module with PNotify.
PNotify.modules.NonBlock = Component;
};
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyNonBlock(options) {
init(this, options);
this._state = assign(data(), options.data);
this._intro = true;
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyNonBlock.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyNonBlock.prototype, methods);
PNotifyNonBlock.prototype._recompute = noop;
setup(PNotifyNonBlock);
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyNonBlock;
});
//# sourceMappingURL=PNotifyNonBlock.js.map

View File

@@ -1 +0,0 @@
{"version":3,"sources":["src/PNotifyNonBlock.html"],"names":[],"mappings":";;;;;;;;;;;;UAuBS,I,GAAG;AACN,SAAO,SAAc;AACnB,cAAW,IADQ,EACJ;AACf,eAAY,EAFO,CAEL;AAFK,GAAd,EAGJ,QAAQ,OAAR,CAAgB,QAAhB,CAAyB,QAHrB,CAAP;AAID;;eAEQ;AACP,YADO,sBACK,OADL,EACc;AACnB,QAAK,GAAL,CAAS,OAAT;AACA,QAAK,eAAL;AACD,GAJM;AAMP,QANO,oBAMG;AACR,QAAK,eAAL;AACD,GARM;AAUP,iBAVO,6BAUY;AACjB,OAAI,KAAK,GAAL,GAAW,QAAf,EAAyB;AACvB,SAAK,GAAL,GAAW,OAAX,CAAmB,cAAnB,CAAkC,UAAlC;AACD,IAFD,MAEO;AACL,SAAK,GAAL,GAAW,OAAX,CAAmB,iBAAnB,CAAqC,UAArC;AACD;AACF;AAhBM,E;;UA1BH,K,CAAC,S,EAAW;AAChB,YAAU,GAAV,GAAgB,UAAhB;;AAEA,YAAU,QAAV,GAAqB;AACvB;AACI,aAAU;AAFS,GAArB;;AAKA,YAAU,IAAV,GAAiB,UAAC,MAAD,EAAY;AAC3B,UAAO,IAAI,SAAJ,CAAc,EAAC,QAAQ,SAAS,IAAlB;AACnB,UAAM;AACJ,gBAAW;AADP,KADa,EAAd,CAAP;AAID,GALD;;AAOF;AACE,UAAQ,OAAR,CAAgB,QAAhB,GAA2B,SAA3B;AACD","sourcesContent":["<script>\n import PNotify from './PNotify.html';\n\n export default {\n setup (Component) {\n Component.key = 'NonBlock';\n\n Component.defaults = {\n // Use NonBlock.js to create a non-blocking notice. It lets the user click elements underneath it.\n nonblock: false\n };\n\n Component.init = (notice) => {\n return new Component({target: document.body,\n data: {\n '_notice': notice\n }});\n };\n\n // Register the module with PNotify.\n PNotify.modules.NonBlock = Component;\n },\n\n data () {\n return Object.assign({\n '_notice': null, // The PNotify notice.\n '_options': {} // The options for the notice.\n }, PNotify.modules.NonBlock.defaults);\n },\n\n methods: {\n initModule (options) {\n this.set(options);\n this.doNonBlockClass();\n },\n\n update () {\n this.doNonBlockClass();\n },\n\n doNonBlockClass () {\n if (this.get().nonblock) {\n this.get()._notice.addModuleClass('nonblock');\n } else {\n this.get()._notice.removeModuleClass('nonblock');\n }\n }\n }\n };\n</script>\n"]}

View File

@@ -1,443 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyReference.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyReference', ["./PNotify"], factory) : global.PNotifyReference = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function data() {
return _extends({
'_notice': null, // The PNotify notice.
'_options': {}, // The options for the notice.
'_mouseIsIn': false
}, PNotify.modules.Reference.defaults);
};
var methods = {
// This method is called from the core to give us our actual options.
// Until it is called, our options will just be the defaults.
initModule: function initModule(options) {
var _this = this;
// Set our options.
this.set(options);
// Now that the notice is available to us, we can listen to events fired
// from it.
var _get = this.get(),
_notice = _get._notice;
_notice.on('mouseenter', function () {
return _this.set({ '_mouseIsIn': true });
});
_notice.on('mouseleave', function () {
return _this.set({ '_mouseIsIn': false });
});
},
doSomething: function doSomething() {
// Spin the notice around.
var curAngle = 0;
var _get2 = this.get(),
_notice = _get2._notice;
var timer = setInterval(function () {
curAngle += 10;
if (curAngle === 360) {
curAngle = 0;
clearInterval(timer);
}
_notice.refs.elem.style.transform = 'rotate(' + curAngle + 'deg)';
}, 20);
},
// I have nothing to put in these, just showing you that they exist. You
// won't need to include them if you aren't using them.
update: function update() {
// Called when the notice is updating its options.
},
beforeOpen: function beforeOpen() {
// Called before the notice is opened.
},
afterOpen: function afterOpen() {
// Called after the notice is opened.
},
beforeClose: function beforeClose() {
// Called before the notice is closed.
},
afterClose: function afterClose() {
// Called after the notice is closed.
},
beforeDestroy: function beforeDestroy() {
// Called before the notice is destroyed.
},
afterDestroy: function afterDestroy() {
// Called after the notice is destroyed.
}
};
function oncreate() {
// This is the second way to init a module. Because we put markup in the
// template, we have to fire this event to tell the core that we are ready
// to receive our options.
this.fire('init', { module: this });
};
function setup(Component) {
// This is the key you use for registering your module with PNotify.
Component.key = 'Reference';
// This if the default values of your options.
Component.defaults = {
// Provide a thing for stuff. Turned off by default.
putThing: false,
// If you are displaying any text, you should use a labels options to
// support internationalization.
labels: {
text: 'Spin Around'
}
};
// This is the first way to init a module. If you aren't placing any
// markup in the template, you would do this.
// Component.init = (_notice) => {
// return new Component({target: document.body, data: {_notice}});
// };
// Register the module with PNotify.
PNotify.modules.Reference = Component;
// Append our markup to the container.
PNotify.modulesAppendContainer.push(Component);
// This is where you would add any styling or icons classes you are using in your code.
_extends(PNotify.icons.brighttheme, {
athing: 'bt-icon bt-icon-refresh'
});
_extends(PNotify.icons.bootstrap3, {
athing: 'glyphicon glyphicon-refresh'
});
_extends(PNotify.icons.fontawesome4, {
athing: 'fa fa-refresh'
});
_extends(PNotify.icons.fontawesome5, {
athing: 'fas fa-sync'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
_extends(PNotify.icons.material, {
athing: 'material-icons pnotify-material-icon-refresh'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-1qy4b0e-style';
style.textContent = ".ui-pnotify-reference-button.svelte-1qy4b0e{float:right}.ui-pnotify-reference-clearing.svelte-1qy4b0e{clear:right;line-height:0}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
var if_block_anchor;
var if_block = ctx.putThing && create_if_block(component, ctx);
return {
c: function c() {
if (if_block) if_block.c();
if_block_anchor = createComment();
},
m: function m(target, anchor) {
if (if_block) if_block.m(target, anchor);
insertNode(if_block_anchor, target, anchor);
},
p: function p(changed, ctx) {
if (ctx.putThing) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(component, ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d: function d(detach) {
if (if_block) if_block.d(detach);
if (detach) {
detachNode(if_block_anchor);
}
}
};
}
// (2:0) {#if putThing}
function create_if_block(component, ctx) {
var button,
i,
i_class_value,
text,
text_1_value = ctx.labels.text,
text_1,
button_disabled_value,
text_3,
div;
function click_handler(event) {
component.doSomething();
}
return {
c: function c() {
button = createElement("button");
i = createElement("i");
text = createText(" ");
text_1 = createText(text_1_value);
text_3 = createText("\n \n ");
div = createElement("div");
i.className = i_class_value = "" + ctx._notice.get()._icons.athing + " svelte-1qy4b0e";
addListener(button, "click", click_handler);
button.className = "ui-pnotify-reference-button btn btn-default svelte-1qy4b0e";
button.type = "button";
button.disabled = button_disabled_value = !ctx._mouseIsIn;
div.className = "ui-pnotify-reference-clearing svelte-1qy4b0e";
},
m: function m(target, anchor) {
insertNode(button, target, anchor);
appendNode(i, button);
appendNode(text, button);
appendNode(text_1, button);
component.refs.thingElem = button;
insertNode(text_3, target, anchor);
insertNode(div, target, anchor);
},
p: function p(changed, ctx) {
if (changed._notice && i_class_value !== (i_class_value = "" + ctx._notice.get()._icons.athing + " svelte-1qy4b0e")) {
i.className = i_class_value;
}
if (changed.labels && text_1_value !== (text_1_value = ctx.labels.text)) {
text_1.data = text_1_value;
}
if (changed._mouseIsIn && button_disabled_value !== (button_disabled_value = !ctx._mouseIsIn)) {
button.disabled = button_disabled_value;
}
},
d: function d(detach) {
if (detach) {
detachNode(button);
}
removeListener(button, "click", click_handler);
if (component.refs.thingElem === button) component.refs.thingElem = null;
if (detach) {
detachNode(text_3);
detachNode(div);
}
}
};
}
function PNotifyReference(options) {
var _this2 = this;
init(this, options);
this.refs = {};
this._state = assign(data(), options.data);
this._intro = true;
if (!document.getElementById("svelte-1qy4b0e-style")) add_css();
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(function () {
oncreate.call(_this2);
_this2.fire("update", { changed: assignTrue({}, _this2._state), current: _this2._state });
});
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
callAll(this._oncreate);
}
}
assign(PNotifyReference.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
assign(PNotifyReference.prototype, methods);
PNotifyReference.prototype._recompute = noop;
setup(PNotifyReference);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function createComment() {
return document.createComment('');
}
function insertNode(node, target, anchor) {
target.insertBefore(node, anchor);
}
function detachNode(node) {
node.parentNode.removeChild(node);
}
function createText(data) {
return document.createTextNode(data);
}
function addListener(node, event, handler) {
node.addEventListener(event, handler, false);
}
function removeListener(node, event, handler) {
node.removeEventListener(event, handler, false);
}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function assignTrue(tar, src) {
for (var k in src) {
tar[k] = 1;
}return tar;
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function noop() {}
function blankObject() {
return Object.create(null);
}
return PNotifyReference;
});
//# sourceMappingURL=PNotifyReference.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,213 +0,0 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/* src/PNotifyStyleMaterial.html generated by Svelte v2.6.3 */
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined" ? module.exports = factory(require('./PNotify')) : typeof define === "function" && define.amd ? define('PNotifyStyleMaterial', ["./PNotify"], factory) : global.PNotifyStyleMaterial = factory(PNotify);
})(this, function (PNotify) {
"use strict";
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
function setup(Component) {
Component.key = 'StyleMaterial';
// Register the module with PNotify.
PNotify.modules.StyleMaterial = Component;
// Prepend this module to the container.
PNotify.modulesPrependContainer.push(Component);
if (!PNotify.styling.material) {
PNotify.styling.material = {};
}
PNotify.styling.material = _extends(PNotify.styling.material, {
container: 'pnotify-material',
notice: 'pnotify-material-notice',
info: 'pnotify-material-info',
success: 'pnotify-material-success',
error: 'pnotify-material-error'
});
if (!PNotify.icons.material) {
PNotify.icons.material = {};
}
PNotify.icons.material = _extends(PNotify.icons.material, {
notice: 'material-icons pnotify-material-icon-notice',
info: 'material-icons pnotify-material-icon-info',
success: 'material-icons pnotify-material-icon-success',
error: 'material-icons pnotify-material-icon-error',
closer: 'material-icons pnotify-material-icon-closer',
pinUp: 'material-icons pnotify-material-icon-sticker',
pinDown: 'material-icons pnotify-material-icon-sticker pnotify-material-icon-stuck'
});
};
function add_css() {
var style = createElement("style");
style.id = 'svelte-19og8nx-style';
style.textContent = "[ui-pnotify] .pnotify-material{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;font-size:14px}[ui-pnotify] .pnotify-material.ui-pnotify-shadow{-webkit-box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2);-moz-box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2);box-shadow:0px 6px 24px 0px rgba(0,0,0,0.2)}[ui-pnotify] .pnotify-material.ui-pnotify-container{padding:24px}[ui-pnotify] .pnotify-material .ui-pnotify-title{font-size:20px;margin-bottom:20px;line-height:24px}[ui-pnotify] .pnotify-material .ui-pnotify-title:last-child{margin-bottom:0}[ui-pnotify] .pnotify-material .ui-pnotify-text{font-size:16px;line-height:24px}[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title,[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text,[ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm{margin-left:32px}[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-title,[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-text,[dir=rtl] [ui-pnotify].ui-pnotify-with-icon .pnotify-material .ui-pnotify-confirm{margin-right:32px;margin-left:0}[ui-pnotify] .pnotify-material .ui-pnotify-action-bar{margin-top:20px;margin-right:-16px;margin-bottom:-16px}[dir=rtl] [ui-pnotify] .pnotify-material .ui-pnotify-action-bar{margin-left:-16px;margin-right:0}[ui-pnotify] .pnotify-material-notice{background-color:#FFEE58;border:none;color:#000}[ui-pnotify] .pnotify-material-info{background-color:#26C6DA;border:none;color:#000}[ui-pnotify] .pnotify-material-success{background-color:#66BB6A;border:none;color:#fff}[ui-pnotify] .pnotify-material-error{background-color:#EF5350;border:none;color:#fff}[ui-pnotify] .pnotify-material-icon-notice,[ui-pnotify] .pnotify-material-icon-info,[ui-pnotify] .pnotify-material-icon-success,[ui-pnotify] .pnotify-material-icon-error,[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{position:relative}[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{height:20px;width:20px;font-size:20px;line-height:20px;position:relative}[ui-pnotify] .pnotify-material-icon-notice:after,[ui-pnotify] .pnotify-material-icon-info:after,[ui-pnotify] .pnotify-material-icon-success:after,[ui-pnotify] .pnotify-material-icon-error:after,[ui-pnotify] .pnotify-material-icon-closer:after,[ui-pnotify] .pnotify-material-icon-sticker:after{font-family:'Material Icons'}[ui-pnotify] .pnotify-material-icon-notice:after{content:\"announcement\"}[ui-pnotify] .pnotify-material-icon-info:after{content:\"info\"}[ui-pnotify] .pnotify-material-icon-success:after{content:\"check_circle\"}[ui-pnotify] .pnotify-material-icon-error:after{content:\"error\"}[ui-pnotify] .pnotify-material-icon-closer,[ui-pnotify] .pnotify-material-icon-sticker{display:inline-block}[ui-pnotify] .pnotify-material-icon-closer:after{top:-4px;content:\"close\"}[ui-pnotify] .pnotify-material-icon-sticker:after{top:-5px;content:\"pause\"}[ui-pnotify] .pnotify-material-icon-sticker.pnotify-material-icon-stuck:after{content:\"play_arrow\"}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input{display:block;width:100%;margin-bottom:8px;padding:15px 0 8px;background-color:transparent;color:inherit;border-radius:0;border-top:none;border-left:none;border-right:none;border-bottom-style:solid;border-bottom-color:inherit;border-bottom-width:1px}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-prompt-input:focus{outline:none;border-bottom-color:#3F51B5;border-bottom-width:2px}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button{position:relative;padding:0 16px;overflow:hidden;border-width:0;outline:none;border-radius:2px;background-color:transparent;color:inherit;transition:background-color .3s;text-transform:uppercase;height:36px;margin:6px;min-width:64px;font-weight:bold}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary{color:#3F51B5}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:hover,[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:focus{background-color:rgba(0, 0, 0, .12);color:inherit}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:hover,[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button.ui-pnotify-material-primary:focus{color:#303F9F}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:before{content:\"\";position:absolute;top:50%;left:50%;display:block;width:0;padding-top:0;border-radius:100%;background-color:rgba(153, 153, 153, .4);-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);-o-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}[ui-pnotify].ui-pnotify .pnotify-material .ui-pnotify-action-button:active:before{width:120%;padding-top:120%;transition:width .2s ease-out, padding-top .2s ease-out}";
appendNode(style, document.head);
}
function create_main_fragment(component, ctx) {
return {
c: noop,
m: noop,
p: noop,
d: noop
};
}
function PNotifyStyleMaterial(options) {
init(this, options);
this._state = assign({}, options.data);
this._intro = true;
if (!document.getElementById("svelte-19og8nx-style")) add_css();
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(PNotifyStyleMaterial.prototype, {
destroy: destroy,
get: get,
fire: fire,
on: on,
set: set,
_set: _set,
_mount: _mount,
_differs: _differs
});
PNotifyStyleMaterial.prototype._recompute = noop;
setup(PNotifyStyleMaterial);
function createElement(name) {
return document.createElement(name);
}
function appendNode(node, target) {
target.appendChild(node);
}
function noop() {}
function init(component, options) {
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function assign(tar, src) {
for (var k in src) {
tar[k] = src[k];
}return tar;
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = noop;
this._fragment.d(detach !== false);
this._fragment = null;
this._state = {};
}
function get() {
return this._state;
}
function fire(eventName, data) {
var handlers = eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
var handler = handlers[i];
if (!handler.__calling) {
handler.__calling = true;
handler.call(this, data);
handler.__calling = false;
}
}
}
function on(eventName, handler) {
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function cancel() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign(assign({}, oldState), newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
this.fire("state", { changed: changed, current: this._state, previous: oldState });
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
}
function _mount(target, anchor) {
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
}
function _differs(a, b) {
return a != a ? b == b : a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function';
}
function blankObject() {
return Object.create(null);
}
function callAll(fns) {
while (fns && fns.length) {
fns.shift()();
}
}
return PNotifyStyleMaterial;
});
//# sourceMappingURL=PNotifyStyleMaterial.js.map

File diff suppressed because one or more lines are too long