Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentiny/vue-tree

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentiny/vue-tree - npm Package Compare versions

Comparing version 3.12.0 to 3.13.0-alpha.0

24

lib/index.js

@@ -19,2 +19,4 @@ function _extends() {

var template = function template2(mode) {
var _process$env;
typeof process === "object" ? (_process$env = process.env) == null ? void 0 : _process$env.TINY_MODE : null;
return PcTemplate;

@@ -85,14 +87,9 @@ };

props: {
default: function _default2(context) {
var ctx = this || context;
var lazy = ctx.lazy;
var defaultProps = {
default: function _default2() {
return {
children: "children",
label: "label",
disabled: "disabled"
disabled: "disabled",
isLeaf: "isLeaf"
};
lazy && Object.assign(defaultProps, {
isLeaf: "isLeaf"
});
return defaultProps;
}

@@ -164,2 +161,9 @@ },

},
deleteNodeMethod: Function,
showCheckedMark: Boolean,
willChangeView: {
type: Boolean,
default: true
},
onlyCheckChildren: Boolean,
showLine: Boolean

@@ -175,3 +179,3 @@ }),

});
var version = "3.12.0";
var version = "3.13.0-alpha.0";
Tree.install = function(Vue) {

@@ -178,0 +182,0 @@ Vue.component(Tree.name, Tree);

import { renderless as renderless$1, api as api$1 } from "@opentiny/vue-renderless/tree/vue";
import { directive, h, setup as _setup, isVue2, defineComponent, props } from "@opentiny/vue-common";
import { iconChevronRight, iconLoading, iconArrowBottom, iconEdit, iconMinusSquare, iconPlusSquare, iconWarning, iconMarkOn } from "@opentiny/vue-icon";
import { iconChevronRight, iconLoading, iconArrowBottom, iconEdit, iconMinusSquare, iconPlusSquare, iconFinish, iconWarning, iconMarkOn } from "@opentiny/vue-icon";
import Switch from "@opentiny/vue-switch";

@@ -120,2 +120,3 @@ import Popover from "@opentiny/vue-popover";

theme: String,
showCheckedMark: Boolean,
showLine: Boolean

@@ -125,3 +126,3 @@ },

CollapseTransition,
Checkbox,
TinyCheckbox: Checkbox,
TinyRadio: Radio,

@@ -135,2 +136,3 @@ TinyInput: Input,

