kre-form
Version:
本项目由 Angular8+ 编写的表单设计器和表单应用,所有的配置都是 JSON 结构体组成,PC 端是基于 ANT 组件库封装
449 lines (418 loc) • 16.8 kB
JavaScript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["common"],{
/***/ "./node_modules/@ionic/core/dist/esm-es5/button-active-5da929d4.js":
/*!*************************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm-es5/button-active-5da929d4.js ***!
\*************************************************************************/
/*! exports provided: c */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return createButtonActiveGesture; });
/* harmony import */ var _index_92848855_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index-92848855.js */ "./node_modules/@ionic/core/dist/esm-es5/index-92848855.js");
/* harmony import */ var _index_eea61379_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index-eea61379.js */ "./node_modules/@ionic/core/dist/esm-es5/index-eea61379.js");
/* harmony import */ var _haptic_7b8ba70a_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./haptic-7b8ba70a.js */ "./node_modules/@ionic/core/dist/esm-es5/haptic-7b8ba70a.js");
var createButtonActiveGesture = function (el, isButton) {
var currentTouchedButton;
var initialTouchedButton;
var activateButtonAtPoint = function (x, y, hapticFeedbackFn) {
if (typeof document === 'undefined') {
return;
}
var target = document.elementFromPoint(x, y);
if (!target || !isButton(target)) {
clearActiveButton();
return;
}
if (target !== currentTouchedButton) {
clearActiveButton();
setActiveButton(target, hapticFeedbackFn);
}
};
var setActiveButton = function (button, hapticFeedbackFn) {
currentTouchedButton = button;
if (!initialTouchedButton) {
initialTouchedButton = currentTouchedButton;
}
var buttonToModify = currentTouchedButton;
Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_0__["c"])(function () { return buttonToModify.classList.add('ion-activated'); });
hapticFeedbackFn();
};
var clearActiveButton = function (dispatchClick) {
if (dispatchClick === void 0) { dispatchClick = false; }
if (!currentTouchedButton) {
return;
}
var buttonToModify = currentTouchedButton;
Object(_index_92848855_js__WEBPACK_IMPORTED_MODULE_0__["c"])(function () { return buttonToModify.classList.remove('ion-activated'); });
/**
* Clicking on one button, but releasing on another button
* does not dispatch a click event in browsers, so we
* need to do it manually here. Some browsers will
* dispatch a click if clicking on one button, dragging over
* another button, and releasing on the original button. In that
* case, we need to make sure we do not cause a double click there.
*/
if (dispatchClick && initialTouchedButton !== currentTouchedButton) {
currentTouchedButton.click();
}
currentTouchedButton = undefined;
};
return Object(_index_eea61379_js__WEBPACK_IMPORTED_MODULE_1__["createGesture"])({
el: el,
gestureName: 'buttonActiveDrag',
threshold: 0,
onStart: function (ev) { return activateButtonAtPoint(ev.currentX, ev.currentY, _haptic_7b8ba70a_js__WEBPACK_IMPORTED_MODULE_2__["a"]); },
onMove: function (ev) { return activateButtonAtPoint(ev.currentX, ev.currentY, _haptic_7b8ba70a_js__WEBPACK_IMPORTED_MODULE_2__["b"]); },
onEnd: function () {
clearActiveButton(true);
Object(_haptic_7b8ba70a_js__WEBPACK_IMPORTED_MODULE_2__["h"])();
initialTouchedButton = undefined;
}
});
};
/***/ }),
/***/ "./node_modules/@ionic/core/dist/esm-es5/framework-delegate-d1eb6504.js":
/*!******************************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm-es5/framework-delegate-d1eb6504.js ***!
\******************************************************************************/
/*! exports provided: a, d */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return attachComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return detachComponent; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
var attachComponent = function (delegate, container, component, cssClasses, componentProps) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var el;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
switch (_a.label) {
case 0:
if (delegate) {
return [2 /*return*/, delegate.attachViewToDom(container, component, componentProps, cssClasses)];
}
if (typeof component !== 'string' && !(component instanceof HTMLElement)) {
throw new Error('framework delegate is missing');
}
el = (typeof component === 'string')
? container.ownerDocument && container.ownerDocument.createElement(component)
: component;
if (cssClasses) {
cssClasses.forEach(function (c) { return el.classList.add(c); });
}
if (componentProps) {
Object.assign(el, componentProps);
}
container.appendChild(el);
if (!el.componentOnReady) return [3 /*break*/, 2];
return [4 /*yield*/, el.componentOnReady()];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/, el];
}
});
}); };
var detachComponent = function (delegate, element) {
if (element) {
if (delegate) {
var container = element.parentElement;
return delegate.removeViewFromDom(container, element);
}
element.remove();
}
return Promise.resolve();
};
/***/ }),
/***/ "./node_modules/@ionic/core/dist/esm-es5/haptic-7b8ba70a.js":
/*!******************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm-es5/haptic-7b8ba70a.js ***!
\******************************************************************/
/*! exports provided: a, b, c, d, h */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hapticSelectionStart; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hapticSelectionChanged; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hapticSelection; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return hapticImpact; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hapticSelectionEnd; });
var HapticEngine = {
getEngine: function () {
var win = window;
return (win.TapticEngine) || (win.Capacitor && win.Capacitor.isPluginAvailable('Haptics') && win.Capacitor.Plugins.Haptics);
},
available: function () {
return !!this.getEngine();
},
isCordova: function () {
return !!window.TapticEngine;
},
isCapacitor: function () {
var win = window;
return !!win.Capacitor;
},
impact: function (options) {
var engine = this.getEngine();
if (!engine) {
return;
}
var style = this.isCapacitor() ? options.style.toUpperCase() : options.style;
engine.impact({ style: style });
},
notification: function (options) {
var engine = this.getEngine();
if (!engine) {
return;
}
var style = this.isCapacitor() ? options.style.toUpperCase() : options.style;
engine.notification({ style: style });
},
selection: function () {
this.impact({ style: 'light' });
},
selectionStart: function () {
var engine = this.getEngine();
if (!engine) {
return;
}
if (this.isCapacitor()) {
engine.selectionStart();
}
else {
engine.gestureSelectionStart();
}
},
selectionChanged: function () {
var engine = this.getEngine();
if (!engine) {
return;
}
if (this.isCapacitor()) {
engine.selectionChanged();
}
else {
engine.gestureSelectionChanged();
}
},
selectionEnd: function () {
var engine = this.getEngine();
if (!engine) {
return;
}
if (this.isCapacitor()) {
engine.selectionEnd();
}
else {
engine.gestureSelectionEnd();
}
}
};
/**
* Trigger a selection changed haptic event. Good for one-time events
* (not for gestures)
*/
var hapticSelection = function () {
HapticEngine.selection();
};
/**
* Tell the haptic engine that a gesture for a selection change is starting.
*/
var hapticSelectionStart = function () {
HapticEngine.selectionStart();
};
/**
* Tell the haptic engine that a selection changed during a gesture.
*/
var hapticSelectionChanged = function () {
HapticEngine.selectionChanged();
};
/**
* Tell the haptic engine we are done with a gesture. This needs to be
* called lest resources are not properly recycled.
*/
var hapticSelectionEnd = function () {
HapticEngine.selectionEnd();
};
/**
* Use this to indicate success/failure/warning to the user.
* options should be of the type `{ style: 'light' }` (or `medium`/`heavy`)
*/
var hapticImpact = function (options) {
HapticEngine.impact(options);
};
/***/ }),
/***/ "./node_modules/@ionic/core/dist/esm-es5/spinner-configs-c78e170e.js":
/*!***************************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm-es5/spinner-configs-c78e170e.js ***!
\***************************************************************************/
/*! exports provided: S */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return SPINNERS; });
var spinners = {
'bubbles': {
dur: 1000,
circles: 9,
fn: function (dur, index, total) {
var animationDelay = (dur * index / total) - dur + "ms";
var angle = 2 * Math.PI * index / total;
return {
r: 5,
style: {
'top': 9 * Math.sin(angle) + "px",
'left': 9 * Math.cos(angle) + "px",
'animation-delay': animationDelay,
}
};
}
},
'circles': {
dur: 1000,
circles: 8,
fn: function (dur, index, total) {
var step = index / total;
var animationDelay = (dur * step) - dur + "ms";
var angle = 2 * Math.PI * step;
return {
r: 5,
style: {
'top': 9 * Math.sin(angle) + "px",
'left': 9 * Math.cos(angle) + "px",
'animation-delay': animationDelay,
}
};
}
},
'circular': {
dur: 1400,
elmDuration: true,
circles: 1,
fn: function () {
return {
r: 20,
cx: 48,
cy: 48,
fill: 'none',
viewBox: '24 24 48 48',
transform: 'translate(0,0)',
style: {}
};
}
},
'crescent': {
dur: 750,
circles: 1,
fn: function () {
return {
r: 26,
style: {}
};
}
},
'dots': {
dur: 750,
circles: 3,
fn: function (_, index) {
var animationDelay = -(110 * index) + 'ms';
return {
r: 6,
style: {
'left': 9 - (9 * index) + "px",
'animation-delay': animationDelay,
}
};
}
},
'lines': {
dur: 1000,
lines: 12,
fn: function (dur, index, total) {
var transform = "rotate(" + (30 * index + (index < 6 ? 180 : -180)) + "deg)";
var animationDelay = (dur * index / total) - dur + "ms";
return {
y1: 17,
y2: 29,
style: {
'transform': transform,
'animation-delay': animationDelay,
}
};
}
},
'lines-small': {
dur: 1000,
lines: 12,
fn: function (dur, index, total) {
var transform = "rotate(" + (30 * index + (index < 6 ? 180 : -180)) + "deg)";
var animationDelay = (dur * index / total) - dur + "ms";
return {
y1: 12,
y2: 20,
style: {
'transform': transform,
'animation-delay': animationDelay,
}
};
}
}
};
var SPINNERS = spinners;
/***/ }),
/***/ "./node_modules/@ionic/core/dist/esm-es5/theme-5641d27f.js":
/*!*****************************************************************!*\
!*** ./node_modules/@ionic/core/dist/esm-es5/theme-5641d27f.js ***!
\*****************************************************************/
/*! exports provided: c, g, h, o */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
;
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return createColorClasses; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getClassMap; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hostContext; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return openURL; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
var hostContext = function (selector, el) {
return el.closest(selector) !== null;
};
/**
* Create the mode and color classes for the component based on the classes passed in
*/
var createColorClasses = function (color, cssClassMap) {
var _a;
return (typeof color === 'string' && color.length > 0) ? Object.assign((_a = { 'ion-color': true }, _a["ion-color-" + color] = true, _a), cssClassMap) : cssClassMap;
};
var getClassList = function (classes) {
if (classes !== undefined) {
var array = Array.isArray(classes) ? classes : classes.split(' ');
return array
.filter(function (c) { return c != null; })
.map(function (c) { return c.trim(); })
.filter(function (c) { return c !== ''; });
}
return [];
};
var getClassMap = function (classes) {
var map = {};
getClassList(classes).forEach(function (c) { return map[c] = true; });
return map;
};
var SCHEME = /^[a-z][a-z0-9+\-.]*:/;
var openURL = function (url, ev, direction, animation) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(void 0, void 0, void 0, function () {
var router;
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__generator"])(this, function (_a) {
if (url != null && url[0] !== '#' && !SCHEME.test(url)) {
router = document.querySelector('ion-router');
if (router) {
if (ev != null) {
ev.preventDefault();
}
return [2 /*return*/, router.push(url, direction, animation)];
}
}
return [2 /*return*/, false];
});
}); };
/***/ })
}]);
//# sourceMappingURL=common.js.map