@fangzhongya/fang-ui 0.1.71 → 0.1.72

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.
@@ -7,6 +7,7 @@ const index$4 = require("../../menu/index.cjs");
7
7
  const index$2 = require("../../../hooks/cssname/index.cjs");
8
8
  const index$1 = require("../../../hooks/inherit/index.cjs");
9
9
  const index = require("../../../hooks/props-default/index.cjs");
10
+ const getTreeObj = require("@fangzhongya/utils/tree/getTreeObj");
10
11
  const index$3 = require("../../../hooks/model/index.cjs");
11
12
  const menuLl_vue_vue_type_script_lang = require("./menu-ll2.cjs");
12
13
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
@@ -31,28 +32,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
31
32
  ...props.config
32
33
  };
33
34
  });
34
- function getChildrenValue(list, value2, config2) {
35
- for (const element of list) {
36
- const p = config2.prop;
37
- if (p && element[p] == value2) {
38
- return element;
39
- }
40
- }
41
- }
42
35
  function getChildren(list, arr, config2) {
43
- let arrObj = [];
44
- let listarr = list;
45
- for (const value2 of arr) {
46
- let v = getChildrenValue(listarr, value2, config2);
47
- if (v) {
48
- arrObj.push({ ...v });
49
- const c = config2.children;
50
- if (c) {
51
- listarr = v[c];
52
- }
53
- }
54
- }
55
- return arrObj;
36
+ const obj = getTreeObj.treeToArray(list, {
37
+ id: config2.prop,
38
+ children: config2.children,
39
+ fid: config2.prop
40
+ }).obj;
41
+ return arr.map((o) => obj[o]);
56
42
  }
57
43
  function onSelect(id, arr) {
58
44
  let arrObj = getChildren(props.list, arr, config.value);
@@ -5,6 +5,7 @@ import { Menu } from "../../menu/index.js";
5
5
  import { useCssName } from "../../../hooks/cssname/index.js";
6
6
  import { useInherit } from "../../../hooks/inherit/index.js";
7
7
  import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
8
+ import { treeToArray } from "@fangzhongya/utils/tree/getTreeObj";
8
9
  import { useModel } from "../../../hooks/model/index.js";
9
10
  import _sfc_main$1 from "./menu-ll2.js";
10
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -29,28 +30,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
30
  ...props.config
30
31
  };
31
32
  });
32
- function getChildrenValue(list, value2, config2) {
33
- for (const element of list) {
34
- const p = config2.prop;
35
- if (p && element[p] == value2) {
36
- return element;
37
- }
38
- }
39
- }
40
33
  function getChildren(list, arr, config2) {
41
- let arrObj = [];
42
- let listarr = list;
43
- for (const value2 of arr) {
44
- let v = getChildrenValue(listarr, value2, config2);
45
- if (v) {
46
- arrObj.push({ ...v });
47
- const c = config2.children;
48
- if (c) {
49
- listarr = v[c];
50
- }
51
- }
52
- }
53
- return arrObj;
34
+ const obj = treeToArray(list, {
35
+ id: config2.prop,
36
+ children: config2.children,
37
+ fid: config2.prop
38
+ }).obj;
39
+ return arr.map((o) => obj[o]);
54
40
  }
55
41
  function onSelect(id, arr) {
56
42
  let arrObj = getChildren(props.list, arr, config.value);
@@ -101,7 +101,7 @@ const _sfc_main = vue.defineComponent({
101
101
  if (!use.useHide(obj, props.value)) {
102
102
  const v = obj[config.prop];
103
103
  const c = obj[config.children];
104
- const i = setIndexValue(v, obj, props.config);
104
+ const i = setIndexValue(v, obj, props.config) || "i" + Date.now();
105
105
  if (c && c.length > 0) {
106
106
  arr.push(
107
107
  vue.h(
@@ -99,7 +99,7 @@ const _sfc_main = defineComponent({
99
99
  if (!useHide(obj, props.value)) {
100
100
  const v = obj[config.prop];
101
101
  const c = obj[config.children];
102
- const i = setIndexValue(v, obj, props.config);
102
+ const i = setIndexValue(v, obj, props.config) || "i" + Date.now();
103
103
  if (c && c.length > 0) {
104
104
  arr.push(
105
105
  h(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-ui",
3
3
  "info": {},
4
- "lastModified": 1768836568904,
4
+ "lastModified": 1768972529411,
5
5
  "icons": {
6
6
  "bar": {
7
7
  "body": " <path fill=\"currentColor\" d=\"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z\" ></path> "
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.1.71",
4
+ "version": "0.1.72",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
@@ -52,13 +52,13 @@
52
52
  "vue-tsc": "^3.2.2",
53
53
  "vxe-table": "4.6.20",
54
54
  "@fang-ui/components": "0.0.1-0",
55
- "@fang-ui/icons": "0.0.1-0",
55
+ "@fang-ui/directives": "0.0.1-0",
56
56
  "@fang-ui/hooks": "0.0.1-0",
57
+ "@fang-ui/icons": "0.0.1-0",
57
58
  "@fang-ui/locale": "0.0.1-0",
58
- "@fang-ui/directives": "0.0.1-0",
59
- "@fang-ui/types": "0.0.1-0",
60
59
  "@fang-ui/theme": "0.0.1-0",
61
- "@fang-ui/utils": "0.0.1-0"
60
+ "@fang-ui/utils": "0.0.1-0",
61
+ "@fang-ui/types": "0.0.1-0"
62
62
  },
63
63
  "main": "./dist/index.cjs",
64
64
  "module": "./dist/index.js",
File without changes
File without changes