@everchron/ec-shards 2.1.0 → 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 +172 -158
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +172 -158
- 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/form-group/form-group.vue +20 -15
- 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 +13 -0
- package/src/stories/form-group/form-group.stories.js +8 -0
package/package.json
CHANGED
|
@@ -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{
|
|
@@ -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,19 @@ 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
|
+
|
|
16
|
+
## Version 2.1.1 (11 October 2022)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- Added `help` prop to EcsCheckbox and EcsRadiobutton to render a small helper text underneath the label.
|
|
21
|
+
|
|
9
22
|
## Version 2.1.0 (11 October 2022)
|
|
10
23
|
|
|
11
24
|
### Breaking Changes
|
|
@@ -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
|
+
});
|