evui 2.0.8 → 2.1.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.
Files changed (193) hide show
  1. package/dist/{adac9fa4f723f9d2cb5b6640517114a9.png → 0b8d1200e71cae8d747dce4e69c4efb6.png} +0 -0
  2. package/dist/1.css +4 -0
  3. package/dist/1.css.map +1 -0
  4. package/dist/1.evui.min.js +2 -0
  5. package/dist/1.evui.min.js.map +1 -0
  6. package/dist/1ba679c05036b34bf359aa2e6c450faa.ttf +0 -0
  7. package/dist/2.css +4 -0
  8. package/dist/2.css.map +1 -0
  9. package/dist/2.evui.min.js +2 -0
  10. package/dist/2.evui.min.js.map +1 -0
  11. package/dist/{e8c322de9658cbeb8a774b6624167c2c.woff2 → 278156e41e0ad908cf7f841b17130502.woff2} +0 -0
  12. package/dist/3.evui.min.js +2 -0
  13. package/dist/3.evui.min.js.map +1 -0
  14. package/dist/32be89b11725274cd3e801192ba88361.ttf +0 -0
  15. package/dist/{0ab54153eeeca0ce03978cc463b257f7.woff2 → 38c6d8bab26db77d8c806813e1497763.woff2} +0 -0
  16. package/dist/4.evui.min.js +2 -0
  17. package/dist/4.evui.min.js.map +1 -0
  18. package/dist/{faff92145777a3cbaf8e7367b4807987.woff → 425399f81e4ce7cbd967685402ba0260.woff} +0 -0
  19. package/dist/4730076470a665bbc7b783c56d29a72e.svg +261 -0
  20. package/dist/52e9a7f6ff3af5ad261e5292d07ebdca.eot +0 -0
  21. package/dist/{ad97afd3337e8cda302d10ff5a4026b8.ttf → 5367103510b27b78482794590e1ce3b0.ttf} +0 -0
  22. package/dist/{65363c4d55617bbeb57d8ce6dcd46099.svg → 57e963e3d6dd0a9cf05150b40eebf69b.svg} +0 -0
  23. package/dist/{c5ebe0b32dc1b5cc449a76c4204d13bb.ttf → 65a2fb6d9aaa164b41a039302093995b.ttf} +0 -0
  24. package/dist/{cd6c777f1945164224dee082abaea03a.woff2 → 687a4990ea22bb1a49d469a5d9319790.woff2} +0 -0
  25. package/dist/{7583da5c07275cd5eb364507616f998f.ttf → 6c1d906bf5ba48676f65b2d65e935e1a.ttf} +0 -0
  26. package/dist/6dafca5a4f1e31f2bdf11939b24ff422.ttf +0 -0
  27. package/dist/{701ae6abd4719e9c2ada3535a497b341.eot → 752905fa5edf21fc52a10a0c1ca9c7a4.eot} +0 -0
  28. package/dist/76c05d80dda67cdc5d03f345b7bd063f.ttf +0 -0
  29. package/dist/{b551b554a67e86a840bc80cbb8066c30.svg → 7d62eb50e7bb05eedb2a4656f7fe8f3b.svg} +0 -0
  30. package/dist/{8e3c7f5520f5ae906c6cf6d7f3ddcd19.eot → a01e3f2d6c83dc3aee175e2482b3f777.eot} +0 -0
  31. package/dist/{448f2aaa315fa9dce7b2cf6ce31caed6.svg → b30fd8419d7e6d5918856c7531d33482.svg} +0 -0
  32. package/dist/c57dd55fa982e8940f69ca1d69a8a999.woff +0 -0
  33. package/dist/{b87b9ba532ace76ae9f6edfe9f72ded2.ttf → c656b8caa454ed19b9a2ef7f4f5b8fea.ttf} +0 -0
  34. package/dist/{a046592bac8f2fd96e994733faf3858c.woff → cac87dc00c87a5d74711d0276713808a.woff} +0 -0
  35. package/dist/{13db00b7a34fee4d819ab7f9838cc428.eot → d68fa3e67dbb653a13cec44b1bcabcfe.eot} +0 -0
  36. package/dist/{ef60a4f6c25ef7f39f2d25a748dbecfe.woff → ddae9b1ba9b0b42f58809904b0b21349.woff} +0 -0
  37. package/dist/evui.min.js +12 -59485
  38. package/dist/evui.min.js.gz +0 -0
  39. package/dist/evui.min.js.map +1 -1
  40. package/dist/main.css +85 -0
  41. package/dist/main.css.gz +0 -0
  42. package/dist/main.css.map +1 -0
  43. package/package.json +58 -89
  44. package/src/common/emitter.js +20 -0
  45. package/src/common/utils.debounce.js +223 -0
  46. package/src/common/utils.js +51 -17
  47. package/src/common/utils.throttle.js +83 -0
  48. package/src/common/utils.tree.js +18 -0
  49. package/src/components/button/button.vue +316 -241
  50. package/src/components/chart/chart.core.js +699 -0
  51. package/src/components/chart/chart.vue +200 -204
  52. package/src/components/chart/element/element.bar.js +311 -0
  53. package/src/components/chart/element/element.bar.time.js +115 -0
  54. package/src/components/chart/element/element.line.js +288 -0
  55. package/src/components/chart/element/element.pie.js +86 -0
  56. package/src/components/chart/element/element.scatter.js +83 -0
  57. package/src/components/chart/element/element.tip.js +356 -0
  58. package/src/components/chart/helpers/helpers.canvas.js +237 -0
  59. package/src/components/chart/helpers/helpers.constant.js +138 -0
  60. package/src/components/chart/helpers/helpers.util.js +154 -0
  61. package/src/components/chart/index.js +0 -1
  62. package/src/components/chart/model/index.js +4 -0
  63. package/src/components/chart/model/model.series.js +86 -0
  64. package/src/components/chart/model/model.store.js +559 -0
  65. package/src/components/chart/plugins/plugins.interaction.js +324 -0
  66. package/src/components/chart/plugins/plugins.legend.js +589 -0
  67. package/src/components/chart/plugins/plugins.pie.js +179 -0
  68. package/src/components/chart/plugins/plugins.title.js +56 -0
  69. package/src/components/chart/plugins/plugins.tooltip.js +384 -0
  70. package/src/components/chart/scale/scale.js +272 -0
  71. package/src/components/chart/scale/scale.linear.js +30 -0
  72. package/src/components/chart/scale/scale.logarithmic.js +120 -0
  73. package/src/components/chart/scale/scale.step.js +197 -0
  74. package/src/components/chart/scale/scale.time.category.js +204 -0
  75. package/src/components/chart/scale/scale.time.js +40 -0
  76. package/src/components/checkbox/checkbox-group.vue +31 -12
  77. package/src/components/checkbox/checkbox.vue +269 -19
  78. package/src/components/codeview/code.vue +42 -29
  79. package/src/components/contextmenu/contextmenu.child.vue +79 -0
  80. package/src/components/contextmenu/contextmenu.vue +276 -0
  81. package/src/components/contextmenu/contextmenu.wrap.vue +189 -0
  82. package/src/components/contextmenu/index.js +3 -0
  83. package/src/components/datepicker/calendar.core.js +604 -510
  84. package/src/components/datepicker/calendar.vue +0 -3
  85. package/src/components/datepicker/datepicker.vue +73 -14
  86. package/src/components/datepicker/index.js +5 -1
  87. package/src/components/grid/grid.filter.vue +290 -0
  88. package/src/components/grid/grid.filter.window.vue +411 -0
  89. package/src/components/grid/grid.render.vue +45 -0
  90. package/src/components/grid/grid.vue +1338 -0
  91. package/src/components/icon/icon.vue +22 -7
  92. package/src/components/input/input.number.vue +309 -277
  93. package/src/components/label/label.vue +2 -2
  94. package/src/components/loadingmask/loadingmask.vue +52 -63
  95. package/src/components/loginfield/index.js +3 -0
  96. package/src/components/loginfield/loginfield.vue +339 -0
  97. package/src/components/markdown/index.js +3 -0
  98. package/src/components/markdown/markdown.vue +1001 -0
  99. package/src/components/menu/index.js +1 -3
  100. package/src/components/menu/menu.nav.item.vue +115 -0
  101. package/src/components/menu/menu.nav.sub.vue +42 -0
  102. package/src/components/menu/menu.nav.vue +71 -98
  103. package/src/components/message/index.js +3 -0
  104. package/src/components/message/message.js +63 -0
  105. package/src/components/message/message.vue +191 -0
  106. package/src/components/message-box/index.js +3 -0
  107. package/src/components/message-box/message-box.js +31 -0
  108. package/src/components/message-box/message-box.vue +298 -0
  109. package/src/components/notification/index.js +3 -0
  110. package/src/components/notification/notification.js +75 -0
  111. package/src/components/notification/notification.vue +242 -0
  112. package/src/components/radio/radio-group.vue +12 -2
  113. package/src/components/radio/radio.vue +186 -25
  114. package/src/components/selectbox/dropdown.vue +96 -39
  115. package/src/components/selectbox/listbox.vue +68 -29
  116. package/src/components/selectbox/option.vue +1 -1
  117. package/src/components/selectbox/selectbox.vue +445 -245
  118. package/src/components/slider/slider-tooltip.vue +7 -7
  119. package/src/components/slider/slider.vue +20 -25
  120. package/src/components/splitter/index.js +3 -0
  121. package/src/components/splitter/splitter.vue +294 -0
  122. package/src/components/table/table.black.css +1 -1
  123. package/src/components/table/table.filter.lite.vue +8 -8
  124. package/src/components/table/table.filter.vue +1 -1
  125. package/src/components/table/table.grey.css +5 -6
  126. package/src/components/table/table.navy.css +1 -1
  127. package/src/components/table/table.vue +60 -55
  128. package/src/components/tabs/tab-panel.vue +19 -5
  129. package/src/components/tabs/tabs.vue +182 -87
  130. package/src/components/textfield/textfield.vue +140 -80
  131. package/src/components/timepicker/index.js +2 -2
  132. package/src/components/timepicker/spinner.vue +15 -17
  133. package/src/components/timepicker/timepicker.vue +98 -53
  134. package/src/components/toggle/toggle.vue +206 -158
  135. package/src/components/tree/index.js +2 -6
  136. package/src/components/tree/render.js +17 -0
  137. package/src/components/tree/tree-node.vue +214 -0
  138. package/src/components/tree/tree.vue +296 -0
  139. package/src/components/tree-table/index.js +7 -0
  140. package/src/components/{tree → tree-table}/tree.table.black.css +0 -0
  141. package/src/components/{tree → tree-table}/tree.table.grey.css +12 -12
  142. package/src/components/{tree → tree-table}/tree.table.vue +151 -95
  143. package/src/components/tree-table/tree.util.js +119 -0
  144. package/src/components/window/window.vue +238 -183
  145. package/src/index.js +29 -12
  146. package/src/styles/base/base.scss +50 -0
  147. package/src/styles/base/index.scss +1 -0
  148. package/src/styles/default.scss +5 -0
  149. package/src/styles/{codemirror.css → lib/codemirror.css} +0 -0
  150. package/src/styles/{all.css → lib/fontawesome.css} +1 -1
  151. package/src/styles/lib/icon.css +792 -0
  152. package/src/styles/themes/index.scss +2 -0
  153. package/src/styles/themes/mixin.scss +33 -0
  154. package/src/styles/themes/variables.scss +206 -0
  155. package/src/styles/utils/colors.scss +222 -0
  156. package/src/styles/utils/index.scss +2 -0
  157. package/src/styles/utils/mixins.scss +34 -0
  158. package/src/styles/utils/variables.scss +27 -0
  159. package/src/webfonts/EVUI.eot +0 -0
  160. package/src/webfonts/EVUI.svg +251 -173
  161. package/src/webfonts/EVUI.ttf +0 -0
  162. package/src/webfonts/EVUI.woff +0 -0
  163. package/src/webfonts/Roboto-Bold.ttf +0 -0
  164. package/src/webfonts/Roboto-Medium.ttf +0 -0
  165. package/src/webfonts/Roboto-Regular.ttf +0 -0
  166. package/dist/3c9453211570a4ede66a4b4954a32bbb.ttf +0 -0
  167. package/dist/8634884f932627fc43782e6963b64ccd.svg +0 -183
  168. package/dist/b9e64d9b5fa6b500eb5df6fa980d3e5b.eot +0 -0
  169. package/dist/f0ac0c8b3c9cd3ef9002749985ae546f.woff +0 -0
  170. package/src/components/chart/charts/chart.bar.js +0 -334
  171. package/src/components/chart/charts/chart.base.js +0 -1075
  172. package/src/components/chart/charts/chart.line.js +0 -262
  173. package/src/components/chart/charts/chart.pie.js +0 -383
  174. package/src/components/chart/charts/chart.scatter.js +0 -349
  175. package/src/components/chart/charts/chart.sunburst.js +0 -193
  176. package/src/components/chart/core/axis/axis.js +0 -217
  177. package/src/components/chart/core/axis/axis.scale.auto.js +0 -69
  178. package/src/components/chart/core/axis/axis.scale.fixed.js +0 -65
  179. package/src/components/chart/core/axis/axis.scale.steps.js +0 -149
  180. package/src/components/chart/core/core.constant.js +0 -91
  181. package/src/components/chart/core/core.legend.js +0 -473
  182. package/src/components/chart/core/core.util.js +0 -66
  183. package/src/components/chart/core/data/data.js +0 -412
  184. package/src/components/chart/core/data/data.pie.js +0 -70
  185. package/src/components/chart/core/data/data.stack.js +0 -222
  186. package/src/components/chart/core/data/data.sunburst.js +0 -172
  187. package/src/components/menu/menu.context.children.vue +0 -201
  188. package/src/components/menu/menu.context.vue +0 -144
  189. package/src/components/tabs/jun/tab.vue +0 -123
  190. package/src/components/tabs/jun/tabs.vue +0 -484
  191. package/src/components/tree/tree.util.js +0 -39
  192. package/src/styles/evui.css +0 -386
  193. package/src/styles/icon.css +0 -557
