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/tabman.js CHANGED
@@ -1 +1,145 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fastman=e():t.fastman=e()}(this,function(){return webpackJsonpfastman([19],{224:function(t,e,a){t.exports=a(90)},90:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e,a){var n=$(t);if(2===arguments.length&&"boolean"==typeof e&&(a=e),0===n.length)return!1;if(n.hasClass("active"))return a&&n.trigger("show"),!1;var i=n.parent(".tabs");if(0===i.length)return!1;var r=i.children(".tab.active").removeClass("active");if(n.addClass("active"),n.trigger("show"),e?e=$(e):(!(e="string"==typeof t?$('.tab-link[href="'+t+'"]'):$('.tab-link[href="#'+n.attr("id")+'"]'))||e&&0===e.length)&&$("[data-tab]").each(function(){n.is($(this).attr("data-tab"))&&(e=$(this))}),0!==e.length){var o;if(r&&r.length>0){var s=r.attr("id");s&&(o=$('.tab-link[href="#'+s+'"]')),(!o||o&&0===o.length)&&$("[data-tab]").each(function(){r.is($(this).attr("data-tab"))&&(o=$(this))})}return e&&e.length>0&&e.addClass("active"),o&&o.length>0&&o.removeClass("active"),e.trigger("active"),!0}},i=$.showTab;$.showTab=n,$.showTab.noConflict=function(){return $.showTab=i,this},$(document).on("click",".tab-link",function(t){t.preventDefault();var e=$(this);n(e.data("tab")||e.attr("href"),e)});var r=function(t,e){$(".tab-link[href='#"+t+"']").on("click",e)},o=function(t){var e=$(".tab-link[href='#"+t+"']");n(e.data("tab")||e.attr("href"),e)};e.tabEvent=r,e.tabSwitch=o}},[224])});
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([19],{
12
+
13
+ /***/ 224:
14
+ /***/ (function(module, exports, __webpack_require__) {
15
+
16
+ module.exports = __webpack_require__(90);
17
+
18
+
19
+ /***/ }),
20
+
21
+ /***/ 90:
22
+ /***/ (function(module, exports, __webpack_require__) {
23
+
24
+ "use strict";
25
+
26
+
27
+ Object.defineProperty(exports, "__esModule", {
28
+ value: true
29
+ });
30
+ var showTab = function showTab(tab, tabLink, force) {
31
+ var newTab = $(tab);
32
+ if (arguments.length === 2) {
33
+ if (typeof tabLink === 'boolean') {
34
+ force = tabLink;
35
+ }
36
+ }
37
+ if (newTab.length === 0) return false;
38
+ if (newTab.hasClass('active')) {
39
+ if (force) newTab.trigger('show');
40
+ return false;
41
+ }
42
+ var tabs = newTab.parent('.tabs');
43
+ if (tabs.length === 0) return false;
44
+
45
+ // Animated tabs
46
+ /*var isAnimatedTabs = tabs.parent().hasClass('tabs-animated-wrap');
47
+ if (isAnimatedTabs) {
48
+ tabs.transform('translate3d(' + -newTab.index() * 100 + '%,0,0)');
49
+ }*/
50
+
51
+ // Remove active class from old tabs
52
+ var oldTab = tabs.children('.tab.active').removeClass('active');
53
+ // Add active class to new tab
54
+ newTab.addClass('active');
55
+ // Trigger 'show' event on new tab
56
+ newTab.trigger('show');
57
+
58
+ // Update navbars in new tab
59
+ /*if (!isAnimatedTabs && newTab.find('.navbar').length > 0) {
60
+ // Find tab's view
61
+ var viewContainer;
62
+ if (newTab.hasClass(app.params.viewClass)) viewContainer = newTab[0];
63
+ else viewContainer = newTab.parents('.' + app.params.viewClass)[0];
64
+ app.sizeNavbars(viewContainer);
65
+ }*/
66
+
67
+ // Find related link for new tab
68
+ if (tabLink) tabLink = $(tabLink);else {
69
+ // Search by id
70
+ if (typeof tab === 'string') tabLink = $('.tab-link[href="' + tab + '"]');else tabLink = $('.tab-link[href="#' + newTab.attr('id') + '"]');
71
+ // Search by data-tab
72
+ if (!tabLink || tabLink && tabLink.length === 0) {
73
+ $('[data-tab]').each(function () {
74
+ if (newTab.is($(this).attr('data-tab'))) tabLink = $(this);
75
+ });
76
+ }
77
+ }
78
+ if (tabLink.length === 0) return;
79
+
80
+ // Find related link for old tab
81
+ var oldTabLink;
82
+ if (oldTab && oldTab.length > 0) {
83
+ // Search by id
84
+ var oldTabId = oldTab.attr('id');
85
+ if (oldTabId) oldTabLink = $('.tab-link[href="#' + oldTabId + '"]');
86
+ // Search by data-tab
87
+ if (!oldTabLink || oldTabLink && oldTabLink.length === 0) {
88
+ $('[data-tab]').each(function () {
89
+ if (oldTab.is($(this).attr('data-tab'))) oldTabLink = $(this);
90
+ });
91
+ }
92
+ }
93
+
94
+ // Update links' classes
95
+ if (tabLink && tabLink.length > 0) tabLink.addClass('active');
96
+ if (oldTabLink && oldTabLink.length > 0) oldTabLink.removeClass('active');
97
+ tabLink.trigger('active');
98
+
99
+ //app.refreshScroller();
100
+
101
+ return true;
102
+ };
103
+
104
+ var old = $.showTab;
105
+ $.showTab = showTab;
106
+
107
+ $.showTab.noConflict = function () {
108
+ $.showTab = old;
109
+ return this;
110
+ };
111
+ //a标签上的click事件,在iscroll下响应有问题
112
+ $(document).on("click", ".tab-link", function (e) {
113
+ e.preventDefault();
114
+ var clicked = $(this);
115
+ showTab(clicked.data("tab") || clicked.attr('href'), clicked);
116
+ });
117
+
118
+ /**
119
+ * 定义某个tab事件
120
+ *
121
+ * @param tabId tab对应href锚点
122
+ * @param fun 回调事件
123
+ */
124
+ var tabEvent = function tabEvent(tabId, fun) {
125
+ $(".tab-link[href='#" + tabId + "']").on("click", fun);
126
+ };
127
+
128
+ /**
129
+ * 切换tab
130
+ *
131
+ * @param tabId tab对应href锚点
132
+ */
133
+ var tabSwitch = function tabSwitch(tabId) {
134
+ // $(".tab-link[href='#" + tabId + "']").trigger('click');
135
+ var clicked = $(".tab-link[href='#" + tabId + "']");
136
+ showTab(clicked.data("tab") || clicked.attr('href'), clicked);
137
+ };
138
+
139
+ exports.tabEvent = tabEvent;
140
+ exports.tabSwitch = tabSwitch;
141
+
142
+ /***/ })
143
+
144
+ },[224]);
145
+ });
package/tipman.js CHANGED
@@ -1 +1,110 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fastman=e():t.fastman=e()}(this,function(){return webpackJsonpfastman([18],{225:function(t,e,i){t.exports=i(91)},91:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.closeTip=e.tip=void 0;var s=i(29),n={content:"",stayTime:1e3,type:"info",extraclass:"",callback:function(){}},o=function(t,e,i){var s=this;this.element=$(t),this._isFromTpl=i,this.elementHeight=$(t).height(),this.option=$.extend(n,e),$(t).css({"-webkit-transform":"translateY(-"+this.elementHeight+"px)"}),setTimeout(function(){$(t).css({"-webkit-transition":"all .5s"}),s.show()},20)};o.prototype={show:function(){var t=this;t.element.trigger($.Event("tips:show")),this.element.css({"-webkit-transform":"translateY(0px)"}),t.option.stayTime>0&&setTimeout(function(){t.hide()},t.option.stayTime)},hide:function(){var t=this;t.element.trigger($.Event("tips:hide")),this.element.css({"-webkit-transform":"translateY(-"+this.elementHeight+"px)"}),setTimeout(function(){t._isFromTpl&&t.element.remove()},500)}};var a=function(t){return n.extraclass="",(0,s.adaptObject)(void 0,n,t,'<div class="ui-poptips ui-poptips-<%=type%>"><div class="ui-poptips-cnt <%=extraclass%>"><%=content%></div></div>',o,"tips")},r=function(t){var e=$(t);e.css({"-webkit-transform":"translateY(-"+e.height()+"px)"}),setTimeout(function(){e.length&&e.remove()},500)};e.tip=a,e.closeTip=r}},[225])});
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([18],{
12
+
13
+ /***/ 225:
14
+ /***/ (function(module, exports, __webpack_require__) {
15
+
16
+ module.exports = __webpack_require__(91);
17
+
18
+
19
+ /***/ }),
20
+
21
+ /***/ 91:
22
+ /***/ (function(module, exports, __webpack_require__) {
23
+
24
+ "use strict";
25
+
26
+
27
+ Object.defineProperty(exports, "__esModule", {
28
+ value: true
29
+ });
30
+ exports.closeTip = exports.tip = undefined;
31
+
32
+ var _base = __webpack_require__(29);
33
+
34
+ // 默认模板
35
+ var _tipsTpl = '<div class="ui-poptips ui-poptips-<%=type%>">' + '<div class="ui-poptips-cnt <%=extraclass%>">' + '<%=content%>' + '</div>' + '</div>';
36
+
37
+ // 默认参数
38
+ /**
39
+ * Created by linyiqing on 2017/3/23.
40
+ */
41
+ var defaults = {
42
+ content: '',
43
+ stayTime: 1000,
44
+ type: 'info',
45
+ extraclass: '', // 自定义样式
46
+ callback: function callback() {}
47
+ // 构造函数
48
+ };var Tips = function Tips(el, option, isFromTpl) {
49
+ var self = this;
50
+ this.element = $(el);
51
+ this._isFromTpl = isFromTpl;
52
+ this.elementHeight = $(el).height();
53
+
54
+ this.option = $.extend(defaults, option);
55
+ $(el).css({
56
+ "-webkit-transform": "translateY(-" + this.elementHeight + "px)"
57
+ });
58
+ setTimeout(function () {
59
+ $(el).css({
60
+ "-webkit-transition": "all .5s"
61
+ });
62
+ self.show();
63
+ }, 20);
64
+ };
65
+ Tips.prototype = {
66
+ show: function show() {
67
+ var self = this;
68
+ // self.option.callback("show");
69
+ self.element.trigger($.Event("tips:show"));
70
+ this.element.css({
71
+ "-webkit-transform": "translateY(0px)"
72
+ });
73
+ if (self.option.stayTime > 0) {
74
+ setTimeout(function () {
75
+ self.hide();
76
+ }, self.option.stayTime);
77
+ }
78
+ },
79
+ hide: function hide() {
80
+ var self = this;
81
+ self.element.trigger($.Event("tips:hide"));
82
+ this.element.css({
83
+ "-webkit-transform": "translateY(-" + this.elementHeight + "px)"
84
+ });
85
+ setTimeout(function () {
86
+ self._isFromTpl && self.element.remove();
87
+ }, 500);
88
+ }
89
+ };
90
+ var tip = function tip(option) {
91
+ defaults.extraclass = '';
92
+ return (0, _base.adaptObject)(undefined, defaults, option, _tipsTpl, Tips, "tips");
93
+ };
94
+ var closeTip = function closeTip(tip) {
95
+ var $tip = $(tip);
96
+ $tip.css({
97
+ "-webkit-transform": "translateY(-" + $tip.height() + "px)"
98
+ });
99
+ setTimeout(function () {
100
+ $tip.length && $tip.remove();
101
+ }, 500);
102
+ };
103
+
104
+ exports.tip = tip;
105
+ exports.closeTip = closeTip;
106
+
107
+ /***/ })
108
+
109
+ },[225]);
110
+ });
package/toastman.js CHANGED
@@ -1 +1,78 @@
1
- !function(o,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fastman=t():o.fastman=t()}(this,function(){return webpackJsonpfastman([17],{226:function(o,t,e){o.exports=e(50)},50:function(o,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeToast=t.toast=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},f=e(10),i=function(o,t,e){if("object"===(void 0===o?"undefined":n(o))){var i=o,s=i.text,c=void 0===s?"":s,u=i.duration,a=void 0===u?2e3:u,r=i.extraclass,d=void 0===r?"":r;o=c,t=a,e=d}else"number"!=typeof t&&(e=t,t=2e3);var p=$('<div class="modal toast '+(e||"")+'">'+o+"</div>").appendTo(document.body);return(0,f.openModal)(p,function(){setTimeout(function(){(0,f.closeModal)(p)},t||2e3)}),p},s=function(o){(0,f.closeModal)(o)};t.toast=i,t.closeToast=s}},[226])});
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([17],{
12
+
13
+ /***/ 226:
14
+ /***/ (function(module, exports, __webpack_require__) {
15
+
16
+ module.exports = __webpack_require__(50);
17
+
18
+
19
+ /***/ }),
20
+
21
+ /***/ 50:
22
+ /***/ (function(module, exports, __webpack_require__) {
23
+
24
+ "use strict";
25
+
26
+
27
+ Object.defineProperty(exports, "__esModule", {
28
+ value: true
29
+ });
30
+ exports.closeToast = exports.toast = undefined;
31
+
32
+ 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; }; /**
33
+ * Created by linyiqing on 2017/3/21.
34
+ */
35
+
36
+
37
+ var _modal = __webpack_require__(10);
38
+
39
+ var toast = function toast(_msg, _duration, _extraclass) {
40
+
41
+ // 函数对象式声明
42
+ if ((typeof _msg === 'undefined' ? 'undefined' : _typeof(_msg)) === 'object') {
43
+ var _msg2 = _msg,
44
+ _msg2$text = _msg2.text,
45
+ text = _msg2$text === undefined ? '' : _msg2$text,
46
+ _msg2$duration = _msg2.duration,
47
+ duration = _msg2$duration === undefined ? 2000 : _msg2$duration,
48
+ _msg2$extraclass = _msg2.extraclass,
49
+ extraclass = _msg2$extraclass === undefined ? '' : _msg2$extraclass;
50
+
51
+ _msg = text;
52
+ _duration = duration;
53
+ _extraclass = extraclass;
54
+ }
55
+ // 表达式声明
56
+ else if (typeof _duration != 'number') {
57
+ _extraclass = _duration;
58
+ _duration = 2000;
59
+ }
60
+
61
+ var $toast = $('<div class="modal toast ' + (_extraclass || '') + '">' + _msg + '</div>').appendTo(document.body);
62
+ (0, _modal.openModal)($toast, function () {
63
+ setTimeout(function () {
64
+ (0, _modal.closeModal)($toast);
65
+ }, _duration || 2000);
66
+ });
67
+ return $toast;
68
+ };
69
+ var closeToast = function closeToast($toast) {
70
+ (0, _modal.closeModal)($toast);
71
+ };
72
+ exports.toast = toast;
73
+ exports.closeToast = closeToast;
74
+
75
+ /***/ })
76
+
77
+ },[226]);
78
+ });
package/toolman.js CHANGED
@@ -1 +1,22 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.fastman=t():e.fastman=t()}(this,function(){return webpackJsonpfastman([31],{240:function(e,t,o){e.exports=o(31)}},[240])});
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([31],{
12
+
13
+ /***/ 240:
14
+ /***/ (function(module, exports, __webpack_require__) {
15
+
16
+ module.exports = __webpack_require__(31);
17
+
18
+
19
+ /***/ })
20
+
21
+ },[240]);
22
+ });