orion-design 0.1.42 → 0.1.43

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,93 @@
1
-
1
+ import { merge as p } from "lodash-es";
2
+ import { defineComponent as h, computed as y, useTemplateRef as k, openBlock as f, createBlock as C, unref as m, withCtx as g, renderSlot as K, normalizeProps as x, guardReactiveProps as B } from "vue";
3
+ import { withInstall as b } from "../_util/vue/install.js";
4
+ import { ElTree as E } from "element-plus";
5
+ import { T as N } from "../../index-C2i44sFt.js";
6
+ const T = /* @__PURE__ */ h({
7
+ name: "OTree",
8
+ inheritAttrs: !1,
9
+ __name: "Tree",
10
+ props: {
11
+ data: {},
12
+ emptyText: {},
13
+ nodeKey: {},
14
+ nodeLabel: { type: [String, Function] },
15
+ nodeChildren: {},
16
+ nodeDisabled: { type: [String, Function] },
17
+ nodeClass: { type: Function },
18
+ renderAfterExpand: { type: Boolean, default: !0 },
19
+ highlightCurrent: { type: Boolean },
20
+ defaultExpandAll: { type: Boolean },
21
+ expandOnClickNode: { type: Boolean, default: !0 },
22
+ checkOnClickNode: { type: Boolean },
23
+ autoExpandParent: { type: Boolean, default: !0 },
24
+ defaultExpandedKeys: {},
25
+ showCheckbox: { type: Boolean },
26
+ checkStrictly: { type: Boolean },
27
+ defaultCheckedKeys: {},
28
+ currentNodeKey: {},
29
+ filterNodeMethod: { type: Function },
30
+ accordion: { type: Boolean },
31
+ indent: {}
32
+ },
33
+ emits: ["node-click", "current-change"],
34
+ setup(o, { expose: a, emit: l }) {
35
+ const c = y(() => ({
36
+ label: o.nodeLabel,
37
+ children: o.nodeChildren,
38
+ disabled: o.nodeDisabled,
39
+ class: o.nodeClass
40
+ })), n = k("_tree");
41
+ a({
42
+ filter: (e) => {
43
+ n.value.filter(e);
44
+ },
45
+ getCheckedKeys: (e) => n.value.getCheckedKeys(e),
46
+ setCheckedKeys: (e) => {
47
+ n.value.setCheckedKeys(e);
48
+ },
49
+ getCurrentKey: () => n.value.getCurrentKey(),
50
+ setCurrentKey: (e, t) => {
51
+ n.value.setCurrentKey(e, t);
52
+ }
53
+ });
54
+ const r = l, i = (e, t, d, u) => {
55
+ r("node-click", e, t, d, u);
56
+ }, s = (e, t) => {
57
+ r("current-change", e, t);
58
+ };
59
+ return (e, t) => (f(), C(m(E), {
60
+ ref: "_tree",
61
+ data: e.data,
62
+ "empty-text": e.emptyText,
63
+ "node-key": e.nodeKey,
64
+ props: c.value,
65
+ "render-after-expand": e.renderAfterExpand,
66
+ "highlight-current": e.highlightCurrent,
67
+ "default-expand-all": e.defaultExpandAll,
68
+ "expand-on-click-node": e.expandOnClickNode,
69
+ "check-on-click-node": e.checkOnClickNode,
70
+ "auto-expand-parent": e.autoExpandParent,
71
+ "default-expanded-keys": e.defaultExpandedKeys,
72
+ "show-checkbox": e.showCheckbox,
73
+ "check-strictly": e.checkStrictly,
74
+ "default-checked-keys": e.defaultCheckedKeys,
75
+ "current-node-key": e.currentNodeKey,
76
+ "filter-node-method": e.filterNodeMethod,
77
+ accordion: e.accordion,
78
+ indent: e.indent,
79
+ onNodeClick: i,
80
+ onCurrentChange: s
81
+ }, {
82
+ default: g((d) => [
83
+ K(e.$slots, "default", x(B(d)))
84
+ ]),
85
+ _: 3
86
+ }, 8, ["data", "empty-text", "node-key", "props", "render-after-expand", "highlight-current", "default-expand-all", "expand-on-click-node", "check-on-click-node", "auto-expand-parent", "default-expanded-keys", "show-checkbox", "check-strictly", "default-checked-keys", "current-node-key", "filter-node-method", "accordion", "indent"]));
87
+ }
88
+ }), M = b(p(T, N), {});
89
+ export {
90
+ M as OTree,
91
+ M as default
92
+ };
2
93
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Tree/Tree.vue","../../../src/components/Tree/index.ts"],"sourcesContent":["<template>\r\n <el-tree ref=\"_tree\" :data=\"data\" :empty-text=\"emptyText\" :node-key=\"nodeKey\" :props=\"nodeProps\"\r\n :render-after-expand=\"renderAfterExpand\" :highlight-current=\"highlightCurrent\"\r\n :default-expand-all=\"defaultExpandAll\" :expand-on-click-node=\"expandOnClickNode\"\r\n :check-on-click-node=\"checkOnClickNode\" :auto-expand-parent=\"autoExpandParent\"\r\n :default-expanded-keys=\"defaultExpandedKeys\" :show-checkbox=\"showCheckbox\" :check-strictly=\"checkStrictly\"\r\n :default-checked-keys=\"defaultCheckedKeys\" :current-node-key=\"currentNodeKey\"\r\n :filter-node-method=\"filterNodeMethod\" :accordion=\"accordion\" :indent=\"indent\" @node-click=\"onNodeClick\"\r\n @current-change=\"onCurrentChange\">\r\n <template #default=\"slotProps\">\r\n <slot v-bind=\"slotProps\"></slot>\r\n </template>\r\n </el-tree>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed, useTemplateRef } from 'vue';\r\nimport { ElTree } from 'element-plus'\r\nimport { TreeExpose, TreeNode, TreeNodeData, TreeProps } from './Tree'\r\n\r\ndefineOptions({\r\n name: 'OTree',\r\n inheritAttrs: false\r\n})\r\n\r\nconst { data,\r\n emptyText,\r\n nodeKey,\r\n nodeLabel,\r\n nodeChildren,\r\n nodeDisabled,\r\n nodeClass,\r\n renderAfterExpand = true,\r\n highlightCurrent,\r\n defaultExpandAll,\r\n expandOnClickNode = true,\r\n checkOnClickNode,\r\n autoExpandParent = true,\r\n defaultExpandedKeys,\r\n showCheckbox,\r\n checkStrictly,\r\n defaultCheckedKeys,\r\n currentNodeKey,\r\n filterNodeMethod,\r\n accordion,\r\n indent } = defineProps<TreeProps>()\r\n\r\nconst nodeProps = computed(() => {\r\n return {\r\n label: nodeLabel,\r\n children: nodeChildren,\r\n disabled: nodeDisabled,\r\n class: nodeClass\r\n }\r\n})\r\n\r\nconst treeInst = useTemplateRef('_tree')\r\nconst filter: TreeExpose['filter'] = (value) => {\r\n treeInst.value!.filter(value)\r\n}\r\nconst getCheckedKeys: TreeExpose['getCheckedKeys'] = (leafOnly) => {\r\n return treeInst.value!.getCheckedKeys(leafOnly)\r\n}\r\nconst setCheckedKeys: TreeExpose['setCheckedKeys'] = (keys) => {\r\n treeInst.value!.setCheckedKeys(keys)\r\n}\r\nconst getCurrentKey: TreeExpose['getCurrentKey'] = () => {\r\n return treeInst.value!.getCurrentKey()\r\n}\r\nconst setCurrentKey: TreeExpose['setCurrentKey'] = (key, shouldAutoExpandParent) => {\r\n treeInst.value!.setCurrentKey(key, shouldAutoExpandParent)\r\n}\r\n\r\ndefineExpose({\r\n filter,\r\n getCheckedKeys,\r\n setCheckedKeys,\r\n getCurrentKey,\r\n setCurrentKey\r\n})\r\n\r\nconst emit = defineEmits(['node-click', 'current-change'])\r\nconst onNodeClick = (nodeData: TreeNodeData, node: TreeNode, instance: any, e: MouseEvent) => {\r\n emit('node-click', nodeData, node, instance, e)\r\n}\r\nconst onCurrentChange = (nodeData: TreeNodeData, node: TreeNode) => {\r\n emit('current-change', nodeData, node)\r\n}\r\n</script>","import { merge } from 'lodash-es'\r\nimport { withInstall } from '../_util'\r\n\r\nimport Tree from './Tree.vue'\r\nimport { TransformOptions, TreeData } from './Tree'\r\nimport * as TreeUtils from './utils'\r\n\r\nexport const OTree = withInstall<\r\n typeof Tree & {\r\n toTreeNodes: (array: TreeData, options?: TransformOptions) => TreeData\r\n toArray: (treeNodes: TreeData, options?: TransformOptions) => TreeData\r\n },\r\n {}\r\n>(merge(Tree, TreeUtils), {})\r\nexport default OTree\r\n\r\nexport * from './Tree'\r\n"],"names":["nodeProps","computed","__props","treeInst","useTemplateRef","__expose","value","leafOnly","keys","key","shouldAutoExpandParent","emit","__emit","onNodeClick","nodeData","node","instance","e","onCurrentChange","OTree","withInstall","merge","Tree","TreeUtils"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CM,UAAAA,IAAYC,EAAS,OAChB;AAAA,MACH,OAAOC,EAAA;AAAA,MACP,UAAUA,EAAA;AAAA,MACV,UAAUA,EAAA;AAAA,MACV,OAAOA;MAEd,GAEKC,IAAWC,EAAe,OAAO;AAiB1B,IAAAC,EAAA;AAAA,MACT,QAjBiC,CAACC,MAAU;AACnC,QAAAH,EAAA,MAAO,OAAOG,CAAK;AAAA,MAAA;AAAA,MAiB5B,gBAfiD,CAACC,MAC3CJ,EAAS,MAAO,eAAeI,CAAQ;AAAA,MAe9C,gBAbiD,CAACC,MAAS;AAClD,QAAAL,EAAA,MAAO,eAAeK,CAAI;AAAA,MAAA;AAAA,MAanC,eAX+C,MACxCL,EAAS,MAAO;MAWvB,eAT+C,CAACM,GAAKC,MAA2B;AACvE,QAAAP,EAAA,MAAO,cAAcM,GAAKC,CAAsB;AAAA,MAAA;AAAA,IAQzD,CACH;AAED,UAAMC,IAAOC,GACPC,IAAc,CAACC,GAAwBC,GAAgBC,GAAeC,MAAkB;AAC1F,MAAAN,EAAK,cAAcG,GAAUC,GAAMC,GAAUC,CAAC;AAAA,IAAA,GAE5CC,IAAkB,CAACJ,GAAwBC,MAAmB;AAC3D,MAAAJ,EAAA,kBAAkBG,GAAUC,CAAI;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IC/E5BI,IAAQC,EAMnBC,EAAMC,GAAMC,CAAS,GAAG,CAAE,CAAA;"}
@@ -0,0 +1,3 @@
1
+ import { TransformOptions, TreeData } from '../Tree';
2
+ export declare const toTreeNodes: (array: TreeData, options?: TransformOptions) => import('element-plus/es/components/tree/src/tree.type.mjs').TreeNodeData[];
3
+ export declare const toArray: (treeNodes: TreeData, options?: TransformOptions) => import('element-plus/es/components/tree/src/tree.type.mjs').TreeData;
@@ -0,0 +1,7 @@
1
+ import "lodash-es";
2
+ import { a, t as e } from "../../../index-C2i44sFt.js";
3
+ export {
4
+ a as toArray,
5
+ e as toTreeNodes
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -16,3 +16,4 @@ export { default as Form } from './Form';
16
16
  export { default as LovTable } from './LovTable';
17
17
  export { default as TableSelectPagetable } from './TableSelectPagetable';
18
18
  export { default as Icon } from './Icon';
19
+ export { default as Tree } from './Tree';
@@ -1,9 +1,9 @@
1
- import { default as a } from "./Button/index.js";
2
- import { T as t } from "../components-Pdc4XEej.js";
1
+ import { default as r } from "./Button/index.js";
2
+ import { T as t } from "../components-G3_R2B-U.js";
3
3
  import { S as l } from "../index-BbsXWo7C.js";
4
- import { Colflex as m, Flexitem as p, Rowflex as d } from "./Flex/index.js";
4
+ import { Colflex as m, Flexitem as p, Rowflex as s } from "./Flex/index.js";
5
5
  import { default as u } from "./Card/index.js";
6
- import { default as T } from "./Tabs/index.js";
6
+ import { default as b } from "./Tabs/index.js";
7
7
  import { default as c } from "./Pagetable/index.js";
8
8
  import { default as P } from "./Querytable/index.js";
9
9
  import { default as g } from "./Modal/index.js";
@@ -11,8 +11,9 @@ import { default as v } from "./Form/index.js";
11
11
  import { default as h } from "./LovTable/index.js";
12
12
  import { default as y } from "./TableSelectPagetable/index.js";
13
13
  import { default as I } from "./Icon/index.js";
14
+ import { OTree as M } from "./Tree/index.js";
14
15
  export {
15
- a as Button,
16
+ r as Button,
16
17
  u as Card,
17
18
  m as Colflex,
18
19
  p as Flexitem,
@@ -22,10 +23,11 @@ export {
22
23
  g as Modal,
23
24
  c as Pagetable,
24
25
  P as Querytable,
25
- d as Rowflex,
26
+ s as Rowflex,
26
27
  l as Space,
27
28
  y as TableSelectPagetable,
28
- T as Tabs,
29
- t as ThroneContextProvider
29
+ b as Tabs,
30
+ t as ThroneContextProvider,
31
+ M as Tree
30
32
  };
31
33
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -2,5 +2,6 @@ import { App } from 'vue';
2
2
  export * from './components';
3
3
  export type * from './types';
4
4
  export declare const install: (app: App) => App<any>;
5
- export { default as useOModal } from './Modal/useModal';
5
+ export * from './Modal';
6
6
  export * from './Form';
7
+ export * from './Tree';
@@ -1,23 +1,24 @@
1
- import { c as t } from "../components-Pdc4XEej.js";
2
- import { T as x } from "../components-Pdc4XEej.js";
3
- import { default as p } from "./Modal/useModal.js";
1
+ import { c as t } from "../components-G3_R2B-U.js";
2
+ import { T as x } from "../components-G3_R2B-U.js";
3
+ import { default as p } from "./Modal/index.js";
4
4
  import { default as n } from "./Form/index.js";
5
- import { default as c } from "./Button/index.js";
6
- import { S as i } from "../index-BbsXWo7C.js";
7
- import { Colflex as T, Flexitem as v, Rowflex as y } from "./Flex/index.js";
8
- import { default as P } from "./Card/index.js";
9
- import { default as h } from "./Tabs/index.js";
10
- import { default as K } from "./Pagetable/index.js";
11
- import { default as M } from "./Querytable/index.js";
12
- import { default as j } from "./Modal/index.js";
13
- import { default as w } from "./LovTable/index.js";
14
- import { default as E } from "./TableSelectPagetable/index.js";
15
- import { default as Q } from "./Icon/index.js";
16
- import { formContextKey as q } from "./Form/Form.js";
17
- import { default as A } from "./Form/LovInput/hooks/useLov.js";
18
- import { lovContextKey as G } from "./Form/LovInput/LovInput.js";
19
- import { default as J } from "./Form/TableSelect/hooks/useTableSelect.js";
20
- import { tableSelectContext as U } from "./Form/TableSelect/TableSelect.js";
5
+ import { OTree as c, OTree as b } from "./Tree/index.js";
6
+ import { default as i } from "./Button/index.js";
7
+ import { S as v } from "../index-BbsXWo7C.js";
8
+ import { Colflex as O, Flexitem as S, Rowflex as P } from "./Flex/index.js";
9
+ import { default as h } from "./Card/index.js";
10
+ import { default as K } from "./Tabs/index.js";
11
+ import { default as M } from "./Pagetable/index.js";
12
+ import { default as k } from "./Querytable/index.js";
13
+ import { default as B } from "./LovTable/index.js";
14
+ import { default as I } from "./TableSelectPagetable/index.js";
15
+ import { default as R } from "./Icon/index.js";
16
+ import { default as z } from "./Modal/useModal.js";
17
+ import { formContextKey as D } from "./Form/Form.js";
18
+ import { default as H } from "./Form/LovInput/hooks/useLov.js";
19
+ import { lovContextKey as N } from "./Form/LovInput/LovInput.js";
20
+ import { default as V } from "./Form/TableSelect/hooks/useTableSelect.js";
21
+ import { tableSelectContext as X } from "./Form/TableSelect/TableSelect.js";
21
22
  const f = function(e) {
22
23
  return Object.keys(t).forEach((r) => {
23
24
  const o = t[r];
@@ -25,27 +26,29 @@ const f = function(e) {
25
26
  }), e;
26
27
  };
27
28
  export {
28
- c as Button,
29
- P as Card,
30
- T as Colflex,
31
- v as Flexitem,
29
+ i as Button,
30
+ h as Card,
31
+ O as Colflex,
32
+ S as Flexitem,
32
33
  n as Form,
33
- Q as Icon,
34
- w as LovTable,
35
- j as Modal,
36
- K as Pagetable,
37
- M as Querytable,
38
- y as Rowflex,
39
- i as Space,
40
- E as TableSelectPagetable,
41
- h as Tabs,
34
+ R as Icon,
35
+ B as LovTable,
36
+ p as Modal,
37
+ c as OTree,
38
+ M as Pagetable,
39
+ k as Querytable,
40
+ P as Rowflex,
41
+ v as Space,
42
+ I as TableSelectPagetable,
43
+ K as Tabs,
42
44
  x as ThroneContextProvider,
43
- q as formContextKey,
45
+ b as Tree,
46
+ D as formContextKey,
44
47
  f as install,
45
- G as lovContextKey,
46
- U as tableSelectContext,
47
- A as useLov,
48
- p as useOModal,
49
- J as useTableselect
48
+ N as lovContextKey,
49
+ X as tableSelectContext,
50
+ H as useLov,
51
+ z as useOModal,
52
+ V as useTableselect
50
53
  };
51
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/components/index.ts"],"sourcesContent":["import type { App } from 'vue'\r\n\r\nimport * as components from './components'\r\n\r\nexport * from './components'\r\n\r\nexport type * from './types'\r\n\r\nexport const install = function (app: App) {\r\n Object.keys(components).forEach((key) => {\r\n const component = components[key]\r\n if (component.install) {\r\n app.use(component)\r\n }\r\n })\r\n return app\r\n}\r\n\r\nexport { default as useOModal } from './Modal/useModal'\r\nexport * from './Form'\r\n"],"names":["install","app","components","key","component"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQa,MAAAA,IAAU,SAAUC,GAAU;AACzC,gBAAO,KAAKC,CAAU,EAAE,QAAQ,CAACC,MAAQ;AACjC,UAAAC,IAAYF,EAAWC,CAAG;AAChC,IAAIC,EAAU,WACZH,EAAI,IAAIG,CAAS;AAAA,EACnB,CACD,GACMH;AACT;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/index.ts"],"sourcesContent":["import type { App } from 'vue'\r\n\r\nimport * as components from './components'\r\n\r\nexport * from './components'\r\n\r\nexport type * from './types'\r\n\r\nexport const install = function (app: App) {\r\n Object.keys(components).forEach((key) => {\r\n const component = components[key]\r\n if (component.install) {\r\n app.use(component)\r\n }\r\n })\r\n return app\r\n}\r\n\r\nexport * from './Modal'\r\nexport * from './Form'\r\nexport * from './Tree'\r\n"],"names":["install","app","components","key","component"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQa,MAAAA,IAAU,SAAUC,GAAU;AACzC,gBAAO,KAAKC,CAAU,EAAE,QAAQ,CAACC,MAAQ;AACjC,UAAAC,IAAYF,EAAWC,CAAG;AAChC,IAAIC,EAAU,WACZH,EAAI,IAAIG,CAAS;AAAA,EACnB,CACD,GACMH;AACT;"}
@@ -1,6 +1,6 @@
1
1
  import e from "./components/Button/index.js";
2
- import { defineComponent as t, renderSlot as n } from "vue";
3
- import { objectType as m } from "./components/_util/type.js";
2
+ import { defineComponent as t, renderSlot as m } from "vue";
3
+ import { objectType as n } from "./components/_util/type.js";
4
4
  import { provideThroneContext as i } from "./Throne/hooks/use-throne-context.js";
5
5
  import "lodash-es";
6
6
  import { withInstall as p } from "./components/_util/vue/install.js";
@@ -16,18 +16,19 @@ import u from "./components/Form/index.js";
16
16
  import C from "./components/LovTable/index.js";
17
17
  import P from "./components/TableSelectPagetable/index.js";
18
18
  import h from "./components/Icon/index.js";
19
- const v = () => ({
20
- context: m()
21
- }), $ = /* @__PURE__ */ t({
19
+ import { OTree as v } from "./components/Tree/index.js";
20
+ const $ = () => ({
21
+ context: n()
22
+ }), S = /* @__PURE__ */ t({
22
23
  name: "OThroneContextProvider",
23
24
  inheritAttrs: !1,
24
- props: v(),
25
+ props: $(),
25
26
  setup(o, {
26
27
  slots: r
27
28
  }) {
28
- return i(o), () => n(r, "default");
29
+ return i(o), () => m(r, "default");
29
30
  }
30
- }), S = p($), E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31
+ }), g = p(S), H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31
32
  __proto__: null,
32
33
  Button: e,
33
34
  Card: x,
@@ -43,10 +44,11 @@ const v = () => ({
43
44
  Space: f,
44
45
  TableSelectPagetable: P,
45
46
  Tabs: s,
46
- ThroneContextProvider: S
47
+ ThroneContextProvider: g,
48
+ Tree: v
47
49
  }, Symbol.toStringTag, { value: "Module" }));
48
50
  export {
49
- S as T,
50
- E as c
51
+ g as T,
52
+ H as c
51
53
  };
52
- //# sourceMappingURL=components-Pdc4XEej.js.map
54
+ //# sourceMappingURL=components-G3_R2B-U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components-G3_R2B-U.js","sources":["../src/components/Throne/ThroneContextProvider.tsx"],"sourcesContent":["import { defineComponent, renderSlot, watch, provide, computed } from 'vue'\r\nimport type { PropType, ExtractPropTypes, CSSProperties, Plugin, App } from 'vue'\r\n\r\nimport { anyType, booleanType, functionType, objectType, someType, stringType, tuple, arrayType } from '../_util/type'\r\n\r\nimport { provideThroneContext } from '../../Throne/hooks/use-throne-context'\r\n\r\nimport { withInstall } from '../_util'\r\n\r\nexport const throneContextProviderProps = () => ({\r\n context: objectType<Record<string, any>>(),\r\n})\r\n\r\nexport type ThroneContextProviderProps = Partial<ExtractPropTypes<ReturnType<typeof throneContextProviderProps>>>\r\n\r\nexport type ThroneContextProviderContext = Partial<ThroneContextProviderProps>\r\n\r\nconst ThroneContextProvider = defineComponent({\r\n name: 'OThroneContextProvider',\r\n inheritAttrs: false,\r\n props: throneContextProviderProps(),\r\n setup(props, { slots }) {\r\n provideThroneContext(props)\r\n return () => {\r\n return renderSlot(slots, 'default')\r\n }\r\n },\r\n})\r\n\r\nexport default withInstall<typeof ThroneContextProvider, {}>(ThroneContextProvider)\r\n"],"names":["throneContextProviderProps","context","objectType","ThroneContextProvider","defineComponent","name","inheritAttrs","props","setup","slots","provideThroneContext","renderSlot","withInstall"],"mappings":";;;;;;;;;;;;;;;;;;;AASO,MAAMA,IAA6BA,OAAO;AAAA,EAC/CC,SAASC,EAAgC;AAC3C,IAMMC,IAAwBC,gBAAAA,EAAgB;AAAA,EAC5CC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAOP,EAA4B;AAAA,EACnCQ,MAAMD,GAAO;AAAA,IAAEE,OAAAA;AAAAA,EAAM,GAAG;AACtBC,WAAAA,EAAqBH,CAAK,GACnB,MACEI,EAAWF,GAAO,SAAS;AAAA,EAEtC;AACF,CAAC,GAEcG,IAAAA,EAA8CT,CAAqB;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,33 @@
1
+ import { cloneDeep as h } from "lodash-es";
2
+ const s = (t, r) => {
3
+ const a = r && r.idKey ? r.idKey : "id", d = r && r.pIdKey ? r.pIdKey : "pid", c = r && r.rootPId ? r.rootPId : void 0, y = r && r.childrenKey ? r.childrenKey : "children", e = h(t), f = e.filter((l) => c ? l[d] == c : !l[d]);
4
+ return f.forEach((l) => {
5
+ u(l, e, a, d, y);
6
+ }), f;
7
+ }, u = (t, r, a, d, c) => {
8
+ const y = r.filter((e) => e[d] == t[a]);
9
+ y.forEach((e) => {
10
+ u(e, r, a, d, c);
11
+ }), y.length > 0 && (t[c] = y);
12
+ }, K = (t, r) => {
13
+ const a = r && r.idKey ? r.idKey : "id", d = r && r.pIdKey ? r.pIdKey : "pid", c = r && r.rootPId ? r.rootPId : void 0, y = r && r.childrenKey ? r.childrenKey : "children", e = [];
14
+ return h(t).forEach((l) => {
15
+ I(l, e, a, d, y), delete l[y], l[d] = c, e.push(l);
16
+ }), e;
17
+ }, I = (t, r, a, d, c) => {
18
+ if (!t[c] || t[c].length == 0)
19
+ return;
20
+ t[c].forEach((e) => {
21
+ I(e, r, a, d, c), delete e[c], e[d] = t[a], r.push(e);
22
+ });
23
+ }, P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24
+ __proto__: null,
25
+ toArray: K,
26
+ toTreeNodes: s
27
+ }, Symbol.toStringTag, { value: "Module" }));
28
+ export {
29
+ P as T,
30
+ K as a,
31
+ s as t
32
+ };
33
+ //# sourceMappingURL=index-C2i44sFt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C2i44sFt.js","sources":["../src/components/Tree/utils/index.ts"],"sourcesContent":["import { TransformOptions, TreeData, TreeNodeData } from '../Tree'\r\nimport { cloneDeep } from 'lodash-es'\r\n\r\nexport const toTreeNodes = (array: TreeData, options?: TransformOptions) => {\r\n const idKey = options && options.idKey ? options.idKey : 'id'\r\n const pIdKey = options && options.pIdKey ? options.pIdKey : 'pid'\r\n const rootPId = options && options.rootPId ? options.rootPId : undefined\r\n const childrenKey = options && options.childrenKey ? options.childrenKey : 'children'\r\n\r\n const allNodes = cloneDeep(array)\r\n const treeNodes = allNodes.filter((item) => (rootPId ? item[pIdKey] == rootPId : !item[pIdKey]))\r\n\r\n treeNodes.forEach((item) => {\r\n toTreeNodesRecursive(item, allNodes, idKey, pIdKey, childrenKey)\r\n })\r\n\r\n return treeNodes\r\n}\r\n\r\nconst toTreeNodesRecursive = (node: TreeNodeData, allNodes: TreeData, idKey: string, pIdKey: string, childrenKey: string) => {\r\n const treeNodes = allNodes.filter((item) => item[pIdKey] == node[idKey])\r\n\r\n treeNodes.forEach((item) => {\r\n toTreeNodesRecursive(item, allNodes, idKey, pIdKey, childrenKey)\r\n })\r\n\r\n if (treeNodes.length > 0) {\r\n node[childrenKey] = treeNodes\r\n }\r\n}\r\n\r\nexport const toArray = (treeNodes: TreeData, options?: TransformOptions) => {\r\n const idKey = options && options.idKey ? options.idKey : 'id'\r\n const pIdKey = options && options.pIdKey ? options.pIdKey : 'pid'\r\n const rootPId = options && options.rootPId ? options.rootPId : undefined\r\n const childrenKey = options && options.childrenKey ? options.childrenKey : 'children'\r\n\r\n const allNodes: TreeData = []\r\n const array = cloneDeep(treeNodes)\r\n array.forEach((item) => {\r\n toArrayRecursive(item, allNodes, idKey, pIdKey, childrenKey)\r\n\r\n delete item[childrenKey]\r\n item[pIdKey] = rootPId\r\n allNodes.push(item)\r\n })\r\n\r\n return allNodes\r\n}\r\n\r\nconst toArrayRecursive = (node: TreeNodeData, allNodes: TreeData, idKey: string, pIdKey: string, childrenKey: string) => {\r\n if (!node[childrenKey] || node[childrenKey].length == 0) {\r\n return\r\n }\r\n\r\n const array: TreeData = node[childrenKey]\r\n array.forEach((item) => {\r\n toArrayRecursive(item, allNodes, idKey, pIdKey, childrenKey)\r\n\r\n delete item[childrenKey]\r\n item[pIdKey] = node[idKey]\r\n allNodes.push(item)\r\n })\r\n}\r\n"],"names":["toTreeNodes","array","options","idKey","pIdKey","rootPId","childrenKey","allNodes","cloneDeep","treeNodes","item","toTreeNodesRecursive","node","toArray","toArrayRecursive"],"mappings":";AAGa,MAAAA,IAAc,CAACC,GAAiBC,MAA+B;AAC1E,QAAMC,IAAQD,KAAWA,EAAQ,QAAQA,EAAQ,QAAQ,MACnDE,IAASF,KAAWA,EAAQ,SAASA,EAAQ,SAAS,OACtDG,IAAUH,KAAWA,EAAQ,UAAUA,EAAQ,UAAU,QACzDI,IAAcJ,KAAWA,EAAQ,cAAcA,EAAQ,cAAc,YAErEK,IAAWC,EAAUP,CAAK,GAC1BQ,IAAYF,EAAS,OAAO,CAACG,MAAUL,IAAUK,EAAKN,CAAM,KAAKC,IAAU,CAACK,EAAKN,CAAM,CAAE;AAErF,SAAAK,EAAA,QAAQ,CAACC,MAAS;AAC1B,IAAAC,EAAqBD,GAAMH,GAAUJ,GAAOC,GAAQE,CAAW;AAAA,EAAA,CAChE,GAEMG;AACT,GAEME,IAAuB,CAACC,GAAoBL,GAAoBJ,GAAeC,GAAgBE,MAAwB;AACrH,QAAAG,IAAYF,EAAS,OAAO,CAACG,MAASA,EAAKN,CAAM,KAAKQ,EAAKT,CAAK,CAAC;AAE7D,EAAAM,EAAA,QAAQ,CAACC,MAAS;AAC1B,IAAAC,EAAqBD,GAAMH,GAAUJ,GAAOC,GAAQE,CAAW;AAAA,EAAA,CAChE,GAEGG,EAAU,SAAS,MACrBG,EAAKN,CAAW,IAAIG;AAExB,GAEaI,IAAU,CAACJ,GAAqBP,MAA+B;AAC1E,QAAMC,IAAQD,KAAWA,EAAQ,QAAQA,EAAQ,QAAQ,MACnDE,IAASF,KAAWA,EAAQ,SAASA,EAAQ,SAAS,OACtDG,IAAUH,KAAWA,EAAQ,UAAUA,EAAQ,UAAU,QACzDI,IAAcJ,KAAWA,EAAQ,cAAcA,EAAQ,cAAc,YAErEK,IAAqB,CAAA;AAErB,SADQC,EAAUC,CAAS,EAC3B,QAAQ,CAACC,MAAS;AACtB,IAAAI,EAAiBJ,GAAMH,GAAUJ,GAAOC,GAAQE,CAAW,GAE3D,OAAOI,EAAKJ,CAAW,GACvBI,EAAKN,CAAM,IAAIC,GACfE,EAAS,KAAKG,CAAI;AAAA,EAAA,CACnB,GAEMH;AACT,GAEMO,IAAmB,CAACF,GAAoBL,GAAoBJ,GAAeC,GAAgBE,MAAwB;AACnH,MAAA,CAACM,EAAKN,CAAW,KAAKM,EAAKN,CAAW,EAAE,UAAU;AACpD;AAII,EADkBM,EAAKN,CAAW,EAClC,QAAQ,CAACI,MAAS;AACtB,IAAAI,EAAiBJ,GAAMH,GAAUJ,GAAOC,GAAQE,CAAW,GAE3D,OAAOI,EAAKJ,CAAW,GAClBI,EAAAN,CAAM,IAAIQ,EAAKT,CAAK,GACzBI,EAAS,KAAKG,CAAI;AAAA,EAAA,CACnB;AACH;;;;;"}
package/dist/index.js CHANGED
@@ -3,50 +3,53 @@ import { default as a } from "./Throne/index.js";
3
3
  import { useThroneContext as l } from "./Throne/hooks/use-throne-context.js";
