eoss-ui 0.5.45 → 0.5.47

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 (127) hide show
  1. package/lib/button.js +137 -144
  2. package/lib/calendar.js +769 -0
  3. package/lib/cascader.js +2 -2
  4. package/lib/checkbox-group.js +4 -2
  5. package/lib/clients.js +2 -2
  6. package/lib/data-table-form.js +36 -13
  7. package/lib/data-table.js +39 -37
  8. package/lib/date-picker.js +2 -2
  9. package/lib/dialog.js +10 -13
  10. package/lib/enterprise.js +2 -2
  11. package/lib/eoss-ui.common.js +1265 -721
  12. package/lib/error-page.js +2 -2
  13. package/lib/flow-group.js +9 -21
  14. package/lib/flow-list.js +2 -2
  15. package/lib/form.js +215 -231
  16. package/lib/handle-user.js +5 -11
  17. package/lib/handler.js +2 -2
  18. package/lib/icons.js +2 -2
  19. package/lib/index.js +1 -1
  20. package/lib/input-number.js +2 -2
  21. package/lib/input.js +2 -2
  22. package/lib/label.js +2 -2
  23. package/lib/menu.js +2 -2
  24. package/lib/nav.js +5 -5
  25. package/lib/notify.js +2 -2
  26. package/lib/page.js +2 -2
  27. package/lib/pagination.js +2 -2
  28. package/lib/player.js +2 -2
  29. package/lib/qr-code.js +2 -2
  30. package/lib/radio-group.js +2 -2
  31. package/lib/retrial-auth.js +2 -2
  32. package/lib/select-ganged.js +2 -2
  33. package/lib/select.js +2 -2
  34. package/lib/selector.js +2 -2
  35. package/lib/sizer.js +9 -9
  36. package/lib/steps.js +2 -2
  37. package/lib/switch.js +2 -2
  38. package/lib/table-form.js +2 -2
  39. package/lib/tabs-panel.js +2 -2
  40. package/lib/tabs.js +2 -2
  41. package/lib/theme-chalk/cascader.css +1 -0
  42. package/lib/theme-chalk/data-table-form.css +1 -1
  43. package/lib/theme-chalk/index.css +1 -1
  44. package/lib/theme-chalk/toolbar.css +1 -1
  45. package/lib/tips.js +2 -2
  46. package/lib/toolbar.js +22 -37
  47. package/lib/tree-group.js +2 -2
  48. package/lib/tree.js +2 -2
  49. package/lib/wujie.js +2 -2
  50. package/lib/wxlogin.js +2 -2
  51. package/package.json +1 -1
  52. package/packages/button/src/main.vue +2 -9
  53. package/packages/calendar/index.js +5 -0
  54. package/packages/calendar/src/main.vue +386 -0
  55. package/packages/data-table/src/main.vue +40 -28
  56. package/packages/data-table-form/src/main.vue +30 -23
  57. package/packages/data-table-form/src/table.vue +16 -3
  58. package/packages/dialog/src/main.vue +5 -9
  59. package/packages/flow-group/src/main.vue +5 -17
  60. package/packages/handle-user/src/main.vue +1 -7
  61. package/packages/nav/src/main.vue +1 -1
  62. package/packages/theme-chalk/gulpfile.js +25 -0
  63. package/packages/theme-chalk/src/cascader.scss +93 -0
  64. package/packages/theme-chalk/src/data-table-form.scss +11 -0
  65. package/packages/theme-chalk/src/index.scss +2 -1
  66. package/packages/theme-chalk/src/toolbar.scss +13 -11
  67. package/packages/toolbar/src/main.vue +39 -52
  68. package/src/index.js +7 -4
  69. package/CHANGELOG.md +0 -929
  70. package/packages/theme-chalk/lib/base.css +0 -1
  71. package/packages/theme-chalk/lib/button-group.css +0 -1
  72. package/packages/theme-chalk/lib/button.css +0 -1
  73. package/packages/theme-chalk/lib/card.css +0 -1
  74. package/packages/theme-chalk/lib/checkbox-group.css +0 -1
  75. package/packages/theme-chalk/lib/clients.css +0 -1
  76. package/packages/theme-chalk/lib/data-table-form.css +0 -1
  77. package/packages/theme-chalk/lib/data-table.css +0 -1
  78. package/packages/theme-chalk/lib/date-picker.css +0 -1
  79. package/packages/theme-chalk/lib/dialog.css +0 -1
  80. package/packages/theme-chalk/lib/enterprise.css +0 -1
  81. package/packages/theme-chalk/lib/error-page.css +0 -1
  82. package/packages/theme-chalk/lib/flow-group.css +0 -1
  83. package/packages/theme-chalk/lib/flow-list.css +0 -1
  84. package/packages/theme-chalk/lib/flow.css +0 -1
  85. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  86. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  87. package/packages/theme-chalk/lib/form.css +0 -1
  88. package/packages/theme-chalk/lib/handle-user.css +0 -1
  89. package/packages/theme-chalk/lib/handler.css +0 -1
  90. package/packages/theme-chalk/lib/icon.css +0 -1
  91. package/packages/theme-chalk/lib/icons.css +0 -1
  92. package/packages/theme-chalk/lib/index.css +0 -1
  93. package/packages/theme-chalk/lib/input-number.css +0 -0
  94. package/packages/theme-chalk/lib/input.css +0 -1
  95. package/packages/theme-chalk/lib/label.css +0 -1
  96. package/packages/theme-chalk/lib/layout.css +0 -1
  97. package/packages/theme-chalk/lib/login.css +0 -1
  98. package/packages/theme-chalk/lib/main.css +0 -1
  99. package/packages/theme-chalk/lib/mainComp.css +0 -0
  100. package/packages/theme-chalk/lib/menu.css +0 -1
  101. package/packages/theme-chalk/lib/nav.css +0 -1
  102. package/packages/theme-chalk/lib/notify.css +0 -0
  103. package/packages/theme-chalk/lib/page.css +0 -1
  104. package/packages/theme-chalk/lib/pagination.css +0 -1
  105. package/packages/theme-chalk/lib/player.css +0 -1
  106. package/packages/theme-chalk/lib/qr-code.css +0 -1
  107. package/packages/theme-chalk/lib/radio-group.css +0 -1
  108. package/packages/theme-chalk/lib/retrial-auth.css +0 -1
  109. package/packages/theme-chalk/lib/select-ganged.css +0 -1
  110. package/packages/theme-chalk/lib/select.css +0 -1
  111. package/packages/theme-chalk/lib/selector-panel.css +0 -1
  112. package/packages/theme-chalk/lib/selector.css +0 -1
  113. package/packages/theme-chalk/lib/sizer.css +0 -1
  114. package/packages/theme-chalk/lib/steps.css +0 -1
  115. package/packages/theme-chalk/lib/switch.css +0 -1
  116. package/packages/theme-chalk/lib/table-form.css +0 -0
  117. package/packages/theme-chalk/lib/tabs-panel.css +0 -0
  118. package/packages/theme-chalk/lib/tabs.css +0 -1
  119. package/packages/theme-chalk/lib/tips.css +0 -1
  120. package/packages/theme-chalk/lib/toolbar.css +0 -1
  121. package/packages/theme-chalk/lib/tree-group.css +0 -1
  122. package/packages/theme-chalk/lib/tree.css +0 -1
  123. package/packages/theme-chalk/lib/upload.css +0 -1
  124. package/packages/theme-chalk/lib/wujie.css +0 -0
  125. package/packages/theme-chalk/lib/wxlogin.css +0 -1
  126. /package/{packages/theme-chalk/lib/cascader.css → lib/theme-chalk/calendar.css} +0 -0
  127. /package/packages/theme-chalk/{lib/flow-chart.css → src/calendar.scss} +0 -0