@@ -9,10 +9,10 @@
9
9
  </template>
10
10
  <script>
11
11
  const prefixCls = 'ev-label';
12
- export default{
12
+ export default {
13
13
  props: {
14
14
  value: {
15
- type: String,
15
+ type: [String, Number],
16
16
  default: '',
17
17
  },
18
18
  size: {
@@ -1,12 +1,10 @@
1
1
  <template>
2
2
  <div
3
- v-show="isShow"
4
3
  class="ev-loadingmask"
5
- style="display: none;"
6
4
  >
7
5
  <div
8
6
  v-show="barCount"
9
- ref="contents"
7
+ ref="loadingCenter"
10
8
  class="ev-loadingmask-center"
11
9
  >
12
10
  <div
@@ -14,13 +12,13 @@
14
12
  :key="index"
15
13
  :style="{
16
14
  position: 'absolute',
17
- width: item.width,
18
- height: item.height,
19
- borderRadius: item.borderRadius,
20
- background: item.barColor,
21
- transform: item.transform,
22
- animation: item.animation,
23
- animationDelay: item.animDelay,
15
+ width: `${item.barWidth}px`,
16
+ height: `${item.barHeight}px`,
17
+ borderRadius: `${item.barBorderRadius}px`,
18
+ background: `${item.barColor}`,
19
+ transform: `${item.transform}`,
20
+ animation: `${item.animation}`,
21
+ animationDelay: `${item.animDelay}`,
24
22
  }"
25
23
  />
26
24
  </div>
@@ -30,17 +28,17 @@
30
28
  <script>
31
29
  export default {
32
30
  props: {
33
- width: { // 바 너비
34
- type: String,
35
- default: '30px',
31
+ barWidth: { // 바 너비
32
+ type: Number,
33
+ default: 30,
36
34
  },
37
- height: { // 바 높이
38
- type: String,
39
- default: '10px',
35
+ barHeight: { // 바 높이
36
+ type: Number,
37
+ default: 10,
40
38
  },
41
- borderRadius: { // 바 테두리 둥근정도
42
- type: String,
43
- default: '20px',
39
+ barBorderRadius: { // 바 테두리 둥근정도
40
+ type: Number,
41
+ default: 20,
44
42
  },
45
43
  barColor: { // 바 색상
46
44
  type: String,
@@ -50,39 +48,34 @@
50
48
  type: Number,
51
49
  default: 13,
52
50
  },
53
- fadebarRadius: { // 중앙점에서부터 로딩 바까지의 반지름
54
- type: String,
55
- default: '45px',
51
+ spinnerRadius: { // 중앙점에서부터 로딩 바까지의 반지름
52
+ type: Number,
53
+ default: 30,
56
54
  },
57
55
  animInterval: { // css animation seconds during 1-time
58
56
  type: Number,
59
57
  default: 1,
60
58
  },
61
- isShow: {
62
- type: Boolean,
63
- default: false,
64
- },
65
59
  },
66
60
  data() {
67
61
  return {
68
62
  barData: [],
69
63
  };
70
64
  },
65
+ computed: {
66
+ },
71
67
  watch: {
72
- isShow() {
73
- setTimeout(this.updatePosition.bind(this), 1);
74
- },
75
68
  },
76
69
  created() {
77
70
  for (let ix = 0, ixLen = this.barCount; ix < ixLen; ix++) {
78
71
  const obj = {};
79
72
  const deg = Math.round(360 * (ix / ixLen));
80
73
  obj.position = 'absolute';
81
- obj.width = this.width;
82
- obj.height = this.height;
83
- obj.borderRadius = this.borderRadius;
74
+ obj.barWidth = this.barWidth;
75
+ obj.barHeight = this.barHeight;
76
+ obj.barBorderRadius = this.barBorderRadius;
84
77
  obj.barColor = this.barColor;
85
- obj.transform = `rotate(${deg}deg) translate(${this.fadebarRadius}, 0px)`;
78
+ obj.transform = `rotate(${deg}deg) translate(${this.spinnerRadius + (this.barWidth / 2)}px, 0px)`;
86
79
  obj.animation = `ev-loadingmask-fadedelay ${this.animInterval}s infinite ease-in-out`;
87
80
  obj.animDelay = `${(this.animInterval * (ix / ixLen)).toFixed(3)}s`;
88
81
  this.barData.push(obj);
@@ -93,49 +86,45 @@
93
86
  },
94
87
  methods: {
95
88
  updatePosition() {
96
- if (!this.isShow) {
97
- this.$el.style.display = 'none';
98
- return;
99
- }
100
-
101
89
  const element = this.$el;
102
- const parentRect = element.parentElement.getBoundingClientRect();
103
- const contentsRect = this.$refs.contents.getBoundingClientRect();
104
-
105
- element.style.cssText = `
106
- display: block;
107
- top: ${(parentRect.height / 2) - (contentsRect.height / 2)}px;
108
- left: ${(parentRect.width / 2) - (contentsRect.width / 2)}px;
109
- width: ${contentsRect}px;
110
- height: ${contentsRect}px;`;
90
+ const parentEl = element.parentElement;
91
+ if (parentEl) {
92
+ const getComputedParent = getComputedStyle(parentEl);
93
+ if (getComputedParent) {
94
+ const parentPaddingTop = getComputedParent.getPropertyValue('padding-top');
95
+ const parentPaddingLeft = getComputedParent.getPropertyValue('padding-left');
96
+ const parentBorder = getComputedParent.getPropertyValue('border-width');
97
+ const parentElRect = parentEl.getBoundingClientRect();
98
+ const parentWidth = parentElRect.width - (parseInt(parentBorder, 10) * 2);
99
+ const parentHeight = parentElRect.height - (parseInt(parentBorder, 10) * 2);
100
+ const wrapperTransform = `translate(-${parentPaddingLeft}, -${parentPaddingTop})`;
101
+ this.$el.setAttribute('style',
102
+ `width: ${parentWidth}px; height: ${parentHeight}px; transform: ${wrapperTransform}`);
103
+ const centerTransform = `translate(-${(this.barWidth / 2)}px, -${(this.barHeight / 2)}px)`;
104
+ this.$refs.loadingCenter.setAttribute('style',
105
+ `top: ${parentHeight / 2}px; left: ${parentWidth / 2}px; transform: ${centerTransform}`);
106
+ }
107
+ }
111
108
  },
112
109
  },
113
110
  };
114
111
  </script>
115
112
 
116
113
  <style>
117
- .ev-loadingmask
118
- {
114
+ .ev-loadingmask {
119
115
  position: absolute;
120
- z-index: 18000;
116
+ overflow: hidden;
117
+ z-index: 300;
121
118
  }
122
- .ev-loadingmask-center
123
- {
119
+ .ev-loadingmask-center {
124
120
  position: relative;
125
- top: 45%;
126
- left: calc(50% - 15px);
127
- transform: translate3d(0px, 0px, 0px);
128
121
  }
129
- @keyframes ev-loadingmask-fadedelay
130
- {
131
- 80%
132
- {
133
- -webkit-opacity: 0.2;
122
+
123
+ @keyframes ev-loadingmask-fadedelay {
124
+ 80% {
134
125
  opacity: 0.2;
135
126
  }
136
- 100%
137
- {
138
- -webkit-opacity: 0.9;
127
+ 100% {
139
128
  opacity: 0.9;
140
129
  }
141
130
  }
@@ -0,0 +1,3 @@
1
+ import loginField from './loginfield';
2
+
3
+ export default loginField;
@@ -0,0 +1,339 @@
1
+ <template>
2
+ <div
3
+ :style="wrapStyle"
4
+ :class="wrapClasses"
5
+ >
6
+ <input
7
+ v-if="type !== 'textarea'"
8
+ :type="type"
9
+ :style="wrapStyle"
10
+ :value="currentValue"
11
+ :class="inputClasses"
12
+ :disabled="disabled"
13
+ :readonly="readonly"
14
+ :maxlength="maxLength"
15
+ spellcheck="false"
16
+ autocomplete="autoComplete"
17
+ required
18
+ @keyup.enter="handleEnter"
19
+ @keyup="handleKeyUp"
20
+ @keydown="handleKeyDown"
21
+ @focus="handleFocus"
22
+ @blur="handleBlur"
23
+ @input="handleInput"
24
+ @change="handleChange"
25
+ >
26
+ <textarea
27
+ v-else
28
+ :style="wrapStyle"
29
+ :value="currentValue"
30
+ :class="inputClasses"
31
+ :disabled="disabled"
32
+ :readonly="readonly"
33
+ :maxlength="maxLength"
34
+ spellcheck="false"
35
+ required
36
+ @keyup.enter="handleEnter"
37
+ @keyup="handleKeyUp"
38
+ @keydown="handleKeyDown"
39
+ @focus="handleFocus"
40
+ @blur="handleBlur"
41
+ @input="handleInput"
42
+ @change="handleChange"
43
+ />
44
+ <label class="loginLabel">{{ placeholder }}</label>
45
+ <div :class="wrapTextClass">
46
+ <div
47
+ v-show="useRegExp && textError"
48
+ :class="errorTextClass"
49
+ >
50
+ <p>{{ errorMsgWrapper }}</p>
51
+ </div>
52
+ <div
53
+ v-show="useMaxLength"
54
+ :class="maxLengthClass"
55
+ >
56
+ <p>{{ currentLength }} / {{ totalLength }}</p>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </template>
61
+
62
+ <script>
63
+ import { getQuantity, getSize } from '@/common/utils';
64
+
65
+ const prefixCls = 'ev-login';
66
+
67
+ export default {
68
+ name: 'TextField',
69
+ props: {
70
+ width: {
71
+ type: [String, Number],
72
+ default: '100%',
73
+ },
74
+ height: {
75
+ type: [String, Number],
76
+ default: '100%',
77
+ },
78
+ value: {
79
+ type: String,
80
+ default: '',
81
+ },
82
+ disabled: {
83
+ type: Boolean,
84
+ default: false,
85
+ },
86
+ readonly: {
87
+ type: Boolean,
88
+ default: false,
89
+ },
90
+ type: {
91
+ type: String,
92
+ validator(value) {
93
+ const supportType = ['text', 'password', 'textarea'];
94
+ return !!supportType.filter(item => value === item).length;
95
+ },
96
+ default: 'text',
97
+ },
98
+ placeholder: {
99
+ type: String,
100
+ default: '',
101
+ },
102
+ maxLength: {
103
+ type: Number,
104
+ default: Infinity,
105
+ },
106
+ useRegExp: {
107
+ type: Boolean,
108
+ default: false,
109
+ },
110
+ useMaxLength: {
111
+ type: Boolean,
112
+ default: false,
113
+ },
114
+ regExp: {
115
+ type: RegExp,
116
+ default: null,
117
+ },
118
+ errorMsg: {
119
+ type: String,
120
+ default: 'Wrong Message',
121
+ },
122
+ borderColor: {
123
+ type: String,
124
+ default: '#dddee1',
125
+ },
126
+ },
127
+ data() {
128
+ return {
129
+ currentValue: this.value,
130
+ currentLength: this.value.length,
131
+ totalLength: this.maxLength,
132
+ focus: false,
133
+ cssError: false,
134
+ maxError: false,
135
+ textError: false,
136
+ errorMsgWrapper: this.errorMsg,
137
+ autoComplete: this.type === 'password' ? 'new-password' : null,
138
+ };
139
+ },
140
+ computed: {
141
+ wrapClasses() {
142
+ return [
143
+ `${prefixCls}`,
144
+ { [`${prefixCls}-disabled`]: this.disabled },
145
+ { focus: this.focus },
146
+ { error: this.cssError },
147
+ ];
148
+ },
149
+ wrapStyle() {
150
+ return {
151
+ width: getSize(getQuantity(this.width)),
152
+ height: getSize(getQuantity(this.height)),
153
+ background: this.disabled ? '#f3f3f3' : '#fff',
154
+ };
155
+ },
156
+ wrapTextClass() {
157
+ return `${prefixCls}-valid-check`;
158
+ },
159
+ errorTextClass() {
160
+ return `${prefixCls}-valid-error`;
161
+ },
162
+ maxLengthClass() {
163
+ return [
164
+ `${prefixCls}-valid-max-length`,
165
+ { error: this.maxError },
166
+ ];
167
+ },
168
+ inputClasses() {
169
+ return `${prefixCls}-${this.type}`;
170
+ },
171
+ },
172
+ watch: {
173
+ value(val) {
174
+ this.setCurrentValue(val);
175
+ },
176
+ },
177
+ created() {
178
+ this.validateError(this.currentValue);
179
+ },
180
+ methods: {
181
+ handleEnter(e) {
182
+ this.$emit('on-enter', e);
183
+ },
184
+ handleKeyDown(e) {
185
+ this.$emit('on-keydown', e);
186
+ },
187
+ handleKeyUp(e) {
188
+ this.$emit('on-keyup', e);
189
+ },
190
+ handleFocus(e) {
191
+ this.focus = true;
192
+ this.$emit('on-focus', e);
193
+ },
194
+ handleBlur(e) {
195
+ this.focus = false;
196
+ this.$emit('on-blur', e);
197
+ },
198
+ handleInput(e) {
199
+ const value = e.target.value;
200
+
201
+ this.$emit('input', value);
202
+ this.setCurrentValue(value);
203
+ this.$emit('on-input-change', e);
204
+ },
205
+ handleChange(e) {
206
+ this.$emit('on-change', e);
207
+ },
208
+ setCurrentValue(value) {
209
+ if (value === this.currentValue) {
210
+ return;
211
+ }
212
+
213
+ this.validateError(value);
214
+ },
215
+ validateError(value) {
216
+ this.textError = false;
217
+ this.cssError = false;
218
+ this.maxError = false;
219
+
220
+ if (this.useRegExp) {
221
+ this.validateRegExp(value);
222
+ }
223
+
224
+ if (this.useMaxLength) {
225
+ this.validateTextLength(value);
226
+ }
227
+
228
+ this.currentValue = value;
229
+ this.currentLength = value.length;
230
+ },
231
+ validateTextLength(value) {
232
+ if (value.length >= this.maxLength) {
233
+ this.maxError = true;
234
+ this.cssError = true;
235
+ return true;
236
+ }
237
+
238
+ return false;
239
+ },
240
+ validateRegExp(value) {
241
+ const validValue = value;
242
+ if (this.regExp === null) {
243
+ return false;
244
+ }
245
+
246
+ const checked = this.regExp.exec(validValue);
247
+ if (checked === null) {
248
+ this.textError = false;
249
+ this.cssError = false;
250
+ return false;
251
+ }
252
+
253
+ const filteredValue = checked[0];
254
+ if (filteredValue.length !== 0) {
255
+ this.textError = true;
256
+ this.cssError = true;
257
+ return true;
258
+ }
259
+
260
+ this.textError = false;
261
+ this.cssError = false;
262
+ return false;
263
+ },
264
+ },
265
+ };
266
+ </script>
267
+
268
+ <style lang="scss">
269
+ @import '~@/styles/default';
270
+
271
+ .ev-login {
272
+ font-family: 'NanumGothic';
273
+ display: inline-block;
274
+ position: relative;
275
+ vertical-align: middle;
276
+ margin: 0;
277
+ padding: 0;
278
+ width: 100%;
279
+ height: 100%;
280
+ border-radius: 4px;
281
+ color: $color-gray75;
282
+ font-size: 12px;
283
+ line-height: 2;
284
+ cursor: text;
285
+ background-image: none;
286
+ }
287
+
288
+ .ev-login.focus,
289
+ .ev-login.focus:hover {
290
+ opacity: 1;
291
+
292
+ @include evThemify() {
293
+ background-color: evThemed('color-primary');
294
+ }
295
+ }
296
+
297
+ .ev-login-text,
298
+ .ev-login-password {
299
+ width: 100%;
300
+ height: 100%;
301
+ font-size: 18px;
302
+ padding: 10px 10px 10px 12px;
303
+ display: block;
304
+ border: 1px solid #DCE1E5;
305
+ border-radius: 1px;
306
+ transition: border $animate-fast;
307
+ }
308
+
309
+ .ev-login-text:focus,
310
+ .ev-login-password:focus {
311
+ outline: none;
312
+
313
+ @include evThemify() {
314
+ border-bottom: 3px solid evThemed('color-primary');
315
+ }
316
+ }
317
+
318
+ /* LABEL ======================================= */
319
+ .loginLabel {
320
+ color: $color-gray80;
321
+ font-size: 12px;
322
+ position: absolute;
323
+ pointer-events: none;
324
+ height: 22px;
325
+ top: -22px;
326
+ font-family: Roboto;
327
+ font-weight: 600;
328
+ transition: color $animate-fast;
329
+ }
330
+ /* active state */
331
+ .ev-login-text:focus ~ .loginLabel,
332
+ .ev-login-text:valid ~ .loginLabel,
333
+ .ev-login-password:focus ~ .loginLabel,
334
+ .ev-login-password:valid ~ .loginLabel {
335
+ @include evThemify() {
336
+ color: evThemed('color-primary');
337
+ }
338
+ }
339
+ </style>
@@ -0,0 +1,3 @@
1
+ import markdown from './markdown';
2
+
3
+ export default markdown;