@everchron/ec-shards 0.7.57 → 0.7.60
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.
- package/dist/ec-shards.common.js +255 -55
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +255 -55
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +2 -2
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/icons/open-external.svg +5 -0
- package/src/components/collapse/collapse.vue +16 -2
- package/src/components/index.js +2 -0
- package/src/components/input-search/input-search.vue +208 -0
- package/src/components/layout-data-table/layout-data-table.vue +2 -1
- package/src/stories/input-search/input-search.stories.js +72 -0
- package/src/stories/input-search/input-search.stories.mdx +59 -0
package/package.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path vector-effect="non-scaling-stroke" d="M19.3333 5.25H24.75V10.6667" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path vector-effect="non-scaling-stroke" d="M17.1667 12.8333L24.75 5.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path vector-effect="non-scaling-stroke" d="M22.5833 17.1667V22.5834C22.5833 23.7804 21.6138 24.75 20.4167 24.75H7.41667C6.21958 24.75 5.25 23.7804 5.25 22.5834V9.58335C5.25 8.38627 6.21958 7.41669 7.41667 7.41669H12.8333" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
</svg>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
<div :class="isVisible ? 'collapse-show' : 'collapse-hide'" :id="`collapse-${ this.id }`" class="collapse">
|
|
19
|
-
<div class="ecs-collapsable-content">
|
|
19
|
+
<div class="ecs-collapsable-content" :class="[condensed ? 'condensed' : '']">
|
|
20
20
|
<slot></slot>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
@@ -69,6 +69,10 @@ export default {
|
|
|
69
69
|
persist: {
|
|
70
70
|
type: Boolean,
|
|
71
71
|
default: true
|
|
72
|
+
},
|
|
73
|
+
condensed: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
72
76
|
}
|
|
73
77
|
},
|
|
74
78
|
|
|
@@ -213,6 +217,11 @@ export default {
|
|
|
213
217
|
&-content{
|
|
214
218
|
padding-top: 15px;
|
|
215
219
|
padding-bottom: 25px;
|
|
220
|
+
|
|
221
|
+
&.condensed{
|
|
222
|
+
padding-top: 5px;
|
|
223
|
+
padding-bottom: 15px;
|
|
224
|
+
}
|
|
216
225
|
}
|
|
217
226
|
|
|
218
227
|
&-indent-md,
|
|
@@ -259,7 +268,12 @@ export default {
|
|
|
259
268
|
padding-left: 15px;
|
|
260
269
|
padding-right: 15px;
|
|
261
270
|
padding-top: 10px;
|
|
262
|
-
padding-bottom: 20px
|
|
271
|
+
padding-bottom: 20px;
|
|
272
|
+
|
|
273
|
+
&.condensed{
|
|
274
|
+
padding-top: 5px;
|
|
275
|
+
padding-bottom: 15px;
|
|
276
|
+
}
|
|
263
277
|
}
|
|
264
278
|
}
|
|
265
279
|
}
|
package/src/components/index.js
CHANGED
|
@@ -52,6 +52,7 @@ import EcsInputClear from "./input-clear/input-clear.vue"
|
|
|
52
52
|
import EcsInputConnector from "./input-connector/input-connector.vue"
|
|
53
53
|
import EcsInputFloat from "./input-float/input-float.vue"
|
|
54
54
|
import EcsInputGroup from "./input-group/input-group.vue"
|
|
55
|
+
import EcsInputSearch from "./input-search/input-search.vue"
|
|
55
56
|
import EcsJumperDocument from "./jumper-document/jumper-document.vue"
|
|
56
57
|
import EcsJumperIndex from "./jumper-index/jumper-index.vue"
|
|
57
58
|
import EcsJumperPage from "./jumper-page/jumper-page.vue"
|
|
@@ -148,6 +149,7 @@ const Components = {
|
|
|
148
149
|
EcsFlag,
|
|
149
150
|
EcsFormCheck,
|
|
150
151
|
EcsFormGroup,
|
|
152
|
+
EcsInputSearch,
|
|
151
153
|
EcsFormHeadline,
|
|
152
154
|
EcsFormatted,
|
|
153
155
|
EcsFormSet,
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ecs-search-group">
|
|
3
|
+
<ecs-icon type="search" color="#B9BCC2" :width="iconSize" :height="iconSize" />
|
|
4
|
+
<input ref="input"
|
|
5
|
+
:name="name"
|
|
6
|
+
:disabled="disabled"
|
|
7
|
+
:placeholder="placeholder"
|
|
8
|
+
:autocomplete="autocomplete"
|
|
9
|
+
:value="value"
|
|
10
|
+
v-bind="$attrs"
|
|
11
|
+
@input="onInput"
|
|
12
|
+
@change="onChange"
|
|
13
|
+
:class="[
|
|
14
|
+
'ecs-search-input',
|
|
15
|
+
sizeClass,
|
|
16
|
+
typeClass
|
|
17
|
+
]"
|
|
18
|
+
/>
|
|
19
|
+
<ecs-input-clear v-if="showClear" @click="clearSearch" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import EcsIcon from '../icon/icon'
|
|
25
|
+
import EcsInputClear from '../input-clear/input-clear'
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
components: {
|
|
29
|
+
EcsIcon,
|
|
30
|
+
EcsInputClear
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
props: {
|
|
34
|
+
placeholder: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'Search...'
|
|
37
|
+
},
|
|
38
|
+
autocomplete: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: null
|
|
41
|
+
},
|
|
42
|
+
value: {
|
|
43
|
+
type: [String, Number],
|
|
44
|
+
default: ''
|
|
45
|
+
},
|
|
46
|
+
name: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: null
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
showClear: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
size: {
|
|
59
|
+
type: String,
|
|
60
|
+
validator: v => ['md', 'lg', 'sml', null].includes(v),
|
|
61
|
+
default: 'md'
|
|
62
|
+
},
|
|
63
|
+
type: {
|
|
64
|
+
type: String,
|
|
65
|
+
validator: v => ['subtle', 'naked', null].includes(v),
|
|
66
|
+
default: null
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
computed: {
|
|
71
|
+
sizeClass() {
|
|
72
|
+
return this.size ? `ecs-search-input-${this.size}` : null
|
|
73
|
+
},
|
|
74
|
+
typeClass() {
|
|
75
|
+
return this.type ? `ecs-search-input-${this.type}` : null
|
|
76
|
+
},
|
|
77
|
+
iconSize() {
|
|
78
|
+
if(this.size === 'sml') {
|
|
79
|
+
return '24px'
|
|
80
|
+
} else {
|
|
81
|
+
return '30px'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
methods: {
|
|
87
|
+
setValue(value) {
|
|
88
|
+
this.$refs.input.value = value
|
|
89
|
+
this.$emit('input', value)
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
onInput(e) {
|
|
93
|
+
this.setValue(e.target.value)
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
onChange(e) {
|
|
97
|
+
this.setValue(e.target.value)
|
|
98
|
+
this.$emit('change', e.target.value)
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
clearSearch() {
|
|
102
|
+
this.setValue('')
|
|
103
|
+
this.$emit('input', '')
|
|
104
|
+
this.$emit('change', '')
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
watch: {
|
|
109
|
+
value (newVal) {
|
|
110
|
+
this.setValue(newVal)
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
mounted() {
|
|
115
|
+
if (this.value) {
|
|
116
|
+
this.setValue(this.value)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<style lang="scss" scoped>
|
|
123
|
+
@import "../tokens/tokens";
|
|
124
|
+
@import "../mixins/svg-uri";
|
|
125
|
+
|
|
126
|
+
.ecs-search-group{
|
|
127
|
+
position: relative;
|
|
128
|
+
display: block;
|
|
129
|
+
width: 100%;
|
|
130
|
+
|
|
131
|
+
.ecs-input-clear{
|
|
132
|
+
position: absolute;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.icon{
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 50%;
|
|
138
|
+
left: 0;
|
|
139
|
+
transform: translateY(-50%);
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ecs-search-input{
|
|
145
|
+
display: block;
|
|
146
|
+
width: 100%;
|
|
147
|
+
padding: 7px 32px;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
font-family: $sf;
|
|
150
|
+
line-height: 16px;
|
|
151
|
+
color: $gray-15;
|
|
152
|
+
background-color: #FFF;
|
|
153
|
+
background-clip: padding-box;
|
|
154
|
+
border: $input-border-width solid rgba($gray-8, .4);
|
|
155
|
+
border-radius: 3px;
|
|
156
|
+
transition: .2s;
|
|
157
|
+
box-shadow: none;
|
|
158
|
+
|
|
159
|
+
&:focus{
|
|
160
|
+
border-color: rgba($blue-8, .5);
|
|
161
|
+
box-shadow: 0 0 0 2px rgba($blue-8, .15);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&-subtle{
|
|
165
|
+
background-color: rgba($gray-10, .15);
|
|
166
|
+
border: none;
|
|
167
|
+
|
|
168
|
+
&:focus{
|
|
169
|
+
background-color: rgba($gray-10, .1);
|
|
170
|
+
box-shadow: none;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&-naked{
|
|
175
|
+
background-color: transparent;
|
|
176
|
+
border: none;
|
|
177
|
+
|
|
178
|
+
&:focus{
|
|
179
|
+
box-shadow: none;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
+ .ecs-input-clear{
|
|
184
|
+
top: 0;
|
|
185
|
+
right: 0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&-lg{
|
|
189
|
+
padding: 11px 32px;
|
|
190
|
+
|
|
191
|
+
+ .ecs-input-clear{
|
|
192
|
+
top: 4px;
|
|
193
|
+
right: 4px;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&-sml{
|
|
198
|
+
font-size: 12px;
|
|
199
|
+
padding: 3px 24px;
|
|
200
|
+
line-height: 16px;
|
|
201
|
+
|
|
202
|
+
+ .ecs-input-clear{
|
|
203
|
+
top: -4px;
|
|
204
|
+
right: -4px;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
</style>
|
|
@@ -64,7 +64,7 @@ $bar-height: 41px;
|
|
|
64
64
|
display: flex;
|
|
65
65
|
align-items: center;
|
|
66
66
|
width: 100%;
|
|
67
|
-
padding: 0 12px;
|
|
67
|
+
padding: 0 12px 0 4px;
|
|
68
68
|
background: #FFF;
|
|
69
69
|
height: $bar-height;
|
|
70
70
|
border-bottom: 1px solid $gray-3;
|
|
@@ -123,6 +123,7 @@ $bar-height: 41px;
|
|
|
123
123
|
border-bottom: 1px solid $gray-3;
|
|
124
124
|
display: flex;
|
|
125
125
|
align-items: center;
|
|
126
|
+
justify-content: space-between;
|
|
126
127
|
padding: 0 16px 0 20px;
|
|
127
128
|
}
|
|
128
129
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import EcsInputSearch from '@components/input-search/input-search';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Forms/Search Input',
|
|
5
|
+
component: EcsInputSearch
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const searchInput = () => ({
|
|
9
|
+
components: { EcsInputSearch },
|
|
10
|
+
data() {
|
|
11
|
+
return {
|
|
12
|
+
inputValue: '',
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
computed: {
|
|
16
|
+
showClear() {
|
|
17
|
+
return this.inputValue.length > 0;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
template: `<div>
|
|
21
|
+
<ecs-input-search v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." style="margin-bottom:24px" />
|
|
22
|
+
<ecs-input-search size="sml" v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." style="margin-bottom:24px" />
|
|
23
|
+
<ecs-input-search size="lg" v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." style="margin-bottom:24px" />
|
|
24
|
+
<hr style="border: none; border-bottom: 1px solid #DADEE6; margin: 20px 0">
|
|
25
|
+
<div v-if="inputValue">Search by: {{ inputValue }}</div>
|
|
26
|
+
<div v-else>Nothing Searched</div>
|
|
27
|
+
</div>`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const searchInputSubtle = () => ({
|
|
31
|
+
components: { EcsInputSearch },
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
inputValue: '',
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
computed: {
|
|
38
|
+
showClear() {
|
|
39
|
+
return this.inputValue.length > 0;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
template: `<div>
|
|
43
|
+
<ecs-input-search v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." type="subtle" style="margin-bottom:24px" />
|
|
44
|
+
<ecs-input-search size="sml" v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." type="subtle" style="margin-bottom:24px" />
|
|
45
|
+
<ecs-input-search size="lg" v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." type="subtle" style="margin-bottom:24px" />
|
|
46
|
+
<hr style="border: none; border-bottom: 1px solid #DADEE6; margin: 20px 0">
|
|
47
|
+
<div v-if="inputValue">Search by: {{ inputValue }}</div>
|
|
48
|
+
<div v-else>Nothing Searched</div>
|
|
49
|
+
</div>`,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const searchInputNaked = () => ({
|
|
53
|
+
components: { EcsInputSearch },
|
|
54
|
+
data() {
|
|
55
|
+
return {
|
|
56
|
+
inputValue: '',
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
showClear() {
|
|
61
|
+
return this.inputValue.length > 0;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
template: `<div>
|
|
65
|
+
<ecs-input-search v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." type="naked" style="margin-bottom:24px" />
|
|
66
|
+
<ecs-input-search size="sml" v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." type="naked" style="margin-bottom:24px" />
|
|
67
|
+
<ecs-input-search size="lg" v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." type="naked" style="margin-bottom:24px" />
|
|
68
|
+
<hr style="border: none; border-bottom: 1px solid #DADEE6; margin: 20px 0">
|
|
69
|
+
<div v-if="inputValue">Search by: {{ inputValue }}</div>
|
|
70
|
+
<div v-else>Nothing Searched</div>
|
|
71
|
+
</div>`,
|
|
72
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Meta, Story, ArgsTable, Canvas, Description } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import EcsInputSearch from '@components/input-search/input-search';
|
|
3
|
+
import * as stories from './input-search.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta
|
|
6
|
+
title="Forms/Search Input"
|
|
7
|
+
component={EcsInputSearch} />
|
|
8
|
+
|
|
9
|
+
# Search Input `EcsInputSearch`
|
|
10
|
+
|
|
11
|
+
The search input is a simple input component that shows a clear button when text has been entered. There are 3 sizes (`size`) available: `sml`, `md`, `lg`.
|
|
12
|
+
|
|
13
|
+
<Canvas withSource="none" withToolbar={true}>
|
|
14
|
+
<Story name="Search Input" height="180px">
|
|
15
|
+
{stories.searchInput()}
|
|
16
|
+
</Story>
|
|
17
|
+
</Canvas>
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
inputValue: '',
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
```js
|
|
27
|
+
computed: {
|
|
28
|
+
showClear() {
|
|
29
|
+
return this.inputValue.length > 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
```js
|
|
34
|
+
<ecs-input-search v-model="inputValue" :show-clear="showClear" placeholder="Search for users..." />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Subtle Variant
|
|
38
|
+
|
|
39
|
+
A subtle variant of the search input is available by setting the `type` prop to `subtle`.
|
|
40
|
+
|
|
41
|
+
<Canvas withSource="none" withToolbar={true}>
|
|
42
|
+
<Story name="Search Input Subtle" height="180px">
|
|
43
|
+
{stories.searchInputSubtle()}
|
|
44
|
+
</Story>
|
|
45
|
+
</Canvas>
|
|
46
|
+
|
|
47
|
+
## Naked Variant
|
|
48
|
+
|
|
49
|
+
A naked variant of the search input is available by setting the `type` prop to `naked`.
|
|
50
|
+
|
|
51
|
+
<Canvas withSource="none" withToolbar={true}>
|
|
52
|
+
<Story name="Search Input Naked" height="180px">
|
|
53
|
+
{stories.searchInputNaked()}
|
|
54
|
+
</Story>
|
|
55
|
+
</Canvas>
|
|
56
|
+
|
|
57
|
+
## Props and Events
|
|
58
|
+
|
|
59
|
+
<ArgsTable of={EcsInputSearch} />
|