@ticatec/uniface-element 0.1.24 → 0.1.31

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.
Files changed (52) hide show
  1. package/dist/accordion/Accordion.svelte +9 -1
  2. package/dist/accordion/AccordionItemView.svelte +14 -4
  3. package/dist/accordion/AccordionItemView.svelte.d.ts +1 -0
  4. package/dist/app-top-bar/AppTopBar.svelte +9 -13
  5. package/dist/app-top-bar/AppTopBar.svelte.d.ts +1 -1
  6. package/dist/breadcrumbs/Breadcrumb.d.ts +4 -0
  7. package/dist/breadcrumbs/Breadcrumbs.svelte +21 -0
  8. package/dist/breadcrumbs/Breadcrumbs.svelte.d.ts +24 -0
  9. package/dist/breadcrumbs/index.d.ts +4 -0
  10. package/dist/breadcrumbs/index.js +2 -0
  11. package/dist/button/Button.svelte +2 -2
  12. package/dist/card/Card.svelte +3 -1
  13. package/dist/card/Card.svelte.d.ts +1 -0
  14. package/dist/card/CommonCardActionBar.svelte +4 -2
  15. package/dist/card/CommonCardActionBar.svelte.d.ts +1 -0
  16. package/dist/color-picker/ColorPicker.svelte +59 -0
  17. package/dist/color-picker/ColorPicker.svelte.d.ts +29 -0
  18. package/dist/color-picker/ColorPickerPanel.svelte +179 -0
  19. package/dist/color-picker/ColorPickerPanel.svelte.d.ts +23 -0
  20. package/dist/color-picker/index.d.ts +2 -0
  21. package/dist/color-picker/index.js +2 -0
  22. package/dist/common/CommonPicker.svelte +6 -3
  23. package/dist/common/Popover.svelte +9 -2
  24. package/dist/common-editor/CommonEditor.svelte +8 -7
  25. package/dist/common-range-editor/CommonRangeEditor.svelte +1 -5
  26. package/dist/data-table/DataTable.svelte +2 -1
  27. package/dist/data-table/DataTable.svelte.d.ts +1 -0
  28. package/dist/data-table/lib/ActionsColumn.d.ts +4 -0
  29. package/dist/data-table/parts/ActionsPanel.svelte +1 -1
  30. package/dist/data-table/parts/ActionsRow.svelte +4 -3
  31. package/dist/data-table/parts/ActionsRow.svelte.d.ts +1 -0
  32. package/dist/date-picker/DatePicker.svelte +2 -2
  33. package/dist/date-picker/DateTimePicker.svelte +1 -1
  34. package/dist/date-range/DateRangeEditor.svelte +1 -1
  35. package/dist/drawer/Drawer.svelte +9 -17
  36. package/dist/drawer/Drawer.svelte.d.ts +3 -7
  37. package/dist/i18n_resources/uniface_cn_resource.d.ts +1 -0
  38. package/dist/i18n_resources/uniface_cn_resource.js +2 -1
  39. package/dist/i18n_resources/uniface_en_resource.d.ts +2 -0
  40. package/dist/i18n_resources/uniface_en_resource.js +3 -1
  41. package/dist/memo-editor/MemoEditor.svelte +1 -1
  42. package/dist/nav-menu/MenuItem.d.ts +1 -1
  43. package/dist/options-multi-select/OptionsMultiSelect.svelte +1 -1
  44. package/dist/options-select/OptionsSelect.svelte +2 -2
  45. package/dist/prompts-text-editor/PromptsTextEditor.svelte +9 -9
  46. package/dist/tabs/Tabs.svelte +2 -2
  47. package/dist/tag/Tag.svelte +1 -1
  48. package/dist/ticatec-uniface-web.css +178 -93
  49. package/dist/unit-number-editor/UnitNumberEditor.svelte +6 -5
  50. package/package.json +6 -2
  51. package/dist/data-table/lib/AdvColumn.d.ts +0 -36
  52. /package/dist/{data-table/lib/AdvColumn.js → breadcrumbs/Breadcrumb.js} +0 -0
@@ -1,9 +1,5 @@
1
1
  <script lang="ts">
2
2
 
3
-
4
- import utils from "../common/utils";
5
- import Icon from "../icon";
6
-
7
3
  export let variant: '' | 'plain' | 'outlined' | 'filled' = '';
