@shwfed/nuxt 0.10.11 → 0.10.12
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/module.json
CHANGED
|
@@ -43,7 +43,7 @@ const open = defineModel("open", { type: Boolean, ...{
|
|
|
43
43
|
const { $toast } = useNuxtApp();
|
|
44
44
|
const { t } = useI18n();
|
|
45
45
|
const search = ref("");
|
|
46
|
-
const draftGap = ref(props.config.gap ??
|
|
46
|
+
const draftGap = ref(props.config.gap ?? 4);
|
|
47
47
|
const draftStyle = ref(props.config.style);
|
|
48
48
|
const selectedItemId = ref("general");
|
|
49
49
|
const draftTree = ref(buildButtonConfiguratorTree(props.config.groups));
|
|
@@ -90,7 +90,6 @@ const selectedNode = computed(() => {
|
|
|
90
90
|
const selectedGroup = computed(() => selectedNode.value?.item.type === "group" ? selectedNode.value.item : void 0);
|
|
91
91
|
const selectedButton = computed(() => selectedNode.value?.item.type === "button" ? selectedNode.value.item : void 0);
|
|
92
92
|
const selectedDropdown = computed(() => selectedNode.value?.item.type === "dropdown" ? selectedNode.value.item : void 0);
|
|
93
|
-
const selectedNodeItemId = computed(() => selectedNode.value?.itemId ?? "");
|
|
94
93
|
const selectedParentNodeId = computed(() => {
|
|
95
94
|
const parentItemId = selectedNode.value?.parentItemId;
|
|
96
95
|
if (!parentItemId) {
|
|
@@ -247,7 +246,7 @@ function getNodeLabel(item) {
|
|
|
247
246
|
return getZhText(item.title) ?? t(item.type === "button" ? "untitled-button" : "untitled-dropdown");
|
|
248
247
|
}
|
|
249
248
|
function applyDraftConfig(config) {
|
|
250
|
-
draftGap.value = config.gap ??
|
|
249
|
+
draftGap.value = config.gap ?? 4;
|
|
251
250
|
draftStyle.value = config.style;
|
|
252
251
|
draftTree.value = buildButtonConfiguratorTree(config.groups);
|
|
253
252
|
validationErrors.value = {};
|
|
@@ -882,18 +881,7 @@ function confirmChanges() {
|
|
|
882
881
|
v-else-if="selectedGroup"
|
|
883
882
|
data-slot="button-configurator-group"
|
|
884
883
|
class="mt-6 grid gap-4"
|
|
885
|
-
|
|
886
|
-
<Button
|
|
887
|
-
type="button"
|
|
888
|
-
variant="ghost"
|
|
889
|
-
data-slot="button-configurator-delete-selected"
|
|
890
|
-
class="justify-start text-red-600 hover:bg-red-50 hover:text-red-700"
|
|
891
|
-
@click="deleteItem(selectedNodeItemId)"
|
|
892
|
-
>
|
|
893
|
-
<Icon icon="fluent:delete-20-regular" />
|
|
894
|
-
{{ t("delete-group") }}
|
|
895
|
-
</Button>
|
|
896
|
-
</section>
|
|
884
|
+
/>
|
|
897
885
|
|
|
898
886
|
<section
|
|
899
887
|
v-else-if="selectedButton"
|
|
@@ -980,17 +968,6 @@ function confirmChanges() {
|
|
|
980
968
|
/>
|
|
981
969
|
<span class="text-sm text-zinc-700">{{ t("button-hide-title") }}</span>
|
|
982
970
|
</label>
|
|
983
|
-
|
|
984
|
-
<Button
|
|
985
|
-
type="button"
|
|
986
|
-
variant="ghost"
|
|
987
|
-
data-slot="button-configurator-delete-selected"
|
|
988
|
-
class="justify-start text-red-600 hover:bg-red-50 hover:text-red-700"
|
|
989
|
-
@click="deleteItem(selectedNodeItemId)"
|
|
990
|
-
>
|
|
991
|
-
<Icon icon="fluent:delete-20-regular" />
|
|
992
|
-
{{ t("delete-button") }}
|
|
993
|
-
</Button>
|
|
994
971
|
</section>
|
|
995
972
|
|
|
996
973
|
<section
|
|
@@ -1032,17 +1009,6 @@ function confirmChanges() {
|
|
|
1032
1009
|
</NativeSelectOption>
|
|
1033
1010
|
</NativeSelect>
|
|
1034
1011
|
</label>
|
|
1035
|
-
|
|
1036
|
-
<Button
|
|
1037
|
-
type="button"
|
|
1038
|
-
variant="ghost"
|
|
1039
|
-
data-slot="button-configurator-delete-selected"
|
|
1040
|
-
class="justify-start text-red-600 hover:bg-red-50 hover:text-red-700"
|
|
1041
|
-
@click="deleteItem(selectedNodeItemId)"
|
|
1042
|
-
>
|
|
1043
|
-
<Icon icon="fluent:delete-20-regular" />
|
|
1044
|
-
{{ t("delete-dropdown") }}
|
|
1045
|
-
</Button>
|
|
1046
1012
|
</section>
|
|
1047
1013
|
|
|
1048
1014
|
<section
|
|
@@ -1099,43 +1065,50 @@ function confirmChanges() {
|
|
|
1099
1065
|
</section>
|
|
1100
1066
|
</div>
|
|
1101
1067
|
|
|
1102
|
-
<DialogFooter class="border-t border-zinc-200 px-6 py-4">
|
|
1103
|
-
<
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
data-slot="button-configurator-copy-markdown"
|
|
1107
|
-
@click="void copyMarkdown()"
|
|
1108
|
-
>
|
|
1109
|
-
<Icon icon="fluent:document-one-page-20-regular" />
|
|
1110
|
-
{{ t("copy-markdown") }}
|
|
1111
|
-
</Button>
|
|
1112
|
-
<Button
|
|
1113
|
-
type="button"
|
|
1114
|
-
variant="ghost"
|
|
1115
|
-
data-slot="button-configurator-copy-config"
|
|
1116
|
-
@click="void copyConfig()"
|
|
1117
|
-
>
|
|
1118
|
-
<Icon icon="fluent:code-text-20-regular" />
|
|
1119
|
-
{{ t("copy-config") }}
|
|
1120
|
-
</Button>
|
|
1121
|
-
<Button
|
|
1122
|
-
type="button"
|
|
1123
|
-
variant="default"
|
|
1124
|
-
data-slot="button-configurator-cancel"
|
|
1125
|
-
@click="open = false"
|
|
1068
|
+
<DialogFooter class="border-t border-zinc-200 px-6 py-4 sm:justify-between">
|
|
1069
|
+
<div
|
|
1070
|
+
data-slot="button-configurator-copy-actions"
|
|
1071
|
+
class="flex items-center gap-2"
|
|
1126
1072
|
>
|
|
1127
|
-
<
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
<
|
|
1137
|
-
|
|
1138
|
-
|
|
1073
|
+
<Button
|
|
1074
|
+
type="button"
|
|
1075
|
+
variant="ghost"
|
|
1076
|
+
data-slot="button-configurator-copy-markdown"
|
|
1077
|
+
@click="void copyMarkdown()"
|
|
1078
|
+
>
|
|
1079
|
+
<Icon icon="simple-icons:markdown" />
|
|
1080
|
+
{{ t("copy-markdown") }}
|
|
1081
|
+
</Button>
|
|
1082
|
+
<Button
|
|
1083
|
+
type="button"
|
|
1084
|
+
variant="ghost"
|
|
1085
|
+
data-slot="button-configurator-copy-config"
|
|
1086
|
+
@click="void copyConfig()"
|
|
1087
|
+
>
|
|
1088
|
+
<Icon icon="fluent:copy-20-regular" />
|
|
1089
|
+
{{ t("copy-config") }}
|
|
1090
|
+
</Button>
|
|
1091
|
+
</div>
|
|
1092
|
+
<div class="flex items-center gap-2">
|
|
1093
|
+
<Button
|
|
1094
|
+
type="button"
|
|
1095
|
+
variant="default"
|
|
1096
|
+
data-slot="button-configurator-cancel"
|
|
1097
|
+
@click="open = false"
|
|
1098
|
+
>
|
|
1099
|
+
<Icon icon="fluent:dismiss-20-regular" />
|
|
1100
|
+
{{ t("cancel") }}
|
|
1101
|
+
</Button>
|
|
1102
|
+
<Button
|
|
1103
|
+
type="button"
|
|
1104
|
+
variant="primary"
|
|
1105
|
+
data-slot="button-configurator-confirm"
|
|
1106
|
+
@click="confirmChanges"
|
|
1107
|
+
>
|
|
1108
|
+
<Icon icon="fluent:checkmark-20-regular" />
|
|
1109
|
+
{{ t("confirm") }}
|
|
1110
|
+
</Button>
|
|
1111
|
+
</div>
|
|
1139
1112
|
</DialogFooter>
|
|
1140
1113
|
</DialogContent>
|
|
1141
1114
|
</Dialog>
|
|
@@ -23,7 +23,7 @@ const props = defineProps({
|
|
|
23
23
|
});
|
|
24
24
|
const emit = defineEmits(["update:config"]);
|
|
25
25
|
const defaultConfig = {
|
|
26
|
-
gap:
|
|
26
|
+
gap: 4,
|
|
27
27
|
groups: []
|
|
28
28
|
};
|
|
29
29
|
const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;
|
|
@@ -80,7 +80,7 @@ function getConfigStyle(config) {
|
|
|
80
80
|
return style;
|
|
81
81
|
}
|
|
82
82
|
const rootStyle = computed(() => ({
|
|
83
|
-
gap: `calc(${displayConfig.value.gap ?? defaultConfig.gap ??
|
|
83
|
+
gap: `calc(${displayConfig.value.gap ?? defaultConfig.gap ?? 4} * 0.25rem)`,
|
|
84
84
|
...getConfigStyle(displayConfig.value)
|
|
85
85
|
}));
|
|
86
86
|
function getButtonLabel(button) {
|