@everchron/ec-shards 1.6.3 → 1.6.5
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 +167 -103
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +167 -103
- 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/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/images/.DS_Store +0 -0
- package/src/assets/images/flags/.DS_Store +0 -0
- package/src/components/quicklink/quicklink.vue +1 -6
- package/src/components/swatches-picker/swatches-picker.vue +30 -12
- package/src/components/switch/switch.vue +102 -13
- package/src/stories/Changelog.stories.mdx +17 -0
- package/src/stories/collection-control/.DS_Store +0 -0
- package/src/stories/comment/.DS_Store +0 -0
- package/src/stories/data-card/.DS_Store +0 -0
- package/src/stories/data-list/.DS_Store +0 -0
- package/src/stories/dialog/.DS_Store +0 -0
- package/src/stories/dialog-header/.DS_Store +0 -0
- package/src/stories/directory-entry/.DS_Store +0 -0
- package/src/stories/document-state/.DS_Store +0 -0
- package/src/stories/dropzone/.DS_Store +0 -0
- package/src/stories/empty-state/.DS_Store +0 -0
- package/src/stories/excerpt-snippet/.DS_Store +0 -0
- package/src/stories/file-icon/.DS_Store +0 -0
- package/src/stories/file-list-item/.DS_Store +0 -0
- package/src/stories/flag/.DS_Store +0 -0
- package/src/stories/form-group/.DS_Store +0 -0
- package/src/stories/form-headline/.DS_Store +0 -0
- package/src/stories/form-set/.DS_Store +0 -0
- package/src/stories/formatted/.DS_Store +0 -0
- package/src/stories/icon/.DS_Store +0 -0
- package/src/stories/index-toolbar/.DS_Store +0 -0
- package/src/stories/info-tooltip/.DS_Store +0 -0
- package/src/stories/input/.DS_Store +0 -0
- package/src/stories/input-group/.DS_Store +0 -0
- package/src/stories/input-search/.DS_Store +0 -0
- package/src/stories/jumper-document/.DS_Store +0 -0
- package/src/stories/jumper-index/.DS_Store +0 -0
- package/src/stories/jumper-page/.DS_Store +0 -0
- package/src/stories/layout-data-table/.DS_Store +0 -0
- package/src/stories/layout-directory/.DS_Store +0 -0
- package/src/stories/layout-index/.DS_Store +0 -0
- package/src/stories/map/.DS_Store +0 -0
- package/src/stories/modal/.DS_Store +0 -0
- package/src/stories/multiselect-option/.DS_Store +0 -0
- package/src/stories/multiselect-search-token/.DS_Store +0 -0
- package/src/stories/multiselect-token/.DS_Store +0 -0
- package/src/stories/overlay/.DS_Store +0 -0
- package/src/stories/pagination/.DS_Store +0 -0
- package/src/stories/party-entry/.DS_Store +0 -0
- package/src/stories/popover-header/.DS_Store +0 -0
- package/src/stories/popover-list/.DS_Store +0 -0
- package/src/stories/popover-list-headline/.DS_Store +0 -0
- package/src/stories/popover-list-item/.DS_Store +0 -0
- package/src/stories/progress/.DS_Store +0 -0
- package/src/stories/quicklink/.DS_Store +0 -0
- package/src/stories/quicklink/quicklink.stories.js +6 -1
- package/src/stories/radiobutton/.DS_Store +0 -0
- package/src/stories/rating-favorability/.DS_Store +0 -0
- package/src/stories/rating-star-read/.DS_Store +0 -0
- package/src/stories/rating-star-write/.DS_Store +0 -0
- package/src/stories/scroll-container/.DS_Store +0 -0
- package/src/stories/section/.DS_Store +0 -0
- package/src/stories/segment/.DS_Store +0 -0
- package/src/stories/select/.DS_Store +0 -0
- package/src/stories/sequence-map-button/.DS_Store +0 -0
- package/src/stories/sidebar/.DS_Store +0 -0
- package/src/stories/skeleton-loader/.DS_Store +0 -0
- package/src/stories/sortbutton/.DS_Store +0 -0
- package/src/stories/sticker/.DS_Store +0 -0
- package/src/stories/structured-content/.DS_Store +0 -0
- package/src/stories/swatches-picker/swatches-picker.stories.js +7 -161
- package/src/stories/switch/.DS_Store +0 -0
- package/src/stories/switch/switch.stories.js +21 -1
- package/src/stories/tabs/.DS_Store +0 -0
- package/src/stories/tag/.DS_Store +0 -0
- package/src/stories/toast/.DS_Store +0 -0
- package/src/stories/transcript-state/.DS_Store +0 -0
- package/src/stories/tree-list/.DS_Store +0 -0
- package/src/stories/tree-list-item/.DS_Store +0 -0
- package/src/stories/video/.DS_Store +0 -0
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<template v-else-if="type === 'switch'">
|
|
27
|
-
<ecs-switch @input="$emit('toggle', $event)" :value="valueToggle" :disabled="
|
|
27
|
+
<ecs-switch @input="$emit('toggle', $event)" :value="valueToggle" :disabled="value == false" size="sml-toggle" colored>{{label}}</ecs-switch>
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<template v-else>
|
|
@@ -110,11 +110,6 @@
|
|
|
110
110
|
return `active`
|
|
111
111
|
else
|
|
112
112
|
return `subtle`
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
disableSwitch(){
|
|
116
|
-
console.log('disableSwitch', this.value == false, this.value)
|
|
117
|
-
return this.value == false
|
|
118
113
|
}
|
|
119
114
|
}
|
|
120
115
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
<template>
|
|
3
3
|
<div class="ecs-swatches" :class="sizeClass">
|
|
4
4
|
<div
|
|
5
|
-
v-for="item in swatches" :key="item.
|
|
6
|
-
@click="selectedColor = item.
|
|
5
|
+
v-for="item in swatches" :key="item.color"
|
|
6
|
+
@click="selectedColor = item.color"
|
|
7
7
|
:title="item.title"
|
|
8
8
|
class="ecs-swatches-color"
|
|
9
|
-
:style="{backgroundColor: item.
|
|
10
|
-
:class="selectedColor == item.
|
|
9
|
+
:style="{backgroundColor: item.color, color: item.color}"
|
|
10
|
+
:class="selectedColor == item.color ? 'active' : ''">
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
@@ -23,17 +23,30 @@
|
|
|
23
23
|
},
|
|
24
24
|
/** Sets the selected color value. Must be a HEX value that exists in the swatches (data) list. */
|
|
25
25
|
selected: {
|
|
26
|
-
type: String
|
|
27
|
-
|
|
28
|
-
/** The available color swatches the user can choose from. Array structure: contains Objects with `id`, `title`, `hex`. */
|
|
29
|
-
swatches: {
|
|
30
|
-
type: Array,
|
|
31
|
-
required: true
|
|
26
|
+
type: String,
|
|
27
|
+
validator: v => ['#F9DF00', '#F3A100', '#B7EA80', '#48E4C2', '#489DFF', '#B877F0', '#FD78FD', '#858E9F', '#227FD3', '#C59465', '#5DAF00', '#A4927A', '#95989C', '#D78B21', '#EE5452', 'null', null].includes(v)
|
|
32
28
|
}
|
|
33
29
|
},
|
|
34
30
|
|
|
35
31
|
data () {
|
|
36
32
|
return {
|
|
33
|
+
swatches: [
|
|
34
|
+
{ title: 'Yellow', color: '#F9DF00' },
|
|
35
|
+
{ title: 'Orange', color: '#F3A100' },
|
|
36
|
+
{ title: 'Lime', color: '#B7EA80' },
|
|
37
|
+
{ title: 'Cyan', color: '#48E4C2' },
|
|
38
|
+
{ title: 'Sky Blue', color: '#489DFF' },
|
|
39
|
+
{ title: 'Indigo', color: '#B877F0' },
|
|
40
|
+
{ title: 'Pink', color: '#FD78FD' },
|
|
41
|
+
{ title: 'Brown', color: '#C59465' },
|
|
42
|
+
{ title: 'Gray', color: '#858E9F' },
|
|
43
|
+
{ title: 'Red', color: '#EE5452' },
|
|
44
|
+
{ title: 'Dark Blue', color: '#227FD3' },
|
|
45
|
+
{ title: 'Green', color: '#5DAF00' },
|
|
46
|
+
{ title: 'Brass', color: '#A4927A' },
|
|
47
|
+
{ title: 'Silver', color: '#95989C' },
|
|
48
|
+
{ title: 'Gold', color: '#D78B21' }
|
|
49
|
+
],
|
|
37
50
|
selectedColor: this.selected,
|
|
38
51
|
selectedTitle: ''
|
|
39
52
|
}
|
|
@@ -49,14 +62,19 @@
|
|
|
49
62
|
|
|
50
63
|
methods: {
|
|
51
64
|
emitSelected(){
|
|
52
|
-
/** Returns the selected color value as
|
|
65
|
+
/** Returns the selected color value and title as Object.
|
|
66
|
+
this.$emit('input', {
|
|
67
|
+
color: this.selectedColor,
|
|
68
|
+
title: this.selectedTitle
|
|
69
|
+
})
|
|
70
|
+
*/
|
|
53
71
|
this.$emit('input', this.selectedColor)
|
|
54
72
|
}
|
|
55
73
|
},
|
|
56
74
|
|
|
57
75
|
watch: {
|
|
58
76
|
selectedColor(){
|
|
59
|
-
this.selectedTitle = this.swatches[this.swatches.findIndex(x => x.
|
|
77
|
+
this.selectedTitle = this.swatches[this.swatches.findIndex(x => x.color === this.selectedColor)].title
|
|
60
78
|
this.emitSelected()
|
|
61
79
|
}
|
|
62
80
|
}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
<label class="ecs-switch"
|
|
4
4
|
:class="[
|
|
5
5
|
sizeClass,
|
|
6
|
-
hasDefaultSlot ?
|
|
7
|
-
disabled ?
|
|
6
|
+
hasDefaultSlot ? 'ecs-switch-has-label' : '',
|
|
7
|
+
disabled ? 'disabled' : '',
|
|
8
|
+
colored ? 'ecs-switch-colored' : '',
|
|
9
|
+
indeterminate ? 'ecs-switch-indeterminate' : ''
|
|
8
10
|
]">
|
|
9
11
|
<input
|
|
10
12
|
type="checkbox"
|
|
@@ -15,7 +17,9 @@
|
|
|
15
17
|
:disabled="disabled"
|
|
16
18
|
:checked="checked"
|
|
17
19
|
@change="handleClick">
|
|
18
|
-
<div class="ecs-slide-switch"
|
|
20
|
+
<div class="ecs-slide-switch">
|
|
21
|
+
<div class="indeterminate" />
|
|
22
|
+
</div>
|
|
19
23
|
</label>
|
|
20
24
|
<label v-if="hasDefaultSlot" :for="id">
|
|
21
25
|
<slot></slot>
|
|
@@ -30,10 +34,10 @@
|
|
|
30
34
|
name: {
|
|
31
35
|
type: String
|
|
32
36
|
},
|
|
33
|
-
/** Determines the size of the switch. */
|
|
37
|
+
/** Determines the size of the switch. `sml-toggle` sets the toggle control size to small, but maintains a regular font size. */
|
|
34
38
|
size: {
|
|
35
39
|
type: String,
|
|
36
|
-
validator: v => ['sml', 'lg', 'null', null].includes(v)
|
|
40
|
+
validator: v => ['sml', 'sml-toggle', 'lg', 'md', 'null', null].includes(v)
|
|
37
41
|
},
|
|
38
42
|
/** Sets the switch to required. */
|
|
39
43
|
required: {
|
|
@@ -45,6 +49,16 @@
|
|
|
45
49
|
type: Boolean,
|
|
46
50
|
default: false
|
|
47
51
|
},
|
|
52
|
+
/** Reflects a true or false state with positive (green) and negative (red) colors. */
|
|
53
|
+
colored: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
/** Reflects an indeterminate switch state (e.g. not all options checked, but some). This is a purely visual setting. */
|
|
58
|
+
indeterminate: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
48
62
|
value: {
|
|
49
63
|
default: false,
|
|
50
64
|
required: false,
|
|
@@ -71,8 +85,6 @@
|
|
|
71
85
|
},
|
|
72
86
|
|
|
73
87
|
mounted () {
|
|
74
|
-
console.log('switch disabled', this.disabled)
|
|
75
|
-
console.log('switch checked', !!this.value, this.checked, this.value)
|
|
76
88
|
this.id = this._uid
|
|
77
89
|
},
|
|
78
90
|
|
|
@@ -83,7 +95,11 @@
|
|
|
83
95
|
|
|
84
96
|
sizeClass() {
|
|
85
97
|
if (this.size && this.size !== '')
|
|
86
|
-
|
|
98
|
+
if (this.size == 'sml-toggle'){
|
|
99
|
+
return `ecs-switch-sml regular-font`
|
|
100
|
+
} else {
|
|
101
|
+
return `ecs-switch-${this.size}`
|
|
102
|
+
}
|
|
87
103
|
return this.size
|
|
88
104
|
},
|
|
89
105
|
|
|
@@ -145,14 +161,24 @@
|
|
|
145
161
|
align-items: center;
|
|
146
162
|
}
|
|
147
163
|
|
|
148
|
-
&.disabled{
|
|
149
|
-
opacity: .5;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
164
|
input[type=checkbox] {
|
|
153
165
|
display:none;
|
|
154
166
|
}
|
|
155
167
|
|
|
168
|
+
.indeterminate{
|
|
169
|
+
width: 9px;
|
|
170
|
+
height: 4px;
|
|
171
|
+
border-radius: 2px;
|
|
172
|
+
position: absolute;
|
|
173
|
+
top: 50%;
|
|
174
|
+
left: 5px;
|
|
175
|
+
margin-top: -2px;
|
|
176
|
+
background: #FFF;
|
|
177
|
+
transition: .3s .15s;
|
|
178
|
+
transform: scale(.5);
|
|
179
|
+
opacity: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
156
182
|
&-has-label{
|
|
157
183
|
margin: $spacing-5 $spacing-15 $spacing-5 0;
|
|
158
184
|
|
|
@@ -160,9 +186,10 @@
|
|
|
160
186
|
margin: $spacing-5 0;
|
|
161
187
|
line-height: $spacing-30;
|
|
162
188
|
font-size: $type-scale-3-font-size;
|
|
163
|
-
|
|
189
|
+
line-height: $type-scale-3-line-height;
|
|
164
190
|
display: flex;
|
|
165
191
|
align-items: center;
|
|
192
|
+
user-select: none;
|
|
166
193
|
}
|
|
167
194
|
}
|
|
168
195
|
|
|
@@ -180,6 +207,13 @@
|
|
|
180
207
|
width: 10px;
|
|
181
208
|
height: 10px;
|
|
182
209
|
}
|
|
210
|
+
|
|
211
|
+
.indeterminate{
|
|
212
|
+
width: 4px;
|
|
213
|
+
height: 2px;
|
|
214
|
+
left: 3px;
|
|
215
|
+
margin-top: -1px;
|
|
216
|
+
}
|
|
183
217
|
}
|
|
184
218
|
|
|
185
219
|
input:checked + .ecs-slide-switch::after{
|
|
@@ -194,6 +228,15 @@
|
|
|
194
228
|
line-height: $type-scale-2-line-height;
|
|
195
229
|
}
|
|
196
230
|
}
|
|
231
|
+
|
|
232
|
+
&.regular-font.ecs-switch-has-label{
|
|
233
|
+
margin: $spacing-5 $spacing-10 $spacing-5 0;
|
|
234
|
+
|
|
235
|
+
+ label{
|
|
236
|
+
font-size: $type-scale-3-font-size;
|
|
237
|
+
line-height: $type-scale-2-line-height;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
197
240
|
}
|
|
198
241
|
|
|
199
242
|
&-lg{
|
|
@@ -210,6 +253,11 @@
|
|
|
210
253
|
width: 28px;
|
|
211
254
|
height: 28px;
|
|
212
255
|
}
|
|
256
|
+
|
|
257
|
+
.indeterminate{
|
|
258
|
+
width: 11px;
|
|
259
|
+
left: 6px;
|
|
260
|
+
}
|
|
213
261
|
}
|
|
214
262
|
|
|
215
263
|
input:checked + .ecs-slide-switch::after{
|
|
@@ -277,4 +325,45 @@
|
|
|
277
325
|
}
|
|
278
326
|
}
|
|
279
327
|
}
|
|
328
|
+
|
|
329
|
+
// Colored theme
|
|
330
|
+
.ecs-switch-colored{
|
|
331
|
+
.ecs-slide-switch{
|
|
332
|
+
&:before{
|
|
333
|
+
border-color: $color-red-9;
|
|
334
|
+
background: $color-red-8;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
input:checked + .ecs-slide-switch{
|
|
339
|
+
background-color: $color-green-8;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.ecs-switch-indeterminate{
|
|
344
|
+
input:checked + .ecs-slide-switch{
|
|
345
|
+
.indeterminate{
|
|
346
|
+
transform: scale(1);
|
|
347
|
+
opacity: 1;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
//Disabled state
|
|
353
|
+
.ecs-switch.disabled{
|
|
354
|
+
opacity: .5;
|
|
355
|
+
|
|
356
|
+
.ecs-slide-switch{
|
|
357
|
+
cursor: not-allowed;
|
|
358
|
+
|
|
359
|
+
&:before{
|
|
360
|
+
border-color: $color-gray-5;
|
|
361
|
+
background: $color-gray-4;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
input:checked + .ecs-slide-switch{
|
|
366
|
+
background-color: $color-gray-8;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
280
369
|
</style>
|
|
@@ -6,6 +6,23 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
6
6
|
Changelog
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
+
## Version 1.6.4 (15 September 2022)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Added new props and functionality to `EcsSwitch` component
|
|
14
|
+
- `indeterminate`: sets the switch to indeterminate state (only visually)
|
|
15
|
+
- `colored`: alters the switch colors to red/green
|
|
16
|
+
- `size="sml-toggle"`: shows the switch toggle in small, but it's label in a regular size
|
|
17
|
+
- improved disabled styles
|
|
18
|
+
- `EcsQuicklink` now uses the new colored switch theme for quicklinks that contain a switch.
|
|
19
|
+
|
|
20
|
+
## Version 1.6.1 (13 September 2022)
|
|
21
|
+
|
|
22
|
+
### Fixes
|
|
23
|
+
|
|
24
|
+
- Unscoped content styles of `EcsDataListItem` to allow more dynamic content injeciton.
|
|
25
|
+
|
|
9
26
|
## Version 1.6.0 (13 September 2022)
|
|
10
27
|
|
|
11
28
|
### Features
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -27,5 +27,10 @@ export const quicklinkFavorability = () => ({
|
|
|
27
27
|
|
|
28
28
|
export const quicklinkThreeWaySwitch = () => ({
|
|
29
29
|
components: { EcsQuicklink },
|
|
30
|
-
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
value: false,
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
template: `<ecs-quicklink @input="value = !value" :active="value" type="switch" label="Filter" :value="value" :valueToggle="true" :count="12" />`,
|
|
31
36
|
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|