8
4
  export let compact: boolean = false;
9
5
  export {className as class};
@@ -22,7 +18,7 @@
22
18
  <div class="divider"></div>
23
19
  <slot name="to"/>
24
20
  <div class="uniface-editor-clean-icon {showActionIcon ? '' : 'hidden'}">
25
- <i class="uniface-icon-x clickable" aria-hidden="true" on:click={clean}></i>
21
+ <i class="icon_google_clear clickable" aria-hidden="true" on:click={clean}></i>
26
22
  </div>
27
23
  </div>
28
24
  <slot/>
@@ -21,6 +21,7 @@
21
21
  export let inlineRowHeight: number = 80;
22
22
  export let rowBorder: boolean = false;
23
23
  export let colBorder: boolean = false;
24
+ export let emptyIndicator: string | undefined = undefined;
24
25
 
25
26
  export let style: string = '';
26
27
 
@@ -111,7 +112,7 @@
111
112
  {/if}
112
113
 
113
114
  <ContentPanel columns={dataColumns} {orderDirection} {orderColumn} {handleWidthChange} {handleCellClick} {tabWidth} bind:rows
114
- bind:scrollTop {expandRow} {rowHeight} {list} {table} {inlineComponent} bind:inlineRowHeight
115
+ bind:scrollTop {expandRow} {rowHeight} {list} {table} {inlineComponent} bind:inlineRowHeight {emptyIndicator}
115
116
  displayHorizontalScroll={actionsColumn!=null || indicatorColumn != null || fixedCols.length > 0}
116
117
  showVerticalScroll={actionsColumn == null}/>
117
118
  {/if}
