@everchron/ec-shards 2.1.1 → 2.1.2
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 +285 -287
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +285 -287
- 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/components/checkbox/checkbox.vue +4 -21
- package/src/components/form-check/form-check.vue +5 -11
- package/src/components/form-group/form-group.vue +20 -15
- package/src/components/quicklink/quicklink.vue +5 -0
- package/src/components/radiobutton/radiobutton.vue +2 -19
- package/src/components/text/text.vue +5 -1
- package/src/components/tree-list-item/tree-list-item.vue +1 -0
- package/src/stories/Changelog.stories.mdx +7 -0
- package/src/stories/checkbox/checkbox.stories.js +0 -8
- package/src/stories/form-group/form-group.stories.js +8 -0
- package/src/stories/radiobutton/radiobutton.stories.js +0 -13
package/package.json
CHANGED
|
@@ -21,17 +21,15 @@
|
|
|
21
21
|
:for="id || _uid">
|
|
22
22
|
|
|
23
23
|
<slot />
|
|
24
|
-
<ecs-text v-if="$slots.default && help" type="form">{{ help }}</ecs-text>
|
|
25
24
|
</label>
|
|
26
25
|
</ecs-form-check>
|
|
27
26
|
</template>
|
|
28
27
|
|
|
29
28
|
<script>
|
|
30
29
|
import EcsFormCheck from '../form-check/form-check'
|
|
31
|
-
import EcsText from '../text/text'
|
|
32
30
|
|
|
33
31
|
export default {
|
|
34
|
-
components: { EcsFormCheck
|
|
32
|
+
components: { EcsFormCheck },
|
|
35
33
|
props: {
|
|
36
34
|
/** Name attribute of the input. */
|
|
37
35
|
name: {
|
|
@@ -73,11 +71,7 @@
|
|
|
73
71
|
default: false
|
|
74
72
|
},
|
|
75
73
|
/** Unique ID */
|
|
76
|
-
id: [String, Number]
|
|
77
|
-
/** Help text that appears underneath (or next to, for inline checkboxes) the label. */
|
|
78
|
-
help: {
|
|
79
|
-
type: String
|
|
80
|
-
}
|
|
74
|
+
id: [String, Number]
|
|
81
75
|
},
|
|
82
76
|
|
|
83
77
|
data() {
|
|
@@ -151,8 +145,7 @@
|
|
|
151
145
|
width: 18px;
|
|
152
146
|
height: 18px;
|
|
153
147
|
left: 0;
|
|
154
|
-
top:
|
|
155
|
-
margin-top: -9px;
|
|
148
|
+
top: 0;
|
|
156
149
|
background: svg-uri('<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><polyline fill="none" stroke="#{$color-blue-10}" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.7" points="6 9.259 8.347 11.998 12 6"/></svg>');
|
|
157
150
|
}
|
|
158
151
|
|
|
@@ -164,8 +157,7 @@
|
|
|
164
157
|
height: 2px;
|
|
165
158
|
border-radius: 1px;
|
|
166
159
|
left: 5px;
|
|
167
|
-
top:
|
|
168
|
-
margin-top: -1px;
|
|
160
|
+
top: 8px;
|
|
169
161
|
}
|
|
170
162
|
|
|
171
163
|
&[type="checkbox"].indeterminate + label:before{
|
|
@@ -173,13 +165,4 @@
|
|
|
173
165
|
border-color: rgba($color-blue-10, .3);
|
|
174
166
|
}
|
|
175
167
|
}
|
|
176
|
-
|
|
177
|
-
.ecs-text{
|
|
178
|
-
min-width: 100%;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.ecs-form-check-inline .ecs-text{
|
|
182
|
-
min-width: auto;
|
|
183
|
-
margin-left: $spacing-10;
|
|
184
|
-
}
|
|
185
168
|
</style>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
.ecs-form-check {
|
|
33
33
|
position: relative;
|
|
34
34
|
display: block;
|
|
35
|
-
|
|
35
|
+
height: 18px;
|
|
36
36
|
margin-bottom: $spacing-25;
|
|
37
37
|
|
|
38
38
|
&.stand-alone{
|
|
@@ -49,10 +49,6 @@
|
|
|
49
49
|
&-inline{
|
|
50
50
|
display: inline-block;
|
|
51
51
|
margin-right: 30px;
|
|
52
|
-
|
|
53
|
-
.ecs-form-check-label{
|
|
54
|
-
display: inline-flex;
|
|
55
|
-
}
|
|
56
52
|
}
|
|
57
53
|
|
|
58
54
|
&.disabled {
|
|
@@ -76,11 +72,10 @@
|
|
|
76
72
|
|
|
77
73
|
.ecs-form-check-label {
|
|
78
74
|
min-width: 18px;
|
|
79
|
-
|
|
75
|
+
height: 18px;
|
|
80
76
|
margin-bottom: 0;
|
|
81
77
|
padding-left: 30px;
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-wrap: wrap;
|
|
78
|
+
display: inline-flex;
|
|
84
79
|
align-items: center;
|
|
85
80
|
}
|
|
86
81
|
|
|
@@ -100,8 +95,7 @@
|
|
|
100
95
|
vertical-align: text-top;
|
|
101
96
|
position: absolute;
|
|
102
97
|
left: 0;
|
|
103
|
-
top:
|
|
104
|
-
margin-top: -9px;
|
|
98
|
+
top: 0;
|
|
105
99
|
width: 18px;
|
|
106
100
|
height: 18px;
|
|
107
101
|
background: white;
|
|
@@ -132,7 +126,7 @@
|
|
|
132
126
|
label{
|
|
133
127
|
display: inline-block;
|
|
134
128
|
font-size: $type-scale-3-font-size;
|
|
135
|
-
line-height:
|
|
129
|
+
line-height: 18px;
|
|
136
130
|
margin-bottom: $spacing-10;
|
|
137
131
|
-webkit-user-select: none;
|
|
138
132
|
-moz-user-select: none;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ecs-form-group" :class="error ? 'error' : ''">
|
|
3
3
|
<slot></slot>
|
|
4
|
-
<
|
|
5
|
-
<
|
|
4
|
+
<ecs-text v-if="hasHelp" v-html="helpText" type="form"></ecs-text>
|
|
5
|
+
<ecs-text v-if="hasErrorText" v-html="errorText" type="form" color="negative"></ecs-text>
|
|
6
|
+
<ecs-text v-if="hasSuccessText" v-html="successText" type="form" color="positive" emphasized></ecs-text>
|
|
6
7
|
</div>
|
|
7
8
|
</template>
|
|
8
9
|
|
|
9
10
|
<script>
|
|
11
|
+
import EcsText from '../text/text'
|
|
12
|
+
|
|
10
13
|
export default {
|
|
14
|
+
components: { EcsText },
|
|
15
|
+
|
|
11
16
|
props: {
|
|
12
17
|
/** If set, the input control will show up in an error state. */
|
|
13
18
|
error: {
|
|
@@ -21,6 +26,10 @@
|
|
|
21
26
|
/** Shows an error message underneath the input control. Should be used together with the `error`prop. */
|
|
22
27
|
errorText: {
|
|
23
28
|
type: String
|
|
29
|
+
},
|
|
30
|
+
/** Shows a success message underneath the input control. */
|
|
31
|
+
successText: {
|
|
32
|
+
type: String
|
|
24
33
|
}
|
|
25
34
|
},
|
|
26
35
|
|
|
@@ -30,6 +39,13 @@
|
|
|
30
39
|
return true
|
|
31
40
|
return this.helpText
|
|
32
41
|
},
|
|
42
|
+
|
|
43
|
+
hasSuccessText() {
|
|
44
|
+
if (this.successText && this.successText !== '')
|
|
45
|
+
return true
|
|
46
|
+
return this.successText
|
|
47
|
+
},
|
|
48
|
+
|
|
33
49
|
hasErrorText() {
|
|
34
50
|
if (this.errorText && this.errorText !== '')
|
|
35
51
|
return true
|
|
@@ -51,10 +67,7 @@
|
|
|
51
67
|
}
|
|
52
68
|
}
|
|
53
69
|
|
|
54
|
-
.ecs-
|
|
55
|
-
display: block;
|
|
56
|
-
font-size: $type-scale-2-font-size;
|
|
57
|
-
color: $color-gray-8;
|
|
70
|
+
.ecs-text{
|
|
58
71
|
margin-top: $spacing-10;
|
|
59
72
|
|
|
60
73
|
a{
|
|
@@ -65,13 +78,9 @@
|
|
|
65
78
|
color: darken($color-blue-10, 10%);
|
|
66
79
|
}
|
|
67
80
|
}
|
|
68
|
-
|
|
69
|
-
&.error{
|
|
70
|
-
color: $color-red-9;
|
|
71
|
-
}
|
|
72
81
|
}
|
|
73
82
|
|
|
74
|
-
.ecs-form-check-group .ecs-
|
|
83
|
+
.ecs-form-check-group .ecs-text{
|
|
75
84
|
margin-top: 0;
|
|
76
85
|
}
|
|
77
86
|
|
|
@@ -111,10 +120,6 @@ label{
|
|
|
111
120
|
@import "../../tokens/build/scss/tokens.scss";
|
|
112
121
|
|
|
113
122
|
.ecs-form-group.error{
|
|
114
|
-
.ecs-form-text{
|
|
115
|
-
color: $color-red-9;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
123
|
.ecs-form-control,
|
|
119
124
|
.ecs-form-control:focus,
|
|
120
125
|
.ecs-form-select{
|
|
@@ -21,17 +21,14 @@
|
|
|
21
21
|
:for="id">
|
|
22
22
|
|
|
23
23
|
<slot />
|
|
24
|
-
<ecs-text v-if="$slots.default && help" type="form">{{ help }}</ecs-text>
|
|
25
24
|
</label>
|
|
26
25
|
</ecs-form-check>
|
|
27
26
|
</template>
|
|
28
27
|
|
|
29
28
|
<script>
|
|
30
29
|
import EcsFormCheck from '../form-check/form-check'
|
|
31
|
-
import EcsText from '../text/text'
|
|
32
|
-
|
|
33
30
|
export default {
|
|
34
|
-
components: { EcsFormCheck
|
|
31
|
+
components: { EcsFormCheck },
|
|
35
32
|
|
|
36
33
|
model: {
|
|
37
34
|
prop: 'checked',
|
|
@@ -65,10 +62,6 @@
|
|
|
65
62
|
inline: {
|
|
66
63
|
type: Boolean,
|
|
67
64
|
default: false
|
|
68
|
-
},
|
|
69
|
-
/** Help text that appears underneath (or next to, for inline radiobuttons) the label. */
|
|
70
|
-
help: {
|
|
71
|
-
type: String
|
|
72
65
|
}
|
|
73
66
|
},
|
|
74
67
|
|
|
@@ -140,18 +133,8 @@
|
|
|
140
133
|
background: $color-blue-10;
|
|
141
134
|
width: 6px;
|
|
142
135
|
height: 6px;
|
|
143
|
-
top:
|
|
144
|
-
margin-top: -3px;
|
|
136
|
+
top: 6px;
|
|
145
137
|
left: 6px;
|
|
146
138
|
}
|
|
147
139
|
}
|
|
148
|
-
|
|
149
|
-
.ecs-text{
|
|
150
|
-
min-width: 100%;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.ecs-form-check-inline .ecs-text{
|
|
154
|
-
min-width: auto;
|
|
155
|
-
margin-left: $spacing-10;
|
|
156
|
-
}
|
|
157
140
|
</style>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
@import "../../tokens/build/scss/tokens.scss";
|
|
80
80
|
@import "../mixins/svg-uri";
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
h1, h2, h3, h4, h5, h6, label{
|
|
83
83
|
margin: 0;
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -160,5 +160,9 @@
|
|
|
160
160
|
font-size: $type-scale-2-font-size;
|
|
161
161
|
line-height: $type-scale-2-line-height;
|
|
162
162
|
color: $color-gray-9;
|
|
163
|
+
|
|
164
|
+
&.emphasized{
|
|
165
|
+
font-weight: $font-weight-medium;
|
|
166
|
+
}
|
|
163
167
|
}
|
|
164
168
|
</style>
|
|
@@ -6,6 +6,13 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
6
6
|
Changelog
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
+
## Version 2.1.2 (24 Octobier 2022)
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
- Refactor EcsFormGroup error text with EcsText component
|
|
14
|
+
- Added some padding to EcsTreeListItem suffix
|
|
15
|
+
|
|
9
16
|
## Version 2.1.1 (11 October 2022)
|
|
10
17
|
|
|
11
18
|
### Features
|
|
@@ -47,11 +47,3 @@ export const checkboxIndeterminate = () => ({
|
|
|
47
47
|
<ecs-checkbox indeterminate inline name="apple">Apples</ecs-checkbox>
|
|
48
48
|
</div>`,
|
|
49
49
|
});
|
|
50
|
-
|
|
51
|
-
export const checkboxHelpText = () => ({
|
|
52
|
-
components: { EcsCheckbox },
|
|
53
|
-
template: `<div>
|
|
54
|
-
<ecs-checkbox help="Help Text Label" name="apple">Apple</ecs-checkbox>
|
|
55
|
-
<ecs-checkbox help="Help Text Label" inline name="apple">Apple</ecs-checkbox>
|
|
56
|
-
</div>`,
|
|
57
|
-
});
|
|
@@ -37,3 +37,11 @@ export const formGroupWithErrorText = () => ({
|
|
|
37
37
|
<ecs-input id="name" placeholder="Please enter your name" />
|
|
38
38
|
</ecs-form-group>`,
|
|
39
39
|
});
|
|
40
|
+
|
|
41
|
+
export const formGroupWithSuccessText = () => ({
|
|
42
|
+
components: { EcsFormGroup, EcsInput },
|
|
43
|
+
template: `<ecs-form-group success-text="Your input was valid, you can be happy.">
|
|
44
|
+
<label for="name">Name</label>
|
|
45
|
+
<ecs-input id="name" placeholder="Please enter your name" />
|
|
46
|
+
</ecs-form-group>`,
|
|
47
|
+
});
|
|
@@ -37,16 +37,3 @@ export const radiobuttonInline = () => ({
|
|
|
37
37
|
Selected: {{ selected }}
|
|
38
38
|
</div>`,
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
export const radiobuttonHelpText = () => ({
|
|
42
|
-
components: { EcsRadiobutton },
|
|
43
|
-
data() {
|
|
44
|
-
return {
|
|
45
|
-
selected: 'apple'
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
template: `<div>
|
|
49
|
-
<ecs-radiobutton name="fruits" v-model="selected" value="orange" help="Help Text Label">Label</ecs-radiobutton>
|
|
50
|
-
<ecs-radiobutton name="fruits" v-model="selected" inline value="apple" help="Help Text Label">Label</ecs-radiobutton>
|
|
51
|
-
</div>`,
|
|
52
|
-
});
|