@everchron/ec-shards 2.1.7 → 2.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everchron/ec-shards",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -21,15 +21,17 @@
21
21
  :for="id || _uid">
22
22
 
23
23
  <slot />
24
+ <ecs-text v-if="$slots.default && help" type="form">{{ help }}</ecs-text>
24
25
  </label>
25
26
  </ecs-form-check>
26
27
  </template>
27
28
 
28
29
  <script>
29
30
  import EcsFormCheck from '../form-check/form-check'
31
+ import EcsText from '../text/text'
30
32
 
31
33
  export default {
32
- components: { EcsFormCheck },
34
+ components: { EcsFormCheck, EcsText },
33
35
  props: {
34
36
  /** Name attribute of the input. */
35
37
  name: {
@@ -71,7 +73,11 @@
71
73
  default: false
72
74
  },
73
75
  /** Unique ID */
74
- id: [String, Number]
76
+ id: [String, Number],
77
+ /** Help text that appears underneath (or next to, for inline checkboxes) the label. */
78
+ help: {
79
+ type: String
80
+ }
75
81
  },
76
82
 
77
83
  data() {
@@ -145,7 +151,8 @@
145
151
  width: 18px;
146
152
  height: 18px;
147
153
  left: 0;
148
- top: 0;
154
+ top: 50%;
155
+ margin-top: -9px;
149
156
  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>');
150
157
  }
151
158
 
@@ -157,7 +164,8 @@
157
164
  height: 2px;
158
165
  border-radius: 1px;
159
166
  left: 5px;
160
- top: 8px;
167
+ top: 50%;
168
+ margin-top: -1px;
161
169
  }
162
170
 
163
171
  &[type="checkbox"].indeterminate + label:before{
@@ -165,4 +173,13 @@
165
173
  border-color: rgba($color-blue-10, .3);
166
174
  }
167
175
  }
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
+ }
168
185
  </style>
@@ -4,10 +4,12 @@
4
4
  :class="[
5
5
  small ? 'ecs-data-list-item-sml' : '',
6
6
  full ? 'ecs-data-list-item-full' : '',
7
- plain ? '' : 'indent'
7
+ plain ? 'plain' : 'filled',
8
+ indent ? 'indent' : '',
9
+ plain && bordered ? 'bordered' : ''
8
10
  ]">
9
- <div class="ecs-data-list-identifier">
10
- {{identifier}}
11
+ <div v-if="hasIdentifier" class="ecs-data-list-identifier">
12
+ {{ identifier }}
11
13
  <ecs-button-more type="ellipsis"
12
14
  v-if="$slots.collapse"
13
15
  class="ecs-data-list-expand-button"
@@ -43,8 +45,7 @@
43
45
  props: {
44
46
  /** The label that shows up to the left of the list item. Usually describes the content to the left, e.g.: "Type", "Profiles", etc. */
45
47
  identifier: {
46
- type: String,
47
- required: true
48
+ type: String
48
49
  },
49
50
  /** Renders the list item in a smaller variant. */
50
51
  small: {
@@ -90,6 +91,16 @@
90
91
  plain: {
91
92
  type: Boolean,
92
93
  default: false
94
+ },
95
+ /** Adds a border bottom to each item (except the last in the list). **Important** the border is only applied when used in combination with the `plain` prop. */
96
+ bordered: {
97
+ type: Boolean,
98
+ default: false
99
+ },
100
+ /** Determines if there should be a left/right padding in the content areas. */
101
+ indent: {
102
+ type: Boolean,
103
+ default: true
93
104
  }
94
105
  },
95
106
 
@@ -104,7 +115,12 @@
104
115
  if (this.type && this.type !== '')
105
116
  return `data-list-data-${this.type}`
106
117
  return this.type
107
- }
118
+ },
119
+
120
+ hasIdentifier() {
121
+ if ((this.identifier && this.identifier !== '') || this.$slots.collapse)
122
+ return true
123
+ },
108
124
  },
109
125
 
110
126
  methods : {
@@ -195,10 +211,15 @@
195
211
  }
196
212
  }
197
213
 
198
- &.indent{
214
+ &.filled{
199
215
  .ecs-data-list-identifier{
200
216
  background: rgba($color-gray-6, .1);
201
217
  color: $color-gray-10;
218
+ }
219
+ }
220
+
221
+ &.indent{
222
+ .ecs-data-list-identifier{
202
223
  padding: 6px 8px;
203
224
  }
204
225
 
@@ -206,24 +227,37 @@
206
227
  padding: 6px 0 6px 8px;
207
228
  }
208
229
  }
