@ticatec/uniface-element 0.1.31 → 0.1.33

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.
@@ -10,6 +10,14 @@ export default interface RowAction {
10
10
  *
11
11
  */
12
12
  label: string;
13
+ /**
14
+ *
15
+ */
16
+ type?: 'primary' | 'secondary' | 'third' | 'forth';
17
+ /**
18
+ *
19
+ */
20
+ icon?: string;
13
21
  /**
14
22
  *
15
23
  */
@@ -1,11 +1,12 @@
1
1
  <script lang="ts">
2
2
 
3
3
  import type RowAction from "../lib/RowAction";
4
- import {TextButton} from "../../button";
4
+ import {IconButton, TextButton} from "../../button";
5
5
  import type TableRow from "./TableRow";
6
6
  import {onDestroy, onMount, tick} from "svelte";
7
7
  import utils from "../../common/utils";
8
8
  import PopupMenu from "./PopupMenu.svelte";
9
+
9
10
  export let row: TableRow;
10
11
  export let actions: Array<RowAction>;
11
12
  export let alternative: boolean;
@@ -83,13 +84,20 @@
83
84
  checkOverflow();
84
85
  }
85
86
 
86
- $: style = rowHeight== null ? '' : `height: ${rowHeight}px`
87
+ $: style = rowHeight == null ? '' : `height: ${rowHeight}px`;
88
+
87
89
 
88
90
  </script>
89
- <div class="data-row" class:alternative style="position: relative; display: block; width: {width}px; {style}">
91
+ <div class="data-row" class:alternative style="position: relative; display: block; padding: 0 4px; width: {width}px; {style}">
90
92
  <div class="action-cell" bind:this={cell} style="{align=='center' ? 'margin: 0 auto' : ''}">
