@opentiny/vue-renderless 3.1.0-alpha.0 → 3.4.7

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.
Files changed (177) hide show
  1. package/action-menu/index.js +10 -0
  2. package/action-menu/vue.js +26 -0
  3. package/amount/index.js +334 -0
  4. package/amount/vue.js +206 -0
  5. package/area/index.js +162 -0
  6. package/area/vue.js +68 -0
  7. package/autonavi-map/index.js +28 -0
  8. package/avatar/index.js +5 -1
  9. package/avatar/vue.js +2 -1
  10. package/baidu-map/index.js +28 -0
  11. package/breadcrumb/index.js +9 -0
  12. package/breadcrumb/vue.js +25 -3
  13. package/breadcrumb-item/index.js +26 -0
  14. package/breadcrumb-item/vue.js +20 -11
  15. package/bulletin-board/index.js +4 -1
  16. package/button-group/vue.js +1 -1
  17. package/calendar/index.js +14 -14
  18. package/card-template/index.js +1 -1
  19. package/cascader/index.js +21 -7
  20. package/cascader/vue.js +1 -2
  21. package/cascader-node/index.js +3 -1
  22. package/cascader-panel/index.js +12 -4
  23. package/cascader-panel/vue.js +1 -2
  24. package/chart-bar/index.js +533 -0
  25. package/chart-boxplot/index.js +270 -0
  26. package/chart-candle/index.js +428 -0
  27. package/chart-core/deps/constants.js +65 -0
  28. package/chart-core/deps/numerify.js +286 -0
  29. package/chart-core/deps/utils.js +205 -0
  30. package/chart-core/index.js +541 -0
  31. package/chart-core/modules/animation.js +10 -0
  32. package/chart-core/modules/extend.js +36 -0
  33. package/chart-core/modules/mark.js +7 -0
  34. package/chart-core/vue.js +128 -0
  35. package/chart-funnel/index.js +155 -0
  36. package/chart-gauge/index.js +153 -0
  37. package/chart-graph/index.js +38 -0
  38. package/chart-heatmap/index.js +407 -0
  39. package/chart-line/index.js +358 -0
  40. package/chart-liquidfill/index.js +119 -0
  41. package/chart-map/index.js +261 -0
  42. package/chart-pie/index.js +327 -0
  43. package/chart-radar/index.js +181 -0
  44. package/chart-sankey/index.js +166 -0
  45. package/chart-scatter/index.js +360 -0
  46. package/chart-sunburst/index.js +36 -0
  47. package/chart-tree/index.js +107 -0
  48. package/chart-waterfall/index.js +231 -0
  49. package/chart-wordcloud/index.js +109 -0
  50. package/checkbox/index.js +4 -4
  51. package/checkbox-button/index.js +3 -1
  52. package/common/bigInt.js +5 -2
  53. package/common/date.js +17 -17
  54. package/common/deps/date-util.js +15 -5
  55. package/common/deps/date.js +6 -6
  56. package/common/deps/dom.js +18 -6
  57. package/common/deps/eSpaceCtrl.js +286 -0
  58. package/common/deps/fullscreen/apis.js +22 -22
  59. package/common/deps/memorize.js +3 -3
  60. package/common/deps/modal-queue.js +2 -0
  61. package/common/deps/popper.js +12 -10
  62. package/common/deps/popup-manager.js +16 -5
  63. package/common/deps/resize-event.js +6 -2
  64. package/common/deps/scrollbar-width.js +6 -2
  65. package/common/deps/tree-model/node.js +30 -10
  66. package/common/deps/tree-model/tree-store.js +33 -21
  67. package/common/deps/tree-model/util.js +6 -2
  68. package/common/deps/upload-ajax.js +7 -1
  69. package/common/deps/vue-popper.js +2 -2
  70. package/common/string.js +1 -1
  71. package/company/index.js +56 -0
  72. package/company/vue.js +35 -0
  73. package/country/index.js +54 -0
  74. package/country/vue.js +35 -0
  75. package/credit-card-form/index.js +1 -0
  76. package/currency/index.js +78 -0
  77. package/currency/vue.js +39 -0
  78. package/date-panel/index.js +16 -6
  79. package/date-picker/index.js +9 -5
  80. package/date-range/index.js +28 -9
  81. package/date-table/index.js +3 -1
  82. package/dept/index.js +318 -0
  83. package/dept/vue.js +163 -0
  84. package/detail-page/index.js +4 -1
  85. package/dialog-box/index.js +14 -4
  86. package/dialog-box/vue.js +7 -3
  87. package/drop-roles/index.js +73 -0
  88. package/drop-roles/vue.js +38 -0
  89. package/dropdown/index.js +5 -4
  90. package/dropdown/vue.js +5 -3
  91. package/dropdown-item/index.js +15 -0
  92. package/dropdown-item/vue.js +27 -13
  93. package/espace/index.js +129 -0
  94. package/espace/vue.js +52 -0
  95. package/file-upload/index.js +336 -291
  96. package/form/index.js +3 -1
  97. package/form/vue.js +15 -0
  98. package/form-item/index.js +15 -5
  99. package/fullscreen/index.js +4 -4
  100. package/fullscreen/vue.js +3 -3
  101. package/grid/core/interceptor.js +4 -7
  102. package/grid/plugins/export.js +2 -2
  103. package/grid/plugins/exportExcel.js +28 -10
  104. package/grid/static/array/findTree.js +1 -1
  105. package/grid/static/base/helperCreateGetObjects.js +1 -1
  106. package/grid/static/base/helperEqualCompare.js +2 -2
  107. package/grid/static/base/helperGetHGSKeys.js +1 -1
  108. package/grid/static/base/uniqueId.js +1 -1
  109. package/grid/static/object/assign.js +3 -3
  110. package/grid/static/string/toString.js +3 -3
  111. package/hrapprover/index.js +118 -0
  112. package/hrapprover/vue.js +102 -0
  113. package/locales/index.js +116 -0
  114. package/locales/vue.js +46 -0
  115. package/logon-user/index.js +23 -0
  116. package/logon-user/vue.js +22 -0
  117. package/logout/index.js +118 -0
  118. package/logout/vue.js +22 -0
  119. package/milestone/index.js +2 -1
  120. package/mini-picker/index.js +1 -1
  121. package/mini-picker/vue.js +1 -1
  122. package/modal/index.js +4 -2
  123. package/month-table/index.js +2 -2
  124. package/nav-menu/index.js +2 -2
  125. package/numeric/index.js +4 -2
  126. package/package.json +33 -136
  127. package/pager-item/vue.js +6 -2
  128. package/picker/index.js +43 -17
  129. package/picker/timezone.js +2 -2
  130. package/picker-column/index.js +7 -3
  131. package/pop-upload/index.js +5 -3
  132. package/popeditor/index.js +15 -7
  133. package/popover/index.js +87 -54
  134. package/popover/vue.js +13 -9
  135. package/rate/index.js +2 -2
  136. package/rich-text/clipboard.js +77 -0
  137. package/rich-text/index.js +176 -0
  138. package/rich-text/module/file-upload.js +118 -0
  139. package/rich-text/module/image-drop.js +54 -0
  140. package/rich-text/module/image-upload.js +84 -0
  141. package/rich-text/options.js +187 -0
  142. package/rich-text/table-module.js +557 -0
  143. package/rich-text/vue.js +149 -0
  144. package/roles/index.js +87 -0
  145. package/roles/vue.js +39 -0
  146. package/search/index.js +32 -27
  147. package/search/vue.js +7 -2
  148. package/select/index.js +328 -304
  149. package/select/vue.js +19 -9
  150. package/select-dropdown/index.js +1 -1
  151. package/slider/index.js +9 -11
  152. package/slider/vue.js +3 -3
  153. package/split/vue.js +1 -1
  154. package/tab-nav/index.js +0 -6
  155. package/tab-nav/vue.js +0 -14
  156. package/table/index.js +1 -1
  157. package/text-popup/index.js +6 -4
  158. package/time/index.js +3 -1
  159. package/time-range/index.js +6 -2
  160. package/time-spinner/index.js +15 -5
  161. package/toggle-menu/index.js +11 -0
  162. package/toggle-menu/vue.js +2 -1
  163. package/tooltip/index.js +46 -35
  164. package/tooltip/vue.js +5 -1
  165. package/tree/index.js +57 -21
  166. package/tree-menu/index.js +3 -1
  167. package/tree-node/index.js +7 -3
  168. package/upload/index.js +14 -5
  169. package/user/index.js +634 -0
  170. package/user/vue.js +113 -0
  171. package/user-account/index.js +23 -0
  172. package/user-account/vue.js +25 -0
  173. package/user-contact/index.js +1 -4
  174. package/user-head/index.js +9 -11
  175. package/user-head/vue.js +2 -6
  176. package/user-link/index.js +43 -0
  177. package/user-link/vue.js +60 -0