IconPlusSquare: iconPlusSquare(),
IconFinish: iconFinish(),
MenuContext: {

@@ -226,3 +228,4 @@ props: {

var _hoisted_9$1 = {
class: "tiny-tree-node__content-right"
key: 0,
class: "tiny-tree-node__checked-mark"
};

@@ -234,6 +237,7 @@ var _hoisted_10$1 = ["title"];

function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
var _component_checkbox = resolveComponent("checkbox");
var _component_tiny_checkbox = resolveComponent("tiny-checkbox");
var _component_tiny_radio = resolveComponent("tiny-radio");
var _component_tiny_input = resolveComponent("tiny-input");
var _component_node_content = resolveComponent("node-content");
var _component_icon_finish = resolveComponent("icon-finish");
var _component_icon_edit = resolveComponent("icon-edit");

@@ -309,2 +313,3 @@ var _component_icon_minus_square = resolveComponent("icon-minus-square");

class: "tiny-tree-node__content-indent",
key: i,
style: normalizeStyle({

@@ -320,4 +325,4 @@ width: _ctx.state.computedIndent,

}),
256
/* UNKEYED_FRAGMENT */
128
/* KEYED_FRAGMENT */
)), createElementVNode("div", _hoisted_3$1, [$props.showNumber ? (openBlock(), createElementBlock(

@@ -334,27 +339,35 @@ "span",

},
[!$props.node.isLeaf ? (openBlock(), createElementBlock("span", {
key: 0,
class: "tree-node-icon",
onClick: _cache[0] || (_cache[0] = function($event) {
return _ctx.handleExpandIconClick($event, $props.node);
})
}, [_ctx.state.expandIcon !== void 0 && _ctx.state.shrinkIcon !== void 0 ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.state.expanded ? _ctx.state.shrinkIcon : _ctx.state.expandIcon), {
key: 0,
fill: _ctx.state.expanded ? _ctx.state.shrinkIconColor : _ctx.state.expandIconColor,
class: normalizeClass(["tiny-tree-node__expand-icon", {
"is-leaf": $props.node.isLeaf
}])
}, null, 8, ["fill", "class"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.state.computedExpandIcon), {
key: 1,
class: normalizeClass(["tiny-tree-node__expand-icon", {
"is-leaf": $props.node.isLeaf,
expanded: !$props.node.isLeaf && _ctx.state.expanded,
"is-saas-theme": _ctx.state.isSaaSTheme
}])
}, null, 8, ["class"]))])) : createCommentVNode("v-if", true)],
[!$props.node.isLeaf ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass(["tree-node-icon", {
"is-disabled": $props.node.disabled
}]),
onClick: _cache[0] || (_cache[0] = function($event) {
return _ctx.handleExpandIconClick($event, $props.node);
})
},
[_ctx.state.expandIcon !== void 0 && _ctx.state.shrinkIcon !== void 0 ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.state.expanded ? _ctx.state.shrinkIcon : _ctx.state.expandIcon), {
key: 0,
fill: _ctx.state.expanded ? _ctx.state.shrinkIconColor : _ctx.state.expandIconColor,
class: normalizeClass(["tiny-tree-node__expand-icon", {
"is-leaf": $props.node.isLeaf
}])
}, null, 8, ["fill", "class"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.state.computedExpandIcon), {
key: 1,
class: normalizeClass(["tiny-tree-node__expand-icon", {
"is-leaf": $props.node.isLeaf,
expanded: !$props.node.isLeaf && _ctx.state.expanded,
"is-saas-theme": _ctx.state.isSaaSTheme
}])
}, null, 8, ["class"]))],
2
/* CLASS */
)) : createCommentVNode("v-if", true)],
64
/* STABLE_FRAGMENT */
)), $props.showCheckbox ? (openBlock(), createBlock(_component_checkbox, {
)), $props.showCheckbox ? (openBlock(), createBlock(_component_tiny_checkbox, {
key: 2,
modelValue: $props.node.checked,
"model-value": $props.node.checked,
ref: "checkbox",

@@ -365,3 +378,3 @@ indeterminate: $props.node.indeterminate,

onChange: _ctx.handleCheckChange
}, null, 8, ["modelValue", "indeterminate", "disabled", "onChange"])) : createCommentVNode("v-if", true), $props.showRadio ? (openBlock(), createBlock(_component_tiny_radio, {
}, null, 8, ["model-value", "indeterminate", "disabled", "onChange"])) : createCommentVNode("v-if", true), $props.showRadio ? (openBlock(), createBlock(_component_tiny_radio, {
key: 3,

@@ -400,34 +413,44 @@ "model-value": $props.currentRadio.value,

node: $props.node
})]), createElementVNode("div", _hoisted_9$1, [renderSlot(_ctx.$slots, "operation", {
node: $props.node
}), $props.action.show ? (openBlock(), createElementBlock(
Fragment,
})]), createElementVNode(
"div",
{
key: 0
class: normalizeClass(["tiny-tree-node__content-right", {
"is-disabled": $props.node.disabled
}])
},
[createElementVNode("span", {
title: _ctx.t("ui.base.edit")
}, [!$props.action.deleteDisabled.includes($props.node.data[$props.nodeKey]) ? (openBlock(), createBlock(_component_icon_edit, {
key: 0,
onClick: _cache[6] || (_cache[6] = withModifiers(function($event) {
return _ctx.openEdit($props.node);
}, ["stop"]))
})) : createCommentVNode("v-if", true)], 8, _hoisted_10$1), createElementVNode("span", {
title: _ctx.t("ui.base.delete")
}, [!$props.action.editDisabled.includes($props.node.data[$props.nodeKey]) ? (openBlock(), createBlock(_component_icon_minus_square, {
key: 0,
onClick: _cache[7] || (_cache[7] = withModifiers(function($event) {
return _ctx.deleteNode($event, $props.node);
}, ["stop"]))
})) : createCommentVNode("v-if", true)], 8, _hoisted_11$1), createElementVNode("span", {
title: _ctx.t("ui.tree.newNodeTitle")
}, [!$props.node.data._isNewNode && !$props.action.addDisabled.includes($props.node.data[$props.nodeKey]) ? (openBlock(), createBlock(_component_icon_plus_square, {
key: 0,
onClick: _cache[8] || (_cache[8] = withModifiers(function($event) {
return _ctx.addNode($props.node);
}, ["stop"]))
})) : createCommentVNode("v-if", true)], 8, _hoisted_12$1)],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)])],
[$props.showCheckedMark && !$props.showCheckbox && !$props.node.disabled && $props.node.isCurrent ? (openBlock(), createElementBlock("span", _hoisted_9$1, [createVNode(_component_icon_finish)])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "operation", {
node: $props.node
}), $props.action.show ? (openBlock(), createElementBlock(
Fragment,
{
key: 1
},
[createElementVNode("span", {
title: _ctx.t("ui.tree.edit")
}, [!$props.action.editDisabled.includes($props.node.data[$props.nodeKey]) ? (openBlock(), createBlock(_component_icon_edit, {
key: 0,
onClick: _cache[6] || (_cache[6] = withModifiers(function($event) {
return _ctx.openEdit($props.node);
}, ["stop"]))
})) : createCommentVNode("v-if", true)], 8, _hoisted_10$1), createElementVNode("span", {
title: _ctx.t("ui.tree.delete")
}, [!$props.action.deleteDisabled.includes($props.node.data[$props.nodeKey]) ? (openBlock(), createBlock(_component_icon_minus_square, {
key: 0,
onClick: _cache[7] || (_cache[7] = withModifiers(function($event) {
return _ctx.deleteNode($event, $props.node);
}, ["stop"]))
})) : createCommentVNode("v-if", true)], 8, _hoisted_11$1), createElementVNode("span", {
title: _ctx.t("ui.tree.newNodeTitle")
}, [!$props.node.data._isNewNode && !$props.action.addDisabled.includes($props.node.data[$props.nodeKey]) ? (openBlock(), createBlock(_component_icon_plus_square, {
key: 0,
onClick: _cache[8] || (_cache[8] = withModifiers(function($event) {
return _ctx.addNode($props.node);
}, ["stop"]))
})) : createCommentVNode("v-if", true)], 8, _hoisted_12$1)],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)],
2
/* CLASS */
)],
6