91
93
  {#each actionList as action}
92
- <TextButton style="flex-shrink: 0; top: 0" size="mini" type="primary" label={action.label} onClick={()=>action.callback(row.data)}/>
94
+ {#if action.icon}
95
+ <IconButton style="flex-shrink: 0; top: 0" size="mini" type="{action.type ?? 'primary'}" icon={action.icon}
96
+ onClick={()=>action.callback(row.data)}/>
97
+ {:else}
98
+ <TextButton style="flex-shrink: 0; top: 0" size="mini" type="{action.type ?? 'primary'}" label={action.label}
99
+ onClick={()=>action.callback(row.data)}/>
100
+ {/if}
93
101
  {/each}
94
102
  {#if popupList.length > 0}
95
103
  <TextButton size="mini" type="primary" style="flex-shrink: 0; top: 0" label="..." onClick={showPopupMenu}/>
@@ -99,10 +107,15 @@
99
107
  {#if showPopup}
100
108
  <PopupMenu {parentRect} closeCallback={()=>{showPopup = false}}>
101
109
  <div style="padding: 4px 6px; box-sizing: border-box; background-color: #ffffff;">
102
- {#each popupList as action}
103
- <div class="action-popover" style="padding: 4px 6px">
104
- <TextButton size="mini" type="primary" label={action.label}
105
- onClick={()=>{action.callback?.(row.data); showPopup=false}}/>
110
+ {#each popupList.reverse() as action}
111
+ <div class="action-popover" style="padding: 4px 6px; text-align: center">
112
+ {#if action.icon}
113
+ <IconButton style="flex-shrink: 0; top: 0" size="mini" type="{action.type ?? 'primary'}" icon={action.icon}
114
+ onClick={()=>{action.callback(row.data); showPopup=false}}/>
115
+ {:else}
116
+ <TextButton style="flex-shrink: 0; top: 0" size="mini" type="{action.type ?? 'primary'}" label={action.label}
117
+ onClick={()=>{action.callback(row.data); showPopup=false}}/>
118
+ {/if}
106
119
  </div>
107
120
  {/each}
108
121
  </div>
@@ -8,8 +8,8 @@ declare global {
8
8
  Dialog: IDialog;
9
9
  }
10
10
  }
11
+ export default Dialog;
11
12
  export { type IDialog };
12
13
  export { type DialogCloseConfirm };
13
14
  export { DialogBoard };
14
- export default Dialog;
15
15
  export { CommonDialog };
@@ -1,8 +1,8 @@
1
1
  import Dialog from "./Dialog.svelte";
2
2
  import DialogBoard from "./DialogBoard.svelte";
3
3
  import CommonDialog from "./CommonDialog.svelte";
4
+ export default Dialog;
4
5
  export {};
5
6
  export {};
6
7
  export { DialogBoard };
7
- export default Dialog;
8
8
  export { CommonDialog };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,9 @@
1
1
  import { DateContext } from "./base-calendar";
2
- import type CardAction from "./card/CardAction";
3
- import type { DialogCloseConfirm, IDialog } from './dialog';
2
+ import type { IDialog } from './dialog';
4
3
  import { type IMessageBox, ModalResult } from "./message-box";
5
4
  import type { Toast } from "./toast";
6
5
  import type { Indicator } from "./indicator";
7
- import type { UnitOption } from "./unit-number-editor";
8
6
  import { DisplayMode } from "./common/DisplayMode.js";
9
- import type { FunFilter, LazyLoader, LoadResult } from "./list-box";
10
- import type { ActionsColumn, FormatCell, CellHint, IndicatorColumn, RowAction, GetRowActions, ActionFunction, DataColumn } from "./data-table";
11
- import type { ContextMenuItem, OnContextMenu, ActionCallback } from "./context-menu";
12
- import type { MouseClickHandler } from "./common/MouseClickHandler";
13
7
  export { DateContext, ModalResult, DisplayMode };
14
8
  declare global {
15
9
  interface Window {
@@ -19,8 +13,3 @@ declare global {
19
13
  Dialog: IDialog;
20
14
  }
21
15
  }
22
- export type { CardAction, IDialog, DialogCloseConfirm, IMessageBox, Toast, UnitOption };
23
- export type { MouseClickHandler };
24
- export type { LazyLoader, FunFilter, LoadResult };
25
- export type { ActionsColumn, FormatCell, CellHint, IndicatorColumn, RowAction, GetRowActions, ActionFunction, DataColumn };
26
- export type { ContextMenuItem, OnContextMenu, ActionCallback };
@@ -3892,6 +3892,7 @@
3892
3892
  .uniface-data-table .action-panel .data-row .action-cell {
3893
3893
  display: flex;
3894
3894
  flex-direction: row;
3895
+ gap: 4px;
3895
3896
  align-items: center;
3896
3897
  width: max-content;
3897
3898
  height: 100%;
@@ -0,0 +1,7 @@
1
+ import type { OnChangeHandler } from "./common/OnChangeHandler";
2
+ import type { MouseClickHandler } from "./common/MouseClickHandler";
3
+ import { DisplayMode } from "./common/DisplayMode.js";
4
+ import { DateContext } from "./base-calendar";
5
+ import { ModalResult } from "./message-box";
6
+ export { DateContext, ModalResult, DisplayMode };
7
+ export type { OnChangeHandler, MouseClickHandler };
package/dist/types.js ADDED
@@ -0,0 +1,4 @@
1
+ import { DisplayMode } from "./common/DisplayMode.js";
2
+ import { DateContext } from "./base-calendar";
3
+ import { ModalResult } from "./message-box";
4
+ export { DateContext, ModalResult, DisplayMode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "uniface web elements",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -28,6 +28,10 @@
28
28
  "types": "./dist/index.d.ts",
29
29
  "import": "./dist/index.js"
30
30
  },
31
+ "./types": {
32
+ "types": "./dist/types.d.ts",
33
+ "import": "./dist/types.js"
34
+ },
31
35
  "./i18n_resources": {
32
36
  "types": "./dist/i18n_resources/index.d.ts",
33
37
  "import": "./dist/i18n_resources/index.js"