@ticatec/uniface-element 0.1.14 → 0.1.16

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 (84) hide show
  1. package/dist/action-bar/ActionBar.svelte +2 -2
  2. package/dist/attachment-files/FileUploadBar.svelte +1 -1
  3. package/dist/attachment-files/FileUploadPanel.svelte +1 -1
  4. package/dist/base-calendar/CalendarBase.svelte +7 -3
  5. package/dist/base-calendar/CalendarBase.svelte.d.ts +0 -3
  6. package/dist/base-calendar/DateContext.d.ts +0 -9
  7. package/dist/base-calendar/DateContext.js +7 -68
  8. package/dist/base-calendar/index.d.ts +2 -2
  9. package/dist/base-calendar/index.js +2 -2
  10. package/dist/box/Box.svelte +11 -7
  11. package/dist/box/Box.svelte.d.ts +8 -3
  12. package/dist/checkbox/CheckBox.svelte +16 -7
  13. package/dist/checkbox/CheckBox.svelte.d.ts +1 -1
  14. package/dist/common/CommonPicker.svelte +14 -8
  15. package/dist/common/CommonPicker.svelte.d.ts +1 -1
  16. package/dist/common-editor/CommonEditor.svelte +17 -9
  17. package/dist/common-editor/CommonEditor.svelte.d.ts +2 -0
  18. package/dist/common-range-editor/CommonRangeEditor.svelte +8 -9
  19. package/dist/common-range-editor/CommonRangeEditor.svelte.d.ts +0 -2
  20. package/dist/concise-data-table/Column.d.ts +9 -0
  21. package/dist/concise-data-table/Column.js +1 -0
  22. package/dist/concise-data-table/ConciseListTable.svelte +154 -0
  23. package/dist/concise-data-table/ConciseListTable.svelte.d.ts +26 -0
  24. package/dist/concise-data-table/DataCell.svelte +22 -0
  25. package/dist/{data-table/parts/LinkButton.svelte.d.ts → concise-data-table/DataCell.svelte.d.ts} +7 -6
  26. package/dist/concise-data-table/DataRow.svelte +15 -0
  27. package/dist/concise-data-table/DataRow.svelte.d.ts +25 -0
  28. package/dist/concise-data-table/TableOptions.d.ts +11 -0
  29. package/dist/concise-data-table/TableOptions.js +1 -0
  30. package/dist/concise-data-table/index.d.ts +5 -0
  31. package/dist/concise-data-table/index.js +2 -0
  32. package/dist/concise-data-table/utils.d.ts +6 -0
  33. package/dist/concise-data-table/utils.js +38 -0
  34. package/dist/criteria-field/CriteriaField.svelte +3 -2
  35. package/dist/criteria-field/CriteriaField.svelte.d.ts +1 -0
  36. package/dist/data-table/DataTable.svelte +2 -0
  37. package/dist/data-table/lib/ActionsColumn.d.ts +0 -4
  38. package/dist/data-table/lib/HrefLink.d.ts +1 -1
  39. package/dist/data-table/parts/ActionsPanel.svelte +2 -2
  40. package/dist/data-table/parts/ContentPanel.svelte +6 -2
  41. package/dist/data-table/parts/DataCell.svelte +1 -1
  42. package/dist/data-table/parts/FixedHeaderPanel.svelte +1 -1
  43. package/dist/data-table/parts/HrefCell.svelte +8 -10
  44. package/dist/data-table/parts/TextCell.svelte +6 -9
  45. package/dist/date-picker/DateTimePicker.svelte +3 -7
  46. package/dist/date-range/DateRangeEditor.svelte +2 -2
  47. package/dist/dialog/Dialog.svelte +1 -1
  48. package/dist/form-field/FormField.svelte +9 -11
  49. package/dist/form-field/FormField.svelte.d.ts +2 -1
  50. package/dist/i18n_resources/index.d.ts +3 -0
  51. package/dist/i18n_resources/index.js +3 -0
  52. package/dist/i18n_resources/uniface_cn_resource.d.ts +29 -0
  53. package/dist/i18n_resources/uniface_cn_resource.js +37 -0
  54. package/dist/i18n_resources/uniface_en_resource.d.ts +29 -0
  55. package/dist/i18n_resources/uniface_en_resource.js +37 -0
  56. package/dist/input-options-select/InputOptionsSelect.svelte +105 -28
  57. package/dist/input-options-select/InputOptionsSelect.svelte.d.ts +2 -4
  58. package/dist/list-box/ListBox.svelte +81 -47
  59. package/dist/list-box/ListBox.svelte.d.ts +10 -16
  60. package/dist/message-box/IMessageBox.js +1 -1
  61. package/dist/nav-menu/NavigatorMenuItem.svelte +1 -1
  62. package/dist/options-multi-select/OptionsMultiSelect.svelte +1 -1
  63. package/dist/property-editor/PropertyEditor.svelte +1 -1
  64. package/dist/search-box/SearchBox.svelte +19 -12
  65. package/dist/search-box/SearchBox.svelte.d.ts +6 -2
  66. package/dist/text-editor/TextEditor.svelte +2 -3
  67. package/dist/ticatec-uniface-web.css +738 -652
  68. package/dist/tree-view/TreeNodeView.svelte +6 -8
  69. package/dist/tree-view/TreeUtils.js +2 -2
  70. package/package.json +12 -7
  71. package/dist/UnifaceResource.d.ts +0 -43
  72. package/dist/UnifaceResource.js +0 -57
  73. package/dist/assets/arrow_down.svg +0 -1
  74. package/dist/assets/arrow_up.svg +0 -1
  75. package/dist/assets/calendar_icon.svg +0 -1
  76. package/dist/assets/delete_icon.svg +0 -1
  77. package/dist/assets/icon-dropdown.svg +0 -1
  78. package/dist/assets/icon_left.svg +0 -1
  79. package/dist/assets/icon_right.svg +0 -1
  80. package/dist/assets/pickup-options.svg +0 -1
  81. package/dist/assets/retry.png +0 -0
  82. package/dist/data-table/parts/LinkButton.svelte +0 -19
  83. package/dist/i18nContext.d.ts +0 -21
  84. package/dist/i18nContext.js +0 -29
