@afeefa/vue-app 0.0.326 → 0.0.328

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.
@@ -1 +1 @@
1
- 0.0.326
1
+ 0.0.328
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.326",
3
+ "version": "0.0.328",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div :class="['a-table2', {border: hasBorder}]" :style="gridStyle">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+
8
+ <script>
9
+ import { Component, Vue } from '@a-vue'
10
+
11
+ @Component({
12
+ props: [{border: false}, 'columns'],
13
+ provide () {
14
+ return {
15
+ table2Border: this.hasBorder
16
+ }
17
+ }
18
+ })
19
+ export default class ATable2 extends Vue {
20
+ get hasBorder () {
21
+ return this.border !== false && this.border !== undefined
22
+ }
23
+
24
+ get gridStyle () {
25
+ const columns = this.columns || []
26
+ return {
27
+ 'grid-template-columns': columns.join(' ')
28
+ }
29
+ }
30
+ }
31
+ </script>
32
+
33
+
34
+ <style lang="scss" scoped>
35
+ .a-table2 {
36
+ display: grid;
37
+ width: 100%;
38
+ }
39
+ </style>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div :class="['a-table2-header', {small: hasSmall, border: table2Border}]">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+
8
+ <script>
9
+ import { Component, Vue } from '@a-vue'
10
+
11
+ @Component({
12
+ props: ['small'],
13
+ inject: {
14
+ table2Border: { default: false }
15
+ }
16
+ })
17
+ export default class ATable2Header extends Vue {
18
+ get hasSmall () {
19
+ return this.small !== undefined && this.small !== false
20
+ }
21
+ }
22
+ </script>
23
+
24
+
25
+ <style lang="scss" scoped>
26
+ .a-table2-header {
27
+ display: contents;
28
+
29
+ > :deep(*) {
30
+ text-transform: uppercase;
31
+ letter-spacing: 1px;
32
+ color: #999999;
33
+ font-size: .9rem;
34
+ padding: .4rem 1.5rem .4rem 0;
35
+
36
+ &:last-child {
37
+ padding-right: 0;
38
+ }
39
+ }
40
+
41
+ &.border > :deep(*) {
42
+ border-bottom: 1px solid #EEEEEE;
43
+ padding-left: .5rem;
44
+ padding-bottom: .6rem;
45
+
46
+ &:last-child {
47
+ padding-right: .2rem;
48
+ }
49
+ }
50
+
51
+ &.small > :deep(*) {
52
+ font-size: .85rem;
53
+ }
54
+
55
+ &.small.border > :deep(*) {
56
+ padding-bottom: .2rem;
57
+ }
58
+ }
59
+ </style>
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div
3
+ :class="['a-table2-row', {border: table2Border, small: hasSmall, tiny: hasTiny, selected, disabled}]"
4
+ @click="$emit('click')"
5
+ >
6
+ <slot />
7
+ </div>
8
+ </template>
9
+
10
+
11
+ <script>
12
+ import { Component, Vue } from '@a-vue'
13
+
14
+ @Component({
15
+ props: [{tiny: false, small: false}, 'selected', 'disabled'],
16
+ inject: {
17
+ table2Border: { default: false }
18
+ }
19
+ })
20
+ export default class ATable2Row extends Vue {
21
+ get hasSmall () {
22
+ return this.small !== undefined && this.small !== false
23
+ }
24
+
25
+ get hasTiny () {
26
+ return this.tiny !== undefined && this.tiny !== false
27
+ }
28
+
29
+ mounted () {
30
+ this.applyColspan()
31
+ }
32
+
33
+ updated () {
34
+ this.applyColspan()
35
+ }
36
+
37
+ applyColspan () {
38
+ if (!this.$el || !this.$el.children) return
39
+ for (const child of this.$el.children) {
40
+ const colspan = child.dataset.colspan
41
+ if (colspan) {
42
+ child.style.gridColumn = `span ${colspan}`
43
+ }
44
+ }
45
+ }
46
+ }
47
+ </script>
48
+
49
+
50
+ <style lang="scss" scoped>
51
+ .a-table2-row {
52
+ display: contents;
53
+
54
+ > :deep(*) {
55
+ padding: .15rem 1.5rem .15rem 0;
56
+ vertical-align: top;
57
+
58
+ &:last-child {
59
+ padding-right: .1rem;
60
+ }
61
+ }
62
+
63
+ &.border > :deep(*) {
64
+ border-bottom: 1px solid #E5E5E5;
65
+ padding: .4rem 1.5rem .4rem .4rem;
66
+
67
+ &:last-child {
68
+ padding-right: .4rem;
69
+ }
70
+ }
71
+
72
+ &:hover > :deep(*) {
73
+ background: #F4F4F4;
74
+ }
75
+
76
+ &.selected > :deep(*) {
77
+ background: #F4F4F4;
78
+ }
79
+
80
+ &.disabled {
81
+ pointer-events: none;
82
+ opacity: .5;
83
+ }
84
+
85
+ // Small mode
86
+ &.small > :deep(*) {
87
+ font-size: .9rem;
88
+ }
89
+
90
+ &.small.border > :deep(*) {
91
+ padding-top: .2rem;
92
+ padding-bottom: .2rem;
93
+ }
94
+
95
+ // Tiny mode
96
+ &.tiny > :deep(*) {
97
+ font-size: .8rem;
98
+ }
99
+
100
+ &.tiny.border > :deep(*) {
101
+ padding-top: .1rem;
102
+ padding-bottom: .1rem;
103
+ }
104
+
105
+ // Text truncation utility
106
+ :deep(.a-table-cell-truncate) {
107
+ overflow: hidden;
108
+ text-overflow: ellipsis;
109
+ white-space: nowrap;
110
+ }
111
+ }
112
+ </style>
@@ -38,6 +38,11 @@ html {
38
38
  color: inherit;
39
39
  text-decoration: line-through;
40
40
  }
41
+
42
+ .text-caption {
43
+ font-family: unset;
44
+ line-height: unset;
45
+ }
41
46
  }
42
47
 
43
48
  .theme--light.v-btn.a-btn-standard {