@economic/taco 2.58.2-EC-64961.1 → 2.58.2-EC-64961.2

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.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' | 'number' | 'datetime' | 'boolean' | 'amount';
3149
+ export declare type TableColumnDataType = 'text' | 'number' | 'datetime' | 'boolean' | 'amount' | 'percentage';
3150
3150
 
3151
3151
  export declare type TableColumnDataTypeOptions = {
3152
3152
  currency?: string;
@@ -3162,6 +3162,9 @@ export declare type TableColumnDataTypeProps<TType = unknown> = {
3162
3162
  } | {
3163
3163
  dataType?: 'amount';
3164
3164
  dataTypeOptions?: TableColumnDataTypeOptionsHandler<TType, Pick<TableColumnDataTypeOptions, 'currency'>>;
3165
+ } | {
3166
+ dataType?: 'percentage';
3167
+ dataTypeOptions?: TableColumnDataTypeOptionsHandler<TType, Pick<TableColumnDataTypeOptions, 'decimals' | 'useGrouping'>>;
3165
3168
  } | {
3166
3169
  dataType?: Omit<TableColumnDataType, 'number' | 'amount'>;
3167
3170
  dataTypeOptions?: never;
package/dist/taco.js CHANGED
@@ -33060,7 +33060,8 @@ const dataTypes = {
33060
33060
  },
33061
33061
  // numbers
33062
33062
  number: createNumberDataType("left"),
33063
- amount: createNumberDataType("right", { decimals: 2, useGrouping: true })
33063
+ amount: createNumberDataType("right", { decimals: 2, useGrouping: true }),
33064
+ percentage: createNumberDataType("right", { useGrouping: true, percent: true })
33064
33065
  };
33065
33066
  function createNumberDataType(align, defaultOptions2) {
33066
33067
  return {
@@ -33090,7 +33091,9 @@ function createNumberDataType(align, defaultOptions2) {
33090
33091
  minimumFractionDigits: (dataTypeOptions == null ? void 0 : dataTypeOptions.decimals) ?? (defaultOptions2 == null ? void 0 : defaultOptions2.decimals),
33091
33092
  maximumFractionDigits: (dataTypeOptions == null ? void 0 : dataTypeOptions.decimals) ?? (defaultOptions2 == null ? void 0 : defaultOptions2.decimals)
33092
33093
  };
33093
- if (dataTypeOptions == null ? void 0 : dataTypeOptions.currency) {
33094
+ if (defaultOptions2 == null ? void 0 : defaultOptions2.percent) {
33095
+ numberFormatOptions.style = "percent";
33096
+ } else if (dataTypeOptions == null ? void 0 : dataTypeOptions.currency) {
33094
33097
  numberFormatOptions.style = "currency";
33095
33098
  numberFormatOptions.currency = dataTypeOptions.currency;
33096
33099
  numberFormatOptions.currencyDisplay = "code";