eoss 0.1.0-alpha.25 → 0.1.0-alpha.26

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 (254) hide show
  1. package/lib/0.js +1 -1
  2. package/lib/1.js +1 -1
  3. package/lib/10.js +1 -1
  4. package/lib/11.js +1 -1
  5. package/lib/12.js +1 -1
  6. package/lib/13.js +1 -1
  7. package/lib/14.js +1 -1
  8. package/lib/15.js +1 -1
  9. package/lib/16.js +1 -1
  10. package/lib/17.js +1 -1
  11. package/lib/18.js +1 -1
  12. package/lib/19.js +1 -1
  13. package/lib/20.js +1 -1
  14. package/lib/21.js +1 -1
  15. package/lib/22.js +1 -1
  16. package/lib/23.js +1 -1
  17. package/lib/24.js +1 -1
  18. package/lib/25.js +1 -1
  19. package/lib/26.js +1 -1
  20. package/lib/27.js +1 -1
  21. package/lib/28.js +1 -1
  22. package/lib/29.js +1 -1
  23. package/lib/3.js +1 -1
  24. package/lib/30.js +1 -1
  25. package/lib/31.js +1 -1
  26. package/lib/32.js +1 -1
  27. package/lib/33.js +1 -1
  28. package/lib/34.js +1 -1
  29. package/lib/35.js +1 -1
  30. package/lib/36.js +1 -1
  31. package/lib/37.js +1 -1
  32. package/lib/38.js +1 -1
  33. package/lib/39.js +1 -1
  34. package/lib/4.js +1 -1
  35. package/lib/40.js +1 -1
  36. package/lib/41.js +1 -1
  37. package/lib/42.js +1 -1
  38. package/lib/43.js +1 -1
  39. package/lib/44.js +1 -1
  40. package/lib/45.js +1 -1
  41. package/lib/46.js +1 -1
  42. package/lib/47.js +1 -1
  43. package/lib/48.js +1 -1
  44. package/lib/49.js +1 -1
  45. package/lib/5.js +1 -1
  46. package/lib/50.js +1 -1
  47. package/lib/51.js +1 -1
  48. package/lib/52.js +1 -1
  49. package/lib/53.js +1 -1
  50. package/lib/54.js +1 -1
  51. package/lib/55.js +1 -1
  52. package/lib/56.js +1 -1
  53. package/lib/57.js +1 -1
  54. package/lib/58.js +1 -1
  55. package/lib/59.js +1 -1
  56. package/lib/6.js +1 -1
  57. package/lib/60.js +1 -1
  58. package/lib/61.js +1 -1
  59. package/lib/62.js +1 -1
  60. package/lib/63.js +1 -1
  61. package/lib/64.js +1 -1
  62. package/lib/65.js +1 -1
  63. package/lib/66.js +1 -1
  64. package/lib/67.js +1 -1
  65. package/lib/68.js +1 -1
  66. package/lib/69.js +1 -1
  67. package/lib/7.js +1 -1
  68. package/lib/70.js +1 -1
  69. package/lib/71.js +1 -1
  70. package/lib/72.js +1 -1
  71. package/lib/73.js +1 -1
  72. package/lib/74.js +1 -1
  73. package/lib/75.js +1 -1
  74. package/lib/76.js +1 -1
  75. package/lib/77.js +1 -1
  76. package/lib/78.js +1 -1
  77. package/lib/79.js +1 -1
  78. package/lib/8.js +1 -1
  79. package/lib/80.js +1 -1
  80. package/lib/81.js +1 -1
  81. package/lib/9.js +1 -1
  82. package/lib/account-login.js +1000 -971
  83. package/lib/alert.js +2 -2
  84. package/lib/aside.js +2 -2
  85. package/lib/audit-trajectory.js +75 -71
  86. package/lib/autocomplete.js +2136 -1951
  87. package/lib/avatar.js +2 -2
  88. package/lib/backtop.js +2 -2
  89. package/lib/badge.js +2 -2
  90. package/lib/breadcrumb-item.js +4 -4
  91. package/lib/breadcrumb.js +4 -4
  92. package/lib/button-group.js +12 -12
  93. package/lib/button.js +2 -2
  94. package/lib/ca-login.js +913 -888
  95. package/lib/calendar.js +872 -847
  96. package/lib/card.js +2 -2
  97. package/lib/carousel-item.js +905 -880
  98. package/lib/carousel.js +1042 -1017
  99. package/lib/cascader-panel.js +926 -901
  100. package/lib/cascader.js +2022 -1837
  101. package/lib/checkbox-button.js +2 -2
  102. package/lib/checkbox-group.js +1000 -971
  103. package/lib/checkbox.js +2 -2
  104. package/lib/col.js +2 -2
  105. package/lib/collapse-item.js +2174 -1980
  106. package/lib/collapse.js +2175 -1980
  107. package/lib/color-picker.js +1112 -952
  108. package/lib/config/api.js +3 -0
  109. package/lib/container.js +2 -2
  110. package/lib/cron.js +2 -2
  111. package/lib/data-table.js +1007 -978
  112. package/lib/date-picker.js +2142 -1957
  113. package/lib/dialog.js +910 -885
  114. package/lib/divider.js +2 -2
  115. package/lib/drawer.js +2 -2
  116. package/lib/dropdown-item.js +4 -4
  117. package/lib/dropdown-menu.js +1104 -944
  118. package/lib/dropdown.js +925 -900
  119. package/lib/email-login.js +999 -970
  120. package/lib/empty.js +2 -2
  121. package/lib/eoss.common.js +8751 -4166
  122. package/lib/flip.js +2 -2
  123. package/lib/flow-group.js +906 -881
  124. package/lib/flow.js +1112 -1083
  125. package/lib/flows.js +1010 -981
  126. package/lib/footer.js +2 -2
  127. package/lib/form-item.js +909 -884
  128. package/lib/form.js +2185 -1986
  129. package/lib/guide.js +620 -0
  130. package/lib/header.js +2 -2
  131. package/lib/icon.js +981 -952
  132. package/lib/icons.js +2 -2
  133. package/lib/image-viewer.js +907 -882
  134. package/lib/image.js +4 -4
  135. package/lib/index.js +1 -1
  136. package/lib/infinite-scroll.js +2 -2
  137. package/lib/input-number.js +4 -4
  138. package/lib/input.js +910 -885
  139. package/lib/link.js +2 -2
  140. package/lib/loading.js +2 -2
  141. package/lib/login.js +1027 -998
  142. package/lib/lowcode.js +17336 -13510
  143. package/lib/main.js +14933 -14625
  144. package/lib/marquee.js +907 -882
  145. package/lib/menu-item-group.js +2 -2
  146. package/lib/menu-item.js +2 -2
  147. package/lib/menu.js +2011 -1826
  148. package/lib/message-box.js +923 -898
  149. package/lib/message.js +911 -886
  150. package/lib/notification.js +911 -886
  151. package/lib/option-group.js +2 -2
  152. package/lib/option.js +907 -882
  153. package/lib/page-header.js +2 -2
  154. package/lib/pagination.js +910 -885
  155. package/lib/phone-login.js +998 -969
  156. package/lib/popconfirm.js +12 -12
  157. package/lib/popover.js +2009 -1824
  158. package/lib/process-config.js +1015 -986
  159. package/lib/process-module.js +1001 -972
  160. package/lib/process-rule.js +1019 -990
  161. package/lib/progress.js +5 -5
  162. package/lib/qr-code.js +4 -4
  163. package/lib/qrcode-login.js +1057 -1028
  164. package/lib/radio-button.js +2 -2
  165. package/lib/radio-group.js +998 -969
  166. package/lib/radio.js +2 -2
  167. package/lib/rate.js +907 -882
  168. package/lib/row.js +2 -2
  169. package/lib/scrollbar.js +904 -879
  170. package/lib/select.js +2135 -1945
  171. package/lib/selector-panel.js +1009 -980
  172. package/lib/selector.js +1001 -972
  173. package/lib/slider.js +2 -2
  174. package/lib/step.js +2172 -1977
  175. package/lib/steps.js +907 -882
  176. package/lib/submenu.js +1119 -959
  177. package/lib/switch.js +907 -882
  178. package/lib/tab-pane.js +2 -2
  179. package/lib/table-column.js +906 -881
  180. package/lib/table.js +2236 -2047
  181. package/lib/tabs.js +911 -886
  182. package/lib/tag.js +2 -2
  183. package/lib/theme-chalk/base.css +1 -1
  184. package/lib/theme-chalk/guide.css +1 -0
  185. package/lib/theme-chalk/icon.css +1 -1
  186. package/lib/theme-chalk/index.css +1 -1
  187. package/lib/theme-chalk/lowcode-view.css +1 -0
  188. package/lib/theme-chalk/lowcode.css +1 -1
  189. package/lib/theme-chalk/main.css +1 -1
  190. package/lib/theme-chalk/pagination.css +1 -1
  191. package/lib/theme-chalk/select-dropdown.css +1 -1
  192. package/lib/theme-chalk/select.css +1 -1
  193. package/lib/theme-chalk/wujie.css +1 -0
  194. package/lib/time-picker.js +1977 -1792
  195. package/lib/time-select.js +1978 -1793
  196. package/lib/timeline-item.js +2 -2
  197. package/lib/timeline.js +2 -2
  198. package/lib/tips.js +998 -969
  199. package/lib/toolbar.js +2 -2
  200. package/lib/tooltip.js +2006 -1821
  201. package/lib/transfer.js +916 -891
  202. package/lib/tree-group.js +978 -949
  203. package/lib/tree.js +999 -970
  204. package/lib/update-history.js +76 -72
  205. package/lib/upload.js +1028 -999
  206. package/lib/utils/frame.js +133 -0
  207. package/lib/wujie.js +5037 -0
  208. package/package.json +3 -2
  209. package/packages/cascader/src/cascader.vue +1 -1
  210. package/packages/date-picker/src/picker.vue +1 -1
  211. package/packages/form/src/form-item-render.vue +10 -6
  212. package/packages/guide/index.js +8 -0
  213. package/packages/guide/src/directive.js +47 -0
  214. package/packages/guide/src/guide.vue +89 -0
  215. package/packages/guide/src/manager.js +133 -0
  216. package/packages/input/src/input.vue +1 -1
  217. package/packages/lowcode/src/aside.vue +41 -8
  218. package/packages/lowcode/src/attribute/bind.vue +2 -4
  219. package/packages/lowcode/src/attribute/dependency.vue +3 -16
  220. package/packages/lowcode/src/attribute/function.vue +2 -4
  221. package/packages/lowcode/src/attribute/property.vue +3 -15
  222. package/packages/lowcode/src/attribute/styles.vue +105 -11
  223. package/packages/lowcode/src/attribute.vue +5 -35
  224. package/packages/lowcode/src/canvas.vue +223 -97
  225. package/packages/lowcode/src/iframe.vue +60 -0
  226. package/packages/lowcode/src/lowcode.vue +32 -8
  227. package/packages/lowcode/src/pages.vue +1 -1
  228. package/packages/lowcode/src/render.vue +312 -70
  229. package/packages/lowcode/src/util/source-generator.js +7 -11
  230. package/packages/lowcode/src/util/source-parser.js +1 -1
  231. package/packages/lowcode-view/index.js +1 -1
  232. package/packages/lowcode-view/src/Iframe.vue +55 -0
  233. package/packages/lowcode-view/src/Modulels.vue +239 -0
  234. package/packages/lowcode-view/src/render.vue +337 -0
  235. package/packages/lowcode-view/src/view.vue +763 -0
  236. package/packages/main/src/components/pages.vue +11 -2
  237. package/packages/main/src/event-center.js +160 -0
  238. package/packages/main/src/minxs.js +60 -90
  239. package/packages/progress/src/progress.vue +1 -1
  240. package/packages/select/src/select.vue +2 -1
  241. package/packages/theme-chalk/src/common/var.scss +34 -10
  242. package/packages/theme-chalk/src/guide.scss +93 -0
  243. package/packages/theme-chalk/src/icon.scss +425 -426
  244. package/packages/theme-chalk/src/index.scss +2 -0
  245. package/packages/theme-chalk/src/lowcode-view.scss +288 -0
  246. package/packages/theme-chalk/src/lowcode.scss +11 -1
  247. package/packages/theme-chalk/src/select-dropdown.scss +1 -1
  248. package/packages/theme-chalk/src/wujie.scss +5 -0
  249. package/packages/wujie/index.js +10 -0
  250. package/packages/wujie/src/wujie.vue +205 -0
  251. package/src/config/api.js +3 -0
  252. package/src/index.js +325 -319
  253. package/src/utils/frame.js +102 -0
  254. package/packages/lowcode/src/view.vue +0 -187
