intelliwaketssveltekitv25 0.2.6 → 0.2.7

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.
@@ -9,6 +9,7 @@ export interface IArrayColumn<T extends Record<string, any>> {
9
9
  hideOnColumn?: string;
10
10
  hideOnFunction?: (rowData: any | null | undefined) => boolean;
11
11
  toNumberFormat?: TNumberStringOptions;
12
+ justify?: 'left' | 'center' | 'right';
12
13
  TSFormat?: string;
13
14
  sumInFooter?: boolean;
14
15
  doNotSort?: boolean;
@@ -40,3 +41,4 @@ export declare function SumsInFooter<T extends Record<string, any>>(arrayData: T
40
41
  export declare function StructuredArray<T extends Record<string, any>>(arrayData: T[] | null, arrayStructure: IArrayStructure<T>): any[];
41
42
  export declare function ScreenFormatValue<T extends Record<string, any>>(value: any | null | undefined, column: IArrayColumn<T>): any | null | undefined;
42
43
  export declare function ColumnClassRight<T extends Record<string, any>>(column: IArrayColumn<T>): boolean;
44
+ export declare function ColumnClassCenter<T extends Record<string, any>>(column: IArrayColumn<T>): boolean;
@@ -69,6 +69,9 @@ export function ScreenFormatValue(value, column) {
69
69
  }
70
70
  }
71
71
  export function ColumnClassRight(column) {
72
- return column.toNumberFormat !== undefined ||
73
- column.TSFormat !== undefined;
72
+ return column.justify === 'right' || (!column.justify && (column.toNumberFormat !== undefined ||
73
+ column.TSFormat !== undefined));
74
+ }
75
+ export function ColumnClassCenter(column) {
76
+ return column.justify === 'center';
74
77
  }
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" generics="T extends Record<string, any>">
2
2
 
3
3
  import {
4
+ ColumnClassCenter,
4
5
  ColumnClassRight,
5
6
  ComputeValue,
6
7
  type IArrayStructure,
@@ -98,6 +99,7 @@
98
99
  {#if !hideCosts || !column.isACost}
99
100
  <td class="text-ellipsis overflow-hidden {!column.size ? '' : ` td-${column.size}`}"
100
101
  class:text-right={ColumnClassRight(column)}
102
+ class:text-center={ColumnClassCenter(column)}
101
103
  title={!!formattedValue && formattedValue.toString().length > 10 ? formattedValue : undefined}
102
104
  onclick={e => {
103
105
  if (!!column.onclick) {
@@ -120,6 +122,7 @@
120
122
  {#if !hideCosts || !column.isACost}
121
123
  <th class="text-ellipsis overflow-hidden {!column.size ? '' : ` td-${column.size}`}"
122
124
  class:text-right={ColumnClassRight(column)}
125
+ class:text-center={ColumnClassCenter(column)}
123
126
  title={
124
127
  !!ScreenFormatValue(sumsInFooter[column.fieldName], column) &&
125
128
  ScreenFormatValue(sumsInFooter[column.fieldName], column).length > 10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",