230
+
231
+ &.bordered{
232
+ border-bottom: 1px solid $color-gray-3;
233
+ margin-bottom: 0;
234
+ }
209
235
  }
210
236
 
211
237
  > div{
212
- &:first-child > .ecs-data-list-item .ecs-data-list-identifier{
213
- border-top-left-radius: $border-radius-small;
238
+ &:first-child{
239
+ > .ecs-data-list-item .ecs-data-list-identifier{
240
+ border-top-left-radius: $border-radius-small;
241
+ }
242
+
243
+ > .ecs-data-list-item.ecs-data-list-item-full .ecs-data-list-identifier{
244
+ border-top-left-radius: $border-radius-small;
245
+ border-top-right-radius: $border-radius-small;
246
+ }
214
247
  }
215
248
 
216
- &:last-child > .ecs-data-list-item .ecs-data-list-identifier{
217
- border-bottom-left-radius: $border-radius-small;
218
- }
249
+ &:last-child{
250
+ > .ecs-data-list-item .ecs-data-list-identifier{
251
+ border-bottom-left-radius: $border-radius-small;
252
+ }
219
253
 
220
- &:first-child > .ecs-data-list-item.ecs-data-list-item-full .ecs-data-list-identifier{
221
- border-top-left-radius: $border-radius-small;
222
- border-top-right-radius: $border-radius-small;
223
- }
254
+ > .ecs-data-list-item.ecs-data-list-item-full .ecs-data-list-identifier{
255
+ border-bottom-left-radius: 0;
256
+ }
224
257
 
225
- &:last-child > .ecs-data-list-item.ecs-data-list-item-full .ecs-data-list-identifier{
226
- border-bottom-left-radius: 0;
258
+ .ecs-data-list-item.bordered{
259
+ border-bottom: none;
260
+ }
227
261
  }
228
262
  }
229
263
 
@@ -250,7 +284,7 @@
250
284
  }
251
285
 
252
286
  &-data{
253
- width: calc(100% - 145px);
287
+ flex: 1;
254
288
  padding: 6px 0;
255
289
  position: relative;
256
290
  z-index: 0;
@@ -32,7 +32,7 @@
32
32
  .ecs-form-check {
33
33
  position: relative;
34
34
  display: block;
35
- height: 18px;
35
+ min-height: 18px;
36
36
  margin-bottom: $spacing-25;
37
37
 
38
38
  &.stand-alone{
@@ -49,6 +49,10 @@
49
49
  &-inline{
50
50
  display: inline-block;
51
51
  margin-right: 30px;
52
+
53
+ .ecs-form-check-label{
54
+ display: inline-flex;
55
+ }
52
56
  }
53
57
 
54
58
  &.disabled {
@@ -72,10 +76,11 @@
72
76
 
73
77
  .ecs-form-check-label {
74
78
  min-width: 18px;
75
- height: 18px;
79
+ min-height: 18px;
76
80
  margin-bottom: 0;
77
81
  padding-left: 30px;
78
- display: inline-flex;
82
+ display: flex;
83
+ flex-wrap: wrap;
79
84
  align-items: center;
80
85
  }
81
86
 
@@ -95,7 +100,8 @@
95
100
  vertical-align: text-top;
96
101
  position: absolute;
97
102
  left: 0;
98
- top: 0;
103
+ top: 50%;
104
+ margin-top: -9px;
99
105
  width: 18px;
100
106
  height: 18px;
101
107
  background: white;
@@ -126,7 +132,7 @@
126
132
  label{
127
133
  display: inline-block;
128
134
  font-size: $type-scale-3-font-size;
129
- line-height: 18px;
135
+ line-height: $type-scale-3-line-height;
130
136
  margin-bottom: $spacing-10;
131
137
  -webkit-user-select: none;
132
138
  -moz-user-select: none;
@@ -239,10 +239,5 @@
239
239
  align-items: center;
240
240
  width: 100%;
241
241
  }
242
-
243
- .ecs-form-check-input + label:before,
244
- .ecs-form-check-input + label:after{
245
- top: auto !important;
246
- }
247
242
  }
248
243
  </style>
@@ -21,14 +21,17 @@
21
21
  :for="id">
22
22
 
23
23
  <slot />
24
+ <ecs-text v-if="$slots.default && help" type="form">{{ help }}</ecs-text>
24
25
  </label>
25
26
  </ecs-form-check>
26
27
  </template>
27
28
 
28
29
  <script>
29
30
  import EcsFormCheck from '../form-check/form-check'
31
+ import EcsText from '../text/text'
32
+
30
33
  export default {
31
- components: { EcsFormCheck },
34
+ components: { EcsFormCheck, EcsText },
32
35
 
33
36
  model: {
34
37
  prop: 'checked',
@@ -62,6 +65,10 @@
62
65
  inline: {
63
66
  type: Boolean,
64
67
  default: false
68
+ },
69
+ /** Help text that appears underneath (or next to, for inline radiobuttons) the label. */
70
+ help: {
71
+ type: String
65
72
  }
66
73
  },
67
74
 
@@ -133,8 +140,18 @@
133
140
  background: $color-blue-10;
134
141
  width: 6px;
135
142
  height: 6px;
136
- top: 6px;
143
+ top: 50%;
144
+ margin-top: -3px;
137
145
  left: 6px;
138
146
  }
139
147
  }
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
+ }
140
157
  </style>
@@ -6,6 +6,18 @@ import { Meta } from '@storybook/addon-docs/blocks';
6
6
  Changelog
7
7
  </h1>
8
8
 
9
+ ## Version 2.1.9 (1 November 2022)
10
+
11
+ ### Features
12
+
13
+ - Added `indent` and `bordered` props to EcsDataListItem for more variants in possible style.
14
+
15
+ ## Version 2.1.8 (30 October 2022)
16
+
17
+ ### Features
18
+
19
+ - Added `help` prop to EcsCheckbox and EcsRadiobutton to render a small helper text underneath the label.
20
+
9
21
  ## Version 2.1.6 (28 October 2022)
10
22
 
11
23
  ### Features
@@ -31,12 +43,6 @@ import { Meta } from '@storybook/addon-docs/blocks';
31
43
  - Refactor EcsFormGroup error text with EcsText component
32
44
  - Added some padding to EcsTreeListItem suffix
33
45
 
34
- ## Version 2.1.1 (11 October 2022)
35
-
36
- ### Features
37
-
38
- - Added `help` prop to EcsCheckbox and EcsRadiobutton to render a small helper text underneath the label.
39
-
40
46
  ## Version 2.1.0 (11 October 2022)
41
47
 
42
48
  ### Breaking Changes
@@ -47,3 +47,11 @@ 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
+ });
@@ -11,7 +11,7 @@ export const dataListItem = () => ({
11
11
  components: { EcsDataList, EcsDataListItem, EcsButton },
12
12
  template: `<ecs-data-list>
13
13
  <ecs-data-list-item identifier="Identifier">Data</ecs-data-list-item>
14
- <ecs-data-list-item identifier="Identifier">Data</ecs-data-list-item>
14
+ <ecs-data-list-item escape identifier="Identifier">Data</ecs-data-list-item>
15
15
  <ecs-data-list-item identifier="Identifier"><a href="https://google.com" target="_blank">Google</a></ecs-data-list-item>
16
16
  </ecs-data-list>`
17
17
  });