@@ -478,2 +501,3 @@ /* CLASS, STYLE */

"node-height": $props.nodeHeight,
"show-checked-mark": $props.showCheckedMark,
key: _ctx.getNodeKey(child),

@@ -506,3 +530,3 @@ "node-key": $props.nodeKey,

/* DYNAMIC */
}, 1032, ["action", "show-radio", "theme", "current-radio", "render-content", "expand-icon", "shrink-icon", "expand-icon-color", "shrink-icon-color", "render-after-expand", "show-checkbox", "show-number", "node-height", "node-key", "check-easily", "node", "show-line", "onNodeExpand"]);
}, 1032, ["action", "show-radio", "theme", "current-radio", "render-content", "expand-icon", "shrink-icon", "expand-icon-color", "shrink-icon-color", "render-after-expand", "show-checkbox", "show-number", "node-height", "show-checked-mark", "node-key", "check-easily", "node", "show-line", "onNodeExpand"]);
}),

@@ -539,3 +563,3 @@ 128

}),
props: [].concat(props, ["data", "dataset", "parentKey", "expandIcon", "shrinkIcon", "expandIconColor", "shrinkIconColor", "emptyText", "renderAfterExpand", "nodeKey", "checkStrictly", "defaultExpandAll", "expandOnClickNode", "checkOnClickNode", "checkDescendants", "autoExpandParent", "defaultCheckedKeys", "defaultExpandedKeys", "defaultExpandedKeysHighlight", "currentNodeKey", "renderContent", "showCheckbox", "draggable", "allowDrag", "allowDrop", "props", "lazy", "highlightCurrent", "load", "filterNodeMethod", "accordion", "indent", "icon", "iconTriggerClickNode", "showRadio", "showContextmenu", "showNumber", "collapsible", "nodeHeight", "showCheckEasily", "size", "deleteDisabledKeys", "editDisabledKeys", "addDisabledKeys", "theme", "viewType", "showAuxi", "pathSplit", "filterPlainMethod", "afterLoad", "lazyCurrent", "baseIndent", "showLine"]),
props: [].concat(props, ["data", "dataset", "parentKey", "expandIcon", "shrinkIcon", "expandIconColor", "shrinkIconColor", "emptyText", "renderAfterExpand", "nodeKey", "checkStrictly", "defaultExpandAll", "expandOnClickNode", "checkOnClickNode", "checkDescendants", "autoExpandParent", "defaultCheckedKeys", "defaultExpandedKeys", "defaultExpandedKeysHighlight", "currentNodeKey", "renderContent", "showCheckbox", "draggable", "allowDrag", "allowDrop", "props", "lazy", "highlightCurrent", "load", "filterNodeMethod", "accordion", "indent", "icon", "iconTriggerClickNode", "showRadio", "showContextmenu", "showNumber", "collapsible", "nodeHeight", "showCheckEasily", "size", "deleteDisabledKeys", "editDisabledKeys", "addDisabledKeys", "theme", "viewType", "showAuxi", "pathSplit", "filterPlainMethod", "afterLoad", "lazyCurrent", "baseIndent", "showLine", "onlyCheckChildren", "deleteNodeMethod", "showCheckedMark", "willChangeView"]),
components: {

@@ -548,5 +572,6 @@ TreeNode,

TinyButton: Button,
TinySwitch: Switch
TinySwitch: Switch,
TinyRadio: Radio
},
emits: ["node-expand", "node-drag-leave", "check-change", "check", "node-drag-over", "node-drag-enter", "node-drag-start", "node-drag-end", "node-drop", "current-change", "node-click", "leave-plain-view", "check-plain"],
emits: ["node-expand", "check-change", "check", "node-drag-over", "node-drag-enter", "node-drag-leave", "node-drag-start", "node-drag-end", "node-drop", "current-change", "node-click", "leave-plain-view", "check-plain", "load-data", "open-edit", "close-edit", "save-edit", "add-node", "edit-node", "delete-node", "closeMenu"],
provide: function provide2() {

@@ -563,3 +588,6 @@ return {

renderless: renderless$1,
api: api$1
api: api$1,
extendOptions: {
isVue2
}
});

