Skip to content

Commit

Permalink
[#654][3.0] inputNumber 컴포넌트 개발 (#655)
Browse files Browse the repository at this point in the history
* [#654][3.0] Docs 페이지 레이아웃 수정
#########
- Docs 페이지 레이아웃 수정

* [#654][3.0] InputNumber 컴포넌트 개발
#######
- InputNumber 컴포넌트 개발
- 불필요 코드 삭제

* [#654][3.0] InputNumber 컴포넌트 개발
#######
- 피드백 반영: 코드 개선 및 불필요 코드 삭제
- docs 레이아웃 수정

Co-authored-by: mjchoi <mjchoi@ex-em.com>
  • Loading branch information
mmindy and exemfe3 authored Oct 7, 2020
1 parent 602c2d6 commit f346771
Show file tree
Hide file tree
Showing 25 changed files with 746 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = {
'no-bitwise': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-console': ['error', { allow: ['log'] }],
'no-console': ['error', { allow: ['log', 'warn'] }],
'class-methods-use-this': 'off',
'prefer-promise-reject-errors': 'off',
'prefer-destructuring': 'off',
Expand Down
44 changes: 33 additions & 11 deletions docs/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,45 @@ export default {
</script>

<style lang="scss">
$file-path: './assets/fonts/';
@import './style/index.scss';
@font-face {
font-family: 'Roboto';
src: url($file-path + 'Roboto-Bold.ttf') format('trutype');
font-weight: 800;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url($file-path + 'Roboto-Medium.ttf') format('trutype');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url($file-path + 'Roboto-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
* {
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
font-family: 'Roboto', Arial, 'Helvetica Neue', Helvetica, sans-serif;
}
.evui-wrapper {
position: relative;
min-height: 100vh;
padding: $header-height 0 0 $nav-width;
font-size: $font-size-base;
@include themify() {
color: themed('font-color-base');
background-color: themed('background-color-base');
}
}
.dark {
@import './style/lib/highlightjs.hybrid';
Expand All @@ -56,14 +88,4 @@ export default {
font-family: consolas, monospace;
}
}
.evui-wrapper {
position: relative;
min-height: 100vh;
padding: $header-height 0 0 $nav-width;
@include themify() {
color: themed('font-color-base');
background-color: themed('background-color-base');
}
}
</style>
Binary file added docs/assets/fonts/Roboto-Bold.ttf
Binary file not shown.
Binary file added docs/assets/fonts/Roboto-Medium.ttf
Binary file not shown.
Binary file added docs/assets/fonts/Roboto-Regular.ttf
Binary file not shown.
58 changes: 46 additions & 12 deletions docs/components/Example.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
{{ description }}
</p>
<div class="article-example">
<div class="view">
<div
ref="viewArea"
class="view"
>
<component :is="component" />
</div>
<div
Expand All @@ -17,27 +20,29 @@
<div
ref="codeWrapper"
class="code-wrapper"
:style="{ height: `${viewAreaHeight}px` }"
>
<pre>
<pre class="html">
{{ parsedData?.template?.content }}
</pre>
<pre>
<pre class="javascript">
{{ parsedData?.script?.content }}
</pre>
</div>
<div
class="btn-show-more"
@click="clickExpend"
>
{{ codeExpend ? '▲ Fold the code' : '▼ Unfold the code' }}
<i class="ev-icon-document-vertically" />
{{ codeExpend ? 'Hide the code' : 'Show more code' }}
</div>
</div>
</div>
</article>
</template>

<script>
import { ref } from 'vue';
import { ref, onMounted } from 'vue';
import hljs from 'highlight.js';

export default {
Expand Down Expand Up @@ -80,10 +85,18 @@ export default {
}
};

const viewArea = ref();
const viewAreaHeight = ref();
onMounted(() => {
viewAreaHeight.value = viewArea.value.offsetHeight;
});

return {
codeExpend,
codeWrapper,
clickExpend,
viewArea,
viewAreaHeight,
};
},
};
Expand Down Expand Up @@ -137,6 +150,7 @@ export default {
margin: 15px 0 20px;
border-radius: 4px;
font-size: 13px;
word-break: break-all;

@include themify() {
background-color: themed('background-color-description');
Expand Down Expand Up @@ -177,30 +191,38 @@ export default {
max-width: 700px;
overflow: hidden;
.code-wrapper {
height: 50px;
height: 100px;
min-height: 350px;
overflow: hidden;
}
.btn-show-more {
display: flex;
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 100%;
height: 45px;
height: 100%;
justify-content: center;
align-items: center;
line-height: 45px;
background-color: rgba($color-yellow, 0.5);
backdrop-filter: blur(2px);
color: $color-black;
text-align: center;
cursor: pointer;
transition: all $animate-fast;
&:hover {
background-color: $color-yellow;
background-color: rgba($color-yellow, 0.8);
}
}
&.expend {
.code-wrapper {
height: auto;
max-height: 600px;
padding-bottom: 45px;
padding-top: 40px;
overflow-y: auto;
}
.btn-show-more {
height: 40px;
}
}
}
}
Expand All @@ -216,6 +238,18 @@ export default {
.code {
max-width: none;
width: 100%;
.code-wrapper {
height: 40px !important;
transition: all $animate-fast;
}
.btn-show-more {
height: 40px;
}
&.expend {
.code-wrapper {
height: 300px !important;
}
}
}
}
}
Expand Down
52 changes: 30 additions & 22 deletions docs/components/Header.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<template>
<header class="evui-header">
<h1 class="evui-header-logo">EXEM Visualization UI</h1>
<button
<h1 class="evui-header-logo">EVUI</h1>
<p class="evui-header-name">EXEM Visualization UI</p>
<span
class="evui-header-theme"
@click="changeTheme"
>
{{ theme }}
</button>
<ev-icon
:icon="themeIcon"
@click="changeTheme"
/>
</span>
</header>
</template>

Expand All @@ -29,15 +32,13 @@ export default {
set: value => emit('update:modelValue', value),
});
const changeTheme = () => {
if (theme.value === 'light') {
theme.value = 'dark';
} else {
theme.value = 'light';
}
theme.value = theme.value === 'light' ? 'dark' : 'light';
};
const themeIcon = computed(() => (theme.value === 'light' ? 'ev-icon-sun' : 'ev-icon-moon'));
return {
theme,
themeIcon,
changeTheme,
};
},
Expand All @@ -51,7 +52,6 @@ a {
text-decoration: none !important;
}
.evui-header {
display: flex;
position: fixed;
top: 0;
right: 0;
Expand All @@ -62,32 +62,40 @@ a {
background-color: $color-blue;
z-index: 10;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
&-logo {
position: absolute;
top: 50%;
left: 10px;
width: 110px;
height: 30px;
line-height: 30px;
padding-left: 110px;
background: url('http://evui.ex-em.com/wp-content/uploads/2017/11/evui_1.png') left center no-repeat;
background-size: contain;
color: rgb(43,87,151);
transform: translateY(-50%);
@include font-hide();
}
&-name {
font-size: $font-size-large;
font-weight: bold;
color: #E8E8E8;
text-align: center;
line-height: $header-height;
}
}
.evui-header-theme {
position: absolute;
top: 50%;
right: 20px;
width: 60px;
height: 25px;
width: 26px;
height: 26px;
transform: translateY(-50%);
outline: none;
border: none;
cursor: pointer;
@include themify() {
color: themed('font-color-base');
background-color: themed('background-color-base');
font-size: 26px;
color: #E8E8E8;
transition: all $animate-fast;
&:hover {
opacity: 0.5;
}
}
</style>
Loading

0 comments on commit f346771

Please sign in to comment.