@@ -24,6 +24,7 @@ declare const DataTable: $$__sveltets_2_IsomorphicComponent<{
24
24
  inlineRowHeight?: number;
25
25
  rowBorder?: boolean;
26
26
  colBorder?: boolean;
27
+ emptyIndicator?: string | undefined;
27
28
  style?: string;
28
29
  }, {
29
30
  [evt: string]: CustomEvent<any>;
@@ -8,4 +8,8 @@ export default interface ActionsColumn {
8
8
  *
9
9
  */
10
10
  getActions: GetRowActions;
11
+ /**
12
+ * 对齐方式,默认靠左对齐
13
+ */
14
+ align?: 'left' | 'center';
11
15
  }
@@ -56,7 +56,7 @@
56
56
  <div bind:this={scrollPanel} class="rows-container" style="overflow-y: auto" on:scroll|passive={handleActionPanelScroll}>
57
57
  <div>
58
58
  {#each rows as row, idx}
59
- <ActionsRow {row} {rowHeight} parentRect={rect} alternative={idx % 2 == 1} width={actionsColumn.width}
59
+ <ActionsRow {row} {rowHeight} parentRect={rect} alternative={idx % 2 == 1} width={actionsColumn.width} align={actionsColumn.align}
60
60
  actions={actionsColumn.getActions(row.data)}/>
61
61
  {#if row == expandRow}
62
62
  <div class="inline-panel" style="height: {inlineRowHeight??0}px">
@@ -15,6 +15,8 @@
15
15
 
16
16
  export let rowHeight: number;
17
17
 
18
+ export let align: 'left' | 'center' | undefined;
19
+
18
20
  let style: string;
19
21
 
20
22
 
@@ -84,9 +86,8 @@
84
86
  $: style = rowHeight== null ? '' : `height: ${rowHeight}px`
85
87
 
86
88
  </script>
87
- <div class="data-row" class:alternative style="position: relative; width: {width}px; display: block; {style}">
88
- <div class="action-cell" bind:this={cell}
89
- style="">
89
+ <div class="data-row" class:alternative style="position: relative; display: block; width: {width}px; {style}">
90
+ <div class="action-cell" bind:this={cell} style="{align=='center' ? 'margin: 0 auto' : ''}">
90
91
  {#each actionList as action}
91
92
  <TextButton style="flex-shrink: 0; top: 0" size="mini" type="primary" label={action.label} onClick={()=>action.callback(row.data)}/>
92
93
  {/each}
@@ -20,6 +20,7 @@ declare const ActionsRow: $$__sveltets_2_IsomorphicComponent<{
20
20
  parentRect: DOMRect;
21
21
  width: number;
22
22
  rowHeight: number;
23
+ align: "left" | "center" | undefined;
23
24
  }, {
24
25
  [evt: string]: CustomEvent<any>;
25
26
  }, {}, {}, string>;
@@ -46,7 +46,7 @@
46
46
  }
47
47
 
48
48
  const handleCalendarSelect = (d: dayjs.Dayjs) => {
49
- value = d;
49
+ value = d.toDate();
50
50
  showPopup = false;
51
51
  }
52
52
 
@@ -78,7 +78,7 @@
78
78
 
79
79
  </script>
80
80
 
81
- <CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="uniface-icon-calendar"
81
+ <CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="icon_google_event_available"
82
82
  bind:showPopup canClean={!mandatory && value!=null} autoFit={false} clean={cleanData} {textValue} {readonly} {disabled}>
83
83
 
84
84
  <input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder} on:keydown={handleKeyDown}
@@ -115,7 +115,7 @@
115
115
 
116
116
  </script>
117
117
 
118
- <CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="uniface-icon-calendar"
118
+ <CommonPicker {displayMode} {variant} {style} className="uniface-date-time-editor" {compact} dropDownIcon="icon_google_access_time"
119
119
  bind:showPopup canClean={!mandatory && value!=null} autoFit={false} clean={cleanData} {textValue} {readonly} {disabled}>
120
120
 
121
121
  <input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder} on:keydown={handleKeyDown}
@@ -66,7 +66,7 @@
66
66
  <input style="width: 100%; text-align: center" readonly on:click={showPopover} value={textTo}/>
67
67
  </svelte:fragment>
68
68
  <svelte:fragment>
69
- <i class="uniface-icon-calendar action-icon" aria-hidden="true" on:click={showPopover}></i>
69
+ <i class="icon_google_event_note action-icon" aria-hidden="true" on:click={showPopover}></i>
70
70
  </svelte:fragment>
71
71
  </CommonRangeEditor>
72
72
 
@@ -1,38 +1,30 @@
1
1
  <script lang="ts">
2
2
  import {fly} from "svelte/transition";
3
- import {createEventDispatcher} from "svelte";
4
3
 
5
4
 
6
- export const open = () => {
7
- visible = true;
8
- hidden = false;
9
- dispatch('open');
10
- }
5
+ export let visible: boolean = false;
11
6
 
12
- export const close = () => {
13
- visible = false;
14
- }
7
+ let hidden: boolean = true;
15
8
 
16
- export let width:number = 300;
17
- export let position: 'left' | 'right' = 'left';
18
9
 
19
- const dispatch = createEventDispatcher();
20
- let hidden: boolean = true;
21
- let visible: boolean = false;
10
+ export let width:number = 300;
11
+ export let position: 'left' | 'right' = 'left'
22
12
 
23
13
  $: if (visible) {
24
14
  hidden = false;
25
15
  }
26
16
 
17
+
18
+
27
19
  let xPos: string;
28
20
 
29
21
  $: xPos = position == 'left' ? `${-width}` : '100%';
30
22
 
31
23
  </script>
32
- <div class="uniface-drawer" style="display: {hidden ? 'none' : 'block'}" on:click={()=>{visible=false; dispatch('close')}}>
24
+ <div class="uniface-drawer" aria-hidden="true" style="display: {hidden ? 'none' : 'block'}" on:click={()=>{visible=false;}}>
33
25
  {#if visible}
34
- <div class={position} style="width: {width}px" transition:fly={{ x: xPos, duration: 1000, opacity: 0.5 }}
35
- on:outroend={()=>{hidden = !visible}} on:click={(e)=>{e.stopPropagation()}}>
26
+ <div class={position} style="width: {width}px" transition:fly={{ x: xPos, duration: 1000, opacity: 0.5 }} aria-hidden="false"
27
+ on:outroend={()=>{hidden = !visible}} on:click|stopPropagation>
36
28
  <div>
37
29
  <slot></slot>
38
30
  </div>
@@ -17,21 +17,17 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
17
17
  children?: any;
18
18
  } : {});
19
19
  declare const Drawer: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
20
- open?: () => void;
21
- close?: () => void;
20
+ visible?: boolean;
22
21
  width?: number;
23
22
  position?: "left" | "right";
24
23
  }, {
25
24
  default: {};
26
25
  }>, {
27
- close: CustomEvent<any>;
26
+ click: MouseEvent;
28
27
  } & {
29
28
  [evt: string]: CustomEvent<any>;
30
29
  }, {
31
30
  default: {};
32
- }, {
33
- open: () => void;
34
- close: () => void;
35
- }, string>;
31
+ }, {}, string>;
36
32
  type Drawer = InstanceType<typeof Drawer>;
37
33
  export default Drawer;
@@ -23,6 +23,7 @@ declare const langRes: {
23
23
  dataTable: {
24
24
  rowNo: string;
25
25
  actions: string;
26
+ emptyDataSet: string;
26
27
  };
27
28
  };
28
29
  };
@@ -30,7 +30,8 @@ const langRes = {
30
30
  },
31
31
  dataTable: {
32
32
  rowNo: "序号",
33
- actions: "操作"
33
+ actions: "操作",
34
+ emptyDataSet: '空数据集'
34
35
  }
35
36
  }
36
37
  };
@@ -3,6 +3,7 @@ declare const langRes: {
3
3
  btnClose: string;
4
4
  btnCancel: string;
5
5
  btnConfirm: string;
6
+ colorPicker: string;
6
7
  calendar: {
7
8
  months: string[];
8
9
  monthsAbbr: string[];
@@ -23,6 +24,7 @@ declare const langRes: {
23
24
  dataTable: {
24
25
  rowNo: string;
25
26
  actions: string;
27
+ emptyDataSet: string;
26
28
  };
27
29
  };
28
30
  };
@@ -3,6 +3,7 @@ const langRes = {
3
3
  btnClose: "Close",
4
4
  btnCancel: 'Cancel',
5
5
  btnConfirm: "OK",
6
+ colorPicker: "Pick up color",
6
7
  calendar: {
7
8
  months: [
8
9
  'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
@@ -30,7 +31,8 @@ const langRes = {
30
31
  },
31
32
  dataTable: {
32
33
  rowNo: "Row#",
33
- actions: "Actions"
34
+ actions: "Actions",
35
+ emptyDataSet: 'Empty dataset'
34
36
  }
35
37
  }
36
38
  };
@@ -78,7 +78,7 @@
78
78
  {/if}
79
79
  {#if !disabled && value && value.length > 0}
80
80
  <div class="action-button-wrapper" style="position: absolute; top: 0; left: 0; width: {width}px;">
81
- <Icon name="uniface-icon-x" clickable class="uniface-editor-clean-icon" onClick={clean}/>
81
+ <Icon name="icon_google_clear" clickable class="uniface-editor-clean-icon" onClick={clean}/>
82
82
  </div>
83
83
  {/if}
84
84
  </div>
@@ -2,7 +2,7 @@ export default interface MenuItem {
2
2
  /**
3
3
  * 菜单编码
4
4
  */
5
- code: string;
5
+ code?: string;
6
6
  /**
7
7
  * 菜单文字
8
8
  */
@@ -104,7 +104,7 @@
104
104
 
105
105
  </script>
106
106
 
107
- <CommonPicker {displayMode} {variant} {style} {compact} className="multiple" dropDownIcon="uniface-icon-chevron-down"
107
+ <CommonPicker {displayMode} {variant} {style} {compact} className="multiple" dropDownIcon="icon_google_arrow_drop_down"
108
108
  bind:showPopup canClean={value!=null} autoFit clean={cleanData} {textValue} {readonly} {disabled}>
109
109
 
110
110
  <div class="option-field" aria-hidden="true" on:click={()=>{showPopup = true}}>
@@ -74,7 +74,7 @@
74
74
 
75
75
  </script>
76
76
 
77
- <CommonPicker {displayMode} {variant} {style} {compact} dropDownIcon="uniface-icon-chevron-down"
77
+ <CommonPicker {displayMode} {variant} {style} {compact} dropDownIcon="icon_google_arrow_drop_down"
78
78
  bind:showPopup canClean={!mandatory && value!=null} autoFit clean={cleanData} {textValue} {readonly} {disabled}>
79
79
 
80
80
  <input style="width: 100%" bind:this={editor} on:click={openPopup} {placeholder} readonly
@@ -84,7 +84,7 @@
84
84
  {#each options as op}
85
85
  {#if hideOptions.indexOf(op[keyField]) < 0}
86
86
  {#if itemRender != null}
87
- <svelte:component this={itemRender} item={op} disabled={disableOptions.indexOf(op[keyField])>-1}
87
+ <svelte:component this={itemRender.component} {...itemRender.props} item={op} disabled={disableOptions.indexOf(op[keyField])>-1}
88
88
  on:click={handleItemClick(op)}/>
89
89
  {:else}
90
90
  <div class="option-item" class:disabled={disableOptions.indexOf(op[keyField])>-1} aria-hidden="true"
@@ -64,27 +64,27 @@
64
64
 
65
65
  <div bind:this={divPanel}>
66
66
  <CommonEditor {displayMode} {style} {value} {prefix} {suffix} {readonly} {variant} {compact} class={className}
67
- showActionIcon={removable && !readonly && !disabled && !utils.isEmpty(value)} {clean}>
67
+ showActionIcon={removable && !readonly && !disabled && !utils.isEmpty(value)} {clean}
68
+ hasLeadingIcon={$$slots['leading-icon']!=null}>
68
69
  <svelte:fragment slot="leading-icon">
69
70
  {#if $$slots['leading-icon']}
70
- <div class="editor-embed-icon">
71
- <slot name="leading-icon"/>
72
- </div>
71
+ <slot name="leading-icon"/>
73
72
  {/if}
74
73
  </svelte:fragment>
75
- <input bind:this={editor} style="flex: 1 1 auto" {disabled} {placeholder} bind:value={value} {readonly}/>
76
- <div class="editor-embed-icon" slot="trailing-icon">
74
+ <input style="width: 100%" bind:this={editor} {disabled} {placeholder} bind:value={value} {readonly}/>
75
+ <svelte:fragment slot="trailing-icon">
77
76
  {#if !disabled && !readonly}
78
- <i class="option-dropdown uniface-icon-chevron-down" aria-hidden="true" on:click={openPopup}></i>
77
+ <i class="option-dropdown icon_google_arrow_drop_down" aria-hidden="true" on:click={openPopup}></i>
79
78
  {/if}
80
- </div>
79
+ </svelte:fragment>
81
80
  </CommonEditor>
82
81
 
83
82
  {#if showPopup}
84
83
  <Popover target={divPanel} autoFit align="right" on:close={()=>{showPopup=false}}>
85
84
  <div class="options-popover" style={mh}>
86
85
  {#each words as word}
87
- <div style="padding-left: 12px; padding-right: 12px" on:click={handleHintClick(word)} aria-hidden="true">
86
+ <div class="option-item" style="padding-left: 12px; padding-right: 12px" on:click={handleHintClick(word)}
87
+ aria-hidden="true">
88
88
  <span>{word}</span>
89
89
  </div>
90
90
  {/each}
@@ -126,10 +126,10 @@
126
126
  {:else}
127
127
  <span>{tab[textField]}</span>
128
128
  {#if refreshable}
129
- <i class="uniface-icon-rotate-cw tab-refresh" on:click={reloadTab(tab)} aria-hidden="true"></i>
129
+ <i class="icon_google_refresh tab-refresh" on:click={reloadTab(tab)} aria-hidden="true"></i>
130
130
  {/if}
131
131
  {#if closable === true || (typeof (closable) == "function" && closable(tab))}
132
- <i class="uniface-icon-x tab-action" on:click={closeTab(tab)} aria-hidden="true"></i>
132
+ <i class="icon_google_clear tab-action" on:click={closeTab(tab)} aria-hidden="true"></i>
133
133
  {/if}
134
134
  {/if}
135
135
  </div>
@@ -22,6 +22,6 @@
22
22
  <div class="uniface-tag" {style}>
23
23
  <div class="{size} {variant} {className} {colorClass}" class:removable={removable} >
24
24
  <span>{text}</span>
25
- <Icon name="uniface-icon-x" clickable class="uniface-remove-icon" onClick={removeHandler}/>
25
+ <Icon name="icon_google_clear" clickable class="uniface-remove-icon" onClick={removeHandler}/>
26
26
  </div>
27
27
  </div>