@ticatec/uniface-element 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-table/index.d.ts +4 -1
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/parts/ActionCell.svelte +19 -0
- package/dist/data-table/parts/ActionCell.svelte.d.ts +22 -0
- package/dist/data-table/parts/ContentPanel.svelte +0 -1
- package/dist/data-table/types.d.ts +20 -0
- package/dist/data-table/types.js +1 -0
- package/package.json +1 -1
|
@@ -5,6 +5,9 @@ import type IndicatorColumn from "./lib/IndicatorColumn";
|
|
|
5
5
|
import type RowAction from "./lib/RowAction";
|
|
6
6
|
import type { GetRowActions, ActionFunction } from "./lib/RowAction";
|
|
7
7
|
import type DataColumn from "./lib/DataColumn";
|
|
8
|
+
import type { CellAction } from "./types";
|
|
9
|
+
import ActionCell from "./parts/ActionCell.svelte";
|
|
8
10
|
export default DataTable;
|
|
11
|
+
export { ActionCell };
|
|
9
12
|
export type { ActionsColumn, IndicatorColumn, FormatCell, CellHint, DataColumn };
|
|
10
|
-
export type { RowAction, GetRowActions, ActionFunction };
|
|
13
|
+
export type { RowAction, GetRowActions, ActionFunction, CellAction };
|
package/dist/data-table/index.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type {CellAction, GetCellAction} from "../types";
|
|
3
|
+
import {TextButton} from "../../button";
|
|
4
|
+
|
|
5
|
+
export let data: any;
|
|
6
|
+
export let getAction: GetCellAction;
|
|
7
|
+
|
|
8
|
+
$: action = getAction?.(data);
|
|
9
|
+
|
|
10
|
+
const handleClick = async (event: MouseEvent) => {
|
|
11
|
+
await action?.handle(data)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
</script>
|
|
15
|
+
{#if action}
|
|
16
|
+
<div style="width: 100; overflow: hidden;">
|
|
17
|
+
<TextButton type={action.type ?? "primary"} label={action.text} onclick={handleClick}></TextButton>
|
|
18
|
+
</div>
|
|
19
|
+
{/if}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { GetCellAction } from "../types";
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const ActionCell: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
data: any;
|
|
17
|
+
getAction: GetCellAction;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type ActionCell = InstanceType<typeof ActionCell>;
|
|
22
|
+
export default ActionCell;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ButtonType } from "../button";
|
|
2
|
+
/**
|
|
3
|
+
* Action cell中的事件处理
|
|
4
|
+
*/
|
|
5
|
+
export type HandleAction = (data: any) => Promise<void>;
|
|
6
|
+
export interface CellAction {
|
|
7
|
+
/**
|
|
8
|
+
* action的文本
|
|
9
|
+
*/
|
|
10
|
+
text: string;
|
|
11
|
+
/**
|
|
12
|
+
* action的类型
|
|
13
|
+
*/
|
|
14
|
+
type?: ButtonType;
|
|
15
|
+
/**
|
|
16
|
+
* 点击处理
|
|
17
|
+
*/
|
|
18
|
+
handle: HandleAction;
|
|
19
|
+
}
|
|
20
|
+
export type GetCellAction = (data: any) => CellAction | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED