survey-knockout
Version:
survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.
1,077 lines (910 loc) • 7.08 MB
JavaScript
/*!
* surveyjs - Survey JavaScript library v1.9.12
* Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("knockout"));
else if(typeof define === 'function' && define.amd)
define("survey-ko", ["knockout"], factory);
else if(typeof exports === 'object')
exports["survey-ko"] = factory(require("knockout"));
else
root["Survey"] = factory(root["ko"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_knockout__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./src/entries/knockout.ts");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/knockout/components/panel/panel.html":
/*!*******************************************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/knockout/components/panel/panel.html ***!
\*******************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<!-- ko template: { name: 'survey-panel', data: question, as: 'question', afterRender: question.koPanelAfterRender } --><!-- /ko -->";
/***/ }),
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/knockout/components/popup/popup.html":
/*!*******************************************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/knockout/components/popup/popup.html ***!
\*******************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div class=\"sv-popup\" tabindex=\"-1\"\n data-bind=\"visible: isVisible, click: clickOutside, class: styleClass, event: { keydown: function(data, event) { onKeyDown(event); return true; } }\">\n <div class=\"sv-popup__container\"\n data-bind=\"style: { left: left, top: top, height: height }, click: function() { return true; }, clickBubble: false\">\n <div class=\"sv-popup_shadow\">\n <!-- ko if: showPointer -->\n <span data-bind=\"style: {left: pointerTarget.left, top: pointerTarget.top }\" class=\"sv-popup__pointer\"></span>\n <!-- /ko -->\n <!-- ko if: !!title -->\n <div class=\"sv-popup__header\" data-bind=\"text: title\"></div>\n <!-- /ko -->\n <div class=\"sv-popup__scrolling-content\">\n <div class=\"sv-popup__content\"\n data-bind=\"component: { name: contentComponentName, params: contentComponentData }\"></div>\n </div>\n <!-- ko if: showFooter -->\n <div class=\"sv-popup__footer\">\n <button type=\"button\" class=\"sv-popup__footer-item sv-popup__button sv-popup__button--cancel\"\n data-bind=\"click: cancel, text: cancelButtonText\"> Cancel </button>\n <!-- ko if: isModal -->\n <button type=\"button\" class=\"sv-popup__footer-item sv-popup__button sv-popup__button--apply\"\n data-bind=\"click: apply, text: applyButtonText\"> Apply </button>\n <!-- /ko -->\n </div>\n <!-- /ko -->\n </div>\n </div>\n</div>";
/***/ }),
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/knockout/components/progress/buttons.html":
/*!************************************************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/knockout/components/progress/buttons.html ***!
\************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div data-bind=\"css: survey.css.progressButtonsContainerCenter\">\n <div data-bind=\"css: survey.css.progressButtonsContainer\">\n <div data-bind=\"css: getScrollButtonCss(true), click: clickScrollButton.bind($data, $element.nextElementSibling, true)\" role=\"button\"></div>\n <div data-bind=\"css: survey.css.progressButtonsListContainer\">\n <ul data-bind=\"foreach: survey.visiblePages, css: survey.css.progressButtonsList\">\n <li data-bind=\"css: $parent.getListElementCss($index), click: $parent.isListElementClickable($index) ? $parent.clickListElement.bind($parent, $index) : null\">\n <div data-bind=\"css: css.progressButtonsPageTitle, text: locNavigationTitle.koRenderedHtml() || name, attr: { title: locNavigationTitle.koRenderedHtml() || name }\"></div>\n <div data-bind=\"css: css.progressButtonsPageDescription, text: locNavigationDescription.koRenderedHtml(), attr: { title: locNavigationDescription.koRenderedHtml() }\"></div>\n </li>\n </ul>\n </div>\n <div data-bind=\"css: getScrollButtonCss(false), click: clickScrollButton.bind($data, $element.previousElementSibling, false)\" role=\"button\"></div>\n </div>\n</div>";
/***/ }),
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/knockout/components/progress/progress.html":
/*!*************************************************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/knockout/components/progress/progress.html ***!
\*************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div data-bind=\"css: model.css.progress\">\n <div data-bind=\"css: model.css.progressBar, style: { width: model.progressValue + '%' }\"\n role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\">\n <span data-bind=\"text: model.progressText, css: getProgressTextInBarCss(model.css)\"></span>\n </div>\n <span data-bind=\"text: model.progressText, css: getProgressTextUnderBarCss(model.css)\"></span>\n</div>";
/***/ }),
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/knockout/components/tooltip-error/tooltip-error.html":
/*!***********************************************************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/knockout/components/tooltip-error/tooltip-error.html ***!
\***********************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<!-- ko if: question.hasVisibleErrors -->\n <!-- ko template: { name: 'survey-question-errors', data: question, afterRender: afterRender } -->\n <!-- /ko -->\n<!-- /ko -->";
/***/ }),
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/knockout/templates/entry.html":
/*!************************************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/knockout/templates/entry.html ***!
\************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = "" + __webpack_require__(/*! ./comment.html */ "./src/knockout/templates/comment.html") + "\n" + __webpack_require__(/*! ./flowpanel.html */ "./src/knockout/templates/flowpanel.html") + "\n" + __webpack_require__(/*! ./header.html */ "./src/knockout/templates/header.html") + "\n" + __webpack_require__(/*! ./index.html */ "./src/knockout/templates/index.html") + "\n" + __webpack_require__(/*! ./page.html */ "./src/knockout/templates/page.html") + "\n" + __webpack_require__(/*! ./panel.html */ "./src/knockout/templates/panel.html") + "\n" + __webpack_require__(/*! ./rows.html */ "./src/knockout/templates/rows.html") + "\n" + __webpack_require__(/*! ./row.html */ "./src/knockout/templates/row.html") + "\n" + __webpack_require__(/*! ./string.html */ "./src/knockout/templates/string.html") + "\n" + __webpack_require__(/*! ./timerpanel.html */ "./src/knockout/templates/timerpanel.html") + "\n" + __webpack_require__(/*! ./question.html */ "./src/knockout/templates/question.html") + "\n" + __webpack_require__(/*! ./questiontitle.html */ "./src/knockout/templates/questiontitle.html") + "\n" + __webpack_require__(/*! ./question-boolean.html */ "./src/knockout/templates/question-boolean.html") + "\n" + __webpack_require__(/*! ./question-checkbox.html */ "./src/knockout/templates/question-checkbox.html") + "\n" + __webpack_require__(/*! ./question-ranking.html */ "./src/knockout/templates/question-ranking.html") + "\n" + __webpack_require__(/*! ./question-comment.html */ "./src/knockout/templates/question-comment.html") + "\n" + __webpack_require__(/*! ./question-composite.html */ "./src/knockout/templates/question-composite.html") + "\n" + __webpack_require__(/*! ./question-custom.html */ "./src/knockout/templates/question-custom.html") + "\n" + __webpack_require__(/*! ./question-dropdown.html */ "./src/knockout/templates/question-dropdown.html") + "\n" + __webpack_require__(/*! ./question-empty.html */ "./src/knockout/templates/question-empty.html") + "\n" + __webpack_require__(/*! ./question-errors.html */ "./src/knockout/templates/question-errors.html") + "\n" + __webpack_require__(/*! ./question-expression.html */ "./src/knockout/templates/question-expression.html") + "\n" + __webpack_require__(/*! ./question-file.html */ "./src/knockout/templates/question-file.html") + "\n" + __webpack_require__(/*! ./question-html.html */ "./src/knockout/templates/question-html.html") + "\n" + __webpack_require__(/*! ./question-image.html */ "./src/knockout/templates/question-image.html") + "\n" + __webpack_require__(/*! ./question-imagepicker.html */ "./src/knockout/templates/question-imagepicker.html") + "\n" + __webpack_require__(/*! ./question-matrix.html */ "./src/knockout/templates/question-matrix.html") + "\n" + __webpack_require__(/*! ./question-matrixdynamic.html */ "./src/knockout/templates/question-matrixdynamic.html") + "\n" + __webpack_require__(/*! ./question-multipletext.html */ "./src/knockout/templates/question-multipletext.html") + "\n" + __webpack_require__(/*! ./question-paneldynamic.html */ "./src/knockout/templates/question-paneldynamic.html") + "\n" + __webpack_require__(/*! ./question-paneldynamic-navigator.html */ "./src/knockout/templates/question-paneldynamic-navigator.html") + "\n" + __webpack_require__(/*! ./question-radiogroup.html */ "./src/knockout/templates/question-radiogroup.html") + "\n" + __webpack_require__(/*! ./question-rating.html */ "./src/knockout/templates/question-rating.html") + "\n" + __webpack_require__(/*! ./question-signaturepad.html */ "./src/knockout/templates/question-signaturepad.html") + "\n" + __webpack_require__(/*! ./question-text.html */ "./src/knockout/templates/question-text.html") + "\n" + __webpack_require__(/*! ./question-buttongroup.html */ "./src/knockout/templates/question-buttongroup.html") + "";
/***/ }),
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/knockout/templates/window/window.html":
/*!********************************************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/knockout/templates/window/window.html ***!
\********************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div style=\"position: fixed; bottom: 3px; right: 10px; max-width: 60%;\" data-bind=\"css: css.window.root\">\n <div data-bind=\"css: css.window.header.root\">\n <span data-bind=\"click:doExpand\" style=\"width: 100%; cursor: pointer;\">\n <span style=\"padding-right:10px\" data-bind=\"css: css.window.header.title, text: locTitle.koRenderedHtml\"></span>\n <span aria-hidden=\"true\" data-bind=\"css: koExpandedCss\"></span>\n </span>\n <span data-bind=\"visible:koExpanded, click:doExpand\" style=\"float: right; cursor: pointer;\">\n <span style=\"padding-right:10px\" data-bind=\"css: css.window.header.title\">X</span>\n </span>\n </div>\n <div data-bind=\"visible:koExpanded, css: css.window.body\">\n <div id=\"windowSurveyJS\"></div>\n </div>\n</div>";
/***/ }),
/***/ "./node_modules/html-loader/index.js?interpolate!./node_modules/val-loader/index.js!./src/svgbundle.html":
/*!*********************************************************************************************!*\
!*** ./node_modules/html-loader?interpolate!./node_modules/val-loader!./src/svgbundle.html ***!
\*********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<svg style=\"display:none;\"><symbol viewBox=\"0 0 10 10\" id=\"icon-arrow_downgrey_10x10\"><style><![CDATA[.st0{fill:#6d7072}]]></style><path class=\"st0\" d=\"M2 2L0 4l5 5 5-5-2-2-3 3z\"></path></symbol><symbol viewBox=\"0 0 34 34\" id=\"icon-arrowdown_34x34\"><style><![CDATA[.st0{fill:#fff}]]></style><path class=\"st0\" d=\"M12 16l2-2 3 3 3-3 2 2-5 5z\"></path></symbol><symbol viewBox=\"0 0 24 24\" id=\"icon-choosefile\"><path d=\"M22 9V7c0-1.1-.9-2-2-2h-8l-2-2H4c-1.1 0-2 .9-2 2v16h20l2-12h-2zM4 5h5.2l1.4 1.4.6.6H20v2H4V5zm16.3 14H4v-8h17.6l-1.3 8z\"></path></symbol><symbol viewBox=\"0 0 24 24\" id=\"icon-clear\"><path d=\"M22.6 8.6l-6.2-6.2c-.4-.4-.9-.6-1.4-.6-.5 0-1 .2-1.4.6L1.4 14.6c-.8.8-.8 2 0 2.8L6 22h6l10.6-10.6c.7-.8.7-2.1 0-2.8zM11.1 20H6.8l-4-4 3.4-3.4 6.2 6.2-1.3 1.2zm2.7-2.6l-6.2-6.2L15 3.8l6.2 6.2-7.4 7.4zM16 20h7v2h-9l2-2z\"></path></symbol><symbol viewBox=\"0 0 16 16\" id=\"icon-collapsedetail\"><path d=\"M13 7H3v2h10V7z\"></path></symbol><symbol viewBox=\"0 0 24 24\" id=\"icon-delete\"><path d=\"M22 4h-6V2c0-1.1-.9-2-2-2h-4C8.9 0 8 .9 8 2v2H2v2h2v14c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6h2V4zM10 2h4v2h-4V2zm8 18H6V6h12v14zM14 8h2v10h-2V8zm-3 0h2v10h-2V8zM8 8h2v10H8V8z\"></path></symbol><symbol viewBox=\"0 0 34 34\" id=\"icon-down_34x34\"><style><![CDATA[.st0{fill:#1ab394}.st1{fill:#fff}]]></style><path class=\"st0\" d=\"M33 34H0V0h33c.6 0 1 .4 1 1v32c0 .6-.4 1-1 1z\"></path><path class=\"st1\" d=\"M12 16l2-2 3 3 3-3 2 2-5 5z\"></path></symbol><symbol viewBox=\"0 0 16 16\" id=\"icon-expanddetail\"><path d=\"M13 7H9V3H7v4H3v2h4v4h2V9h4V7z\"></path></symbol><symbol viewBox=\"0 0 16 16\" id=\"icon-left\"><path d=\"M11 12l-2 2-6-6 6-6 2 2-4 4z\"></path></symbol><symbol viewBox=\"0 0 24 24\" id=\"icon-moderncheck\"><path d=\"M5 13l2-2 3 3 7-7 2 2-9 9-5-5z\"></path></symbol><symbol viewBox=\"-12 -12 24 24\" id=\"icon-modernradio\"><circle r=\"6\"></circle></symbol><symbol viewBox=\"0 0 24 24\" id=\"icon-more\"><path d=\"M6 12c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm6-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm8 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z\"></path></symbol><symbol viewBox=\"0 0 10 10\" id=\"icon-progressbutton\"><path d=\"M2 2L0 4l5 5 5-5-2-2-3 3z\"></path></symbol><symbol viewBox=\"0 0 16 16\" id=\"icon-progressbuttonv2\"><path d=\"M15 9H4.4l4.3 4.3-1.4 1.4L.6 8l6.7-6.7 1.4 1.4L4.4 7H15v2z\"></path></symbol><symbol viewBox=\"0 0 16 16\" id=\"icon-removefile\"><path d=\"M8 2C4.7 2 2 4.7 2 8s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zm3 8l-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2 1 1-2 2 2 2z\"></path></symbol><symbol viewBox=\"0 0 16 16\" id=\"icon-right\"><path d=\"M5 4l2-2 6 6-6 6-2-2 4-4z\"></path></symbol><symbol viewBox=\"0 0 20 20\" id=\"icon-v2check\"><path d=\"M8 15.8l-5.4-5.4L4 9l4 4 8-8 1.4 1.4L8 15.8z\"></path></symbol></svg>";
/***/ }),
/***/ "./node_modules/signature_pad/dist/signature_pad.mjs":
/*!***********************************************************!*\
!*** ./node_modules/signature_pad/dist/signature_pad.mjs ***!
\***********************************************************/
/*! exports provided: default */
/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/*!
* Signature Pad v2.3.2
* https://github.com/szimek/signature_pad
*
* Copyright 2017 Szymon Nowak
* Released under the MIT license
*
* The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
* http://corner.squareup.com/2012/07/smoother-signatures.html
*
* Implementation of interpolation using cubic Bézier curves is taken from:
* http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
*
* Algorithm for approximated length of a Bézier curve is taken from:
* http://www.lemoda.net/maths/bezier-length/index.html
*
*/
function Point(x, y, time) {
this.x = x;
this.y = y;
this.time = time || new Date().getTime();
}
Point.prototype.velocityFrom = function (start) {
return this.time !== start.time ? this.distanceTo(start) / (this.time - start.time) : 1;
};
Point.prototype.distanceTo = function (start) {
return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));
};
Point.prototype.equals = function (other) {
return this.x === other.x && this.y === other.y && this.time === other.time;
};
function Bezier(startPoint, control1, control2, endPoint) {
this.startPoint = startPoint;
this.control1 = control1;
this.control2 = control2;
this.endPoint = endPoint;
}
// Returns approximated length.
Bezier.prototype.length = function () {
var steps = 10;
var length = 0;
var px = void 0;
var py = void 0;
for (var i = 0; i <= steps; i += 1) {
var t = i / steps;
var cx = this._point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);
var cy = this._point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
if (i > 0) {
var xdiff = cx - px;
var ydiff = cy - py;
length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);
}
px = cx;
py = cy;
}
return length;
};
/* eslint-disable no-multi-spaces, space-in-parens */
Bezier.prototype._point = function (t, start, c1, c2, end) {
return start * (1.0 - t) * (1.0 - t) * (1.0 - t) + 3.0 * c1 * (1.0 - t) * (1.0 - t) * t + 3.0 * c2 * (1.0 - t) * t * t + end * t * t * t;
};
/* eslint-disable */
// http://stackoverflow.com/a/27078401/815507
function throttle(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
if (!options) options = {};
var later = function later() {
previous = options.leading === false ? 0 : Date.now();
timeout = null;
result = func.apply(context, args);
if (!timeout) context = args = null;
};
return function () {
var now = Date.now();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0 || remaining > wait) {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
previous = now;
result = func.apply(context, args);
if (!timeout) context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
}
function SignaturePad(canvas, options) {
var self = this;
var opts = options || {};
this.velocityFilterWeight = opts.velocityFilterWeight || 0.7;
this.minWidth = opts.minWidth || 0.5;
this.maxWidth = opts.maxWidth || 2.5;
this.throttle = 'throttle' in opts ? opts.throttle : 16; // in miliseconds
this.minDistance = 'minDistance' in opts ? opts.minDistance : 5;
if (this.throttle) {
this._strokeMoveUpdate = throttle(SignaturePad.prototype._strokeUpdate, this.throttle);
} else {
this._strokeMoveUpdate = SignaturePad.prototype._strokeUpdate;
}
this.dotSize = opts.dotSize || function () {
return (this.minWidth + this.maxWidth) / 2;
};
this.penColor = opts.penColor || 'black';
this.backgroundColor = opts.backgroundColor || 'rgba(0,0,0,0)';
this.onBegin = opts.onBegin;
this.onEnd = opts.onEnd;
this._canvas = canvas;
this._ctx = canvas.getContext('2d');
this.clear();
// We need add these inline so they are available to unbind while still having
// access to 'self' we could use _.bind but it's not worth adding a dependency.
this._handleMouseDown = function (event) {
if (event.which === 1) {
self._mouseButtonDown = true;
self._strokeBegin(event);
}
};
this._handleMouseMove = function (event) {
if (self._mouseButtonDown) {
self._strokeMoveUpdate(event);
}
};
this._handleMouseUp = function (event) {
if (event.which === 1 && self._mouseButtonDown) {
self._mouseButtonDown = false;
self._strokeEnd(event);
}
};
this._handleTouchStart = function (event) {
if (event.targetTouches.length === 1) {
var touch = event.changedTouches[0];
self._strokeBegin(touch);
}
};
this._handleTouchMove = function (event) {
// Prevent scrolling.
event.preventDefault();
var touch = event.targetTouches[0];
self._strokeMoveUpdate(touch);
};
this._handleTouchEnd = function (event) {
var wasCanvasTouched = event.target === self._canvas;
if (wasCanvasTouched) {
event.preventDefault();
self._strokeEnd(event);
}
};
// Enable mouse and touch event handlers
this.on();
}
// Public methods
SignaturePad.prototype.clear = function () {
var ctx = this._ctx;
var canvas = this._canvas;
ctx.fillStyle = this.backgroundColor;
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillRect(0, 0, canvas.width, canvas.height);
this._data = [];
this._reset();
this._isEmpty = true;
};
SignaturePad.prototype.fromDataURL = function (dataUrl) {
var _this = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var image = new Image();
var ratio = options.ratio || window.devicePixelRatio || 1;
var width = options.width || this._canvas.width / ratio;
var height = options.height || this._canvas.height / ratio;
this._reset();
image.src = dataUrl;
image.onload = function () {
_this._ctx.drawImage(image, 0, 0, width, height);
};
this._isEmpty = false;
};
SignaturePad.prototype.toDataURL = function (type) {
var _canvas;
switch (type) {
case 'image/svg+xml':
return this._toSVG();
default:
for (var _len = arguments.length, options = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
options[_key - 1] = arguments[_key];
}
return (_canvas = this._canvas).toDataURL.apply(_canvas, [type].concat(options));
}
};
SignaturePad.prototype.on = function () {
this._handleMouseEvents();
this._handleTouchEvents();
};
SignaturePad.prototype.off = function () {
this._canvas.removeEventListener('mousedown', this._handleMouseDown);
this._canvas.removeEventListener('mousemove', this._handleMouseMove);
document.removeEventListener('mouseup', this._handleMouseUp);
this._canvas.removeEventListener('touchstart', this._handleTouchStart);
this._canvas.removeEventListener('touchmove', this._handleTouchMove);
this._canvas.removeEventListener('touchend', this._handleTouchEnd);
};
SignaturePad.prototype.isEmpty = function () {
return this._isEmpty;
};
// Private methods
SignaturePad.prototype._strokeBegin = function (event) {
this._data.push([]);
this._reset();
this._strokeUpdate(event);
if (typeof this.onBegin === 'function') {
this.onBegin(event);
}
};
SignaturePad.prototype._strokeUpdate = function (event) {
var x = event.clientX;
var y = event.clientY;
var point = this._createPoint(x, y);
var lastPointGroup = this._data[this._data.length - 1];
var lastPoint = lastPointGroup && lastPointGroup[lastPointGroup.length - 1];
var isLastPointTooClose = lastPoint && point.distanceTo(lastPoint) < this.minDistance;
// Skip this point if it's too close to the previous one
if (!(lastPoint && isLastPointTooClose)) {
var _addPoint = this._addPoint(point),
curve = _addPoint.curve,
widths = _addPoint.widths;
if (curve && widths) {
this._drawCurve(curve, widths.start, widths.end);
}
this._data[this._data.length - 1].push({
x: point.x,
y: point.y,
time: point.time,
color: this.penColor
});
}
};
SignaturePad.prototype._strokeEnd = function (event) {
var canDrawCurve = this.points.length > 2;
var point = this.points[0]; // Point instance
if (!canDrawCurve && point) {
this._drawDot(point);
}
if (point) {
var lastPointGroup = this._data[this._data.length - 1];
var lastPoint = lastPointGroup[lastPointGroup.length - 1]; // plain object
// When drawing a dot, there's only one point in a group, so without this check
// such group would end up with exactly the same 2 points.
if (!point.equals(lastPoint)) {
lastPointGroup.push({
x: point.x,
y: point.y,
time: point.time,
color: this.penColor
});
}
}
if (typeof this.onEnd === 'function') {
this.onEnd(event);
}
};
SignaturePad.prototype._handleMouseEvents = function () {
this._mouseButtonDown = false;
this._canvas.addEventListener('mousedown', this._handleMouseDown);
this._canvas.addEventListener('mousemove', this._handleMouseMove);
document.addEventListener('mouseup', this._handleMouseUp);
};
SignaturePad.prototype._handleTouchEvents = function () {
// Pass touch events to canvas element on mobile IE11 and Edge.
this._canvas.style.msTouchAction = 'none';
this._canvas.style.touchAction = 'none';
this._canvas.addEventListener('touchstart', this._handleTouchStart);
this._canvas.addEventListener('touchmove', this._handleTouchMove);
this._canvas.addEventListener('touchend', this._handleTouchEnd);
};
SignaturePad.prototype._reset = function () {
this.points = [];
this._lastVelocity = 0;
this._lastWidth = (this.minWidth + this.maxWidth) / 2;
this._ctx.fillStyle = this.penColor;
};
SignaturePad.prototype._createPoint = function (x, y, time) {
var rect = this._canvas.getBoundingClientRect();
return new Point(x - rect.left, y - rect.top, time || new Date().getTime());
};
SignaturePad.prototype._addPoint = function (point) {
var points = this.points;
var tmp = void 0;
points.push(point);
if (points.length > 2) {
// To reduce the initial lag make it work with 3 points
// by copying the first point to the beginning.
if (points.length === 3) points.unshift(points[0]);
tmp = this._calculateCurveControlPoints(points[0], points[1], points[2]);
var c2 = tmp.c2;
tmp = this._calculateCurveControlPoints(points[1], points[2], points[3]);
var c3 = tmp.c1;
var curve = new Bezier(points[1], c2, c3, points[2]);
var widths = this._calculateCurveWidths(curve);
// Remove the first element from the list,
// so that we always have no more than 4 points in points array.
points.shift();
return { curve: curve, widths: widths };
}
return {};
};
SignaturePad.prototype._calculateCurveControlPoints = function (s1, s2, s3) {
var dx1 = s1.x - s2.x;
var dy1 = s1.y - s2.y;
var dx2 = s2.x - s3.x;
var dy2 = s2.y - s3.y;
var m1 = { x: (s1.x + s2.x) / 2.0, y: (s1.y + s2.y) / 2.0 };
var m2 = { x: (s2.x + s3.x) / 2.0, y: (s2.y + s3.y) / 2.0 };
var l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);
var l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);
var dxm = m1.x - m2.x;
var dym = m1.y - m2.y;
var k = l2 / (l1 + l2);
var cm = { x: m2.x + dxm * k, y: m2.y + dym * k };
var tx = s2.x - cm.x;
var ty = s2.y - cm.y;
return {
c1: new Point(m1.x + tx, m1.y + ty),
c2: new Point(m2.x + tx, m2.y + ty)
};
};
SignaturePad.prototype._calculateCurveWidths = function (curve) {
var startPoint = curve.startPoint;
var endPoint = curve.endPoint;
var widths = { start: null, end: null };
var velocity = this.velocityFilterWeight * endPoint.velocityFrom(startPoint) + (1 - this.velocityFilterWeight) * this._lastVelocity;
var newWidth = this._strokeWidth(velocity);
widths.start = this._lastWidth;
widths.end = newWidth;
this._lastVelocity = velocity;
this._lastWidth = newWidth;
return widths;
};
SignaturePad.prototype._strokeWidth = function (velocity) {
return Math.max(this.maxWidth / (velocity + 1), this.minWidth);
};
SignaturePad.prototype._drawPoint = function (x, y, size) {
var ctx = this._ctx;
ctx.moveTo(x, y);
ctx.arc(x, y, size, 0, 2 * Math.PI, false);
this._isEmpty = false;
};
SignaturePad.prototype._drawCurve = function (curve, startWidth, endWidth) {
var ctx = this._ctx;
var widthDelta = endWidth - startWidth;
var drawSteps = Math.floor(curve.length());
ctx.beginPath();
for (var i = 0; i < drawSteps; i += 1) {
// Calculate the Bezier (x, y) coordinate for this step.
var t = i / drawSteps;
var tt = t * t;
var ttt = tt * t;
var u = 1 - t;
var uu = u * u;
var uuu = uu * u;
var x = uuu * curve.startPoint.x;
x += 3 * uu * t * curve.control1.x;
x += 3 * u * tt * curve.control2.x;
x += ttt * curve.endPoint.x;
var y = uuu * curve.startPoint.y;
y += 3 * uu * t * curve.control1.y;
y += 3 * u * tt * curve.control2.y;
y += ttt * curve.endPoint.y;
var width = startWidth + ttt * widthDelta;
this._drawPoint(x, y, width);
}
ctx.closePath();
ctx.fill();
};
SignaturePad.prototype._drawDot = function (point) {
var ctx = this._ctx;
var width = typeof this.dotSize === 'function' ? this.dotSize() : this.dotSize;
ctx.beginPath();
this._drawPoint(point.x, point.y, width);
ctx.closePath();
ctx.fill();
};
SignaturePad.prototype._fromData = function (pointGroups, drawCurve, drawDot) {
for (var i = 0; i < pointGroups.length; i += 1) {
var group = pointGroups[i];
if (group.length > 1) {
for (var j = 0; j < group.length; j += 1) {
var rawPoint = group[j];
var point = new Point(rawPoint.x, rawPoint.y, rawPoint.time);
var color = rawPoint.color;
if (j === 0) {
// First point in a group. Nothing to draw yet.
// All points in the group have the same color, so it's enough to set
// penColor just at the beginning.
this.penColor = color;
this._reset();
this._addPoint(point);
} else if (j !== group.length - 1) {
// Middle point in a group.
var _addPoint2 = this._addPoint(point),
curve = _addPoint2.curve,
widths = _addPoint2.widths;
if (curve && widths) {
drawCurve(curve, widths, color);
}
} else {
// Last point in a group. Do nothing.
}
}
} else {
this._reset();
var _rawPoint = group[0];
drawDot(_rawPoint);
}
}
};
SignaturePad.prototype._toSVG = function () {
var _this2 = this;
var pointGroups = this._data;
var canvas = this._canvas;
var ratio = Math.max(window.devicePixelRatio || 1, 1);
var minX = 0;
var minY = 0;
var maxX = canvas.width / ratio;
var maxY = canvas.height / ratio;
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttributeNS(null, 'width', canvas.width);
svg.setAttributeNS(null, 'height', canvas.height);
this._fromData(pointGroups, function (curve, widths, color) {
var path = document.createElement('path');
// Need to check curve for NaN values, these pop up when drawing
// lines on the canvas that are not continuous. E.g. Sharp corners
// or stopping mid-stroke and than continuing without lifting mouse.
if (!isNaN(curve.control1.x) && !isNaN(curve.control1.y) && !isNaN(curve.control2.x) && !isNaN(curve.control2.y)) {
var attr = 'M ' + curve.startPoint.x.toFixed(3) + ',' + curve.startPoint.y.toFixed(3) + ' ' + ('C ' + curve.control1.x.toFixed(3) + ',' + curve.control1.y.toFixed(3) + ' ') + (curve.control2.x.toFixed(3) + ',' + curve.control2.y.toFixed(3) + ' ') + (curve.endPoint.x.toFixed(3) + ',' + curve.endPoint.y.toFixed(3));
path.setAttribute('d', attr);
path.setAttribute('stroke-width', (widths.end * 2.25).toFixed(3));
path.setAttribute('stroke', color);
path.setAttribute('fill', 'none');
path.setAttribute('stroke-linecap', 'round');
svg.appendChild(path);
}
}, function (rawPoint) {
var circle = document.createElement('circle');
var dotSize = typeof _this2.dotSize === 'function' ? _this2.dotSize() : _this2.dotSize;
circle.setAttribute('r', dotSize);
circle.setAttribute('cx', rawPoint.x);
circle.setAttribute('cy', rawPoint.y);
circle.setAttribute('fill', rawPoint.color);
svg.appendChild(circle);
});
var prefix = 'data:image/svg+xml;base64,';
var header = '<svg' + ' xmlns="http://www.w3.org/2000/svg"' + ' xmlns:xlink="http://www.w3.org/1999/xlink"' + (' viewBox="' + minX + ' ' + minY + ' ' + maxX + ' ' + maxY + '"') + (' width="' + maxX + '"') + (' height="' + maxY + '"') + '>';
var body = svg.innerHTML;
// IE hack for missing innerHTML property on SVGElement
if (body === undefined) {
var dummy = document.createElement('dummy');
var nodes = svg.childNodes;
dummy.innerHTML = '';
for (var i = 0; i < nodes.length; i += 1) {
dummy.appendChild(nodes[i].cloneNode(true));
}
body = dummy.innerHTML;
}
var footer = '</svg>';
var data = header + body + footer;
return prefix + btoa(data);
};
SignaturePad.prototype.fromData = function (pointGroups) {
var _this3 = this;
this.clear();
this._fromData(pointGroups, function (curve, widths) {
return _this3._drawCurve(curve, widths.start, widths.end);
}, function (rawPoint) {
return _this3._drawDot(rawPoint);
});
this._data = pointGroups;
};
SignaturePad.prototype.toData = function () {
return this._data;
};
/* harmony default export */ __webpack_exports__["default"] = (SignaturePad);
/***/ }),
/***/ "./node_modules/webpack/buildin/global.js":
/*!***********************************!*\
!*** (webpack)/buildin/global.js ***!
\***********************************/
/*! no static exports found */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/***/ "./src/actions/action.ts":
/*!*******************************!*\
!*** ./src/actions/action.ts ***!
\*******************************/
/*! exports provided: Action */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; });
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base */ "./src/base.ts");
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../jsonobject */ "./src/jsonobject.ts");
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container */ "./src/actions/container.ts");
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var Action = /** @class */ (function (_super) {
__extends(Action, _super);
function Action(innerItem) {
var _this = _super.call(this) || this;
_this.innerItem = innerItem;
_this.iconSize = 24;
//Object.assign(this, item) to support IE11
if (!!innerItem) {
for (var key in innerItem) {
_this[key] = innerItem[key];
}
}
return _this;
}
Action.prototype.raiseUpdate = function () {
this.updateCallback && this.updateCallback();
};
Object.defineProperty(Action.prototype, "cssClasses", {
get: function () {
return this.cssClassesValue || _container__WEBPACK_IMPORTED_MODULE_3__["defaultActionBarCss"];
},
set: function (val) {
this.cssClassesValue = val;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Action.prototype, "disabled", {
get: function () {
return this.enabled !== undefined && !this.enabled;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Action.prototype, "hasTitle", {
get: function () {
return (((this.mode != "small" &&
(this.showTitle || this.showTitle === undefined)) ||
!this.iconName) &&
!!this.title);
},
enumerable: false,
configurable: true
});
Object.defineProperty(Action.prototype, "isVisible", {
get: function () {
return this.visible && this.mode !== "popup";
},
enumerable: false,
configurable: true
});
Object.defineProperty(Action.prototype, "canShrink", {
get: function () {
return !!this.iconName;
},
enumerable: false,
configurable: true
});
Action.prototype.getActionRootCss = function () {
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
.append("sv-action")
.append(this.css)
.append("sv-action--hidden", !this.isVisible)
.toString();
};
Action.prototype.getActionBarItemTitleCss = function () {
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
.append(this.cssClasses.itemTitle)
.append(this.cssClasses.itemTitleWithIcon, !!this.iconName)
.toString();
};
Action.prototype.getActionBarItemCss = function () {
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
.append(this.cssClasses.item)
.append(this.cssClasses.itemAsIcon, !this.hasTitle)
.append(this.cssClasses.itemActive, !!this.active)
.append(this.cssClasses.itemPressed, !!this.pressed)
.append(this.innerCss)
.toString();
};
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "id", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "iconName", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "iconSize", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
defaultValue: true, onSet: function (_, target) {
target.raiseUpdate();
}
})
], Action.prototype, "visible", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "title", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "tooltip", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "enabled", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "showTitle", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "action", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "css", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "innerCss", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "data", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "popupModel", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "needSeparator", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "active", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "pressed", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "template", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "component", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "items", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "visibleIndex", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "large" })
], Action.prototype, "mode", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "disableTabStop", void 0);
__decorate([
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
], Action.prototype, "disableShrink", void 0);
return Action;
}(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));
/***/ }),
/***/ "./src/actions/adaptive-container.ts":
/*!*******************************************!*\
!*** ./src/actions/adaptive-container.ts ***!
\*******************************************/
/*! exports provided: AdaptiveActionContainer */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdaptiveActionContainer", function() { return AdaptiveActionContainer; });
/* harmony import */ var _utils_responsivity_manager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/responsivity-manager */ "./src/utils/responsivity-manager.ts");
/* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../list */ "./src/list.ts");
/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../popup */ "./src/popup.ts");
/* harmony import */ var _action__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./action */ "./src/actions/action.ts");
/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./container */ "./src/actions/container.ts");
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var AdaptiveActionContainer = /** @class */ (function (_super) {
__extends(AdaptiveActionContainer, _super);
function AdaptiveActionContainer() {
var _this = _super.call(this) || this;
_this.minVisibleItemsCount = 0;
_this.invisibleItemsListModel = new _list__WEBPACK_IMPORTED_MODULE_1__["ListModel"]([], fun