vueless 0.0.536 → 0.0.538
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/package.json +1 -1
- package/ui.button/UButton.vue +1 -1
- package/ui.button/types.ts +1 -1
- package/ui.button-link/ULink.vue +1 -1
- package/ui.button-link/types.ts +1 -1
- package/ui.button-toggle/UToggle.vue +1 -1
- package/ui.button-toggle/types.ts +1 -1
- package/ui.button-toggle-item/UToggleItem.vue +1 -1
- package/ui.button-toggle-item/types.ts +1 -1
- package/ui.container-accordion/UAccordion.vue +1 -1
- package/ui.container-accordion/types.ts +1 -1
- package/ui.container-card/UCard.vue +1 -1
- package/ui.container-card/types.ts +1 -1
- package/ui.container-col/UCol.vue +1 -1
- package/ui.container-col/types.ts +1 -1
- package/ui.container-divider/UDivider.vue +1 -1
- package/ui.container-divider/types.ts +1 -1
- package/ui.container-group/UGroup.vue +1 -2
- package/ui.container-group/config.ts +1 -14
- package/ui.container-group/types.ts +1 -6
- package/ui.container-groups/UGroups.vue +25 -0
- package/ui.container-groups/config.ts +18 -0
- package/ui.container-groups/constants.ts +5 -0
- package/ui.container-groups/storybook/Docs.mdx +16 -0
- package/ui.container-groups/storybook/stories.ts +59 -0
- package/ui.container-groups/types.ts +20 -0
- package/ui.container-groups/useAttrs.ts +18 -0
- package/ui.container-modal/UModal.vue +1 -1
- package/ui.container-modal/types.ts +1 -1
- package/ui.container-modal-confirm/UModalConfirm.vue +1 -1
- package/ui.container-modal-confirm/types.ts +1 -1
- package/ui.container-page/UPage.vue +1 -1
- package/ui.container-page/types.ts +1 -1
- package/ui.container-row/URow.vue +1 -1
- package/ui.container-row/types.ts +1 -1
- package/ui.data-table/UTable.vue +6 -6
- package/ui.data-table/config.ts +5 -4
- package/ui.data-table/useAttrs.ts +3 -2
- package/ui.form-checkbox/UCheckbox.vue +1 -1
- package/ui.form-checkbox/types.ts +1 -1
- package/ui.form-checkbox-group/UCheckboxGroup.vue +1 -1
- package/ui.form-checkbox-group/types.ts +1 -1
- package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +1 -1
- package/ui.form-checkbox-multi-state/types.ts +1 -1
- package/ui.form-select/config.js +3 -3
- package/ui.image-avatar/UAvatar.vue +1 -1
- package/ui.image-avatar/types.ts +1 -1
- package/ui.image-icon/UIcon.vue +1 -1
- package/ui.image-icon/types.ts +1 -1
- package/ui.loader/ULoader.vue +1 -1
- package/ui.loader/types.ts +1 -1
- package/ui.loader-overlay/ULoaderOverlay.vue +1 -1
- package/ui.loader-overlay/types.ts +1 -1
- package/ui.loader-progress/ULoaderProgress.vue +1 -1
- package/ui.loader-progress/types.ts +1 -1
- package/ui.navigation-pagination/UPagination.vue +1 -1
- package/ui.navigation-pagination/types.ts +1 -1
- package/ui.navigation-progress/StepperProgress.vue +1 -1
- package/ui.navigation-progress/UProgress.vue +1 -1
- package/ui.navigation-progress/types.ts +2 -2
- package/ui.navigation-tab/UTab.vue +1 -1
- package/ui.navigation-tab/types.ts +1 -1
- package/ui.navigation-tabs/UTabs.vue +1 -1
- package/ui.navigation-tabs/types.ts +1 -1
- package/ui.other-dot/UDot.vue +1 -1
- package/ui.other-dot/types.ts +1 -1
- package/ui.text-alert/UAlert.vue +1 -1
- package/ui.text-alert/types.ts +1 -1
- package/ui.text-badge/UBadge.vue +1 -1
- package/ui.text-badge/types.ts +1 -1
- package/ui.text-block/UText.vue +1 -1
- package/ui.text-block/types.ts +1 -1
- package/ui.text-empty/UEmpty.vue +1 -1
- package/ui.text-empty/types.ts +1 -1
- package/ui.text-file/UFile.vue +1 -1
- package/ui.text-file/types.ts +1 -1
- package/ui.text-files/UFiles.vue +1 -1
- package/ui.text-files/types.ts +1 -1
- package/ui.text-header/UHeader.vue +1 -1
- package/ui.text-header/types.ts +1 -1
- package/ui.text-money/UMoney.vue +1 -1
- package/ui.text-money/types.ts +1 -1
- package/ui.text-notify/UNotify.vue +1 -1
- package/ui.text-notify/types.ts +1 -1
- package/web-types.json +90 -163
package/package.json
CHANGED
package/ui.button/UButton.vue
CHANGED
package/ui.button/types.ts
CHANGED
package/ui.button-link/ULink.vue
CHANGED
package/ui.button-link/types.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script lang="ts"
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
import { getDefault } from "../utils/ui.ts";
|
|
3
3
|
import UDivider from "../ui.container-divider/UDivider.vue";
|
|
4
4
|
import UHeader from "../ui.text-header/UHeader.vue";
|
|
@@ -12,7 +12,6 @@ import type { UGroupProps } from "./types.ts";
|
|
|
12
12
|
defineOptions({ inheritAttrs: false });
|
|
13
13
|
|
|
14
14
|
const props = withDefaults(defineProps<UGroupProps>(), {
|
|
15
|
-
gap: getDefault<UGroupProps>(defaultConfig, UGroup).gap,
|
|
16
15
|
upperlined: getDefault<UGroupProps>(defaultConfig, UGroup).upperlined,
|
|
17
16
|
underlined: getDefault<UGroupProps>(defaultConfig, UGroup).underlined,
|
|
18
17
|
dataTest: "",
|
|
@@ -12,21 +12,8 @@ export default /*tw*/ {
|
|
|
12
12
|
header: "flex items-center justify-between",
|
|
13
13
|
headerLeftFallback: "flex items-center",
|
|
14
14
|
title: "{UHeader} pr-2",
|
|
15
|
-
content:
|
|
16
|
-
base: "flex flex-col items-stretch",
|
|
17
|
-
variants: {
|
|
18
|
-
gap: {
|
|
19
|
-
none: "gap-0",
|
|
20
|
-
xs: "gap-8",
|
|
21
|
-
sm: "gap-10",
|
|
22
|
-
md: "gap-12",
|
|
23
|
-
lg: "gap-14",
|
|
24
|
-
xl: "gap-16",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
15
|
+
content: "",
|
|
28
16
|
defaults: {
|
|
29
|
-
gap: "md",
|
|
30
17
|
upperlined: false,
|
|
31
18
|
underlined: false,
|
|
32
19
|
},
|
|
@@ -8,11 +8,6 @@ export interface UGroupProps {
|
|
|
8
8
|
*/
|
|
9
9
|
title?: string;
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* The distance between nested elements.
|
|
13
|
-
*/
|
|
14
|
-
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
15
|
-
|
|
16
11
|
/**
|
|
17
12
|
* Show line above the header.
|
|
18
13
|
*/
|
|
@@ -26,7 +21,7 @@ export interface UGroupProps {
|
|
|
26
21
|
/**
|
|
27
22
|
* Component config object.
|
|
28
23
|
*/
|
|
29
|
-
config?:
|
|
24
|
+
config?: Config;
|
|
30
25
|
|
|
31
26
|
/**
|
|
32
27
|
* Data-test attribute for automated testing.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { getDefault } from "../utils/ui.ts";
|
|
3
|
+
|
|
4
|
+
import { UGroups } from "./constants.ts";
|
|
5
|
+
import defaultConfig from "./config.ts";
|
|
6
|
+
import useAttrs from "./useAttrs.ts";
|
|
7
|
+
|
|
8
|
+
import type { UGroupsProps } from "./types.ts";
|
|
9
|
+
|
|
10
|
+
defineOptions({ inheritAttrs: false });
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(defineProps<UGroupsProps>(), {
|
|
13
|
+
gap: getDefault<UGroupsProps>(defaultConfig, UGroups).gap,
|
|
14
|
+
dataTest: "",
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const { wrapperAttrs } = useAttrs(props);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div v-bind="wrapperAttrs" :data-test="dataTest">
|
|
22
|
+
<!-- @slot Use it to add something inside. -->
|
|
23
|
+
<slot />
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default /*tw*/ {
|
|
2
|
+
wrapper: {
|
|
3
|
+
base: "flex flex-col items-stretch",
|
|
4
|
+
variants: {
|
|
5
|
+
gap: {
|
|
6
|
+
none: "gap-0",
|
|
7
|
+
xs: "gap-8",
|
|
8
|
+
sm: "gap-10",
|
|
9
|
+
md: "gap-12",
|
|
10
|
+
lg: "gap-14",
|
|
11
|
+
xl: "gap-16",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaults: {
|
|
16
|
+
gap: "md",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../../utils/storybook.ts";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./stories.ts";
|
|
5
|
+
import defaultConfig from "../config.ts?raw"
|
|
6
|
+
|
|
7
|
+
<Meta of={stories} />
|
|
8
|
+
<Title of={stories} />
|
|
9
|
+
<Subtitle of={stories} />
|
|
10
|
+
<Description of={stories} />
|
|
11
|
+
<Primary of={stories} />
|
|
12
|
+
<Controls of={stories.Default} />
|
|
13
|
+
<Stories of={stories} />
|
|
14
|
+
|
|
15
|
+
## Default config
|
|
16
|
+
<Source code={getSource(defaultConfig)} language="jsx" dark />
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getArgTypes, getSlotNames } from "../../utils/storybook.ts";
|
|
2
|
+
|
|
3
|
+
import UGroups from "../../ui.container-groups/UGroups.vue";
|
|
4
|
+
import UGroup from "../../ui.container-group/UGroup.vue";
|
|
5
|
+
import UCol from "../../ui.container-col/UCol.vue";
|
|
6
|
+
import UInput from "../../ui.form-input/UInput.vue";
|
|
7
|
+
|
|
8
|
+
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
9
|
+
import type { UGroupsProps } from "../types.ts";
|
|
10
|
+
|
|
11
|
+
interface UGroupsArgs extends UGroupsProps {
|
|
12
|
+
slotTemplate?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The `UGroups` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.container-groups)
|
|
17
|
+
*/
|
|
18
|
+
export default {
|
|
19
|
+
id: "5035",
|
|
20
|
+
title: "Containers / Groups",
|
|
21
|
+
component: UGroups,
|
|
22
|
+
args: {},
|
|
23
|
+
argTypes: {
|
|
24
|
+
...getArgTypes(UGroups.__name),
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
docs: {
|
|
28
|
+
story: {
|
|
29
|
+
iframeHeight: 360,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
} as Meta;
|
|
34
|
+
|
|
35
|
+
const DefaultTemplate: StoryFn<UGroupsArgs> = (args: UGroupsArgs) => ({
|
|
36
|
+
components: { UGroups, UGroup, UCol, UInput },
|
|
37
|
+
setup() {
|
|
38
|
+
const slots = getSlotNames(UGroups.__name);
|
|
39
|
+
|
|
40
|
+
return { args, slots };
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<UGroups v-bind="args">
|
|
44
|
+
${args.slotTemplate}
|
|
45
|
+
</UGroups>
|
|
46
|
+
`,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const Default = DefaultTemplate.bind({});
|
|
50
|
+
Default.args = {
|
|
51
|
+
slotTemplate: `
|
|
52
|
+
<UGroup :upperlined="n !== 1" :title="'Group '+n" v-for="n in 3">
|
|
53
|
+
<UCol>
|
|
54
|
+
<UInput placeholder="input" label="Label" />
|
|
55
|
+
<UInput placeholder="input" label="Label" />
|
|
56
|
+
</UCol>
|
|
57
|
+
</UGroup>
|
|
58
|
+
`,
|
|
59
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import defaultConfig from "./config.ts";
|
|
2
|
+
|
|
3
|
+
export type Config = Partial<typeof defaultConfig>;
|
|
4
|
+
|
|
5
|
+
export interface UGroupsProps {
|
|
6
|
+
/**
|
|
7
|
+
* The distance between nested elements.
|
|
8
|
+
*/
|
|
9
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Component config object.
|
|
13
|
+
*/
|
|
14
|
+
config?: Config;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Data-test attribute for automated testing.
|
|
18
|
+
*/
|
|
19
|
+
dataTest?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import useUI from "../composables/useUI.ts";
|
|
2
|
+
|
|
3
|
+
import defaultConfig from "./config.ts";
|
|
4
|
+
|
|
5
|
+
import type { UseAttrs } from "../types.ts";
|
|
6
|
+
import type { UGroupsProps, Config } from "./types.ts";
|
|
7
|
+
|
|
8
|
+
export default function useAttrs(props: UGroupsProps): UseAttrs<Config> {
|
|
9
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI<Config>(defaultConfig, () => props.config);
|
|
10
|
+
|
|
11
|
+
const keysAttrs = getKeysAttrs();
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
config,
|
|
15
|
+
...keysAttrs,
|
|
16
|
+
hasSlotContent,
|
|
17
|
+
};
|
|
18
|
+
}
|
package/ui.data-table/UTable.vue
CHANGED
|
@@ -205,14 +205,14 @@ const {
|
|
|
205
205
|
bodyRowDateDividerAttrs,
|
|
206
206
|
headerCellBaseAttrs,
|
|
207
207
|
headerCellCheckboxAttrs,
|
|
208
|
-
|
|
208
|
+
headerActionsCheckboxAttrs,
|
|
209
209
|
stickyHeaderCheckboxAttrs,
|
|
210
210
|
headerCheckboxAttrs,
|
|
211
211
|
headerCounterAttrs,
|
|
212
212
|
bodyEmptyStateAttrs,
|
|
213
213
|
bodyDateDividerAttrs,
|
|
214
214
|
bodyCellDateDividerAttrs,
|
|
215
|
-
|
|
215
|
+
headerActionsCounterAttrs,
|
|
216
216
|
stickyHeaderCounterAttrs,
|
|
217
217
|
stickyHeaderLoaderAttrs,
|
|
218
218
|
tableAttrs,
|
|
@@ -496,14 +496,14 @@ defineExpose({
|
|
|
496
496
|
v-model="selectAll"
|
|
497
497
|
size="md"
|
|
498
498
|
:partial="!isSelectedAllRows"
|
|
499
|
-
v-bind="
|
|
499
|
+
v-bind="headerActionsCheckboxAttrs"
|
|
500
500
|
:data-test="`${dataTest}-select-all`"
|
|
501
501
|
/>
|
|
502
502
|
</div>
|
|
503
503
|
|
|
504
504
|
<div
|
|
505
505
|
v-if="selectedRows.length"
|
|
506
|
-
v-bind="
|
|
506
|
+
v-bind="headerActionsCounterAttrs"
|
|
507
507
|
v-text="selectedRows.length"
|
|
508
508
|
/>
|
|
509
509
|
|
|
@@ -529,14 +529,14 @@ defineExpose({
|
|
|
529
529
|
v-model="selectAll"
|
|
530
530
|
size="md"
|
|
531
531
|
:partial="!isSelectedAllRows"
|
|
532
|
-
v-bind="
|
|
532
|
+
v-bind="headerActionsCheckboxAttrs"
|
|
533
533
|
:data-test="`${dataTest}-select-all`"
|
|
534
534
|
/>
|
|
535
535
|
</div>
|
|
536
536
|
|
|
537
537
|
<div
|
|
538
538
|
v-if="selectedRows.length"
|
|
539
|
-
v-bind="
|
|
539
|
+
v-bind="headerActionsCounterAttrs"
|
|
540
540
|
v-text="selectedRows.length"
|
|
541
541
|
/>
|
|
542
542
|
|
package/ui.data-table/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: "relative w-full overflow-auto",
|
|
3
3
|
headerCounterBase: "mr-1.5 pr-1.5 font-medium text-sm text-gray-900",
|
|
4
|
-
stickyHeader: "fixed top-0 flex items-center z-30 overflow-hidden rounded-none
|
|
4
|
+
stickyHeader: "fixed top-0 flex items-center z-30 overflow-hidden border rounded-none",
|
|
5
5
|
stickyHeaderRow: "border-gray-200 bg-white",
|
|
6
6
|
stickyHeaderCell: "flex-none whitespace-nowrap",
|
|
7
7
|
stickyHeaderCheckbox: "{UCheckbox}",
|
|
@@ -14,9 +14,10 @@ export default /*tw*/ {
|
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
stickyHeaderLoader: "{ULoaderProgress}",
|
|
17
|
-
stickyHeaderActions: "rounded-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
stickyHeaderActions: "rounded-none",
|
|
18
|
+
headerActions: "rounded-t-dynamic border-blue-200 bg-blue-50",
|
|
19
|
+
headerActionsCheckbox: "{UCheckbox}",
|
|
20
|
+
headerActionsCounter: "-ml-1.5",
|
|
20
21
|
tableWrapper: "border border-gray-200 rounded-dynamic bg-white",
|
|
21
22
|
table: "min-w-full border-none text-sm w-full table-auto",
|
|
22
23
|
header: "border-b border-gray-200",
|
|
@@ -25,6 +25,7 @@ export default function useAttrs(
|
|
|
25
25
|
|
|
26
26
|
const extendingKeys = [
|
|
27
27
|
"headerCounterBase",
|
|
28
|
+
"headerActions",
|
|
28
29
|
"stickyHeaderActions",
|
|
29
30
|
"stickyHeaderRow",
|
|
30
31
|
"stickyFooter",
|
|
@@ -42,7 +43,7 @@ export default function useAttrs(
|
|
|
42
43
|
const classes = [];
|
|
43
44
|
|
|
44
45
|
if (isShownActionsHeader.value) {
|
|
45
|
-
classes.push(extendingKeysClasses.
|
|
46
|
+
classes.push(extendingKeysClasses.headerActions.value);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
if (isShownActionsHeader.value && isHeaderSticky.value) {
|
|
@@ -65,7 +66,7 @@ export default function useAttrs(
|
|
|
65
66
|
stickyHeaderCounter: {
|
|
66
67
|
base: computed(() => [extendingKeysClasses.headerCounterBase.value]),
|
|
67
68
|
},
|
|
68
|
-
|
|
69
|
+
headerActionsCounter: {
|
|
69
70
|
base: computed(() => [extendingKeysClasses.headerCounterBase.value]),
|
|
70
71
|
},
|
|
71
72
|
headerCellCheckbox: {
|
package/ui.form-select/config.js
CHANGED
package/ui.image-avatar/types.ts
CHANGED
package/ui.image-icon/UIcon.vue
CHANGED