grav-svelte 0.0.80 → 0.0.82

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.
@@ -7,19 +7,19 @@
7
7
 
8
8
  {#if item[header.campo] == true}
9
9
  <div
10
- class="cell-content {item[header.colorCampo ?? ''] ?? ''} {header.biBold
10
+ class="cell-content {header.biBold
11
11
  ? 'bold'
12
12
  : ''}"
13
- style="text-align: {header.align ?? 'left'}"
13
+ style="text-align: {header.align ?? 'left'}; {header.colorCampo && item[header.colorCampo] ? `background-color: ${item[header.colorCampo]}; color: white;` : ''}"
14
14
  >
15
15
  <i class="fas fa-check"></i>
16
16
  </div>
17
17
  {:else}
18
18
  <div
19
- class="cell-content {item[header.colorCampo ?? ''] ?? ''} {header.biBold
19
+ class="cell-content {header.biBold
20
20
  ? 'bold'
21
21
  : ''}"
22
- style="text-align: {header.align ?? 'left'}"
22
+ style="text-align: {header.align ?? 'left'}; {header.colorCampo && item[header.colorCampo] ? `background-color: ${item[header.colorCampo]}; color: white;` : ''}"
23
23
  >
24
24
  <i class="fas fa-minus"></i>
25
25
  </div>
@@ -11,10 +11,8 @@
11
11
 
12
12
  {#if config?.tipo === "Text"}
13
13
  <p
14
- class="cell-content {config.colorField
15
- ? item[config.colorField] ?? ''
16
- : ''} {header.biBold ? 'bold' : ''}"
17
- style="text-align: {header.align ?? 'left'}"
14
+ class="cell-content {header.biBold ? 'bold' : ''}"
15
+ style="text-align: {header.align ?? 'left'}; {config.colorField && item[config.colorField] ? `background-color: ${item[config.colorField]}; color: white;` : ''}"
18
16
  >
19
17
  {config.textField ? item[config.textField] ?? "" : ""}
20
18
  </p>
@@ -30,18 +28,16 @@
30
28
  >
31
29
  {#if config.textField1 && item[config.textField1]}
32
30
  <div
33
- class="dual-text-1 {config.colorField1
34
- ? item[config.colorField1] ?? ''
35
- : ''}"
31
+ class="dual-text-1"
32
+ style="{config.colorField1 && item[config.colorField1] ? `background-color: ${item[config.colorField1]}; color: white;` : ''}"
36
33
  >
37
34
  {item[config.textField1]}
38
35
  </div>
39
36
  {/if}
40
37
  {#if config.textField2 && item[config.textField2]}
41
38
  <div
42
- class="dual-text-2 {config.colorField2
43
- ? item[config.colorField2] ?? ''
44
- : ''}"
39
+ class="dual-text-2"
40
+ style="{config.colorField2 && item[config.colorField2] ? `background-color: ${item[config.colorField2]}; color: white;` : ''}"
45
41
  >
46
42
  {item[config.textField2]}
47
43
  </div>
@@ -7,10 +7,10 @@
7
7
  </script>
8
8
 
9
9
  <p
10
- class="cell-content {item[header.colorCampo ?? ''] ?? ''} {header.biBold
10
+ class="cell-content {header.biBold
11
11
  ? 'bold'
12
12
  : ''}"
13
- style="text-align: {header.align ?? 'left'}"
13
+ style="text-align: {header.align ?? 'left'}; {header.colorCampo && item[header.colorCampo] ? `background-color: ${item[header.colorCampo]}; color: white;` : ''}"
14
14
  >
15
15
  {#if isDatetime}
16
16
  {item[header.campo]?.replace("T", ":") ?? ":"}
@@ -24,12 +24,18 @@
24
24
  }}
25
25
  >
26
26
  {#if hasText1}
27
- <div class="dual-text-1 {item[header.colorField1 ?? ''] ?? ''} {isSingleState ? 'rounded-bottom' : ''}">
27
+ <div
28
+ class="dual-text-1 {isSingleState ? 'rounded-bottom' : ''}"
29
+ style="{header.colorField1 && item[header.colorField1] ? `background-color: ${item[header.colorField1]}; color: white;` : ''}"
30
+ >
28
31
  {item[header.textField1]}
29
32
  </div>
30
33
  {/if}
31
34
  {#if hasText2}
32
- <div class="dual-text-2 {item[header.colorField2 ?? ''] ?? ''} {isSingleState ? 'rounded-bottom' : ''}">
35
+ <div
36
+ class="dual-text-2 {isSingleState ? 'rounded-bottom' : ''}"
37
+ style="{header.colorField2 && item[header.colorField2] ? `background-color: ${item[header.colorField2]}; color: white;` : ''}"
38
+ >
33
39
  {item[header.textField2]}
34
40
  </div>
35
41
  {/if}
@@ -12,8 +12,8 @@
12
12
  <div style="display: inline-flex; {alignStyle}">
13
13
  <button
14
14
  type="button"
15
- class="{item[header.colorField ?? ''] ?? ''} dynamic-button "
16
- style="{header.styleField ? (item[header.styleField] ?? '') : ''}"
15
+ class="dynamic-button"
16
+ style="{header.colorField && item[header.colorField] ? `background-color: ${item[header.colorField]}; color: white;` : ''} {header.styleField ? (item[header.styleField] ?? '') : ''}"
17
17
  on:click={() => {
18
18
  if (header.onButtonClick) {
19
19
  header.onButtonClick(item[idField], item);
@@ -19,7 +19,10 @@
19
19
  }}
20
20
  >
21
21
  {#each items as multiItem}
22
- <div class="multi-text-item {multiItem.color ?? ''}">
22
+ <div
23
+ class="multi-text-item"
24
+ style="{multiItem.color ? `background-color: ${multiItem.color}; color: white;` : ''}"
25
+ >
23
26
  {multiItem.text ?? ""}
24
27
  </div>
25
28
  {/each}
@@ -6,10 +6,8 @@
6
6
  </script>
7
7
 
8
8
  <p
9
- class="cell-content {item[header.colorCampo ?? ''] ?? ''} {header.biBold
10
- ? 'bold'
11
- : ''}"
12
- style="text-align: {header.align ?? 'left'}"
9
+ class="cell-content {header.biBold ? 'bold' : ''}"
10
+ style="text-align: {header.align ?? 'left'}; {header.colorCampo && item[header.colorCampo] ? `background-color: ${item[header.colorCampo]}; color: white;` : ''}"
13
11
  >
14
12
  {item[header.campo] ?? ""}
15
13
  </p>
@@ -158,6 +158,8 @@
158
158
  white-space: nowrap;
159
159
  vertical-align: middle;
160
160
  z-index: 10;
161
+ padding-top: 7px;
162
+ padding-bottom: 7px;
161
163
  }
162
164
 
163
165
  .sticky-cell {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grav-svelte",
3
- "version": "0.0.80",
3
+ "version": "0.0.82",
4
4
  "description": "A collection of Svelte components",
5
5
  "license": "MIT",
6
6
  "scripts": {