@@ -72,16 +72,14 @@
72
72
  <div class="node-item" class:selected={activeNode===node} on:click={handleNodeClick} aria-hidden="true"
73
73
  on:contextmenu={handleContextMenu}>
74
74
  <div class="item-icon">
75
- {#if loading}
76
- <img alt="" style="cursor: default" src={iconLoading}/>
77
- {:else }
78
- <span aria-hidden="true" on:click={handleNodeIconClick}>{expanded ? '▼' : '▶'}</span>
75
+ {#if isBranch()}
76
+ {#if loading}
77
+ <img alt="" style="cursor: default" src={iconLoading}/>
78
+ {:else }
79
+ <span aria-hidden="true" on:click={handleNodeIconClick}>{expanded ? '▼' : '▶'}</span>
80
+ {/if}
79
81
  {/if}
80
82
  </div>
81
- <div class="item-icon" style="margin-left: 4px;">
82
- <i class={isBranch() ? "uniface-icon-folder" : "uniface-icon-file"}
83
- aria-hidden="true"></i>
84
- </div>
85
83
  <span class="item-text">{node.text}</span>
86
84
  </div>
87
85
  {#if expanded && node.children}
@@ -24,7 +24,7 @@ const buildTreeNode = (list, idKey, joinKey, textField, valueField, isRoot, sort
24
24
  else {
25
25
  let parent = map.get(item[joinKey]);
26
26
  if (parent != null) {
27
- parent.children = [...parent.children, node];
27
+ parent.children = [...(parent.children ?? []), node];
28
28
  node.parent = parent;
29
29
  map.set(item[idKey], node);
30
30
  }
@@ -36,7 +36,7 @@ const buildTreeNode = (list, idKey, joinKey, textField, valueField, isRoot, sort
36
36
  else {
37
37
  let parent = map.get(item[joinKey]);
38
38
  if (parent != null) {
39
- parent.children = [...parent.children, item];
39
+ parent.children = [...(parent.children ?? []), item];
40
40
  node.parent = parent;
41
41
  map.set(item[idKey], node);
42
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "uniface web elements",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -28,9 +28,9 @@
28
28
  "types": "./dist/index.d.ts",
29
29
  "import": "./dist/index.js"
30
30
  },
31
- "./I18nContext": {
32
- "types": "./dist/i18nContext.d.ts",
33
- "import": "./dist/i18nContext.js"
31
+ "./i18n_resources": {
32
+ "types": "./dist/i18n_resources/index.d.ts",
33
+ "import": "./dist/i18n_resources/index.js"
34
34
  },
35
35
  "./ticatec-uniface-web.css": {
36
36
  "default": "./dist/ticatec-uniface-web.css"
@@ -100,6 +100,10 @@
100
100
  "types": "./dist/common/FullscreenOverlay.svelte.d.ts",
101
101
  "import": "./dist/common/FullscreenOverlay.svelte"
102
102
  },
103
+ "./ConciseDataTable": {
104
+ "types": "./dist/concise-data-table/index.d.ts",
105
+ "import": "./dist/concise-data-table/index.js"
106
+ },
103
107
  "./PromptsTextEditor": {
104
108
  "types": "./dist/prompts-text-editor/index.d.ts",
105
109
  "import": "./dist/prompts-text-editor/index.js"
@@ -305,17 +309,18 @@
305
309
  "@sveltejs/kit": "^2.0.0",
306
310
  "@sveltejs/package": "^2.0.0",
307
311
  "@sveltejs/vite-plugin-svelte": "^4.0.0",
312
+ "@ticatec/uniface-icons": "^0.2.0",
313
+ "dayjs": "^1.11.10",
308
314
  "publint": "^0.3.2",
309
315
  "sass": "^1.57.1",
310
316
  "svelte": "^5.0.0",
311
317
  "svelte-check": "^4.0.0",
318
+ "svelte-portal": "^2.2.1",
312
319
  "svelte-preprocess": "^6.0.3",
313
320
  "tslib": "^2.3.1",
314
321
  "typescript": "^5.7.3",
315
322
  "vite": "^5.4.11",
316
- "@ticatec/uniface-icons": "^0.2.0",
317
- "dayjs": "^1.11.10",
318
- "svelte-portal": "^2.2.1"
323
+ "@ticatec/i18n": "^0.0.4"
319
324
  },
320
325
  "author": "Henry Feng",
321
326
  "license": "MIT",
@@ -1,43 +0,0 @@
1
- declare const resource_en: {
2
- uniface: {
3
- upload: {
4
- btnPickup: string;
5
- btnCancel: string;
6
- btnRetry: string;
7
- btnRemove: string;
8
- };
9
- propertyEditor: {
10
- colName: string;
11
- colValue: string;
12
- };
13
- calendar: {
14
- months: string[];
15
- monthsAbbr: string[];
16
- weekTitle: string[];
17
- weekTitleAbbr: string[];
18
- confirmText: string;
19
- };
20
- };
21
- };
22
- declare const resource_cn: {
23
- uniface: {
24
- upload: {
25
- btnPickup: string;
26
- btnCancel: string;
27
- btnRetry: string;
28
- btnRemove: string;
29
- };
30
- propertyEditor: {
31
- colName: string;
32
- colValue: string;
33
- };
34
- calendar: {
35
- months: string[];
36
- monthsAbbr: string[];
37
- weekTitle: string[];
38
- confirmText: string;
39
- };
40
- };
41
- };
42
- export default resource_en;
43
- export { resource_cn };
@@ -1,57 +0,0 @@
1
- const resource_en = {
2
- uniface: {
3
- upload: {
4
- btnPickup: "Pickup Files",
5
- btnCancel: "Cancel",
6
- btnRetry: "Retry",
7
- btnRemove: "Delete"
8
- },
9
- propertyEditor: {
10
- colName: "Name",
11
- colValue: "Value"
12
- },
13
- calendar: {
14
- months: [
15
- 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
16
- ],
17
- monthsAbbr: [
18
- 'Jan', 'Feb', 'Mar', 'Api', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
19
- ],
20
- weekTitle: [
21
- "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
22
- ],
23
- weekTitleAbbr: [
24
- "Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat"
25
- ],
26
- confirmText: "OK"
27
- }
28
- }
29
- };
30
- const resource_cn = {
31
- uniface: {
32
- upload: {
33
- btnPickup: "选择文件",
34
- btnCancel: "取消",
35
- btnRetry: "重试",
36
- btnRemove: "删除"
37
- },
38
- propertyEditor: {
39
- colName: "名称",
40
- colValue: "值"
41
- },
42
- calendar: {
43
- months: [
44
- '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
45
- ],
46
- monthsAbbr: [
47
- '一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'
48
- ],
49
- weekTitle: [
50
- "日", "一", "二", "三", "四", "五", "六"
51
- ],
52
- confirmText: "确认"
53
- }
54
- }
55
- };
56
- export default resource_en;
57
- export { resource_cn };
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="512px" id="Layer_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="512px" fill="currentColor" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M98.9,184.7l1.8,2.1l136,156.5c4.6,5.3,11.5,8.6,19.2,8.6c7.7,0,14.6-3.4,19.2-8.6L411,187.1l2.3-2.6 c1.7-2.5,2.7-5.5,2.7-8.7c0-8.7-7.4-15.8-16.6-15.8v0H112.6v0c-9.2,0-16.6,7.1-16.6,15.8C96,179.1,97.1,182.2,98.9,184.7z"/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="512px" id="Layer_1" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M413.1,327.3l-1.8-2.1l-136-156.5c-4.6-5.3-11.5-8.6-19.2-8.6c-7.7,0-14.6,3.4-19.2,8.6L101,324.9l-2.3,2.6 C97,330,96,333,96,336.2c0,8.7,7.4,15.8,16.6,15.8v0h286.8v0c9.2,0,16.6-7.1,16.6-15.8C416,332.9,414.9,329.8,413.1,327.3z"/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 32 32" height="32px" id="Layer_1" version="1.1" viewBox="0 0 32 32" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="calendar_1_"><path d="M29.334,3H25V1c0-0.553-0.447-1-1-1s-1,0.447-1,1v2h-6V1c0-0.553-0.448-1-1-1s-1,0.447-1,1v2H9V1 c0-0.553-0.448-1-1-1S7,0.447,7,1v2H2.667C1.194,3,0,4.193,0,5.666v23.667C0,30.806,1.194,32,2.667,32h26.667 C30.807,32,32,30.806,32,29.333V5.666C32,4.193,30.807,3,29.334,3z M30,29.333C30,29.701,29.701,30,29.334,30H2.667 C2.299,30,2,29.701,2,29.333V5.666C2,5.299,2.299,5,2.667,5H7v2c0,0.553,0.448,1,1,1s1-0.447,1-1V5h6v2c0,0.553,0.448,1,1,1 s1-0.447,1-1V5h6v2c0,0.553,0.447,1,1,1s1-0.447,1-1V5h4.334C29.701,5,30,5.299,30,5.666V29.333z" fill="#333332"/><rect fill="#333332" height="3" width="4" x="7" y="12"/><rect fill="#333332" height="3" width="4" x="7" y="17"/><rect fill="#333332" height="3" width="4" x="7" y="22"/><rect fill="#333332" height="3" width="4" x="14" y="22"/><rect fill="#333332" height="3" width="4" x="14" y="17"/><rect fill="#333332" height="3" width="4" x="14" y="12"/><rect fill="#333332" height="3" width="4" x="21" y="22"/><rect fill="#333332" height="3" width="4" x="21" y="17"/><rect fill="#333332" height="3" width="4" x="21" y="12"/></g></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.0//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'><svg enable-background="new 0 0 512 512" height="512px" id="Layer_1" version="1.0" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><polygon points="445.2,109.2 402.8,66.8 256,213.6 109.2,66.8 66.8,109.2 213.6,256 66.8,402.8 109.2,445.2 256,298.4 402.8,445.2 445.2,402.8 298.4,256 "/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M33.17 17.17l-9.17 9.17-9.17-9.17-2.83 2.83 12 12 12-12z"/><path d="M0 0h48v48h-48z" fill="none"/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><title/><path d="M39.3756,48.0022l30.47-25.39a6.0035,6.0035,0,0,0-7.6878-9.223L26.1563,43.3906a6.0092,6.0092,0,0,0,0,9.2231L62.1578,82.615a6.0035,6.0035,0,0,0,7.6878-9.2231Z"/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><svg viewBox="0 0 96 96" xmlns="http://www.w3.org/2000/svg"><title/><path d="M69.8437,43.3876,33.8422,13.3863a6.0035,6.0035,0,0,0-7.6878,9.223l30.47,25.39-30.47,25.39a6.0035,6.0035,0,0,0,7.6878,9.2231L69.8437,52.6106a6.0091,6.0091,0,0,0,0-9.223Z"/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" ?><svg height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h48v48h-48z" fill="none"/><path d="M24 11.66l6.34 6.34 2.83-2.83-9.17-9.17-9.17 9.17 2.83 2.83 6.34-6.34zm0 24.68l-6.34-6.34-2.83 2.83 9.17 9.17 9.17-9.17-2.83-2.83-6.34 6.34z"/></svg>
Binary file
@@ -1,19 +0,0 @@
1
- <script lang="ts">
2
- export let text;
3
- export let action;
4
- export let style: string = '';
5
-
6
- let silent: boolean = false;
7
-
8
- const handleButtonClick = (e) => {
9
- if (!silent) {
10
- silent = true;
11
- setTimeout(()=>{silent=false}, 500);
12
- action();
13
- }
14
- }
15
-
16
- </script>
17
- <a {style} class="action-button" href="javascript:void(0)" on:click={handleButtonClick}>
18
- <span>{text}</span>
19
- </a>
@@ -1,21 +0,0 @@
1
- declare class I18nContext {
2
- private resource;
3
- /**
4
- * 设置语言包
5
- * @param languagePackage
6
- */
7
- setResource(languagePackage: any): void;
8
- /**
9
- * 根据key值获取相应的文本值
10
- * @param key
11
- * @param defaultText
12
- */
13
- getText(key: string, defaultText?: string): string;
14
- /**
15
- * 根据key获取一个节点
16
- * @param key
17
- */
18
- get(key: string): any;
19
- }
20
- declare const i18n: I18nContext;
21
- export default i18n;
@@ -1,29 +0,0 @@
1
- import utils from "./common/utils";
2
- class I18nContext {
3
- resource = {};
4
- /**
5
- * 设置语言包
6
- * @param languagePackage
7
- */
8
- setResource(languagePackage) {
9
- this.resource = languagePackage;
10
- }
11
- /**
12
- * 根据key值获取相应的文本值
13
- * @param key
14
- * @param defaultText
15
- */
16
- getText(key, defaultText) {
17
- let text = utils.getNestedValue(this.resource, key) ?? defaultText ?? `Invalid key: ${key}`;
18
- return typeof text == "string" ? text : `Invalid key: ${key}`;
19
- }
20
- /**
21
- * 根据key获取一个节点
22
- * @param key
23
- */
24
- get(key) {
25
- return utils.getNestedValue(this.resource, key);
26
- }
27
- }
28
- const i18n = new I18nContext();
29
- export default i18n;