@antify/ui 2.2.0 → 2.2.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/dist/components/AntAccordion.vue +25 -12
- package/dist/components/AntAccordionItem.vue +28 -13
- package/dist/components/AntAlert.vue +25 -15
- package/dist/components/AntCard.vue +26 -14
- package/dist/components/AntContent.vue +4 -4
- package/dist/components/AntDropdown.vue +41 -23
- package/dist/components/AntIcon.vue +18 -6
- package/dist/components/AntKeycap.vue +31 -16
- package/dist/components/AntListGroup.vue +13 -11
- package/dist/components/AntListGroupItem.vue +19 -9
- package/dist/components/AntModal.vue +26 -15
- package/dist/components/AntPagination.vue +28 -15
- package/dist/components/AntPopover.vue +74 -51
- package/dist/components/AntSkeleton.vue +8 -4
- package/dist/components/AntSpinner.vue +14 -6
- package/dist/components/AntTag.vue +25 -13
- package/dist/components/AntToast.vue +19 -11
- package/dist/components/AntToaster.vue +13 -5
- package/dist/components/AntTooltip.vue +78 -54
- package/dist/components/__stories/AntAccordion.stories.js +4 -4
- package/dist/components/__stories/AntAccordion.stories.mjs +50 -17
- package/dist/components/__stories/AntAlert.stories.mjs +18 -5
- package/dist/components/__stories/AntCard.stories.mjs +36 -10
- package/dist/components/__stories/AntContent.stories.mjs +14 -4
- package/dist/components/__stories/AntDropdown.stories.mjs +20 -4
- package/dist/components/__stories/AntIcon.stories.mjs +38 -12
- package/dist/components/__stories/AntKeycap.stories.mjs +35 -10
- package/dist/components/__stories/AntListGroup.stories.d.ts +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +22 -4
- package/dist/components/__stories/AntListGroupItem.stories.mjs +27 -8
- package/dist/components/__stories/AntModal.stories.mjs +17 -4
- package/dist/components/__stories/AntPagination.stories.mjs +21 -6
- package/dist/components/__stories/AntPopover.stories.mjs +20 -4
- package/dist/components/__stories/AntSkeleton.stories.mjs +17 -5
- package/dist/components/__stories/AntSpinner.stories.mjs +33 -9
- package/dist/components/__stories/AntTag.stories.mjs +28 -8
- package/dist/components/__stories/AntToast.stories.mjs +19 -5
- package/dist/components/__stories/AntToaster.stories.d.ts +1 -1
- package/dist/components/__stories/AntToaster.stories.mjs +35 -9
- package/dist/components/__stories/AntTooltip.stories.js +1 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +44 -13
- package/dist/components/buttons/AntActionButton.vue +38 -29
- package/dist/components/buttons/AntButton.vue +34 -13
- package/dist/components/buttons/AntCreateButton.vue +11 -4
- package/dist/components/buttons/AntDeleteButton.vue +11 -4
- package/dist/components/buttons/AntDuplicateButton.vue +11 -4
- package/dist/components/buttons/AntEditButton.vue +11 -4
- package/dist/components/buttons/AntSaveAndNewButton.vue +11 -4
- package/dist/components/buttons/AntSaveButton.vue +11 -4
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +35 -10
- package/dist/components/buttons/__stories/AntButton.stories.mjs +77 -23
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +25 -7
- package/dist/components/crud/AntCrud.vue +6 -6
- package/dist/components/crud/AntCrudDetail.vue +8 -5
- package/dist/components/crud/AntCrudDetailActions.vue +14 -8
- package/dist/components/crud/AntCrudDetailNav.vue +21 -13
- package/dist/components/crud/AntCrudTableFilter.vue +29 -17
- package/dist/components/crud/AntCrudTableNav.vue +36 -22
- package/dist/components/crud/__stories/AntCrud.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +10 -2
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +23 -7
- package/dist/components/dialogs/AntDeleteDialog.vue +13 -5
- package/dist/components/dialogs/AntDialog.vue +23 -13
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +12 -3
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +28 -7
- package/dist/components/forms/AntField.vue +18 -7
- package/dist/components/forms/AntFormGroup.vue +9 -5
- package/dist/components/forms/AntFormGroupLabel.vue +1 -1
- package/dist/components/forms/__stories/AntField.stories.mjs +37 -9
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +20 -5
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +11 -3
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inputs/AntCheckbox.vue +61 -36
- package/dist/components/inputs/AntCheckboxGroup.vue +40 -15
- package/dist/components/inputs/AntDateInput.vue +35 -12
- package/dist/components/inputs/AntNumberInput.vue +33 -12
- package/dist/components/inputs/AntPasswordInput.vue +32 -11
- package/dist/components/inputs/AntRadio.vue +57 -34
- package/dist/components/inputs/AntRadioGroup.vue +60 -35
- package/dist/components/inputs/AntRangeSlider.vue +31 -12
- package/dist/components/inputs/AntSearch.vue +19 -7
- package/dist/components/inputs/AntSelect.vue +107 -83
- package/dist/components/inputs/AntSwitch.vue +36 -18
- package/dist/components/inputs/AntSwitcher.vue +30 -15
- package/dist/components/inputs/AntTagInput.vue +91 -61
- package/dist/components/inputs/AntTextInput.vue +31 -11
- package/dist/components/inputs/AntTextarea.vue +53 -25
- package/dist/components/inputs/AntUnitInput.vue +33 -12
- package/dist/components/inputs/Elements/AntBaseInput.vue +47 -18
- package/dist/components/inputs/Elements/AntInputDescription.vue +16 -8
- package/dist/components/inputs/Elements/AntInputLabel.vue +13 -5
- package/dist/components/inputs/Elements/AntInputLimiter.vue +13 -5
- package/dist/components/inputs/Elements/AntSelectMenu.vue +65 -41
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +104 -27
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +33 -9
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +34 -9
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +33 -9
- package/dist/components/inputs/Elements/index.d.ts +1 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +34 -9
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +45 -21
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +52 -14
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +66 -17
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +51 -13
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +45 -12
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +16 -5
- package/dist/components/inputs/__stories/AntSearch.stories.mjs +41 -10
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +59 -15
- package/dist/components/inputs/__stories/AntSwitch.stories.js +126 -102
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +162 -112
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +38 -10
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +46 -12
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +59 -16
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +47 -13
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +46 -12
- package/dist/components/layouts/AntNavLeftLayout.vue +12 -6
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +10 -2
- package/dist/components/navbar/AntNavbar.vue +7 -3
- package/dist/components/navbar/AntNavbarItem.vue +12 -6
- package/dist/components/navbar/__stories/AntNavbar.stories.mjs +59 -37
- package/dist/components/table/AntCollapsibleTableRowContent.vue +7 -5
- package/dist/components/table/AntTable.vue +227 -165
- package/dist/components/table/AntTableSkeleton.vue +126 -0
- package/dist/components/table/AntTableSortButton.vue +22 -13
- package/dist/components/table/AntTd.vue +21 -17
- package/dist/components/table/AntTh.vue +19 -12
- package/dist/components/table/__stories/AntTable.stories.js +132 -14
- package/dist/components/table/__stories/AntTable.stories.mjs +253 -31
- package/dist/components/table/__types/index.d.ts +0 -1
- package/dist/components/table/__types/index.js +0 -11
- package/dist/components/table/__types/index.mjs +0 -1
- package/dist/components/tabs/AntTabItem.vue +20 -8
- package/dist/components/tabs/AntTabs.vue +35 -21
- package/dist/components/tabs/__stories/AntTabItem.stories.mjs +23 -7
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +45 -13
- package/dist/components/transitions/AntTransitionCollapseHeight.vue +1 -1
- package/dist/composables/useToaster.mjs +25 -7
- package/dist/index.css +1 -0
- package/dist/utils.mjs +3 -1
- package/package.json +23 -16
- package/dist/tailwind.config.d.ts +0 -3
- package/dist/tailwind.config.js +0 -198
- package/dist/tailwind.config.mjs +0 -189
|
@@ -3,19 +3,27 @@
|
|
|
3
3
|
import AntSearch from '../inputs/AntSearch.vue';
|
|
4
4
|
import AntCreateButton from '../buttons/AntCreateButton.vue';
|
|
5
5
|
import AntDropdown from '../AntDropdown.vue';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
computed, ref, watch,
|
|
8
|
+
} from 'vue';
|
|
7
9
|
import AntButton from '../buttons/AntButton.vue';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
import {
|
|
11
|
+
faFilter, faMultiply,
|
|
12
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
13
|
+
import {
|
|
14
|
+
State, Grouped, Position,
|
|
15
|
+
} from '../../enums';
|
|
16
|
+
import {
|
|
17
|
+
useRoute, useRouter,
|
|
18
|
+
} from 'vue-router';
|
|
11
19
|
|
|
12
20
|
const props = withDefaults(defineProps<{
|
|
13
|
-
fullWidth?: boolean
|
|
14
|
-
showFilter?: boolean
|
|
15
|
-
searchQuery?: string
|
|
16
|
-
hasFilter?: boolean
|
|
17
|
-
canCreate?: boolean
|
|
18
|
-
skeleton?: boolean
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
showFilter?: boolean;
|
|
23
|
+
searchQuery?: string;
|
|
24
|
+
hasFilter?: boolean;
|
|
25
|
+
canCreate?: boolean;
|
|
26
|
+
skeleton?: boolean;
|
|
19
27
|
}>(), {
|
|
20
28
|
fullWidth: true,
|
|
21
29
|
showFilter: true,
|
|
@@ -24,7 +32,11 @@ const props = withDefaults(defineProps<{
|
|
|
24
32
|
canCreate: true,
|
|
25
33
|
skeleton: false,
|
|
26
34
|
});
|
|
27
|
-
const emit = defineEmits([
|
|
35
|
+
const emit = defineEmits([
|
|
36
|
+
'search',
|
|
37
|
+
'create',
|
|
38
|
+
'removeFilter',
|
|
39
|
+
]);
|
|
28
40
|
const router = useRouter();
|
|
29
41
|
const route = useRoute();
|
|
30
42
|
|
|
@@ -35,7 +47,7 @@ const search = computed({
|
|
|
35
47
|
set: (value) => {
|
|
36
48
|
const query = {
|
|
37
49
|
...route.query,
|
|
38
|
-
[props.searchQuery]: value
|
|
50
|
+
[props.searchQuery]: value,
|
|
39
51
|
};
|
|
40
52
|
|
|
41
53
|
if (!value) {
|
|
@@ -45,12 +57,12 @@ const search = computed({
|
|
|
45
57
|
(async () => {
|
|
46
58
|
await router.replace({
|
|
47
59
|
...route,
|
|
48
|
-
query
|
|
60
|
+
query,
|
|
49
61
|
});
|
|
50
62
|
|
|
51
63
|
emit('search', value);
|
|
52
64
|
})();
|
|
53
|
-
}
|
|
65
|
+
},
|
|
54
66
|
});
|
|
55
67
|
|
|
56
68
|
watch(() => props.fullWidth, (val) => {
|
|
@@ -66,8 +78,8 @@ watch(() => props.fullWidth, (val) => {
|
|
|
66
78
|
data-e2e="crud-table-filter"
|
|
67
79
|
>
|
|
68
80
|
<div
|
|
69
|
-
class="flex gap-2.5
|
|
70
|
-
:class="{'
|
|
81
|
+
class="flex gap-2.5 grow"
|
|
82
|
+
:class="{'grow': !_fullWidth}"
|
|
71
83
|
>
|
|
72
84
|
<div :class="{'w-80': _fullWidth, 'w-full': !_fullWidth}">
|
|
73
85
|
<AntSearch
|
|
@@ -102,7 +114,7 @@ watch(() => props.fullWidth, (val) => {
|
|
|
102
114
|
</div>
|
|
103
115
|
|
|
104
116
|
<template #content>
|
|
105
|
-
<slot name="dropdownContent"/>
|
|
117
|
+
<slot name="dropdownContent" />
|
|
106
118
|
</template>
|
|
107
119
|
</AntDropdown>
|
|
108
120
|
</div>
|
|
@@ -4,40 +4,52 @@
|
|
|
4
4
|
* TODO:: test me in storybook through vue router
|
|
5
5
|
* TODO:: fix ts errors
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
useRouter, useRoute,
|
|
9
|
+
} from 'vue-router';
|
|
8
10
|
import AntPagination from '../AntPagination.vue';
|
|
9
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
computed, ref, watch,
|
|
13
|
+
} from 'vue';
|
|
10
14
|
import AntSelect from '../inputs/AntSelect.vue';
|
|
11
15
|
import AntSkeleton from '../AntSkeleton.vue';
|
|
12
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
type SelectOption,
|
|
18
|
+
} from '../inputs/__types';
|
|
13
19
|
|
|
14
|
-
const emit = defineEmits([
|
|
20
|
+
const emit = defineEmits([
|
|
21
|
+
'changeItemsPerPage',
|
|
22
|
+
'changePage',
|
|
23
|
+
]);
|
|
15
24
|
const props = withDefaults(
|
|
16
25
|
defineProps<{
|
|
17
|
-
count: number | null
|
|
18
|
-
pageQuery?: string
|
|
19
|
-
itemsPerPageQuery?: string
|
|
20
|
-
fullWidth?: boolean
|
|
21
|
-
validItemsPerPage?: number[]
|
|
22
|
-
skeleton?: boolean
|
|
26
|
+
count: number | null;
|
|
27
|
+
pageQuery?: string;
|
|
28
|
+
itemsPerPageQuery?: string;
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
validItemsPerPage?: number[];
|
|
31
|
+
skeleton?: boolean;
|
|
23
32
|
}>(),
|
|
24
33
|
{
|
|
25
34
|
pageQuery: 'p',
|
|
26
35
|
itemsPerPageQuery: 'ipp',
|
|
27
36
|
fullWidth: true,
|
|
28
|
-
validItemsPerPage: () => [
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
validItemsPerPage: () => [
|
|
38
|
+
20,
|
|
39
|
+
50,
|
|
40
|
+
100,
|
|
41
|
+
200,
|
|
42
|
+
],
|
|
43
|
+
skeleton: false,
|
|
44
|
+
},
|
|
31
45
|
);
|
|
32
46
|
|
|
33
47
|
const route = useRoute();
|
|
34
48
|
const router = useRouter();
|
|
35
|
-
const itemsPerPageOptions = computed(() =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}) as SelectOption)
|
|
40
|
-
);
|
|
49
|
+
const itemsPerPageOptions = computed(() => props.validItemsPerPage.map(item => ({
|
|
50
|
+
label: `${item}`,
|
|
51
|
+
value: item,
|
|
52
|
+
}) as SelectOption));
|
|
41
53
|
const page = computed(() => {
|
|
42
54
|
const _page = route.query[props.pageQuery] >= 1 ? Number.parseInt(route.query[props.pageQuery]) : 1;
|
|
43
55
|
|
|
@@ -54,19 +66,21 @@ const itemsPerPage = computed({
|
|
|
54
66
|
props.validItemsPerPage[0];
|
|
55
67
|
},
|
|
56
68
|
set(val) {
|
|
57
|
-
const query = {
|
|
69
|
+
const query = {
|
|
70
|
+
...route.query,
|
|
71
|
+
};
|
|
58
72
|
query[props.itemsPerPageQuery] = `${val}`;
|
|
59
73
|
delete query[props.pageQuery];
|
|
60
74
|
|
|
61
75
|
(async () => {
|
|
62
76
|
await router.push({
|
|
63
77
|
...route,
|
|
64
|
-
query
|
|
78
|
+
query,
|
|
65
79
|
});
|
|
66
80
|
|
|
67
81
|
emit('changeItemsPerPage', val);
|
|
68
82
|
})();
|
|
69
|
-
}
|
|
83
|
+
},
|
|
70
84
|
});
|
|
71
85
|
const fromItems = computed(() => (itemsPerPage.value * (page.value - 1)) + 1);
|
|
72
86
|
const toItems = computed(() => {
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
ref,
|
|
4
|
+
watch
|
|
5
|
+
} from "vue";
|
|
2
6
|
import AntTabs from "../../tabs/AntTabs.vue";
|
|
3
7
|
import AntCrud from "../AntCrud.vue";
|
|
4
8
|
import AntCrudTableNav from "../AntCrudTableNav.vue";
|
|
5
9
|
import AntTable from "../../table/AntTable.vue";
|
|
6
10
|
import AntCrudTableFilter from "../AntCrudTableFilter.vue";
|
|
7
11
|
import AntCrudDetail from "../AntCrudDetail.vue";
|
|
8
|
-
import {
|
|
9
|
-
|
|
12
|
+
import {
|
|
13
|
+
AntTableRowTypes
|
|
14
|
+
} from "../../table/__types/TableHeader.types.mjs";
|
|
15
|
+
import {
|
|
16
|
+
vueRouter
|
|
17
|
+
} from "storybook-vue3-router";
|
|
10
18
|
const meta = {
|
|
11
19
|
title: "Crud/Crud",
|
|
12
20
|
component: AntCrud,
|
|
13
21
|
parameters: {
|
|
14
|
-
controls: {
|
|
22
|
+
controls: {
|
|
23
|
+
sort: "requiredFirst"
|
|
24
|
+
},
|
|
15
25
|
fullscreen: true
|
|
16
26
|
},
|
|
17
27
|
decorators: [
|
|
18
|
-
() => ({
|
|
28
|
+
() => ({
|
|
29
|
+
template: '<div class="dashed h-80"><story/></div>'
|
|
30
|
+
}),
|
|
19
31
|
vueRouter()
|
|
20
32
|
],
|
|
21
33
|
argTypes: {}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import AntCrudDetail from "../AntCrudDetail.vue";
|
|
2
2
|
import AntCrudDetailNav from "../AntCrudDetailNav.vue";
|
|
3
3
|
import AntCrudDetailActions from "../AntCrudDetailActions.vue";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
vueRouter
|
|
6
|
+
} from "storybook-vue3-router";
|
|
5
7
|
const meta = {
|
|
6
8
|
title: "Crud/Crud Detail",
|
|
7
9
|
component: AntCrudDetail,
|
|
8
|
-
parameters: {
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: {
|
|
12
|
+
sort: "requiredFirst"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
9
15
|
decorators: [
|
|
10
|
-
() => ({
|
|
16
|
+
() => ({
|
|
17
|
+
template: '<div class="dashed h-80"><story/></div>'
|
|
18
|
+
}),
|
|
11
19
|
vueRouter()
|
|
12
20
|
],
|
|
13
21
|
argTypes: {}
|
|
@@ -3,8 +3,16 @@ import AntCrudDetailActions from "../AntCrudDetailActions.vue";
|
|
|
3
3
|
const meta = {
|
|
4
4
|
title: "Crud/Crud Detail Actions",
|
|
5
5
|
component: AntCrudDetailActions,
|
|
6
|
-
parameters: {
|
|
7
|
-
|
|
6
|
+
parameters: {
|
|
7
|
+
controls: {
|
|
8
|
+
sort: "requiredFirst"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
decorators: [
|
|
12
|
+
() => ({
|
|
13
|
+
template: '<div class="border border-dashed border-base-300"><story/></div>'
|
|
14
|
+
})
|
|
15
|
+
],
|
|
8
16
|
argTypes: {}
|
|
9
17
|
};
|
|
10
18
|
export default meta;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import AntTabs from "../../tabs/AntTabs.vue";
|
|
2
2
|
import AntCrudDetailNav from "../AntCrudDetailNav.vue";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
vueRouter
|
|
5
|
+
} from "storybook-vue3-router";
|
|
4
6
|
const meta = {
|
|
5
7
|
title: "Crud/Crud Detail Nav",
|
|
6
8
|
component: AntCrudDetailNav,
|
|
7
|
-
parameters: {
|
|
9
|
+
parameters: {
|
|
10
|
+
controls: {
|
|
11
|
+
sort: "requiredFirst"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
decorators: [
|
|
9
|
-
() => ({
|
|
15
|
+
() => ({
|
|
16
|
+
template: '<div class="dashed"><story/></div>'
|
|
17
|
+
}),
|
|
10
18
|
vueRouter()
|
|
11
19
|
],
|
|
12
20
|
argTypes: {}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import AntCrudTableFilter from "../AntCrudTableFilter.vue";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
vueRouter
|
|
4
|
+
} from "storybook-vue3-router";
|
|
3
5
|
const meta = {
|
|
4
6
|
title: "Crud/Crud Table Filter",
|
|
5
7
|
component: AntCrudTableFilter,
|
|
6
|
-
parameters: {
|
|
8
|
+
parameters: {
|
|
9
|
+
controls: {
|
|
10
|
+
sort: "requiredFirst"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
7
13
|
argTypes: {},
|
|
8
|
-
decorators: [
|
|
14
|
+
decorators: [
|
|
15
|
+
vueRouter()
|
|
16
|
+
]
|
|
9
17
|
};
|
|
10
18
|
export default meta;
|
|
11
19
|
export const Docs = {
|
|
12
20
|
render: (args) => ({
|
|
13
|
-
components: {
|
|
21
|
+
components: {
|
|
22
|
+
AntCrudTableFilter
|
|
23
|
+
},
|
|
14
24
|
setup() {
|
|
15
|
-
return {
|
|
25
|
+
return {
|
|
26
|
+
args
|
|
27
|
+
};
|
|
16
28
|
},
|
|
17
29
|
template: `
|
|
18
30
|
<div class="border border-base-300 border-dashed">
|
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
import AntCrudTableNav from "../AntCrudTableNav.vue";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
vueRouter
|
|
4
|
+
} from "storybook-vue3-router";
|
|
3
5
|
const meta = {
|
|
4
6
|
title: "Crud/Crud Table Nav",
|
|
5
7
|
component: AntCrudTableNav,
|
|
6
|
-
parameters: {
|
|
8
|
+
parameters: {
|
|
9
|
+
controls: {
|
|
10
|
+
sort: "requiredFirst"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
7
13
|
argTypes: {
|
|
8
14
|
pageQuery: {
|
|
9
15
|
description: "Which query parameter should be used, for writing the current page into it."
|
|
10
16
|
}
|
|
11
17
|
},
|
|
12
|
-
decorators: [
|
|
18
|
+
decorators: [
|
|
19
|
+
vueRouter()
|
|
20
|
+
]
|
|
13
21
|
};
|
|
14
22
|
export default meta;
|
|
15
23
|
export const Docs = {
|
|
16
24
|
render: (args) => ({
|
|
17
|
-
components: {
|
|
25
|
+
components: {
|
|
26
|
+
AntCrudTableNav
|
|
27
|
+
},
|
|
18
28
|
setup() {
|
|
19
|
-
return {
|
|
29
|
+
return {
|
|
30
|
+
args
|
|
31
|
+
};
|
|
20
32
|
},
|
|
21
33
|
template: `
|
|
22
34
|
<div class="dashed">
|
|
@@ -30,9 +42,13 @@ export const Docs = {
|
|
|
30
42
|
};
|
|
31
43
|
export const fullWidth = {
|
|
32
44
|
render: (args) => ({
|
|
33
|
-
components: {
|
|
45
|
+
components: {
|
|
46
|
+
AntCrudTableNav
|
|
47
|
+
},
|
|
34
48
|
setup() {
|
|
35
|
-
return {
|
|
49
|
+
return {
|
|
50
|
+
args
|
|
51
|
+
};
|
|
36
52
|
},
|
|
37
53
|
template: `
|
|
38
54
|
<div class="p-4 flex gap-4">
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
InputState,
|
|
4
|
+
} from '../../enums';
|
|
3
5
|
import AntDialog from './AntDialog.vue';
|
|
4
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
useVModel,
|
|
8
|
+
} from '@vueuse/core';
|
|
5
9
|
|
|
6
|
-
const emit = defineEmits([
|
|
10
|
+
const emit = defineEmits([
|
|
11
|
+
'update:open',
|
|
12
|
+
'close',
|
|
13
|
+
'confirm',
|
|
14
|
+
]);
|
|
7
15
|
const props = defineProps<{
|
|
8
|
-
open: boolean
|
|
9
|
-
entity: string
|
|
16
|
+
open: boolean;
|
|
17
|
+
entity: string;
|
|
10
18
|
}>();
|
|
11
19
|
|
|
12
20
|
const _open = useVModel(props, 'open', emit);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
// TODO:: remove ts ignore
|
|
3
3
|
// @ts-nocheck
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
computed, ref, watch,
|
|
6
|
+
} from 'vue';
|
|
5
7
|
import AntButton from '../buttons/AntButton.vue';
|
|
6
8
|
import AntIcon from '../AntIcon.vue';
|
|
7
9
|
import {
|
|
@@ -11,17 +13,25 @@ import {
|
|
|
11
13
|
faInfoCircle,
|
|
12
14
|
type IconDefinition,
|
|
13
15
|
} from '@fortawesome/free-solid-svg-icons';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
State, InputState,
|
|
18
|
+
} from '../../enums';
|
|
19
|
+
import {
|
|
20
|
+
IconSize,
|
|
21
|
+
} from '../__types';
|
|
22
|
+
|
|
23
|
+
const emit = defineEmits([
|
|
24
|
+
'update:open',
|
|
25
|
+
'close',
|
|
26
|
+
'confirm',
|
|
27
|
+
]);
|
|
18
28
|
const props = withDefaults(defineProps<{
|
|
19
|
-
title?: string
|
|
20
|
-
open: boolean
|
|
21
|
-
confirmText?: string
|
|
22
|
-
cancelText?: string
|
|
23
|
-
showCancel?: boolean
|
|
24
|
-
state?: InputState
|
|
29
|
+
title?: string;
|
|
30
|
+
open: boolean;
|
|
31
|
+
confirmText?: string;
|
|
32
|
+
cancelText?: string;
|
|
33
|
+
showCancel?: boolean;
|
|
34
|
+
state?: InputState;
|
|
25
35
|
}>(), {
|
|
26
36
|
state: InputState.base,
|
|
27
37
|
confirmText: 'Confirm',
|
|
@@ -84,7 +94,7 @@ function confirmDialog() {
|
|
|
84
94
|
<Transition name="fade">
|
|
85
95
|
<div
|
|
86
96
|
v-if="openBackground"
|
|
87
|
-
class="absolute inset-0 flex items-center justify-center z-50 cursor-pointer overflow-hidden bg-black/50 backdrop-blur-
|
|
97
|
+
class="absolute inset-0 flex items-center justify-center z-50 cursor-pointer overflow-hidden bg-black/50 backdrop-blur-xs"
|
|
88
98
|
data-e2e="dialog"
|
|
89
99
|
@click.self="closeDialog"
|
|
90
100
|
>
|
|
@@ -113,7 +123,7 @@ function confirmDialog() {
|
|
|
113
123
|
/>
|
|
114
124
|
</slot>
|
|
115
125
|
|
|
116
|
-
<slot/>
|
|
126
|
+
<slot />
|
|
117
127
|
</div>
|
|
118
128
|
|
|
119
129
|
<div
|
|
@@ -3,15 +3,24 @@ import AntButton from "../../buttons/AntButton.vue";
|
|
|
3
3
|
const meta = {
|
|
4
4
|
title: "Components/Dialogs/Delete Dialog",
|
|
5
5
|
component: AntDeleteDialog,
|
|
6
|
-
parameters: {
|
|
6
|
+
parameters: {
|
|
7
|
+
controls: {
|
|
8
|
+
sort: "requiredFirst"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
7
11
|
argTypes: {}
|
|
8
12
|
};
|
|
9
13
|
export default meta;
|
|
10
14
|
export const Docs = {
|
|
11
15
|
render: (args) => ({
|
|
12
|
-
components: {
|
|
16
|
+
components: {
|
|
17
|
+
AntDeleteDialog,
|
|
18
|
+
AntButton
|
|
19
|
+
},
|
|
13
20
|
setup() {
|
|
14
|
-
return {
|
|
21
|
+
return {
|
|
22
|
+
args
|
|
23
|
+
};
|
|
15
24
|
},
|
|
16
25
|
template: `
|
|
17
26
|
<div class="h-96">
|
|
@@ -1,28 +1,49 @@
|
|
|
1
1
|
import AntDialog from "../AntDialog.vue";
|
|
2
2
|
import AntButton from "../../buttons/AntButton.vue";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
InputState
|
|
5
|
+
} from "../../../enums/index.mjs";
|
|
4
6
|
const meta = {
|
|
5
7
|
title: "Components/Dialogs/Dialog",
|
|
6
8
|
component: AntDialog,
|
|
7
|
-
parameters: {
|
|
8
|
-
|
|
9
|
+
parameters: {
|
|
10
|
+
controls: {
|
|
11
|
+
sort: "requiredFirst"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
decorators: [
|
|
15
|
+
() => ({
|
|
16
|
+
template: '<div class="border border-dashed border-base-300"><story/></div>'
|
|
17
|
+
})
|
|
18
|
+
],
|
|
9
19
|
argTypes: {
|
|
10
20
|
state: {
|
|
11
|
-
control: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "select"
|
|
23
|
+
},
|
|
12
24
|
options: Object.values(InputState)
|
|
13
25
|
},
|
|
14
26
|
title: {
|
|
15
27
|
control: "text",
|
|
16
|
-
table: {
|
|
28
|
+
table: {
|
|
29
|
+
type: {
|
|
30
|
+
summary: "string|null"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
17
33
|
}
|
|
18
34
|
}
|
|
19
35
|
};
|
|
20
36
|
export default meta;
|
|
21
37
|
export const Docs = {
|
|
22
38
|
render: (args) => ({
|
|
23
|
-
components: {
|
|
39
|
+
components: {
|
|
40
|
+
AntDialog,
|
|
41
|
+
AntButton
|
|
42
|
+
},
|
|
24
43
|
setup() {
|
|
25
|
-
return {
|
|
44
|
+
return {
|
|
45
|
+
args
|
|
46
|
+
};
|
|
26
47
|
},
|
|
27
48
|
template: `
|
|
28
49
|
<div
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
onMounted, computed,
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import {
|
|
6
|
+
Size,
|
|
7
|
+
} from '../../enums/Size.enum';
|
|
4
8
|
import AntInputLabel from '../inputs/Elements/AntInputLabel.vue';
|
|
5
9
|
import AntInputDescription from '../inputs/Elements/AntInputDescription.vue';
|
|
6
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
handleEnumValidation,
|
|
12
|
+
} from '../../handler';
|
|
7
13
|
import AntInputLimiter from '../inputs/Elements/AntInputLimiter.vue';
|
|
8
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
InputState,
|
|
16
|
+
} from '../../enums';
|
|
9
17
|
|
|
10
|
-
defineEmits([
|
|
18
|
+
defineEmits([
|
|
19
|
+
'clickLabel',
|
|
20
|
+
'validate',
|
|
21
|
+
]);
|
|
11
22
|
|
|
12
23
|
const props = withDefaults(defineProps<{
|
|
13
24
|
label?: string;
|
|
@@ -74,7 +85,7 @@ const descriptionClasses = computed(() => ({
|
|
|
74
85
|
@click-content="$emit('clickLabel')"
|
|
75
86
|
>
|
|
76
87
|
<div class="w-full h-full">
|
|
77
|
-
<slot/>
|
|
88
|
+
<slot />
|
|
78
89
|
</div>
|
|
79
90
|
</AntInputLabel>
|
|
80
91
|
|
|
@@ -114,7 +125,7 @@ const descriptionClasses = computed(() => ({
|
|
|
114
125
|
|
|
115
126
|
<div
|
|
116
127
|
v-if="limiterMaxValue !== undefined && limiterValue !== undefined"
|
|
117
|
-
class="flex
|
|
128
|
+
class="flex grow justify-end"
|
|
118
129
|
>
|
|
119
130
|
<AntInputLimiter
|
|
120
131
|
:value="limiterValue"
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
Direction,
|
|
4
|
+
} from '../../enums/Direction.enum';
|
|
5
|
+
import {
|
|
6
|
+
computed, useAttrs,
|
|
7
|
+
} from 'vue';
|
|
4
8
|
|
|
5
9
|
const attrs = useAttrs();
|
|
6
10
|
const props = withDefaults(defineProps<{
|
|
@@ -11,7 +15,7 @@ const props = withDefaults(defineProps<{
|
|
|
11
15
|
|
|
12
16
|
const classes = computed(() => {
|
|
13
17
|
// Let override gap-x-* and gap-y-* classes from outside
|
|
14
|
-
const attrClasses = typeof attrs.class === 'string' ? attrs.class : ''
|
|
18
|
+
const attrClasses = typeof attrs.class === 'string' ? attrs.class : '';
|
|
15
19
|
const hasGapX = /gap-x-\d/.test(attrClasses);
|
|
16
20
|
const hasGapY = /gap-y-\d/.test(attrClasses);
|
|
17
21
|
|
|
@@ -20,7 +24,7 @@ const classes = computed(() => {
|
|
|
20
24
|
'gap-y-2.5': !hasGapY && props.direction === Direction.column,
|
|
21
25
|
'flex-row': props.direction === Direction.row,
|
|
22
26
|
'gap-x-2.5': !hasGapX && props.direction === Direction.row,
|
|
23
|
-
}
|
|
27
|
+
};
|
|
24
28
|
|
|
25
29
|
return classes;
|
|
26
30
|
});
|
|
@@ -31,6 +35,6 @@ const classes = computed(() => {
|
|
|
31
35
|
class="flex"
|
|
32
36
|
:class="classes"
|
|
33
37
|
>
|
|
34
|
-
<slot/>
|
|
38
|
+
<slot />
|
|
35
39
|
</section>
|
|
36
40
|
</template>
|