x-prop-tree 0.8.35 → 0.8.37
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.
|
@@ -4,10 +4,6 @@ import { t as __exportAll } from "./rolldown-runtime.c6i0pdwe.js";
|
|
|
4
4
|
var en_exports = /* @__PURE__ */ __exportAll({ default: () => en_default });
|
|
5
5
|
var en_default = { "x-prop-tree": {
|
|
6
6
|
copy: "Copy",
|
|
7
|
-
dlg: { saveChange: {
|
|
8
|
-
title: "Save Changes",
|
|
9
|
-
text: "Do you want to save the changes?"
|
|
10
|
-
} },
|
|
11
7
|
json: "JSON",
|
|
12
8
|
jsonEditor: "JSON Editor",
|
|
13
9
|
noAdaptSlot: "No Adapt Slot",
|
|
@@ -4,10 +4,6 @@ import { t as __exportAll } from "./rolldown-runtime.c6i0pdwe.js";
|
|
|
4
4
|
var zhHans_exports = /* @__PURE__ */ __exportAll({ default: () => zhHans_default });
|
|
5
5
|
var zhHans_default = { "x-prop-tree": {
|
|
6
6
|
copy: "拷贝",
|
|
7
|
-
dlg: { saveChange: {
|
|
8
|
-
title: "保存变化",
|
|
9
|
-
text: "你想要保存变化吗?"
|
|
10
|
-
} },
|
|
11
7
|
json: "JSON",
|
|
12
8
|
jsonEditor: "JSON编辑器",
|
|
13
9
|
noAdaptSlot: "没有适配插槽",
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
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,
|
|
4
|
+
import { eventBus, globalObjects, injectDark, injectLocale, 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
|
-
import { getListEntry, setCollapse, tidyList } from "x-group-list";
|
|
7
6
|
import { useI18n } from "vue-i18n";
|
|
8
7
|
import { globalState } from "x-state-lib";
|
|
9
8
|
import { useDisplay } from "vuetify";
|
|
@@ -96,7 +95,7 @@ function isCollapse(root, keys) {
|
|
|
96
95
|
}
|
|
97
96
|
return current.collapse;
|
|
98
97
|
}
|
|
99
|
-
function setCollapse
|
|
98
|
+
function setCollapse(root, keys, collapse) {
|
|
100
99
|
let current = root.value;
|
|
101
100
|
for (const key of keys) {
|
|
102
101
|
if (!current.children[key]) current.children[key] = {
|
|
@@ -664,7 +663,7 @@ var menu_default = index_vue_vue_type_script_setup_true_lang_default$17;
|
|
|
664
663
|
|
|
665
664
|
//#endregion
|
|
666
665
|
//#region src/components/title/index.vue?vue&type=script&setup=true&lang.ts
|
|
667
|
-
const _hoisted_1$
|
|
666
|
+
const _hoisted_1$14 = { style: { pointerEvents: "none" } };
|
|
668
667
|
var index_vue_vue_type_script_setup_true_lang_default$16 = /*@__PURE__*/ defineComponent({
|
|
669
668
|
__name: "index",
|
|
670
669
|
props: {
|
|
@@ -733,7 +732,7 @@ var index_vue_vue_type_script_setup_true_lang_default$16 = /*@__PURE__*/ defineC
|
|
|
733
732
|
class: "mr-1",
|
|
734
733
|
icon: __props.collapse ? "mdi-chevron-right" : "mdi-chevron-down"
|
|
735
734
|
}, null, 8, ["icon"]),
|
|
736
|
-
createElementVNode("span", _hoisted_1$
|
|
735
|
+
createElementVNode("span", _hoisted_1$14, toDisplayString(__props.title), 1),
|
|
737
736
|
createVNode(_component_v_spacer),
|
|
738
737
|
__props.hasCreate ? (openBlock(), createBlock(_component_v_btn, {
|
|
739
738
|
key: 0,
|
|
@@ -767,27 +766,28 @@ function useAdaptSlotList() {
|
|
|
767
766
|
const type = injectType();
|
|
768
767
|
const subtype = injectSubtype();
|
|
769
768
|
const { i18n } = globalObjects;
|
|
770
|
-
const adaptSlotList =
|
|
769
|
+
const adaptSlotList = {
|
|
770
|
+
groups: ref([]),
|
|
771
|
+
items: ref([]),
|
|
772
|
+
state: ref({})
|
|
773
|
+
};
|
|
771
774
|
provideAdaptSlotList(adaptSlotList);
|
|
772
|
-
|
|
773
|
-
|
|
775
|
+
function getLatest() {
|
|
776
|
+
const tmpGroups = [];
|
|
777
|
+
const tmpItems = [];
|
|
778
|
+
if (!version.value || !type.value || !subtype.value) return [tmpGroups, tmpItems];
|
|
774
779
|
const pkg = pkgs[version.value];
|
|
775
780
|
if (!pkg) {
|
|
776
781
|
console.assert(false, `invalid version=${version.value}`);
|
|
777
|
-
return [];
|
|
782
|
+
return [tmpGroups, tmpItems];
|
|
778
783
|
}
|
|
779
784
|
const tag = getTag(type.value, subtype.value);
|
|
780
|
-
const tmpSlotList = [];
|
|
781
785
|
for (let i = 0; i < pkg.groups[tag].length; i++) {
|
|
782
786
|
const group = pkg.groups[tag][i];
|
|
783
|
-
|
|
784
|
-
tmpSlotList.push({
|
|
787
|
+
tmpGroups.push({
|
|
785
788
|
id: group.key,
|
|
786
|
-
type: 0,
|
|
787
|
-
name: i18n.global.t(group.name),
|
|
788
789
|
position: i,
|
|
789
|
-
|
|
790
|
-
count: 0
|
|
790
|
+
name: i18n.global.t(group.name)
|
|
791
791
|
});
|
|
792
792
|
let pos = 0;
|
|
793
793
|
for (const item of group.items) {
|
|
@@ -798,28 +798,22 @@ function useAdaptSlotList() {
|
|
|
798
798
|
for (const slot of element.slots) {
|
|
799
799
|
const id = makeSlotId("elementSlot", element.key, slot.key);
|
|
800
800
|
const name = `${i18n.global.t(element.name)} / ${i18n.global.t(slot.name)}`;
|
|
801
|
-
|
|
801
|
+
tmpItems.push({
|
|
802
802
|
id,
|
|
803
|
-
type: 1,
|
|
804
|
-
name,
|
|
805
|
-
position: pos++,
|
|
806
803
|
group: group.key,
|
|
804
|
+
position: pos++,
|
|
805
|
+
name,
|
|
807
806
|
names: [element.name, slot.name]
|
|
808
807
|
});
|
|
809
808
|
}
|
|
810
809
|
}
|
|
811
810
|
}
|
|
812
811
|
const { activeApp, depends } = globalState.app;
|
|
813
|
-
for (const { id, name, position } of activeApp.compGroups) {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
name,
|
|
819
|
-
position,
|
|
820
|
-
collapse: last?.collapse ?? true
|
|
821
|
-
});
|
|
822
|
-
}
|
|
812
|
+
for (const { id, name, position } of activeApp.compGroups) tmpGroups.push({
|
|
813
|
+
id,
|
|
814
|
+
position,
|
|
815
|
+
name
|
|
816
|
+
});
|
|
823
817
|
let pos = 0;
|
|
824
818
|
for (const comp of activeApp.comps) {
|
|
825
819
|
const depend = depends[comp.id];
|
|
@@ -828,33 +822,34 @@ function useAdaptSlotList() {
|
|
|
828
822
|
for (const slot of depend.meta.slots) {
|
|
829
823
|
const id = makeSlotId("customSlot", comp.id, slot.id);
|
|
830
824
|
const name = `${comp.name} / ${slot.name}`;
|
|
831
|
-
|
|
825
|
+
tmpItems.push({
|
|
832
826
|
id,
|
|
833
|
-
type: 1,
|
|
834
|
-
name,
|
|
835
|
-
position: pos++,
|
|
836
827
|
group: comp.groupId,
|
|
828
|
+
position: pos++,
|
|
829
|
+
name,
|
|
837
830
|
names: [comp.name, slot.name]
|
|
838
831
|
});
|
|
839
832
|
}
|
|
840
833
|
}
|
|
841
|
-
return
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
834
|
+
return [tmpGroups, tmpItems];
|
|
835
|
+
}
|
|
836
|
+
function refresh() {
|
|
837
|
+
const [groups, items] = getLatest();
|
|
838
|
+
adaptSlotList.groups.value = groups;
|
|
839
|
+
adaptSlotList.items.value = items;
|
|
840
|
+
}
|
|
846
841
|
let handle;
|
|
847
|
-
|
|
842
|
+
function startTimer() {
|
|
848
843
|
clearTimeout(handle);
|
|
849
844
|
handle = window.setTimeout(() => {
|
|
850
845
|
refresh();
|
|
851
846
|
if (handle) startTimer();
|
|
852
847
|
}, 1e3);
|
|
853
|
-
}
|
|
854
|
-
|
|
848
|
+
}
|
|
849
|
+
function stopTimer() {
|
|
855
850
|
clearTimeout(handle);
|
|
856
851
|
handle = void 0;
|
|
857
|
-
}
|
|
852
|
+
}
|
|
858
853
|
onMounted(() => {
|
|
859
854
|
startTimer();
|
|
860
855
|
});
|
|
@@ -874,45 +869,45 @@ function useAdaptSlotList() {
|
|
|
874
869
|
//#endregion
|
|
875
870
|
//#region src/composables/compList/index.ts
|
|
876
871
|
function useCompList() {
|
|
877
|
-
const compList =
|
|
872
|
+
const compList = {
|
|
873
|
+
groups: ref([]),
|
|
874
|
+
items: ref([]),
|
|
875
|
+
state: ref({})
|
|
876
|
+
};
|
|
878
877
|
provideCompList(compList);
|
|
879
|
-
|
|
878
|
+
function refresh() {
|
|
879
|
+
const tmpGroups = [];
|
|
880
|
+
const tmpItems = [];
|
|
880
881
|
const { activeApp, depends } = globalState.app;
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
type: 0,
|
|
887
|
-
name,
|
|
888
|
-
position,
|
|
889
|
-
collapse: last?.collapse ?? true
|
|
890
|
-
});
|
|
891
|
-
}
|
|
882
|
+
for (const { id, name, position } of activeApp.compGroups) tmpGroups.push({
|
|
883
|
+
id,
|
|
884
|
+
position,
|
|
885
|
+
name
|
|
886
|
+
});
|
|
892
887
|
for (const { id, groupId: group, name, position } of activeApp.comps) {
|
|
893
888
|
if (!depends[id]) continue;
|
|
894
|
-
|
|
889
|
+
tmpItems.push({
|
|
895
890
|
id,
|
|
896
|
-
|
|
897
|
-
name,
|
|
891
|
+
group,
|
|
898
892
|
position,
|
|
899
|
-
|
|
893
|
+
name
|
|
900
894
|
});
|
|
901
895
|
}
|
|
902
|
-
compList.value =
|
|
903
|
-
|
|
896
|
+
compList.groups.value = tmpGroups;
|
|
897
|
+
compList.items.value = tmpItems;
|
|
898
|
+
}
|
|
904
899
|
let handle;
|
|
905
|
-
|
|
900
|
+
function startTimer() {
|
|
906
901
|
clearTimeout(handle);
|
|
907
902
|
handle = window.setTimeout(() => {
|
|
908
903
|
refresh();
|
|
909
904
|
if (handle) startTimer();
|
|
910
905
|
}, 1e3);
|
|
911
|
-
}
|
|
912
|
-
|
|
906
|
+
}
|
|
907
|
+
function stopTimer() {
|
|
913
908
|
clearTimeout(handle);
|
|
914
909
|
handle = void 0;
|
|
915
|
-
}
|
|
910
|
+
}
|
|
916
911
|
onMounted(() => {
|
|
917
912
|
startTimer();
|
|
918
913
|
});
|
|
@@ -960,117 +955,8 @@ function useSlotList() {
|
|
|
960
955
|
});
|
|
961
956
|
}
|
|
962
957
|
|
|
963
|
-
//#endregion
|
|
964
|
-
//#region src/components/values/adaptSlot/adaptSlotList/group.vue?vue&type=script&setup=true&lang.ts
|
|
965
|
-
const _hoisted_1$19 = { class: "text-label-large ml-1" };
|
|
966
|
-
const _hoisted_2$3 = { class: "text-body-small text-grey ml-1" };
|
|
967
|
-
var group_vue_vue_type_script_setup_true_lang_default$1 = /*@__PURE__*/ defineComponent({
|
|
968
|
-
__name: "group",
|
|
969
|
-
props: {
|
|
970
|
-
id: {
|
|
971
|
-
type: String,
|
|
972
|
-
required: true
|
|
973
|
-
},
|
|
974
|
-
title: {
|
|
975
|
-
type: String,
|
|
976
|
-
required: true
|
|
977
|
-
},
|
|
978
|
-
collapse: {
|
|
979
|
-
type: Boolean,
|
|
980
|
-
required: true
|
|
981
|
-
},
|
|
982
|
-
count: {
|
|
983
|
-
type: Number,
|
|
984
|
-
required: true
|
|
985
|
-
}
|
|
986
|
-
},
|
|
987
|
-
emits: ["x-click"],
|
|
988
|
-
setup(__props, { emit: __emit }) {
|
|
989
|
-
const { backgroundColor2, highlightColor } = useColor();
|
|
990
|
-
const emit = __emit;
|
|
991
|
-
const mouseOver = ref(false);
|
|
992
|
-
const style = computed(() => {
|
|
993
|
-
return {
|
|
994
|
-
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
995
|
-
height: "30px",
|
|
996
|
-
userSelect: "none"
|
|
997
|
-
};
|
|
998
|
-
});
|
|
999
|
-
return (_ctx, _cache) => {
|
|
1000
|
-
const _component_v_icon = resolveComponent("v-icon");
|
|
1001
|
-
const _directive_ripple = resolveDirective("ripple");
|
|
1002
|
-
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1003
|
-
class: "d-flex align-center cursor-pointer",
|
|
1004
|
-
style: normalizeStyle(style.value),
|
|
1005
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1006
|
-
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1007
|
-
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1008
|
-
}, [
|
|
1009
|
-
createVNode(_component_v_icon, {
|
|
1010
|
-
icon: __props.collapse ? "mdi-chevron-right" : "mdi-chevron-down",
|
|
1011
|
-
size: "small"
|
|
1012
|
-
}, null, 8, ["icon"]),
|
|
1013
|
-
createElementVNode("span", _hoisted_1$19, toDisplayString(__props.title), 1),
|
|
1014
|
-
createElementVNode("span", _hoisted_2$3, toDisplayString(__props.count), 1)
|
|
1015
|
-
], 36)), [[_directive_ripple]]);
|
|
1016
|
-
};
|
|
1017
|
-
}
|
|
1018
|
-
});
|
|
1019
|
-
|
|
1020
|
-
//#endregion
|
|
1021
|
-
//#region src/components/values/adaptSlot/adaptSlotList/group.vue
|
|
1022
|
-
var group_default$1 = group_vue_vue_type_script_setup_true_lang_default$1;
|
|
1023
|
-
|
|
1024
|
-
//#endregion
|
|
1025
|
-
//#region src/components/values/adaptSlot/adaptSlotList/item.vue?vue&type=script&setup=true&lang.ts
|
|
1026
|
-
const _hoisted_1$18 = { class: "text-body-large ml-6" };
|
|
1027
|
-
var item_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineComponent({
|
|
1028
|
-
__name: "item",
|
|
1029
|
-
props: {
|
|
1030
|
-
id: {
|
|
1031
|
-
type: String,
|
|
1032
|
-
required: true
|
|
1033
|
-
},
|
|
1034
|
-
title: {
|
|
1035
|
-
type: String,
|
|
1036
|
-
required: true
|
|
1037
|
-
}
|
|
1038
|
-
},
|
|
1039
|
-
emits: ["x-click"],
|
|
1040
|
-
setup(__props, { emit: __emit }) {
|
|
1041
|
-
const { backgroundColor2, highlightColor } = useColor();
|
|
1042
|
-
const emit = __emit;
|
|
1043
|
-
const mouseOver = ref(false);
|
|
1044
|
-
const style = computed(() => {
|
|
1045
|
-
return {
|
|
1046
|
-
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
1047
|
-
height: "48px",
|
|
1048
|
-
userSelect: "none"
|
|
1049
|
-
};
|
|
1050
|
-
});
|
|
1051
|
-
return (_ctx, _cache) => {
|
|
1052
|
-
const _directive_ripple = resolveDirective("ripple");
|
|
1053
|
-
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1054
|
-
class: "d-flex align-center cursor-pointer",
|
|
1055
|
-
style: normalizeStyle(style.value),
|
|
1056
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1057
|
-
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1058
|
-
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1059
|
-
}, [createElementVNode("span", _hoisted_1$18, toDisplayString(__props.title), 1)], 36)), [[_directive_ripple]]);
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
});
|
|
1063
|
-
|
|
1064
|
-
//#endregion
|
|
1065
|
-
//#region src/components/values/adaptSlot/adaptSlotList/item.vue
|
|
1066
|
-
var item_default$2 = item_vue_vue_type_script_setup_true_lang_default$2;
|
|
1067
|
-
|
|
1068
958
|
//#endregion
|
|
1069
959
|
//#region src/components/values/adaptSlot/adaptSlotList/index.vue?vue&type=script&setup=true&lang.ts
|
|
1070
|
-
const _hoisted_1$17 = {
|
|
1071
|
-
key: 1,
|
|
1072
|
-
class: "text-body-medium text-grey ml-3"
|
|
1073
|
-
};
|
|
1074
960
|
var index_vue_vue_type_script_setup_true_lang_default$15 = /*@__PURE__*/ defineComponent({
|
|
1075
961
|
__name: "index",
|
|
1076
962
|
props: {
|
|
@@ -1086,46 +972,25 @@ var index_vue_vue_type_script_setup_true_lang_default$15 = /*@__PURE__*/ defineC
|
|
|
1086
972
|
const open = useModel(__props, "open");
|
|
1087
973
|
const emit = __emit;
|
|
1088
974
|
const adaptSlotList = injectAdaptSlotList();
|
|
1089
|
-
const style = computed(() => {
|
|
1090
|
-
return {
|
|
1091
|
-
display: "flex",
|
|
1092
|
-
flexDirection: "column",
|
|
1093
|
-
gap: "1px"
|
|
1094
|
-
};
|
|
1095
|
-
});
|
|
1096
|
-
function onGroupClick(id) {
|
|
1097
|
-
const group = getListEntry(adaptSlotList, id);
|
|
1098
|
-
if (!group) return;
|
|
1099
|
-
setCollapse(adaptSlotList, id, !group.collapse);
|
|
1100
|
-
}
|
|
1101
975
|
function onItemClick(id) {
|
|
1102
976
|
open.value = false;
|
|
1103
977
|
emit("x-select", id);
|
|
1104
978
|
}
|
|
1105
979
|
return (_ctx, _cache) => {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
"count",
|
|
1121
|
-
"title"
|
|
1122
|
-
])) : createCommentVNode("v-if", true), item.type === 1 && item.show ? (openBlock(), createBlock(item_default$2, {
|
|
1123
|
-
key: 1,
|
|
1124
|
-
id: item.id,
|
|
1125
|
-
title: item.name,
|
|
1126
|
-
onXClick: onItemClick
|
|
1127
|
-
}, null, 8, ["id", "title"])) : createCommentVNode("v-if", true)], 64);
|
|
1128
|
-
}), 128))], 4)) : (openBlock(), createElementBlock("div", _hoisted_1$17, toDisplayString(unref(t)("x-prop-tree.noAdaptSlot")), 1));
|
|
980
|
+
const _component_x_group_list_lite = resolveComponent("x-group-list-lite");
|
|
981
|
+
return openBlock(), createBlock(_component_x_group_list_lite, {
|
|
982
|
+
state: unref(adaptSlotList).state,
|
|
983
|
+
"onUpdate:state": _cache[0] || (_cache[0] = ($event) => unref(adaptSlotList).state = $event),
|
|
984
|
+
groups: unref(adaptSlotList).groups,
|
|
985
|
+
items: unref(adaptSlotList).items,
|
|
986
|
+
"no-data": unref(t)("x-prop-tree.noAdaptSlot"),
|
|
987
|
+
onXItemClick: onItemClick
|
|
988
|
+
}, null, 8, [
|
|
989
|
+
"state",
|
|
990
|
+
"groups",
|
|
991
|
+
"items",
|
|
992
|
+
"no-data"
|
|
993
|
+
]);
|
|
1129
994
|
};
|
|
1130
995
|
}
|
|
1131
996
|
});
|
|
@@ -1136,7 +1001,7 @@ var adaptSlotList_default = index_vue_vue_type_script_setup_true_lang_default$15
|
|
|
1136
1001
|
|
|
1137
1002
|
//#endregion
|
|
1138
1003
|
//#region src/components/values/adaptSlot/index.vue?vue&type=script&setup=true&lang.ts
|
|
1139
|
-
const _hoisted_1$
|
|
1004
|
+
const _hoisted_1$13 = { class: "text-body-large" };
|
|
1140
1005
|
var index_vue_vue_type_script_setup_true_lang_default$14 = /*@__PURE__*/ defineComponent({
|
|
1141
1006
|
__name: "index",
|
|
1142
1007
|
props: /*@__PURE__*/ mergeModels({
|
|
@@ -1188,7 +1053,7 @@ var index_vue_vue_type_script_setup_true_lang_default$14 = /*@__PURE__*/ defineC
|
|
|
1188
1053
|
});
|
|
1189
1054
|
watchEffect(() => {
|
|
1190
1055
|
if (!adaptSlot.value) return;
|
|
1191
|
-
const item =
|
|
1056
|
+
const item = adaptSlotList.items.value.find((entry) => entry.id === adaptSlot.value.id);
|
|
1192
1057
|
if (item && !isEqual(item.names, adaptSlot.value.names)) adaptSlot.value = {
|
|
1193
1058
|
...adaptSlot.value,
|
|
1194
1059
|
names: cloneDeep(item.names)
|
|
@@ -1210,7 +1075,7 @@ var index_vue_vue_type_script_setup_true_lang_default$14 = /*@__PURE__*/ defineC
|
|
|
1210
1075
|
adaptSlot.value = null;
|
|
1211
1076
|
return;
|
|
1212
1077
|
}
|
|
1213
|
-
const item =
|
|
1078
|
+
const item = adaptSlotList.items.value.find((entry) => entry.id === id);
|
|
1214
1079
|
if (!item) {
|
|
1215
1080
|
adaptSlot.value = null;
|
|
1216
1081
|
return;
|
|
@@ -1271,7 +1136,7 @@ var index_vue_vue_type_script_setup_true_lang_default$14 = /*@__PURE__*/ defineC
|
|
|
1271
1136
|
icon: "mdi-close",
|
|
1272
1137
|
variant: "text",
|
|
1273
1138
|
onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
|
|
1274
|
-
}), createElementVNode("span", _hoisted_1$
|
|
1139
|
+
}), createElementVNode("span", _hoisted_1$13, toDisplayString(unref(t)("x-prop-tree.selectAdaptSlot")), 1)]),
|
|
1275
1140
|
_: 1
|
|
1276
1141
|
}),
|
|
1277
1142
|
createElementVNode("div", {
|
|
@@ -1293,117 +1158,8 @@ var index_vue_vue_type_script_setup_true_lang_default$14 = /*@__PURE__*/ defineC
|
|
|
1293
1158
|
//#region src/components/values/adaptSlot/index.vue
|
|
1294
1159
|
var adaptSlot_default = index_vue_vue_type_script_setup_true_lang_default$14;
|
|
1295
1160
|
|
|
1296
|
-
//#endregion
|
|
1297
|
-
//#region src/components/values/comp/compList/group.vue?vue&type=script&setup=true&lang.ts
|
|
1298
|
-
const _hoisted_1$15 = { class: "text-label-large ml-1" };
|
|
1299
|
-
const _hoisted_2$2 = { class: "text-body-small text-grey ml-1" };
|
|
1300
|
-
var group_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
1301
|
-
__name: "group",
|
|
1302
|
-
props: {
|
|
1303
|
-
id: {
|
|
1304
|
-
type: String,
|
|
1305
|
-
required: true
|
|
1306
|
-
},
|
|
1307
|
-
title: {
|
|
1308
|
-
type: String,
|
|
1309
|
-
required: true
|
|
1310
|
-
},
|
|
1311
|
-
collapse: {
|
|
1312
|
-
type: Boolean,
|
|
1313
|
-
required: true
|
|
1314
|
-
},
|
|
1315
|
-
count: {
|
|
1316
|
-
type: Number,
|
|
1317
|
-
required: true
|
|
1318
|
-
}
|
|
1319
|
-
},
|
|
1320
|
-
emits: ["x-click"],
|
|
1321
|
-
setup(__props, { emit: __emit }) {
|
|
1322
|
-
const { backgroundColor2, highlightColor } = useColor();
|
|
1323
|
-
const emit = __emit;
|
|
1324
|
-
const mouseOver = ref(false);
|
|
1325
|
-
const style = computed(() => {
|
|
1326
|
-
return {
|
|
1327
|
-
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
1328
|
-
height: "30px",
|
|
1329
|
-
userSelect: "none"
|
|
1330
|
-
};
|
|
1331
|
-
});
|
|
1332
|
-
return (_ctx, _cache) => {
|
|
1333
|
-
const _component_v_icon = resolveComponent("v-icon");
|
|
1334
|
-
const _directive_ripple = resolveDirective("ripple");
|
|
1335
|
-
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1336
|
-
class: "d-flex align-center cursor-pointer",
|
|
1337
|
-
style: normalizeStyle(style.value),
|
|
1338
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1339
|
-
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1340
|
-
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1341
|
-
}, [
|
|
1342
|
-
createVNode(_component_v_icon, {
|
|
1343
|
-
icon: __props.collapse ? "mdi-chevron-right" : "mdi-chevron-down",
|
|
1344
|
-
size: "small"
|
|
1345
|
-
}, null, 8, ["icon"]),
|
|
1346
|
-
createElementVNode("span", _hoisted_1$15, toDisplayString(__props.title), 1),
|
|
1347
|
-
createElementVNode("span", _hoisted_2$2, toDisplayString(__props.count), 1)
|
|
1348
|
-
], 36)), [[_directive_ripple]]);
|
|
1349
|
-
};
|
|
1350
|
-
}
|
|
1351
|
-
});
|
|
1352
|
-
|
|
1353
|
-
//#endregion
|
|
1354
|
-
//#region src/components/values/comp/compList/group.vue
|
|
1355
|
-
var group_default = group_vue_vue_type_script_setup_true_lang_default;
|
|
1356
|
-
|
|
1357
|
-
//#endregion
|
|
1358
|
-
//#region src/components/values/comp/compList/item.vue?vue&type=script&setup=true&lang.ts
|
|
1359
|
-
const _hoisted_1$14 = { class: "text-body-large ml-6" };
|
|
1360
|
-
var item_vue_vue_type_script_setup_true_lang_default$1 = /*@__PURE__*/ defineComponent({
|
|
1361
|
-
__name: "item",
|
|
1362
|
-
props: {
|
|
1363
|
-
id: {
|
|
1364
|
-
type: String,
|
|
1365
|
-
required: true
|
|
1366
|
-
},
|
|
1367
|
-
title: {
|
|
1368
|
-
type: String,
|
|
1369
|
-
required: true
|
|
1370
|
-
}
|
|
1371
|
-
},
|
|
1372
|
-
emits: ["x-click"],
|
|
1373
|
-
setup(__props, { emit: __emit }) {
|
|
1374
|
-
const { backgroundColor2, highlightColor } = useColor();
|
|
1375
|
-
const emit = __emit;
|
|
1376
|
-
const mouseOver = ref(false);
|
|
1377
|
-
const style = computed(() => {
|
|
1378
|
-
return {
|
|
1379
|
-
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
1380
|
-
height: "48px",
|
|
1381
|
-
userSelect: "none"
|
|
1382
|
-
};
|
|
1383
|
-
});
|
|
1384
|
-
return (_ctx, _cache) => {
|
|
1385
|
-
const _directive_ripple = resolveDirective("ripple");
|
|
1386
|
-
return withDirectives((openBlock(), createElementBlock("div", {
|
|
1387
|
-
class: "d-flex align-center cursor-pointer",
|
|
1388
|
-
style: normalizeStyle(style.value),
|
|
1389
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emit("x-click", __props.id)),
|
|
1390
|
-
onMouseout: _cache[1] || (_cache[1] = ($event) => mouseOver.value = false),
|
|
1391
|
-
onMouseover: _cache[2] || (_cache[2] = ($event) => mouseOver.value = true)
|
|
1392
|
-
}, [createElementVNode("span", _hoisted_1$14, toDisplayString(__props.title), 1)], 36)), [[_directive_ripple]]);
|
|
1393
|
-
};
|
|
1394
|
-
}
|
|
1395
|
-
});
|
|
1396
|
-
|
|
1397
|
-
//#endregion
|
|
1398
|
-
//#region src/components/values/comp/compList/item.vue
|
|
1399
|
-
var item_default$1 = item_vue_vue_type_script_setup_true_lang_default$1;
|
|
1400
|
-
|
|
1401
1161
|
//#endregion
|
|
1402
1162
|
//#region src/components/values/comp/compList/index.vue?vue&type=script&setup=true&lang.ts
|
|
1403
|
-
const _hoisted_1$13 = {
|
|
1404
|
-
key: 1,
|
|
1405
|
-
class: "text-body-medium text-grey ml-3"
|
|
1406
|
-
};
|
|
1407
1163
|
var index_vue_vue_type_script_setup_true_lang_default$13 = /*@__PURE__*/ defineComponent({
|
|
1408
1164
|
__name: "index",
|
|
1409
1165
|
props: {
|
|
@@ -1419,47 +1175,26 @@ var index_vue_vue_type_script_setup_true_lang_default$13 = /*@__PURE__*/ defineC
|
|
|
1419
1175
|
const open = useModel(__props, "open");
|
|
1420
1176
|
const emit = __emit;
|
|
1421
1177
|
const compList = injectCompList();
|
|
1422
|
-
const style = computed(() => {
|
|
1423
|
-
return {
|
|
1424
|
-
display: "flex",
|
|
1425
|
-
flexDirection: "column",
|
|
1426
|
-
gap: "1px"
|
|
1427
|
-
};
|
|
1428
|
-
});
|
|
1429
|
-
function onGroupClick(id) {
|
|
1430
|
-
const group = getListEntry(compList, id);
|
|
1431
|
-
if (!group) return;
|
|
1432
|
-
setCollapse(compList, id, !group.collapse);
|
|
1433
|
-
}
|
|
1434
1178
|
function onItemClick(id) {
|
|
1435
1179
|
open.value = false;
|
|
1436
1180
|
emit("x-select", id);
|
|
1437
1181
|
eventBus.emit("refreshDepends");
|
|
1438
1182
|
}
|
|
1439
1183
|
return (_ctx, _cache) => {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
"count",
|
|
1455
|
-
"title"
|
|
1456
|
-
])) : createCommentVNode("v-if", true), item.type === 1 && item.show ? (openBlock(), createBlock(item_default$1, {
|
|
1457
|
-
key: 1,
|
|
1458
|
-
id: item.id,
|
|
1459
|
-
title: item.name,
|
|
1460
|
-
onXClick: onItemClick
|
|
1461
|
-
}, null, 8, ["id", "title"])) : createCommentVNode("v-if", true)], 64);
|
|
1462
|
-
}), 128))], 4)) : (openBlock(), createElementBlock("div", _hoisted_1$13, toDisplayString(unref(t)("x-prop-tree.noComp")), 1));
|
|
1184
|
+
const _component_x_group_list_lite = resolveComponent("x-group-list-lite");
|
|
1185
|
+
return openBlock(), createBlock(_component_x_group_list_lite, {
|
|
1186
|
+
state: unref(compList).state,
|
|
1187
|
+
"onUpdate:state": _cache[0] || (_cache[0] = ($event) => unref(compList).state = $event),
|
|
1188
|
+
groups: unref(compList).groups,
|
|
1189
|
+
items: unref(compList).items,
|
|
1190
|
+
"no-data": unref(t)("x-prop-tree.noComp"),
|
|
1191
|
+
onXItemClick: onItemClick
|
|
1192
|
+
}, null, 8, [
|
|
1193
|
+
"state",
|
|
1194
|
+
"groups",
|
|
1195
|
+
"items",
|
|
1196
|
+
"no-data"
|
|
1197
|
+
]);
|
|
1463
1198
|
};
|
|
1464
1199
|
}
|
|
1465
1200
|
});
|
|
@@ -1522,7 +1257,7 @@ var index_vue_vue_type_script_setup_true_lang_default$12 = /*@__PURE__*/ defineC
|
|
|
1522
1257
|
});
|
|
1523
1258
|
watchEffect(() => {
|
|
1524
1259
|
if (!comp.value) return;
|
|
1525
|
-
const item =
|
|
1260
|
+
const item = compList.items.value.find((entry) => entry.id === comp.value.id);
|
|
1526
1261
|
if (item && item.name !== comp.value.name) comp.value = {
|
|
1527
1262
|
...comp.value,
|
|
1528
1263
|
name: item.name
|
|
@@ -1541,7 +1276,7 @@ var index_vue_vue_type_script_setup_true_lang_default$12 = /*@__PURE__*/ defineC
|
|
|
1541
1276
|
comp.value = null;
|
|
1542
1277
|
return;
|
|
1543
1278
|
}
|
|
1544
|
-
const item =
|
|
1279
|
+
const item = compList.items.value.find((entry) => entry.id === id);
|
|
1545
1280
|
if (!item) {
|
|
1546
1281
|
comp.value = null;
|
|
1547
1282
|
return;
|
|
@@ -1774,7 +1509,6 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1774
1509
|
const { t } = useI18n();
|
|
1775
1510
|
const { sysBarAvail } = useSystem();
|
|
1776
1511
|
const { backgroundColor0, backgroundColor1, backgroundColor2 } = useColor();
|
|
1777
|
-
injectViews();
|
|
1778
1512
|
const json = useModel(__props, "modelValue");
|
|
1779
1513
|
const emit = __emit;
|
|
1780
1514
|
const contStyle = computed(() => {
|
|
@@ -1787,20 +1521,10 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1787
1521
|
};
|
|
1788
1522
|
});
|
|
1789
1523
|
const editor = useTemplateRef("editor");
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
if (!await openConfirmDlg({
|
|
1795
|
-
title: t("x-prop-tree.dlg.saveChange.title"),
|
|
1796
|
-
text: t("x-prop-tree.dlg.saveChange.text")
|
|
1797
|
-
})) return;
|
|
1798
|
-
json.value = newJson;
|
|
1799
|
-
} finally {
|
|
1800
|
-
open.value = false;
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
const { open } = useViewStack(`propTreejsonEditorDlg${useId()}`, void 0, onClose);
|
|
1524
|
+
const { open } = useViewStack(`propTreejsonEditorDlg${useId()}`);
|
|
1525
|
+
watch(open, (val) => {
|
|
1526
|
+
if (!val) json.value = editor.value.save();
|
|
1527
|
+
});
|
|
1804
1528
|
return (_ctx, _cache) => {
|
|
1805
1529
|
const _component_v_btn = resolveComponent("v-btn");
|
|
1806
1530
|
const _component_v_sheet = resolveComponent("v-sheet");
|
|
@@ -1808,13 +1532,13 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1808
1532
|
const _component_v_dialog = resolveComponent("v-dialog");
|
|
1809
1533
|
return openBlock(), createBlock(_component_v_dialog, {
|
|
1810
1534
|
modelValue: unref(open),
|
|
1811
|
-
"onUpdate:modelValue": _cache[
|
|
1535
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = $event : null),
|
|
1812
1536
|
attach: "",
|
|
1813
1537
|
fullscreen: "",
|
|
1814
1538
|
"no-click-animation": "",
|
|
1815
1539
|
persistent: "",
|
|
1816
1540
|
transition: "dialog-bottom-transition",
|
|
1817
|
-
onKeydown: withKeys(withModifiers(
|
|
1541
|
+
onKeydown: _cache[3] || (_cache[3] = withKeys(withModifiers(($event) => open.value = false, ["stop", "prevent"]), ["esc"]))
|
|
1818
1542
|
}, {
|
|
1819
1543
|
activator: withCtx(({ props: activatorProps }) => [createVNode(_component_v_btn, mergeProps(activatorProps, {
|
|
1820
1544
|
block: "",
|
|
@@ -1852,7 +1576,7 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1852
1576
|
density: "comfortable",
|
|
1853
1577
|
icon: "mdi-close",
|
|
1854
1578
|
variant: "text",
|
|
1855
|
-
onClick:
|
|
1579
|
+
onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
|
|
1856
1580
|
}),
|
|
1857
1581
|
createElementVNode("span", _hoisted_1$10, toDisplayString(unref(t)("x-prop-tree.jsonEditor")), 1),
|
|
1858
1582
|
createVNode(_component_v_spacer)
|
|
@@ -1868,7 +1592,7 @@ var index_vue_vue_type_script_setup_true_lang_default$10 = /*@__PURE__*/ defineC
|
|
|
1868
1592
|
_: 1
|
|
1869
1593
|
}, 8, ["color"])]),
|
|
1870
1594
|
_: 1
|
|
1871
|
-
}, 8, ["modelValue"
|
|
1595
|
+
}, 8, ["modelValue"]);
|
|
1872
1596
|
};
|
|
1873
1597
|
}
|
|
1874
1598
|
});
|
|
@@ -3273,7 +2997,7 @@ var main_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
3273
2997
|
collapse: isCollapse(collapseState, keys),
|
|
3274
2998
|
hasCreate: true,
|
|
3275
2999
|
onCollapse: (val) => {
|
|
3276
|
-
setCollapse
|
|
3000
|
+
setCollapse(collapseState, keys, val);
|
|
3277
3001
|
},
|
|
3278
3002
|
onMenu: (x, y) => {
|
|
3279
3003
|
eventBus.emit("propTreeMenu", {
|
|
@@ -3302,7 +3026,7 @@ var main_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
3302
3026
|
hasDelete: true,
|
|
3303
3027
|
index: i,
|
|
3304
3028
|
onCollapse: (val) => {
|
|
3305
|
-
setCollapse
|
|
3029
|
+
setCollapse(collapseState, [...keys, i], val);
|
|
3306
3030
|
},
|
|
3307
3031
|
onMenu: (x, y) => {
|
|
3308
3032
|
eventBus.emit("propTreeMenu", {
|
|
@@ -3346,7 +3070,7 @@ var main_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
3346
3070
|
collapse: isCollapse(collapseState, keys),
|
|
3347
3071
|
hasDelete: arrayIndex !== void 0 && !isBranch,
|
|
3348
3072
|
onCollapse: (val) => {
|
|
3349
|
-
setCollapse
|
|
3073
|
+
setCollapse(collapseState, keys, val);
|
|
3350
3074
|
},
|
|
3351
3075
|
onMenu: (x, y) => {
|
|
3352
3076
|
eventBus.emit("propTreeMenu", {
|
|
@@ -3393,7 +3117,7 @@ var main_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
3393
3117
|
collapse: isCollapse(collapseState, keys),
|
|
3394
3118
|
hasCreate: true,
|
|
3395
3119
|
onCollapse: (val) => {
|
|
3396
|
-
setCollapse
|
|
3120
|
+
setCollapse(collapseState, keys, val);
|
|
3397
3121
|
},
|
|
3398
3122
|
onMenu: (x, y) => {
|
|
3399
3123
|
eventBus.emit("propTreeMenu", {
|
|
@@ -3559,8 +3283,8 @@ const install = (app) => {
|
|
|
3559
3283
|
//#endregion
|
|
3560
3284
|
//#region src/i18n/index.ts
|
|
3561
3285
|
async function loadLocaleMessagePropTree(locale) {
|
|
3562
|
-
if (locale === "en") return (await import("./i18n-en.
|
|
3563
|
-
else if (locale === "zhHans") return (await import("./i18n-zhHans.
|
|
3286
|
+
if (locale === "en") return (await import("./i18n-en.fevhb1gv.js").then((n) => n.t)).default;
|
|
3287
|
+
else if (locale === "zhHans") return (await import("./i18n-zhHans.cro9uz6i.js").then((n) => n.t)).default;
|
|
3564
3288
|
else throw new Error(`invalid locale=${locale}`);
|
|
3565
3289
|
}
|
|
3566
3290
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-prop-tree",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.37",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"vuetify": "^4.2.1",
|
|
46
46
|
"x-block-lib": "^0.11.11",
|
|
47
47
|
"x-error-lib": "^0.6.5",
|
|
48
|
-
"x-essential-lib": "^0.10.
|
|
49
|
-
"x-group-list": "^0.
|
|
48
|
+
"x-essential-lib": "^0.10.43",
|
|
49
|
+
"x-group-list": "^0.5.0",
|
|
50
50
|
"x-runtime-lib": "^0.10.5",
|
|
51
51
|
"x-state-lib": "^0.4.5"
|
|
52
52
|
}
|