@everchron/ec-shards 0.6.53 → 0.6.66
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 +130 -116
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +130 -116
- 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/button/button.vue +3 -2
- package/src/components/button-table/button-table.vue +14 -5
- package/src/components/quicklink/quicklink.vue +2 -2
- package/src/components/rating-favorability/rating-favorability.vue +10 -11
- package/src/stories/button-table/button-table.stories.js +1 -1
- package/src/stories/rating-favorability/rating-favorability.stories.js +15 -15
- package/src/stories/rating-favorability/rating-favorability.stories.mdx +14 -14
package/package.json
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button
|
|
3
3
|
class="ecs-button-table"
|
|
4
|
-
:class="[
|
|
4
|
+
:class="[
|
|
5
|
+
active ? 'active' : '',
|
|
6
|
+
hasLabel,
|
|
7
|
+
subtle ? 'subtle' : ''
|
|
8
|
+
]"
|
|
9
|
+
:disabled="disabled"
|
|
5
10
|
@click="$emit('click', $event)"
|
|
6
11
|
@mouseover="$emit('mouseover', $event)"
|
|
7
12
|
@mouseleave="$emit('mouseleave', $event)">
|
|
8
13
|
|
|
9
14
|
<ecs-icon v-if="icon" :type="icon" width="20" height="20" />
|
|
10
|
-
<div v-if="label">{{ label }}</div>
|
|
15
|
+
<div v-if="label != null">{{ label }}</div>
|
|
11
16
|
</button>
|
|
12
17
|
</template>
|
|
13
18
|
|
|
@@ -29,13 +34,17 @@
|
|
|
29
34
|
type: String
|
|
30
35
|
},
|
|
31
36
|
label: {
|
|
32
|
-
type: String
|
|
37
|
+
type: [String, Number]
|
|
38
|
+
},
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
33
42
|
}
|
|
34
43
|
},
|
|
35
44
|
|
|
36
45
|
computed: {
|
|
37
46
|
hasLabel() {
|
|
38
|
-
if (this.label && this.label !== '')
|
|
47
|
+
if (this.label && this.label !== '' || this.label != null)
|
|
39
48
|
return `has-label`
|
|
40
49
|
return this.label
|
|
41
50
|
}
|
|
@@ -52,7 +61,7 @@
|
|
|
52
61
|
align-items: center;
|
|
53
62
|
border-radius: 3px;
|
|
54
63
|
background: rgba($gray-7, .1);
|
|
55
|
-
color: $gray-
|
|
64
|
+
color: $gray-14;
|
|
56
65
|
transition: .2s;
|
|
57
66
|
font-size: 14px;
|
|
58
67
|
padding: 1px;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</label>
|
|
8
8
|
|
|
9
9
|
<div v-else-if="type === 'favorability'" class="ecs-form-check" @click="$emit('click', $event)">
|
|
10
|
-
<ecs-rating-favorability :type="favorabilityType" rating="
|
|
10
|
+
<ecs-rating-favorability :type="favorabilityType" :rating="rating" :label="false" :disabled="disabled" />
|
|
11
11
|
<label class="ml-3">
|
|
12
12
|
<span class="static-label">{{label}}</span>
|
|
13
13
|
</label>
|
|
@@ -221,4 +221,4 @@
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
</style>
|
|
224
|
+
</style>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ecs-favorability" :class="typeClass">
|
|
3
|
-
<div class="ecs-favorability-button" :class="[css, loading ? `loading` : ``]" :title="
|
|
3
|
+
<div class="ecs-favorability-button" :class="[css, loading ? `loading` : ``]" :title="rating">
|
|
4
4
|
<ecs-icon :type="iconType" />
|
|
5
5
|
</div>
|
|
6
|
-
<span v-if="
|
|
6
|
+
<span v-if="label" class="label" :class="loading ? `loading` : ``">{{ rating }}</span>
|
|
7
7
|
|
|
8
8
|
<ecs-skeleton-loader v-if="loading" type="rect" :width="20" :height="20" />
|
|
9
|
-
<ecs-skeleton-loader v-if="loading &&
|
|
9
|
+
<ecs-skeleton-loader v-if="loading && label" type="single" style="width:calc(100% - 30px)" />
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
rating: {
|
|
26
26
|
type: String,
|
|
27
|
-
validator: v => ['
|
|
27
|
+
validator: v => ['good', 'mixed', 'bad', 'unrated'].includes(v),
|
|
28
28
|
required: true
|
|
29
29
|
},
|
|
30
30
|
type: {
|
|
@@ -45,10 +45,6 @@
|
|
|
45
45
|
},
|
|
46
46
|
|
|
47
47
|
computed: {
|
|
48
|
-
ratingLabel() {
|
|
49
|
-
return this.rating ? this.rating == 'Good' || this.rating == 'Bad' ? `${ this.rating } for Us` : this.rating : null
|
|
50
|
-
},
|
|
51
|
-
|
|
52
48
|
typeClass() {
|
|
53
49
|
if (this.type && this.type !== '')
|
|
54
50
|
return `ecs-favorability-${ this.type }`
|
|
@@ -57,12 +53,14 @@
|
|
|
57
53
|
|
|
58
54
|
iconType() {
|
|
59
55
|
switch (this.rating){
|
|
60
|
-
case '
|
|
56
|
+
case 'good':
|
|
61
57
|
return 'fav-arrow'
|
|
62
|
-
case '
|
|
58
|
+
case 'mixed':
|
|
63
59
|
return 'fav-mixed'
|
|
64
|
-
case '
|
|
60
|
+
case 'bad':
|
|
65
61
|
return 'fav-arrow'
|
|
62
|
+
case 'unrated':
|
|
63
|
+
return 'fav-unrated'
|
|
66
64
|
default:
|
|
67
65
|
return 'fav-unrated'
|
|
68
66
|
}
|
|
@@ -103,6 +101,7 @@
|
|
|
103
101
|
.label{
|
|
104
102
|
font-size: 13px;
|
|
105
103
|
margin-left: 8px;
|
|
104
|
+
text-transform: capitalize;
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
.good{
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
|
|
8
8
|
export const text = () => ({
|
|
9
9
|
components: { EcsButtonTable },
|
|
10
|
-
template: `<ecs-button-table icon="parties" label="
|
|
10
|
+
template: `<ecs-button-table icon="parties" label="5"></ecs-button-table>`,
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
export const iconOnly = () => ({
|
|
@@ -8,38 +8,38 @@ export default {
|
|
|
8
8
|
export const favorability = () => ({
|
|
9
9
|
components: { EcsRatingFavorability },
|
|
10
10
|
template: `<main>
|
|
11
|
-
<ecs-rating-favorability rating="
|
|
12
|
-
<ecs-rating-favorability rating="
|
|
13
|
-
<ecs-rating-favorability rating="
|
|
14
|
-
<ecs-rating-favorability rating="
|
|
11
|
+
<ecs-rating-favorability rating="good" />
|
|
12
|
+
<ecs-rating-favorability rating="mixed" />
|
|
13
|
+
<ecs-rating-favorability rating="bad" />
|
|
14
|
+
<ecs-rating-favorability rating="unrated" />
|
|
15
15
|
</main>`,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
export const favorabilityLabel = () => ({
|
|
19
19
|
components: { EcsRatingFavorability },
|
|
20
20
|
template: `<main>
|
|
21
|
-
<ecs-rating-favorability label rating="
|
|
22
|
-
<ecs-rating-favorability label rating="
|
|
23
|
-
<ecs-rating-favorability label rating="
|
|
24
|
-
<ecs-rating-favorability label rating="
|
|
21
|
+
<ecs-rating-favorability label rating="good" />
|
|
22
|
+
<ecs-rating-favorability label rating="mixed" />
|
|
23
|
+
<ecs-rating-favorability label rating="bad" />
|
|
24
|
+
<ecs-rating-favorability label rating="unrated" />
|
|
25
25
|
</main>`,
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
export const favorabilityTypes = () => ({
|
|
29
29
|
components: { EcsRatingFavorability },
|
|
30
30
|
template: `<main>
|
|
31
|
-
<ecs-rating-favorability rating="
|
|
32
|
-
<ecs-rating-favorability type="active" rating="
|
|
33
|
-
<ecs-rating-favorability type="subtle" rating="
|
|
31
|
+
<ecs-rating-favorability rating="good" />
|
|
32
|
+
<ecs-rating-favorability type="active" rating="good" />
|
|
33
|
+
<ecs-rating-favorability type="subtle" rating="good" />
|
|
34
34
|
</main>`,
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
export const favorabilityLoading = () => ({
|
|
38
38
|
components: { EcsRatingFavorability },
|
|
39
39
|
template: `<main>
|
|
40
|
-
<ecs-rating-favorability label loading rating="
|
|
41
|
-
<ecs-rating-favorability label loading rating="
|
|
42
|
-
<ecs-rating-favorability label loading rating="
|
|
43
|
-
<ecs-rating-favorability label loading rating="
|
|
40
|
+
<ecs-rating-favorability label loading rating="good" />
|
|
41
|
+
<ecs-rating-favorability label loading rating="mixed" />
|
|
42
|
+
<ecs-rating-favorability label loading rating="bad" />
|
|
43
|
+
<ecs-rating-favorability label loading rating="unrated" />
|
|
44
44
|
</main>`,
|
|
45
45
|
});
|
|
@@ -17,10 +17,10 @@ Rating component to rate documents and entries by favorability.
|
|
|
17
17
|
</Canvas>
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
<ecs-rating-favorability rating="
|
|
21
|
-
<ecs-rating-favorability rating="
|
|
22
|
-
<ecs-rating-favorability rating="
|
|
23
|
-
<ecs-rating-favorability rating="
|
|
20
|
+
<ecs-rating-favorability rating="good" />
|
|
21
|
+
<ecs-rating-favorability rating="mixed" />
|
|
22
|
+
<ecs-rating-favorability rating="bad" />
|
|
23
|
+
<ecs-rating-favorability rating="unrated" />
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Labels
|
|
@@ -34,10 +34,10 @@ Add a label to show the favorability name by adding the `label` prop.
|
|
|
34
34
|
</Canvas>
|
|
35
35
|
|
|
36
36
|
```js
|
|
37
|
-
<ecs-rating-favorability label rating="
|
|
38
|
-
<ecs-rating-favorability label rating="
|
|
39
|
-
<ecs-rating-favorability label rating="
|
|
40
|
-
<ecs-rating-favorability label rating="
|
|
37
|
+
<ecs-rating-favorability label rating="good" />
|
|
38
|
+
<ecs-rating-favorability label rating="mixed" />
|
|
39
|
+
<ecs-rating-favorability label rating="bad" />
|
|
40
|
+
<ecs-rating-favorability label rating="unrated" />
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
## Type
|
|
@@ -52,8 +52,8 @@ There are several visual variants of favorability ratings available. Set the `ty
|
|
|
52
52
|
|
|
53
53
|
```js
|
|
54
54
|
<ecs-rating-favorability rating="good" />
|
|
55
|
-
<ecs-rating-favorability type="active" rating="
|
|
56
|
-
<ecs-rating-favorability type="subtle" rating="
|
|
55
|
+
<ecs-rating-favorability type="active" rating="good" />
|
|
56
|
+
<ecs-rating-favorability type="subtle" rating="good" />
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
## Loading
|
|
@@ -67,10 +67,10 @@ Add the `loading` attribute to display a skeleton loader for the favorability co
|
|
|
67
67
|
</Canvas>
|
|
68
68
|
|
|
69
69
|
```js
|
|
70
|
-
<ecs-rating-favorability label loading rating="
|
|
71
|
-
<ecs-rating-favorability label loading rating="
|
|
72
|
-
<ecs-rating-favorability label loading rating="
|
|
73
|
-
<ecs-rating-favorability label loading rating="
|
|
70
|
+
<ecs-rating-favorability label loading rating="good" />
|
|
71
|
+
<ecs-rating-favorability label loading rating="mixed" />
|
|
72
|
+
<ecs-rating-favorability label loading rating="bad" />
|
|
73
|
+
<ecs-rating-favorability label loading rating="unrated" />
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
## Props
|