@everchron/ec-shards 1.3.6 → 1.3.7

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": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -21,11 +21,12 @@
21
21
 
22
22
  <div class="ecs-pagination-dropdown">
23
23
  <span>Page</span>
24
- <div @click="showDropdown = !showDropdown" class="ecs-pagination-dropdown-button" :class="showDropdown ? `active` : ''">
25
- {{ currentPage }}
24
+ <div @click="toggleDropdown" class="ecs-pagination-dropdown-button" :class="[dropdownShown ? 'active' : '', totalPages ? '' : 'disabled']">
25
+ <template v-if="currentPage">{{ currentPage }}</template>
26
+ <template v-else>-</template>
26
27
 
27
28
  <transition name="dropdown">
28
- <div v-if="showDropdown" class="ecs-pagination-select scrollbar scrollbar-sml">
29
+ <div v-if="dropdownShown && totalPages" class="ecs-pagination-select scrollbar scrollbar-sml">
29
30
  <ecs-popover-list>
30
31
  <ecs-popover-list-item
31
32
  @click="$emit('update:page', n), hideDropdown"
@@ -38,7 +39,7 @@
38
39
  </div>
39
40
  </transition>
40
41
  </div>
41
- <span class="total">of {{ totalPages }}</span>
42
+ <span v-if="totalPages" class="total">of {{ totalPages }}</span>
42
43
  </div>
43
44
  </div>
44
45
  <div>
@@ -76,24 +77,27 @@
76
77
  /** The current page. */
77
78
  currentPage: {
78
79
  type: Number,
79
- required: true
80
80
  },
81
81
  /** The total pages of the index. */
82
82
  totalPages: {
83
83
  type: Number,
84
- required: true
85
84
  }
86
85
  },
87
86
 
88
87
  data() {
89
88
  return {
90
- showDropdown: false
89
+ dropdownShown: false
91
90
  }
92
91
  },
93
92
 
94
93
  methods: {
94
+ toggleDropdown(){
95
+ if(this.totalPages)
96
+ this.dropdownShown = !this.dropdownShown
97
+ },
98
+
95
99
  hideDropdown(){
96
- showDropdown = false
100
+ this.dropdownShown = false
97
101
  }
98
102
  }
99
103
  }
@@ -155,6 +159,7 @@
155
159
  margin: 0 6px;
156
160
  cursor: pointer;
157
161
  position: relative;
162
+ color: $color-gray-15;
158
163
 
159
164
  &:after{
160
165
  content: "";
@@ -174,6 +179,13 @@
174
179
  box-shadow: 0 1px 0 rgba($color-gray-2, .1) inset;
175
180
  background: rgba($color-gray-5, .1);
176
181
  }
182
+
183
+ &.disabled{
184
+ border: 1px solid $color-gray-3;
185
+ box-shadow: none;
186
+ cursor: not-allowed;
187
+ color: $color-gray-7;
188
+ }
177
189
  }
178
190
  }
179
191
 
@@ -17,34 +17,39 @@
17
17
 
18
18
  <script>
19
19
  import EcsIcon from '../icon/icon'
