solely 0.7.1 → 0.8.0
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 +30 -3
- package/dist/compiler/index.d.ts +2 -2
- package/dist/compiler/ir/buildIR.d.ts +1 -1
- package/dist/compiler/ir/index.d.ts +1 -1
- package/dist/compiler/parser/index.d.ts +1 -1
- package/dist/compiler/parser/parser.d.ts +1 -1
- package/dist/components/commands/drawer/index.cjs +1 -1
- package/dist/components/commands/drawer/index.d.ts +1 -1
- package/dist/components/commands/drawer/index.js +1 -1
- package/dist/components/commands/drawer/style.css.cjs +1 -1
- package/dist/components/commands/drawer/style.css.js +1 -1
- package/dist/components/commands/index.d.ts +12 -12
- package/dist/components/commands/message/index.cjs +1 -1
- package/dist/components/commands/message/index.d.ts +1 -1
- package/dist/components/commands/message/index.js +1 -1
- package/dist/components/commands/message/style.css.cjs +1 -1
- package/dist/components/commands/message/style.css.js +1 -1
- package/dist/components/commands/message/types.d.ts +1 -1
- package/dist/components/commands/modal/index.cjs +1 -1
- package/dist/components/commands/modal/index.d.ts +1 -1
- package/dist/components/commands/modal/index.js +1 -1
- package/dist/components/commands/modal/style.css.cjs +1 -1
- package/dist/components/commands/modal/style.css.js +1 -1
- package/dist/components/commands/modal/types.d.ts +8 -3
- package/dist/components/commands/popconfirm/index.cjs +1 -1
- package/dist/components/commands/popconfirm/index.d.ts +1 -1
- package/dist/components/commands/popconfirm/index.js +1 -1
- package/dist/components/commands/popconfirm/style.css.cjs +1 -1
- package/dist/components/commands/popconfirm/style.css.js +1 -1
- package/dist/components/commands/popconfirm/types.d.ts +10 -3
- package/dist/components/commands/tooltip/index.cjs +1 -1
- package/dist/components/commands/tooltip/index.d.ts +1 -1
- package/dist/components/commands/tooltip/index.js +1 -1
- package/dist/components/commands/tooltip/style.css.cjs +1 -1
- package/dist/components/commands/tooltip/style.css.js +1 -1
- package/dist/components/commands/tooltip/types.d.ts +1 -3
- package/dist/components/commands/utils.cjs +1 -1
- package/dist/components/commands/utils.d.ts +11 -0
- package/dist/components/commands/utils.js +1 -1
- package/dist/components/elements/alert/index.cjs +1 -1
- package/dist/components/elements/alert/index.d.ts +68 -6
- package/dist/components/elements/alert/index.html.cjs +1 -1
- package/dist/components/elements/alert/index.html.js +1 -1
- package/dist/components/elements/alert/index.js +1 -1
- package/dist/components/elements/alert/style.css.cjs +1 -1
- package/dist/components/elements/alert/style.css.js +1 -1
- package/dist/components/elements/alert/types.d.ts +5 -1
- package/dist/components/elements/backtop/index.cjs +1 -1
- package/dist/components/elements/backtop/index.d.ts +14 -2
- package/dist/components/elements/backtop/index.html.cjs +1 -1
- package/dist/components/elements/backtop/index.html.js +1 -1
- package/dist/components/elements/backtop/index.js +1 -1
- package/dist/components/elements/backtop/style.css.cjs +1 -1
- package/dist/components/elements/backtop/style.css.js +1 -1
- package/dist/components/elements/badge/index.cjs +1 -1
- package/dist/components/elements/badge/index.d.ts +12 -6
- package/dist/components/elements/badge/index.html.cjs +1 -1
- package/dist/components/elements/badge/index.html.js +1 -1
- package/dist/components/elements/badge/index.js +1 -1
- package/dist/components/elements/badge/types.d.ts +2 -4
- package/dist/components/elements/breadcrumb/index.cjs +1 -1
- package/dist/components/elements/breadcrumb/index.d.ts +13 -3
- package/dist/components/elements/breadcrumb/index.html.cjs +1 -1
- package/dist/components/elements/breadcrumb/index.html.js +1 -1
- package/dist/components/elements/breadcrumb/index.js +1 -1
- package/dist/components/elements/breadcrumb/style.css.cjs +1 -1
- package/dist/components/elements/breadcrumb/style.css.js +1 -1
- package/dist/components/elements/breadcrumb/types.d.ts +2 -0
- package/dist/components/elements/button/index.cjs +1 -1
- package/dist/components/elements/button/index.d.ts +14 -2
- package/dist/components/elements/button/index.html.cjs +1 -1
- package/dist/components/elements/button/index.html.js +1 -1
- package/dist/components/elements/button/index.js +1 -1
- package/dist/components/elements/button/style.css.cjs +1 -1
- package/dist/components/elements/button/style.css.js +1 -1
- package/dist/components/elements/button/types.d.ts +4 -0
- package/dist/components/elements/card/index.cjs +1 -1
- package/dist/components/elements/card/index.d.ts +22 -2
- package/dist/components/elements/card/index.html.cjs +1 -1
- package/dist/components/elements/card/index.html.js +1 -1
- package/dist/components/elements/card/index.js +1 -1
- package/dist/components/elements/card/style.css.cjs +1 -1
- package/dist/components/elements/card/style.css.js +1 -1
- package/dist/components/elements/card/types.d.ts +4 -2
- package/dist/components/elements/checkbox/index.cjs +1 -1
- package/dist/components/elements/checkbox/index.d.ts +56 -3
- package/dist/components/elements/checkbox/index.html.cjs +1 -1
- package/dist/components/elements/checkbox/index.html.js +1 -1
- package/dist/components/elements/checkbox/index.js +1 -1
- package/dist/components/elements/checkbox/style.css.cjs +1 -1
- package/dist/components/elements/checkbox/style.css.js +1 -1
- package/dist/components/elements/checkbox/types.d.ts +10 -0
- package/dist/components/elements/coordinate-input/index.cjs +1 -1
- package/dist/components/elements/coordinate-input/index.d.ts +27 -2
- package/dist/components/elements/coordinate-input/index.html.cjs +1 -1
- package/dist/components/elements/coordinate-input/index.html.js +1 -1
- package/dist/components/elements/coordinate-input/index.js +1 -1
- package/dist/components/elements/coordinate-input/style.css.cjs +1 -1
- package/dist/components/elements/coordinate-input/style.css.js +1 -1
- package/dist/components/elements/coordinate-input/types.d.ts +4 -4
- package/dist/components/elements/divider/index.cjs +1 -1
- package/dist/components/elements/divider/index.d.ts +11 -2
- package/dist/components/elements/divider/index.js +1 -1
- package/dist/components/elements/empty/index.cjs +1 -1
- package/dist/components/elements/empty/index.d.ts +14 -2
- package/dist/components/elements/empty/index.html.cjs +1 -1
- package/dist/components/elements/empty/index.html.js +1 -1
- package/dist/components/elements/empty/index.js +1 -1
- package/dist/components/elements/empty/style.css.cjs +1 -1
- package/dist/components/elements/empty/style.css.js +1 -1
- package/dist/components/elements/empty/types.d.ts +4 -2
- package/dist/components/elements/fab/index.cjs +1 -1
- package/dist/components/elements/fab/index.d.ts +12 -3
- package/dist/components/elements/fab/index.html.cjs +1 -1
- package/dist/components/elements/fab/index.html.js +1 -1
- package/dist/components/elements/fab/index.js +1 -1
- package/dist/components/elements/fab/style.css.cjs +1 -1
- package/dist/components/elements/fab/style.css.js +1 -1
- package/dist/components/elements/icon/index.cjs +1 -1
- package/dist/components/elements/icon/index.d.ts +23 -2
- package/dist/components/elements/icon/index.js +1 -1
- package/dist/components/elements/icon/style.css.cjs +1 -1
- package/dist/components/elements/icon/style.css.js +1 -1
- package/dist/components/elements/index.cjs +1 -1
- package/dist/components/elements/index.d.ts +61 -60
- package/dist/components/elements/index.js +1 -1
- package/dist/components/elements/input/index.cjs +1 -1
- package/dist/components/elements/input/index.d.ts +120 -5
- package/dist/components/elements/input/index.html.cjs +1 -1
- package/dist/components/elements/input/index.html.js +1 -1
- package/dist/components/elements/input/index.js +1 -1
- package/dist/components/elements/input/style.css.cjs +1 -1
- package/dist/components/elements/input/style.css.js +1 -1
- package/dist/components/elements/input/types.d.ts +46 -7
- package/dist/components/elements/not-found/index.cjs +1 -1
- package/dist/components/elements/not-found/index.d.ts +38 -2
- package/dist/components/elements/not-found/index.html.cjs +1 -1
- package/dist/components/elements/not-found/index.html.js +1 -1
- package/dist/components/elements/not-found/index.js +1 -1
- package/dist/components/elements/not-found/style.css.cjs +1 -1
- package/dist/components/elements/not-found/style.css.js +1 -1
- package/dist/components/elements/not-found/types.d.ts +2 -0
- package/dist/components/elements/pagination/index.cjs +1 -1
- package/dist/components/elements/pagination/index.d.ts +52 -7
- package/dist/components/elements/pagination/index.html.cjs +1 -1
- package/dist/components/elements/pagination/index.html.js +1 -1
- package/dist/components/elements/pagination/index.js +1 -1
- package/dist/components/elements/pagination/style.css.cjs +1 -1
- package/dist/components/elements/pagination/style.css.js +1 -1
- package/dist/components/elements/pagination/types.d.ts +1 -1
- package/dist/components/elements/progress/index.cjs +1 -1
- package/dist/components/elements/progress/index.d.ts +16 -7
- package/dist/components/elements/progress/index.html.cjs +1 -1
- package/dist/components/elements/progress/index.html.js +1 -1
- package/dist/components/elements/progress/index.js +1 -1
- package/dist/components/elements/progress/style.css.cjs +1 -1
- package/dist/components/elements/progress/style.css.js +1 -1
- package/dist/components/elements/progress/types.d.ts +4 -2
- package/dist/components/elements/radio/index.cjs +1 -1
- package/dist/components/elements/radio/index.d.ts +82 -3
- package/dist/components/elements/radio/index.html.cjs +1 -1
- package/dist/components/elements/radio/index.html.js +1 -1
- package/dist/components/elements/radio/index.js +1 -1
- package/dist/components/elements/radio/style.css.cjs +1 -1
- package/dist/components/elements/radio/style.css.js +1 -1
- package/dist/components/elements/radio/types.d.ts +6 -0
- package/dist/components/elements/rate/index.cjs +1 -1
- package/dist/components/elements/rate/index.d.ts +75 -3
- package/dist/components/elements/rate/index.html.cjs +1 -1
- package/dist/components/elements/rate/index.html.js +1 -1
- package/dist/components/elements/rate/index.js +1 -1
- package/dist/components/elements/rate/style.css.cjs +1 -1
- package/dist/components/elements/rate/style.css.js +1 -1
- package/dist/components/elements/rate/types.d.ts +2 -0
- package/dist/components/elements/select/index.cjs +1 -1
- package/dist/components/elements/select/index.d.ts +197 -22
- package/dist/components/elements/select/index.html.cjs +1 -1
- package/dist/components/elements/select/index.html.js +1 -1
- package/dist/components/elements/select/index.js +1 -1
- package/dist/components/elements/select/option.cjs +1 -0
- package/dist/components/elements/select/option.d.ts +2 -2
- package/dist/components/elements/select/option.js +1 -0
- package/dist/components/elements/select/style.css.cjs +1 -1
- package/dist/components/elements/select/style.css.js +1 -1
- package/dist/components/elements/select/types.d.ts +42 -6
- package/dist/components/elements/skeleton/index.cjs +1 -1
- package/dist/components/elements/skeleton/index.d.ts +15 -2
- package/dist/components/elements/skeleton/index.html.cjs +1 -1
- package/dist/components/elements/skeleton/index.html.js +1 -1
- package/dist/components/elements/skeleton/index.js +1 -1
- package/dist/components/elements/skeleton/style.css.cjs +1 -1
- package/dist/components/elements/skeleton/style.css.js +1 -1
- package/dist/components/elements/skeleton/types.d.ts +2 -1
- package/dist/components/elements/slider/index.cjs +1 -1
- package/dist/components/elements/slider/index.d.ts +115 -11
- package/dist/components/elements/slider/index.html.cjs +1 -1
- package/dist/components/elements/slider/index.html.js +1 -1
- package/dist/components/elements/slider/index.js +1 -1
- package/dist/components/elements/slider/style.css.cjs +1 -1
- package/dist/components/elements/slider/style.css.js +1 -1
- package/dist/components/elements/slider/types.d.ts +15 -4
- package/dist/components/elements/steps/index.cjs +1 -1
- package/dist/components/elements/steps/index.d.ts +73 -10
- package/dist/components/elements/steps/index.html.cjs +1 -1
- package/dist/components/elements/steps/index.html.js +1 -1
- package/dist/components/elements/steps/index.js +1 -1
- package/dist/components/elements/steps/style.css.cjs +1 -1
- package/dist/components/elements/steps/style.css.js +1 -1
- package/dist/components/elements/steps/types.d.ts +9 -2
- package/dist/components/elements/switch/index.cjs +1 -1
- package/dist/components/elements/switch/index.d.ts +52 -9
- package/dist/components/elements/switch/index.html.cjs +1 -1
- package/dist/components/elements/switch/index.html.js +1 -1
- package/dist/components/elements/switch/index.js +1 -1
- package/dist/components/elements/switch/types.d.ts +12 -0
- package/dist/components/elements/table/index.cjs +1 -1
- package/dist/components/elements/table/index.d.ts +251 -4
- package/dist/components/elements/table/index.html.cjs +1 -1
- package/dist/components/elements/table/index.html.js +1 -1
- package/dist/components/elements/table/index.js +1 -1
- package/dist/components/elements/table/style.css.cjs +1 -1
- package/dist/components/elements/table/style.css.js +1 -1
- package/dist/components/elements/table/types.d.ts +152 -7
- package/dist/components/elements/tabs/index.cjs +1 -1
- package/dist/components/elements/tabs/index.d.ts +47 -4
- package/dist/components/elements/tabs/index.html.cjs +1 -1
- package/dist/components/elements/tabs/index.html.js +1 -1
- package/dist/components/elements/tabs/index.js +1 -1
- package/dist/components/elements/tabs/style.css.cjs +1 -1
- package/dist/components/elements/tabs/style.css.js +1 -1
- package/dist/components/elements/tabs/types.d.ts +10 -0
- package/dist/components/elements/tag/index.cjs +1 -1
- package/dist/components/elements/tag/index.d.ts +11 -3
- package/dist/components/elements/tag/index.html.cjs +1 -1
- package/dist/components/elements/tag/index.html.js +1 -1
- package/dist/components/elements/tag/index.js +1 -1
- package/dist/components/elements/tag/style.css.cjs +1 -1
- package/dist/components/elements/tag/style.css.js +1 -1
- package/dist/components/elements/timeline/index.cjs +1 -1
- package/dist/components/elements/timeline/index.d.ts +8 -2
- package/dist/components/elements/timeline/index.js +1 -1
- package/dist/components/elements/timeline/style.css.cjs +1 -1
- package/dist/components/elements/timeline/style.css.js +1 -1
- package/dist/components/elements/timeline/types.d.ts +0 -1
- package/dist/components/elements/tooltip/index.cjs +1 -1
- package/dist/components/elements/tooltip/index.d.ts +78 -5
- package/dist/components/elements/tooltip/index.html.cjs +1 -1
- package/dist/components/elements/tooltip/index.html.js +1 -1
- package/dist/components/elements/tooltip/index.js +1 -1
- package/dist/components/elements/tooltip/style.css.cjs +1 -1
- package/dist/components/elements/tooltip/style.css.js +1 -1
- package/dist/components/elements/tooltip/types.d.ts +1 -1
- package/dist/components/elements/tree/index.cjs +1 -1
- package/dist/components/elements/tree/index.d.ts +163 -13
- package/dist/components/elements/tree/index.html.cjs +1 -1
- package/dist/components/elements/tree/index.html.js +1 -1
- package/dist/components/elements/tree/index.js +1 -1
- package/dist/components/elements/tree/style.css.cjs +1 -1
- package/dist/components/elements/tree/style.css.js +1 -1
- package/dist/components/elements/tree/types.d.ts +18 -4
- package/dist/components/elements/upload/index.cjs +1 -1
- package/dist/components/elements/upload/index.d.ts +59 -8
- package/dist/components/elements/upload/index.html.cjs +1 -1
- package/dist/components/elements/upload/index.html.js +1 -1
- package/dist/components/elements/upload/index.js +1 -1
- package/dist/components/elements/upload/style.css.cjs +1 -1
- package/dist/components/elements/upload/style.css.js +1 -1
- package/dist/components/elements/upload/types.d.ts +89 -5
- package/dist/components/elements/utils/helpers.cjs +1 -1
- package/dist/components/elements/utils/helpers.d.ts +10 -0
- package/dist/components/elements/utils/helpers.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +3 -21
- package/dist/components/index.js +1 -1
- package/dist/components/theme/auto-inject.cjs +1 -0
- package/dist/components/theme/auto-inject.d.ts +23 -0
- package/dist/components/theme/auto-inject.js +1 -0
- package/dist/components/theme/index.cjs +1 -1
- package/dist/components/theme/index.d.ts +7 -1
- package/dist/components/theme/index.js +1 -1
- package/dist/components/theme/variables.css +25 -0
- package/dist/components/theme/variables.css.cjs +1 -0
- package/dist/components/theme/variables.css.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/plugin.d.ts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/plugins/solely-vite-plugin.d.ts +1 -1
- package/dist/router/core.d.ts +1 -1
- package/dist/router/index.d.ts +4 -4
- package/dist/router/router-link.d.ts +1 -1
- package/dist/router/router-view.d.ts +2 -2
- package/dist/runtime/component/base-element.cjs +1 -1
- package/dist/runtime/component/base-element.d.ts +7 -0
- package/dist/runtime/component/base-element.js +1 -1
- package/dist/runtime/component/decorators.d.ts +7 -2
- package/dist/runtime/component/index.d.ts +2 -2
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/reactivity/computed.d.ts +1 -1
- package/dist/runtime/reactivity/index.d.ts +6 -6
- package/dist/runtime/reactivity/watch.d.ts +1 -1
- package/dist/runtime/renderer/index.d.ts +2 -2
- package/dist/runtime/renderer/renderIR.cjs +1 -1
- package/dist/runtime/renderer/renderIR.d.ts +1 -1
- package/dist/runtime/renderer/renderIR.js +1 -1
- package/dist/shared/aria.cjs +1 -0
- package/dist/shared/aria.d.ts +67 -0
- package/dist/shared/aria.js +1 -0
- package/dist/shared/boolean.cjs +1 -0
- package/dist/shared/boolean.d.ts +9 -0
- package/dist/shared/boolean.js +1 -0
- package/dist/shared/enum.cjs +1 -0
- package/dist/shared/enum.d.ts +10 -0
- package/dist/shared/enum.js +1 -0
- package/dist/shared/env.cjs +1 -1
- package/dist/shared/env.js +1 -1
- package/dist/shared/floating/overlay-stack.cjs +1 -0
- package/dist/shared/floating/overlay-stack.d.ts +56 -0
- package/dist/shared/floating/overlay-stack.js +1 -0
- package/dist/shared/floating/position.cjs +1 -0
- package/dist/shared/floating/position.d.ts +32 -0
- package/dist/shared/floating/position.js +1 -0
- package/dist/shared/floating/types.d.ts +112 -0
- package/dist/shared/form-associated.cjs +1 -0
- package/dist/shared/form-associated.d.ts +253 -0
- package/dist/shared/form-associated.js +1 -0
- package/dist/shared/gen-function.d.ts +1 -1
- package/dist/shared/icons.cjs +1 -0
- package/dist/shared/icons.d.ts +31 -0
- package/dist/shared/icons.js +1 -0
- package/dist/shared/index.cjs +1 -1
- package/dist/shared/index.d.ts +11 -9
- package/dist/shared/index.js +1 -1
- package/dist/shared/size.cjs +1 -0
- package/dist/shared/size.d.ts +17 -0
- package/dist/shared/size.js +1 -0
- package/dist/shared/templateError.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/ir.d.ts +1 -1
- package/package.json +27 -11
- package/dist/solely.svg +0 -1
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { BaseElement } from '../../../runtime/component';
|
|
2
|
-
import {
|
|
1
|
+
import { BaseElement } from '../../../runtime/component/index.js';
|
|
2
|
+
import { SizeInput } from '../../../shared/size.js';
|
|
3
|
+
import { TableProps, TableSize, TableColumn, TableSortState, TableSortOrder, TableFilterValues, TableFilterOption, TablePaginationDetail, TableSelectionMode } from './types.js';
|
|
3
4
|
declare class SolelyTable extends BaseElement<TableProps> {
|
|
5
|
+
#private;
|
|
6
|
+
/** 统一尺寸语义:middle / default 归一为 medium */
|
|
7
|
+
get size(): TableSize;
|
|
8
|
+
set size(value: SizeInput);
|
|
4
9
|
/**
|
|
5
10
|
* 获取 table class 对象
|
|
6
11
|
*/
|
|
@@ -9,10 +14,47 @@ declare class SolelyTable extends BaseElement<TableProps> {
|
|
|
9
14
|
* 获取解析后的列配置
|
|
10
15
|
*/
|
|
11
16
|
getParsedColumns(): TableColumn[];
|
|
17
|
+
unmounted(): void;
|
|
12
18
|
/**
|
|
13
|
-
*
|
|
19
|
+
* 刷新前丢弃展示数据缓存。
|
|
20
|
+
*
|
|
21
|
+
* 数据源可能被原地修改(响应式代理的 push/splice,或调用方持有原始数组后手动
|
|
22
|
+
* refresh):缓存只按引用判断会把修改前的结果继续返回,表现为“数据变了但表格不动”。
|
|
23
|
+
*/
|
|
24
|
+
refresh(): void;
|
|
25
|
+
/**
|
|
26
|
+
* 获取解析后的数据源(未经过本地筛选/排序)
|
|
14
27
|
*/
|
|
15
28
|
getParsedDataSource(): Record<string, unknown>[];
|
|
29
|
+
/** 是否在组件内做本地排序(默认开启;remote 优先关闭) */
|
|
30
|
+
private isLocalSortEnabled;
|
|
31
|
+
/** 是否在组件内做本地筛选(默认开启;remote 优先关闭) */
|
|
32
|
+
private isLocalFilterEnabled;
|
|
33
|
+
/**
|
|
34
|
+
* 按 dataIndex 取值。
|
|
35
|
+
* 支持 `user.name`、`items[0].name`、`items.0.name`;
|
|
36
|
+
* 行对象上存在同名字面字段时优先取字面字段,兼容拍平数据。
|
|
37
|
+
*/
|
|
38
|
+
private getValueByPath;
|
|
39
|
+
/** 该列是否配置了列级 render 函数 */
|
|
40
|
+
hasColumnRender(col: TableColumn): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 单元格插槽名。
|
|
43
|
+
* 规则:列级 `slot` > 稳定插槽 `col-{key}-{rowKey}` > 旧版按索引插槽 `col-{key}-{rowIndex}` > 字段值。
|
|
44
|
+
* 稳定插槽与旧版插槽同时存在时稳定插槽优先;旧版插槽仅在稳定插槽不存在时作为兼容回退。
|
|
45
|
+
*/
|
|
46
|
+
getCellSlotName(col: TableColumn, row: Record<string, unknown>, rowIndex: number): string;
|
|
47
|
+
/** 轻 DOM 中是否存在指定 name 的插槽内容(用于稳定插槽/旧版插槽的优先级判断) */
|
|
48
|
+
private hasSlotInLightDom;
|
|
49
|
+
/**
|
|
50
|
+
* 获取最终用于渲染的数据。
|
|
51
|
+
* 默认(非 remote)在组件内执行筛选/排序;remote 时原样返回数据源。
|
|
52
|
+
*/
|
|
53
|
+
getDisplayedDataSource(): Record<string, unknown>[];
|
|
54
|
+
/** 是否无数据可展示(用于空态) */
|
|
55
|
+
isEmpty(): boolean;
|
|
56
|
+
/** 当前实际列数(含选择列与展开列),用于展开行的 colspan */
|
|
57
|
+
getColumnCount(): number;
|
|
16
58
|
/**
|
|
17
59
|
* 获取 th class 对象
|
|
18
60
|
*/
|
|
@@ -21,15 +63,220 @@ declare class SolelyTable extends BaseElement<TableProps> {
|
|
|
21
63
|
* 获取 td class 对象
|
|
22
64
|
*/
|
|
23
65
|
getTdClasses(col: TableColumn): Record<string, boolean>;
|
|
66
|
+
/** 当前选择模式(非法值回退多选) */
|
|
67
|
+
getSelectionMode(): TableSelectionMode;
|
|
68
|
+
/** 是否存在左固定列(决定选择列是否一起固定) */
|
|
69
|
+
hasFixedLeftColumns(): boolean;
|
|
70
|
+
/** 是否存在右固定列(决定展开列是否一起固定) */
|
|
71
|
+
hasFixedRightColumns(): boolean;
|
|
72
|
+
/** 选择列 class(有左固定列时一起固定,避免被遮挡) */
|
|
73
|
+
getSelectionCellClasses(): Record<string, boolean>;
|
|
74
|
+
/** 展开列 class(有右固定列时一起固定) */
|
|
75
|
+
getExpandCellClasses(): Record<string, boolean>;
|
|
76
|
+
/** 列宽转像素;无法从配置解析时返回 null,交给运行时实测补足 */
|
|
77
|
+
private getColumnWidthPx;
|
|
78
|
+
/**
|
|
79
|
+
* 计算并写入固定列偏移。
|
|
80
|
+
* 多个左固定列按列宽累加 left,多个右固定列按列宽累加 right;
|
|
81
|
+
* 选择列贴左、展开列贴右,一并纳入计算。
|
|
82
|
+
*/
|
|
83
|
+
private syncFixedOffsets;
|
|
84
|
+
/** 列配置从固定列改回普通列时,清理上一次写入的内联偏移 */
|
|
85
|
+
private clearFixedOffsets;
|
|
86
|
+
/** 行 class 对象 */
|
|
87
|
+
getRowClasses(row: Record<string, unknown>, index: number): Record<string, boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* 获取排序方向图标
|
|
90
|
+
*/
|
|
91
|
+
getSortIcon(col: TableColumn): string;
|
|
92
|
+
/** 排序图标 class */
|
|
93
|
+
getSortIconClasses(col: TableColumn): Record<string, boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* 表头 aria-sort。非排序列返回 null,由渲染器移除该属性。
|
|
96
|
+
*/
|
|
97
|
+
getAriaSort(col: TableColumn): 'ascending' | 'descending' | 'none' | null;
|
|
24
98
|
mounted(): void;
|
|
25
99
|
/**
|
|
26
|
-
*
|
|
100
|
+
* 每次渲染完成后注入 expandRender 返回的内容。
|
|
101
|
+
* 仅处理没有对应 slot 的展开行。
|
|
102
|
+
*/
|
|
103
|
+
updated(): void;
|
|
104
|
+
/**
|
|
105
|
+
* 获取单元格值(支持嵌套路径与数组下标)
|
|
27
106
|
*/
|
|
28
107
|
getCellValue(row: Record<string, unknown>, col: TableColumn): unknown;
|
|
108
|
+
/** 渲染列级 render 返回的内容;字符串按纯文本插入,避免 XSS */
|
|
109
|
+
private renderColumnCells;
|
|
110
|
+
/** 显式关闭本地排序/筛选时提示一次,避免“传了 sortable/filters 却只收到事件”的困惑 */
|
|
111
|
+
private warnAboutLocalComputation;
|
|
112
|
+
/** 未配置 row-key 且实际启用了依赖行身份的能力时提示一次 */
|
|
113
|
+
private warnAboutRowKey;
|
|
29
114
|
/**
|
|
30
115
|
* 行点击事件
|
|
116
|
+
*
|
|
117
|
+
* 事件契约:只派发一次 CustomEvent('row-click'),detail 为 `{ row, index }`。
|
|
118
|
+
* 不再手动派发 click —— 原生 click 已会从行冒泡到宿主元素,
|
|
119
|
+
* 额外派发会造成监听 click 的一方收到两次。
|
|
31
120
|
*/
|
|
32
121
|
handleRowClick(row: Record<string, unknown>, index: number): void;
|
|
122
|
+
/**
|
|
123
|
+
* 行是否参与键盘交互时的 tabindex。
|
|
124
|
+
*
|
|
125
|
+
* - 无 row-click 且不可选:不聚焦
|
|
126
|
+
* - 仅 row-click:行是唯一操作件,进入 Tab 序列(0)
|
|
127
|
+
* - 可选中:复选框已是该行的 Tab 停点,行用 -1 保持可被点击/focus() 聚焦,
|
|
128
|
+
* 但不额外占用一个 Tab 停点,避免同一行出现两个停点
|
|
129
|
+
*/
|
|
130
|
+
getRowTabIndex(): string | null;
|
|
131
|
+
/**
|
|
132
|
+
* 行键盘激活:Enter / Space 触发与行点击一致的行为。
|
|
133
|
+
* 仅处理行自身获得焦点的情况,复选框/展开按钮等内部控件的键盘事件不重复触发。
|
|
134
|
+
*
|
|
135
|
+
* - 行可点击:派发 row-click,与鼠标点击一致;
|
|
136
|
+
* - 仅可选择(未开启 row-clickable):切换该行选中状态。这里直接调用
|
|
137
|
+
* toggleRowSelection + refresh,不产生原生 checkbox click,因此无需
|
|
138
|
+
* preventDefault,也不会出现 input.checked 与状态失同步。
|
|
139
|
+
*/
|
|
140
|
+
handleRowKeydown(row: Record<string, unknown>, index: number, event: KeyboardEvent): void;
|
|
141
|
+
/** 是否处于受控排序模式(sort 有值即视为受控) */
|
|
142
|
+
isSortControlled(): boolean;
|
|
143
|
+
/** 归一化排序状态(接受对象或 JSON 字符串) */
|
|
144
|
+
private normalizeSortState;
|
|
145
|
+
/** 当前生效的排序状态(受控优先) */
|
|
146
|
+
getSortState(): TableSortState | null;
|
|
147
|
+
private isSameSort;
|
|
148
|
+
private getColumnKey;
|
|
149
|
+
/** 某列当前的排序方向 */
|
|
150
|
+
getSortOrder(col: TableColumn): TableSortOrder;
|
|
151
|
+
/**
|
|
152
|
+
* 点击表头排序(非排序列忽略)。
|
|
153
|
+
*/
|
|
154
|
+
handleHeaderClick(col: TableColumn): void;
|
|
155
|
+
/**
|
|
156
|
+
* 表头键盘排序:Enter / Space
|
|
157
|
+
*/
|
|
158
|
+
handleHeaderKeydown(col: TableColumn, event: KeyboardEvent): void;
|
|
159
|
+
/** asc → desc → 无 */
|
|
160
|
+
private toggleSortColumn;
|
|
161
|
+
private applySort;
|
|
162
|
+
/** 程序化设置排序 */
|
|
163
|
+
setSort(column: string, order?: 'asc' | 'desc'): void;
|
|
164
|
+
/** 清除排序 */
|
|
165
|
+
clearSort(): void;
|
|
166
|
+
/** 默认比较规则:自定义 sorter > 数字 > 日期 > 字符串 */
|
|
167
|
+
private compareRows;
|
|
168
|
+
/** 是否处于受控筛选模式(filterValues 有值即视为受控) */
|
|
169
|
+
isFilterControlled(): boolean;
|
|
170
|
+
private normalizeFilterValue;
|
|
171
|
+
private normalizeFilterValues;
|
|
172
|
+
private cloneFilters;
|
|
173
|
+
/** 当前生效的筛选值(受控优先) */
|
|
174
|
+
getFilterValues(): Record<string, string[]>;
|
|
175
|
+
private getEffectiveFilterValues;
|
|
176
|
+
private applyFilterValues;
|
|
177
|
+
/** 设置单列筛选值;传空值等于清除该列 */
|
|
178
|
+
setFilter(column: string, values: TableFilterValues[string], silent?: boolean): void;
|
|
179
|
+
/** 批量设置筛选值 */
|
|
180
|
+
setFilterValues(values: TableFilterValues, silent?: boolean): void;
|
|
181
|
+
/** 是否存在带 filters 的列(决定是否渲染内置筛选行) */
|
|
182
|
+
hasFilterableColumn(): boolean;
|
|
183
|
+
/** 某列当前选中的筛选值(字符串形式) */
|
|
184
|
+
private getColumnFilterValues;
|
|
185
|
+
/** 某列是否有生效中的筛选(用于显示清除按钮与激活态) */
|
|
186
|
+
hasColumnFilter(col: TableColumn): boolean;
|
|
187
|
+
/** 内置筛选行中某个选项是否已选中 */
|
|
188
|
+
isFilterOptionChecked(col: TableColumn, option: TableFilterOption): boolean;
|
|
189
|
+
/** 内置筛选行勾选/取消勾选 */
|
|
190
|
+
handleFilterOptionChange(col: TableColumn, option: TableFilterOption, event: Event): void;
|
|
191
|
+
/** 清除全部或指定列的筛选 */
|
|
192
|
+
clearFilters(column?: string, silent?: boolean): void;
|
|
193
|
+
/**
|
|
194
|
+
* 行 key。
|
|
195
|
+
* 配置 rowKey 时取该字段;未配置时按行对象引用分配稳定 id,
|
|
196
|
+
* 因此排序/筛选换位置不会改变身份(数据源替换为新对象时才会变化)。
|
|
197
|
+
*/
|
|
198
|
+
getRowKey(row: Record<string, unknown>, index: number): string;
|
|
199
|
+
private getStableRowKey;
|
|
200
|
+
private warnMissingRowKeyField;
|
|
201
|
+
private normalizeKeyList;
|
|
202
|
+
isSelectionControlled(): boolean;
|
|
203
|
+
isExpansionControlled(): boolean;
|
|
204
|
+
/** 受控选中数据的归一化缓存(按 raw 引用缓存,避免每次调用重新归一化) */
|
|
205
|
+
private getControlledSelectionCache;
|
|
206
|
+
/** 当前生效的选中键集合 */
|
|
207
|
+
private getEffectiveSelectedKeySet;
|
|
208
|
+
private getEffectiveSelectedKeys;
|
|
209
|
+
private getEffectiveExpandedKeys;
|
|
210
|
+
private listsEqual;
|
|
211
|
+
/** 当前选中行 key(返回副本,避免调用方修改内部缓存) */
|
|
212
|
+
getSelectedKeys(): string[];
|
|
213
|
+
/** 当前选中行(仅当前数据中仍存在的行) */
|
|
214
|
+
getSelectedRows(): Record<string, unknown>[];
|
|
215
|
+
private getRowsByKeys;
|
|
216
|
+
/** 某行是否被选中(按行 key 做 Set.has,避免每行重建数组 + includes 的 O(n) 扫描) */
|
|
217
|
+
isRowSelected(row: Record<string, unknown>, index: number): boolean;
|
|
218
|
+
/** 全选状态(仅针对当前展示数据) */
|
|
219
|
+
isAllDisplayedSelected(): boolean;
|
|
220
|
+
/** 半选状态 */
|
|
221
|
+
isSelectionIndeterminate(): boolean;
|
|
222
|
+
private emitSelectionChange;
|
|
223
|
+
private applySelectedKeys;
|
|
224
|
+
/** 切换某行选中状态 */
|
|
225
|
+
toggleRowSelection(row: Record<string, unknown>, index: number): void;
|
|
226
|
+
/** 设置选中行 key */
|
|
227
|
+
setSelectedKeys(keys: string[], silent?: boolean): void;
|
|
228
|
+
/** 清空选择 */
|
|
229
|
+
clearSelection(silent?: boolean): void;
|
|
230
|
+
/**
|
|
231
|
+
* 行选择框点击:阻止冒泡避免触发行点击。
|
|
232
|
+
*
|
|
233
|
+
* 这里刻意不调用 preventDefault():
|
|
234
|
+
* 原生 checkbox 的 checked 翻转发生在 click 监听器之前;若在此取消默认行为,
|
|
235
|
+
* 浏览器只会在「微任务检查点之后」才把 checked/indeterminate 回滚到点击前的值。
|
|
236
|
+
* 组件的 refresh 恰好排在同一次点击的微任务里,渲染时读到的是翻转后的临时值,
|
|
237
|
+
* renderIR 的布尔属性脏检查判定“无需写入”而跳过;随后浏览器回滚,DOM 属性就停在
|
|
238
|
+
* 旧值(真实指针点击与键盘 Space 激活均可复现,脚本 click() 因回滚先于微任务而不复现)。
|
|
239
|
+
*
|
|
240
|
+
* 因此让原生翻转正常生效,再由紧随其后的 refresh 把 DOM 对齐到组件状态。
|
|
241
|
+
* 这里统一 refresh 一次(同一微任务内的重复调度会被合并):既覆盖受控模式下
|
|
242
|
+
* 使用方未回写 selectedKeys、需要立即纠正原生翻转的场景,也覆盖空表等无状态变化场景。
|
|
243
|
+
*/
|
|
244
|
+
handleRowSelectClick(row: Record<string, unknown>, index: number, event: Event): void;
|
|
245
|
+
/**
|
|
246
|
+
* 表头全选/取消全选(仅多选模式)
|
|
247
|
+
*
|
|
248
|
+
* 同 handleRowSelectClick:不取消原生默认行为,避免 preventDefault 的回滚
|
|
249
|
+
* 晚于微任务渲染而导致表头 checkbox/indeterminate 停在陈旧值。
|
|
250
|
+
*/
|
|
251
|
+
handleSelectAllClick(event: Event): void;
|
|
252
|
+
private getExpandSlotName;
|
|
253
|
+
private hasSlot;
|
|
254
|
+
/** 该展开行是否由 expandRender 渲染(有对应 slot 时以 slot 为准) */
|
|
255
|
+
shouldRenderExpand(row: Record<string, unknown>, index: number): boolean;
|
|
256
|
+
/** 某行是否处于展开状态 */
|
|
257
|
+
isRowExpanded(row: Record<string, unknown>, index: number): boolean;
|
|
258
|
+
/** 当前展开行 key */
|
|
259
|
+
getExpandedKeys(): string[];
|
|
260
|
+
private emitExpandChange;
|
|
261
|
+
private applyExpandedKeys;
|
|
262
|
+
/** 切换某行展开状态 */
|
|
263
|
+
toggleRowExpansion(row: Record<string, unknown>, index: number): void;
|
|
264
|
+
/** 设置展开行 key */
|
|
265
|
+
setExpandedKeys(keys: string[], silent?: boolean): void;
|
|
266
|
+
/** 展开行按钮点击 */
|
|
267
|
+
handleExpandClick(row: Record<string, unknown>, index: number, event: Event): void;
|
|
268
|
+
/**
|
|
269
|
+
* 接收 pagination 的 change 事件(或 detail),转出为 page-change。
|
|
270
|
+
* table 不执行分页计算,数据切片/远端请求由使用方完成。
|
|
271
|
+
*/
|
|
272
|
+
handlePaginationChange(input: TablePaginationDetail | Event): void;
|
|
273
|
+
/**
|
|
274
|
+
* 数据源变化(含 attribute 更新)时派发 data-change。
|
|
275
|
+
*
|
|
276
|
+
* 注意:受控属性的「切换回非受控」请通过 property 赋值为 undefined 实现;
|
|
277
|
+
* 移除 HTML attribute 会被框架回落为旧值,组件无法感知。
|
|
278
|
+
*/
|
|
279
|
+
attributeChanged(name: string, _oldValue: unknown, _newValue: unknown): void;
|
|
33
280
|
/**
|
|
34
281
|
* 设置列配置
|
|
35
282
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getTableClasses()},function(t){const{$data:a}=this;return this.getParsedColumns()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getThClasses(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return d.width?"width: "+("number"==typeof d.width?d.width+"px":d.width):""},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${d.title}`},function(t){const{$data:a}=this;return this.getParsedDataSource()},function(t,a){const{$data:d}=this,{value:s,checked:n}=t?.target||{};var[e]=a.map(t=>t.itmVal),[i]=a.map(t=>t.idxVal);this.handleRowClick(e,i)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getParsedColumns()},function(t){const{$data:a}=this;var[d,s]=t.map(t=>t.itmVal),[n,e]=t.map(t=>t.idxVal);return this.getTdClasses(s)},function(t){const{$data:a}=this;var[d,s]=t.map(t=>t.itmVal),[n,e]=t.map(t=>t.idxVal);return"col-"+s.key+"-"+n},function(t){const{$data:a}=this;var[d,s]=t.map(t=>t.itmVal),[n,e]=t.map(t=>t.idxVal);return`${this.getCellValue(d,s)}`},function(t){const{$data:a}=this;return a.loading},function(t){const{$data:a}=this;return!a.loading&&0===this.getParsedDataSource().length}],n:[{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"table-wrapper",d:0}],c:[{t:0,d:1,g:"table",a:[{k:"part",v:"base",d:0},{k:"class",v:"table",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,g:"thead",a:[{k:"part",v:"head",d:0}],c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"head-row",d:0}],c:[{t:6,d:1,f:2,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:":class",f:3,d:1},{k:":style",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]}]},{t:0,d:0,g:"tbody",a:[{k:"part",v:"body",d:0}],c:[{t:6,d:1,f:6,i:"row",n:"rowIndex",a:[],c:[{t:0,d:1,g:"tr",a:[{k:"part",v:"row",d:0},{k:"@click",f:7,d:1}],c:[{t:6,d:1,f:8,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:":class",f:9,d:1}],c:[{t:0,d:1,g:"slot",a:[{k:":name",f:10,d:1}],c:[{t:1,d:1,f:11}]}]}]}]}]}]}]},{t:2,d:0,x:" 加载状态 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:12,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"loading",d:0},{k:"class",v:"table__loading",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"table__loading-icon",d:0}],c:[]}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 空状态 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:13,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"empty",d:0},{k:"class",v:"table__empty",d:0}],c:[{t:1,d:0,s:1,x:"暂无数据"}]}]}]}]}],s:{tf:13,cf:13,dn:0,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getTableClasses()},function(t){const{$data:a}=this;return a.loading?"true":null},function(t){const{$data:a}=this;return a.selectable},function(t){const{$data:a}=this;return this.getSelectionCellClasses()},function(t){const{$data:a}=this;return"single"!==this.getSelectionMode()},function(t){const{$data:a}=this;return this.isAllDisplayedSelected()},function(t){const{$data:a}=this;return this.isSelectionIndeterminate()},function(t){const{$data:a}=this;return this.isSelectionIndeterminate()?"mixed":this.isAllDisplayedSelected()?"true":"false"},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};this.handleSelectAllClick(t)},function(t){const{$data:a}=this;return this.getParsedColumns()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getThClasses(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getColumnKey(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.width?"width: "+("number"==typeof d.width?d.width+"px":d.width):""},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.sortable?0:void 0},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getAriaSort(d)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleHeaderClick(s)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleHeaderKeydown(s,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return`${d.title}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.sortable},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getSortIconClasses(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return`${this.getSortIcon(d)}`},function(t){const{$data:a}=this;return a.expandable},function(t){const{$data:a}=this;return this.getExpandCellClasses()},function(t){const{$data:a}=this;return this.hasFilterableColumn()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return(d.filters||[]).length>0},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return{"is-active":this.hasColumnFilter(d)}},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return"筛选:"+d.title},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.filters},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,i]=t.map(t=>t.idxVal);return this.isFilterOptionChecked(d,e)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s,l]=a.map(t=>t.itmVal),[n,n]=a.map(t=>t.idxVal);this.handleFilterOptionChange(s,l,t)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,i]=t.map(t=>t.idxVal);return`${e.label}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.hasColumnFilter(d)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.clearFilters(this.getColumnKey(s))},function(t){const{$data:a}=this;return this.getDisplayedDataSource()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getRowClasses(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getRowKey(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return a.selectable?this.isRowSelected(d,e)?"true":"false":null},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getRowTabIndex()},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleRowClick(s,l)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleRowKeydown(s,l,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return a.selectable},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getSelectionCellClasses()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowSelected(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowSelected(d,e)?"true":"false"},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return"选择第 "+(e+1)+" 行"},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleRowSelectClick(s,l,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getParsedColumns()},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.getTdClasses(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.getColumnKey(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.hasColumnRender(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return i},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return!this.hasColumnRender(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.getCellSlotName(e,d,i)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return`${this.getCellValue(d,e)}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return a.expandable},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getExpandCellClasses()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowExpanded(d,e)?"true":"false"},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowExpanded(d,e)?"折叠行":"展开行"},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleExpandClick(s,l,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowExpanded(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return!this.isRowExpanded(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getExpandSlotName(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.shouldRenderExpand(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return e},function(t){const{$data:a}=this;return a.loading},function(t){const{$data:a}=this;return this.isEmpty()}],n:[{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"table-wrapper",d:0}],c:[{t:0,d:1,g:"table",a:[{k:"part",v:"base",d:0},{k:"class",v:"table",d:0},{k:":class",f:1,d:1},{k:":aria-busy",f:2,d:1}],c:[{t:0,d:0,g:"thead",a:[{k:"part",v:"head",d:0}],c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"head-row",d:0}],c:[{t:7,d:1,b:[{f:3,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:"class",v:"table__selection-cell",d:0},{k:":class",f:4,d:1},{k:"scope",v:"col",d:0}],c:[{t:7,d:1,b:[{f:5,c:[{t:0,d:1,g:"input",a:[{k:"part",v:"select-all",d:0},{k:"class",v:"table__checkbox",d:0},{k:"type",v:"checkbox",d:0},{k:"aria-label",v:"全选",d:0},{k:":checked",f:6,d:1},{k:":indeterminate",f:7,d:1},{k:":aria-checked",f:8,d:1},{k:"@click",f:9,d:1}],c:[]}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:6,d:1,f:10,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:":class",f:11,d:1},{k:"scope",v:"col",d:0},{k:":data-col-key",f:12,d:1},{k:":style",f:13,d:1},{k:":tabindex",f:14,d:1},{k:":aria-sort",f:15,d:1},{k:"@click",f:16,d:1},{k:"@keydown",f:17,d:1}],c:[{t:0,d:0,g:"span",a:[{k:"class",v:"table__head-content",d:0}],c:[{t:1,d:1,f:18},{t:7,d:1,b:[{f:19,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"sort-icon",d:0},{k:"class",v:"table__sort-icon",d:0},{k:":class",f:20,d:1},{k:"aria-hidden",v:"true",d:0}],c:[{t:1,d:1,f:21}]}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:22,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:"class",v:"table__expand-cell",d:0},{k:":class",f:23,d:1},{k:"scope",v:"col",d:0},{k:"aria-label",v:"展开",d:0}],c:[]}]}]}]},{t:7,d:1,b:[{f:24,c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"filter-row",d:0},{k:"class",v:"table__filter-row",d:0}],c:[{t:7,d:1,b:[{f:3,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"filter-cell",d:0},{k:"class",v:"table__selection-cell",d:0},{k:":class",f:4,d:1},{k:"scope",v:"col",d:0}],c:[]}]}]},{t:1,d:0,s:1,x:" "},{t:6,d:1,f:10,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"th",a:[{k:"part",v:"filter-cell",d:0},{k:":class",f:11,d:1},{k:":data-col-key",f:12,d:1},{k:"scope",v:"col",d:0}],c:[{t:7,d:1,b:[{f:25,c:[{t:0,d:1,g:"div",a:[{k:"class",v:"table__filter",d:0},{k:":class",f:26,d:1},{k:"role",v:"group",d:0},{k:":aria-label",f:27,d:1}],c:[{t:6,d:1,f:28,i:"option",n:"index",a:[],c:[{t:0,d:0,g:"label",a:[{k:"part",v:"filter-option",d:0},{k:"class",v:"table__filter-option",d:0}],c:[{t:0,d:1,g:"input",a:[{k:"class",v:"table__checkbox",d:0},{k:"type",v:"checkbox",d:0},{k:":checked",f:29,d:1},{k:"@change",f:30,d:1}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[],c:[{t:1,d:1,f:31}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:32,c:[{t:0,d:1,g:"button",a:[{k:"type",v:"button",d:0},{k:"part",v:"filter-clear",d:0},{k:"class",v:"table__filter-clear",d:0},{k:"@click",f:33,d:1}],c:[{t:1,d:0,s:1,x:"清除"}]}]}]}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:22,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"filter-cell",d:0},{k:"class",v:"table__expand-cell",d:0},{k:":class",f:23,d:1},{k:"scope",v:"col",d:0}],c:[]}]}]}]}]}]}]},{t:0,d:0,g:"tbody",a:[{k:"part",v:"body",d:0}],c:[{t:6,d:1,f:34,i:"row",n:"rowIndex",a:[],c:[{t:0,d:1,g:"tr",a:[{k:"part",v:"row",d:0},{k:"role",v:"row",d:0},{k:":class",f:35,d:1},{k:":data-row-key",f:36,d:1},{k:":aria-selected",f:37,d:1},{k:":tabindex",f:38,d:1},{k:"@click",f:39,d:1},{k:"@keydown",f:40,d:1}],c:[{t:7,d:1,b:[{f:41,c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:"class",v:"table__selection-cell align-center",d:0},{k:":class",f:42,d:1}],c:[{t:0,d:1,g:"input",a:[{k:"class",v:"table__checkbox",d:0},{k:"type",v:"checkbox",d:0},{k:":checked",f:43,d:1},{k:":aria-checked",f:44,d:1},{k:":aria-label",f:45,d:1},{k:"@click",f:46,d:1}],c:[]}]}]}]},{t:1,d:0,s:1,x:" "},{t:6,d:1,f:47,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:":class",f:48,d:1},{k:":data-col-key",f:49,d:1}],c:[{t:7,d:1,b:[{f:50,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"cell-render",d:0},{k:"class",v:"table__cell-render",d:0},{k:":data-col-key",f:49,d:1},{k:":data-row-index",f:51,d:1}],c:[]}]}]},{t:7,d:1,b:[{f:52,c:[{t:0,d:1,g:"slot",a:[{k:":name",f:53,d:1}],c:[{t:1,d:1,f:54}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:55,c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:"class",v:"table__expand-cell align-center",d:0},{k:":class",f:56,d:1}],c:[{t:0,d:1,g:"button",a:[{k:"type",v:"button",d:0},{k:"part",v:"expand-trigger",d:0},{k:"class",v:"table__expand-trigger",d:0},{k:":aria-expanded",f:57,d:1},{k:":aria-label",f:58,d:1},{k:"@click",f:59,d:1}],c:[{t:7,d:1,b:[{f:60,c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"solely-linear-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M3.5 6 8 10.5 12.5 6",d:0}],c:[]}]}]}]},{t:7,d:1,b:[{f:61,c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"solely-linear-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M6 3.5 10.5 8 6 12.5",d:0}],c:[]}]}]}]}]}]}]}]}]},{t:7,d:1,b:[{f:60,c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"expand-row",d:0},{k:"class",v:"table__expand-row",d:0}],c:[{t:0,d:0,g:"td",a:[{k:"part",v:"cell",d:0},{k:"class",v:"table__expand-detail",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"class",v:"table__expand-content",d:0}],c:[{t:0,d:1,g:"slot",a:[{k:":name",f:62,d:1}],c:[]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:63,c:[{t:0,d:1,g:"span",a:[{k:"class",v:"table__expand-render",d:0},{k:":data-expand-index",f:64,d:1}],c:[]}]}]}]}]}]}]}]}]}]}]},{t:2,d:0,x:" 加载状态 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:65,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"loading",d:0},{k:"class",v:"table__loading",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"table__loading-icon",d:0}],c:[]}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:' 空状态:复用 solely-empty,可通过 slot="empty" 自定义 '},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:66,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"empty",d:0},{k:"class",v:"table__empty",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"empty",d:0}],c:[{t:0,d:0,s:1,g:"solely-empty",a:[{k:"description",v:"暂无数据",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"class",v:"table__empty-sr",d:0}],c:[{t:1,d:0,s:1,x:"暂无数据"}]}]}]}]}]}]}]}],s:{tf:66,cf:66,dn:0,tn:1,sn:0}};exports.__SOLELY_IR__=t,exports.default=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getTableClasses()},function(t){const{$data:a}=this;return this.getParsedColumns()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getThClasses(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return d.width?"width: "+("number"==typeof d.width?d.width+"px":d.width):""},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return`${d.title}`},function(t){const{$data:a}=this;return this.getParsedDataSource()},function(t,a){const{$data:d}=this,{value:s,checked:n}=t?.target||{};var[i]=a.map(t=>t.itmVal),[c]=a.map(t=>t.idxVal);this.handleRowClick(i,c)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[s]=t.map(t=>t.idxVal);return this.getParsedColumns()},function(t){const{$data:a}=this;var[d,s]=t.map(t=>t.itmVal),[n,i]=t.map(t=>t.idxVal);return this.getTdClasses(s)},function(t){const{$data:a}=this;var[d,s]=t.map(t=>t.itmVal),[n,i]=t.map(t=>t.idxVal);return"col-"+s.key+"-"+n},function(t){const{$data:a}=this;var[d,s]=t.map(t=>t.itmVal),[n,i]=t.map(t=>t.idxVal);return`${this.getCellValue(d,s)}`},function(t){const{$data:a}=this;return a.loading},function(t){const{$data:a}=this;return!a.loading&&0===this.getParsedDataSource().length}],n:[{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"table-wrapper",d:0}],c:[{t:0,d:1,g:"table",a:[{k:"part",v:"base",d:0},{k:"class",v:"table",d:0},{k:":class",f:1,d:1}],c:[{t:0,d:0,g:"thead",a:[{k:"part",v:"head",d:0}],c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"head-row",d:0}],c:[{t:6,d:1,f:2,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:":class",f:3,d:1},{k:":style",f:4,d:1}],c:[{t:1,d:1,f:5}]}]}]}]},{t:0,d:0,g:"tbody",a:[{k:"part",v:"body",d:0}],c:[{t:6,d:1,f:6,i:"row",n:"rowIndex",a:[],c:[{t:0,d:1,g:"tr",a:[{k:"part",v:"row",d:0},{k:"@click",f:7,d:1}],c:[{t:6,d:1,f:8,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:":class",f:9,d:1}],c:[{t:0,d:1,g:"slot",a:[{k:":name",f:10,d:1}],c:[{t:1,d:1,f:11}]}]}]}]}]}]}]},{t:2,d:0,x:" 加载状态 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:12,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"loading",d:0},{k:"class",v:"table__loading",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"table__loading-icon",d:0}],c:[]}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:" 空状态 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:13,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"empty",d:0},{k:"class",v:"table__empty",d:0}],c:[{t:1,d:0,s:1,x:"暂无数据"}]}]}]}]}],s:{tf:13,cf:13,dn:0,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
|
|
1
|
+
const t={t:"root",v:"1.2.0",fns:[function(t){const{$data:a}=this;return this.getTableClasses()},function(t){const{$data:a}=this;return a.loading?"true":null},function(t){const{$data:a}=this;return a.selectable},function(t){const{$data:a}=this;return this.getSelectionCellClasses()},function(t){const{$data:a}=this;return"single"!==this.getSelectionMode()},function(t){const{$data:a}=this;return this.isAllDisplayedSelected()},function(t){const{$data:a}=this;return this.isSelectionIndeterminate()},function(t){const{$data:a}=this;return this.isSelectionIndeterminate()?"mixed":this.isAllDisplayedSelected()?"true":"false"},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};this.handleSelectAllClick(t)},function(t){const{$data:a}=this;return this.getParsedColumns()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getThClasses(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getColumnKey(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.width?"width: "+("number"==typeof d.width?d.width+"px":d.width):""},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.sortable?0:void 0},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getAriaSort(d)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleHeaderClick(s)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleHeaderKeydown(s,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return`${d.title}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.sortable},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getSortIconClasses(d)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return`${this.getSortIcon(d)}`},function(t){const{$data:a}=this;return a.expandable},function(t){const{$data:a}=this;return this.getExpandCellClasses()},function(t){const{$data:a}=this;return this.hasFilterableColumn()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return(d.filters||[]).length>0},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return{"is-active":this.hasColumnFilter(d)}},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return"筛选:"+d.title},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return d.filters},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,i]=t.map(t=>t.idxVal);return this.isFilterOptionChecked(d,e)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s,l]=a.map(t=>t.itmVal),[n,n]=a.map(t=>t.idxVal);this.handleFilterOptionChange(s,l,t)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,i]=t.map(t=>t.idxVal);return`${e.label}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.hasColumnFilter(d)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.clearFilters(this.getColumnKey(s))},function(t){const{$data:a}=this;return this.getDisplayedDataSource()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getRowClasses(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getRowKey(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return a.selectable?this.isRowSelected(d,e)?"true":"false":null},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getRowTabIndex()},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleRowClick(s,l)},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleRowKeydown(s,l,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return a.selectable},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getSelectionCellClasses()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowSelected(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowSelected(d,e)?"true":"false"},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return"选择第 "+(e+1)+" 行"},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleRowSelectClick(s,l,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getParsedColumns()},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.getTdClasses(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.getColumnKey(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.hasColumnRender(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return i},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return!this.hasColumnRender(e)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return this.getCellSlotName(e,d,i)},function(t){const{$data:a}=this;var[d,e]=t.map(t=>t.itmVal),[i,s]=t.map(t=>t.idxVal);return`${this.getCellValue(d,e)}`},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return a.expandable},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getExpandCellClasses()},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowExpanded(d,e)?"true":"false"},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowExpanded(d,e)?"折叠行":"展开行"},function(t,a){const{$data:d}=this,{value:e,checked:i}=t?.target||{};var[s]=a.map(t=>t.itmVal),[l]=a.map(t=>t.idxVal);this.handleExpandClick(s,l,t)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.isRowExpanded(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return!this.isRowExpanded(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.getExpandSlotName(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return this.shouldRenderExpand(d,e)},function(t){const{$data:a}=this;var[d]=t.map(t=>t.itmVal),[e]=t.map(t=>t.idxVal);return e},function(t){const{$data:a}=this;return a.loading},function(t){const{$data:a}=this;return this.isEmpty()}],n:[{t:0,d:0,g:"div",a:[{k:"part",v:"wrapper",d:0},{k:"class",v:"table-wrapper",d:0}],c:[{t:0,d:1,g:"table",a:[{k:"part",v:"base",d:0},{k:"class",v:"table",d:0},{k:":class",f:1,d:1},{k:":aria-busy",f:2,d:1}],c:[{t:0,d:0,g:"thead",a:[{k:"part",v:"head",d:0}],c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"head-row",d:0}],c:[{t:7,d:1,b:[{f:3,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:"class",v:"table__selection-cell",d:0},{k:":class",f:4,d:1},{k:"scope",v:"col",d:0}],c:[{t:7,d:1,b:[{f:5,c:[{t:0,d:1,g:"input",a:[{k:"part",v:"select-all",d:0},{k:"class",v:"table__checkbox",d:0},{k:"type",v:"checkbox",d:0},{k:"aria-label",v:"全选",d:0},{k:":checked",f:6,d:1},{k:":indeterminate",f:7,d:1},{k:":aria-checked",f:8,d:1},{k:"@click",f:9,d:1}],c:[]}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:6,d:1,f:10,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:":class",f:11,d:1},{k:"scope",v:"col",d:0},{k:":data-col-key",f:12,d:1},{k:":style",f:13,d:1},{k:":tabindex",f:14,d:1},{k:":aria-sort",f:15,d:1},{k:"@click",f:16,d:1},{k:"@keydown",f:17,d:1}],c:[{t:0,d:0,g:"span",a:[{k:"class",v:"table__head-content",d:0}],c:[{t:1,d:1,f:18},{t:7,d:1,b:[{f:19,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"sort-icon",d:0},{k:"class",v:"table__sort-icon",d:0},{k:":class",f:20,d:1},{k:"aria-hidden",v:"true",d:0}],c:[{t:1,d:1,f:21}]}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:22,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"head-cell",d:0},{k:"class",v:"table__expand-cell",d:0},{k:":class",f:23,d:1},{k:"scope",v:"col",d:0},{k:"aria-label",v:"展开",d:0}],c:[]}]}]}]},{t:7,d:1,b:[{f:24,c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"filter-row",d:0},{k:"class",v:"table__filter-row",d:0}],c:[{t:7,d:1,b:[{f:3,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"filter-cell",d:0},{k:"class",v:"table__selection-cell",d:0},{k:":class",f:4,d:1},{k:"scope",v:"col",d:0}],c:[]}]}]},{t:1,d:0,s:1,x:" "},{t:6,d:1,f:10,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"th",a:[{k:"part",v:"filter-cell",d:0},{k:":class",f:11,d:1},{k:":data-col-key",f:12,d:1},{k:"scope",v:"col",d:0}],c:[{t:7,d:1,b:[{f:25,c:[{t:0,d:1,g:"div",a:[{k:"class",v:"table__filter",d:0},{k:":class",f:26,d:1},{k:"role",v:"group",d:0},{k:":aria-label",f:27,d:1}],c:[{t:6,d:1,f:28,i:"option",n:"index",a:[],c:[{t:0,d:0,g:"label",a:[{k:"part",v:"filter-option",d:0},{k:"class",v:"table__filter-option",d:0}],c:[{t:0,d:1,g:"input",a:[{k:"class",v:"table__checkbox",d:0},{k:"type",v:"checkbox",d:0},{k:":checked",f:29,d:1},{k:"@change",f:30,d:1}],c:[]},{t:1,d:0,s:1,x:" "},{t:0,d:0,g:"span",a:[],c:[{t:1,d:1,f:31}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:32,c:[{t:0,d:1,g:"button",a:[{k:"type",v:"button",d:0},{k:"part",v:"filter-clear",d:0},{k:"class",v:"table__filter-clear",d:0},{k:"@click",f:33,d:1}],c:[{t:1,d:0,s:1,x:"清除"}]}]}]}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:22,c:[{t:0,d:1,g:"th",a:[{k:"part",v:"filter-cell",d:0},{k:"class",v:"table__expand-cell",d:0},{k:":class",f:23,d:1},{k:"scope",v:"col",d:0}],c:[]}]}]}]}]}]}]},{t:0,d:0,g:"tbody",a:[{k:"part",v:"body",d:0}],c:[{t:6,d:1,f:34,i:"row",n:"rowIndex",a:[],c:[{t:0,d:1,g:"tr",a:[{k:"part",v:"row",d:0},{k:"role",v:"row",d:0},{k:":class",f:35,d:1},{k:":data-row-key",f:36,d:1},{k:":aria-selected",f:37,d:1},{k:":tabindex",f:38,d:1},{k:"@click",f:39,d:1},{k:"@keydown",f:40,d:1}],c:[{t:7,d:1,b:[{f:41,c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:"class",v:"table__selection-cell align-center",d:0},{k:":class",f:42,d:1}],c:[{t:0,d:1,g:"input",a:[{k:"class",v:"table__checkbox",d:0},{k:"type",v:"checkbox",d:0},{k:":checked",f:43,d:1},{k:":aria-checked",f:44,d:1},{k:":aria-label",f:45,d:1},{k:"@click",f:46,d:1}],c:[]}]}]}]},{t:1,d:0,s:1,x:" "},{t:6,d:1,f:47,i:"col",n:"index",a:[],c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:":class",f:48,d:1},{k:":data-col-key",f:49,d:1}],c:[{t:7,d:1,b:[{f:50,c:[{t:0,d:1,g:"span",a:[{k:"part",v:"cell-render",d:0},{k:"class",v:"table__cell-render",d:0},{k:":data-col-key",f:49,d:1},{k:":data-row-index",f:51,d:1}],c:[]}]}]},{t:7,d:1,b:[{f:52,c:[{t:0,d:1,g:"slot",a:[{k:":name",f:53,d:1}],c:[{t:1,d:1,f:54}]}]}]}]}]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:55,c:[{t:0,d:1,g:"td",a:[{k:"part",v:"cell",d:0},{k:"class",v:"table__expand-cell align-center",d:0},{k:":class",f:56,d:1}],c:[{t:0,d:1,g:"button",a:[{k:"type",v:"button",d:0},{k:"part",v:"expand-trigger",d:0},{k:"class",v:"table__expand-trigger",d:0},{k:":aria-expanded",f:57,d:1},{k:":aria-label",f:58,d:1},{k:"@click",f:59,d:1}],c:[{t:7,d:1,b:[{f:60,c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"solely-linear-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M3.5 6 8 10.5 12.5 6",d:0}],c:[]}]}]}]},{t:7,d:1,b:[{f:61,c:[{t:0,d:0,s:1,g:"svg",a:[{k:"class",v:"solely-linear-icon",d:0},{k:"viewBox",v:"0 0 16 16",d:0},{k:"aria-hidden",v:"true",d:0},{k:"focusable",v:"false",d:0}],c:[{t:0,d:0,s:1,g:"path",a:[{k:"d",v:"M6 3.5 10.5 8 6 12.5",d:0}],c:[]}]}]}]}]}]}]}]}]},{t:7,d:1,b:[{f:60,c:[{t:0,d:0,g:"tr",a:[{k:"part",v:"expand-row",d:0},{k:"class",v:"table__expand-row",d:0}],c:[{t:0,d:0,g:"td",a:[{k:"part",v:"cell",d:0},{k:"class",v:"table__expand-detail",d:0}],c:[{t:0,d:0,g:"div",a:[{k:"class",v:"table__expand-content",d:0}],c:[{t:0,d:1,g:"slot",a:[{k:":name",f:62,d:1}],c:[]},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:63,c:[{t:0,d:1,g:"span",a:[{k:"class",v:"table__expand-render",d:0},{k:":data-expand-index",f:64,d:1}],c:[]}]}]}]}]}]}]}]}]}]}]},{t:2,d:0,x:" 加载状态 "},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:65,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"loading",d:0},{k:"class",v:"table__loading",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"part",v:"loading-icon",d:0},{k:"class",v:"table__loading-icon",d:0}],c:[]}]}]}]},{t:1,d:0,s:1,x:" "},{t:2,d:0,x:' 空状态:复用 solely-empty,可通过 slot="empty" 自定义 '},{t:1,d:0,s:1,x:" "},{t:7,d:1,b:[{f:66,c:[{t:0,d:0,s:1,g:"div",a:[{k:"part",v:"empty",d:0},{k:"class",v:"table__empty",d:0}],c:[{t:0,d:0,s:1,g:"slot",a:[{k:"name",v:"empty",d:0}],c:[{t:0,d:0,s:1,g:"solely-empty",a:[{k:"description",v:"暂无数据",d:0}],c:[{t:0,d:0,s:1,g:"span",a:[{k:"class",v:"table__empty-sr",d:0}],c:[{t:1,d:0,s:1,x:"暂无数据"}]}]}]}]}]}]}]}],s:{tf:66,cf:66,dn:0,tn:1,sn:0}};export{t as __SOLELY_IR__,t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"./style.css.js";import{__SOLELY_IR__ as t}from"./index.html.js";import{safeJsonParse as a}from"../utils/helpers.js";import r from"../../../runtime/component/base-element.js";import{CustomElement as s}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let i=class extends r{getTableClasses(){const e={};return"small"===this.$data.size?e["table--sm"]=!0:"large"===this.$data.size?e["table--lg"]=!0:e["table--md"]=!0,e["table--bordered"]=!!this.$data.bordered,e["is-loading"]=!!this.$data.loading,e["table--striped"]=!!this.$data.striped,e["table--clickable"]=!!this.$data.rowClickable,e}getParsedColumns(){const e=this.$data.columns;return Array.isArray(e)?e:"string"==typeof e&&e?a(e,[]):[]}getParsedDataSource(){const e=this.$data.dataSource;return Array.isArray(e)?e:"string"==typeof e&&e?a(e,[]):[]}getThClasses(e){const t={};return"left"===e.fixed&&(t["fixed-left"]=!0),"right"===e.fixed&&(t["fixed-right"]=!0),t[`align-${e.align||"left"}`]=!0,t}getTdClasses(e){const t={};return"left"===e.fixed&&(t["fixed-left"]=!0),"right"===e.fixed&&(t["fixed-right"]=!0),t[`align-${e.align||"left"}`]=!0,t}mounted(){this.refresh()}getCellValue(e,t){return e[t.dataIndex]}handleRowClick(e,t){this.$data.rowClickable&&(this.emit("row-click",{row:e,index:t}),this.dispatchEvent(new Event("click",{bubbles:!0,composed:!0})))}setColumns(e){this.$data.columns=JSON.stringify(e)}setDataSource(e){this.$data.dataSource=JSON.stringify(e)}getDataSource(){return this.getParsedDataSource()}};i=((e,t)=>{for(var a,r=t,s=e.length-1;s>=0;s--)(a=e[s])&&(r=a(r)||r);return r})([s({tagName:"solely-table",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"columns",type:"string"},{name:"dataSource",type:"string"},{name:"size",type:"string",default:"medium"},{name:"bordered",type:"boolean",default:!1},{name:"loading",type:"boolean",default:!1},{name:"striped",type:"boolean",default:!1},{name:"rowClickable",type:"boolean",default:!1},{name:"rowKey",type:"string"}]})],i);export{i as SolelyTable};
|
|
1
|
+
import{normalizeSize as e}from"../../../shared/size.js";import{oneOf as t}from"../../../shared/enum.js";import r from"./style.css.js";import{__SOLELY_IR__ as s}from"./index.html.js";import{safeJsonParse as l}from"../utils/helpers.js";import"../empty/index.js";import i from"../../../runtime/component/base-element.js";import{CustomElement as a}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;var n,o,h,d,c,u,f,g,p,y,m,S,C,w,b,x,K=e=>{throw TypeError(e)},$=(e,t,r)=>t.has(e)||K("Cannot "+r),E=(e,t,r)=>($(e,t,"read from private field"),r?r.call(e):t.get(e)),v=(e,t,r)=>t.has(e)?K("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),F=(e,t,r,s)=>($(e,t,"write to private field"),t.set(e,r),r);const R="asc",k="desc";let A=class extends i{constructor(){super(...arguments),v(this,n,null),v(this,o,{}),v(this,h,new Set),v(this,d,new Set),v(this,c,new WeakMap),v(this,u,0),v(this,f,!1),v(this,g,new Set),v(this,p,!1),v(this,y,null),v(this,m,null),v(this,S,null),v(this,C,null),v(this,w,null),v(this,b,!1),v(this,x,e=>{const t=e.detail?.path;!Array.isArray(t)||"dataSource"!==t[0]&&"columns"!==t[0]||F(this,S,null)})}get size(){return e(this.$data.size)}set size(t){this.$data.size=e(t)}getTableClasses(){const e={};return"small"===this.$data.size?e["table--sm"]=!0:"large"===this.$data.size?e["table--lg"]=!0:e["table--md"]=!0,e["table--bordered"]=!!this.$data.bordered,e["is-loading"]=!!this.$data.loading,e["table--striped"]=!!this.$data.striped,e["table--clickable"]=!!this.$data.rowClickable,e["table--selectable"]=!!this.$data.selectable,e["table--expandable"]=!!this.$data.expandable,e}getParsedColumns(){const e=this.$data.columns;if(Array.isArray(e))return e;if("string"==typeof e&&e){if(E(this,y)&&E(this,y).raw===e)return E(this,y).value;const t=l(e,[]);return F(this,y,{raw:e,value:t}),t}return[]}unmounted(){this.removeEventListener("dataChange",E(this,x))}refresh(){F(this,S,null),super.refresh()}getParsedDataSource(){const e=this.$data.dataSource;if(Array.isArray(e))return e;if("string"==typeof e&&e){if(E(this,m)&&E(this,m).raw===e)return E(this,m).value;const t=l(e,[]);return F(this,m,{raw:e,value:t}),t}return[]}isLocalSortEnabled(){return!this.$data.remote&&!!this.$data.localSort}isLocalFilterEnabled(){return!this.$data.remote&&!!this.$data.localFilter}getValueByPath(e,t){if(!t)return;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=t.replace(/\[(\d+)\]/g,".$1").split(".");let s=e;for(const l of r){if(null==s||"object"!=typeof s)return;s=s[l]}return s}hasColumnRender(e){return"function"==typeof e.render}getCellSlotName(e,t,r){if(e.slot)return e.slot;const s=`col-${this.getColumnKey(e)}-${this.getRowKey(t,r)}`;if(this.hasSlotInLightDom(s))return s;const l=`col-${this.getColumnKey(e)}-${r}`;return this.hasSlotInLightDom(l)?l:s}hasSlotInLightDom(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}getDisplayedDataSource(){const e=this.getParsedColumns(),t=this.$data.dataSource,r=this.isLocalFilterEnabled(),s=this.isLocalSortEnabled(),l=!!this.$data.remote,i=r?this.isFilterControlled()?this.$data.filterValues:E(this,o):null,a=s?this.isSortControlled()?this.$data.sort:E(this,n):null,h=E(this,S);if(h&&h.columns===e&&h.dataSourceRaw===t&&h.localFilter===r&&h.localSort===s&&h.remote===l&&h.filterSource===i&&h.sortSource===a)return h.value;let d=this.getParsedDataSource();if(r){const t=this.getEffectiveFilterValues();d=d.filter(r=>e.every(e=>{const s=t[this.getColumnKey(e)]||[];if(0===s.length)return!0;const l=this.getCellValue(r,e);return s.some(e=>String(e)===String(l))}))}if(s){const t=this.getSortState();if(t){const r=e.find(e=>this.getColumnKey(e)===t.column);if(r){const e="desc"===t.order?-1:1;d=d.slice().sort((t,s)=>this.compareRows(t,s,r)*e)}}}return F(this,S,{columns:e,dataSourceRaw:t,localFilter:r,localSort:s,remote:l,filterSource:i,sortSource:a,value:d}),d}isEmpty(){return!this.$data.loading&&0===this.getDisplayedDataSource().length}getColumnCount(){return this.getParsedColumns().length+(this.$data.selectable?1:0)+(this.$data.expandable?1:0)}getThClasses(e){const r={};return"left"===e.fixed&&(r["fixed-left"]=!0),"right"===e.fixed&&(r["fixed-right"]=!0),r[`align-${t(e.align,["left","center","right"],"left")}`]=!0,e.sortable&&(r.table__sortable=!0),this.getSortOrder(e)&&(r["is-sorted"]=!0),r}getTdClasses(e){const r={};return"left"===e.fixed&&(r["fixed-left"]=!0),"right"===e.fixed&&(r["fixed-right"]=!0),r[`align-${t(e.align,["left","center","right"],"left")}`]=!0,r}getSelectionMode(){return t(this.$data.selectionMode,["multiple","single"],"multiple")}hasFixedLeftColumns(){return this.getParsedColumns().some(e=>"left"===e.fixed)}hasFixedRightColumns(){return this.getParsedColumns().some(e=>"right"===e.fixed)}getSelectionCellClasses(){return{"fixed-left":this.hasFixedLeftColumns()}}getExpandCellClasses(){return{"fixed-right":this.hasFixedRightColumns()}}getColumnWidthPx(e){const t=e.width;if("number"==typeof t&&Number.isFinite(t))return t;if("string"==typeof t){const e=t.trim();if(/^[0-9.]+(?:px)?$/i.test(e)){const t=parseFloat(e);return Number.isFinite(t)?t:null}}return null}syncFixedOffsets(){const e=this.shadowRoot;if(!e)return;const t=this.hasFixedLeftColumns(),r=this.hasFixedRightColumns();if(!t&&!r){if(!E(this,b))return;return F(this,b,!1),void this.clearFixedOffsets(e)}F(this,b,!0);const s=e.querySelector('thead tr[part="head-row"]');if(!s)return;const l=this.getParsedColumns(),i=new Map(l.map(e=>[this.getColumnKey(e),e])),a=Array.from(s.children),n=new Map;let o=48,h=44;for(const p of a){const e=p.getBoundingClientRect?p.getBoundingClientRect().width:0;p.classList.contains("table__selection-cell")&&e>0&&(o=e),p.classList.contains("table__expand-cell")&&e>0&&(h=e);const t=p.dataset.colKey;if(t)if(e>0)n.set(t,e);else{const e=i.get(t),r=e?this.getColumnWidthPx(e):null;n.set(t,r??0)}}const d=!!this.$data.selectable,c=!!this.$data.expandable,u=new Map;if(t){let e=d?o:0;for(const t of l){if("left"!==t.fixed)continue;const r=this.getColumnKey(t);u.set(r,e),e+=n.get(r)??this.getColumnWidthPx(t)??0}}const f=new Map;if(r){let e=c?h:0;for(let t=l.length-1;t>=0;t--){const r=l[t];if("right"!==r.fixed)continue;const s=this.getColumnKey(r);f.set(s,e),e+=n.get(s)??this.getColumnWidthPx(r)??0}}const g=(e,t,r)=>{const s=e;s.style&&(null==r?s.style.removeProperty(t):s.style.getPropertyValue(t)!==`${r}px`&&s.style.setProperty(t,`${r}px`))};e.querySelectorAll("th.table__selection-cell, td.table__selection-cell").forEach(e=>{g(e,"left",t?0:null)}),e.querySelectorAll("th.table__expand-cell, td.table__expand-cell").forEach(e=>{g(e,"right",r?0:null)}),e.querySelectorAll("th[data-col-key], td[data-col-key]").forEach(e=>{const t=e.dataset.colKey||"",r=i.get(t);r&&(g(e,"left","left"===r.fixed?u.get(t)??null:null),g(e,"right","right"===r.fixed?f.get(t)??null:null))})}clearFixedOffsets(e){e.querySelectorAll(["th.table__selection-cell, td.table__selection-cell,","th.table__expand-cell, td.table__expand-cell,","th[data-col-key], td[data-col-key]"].join(" ")).forEach(e=>{const t=e;t.style&&(t.style.removeProperty("left"),t.style.removeProperty("right"))})}getRowClasses(e,t){return{"table__row--selected":!!this.$data.selectable&&this.isRowSelected(e,t),"table__row--expanded":!!this.$data.expandable&&this.isRowExpanded(e,t)}}getSortIcon(e){const t=this.getSortOrder(e);return t===R?"↑":t===k?"↓":""}getSortIconClasses(e){return{"is-active":""!==this.getSortOrder(e)}}getAriaSort(e){if(!e.sortable)return null;const t=this.getSortOrder(e);return t===R?"ascending":t===k?"descending":"none"}mounted(){this.addEventListener("dataChange",E(this,x)),this.refresh()}updated(){const e=this.shadowRoot;if(!e)return;this.warnAboutLocalComputation(),this.warnAboutRowKey(),this.renderColumnCells(),this.syncFixedOffsets(),e.querySelectorAll(".table__expand-detail").forEach(e=>{e.setAttribute("colspan",String(this.getColumnCount()))});const t=this.$data.expandRender;if("function"!=typeof t)return;const r=this.getDisplayedDataSource();e.querySelectorAll(".table__expand-render").forEach(e=>{const s=e,l=Number(s.dataset.expandIndex),i=r[l];if(!i)return void s.replaceChildren();const a=t(i,l);null==a?s.replaceChildren():a instanceof Node?s.replaceChildren(a):s.replaceChildren(String(a))})}getCellValue(e,t){return this.getValueByPath(e,t.dataIndex)}renderColumnCells(){const e=this.shadowRoot;if(!e)return;const t=e.querySelectorAll(".table__cell-render");if(0===t.length)return;const r=new Map(this.getParsedColumns().map(e=>[this.getColumnKey(e),e])),s=this.getDisplayedDataSource();t.forEach(e=>{const t=e,l=r.get(t.dataset.colKey||""),i=Number(t.dataset.rowIndex),a=s[i];if(!l||"function"!=typeof l.render||!a)return void t.replaceChildren();const n=l.render(a,i);null==n?t.replaceChildren():n instanceof Node?t.replaceChildren(n):t.replaceChildren(document.createTextNode(String(n)))})}warnAboutLocalComputation(){if(E(this,p)||this.$data.remote)return;const e=this.getParsedColumns(),t=!this.$data.localSort&&e.some(e=>e.sortable),r=!this.$data.localFilter&&e.some(e=>(e.filters||[]).length>0);if(!t&&!r)return;F(this,p,!0);const s=[t?"排序":"",r?"筛选":""].filter(Boolean).join(" / ");this.warn(!0,`本地${s}已关闭:组件只管理状态并派发事件,需由使用方自行变换数据。`)}warnAboutRowKey(){if(E(this,f))return;const e=this.getParsedColumns(),t=!!this.$data.selectable||!!this.$data.expandable||this.isLocalSortEnabled()&&e.some(e=>e.sortable)||this.isLocalFilterEnabled()&&e.some(e=>(e.filters||[]).length>0);!this.$data.rowKey&&t&&(F(this,f,!0),this.warn(!0,"未配置 row-key:选择、展开与本地排序/筛选会按行对象引用生成稳定 id。排序/筛选不会漂移,但数据源替换为新对象后身份会变化;推荐为每行提供稳定的 row-key 字段。"))}handleRowClick(e,t){this.$data.rowClickable&&this.emit("row-click",{row:e,index:t})}getRowTabIndex(){return this.$data.selectable||this.$data.rowClickable?this.$data.selectable?"-1":"0":null}handleRowKeydown(e,t,r){r.target===r.currentTarget&&("Enter"!==r.key&&" "!==r.key||(this.$data.selectable||this.$data.rowClickable)&&(r.preventDefault(),this.$data.rowClickable?this.handleRowClick(e,t):(this.toggleRowSelection(e,t),this.refresh())))}isSortControlled(){const e=this.$data.sort;return null!=e&&("string"==typeof e?""!==e.trim():"object"==typeof e)}normalizeSortState(e){let t=e;if("string"==typeof t){if(!t.trim())return null;t=l(t,null)}if(!t||"object"!=typeof t)return null;const r=t,s="string"==typeof r.column?r.column:"",i=r.order===k?k:r.order===R?R:"";return s&&i?{column:s,order:i}:null}getSortState(){return this.isSortControlled()?this.normalizeSortState(this.$data.sort):E(this,n)}isSameSort(e,t){return e&&t?e.column===t.column&&e.order===t.order:e===t}getColumnKey(e){return e.key||e.dataIndex}getSortOrder(e){const t=this.getSortState();return t&&t.column===this.getColumnKey(e)?t.order:""}handleHeaderClick(e){e.sortable&&this.toggleSortColumn(e)}handleHeaderKeydown(e,t){e.sortable&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.toggleSortColumn(e)))}toggleSortColumn(e){const t=this.getColumnKey(e),r=this.getSortState();let s;s=r&&r.column===t?r.order===R?k:"":R,this.applySort(t,s)}applySort(e,t,r=!1){const s=e&&t?{column:e,order:t}:null,l=this.getSortState();this.isSortControlled()||(F(this,n,s),this.isSameSort(l,s)||this.refresh()),r||this.emit("sort-change",{column:s?s.column:null,order:s?s.order:"",sort:s})}setSort(e,t="asc"){this.applySort(e,t===k?k:R)}clearSort(){this.applySort(null,"")}compareRows(e,t,r){if("function"==typeof r.sorter)return r.sorter(e,t);const s=this.getCellValue(e,r),l=this.getCellValue(t,r);return null==s&&null==l?0:null==s?1:null==l?-1:"number"==typeof s&&"number"==typeof l?s-l:s instanceof Date&&l instanceof Date?s.getTime()-l.getTime():String(s).localeCompare(String(l))}isFilterControlled(){const e=this.$data.filterValues;return null!=e&&("string"==typeof e?""!==e.trim():"object"==typeof e)}normalizeFilterValue(e){if(null==e)return[];if(Array.isArray(e))return e.filter(e=>null!=e).map(e=>String(e)).filter(e=>""!==e);const t=String(e);return""===t?[]:[t]}normalizeFilterValues(e){let t=e;if("string"==typeof t){if(!t.trim())return{};t=l(t,{})}if(!t||"object"!=typeof t||Array.isArray(t))return{};const r={};for(const[s,l]of Object.entries(t)){const e=this.normalizeFilterValue(l);e.length>0&&(r[s]=e)}return r}cloneFilters(e){const t={};for(const[r,s]of Object.entries(e))t[r]=s.slice();return t}getFilterValues(){return this.cloneFilters(this.getEffectiveFilterValues())}getEffectiveFilterValues(){return this.isFilterControlled()?this.normalizeFilterValues(this.$data.filterValues):E(this,o)}applyFilterValues(e,t,r,s=!1){this.isFilterControlled()||F(this,o,this.cloneFilters(e)),this.refresh(),s||this.emit("filter-change",{filters:this.cloneFilters(e),column:t,values:r?r.slice():null})}setFilter(e,t,r=!1){const s=this.cloneFilters(this.getEffectiveFilterValues()),l=this.normalizeFilterValue(t);l.length>0?s[e]=l:delete s[e],this.applyFilterValues(s,e,l,r)}setFilterValues(e,t=!1){const r=this.normalizeFilterValues(e);this.applyFilterValues(r,null,null,t)}hasFilterableColumn(){return this.getParsedColumns().some(e=>(e.filters||[]).length>0)}getColumnFilterValues(e){return this.getEffectiveFilterValues()[this.getColumnKey(e)]||[]}hasColumnFilter(e){return this.getColumnFilterValues(e).length>0}isFilterOptionChecked(e,t){const r=String(t.value);return this.getColumnFilterValues(e).some(e=>e===r)}handleFilterOptionChange(e,t,r){const s=!!r.target?.checked,l=String(t.value),i=this.getColumnFilterValues(e),a=s?i.includes(l)?i:[...i,l]:i.filter(e=>e!==l);this.setFilter(this.getColumnKey(e),a)}clearFilters(e,t=!1){if(e){const r=this.cloneFilters(this.getEffectiveFilterValues());return delete r[e],void this.applyFilterValues(r,e,[],t)}this.applyFilterValues({},null,null,t)}getRowKey(e,t){const r=this.$data.rowKey;if(r){const t=this.getValueByPath(e,r);if(null!=t)return String(t);this.warnMissingRowKeyField(r)}return this.getStableRowKey(e,t)}getStableRowKey(e,t){if(e&&"object"==typeof e){let t=E(this,c).get(e);return t||(t="#row-"+ ++(r=this,s=u,{set _(e){F(r,s,e)},get _(){return E(r,s,void 0)}})._,E(this,c).set(e,t)),t}var r,s;return`#row-${t}`}warnMissingRowKeyField(e){E(this,g).has(e)||(E(this,g).add(e),this.warn(!0,`row-key "${e}" 在部分行中不存在,已回退为按行对象引用生成的稳定 id,请检查数据字段。`))}normalizeKeyList(e){if(Array.isArray(e))return e.filter(e=>null!=e).map(e=>String(e));if("string"==typeof e&&e.trim()){const t=l(e,null);return Array.isArray(t)?t.filter(e=>null!=e).map(e=>String(e)):e.includes(",")?e.split(",").map(e=>e.trim()).filter(Boolean):[e]}return[]}isSelectionControlled(){const e=this.$data.selectedKeys;return null!=e&&("string"==typeof e?""!==e.trim():Array.isArray(e))}isExpansionControlled(){const e=this.$data.expandedKeys;return null!=e&&("string"==typeof e?""!==e.trim():Array.isArray(e))}getControlledSelectionCache(){const e=this.$data.selectedKeys,t=E(this,C);if(t&&t.raw===e)return t;const r=this.normalizeKeyList(e),s={raw:e,set:new Set(r),array:r};return F(this,C,s),s}getEffectiveSelectedKeySet(){return this.isSelectionControlled()?this.getControlledSelectionCache().set:E(this,h)}getEffectiveSelectedKeys(){if(this.isSelectionControlled())return this.getControlledSelectionCache().array;const e=E(this,w);if(e&&e.source===E(this,h))return e.array;const t=Array.from(E(this,h));return F(this,w,{source:E(this,h),array:t}),t}getEffectiveExpandedKeys(){return this.isExpansionControlled()?this.normalizeKeyList(this.$data.expandedKeys):Array.from(E(this,d))}listsEqual(e,t){return e.length===t.length&&e.every((e,r)=>e===t[r])}getSelectedKeys(){return this.getEffectiveSelectedKeys().slice()}getSelectedRows(){return this.getRowsByKeys(this.getEffectiveSelectedKeys())}getRowsByKeys(e){const t=new Set(e),r=[];return this.getParsedDataSource().forEach((e,s)=>{t.has(this.getRowKey(e,s))&&r.push(e)}),r}isRowSelected(e,t){return this.getEffectiveSelectedKeySet().has(this.getRowKey(e,t))}isAllDisplayedSelected(){const e=this.getDisplayedDataSource();return!(!this.$data.selectable||0===e.length)&&e.every((e,t)=>this.isRowSelected(e,t))}isSelectionIndeterminate(){if(!this.$data.selectable||"single"===this.getSelectionMode())return!1;const e=this.getDisplayedDataSource();if(0===e.length)return!1;const t=e.filter((e,t)=>this.isRowSelected(e,t)).length;return t>0&&t<e.length}emitSelectionChange(e,t,r){this.emit("selection-change",{selectedKeys:e,selectedRows:this.getRowsByKeys(e),row:t,selected:r})}applySelectedKeys(e,t,r,s=!1){const l=Array.from(new Set(e.map(String))),i=!this.listsEqual(this.getEffectiveSelectedKeys(),l);!this.isSelectionControlled()&&i&&(F(this,h,new Set(l)),this.refresh()),!s&&i&&this.emitSelectionChange(l,t,r)}toggleRowSelection(e,t){if(!this.$data.selectable)return;const r=this.getRowKey(e,t),s=this.getEffectiveSelectedKeys(),l=this.getEffectiveSelectedKeySet().has(r);let i;i="single"===this.getSelectionMode()?l?[]:[r]:l?s.filter(e=>e!==r):[...s,r],this.applySelectedKeys(i,e,!l)}setSelectedKeys(e,t=!1){this.applySelectedKeys(this.normalizeKeyList(e),void 0,void 0,t)}clearSelection(e=!1){this.applySelectedKeys([],void 0,void 0,e)}handleRowSelectClick(e,t,r){r.stopPropagation(),this.toggleRowSelection(e,t),this.refresh()}handleSelectAllClick(e){if(e.stopPropagation(),!this.$data.selectable||"single"===this.getSelectionMode())return;const t=this.getDisplayedDataSource();if(0===t.length)return void this.refresh();const r=this.getEffectiveSelectedKeys(),s=this.getEffectiveSelectedKeySet(),l=t.map((e,t)=>this.getRowKey(e,t)),i=new Set(l),a=l.every(e=>s.has(e)),n=a?r.filter(e=>!i.has(e)):[...r,...l.filter(e=>!s.has(e))];this.applySelectedKeys(n,void 0,!a),this.refresh()}getExpandSlotName(e,t){return`expand-${this.getRowKey(e,t)}`}hasSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}shouldRenderExpand(e,t){return"function"==typeof this.$data.expandRender&&!this.hasSlot(this.getExpandSlotName(e,t))}isRowExpanded(e,t){return this.getEffectiveExpandedKeys().includes(this.getRowKey(e,t))}getExpandedKeys(){return this.getEffectiveExpandedKeys()}emitExpandChange(e,t,r,s){this.emit("expand-change",{expandedKeys:e,row:t,index:r,expanded:s})}applyExpandedKeys(e,t,r,s,l=!1){const i=Array.from(new Set(e.map(String))),a=!this.listsEqual(this.getEffectiveExpandedKeys(),i);!this.isExpansionControlled()&&a&&(F(this,d,new Set(i)),this.refresh()),!l&&a&&this.emitExpandChange(i,t,r,s)}toggleRowExpansion(e,t){if(!this.$data.expandable)return;const r=this.getRowKey(e,t),s=this.getEffectiveExpandedKeys(),l=s.includes(r),i=l?s.filter(e=>e!==r):[...s,r];this.applyExpandedKeys(i,e,t,!l)}setExpandedKeys(e,t=!1){this.applyExpandedKeys(this.normalizeKeyList(e),void 0,void 0,void 0,t)}handleExpandClick(e,t,r){r.stopPropagation(),this.toggleRowExpansion(e,t)}handlePaginationChange(e){const t="undefined"!=typeof Event&&e instanceof Event?e.detail:e;if(!t)return;const r=Math.max(1,Math.floor(Number(t.current))||1),s=Math.max(1,Math.floor(Number(t.pageSize))||10);this.emit("page-change",{current:r,pageSize:s})}attributeChanged(e,t,r){if("data-source"!==e)return;const s=this.getParsedDataSource();this.emit("data-change",{dataSource:s,total:s.length})}setColumns(e){this.$data.columns=e}setDataSource(e){this.$data.dataSource=e,this.emit("data-change",{dataSource:e,total:e.length})}getDataSource(){return this.getParsedDataSource()}};n=new WeakMap,o=new WeakMap,h=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,f=new WeakMap,g=new WeakMap,p=new WeakMap,y=new WeakMap,m=new WeakMap,S=new WeakMap,C=new WeakMap,w=new WeakMap,b=new WeakMap,x=new WeakMap,A=((e,t)=>{for(var r,s=t,l=e.length-1;l>=0;l--)(r=e[l])&&(s=r(s)||s);return s})([a({tagName:"solely-table",template:s,styles:r,shadowDOM:{use:!0,mode:"open"},props:[{name:"columns",type:"string",default:[]},{name:"dataSource",type:"string",default:[]},{name:"size",type:"string",default:"medium"},{name:"bordered",type:"boolean",default:!1},{name:"loading",type:"boolean",default:!1},{name:"striped",type:"boolean",default:!1},{name:"rowClickable",type:"boolean",default:!1},{name:"rowKey",type:"string"},{name:"selectable",type:"boolean",default:!1},{name:"selectionMode",type:"string",default:"multiple"},{name:"selectedKeys",type:"array"},{name:"expandable",type:"boolean",default:!1},{name:"expandedKeys",type:"array"},{name:"expandRender",type:"object"},{name:"sort",type:"object"},{name:"filterValues",type:"object"},{name:"localSort",type:"boolean",default:!0},{name:"localFilter",type:"boolean",default:!0},{name:"remote",type:"boolean",default:!1}]})],A);export{A as SolelyTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:block}.table-wrapper{font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);overflow-x:auto}.table{width:100%;border-collapse:separate;border-spacing:0;text-align:left;background-color:var(--solely-component-bg)}.table--bordered{border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md)}.table--bordered th,.table--bordered td{border-right:1px solid var(--solely-border-color);border-bottom:1px solid var(--solely-border-color)}.table--bordered th:last-child,.table--bordered td:last-child{border-right:none}.table--bordered tr:last-child td{border-bottom:none}.table th{padding:var(--solely-spacing-md) var(--solely-spacing-md);font-weight:500;color:var(--solely-text-primary);background-color:var(--solely-gray-2);border-bottom:1px solid var(--solely-border-color);white-space:nowrap}.table td{padding:var(--solely-spacing-md) var(--solely-spacing-md);color:var(--solely-text-primary);border-bottom:1px solid var(--solely-border-color);transition:background-color var(--solely-transition-duration)}.table--sm th,.table--sm td{padding:var(--solely-spacing-xs) var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.table--lg th,.table--lg td{padding:var(--solely-spacing-md) var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.table--md th,.table--md td{padding:var(--solely-spacing-sm) var(--solely-spacing-md)}.table--striped tbody tr:nth-child(2n){background-color:var(--solely-gray-3)}.table--clickable tbody tr{cursor:pointer}.table tbody tr:hover{background-color:var(--solely-primary-light)}.table th.fixed-left,.table td.fixed-left{position:sticky;left:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-right,.table td.fixed-right{position:sticky;right:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-left,.table th.fixed-right{z-index:var(--solely-z-index-table-header);background-color:var(--solely-gray-2)}.is-loading{opacity:var(--solely-disabled-opacity);pointer-events:none}.table__loading{display:flex;align-items:center;justify-content:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table__loading-icon{width:24px;height:24px;border:2px solid var(--solely-border-color);border-top-color:var(--solely-primary);border-radius:50%;animation:table-spin 1s linear infinite}@keyframes table-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.table__empty{text-align:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table .align-left{text-align:left}.table .align-center{text-align:center}.table .align-right{text-align:right}";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:block}.table-wrapper{font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);overflow-x:auto}.table{width:100%;border-collapse:separate;border-spacing:0;text-align:left;background-color:var(--solely-component-bg)}.table--bordered{border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md)}.table--bordered th,.table--bordered td{border-right:1px solid var(--solely-border-color);border-bottom:1px solid var(--solely-border-color)}.table--bordered th:last-child,.table--bordered td:last-child{border-right:none}.table--bordered tr:last-child td{border-bottom:none}.table th{padding:var(--solely-spacing-md) var(--solely-spacing-md);font-weight:500;color:var(--solely-text-primary);background-color:var(--solely-gray-2);border-bottom:1px solid var(--solely-border-color);white-space:nowrap}.table td{padding:var(--solely-spacing-md) var(--solely-spacing-md);color:var(--solely-text-primary);border-bottom:1px solid var(--solely-border-color);transition:background-color var(--solely-transition-duration)}.table--sm th,.table--sm td{padding:var(--solely-spacing-xs) var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.table--lg th,.table--lg td{padding:var(--solely-spacing-md) var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.table--md th,.table--md td{padding:var(--solely-spacing-sm) var(--solely-spacing-md)}.table--striped tbody tr:nth-child(2n){background-color:var(--solely-gray-3)}.table--clickable tbody tr{cursor:pointer}.table tbody tr:hover{background-color:var(--solely-primary-light)}.table tbody tr:focus-visible{outline:var(--solely-focus-ring-width) solid var(--solely-focus-ring-color);outline-offset:calc(-1 * var(--solely-focus-ring-width))}.table th.fixed-left,.table td.fixed-left{position:sticky;left:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-right,.table td.fixed-right{position:sticky;right:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-left,.table th.fixed-right{z-index:var(--solely-z-index-table-header);background-color:var(--solely-gray-2)}.is-loading{opacity:var(--solely-disabled-opacity);pointer-events:none}.table__loading{display:flex;align-items:center;justify-content:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table__loading-icon{width:24px;height:24px;border:2px solid var(--solely-border-color);border-top-color:var(--solely-primary);border-radius:50%;animation:table-spin 1s linear infinite}@keyframes table-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.table__empty{text-align:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table .align-left{text-align:left}.table .align-center{text-align:center}.table .align-right{text-align:right}.table__filter-row th{padding:var(--solely-spacing-xs) var(--solely-spacing-md);font-weight:400;background-color:var(--solely-gray-3);border-bottom:1px solid var(--solely-border-color)}.table__filter-row th.table__sortable{cursor:default}.table__filter{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}.table__filter-option{display:inline-flex;align-items:center;gap:4px;font-size:var(--solely-font-size-sm);color:var(--solely-text-secondary);cursor:pointer;white-space:nowrap}.table__filter-clear{padding:0;font-family:inherit;font-size:var(--solely-font-size-sm);color:var(--solely-primary);background:transparent;border:none;cursor:pointer}.table__filter-clear:hover{text-decoration:underline}.table__cell-render{display:inline-block}.table__sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.table__sortable:focus-visible{outline:2px solid var(--solely-primary);outline-offset:-2px}.table__head-content{display:inline-flex;align-items:center;gap:var(--solely-spacing-xxs, 4px)}.table__sort-icon{font-size:var(--solely-font-size-sm);line-height:1;opacity:.45;transition:opacity var(--solely-transition-duration)}.table__sort-icon.is-active{opacity:1;color:var(--solely-primary)}.table__selection-cell{width:48px;text-align:center}.table__checkbox{width:16px;height:16px;margin:0;vertical-align:middle;cursor:pointer;accent-color:var(--solely-primary)}.table__row--selected>td{background-color:color-mix(in srgb,var(--solely-primary) 10%,transparent)}.table__row--selected>td:first-child{box-shadow:inset 3px 0 0 var(--solely-primary)}.table__expand-cell{width:44px;text-align:center}.table__expand-trigger{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;line-height:1;color:var(--solely-text-secondary);background:transparent;border:none;border-radius:var(--solely-border-radius-sm, 4px);cursor:pointer}.solely-linear-icon{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;flex-shrink:0}.table__expand-trigger:hover{color:var(--solely-primary)}.table__expand-trigger:focus-visible{outline:2px solid var(--solely-primary);outline-offset:-2px}.table__expand-row>.table__expand-detail{padding:0;background-color:var(--solely-gray-2)}.table__expand-content{padding:var(--solely-spacing-md);text-align:left;color:var(--solely-text-secondary)}.table__empty-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="*,*:before,*:after{box-sizing:border-box}:host{display:block}.table-wrapper{font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);overflow-x:auto}.table{width:100%;border-collapse:separate;border-spacing:0;text-align:left;background-color:var(--solely-component-bg)}.table--bordered{border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md)}.table--bordered th,.table--bordered td{border-right:1px solid var(--solely-border-color);border-bottom:1px solid var(--solely-border-color)}.table--bordered th:last-child,.table--bordered td:last-child{border-right:none}.table--bordered tr:last-child td{border-bottom:none}.table th{padding:var(--solely-spacing-md) var(--solely-spacing-md);font-weight:500;color:var(--solely-text-primary);background-color:var(--solely-gray-2);border-bottom:1px solid var(--solely-border-color);white-space:nowrap}.table td{padding:var(--solely-spacing-md) var(--solely-spacing-md);color:var(--solely-text-primary);border-bottom:1px solid var(--solely-border-color);transition:background-color var(--solely-transition-duration)}.table--sm th,.table--sm td{padding:var(--solely-spacing-xs) var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.table--lg th,.table--lg td{padding:var(--solely-spacing-md) var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.table--md th,.table--md td{padding:var(--solely-spacing-sm) var(--solely-spacing-md)}.table--striped tbody tr:nth-child(2n){background-color:var(--solely-gray-3)}.table--clickable tbody tr{cursor:pointer}.table tbody tr:hover{background-color:var(--solely-primary-light)}.table th.fixed-left,.table td.fixed-left{position:sticky;left:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-right,.table td.fixed-right{position:sticky;right:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-left,.table th.fixed-right{z-index:var(--solely-z-index-table-header);background-color:var(--solely-gray-2)}.is-loading{opacity:var(--solely-disabled-opacity);pointer-events:none}.table__loading{display:flex;align-items:center;justify-content:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table__loading-icon{width:24px;height:24px;border:2px solid var(--solely-border-color);border-top-color:var(--solely-primary);border-radius:50%;animation:table-spin 1s linear infinite}@keyframes table-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.table__empty{text-align:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table .align-left{text-align:left}.table .align-center{text-align:center}.table .align-right{text-align:right}";export{e as default};
|
|
1
|
+
const e="*,*:before,*:after{box-sizing:border-box}:host{display:block}.table-wrapper{font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);overflow-x:auto}.table{width:100%;border-collapse:separate;border-spacing:0;text-align:left;background-color:var(--solely-component-bg)}.table--bordered{border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md)}.table--bordered th,.table--bordered td{border-right:1px solid var(--solely-border-color);border-bottom:1px solid var(--solely-border-color)}.table--bordered th:last-child,.table--bordered td:last-child{border-right:none}.table--bordered tr:last-child td{border-bottom:none}.table th{padding:var(--solely-spacing-md) var(--solely-spacing-md);font-weight:500;color:var(--solely-text-primary);background-color:var(--solely-gray-2);border-bottom:1px solid var(--solely-border-color);white-space:nowrap}.table td{padding:var(--solely-spacing-md) var(--solely-spacing-md);color:var(--solely-text-primary);border-bottom:1px solid var(--solely-border-color);transition:background-color var(--solely-transition-duration)}.table--sm th,.table--sm td{padding:var(--solely-spacing-xs) var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.table--lg th,.table--lg td{padding:var(--solely-spacing-md) var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.table--md th,.table--md td{padding:var(--solely-spacing-sm) var(--solely-spacing-md)}.table--striped tbody tr:nth-child(2n){background-color:var(--solely-gray-3)}.table--clickable tbody tr{cursor:pointer}.table tbody tr:hover{background-color:var(--solely-primary-light)}.table tbody tr:focus-visible{outline:var(--solely-focus-ring-width) solid var(--solely-focus-ring-color);outline-offset:calc(-1 * var(--solely-focus-ring-width))}.table th.fixed-left,.table td.fixed-left{position:sticky;left:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-right,.table td.fixed-right{position:sticky;right:0;z-index:var(--solely-z-index-table-fixed);background-color:var(--solely-component-bg)}.table th.fixed-left,.table th.fixed-right{z-index:var(--solely-z-index-table-header);background-color:var(--solely-gray-2)}.is-loading{opacity:var(--solely-disabled-opacity);pointer-events:none}.table__loading{display:flex;align-items:center;justify-content:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table__loading-icon{width:24px;height:24px;border:2px solid var(--solely-border-color);border-top-color:var(--solely-primary);border-radius:50%;animation:table-spin 1s linear infinite}@keyframes table-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.table__empty{text-align:center;padding:var(--solely-spacing-xl);color:var(--solely-text-tertiary)}.table .align-left{text-align:left}.table .align-center{text-align:center}.table .align-right{text-align:right}.table__filter-row th{padding:var(--solely-spacing-xs) var(--solely-spacing-md);font-weight:400;background-color:var(--solely-gray-3);border-bottom:1px solid var(--solely-border-color)}.table__filter-row th.table__sortable{cursor:default}.table__filter{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}.table__filter-option{display:inline-flex;align-items:center;gap:4px;font-size:var(--solely-font-size-sm);color:var(--solely-text-secondary);cursor:pointer;white-space:nowrap}.table__filter-clear{padding:0;font-family:inherit;font-size:var(--solely-font-size-sm);color:var(--solely-primary);background:transparent;border:none;cursor:pointer}.table__filter-clear:hover{text-decoration:underline}.table__cell-render{display:inline-block}.table__sortable{cursor:pointer;-webkit-user-select:none;user-select:none}.table__sortable:focus-visible{outline:2px solid var(--solely-primary);outline-offset:-2px}.table__head-content{display:inline-flex;align-items:center;gap:var(--solely-spacing-xxs, 4px)}.table__sort-icon{font-size:var(--solely-font-size-sm);line-height:1;opacity:.45;transition:opacity var(--solely-transition-duration)}.table__sort-icon.is-active{opacity:1;color:var(--solely-primary)}.table__selection-cell{width:48px;text-align:center}.table__checkbox{width:16px;height:16px;margin:0;vertical-align:middle;cursor:pointer;accent-color:var(--solely-primary)}.table__row--selected>td{background-color:color-mix(in srgb,var(--solely-primary) 10%,transparent)}.table__row--selected>td:first-child{box-shadow:inset 3px 0 0 var(--solely-primary)}.table__expand-cell{width:44px;text-align:center}.table__expand-trigger{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;line-height:1;color:var(--solely-text-secondary);background:transparent;border:none;border-radius:var(--solely-border-radius-sm, 4px);cursor:pointer}.solely-linear-icon{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;flex-shrink:0}.table__expand-trigger:hover{color:var(--solely-primary)}.table__expand-trigger:focus-visible{outline:2px solid var(--solely-primary);outline-offset:-2px}.table__expand-row>.table__expand-detail{padding:0;background-color:var(--solely-gray-2)}.table__expand-content{padding:var(--solely-spacing-md);text-align:left;color:var(--solely-text-secondary)}.table__empty-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}";export{e as default};
|