foggy-data-viewer 1.0.1-beta.49 → 1.0.1-beta.50
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/README.md +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3619 -3617
- package/dist/index.umd +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/displayValue.d.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -189,6 +189,23 @@ const amountField = {
|
|
|
189
189
|
从 `1.0.1-beta.49` 起,`requiredFields` / `requiredRuntimeColumns` 仅声明执行依赖:请求字段为用户选择 U 与依赖 R 的并集。用户主动选择的 U∩R 正常展示、保存并计入 50 字段额度;隐式补入的 R\\U 不自动展示、不保存、不占用户额度。永久隐藏的系统字段应使用独立元数据规则,不能由 required 推断。旧 `internalFields` 额度豁免选项不再生效。
|
|
190
190
|
|
|
191
191
|
恢复方案中的维度 ID 时,`SelectFilter` 会通过当前 `filterMemberLoader` 主动回填名称,无需打开下拉。成员接口应在 `selectedItems` 返回不在当前分页内的已选成员;回填不改变 DSL 值或触发额外筛选/主表请求。
|
|
192
|
+
|
|
193
|
+
### 表格与 Excel 共用展示值(beta.50)
|
|
194
|
+
|
|
195
|
+
```ts
|
|
196
|
+
import { formatCellDisplayValue, type DisplayValueColumn } from 'foggy-data-viewer'
|
|
197
|
+
|
|
198
|
+
// 统一导出适配器保留列元数据,不要只 Pick name/title/customFormatter。
|
|
199
|
+
const exportColumns: DisplayValueColumn[] = schema.columns.map(column => ({ ...column }))
|
|
200
|
+
const cells = rows.map(row => exportColumns.map(column =>
|
|
201
|
+
formatCellDisplayValue(column, row[column.name])
|
|
202
|
+
))
|
|
203
|
+
// cells 交给现有 Excel 序列化器;不要写回 rows。
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
引擎提供纯文本投影,不提供 Excel 文件生成/下载。`formatCellDisplayValue(column, value): string` 与 DataTable 使用同一实现:空值(null/undefined/空字符串)返回空文本;其余值按 `customFormatter > dictItems > extData.viewer > 类型默认格式化` 处理。字典 key 用 String 匹配,未知 code 返回原值文本。保留 MONEY viewer 缩放及 INTEGER 标识符不分组规则。除 dictItems/type/customFormatter 外,适配器还应保留 extData/category/measure/aggregatable/name/title。
|
|
207
|
+
|
|
208
|
+
兼容性:beta.50 将原来 viewer 优先于 customFormatter/dictItems 的顺序调整为上述顺序,空值不再调用 customFormatter。API 不写回行数据;业务自定义 formatter 应保持纯函数,其异常继续向调用方抛出。返回值是字符串,Excel 单元格类型、安全转义和文件生成由导出适配器负责。VNode、slot 和 global renderer 的视觉内容不自动转成 Excel 文本;需要等价文本时使用 customFormatter。原复制按钮的复制语义保持不变。
|
|
192
209
|
|
|
193
210
|
### DataTable Events
|
|
194
211
|
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export { default as ListPresetConditionEditor } from './components/list-preset/L
|
|
|
16
16
|
export type { QueryFieldSchema, QueryPanelLayoutSchema, QueryPanelExpose, QuerySchema } from './components/QueryPanel.vue';
|
|
17
17
|
export * from './components/filters';
|
|
18
18
|
export * from './components/composables';
|
|
19
|
+
export { formatCellDisplayValue } from './utils/displayValue';
|
|
20
|
+
export type { DisplayValueColumn } from './utils/displayValue';
|
|
19
21
|
export { buildTableColumns, calculateColumnWidth } from './utils/schemaHelper';
|
|
20
22
|
export { MAX_LIST_PRESET_FIELDS, MAX_LIST_PRESET_CONDITIONS, countConditionLeaves, cloneSliceTree, getConditionFields, getListPresetFieldCount, getListPresetLimitResult, validateListPresetLimits, getUserConfigurableColumns, getDisplayColumnForCondition, getQueryFieldForColumn } from './utils/listPreset';
|
|
21
23
|
export { MONEY_VIEWER, formatViewerValue, getColumnMoneyViewer, resolveMoneyViewer, viewerSlicesToDisplay, viewerSlicesToRaw } from './utils/viewer';
|