x-prop-tree 0.8.33 → 0.8.34
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/index.js +31 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){try{document.getElementById(`x-prop-tree`)?.remove();const e = document.createElement(`style`);e.setAttribute(`id`, `x-prop-tree`);const t = document.createTextNode(``);e.appendChild(t);document.head.appendChild(e);}catch(e){console.error('rolldown-plugin-inject-css', e);}})()
|
|
2
2
|
import { n as isEqual, r as cloneDeep, t as omit } from "./vendor.mu9vrf3y.js";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, h, inject, isRef, mergeModels, mergeProps, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDirective, toDisplayString, unref, useId, useModel, useTemplateRef, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
4
|
-
import { eventBus, globalObjects, injectDark, injectLocale, openConfirmDlg, openNumberDlg, openPromptDlg, useColor, useSystem, useViewStack } from "x-essential-lib";
|
|
4
|
+
import { addView, delView, eventBus, globalObjects, hasView, injectDark, injectLocale, injectViews, openConfirmDlg, openNumberDlg, openPromptDlg, useColor, useSystem, useViewStack } from "x-essential-lib";
|
|
5
5
|
import { getElement, getItems, getPropertyDefault, getPropertyDefaultArray, getTag, getTypes, isHexColor, isThemeColor, makeSlotId, parseNumberUnit, pkgs, rules, themeColors, unwrapSlotId } from "x-runtime-lib";
|
|
6
6
|
import { getListEntry, setCollapse, tidyList } from "x-group-list";
|
|
7
7
|
import { useI18n } from "vue-i18n";
|
|
@@ -1774,6 +1774,7 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1774
1774
|
const { t } = useI18n();
|
|
1775
1775
|
const { sysBarAvail } = useSystem();
|
|
1776
1776
|
const { backgroundColor0, backgroundColor1, backgroundColor2 } = useColor();
|
|
1777
|
+
const views = injectViews();
|
|
1777
1778
|
const json = useModel(__props, "modelValue");
|
|
1778
1779
|
const emit = __emit;
|
|
1779
1780
|
const contStyle = computed(() => {
|
|
@@ -1785,8 +1786,21 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1785
1786
|
height: `calc(100% - ${h}px)`
|
|
1786
1787
|
};
|
|
1787
1788
|
});
|
|
1788
|
-
const { open } = useViewStack(`propTreejsonEditorDlg${useId()}`);
|
|
1789
1789
|
const editor = useTemplateRef("editor");
|
|
1790
|
+
const name = `propTreejsonEditorDlg${useId()}`;
|
|
1791
|
+
const open = ref(false);
|
|
1792
|
+
const view = computed({
|
|
1793
|
+
get() {
|
|
1794
|
+
return hasView(views, name);
|
|
1795
|
+
},
|
|
1796
|
+
set(val) {
|
|
1797
|
+
if (val) addView(views, name);
|
|
1798
|
+
else delView(views, name);
|
|
1799
|
+
}
|
|
1800
|
+
});
|
|
1801
|
+
function onOpen() {
|
|
1802
|
+
open.value = true;
|
|
1803
|
+
}
|
|
1790
1804
|
async function onClose() {
|
|
1791
1805
|
try {
|
|
1792
1806
|
const newJson = editor.value.save();
|
|
@@ -1800,14 +1814,27 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1800
1814
|
open.value = false;
|
|
1801
1815
|
}
|
|
1802
1816
|
}
|
|
1817
|
+
onMounted(() => {
|
|
1818
|
+
eventBus.on(name, onOpen);
|
|
1819
|
+
});
|
|
1820
|
+
onBeforeUnmount(() => {
|
|
1821
|
+
eventBus.off(name, onOpen);
|
|
1822
|
+
});
|
|
1823
|
+
watch(open, (val) => {
|
|
1824
|
+
view.value = val;
|
|
1825
|
+
});
|
|
1826
|
+
watch(view, async (val) => {
|
|
1827
|
+
if (!val) await onClose();
|
|
1828
|
+
open.value = val;
|
|
1829
|
+
});
|
|
1803
1830
|
return (_ctx, _cache) => {
|
|
1804
1831
|
const _component_v_btn = resolveComponent("v-btn");
|
|
1805
1832
|
const _component_v_sheet = resolveComponent("v-sheet");
|
|
1806
1833
|
const _component_v_spacer = resolveComponent("v-spacer");
|
|
1807
1834
|
const _component_v_dialog = resolveComponent("v-dialog");
|
|
1808
1835
|
return openBlock(), createBlock(_component_v_dialog, {
|
|
1809
|
-
modelValue:
|
|
1810
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) =>
|
|
1836
|
+
modelValue: open.value,
|
|
1837
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => open.value = $event),
|
|
1811
1838
|
attach: "",
|
|
1812
1839
|
fullscreen: "",
|
|
1813
1840
|
"no-click-animation": "",
|