aaa-ui-test 1.0.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.

Potentially problematic release.


This version of aaa-ui-test might be problematic. Click here for more details.

Files changed (189) hide show
  1. package/README.md +62 -0
  2. package/babel-plugin-on-demand-load/index.js +74 -0
  3. package/babel-plugin-on-demand-load/report.js +49 -0
  4. package/lib/address/index.js +19 -0
  5. package/lib/address/src/address.js +340 -0
  6. package/lib/amount/index.js +19 -0
  7. package/lib/amount/src/amount.js +206 -0
  8. package/lib/button/index.js +19 -0
  9. package/lib/button/src/button.js +75 -0
  10. package/lib/button-group/index.js +19 -0
  11. package/lib/button-group/src/button-group.js +53 -0
  12. package/lib/checkbox/index.js +22 -0
  13. package/lib/checkbox/src/checkbox-group.js +85 -0
  14. package/lib/checkbox/src/checkbox.js +228 -0
  15. package/lib/components/address/index.js +19 -0
  16. package/lib/components/amount/index.js +19 -0
  17. package/lib/components/button/index.js +19 -0
  18. package/lib/components/button-group/index.js +19 -0
  19. package/lib/components/checkbox/index.js +22 -0
  20. package/lib/components/date-selecter/index.js +19 -0
  21. package/lib/components/default/index.js +19 -0
  22. package/lib/components/dialog/index.js +204 -0
  23. package/lib/components/field/index.js +19 -0
  24. package/lib/components/input/index.js +19 -0
  25. package/lib/components/list/index.js +19 -0
  26. package/lib/components/list-item/index.js +19 -0
  27. package/lib/components/loading/index.js +116 -0
  28. package/lib/components/mask/index.js +19 -0
  29. package/lib/components/notice/index.js +19 -0
  30. package/lib/components/overlay/index.js +19 -0
  31. package/lib/components/picker/index.js +19 -0
  32. package/lib/components/popup/index.js +19 -0
  33. package/lib/components/popup-header/index.js +19 -0
  34. package/lib/components/radio/index.js +19 -0
  35. package/lib/components/select/index.js +19 -0
  36. package/lib/components/swiper/index.js +19 -0
  37. package/lib/components/switch/index.js +19 -0
  38. package/lib/components/tabs/index.js +22 -0
  39. package/lib/components/textarea/index.js +19 -0
  40. package/lib/components/toast/index.js +60 -0
  41. package/lib/date-selecter/index.js +19 -0
  42. package/lib/date-selecter/src/dateselecter.js +544 -0
  43. package/lib/default/index.js +19 -0
  44. package/lib/default/src/default.js +61 -0
  45. package/lib/dialog/index.js +204 -0
  46. package/lib/dialog/src/dialog.js +258 -0
  47. package/lib/field/index.js +19 -0
  48. package/lib/field/src/field.js +91 -0
  49. package/lib/index.css +2213 -0
  50. package/lib/index.js +10083 -0
  51. package/lib/input/index.js +19 -0
  52. package/lib/input/src/input.js +365 -0
  53. package/lib/list/index.js +19 -0
  54. package/lib/list/src/list.js +54 -0
  55. package/lib/list-item/index.js +19 -0
  56. package/lib/list-item/src/list-item.js +122 -0
  57. package/lib/loading/index.js +116 -0
  58. package/lib/loading/src/loading.js +80 -0
  59. package/lib/mask/index.js +19 -0
  60. package/lib/mask/src/mask.js +94 -0
  61. package/lib/mixins/emitter.js +43 -0
  62. package/lib/mixins/visible.js +29 -0
  63. package/lib/notice/index.js +19 -0
  64. package/lib/notice/src/notice.js +188 -0
  65. package/lib/overlay/index.js +19 -0
  66. package/lib/overlay/src/overlay.js +153 -0
  67. package/lib/picker/index.js +19 -0
  68. package/lib/picker/src/picker.js +218 -0
  69. package/lib/popup/index.js +19 -0
  70. package/lib/popup/src/popup.js +170 -0
  71. package/lib/popup-header/index.js +19 -0
  72. package/lib/popup-header/src/popup-header.js +93 -0
  73. package/lib/radio/index.js +19 -0
  74. package/lib/radio/src/radio.js +102 -0
  75. package/lib/select/index.js +19 -0
  76. package/lib/select/src/select.js +136 -0
  77. package/lib/swiper/index.js +19 -0
  78. package/lib/swiper/src/swiper.js +270 -0
  79. package/lib/switch/index.js +19 -0
  80. package/lib/switch/src/switch.js +143 -0
  81. package/lib/tabs/index.js +22 -0
  82. package/lib/tabs/src/tab-item.js +72 -0
  83. package/lib/tabs/src/tabs.js +171 -0
  84. package/lib/textarea/index.js +19 -0
  85. package/lib/textarea/src/textarea.js +219 -0
  86. package/lib/toast/index.js +60 -0
  87. package/lib/toast/src/toast.js +59 -0
  88. package/lib/utils/clickoutside.js +45 -0
  89. package/lib/utils/fix-body.js +57 -0
  90. package/lib/utils/utils.js +74 -0
  91. package/package.json +73 -0
  92. package/src/assets/css/common/_mixin.scss +130 -0
  93. package/src/assets/css/common/_var.scss +69 -0
  94. package/src/components/address/index.js +8 -0
  95. package/src/components/address/index.scss +72 -0
  96. package/src/components/address/src/address.vue +238 -0
  97. package/src/components/amount/index.js +6 -0
  98. package/src/components/amount/index.scss +88 -0
  99. package/src/components/amount/src/amount.vue +143 -0
  100. package/src/components/button/__tests__/__snapshots__/index.test.js.snap +7 -0
  101. package/src/components/button/__tests__/index.test.js +39 -0
  102. package/src/components/button/index.js +7 -0
  103. package/src/components/button/index.scss +83 -0
  104. package/src/components/button/src/button.vue +39 -0
  105. package/src/components/button-group/index.js +8 -0
  106. package/src/components/button-group/index.scss +37 -0
  107. package/src/components/button-group/src/button-group.vue +21 -0
  108. package/src/components/checkbox/index.js +8 -0
  109. package/src/components/checkbox/index.scss +47 -0
  110. package/src/components/checkbox/src/checkbox-group.vue +53 -0
  111. package/src/components/checkbox/src/checkbox.vue +153 -0
  112. package/src/components/date-selecter/index.js +6 -0
  113. package/src/components/date-selecter/index.scss +190 -0
  114. package/src/components/date-selecter/src/dateselecter.vue +387 -0
  115. package/src/components/default/index.js +6 -0
  116. package/src/components/default/index.scss +25 -0
  117. package/src/components/default/src/default.vue +23 -0
  118. package/src/components/dialog/index.js +146 -0
  119. package/src/components/dialog/index.scss +250 -0
  120. package/src/components/dialog/src/dialog.vue +153 -0
  121. package/src/components/field/index.js +8 -0
  122. package/src/components/field/index.scss +93 -0
  123. package/src/components/field/src/field.vue +57 -0
  124. package/src/components/input/__tests__/__snapshots__/index.test.js.snap +10 -0
  125. package/src/components/input/__tests__/index.test.js +63 -0
  126. package/src/components/input/index.js +8 -0
  127. package/src/components/input/index.scss +91 -0
  128. package/src/components/input/src/input.vue +214 -0
  129. package/src/components/list/index.js +8 -0
  130. package/src/components/list/index.scss +21 -0
  131. package/src/components/list/src/list.vue +16 -0
  132. package/src/components/list-item/index.js +8 -0
  133. package/src/components/list-item/index.scss +126 -0
  134. package/src/components/list-item/src/list-item.vue +59 -0
  135. package/src/components/loading/__tests__/__snapshots__/index.test.js.snap +9 -0
  136. package/src/components/loading/__tests__/index.test.js +30 -0
  137. package/src/components/loading/index.js +128 -0
  138. package/src/components/loading/index.scss +33 -0
  139. package/src/components/loading/src/loading.vue +23 -0
  140. package/src/components/mask/index.js +9 -0
  141. package/src/components/mask/index.scss +16 -0
  142. package/src/components/mask/src/mask.vue +52 -0
  143. package/src/components/notice/index.js +6 -0
  144. package/src/components/notice/index.scss +81 -0
  145. package/src/components/notice/src/notice.vue +128 -0
  146. package/src/components/overlay/index.js +8 -0
  147. package/src/components/overlay/index.scss +119 -0
  148. package/src/components/overlay/src/overlay.vue +72 -0
  149. package/src/components/picker/index.js +7 -0
  150. package/src/components/picker/index.scss +49 -0
  151. package/src/components/picker/src/picker.vue +205 -0
  152. package/src/components/popup/index.js +8 -0
  153. package/src/components/popup/index.scss +79 -0
  154. package/src/components/popup/src/popup.vue +88 -0
  155. package/src/components/popup-header/index.js +8 -0
  156. package/src/components/popup-header/index.scss +45 -0
  157. package/src/components/popup-header/src/popup-header.vue +41 -0
  158. package/src/components/radio/index.js +8 -0
  159. package/src/components/radio/index.scss +19 -0
  160. package/src/components/radio/src/radio.vue +51 -0
  161. package/src/components/select/index.js +8 -0
  162. package/src/components/select/index.scss +51 -0
  163. package/src/components/select/src/select.vue +86 -0
  164. package/src/components/swiper/index.js +6 -0
  165. package/src/components/swiper/index.scss +49 -0
  166. package/src/components/swiper/src/swiper.vue +211 -0
  167. package/src/components/switch/__tests__/__snapshots__/index.test.js.snap +15 -0
  168. package/src/components/switch/__tests__/index.test.js +44 -0
  169. package/src/components/switch/index.js +8 -0
  170. package/src/components/switch/index.scss +85 -0
  171. package/src/components/switch/src/switch.vue +60 -0
  172. package/src/components/tabs/index.js +8 -0
  173. package/src/components/tabs/index.scss +73 -0
  174. package/src/components/tabs/src/tab-item.vue +40 -0
  175. package/src/components/tabs/src/tabs.vue +121 -0
  176. package/src/components/textarea/index.js +8 -0
  177. package/src/components/textarea/index.scss +41 -0
  178. package/src/components/textarea/src/textarea.vue +140 -0
  179. package/src/components/toast/__tests__/__snapshots__/index.test.js.snap +3 -0
  180. package/src/components/toast/__tests__/index.test.js +25 -0
  181. package/src/components/toast/index.js +53 -0
  182. package/src/components/toast/index.scss +102 -0
  183. package/src/components/toast/src/toast.vue +19 -0
  184. package/src/index.js +87 -0
  185. package/src/mixins/emitter.js +33 -0
  186. package/src/mixins/visible.js +23 -0
  187. package/src/utils/clickoutside.js +42 -0
  188. package/src/utils/fix-body.js +46 -0
  189. package/src/utils/utils.js +71 -0
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _tabItem = _interopRequireDefault(require("./tab-item"));
13
+
14
+ var _utils = require("../../utils/utils");
15
+
16
+ //
17
+ //
18
+ //
19
+ //
20
+ //
21
+ //
22
+ //
23
+ //
24
+ //
25
+ var __script__ = {
26
+ name: "JddTabs",
27
+ props: {
28
+ value: {
29
+ default: 0
30
+ },
31
+ type: {
32
+ type: String,
33
+ default: "line"
34
+ }
35
+ },
36
+ components: {
37
+ JddTabItem: _tabItem.default
38
+ },
39
+ provide: function provide() {
40
+ return {
41
+ handleClick: this.itemSelect,
42
+ parent: this
43
+ };
44
+ },
45
+ data: function data() {
46
+ return {
47
+ needScroll: false,
48
+ left: 0,
49
+ midPos: 0,
50
+ rafHand: null,
51
+ period: 5
52
+ };
53
+ },
54
+ created: function created() {
55
+ var slotsLength = 0;
56
+
57
+ if (this.$slots.default && this.$slots.default.length) {
58
+ slotsLength = this.$slots.default.length;
59
+ }
60
+
61
+ if (slotsLength >= 5) {
62
+ this.needScroll = true;
63
+ } //let slotsLength = this.$slots.default.length;
64
+ // console.log()
65
+
66
+ },
67
+ methods: {
68
+ computedLeft: function computedLeft(offsetLeft) {
69
+ var activeTab = this.$refs.tab.querySelector(".jdd-tabs-active");
70
+ var activeLineWidth = this.$refs.tab.querySelector(".jdd-tabs-active-line").offsetWidth;
71
+ this.left = activeTab.offsetLeft + activeTab.offsetWidth / 2 - activeLineWidth / 2;
72
+ this.midPos = this.$refs.scroll.offsetWidth / 2; //console.log(this.midPos,offsetLeft)
73
+
74
+ var scrollLeft = this.$refs.scroll.scrollLeft;
75
+
76
+ if (this.midPos <= offsetLeft) {
77
+ // this.$refs.scroll.scrollLeft = offsetLeft-this.midPos;
78
+ this.rafScroll(scrollLeft, offsetLeft - this.midPos);
79
+ } else {
80
+ // this.$refs.scroll.scrollLeft = 0;
81
+ this.rafScroll(scrollLeft, 0);
82
+ } //if()
83
+
84
+ },
85
+ itemSelect: function itemSelect(value, content, offsetLeft) {
86
+ var _this2 = this;
87
+
88
+ if (value !== this.value) {
89
+ this.$emit("input", value);
90
+ this.$nextTick(function () {
91
+ _this2.computedLeft(offsetLeft); // this
92
+
93
+ });
94
+ }
95
+
96
+ this.$emit("click", value);
97
+ },
98
+ rafScroll: function rafScroll(begin, end) {
99
+ if (begin === end) {
100
+ return;
101
+ } // if(this.rafHand){
102
+ // cancelAnimationFrame(this.rafHand);
103
+ // }
104
+ //this.rafHand&&;
105
+
106
+
107
+ var arr = [];
108
+ var period = (end - begin) / this.period;
109
+
110
+ for (var index = 0; index < this.period; index++) {
111
+ arr.push(parseInt(begin += period));
112
+ }
113
+
114
+ arr.push(end);
115
+
116
+ var _this = this; // console.log(arr)
117
+ // let stop = null;
118
+
119
+
120
+ var i = 0; //console.log(new Date().getTime())
121
+
122
+ function step(timestamp) {
123
+ if (i < arr.length) {
124
+ // console.log(arr[i])
125
+ _this.$refs.scroll.scrollLeft = arr[i];
126
+ i += 1;
127
+ (0, _utils.rAF)(step);
128
+ } else {
129
+ // console.log(new Date().getTime())
130
+ (0, _utils.cancelRaf)(_this.rafHand);
131
+ }
132
+ }
133
+
134
+ _this.rafHand = (0, _utils.rAF)(step);
135
+ }
136
+ },
137
+ mounted: function mounted() {
138
+ this.computedLeft();
139
+ }
140
+ };
141
+
142
+ var render = function render() {
143
+ var _vm = this;
144
+
145
+ var _h = _vm.$createElement;
146
+
147
+ var _c = _vm._self._c || _h;
148
+
149
+ return _c('div', {
150
+ ref: "tab",
151
+ class: [_vm.type === 'line' ? 'jdd-tabs-line' : 'jdd-tabs-card', _vm.needScroll ? 'jdd-tabs-hasscroll' : '', 'jdd-tabs-wrap']
152
+ }, [_c('div', {
153
+ ref: "scroll",
154
+ staticClass: "jdd-tabs-list"
155
+ }, [_vm._t("default"), _vm._v(" "), _c('span', {
156
+ staticClass: "jdd-tabs-active-line",
157
+ style: {
158
+ 'left': _vm.left + 'px'
159
+ }
160
+ })], 2)]);
161
+ };
162
+
163
+ var staticRenderFns = [];
164
+ var __template__ = {
165
+ render: render,
166
+ staticRenderFns: staticRenderFns
167
+ };
168
+
169
+ var _default = (0, _extends2.default)({}, __script__, __template__);
170
+
171
+ exports.default = _default;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _textarea = _interopRequireDefault(require("./src/textarea"));
11
+
12
+ require("./index.css");
13
+
14
+ _textarea.default.install = function (Vue) {
15
+ Vue.component(_textarea.default.name, _textarea.default);
16
+ };
17
+
18
+ var _default = _textarea.default;
19
+ exports.default = _default;
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _field = _interopRequireDefault(require("../../field"));
13
+
14
+ //
15
+ //
16
+ //
17
+ //
18
+ //
19
+ //
20
+ //
21
+ //
22
+ //
23
+ //
24
+ //
25
+ //
26
+ //
27
+ //
28
+ //
29
+ //
30
+ //
31
+ //
32
+ //
33
+ //
34
+ //
35
+ //
36
+ //
37
+ //
38
+ //
39
+ //
40
+ //
41
+ //
42
+ var __script__ = {
43
+ name: "JddTextarea",
44
+ inheritAttrs: false,
45
+ props: {
46
+ value: {
47
+ type: String,
48
+ default: ""
49
+ },
50
+ title: {
51
+ type: String,
52
+ default: ""
53
+ },
54
+ direction: {
55
+ type: String,
56
+ default: "row"
57
+ },
58
+ placeholder: {
59
+ type: String,
60
+ default: ""
61
+ },
62
+ border: {
63
+ type: String,
64
+ default: ""
65
+ }
66
+ },
67
+ components: {
68
+ jddField: _field.default
69
+ },
70
+ data: function data() {
71
+ return {
72
+ checkValue: this.value,
73
+ label: this.title,
74
+ isFocus: false,
75
+ inputValue: this.value,
76
+ paddingBottom: 0
77
+ };
78
+ },
79
+ methods: {
80
+ onLabelclick: function onLabelclick() {
81
+ //if(!this.value)
82
+ this.isFocus = true;
83
+ this.$refs.textarea.focus();
84
+ },
85
+ onInput: function onInput() {
86
+ this.resizeHeight();
87
+ this.$emit("input", this.inputValue);
88
+ },
89
+ onClick: function onClick() {
90
+ this.$refs.textarea.focus();
91
+ this.isFocus = true;
92
+ },
93
+ onFocus: function onFocus() {},
94
+ onBlur: function onBlur() {
95
+ var textareaDom = this.$refs.textarea;
96
+
97
+ if (!this.inputValue) {
98
+ this.isFocus = false;
99
+ textareaDom.style.height = "0px";
100
+ }
101
+
102
+ textareaDom.scrollTop = 0;
103
+ },
104
+ onChange: function onChange() {
105
+ this.resizeHeight();
106
+ this.$emit("input", this.inputValue);
107
+ },
108
+ resizeHeight: function resizeHeight() {
109
+ //console.log(1)
110
+ //console.log(this.$refs.textarea.scrollHeight)
111
+ var textareaDom = this.$refs.textarea;
112
+ var scrollHeight = textareaDom.scrollHeight;
113
+
114
+ if (scrollHeight > 30 && this.direction === "column") {
115
+ this.paddingBottom = 12;
116
+ } else if (this.direction === 'row') {
117
+ this.paddingBottom = 16;
118
+ }
119
+
120
+ var height = 0,
121
+ style = textareaDom.style;
122
+ var minHeight = 22;
123
+ textareaDom.style.height = minHeight + "px";
124
+
125
+ if (textareaDom.scrollHeight > minHeight) {
126
+ height = textareaDom.scrollHeight;
127
+ style.height = height + "px";
128
+ }
129
+ }
130
+ },
131
+ created: function created() {
132
+ if (this.value) {
133
+ this.isFocus = true;
134
+ }
135
+ },
136
+ computed: {
137
+ getPlaceholder: function getPlaceholder() {
138
+ return this.direction !== "column" && this.placeholder;
139
+ }
140
+ },
141
+ mounted: function mounted() {
142
+ this.resizeHeight();
143
+ },
144
+ watch: {
145
+ value: function value(newVal) {
146
+ this.checkValue = newVal;
147
+ },
148
+ checkValue: function checkValue(newVal) {
149
+ this.$emit("change", newVal);
150
+ this.$emit("input", newVal);
151
+ }
152
+ }
153
+ };
154
+
155
+ var render = function render() {
156
+ var _vm = this;
157
+
158
+ var _h = _vm.$createElement;
159
+
160
+ var _c = _vm._self._c || _h;
161
+
162
+ return _c('jdd-field', {
163
+ attrs: {
164
+ "label": _vm.label,
165
+ "isFocus": _vm.isFocus,
166
+ "direction": _vm.direction,
167
+ "border": _vm.border
168
+ },
169
+ on: {
170
+ "label-click": _vm.onLabelclick
171
+ }
172
+ }, [_c('div', {
173
+ staticClass: "jdd-field-control jdd-field-textarea",
174
+ style: {
175
+ 'paddingBottom': _vm.paddingBottom + 'px'
176
+ },
177
+ on: {
178
+ "click": _vm.onClick
179
+ }
180
+ }, [_c('textarea', _vm._b({
181
+ directives: [{
182
+ name: "model",
183
+ rawName: "v-model",
184
+ value: _vm.inputValue,
185
+ expression: "inputValue"
186
+ }],
187
+ ref: "textarea",
188
+ attrs: {
189
+ "rows": "1",
190
+ "placeholder": _vm.getPlaceholder
191
+ },
192
+ domProps: {
193
+ "value": _vm.inputValue
194
+ },
195
+ on: {
196
+ "input": [function ($event) {
197
+ if ($event.target.composing) {
198
+ return;
199
+ }
200
+
201
+ _vm.inputValue = $event.target.value;
202
+ }, _vm.onInput],
203
+ "change": _vm.onChange,
204
+ "propertychange": _vm.onChange,
205
+ "blur": _vm.onBlur,
206
+ "focus": _vm.onFocus
207
+ }
208
+ }, 'textarea', _vm.$attrs, false))])]);
209
+ };
210
+
211
+ var staticRenderFns = [];
212
+ var __template__ = {
213
+ render: render,
214
+ staticRenderFns: staticRenderFns
215
+ };
216
+
217
+ var _default = (0, _extends2.default)({}, __script__, __template__);
218
+
219
+ exports.default = _default;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _vue = _interopRequireDefault(require("vue"));
11
+
12
+ var _toast = _interopRequireDefault(require("./src/toast"));
13
+
14
+ require("./index.css");
15
+
16
+ // const Toast = {};
17
+ // // 注册Toast
18
+ // Toast.install = function (Vue) {
19
+ // 生成一个Vue的子类
20
+ // 同时这个子类也就是组件
21
+ var ToastConstructor = _vue.default.extend(_toast.default);
22
+
23
+ var toastPool = []; // 生成一个该子类的实例
24
+
25
+ var getAnInstance = function getAnInstance() {
26
+ if (toastPool.length > 0) {
27
+ var instance = toastPool[0];
28
+ toastPool.splice(0, 1);
29
+ return instance;
30
+ }
31
+
32
+ return new ToastConstructor({
33
+ el: document.createElement('div')
34
+ });
35
+ }; // 通过Vue的原型注册一个方法
36
+ // 让所有实例共享这个方法
37
+
38
+
39
+ var Toast = _vue.default.prototype.$toast = function (msg, bgcolor) {
40
+ if (document.querySelector('.jdd-toast')) {
41
+ document.body.removeChild(document.querySelector('.jdd-toast'));
42
+ }
43
+
44
+ var instance = getAnInstance();
45
+ instance.message = msg;
46
+
47
+ if (bgcolor) {
48
+ instance.bgcolor = bgcolor;
49
+ }
50
+
51
+ instance.show = true;
52
+ document.body.appendChild(instance.$el);
53
+ return instance;
54
+ };
55
+
56
+ Toast.install = function (Vue) {}; //}
57
+
58
+
59
+ var _default = Toast;
60
+ exports.default = _default;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ //
13
+ //
14
+ //
15
+ //
16
+ //
17
+ //
18
+ var __script__ = {
19
+ name: 'JddToast',
20
+ data: function data() {
21
+ return {
22
+ show: false,
23
+ android: navigator.userAgent.toLowerCase().match(/android/i) == "android" ? true : false,
24
+ message: "",
25
+ bgcolor: ""
26
+ };
27
+ }
28
+ };
29
+
30
+ var render = function render() {
31
+ var _vm = this;
32
+
33
+ var _h = _vm.$createElement;
34
+
35
+ var _c = _vm._self._c || _h;
36
+
37
+ return _vm.show ? _c('div', {
38
+ staticClass: "jdd-toast ",
39
+ class: {
40
+ 'jdd-toast-in': _vm.show,
41
+ 'jdd-toast-bottom': _vm.android,
42
+ 'jdd-toast-top': !_vm.android
43
+ }
44
+ }, [_c('span', {
45
+ style: {
46
+ background: _vm.bgcolor
47
+ }
48
+ }, [_vm._v(_vm._s(_vm.message))])]) : _vm._e();
49
+ };
50
+
51
+ var staticRenderFns = [];
52
+ var __template__ = {
53
+ render: render,
54
+ staticRenderFns: staticRenderFns
55
+ };
56
+
57
+ var _default = (0, _extends2.default)({}, __script__, __template__);
58
+
59
+ exports.default = _default;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ /**
9
+ * v-clickoutside
10
+ * @desc 点击元素外面才会触发的事件
11
+ * @example
12
+ * ```vue
13
+ * <div v-clickoutside="handleClose">
14
+ * ```
15
+ */
16
+ var clickoutsideContext = '@@clickoutsideContext';
17
+ var _default = {
18
+ bind: function bind(el, binding, vnode) {
19
+ var documentHandler = function documentHandler(e) {
20
+ if (vnode.context && !el.contains(e.target)) {
21
+ vnode.context[el[clickoutsideContext].methodName]();
22
+ }
23
+ };
24
+
25
+ el[clickoutsideContext] = {
26
+ documentHandler: documentHandler,
27
+ methodName: binding.expression,
28
+ arg: binding.arg || 'click'
29
+ };
30
+ document.addEventListener(el[clickoutsideContext].arg, documentHandler);
31
+ },
32
+ update: function update(el, binding) {
33
+ el[clickoutsideContext].methodName = binding.expression;
34
+ },
35
+ unbind: function unbind(el) {
36
+ document.removeEventListener(el[clickoutsideContext].arg, el[clickoutsideContext].documentHandler);
37
+ },
38
+ install: function install(Vue) {
39
+ Vue.directive('clickoutside', {
40
+ bind: this.bind,
41
+ unbind: this.unbind
42
+ });
43
+ }
44
+ };
45
+ exports.default = _default;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _utils = require("./utils");
9
+
10
+ /**
11
+ * v-fixed
12
+ * @desc 点击元素外面才会触发的事件
13
+ * @example
14
+ * ```vue
15
+ * <div v-fixed>
16
+ * ```
17
+ */
18
+ var scrollTop = 0;
19
+
20
+ function getTop() {
21
+ return document.body.scrollTop || document.documentElement.scrollTop;
22
+ }
23
+
24
+ function setTop() {
25
+ document.body.style.top = -scrollTop + "px";
26
+ }
27
+
28
+ function backScroll() {
29
+ document.body.scrollTop = document.documentElement.scrollTop = scrollTop;
30
+ }
31
+
32
+ var _default = {
33
+ bind: function bind(el, binding, vnode) {
34
+ if (binding.value) {
35
+ scrollTop = getTop();
36
+ (0, _utils.addClass)(document.body, "jdd-modal-open");
37
+ setTop();
38
+ }
39
+ },
40
+ unbind: function unbind() {
41
+ (0, _utils.removeClass)(document.body, "jdd-modal-open"); // scrollTop lost after set position:fixed, restore it back.
42
+
43
+ backScroll();
44
+ },
45
+ componentUpdated: function componentUpdated(el, binding) {
46
+ if (binding.value) {
47
+ scrollTop = getTop();
48
+ (0, _utils.addClass)(document.body, "jdd-modal-open");
49
+ setTop();
50
+ } else {
51
+ (0, _utils.removeClass)(document.body, "jdd-modal-open"); // scrollTop lost after set position:fixed, restore it back.
52
+
53
+ backScroll();
54
+ }
55
+ }
56
+ };
57
+ exports.default = _default;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.addClass = addClass;
7
+ exports.removeClass = removeClass;
8
+ exports.cancelRaf = exports.rAF = exports.Type = void 0;
9
+
10
+ /* 类型检测 */
11
+ var Type = {}; // eslint-disable-next-line no-cond-assign
12
+
13
+ exports.Type = Type;
14
+
15
+ for (var i = 0, type; type = ['String', 'Number', 'Boolean', 'Array', 'Object', 'Function'][i++];) {
16
+ (function (type) {
17
+ Type['is' + type] = function (obj) {
18
+ return Object.prototype.toString.call(obj) === '[object ' + type + ']';
19
+ };
20
+ })(type);
21
+ }
22
+
23
+ var whitespaceRE = /\s+/;
24
+
25
+ function addClass(el, cls) {
26
+ /* istanbul ignore if */
27
+ if (!cls || !(cls = cls.trim())) {
28
+ return;
29
+ }
30
+ /* istanbul ignore else */
31
+
32
+
33
+ if (cls.indexOf(' ') > -1) {
34
+ cls.split(whitespaceRE).forEach(function (c) {
35
+ return el.classList.add(c);
36
+ });
37
+ } else {
38
+ el.classList.add(cls);
39
+ }
40
+ }
41
+
42
+ function removeClass(el, cls) {
43
+ /* istanbul ignore if */
44
+ if (!cls || !(cls = cls.trim())) {
45
+ return;
46
+ }
47
+ /* istanbul ignore else */
48
+
49
+
50
+ if (cls.indexOf(' ') > -1) {
51
+ cls.split(whitespaceRE).forEach(function (c) {
52
+ return el.classList.remove(c);
53
+ });
54
+ } else {
55
+ el.classList.remove(cls);
56
+ }
57
+
58
+ if (!el.classList.length) {
59
+ el.removeAttribute('class');
60
+ }
61
+ }
62
+
63
+ var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
64
+ window.setTimeout(callback, 1000 / 60);
65
+ };
66
+
67
+ exports.rAF = rAF;
68
+
69
+ var cancelRaf = window.cancelAnimationFrame || Window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || window.oCancelAnimationFrame || function (id) {
70
+ //为了使setTimteout的尽可能的接近每秒60帧的效果
71
+ window.clearTimeout(id);
72
+ };
73
+
74
+ exports.cancelRaf = cancelRaf;