package/lib/guide.js ADDED
@@ -0,0 +1,620 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "/dist/";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 141);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 141:
91
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
+
93
+ "use strict";
94
+ __webpack_require__.r(__webpack_exports__);
95
+ /* harmony import */ var _src_directive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(95);
96
+
97
+
98
+ /* harmony default export */ __webpack_exports__["default"] = ({
99
+ install: function install(Vue) {
100
+ Vue.use(_src_directive__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
101
+ },
102
+
103
+ directive: _src_directive__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]
104
+ });
105
+
106
+ /***/ }),
107
+
108
+ /***/ 27:
109
+ /***/ (function(module, exports) {
110
+
111
+ module.exports = require("eoss/lib/button");
112
+
113
+ /***/ }),
114
+
115
+ /***/ 3:
116
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
117
+
118
+ "use strict";
119
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
120
+ /* globals __VUE_SSR_CONTEXT__ */
121
+
122
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
123
+ // This module is a runtime utility for cleaner component module output and will
124
+ // be included in the final webpack user bundle.
125
+
126
+ function normalizeComponent(
127
+ scriptExports,
128
+ render,
129
+ staticRenderFns,
130
+ functionalTemplate,
131
+ injectStyles,
132
+ scopeId,
133
+ moduleIdentifier /* server only */,
134
+ shadowMode /* vue-cli only */
135
+ ) {
136
+ // Vue.extend constructor export interop
137
+ var options =
138
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
139
+
140
+ // render functions
141
+ if (render) {
142
+ options.render = render
143
+ options.staticRenderFns = staticRenderFns
144
+ options._compiled = true
145
+ }
146
+
147
+ // functional template
148
+ if (functionalTemplate) {
149
+ options.functional = true
150
+ }
151
+
152
+ // scopedId
153
+ if (scopeId) {
154
+ options._scopeId = 'data-v-' + scopeId
155
+ }
156
+
157
+ var hook
158
+ if (moduleIdentifier) {
159
+ // server build
160
+ hook = function (context) {
161
+ // 2.3 injection
162
+ context =
163
+ context || // cached call
164
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
165
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
166
+ // 2.2 with runInNewContext: true
167
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
168
+ context = __VUE_SSR_CONTEXT__
169
+ }
170
+ // inject component styles
171
+ if (injectStyles) {
172
+ injectStyles.call(this, context)
173
+ }
174
+ // register component module identifier for async chunk inferrence
175
+ if (context && context._registeredComponents) {
176
+ context._registeredComponents.add(moduleIdentifier)
177
+ }
178
+ }
179
+ // used by ssr in case component is cached and beforeCreate
180
+ // never gets called
181
+ options._ssrRegister = hook
182
+ } else if (injectStyles) {
183
+ hook = shadowMode
184
+ ? function () {
185
+ injectStyles.call(
186
+ this,
187
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
188
+ )
189
+ }
190
+ : injectStyles
191
+ }
192
+
193
+ if (hook) {
194
+ if (options.functional) {
195
+ // for template-only hot-reload because in that case the render fn doesn't
196
+ // go through the normalizer
197
+ options._injectStyles = hook
198
+ // register for functional component in vue file
199
+ var originalRender = options.render
200
+ options.render = function renderWithStyleInjection(h, context) {
201
+ hook.call(context)
202
+ return originalRender(h, context)
203
+ }
204
+ } else {
205
+ // inject component registration as beforeCreate hook
206
+ var existing = options.beforeCreate
207
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
208
+ }
209
+ }
210
+
211
+ return {
212
+ exports: scriptExports,
213
+ options: options
214
+ }
215
+ }
216
+
217
+
218
+ /***/ }),
219
+
220
+ /***/ 4:
221
+ /***/ (function(module, exports) {
222
+
223
+ module.exports = require("vue");
224
+
225
+ /***/ }),
226
+
227
+ /***/ 95:
228
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
229
+
230
+ "use strict";
231
+
232
+ // EXPORTS
233
+ __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ directive_guide; });
234
+
235
+ // EXTERNAL MODULE: external "vue"
236
+ var external_vue_ = __webpack_require__(4);
237
+ var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
238
+
239
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/guide/src/guide.vue?vue&type=template&id=d5e853c8&
240
+ var render = function () {
241
+ var _vm = this
242
+ var _h = _vm.$createElement
243
+ var _c = _vm._self._c || _h
244
+ return _c(
245
+ "transition",
246
+ {
247
+ attrs: { name: "es-guide-fade" },
248
+ on: { "after-leave": _vm.handleAfterLeave },
249
+ },
250
+ [
251
+ _vm.visible
252
+ ? _c(
253
+ "div",
254
+ {
255
+ staticClass: "es-guide",
256
+ class: _vm.customClass,
257
+ style: { "--guide-mask": _vm.maskColor },
258
+ },
259
+ [
260
+ _c("div", {
261
+ staticClass: "es-guide__spot",
262
+ style: _vm.spotStyle,
263
+ }),
264
+ _c(
265
+ "div",
266
+ {
267
+ staticClass: "es-guide__tooltip",
268
+ class: "is-" + _vm.placement,
269
+ style: _vm.tipStyle,
270
+ },
271
+ [
272
+ _vm.text
273
+ ? _c("p", { staticClass: "es-guide__text" }, [
274
+ _vm._v(_vm._s(_vm.text)),
275
+ ])
276
+ : _vm._e(),
277
+ _vm.showButton
278
+ ? _c(
279
+ "es-button",
280
+ {
281
+ attrs: { type: "primary", size: "small" },
282
+ on: { click: _vm.close },
283
+ },
284
+ [
285
+ _vm._v(
286
+ "\n " + _vm._s(_vm.buttonText) + "\n "
287
+ ),
288
+ ]
289
+ )
290
+ : _vm._e(),
291
+ ],
292
+ 1
293
+ ),
294
+ ]
295
+ )
296
+ : _vm._e(),
297
+ ]
298
+ )
299
+ }
300
+ var staticRenderFns = []
301
+ render._withStripped = true
302
+
303
+
304
+ // CONCATENATED MODULE: ./packages/guide/src/guide.vue?vue&type=template&id=d5e853c8&
305
+
306
+ // EXTERNAL MODULE: external "eoss/lib/button"
307
+ var button_ = __webpack_require__(27);
308
+ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
309
+
310
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/guide/src/guide.vue?vue&type=script&lang=js&
311
+ //
312
+ //
313
+ //
314
+ //
315
+ //
316
+ //
317
+ //
318
+ //
319
+ //
320
+ //
321
+ //
322
+ //
323
+ //
324
+ //
325
+ //
326
+ //
327
+ //
328
+ //
329
+ //
330
+ //
331
+ //
332
+ //
333
+ //
334
+
335
+
336
+ /* harmony default export */ var guidevue_type_script_lang_js_ = ({
337
+ name: 'EsGuide',
338
+ components: {
339
+ EsButton: button_default.a
340
+ },
341
+
342
+ data: function data() {
343
+ return {
344
+ visible: false,
345
+ text: '',
346
+ buttonText: '知道了',
347
+ showButton: true,
348
+ duration: 3,
349
+ placement: 'bottom',
350
+ customClass: '',
351
+ maskColor: 'rgba(0, 0, 0, 0.45)',
352
+ spotStyle: {},
353
+ tipStyle: {},
354
+ onClose: null,
355
+ onAfterLeave: null,
356
+ timer: null
357
+ };
358
+ },
359
+
360
+
361
+ watch: {
362
+ visible: function visible(val) {
363
+ // 无按钮时按 duration 自动消失
364
+ if (val && !this.showButton) {
365
+ this.startTimer();
366
+ } else {
367
+ this.clearTimer();
368
+ }
369
+ }
370
+ },
371
+
372
+ methods: {
373
+ startTimer: function startTimer() {
374
+ var _this = this;
375
+
376
+ this.clearTimer();
377
+ var sec = Number(this.duration) || 0;
378
+ if (sec > 0) {
379
+ this.timer = setTimeout(function () {
380
+ return _this.close();
381
+ }, sec * 1000);
382
+ }
383
+ },
384
+ clearTimer: function clearTimer() {
385
+ if (this.timer) {
386
+ clearTimeout(this.timer);
387
+ this.timer = null;
388
+ }
389
+ },
390
+ close: function close() {
391
+ this.clearTimer();
392
+ this.visible = false;
393
+ if (typeof this.onClose === 'function') this.onClose();
394
+ },
395
+ handleAfterLeave: function handleAfterLeave() {
396
+ if (typeof this.onAfterLeave === 'function') this.onAfterLeave();
397
+ }
398
+ },
399
+
400
+ beforeDestroy: function beforeDestroy() {
401
+ this.clearTimer();
402
+ }
403
+ });
404
+ // CONCATENATED MODULE: ./packages/guide/src/guide.vue?vue&type=script&lang=js&
405
+ /* harmony default export */ var src_guidevue_type_script_lang_js_ = (guidevue_type_script_lang_js_);
406
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
407
+ var componentNormalizer = __webpack_require__(3);
408
+
409
+ // CONCATENATED MODULE: ./packages/guide/src/guide.vue
410
+
411
+
412
+
413
+
414
+
415
+ /* normalize component */
416
+
417
+ var component = Object(componentNormalizer["a" /* default */])(
418
+ src_guidevue_type_script_lang_js_,
419
+ render,
420
+ staticRenderFns,
421
+ false,
422
+ null,
423
+ null,
424
+ null
425
+
426
+ )
427
+
428
+ /* harmony default export */ var guide = (component.exports);
429
+ // CONCATENATED MODULE: ./packages/guide/src/manager.js
430
+
431
+
432
+
433
+ var GuideCtor = external_vue_default.a.extend(guide);
434
+
435
+ var instance = null;
436
+ var queue = [];
437
+ var currentEl = null;
438
+
439
+ function getInstance() {
440
+ if (!instance) {
441
+ instance = new GuideCtor({ el: document.createElement('div') });
442
+ document.body.appendChild(instance.$el);
443
+ // capture 以捕获任意嵌套滚动容器的 scroll,实时重算位置
444
+ window.addEventListener('scroll', onScroll, true);
445
+ window.addEventListener('resize', onScroll);
446
+ }
447
+ return instance;
448
+ }
449
+
450
+ function onScroll() {
451
+ if (currentEl && instance && instance.visible) {
452
+ position(currentEl, instance);
453
+ }
454
+ }
455
+
456
+ // fixed 定位使用视口坐标
457
+ function position(el, inst) {
458
+ var rect = el.getBoundingClientRect();
459
+ var pad = 4;
460
+ var gap = 12;
461
+
462
+ inst.spotStyle = {
463
+ top: rect.top - pad + 'px',
464
+ left: rect.left - pad + 'px',
465
+ width: rect.width + pad * 2 + 'px',
466
+ height: rect.height + pad * 2 + 'px'
467
+ };
468
+
469
+ var tip = {};
470
+ switch (inst.placement) {
471
+ case 'top':
472
+ tip = { top: rect.top - gap + 'px', left: rect.left + 'px', transform: 'translateY(-100%)' };
473
+ break;
474
+ case 'left':
475
+ tip = { top: rect.top + 'px', left: rect.left - gap + 'px', transform: 'translateX(-100%)' };
476
+ break;
477
+ case 'right':
478
+ tip = { top: rect.top + 'px', left: rect.right + gap + 'px' };
479
+ break;
480
+ default:
481
+ tip = { top: rect.bottom + gap + 'px', left: rect.left + 'px' };
482
+ }
483
+ inst.tipStyle = tip;
484
+ }
485
+
486
+ function applyConfig(cfg) {
487
+ var inst = getInstance();
488
+ // 清除上一个的兜底定时器
489
+ clearTimeout(inst._advanceTimer);
490
+ inst.text = cfg.text || '';
491
+ inst.showButton = cfg.showButton !== false;
492
+ inst.buttonText = cfg.buttonText || '知道了';
493
+ inst.duration = cfg.duration != null ? cfg.duration : 3;
494
+ inst.placement = cfg.placement || 'bottom';
495
+ inst.customClass = cfg.customClass || '';
496
+ inst.maskColor = cfg.maskColor || 'rgba(0, 0, 0, 0.45)';
497
+ inst.onClose = function () {
498
+ if (typeof cfg.onClose === 'function') cfg.onClose();
499
+ // 用户点击按钮后,启动兜底定时器
500
+ inst._advanceTimer = setTimeout(function () {
501
+ if (!advanced) {
502
+ advanced = true;
503
+ next();
504
+ }
505
+ }, 350);
506
+ };
507
+ var advanced = false;
508
+ inst.onAfterLeave = function () {
509
+ if (advanced) return;
510
+ advanced = true;
511
+ clearTimeout(inst._advanceTimer);
512
+ next();
513
+ };
514
+ position(cfg.el, inst);
515
+ inst.visible = true;
516
+ }
517
+
518
+ function next() {
519
+ currentEl = null;
520
+ if (queue.length > 0) {
521
+ var cfg = queue.shift();
522
+ currentEl = cfg.el;
523
+ external_vue_default.a.nextTick(function () {
524
+ return applyConfig(cfg);
525
+ });
526
+ } else {
527
+ if (instance) {
528
+ clearTimeout(instance._advanceTimer);
529
+ instance.visible = false;
530
+ }
531
+ }
532
+ }
533
+
534
+ var Manager = {
535
+ show: function show(cfg) {
536
+ if (!cfg || !cfg.el) return;
537
+ if (currentEl) {
538
+ // 已有引导在展示,加入队列
539
+ queue.push(cfg);
540
+ } else {
541
+ currentEl = cfg.el;
542
+ external_vue_default.a.nextTick(function () {
543
+ return applyConfig(cfg);
544
+ });
545
+ }
546
+ },
547
+ hide: function hide(el) {
548
+ // 只从队列移除,不主动推进;由 onAfterLeave 统一处理
549
+ queue = queue.filter(function (c) {
550
+ return c.el !== el;
551
+ });
552
+ },
553
+ destroy: function destroy() {
554
+ queue = [];
555
+ currentEl = null;
556
+ if (instance) {
557
+ instance.$destroy();
558
+ if (instance.$el && instance.$el.parentNode) {
559
+ instance.$el.parentNode.removeChild(instance.$el);
560
+ }
561
+ instance = null;
562
+ }
563
+ }
564
+ };
565
+
566
+ /* harmony default export */ var manager = (Manager);
567
+ // CONCATENATED MODULE: ./packages/guide/src/directive.js
568
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
569
+
570
+ 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; };
571
+
572
+
573
+
574
+
575
+ // 兼容 value 为布尔或对象两种写法
576
+ function getConfig(binding) {
577
+ var v = binding.value;
578
+ if (v === true) return { show: true };
579
+ if (v && (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object') return v;
580
+ return { show: !!v };
581
+ }
582
+
583
+ var directive_guide = {
584
+ bind: function bind(el, binding) {
585
+ var cfg = getConfig(binding);
586
+ el._guideCfg = cfg;
587
+ if (cfg.show) {
588
+ external_vue_default.a.nextTick(function () {
589
+ manager.show(_extends({}, cfg, { el: el }));
590
+ });
591
+ }
592
+ },
593
+ update: function update(el, binding) {
594
+ if (binding.oldValue === binding.value) return;
595
+ var cfg = getConfig(binding);
596
+ el._guideCfg = cfg;
597
+ if (cfg.show) {
598
+ manager.show(_extends({}, cfg, { el: el }));
599
+ } else {
600
+ manager.hide(el);
601
+ }
602
+ },
603
+ unbind: function unbind(el) {
604
+ manager.hide(el);
605
+ }
606
+ };
607
+
608
+ var guideDirective = {
609
+ install: function install(Vue) {
610
+ if (Vue.prototype.$isServer) return;
611
+ Vue.directive('guide', directive_guide);
612
+ }
613
+ };
614
+
615
+
616
+ /* harmony default export */ var directive = __webpack_exports__["a"] = (guideDirective);
617
+
618
+ /***/ })
619
+
620
+ /******/ });
package/lib/header.js CHANGED
@@ -82,12 +82,12 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 214);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 219);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
89
89
 
90
- /***/ 214:
90
+ /***/ 219:
91
91
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
92
 
93
93
  "use strict";