@7365admin1/layer-common 3.2.2-staging.143 → 3.2.2-staging.145
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/components/SwitchContext.vue +55 -2
- package/package.json +1 -1
|
@@ -58,7 +58,41 @@
|
|
|
58
58
|
</v-list-item>
|
|
59
59
|
</v-list>
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
<!-- The two actions under the list. Seven applications hand-wrote this
|
|
62
|
+
same block, and all seven wrote `color="primary" size="large"` on a
|
|
63
|
+
filled button - `primary` is the design's FOREGROUND token, so the
|
|
64
|
+
fill was off-palette and 44px against the design's 40px. Stating it
|
|
65
|
+
once here means an application passes two labels instead of thirty
|
|
66
|
+
lines. Anything passed to #footer still overrides it wholesale. -->
|
|
67
|
+
<slot name="footer">
|
|
68
|
+
<v-row v-if="prop.manageLabel || prop.addLabel" no-gutters>
|
|
69
|
+
<v-col
|
|
70
|
+
v-if="prop.manageLabel"
|
|
71
|
+
cols="12"
|
|
72
|
+
:class="{ 'mb-2': prop.addLabel }"
|
|
73
|
+
>
|
|
74
|
+
<v-btn
|
|
75
|
+
block
|
|
76
|
+
variant="flat"
|
|
77
|
+
class="screen-btn-primary"
|
|
78
|
+
@click="emit('manage')"
|
|
79
|
+
>
|
|
80
|
+
{{ prop.manageLabel }}
|
|
81
|
+
</v-btn>
|
|
82
|
+
</v-col>
|
|
83
|
+
|
|
84
|
+
<v-col v-if="prop.addLabel" cols="12">
|
|
85
|
+
<v-btn
|
|
86
|
+
block
|
|
87
|
+
variant="flat"
|
|
88
|
+
class="screen-btn-primary"
|
|
89
|
+
@click="emit('add')"
|
|
90
|
+
>
|
|
91
|
+
{{ prop.addLabel }}
|
|
92
|
+
</v-btn>
|
|
93
|
+
</v-col>
|
|
94
|
+
</v-row>
|
|
95
|
+
</slot>
|
|
62
96
|
</v-card>
|
|
63
97
|
</v-menu>
|
|
64
98
|
</template>
|
|
@@ -85,6 +119,25 @@ const prop = defineProps({
|
|
|
85
119
|
required: false,
|
|
86
120
|
default: "",
|
|
87
121
|
},
|
|
122
|
+
/**
|
|
123
|
+
* The default #footer's two buttons. Each draws only when its label is a
|
|
124
|
+
* non-empty string, so an application that states neither gets the empty
|
|
125
|
+
* footer it has today, and one that states only `addLabel` gets one button.
|
|
126
|
+
* Deliberately opt-in by label rather than by a boolean: the wording differs
|
|
127
|
+
* per context ("Manage organization" / "Manage sites") and is not derivable
|
|
128
|
+
* from `title`, which is already "Organizations" in one place and "site" in
|
|
129
|
+
* the other.
|
|
130
|
+
*/
|
|
131
|
+
manageLabel: {
|
|
132
|
+
type: String,
|
|
133
|
+
required: false,
|
|
134
|
+
default: "",
|
|
135
|
+
},
|
|
136
|
+
addLabel: {
|
|
137
|
+
type: String,
|
|
138
|
+
required: false,
|
|
139
|
+
default: "",
|
|
140
|
+
},
|
|
88
141
|
});
|
|
89
142
|
|
|
90
143
|
const menu = defineModel<boolean>("menu", { required: false, default: false });
|
|
@@ -97,7 +150,7 @@ const search = defineModel<string>("search", {
|
|
|
97
150
|
default: "",
|
|
98
151
|
});
|
|
99
152
|
|
|
100
|
-
const emit = defineEmits(["search", "select"]);
|
|
153
|
+
const emit = defineEmits(["search", "select", "manage", "add"]);
|
|
101
154
|
|
|
102
155
|
const name = computed(() => {
|
|
103
156
|
return prop.items.find((item) => item.value === selected.value)?.text ?? "";
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "3.2.2-staging.
|
|
5
|
+
"version": "3.2.2-staging.145",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|