4
4
  import { install as m } from "./components/index.js";
5
5
  import { default as p } from "./version/version.js";
6
- import { default as d } from "./components/Modal/useModal.js";
7
- import { default as b } from "./components/Form/LovInput/hooks/useLov.js";
8
- import { default as C } from "./components/Form/TableSelect/hooks/useTableSelect.js";
9
- import { default as i } from "./components/Button/index.js";
10
- import { T as S } from "./components-Pdc4XEej.js";
11
- import { S as y } from "./index-BbsXWo7C.js";
12
- import { Colflex as g, Flexitem as F, Rowflex as K } from "./components/Flex/index.js";
13
- import { default as M } from "./components/Card/index.js";
14
- import { default as w } from "./components/Tabs/index.js";
15
- import { default as E } from "./components/Pagetable/index.js";
16
- import { default as Q } from "./components/Querytable/index.js";
17
- import { default as j } from "./components/Modal/index.js";
18
- import { default as q } from "./components/Form/index.js";
19
- import { default as A } from "./components/LovTable/index.js";
20
- import { default as G } from "./components/TableSelectPagetable/index.js";
21
- import { default as J } from "./components/Icon/index.js";
22
- import { formContextKey as U } from "./components/Form/Form.js";
23
- import { lovContextKey as W } from "./components/Form/LovInput/LovInput.js";
24
- import { tableSelectContext as Y } from "./components/Form/TableSelect/TableSelect.js";
6
+ import { OTree as d, OTree as n } from "./components/Tree/index.js";
7
+ import { default as b } from "./components/Modal/useModal.js";
8
+ import { default as c } from "./components/Form/LovInput/hooks/useLov.js";
9
+ import { default as v } from "./components/Form/TableSelect/hooks/useTableSelect.js";
10
+ import { default as S } from "./components/Button/index.js";
11
+ import { T as y } from "./components-G3_R2B-U.js";
12
+ import { S as g } from "./index-BbsXWo7C.js";
13
+ import { Colflex as K, Flexitem as L, Rowflex as M } from "./components/Flex/index.js";
14
+ import { default as B } from "./components/Card/index.js";
15
+ import { default as I } from "./components/Tabs/index.js";
16
+ import { default as R } from "./components/Pagetable/index.js";
17
+ import { default as k } from "./components/Querytable/index.js";
18
+ import { default as z } from "./components/Modal/index.js";
19
+ import { default as D } from "./components/Form/index.js";
20
+ import { default as H } from "./components/LovTable/index.js";
21
+ import { default as N } from "./components/TableSelectPagetable/index.js";
22
+ import { default as V } from "./components/Icon/index.js";
23
+ import { formContextKey as X } from "./components/Form/Form.js";
24
+ import { lovContextKey as Z } from "./components/Form/LovInput/LovInput.js";
25
+ import { tableSelectContext as $ } from "./components/Form/TableSelect/TableSelect.js";
25
26
  export {
26
- i as Button,
27
- M as Card,
28
- g as Colflex,
29
- F as Flexitem,
30
- q as Form,
31
- J as Icon,
32
- A as LovTable,
33
- j as Modal,
27
+ S as Button,
28
+ B as Card,
29
+ K as Colflex,
30
+ L as Flexitem,
31
+ D as Form,
32
+ V as Icon,
33
+ H as LovTable,
34
+ z as Modal,
35
+ d as OTree,
34
36
  r as OrionError,
35
- E as Pagetable,
36
- Q as Querytable,
37
- K as Rowflex,
38
- y as Space,
39
- G as TableSelectPagetable,
40
- w as Tabs,
37
+ R as Pagetable,
38
+ k as Querytable,
39
+ M as Rowflex,
40
+ g as Space,
41
+ N as TableSelectPagetable,
42
+ I as Tabs,
41
43
  a as Throne,
42
- S as ThroneContextProvider,
43
- U as formContextKey,
44
+ y as ThroneContextProvider,
45
+ n as Tree,
46
+ X as formContextKey,
44
47
  m as install,
45
- W as lovContextKey,
46
- Y as tableSelectContext,
47
- b as useLov,
48
- d as useOModal,
49
- C as useTableselect,
48
+ Z as lovContextKey,
49
+ $ as tableSelectContext,
50
+ c as useLov,
51
+ b as useOModal,
52
+ v as useTableselect,
50
53
  l as useThroneContext,
51
54
  p as version
52
55
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- declare const _default: "0.1.42";
1
+ declare const _default: "0.1.43";
2
2
  export default _default;
@@ -1,4 +1,4 @@
1
- const e = "0.1.42";
1
+ const e = "0.1.43";
2
2
  export {
3
3
  e as default
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version/version.ts"],"sourcesContent":["export default '0.1.42';"],"names":["version"],"mappings":"AAAA,MAAAA,IAAe;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version/version.ts"],"sourcesContent":["export default '0.1.43';"],"names":["version"],"mappings":"AAAA,MAAAA,IAAe;"}
package/global.d.ts CHANGED
@@ -74,6 +74,8 @@ declare module 'vue' {
74
74
  OModalLocator: typeof import('orion-design')['Modal']['ModalLocator']
75
75
 
76
76
  ORichTextEditor: typeof import('orion-design')['RichTextEditor']
77
+
78
+ OTree: typeof import('orion-design')['Tree']
77
79
  }
78
80
  }
79
81
  export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orion-design",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -1 +0,0 @@
1
- {"version":3,"file":"components-Pdc4XEej.js","sources":["../src/components/Throne/ThroneContextProvider.tsx"],"sourcesContent":["import { defineComponent, renderSlot, watch, provide, computed } from 'vue'\nimport type { PropType, ExtractPropTypes, CSSProperties, Plugin, App } from 'vue'\n\nimport { anyType, booleanType, functionType, objectType, someType, stringType, tuple, arrayType } from '../_util/type'\n\nimport { provideThroneContext } from '../../Throne/hooks/use-throne-context'\n\nimport { withInstall } from '../_util'\n\nexport const throneContextProviderProps = () => ({\n context: objectType<Record<string, any>>(),\n})\n\nexport type ThroneContextProviderProps = Partial<ExtractPropTypes<ReturnType<typeof throneContextProviderProps>>>\n\nexport type ThroneContextProviderContext = Partial<ThroneContextProviderProps>\n\nconst ThroneContextProvider = defineComponent({\n name: 'OThroneContextProvider',\n inheritAttrs: false,\n props: throneContextProviderProps(),\n setup(props, { slots }) {\n provideThroneContext(props)\n return () => {\n return renderSlot(slots, 'default')\n }\n },\n})\n\nexport default withInstall<typeof ThroneContextProvider, {}>(ThroneContextProvider)\n"],"names":["throneContextProviderProps","context","objectType","ThroneContextProvider","defineComponent","name","inheritAttrs","props","setup","slots","provideThroneContext","renderSlot","withInstall"],"mappings":";;;;;;;;;;;;;;;;;;AASO,MAAMA,IAA6BA,OAAO;AAAA,EAC/CC,SAASC,EAAgC;AAC3C,IAMMC,IAAwBC,gBAAAA,EAAgB;AAAA,EAC5CC,MAAM;AAAA,EACNC,cAAc;AAAA,EACdC,OAAOP,EAA4B;AAAA,EACnCQ,MAAMD,GAAO;AAAA,IAAEE,OAAAA;AAAAA,EAAM,GAAG;AACtBC,WAAAA,EAAqBH,CAAK,GACnB,MACEI,EAAWF,GAAO,SAAS;AAAA,EAEtC;AACF,CAAC,GAEcG,IAAAA,EAA8CT,CAAqB;;;;;;;;;;;;;;;;;;"}