@everchron/ec-shards 3.1.0 → 4.0.0

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.
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
  </div>
19
19
 
20
- <div v-if="$slots.sidebar" class="ecs-index-layout-sidebar" :class="[overlaySidebar ? 'overlay' : '']">
20
+ <div v-if="$slots.sidebar" class="ecs-index-layout-sidebar" :class="[overlaySidebar ? 'overlay' : '']" :style="sidebarPosition">
21
21
  <!-- @slot Slot for the sidebar. -->
22
22
  <slot name="sidebar"></slot>
23
23
  </div>
@@ -43,7 +43,16 @@
43
43
  type: Boolean,
44
44
  default: false
45
45
  }
46
- }
46
+ },
47
+
48
+ computed: {
49
+ sidebarPosition() {
50
+ if (this.overlaySidebar && this.$slots.sidebar)
51
+ return `bottom: 40px;`
52
+ else
53
+ return `bottom: 0px;`
54
+ },
55
+ },
47
56
  }
48
57
  </script>
49
58
 
@@ -99,10 +108,6 @@
99
108
  overflow: auto;
100
109
  }
101
110
 
102
- &-pagination{
103
- padding: 0 5px 5px 5px;
104
- }
105
-
106
111
  &-sidebar{
107
112
  &.overlay{
108
113
  position: absolute;
@@ -6,6 +6,13 @@ import { Meta } from '@storybook/addon-docs/blocks';
6
6
  Changelog
7
7
  </h1>
8
8
 
9
+ ## Version 3.1.1 (29 November 2022)
10
+
11
+ ### Fixes
12
+
13
+ - Fixed padding of pagination slot in EcsLayoutIndex component
14
+ - Fixed position of sidebar in EcsLayoutIndex component
15
+
9
16
  ## Version 3.1.0 (24 November 2022)
10
17
 
11
18
  ### Fixes
@@ -0,0 +1,28 @@
1
+ import EcsDataGrid from '@components/data-grid/data-grid';
2
+ import EcsDataGridGroup from '@components/data-grid/data-grid-group';
3
+ import EcsDataGridRow from '@components/data-grid/data-grid-row';
4
+ import EcsDataGridHeadCell from '@components/data-grid/data-grid-head-cell';
5
+ import EcsDataGridCell from '@components/data-grid/data-grid-cell';
6
+
7
+ export default {
8
+ title: 'Data/Data Grid/Cell',
9
+ component: EcsDataGridCell
10
+ };
11
+
12
+ export const cell = () => ({
13
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell },
14
+ template: `<ecs-data-grid>
15
+ <ecs-data-grid-row>
16
+ <ecs-data-grid-cell column="first" :width="200">Cell</ecs-data-grid-cell>
17
+ </ecs-data-grid-row>
18
+ </ecs-data-grid>`,
19
+ });
20
+
21
+ export const cellCustomPadding = () => ({
22
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell },
23
+ template: `<ecs-data-grid>
24
+ <ecs-data-grid-row>
25
+ <ecs-data-grid-cell column="first" :width="200" padding="20px 0 16px 8px">Cell</ecs-data-grid-cell>
26
+ </ecs-data-grid-row>
27
+ </ecs-data-grid>`,
28
+ });
@@ -0,0 +1,60 @@
1
+ import EcsDataGrid from '@components/data-grid/data-grid';
2
+ import EcsDataGridGroup from '@components/data-grid/data-grid-group';
3
+ import EcsDataGridRow from '@components/data-grid/data-grid-row';
4
+ import EcsDataGridHeadCell from '@components/data-grid/data-grid-head-cell';
5
+ import EcsDataGridCell from '@components/data-grid/data-grid-cell';
6
+ import EcsButton from '@components/button/button';
7
+ import EcsFlexRow from '@components/flex/flex-row';
8
+
9
+ export default {
10
+ title: 'Data/Data Grid/Group',
11
+ component: EcsDataGridGroup,
12
+ parameters: {
13
+ docs: {
14
+ description: {
15
+ component: 'Groups are used to to conditionally show and hide columns in a data grid. They are the equivalent of tabs inside tables.',
16
+ },
17
+ }
18
+ }
19
+ };
20
+
21
+ export const groupedColumns = () => ({
22
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell, EcsButton, EcsFlexRow },
23
+ data() {
24
+ return {
25
+ activeGroup: 1
26
+ }
27
+ },
28
+ template: `<div style="width: 100%; height: 400px">
29
+ <ecs-flex-row :gap="8" style="position:absolute; bottom: 16px; left: 16px;">
30
+ <ecs-button @click="activeGroup = 1">Group 1</ecs-button>
31
+ <ecs-button @click="activeGroup = 2">Group 2</ecs-button>
32
+ </ecs-flex-row>
33
+
34
+ <ecs-data-grid>
35
+ <template slot="head">
36
+ <ecs-data-grid-head-cell name="First Column" :min-width="200" :width="400" fixed-left fixed-left-last />
37
+ <ecs-data-grid-group :show="activeGroup == 1">
38
+ <ecs-data-grid-head-cell name="Group 1 First Column" :min-width="300" :width="500" />
39
+ <ecs-data-grid-head-cell name="Group 1 Second Column" :min-width="140" :width="200" />
40
+ </ecs-data-grid-group>
41
+ <ecs-data-grid-group :show="activeGroup == 2">
42
+ <ecs-data-grid-head-cell name="Group 2 First Column" :min-width="300" :width="500" />
43
+ <ecs-data-grid-head-cell name="Group 2 Seconds Column" :min-width="140" :width="200" />
44
+ </ecs-data-grid-group>
45
+ </template>
46
+
47
+ <ecs-data-grid-row v-for="index in 100" :key="index">
48
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
49
+ <ecs-data-grid-group :show="activeGroup == 1">
50
+ <ecs-data-grid-cell column="group-1-first" :min-width="300" :width="500">Group 1 First Column</ecs-data-grid-cell>
51
+ <ecs-data-grid-cell column="group-1-second" :min-width="140" :width="200">Group 1 Second Column</ecs-data-grid-cell>
52
+ </ecs-data-grid-group>
53
+ <ecs-data-grid-group :show="activeGroup == 2">
54
+ <ecs-data-grid-cell column="group-2-first" :min-width="300" :width="500">Group 2 First Column</ecs-data-grid-cell>
55
+ <ecs-data-grid-cell column="group-2-second" :min-width="140" :width="200">Group 2 Second Column</ecs-data-grid-cell>
56
+ </ecs-data-grid-group>
57
+ </ecs-data-grid-row>
58
+ </ecs-data-grid>
59
+ </div>`,
60
+ });
@@ -0,0 +1,77 @@
1
+ import EcsDataGrid from '@components/data-grid/data-grid';
2
+ import EcsDataGridGroup from '@components/data-grid/data-grid-group';
3
+ import EcsDataGridRow from '@components/data-grid/data-grid-row';
4
+ import EcsDataGridHeadCell from '@components/data-grid/data-grid-head-cell';
5
+ import EcsDataGridCell from '@components/data-grid/data-grid-cell';
6
+
7
+ export default {
8
+ title: 'Data/Data Grid/Head Cell',
9
+ component: EcsDataGridHeadCell
10
+ };
11
+
12
+ export const headCell = () => ({
13
+ components: { EcsDataGridHeadCell },
14
+ template: `<ecs-data-grid-head-cell name="Column" :min-width="200" :width="300" />`,
15
+ });
16
+
17
+ export const headCellIcon = () => ({
18
+ components: { EcsDataGridHeadCell, EcsDataGrid },
19
+ template: `<ecs-data-grid striped>
20
+ <template slot="head">
21
+ <ecs-data-grid-head-cell name="Comments" :width="80" icon="comment" />
22
+ </template>
23
+ </ecs-data-grid>`,
24
+ });
25
+
26
+ export const headCellSelect = () => ({
27
+ components: { EcsDataGridHeadCell, EcsDataGrid },
28
+ data() {
29
+ return {
30
+ selectOptions: [
31
+ { value: 'ecid', name: 'ECID' },
32
+ { value: 'bates', name: 'Bates Range' },
33
+ { value: 'trialex', name: 'Trial Exhibit'}
34
+ ]
35
+ }
36
+ },
37
+ template: `<ecs-data-grid striped>
38
+ <template slot="head">
39
+ <ecs-data-grid-head-cell name="Identifiers" :width="200" :select="selectOptions" />
40
+ </template>
41
+ </ecs-data-grid>`,
42
+ });
43
+
44
+ export const headCellSorting = () => ({
45
+ components: { EcsDataGridHeadCell, EcsDataGrid },
46
+ data() {
47
+ return {
48
+ columns: [
49
+ { id: 'col-1', name: 'Column 1', width: 200, sortable: true, sorting: 'descending' },
50
+ { id: 'col-2', name: 'Column 2', width: 200, sortable: true, sorting: 'none' },
51
+ { id: 'col-3', name: 'Column 3', width: 200, sortable: true, sorting: 'none' },
52
+ ]
53
+ }
54
+ },
55
+ methods: {
56
+ sortColumn(id, order){
57
+ this.columns.forEach(function (column, index) {
58
+ column.sorting = 'none'
59
+ if(column.id == id)
60
+ column.sorting = order
61
+ })
62
+ }
63
+ },
64
+ template: `<ecs-data-grid striped>
65
+ <template slot="head">
66
+ <ecs-data-grid-head-cell
67
+ v-for="(column, index) in columns"
68
+ :key="index"
69
+ @sortby="sortColumn(column.id, $event)"
70
+ :width="column.width"
71
+ :sortable="column.sortable"
72
+ :sorting="column.sorting"
73
+ :name="column.name"
74
+ :id="column.id" />
75
+ </template>
76
+ </ecs-data-grid>`,
77
+ });
@@ -0,0 +1,91 @@
1
+ import EcsDataGrid from '@components/data-grid/data-grid';
2
+ import EcsDataGridGroup from '@components/data-grid/data-grid-group';
3
+ import EcsDataGridRow from '@components/data-grid/data-grid-row';
4
+ import EcsDataGridHeadCell from '@components/data-grid/data-grid-head-cell';
5
+ import EcsDataGridCell from '@components/data-grid/data-grid-cell';
6
+ import EcsButton from '@components/button/button';
7
+
8
+ export default {
9
+ title: 'Data/Data Grid/Row',
10
+ component: EcsDataGridRow
11
+ };
12
+
13
+ export const states = () => ({
14
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell },
15
+ template: `<div style="width: 100%; height: 500px">
16
+ <ecs-data-grid striped>
17
+ <template slot="head">
18
+ <ecs-data-grid-head-cell name="First Column" :width="400" fixed-left fixed-left-last />
19
+ <ecs-data-grid-head-cell name="Second Column" :width="500" />
20
+ <ecs-data-grid-head-cell name="Third Column" :width="200" />
21
+ </template>
22
+
23
+ <ecs-data-grid-row state="selected" v-for="index in 2">
24
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>Selected State</ecs-data-grid-cell>
25
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
26
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
27
+ </ecs-data-grid-row>
28
+
29
+ <ecs-data-grid-row v-for="index in 3">
30
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
31
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
32
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
33
+ </ecs-data-grid-row>
34
+
35
+ <ecs-data-grid-row state="opened">
36
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>Opened in Viewer State</ecs-data-grid-cell>
37
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
38
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
39
+ </ecs-data-grid-row>
40
+
41
+ <ecs-data-grid-row v-for="index in 3">
42
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
43
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
44
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
45
+ </ecs-data-grid-row>
46
+
47
+ <ecs-data-grid-row state="droppable" v-for="index in 2">
48
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>Drag Target State</ecs-data-grid-cell>
49
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
50
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
51
+ </ecs-data-grid-row>
52
+ </ecs-data-grid>
53
+ </div>`,
54
+ });
55
+
56
+ export const newRowStates = () => ({
57
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell, EcsButton },
58
+ data() {
59
+ return {
60
+ addedRows: 1
61
+ }
62
+ },
63
+ methods: {
64
+ addRows() {
65
+ this.addedRows = this.addedRows + 2
66
+ }
67
+ },
68
+ template: `<div style="width: 100%; height: 400px">
69
+ <ecs-button @click="addRows" style="position:absolute; bottom: 16px; left: 16px;">Add Rows</ecs-button>
70
+
71
+ <ecs-data-grid>
72
+ <template slot="head">
73
+ <ecs-data-grid-head-cell name="First Column" :width="400" fixed-left fixed-left-last />
74
+ <ecs-data-grid-head-cell name="Second Column" :width="500" />
75
+ <ecs-data-grid-head-cell name="Third Column" :width="200" />
76
+ </template>
77
+
78
+ <ecs-data-grid-row v-for="index in 3">
79
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
80
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
81
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
82
+ </ecs-data-grid-row>
83
+
84
+ <ecs-data-grid-row state="added" v-for="index in addedRows">
85
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
86
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
87
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
88
+ </ecs-data-grid-row>
89
+ </ecs-data-grid>
90
+ </div>`,
91
+ });
@@ -0,0 +1,48 @@
1
+ import EcsDataGrid from '@components/data-grid/data-grid';
2
+ import EcsDataGridGroup from '@components/data-grid/data-grid-group';
3
+ import EcsDataGridRow from '@components/data-grid/data-grid-row';
4
+ import EcsDataGridHeadCell from '@components/data-grid/data-grid-head-cell';
5
+ import EcsDataGridCell from '@components/data-grid/data-grid-cell';
6
+
7
+ export default {
8
+ title: 'Data/Data Grid/Grid',
9
+ component: EcsDataGrid
10
+ };
11
+
12
+ export const grid = () => ({
13
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell },
14
+ template: `<div style="width: 100%; height: 500px">
15
+ <ecs-data-grid :striped="false">
16
+ <template slot="head">
17
+ <ecs-data-grid-head-cell name="First Column" :min-width="200" :width="400" fixed-left fixed-left-last />
18
+ <ecs-data-grid-head-cell name="Second Column" :min-width="300" :width="500" />
19
+ <ecs-data-grid-head-cell name="Third Column" :min-width="140" :width="200" />
20
+ </template>
21
+
22
+ <ecs-data-grid-row v-for="index in 100" :key="index">
23
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
24
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
25
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
26
+ </ecs-data-grid-row>
27
+ </ecs-data-grid>
28
+ </div>`,
29
+ });
30
+
31
+ export const gridStriped = () => ({
32
+ components: { EcsDataGrid, EcsDataGridGroup, EcsDataGridRow, EcsDataGridHeadCell, EcsDataGridCell },
33
+ template: `<div style="width: 100%; height: 500px">
34
+ <ecs-data-grid striped>
35
+ <template slot="head">
36
+ <ecs-data-grid-head-cell name="First Column" :min-width="200" :width="400" fixed-left fixed-left-last />
37
+ <ecs-data-grid-head-cell name="Second Column" :min-width="300" :width="500" />
38
+ <ecs-data-grid-head-cell name="Third Column" :min-width="140" :width="200" />
39
+ </template>
40
+
41
+ <ecs-data-grid-row v-for="index in 100" :key="index">
42
+ <ecs-data-grid-cell column="first" :min-width="200" :width="400" fixed-left fixed-left-last>First Column</ecs-data-grid-cell>
43
+ <ecs-data-grid-cell column="second" :min-width="300" :width="500">Second Column</ecs-data-grid-cell>
44
+ <ecs-data-grid-cell column="third" :min-width="140" :width="200">Third Column</ecs-data-grid-cell>
45
+ </ecs-data-grid-row>
46
+ </ecs-data-grid>
47
+ </div>`,
48
+ });
@@ -34,6 +34,14 @@ export const dataListItemPlain = () => ({
34
34
  </ecs-data-list>`
35
35
  });
36
36
 
37
+ export const dataListItemWithoutIdentifier = () => ({
38
+ components: { EcsDataList, EcsDataListItem, EcsButton },
39
+ template: `<ecs-data-list>
40
+ <ecs-data-list-item>Data</ecs-data-list-item>
41
+ <ecs-data-list-item :indent="false"><a href="https://google.com" target="_blank">Google</a></ecs-data-list-item>
42
+ </ecs-data-list>`
43
+ });
44
+
37
45
  export const dataListItemPlainBordered = () => ({
38
46
  components: { EcsDataList, EcsDataListItem, EcsButton },
39
47
  template: `<ecs-data-list>