@fangzhongya/fang-ui 0.1.67 → 0.1.69

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.
@@ -85,7 +85,7 @@ function setUp(props, emit, cs, refForm, getLocale) {
85
85
  const setListValue = (arr, listobj, callback) => {
86
86
  arr == null ? void 0 : arr.forEach((obj) => {
87
87
  if (listobj) {
88
- obj.father = obj.father ?? listobj;
88
+ obj.__father = obj.__father ?? listobj;
89
89
  }
90
90
  if (obj.children) {
91
91
  setListValue(obj.children, obj, callback);
@@ -83,7 +83,7 @@ function setUp(props, emit, cs, refForm, getLocale) {
83
83
  const setListValue = (arr, listobj, callback) => {
84
84
  arr == null ? void 0 : arr.forEach((obj) => {
85
85
  if (listobj) {
86
- obj.father = obj.father ?? listobj;
86
+ obj.__father = obj.__father ?? listobj;
87
87
  }
88
88
  if (obj.children) {
89
89
  setListValue(obj.children, obj, callback);
@@ -74,7 +74,7 @@ const _sfc_main = vue.defineComponent({
74
74
  };
75
75
  const processObjectVisibility = (obj, listobj, value) => {
76
76
  if (listobj) {
77
- obj.father = obj.father ?? listobj;
77
+ obj.__father = obj.__father ?? listobj;
78
78
  }
79
79
  return !use.useHide(obj, value);
80
80
  };
@@ -72,7 +72,7 @@ const _sfc_main = defineComponent({
72
72
  };
73
73
  const processObjectVisibility = (obj, listobj, value) => {
74
74
  if (listobj) {
75
- obj.father = obj.father ?? listobj;
75
+ obj.__father = obj.__father ?? listobj;
76
76
  }
77
77
  return !useHide(obj, value);
78
78
  };
@@ -42,7 +42,7 @@ const dataProps = buildProps.buildProps({
42
42
  * @props { String } value
43
43
  * 当前选中的
44
44
  */
45
- value: {
45
+ modelValue: {
46
46
  type: String
47
47
  },
48
48
  /**
@@ -56,7 +56,7 @@ const dataProps = buildProps.buildProps({
56
56
  }
57
57
  }
58
58
  });
59
- const dataEmits = ["select"];
59
+ const dataEmits = ["select", "update:modelValue"];
60
60
  const dataSlot = {
61
61
  default: "default"
62
62
  };
@@ -41,7 +41,7 @@ export declare const dataProps: {
41
41
  * @props { String } value
42
42
  * 当前选中的
43
43
  */
44
- value: {
44
+ modelValue: {
45
45
  type: StringConstructor;
46
46
  };
47
47
  /**
@@ -40,7 +40,7 @@ const dataProps = buildProps({
40
40
  * @props { String } value
41
41
  * 当前选中的
42
42
  */
43
- value: {
43
+ modelValue: {
44
44
  type: String
45
45
  },
46
46
  /**
@@ -54,7 +54,7 @@ const dataProps = buildProps({
54
54
  }
55
55
  }
56
56
  });
57
- const dataEmits = ["select"];
57
+ const dataEmits = ["select", "update:modelValue"];
58
58
  const dataSlot = {
59
59
  default: "default"
60
60
  };
@@ -3,10 +3,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const vue = require("vue");
4
4
  require("./menu-ll.cjs");
5
5
  const data = require("./data.cjs");
6
- const index$3 = require("../../menu/index.cjs");
6
+ 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 index$3 = require("../../../hooks/model/index.cjs");
10
11
  const menuLl_vue_vue_type_script_lang = require("./menu-ll2.cjs");
11
12
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
12
13
  __name: "index",
@@ -18,6 +19,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
18
19
  const attrs = index$1.useInherit(vue.useAttrs(), data.name);
19
20
  const cs = index$2.useCssName(data.name);
20
21
  const emit = __emit;
22
+ const value = index$3.useModel(props, emit);
21
23
  const slots = vue.useSlots();
22
24
  const config = vue.computed(() => {
23
25
  return {
@@ -29,10 +31,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
29
31
  ...props.config
30
32
  };
31
33
  });
32
- function getChildrenValue(list, value, config2) {
34
+ function getChildrenValue(list, value2, config2) {
33
35
  for (const element of list) {
34
36
  const p = config2.prop;
35
- if (p && element[p] == value) {
37
+ if (p && element[p] == value2) {
36
38
  return element;
37
39
  }
38
40
  }
@@ -40,8 +42,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
40
42
  function getChildren(list, arr, config2) {
41
43
  let arrObj = [];
42
44
  let listarr = list;
43
- for (const value of arr) {
44
- let v = getChildrenValue(listarr, value, config2);
45
+ for (const value2 of arr) {
46
+ let v = getChildrenValue(listarr, value2, config2);
45
47
  if (v) {
46
48
  arrObj.push({ ...v });
47
49
  const c = config2.children;
@@ -54,21 +56,22 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
54
56
  }
55
57
  function onSelect(id, arr) {
56
58
  let arrObj = getChildren(props.list, arr, config.value);
59
+ value.value = id;
57
60
  emit("select", id, arr, arrObj);
58
61
  }
59
62
  return (_ctx, _cache) => {
60
63
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
61
64
  class: vue.unref(cs).z()
62
65
  }, vue.unref(attrs).root), [
63
- vue.createVNode(vue.unref(index$3.Menu), vue.mergeProps(vue.unref(attrs).assem, {
66
+ vue.createVNode(vue.unref(index$4.Menu), vue.mergeProps(vue.unref(attrs).assem, {
64
67
  class: vue.unref(cs).z("menu"),
65
68
  onSelect,
66
- "default-active": vue.unref(props).value
69
+ "default-active": vue.unref(value)
67
70
  }), {
68
71
  default: vue.withCtx(() => [
69
72
  vue.createVNode(menuLl_vue_vue_type_script_lang.default, {
70
73
  compons: vue.unref(props).compons,
71
- value: vue.unref(props).value,
74
+ value: vue.unref(value),
72
75
  list: vue.unref(props).list,
73
76
  level: vue.unref(props).level,
74
77
  config: 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 { useModel } from "../../../hooks/model/index.js";
8
9
  import _sfc_main$1 from "./menu-ll2.js";
9
10
  const _sfc_main = /* @__PURE__ */ defineComponent({
10
11
  __name: "index",
@@ -16,6 +17,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
17
  const attrs = useInherit(useAttrs(), name);
17
18
  const cs = useCssName(name);
18
19
  const emit = __emit;
20
+ const value = useModel(props, emit);
19
21
  const slots = useSlots();
20
22
  const config = computed(() => {
21
23
  return {
@@ -27,10 +29,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
29
  ...props.config
28
30
  };
29
31
  });
30
- function getChildrenValue(list, value, config2) {
32
+ function getChildrenValue(list, value2, config2) {
31
33
  for (const element of list) {
32
34
  const p = config2.prop;
33
- if (p && element[p] == value) {
35
+ if (p && element[p] == value2) {
34
36
  return element;
35
37
  }
36
38
  }
@@ -38,8 +40,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
40
  function getChildren(list, arr, config2) {
39
41
  let arrObj = [];
40
42
  let listarr = list;
41
- for (const value of arr) {
42
- let v = getChildrenValue(listarr, value, config2);
43
+ for (const value2 of arr) {
44
+ let v = getChildrenValue(listarr, value2, config2);
43
45
  if (v) {
44
46
  arrObj.push({ ...v });
45
47
  const c = config2.children;
@@ -52,6 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
54
  }
53
55
  function onSelect(id, arr) {
54
56
  let arrObj = getChildren(props.list, arr, config.value);
57
+ value.value = id;
55
58
  emit("select", id, arr, arrObj);
56
59
  }
57
60
  return (_ctx, _cache) => {
@@ -61,12 +64,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
64
  createVNode(unref(Menu), mergeProps(unref(attrs).assem, {
62
65
  class: unref(cs).z("menu"),
63
66
  onSelect,
64
- "default-active": unref(props).value
67
+ "default-active": unref(value)
65
68
  }), {
66
69
  default: withCtx(() => [
67
70
  createVNode(_sfc_main$1, {
68
71
  compons: unref(props).compons,
69
- value: unref(props).value,
72
+ value: unref(value),
70
73
  list: unref(props).list,
71
74
  level: unref(props).level,
72
75
  config: config.value
@@ -96,7 +96,7 @@ const _sfc_main = vue.defineComponent({
96
96
  let arr = [];
97
97
  arrs == null ? void 0 : arrs.forEach((obj, index2) => {
98
98
  if (listobj) {
99
- obj.father = obj.father ?? listobj;
99
+ obj.__father = obj.__father ?? listobj;
100
100
  }
101
101
  if (!use.useHide(obj, props.value)) {
102
102
  const v = obj[config.prop];
@@ -94,7 +94,7 @@ const _sfc_main = defineComponent({
94
94
  let arr = [];
95
95
  arrs == null ? void 0 : arrs.forEach((obj, index) => {
96
96
  if (listobj) {
97
- obj.father = obj.father ?? listobj;
97
+ obj.__father = obj.__father ?? listobj;
98
98
  }
99
99
  if (!useHide(obj, props.value)) {
100
100
  const v = obj[config.prop];
@@ -5,13 +5,23 @@ const use = require("../../common/use.cjs");
5
5
  function setLabel(value, obj, props, compons, emit, slots, index) {
6
6
  let label = value ?? obj.label ?? "";
7
7
  obj.label = label;
8
- return use.useVNodeComponDom(obj, props.value, slots, emit, {
9
- // options: {},
10
- compons,
11
- index,
12
- scope: {
13
- config: props
8
+ return use.useVNodeComponDom(
9
+ {
10
+ ...obj,
11
+ prop: "label",
12
+ __father: void 0
13
+ },
14
+ obj,
15
+ slots,
16
+ emit,
17
+ {
18
+ // options: {},
19
+ compons,
20
+ index,
21
+ scope: {
22
+ config: props
23
+ }
14
24
  }
15
- });
25
+ );
16
26
  }
17
27
  exports.setLabel = setLabel;
@@ -3,14 +3,24 @@ import { useVNodeComponDom } from "../../common/use.js";
3
3
  function setLabel(value, obj, props, compons, emit, slots, index) {
4
4
  let label = value ?? obj.label ?? "";
5
5
  obj.label = label;
6
- return useVNodeComponDom(obj, props.value, slots, emit, {
7
- // options: {},
8
- compons,
9
- index,
10
- scope: {
11
- config: props
6
+ return useVNodeComponDom(
7
+ {
8
+ ...obj,
9
+ prop: "label",
10
+ __father: void 0
11
+ },
12
+ obj,
13
+ slots,
14
+ emit,
15
+ {
16
+ // options: {},
17
+ compons,
18
+ index,
19
+ scope: {
20
+ config: props
21
+ }
12
22
  }
13
- });
23
+ );
14
24
  }
15
25
  export {
16
26
  setLabel
@@ -33,7 +33,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
33
33
  const filtration = (arr, listobj) => {
34
34
  for (const obj of arr) {
35
35
  if (listobj) {
36
- obj.father = obj.father ?? listobj;
36
+ obj.__father = obj.__father ?? listobj;
37
37
  }
38
38
  if (obj.prop) {
39
39
  value[obj.prop] = obj;
@@ -31,7 +31,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
31
  const filtration = (arr, listobj) => {
32
32
  for (const obj of arr) {
33
33
  if (listobj) {
34
- obj.father = obj.father ?? listobj;
34
+ obj.__father = obj.__father ?? listobj;
35
35
  }
36
36
  if (obj.prop) {
37
37
  value[obj.prop] = obj;
@@ -6,7 +6,7 @@ function getLists(arrs, emit, props, slots, listobj) {
6
6
  let arr = [];
7
7
  arrs == null ? void 0 : arrs.forEach((obj, index) => {
8
8
  if (listobj) {
9
- obj.father = obj.father ?? listobj;
9
+ obj.__father = obj.__father ?? listobj;
10
10
  }
11
11
  if (!use.useHide(obj, props.value)) {
12
12
  if (obj.children && obj.children.length > 0) {
@@ -4,7 +4,7 @@ function getLists(arrs, emit, props, slots, listobj) {
4
4
  let arr = [];
5
5
  arrs == null ? void 0 : arrs.forEach((obj, index) => {
6
6
  if (listobj) {
7
- obj.father = obj.father ?? listobj;
7
+ obj.__father = obj.__father ?? listobj;
8
8
  }
9
9
  if (!useHide(obj, props.value)) {
10
10
  if (obj.children && obj.children.length > 0) {
@@ -263,7 +263,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
263
263
  config?: ObjAny | undefined;
264
264
  events?: ObjAny | undefined;
265
265
  children?: /*elided*/ any[] | undefined;
266
- father?: /*elided*/ any | undefined;
266
+ __father?: /*elided*/ any | undefined;
267
267
  minWidth?: string | number | undefined;
268
268
  whole?: boolean | undefined;
269
269
  type?: string | undefined;
@@ -304,7 +304,7 @@ export declare const useInit: (props: ExtractPropTypes<typeof dataProps>, emit:
304
304
  config?: ObjAny | undefined;
305
305
  events?: ObjAny | undefined;
306
306
  children?: /*elided*/ any[] | undefined;
307
- father?: /*elided*/ any | undefined;
307
+ __father?: /*elided*/ any | undefined;
308
308
  minWidth?: string | number | undefined;
309
309
  whole?: boolean | undefined;
310
310
  type?: string | undefined;
@@ -9,7 +9,7 @@ function getLists(arrs, emit, props, slots, listobj) {
9
9
  let arr = [];
10
10
  arrs == null ? void 0 : arrs.forEach((obj, index) => {
11
11
  if (listobj) {
12
- obj.father = obj.father ?? {
12
+ obj.__father = obj.__father ?? {
13
13
  ...listobj,
14
14
  children: void 0
15
15
  };
@@ -7,7 +7,7 @@ function getLists(arrs, emit, props, slots, listobj) {
7
7
  let arr = [];
8
8
  arrs == null ? void 0 : arrs.forEach((obj, index) => {
9
9
  if (listobj) {
10
- obj.father = obj.father ?? {
10
+ obj.__father = obj.__father ?? {
11
11
  ...listobj,
12
12
  children: void 0
13
13
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "prefix": "fang-ui",
3
3
  "info": {},
4
- "lastModified": 1768544548153,
4
+ "lastModified": 1768575098266,
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/dist/type.d.ts CHANGED
@@ -153,7 +153,7 @@ type ListObj = {
153
153
  events?: ObjAny;
154
154
 
155
155
  children?: ListObj[];
156
- father?: ListObj;
156
+ __father?: ListObj;
157
157
 
158
158
  minWidth?: string | number;
159
159
  // 是否整行
@@ -3,9 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const objValue = require("@fangzhongya/utils/basic/object/objValue");
4
4
  const getContent = require("@fangzhongya/utils/basic/string/getContent");
5
5
  function getFathers(obj, arr) {
6
- if (obj.father) {
7
- arr.unshift(obj.father);
8
- getFathers(obj.father, arr);
6
+ if (obj.__father) {
7
+ arr.unshift(obj.__father);
8
+ getFathers(obj.__father, arr);
9
9
  }
10
10
  }
11
11
  function getChildrenData(obj, row, is) {
@@ -46,7 +46,7 @@ function getNextValue(obj, currentValue) {
46
46
  if (obj.pars) {
47
47
  return objValue.getObjValue(obj.prop, currentValue) ?? obj.default;
48
48
  }
49
- return currentValue[obj.prop] ?? obj.default;
49
+ return (currentValue == null ? void 0 : currentValue[obj.prop]) ?? obj.default;
50
50
  }
51
51
  function executionMethod(fun, ...arr) {
52
52
  var _a;
@@ -1,9 +1,9 @@
1
1
  import { setObjValue, getObjValue } from "@fangzhongya/utils/basic/object/objValue";
2
2
  import { getContents } from "@fangzhongya/utils/basic/string/getContent";
3
3
  function getFathers(obj, arr) {
4
- if (obj.father) {
5
- arr.unshift(obj.father);
6
- getFathers(obj.father, arr);
4
+ if (obj.__father) {
5
+ arr.unshift(obj.__father);
6
+ getFathers(obj.__father, arr);
7
7
  }
8
8
  }
9
9
  function getChildrenData(obj, row, is) {
@@ -44,7 +44,7 @@ function getNextValue(obj, currentValue) {
44
44
  if (obj.pars) {
45
45
  return getObjValue(obj.prop, currentValue) ?? obj.default;
46
46
  }
47
- return currentValue[obj.prop] ?? obj.default;
47
+ return (currentValue == null ? void 0 : currentValue[obj.prop]) ?? obj.default;
48
48
  }
49
49
  function executionMethod(fun, ...arr) {
50
50
  var _a;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fangzhongya/fang-ui",
3
3
  "private": false,
4
- "version": "0.1.67",
4
+ "version": "0.1.69",
5
5
  "type": "module",
6
6
  "description ": "fang-ui",
7
7
  "keywords": [
File without changes