@everchron/ec-shards 7.5.7 → 7.5.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": "7.5.7",
3
+ "version": "7.5.9",
4
4
  "private": false,
5
5
  "description": "Everchron Shards UI Library",
6
6
  "repository": "https://github.com/everchron/ec-shards.git",
@@ -25,6 +25,19 @@
25
25
  <div class="ecs-data-card-inner">
26
26
  <div class="ecs-data-card-row">
27
27
  <div class="ecs-data-card-row-inner">
28
+ <ecs-button
29
+ @click="isExpanded = !isExpanded"
30
+ v-if="expandable && expandPosition === 'left'"
31
+ type="secondary"
32
+ :aria-controls="expandId"
33
+ :aria-expanded="isExpanded ? 'true' : 'false'"
34
+ icon-only
35
+ :icon="expandIcon ? expandIcon : (isExpanded ? 'chevron-down' : 'chevron-right')"
36
+ size="sml"
37
+ :active="isExpanded"
38
+ :aria-label="expandLabel ? expandLabel : (isExpanded ? 'Collapse' : 'Expand')"
39
+ class="expand-button-left"
40
+ />
28
41
  <div class="ecs-data-card-row-inner-text">
29
42
  <slot></slot>
30
43
  </div>
@@ -35,7 +48,7 @@
35
48
  </div>
36
49
  <ecs-button-table
37
50
  @click="isExpanded = !isExpanded"
38
- v-if="expandable"
51
+ v-if="expandable && expandPosition === 'right'"
39
52
  :aria-controls="expandId"
40
53
  :aria-expanded="isExpanded ? 'true' : 'false'"
41
54
  pale
@@ -44,7 +57,7 @@
44
57
  :active="isExpanded"
45
58
  :icon="expandIcon"
46
59
  :label="expandLabel"
47
- class="expand-button" />
60
+ class="expand-button-right" />
48
61
  </div>
49
62
  </div>
50
63
  <div v-if="$slots.meta" class="ecs-data-card-row">
@@ -74,11 +87,12 @@
74
87
  import EcsIcon from '../icon/icon'
75
88
  import EcsSkeletonLoader from '../skeleton-loader/skeleton-loader'
76
89
  import EcsButtonTable from '../button-table/button-table'
90
+ import EcsButton from '../button/button'
77
91
  import EcsFocusRing from '../mixins/focus-ring'
78
92
  import { uniqueIdMixin } from '../mixins/unique-id'
79
93
 
80
94
  export default {
81
- components: { EcsIcon, EcsSkeletonLoader, EcsButtonTable, EcsFocusRing },
95
+ components: { EcsIcon, EcsSkeletonLoader, EcsButtonTable, EcsButton, EcsFocusRing },
82
96
  mixins: [uniqueIdMixin],
83
97
 
84
98
  props: {
@@ -137,6 +151,12 @@
137
151
  /** Sets the label of the expand button. */
138
152
  expandLabel: {
139
153
  type: String
154
+ },
155
+ /** Defines the position of the expand button. */
156
+ expandPosition: {
157
+ type: String,
158
+ default: 'right',
159
+ validator: v => ['right', 'left'].includes(v)
140
160
  }
141
161
  },
142
162
 
@@ -348,10 +368,14 @@
348
368
  color: $color-gray-10;
349
369
  }
350
370
 
