@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everchron/ec-shards",
3
- "version": "0.6.53",
3
+ "version": "0.6.66",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -384,13 +384,14 @@
384
384
 
385
385
  &:disabled{
386
386
  opacity: .5;
387
- cursor: not-allowed;
387
+ cursor: default;
388
+ filter: saturate(0);
388
389
 
389
390
  &:after{
390
391
  opacity: 0;
391
392
  }
392
393
  }
393
-
394
+
394
395
  &.loading{
395
396
  opacity: .7;
396
397
  cursor: wait;
@@ -1,13 +1,18 @@
1
1
  <template>
2
2
  <button
3
3
  class="ecs-button-table"
4
- :class="[ active ? 'active' : '', hasLabel, subtle ? 'subtle' : '' ]"
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-12;
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="Good" :label="false" :disabled="disabled" />
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="ratingLabel">
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="ratingLabel && label" class="label" :class="loading ? `loading` : ``">{{ ratingLabel }}</span>
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 && ratingLabel" type="single" style="width:calc(100% - 30px)" />
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 => ['Good', 'Mixed', 'Bad', 'Unrated'].includes(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 'Good':
56
+ case 'good':
61
57
  return 'fav-arrow'
62
- case 'Mixed':
58
+ case 'mixed':
63
59
  return 'fav-mixed'
64
- case 'Bad':
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="4"></ecs-button-table>`,
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="Good" />
12
- <ecs-rating-favorability rating="Mixed" />
13
- <ecs-rating-favorability rating="Bad" />
14
- <ecs-rating-favorability rating="Unrated" />
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="Good" />
22
- <ecs-rating-favorability label rating="Mixed" />
23
- <ecs-rating-favorability label rating="Bad" />
24
- <ecs-rating-favorability label rating="Unrated" />
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="Good" />
32
- <ecs-rating-favorability type="active" rating="Good" />
33
- <ecs-rating-favorability type="subtle" rating="Good" />
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="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" />
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="Good" />
21
- <ecs-rating-favorability rating="Mixed" />
22
- <ecs-rating-favorability rating="Bad" />
23
- <ecs-rating-favorability rating="Unrated" />
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="Good" />
38
- <ecs-rating-favorability label rating="Mixed" />
39
- <ecs-rating-favorability label rating="Bad" />
40
- <ecs-rating-favorability label rating="Unrated" />
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="Good" />
56
- <ecs-rating-favorability type="subtle" rating="Good" />
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="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" />
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