@wishbone-media/spark 0.47.0 → 0.48.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wishbone-media/spark",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -53,6 +53,14 @@
53
53
  td.spark-table-word-wrap {
54
54
  @apply whitespace-normal break-words;
55
55
  }
56
+
57
+ td.spark-table-align-center {
58
+ @apply text-center;
59
+ }
60
+
61
+ td.spark-table-align-right {
62
+ @apply text-right;
63
+ }
56
64
  }
57
65
  }
58
66
 
@@ -383,11 +383,12 @@ const sparkTable = reactive({
383
383
  const columns = get(props.settings, 'columns', [])
384
384
 
385
385
  const transformedColumns = columns.map((col) => {
386
- if (!col.wordWrap) return col
387
- return {
388
- ...col,
389
- className: [col.className, 'spark-table-word-wrap'].filter(Boolean).join(' '),
390
- }
386
+ if (!col.wordWrap && !col.align) return col
387
+ const classes = [col.className]
388
+ if (col.wordWrap) classes.push('spark-table-word-wrap')
389
+ if (col.align === 'center') classes.push('spark-table-align-center')
390
+ if (col.align === 'right') classes.push('spark-table-align-right')
391
+ return { ...col, className: classes.filter(Boolean).join(' ') }
391
392
  })
392
393
 
393
394
  const hasClampedColumns = columns.some(