351
- .expand-button{
371
+ .expand-button-right{
352
372
  margin-left: 8px;
353
373
  }
354
374
 
375
+ .expand-button-left{
376
+ margin: -2px 4px -2px -2px;
377
+ }
378
+
355
379
  .chained{
356
380
  display: inline-flex;
357
381
 
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <div class="ecs-donut-chart" :style="wrapperPadding">
3
+ <svg :height="size" :width="size" :viewBox="viewBox">
4
+ <g>
5
+ <circle :cx="size / 2" :cy="size / 2" :r="size / 2" stroke="red" :stroke-width="strokeWidth" :stroke-dasharray="circumference" :stroke-dashoffset="0" fill="transparent" :transform="'rotate(-90 ' + size / 2 + ' ' + size / 2 + ')'" />
6
+ <circle :cx="size/2" :cy="size/2" :r="size/2" :stroke="color" :stroke-width="strokeWidth" :stroke-dasharray="circumference" :stroke-dashoffset="calculateStrokeDashOffset(value, circumference)" fill="transparent" :transform="'rotate(-90 ' + size/2 + ' ' + size/2 + ')'" />
7
+ </g>
8
+ </svg>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ props: {
15
+ /** The initial value of the chart as a percentage. */
16
+ value: {
17
+ type: Number,
18
+ required: true,
19
+ validator: value => value >= 0 && value <= 100
20
+ },
21
+ /** The color of the chart. */
22
+ color: {
23
+ type: String,
24
+ default: "#6495ED"
25
+ },
26
+ /** The width of the chart's stroke. */
27
+ strokeWidth: {
28
+ type: Number,
29
+ default: 30
30
+ },
31
+ /** The size of the chart. */
32
+ size: {
33
+ type: Number,
34
+ default: 160
35
+ }
36
+ },
37
+
38
+ computed: {
39
+ circumference() {
40
+ return 2 * Math.PI * (this.size/2)
41
+ },
42
+
43
+ viewBox() {
44
+ return `0 0 ${this.size} ${this.size}`
45
+ },
46
+
47
+ wrapperPadding() {
48
+ return { padding: `${this.strokeWidth/2}px` }
49
+ }
50
+ },
51
+
52
+ methods: {
53
+ calculateStrokeDashOffset(dataVal, circumference) {
54
+ const strokeDiff = this.dataPercentage(dataVal) * circumference
55
+ return circumference - strokeDiff
56
+ },
57
+ dataPercentage(dataVal) {
58
+ return dataVal / 100
59
+ }
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <style lang="scss" scoped>
65
+ .ecs-donut-chart {
66
+ display: inline-flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+
70
+ svg{
71
+ overflow: visible;
72
+ }
73
+ }
74
+ </style>
@@ -8,7 +8,7 @@
8
8
  {{ currentPage }}
9
9
  </div>
10
10
  <div class="total-pages">of {{ lastPage }}</div>
11
- <span v-if="isTranscriptMissingPages" style="color:tomato" title="This transcript has missing page gaps">*</span>
11
+ <span v-if="isTranscriptMissingPages" class="page-missing-gaps" title="This transcript has missing page gaps">*</span>
12
12
  </div>
13
13
  <div class="ecs-viewer-pages-pagination">
14
14
  <div class="total-pages-relative">{{ altPageNumber }}&nbsp;</div>
@@ -160,4 +160,12 @@
160
160
  color: $color-gray-8;
161
161
  margin-top: 4px;
162
162
  }
163
+
164
+ .page-missing-gaps{
165
+ color: $color-red-7;
166
+ font-size: $type-scale-5-font-size;
167
+ margin: -6px 0 0 0px;
168
+ padding: 2px;
169
+ cursor: help;
170
+ }
163
171
  </style>
@@ -150,6 +150,20 @@ export const expandable = () => ({
150
150
  </ecs-data-card>`
151
151
  });
152
152
 
153
+ export const expandablePostion = () => ({
154
+ components: { EcsDataCard, EcsButtonMore },
155
+ template: `<ecs-data-card expandable expand-position="left">
156
+ <span>Added last 2 months</span>
157
+ <span class="subtle">4h ago</span>
158
+ <template slot="meta">
159
+ <span class="subtle"><span class="color-venta-1">32 documents</span> added by Marie Walsh</span>
160
+ </template>
161
+ <template slot="expand">
162
+ test
163
+ </template>
164
+ </ecs-data-card>`
165
+ });
166
+
153
167
  export const loading = () => ({
154
168
  components: { EcsDataCardList, EcsDataCard },
155
169
  template: `<ecs-data-card-list>
@@ -0,0 +1,12 @@
1
+ import EcsDonutChart from '@components/donut-chart/donut-chart';
2
+
3
+ export default {
4
+ title: 'Data/Donut Chart',
5
+ component: EcsDonutChart
6
+ };
7
+
8
+ export const chart = () => ({
9
+ components: { EcsDonutChart },
10
+ template: `<ecs-donut-chart :value="90" :stroke-width="10" />
11
+ `,
12
+ });
@@ -14,3 +14,8 @@ export const jumperPageRelative = () => ({
14
14
  components: { EcsJumperPage },
15
15
  template: `<ecs-jumper-page :current-page="2" :page-count="70" :relative-page="40" :last-page="80" />`,
16
16
  });
17
+
18
+ export const jumperPageRelativeWithPageMissing = () => ({
19
+ components: { EcsJumperPage },
20
+ template: `<ecs-jumper-page :current-page="2" :page-count="70" :relative-page="40" :last-page="80" isTranscriptMissingPages />`,
21
+ });