fastman2 2.8.9 → 3.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/actionsheetman.js CHANGED
@@ -1 +1,96 @@
1
- !function(o,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.fastman=n():o.fastman=n()}(this,function(){return webpackJsonpfastman([30],{213:function(o,n,e){o.exports=e(82)},82:function(o,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=e(10),a=document.createElement("div");n.default=function(o){var n,e,l,c=o;c=c||[],c.length>0&&!$.isArray(c[0])&&(c=[c]);for(var i,d="",s=0;s<c.length;s++)for(var r=0;r<c[s].length;r++){0===r&&(d+='<div class="actions-modal-group">');var f=c[s][r],u=f.label?"actions-modal-label":"actions-modal-button";f.bold&&(u+=" actions-modal-button-bold"),f.color&&(u+=" color-"+f.color),f.bg&&(u+=" bg-"+f.bg),f.disabled&&(u+=" disabled"),d+='<span class="'+u+'">'+f.text+"</span>",r===c[s].length-1&&(d+="</div>")}return i='<div class="actions-modal">'+d+"</div>",a.innerHTML=i,n=$(a).children(),$(t.defaults.modalContainer).append(n[0]),e=".actions-modal-group",l=".actions-modal-button",n.find(e).each(function(o,e){var a=o;$(e).children().each(function(o,e){var i,d=o,s=c[a][d];$(e).is(l)&&(i=$(e)),i&&i.on("click",function(o){!1!==s.close&&(0,t.closeModal)(n),s.onClick&&s.onClick(n,o)})})}),(0,t.openModal)(n),n[0]}}},[213])});
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["fastman"] = factory();
8
+ else
9
+ root["fastman"] = factory();
10
+ })(this, function() {
11
+ return webpackJsonpfastman([30],{
12
+
13
+ /***/ 213:
14
+ /***/ (function(module, exports, __webpack_require__) {
15
+
16
+ module.exports = __webpack_require__(82);
17
+
18
+
19
+ /***/ }),
20
+
21
+ /***/ 82:
22
+ /***/ (function(module, exports, __webpack_require__) {
23
+
24
+ "use strict";
25
+
26
+
27
+ Object.defineProperty(exports, "__esModule", {
28
+ value: true
29
+ });
30
+
31
+ var _modal = __webpack_require__(10);
32
+
33
+ var _modalTemplateTempDiv = document.createElement('div');
34
+
35
+ // 从下往上需要在Element上添加"actions-modal"样式
36
+ /**
37
+ * Created by dfzq on 2017/3/21.
38
+ */
39
+
40
+ exports.default = function (buttons) {
41
+ var params = buttons;
42
+
43
+ var modal, groupSelector, buttonSelector;
44
+ params = params || [];
45
+
46
+ if (params.length > 0 && !$.isArray(params[0])) {
47
+ params = [params];
48
+ }
49
+ var modalHTML;
50
+ var buttonsHTML = '';
51
+ for (var i = 0; i < params.length; i++) {
52
+ for (var j = 0; j < params[i].length; j++) {
53
+ if (j === 0) buttonsHTML += '<div class="actions-modal-group">';
54
+ var button = params[i][j];
55
+ var buttonClass = button.label ? 'actions-modal-label' : 'actions-modal-button';
56
+ if (button.bold) buttonClass += ' actions-modal-button-bold';
57
+ if (button.color) buttonClass += ' color-' + button.color;
58
+ if (button.bg) buttonClass += ' bg-' + button.bg;
59
+ if (button.disabled) buttonClass += ' disabled';
60
+ buttonsHTML += '<span class="' + buttonClass + '">' + button.text + '</span>';
61
+ if (j === params[i].length - 1) buttonsHTML += '</div>';
62
+ }
63
+ }
64
+ modalHTML = '<div class="actions-modal">' + buttonsHTML + '</div>';
65
+ _modalTemplateTempDiv.innerHTML = modalHTML;
66
+ modal = $(_modalTemplateTempDiv).children();
67
+ $(_modal.defaults.modalContainer).append(modal[0]);
68
+ groupSelector = '.actions-modal-group';
69
+ buttonSelector = '.actions-modal-button';
70
+
71
+ var groups = modal.find(groupSelector);
72
+ groups.each(function (index, el) {
73
+ var groupIndex = index;
74
+ $(el).children().each(function (index, el) {
75
+ var buttonIndex = index;
76
+ var buttonParams = params[groupIndex][buttonIndex];
77
+ var clickTarget;
78
+ if ($(el).is(buttonSelector)) clickTarget = $(el);
79
+ // if (toPopover && $(el).find(buttonSelector).length > 0) clickTarget = $(el).find(buttonSelector);
80
+
81
+ if (clickTarget) {
82
+ clickTarget.on('click', function (e) {
83
+ if (buttonParams.close !== false) (0, _modal.closeModal)(modal);
84
+ if (buttonParams.onClick) buttonParams.onClick(modal, e);
85
+ });
86
+ }
87
+ });
88
+ });
89
+ (0, _modal.openModal)(modal);
90
+ return modal[0];
91
+ };
92
+
93
+ /***/ })
94
+
95
+ },[213]);
96
+ });
package/alertman.js CHANGED
@@ -1 +1,79 @@
1
- !function(t,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.fastman=o():t.fastman=o()}(this,function(){return webpackJsonpfastman([29],{214:function(t,o,e){t.exports=e(83)},83:function(t,o,e){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=e(10);o.default=function(t,o,e,i){if("function"==typeof o)e=o,o=void 0;else if("object"===(void 0===t?"undefined":n(t))){var f=t.text,s=void 0===f?"":f,u=t.title,d=void 0===u?l.defaults.modalTitle:u,a=t.allowClose,r=void 0!==a&&a,c=t.onClick,m=t.modalButtonOk;return(0,l.modal)({text:s,title:d,buttons:[{text:m||l.defaults.modalButtonOk,bold:!0,onClick:c}],isClose:r,extraClass:"remove-on-close"})}return(0,l.modal)({text:t||"",title:void 0===o?l.defaults.modalTitle:o,buttons:[{text:l.defaults.modalButtonOk,bold:!0,onClick:e}],isClose:i||!1,extraClass:"remove-on-close"})}}},[214])});
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["fastman"] = factory();
8
+ else
9
+ root["fastman"] = factory();
10
+ })(this, function() {
11
+ return webpackJsonpfastman([29],{
12
+
13
+ /***/ 214:
14
+ /***/ (function(module, exports, __webpack_require__) {
15
+
16
+ module.exports = __webpack_require__(83);
17
+
18
+
19
+ /***/ }),
20
+
21
+ /***/ 83:
22
+ /***/ (function(module, exports, __webpack_require__) {
23
+
24
+ "use strict";
25
+
26
+
27
+ Object.defineProperty(exports, "__esModule", {
28
+ value: true
29
+ });
30
+
31
+ 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; }; /*
32
+ * @Author: linyiqing
33
+ * @Date: 2019-05-22 16:58:50
34
+ * @Company: orientsec.com.cn
35
+ * @Description: 对话框
36
+ */
37
+
38
+
39
+ var _modal = __webpack_require__(10);
40
+
41
+ exports.default = function (_text, title, callbackOk, allowClose) {
42
+ // 表达式声明
43
+ if (typeof title === 'function') {
44
+ callbackOk = title;
45
+ title = undefined;
46
+ }
47
+ // 函数对象式声明
48
+ else if ((typeof _text === 'undefined' ? 'undefined' : _typeof(_text)) === 'object') {
49
+ var _text$text = _text.text,
50
+ text = _text$text === undefined ? '' : _text$text,
51
+ _text$title = _text.title,
52
+ _title = _text$title === undefined ? _modal.defaults.modalTitle : _text$title,
53
+ _text$allowClose = _text.allowClose,
54
+ _allowClose = _text$allowClose === undefined ? false : _text$allowClose,
55
+ onClick = _text.onClick,
56
+ modalButtonOk = _text.modalButtonOk;
57
+
58
+ return (0, _modal.modal)({
59
+ text: text,
60
+ title: _title,
61
+ buttons: [{ text: modalButtonOk || _modal.defaults.modalButtonOk, bold: true, onClick: onClick }],
62
+ isClose: _allowClose,
63
+ extraClass: 'remove-on-close'
64
+ });
65
+ }
66
+
67
+ return (0, _modal.modal)({
68
+ text: _text || '',
69
+ title: typeof title === 'undefined' ? _modal.defaults.modalTitle : title,
70
+ buttons: [{ text: _modal.defaults.modalButtonOk, bold: true, onClick: callbackOk }],
71
+ isClose: allowClose || false,
72
+ extraClass: 'remove-on-close'
73
+ });
74
+ };
75
+
76
+ /***/ })
77
+
78
+ },[214]);
79
+ });