import { Text } from '@blockeditor/store';
import { tNumber } from '../../../logical/data-type.js';
import { columnManager } from '../manager.js';
import { richTextColumnTypeName } from '../rich-text/define.js';
export const progressColumnTypeName = 'progress';
export const progressPureColumnConfig = columnManager.register(progressColumnTypeName, {
    name: 'Progress',
    type: () => tNumber.create(),
    defaultData: () => ({}),
    cellToString: data => data?.toString() ?? '',
    cellFromString: data => {
        const num = data ? Number(data) : NaN;
        return {
            value: isNaN(num) ? null : num,
        };
    },
    cellToJson: data => data ?? null,
});
progressPureColumnConfig.registerConvert(richTextColumnTypeName, (_column, cells) => ({
    column: {},
    cells: cells.map(v => new Text(v?.toString()).yText),
}));
//# sourceMappingURL=define.js.map