vueless 0.0.342 → 0.0.344
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/composables/useLocale.js +1 -1
- package/package.json +1 -1
- package/ui.dropdown-badge/config.js +1 -1
- package/ui.dropdown-button/UDropdownButton.vue +7 -2
- package/ui.dropdown-button/config.js +1 -1
- package/ui.dropdown-link/UDropdownLink.vue +7 -1
- package/ui.dropdown-link/config.js +1 -1
- package/ui.form-date-picker/UDatePicker.vue +2 -2
- package/ui.form-date-picker/storybook/Docs.mdx +1 -1
- package/web-types.json +1 -1
package/composables/useLocale.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: "relative inline-block",
|
|
3
3
|
dropdownBadge: "{UBadge}",
|
|
4
|
-
dropdownBadgeActive: "group",
|
|
4
|
+
dropdownBadgeActive: "group ring-dynamic ring-offset-dynamic ring-brand-700/15 border-brand-500 hover:border-brand-500",
|
|
5
5
|
dropdownIcon: "{UIcon} transition duration-300 group-[]:rotate-180",
|
|
6
6
|
dropdownList: {
|
|
7
7
|
component: "{UDropdownList}",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
|
|
53
53
|
<UDropdownList
|
|
54
54
|
v-if="isShownOptions"
|
|
55
|
+
ref="dropdownListRef"
|
|
55
56
|
v-model="selectedItem"
|
|
56
57
|
:size="size"
|
|
57
58
|
:options="options"
|
|
58
59
|
:value-key="valueKey"
|
|
59
60
|
:label-key="labelKey"
|
|
60
61
|
v-bind="dropdownListAttrs"
|
|
61
|
-
tabindex="-1"
|
|
62
62
|
:data-test="`${dataTest}-list`"
|
|
63
63
|
@click="onClickList"
|
|
64
64
|
/>
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
</template>
|
|
67
67
|
|
|
68
68
|
<script setup>
|
|
69
|
-
import { computed, provide, ref, watch, useId } from "vue";
|
|
69
|
+
import { nextTick, computed, provide, ref, watch, useId } from "vue";
|
|
70
70
|
|
|
71
71
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
72
72
|
import UButton from "../ui.button/UButton.vue";
|
|
@@ -237,6 +237,7 @@ provide("hideDropdownOptions", hideOptions);
|
|
|
237
237
|
|
|
238
238
|
const isShownOptions = ref(false);
|
|
239
239
|
const selectedItem = ref("");
|
|
240
|
+
const dropdownListRef = ref(null);
|
|
240
241
|
|
|
241
242
|
const elementId = props.id || useId();
|
|
242
243
|
|
|
@@ -266,6 +267,10 @@ watch(selectedItem, () => {
|
|
|
266
267
|
|
|
267
268
|
function onClickButton() {
|
|
268
269
|
isShownOptions.value = !isShownOptions.value;
|
|
270
|
+
|
|
271
|
+
if (isShownOptions.value) {
|
|
272
|
+
nextTick(() => dropdownListRef.value.wrapperRef.focus());
|
|
273
|
+
}
|
|
269
274
|
}
|
|
270
275
|
|
|
271
276
|
function hideOptions() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: "relative inline-block",
|
|
3
3
|
dropdownButton: "{UButton}",
|
|
4
|
-
dropdownButtonActive: "group",
|
|
4
|
+
dropdownButtonActive: "group ring-dynamic ring-offset-dynamic ring-brand-700/15 border-brand-500 hover:border-brand-500",
|
|
5
5
|
dropdownIcon: "{UIcon} transition duration-300 group-[]:rotate-180",
|
|
6
6
|
dropdownList: {
|
|
7
7
|
base: "{UDropdownList} w-fit",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
<UDropdownList
|
|
57
57
|
v-if="isShownOptions"
|
|
58
|
+
ref="dropdownListRef"
|
|
58
59
|
v-model="selectedItem"
|
|
59
60
|
:size="size"
|
|
60
61
|
:options="options"
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
</template>
|
|
69
70
|
|
|
70
71
|
<script setup>
|
|
71
|
-
import { computed, provide, ref, watch, useId } from "vue";
|
|
72
|
+
import { nextTick, computed, provide, ref, watch, useId } from "vue";
|
|
72
73
|
|
|
73
74
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
74
75
|
import ULink from "../ui.button-link/ULink.vue";
|
|
@@ -230,6 +231,7 @@ provide("hideDropdownOptions", hideOptions);
|
|
|
230
231
|
|
|
231
232
|
const isShownOptions = ref(false);
|
|
232
233
|
const selectedItem = ref("");
|
|
234
|
+
const dropdownListRef = ref(null);
|
|
233
235
|
|
|
234
236
|
const elementId = props.id || useId();
|
|
235
237
|
|
|
@@ -254,6 +256,10 @@ watch(selectedItem, () => {
|
|
|
254
256
|
|
|
255
257
|
function onClickLink() {
|
|
256
258
|
isShownOptions.value = !isShownOptions.value;
|
|
259
|
+
|
|
260
|
+
if (isShownOptions.value) {
|
|
261
|
+
nextTick(() => dropdownListRef.value.wrapperRef.focus());
|
|
262
|
+
}
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
function hideOptions() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: "relative inline-block",
|
|
3
3
|
dropdownLink: "{ULink}",
|
|
4
|
-
dropdownLinkActive: "group",
|
|
4
|
+
dropdownLinkActive: "group ring-dynamic ring-offset-4 ring-brand-700/15",
|
|
5
5
|
dropdownIcon: "{UIcon} block transition duration-300 group-[]:rotate-180",
|
|
6
6
|
dropdownList: {
|
|
7
7
|
base: "{UDropdownList} w-fit",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
:timepicker="timepicker"
|
|
49
49
|
:date-format="dateFormat"
|
|
50
50
|
:date-time-format="dateTimeFormat"
|
|
51
|
-
:user-date-format="
|
|
51
|
+
:user-date-format="userDateFormat"
|
|
52
52
|
:user-date-time-format="userDateTimeFormat"
|
|
53
53
|
:max-date="maxDate"
|
|
54
54
|
:min-date="minDate"
|
|
@@ -359,7 +359,7 @@ function onBlur(event) {
|
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
function formatUserDate(data) {
|
|
362
|
-
if (props.
|
|
362
|
+
if (props.userDateFormat !== STANDARD_USER_FORMAT || props.timepicker) return data;
|
|
363
363
|
|
|
364
364
|
let prefix = "";
|
|
365
365
|
const formattedDate = data.charAt(0).toUpperCase() + data.toLowerCase().slice(1);
|
|
@@ -16,7 +16,7 @@ import defaultConfig from "../config.js?raw"
|
|
|
16
16
|
<Source code={getSource(defaultConfig)} language="jsx" dark />
|
|
17
17
|
|
|
18
18
|
## Formatting tokens
|
|
19
|
-
Each character in the table below can be used in `dateFormat` and `
|
|
19
|
+
Each character in the table below can be used in `dateFormat` and `userDateFormat` / `userDateTimeFormat` options to achieve the format you need.
|
|
20
20
|
|
|
21
21
|
<Markdown>
|
|
22
22
|
{`
|