@@ -623,2 +651,3 @@ }

var _component_tiny_checkbox = resolveComponent("tiny-checkbox");
var _component_tiny_radio = resolveComponent("tiny-radio");
var _component_icon_mark_on = resolveComponent("icon-mark-on");

@@ -672,3 +701,4 @@ var _component_tiny_switch = resolveComponent("tiny-switch");

"check-easily": _ctx.state.checkEasily,
"show-line": _ctx.showLine
"show-line": _ctx.showLine,
"show-checked-mark": _ctx.showCheckedMark
}, {

@@ -692,3 +722,3 @@ prefix: withCtx(function(slotScoped) {

/* DYNAMIC */
}, 1032, ["action", "show-radio", "theme", "show-number", "collapsible", "node-height", "current-radio", "expand-icon", "shrink-icon", "expand-icon-color", "shrink-icon-color", "node", "props", "render-after-expand", "show-checkbox", "node-key", "render-content", "onNodeExpand", "check-easily", "show-line"]);
}, 1032, ["action", "show-radio", "theme", "show-number", "collapsible", "node-height", "current-radio", "expand-icon", "shrink-icon", "expand-icon-color", "shrink-icon-color", "node", "props", "render-after-expand", "show-checkbox", "node-key", "render-content", "onNodeExpand", "check-easily", "show-line", "show-checked-mark"]);
}),

@@ -706,4 +736,5 @@ 128

