@ticatec/uniface-element 0.3.17 → 0.3.19

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.
@@ -26,14 +26,8 @@
26
26
  if (node.children == null && lazyLoader != null) {
27
27
  try {
28
28
  loading = true;
29
- const loadedChildren = await lazyLoader.load(node);
30
- // 通过 append 方法添加子节点
31
- for (const child of loadedChildren) {
32
- node.append({
33
- ...child,
34
- expand: child.expand ?? false
35
- });
36
- }
29
+ node.append(await lazyLoader.load(node));
30
+ node.expand = true;
37
31
  } finally {
38
32
  loading = false;
39
33
  }
@@ -51,7 +45,7 @@
51
45
  await loadChildren();
52
46
  // 加载完成后,如果有子节点则展开
53
47
  const children = node.children;
54
- if (children && children.length > 0) {
48
+ if (children != null && children.length > 0) {
55
49
  node.expand = true;
56
50
  }
57
51
  } else {
@@ -50,12 +50,10 @@
50
50
  if (activeNode.children == null && lazyLoader != null) {
51
51
  try {
52
52
  const loadedChildren = await lazyLoader.load(activeNode);
53
- // 通过 append 方法添加子节点
54
- for (const child of loadedChildren) {
55
- activeNode.append({
56
- ...child,
57
- expand: child.expand ?? false
58
- });
53
+ // 通过 append 方法添加子节点,并设置 expand
54
+ for (const childData of loadedChildren) {
55
+ const childNode = activeNode.append(childData);
56
+ childNode.expand = childData.expand ?? false;
59
57
  }
60
58
  } catch (error) {
61
59
  console.error('Failed to load lazy node:', error);
@@ -5,9 +5,9 @@ export type OnNodeSelectionChange = (node: ITreeNode<any>) => Promise<boolean>;
5
5
  */
6
6
  export type NodeVisibleFun = (node: ITreeNode<any>) => boolean;
7
7
  /**
8
- * 加载子节点
8
+ * 加载子节点(返回纯数据对象)
9
9
  */
10
- export type LoadChildrenFun = (item: ITreeNode<any>) => Promise<Array<ITreeNode<any>>>;
10
+ export type LoadChildrenFun = (item: ITreeNode<any>) => Promise<Array<any>>;
11
11
  /**
12
12
  * 按需加载树节点的子节点
13
13
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticatec/uniface-element",
3
- "version": "0.3.17",
3
+ "version": "0.3.19",
4
4
  "description": "A comprehensive UI component library for Svelte applications with rich form controls, data tables, layouts and interactive elements",
5
5
  "keywords": [
6
6
  "svelte",
@@ -29,9 +29,14 @@
29
29
  "package": "svelte-kit sync && svelte-package && publint",
30
30
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
31
31
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
32
- "lint": "npm run check",
32
+ "lint": "eslint .",
33
+ "lint:fix": "eslint . --fix",
34
+ "format": "prettier --write .",
35
+ "format:check": "prettier --check .",
33
36
  "typecheck": "npm run check",
34
37
  "test": "npm run check",
38
+ "audit": "npm audit",
39
+ "audit:fix": "npm audit fix",
35
40
  "prepublishOnly": "rm -rf ./dist && npm run build",
36
41
  "publish:public": "npm publish --access public"
37
42
  },
@@ -371,22 +376,26 @@
371
376
  "svelte": "^5.0.0"
372
377
  },
373
378
  "devDependencies": {
379
+ "@eslint/js": "^9.18.0",
374
380
  "@sveltejs/adapter-auto": "^6.0.2",
375
381
  "@sveltejs/kit": "^2.27.3",
376
382
  "@sveltejs/package": "^2.4.1",
377
383
  "@sveltejs/vite-plugin-svelte": "^6.1.1",
378
- "@ticatec/uniface-google-material-icons": "^0.1.2",
379
- "dayjs": "^1.11.10",
384
+ "eslint": "^9.18.0",
385
+ "eslint-config-prettier": "^9.1.0",
386
+ "eslint-plugin-svelte": "^2.46.0",
387
+ "globals": "^15.14.0",
388
+ "prettier": "^3.4.2",
389
+ "prettier-plugin-svelte": "^3.3.2",
380
390
  "publint": "^0.3.2",
381
391
  "sass": "^1.90.0",
382
392
  "svelte": "^5.0.0",
383
393
  "svelte-check": "^4.3.1",
384
- "svelte-portal": "^2.2.1",
385
394
  "svelte-preprocess": "^6.0.3",
386
395
  "tslib": "^2.3.1",
387
396
  "typescript": "^5.7.3",
388
- "vite": "^6.3.5",
389
- "@ticatec/i18n": "^0.2.1"
397
+ "typescript-eslint": "^8.19.1",
398
+ "vite": "^6.3.5"
390
399
  },
391
400
  "author": "Henry Feng",
392
401
  "license": "MIT",
@@ -398,8 +407,6 @@
398
407
  "publishConfig": {
399
408
  "access": "public"
400
409
  },
401
- "dependencies": {
402
- },
403
410
  "title": "uniface-element",
404
411
  "url": "https://github.com/ticatec/uniface-element",
405
412
  "npm": "@ticatec/uniface-element",