@@ -158,8 +158,8 @@ var parseFlags = {
158
158
  }],
159
159
  yy: [twoDigits, function (date, value) {
160
160
  var now = new Date();
161
- var cent = +('' + now.getFullYear()).substr(0, 2);
162
- date.year = '' + (value > 68 ? cent - 1 : cent) + value;
161
+ var cent = Number(String(now.getFullYear()).substr(0, 2));
162
+ date.year = String(value > 68 ? cent - 1 : cent) + value;
163
163
  }],
164
164
  h: [twoDigits, function (date, value) {
165
165
  date.hour = value;
@@ -195,10 +195,10 @@ var parseFlags = {
195
195
  }
196
196
  }],
197
197
  ZZ: ['[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z', function (date, value) {
198
- var parts = (value + '').match(/([+-]|\d\d)/gi);
198
+ var parts = String(value).match(/([+-]|\d\d)/gi);
199
199
  var minutes;
200
200
  if (parts) {
201
- minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
201
+ minutes = Number(parts[1] * 60) + parseInt(parts[2], 10);
202
202
  date.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
203
203
  }
204
204
  }]
@@ -221,7 +221,7 @@ fecha.format = function (dateObj, mask, i18nSettings) {
221
221
  if (!isDate(dateObj) || isNaN(dateObj.getTime())) {
222
222
  throw new Error('Invalid Date in fecha.format');
223
223
  }
224
- mask = fecha.masks[mask] || mask || fecha.masks['default'];
224
+ mask = fecha.masks[mask] || mask || fecha.masks["default"];
225
225
  var literals = [];
226
226
  mask = mask.replace(literal, function ($0, $1) {
227
227
  literals.push($1);
@@ -253,7 +253,7 @@ var getDate = function getDate(dateInfo) {
253
253
  var date;
254
254
  var today = new Date();
255
255
  if (!isNull(dateInfo.timezoneOffset)) {
256
- dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
256
+ dateInfo.minute = Number(dateInfo.minute || 0) - Number(dateInfo.timezoneOffset);
257
257
  var year = dateInfo.year,
258
258
  month = dateInfo.month,
259
259
  day = dateInfo.day,
@@ -52,7 +52,9 @@ export var once = function once(el, event, fn) {
52
52
  on(el, event, listener);
53
53
  };
54
54
  export var hasClass = function hasClass(el, clazz) {
55
- if (!el || !clazz) return false;
55
+ if (!el || !clazz) {
56
+ return false;
57
+ }
56
58
  if (clazz.indexOf(' ') !== -1) {
57
59
  throw new Error('className should not contain space.');
58
60
  }
@@ -102,8 +104,12 @@ export var removeClass = function removeClass(el, clazz) {
102
104
  }
103
105
  };
104
106
  export var getStyle = function getStyle(el, styleName) {
105
- if (isServer) return;
106
- if (!el || !styleName) return null;
107
+ if (isServer) {
108
+ return;
109
+ }
110
+ if (!el || !styleName) {
111
+ return null;
112
+ }
107
113
  styleName = camelCase(styleName);
108
114
  if (styleName === 'float') {
109
115
  styleName = 'cssFloat';
@@ -135,7 +141,9 @@ export var setStyle = function setStyle(el, name, value) {
135
141
  }
136
142
  };
137
143
  export var isScroll = function isScroll(el, vertical) {
138
- if (isServer) return;
144
+ if (isServer) {
145
+ return;
146
+ }
139
147
  var determinedDirection = !isNull(vertical);
140
148
  var overflow;
141
149
  if (determinedDirection) {
@@ -146,7 +154,9 @@ export var isScroll = function isScroll(el, vertical) {
146
154
  return overflow.match(/(scroll|auto)/);
147
155
  };
148
156
  export var getScrollContainer = function getScrollContainer(el, vertical) {
149
- if (isServer) return;
157
+ if (isServer) {
158
+ return;
159
+ }
150
160
  var parent = el;
151
161
  while (parent) {
152
162
  if (~[window, document, document.documentElement].indexOf(parent)) {
@@ -160,7 +170,9 @@ export var getScrollContainer = function getScrollContainer(el, vertical) {
160
170
  return parent;
161
171
  };
162
172
  export var isInContainer = function isInContainer(el, container) {
163
- if (isServer || !el || !container) return false;
173
+ if (isServer || !el || !container) {
174
+ return false;
175
+ }
164
176
  var elRect = el.getBoundingClientRect();
165
177
  var containerRect;
166
178
  if (~[window, document, document.documentElement].indexOf(container) || isNull(container)) {
@@ -0,0 +1,286 @@
1
+ var ws = null;
2
+ var url = 'ws://localhost';
3
+ var ports = [27197, 27198, 27199];
4
+ var index = 0;
5
+ var connected;
6
+ var pollingInterval = 1000;
7
+ var timeout = 30000;
8
+ var cid = 0;
9
+ var callbacks = {};
10
+ var pollingTimer;
11
+ var userStatus = {};
12
+ var heartbeatInterval = 20 * 1000;
13
+ var heartbeatTimer = null;
14
+ var connectTimer = null;
15
+ var apiTimers = {};
16
+ var events = {};
17
+ var out = {};
18
+ var error = function error() {
19
+ return undefined;
20
+ };
21
+ var ready = function ready() {
22
+ return undefined;
23
+ };
24
+ var clearCallback = function clearCallback(cid) {
25
+ clearTimeout(apiTimers[cid]);
26
+ delete callbacks[cid];
27
+ delete apiTimers[cid];
28
+ };
29
+ var onopen = function onopen() {
30
+ connectTimer = setTimeout(function () {
31
+ ws.close();
32
+ }, 5000);
33
+ };
34
+ var send = function send(argv, cb) {
35
+ var id = cid++;
36
+ id = String(id);
37
+ argv.cid = id;
38
+ if (!connected) {
39
+ cb && setTimeout(cb, 0, {
40
+ ok: false,
41
+ message: 'eSpace is not logged in.'
42
+ });
43
+ return;
44
+ }
45
+ if (typeof cb === 'function') {
46
+ callbacks[id] = cb;
47
+ apiTimers[id] = setTimeout(function () {
48
+ cb({
49
+ ok: false,
50
+ message: 'time out'
51
+ });
52
+ clearCallback(id);
53
+ }, timeout);
54
+ }
55
+ ws.send(JSON.stringify(argv));
56
+ };
57
+ var sendHeartbeat = function sendHeartbeat() {
58
+ heartbeatTimer = setTimeout(function () {
59
+ if (connected) {
60
+ send({
61
+ type: 'heartbeat'
62
+ }, function () {
63
+ sendHeartbeat();
64
+ });
65
+ } else {
66
+ clearTimeout(heartbeatTimer);
67
+ }
68
+ }, heartbeatInterval);
69
+ };
70
+ var connectionSucceeded = function connectionSucceeded(data) {
71
+ connected = true;
72
+ sendHeartbeat();
73
+ clearTimeout(pollingTimer);
74
+ clearTimeout(connectTimer);
75
+ ready(data);
76
+ };
77
+ var onmessage = function onmessage(evt) {
78
+ var data = evt.data;
79
+ if (typeof data !== 'string') {
80
+ return;
81
+ }
82
+ data = data.replace(/^\d+/, '');
83
+ if (!data) {
84
+ return;
85
+ }
86
+ try {
87
+ data = JSON.parse(data);
88
+ } catch (e) {
89
+ return !e;
90
+ }
91
+ if (connected) {
92
+ var event = events[data.type];
93
+ if (event) {
94
+ return event(data.data);
95
+ }
96
+ var _cid = data.cid;
97
+ var cb = callbacks[_cid];
98
+ if (cb) {
99
+ if (data.ok) {
100
+ cb(null, data.data);
101
+ } else {
102
+ cb({
103
+ ok: data.ok
104
+ });
105
+ }
106
+ clearCallback(_cid);
107
+ }
108
+ } else {
109
+ if (data.type === 'eSpace-ctrl-connection-success') {
110
+ connectionSucceeded(data.data);
111
+ } else {
112
+ ws.close();
113
+ }
114
+ }
115
+ };
116
+ var bindEvents = function bindEvents() {
117
+ ws.onopen = onopen;
118
+ ws.onclose = onclose;
119
+ ws.onmessage = onmessage;
120
+ };
121
+ var connect = function connect(interval) {
122
+ pollingTimer = setTimeout(function () {
123
+ if (index >= ports.length) {
124
+ index = 0;
125
+ }
126
+ ws = new WebSocket(url + ':' + ports[index++]);
127
+ bindEvents();
128
+ }, interval || 0);
129
+ };
130
+ var onclose = function onclose() {
131
+ if (connected || typeof connected === 'undefined') {
132
+ connected = false;
133
+ error();
134
+ }
135
+ connect(pollingInterval);
136
+ };
137
+ out.init = function (conf) {
138
+ if (conf) {
139
+ timeout = conf.timeout || 30000;
140
+ pollingInterval = conf.pollingInterval || 0;
141
+ }
142
+ connect();
143
+ };
144
+ out.ready = function (cb) {
145
+ ready = cb;
146
+ };
147
+ out.error = function (cb) {
148
+ error = cb;
149
+ };
150
+ var attrToArr = function attrToArr(name, total, object) {
151
+ var result = [];
152
+ for (var i = 0; i < total; i++) {
153
+ var attrName = name;
154
+ if (i) {
155
+ attrName += i;
156
+ }
157
+ var attrVal = object[attrName];
158
+ if (attrVal) {
159
+ result.push(attrVal);
160
+ }
161
+ }
162
+ return result;
163
+ };
164
+ out.on = function (event, hander) {
165
+ events[event] = hander;
166
+ };
167
+ out.getUserInfo = function (account, cb) {
168
+ var fn = function fn(err, data) {
169
+ if (err) {
170
+ return cb(err);
171
+ }
172
+ var formatInfo = function formatInfo(user) {
173
+ return {
174
+ account: user.account,
175
+ name: user.name,
176
+ mobile: attrToArr('mobile', 6, user),
177
+ 'office_phone': attrToArr('office_phone', 6, user),
178
+ 'home_phone': user.home_phone,
179
+ 'ip_phone': user.ip_phone,
180
+ 'other_phone': user.other_phone
181
+ };
182
+ };
183
+ if (data.account) {
184
+ cb(null, formatInfo(data));
185
+ } else {
186
+ var result = {};
187
+ for (var p in data) {
188
+ if (Object.prototype.hasOwnProperty.call(data, p)) {
189
+ var user = data[p];
190
+ result[p] = user ? formatInfo(user) : user;
191
+ }
192
+ }
193
+ cb(null, result);
194
+ }
195
+ };
196
+ send({
197
+ type: 'get-user-info',
198
+ param: account
199
+ }, fn);
200
+ };
201
+ out.subscribeUserStatus = function (accounts, cb) {
202
+ if (Array.isArray(accounts)) {
203
+ accounts.forEach(function (account) {
204
+ userStatus[account] = true;
205
+ });
206
+ }
207
+ send({
208
+ type: 'subscribe-user-status',
209
+ param: accounts
210
+ }, cb);
211
+ };
212
+ out.eSpaceCall = function (account, num, cb) {
213
+ send({
214
+ type: 'espace-call',
215
+ param: {
216
+ account: account,
217
+ number: num
218
+ }
219
+ }, cb);
220
+ };
221
+ out.eSpaceCallByAccount = function (account, cb) {
222
+ send({
223
+ type: 'espace-call',
224
+ param: {
225
+ account: account
226
+ }
227
+ }, cb);
228
+ };
229
+ out.eSpaceCallByNumber = function (number, cb) {
230
+ send({
231
+ type: 'espace-call',
232
+ param: {
233
+ number: number
234
+ }
235
+ }, cb);
236
+ };
237
+ out.showImDialog = function (account, cb) {
238
+ send({
239
+ type: 'show-espace-im-dialog',
240
+ param: account
241
+ }, cb);
242
+ };
243
+ out.showGroupDialog = function (gid, cb) {
244
+ send({
245
+ type: 'show-espace-im-group-dialog',
246
+ param: gid
247
+ }, cb);
248
+ };
249
+ out.addContactList = function (account, cb) {
250
+ send({
251
+ type: 'add-contact-list',
252
+ param: account
253
+ }, cb);
254
+ };
255
+ if (!window.WebSocket) {
256
+ var notFn = function notFn() {
257
+ return undefined;
258
+ };
259
+ for (var api in out) {
260
+ if (Object.prototype.hasOwnProperty.call(out, api)) {
261
+ var fn = out[api];
262
+ if (typeof fn === 'function') {
263
+ out[api] = notFn;
264
+ }
265
+ }
266
+ }
267
+ }
268
+ var initialized = false;
269
+ export function init() {
270
+ if (!initialized) {
271
+ localStorage.setItem('eSpaceCtrl_initialized', 0);
272
+ out.init({
273
+ timeout: 3000,
274
+ pollingInterval: 1000
275
+ });
276
+ out.ready(function () {
277
+ localStorage.setItem('eSpaceCtrl_initialized', 1);
278
+ });
279
+ out.error(function () {
280
+ localStorage.setItem('eSpaceCtrl_initialized', 0);
281
+ });
282
+ initialized = true;
283
+ }
284
+ return out;
285
+ }
286
+ export default out;
@@ -1,4 +1,3 @@
1
- var _this = this;
2
1
  import { extend } from '@opentiny/vue-renderless/common/object';
3
2
  import { on, off } from '@opentiny/vue-renderless/common/deps/dom';
4
3
  import screenfull from '@opentiny/vue-renderless/common/deps/fullscreen/screenfull';
@@ -21,7 +20,7 @@ var setStyle = function setStyle(element, style) {
21
20
  element.style.zIndex = style.zIndex;
22
21
  };
23
22
  var resetElement = function resetElement(api) {
24
- var targetEle = api.targetEle;
23
+ var targetEle = api.targetElement;
25
24
  if (targetEle) {
26
25
  targetEle.classList.remove(api.opts.fullscreenClass);
27
26
  if (api.opts.teleport || api.opts.pageOnly) {
@@ -78,23 +77,24 @@ var api = {
78
77
  targetElement: null,
79
78
  opts: null,
80
79
  isEnabled: screenfull.isEnabled,
81
- isFullScreen: false,
80
+ isFullscreen: false,
82
81
  toggle: function toggle(target, options, force) {
83
82
  if (force === undefined) {
84
- return !_this.isFullScreen ? _this.request(target, options) : _this.exit();
83
+ return !this.isFullscreen ? this.request(target, options) : this.exit();
85
84
  }
86
- return force ? _this.request(target, options) : _this.exit();
85
+ return force ? this.request(target, options) : this.exit();
87
86
  },
88
87
  request: function request(targetEle, options) {
89
- if (_this.isFullScreen) {
88
+ var _this = this;
89
+ if (this.isFullscreen) {
90
90
  return Promise.resolve();
91
91
  }
92
92
  if (!targetEle) {
93
93
  targetEle = document.body;
94
94
  }
95
- _this.opts = getOptions(screenfull, options, targetEle);
96
- setTargetStyle(targetEle, _this.opts);
97
- if (_this.opts.teleport) {
95
+ this.opts = getOptions(screenfull, options, targetEle);
96
+ setTargetStyle(targetEle, this.opts);
97
+ if (this.opts.teleport) {
98
98
  parentNode = targetEle.parentNode;
99
99
  if (parentNode) {
100
100
  token = document.createComment('fullscreen-token');
@@ -102,47 +102,47 @@ var api = {
102
102
  document.body.appendChild(targetEle);
103
103
  }
104
104
  }
105
- if (_this.opts.pageOnly) {
105
+ if (this.opts.pageOnly) {
106
106
  var keypressCallback = function keypressCallback(e) {
107
107
  if (e.key === 'Escape') {
108
108
  off(document, 'keyup', keypressCallback);
109
109
  _this.exit();
110
110
  }
111
111
  };
112
- _this.isFullScreen = true;
113
- _this.targetElement = targetEle;
112
+ this.isFullscreen = true;
113
+ this.targetElement = targetEle;
114
114
  off(document, 'keyup', keypressCallback);
115
115
  on(document, 'keyup', keypressCallback);
116
- if (_this.opts.callback) {
117
- _this.opts.callback(_this.isFullScreen);
116
+ if (this.opts.callback) {
117
+ this.opts.callback(this.isFullscreen);
118
118
  }
119
119
  return Promise.resolve();
120
120
  } else {
121
121
  var fullScreenCallback = function fullScreenCallback() {
122
- if (!screenfull.isFullScreen) {
122
+ if (!screenfull.isFullscreen) {
123
123
  screenfull.off('change', fullScreenCallback);
124
124
  resetElement(_this);
125
125
  }
126
- _this.isFullScreen = screenfull.isFullScreen;
126
+ _this.isFullscreen = screenfull.isFullscreen;
127
127
  _this.targetElement = !_this.opts.teleport ? screenfull.targetElement : targetEle || null;
128
128
  if (_this.opts.callback) {
129
- _this.opts.callback(screenfull.isFullScreen);
129
+ _this.opts.callback(screenfull.isFullscreen);
130
130
  }
131
131
  };
132
132
  screenfull.on('change', fullScreenCallback);
133
- return screenfull.request(_this.opts.teleport ? document.body : targetEle);
133
+ return screenfull.request(this.opts.teleport ? document.body : targetEle);
134
134
  }
135
135
  },
136
136
  exit: function exit() {
137
- if (!this.isFullScreen) {
137
+ if (!this.isFullscreen) {
138
138
  return Promise.resolve();
139
139
  }
140
140
  if (this.opts.pageOnly) {
141
141
  resetElement(this);
142
- this.isFullScreen = false;
142
+ this.isFullscreen = false;
143
143
  this.targetElement = null;
144
144
  if (this.opts.callback) {
145
- this.opts.callback(this.isFullScreen);
145
+ this.opts.callback(this.isFullscreen);
146
146
  }
147
147
  return Promise.resolve();
148
148
  }
@@ -151,7 +151,7 @@ var api = {
151
151
  };
152
152
  api.support = api.isEnabled;
153
153
  api.getState = function () {
154
- return api.isFullScreen;
154
+ return api.isFullscreen;
155
155
  };
156
156
  api.enter = api.request;
157
157
  export default api;
@@ -30,7 +30,7 @@ var Memorize = function () {
30
30
  _createClass(Memorize, [{
31
31
  key: "setKey",
32
32
  value: function setKey(storeKey) {
33
- this._storeKey = this._prefix + (storeKey || +new Date());
33
+ this._storeKey = this._prefix + (storeKey || Number(new Date()));
34
34
  }
35
35
  }, {
36
36
  key: "getValue",
@@ -69,7 +69,7 @@ var Memorize = function () {
69
69
  key: dataKey
70
70
  };
71
71
  newData[this._customField1] = 1;
72
- newData[this._customField2] = +new Date();
72
+ newData[this._customField2] = Number(new Date());
73
73
  if (list.length < this._cacheNum) {
74
74
  list.push(newData);
75
75
  this.setValue(list);
@@ -84,7 +84,7 @@ var Memorize = function () {
84
84
  list.some(function (item) {
85
85
  if (item.key === dataKey) {
86
86
  item[_this._customField1] = (item[_this._customField1] || 0) + 1;
87
- item[_this._customField2] = +new Date();
87
+ item[_this._customField2] = Number(new Date());
88
88
  isChanged = true;
89
89
  return true;
90
90
  }
@@ -0,0 +1,2 @@
1
+ var queue = [];
2
+ export default queue;
@@ -1,10 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
3
3
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  import { on, off } from '@opentiny/vue-renderless/common/deps/dom';
8
+ import PopupManager from '@opentiny/vue-renderless/common/deps/popup-manager';
8
9
  import { typeOf } from '@opentiny/vue-renderless/common/type';
9
10
  import { xss } from '@opentiny/vue-renderless/common/xss.js';
10
11
  var win = window;
@@ -94,9 +95,9 @@ var getBoundingClientRect = function getBoundingClientRect(el) {
94
95
  height: rectObj.bottom - rectTop
95
96
  };
96
97
  };
97
- var isScrollElement = function isScrollElement(parent) {
98
+ var isScrollElement = function isScrollElement(el) {
98
99
  var scrollTypes = ['scroll', 'auto'];
99
- return ~scrollTypes.indexOf(getStyleComputedProperty(parent, 'overflow')) || ~scrollTypes.indexOf(getStyleComputedProperty(parent, 'overflow-x')) || ~scrollTypes.indexOf(getStyleComputedProperty(parent, 'overflow-y'));
100
+ return scrollTypes.includes(getStyleComputedProperty(el, 'overflow')) || scrollTypes.includes(getStyleComputedProperty(el, 'overflow-x')) || scrollTypes.includes(getStyleComputedProperty(el, 'overflow-y'));
100
101
  };
101
102
  export var getScrollParent = function getScrollParent(el) {
102
103
  var parent = el.parentNode;
@@ -293,6 +294,7 @@ Popper.prototype.update = function () {
293
294
  instance: this,
294
295
  styles: {}
295
296
  };
297
+ this.popperOuterSize = null;
296
298
  data.placement = data._originalPlacement = this._options.placement;
297
299
  data.offsets = this._getOffsets(this._popper, this._reference, data.placement);
298
300
  data.boundaries = this._getBoundaries(data, this._options.boundariesPadding, this._options.boundariesElement);
@@ -365,9 +367,9 @@ Popper.prototype._getOffsets = function (popper, reference, placement) {
365
367
  popperOffsets.position = this.state.position;
366
368
  var isParentFixed = popperOffsets.position === 'fixed';
367
369
  var referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
368
- var _getOuterSizes = getOuterSizes(popper),
369
- width = _getOuterSizes.width,
370
- height = _getOuterSizes.height;
370
+ var _ref = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(popper),
371
+ width = _ref.width,
372
+ height = _ref.height;
371
373
  if (~['right', 'left'].indexOf(placement)) {
372
374
  popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - height / 2;
373
375
  if (placement === 'left') {
@@ -399,7 +401,8 @@ Popper.prototype._setupEventListeners = function () {
399
401
  if (target === win.document.body || target === win.document.documentElement) {
400
402
  target = win;
401
403
  }
402
- if (this._options.bubbling) {
404
+ this.state.scrollTarget = target;
405
+ if (this._options.bubbling || PopupManager.globalScroll) {
403
406
  var targets = getAllScrollParents(this._reference);
404
407
  this.state.scrollTargets = targets || [];
405
408
  targets.forEach(function (target) {
@@ -408,7 +411,6 @@ Popper.prototype._setupEventListeners = function () {
408
411
  } else {
409
412
  on(target, 'scroll', this.state.updateBound);
410
413
  }
411
- this.state.scrollTarget = target;
412
414
  }
413
415
  };
414
416
  Popper.prototype._removeEventListeners = function () {
@@ -417,7 +419,7 @@ Popper.prototype._removeEventListeners = function () {
417
419
  if (this._options.boundariesElement !== 'window' && this.state.scrollTarget) {
418
420
  off(this.state.scrollTarget, 'scroll', this.state.updateBound);
419
421
  this.state.scrollTarget = null;
420
- if (this._options.bubbling) {
422
+ if (this._options.bubbling || PopupManager.globalScroll) {
421
423
  var targets = this.state.scrollTargets || [];
422
424
  targets.forEach(function (target) {
423
425
  off(target, 'scroll', _this3.state.updateBound);
@@ -692,7 +694,7 @@ Popper.prototype.modifiers.arrow = function (data) {
692
694
  var opSide = isVertical ? 'bottom' : 'right';
693
695
  var altSide = isVertical ? 'left' : 'top';
694
696
  var side = isVertical ? 'top' : 'left';
695
- var popperRect = getOuterSizes(this._popper);
697
+ var popperRect = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(this._popper);
696
698
  var arrowRect = getOuterSizes(arrow);
697
699
  var arrowSize = arrowRect[len];
698
700
  if (reference[opSide] - arrowSize < popper[side]) {
@@ -20,6 +20,7 @@ var getModal;
20
20
  var PopupManager = {
21
21
  step: 2,
22
22
  zIndex: 2000,
23
+ globalScroll: false,
23
24
  modalFade: true,
24
25
  modalStack: [],
25
26
  deregister: function deregister(id) {
@@ -91,7 +92,9 @@ var PopupManager = {
91
92
  doOnModalClick: function doOnModalClick() {
92
93
  var modalStack = PopupManager.modalStack;
93
94
  var topPopup = modalStack[modalStack.length - 1];
94
- if (!topPopup) return;
95
+ if (!topPopup) {
96
+ return;
97
+ }
95
98
  var instance = PopupManager.getInstance(topPopup.id);
96
99
  if (instance && instance.closeOnClickModal) {
97
100
  typeof instance.close === 'function' && instance.close();
@@ -122,7 +125,9 @@ var PopupManager = {
122
125
  this.modalFade && addClass(modalDom, classes.leave);
123
126
  setTimeout(function () {
124
127
  if (modalStack.length === 0) {
125
- if (modalDom.parentNode) modalDom.parentNode.removeChild(modalDom);
128
+ if (modalDom.parentNode) {
129
+ modalDom.parentNode.removeChild(modalDom);
130
+ }
126
131
  modalDom.style.display = 'none';
127
132
  PopupManager.modalDom = undefined;
128
133
  }
@@ -132,7 +137,9 @@ var PopupManager = {
132
137
  }
133
138
  };
134
139
  getModal = function getModal() {
135
- if (isServer) return;
140
+ if (isServer) {
141
+ return;
142
+ }
136
143
  var modalDom = PopupManager.modalDom;
137
144
  if (modalDom) {
138
145
  hasModal = true;
@@ -153,11 +160,15 @@ getModal = function getModal() {
153
160
  return modalDom;
154
161
  };
155
162
  var getTopPopup = function getTopPopup() {
156
- if (isServer) return;
163
+ if (isServer) {
164
+ return;
165
+ }
157
166
  var modalStack = PopupManager.modalStack;
158
167
  if (modalStack.length > 0) {
159
168
  var topPopup = modalStack[modalStack.length - 1];
160
- if (!topPopup) return;
169
+ if (!topPopup) {
170
+ return;
171
+ }
161
172
  var instance = PopupManager.getInstance(topPopup.id);
162
173
  return instance;
163
174
  }
@@ -12,7 +12,9 @@ var resizeHandler = function resizeHandler(entries) {
12
12
  });
13
13
  };
14
14
  export var addResizeListener = function addResizeListener(el, fn) {
15
- if (isServer) return;
15
+ if (isServer) {
16
+ return;
17
+ }
16
18
  if (!el[cacheKey]) {
17
19
  el[cacheKey] = [];
18
20
  el.__ro__ = new ResizeObserver(resizeHandler);
@@ -21,7 +23,9 @@ export var addResizeListener = function addResizeListener(el, fn) {
21
23
  el[cacheKey].push(fn);
22
24
  };
23
25
  export var removeResizeListener = function removeResizeListener(el, fn) {
24
- if (!el || !el[cacheKey]) return;
26
+ if (!el || !el[cacheKey]) {
27
+ return;
28
+ }
25
29
  el[cacheKey].splice(el[cacheKey].indexOf(fn), 1);
26
30
  if (!el[cacheKey].length) {
27
31
  el.__ro__.disconnect();