vueless 0.0.554 → 0.0.556
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/useUI.ts +28 -64
- package/constants.js +21 -2
- package/index.d.ts +8 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/types.ts +4 -10
- package/ui.button/UButton.vue +21 -7
- package/ui.button-link/ULink.vue +14 -2
- package/ui.button-link/config.ts +6 -1
- package/ui.button-link/useAttrs.ts +8 -39
- package/ui.button-toggle/useAttrs.ts +2 -8
- package/ui.button-toggle-item/config.ts +9 -11
- package/ui.button-toggle-item/useAttrs.ts +4 -18
- package/ui.container-accordion/config.ts +3 -1
- package/ui.container-accordion/useAttrs.ts +6 -17
- package/ui.container-card/UCard.vue +2 -1
- package/ui.container-card/useAttrs.ts +2 -8
- package/ui.container-col/useAttrs.ts +2 -8
- package/ui.container-divider/useAttrs.ts +2 -8
- package/ui.container-group/useAttrs.ts +2 -8
- package/ui.container-groups/useAttrs.ts +2 -8
- package/ui.container-modal/UModal.vue +1 -1
- package/ui.container-modal/useAttrs.ts +2 -12
- package/ui.container-modal-confirm/UModalConfirm.vue +3 -7
- package/ui.container-modal-confirm/useAttrs.ts +2 -8
- package/ui.container-page/UPage.vue +4 -5
- package/ui.container-page/useAttrs.ts +3 -32
- package/ui.container-row/useAttrs.ts +2 -8
- package/ui.data-list/UDataList.vue +3 -2
- package/ui.data-list/config.js +1 -1
- package/ui.data-list/useAttrs.js +2 -18
- package/ui.data-table/UTable.vue +6 -6
- package/ui.data-table/UTableRow.vue +1 -5
- package/ui.data-table/config.ts +28 -13
- package/ui.data-table/useAttrs.ts +10 -75
- package/ui.dropdown-badge/config.ts +10 -2
- package/ui.dropdown-badge/useAttrs.ts +8 -21
- package/ui.dropdown-button/config.ts +6 -6
- package/ui.dropdown-button/useAttrs.ts +6 -19
- package/ui.dropdown-link/config.ts +8 -2
- package/ui.dropdown-link/useAttrs.ts +10 -20
- package/ui.dropdown-list/config.ts +3 -2
- package/ui.dropdown-list/useAttrs.ts +2 -25
- package/ui.form-calendar/config.ts +36 -36
- package/ui.form-calendar/useAttrs.ts +2 -264
- package/ui.form-checkbox/useAttrs.ts +2 -8
- package/ui.form-checkbox-group/useAttrs.ts +2 -8
- package/ui.form-checkbox-multi-state/useAttrs.ts +2 -6
- package/ui.form-color-picker/useAttrs.js +2 -8
- package/ui.form-date-picker/useAttrs.ts +2 -6
- package/ui.form-date-picker-range/UDatePickerRange.vue +28 -28
- package/ui.form-date-picker-range/config.ts +30 -16
- package/ui.form-date-picker-range/useAttrs.ts +9 -70
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input/useAttrs.js +2 -8
- package/ui.form-input-file/UInputFile.vue +3 -4
- package/ui.form-input-file/useAttrs.js +2 -8
- package/ui.form-input-money/useAttrs.js +2 -8
- package/ui.form-input-number/useAttrs.js +2 -8
- package/ui.form-input-rating/UInputRating.vue +5 -11
- package/ui.form-input-rating/useAttrs.js +2 -8
- package/ui.form-input-search/useAttrs.js +2 -8
- package/ui.form-label/useAttrs.js +2 -8
- package/ui.form-radio/useAttrs.ts +2 -8
- package/ui.form-radio-group/useAttrs.ts +2 -8
- package/ui.form-select/USelect.vue +37 -38
- package/ui.form-select/config.js +30 -11
- package/ui.form-select/useAttrs.js +6 -50
- package/ui.form-switch/useAttrs.js +2 -8
- package/ui.form-textarea/UTextarea.vue +5 -9
- package/ui.form-textarea/useAttrs.js +2 -8
- package/ui.image-avatar/useAttrs.ts +2 -8
- package/ui.image-icon/useAttrs.ts +2 -8
- package/ui.loader/config.ts +4 -1
- package/ui.loader/useAttrs.ts +2 -17
- package/ui.loader-overlay/useAttrs.ts +2 -12
- package/ui.loader-progress/ULoaderProgress.vue +2 -2
- package/ui.loader-progress/config.ts +8 -2
- package/ui.loader-progress/types.ts +5 -0
- package/ui.loader-progress/useAttrs.ts +3 -27
- package/ui.navigation-pagination/config.ts +6 -6
- package/ui.navigation-pagination/useAttrs.ts +2 -34
- package/ui.navigation-progress/config.ts +3 -1
- package/ui.navigation-progress/useAttrs.ts +5 -17
- package/ui.navigation-tab/config.ts +3 -1
- package/ui.navigation-tab/useAttrs.ts +4 -18
- package/ui.navigation-tabs/useAttrs.ts +2 -8
- package/ui.other-dot/useAttrs.ts +2 -8
- package/ui.text-alert/UAlert.vue +2 -1
- package/ui.text-alert/useAttrs.ts +2 -8
- package/ui.text-badge/useAttrs.ts +3 -8
- package/ui.text-block/UText.vue +2 -1
- package/ui.text-block/useAttrs.ts +2 -8
- package/ui.text-empty/useAttrs.ts +2 -8
- package/ui.text-file/useAttrs.ts +2 -8
- package/ui.text-files/useAttrs.ts +2 -8
- package/ui.text-header/useAttrs.ts +2 -8
- package/ui.text-money/UMoney.vue +1 -1
- package/ui.text-money/useAttrs.ts +2 -8
- package/ui.text-notify/useAttrs.ts +2 -8
- package/utils/helper.ts +29 -0
- package/utils/node/tailwindSafelist.js +2 -2
- package/utils/ui.ts +3 -4
- package/web-types.json +17 -1
- package/ui.button/useAttrs.ts +0 -26
|
@@ -53,8 +53,10 @@
|
|
|
53
53
|
<script setup>
|
|
54
54
|
import { computed, onMounted, ref, watch, useSlots, useId } from "vue";
|
|
55
55
|
|
|
56
|
-
import ULabel from "../ui.form-label/ULabel.vue";
|
|
57
56
|
import { getDefault } from "../utils/ui.ts";
|
|
57
|
+
import { hasSlotContent } from "../utils/helper.ts";
|
|
58
|
+
|
|
59
|
+
import ULabel from "../ui.form-label/ULabel.vue";
|
|
58
60
|
|
|
59
61
|
import { UTextarea } from "./constants.js";
|
|
60
62
|
import defaultConfig from "./config.js";
|
|
@@ -232,14 +234,8 @@ const slots = useSlots();
|
|
|
232
234
|
|
|
233
235
|
const elementId = props.id || useId();
|
|
234
236
|
|
|
235
|
-
const {
|
|
236
|
-
|
|
237
|
-
textareaLabelAttrs,
|
|
238
|
-
textareaWrapperAttrs,
|
|
239
|
-
leftSlotAttrs,
|
|
240
|
-
rightSlotAttrs,
|
|
241
|
-
hasSlotContent,
|
|
242
|
-
} = useAttrs(props);
|
|
237
|
+
const { textareaAttrs, textareaLabelAttrs, textareaWrapperAttrs, leftSlotAttrs, rightSlotAttrs } =
|
|
238
|
+
useAttrs(props);
|
|
243
239
|
|
|
244
240
|
const textareaRef = ref(null);
|
|
245
241
|
const labelComponentRef = ref(null);
|
|
@@ -4,18 +4,12 @@ import useUI from "../composables/useUI.ts";
|
|
|
4
4
|
import defaultConfig from "./config.js";
|
|
5
5
|
|
|
6
6
|
export default function useAttrs(props) {
|
|
7
|
-
const { config, getKeysAttrs
|
|
7
|
+
const { config, getKeysAttrs } = useUI(defaultConfig, () => props.config);
|
|
8
8
|
|
|
9
9
|
const mutatedProps = computed(() => ({
|
|
10
10
|
error: Boolean(props.error),
|
|
11
11
|
label: Boolean(props.label),
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
config,
|
|
18
|
-
...keysAttrs,
|
|
19
|
-
hasSlotContent,
|
|
20
|
-
};
|
|
14
|
+
return { config, ...getKeysAttrs(mutatedProps) };
|
|
21
15
|
}
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UAvatarProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UAvatarProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UIconProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UIconProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
package/ui.loader/config.ts
CHANGED
|
@@ -16,7 +16,7 @@ export default /*tw*/ {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
ellipse: {
|
|
19
|
-
base: "absolute rounded-full bg-{color}-600 ease-[cubic-bezier(0,1,1,0)]",
|
|
19
|
+
base: "absolute rounded-full bg-{color}-600 ease-[cubic-bezier(0,1,1,0)] vueless-loader-ellipse",
|
|
20
20
|
variants: {
|
|
21
21
|
color: {
|
|
22
22
|
white: "bg-white",
|
|
@@ -30,6 +30,7 @@ export default /*tw*/ {
|
|
|
30
30
|
[&:nth-child(2)]:left-1
|
|
31
31
|
[&:nth-child(3)]:left-4
|
|
32
32
|
[&:nth-child(4)]:left-7
|
|
33
|
+
vueless-loader-ellipse-sm
|
|
33
34
|
`,
|
|
34
35
|
md: `
|
|
35
36
|
size-2.5
|
|
@@ -37,6 +38,7 @@ export default /*tw*/ {
|
|
|
37
38
|
[&:nth-child(2)]:left-1.5
|
|
38
39
|
[&:nth-child(3)]:left-6
|
|
39
40
|
[&:nth-child(4)]:left-[2.625rem]
|
|
41
|
+
vueless-loader-ellipse-md
|
|
40
42
|
`,
|
|
41
43
|
lg: `
|
|
42
44
|
size-4
|
|
@@ -44,6 +46,7 @@ export default /*tw*/ {
|
|
|
44
46
|
[&:nth-child(2)]:left-2
|
|
45
47
|
[&:nth-child(3)]:left-8
|
|
46
48
|
[&:nth-child(4)]:left-14
|
|
49
|
+
vueless-loader-ellipse-lg
|
|
47
50
|
`,
|
|
48
51
|
},
|
|
49
52
|
},
|
package/ui.loader/useAttrs.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import useUI from "../composables/useUI.ts";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.ts";
|
|
@@ -7,21 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
7
6
|
import type { ULoaderProps, Config } from "./types.ts";
|
|
8
7
|
|
|
9
8
|
export default function useAttrs(props: ULoaderProps): UseAttrs<Config> {
|
|
10
|
-
const { config, getKeysAttrs
|
|
11
|
-
defaultConfig,
|
|
12
|
-
() => props.config,
|
|
13
|
-
"loader",
|
|
14
|
-
);
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config, "loader");
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
ellipse: {
|
|
18
|
-
extend: computed(() => ["vueless-loader-ellipse", `vueless-loader-ellipse-${props.size}`]),
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
config,
|
|
24
|
-
...keysAttrs,
|
|
25
|
-
hasSlotContent,
|
|
26
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
27
12
|
}
|
|
@@ -6,17 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { ULoaderOverlayProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: ULoaderOverlayProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
10
|
-
defaultConfig,
|
|
11
|
-
() => props.config,
|
|
12
|
-
"overlay",
|
|
13
|
-
);
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config, "overlay");
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
config,
|
|
19
|
-
...keysAttrs,
|
|
20
|
-
hasSlotContent,
|
|
21
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
22
12
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { computed, onBeforeUnmount, watch, ref, onMounted, onUnmounted } from "vue";
|
|
3
3
|
|
|
4
4
|
import { getDefault } from "../utils/ui.ts";
|
|
5
|
-
import { isMobileApp } from "../utils/platform.ts";
|
|
6
5
|
import { clamp, queue, getRequestWithoutQuery } from "./utilLoaderProgress.ts";
|
|
7
6
|
import { useLoaderProgress } from "./useLoaderProgress.ts";
|
|
8
7
|
import useAttrs from "./useAttrs.ts";
|
|
@@ -16,6 +15,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
16
15
|
|
|
17
16
|
const props = withDefaults(defineProps<ULoaderProgressProps>(), {
|
|
18
17
|
color: getDefault<ULoaderProgressProps>(defaultConfig, ULoaderProgress).color,
|
|
18
|
+
size: getDefault<ULoaderProgressProps>(defaultConfig, ULoaderProgress).size,
|
|
19
19
|
loading: getDefault<ULoaderProgressProps>(defaultConfig, ULoaderProgress).loading,
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ const {
|
|
|
34
34
|
addRequestUrl,
|
|
35
35
|
} = useLoaderProgress();
|
|
36
36
|
|
|
37
|
-
const { stripeAttrs } = useAttrs(props
|
|
37
|
+
const { stripeAttrs } = useAttrs(props);
|
|
38
38
|
|
|
39
39
|
const isStarted = computed(() => {
|
|
40
40
|
return typeof status.value === "number";
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
stripe: {
|
|
3
|
-
base: "top-0 left-0 right-0 fixed
|
|
3
|
+
base: "top-0 left-0 right-0 fixed transition-all ease-linear bg-{color}-600",
|
|
4
4
|
variants: {
|
|
5
5
|
color: {
|
|
6
6
|
white: "bg-white",
|
|
7
7
|
grayscale: "bg-gray-900",
|
|
8
8
|
},
|
|
9
|
+
size: {
|
|
10
|
+
xs: "h-px",
|
|
11
|
+
sm: "h-0.5",
|
|
12
|
+
md: "h-[3px]",
|
|
13
|
+
lg: "h-1",
|
|
14
|
+
},
|
|
9
15
|
error: {
|
|
10
16
|
true: "bg-red-600",
|
|
11
17
|
},
|
|
12
18
|
},
|
|
13
19
|
},
|
|
14
|
-
stripeMobile: "",
|
|
15
20
|
defaults: {
|
|
16
21
|
color: "brand",
|
|
22
|
+
size: "md",
|
|
17
23
|
loading: false,
|
|
18
24
|
},
|
|
19
25
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import useUI from "../composables/useUI.ts";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.ts";
|
|
@@ -6,31 +5,8 @@ import defaultConfig from "./config.ts";
|
|
|
6
5
|
import type { UseAttrs } from "../types.ts";
|
|
7
6
|
import type { ULoaderProgressProps, Config } from "./types.ts";
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
8
|
+
export default function useAttrs(props: ULoaderProgressProps): UseAttrs<Config> {
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
props: ULoaderProgressProps,
|
|
15
|
-
{ isMobileApp }: ComponentState,
|
|
16
|
-
): UseAttrs<Config> {
|
|
17
|
-
const { config, getKeysAttrs, getExtendingKeysClasses, hasSlotContent } = useUI<Config>(
|
|
18
|
-
defaultConfig,
|
|
19
|
-
() => props.config,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const extendingKeys = ["stripeMobile"];
|
|
23
|
-
const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
|
|
24
|
-
|
|
25
|
-
const keysAttrs = getKeysAttrs({}, extendingKeys, {
|
|
26
|
-
stripe: {
|
|
27
|
-
extend: computed(() => [isMobileApp && extendingKeysClasses.linkWithChild.value]),
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
config,
|
|
33
|
-
...keysAttrs,
|
|
34
|
-
hasSlotContent,
|
|
35
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
36
12
|
}
|
|
@@ -8,12 +8,12 @@ export default /*tw*/ {
|
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
|
-
firstButton: "{UButton}",
|
|
12
|
-
lastButton: "{UButton}",
|
|
13
|
-
prevButton: "{UButton}",
|
|
14
|
-
nextButton: "{UButton}",
|
|
15
|
-
inactiveButton: "{UButton}",
|
|
16
|
-
activeButton: "{UButton}",
|
|
11
|
+
firstButton: "{UButton} {>paginationButton}",
|
|
12
|
+
lastButton: "{UButton} {>paginationButton}",
|
|
13
|
+
prevButton: "{UButton} {>paginationButton}",
|
|
14
|
+
nextButton: "{UButton} {>paginationButton}",
|
|
15
|
+
inactiveButton: "{UButton} {>paginationButton}",
|
|
16
|
+
activeButton: "{UButton} {>paginationButton}",
|
|
17
17
|
lastIcon: "{UIcon}",
|
|
18
18
|
firstIcon: "{UIcon}",
|
|
19
19
|
prevIcon: "{UIcon}",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
1
|
import useUI from "../composables/useUI.ts";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.js";
|
|
@@ -7,38 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
7
6
|
import type { UPaginationProps, Config } from "./types.ts";
|
|
8
7
|
|
|
9
8
|
export default function useAttrs(props: UPaginationProps): UseAttrs<Config> {
|
|
10
|
-
const { config, getKeysAttrs
|
|
11
|
-
defaultConfig,
|
|
12
|
-
() => props.config,
|
|
13
|
-
);
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
|
|
17
|
-
|
|
18
|
-
const keysAttrs = getKeysAttrs({}, extendingKeys, {
|
|
19
|
-
firstButton: {
|
|
20
|
-
base: computed(() => [extendingKeysClasses.paginationButton.value]),
|
|
21
|
-
},
|
|
22
|
-
lastButton: {
|
|
23
|
-
base: computed(() => [extendingKeysClasses.paginationButton.value]),
|
|
24
|
-
},
|
|
25
|
-
prevButton: {
|
|
26
|
-
base: computed(() => [extendingKeysClasses.paginationButton.value]),
|
|
27
|
-
},
|
|
28
|
-
nextButton: {
|
|
29
|
-
base: computed(() => [extendingKeysClasses.paginationButton.value]),
|
|
30
|
-
},
|
|
31
|
-
activeButton: {
|
|
32
|
-
base: computed(() => [extendingKeysClasses.paginationButton.value]),
|
|
33
|
-
},
|
|
34
|
-
inactiveButton: {
|
|
35
|
-
base: computed(() => [extendingKeysClasses.paginationButton.value]),
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
config,
|
|
41
|
-
...keysAttrs,
|
|
42
|
-
hasSlotContent,
|
|
43
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
44
12
|
}
|
|
@@ -78,7 +78,6 @@ export default /*tw*/ {
|
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
|
-
stepFirst: "text-gray-500",
|
|
82
81
|
step: {
|
|
83
82
|
base: "text-{color}-600 flex justify-end w-full transition",
|
|
84
83
|
variants: {
|
|
@@ -99,6 +98,9 @@ export default /*tw*/ {
|
|
|
99
98
|
xl: "text-xl",
|
|
100
99
|
"2xl": "text-2xl",
|
|
101
100
|
},
|
|
101
|
+
value: {
|
|
102
|
+
false: "text-gray-500",
|
|
103
|
+
},
|
|
102
104
|
},
|
|
103
105
|
},
|
|
104
106
|
defaults: {
|
|
@@ -7,23 +7,11 @@ import type { UseAttrs } from "../types.ts";
|
|
|
7
7
|
import type { UProgressProps, Config } from "./types.ts";
|
|
8
8
|
|
|
9
9
|
export default function useAttrs(props: UProgressProps): UseAttrs<Config> {
|
|
10
|
-
const { config, getKeysAttrs
|
|
11
|
-
defaultConfig,
|
|
12
|
-
() => props.config,
|
|
13
|
-
);
|
|
10
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
14
11
|
|
|
15
|
-
const
|
|
16
|
-
|
|
12
|
+
const mutatedProps = computed(() => ({
|
|
13
|
+
value: Boolean(props.value),
|
|
14
|
+
}));
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
step: {
|
|
20
|
-
base: computed(() => [!props.value && extendingKeysClasses.stepFirst.value]),
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
config,
|
|
26
|
-
...keysAttrs,
|
|
27
|
-
hasSlotContent,
|
|
28
|
-
};
|
|
16
|
+
return { config, ...getKeysAttrs(mutatedProps) };
|
|
29
17
|
}
|
|
@@ -10,9 +10,11 @@ export default /*tw*/ {
|
|
|
10
10
|
disabled: {
|
|
11
11
|
true: "text-gray-400 cursor-not-allowed",
|
|
12
12
|
},
|
|
13
|
+
selected: {
|
|
14
|
+
true: "border-b-2 text-brand-700 border-brand-700",
|
|
15
|
+
},
|
|
13
16
|
},
|
|
14
17
|
},
|
|
15
|
-
tabActive: "border-b-2 text-brand-700 border-brand-700",
|
|
16
18
|
defaults: {
|
|
17
19
|
size: "md",
|
|
18
20
|
disabled: false,
|
|
@@ -16,27 +16,13 @@ export default function useAttrs(
|
|
|
16
16
|
props: UTabProps,
|
|
17
17
|
{ selected, size }: ComponentState,
|
|
18
18
|
): UseAttrs<Config> {
|
|
19
|
-
const { config, getKeysAttrs
|
|
20
|
-
defaultConfig,
|
|
21
|
-
() => props.config,
|
|
22
|
-
);
|
|
19
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
23
20
|
|
|
24
21
|
const mutatedProps = computed(() => ({
|
|
25
22
|
size: size.value,
|
|
23
|
+
/* component state, not a props */
|
|
24
|
+
selected: selected.value,
|
|
26
25
|
}));
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
|
|
30
|
-
|
|
31
|
-
const keysAttrs = getKeysAttrs(mutatedProps, extendingKeys, {
|
|
32
|
-
tab: {
|
|
33
|
-
extend: computed(() => [selected.value && extendingKeysClasses.tabActive.value]),
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
config,
|
|
39
|
-
...keysAttrs,
|
|
40
|
-
hasSlotContent,
|
|
41
|
-
};
|
|
27
|
+
return { config, ...getKeysAttrs(mutatedProps) };
|
|
42
28
|
}
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UTabsProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UTabsProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
package/ui.other-dot/useAttrs.ts
CHANGED
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UDotProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UDotProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
package/ui.text-alert/UAlert.vue
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onMounted, ref, computed } from "vue";
|
|
3
|
+
|
|
3
4
|
import { getDefault } from "../utils/ui.ts";
|
|
5
|
+
import { hasSlotContent } from "../utils/helper.ts";
|
|
4
6
|
|
|
5
7
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
6
8
|
import UButton from "../ui.button/UButton.vue";
|
|
@@ -45,7 +47,6 @@ const {
|
|
|
45
47
|
closeButtonAttrs,
|
|
46
48
|
closeIconAttrs,
|
|
47
49
|
contentWrapperAttrs,
|
|
48
|
-
hasSlotContent,
|
|
49
50
|
} = useAttrs(props);
|
|
50
51
|
|
|
51
52
|
onMounted(() => {
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UAlertProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UAlertProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed, useSlots } from "vue";
|
|
2
2
|
import useUI from "../composables/useUI.ts";
|
|
3
|
+
import { hasSlotContent } from "../utils/helper.ts";
|
|
3
4
|
|
|
4
5
|
import defaultConfig from "./config.ts";
|
|
5
6
|
|
|
@@ -7,7 +8,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
7
8
|
import type { UBadgeProps, Config } from "./types.ts";
|
|
8
9
|
|
|
9
10
|
export default function useAttrs(props: UBadgeProps): UseAttrs<Config> {
|
|
10
|
-
const { config, getKeysAttrs
|
|
11
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
11
12
|
const slots = useSlots();
|
|
12
13
|
|
|
13
14
|
const mutatedProps = computed(() => ({
|
|
@@ -16,11 +17,5 @@ export default function useAttrs(props: UBadgeProps): UseAttrs<Config> {
|
|
|
16
17
|
rightIcon: Boolean(props.rightIcon) || hasSlotContent(slots["right"]),
|
|
17
18
|
}));
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
config,
|
|
23
|
-
...keysAttrs,
|
|
24
|
-
hasSlotContent,
|
|
25
|
-
};
|
|
20
|
+
return { config, ...getKeysAttrs(mutatedProps) };
|
|
26
21
|
}
|
package/ui.text-block/UText.vue
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { getDefault } from "../utils/ui.ts";
|
|
3
|
+
import { hasSlotContent } from "../utils/helper.ts";
|
|
3
4
|
|
|
4
5
|
import { UText } from "./constants.ts";
|
|
5
6
|
import defaultConfig from "./config.ts";
|
|
@@ -16,7 +17,7 @@ const props = withDefaults(defineProps<UTextProps>(), {
|
|
|
16
17
|
dataTest: "",
|
|
17
18
|
});
|
|
18
19
|
|
|
19
|
-
const { wrapperAttrs, htmlAttrs
|
|
20
|
+
const { wrapperAttrs, htmlAttrs } = useAttrs(props);
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
23
|
<template>
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UTextProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UTextProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UEmptyProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UEmptyProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
package/ui.text-file/useAttrs.ts
CHANGED
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UFileProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UFileProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UFilesProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UFilesProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
|
@@ -6,13 +6,7 @@ import type { UseAttrs } from "../types.ts";
|
|
|
6
6
|
import type { UHeaderProps, Config } from "./types.ts";
|
|
7
7
|
|
|
8
8
|
export default function useAttrs(props: UHeaderProps): UseAttrs<Config> {
|
|
9
|
-
const { config, getKeysAttrs
|
|
9
|
+
const { config, getKeysAttrs } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
config,
|
|
15
|
-
...keysAttrs,
|
|
16
|
-
hasSlotContent,
|
|
17
|
-
};
|
|
11
|
+
return { config, ...getKeysAttrs() };
|
|
18
12
|
}
|
package/ui.text-money/UMoney.vue
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
|
|
4
4
|
import { getDefault } from "../utils/ui.ts";
|
|
5
|
+
import { hasSlotContent } from "../utils/helper.ts";
|
|
5
6
|
|
|
6
7
|
import { UMoney } from "./constants.ts";
|
|
7
8
|
import defaultConfig from "./config.ts";
|
|
@@ -36,7 +37,6 @@ const {
|
|
|
36
37
|
slotLeftAttrs,
|
|
37
38
|
symbolAttrs,
|
|
38
39
|
slotRightAttrs,
|
|
39
|
-
hasSlotContent,
|
|
40
40
|
} = useAttrs(props);
|
|
41
41
|
|
|
42
42
|
const currencySymbolPosition = computed(() => {
|