@@ -0,0 +1,769 @@
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 = 38);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 3:
91
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
+
93
+ "use strict";
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
+ /* globals __VUE_SSR_CONTEXT__ */
96
+
97
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
+ // This module is a runtime utility for cleaner component module output and will
99
+ // be included in the final webpack user bundle.
100
+
101
+ function normalizeComponent(
102
+ scriptExports,
103
+ render,
104
+ staticRenderFns,
105
+ functionalTemplate,
106
+ injectStyles,
107
+ scopeId,
108
+ moduleIdentifier /* server only */,
109
+ shadowMode /* vue-cli only */
110
+ ) {
111
+ // Vue.extend constructor export interop
112
+ var options =
113
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
114
+
115
+ // render functions
116
+ if (render) {
117
+ options.render = render
118
+ options.staticRenderFns = staticRenderFns
119
+ options._compiled = true
120
+ }
121
+
122
+ // functional template
123
+ if (functionalTemplate) {
124
+ options.functional = true
125
+ }
126
+
127
+ // scopedId
128
+ if (scopeId) {
129
+ options._scopeId = 'data-v-' + scopeId
130
+ }
131
+
132
+ var hook
133
+ if (moduleIdentifier) {
134
+ // server build
135
+ hook = function (context) {
136
+ // 2.3 injection
137
+ context =
138
+ context || // cached call
139
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
140
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
+ // 2.2 with runInNewContext: true
142
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
+ context = __VUE_SSR_CONTEXT__
144
+ }
145
+ // inject component styles
146
+ if (injectStyles) {
147
+ injectStyles.call(this, context)
148
+ }
149
+ // register component module identifier for async chunk inferrence
150
+ if (context && context._registeredComponents) {
151
+ context._registeredComponents.add(moduleIdentifier)
152
+ }
153
+ }
154
+ // used by ssr in case component is cached and beforeCreate
155
+ // never gets called
156
+ options._ssrRegister = hook
157
+ } else if (injectStyles) {
158
+ hook = shadowMode
159
+ ? function () {
160
+ injectStyles.call(
161
+ this,
162
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
163
+ )
164
+ }
165
+ : injectStyles
166
+ }
167
+
168
+ if (hook) {
169
+ if (options.functional) {
170
+ // for template-only hot-reload because in that case the render fn doesn't
171
+ // go through the normalizer
172
+ options._injectStyles = hook
173
+ // register for functional component in vue file
174
+ var originalRender = options.render
175
+ options.render = function renderWithStyleInjection(h, context) {
176
+ hook.call(context)
177
+ return originalRender(h, context)
178
+ }
179
+ } else {
180
+ // inject component registration as beforeCreate hook
181
+ var existing = options.beforeCreate
182
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
183
+ }
184
+ }
185
+
186
+ return {
187
+ exports: scriptExports,
188
+ options: options
189
+ }
190
+ }
191
+
192
+
193
+ /***/ }),
194
+
195
+ /***/ 38:
196
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
+
198
+ "use strict";
199
+ // ESM COMPAT FLAG
200
+ __webpack_require__.r(__webpack_exports__);
201
+
202
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/calendar/src/main.vue?vue&type=template&id=9b8c6630&
203
+ var render = function () {
204
+ var _vm = this
205
+ var _h = _vm.$createElement
206
+ var _c = _vm._self._c || _h
207
+ return _c("div", { staticClass: "es-calendar" }, [
208
+ _c(
209
+ "div",
210
+ {
211
+ directives: [
212
+ {
213
+ name: "show",
214
+ rawName: "v-show",
215
+ value: _vm.showTitle,
216
+ expression: "showTitle",
217
+ },
218
+ ],
219
+ staticClass: "es-calendar-title",
220
+ },
221
+ [
222
+ _c("i", {
223
+ staticClass: "es-calendar-prev es-icon-pointer-left",
224
+ on: { click: _vm.prev },
225
+ }),
226
+ _c(
227
+ "div",
228
+ { staticClass: "es-title", on: { click: _vm.resetDate } },
229
+ [
230
+ _vm._t(
231
+ "title",
232
+ [
233
+ _vm._v(
234
+ "\n " +
235
+ _vm._s(_vm.year) +
236
+ "年" +
237
+ _vm._s(_vm.month) +
238
+ "月\n "
239
+ ),
240
+ ],
241
+ { year: _vm.year, month: _vm.month }
242
+ ),
243
+ ],
244
+ 2
245
+ ),
246
+ _c("i", {
247
+ staticClass: "es-calendar-next es-icon-pointer-right",
248
+ on: { click: _vm.next },
249
+ }),
250
+ ]
251
+ ),
252
+ _c(
253
+ "ul",
254
+ { staticClass: "es-calendar-weeks" },
255
+ _vm._l(_vm.weeks, function (item, index) {
256
+ return _c("li", { key: index, staticClass: "es-week" }, [
257
+ _vm._v("\n " + _vm._s(item) + "\n "),
258
+ ])
259
+ }),
260
+ 0
261
+ ),
262
+ _c(
263
+ "ul",
264
+ { staticClass: "es-calendar-days" },
265
+ _vm._l(_vm.lists, function (item, index) {
266
+ return _c(
267
+ "li",
268
+ {
269
+ key: item.year + "-" + item.month + "-" + item.date,
270
+ staticClass: "es-day",
271
+ on: {
272
+ click: function ($event) {
273
+ _vm.handleClick(item)
274
+ },
275
+ },
276
+ },
277
+ [
278
+ _c(
279
+ "div",
280
+ {
281
+ staticClass: "es-day-item",
282
+ class: {
283
+ "es-disabled-day": item.type == 0,
284
+ "es-today": _vm.isSelect(item, _vm.today) && _vm.mark,
285
+ "es-select": _vm.isSelect(item, _vm.select),
286
+ },
287
+ },
288
+ [
289
+ _vm._v("\n " + _vm._s(item.date) + "\n "),
290
+ _vm._t("mark", null, { data: item }),
291
+ ],
292
+ 2
293
+ ),
294
+ ]
295
+ )
296
+ }),
297
+ 0
298
+ ),
299
+ _c(
300
+ "div",
301
+ {
302
+ directives: [
303
+ {
304
+ name: "show",
305
+ rawName: "v-show",
306
+ value: _vm.fold,
307
+ expression: "fold",
308
+ },
309
+ ],
310
+ staticClass: "es-calendar-switch",
311
+ },
312
+ [
313
+ _c("i", {
314
+ directives: [
315
+ {
316
+ name: "show",
317
+ rawName: "v-show",
318
+ value: _vm.all,
319
+ expression: "all",
320
+ },
321
+ ],
322
+ staticClass: "es-icon-pointer-up es-switch-icon",
323
+ attrs: { name: "" },
324
+ on: { click: _vm.handleHide },
325
+ }),
326
+ _c("i", {
327
+ directives: [
328
+ {
329
+ name: "show",
330
+ rawName: "v-show",
331
+ value: !_vm.all,
332
+ expression: "!all",
333
+ },
334
+ ],
335
+ staticClass: "es-icon-pointer-down es-switch-icon",
336
+ on: { click: _vm.handleShow },
337
+ }),
338
+ ]
339
+ ),
340
+ ])
341
+ }
342
+ var staticRenderFns = []
343
+ render._withStripped = true
344
+
345
+
346
+ // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=template&id=9b8c6630&
347
+
348
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/calendar/src/main.vue?vue&type=script&lang=js&
349
+ //
350
+ //
351
+ //
352
+ //
353
+ //
354
+ //
355
+ //
356
+ //
357
+ //
358
+ //
359
+ //
360
+ //
361
+ //
362
+ //
363
+ //
364
+ //
365
+ //
366
+ //
367
+ //
368
+ //
369
+ //
370
+ //
371
+ //
372
+ //
373
+ //
374
+ //
375
+ //
376
+ //
377
+ //
378
+ //
379
+ //
380
+ //
381
+ //
382
+ //
383
+ //
384
+ //
385
+ //
386
+ //
387
+ //
388
+ //
389
+ //
390
+ //
391
+ //
392
+ //
393
+ //
394
+ //
395
+ //
396
+ //
397
+ //
398
+ //
399
+ //
400
+ //
401
+
402
+ /* harmony default export */ var mainvue_type_script_lang_js_ = ({
403
+ name: 'esCalendar',
404
+ props: {
405
+ //显示title
406
+ showTitle: {
407
+ type: Boolean,
408
+ default: true
409
+ },
410
+ //指定日期
411
+ date: [String, Number],
412
+ //是否只显示本周
413
+ brief: Boolean,
414
+ //是否等指定日期传入后再渲染
415
+ wait: Boolean,
416
+ //是否显示收起展开按钮
417
+ fold: {
418
+ type: Boolean,
419
+ default: true
420
+ },
421
+ mark: Boolean
422
+ },
423
+ watch: {
424
+ date: {
425
+ immediate: true,
426
+ handler: function handler(val) {
427
+ if (this.wait) {
428
+ val && this.init();
429
+ } else {
430
+ this.init();
431
+ }
432
+ }
433
+ },
434
+ brief: {
435
+ immediate: true,
436
+ handler: function handler(val) {
437
+ this.all = !val;
438
+ }
439
+ }
440
+ },
441
+ computed: {
442
+ lists: function lists() {
443
+ var _this = this;
444
+
445
+ if (this.all) {
446
+ return this.daysList;
447
+ }
448
+ return this.daysList.filter(function (item) {
449
+ for (var i = 0; i < _this.weekDate.length; i++) {
450
+ var ele = _this.weekDate[i];
451
+ if (item.year == ele.year && item.month == ele.month && item.date == ele.date) {
452
+ return true;
453
+ }
454
+ }
455
+ });
456
+ }
457
+ },
458
+ data: function data() {
459
+ return {
460
+ year: '',
461
+ _month: '',
462
+ weeks: ['日', '一', '二', '三', '四', '五', '六'],
463
+ weekDate: [],
464
+ week7: '',
465
+ today: '',
466
+ select: '',
467
+ selectDate: '',
468
+ daysList: [],
469
+ all: true,
470
+ week: 0,
471
+ prevMonthDays: 0,
472
+ nextMonthDays: 0,
473
+ days: 0
474
+ };
475
+ },
476
+ mounted: function mounted() {},
477
+
478
+ methods: {
479
+ resetDate: function resetDate() {
480
+ this.week = 0;
481
+ this.init();
482
+ },
483
+ init: function init(res) {
484
+ this.daysList = [];
485
+ var dates = this.getDays(res ? res : this.date);
486
+ var year = dates.year,
487
+ month = dates.month,
488
+ today = dates.today,
489
+ daysList = dates.daysList,
490
+ weekDate = dates.weekDate,
491
+ prevMonthDays = dates.prevMonthDays,
492
+ nextMonthDays = dates.nextMonthDays,
493
+ days = dates.days;
494
+
495
+ if (!res) {
496
+ this.today = year + '/' + month + '/' + today;
497
+ this.selectDate = today;
498
+ this.select = year + '/' + month + '/' + today;
499
+ this.$emit('select', { year: year, month: month, date: today, type: 1 });
500
+ }
501
+ this.prevMonthDays = prevMonthDays;
502
+ this.nextMonthDays = nextMonthDays;
503
+ this.days = days;
504
+ this.daysList = daysList;
505
+ this.year = year;
506
+ this.month = month;
507
+ if (!this.weekDate.length) {
508
+ this.weekDate = weekDate;
509
+ }
510
+ this.$emit('init', dates);
511
+ return dates;
512
+ },
513
+ isShow: function isShow(res) {
514
+ if (this.all) {
515
+ return true;
516
+ }
517
+ return this.weekDate.filter(function (item) {
518
+ return item.year == res.year && item.month == res.month && item.date == res.date;
519
+ }).length;
520
+ },
521
+ isSelect: function isSelect(res, target) {
522
+ var year = res.year,
523
+ month = res.month,
524
+ date = res.date;
525
+
526
+ return target == year + '/' + month + '/' + date;
527
+ },
528
+ handleClick: function handleClick(res) {
529
+ var year = res.year,
530
+ month = res.month,
531
+ date = res.date;
532
+
533
+ this.selectDate = date;
534
+ this.select = year + '/' + month + '/' + date;
535
+ this.$emit('select', res);
536
+ },
537
+ prev: function prev() {
538
+ if (this.all) {
539
+ this.weekDate = [];
540
+ this.prevMonth();
541
+ } else {
542
+ this.weekDate = this.getWeekDay(-1);
543
+ this.$emit('prev', this.weekDate, 'week');
544
+ }
545
+ },
546
+ next: function next() {
547
+ if (this.all) {
548
+ this.weekDate = [];
549
+ this.nextMonth();
550
+ } else {
551
+ this.weekDate = this.getWeekDay(1);
552
+ this.$emit('next', this.weekDate, 'week');
553
+ }
554
+ },
555
+ prevMonth: function prevMonth() {
556
+ var year = this.year;
557
+ var month = this.month;
558
+ var dates = this.select.split('/');
559
+ if (month == 1) {
560
+ year -= 1;
561
+ month = 12;
562
+ } else {
563
+ month -= 1;
564
+ }
565
+ var date = year == dates[0] && month == dates[1] ? dates[2] : this.prevMonthDays;
566
+ date = date.toString().padStart(2, '0');
567
+ month = month.toString().padStart(2, '0');
568
+ var res = this.init(year + '/' + month + '/' + date);
569
+ this.$emit('prev', res, 'month');
570
+ },
571
+ nextMonth: function nextMonth() {
572
+ var year = this.year;
573
+ var month = this.month;
574
+ var dates = this.select.split('/');
575
+ if (month == 12) {
576
+ year += 1;
577
+ month = 1;
578
+ } else {
579
+ month += 1;
580
+ }
581
+ var date = year == dates[0] && month == dates[1] ? dates[2] : 1;
582
+ date = date.toString().padStart(2, '0');
583
+ month = month.toString().padStart(2, '0');
584
+ var res = this.init(year + '/' + month + '/' + date);
585
+ this.$emit('next', res, 'month');
586
+ },
587
+
588
+ //获取当月或指定日期所在月天数
589
+ getDays: function getDays(res) {
590
+ var date = res ? new Date(res) : new Date();
591
+ var year = date.getFullYear();
592
+ var month = date.getMonth();
593
+ var today = date.getDate();
594
+ var week = date.getDay();
595
+ //此月天数
596
+ var days = new Date(year, month + 1, 0).getDate();
597
+ //此月第一天周几
598
+ var stratDay = new Date(year, month, 1).getDay();
599
+ //此月最后一天周几
600
+ var endDay = new Date(year, month, days).getDay();
601
+ //上月天数
602
+ var prevMonthDays = month == 0 ? new Date(year - 1, 11, 0).getDate() : new Date(year, month, 0).getDate();
603
+ //下月天数
604
+ var nextMonthDays = month == 11 ? new Date(year + 1, 1, 0).getDate() : new Date(year, month + 2, 0).getDate();
605
+ //当前日期所在的周
606
+ var weekDate = [{ date: today, year: year, month: month + 1 }];
607
+ for (var _i = 0; _i < week; _i++) {
608
+ var d = _i + 1;
609
+ if (today - d > 1) {
610
+ weekDate.unshift({
611
+ date: today - d,
612
+ year: year,
613
+ month: month + 1
614
+ });
615
+ } else {
616
+ weekDate.unshift({
617
+ date: prevMonthDays - _i,
618
+ year: month == 0 ? year - 1 : year,
619
+ month: month == 0 ? 12 : month
620
+ });
621
+ }
622
+ }
623
+ for (var _i2 = 0; _i2 < 6 - week; _i2++) {
624
+ var _d = _i2 + 1;
625
+ if (today + _d <= days) {
626
+ weekDate.unshift({
627
+ date: today + _d,
628
+ year: year,
629
+ month: month + 1
630
+ });
631
+ } else {
632
+ weekDate.push({
633
+ date: today + _d - days,
634
+ year: month == 11 ? year + 1 : year,
635
+ month: month == 11 ? 1 : month + 2
636
+ });
637
+ }
638
+ }
639
+
640
+ var daysList = [];
641
+ //本月前加入数组
642
+ if (stratDay > 0) {
643
+ for (var _i3 = prevMonthDays; _i3 > prevMonthDays - stratDay; _i3--) {
644
+ daysList.unshift({
645
+ date: _i3,
646
+ type: 0,
647
+ year: month == 0 ? year - 1 : year,
648
+ month: month == 0 ? 12 : month
649
+ });
650
+ }
651
+ }
652
+ //本月加入数组
653
+ for (var _i4 = 1; _i4 <= days; _i4++) {
654
+ daysList.push({
655
+ date: _i4,
656
+ type: 1,
657
+ year: year,
658
+ month: month + 1,
659
+ row: week < 6 && today + week > days
660
+ });
661
+ }
662
+ //本月后加入数组
663
+ if (endDay < 6) {
664
+ for (var i = 1; i < 6 - endDay + 1; i++) {
665
+ daysList.push({
666
+ date: i,
667
+ type: 0,
668
+ year: month == 11 ? year + 1 : year,
669
+ month: month == 11 ? 1 : month + 2
670
+ });
671
+ }
672
+ }
673
+ return {
674
+ days: days,
675
+ prevMonthDays: prevMonthDays,
676
+ nextMonthDays: nextMonthDays,
677
+ stratDay: stratDay,
678
+ endDay: endDay,
679
+ weekDate: weekDate,
680
+ year: year,
681
+ month: month + 1,
682
+ today: today,
683
+ week: week,
684
+ daysList: daysList
685
+ };
686
+ },
687
+ getWeekDay: function getWeekDay(val) {
688
+ var _this2 = this;
689
+
690
+ var flag = true;
691
+ var weekDate = JSON.parse(JSON.stringify(this.weekDate));
692
+ var days = weekDate.map(function (item) {
693
+ var date = item.date,
694
+ month = item.month,
695
+ year = item.year;
696
+
697
+ date += val * 7;
698
+ if (date < 1) {
699
+ date += _this2.prevMonthDays;
700
+ month -= 1;
701
+ if (month == 0) {
702
+ month = 12;
703
+ year -= 1;
704
+ }
705
+ } else if (date > _this2.days) {
706
+ date -= _this2.days;
707
+ month += 1;
708
+ if (month > 12) {
709
+ month = 1;
710
+ year += 1;
711
+ }
712
+ }
713
+ if (_this2.month == month) {
714
+ flag = false;
715
+ }
716
+ return { date: date, month: month, year: year };
717
+ });
718
+ if (flag) {
719
+ val == 1 ? this.nextMonth() : this.prevMonth();
720
+ }
721
+ return days;
722
+ },
723
+ handleShow: function handleShow() {
724
+ this.all = true;
725
+ this.$emit('show', true);
726
+ },
727
+ handleHide: function handleHide() {
728
+ this.all = false;
729
+ this.$emit('show', false);
730
+ }
731
+ }
732
+ });
733
+ // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=script&lang=js&
734
+ /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
735
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
736
+ var componentNormalizer = __webpack_require__(3);
737
+
738
+ // CONCATENATED MODULE: ./packages/calendar/src/main.vue
739
+
740
+
741
+
742
+
743
+
744
+ /* normalize component */
745
+
746
+ var component = Object(componentNormalizer["a" /* default */])(
747
+ src_mainvue_type_script_lang_js_,
748
+ render,
749
+ staticRenderFns,
750
+ false,
751
+ null,
752
+ null,
753
+ null
754
+
755
+ )
756
+
757
+ /* harmony default export */ var main = (component.exports);
758
+ // CONCATENATED MODULE: ./packages/calendar/index.js
759
+
760
+
761
+ main.install = function (Vue) {
762
+ return Vue.component(main.name, main);
763
+ };
764
+
765
+ /* harmony default export */ var calendar = __webpack_exports__["default"] = (main);
766
+
767
+ /***/ })
768
+
769
+ /******/ });