20
-
21
20
  export default {
22
21
  components: { EcsIcon },
23
-
24
22
  props: {
23
+ /** Adds an icon to the party entry. The list of available icon names can be found [here](https://github.com/everchron/ec-shards/tree/main/src/assets/icons). */
25
24
  icon: {
26
25
  type: String
27
26
  },
27
+ /** If the party entry tag should be represented by the default party side colors, set this party prop. */
28
28
  party: {
29
29
  type: String,
30
30
  validator: v => ['client', 'opposing', 'joint', 'other', 'court', 'unaffiliated'].includes(v)
31
31
  },
32
+ /** Renders a subtle colored background. */
32
33
  background: {
33
34
  type: Boolean,
34
35
  default: false
35
36
  },
37
+ /** Adds a shared badge indicator. */
36
38
  shared: {
37
39
  type: Boolean,
38
40
  default: false
39
41
  },
42
+ /** Determines the spacing between icon and text. */
40
43
  iconSpacing: {
41
44
  type: String,
42
45
  default: '5px'
43
46
  },
47
+ /** Determines the position of the icon. */
44
48
  iconPosition: {
45
49
  type: String,
46
50
  default: 'left'
47
51
  },
52
+ /** Determines the size of the icon. */
48
53
  iconSize: {
49
54
  type: String,
50
55
  default: '30px'
@@ -55,7 +60,7 @@
55
60
  },
56
61
  },
57
62
 
58
- computed: {
63
+ computed: {
59
64
  iconType() {
60
65
  switch (this.icon){
61
66
  case 'sequence':
@@ -71,7 +76,7 @@
71
76
  }
72
77
  },
73
78
 
74
- annotationBackgroundColor() {
79
+ annotationBackgroundColor() {
75
80
  switch (this.annotationColor){
76
81
  case 1:
77
82
  return 'rgba(249, 223, 0, 0.2)'
@@ -183,7 +188,6 @@
183
188
  <style lang="scss" scoped>
184
189
  @import "../../tokens/build/scss/tokens.scss";
185
190
  @import "../mixins/svg-uri";
186
-
187
191
  .ecs-party-entry{
188
192
  position: relative;
189
193
  display: inline-flex;
@@ -219,7 +223,7 @@
219
223
  &:not(.ecs-party-entry-background){
220
224
  background: transparent !important;
221
225
  }
222
-
226
+
223
227
  &.client{
224
228
  color: $color-party-client-content;
225
229
  }
@@ -264,7 +268,7 @@
264
268
  &.court{
265
269
  background-color: $color-party-court-background;
266
270
  }
267
-
271
+
268
272
  &.unaffiliated{
269
273
  background-color: $color-party-other-background;
270
274
  }
@@ -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.color"
6
- @click="selectedColor = item.color"
5
+ v-for="item in swatches" :key="item.id"
6
+ @click="selectedColor = item.hex"
7
7
  :title="item.title"
8
8
  class="ecs-swatches-color"
9
- :style="{backgroundColor: item.color, color: item.color}"
10
- :class="selectedColor == item.color ? 'active' : ''">
9
+ :style="{backgroundColor: item.hex, color: item.hex}"
10
+ :class="selectedColor == item.hex ? 'active' : ''">
11
11
  </div>
12
12
  </div>
13
13
  </template>
@@ -23,30 +23,17 @@
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
- validator: v => ['#F9DF00', '#F3A100', '#B7EA80', '#48E4C2', '#489DFF', '#B877F0', '#FD78FD', '#858E9F', '#227FD3', '#C59465', '#5DAF00', '#A4927A', '#95989C', '#D78B21', '#EE5452', 'null', null].includes(v)
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
28
32
  }
29
33
  },
30
34
 
31
35
  data () {
32
36
  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
- ],
50
37
  selectedColor: this.selected,
51
38
  selectedTitle: ''
52
39
  }
@@ -62,27 +49,14 @@
62
49
 
63
50
  methods: {
64
51
  emitSelected(){
65
- /** Returns the selected color value and title as Object.
66
- this.$emit('input', {
67
- color: this.selectedColor,
68
- title: this.selectedTitle
69
- })
70
- */
52
+ /** Returns the selected color value as HEX. */
71
53
  this.$emit('input', this.selectedColor)
72
54
  }
73
55
  },
74
56
 
75
- /*
76
- mounted () {
77
- if (this.selected)
78
- this.selectedTitle = this.swatches[this.swatches.findIndex(x => x.color === this.selectedColor)].title
79
- this.emitSelected()
80
- },
81
- */
82
-
83
57
  watch: {
84
58
  selectedColor(){
85
- this.selectedTitle = this.swatches[this.swatches.findIndex(x => x.color === this.selectedColor)].title
59
+ this.selectedTitle = this.swatches[this.swatches.findIndex(x => x.hex === this.selectedColor)].title
86
60
  this.emitSelected()
87
61
  }
88
62
  }
@@ -6,11 +6,12 @@ import { Meta } from '@storybook/addon-docs/blocks';
6
6
  Changelog
7
7
  </h1>
8
8
 
9
- ## Version 1.3.3 (27 August 2022)
9
+ ## Version 1.3.6 (29 August 2022)
10
10
 
11
- ### Changes
11
+ ### Fixes
12
12
 
13
- - Added flexDirection prop to EcsTabs component.
13
+ - Added flex and flexDirection prop to EcsTab component.
14
+ - Removed flex and flexDirection props from EcsTabs component.
14
15
 
15
16
  ## Version 1.3.2 (27 August 2022)
16
17
 
@@ -49,14 +49,16 @@ export const partyEntryWithBackground = () => ({
49
49
  export const partyEntryAnnotations = () => ({
50
50
  components: { EcsPartyEntry },
51
51
  template: `<main>
52
- <ecs-party-entry background icon="marker" :annotation-color="1">Annotation</ecs-party-entry>
53
- <ecs-party-entry background icon="marker" :annotation-color="2">Annotation</ecs-party-entry>
54
- <ecs-party-entry background icon="marker" :annotation-color="3">Annotation</ecs-party-entry>
55
- <ecs-party-entry background icon="marker" :annotation-color="4">Annotation</ecs-party-entry>
56
- <ecs-party-entry background icon="marker" :annotation-color="5">Annotation</ecs-party-entry>
57
- <ecs-party-entry background icon="marker" :annotation-color="6">Annotation</ecs-party-entry>
58
- <ecs-party-entry background icon="marker" :annotation-color="7">Annotation</ecs-party-entry>
59
- <ecs-party-entry background icon="marker" :annotation-color="8">Annotation</ecs-party-entry>
60
- <ecs-party-entry background icon="marker" :annotation-color="9">Annotation</ecs-party-entry>
52
+ <ecs-party-entry background icon="marker" color="#F9DF00">Annotation</ecs-party-entry>
53
+ <ecs-party-entry background icon="marker" color="#F3A100">Annotation</ecs-party-entry>
54
+ <ecs-party-entry background icon="marker" color="#B7EA80">Annotation</ecs-party-entry>
55
+ <ecs-party-entry background icon="marker" color="#48E4C2">Annotation</ecs-party-entry>
56
+ <ecs-party-entry background icon="marker" color="#489DFF">Annotation</ecs-party-entry>
57
+ <ecs-party-entry background icon="marker" color="#B877F0">Annotation</ecs-party-entry>
58
+ <ecs-party-entry background icon="marker" color="#FD78FD">Annotation</ecs-party-entry>
59
+ <ecs-party-entry background icon="marker" color="#858E9F">Annotation</ecs-party-entry>
60
+ <ecs-party-entry background icon="marker" color="#EE5452">Annotation</ecs-party-entry>
61
+ <ecs-party-entry background icon="marker">No Color Defined</ecs-party-entry>
62
+ <ecs-party-entry icon="marker" color="#EE5452">Annotation</ecs-party-entry>
61
63
  </main>`,
62
64
  });
@@ -9,13 +9,90 @@ export const SwatchesPicker = () => ({
9
9
  components: { EcsSwatchesPicker },
10
10
  data() {
11
11
  return {
12
- selectedColor: ''
12
+ selectedColor: '',
13
+ swatchesData: [
14
+ {
15
+ "id": 1,
16
+ "title": "Yellow",
17
+ "hex": "#F9DF00"
18
+ },
19
+ {
20
+ "id": 2,
21
+ "title": "Orange",
22
+ "hex": "#F3A100"
23
+ },
24
+ {
25
+ "id": 3,
26
+ "title": "Lime",
27
+ "hex": "#B7EA80"
28
+ },
29
+ {
30
+ "id": 4,
31
+ "title": "Cyan",
32
+ "hex": "#48E4C2"
33
+ },
34
+ {
35
+ "id": 5,
36
+ "title": "Blue",
37
+ "hex": "#489DFF"
38
+ },
39
+ {
40
+ "id": 6,
41
+ "title": "Indigo",
42
+ "hex": "#B877F0"
43
+ },
44
+ {
45
+ "id": 7,
46
+ "title": "Pink",
47
+ "hex": "#FD78FD"
48
+ },
49
+ {
50
+ "id": 8,
51
+ "title": "Brown",
52
+ "hex": "#C59465"
53
+ },
54
+ {
55
+ "id": 9,
56
+ "title": "Grey",
57
+ "hex": "#858E9F"
58
+ },
59
+ {
60
+ "id": 10,
61
+ "title": "Red",
62
+ "hex": "#EE5452"
63
+ },
64
+ {
65
+ "id": 11,
66
+ "title": "Dark Blue",
67
+ "hex": "#227FD3"
68
+ },
69
+ {
70
+ "id": 12,
71
+ "title": "Green",
72
+ "hex": "#5DAF00"
73
+ },
74
+ {
75
+ "id": 13,
76
+ "title": "Brass",
77
+ "hex": "#A4927A"
78
+ },
79
+ {
80
+ "id": 14,
81
+ "title": "Silver",
82
+ "hex": "#95989C"
83
+ },
84
+ {
85
+ "id": 15,
86
+ "title": "Gold",
87
+ "hex": "#D78B21"
88
+ }
89
+ ]
13
90
  }
14
91
  },
15
92
  template: `<div>
16
- <ecs-swatches-picker v-model="selectedColor" selected="#F9DF00" />
93
+ <ecs-swatches-picker v-model="selectedColor" selected="#F9DF00" :swatches="swatchesData" />
17
94
  <hr style="border: none; border-bottom: 1px solid #DADEE6; margin: 20px 0">
18
- Selected: {{ selectedColor.title }}, {{ selectedColor.color }}
95
+ Selected: {{ selectedColor }}
19
96
  </div>`,
20
97
  });
21
98
 
@@ -23,12 +100,89 @@ export const SwatchesPickerSizes = () => ({
23
100
  components: { EcsSwatchesPicker },
24
101
  data() {
25
102
  return {
26
- selectedColor: ''
103
+ selectedColor: '',
104
+ swatchesData: [
105
+ {
106
+ "id": 1,
107
+ "title": "Yellow",
108
+ "hex": "#F9DF00"
109
+ },
110
+ {
111
+ "id": 2,
112
+ "title": "Orange",
113
+ "hex": "#F3A100"
114
+ },
115
+ {
116
+ "id": 3,
117
+ "title": "Lime",
118
+ "hex": "#B7EA80"
119
+ },
120
+ {
121
+ "id": 4,
122
+ "title": "Cyan",
123
+ "hex": "#48E4C2"
124
+ },
125
+ {
126
+ "id": 5,
127
+ "title": "Blue",
128
+ "hex": "#489DFF"
129
+ },
130
+ {
131
+ "id": 6,
132
+ "title": "Indigo",
133
+ "hex": "#B877F0"
134
+ },
135
+ {
136
+ "id": 7,
137
+ "title": "Pink",
138
+ "hex": "#FD78FD"
139
+ },
140
+ {
141
+ "id": 8,
142
+ "title": "Brown",
143
+ "hex": "#C59465"
144
+ },
145
+ {
146
+ "id": 9,
147
+ "title": "Grey",
148
+ "hex": "#858E9F"
149
+ },
150
+ {
151
+ "id": 10,
152
+ "title": "Red",
153
+ "hex": "#EE5452"
154
+ },
155
+ {
156
+ "id": 11,
157
+ "title": "Dark Blue",
158
+ "hex": "#227FD3"
159
+ },
160
+ {
161
+ "id": 12,
162
+ "title": "Green",
163
+ "hex": "#5DAF00"
164
+ },
165
+ {
166
+ "id": 13,
167
+ "title": "Brass",
168
+ "hex": "#A4927A"
169
+ },
170
+ {
171
+ "id": 14,
172
+ "title": "Silver",
173
+ "hex": "#95989C"
174
+ },
175
+ {
176
+ "id": 15,
177
+ "title": "Gold",
178
+ "hex": "#D78B21"
179
+ }
180
+ ]
27
181
  }
28
182
  },
29
183
  template: `<div>
30
- <ecs-swatches-picker v-model="selectedColor" size="sml" selected="#F9DF00" />
31
- <ecs-swatches-picker v-model="selectedColor" size="md" selected="#F9DF00" />
32
- <ecs-swatches-picker v-model="selectedColor" size="lg" selected="#F9DF00" />
184
+ <ecs-swatches-picker v-model="selectedColor" size="sml" :swatches="swatchesData" selected="#D78B21" />
185
+ <ecs-swatches-picker v-model="selectedColor" size="md" :swatches="swatchesData" selected="#F9DF00" />
186
+ <ecs-swatches-picker v-model="selectedColor" size="lg" :swatches="swatchesData" selected="#F9DF00" />
33
187
  </div>`,
34
188
  });