@@ -25,6 +25,24 @@ export const dataListItemFull = () => ({
25
25
  </ecs-data-list>`
26
26
  });
27
27
 
28
+ export const dataListItemPlain = () => ({
29
+ components: { EcsDataList, EcsDataListItem, EcsButton },
30
+ template: `<ecs-data-list>
31
+ <ecs-data-list-item plain identifier="Identifier">Data</ecs-data-list-item>
32
+ <ecs-data-list-item plain full identifier="Identifier">Full Data</ecs-data-list-item>
33
+ <ecs-data-list-item plain identifier="Identifier"><a href="https://google.com" target="_blank">Google</a></ecs-data-list-item>
34
+ </ecs-data-list>`
35
+ });
36
+
37
+ export const dataListItemPlainBordered = () => ({
38
+ components: { EcsDataList, EcsDataListItem, EcsButton },
39
+ template: `<ecs-data-list>
40
+ <ecs-data-list-item plain bordered identifier="Identifier">Data</ecs-data-list-item>
41
+ <ecs-data-list-item plain bordered full identifier="Identifier">Full Data</ecs-data-list-item>
42
+ <ecs-data-list-item plain bordered identifier="Identifier"><a href="https://google.com" target="_blank">Google</a></ecs-data-list-item>
43
+ </ecs-data-list>`
44
+ });
45
+
28
46
  export const dataListItemExpandable = () => ({
29
47
  components: { EcsDataList, EcsDataListItem },
30
48
  template: `<ecs-data-list>
@@ -37,3 +37,16 @@ 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
+ });