@economic/taco 2.58.2-EC-64961.2 → 2.58.2-EC-64961.3
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/dist/taco.cjs +37 -13
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.d.ts +2 -2
- package/dist/taco.js +37 -13
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.d.ts
CHANGED
@@ -3146,7 +3146,7 @@ export declare type TableColumnAlignment = 'left' | 'center' | 'right';
|
|
3146
3146
|
|
3147
3147
|
export declare type TableColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);
|
3148
3148
|
|
3149
|
-
export declare type TableColumnDataType = 'text' | '
|
3149
|
+
export declare type TableColumnDataType = 'text' | 'boolean' | 'date' | 'time' | 'datetime' | 'number' | 'amount' | 'percentage';
|
3150
3150
|
|
3151
3151
|
export declare type TableColumnDataTypeOptions = {
|
3152
3152
|
currency?: string;
|
@@ -3166,7 +3166,7 @@ export declare type TableColumnDataTypeProps<TType = unknown> = {
|
|
3166
3166
|
dataType?: 'percentage';
|
3167
3167
|
dataTypeOptions?: TableColumnDataTypeOptionsHandler<TType, Pick<TableColumnDataTypeOptions, 'decimals' | 'useGrouping'>>;
|
3168
3168
|
} | {
|
3169
|
-
dataType?: Omit<TableColumnDataType, 'number' | 'amount'>;
|
3169
|
+
dataType?: Omit<TableColumnDataType, 'number' | 'amount' | 'percentage'>;
|
3170
3170
|
dataTypeOptions?: never;
|
3171
3171
|
};
|
3172
3172
|
|
package/dist/taco.js
CHANGED
@@ -33036,7 +33036,34 @@ const dataTypes = {
|
|
33036
33036
|
TableFilterComparator.IsNotEmpty
|
33037
33037
|
]
|
33038
33038
|
},
|
33039
|
-
|
33039
|
+
boolean: {
|
33040
|
+
sortingFn: "basic",
|
33041
|
+
filterComparators: [TableFilterComparator.IsEqualTo, TableFilterComparator.IsNotEqualTo]
|
33042
|
+
},
|
33043
|
+
// dates
|
33044
|
+
date: createDatetimeDataType({
|
33045
|
+
day: "2-digit",
|
33046
|
+
month: "2-digit",
|
33047
|
+
year: "2-digit"
|
33048
|
+
}),
|
33049
|
+
time: createDatetimeDataType({
|
33050
|
+
hour: "2-digit",
|
33051
|
+
minute: "2-digit"
|
33052
|
+
}),
|
33053
|
+
datetime: createDatetimeDataType({
|
33054
|
+
day: "2-digit",
|
33055
|
+
month: "2-digit",
|
33056
|
+
year: "2-digit",
|
33057
|
+
hour: "2-digit",
|
33058
|
+
minute: "2-digit"
|
33059
|
+
}),
|
33060
|
+
// numbers
|
33061
|
+
number: createNumberDataType("left"),
|
33062
|
+
amount: createNumberDataType("right", { decimals: 2, useGrouping: true }),
|
33063
|
+
percentage: createNumberDataType("right", { useGrouping: true, percent: true })
|
33064
|
+
};
|
33065
|
+
function createDatetimeDataType(defaultOptions2) {
|
33066
|
+
return {
|
33040
33067
|
sortingFn: "datetime",
|
33041
33068
|
filterComparators: [
|
33042
33069
|
TableFilterComparator.IsEqualTo,
|
@@ -33049,20 +33076,17 @@ const dataTypes = {
|
|
33049
33076
|
TableFilterComparator.IsEmpty,
|
33050
33077
|
TableFilterComparator.IsNotEmpty
|
33051
33078
|
],
|
33052
|
-
getDisplayValue: (value,
|
33079
|
+
getDisplayValue: (value, row, options) => {
|
33053
33080
|
var _a;
|
33054
|
-
|
33081
|
+
if (value === void 0) {
|
33082
|
+
return "";
|
33083
|
+
}
|
33084
|
+
return new Intl.DateTimeFormat((_a = options == null ? void 0 : options.localization) == null ? void 0 : _a.locale, defaultOptions2).format(
|
33085
|
+
typeof value === "string" ? Date.parse(value) : value
|
33086
|
+
);
|
33055
33087
|
}
|
33056
|
-
}
|
33057
|
-
|
33058
|
-
sortingFn: "basic",
|
33059
|
-
filterComparators: [TableFilterComparator.IsEqualTo, TableFilterComparator.IsNotEqualTo]
|
33060
|
-
},
|
33061
|
-
// numbers
|
33062
|
-
number: createNumberDataType("left"),
|
33063
|
-
amount: createNumberDataType("right", { decimals: 2, useGrouping: true }),
|
33064
|
-
percentage: createNumberDataType("right", { useGrouping: true, percent: true })
|
33065
|
-
};
|
33088
|
+
};
|
33089
|
+
}
|
33066
33090
|
function createNumberDataType(align, defaultOptions2) {
|
33067
33091
|
return {
|
33068
33092
|
align,
|