vueless 1.2.15-beta.2 → 1.2.15-beta.3
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/bin/commands/copy.js +1 -1
- package/composables/tests/useUI.test.ts +1 -1
- package/composables/useBreakpoint.ts +1 -1
- package/composables/useUI.ts +1 -5
- package/constants.d.ts +1 -1
- package/constants.js +1 -1
- package/index.d.ts +3 -3
- package/index.ts +3 -3
- package/package.json +1 -1
- package/types.ts +2 -2
- package/ui.boilerplate/UBoilerplate.vue +1 -1
- package/ui.button/UButton.vue +1 -1
- package/ui.button-link/ULink.vue +1 -1
- package/ui.button-toggle/UToggle.vue +1 -1
- package/ui.container-accordion/UAccordion.vue +1 -1
- package/ui.container-accordion-item/UAccordionItem.vue +1 -1
- package/ui.container-card/UCard.vue +1 -1
- package/ui.container-col/UCol.vue +1 -1
- package/ui.container-divider/UDivider.vue +1 -1
- package/ui.container-drawer/UDrawer.vue +1 -1
- package/ui.container-group/UGroup.vue +1 -1
- package/ui.container-groups/UGroups.vue +1 -1
- package/ui.container-modal/UModal.vue +1 -1
- package/ui.container-modal-confirm/UModalConfirm.vue +1 -1
- package/ui.container-page/UPage.vue +1 -1
- package/ui.container-page/config.ts +3 -3
- package/ui.container-row/URow.vue +1 -1
- package/ui.data-list/UDataList.vue +1 -1
- package/ui.data-list/config.ts +1 -1
- package/ui.data-table/UTable.vue +1 -1
- package/ui.data-table/UTableRow.vue +1 -1
- package/ui.dropdown-badge/UDropdownBadge.vue +1 -1
- package/ui.dropdown-button/UDropdownButton.vue +1 -1
- package/ui.dropdown-link/UDropdownLink.vue +1 -1
- package/ui.form-calendar/UCalendar.vue +1 -1
- package/ui.form-calendar/UCalendarDayView.vue +1 -1
- package/ui.form-calendar/UCalendarMonthView.vue +1 -1
- package/ui.form-calendar/UCalendarYearView.vue +1 -1
- package/ui.form-checkbox/UCheckbox.vue +1 -1
- package/ui.form-checkbox-group/UCheckboxGroup.vue +1 -1
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +1 -1
- package/{ui.form-color-picker/UColorPicker.vue → ui.form-color-toggle/UColorToggle.vue} +1 -1
- package/{ui.form-color-picker → ui.form-color-toggle}/constants.ts +1 -1
- package/{ui.form-color-picker → ui.form-color-toggle}/storybook/stories.ts +14 -14
- package/{ui.form-color-picker/tests/UColorPicker.test.ts → ui.form-color-toggle/tests/UColorToggle.test.ts} +8 -8
- package/ui.form-date-picker/UDatePicker.vue +1 -1
- package/ui.form-date-picker-range/UDatePickerRange.vue +1 -1
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input-counter/UInputCounter.vue +1 -1
- package/ui.form-input-file/UInputFile.vue +1 -1
- package/ui.form-input-number/UInputNumber.vue +1 -1
- package/ui.form-input-password/UInputPassword.vue +1 -1
- package/ui.form-input-rating/UInputRating.vue +1 -1
- package/ui.form-input-search/UInputSearch.vue +1 -1
- package/ui.form-label/ULabel.vue +1 -1
- package/ui.form-listbox/UListbox.vue +1 -1
- package/ui.form-radio/URadio.vue +1 -1
- package/ui.form-radio-group/URadioGroup.vue +1 -1
- package/ui.form-select/USelect.vue +1 -1
- package/ui.form-switch/USwitch.vue +1 -1
- package/ui.form-textarea/UTextarea.vue +1 -1
- package/ui.image-avatar/UAvatar.vue +1 -1
- package/ui.image-icon/UIcon.vue +1 -1
- package/ui.loader/ULoader.vue +1 -1
- package/ui.loader-overlay/ULoaderOverlay.vue +1 -1
- package/ui.loader-progress/ULoaderProgress.vue +1 -1
- package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +1 -1
- package/ui.navigation-pagination/UPagination.vue +1 -1
- package/ui.navigation-progress/UProgress.vue +1 -1
- package/ui.navigation-progress/UStepperProgress.vue +1 -1
- package/ui.navigation-tab/UTab.vue +1 -1
- package/ui.navigation-tabs/UTabs.vue +1 -1
- package/ui.other-chip/UChip.vue +1 -1
- package/ui.other-dot/UDot.vue +1 -1
- package/ui.other-theme-color-toggle/UThemeColorToggle.vue +4 -4
- package/ui.other-theme-color-toggle/config.ts +2 -2
- package/ui.other-theme-color-toggle/tests/UThemeColorToggle.test.ts +10 -10
- package/ui.skeleton/USkeleton.vue +1 -1
- package/ui.skeleton-choice/USkeletonChoice.vue +1 -1
- package/ui.skeleton-input/USkeletonInput.vue +1 -1
- package/ui.skeleton-text/USkeletonText.vue +1 -1
- package/ui.text-alert/UAlert.vue +1 -1
- package/ui.text-badge/UBadge.vue +1 -1
- package/ui.text-block/UText.vue +1 -1
- package/ui.text-block/config.ts +5 -4
- package/ui.text-empty/UEmpty.vue +1 -1
- package/ui.text-file/UFile.vue +1 -1
- package/ui.text-files/UFiles.vue +1 -1
- package/ui.text-header/UHeader.vue +1 -1
- package/ui.text-notify/UNotify.vue +1 -1
- package/ui.text-number/UNumber.vue +1 -1
- /package/{ui.form-color-picker → ui.form-color-toggle}/config.ts +0 -0
- /package/{ui.form-color-picker → ui.form-color-toggle}/storybook/docs.mdx +0 -0
- /package/{ui.form-color-picker → ui.form-color-toggle}/types.ts +0 -0
package/bin/commands/copy.js
CHANGED
|
@@ -44,7 +44,6 @@ export async function copyVuelessComponent(options) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const absoluteSourcePath = path.join(cwd(), VUELESS_PACKAGE_DIR, COMPONENTS[componentName]);
|
|
47
|
-
|
|
48
47
|
const absoluteDestPath = path.join(cwd(), VUELESS_USER_COMPONENTS_DIR, newComponentName);
|
|
49
48
|
|
|
50
49
|
if (existsSync(absoluteDestPath)) {
|
|
@@ -119,6 +118,7 @@ async function modifyCreatedComponent(destPath, componentName, newComponentName)
|
|
|
119
118
|
// saving indexes
|
|
120
119
|
const storyIdIndex = getStoryMetaKeyIndex(fileContent, "id");
|
|
121
120
|
const storyTitleIndex = getStoryMetaKeyIndex(fileContent, "title");
|
|
121
|
+
|
|
122
122
|
const componentImportIndex = lines.findIndex(
|
|
123
123
|
(line) => line.includes(componentName) && line.includes("import"),
|
|
124
124
|
);
|
|
@@ -53,7 +53,7 @@ vi.mock("vue", async () => {
|
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
import useUI from "../useUI";
|
|
56
|
+
import { useUI } from "../useUI";
|
|
57
57
|
import * as uiUtils from "../../utils/ui";
|
|
58
58
|
import { getCurrentInstance, useAttrs } from "vue";
|
|
59
59
|
import type { UnknownObject } from "../../types";
|
package/composables/useUI.ts
CHANGED
|
@@ -32,11 +32,7 @@ import type {
|
|
|
32
32
|
* 3. Component config (:config="{...}" props)
|
|
33
33
|
* 4. Component classes (class="...")
|
|
34
34
|
*/
|
|
35
|
-
export
|
|
36
|
-
defaultConfig: T,
|
|
37
|
-
mutatedProps?: MutatedProps,
|
|
38
|
-
topLevelClassKey?: string,
|
|
39
|
-
) {
|
|
35
|
+
export function useUI<T>(defaultConfig: T, mutatedProps?: MutatedProps, topLevelClassKey?: string) {
|
|
40
36
|
const { type, props, parent } = getCurrentInstance() as VuelessComponentInstance;
|
|
41
37
|
|
|
42
38
|
const componentName = type?.internal
|
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
|
@@ -272,7 +272,7 @@ export const COMPONENTS = {
|
|
|
272
272
|
UCalendar: "ui.form-calendar",
|
|
273
273
|
UDatePicker: "ui.form-date-picker",
|
|
274
274
|
UDatePickerRange: "ui.form-date-picker-range",
|
|
275
|
-
|
|
275
|
+
UColorToggle: "ui.form-color-toggle",
|
|
276
276
|
ULabel: "ui.form-label",
|
|
277
277
|
|
|
278
278
|
/* Text & Content */
|
package/index.d.ts
CHANGED
|
@@ -26,10 +26,10 @@ export { createVuelessAdapter } from "./adapter.locale/vueless";
|
|
|
26
26
|
export { createVueI18nAdapter } from "./adapter.locale/vue-i18n";
|
|
27
27
|
/* composables */
|
|
28
28
|
export { useLocale } from "./composables/useLocale";
|
|
29
|
-
export {
|
|
29
|
+
export { useUI } from "./composables/useUI";
|
|
30
30
|
export { useDarkMode } from "./composables/useDarkMode";
|
|
31
31
|
export { useRequestQueue } from "./composables/useRequestQueue";
|
|
32
|
-
export {
|
|
32
|
+
export { useBreakpoint } from "./composables/useBreakpoint";
|
|
33
33
|
export { useLoaderOverlay } from "./ui.loader-overlay/useLoaderOverlay";
|
|
34
34
|
export { useLoaderProgress } from "./ui.loader-progress/useLoaderProgress";
|
|
35
35
|
export { useMutationObserver } from "./composables/useMutationObserver";
|
|
@@ -81,7 +81,7 @@ export { default as URadioGroup } from "./ui.form-radio-group/URadioGroup.vue";
|
|
|
81
81
|
export { default as UCalendar } from "./ui.form-calendar/UCalendar.vue";
|
|
82
82
|
export { default as UDatePicker } from "./ui.form-date-picker/UDatePicker.vue";
|
|
83
83
|
export { default as UDatePickerRange } from "./ui.form-date-picker-range/UDatePickerRange.vue";
|
|
84
|
-
export { default as
|
|
84
|
+
export { default as UColorToggle } from "./ui.form-color-toggle/UColorToggle.vue";
|
|
85
85
|
export { default as ULabel } from "./ui.form-label/ULabel.vue";
|
|
86
86
|
/* Text & Content */
|
|
87
87
|
export { default as UHeader } from "./ui.text-header/UHeader.vue";
|
package/index.ts
CHANGED
|
@@ -32,10 +32,10 @@ export { createVuelessAdapter } from "./adapter.locale/vueless";
|
|
|
32
32
|
export { createVueI18nAdapter } from "./adapter.locale/vue-i18n";
|
|
33
33
|
/* composables */
|
|
34
34
|
export { useLocale } from "./composables/useLocale";
|
|
35
|
-
export {
|
|
35
|
+
export { useUI } from "./composables/useUI";
|
|
36
36
|
export { useDarkMode } from "./composables/useDarkMode";
|
|
37
37
|
export { useRequestQueue } from "./composables/useRequestQueue";
|
|
38
|
-
export {
|
|
38
|
+
export { useBreakpoint } from "./composables/useBreakpoint";
|
|
39
39
|
export { useLoaderOverlay } from "./ui.loader-overlay/useLoaderOverlay";
|
|
40
40
|
export { useLoaderProgress } from "./ui.loader-progress/useLoaderProgress";
|
|
41
41
|
export { useMutationObserver } from "./composables/useMutationObserver";
|
|
@@ -87,7 +87,7 @@ export { default as URadioGroup } from "./ui.form-radio-group/URadioGroup.vue";
|
|
|
87
87
|
export { default as UCalendar } from "./ui.form-calendar/UCalendar.vue";
|
|
88
88
|
export { default as UDatePicker } from "./ui.form-date-picker/UDatePicker.vue";
|
|
89
89
|
export { default as UDatePickerRange } from "./ui.form-date-picker-range/UDatePickerRange.vue";
|
|
90
|
-
export { default as
|
|
90
|
+
export { default as UColorToggle } from "./ui.form-color-toggle/UColorToggle.vue";
|
|
91
91
|
export { default as ULabel } from "./ui.form-label/ULabel.vue";
|
|
92
92
|
/* Text & Content */
|
|
93
93
|
export { default as UHeader } from "./ui.text-header/UHeader.vue";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "1.2.15-beta.
|
|
3
|
+
"version": "1.2.15-beta.3",
|
|
4
4
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
package/types.ts
CHANGED
|
@@ -48,7 +48,7 @@ import URadioGroupConfig from "./ui.form-radio-group/config";
|
|
|
48
48
|
import USwitchConfig from "./ui.form-switch/config";
|
|
49
49
|
import UTextareaConfig from "./ui.form-textarea/config";
|
|
50
50
|
import ULabelConfig from "./ui.form-label/config";
|
|
51
|
-
import
|
|
51
|
+
import UColorToggleConfig from "./ui.form-color-toggle/config";
|
|
52
52
|
import UInputConfig from "./ui.form-input/config";
|
|
53
53
|
import UInputCounterConfig from "./ui.form-input-counter/config";
|
|
54
54
|
import UInputPasswordConfig from "./ui.form-input-password/config";
|
|
@@ -315,7 +315,7 @@ export interface Components {
|
|
|
315
315
|
USwitch: Partial<typeof USwitchConfig>;
|
|
316
316
|
UTextarea: Partial<typeof UTextareaConfig>;
|
|
317
317
|
ULabel: Partial<typeof ULabelConfig>;
|
|
318
|
-
|
|
318
|
+
UColorToggle: Partial<typeof UColorToggleConfig>;
|
|
319
319
|
UInput: Partial<typeof UInputConfig>;
|
|
320
320
|
UInputCounter: Partial<typeof UInputCounterConfig>;
|
|
321
321
|
UInputPassword: Partial<typeof UInputPasswordConfig>;
|
package/ui.button/UButton.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref, watchEffect, useId, watch, useSlots, useTemplateRef } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { hasSlotContent } from "../utils/helper";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
package/ui.button-link/ULink.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, useSlots, useTemplateRef } from "vue";
|
|
3
3
|
import { RouterLink } from "vue-router";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { hasSlotContent } from "../utils/helper";
|
|
7
7
|
import { getDefaults } from "../utils/ui";
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@ import { computed, ref, useId, useTemplateRef } from "vue";
|
|
|
3
3
|
|
|
4
4
|
import UButton from "../ui.button/UButton.vue";
|
|
5
5
|
|
|
6
|
-
import useUI from "../composables/useUI";
|
|
6
|
+
import { useUI } from "../composables/useUI";
|
|
7
7
|
import { getDefaults } from "../utils/ui";
|
|
8
8
|
|
|
9
9
|
import defaultConfig from "./config";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, provide, useTemplateRef, ref, watch, onMounted } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { getDefaults } from "../utils/ui";
|
|
6
6
|
|
|
7
7
|
import UAccordionItem from "../ui.container-accordion-item/UAccordionItem.vue";
|
|
@@ -3,7 +3,7 @@ import { computed, ref, inject, useId, useSlots, useTemplateRef, toValue, watchE
|
|
|
3
3
|
|
|
4
4
|
import { isEqual } from "lodash-es";
|
|
5
5
|
|
|
6
|
-
import useUI from "../composables/useUI";
|
|
6
|
+
import { useUI } from "../composables/useUI";
|
|
7
7
|
import { getDefaults } from "../utils/ui";
|
|
8
8
|
import { hasSlotContent } from "../utils/helper";
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, useSlots, useTemplateRef } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { hasSlotContent } from "../utils/helper";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, useSlots, watch, useId, useTemplateRef, nextTick, ref } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { getDefaults } from "../utils/ui";
|
|
6
6
|
import { hasSlotContent } from "../utils/helper";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, useSlots, watch, useId, useTemplateRef, nextTick, ref } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { getDefaults } from "../utils/ui";
|
|
6
6
|
import { hasSlotContent } from "../utils/helper";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, watch, useTemplateRef } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { getDefaults } from "../utils/ui";
|
|
6
6
|
import { hasSlotContent } from "../utils/helper";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, useSlots, onMounted, useTemplateRef } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { getDefaults } from "../utils/ui";
|
|
6
6
|
import { hasSlotContent } from "../utils/helper";
|
|
7
7
|
|
|
@@ -64,9 +64,9 @@ export default /*tw*/ {
|
|
|
64
64
|
description: "mt-1.5 text-large font-normal text-lifted",
|
|
65
65
|
actions: "",
|
|
66
66
|
body: "",
|
|
67
|
-
footer: "mb-0 mt-14 justify-between pt-8 md:flex
|
|
68
|
-
footerLeft: "md:flex
|
|
69
|
-
footerRight: "md:flex
|
|
67
|
+
footer: "mb-0 mt-14 justify-between pt-8 md:flex gap-4 md:gap-0 md:items-baseline border-t border-muted",
|
|
68
|
+
footerLeft: "md:flex gap-4",
|
|
69
|
+
footerRight: "md:flex gap-4",
|
|
70
70
|
defaults: {
|
|
71
71
|
variant: "solid",
|
|
72
72
|
size: "wide",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useTemplateRef } from "vue";
|
|
3
3
|
import draggable from "vuedraggable/src/vuedraggable";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
import { hasSlotContent } from "../utils/helper";
|
|
8
8
|
|
package/ui.data-list/config.ts
CHANGED
|
@@ -42,7 +42,7 @@ export default /*tw*/ {
|
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
labelCrossed: "{>label} line-through",
|
|
45
|
-
customActions: "
|
|
45
|
+
customActions: "flex items-center gap-5 opacity-50 md:opacity-0 group-hover/item:opacity-100",
|
|
46
46
|
divider: "{UDivider}",
|
|
47
47
|
empty: "{UEmpty}",
|
|
48
48
|
nested: "{UDataList} group/nested ml-6",
|
package/ui.data-table/UTable.vue
CHANGED
|
@@ -18,7 +18,7 @@ import ULoaderProgress from "../ui.loader-progress/ULoaderProgress.vue";
|
|
|
18
18
|
import UTableRow from "./UTableRow.vue";
|
|
19
19
|
import UDivider from "../ui.container-divider/UDivider.vue";
|
|
20
20
|
|
|
21
|
-
import useUI from "../composables/useUI";
|
|
21
|
+
import { useUI } from "../composables/useUI";
|
|
22
22
|
import { getDefaults, cx, getMergedConfig } from "../utils/ui";
|
|
23
23
|
import { hasSlotContent } from "../utils/helper";
|
|
24
24
|
import { useComponentLocaleMessages } from "../composables/useComponentLocaleMassages";
|
|
@@ -7,7 +7,7 @@ import { PX_IN_REM } from "../constants";
|
|
|
7
7
|
import { mapRowColumns } from "./utilTable";
|
|
8
8
|
|
|
9
9
|
import { useMutationObserver } from "../composables/useMutationObserver";
|
|
10
|
-
import useUI from "../composables/useUI";
|
|
10
|
+
import { useUI } from "../composables/useUI";
|
|
11
11
|
|
|
12
12
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
13
13
|
import UCheckbox from "../ui.form-checkbox/UCheckbox.vue";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ref, computed, nextTick, useId, useTemplateRef } from "vue";
|
|
3
3
|
import { isEqual } from "lodash-es";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
|
8
8
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { nextTick, computed, ref, useId, useTemplateRef } from "vue";
|
|
3
3
|
import { isEqual } from "lodash-es";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
|
8
8
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { nextTick, computed, ref, useId, useTemplateRef } from "vue";
|
|
3
3
|
import { isEqual } from "lodash-es";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
|
8
8
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts" generic="TModelValue extends DateValue">
|
|
2
2
|
import { computed, ref, watch, useTemplateRef, nextTick, onMounted } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { getDefaults } from "../utils/ui";
|
|
6
6
|
import { isRangeDate } from "./types";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
|
|
6
6
|
import { formatDate, dateIsOutOfRange } from "./utilCalendar";
|
|
7
7
|
import { isSameMonth, isCurrentMonth } from "./utilDate";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, watch } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
|
|
6
6
|
import { formatDate, dateIsOutOfRange } from "./utilCalendar";
|
|
7
7
|
import { isSameMonth, isCurrentYear } from "./utilDate";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { inject, ref, onMounted, computed, watchEffect, toValue, useId } from "vue";
|
|
3
3
|
import { isEqual } from "lodash-es";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
|
8
8
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { provide, ref, watch, useTemplateRef } from "vue";
|
|
3
3
|
import { isEqual } from "lodash-es";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
|
8
8
|
import ULabel from "../ui.form-label/ULabel.vue";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, ref, watchEffect } from "vue";
|
|
3
3
|
import { cloneDeep } from "../utils/helper";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
import { getDefaults } from "../utils/ui";
|
|
7
7
|
|
|
8
8
|
import UCheckbox from "../ui.form-checkbox/UCheckbox.vue";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, computed, useId, useTemplateRef } from "vue";
|
|
3
3
|
|
|
4
|
-
import useUI from "../composables/useUI";
|
|
4
|
+
import { useUI } from "../composables/useUI";
|
|
5
5
|
import { getDefaults } from "../utils/ui";
|
|
6
6
|
|
|
7
7
|
import vTooltip from "../v.tooltip/vTooltip";
|
|
@@ -6,22 +6,22 @@ import {
|
|
|
6
6
|
getDocsDescription,
|
|
7
7
|
} from "../../utils/storybook";
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import UColorToggle from "../UColorToggle.vue";
|
|
10
10
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
11
11
|
import UButton from "../../ui.button/UButton.vue";
|
|
12
12
|
|
|
13
13
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
14
14
|
import type { Props } from "../types";
|
|
15
15
|
|
|
16
|
-
interface
|
|
16
|
+
interface UColorToggleArgs extends Props {
|
|
17
17
|
slotTemplate?: string;
|
|
18
18
|
enum: "size";
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export default {
|
|
22
22
|
id: "3190",
|
|
23
|
-
title: "Form Inputs & Controls / Color
|
|
24
|
-
component:
|
|
23
|
+
title: "Form Inputs & Controls / Color Toggle",
|
|
24
|
+
component: UColorToggle,
|
|
25
25
|
args: {
|
|
26
26
|
modelValue: "",
|
|
27
27
|
colors: /*tw*/ {
|
|
@@ -47,31 +47,31 @@ export default {
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
argTypes: {
|
|
50
|
-
...getArgTypes(
|
|
50
|
+
...getArgTypes(UColorToggle.__name),
|
|
51
51
|
},
|
|
52
52
|
parameters: {
|
|
53
53
|
docs: {
|
|
54
|
-
...getDocsDescription(
|
|
54
|
+
...getDocsDescription(UColorToggle.__name),
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
} as Meta;
|
|
58
58
|
|
|
59
|
-
const DefaultTemplate: StoryFn<
|
|
60
|
-
components: {
|
|
61
|
-
setup: () => ({ args, slots: getSlotNames(
|
|
59
|
+
const DefaultTemplate: StoryFn<UColorToggleArgs> = (args: UColorToggleArgs) => ({
|
|
60
|
+
components: { UColorToggle, UButton, UCol },
|
|
61
|
+
setup: () => ({ args, slots: getSlotNames(UColorToggle.__name) }),
|
|
62
62
|
template: `
|
|
63
|
-
<
|
|
63
|
+
<UColorToggle v-bind="args" v-model="args.modelValue">
|
|
64
64
|
${args.slotTemplate || getSlotsFragment("")}
|
|
65
|
-
</
|
|
65
|
+
</UColorToggle>
|
|
66
66
|
`,
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
const EnumTemplate: StoryFn<
|
|
70
|
-
components: { UCol,
|
|
69
|
+
const EnumTemplate: StoryFn<UColorToggleArgs> = (args: UColorToggleArgs, { argTypes }) => ({
|
|
70
|
+
components: { UCol, UColorToggle },
|
|
71
71
|
setup: () => ({ args, argTypes, getArgs }),
|
|
72
72
|
template: `
|
|
73
73
|
<UCol>
|
|
74
|
-
<
|
|
74
|
+
<UColorToggle
|
|
75
75
|
v-for="option in argTypes?.[args.enum]?.options"
|
|
76
76
|
v-bind="getArgs(args, option)"
|
|
77
77
|
:key="option"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { mount } from "@vue/test-utils";
|
|
2
2
|
import { describe, it, expect } from "vitest";
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import UColorToggle from "../UColorToggle.vue";
|
|
5
5
|
import UButton from "../../ui.button/UButton.vue";
|
|
6
6
|
|
|
7
7
|
import type { Props } from "../types";
|
|
8
8
|
|
|
9
|
-
describe("
|
|
9
|
+
describe("UColorToggle.vue", () => {
|
|
10
10
|
describe("Props", () => {
|
|
11
11
|
it("Model Value – selects the correct color based on modelValue", async () => {
|
|
12
12
|
const modelValue = "primary";
|
|
@@ -18,7 +18,7 @@ describe("UColorPicker.vue", () => {
|
|
|
18
18
|
secondary: "bg-secondary-500",
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const component = mount(
|
|
21
|
+
const component = mount(UColorToggle, {
|
|
22
22
|
props: {
|
|
23
23
|
modelValue,
|
|
24
24
|
"onUpdate:modelValue": (value) => component.setProps({ modelValue: value }),
|
|
@@ -47,7 +47,7 @@ describe("UColorPicker.vue", () => {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
Object.entries(sizes).forEach(([size, classes]) => {
|
|
50
|
-
const component = mount(
|
|
50
|
+
const component = mount(UColorToggle, {
|
|
51
51
|
props: {
|
|
52
52
|
modelValue: "",
|
|
53
53
|
size: size as Props["size"],
|
|
@@ -70,7 +70,7 @@ describe("UColorPicker.vue", () => {
|
|
|
70
70
|
error: "bg-error-500",
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const component = mount(
|
|
73
|
+
const component = mount(UColorToggle, {
|
|
74
74
|
props: {
|
|
75
75
|
modelValue: "",
|
|
76
76
|
colors,
|
|
@@ -89,7 +89,7 @@ describe("UColorPicker.vue", () => {
|
|
|
89
89
|
it("Id – applies the correct id attribute", () => {
|
|
90
90
|
const id = "test-color-picker-id";
|
|
91
91
|
|
|
92
|
-
const component = mount(
|
|
92
|
+
const component = mount(UColorToggle, {
|
|
93
93
|
props: {
|
|
94
94
|
modelValue: "",
|
|
95
95
|
id,
|
|
@@ -107,7 +107,7 @@ describe("UColorPicker.vue", () => {
|
|
|
107
107
|
secondary: "bg-secondary-500",
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
-
const component = mount(
|
|
110
|
+
const component = mount(UColorToggle, {
|
|
111
111
|
props: {
|
|
112
112
|
modelValue: "",
|
|
113
113
|
dataTest,
|
|
@@ -127,7 +127,7 @@ describe("UColorPicker.vue", () => {
|
|
|
127
127
|
|
|
128
128
|
describe("Exposed properties", () => {
|
|
129
129
|
it("ListRef – exposes listRef", () => {
|
|
130
|
-
const component = mount(
|
|
130
|
+
const component = mount(UColorToggle, {
|
|
131
131
|
props: {
|
|
132
132
|
modelValue: "",
|
|
133
133
|
colors: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, nextTick, ref, useId, useTemplateRef, watchEffect } from "vue";
|
|
3
3
|
import { merge } from "lodash-es";
|
|
4
4
|
|
|
5
|
-
import useUI from "../composables/useUI";
|
|
5
|
+
import { useUI } from "../composables/useUI";
|
|
6
6
|
|
|
7
7
|
import UIcon from "../ui.image-icon/UIcon.vue";
|
|
8
8
|
import UInput from "../ui.form-input/UInput.vue";
|