@ark-ui/vue 5.16.1 → 5.18.0
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.
- package/dist/components/checkbox/checkbox-group-provider.vue.cjs +33 -0
- package/dist/components/checkbox/checkbox-group-provider.vue.d.cts +23 -0
- package/dist/components/checkbox/checkbox-group-provider.vue.d.ts +23 -0
- package/dist/components/checkbox/checkbox-group-provider.vue.js +29 -0
- package/dist/components/checkbox/checkbox-group-provider.vue2.cjs +9 -0
- package/dist/components/checkbox/checkbox-group-provider.vue2.js +5 -0
- package/dist/components/checkbox/checkbox-group.vue.cjs +1 -1
- package/dist/components/checkbox/checkbox-group.vue.js +2 -2
- package/dist/components/checkbox/checkbox.cjs +2 -0
- package/dist/components/checkbox/checkbox.d.cts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +1 -0
- package/dist/components/checkbox/checkbox.js +1 -0
- package/dist/components/checkbox/index.cjs +2 -0
- package/dist/components/checkbox/index.d.cts +1 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/checkbox/use-checkbox-group-context.cjs +2 -2
- package/dist/components/checkbox/use-checkbox-group-context.d.cts +1 -1
- package/dist/components/checkbox/use-checkbox-group-context.d.ts +1 -1
- package/dist/components/checkbox/use-checkbox-group-context.js +2 -2
- package/dist/components/collapsible/collapsible-trigger.vue.cjs +2 -2
- package/dist/components/collapsible/collapsible-trigger.vue.js +3 -3
- package/dist/components/collection/index.cjs +2 -0
- package/dist/components/collection/index.d.cts +2 -1
- package/dist/components/collection/index.d.ts +2 -1
- package/dist/components/collection/index.js +1 -0
- package/dist/components/collection/tree-collection.js +1 -1
- package/dist/components/collection/use-list-selection.cjs +115 -0
- package/dist/components/collection/use-list-selection.d.cts +104 -0
- package/dist/components/collection/use-list-selection.d.ts +104 -0
- package/dist/components/collection/use-list-selection.js +111 -0
- package/dist/components/combobox/combobox-item-group.vue.cjs +2 -1
- package/dist/components/combobox/combobox-item-group.vue.js +2 -1
- package/dist/components/date-picker/date-picker-table.vue.cjs +2 -1
- package/dist/components/date-picker/date-picker-table.vue.js +2 -1
- package/dist/components/date-picker/use-date-picker.cjs +0 -1
- package/dist/components/date-picker/use-date-picker.js +0 -1
- package/dist/components/file-upload/file-upload-root.vue.cjs +2 -1
- package/dist/components/file-upload/file-upload-root.vue.d.cts +2 -0
- package/dist/components/file-upload/file-upload-root.vue.d.ts +2 -0
- package/dist/components/file-upload/file-upload-root.vue.js +2 -1
- package/dist/components/file-upload/file-upload.d.cts +1 -1
- package/dist/components/file-upload/file-upload.d.ts +1 -1
- package/dist/components/file-upload/file-upload.types.d.cts +8 -0
- package/dist/components/file-upload/file-upload.types.d.ts +8 -0
- package/dist/components/file-upload/index.d.cts +1 -1
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/use-file-upload.cjs +1 -0
- package/dist/components/file-upload/use-file-upload.js +1 -0
- package/dist/components/index.cjs +12 -0
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +7 -0
- package/dist/components/json-tree-view/get-branch-value.cjs +18 -0
- package/dist/components/json-tree-view/get-branch-value.d.cts +3 -0
- package/dist/components/json-tree-view/get-branch-value.d.ts +3 -0
- package/dist/components/json-tree-view/get-branch-value.js +14 -0
- package/dist/components/json-tree-view/index.cjs +17 -0
- package/dist/components/json-tree-view/index.d.cts +5 -0
- package/dist/components/json-tree-view/index.d.ts +5 -0
- package/dist/components/json-tree-view/index.js +6 -0
- package/dist/components/json-tree-view/json-tree-view-key-node.vue.cjs +30 -0
- package/dist/components/json-tree-view/json-tree-view-key-node.vue.d.cts +14 -0
- package/dist/components/json-tree-view/json-tree-view-key-node.vue.d.ts +14 -0
- package/dist/components/json-tree-view/json-tree-view-key-node.vue.js +26 -0
- package/dist/components/json-tree-view/json-tree-view-key-node.vue2.cjs +9 -0
- package/dist/components/json-tree-view/json-tree-view-key-node.vue2.js +5 -0
- package/dist/components/json-tree-view/json-tree-view-node.vue.cjs +140 -0
- package/dist/components/json-tree-view/json-tree-view-node.vue.d.cts +28 -0
- package/dist/components/json-tree-view/json-tree-view-node.vue.d.ts +28 -0
- package/dist/components/json-tree-view/json-tree-view-node.vue.js +136 -0
- package/dist/components/json-tree-view/json-tree-view-node.vue2.cjs +9 -0
- package/dist/components/json-tree-view/json-tree-view-node.vue2.js +5 -0
- package/dist/components/json-tree-view/json-tree-view-props-context.cjs +10 -0
- package/dist/components/json-tree-view/json-tree-view-props-context.d.cts +9 -0
- package/dist/components/json-tree-view/json-tree-view-props-context.d.ts +9 -0
- package/dist/components/json-tree-view/json-tree-view-props-context.js +5 -0
- package/dist/components/json-tree-view/json-tree-view-root-provider.vue.cjs +28 -0
- package/dist/components/json-tree-view/json-tree-view-root-provider.vue.d.cts +22 -0
- package/dist/components/json-tree-view/json-tree-view-root-provider.vue.d.ts +22 -0
- package/dist/components/json-tree-view/json-tree-view-root-provider.vue.js +24 -0
- package/dist/components/json-tree-view/json-tree-view-root-provider.vue2.cjs +9 -0
- package/dist/components/json-tree-view/json-tree-view-root-provider.vue2.js +5 -0
- package/dist/components/json-tree-view/json-tree-view-root.vue.cjs +87 -0
- package/dist/components/json-tree-view/json-tree-view-root.vue.d.cts +37 -0
- package/dist/components/json-tree-view/json-tree-view-root.vue.d.ts +37 -0
- package/dist/components/json-tree-view/json-tree-view-root.vue.js +83 -0
- package/dist/components/json-tree-view/json-tree-view-root.vue2.cjs +9 -0
- package/dist/components/json-tree-view/json-tree-view-root.vue2.js +5 -0
- package/dist/components/json-tree-view/json-tree-view-tree.vue.cjs +51 -0
- package/dist/components/json-tree-view/json-tree-view-tree.vue.d.cts +27 -0
- package/dist/components/json-tree-view/json-tree-view-tree.vue.d.ts +27 -0
- package/dist/components/json-tree-view/json-tree-view-tree.vue.js +47 -0
- package/dist/components/json-tree-view/json-tree-view-tree.vue2.cjs +9 -0
- package/dist/components/json-tree-view/json-tree-view-tree.vue2.js +5 -0
- package/dist/components/json-tree-view/json-tree-view-value-node.vue.cjs +49 -0
- package/dist/components/json-tree-view/json-tree-view-value-node.vue.d.cts +28 -0
- package/dist/components/json-tree-view/json-tree-view-value-node.vue.d.ts +28 -0
- package/dist/components/json-tree-view/json-tree-view-value-node.vue.js +45 -0
- package/dist/components/json-tree-view/json-tree-view-value-node.vue2.cjs +9 -0
- package/dist/components/json-tree-view/json-tree-view-value-node.vue2.js +5 -0
- package/dist/components/json-tree-view/json-tree-view.cjs +13 -0
- package/dist/components/json-tree-view/json-tree-view.d.cts +3 -0
- package/dist/components/json-tree-view/json-tree-view.d.ts +3 -0
- package/dist/components/json-tree-view/json-tree-view.js +3 -0
- package/dist/components/json-tree-view/use-json-tree-view.cjs +30 -0
- package/dist/components/json-tree-view/use-json-tree-view.d.cts +10 -0
- package/dist/components/json-tree-view/use-json-tree-view.d.ts +10 -0
- package/dist/components/json-tree-view/use-json-tree-view.js +26 -0
- package/dist/components/listbox/listbox-item-group.vue.cjs +2 -1
- package/dist/components/listbox/listbox-item-group.vue.js +2 -1
- package/dist/components/menu/menu-item-group.vue.cjs +2 -1
- package/dist/components/menu/menu-item-group.vue.js +2 -1
- package/dist/components/menu/menu-radio-item-group.vue.cjs +2 -1
- package/dist/components/menu/menu-radio-item-group.vue.js +2 -1
- package/dist/components/password-input/password-input-context.vue.d.cts +9 -9
- package/dist/components/password-input/password-input-context.vue.d.ts +9 -9
- package/dist/components/select/select-item-group.vue.cjs +2 -1
- package/dist/components/select/select-item-group.vue.js +2 -1
- package/dist/components/signature-pad/signature-pad-root.vue.cjs +2 -1
- package/dist/components/signature-pad/signature-pad-root.vue.d.cts +2 -0
- package/dist/components/signature-pad/signature-pad-root.vue.d.ts +2 -0
- package/dist/components/signature-pad/signature-pad-root.vue.js +2 -1
- package/dist/components/signature-pad/signature-pad.types.d.cts +8 -0
- package/dist/components/signature-pad/signature-pad.types.d.ts +8 -0
- package/dist/components/signature-pad/use-signature-pad.cjs +1 -0
- package/dist/components/signature-pad/use-signature-pad.js +1 -0
- package/dist/components/tabs/tabs-root.vue.d.cts +1 -1
- package/dist/components/tabs/tabs-root.vue.d.ts +1 -1
- package/dist/components/toggle-group/toggle-group-root.vue.d.cts +1 -1
- package/dist/components/toggle-group/toggle-group-root.vue.d.ts +1 -1
- package/dist/components/tree-view/tree-view-root.vue.cjs +4 -1
- package/dist/components/tree-view/tree-view-root.vue.js +4 -1
- package/dist/index.cjs +12 -0
- package/dist/index.js +7 -0
- package/package.json +61 -60
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
interface JsonTreeViewKeyNodeProps {
|
|
4
|
+
/**
|
|
5
|
+
* The node to render.
|
|
6
|
+
*/
|
|
7
|
+
node: JsonNode;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to show quotes on the key.
|
|
10
|
+
*/
|
|
11
|
+
showQuotes?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: DefineComponent<JsonTreeViewKeyNodeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<JsonTreeViewKeyNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
interface JsonTreeViewKeyNodeProps {
|
|
4
|
+
/**
|
|
5
|
+
* The node to render.
|
|
6
|
+
*/
|
|
7
|
+
node: JsonNode;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to show quotes on the key.
|
|
10
|
+
*/
|
|
11
|
+
showQuotes?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: DefineComponent<JsonTreeViewKeyNodeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<JsonTreeViewKeyNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, Fragment, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { keyPathToKey } from '@zag-js/json-tree-utils';
|
|
3
|
+
|
|
4
|
+
const _hoisted_1 = ["data-non-enumerable"];
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "json-tree-view-key-node",
|
|
7
|
+
props: {
|
|
8
|
+
node: {},
|
|
9
|
+
showQuotes: { type: Boolean }
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
const key = computed(() => keyPathToKey(props.node.keyPath));
|
|
14
|
+
return (_ctx, _cache) => {
|
|
15
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
16
|
+
createElementVNode("span", {
|
|
17
|
+
"data-kind": "key",
|
|
18
|
+
"data-non-enumerable": _ctx.node.isNonEnumerable ? "" : void 0
|
|
19
|
+
}, toDisplayString(_ctx.showQuotes ? `"${key.value}"` : key.value), 9, _hoisted_1),
|
|
20
|
+
_cache[0] || (_cache[0] = createElementVNode("span", { "data-kind": "colon" }, ":", -1))
|
|
21
|
+
], 64);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const jsonTreeViewKeyNode_vue_vue_type_script_setup_true_lang = require('./json-tree-view-key-node.vue.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.default = jsonTreeViewKeyNode_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const vue = require('vue');
|
|
6
|
+
const jsonTreeUtils = require('@zag-js/json-tree-utils');
|
|
7
|
+
const treeViewItemText_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-item-text.vue.cjs');
|
|
8
|
+
const treeViewItem_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-item.vue.cjs');
|
|
9
|
+
const treeViewNodeProvider_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-node-provider.vue.cjs');
|
|
10
|
+
const treeViewBranchContent_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-branch-content.vue.cjs');
|
|
11
|
+
const treeViewBranchControl_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-branch-control.vue.cjs');
|
|
12
|
+
const treeViewBranchIndentGuide_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-branch-indent-guide.vue.cjs');
|
|
13
|
+
const treeViewBranchIndicator_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-branch-indicator.vue.cjs');
|
|
14
|
+
const treeViewBranchText_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-branch-text.vue.cjs');
|
|
15
|
+
const treeViewBranch_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-branch.vue.cjs');
|
|
16
|
+
const useTreeViewContext = require('../tree-view/use-tree-view-context.cjs');
|
|
17
|
+
const jsonTreeViewKeyNode_vue_vue_type_script_setup_true_lang = require('./json-tree-view-key-node.vue.cjs');
|
|
18
|
+
const jsonTreeViewPropsContext = require('./json-tree-view-props-context.cjs');
|
|
19
|
+
const jsonTreeViewValueNode_vue_vue_type_script_setup_true_lang = require('./json-tree-view-value-node.vue.cjs');
|
|
20
|
+
|
|
21
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
22
|
+
__name: "json-tree-view-node",
|
|
23
|
+
props: {
|
|
24
|
+
node: {},
|
|
25
|
+
indexPath: {},
|
|
26
|
+
indentGuide: { type: Boolean }
|
|
27
|
+
},
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const props = __props;
|
|
30
|
+
const tree = useTreeViewContext.useTreeViewContext();
|
|
31
|
+
const nodeState = vue.computed(() => tree.value.getNodeState({ node: props.node, indexPath: props.indexPath }));
|
|
32
|
+
const options = jsonTreeViewPropsContext.useJsonTreeViewPropsContext();
|
|
33
|
+
const key = vue.computed(() => jsonTreeUtils.keyPathToKey(props.node.keyPath, { excludeRoot: true }));
|
|
34
|
+
const valueNode = vue.computed(() => jsonTreeUtils.jsonNodeToElement(props.node, vue.toValue(options)));
|
|
35
|
+
const nodeProps = vue.computed(() => {
|
|
36
|
+
const desc = jsonTreeUtils.getAccessibleDescription(props.node);
|
|
37
|
+
const line = props.indexPath.reduce((acc, curr) => acc + curr, 1);
|
|
38
|
+
const lineLength = props.indexPath.length - 1;
|
|
39
|
+
return {
|
|
40
|
+
"aria-label": desc,
|
|
41
|
+
"data-line": line,
|
|
42
|
+
style: { ["--line-length"]: lineLength }
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
const _component_JsonTreeViewNode = vue.resolveComponent("JsonTreeViewNode", true);
|
|
47
|
+
return vue.openBlock(), vue.createBlock(treeViewNodeProvider_vue_vue_type_script_setup_true_lang.default, {
|
|
48
|
+
node: _ctx.node,
|
|
49
|
+
"index-path": _ctx.indexPath
|
|
50
|
+
}, {
|
|
51
|
+
default: vue.withCtx(() => [
|
|
52
|
+
nodeState.value.isBranch ? (vue.openBlock(), vue.createBlock(treeViewBranch_vue_vue_type_script_setup_true_lang.default, {
|
|
53
|
+
key: 0,
|
|
54
|
+
"data-scope": "json-tree-view"
|
|
55
|
+
}, {
|
|
56
|
+
default: vue.withCtx(() => [
|
|
57
|
+
vue.createVNode(treeViewBranchControl_vue_vue_type_script_setup_true_lang.default, vue.mergeProps(nodeProps.value, { "data-scope": "json-tree-view" }), {
|
|
58
|
+
default: vue.withCtx(() => [
|
|
59
|
+
_ctx.$slots.arrow ? (vue.openBlock(), vue.createBlock(treeViewBranchIndicator_vue_vue_type_script_setup_true_lang.default, {
|
|
60
|
+
key: 0,
|
|
61
|
+
"data-scope": "json-tree-view"
|
|
62
|
+
}, {
|
|
63
|
+
default: vue.withCtx(() => [
|
|
64
|
+
vue.renderSlot(_ctx.$slots, "arrow")
|
|
65
|
+
]),
|
|
66
|
+
_: 3
|
|
67
|
+
})) : vue.createCommentVNode("", true),
|
|
68
|
+
vue.createVNode(treeViewBranchText_vue_vue_type_script_setup_true_lang.default, { "data-scope": "json-tree-view" }, {
|
|
69
|
+
default: vue.withCtx(() => [
|
|
70
|
+
key.value ? (vue.openBlock(), vue.createBlock(jsonTreeViewKeyNode_vue_vue_type_script_setup_true_lang.default, {
|
|
71
|
+
key: 0,
|
|
72
|
+
node: _ctx.node,
|
|
73
|
+
"show-quotes": vue.unref(options).quotesOnKeys
|
|
74
|
+
}, null, 8, ["node", "show-quotes"])) : vue.createCommentVNode("", true),
|
|
75
|
+
vue.createVNode(jsonTreeViewValueNode_vue_vue_type_script_setup_true_lang.default, { node: valueNode.value }, {
|
|
76
|
+
renderValue: vue.withCtx(({ node: childNode }) => [
|
|
77
|
+
vue.renderSlot(_ctx.$slots, "renderValue", { node: childNode })
|
|
78
|
+
]),
|
|
79
|
+
_: 3
|
|
80
|
+
}, 8, ["node"])
|
|
81
|
+
]),
|
|
82
|
+
_: 3
|
|
83
|
+
})
|
|
84
|
+
]),
|
|
85
|
+
_: 3
|
|
86
|
+
}, 16),
|
|
87
|
+
vue.createVNode(treeViewBranchContent_vue_vue_type_script_setup_true_lang.default, { "data-scope": "json-tree-view" }, {
|
|
88
|
+
default: vue.withCtx(() => [
|
|
89
|
+
_ctx.$slots.indentGuide ? vue.renderSlot(_ctx.$slots, "indentGuide", { key: 0 }) : _ctx.indentGuide ? (vue.openBlock(), vue.createBlock(treeViewBranchIndentGuide_vue_vue_type_script_setup_true_lang.default, { key: 1 })) : vue.createCommentVNode("", true),
|
|
90
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.node.children, (child, index) => {
|
|
91
|
+
return vue.openBlock(), vue.createBlock(_component_JsonTreeViewNode, vue.mergeProps({ key: index }, { ref_for: true }, _ctx.$props, {
|
|
92
|
+
node: child,
|
|
93
|
+
"index-path": [..._ctx.indexPath, index]
|
|
94
|
+
}), {
|
|
95
|
+
arrow: vue.withCtx(() => [
|
|
96
|
+
vue.renderSlot(_ctx.$slots, "arrow")
|
|
97
|
+
]),
|
|
98
|
+
indentGuide: vue.withCtx(() => [
|
|
99
|
+
vue.renderSlot(_ctx.$slots, "indentGuide")
|
|
100
|
+
]),
|
|
101
|
+
renderValue: vue.withCtx(({ node: childNode }) => [
|
|
102
|
+
vue.renderSlot(_ctx.$slots, "renderValue", { node: childNode })
|
|
103
|
+
]),
|
|
104
|
+
_: 2
|
|
105
|
+
}, 1040, ["node", "index-path"]);
|
|
106
|
+
}), 128))
|
|
107
|
+
]),
|
|
108
|
+
_: 3
|
|
109
|
+
})
|
|
110
|
+
]),
|
|
111
|
+
_: 3
|
|
112
|
+
})) : (vue.openBlock(), vue.createBlock(treeViewItem_vue_vue_type_script_setup_true_lang.default, vue.mergeProps({ key: 1 }, nodeProps.value, { "data-scope": "json-tree-view" }), {
|
|
113
|
+
default: vue.withCtx(() => [
|
|
114
|
+
vue.createVNode(treeViewItemText_vue_vue_type_script_setup_true_lang.default, { "data-scope": "json-tree-view" }, {
|
|
115
|
+
default: vue.withCtx(() => [
|
|
116
|
+
key.value ? (vue.openBlock(), vue.createBlock(jsonTreeViewKeyNode_vue_vue_type_script_setup_true_lang.default, {
|
|
117
|
+
key: 0,
|
|
118
|
+
node: _ctx.node,
|
|
119
|
+
"show-quotes": vue.unref(options).quotesOnKeys
|
|
120
|
+
}, null, 8, ["node", "show-quotes"])) : vue.createCommentVNode("", true),
|
|
121
|
+
vue.createVNode(jsonTreeViewValueNode_vue_vue_type_script_setup_true_lang.default, { node: valueNode.value }, {
|
|
122
|
+
renderValue: vue.withCtx(({ node: childNode }) => [
|
|
123
|
+
vue.renderSlot(_ctx.$slots, "renderValue", { node: childNode })
|
|
124
|
+
]),
|
|
125
|
+
_: 3
|
|
126
|
+
}, 8, ["node"])
|
|
127
|
+
]),
|
|
128
|
+
_: 3
|
|
129
|
+
})
|
|
130
|
+
]),
|
|
131
|
+
_: 3
|
|
132
|
+
}, 16))
|
|
133
|
+
]),
|
|
134
|
+
_: 3
|
|
135
|
+
}, 8, ["node", "index-path"]);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JsonNode, JsonNodeHastElement } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
export interface JsonTreeViewNodeBaseProps {
|
|
4
|
+
indentGuide?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface JsonTreeViewNodeProps extends JsonTreeViewNodeBaseProps {
|
|
7
|
+
node: JsonNode;
|
|
8
|
+
indexPath: number[];
|
|
9
|
+
}
|
|
10
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<JsonTreeViewNodeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<JsonTreeViewNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
11
|
+
arrow?(): unknown;
|
|
12
|
+
indentGuide?(): unknown;
|
|
13
|
+
renderValue?(props: {
|
|
14
|
+
node: JsonNodeHastElement;
|
|
15
|
+
}): unknown;
|
|
16
|
+
}> & {
|
|
17
|
+
arrow?(): unknown;
|
|
18
|
+
indentGuide?(): unknown;
|
|
19
|
+
renderValue?(props: {
|
|
20
|
+
node: JsonNodeHastElement;
|
|
21
|
+
}): unknown;
|
|
22
|
+
}>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JsonNode, JsonNodeHastElement } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
export interface JsonTreeViewNodeBaseProps {
|
|
4
|
+
indentGuide?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface JsonTreeViewNodeProps extends JsonTreeViewNodeBaseProps {
|
|
7
|
+
node: JsonNode;
|
|
8
|
+
indexPath: number[];
|
|
9
|
+
}
|
|
10
|
+
declare const _default: __VLS_WithTemplateSlots< DefineComponent<JsonTreeViewNodeProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<JsonTreeViewNodeProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
11
|
+
arrow?(): unknown;
|
|
12
|
+
indentGuide?(): unknown;
|
|
13
|
+
renderValue?(props: {
|
|
14
|
+
node: JsonNodeHastElement;
|
|
15
|
+
}): unknown;
|
|
16
|
+
}> & {
|
|
17
|
+
arrow?(): unknown;
|
|
18
|
+
indentGuide?(): unknown;
|
|
19
|
+
renderValue?(props: {
|
|
20
|
+
node: JsonNodeHastElement;
|
|
21
|
+
}): unknown;
|
|
22
|
+
}>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { defineComponent, computed, toValue, resolveComponent, createBlock, openBlock, withCtx, createVNode, mergeProps, createCommentVNode, renderSlot, unref, createElementBlock, Fragment, renderList } from 'vue';
|
|
2
|
+
import { keyPathToKey, jsonNodeToElement, getAccessibleDescription } from '@zag-js/json-tree-utils';
|
|
3
|
+
import _sfc_main$b from '../tree-view/tree-view-item-text.vue.js';
|
|
4
|
+
import _sfc_main$a from '../tree-view/tree-view-item.vue.js';
|
|
5
|
+
import _sfc_main$1 from '../tree-view/tree-view-node-provider.vue.js';
|
|
6
|
+
import _sfc_main$8 from '../tree-view/tree-view-branch-content.vue.js';
|
|
7
|
+
import _sfc_main$3 from '../tree-view/tree-view-branch-control.vue.js';
|
|
8
|
+
import _sfc_main$9 from '../tree-view/tree-view-branch-indent-guide.vue.js';
|
|
9
|
+
import _sfc_main$4 from '../tree-view/tree-view-branch-indicator.vue.js';
|
|
10
|
+
import _sfc_main$5 from '../tree-view/tree-view-branch-text.vue.js';
|
|
11
|
+
import _sfc_main$2 from '../tree-view/tree-view-branch.vue.js';
|
|
12
|
+
import { useTreeViewContext } from '../tree-view/use-tree-view-context.js';
|
|
13
|
+
import _sfc_main$6 from './json-tree-view-key-node.vue.js';
|
|
14
|
+
import { useJsonTreeViewPropsContext } from './json-tree-view-props-context.js';
|
|
15
|
+
import _sfc_main$7 from './json-tree-view-value-node.vue.js';
|
|
16
|
+
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
+
__name: "json-tree-view-node",
|
|
19
|
+
props: {
|
|
20
|
+
node: {},
|
|
21
|
+
indexPath: {},
|
|
22
|
+
indentGuide: { type: Boolean }
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const tree = useTreeViewContext();
|
|
27
|
+
const nodeState = computed(() => tree.value.getNodeState({ node: props.node, indexPath: props.indexPath }));
|
|
28
|
+
const options = useJsonTreeViewPropsContext();
|
|
29
|
+
const key = computed(() => keyPathToKey(props.node.keyPath, { excludeRoot: true }));
|
|
30
|
+
const valueNode = computed(() => jsonNodeToElement(props.node, toValue(options)));
|
|
31
|
+
const nodeProps = computed(() => {
|
|
32
|
+
const desc = getAccessibleDescription(props.node);
|
|
33
|
+
const line = props.indexPath.reduce((acc, curr) => acc + curr, 1);
|
|
34
|
+
const lineLength = props.indexPath.length - 1;
|
|
35
|
+
return {
|
|
36
|
+
"aria-label": desc,
|
|
37
|
+
"data-line": line,
|
|
38
|
+
style: { ["--line-length"]: lineLength }
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
const _component_JsonTreeViewNode = resolveComponent("JsonTreeViewNode", true);
|
|
43
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
44
|
+
node: _ctx.node,
|
|
45
|
+
"index-path": _ctx.indexPath
|
|
46
|
+
}, {
|
|
47
|
+
default: withCtx(() => [
|
|
48
|
+
nodeState.value.isBranch ? (openBlock(), createBlock(_sfc_main$2, {
|
|
49
|
+
key: 0,
|
|
50
|
+
"data-scope": "json-tree-view"
|
|
51
|
+
}, {
|
|
52
|
+
default: withCtx(() => [
|
|
53
|
+
createVNode(_sfc_main$3, mergeProps(nodeProps.value, { "data-scope": "json-tree-view" }), {
|
|
54
|
+
default: withCtx(() => [
|
|
55
|
+
_ctx.$slots.arrow ? (openBlock(), createBlock(_sfc_main$4, {
|
|
56
|
+
key: 0,
|
|
57
|
+
"data-scope": "json-tree-view"
|
|
58
|
+
}, {
|
|
59
|
+
default: withCtx(() => [
|
|
60
|
+
renderSlot(_ctx.$slots, "arrow")
|
|
61
|
+
]),
|
|
62
|
+
_: 3
|
|
63
|
+
})) : createCommentVNode("", true),
|
|
64
|
+
createVNode(_sfc_main$5, { "data-scope": "json-tree-view" }, {
|
|
65
|
+
default: withCtx(() => [
|
|
66
|
+
key.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
67
|
+
key: 0,
|
|
68
|
+
node: _ctx.node,
|
|
69
|
+
"show-quotes": unref(options).quotesOnKeys
|
|
70
|
+
}, null, 8, ["node", "show-quotes"])) : createCommentVNode("", true),
|
|
71
|
+
createVNode(_sfc_main$7, { node: valueNode.value }, {
|
|
72
|
+
renderValue: withCtx(({ node: childNode }) => [
|
|
73
|
+
renderSlot(_ctx.$slots, "renderValue", { node: childNode })
|
|
74
|
+
]),
|
|
75
|
+
_: 3
|
|
76
|
+
}, 8, ["node"])
|
|
77
|
+
]),
|
|
78
|
+
_: 3
|
|
79
|
+
})
|
|
80
|
+
]),
|
|
81
|
+
_: 3
|
|
82
|
+
}, 16),
|
|
83
|
+
createVNode(_sfc_main$8, { "data-scope": "json-tree-view" }, {
|
|
84
|
+
default: withCtx(() => [
|
|
85
|
+
_ctx.$slots.indentGuide ? renderSlot(_ctx.$slots, "indentGuide", { key: 0 }) : _ctx.indentGuide ? (openBlock(), createBlock(_sfc_main$9, { key: 1 })) : createCommentVNode("", true),
|
|
86
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.node.children, (child, index) => {
|
|
87
|
+
return openBlock(), createBlock(_component_JsonTreeViewNode, mergeProps({ key: index }, { ref_for: true }, _ctx.$props, {
|
|
88
|
+
node: child,
|
|
89
|
+
"index-path": [..._ctx.indexPath, index]
|
|
90
|
+
}), {
|
|
91
|
+
arrow: withCtx(() => [
|
|
92
|
+
renderSlot(_ctx.$slots, "arrow")
|
|
93
|
+
]),
|
|
94
|
+
indentGuide: withCtx(() => [
|
|
95
|
+
renderSlot(_ctx.$slots, "indentGuide")
|
|
96
|
+
]),
|
|
97
|
+
renderValue: withCtx(({ node: childNode }) => [
|
|
98
|
+
renderSlot(_ctx.$slots, "renderValue", { node: childNode })
|
|
99
|
+
]),
|
|
100
|
+
_: 2
|
|
101
|
+
}, 1040, ["node", "index-path"]);
|
|
102
|
+
}), 128))
|
|
103
|
+
]),
|
|
104
|
+
_: 3
|
|
105
|
+
})
|
|
106
|
+
]),
|
|
107
|
+
_: 3
|
|
108
|
+
})) : (openBlock(), createBlock(_sfc_main$a, mergeProps({ key: 1 }, nodeProps.value, { "data-scope": "json-tree-view" }), {
|
|
109
|
+
default: withCtx(() => [
|
|
110
|
+
createVNode(_sfc_main$b, { "data-scope": "json-tree-view" }, {
|
|
111
|
+
default: withCtx(() => [
|
|
112
|
+
key.value ? (openBlock(), createBlock(_sfc_main$6, {
|
|
113
|
+
key: 0,
|
|
114
|
+
node: _ctx.node,
|
|
115
|
+
"show-quotes": unref(options).quotesOnKeys
|
|
116
|
+
}, null, 8, ["node", "show-quotes"])) : createCommentVNode("", true),
|
|
117
|
+
createVNode(_sfc_main$7, { node: valueNode.value }, {
|
|
118
|
+
renderValue: withCtx(({ node: childNode }) => [
|
|
119
|
+
renderSlot(_ctx.$slots, "renderValue", { node: childNode })
|
|
120
|
+
]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 8, ["node"])
|
|
123
|
+
]),
|
|
124
|
+
_: 3
|
|
125
|
+
})
|
|
126
|
+
]),
|
|
127
|
+
_: 3
|
|
128
|
+
}, 16))
|
|
129
|
+
]),
|
|
130
|
+
_: 3
|
|
131
|
+
}, 8, ["node", "index-path"]);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const jsonTreeViewNode_vue_vue_type_script_setup_true_lang = require('./json-tree-view-node.vue.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.default = jsonTreeViewNode_vue_vue_type_script_setup_true_lang.default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const createContext = require('../../utils/create-context.cjs');
|
|
6
|
+
|
|
7
|
+
const [JsonTreeViewPropsProvider, useJsonTreeViewPropsContext] = createContext.createContext("JsonTreeViewPropsContext");
|
|
8
|
+
|
|
9
|
+
exports.JsonTreeViewPropsProvider = JsonTreeViewPropsProvider;
|
|
10
|
+
exports.useJsonTreeViewPropsContext = useJsonTreeViewPropsContext;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JsonNodePreviewOptions } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
|
+
export interface JsonTreeViewOptions extends Partial<JsonNodePreviewOptions> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to show quotes on the keys.
|
|
6
|
+
*/
|
|
7
|
+
quotesOnKeys?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const JsonTreeViewPropsProvider: (opts: ComputedRef<JsonTreeViewOptions>) => void, useJsonTreeViewPropsContext: (fallback?: ComputedRef<JsonTreeViewOptions> | undefined) => ComputedRef<JsonTreeViewOptions>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JsonNodePreviewOptions } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
|
+
export interface JsonTreeViewOptions extends Partial<JsonNodePreviewOptions> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to show quotes on the keys.
|
|
6
|
+
*/
|
|
7
|
+
quotesOnKeys?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const JsonTreeViewPropsProvider: (opts: ComputedRef<JsonTreeViewOptions>) => void, useJsonTreeViewPropsContext: (fallback?: ComputedRef<JsonTreeViewOptions> | undefined) => ComputedRef<JsonTreeViewOptions>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const vue = require('vue');
|
|
6
|
+
const treeViewRootProvider_vue_vue_type_script_setup_true_lang = require('../tree-view/tree-view-root-provider.vue.cjs');
|
|
7
|
+
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9
|
+
__name: "json-tree-view-root-provider",
|
|
10
|
+
props: {
|
|
11
|
+
value: {},
|
|
12
|
+
lazyMount: { type: Boolean },
|
|
13
|
+
unmountOnExit: { type: Boolean },
|
|
14
|
+
asChild: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return vue.openBlock(), vue.createBlock(vue.unref(treeViewRootProvider_vue_vue_type_script_setup_true_lang.default), vue.mergeProps({ "data-scope": "json-tree-view" }, _ctx.$props), {
|
|
19
|
+
default: vue.withCtx(() => [
|
|
20
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
21
|
+
]),
|
|
22
|
+
_: 3
|
|
23
|
+
}, 16);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { TreeViewRootProviderProps } from '../tree-view';
|
|
3
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
4
|
+
export interface JsonTreeViewRootProviderProps extends TreeViewRootProviderProps<JsonNode> {
|
|
5
|
+
}
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: DefineComponent<JsonTreeViewRootProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<JsonTreeViewRootProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JsonNode } from '@zag-js/json-tree-utils';
|
|
2
|
+
import { TreeViewRootProviderProps } from '../tree-view';
|
|
3
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
4
|
+
export interface JsonTreeViewRootProviderProps extends TreeViewRootProviderProps<JsonNode> {
|
|
5
|
+
}
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: DefineComponent<JsonTreeViewRootProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<JsonTreeViewRootProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
|
|
2
|
+
import _sfc_main$1 from '../tree-view/tree-view-root-provider.vue.js';
|
|
3
|
+
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "json-tree-view-root-provider",
|
|
6
|
+
props: {
|
|
7
|
+
value: {},
|
|
8
|
+
lazyMount: { type: Boolean },
|
|
9
|
+
unmountOnExit: { type: Boolean },
|
|
10
|
+
asChild: { type: Boolean }
|
|
11
|
+
},
|
|
12
|
+
setup(__props) {
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return openBlock(), createBlock(unref(_sfc_main$1), mergeProps({ "data-scope": "json-tree-view" }, _ctx.$props), {
|
|
15
|
+
default: withCtx(() => [
|
|
16
|
+
renderSlot(_ctx.$slots, "default")
|
|
17
|
+
]),
|
|
18
|
+
_: 3
|
|
19
|
+
}, 16);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const jsonTreeViewRootProvider_vue_vue_type_script_setup_true_lang = require('./json-tree-view-root-provider.vue.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.default = jsonTreeViewRootProvider_vue_vue_type_script_setup_true_lang.default;
|