class: "tiny-tree__plain-node"
}, [createElementVNode("div", _hoisted_1, [createVNode(_component_tiny_checkbox, {
modelValue: plainNode.node.checked,
}, [createElementVNode("div", _hoisted_1, [_ctx.showCheckbox ? (openBlock(), createBlock(_component_tiny_checkbox, {
key: 0,
"model-value": plainNode.node.checked,
indeterminate: plainNode.node.indeterminate,

@@ -714,3 +745,15 @@ disabled: !!plainNode.node.disabled,

}
}, null, 8, ["modelValue", "indeterminate", "disabled", "onChange"]), renderSlot(_ctx.$slots, "prefix", {
}, null, 8, ["model-value", "indeterminate", "disabled", "onChange"])) : createCommentVNode("v-if", true), _ctx.showRadio ? (openBlock(), createBlock(_component_tiny_radio, {
key: 1,
modelValue: _ctx.state.currentRadio.value,
"onUpdate:modelValue": _cache[1] || (_cache[1] = function($event) {
return _ctx.state.currentRadio.value = $event;
}),
"validate-event": false,
label: plainNode.node.id,
disabled: !!plainNode.node.disabled,
onChange: function onChange($event) {
return _ctx.handleCheckPlainNode($event === plainNode.node.id, plainNode);
}
}, null, 8, ["modelValue", "label", "disabled", "onChange"])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "prefix", {
node: plainNode.node

@@ -749,3 +792,3 @@ }), renderSlot(_ctx.$slots, "default", {

_hoisted_6,
toDisplayString(_ctx.state.showEmptyText),
toDisplayString(_ctx.state.loaded ? _ctx.state.showEmptyText : _ctx.t("ui.tree.loading")),
1

@@ -764,3 +807,3 @@ /* TEXT */

modelValue: _ctx.state.checkEasily,
"onUpdate:modelValue": _cache[1] || (_cache[1] = function($event) {
"onUpdate:modelValue": _cache[2] || (_cache[2] = function($event) {
return _ctx.state.checkEasily = $event;

@@ -776,6 +819,7 @@ })

)];
})])])])) : createCommentVNode("v-if", true), createVNode(_component_tiny_popover, {
})])])])) : createCommentVNode("v-if", true), _ctx.state.action.show ? withDirectives((openBlock(), createBlock(_component_tiny_popover, {
key: 4,
ref: "deletePopover",
modelValue: _ctx.state.action.popoverVisible,
"onUpdate:modelValue": _cache[3] || (_cache[3] = function($event) {
"onUpdate:modelValue": _cache[4] || (_cache[4] = function($event) {
return _ctx.state.action.popoverVisible = $event;

@@ -793,3 +837,3 @@ }),

_hoisted_14,
toDisplayString(_ctx.t("ui.tree.deleteTip")),
toDisplayString(_ctx.t("ui.tree.preserveSubnodeTip")),
1

@@ -810,3 +854,3 @@ /* TEXT */

modelValue: _ctx.state.action.isSaveChildNode,
"onUpdate:modelValue": _cache[2] || (_cache[2] = function($event) {
"onUpdate:modelValue": _cache[3] || (_cache[3] = function($event) {
return _ctx.state.action.isSaveChildNode = $event;

@@ -857,3 +901,3 @@ }),

/* STABLE */
}, 8, ["modelValue", "width", "reference"])],
}, 8, ["modelValue", "width", "reference"])), [[vShow, _ctx.state.action.popoverVisible]]) : createCommentVNode("v-if", true)],
2

@@ -860,0 +904,0 @@ /* CLASS */

{
"name": "@opentiny/vue-tree",
"version": "3.12.0",
"version": "3.13.0-alpha.0",
"description": "",

@@ -10,12 +10,12 @@ "main": "./lib/index.js",

"dependencies": {
"@opentiny/vue-renderless": "~3.12.0",
"@opentiny/vue-common": "~3.12.0",
"@opentiny/vue-collapse-transition": "~3.12.0",
"@opentiny/vue-icon": "~3.12.0",
"@opentiny/vue-checkbox": "~3.12.0",
"@opentiny/vue-radio": "~3.12.0",
"@opentiny/vue-input": "~3.12.0",
"@opentiny/vue-switch": "~3.12.0",
"@opentiny/vue-popover": "~3.12.0",
"@opentiny/vue-button": "~3.12.0"
"@opentiny/vue-renderless": "~3.13.0-alpha.0",
"@opentiny/vue-common": "~3.13.0-alpha.0",
"@opentiny/vue-collapse-transition": "~3.13.0-alpha.0",
"@opentiny/vue-icon": "~3.13.0-alpha.0",
"@opentiny/vue-checkbox": "~3.13.0-alpha.0",
"@opentiny/vue-radio": "~3.13.0-alpha.0",
"@opentiny/vue-input": "~3.13.0-alpha.0",
"@opentiny/vue-switch": "~3.13.0-alpha.0",
"@opentiny/vue-popover": "~3.13.0-alpha.0",
"@opentiny/vue-button": "~3.13.0-alpha.0"
},

@@ -22,0 +22,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc