@antify/ui 2.5.6 → 3.0.0
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 +5 -6
- package/dist/components/AntAccordionItem.vue +5 -7
- package/dist/components/AntAlert.vue +53 -54
- package/dist/components/{buttons/AntButton.vue → AntButton.vue} +69 -71
- package/dist/components/AntCard.vue +10 -11
- package/dist/components/{dialogs/AntDialog.vue → AntDialog.vue} +4 -4
- package/dist/components/AntIcon.vue +8 -8
- package/dist/components/AntKeycap.vue +15 -15
- package/dist/components/AntListGroup.vue +10 -10
- package/dist/components/AntModal.vue +6 -6
- package/dist/components/AntPagination.vue +39 -41
- package/dist/components/AntSkeleton.vue +5 -25
- package/dist/components/AntToast.vue +1 -1
- package/dist/components/{buttons/__stories → __stories}/AntButton.stories.js +6 -6
- package/dist/components/{buttons/__stories → __stories}/AntButton.stories.mjs +6 -6
- package/dist/components/{dialogs/__stories → __stories}/AntDialog.stories.js +3 -3
- package/dist/components/{dialogs/__stories → __stories}/AntDialog.stories.mjs +3 -3
- package/dist/components/__stories/AntDropdown.stories.js +1 -1
- package/dist/components/__stories/AntDropdown.stories.mjs +1 -1
- package/dist/components/__stories/AntListGroup.stories.js +6 -9
- package/dist/components/__stories/AntListGroup.stories.mjs +6 -9
- package/dist/components/__stories/AntListGroupItem.stories.js +1 -1
- package/dist/components/__stories/AntListGroupItem.stories.mjs +1 -1
- package/dist/components/__stories/AntModal.stories.js +1 -1
- package/dist/components/__stories/AntModal.stories.mjs +1 -1
- package/dist/components/__stories/AntPopover.stories.js +1 -1
- package/dist/components/__stories/AntPopover.stories.mjs +1 -1
- package/dist/components/__stories/AntProgress.stories.js +1 -1
- package/dist/components/__stories/AntProgress.stories.mjs +1 -1
- package/dist/components/__stories/AntToaster.stories.js +1 -1
- package/dist/components/__stories/AntToaster.stories.mjs +1 -1
- package/dist/components/__stories/AntTooltip.stories.js +1 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +1 -1
- package/dist/components/__types/index.d.ts +1 -0
- package/dist/components/__types/index.js +11 -0
- package/dist/components/__types/index.mjs +1 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.js +1 -1
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +1 -1
- package/dist/components/index.d.ts +3 -17
- package/dist/components/index.js +2 -100
- package/dist/components/index.mjs +2 -30
- package/dist/components/inputs/AntCheckbox.vue +8 -9
- package/dist/components/inputs/AntColorInput/AntColorInput.vue +6 -11
- package/dist/components/inputs/AntDateInput.vue +1 -1
- package/dist/components/inputs/AntImageInput.vue +35 -37
- package/dist/components/inputs/AntNumberInput.vue +1 -1
- package/dist/components/inputs/AntRadio.vue +8 -9
- package/dist/components/inputs/AntSelect.vue +65 -64
- package/dist/components/inputs/AntSwitch.vue +26 -27
- package/dist/components/inputs/AntSwitcher.vue +13 -12
- package/dist/components/inputs/AntTagInput.vue +6 -10
- package/dist/components/inputs/AntTextarea.vue +5 -9
- package/dist/components/inputs/AntUnitInput.vue +1 -1
- package/dist/components/inputs/Elements/AntBaseInput.vue +60 -60
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +1 -1
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +1 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.js +41 -14
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +41 -14
- package/dist/components/inputs/__stories/AntPasswordInput.stories.js +1 -1
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +1 -1
- package/dist/components/inputs/__stories/AntTextInput.stories.js +1 -1
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +1 -1
- package/dist/components/table/AntTable.vue +12 -8
- package/dist/components/table/AntTableSkeleton.vue +5 -1
- package/dist/components/table/AntTableSortButton.vue +1 -1
- package/dist/components/table/__stories/AntTable.stories.js +1 -1
- package/dist/components/table/__stories/AntTable.stories.mjs +1 -1
- package/dist/components/tabs/AntTabItem.vue +5 -7
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +11 -0
- package/dist/composables/index.mjs +1 -0
- package/dist/composables/useFlickerProtection.d.ts +22 -0
- package/dist/composables/useFlickerProtection.js +48 -0
- package/dist/composables/useFlickerProtection.mjs +48 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.js +5 -16
- package/dist/types.mjs +0 -1
- package/package.json +5 -1
- package/dist/components/buttons/AntActionButton.vue +0 -83
- package/dist/components/buttons/AntCreateButton.vue +0 -61
- package/dist/components/buttons/AntDeleteButton.vue +0 -61
- package/dist/components/buttons/AntDuplicateButton.vue +0 -61
- package/dist/components/buttons/AntEditButton.vue +0 -61
- package/dist/components/buttons/AntSaveAndNewButton.vue +0 -63
- package/dist/components/buttons/AntSaveButton.vue +0 -62
- package/dist/components/buttons/__stories/AntActionButton.stories.d.ts +0 -11
- package/dist/components/buttons/__stories/AntActionButton.stories.js +0 -111
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +0 -111
- package/dist/components/buttons/__stories/AntCreateButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntCreateButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntDeleteButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntDeleteButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntEditButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntEditButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +0 -94
- package/dist/components/buttons/__stories/AntSaveButton.stories.d.ts +0 -12
- package/dist/components/buttons/__stories/AntSaveButton.stories.js +0 -97
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +0 -94
- package/dist/components/buttons/__types/index.d.ts +0 -1
- package/dist/components/buttons/__types/index.js +0 -16
- package/dist/components/buttons/__types/index.mjs +0 -1
- package/dist/components/crud/AntCrud.vue +0 -75
- package/dist/components/crud/AntCrudDetail.vue +0 -14
- package/dist/components/crud/AntCrudDetailActions.vue +0 -65
- package/dist/components/crud/AntCrudDetailNav.vue +0 -72
- package/dist/components/crud/AntCrudTableFilter.vue +0 -141
- package/dist/components/crud/AntCrudTableNav.vue +0 -163
- package/dist/components/crud/__stories/AntCrud.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrud.stories.js +0 -131
- package/dist/components/crud/__stories/AntCrud.stories.mjs +0 -142
- package/dist/components/crud/__stories/AntCrudDetail.stories.d.ts +0 -7
- package/dist/components/crud/__stories/AntCrudDetail.stories.js +0 -90
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +0 -92
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.js +0 -38
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +0 -33
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.js +0 -51
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +0 -53
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.d.ts +0 -6
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.js +0 -42
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +0 -39
- package/dist/components/crud/__stories/AntCrudTableNav.stories.d.ts +0 -8
- package/dist/components/crud/__stories/AntCrudTableNav.stories.js +0 -77
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +0 -74
- package/dist/components/dialogs/AntDeleteDialog.vue +0 -37
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.d.ts +0 -6
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.js +0 -48
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +0 -41
- /package/dist/components/{buttons/__stories → __stories}/AntButton.stories.d.ts +0 -0
- /package/dist/components/{dialogs/__stories → __stories}/AntDialog.stories.d.ts +0 -0
- /package/dist/components/{buttons/__types → __types}/AntButton.types.d.ts +0 -0
- /package/dist/components/{buttons/__types → __types}/AntButton.types.js +0 -0
- /package/dist/components/{buttons/__types → __types}/AntButton.types.mjs +0 -0
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
/**
|
|
4
|
-
* TODO:: test me in storybook through vue router
|
|
5
|
-
* TODO:: fix ts errors
|
|
6
|
-
*/
|
|
7
|
-
import {
|
|
8
|
-
useRouter, useRoute,
|
|
9
|
-
} from 'vue-router';
|
|
10
|
-
import AntPagination from '../AntPagination.vue';
|
|
11
|
-
import {
|
|
12
|
-
computed, ref, watch,
|
|
13
|
-
} from 'vue';
|
|
14
|
-
import AntSelect from '../inputs/AntSelect.vue';
|
|
15
|
-
import AntSkeleton from '../AntSkeleton.vue';
|
|
16
|
-
import {
|
|
17
|
-
type SelectOption,
|
|
18
|
-
} from '../inputs/__types';
|
|
19
|
-
|
|
20
|
-
const emit = defineEmits([
|
|
21
|
-
'changeItemsPerPage',
|
|
22
|
-
'changePage',
|
|
23
|
-
]);
|
|
24
|
-
const props = withDefaults(
|
|
25
|
-
defineProps<{
|
|
26
|
-
count: number | null;
|
|
27
|
-
pageQuery?: string;
|
|
28
|
-
itemsPerPageQuery?: string;
|
|
29
|
-
fullWidth?: boolean;
|
|
30
|
-
validItemsPerPage?: number[];
|
|
31
|
-
skeleton?: boolean;
|
|
32
|
-
}>(),
|
|
33
|
-
{
|
|
34
|
-
pageQuery: 'p',
|
|
35
|
-
itemsPerPageQuery: 'ipp',
|
|
36
|
-
fullWidth: true,
|
|
37
|
-
validItemsPerPage: () => [
|
|
38
|
-
20,
|
|
39
|
-
50,
|
|
40
|
-
100,
|
|
41
|
-
200,
|
|
42
|
-
],
|
|
43
|
-
skeleton: false,
|
|
44
|
-
},
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const route = useRoute();
|
|
48
|
-
const router = useRouter();
|
|
49
|
-
const itemsPerPageOptions = computed(() => props.validItemsPerPage.map(item => ({
|
|
50
|
-
label: `${item}`,
|
|
51
|
-
value: item,
|
|
52
|
-
}) as SelectOption));
|
|
53
|
-
const page = computed(() => {
|
|
54
|
-
const _page = route.query[props.pageQuery] >= 1 ? Number.parseInt(route.query[props.pageQuery]) : 1;
|
|
55
|
-
|
|
56
|
-
if (_page <= 0 || _page > pages.value) {
|
|
57
|
-
return 1;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return _page;
|
|
61
|
-
});
|
|
62
|
-
const itemsPerPage = computed({
|
|
63
|
-
get() {
|
|
64
|
-
return route.query[props.itemsPerPageQuery] ?
|
|
65
|
-
Number.parseInt(route.query[props.itemsPerPageQuery]) :
|
|
66
|
-
props.validItemsPerPage[0];
|
|
67
|
-
},
|
|
68
|
-
set(val) {
|
|
69
|
-
const query = {
|
|
70
|
-
...route.query,
|
|
71
|
-
};
|
|
72
|
-
query[props.itemsPerPageQuery] = `${val}`;
|
|
73
|
-
delete query[props.pageQuery];
|
|
74
|
-
|
|
75
|
-
(async () => {
|
|
76
|
-
await router.push({
|
|
77
|
-
...route,
|
|
78
|
-
query,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
emit('changeItemsPerPage', val);
|
|
82
|
-
})();
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
const fromItems = computed(() => (itemsPerPage.value * (page.value - 1)) + 1);
|
|
86
|
-
const toItems = computed(() => {
|
|
87
|
-
const items = itemsPerPage.value * page.value;
|
|
88
|
-
|
|
89
|
-
if (page.value === pages.value && items > props.count) {
|
|
90
|
-
return props.count;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return itemsPerPage.value * page.value;
|
|
94
|
-
});
|
|
95
|
-
const pages = computed(() => Math.ceil(props.count / itemsPerPage.value));
|
|
96
|
-
const _fullWidth = ref(props.fullWidth);
|
|
97
|
-
|
|
98
|
-
watch(() => props.fullWidth, (val) => {
|
|
99
|
-
setTimeout(() => {
|
|
100
|
-
_fullWidth.value = val;
|
|
101
|
-
}, val ? 300 : 200);
|
|
102
|
-
});
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<template>
|
|
106
|
-
<div
|
|
107
|
-
class="w-full"
|
|
108
|
-
data-e2e="crud-table-nav"
|
|
109
|
-
>
|
|
110
|
-
<div
|
|
111
|
-
class="flex w-full items-center p-2"
|
|
112
|
-
:class="{'justify-end': !_fullWidth, 'justify-between': _fullWidth}"
|
|
113
|
-
>
|
|
114
|
-
<div
|
|
115
|
-
v-if="_fullWidth"
|
|
116
|
-
class="flex gap-2 items-center text-for-white-bg-font text-sm"
|
|
117
|
-
data-e2e="items-per-page"
|
|
118
|
-
>
|
|
119
|
-
<span class="relative">
|
|
120
|
-
<AntSkeleton
|
|
121
|
-
v-if="skeleton"
|
|
122
|
-
rounded
|
|
123
|
-
absolute
|
|
124
|
-
/>
|
|
125
|
-
Items per page
|
|
126
|
-
</span>
|
|
127
|
-
|
|
128
|
-
<AntSelect
|
|
129
|
-
v-model="itemsPerPage"
|
|
130
|
-
:options="itemsPerPageOptions"
|
|
131
|
-
:skeleton="skeleton"
|
|
132
|
-
:expanded="false"
|
|
133
|
-
/>
|
|
134
|
-
|
|
135
|
-
<div
|
|
136
|
-
v-if="count !== null"
|
|
137
|
-
class="flex gap-1 relative"
|
|
138
|
-
>
|
|
139
|
-
<AntSkeleton
|
|
140
|
-
v-if="skeleton"
|
|
141
|
-
rounded
|
|
142
|
-
absolute
|
|
143
|
-
/>
|
|
144
|
-
|
|
145
|
-
<span class="font-medium">{{ fromItems }} - {{ toItems }}</span>
|
|
146
|
-
<span>of</span>
|
|
147
|
-
<span
|
|
148
|
-
class="font-medium"
|
|
149
|
-
data-e2e="total-items"
|
|
150
|
-
>{{ count }}</span>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
|
|
154
|
-
<AntPagination
|
|
155
|
-
:pages="pages"
|
|
156
|
-
:page-query="pageQuery"
|
|
157
|
-
:skeleton="skeleton"
|
|
158
|
-
:light-version="!_fullWidth"
|
|
159
|
-
@input="(val) => emit('changePage', val)"
|
|
160
|
-
/>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</template>
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
module.exports = exports.Docs = void 0;
|
|
7
|
-
var _vue = require("vue");
|
|
8
|
-
var _AntTabs = _interopRequireDefault(require("../../tabs/AntTabs.vue"));
|
|
9
|
-
var _AntCrud = _interopRequireDefault(require("../AntCrud.vue"));
|
|
10
|
-
var _AntCrudTableNav = _interopRequireDefault(require("../AntCrudTableNav.vue"));
|
|
11
|
-
var _AntTable = _interopRequireDefault(require("../../table/AntTable.vue"));
|
|
12
|
-
var _AntCrudTableFilter = _interopRequireDefault(require("../AntCrudTableFilter.vue"));
|
|
13
|
-
var _AntCrudDetail = _interopRequireDefault(require("../AntCrudDetail.vue"));
|
|
14
|
-
var _TableHeader = require("../../table/__types/TableHeader.types");
|
|
15
|
-
var _storybookVue3Router = require("storybook-vue3-router");
|
|
16
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
const meta = {
|
|
18
|
-
title: "Crud/Crud",
|
|
19
|
-
component: _AntCrud.default,
|
|
20
|
-
parameters: {
|
|
21
|
-
controls: {
|
|
22
|
-
sort: "requiredFirst"
|
|
23
|
-
},
|
|
24
|
-
fullscreen: true
|
|
25
|
-
},
|
|
26
|
-
decorators: [() => ({
|
|
27
|
-
template: '<div class="dashed h-80"><story/></div>'
|
|
28
|
-
}), (0, _storybookVue3Router.vueRouter)()],
|
|
29
|
-
argTypes: {}
|
|
30
|
-
};
|
|
31
|
-
module.exports = meta;
|
|
32
|
-
function generateTableData(amount) {
|
|
33
|
-
const tableData = [];
|
|
34
|
-
for (let i = 0; i < amount; i++) {
|
|
35
|
-
tableData.push({
|
|
36
|
-
name: "Lindsay Walton",
|
|
37
|
-
title: "Front-end Developer",
|
|
38
|
-
email: "lindsay.walton@gmail.com",
|
|
39
|
-
streetAddress: "3670 New Road",
|
|
40
|
-
city: "Birmingham",
|
|
41
|
-
country: "United Kingdom"
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return tableData;
|
|
45
|
-
}
|
|
46
|
-
const Docs = exports.Docs = {
|
|
47
|
-
render: args => ({
|
|
48
|
-
components: {
|
|
49
|
-
AntTabs: _AntTabs.default,
|
|
50
|
-
AntTable: _AntTable.default,
|
|
51
|
-
AntCrudTableNav: _AntCrudTableNav.default,
|
|
52
|
-
AntCrud: _AntCrud.default,
|
|
53
|
-
AntCrudTableFilter: _AntCrudTableFilter.default,
|
|
54
|
-
AntCrudDetail: _AntCrudDetail.default
|
|
55
|
-
},
|
|
56
|
-
setup() {
|
|
57
|
-
const selectedDataItem = (0, _vue.ref)(null);
|
|
58
|
-
const fullWidth = (0, _vue.computed)(() => selectedDataItem.value === null && args.showDetail === false);
|
|
59
|
-
(0, _vue.watch)(() => args.showDetail, showDetail => {
|
|
60
|
-
if (showDetail === false) {
|
|
61
|
-
selectedDataItem.value = null;
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return {
|
|
65
|
-
args,
|
|
66
|
-
fullWidth,
|
|
67
|
-
tableData: generateTableData(50),
|
|
68
|
-
tableHeaders: [{
|
|
69
|
-
title: "Name",
|
|
70
|
-
identifier: "name",
|
|
71
|
-
type: _TableHeader.AntTableRowTypes.text,
|
|
72
|
-
lightVersion: true
|
|
73
|
-
}, {
|
|
74
|
-
title: "Title",
|
|
75
|
-
identifier: "title",
|
|
76
|
-
type: _TableHeader.AntTableRowTypes.text,
|
|
77
|
-
lightVersion: true
|
|
78
|
-
}, {
|
|
79
|
-
title: "E-Mail",
|
|
80
|
-
identifier: "email",
|
|
81
|
-
type: _TableHeader.AntTableRowTypes.text
|
|
82
|
-
}, {
|
|
83
|
-
title: "Street Address",
|
|
84
|
-
identifier: "streetAddress",
|
|
85
|
-
type: _TableHeader.AntTableRowTypes.text
|
|
86
|
-
}, {
|
|
87
|
-
title: "City",
|
|
88
|
-
identifier: "city",
|
|
89
|
-
type: _TableHeader.AntTableRowTypes.text
|
|
90
|
-
}, {
|
|
91
|
-
title: "Country",
|
|
92
|
-
identifier: "country",
|
|
93
|
-
type: _TableHeader.AntTableRowTypes.text
|
|
94
|
-
}]
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
template: `
|
|
98
|
-
<AntCrud v-bind="args" :show-detail="!fullWidth">
|
|
99
|
-
<template #search-section>
|
|
100
|
-
<AntCrudTableFilter
|
|
101
|
-
:full-width="fullWidth"
|
|
102
|
-
/>
|
|
103
|
-
</template>
|
|
104
|
-
|
|
105
|
-
<template #table-section>
|
|
106
|
-
<AntTable
|
|
107
|
-
:data="tableData"
|
|
108
|
-
:headers="tableHeaders"
|
|
109
|
-
:show-light-version="!fullWidth"
|
|
110
|
-
selectable-rows
|
|
111
|
-
/>
|
|
112
|
-
</template>
|
|
113
|
-
|
|
114
|
-
<template #table-nav-section>
|
|
115
|
-
<AntCrudTableNav
|
|
116
|
-
:pages="(1000000 * 20)"
|
|
117
|
-
:count="1000000"
|
|
118
|
-
:full-width="fullWidth"
|
|
119
|
-
/>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<AntCrudDetail>
|
|
123
|
-
<div class="m-2.5 slot">
|
|
124
|
-
SLOT
|
|
125
|
-
</div>
|
|
126
|
-
</AntCrudDetail>
|
|
127
|
-
</AntCrud>
|
|
128
|
-
`
|
|
129
|
-
}),
|
|
130
|
-
args: {}
|
|
131
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computed,
|
|
3
|
-
ref,
|
|
4
|
-
watch
|
|
5
|
-
} from "vue";
|
|
6
|
-
import AntTabs from "../../tabs/AntTabs.vue";
|
|
7
|
-
import AntCrud from "../AntCrud.vue";
|
|
8
|
-
import AntCrudTableNav from "../AntCrudTableNav.vue";
|
|
9
|
-
import AntTable from "../../table/AntTable.vue";
|
|
10
|
-
import AntCrudTableFilter from "../AntCrudTableFilter.vue";
|
|
11
|
-
import AntCrudDetail from "../AntCrudDetail.vue";
|
|
12
|
-
import {
|
|
13
|
-
AntTableRowTypes
|
|
14
|
-
} from "../../table/__types/TableHeader.types.mjs";
|
|
15
|
-
import {
|
|
16
|
-
vueRouter
|
|
17
|
-
} from "storybook-vue3-router";
|
|
18
|
-
const meta = {
|
|
19
|
-
title: "Crud/Crud",
|
|
20
|
-
component: AntCrud,
|
|
21
|
-
parameters: {
|
|
22
|
-
controls: {
|
|
23
|
-
sort: "requiredFirst"
|
|
24
|
-
},
|
|
25
|
-
fullscreen: true
|
|
26
|
-
},
|
|
27
|
-
decorators: [
|
|
28
|
-
() => ({
|
|
29
|
-
template: '<div class="dashed h-80"><story/></div>'
|
|
30
|
-
}),
|
|
31
|
-
vueRouter()
|
|
32
|
-
],
|
|
33
|
-
argTypes: {}
|
|
34
|
-
};
|
|
35
|
-
export default meta;
|
|
36
|
-
function generateTableData(amount) {
|
|
37
|
-
const tableData = [];
|
|
38
|
-
for (let i = 0; i < amount; i++) {
|
|
39
|
-
tableData.push({
|
|
40
|
-
name: "Lindsay Walton",
|
|
41
|
-
title: "Front-end Developer",
|
|
42
|
-
email: "lindsay.walton@gmail.com",
|
|
43
|
-
streetAddress: "3670 New Road",
|
|
44
|
-
city: "Birmingham",
|
|
45
|
-
country: "United Kingdom"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return tableData;
|
|
49
|
-
}
|
|
50
|
-
export const Docs = {
|
|
51
|
-
render: (args) => ({
|
|
52
|
-
components: {
|
|
53
|
-
AntTabs,
|
|
54
|
-
AntTable,
|
|
55
|
-
AntCrudTableNav,
|
|
56
|
-
AntCrud,
|
|
57
|
-
AntCrudTableFilter,
|
|
58
|
-
AntCrudDetail
|
|
59
|
-
},
|
|
60
|
-
setup() {
|
|
61
|
-
const selectedDataItem = ref(null);
|
|
62
|
-
const fullWidth = computed(() => selectedDataItem.value === null && args.showDetail === false);
|
|
63
|
-
watch(() => args.showDetail, (showDetail) => {
|
|
64
|
-
if (showDetail === false) {
|
|
65
|
-
selectedDataItem.value = null;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return {
|
|
69
|
-
args,
|
|
70
|
-
fullWidth,
|
|
71
|
-
tableData: generateTableData(50),
|
|
72
|
-
tableHeaders: [
|
|
73
|
-
{
|
|
74
|
-
title: "Name",
|
|
75
|
-
identifier: "name",
|
|
76
|
-
type: AntTableRowTypes.text,
|
|
77
|
-
lightVersion: true
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
title: "Title",
|
|
81
|
-
identifier: "title",
|
|
82
|
-
type: AntTableRowTypes.text,
|
|
83
|
-
lightVersion: true
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
title: "E-Mail",
|
|
87
|
-
identifier: "email",
|
|
88
|
-
type: AntTableRowTypes.text
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
title: "Street Address",
|
|
92
|
-
identifier: "streetAddress",
|
|
93
|
-
type: AntTableRowTypes.text
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
title: "City",
|
|
97
|
-
identifier: "city",
|
|
98
|
-
type: AntTableRowTypes.text
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
title: "Country",
|
|
102
|
-
identifier: "country",
|
|
103
|
-
type: AntTableRowTypes.text
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
};
|
|
107
|
-
},
|
|
108
|
-
template: `
|
|
109
|
-
<AntCrud v-bind="args" :show-detail="!fullWidth">
|
|
110
|
-
<template #search-section>
|
|
111
|
-
<AntCrudTableFilter
|
|
112
|
-
:full-width="fullWidth"
|
|
113
|
-
/>
|
|
114
|
-
</template>
|
|
115
|
-
|
|
116
|
-
<template #table-section>
|
|
117
|
-
<AntTable
|
|
118
|
-
:data="tableData"
|
|
119
|
-
:headers="tableHeaders"
|
|
120
|
-
:show-light-version="!fullWidth"
|
|
121
|
-
selectable-rows
|
|
122
|
-
/>
|
|
123
|
-
</template>
|
|
124
|
-
|
|
125
|
-
<template #table-nav-section>
|
|
126
|
-
<AntCrudTableNav
|
|
127
|
-
:pages="(1000000 * 20)"
|
|
128
|
-
:count="1000000"
|
|
129
|
-
:full-width="fullWidth"
|
|
130
|
-
/>
|
|
131
|
-
</template>
|
|
132
|
-
|
|
133
|
-
<AntCrudDetail>
|
|
134
|
-
<div class="m-2.5 slot">
|
|
135
|
-
SLOT
|
|
136
|
-
</div>
|
|
137
|
-
</AntCrudDetail>
|
|
138
|
-
</AntCrud>
|
|
139
|
-
`
|
|
140
|
-
}),
|
|
141
|
-
args: {}
|
|
142
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type Meta, type StoryObj } from '@storybook/vue3';
|
|
2
|
-
import AntCrudDetail from '../AntCrudDetail.vue';
|
|
3
|
-
declare const meta: Meta<typeof AntCrudDetail>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AntCrudDetail>;
|
|
6
|
-
export declare const Docs: Story;
|
|
7
|
-
export declare const overflownContent: Story;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.overflownContent = exports.default = exports.Docs = void 0;
|
|
7
|
-
var _AntCrudDetail = _interopRequireDefault(require("../AntCrudDetail.vue"));
|
|
8
|
-
var _AntCrudDetailNav = _interopRequireDefault(require("../AntCrudDetailNav.vue"));
|
|
9
|
-
var _AntCrudDetailActions = _interopRequireDefault(require("../AntCrudDetailActions.vue"));
|
|
10
|
-
var _storybookVue3Router = require("storybook-vue3-router");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const meta = {
|
|
13
|
-
title: "Crud/Crud Detail",
|
|
14
|
-
component: _AntCrudDetail.default,
|
|
15
|
-
parameters: {
|
|
16
|
-
controls: {
|
|
17
|
-
sort: "requiredFirst"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
decorators: [() => ({
|
|
21
|
-
template: '<div class="dashed h-80"><story/></div>'
|
|
22
|
-
}), (0, _storybookVue3Router.vueRouter)()],
|
|
23
|
-
argTypes: {}
|
|
24
|
-
};
|
|
25
|
-
module.exports = meta;
|
|
26
|
-
const Docs = exports.Docs = {
|
|
27
|
-
render: args => ({
|
|
28
|
-
components: {
|
|
29
|
-
AntCrudDetail: _AntCrudDetail.default,
|
|
30
|
-
AntCrudDetailNav: _AntCrudDetailNav.default,
|
|
31
|
-
AntCrudDetailActions: _AntCrudDetailActions.default
|
|
32
|
-
},
|
|
33
|
-
setup() {
|
|
34
|
-
return {
|
|
35
|
-
args,
|
|
36
|
-
overflowContent: false,
|
|
37
|
-
tabItems: [{
|
|
38
|
-
id: "1",
|
|
39
|
-
label: "Tab"
|
|
40
|
-
}, {
|
|
41
|
-
id: "2",
|
|
42
|
-
label: "Tab"
|
|
43
|
-
}, {
|
|
44
|
-
id: "3",
|
|
45
|
-
label: "Tab"
|
|
46
|
-
}]
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
template: `
|
|
50
|
-
<AntCrudDetail v-bind="args">
|
|
51
|
-
<template #header>
|
|
52
|
-
<AntCrudDetailNav
|
|
53
|
-
:tab-items="tabItems"
|
|
54
|
-
:get-entity-name="() => 'Lorem ipsum'"
|
|
55
|
-
/>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<div
|
|
59
|
-
class="m-2.5 slot"
|
|
60
|
-
:class="{'h-96': overflowContent}"
|
|
61
|
-
>
|
|
62
|
-
SLOT
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<template #footer>
|
|
66
|
-
<AntCrudDetailActions/>
|
|
67
|
-
</template>
|
|
68
|
-
</AntCrudDetail>
|
|
69
|
-
`
|
|
70
|
-
}),
|
|
71
|
-
args: {}
|
|
72
|
-
};
|
|
73
|
-
const overflownContent = exports.overflownContent = {
|
|
74
|
-
render: (args, ctx) => ({
|
|
75
|
-
// @ts-ignore
|
|
76
|
-
components: Docs.render(args, ctx).components,
|
|
77
|
-
setup() {
|
|
78
|
-
return {
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
...Docs.render(args, ctx).setup(),
|
|
81
|
-
overflowContent: true
|
|
82
|
-
};
|
|
83
|
-
},
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
template: Docs.render(args, ctx).template
|
|
86
|
-
}),
|
|
87
|
-
args: {
|
|
88
|
-
...Docs.args
|
|
89
|
-
}
|
|
90
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import AntCrudDetail from "../AntCrudDetail.vue";
|
|
2
|
-
import AntCrudDetailNav from "../AntCrudDetailNav.vue";
|
|
3
|
-
import AntCrudDetailActions from "../AntCrudDetailActions.vue";
|
|
4
|
-
import {
|
|
5
|
-
vueRouter
|
|
6
|
-
} from "storybook-vue3-router";
|
|
7
|
-
const meta = {
|
|
8
|
-
title: "Crud/Crud Detail",
|
|
9
|
-
component: AntCrudDetail,
|
|
10
|
-
parameters: {
|
|
11
|
-
controls: {
|
|
12
|
-
sort: "requiredFirst"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
decorators: [
|
|
16
|
-
() => ({
|
|
17
|
-
template: '<div class="dashed h-80"><story/></div>'
|
|
18
|
-
}),
|
|
19
|
-
vueRouter()
|
|
20
|
-
],
|
|
21
|
-
argTypes: {}
|
|
22
|
-
};
|
|
23
|
-
export default meta;
|
|
24
|
-
export const Docs = {
|
|
25
|
-
render: (args) => ({
|
|
26
|
-
components: {
|
|
27
|
-
AntCrudDetail,
|
|
28
|
-
AntCrudDetailNav,
|
|
29
|
-
AntCrudDetailActions
|
|
30
|
-
},
|
|
31
|
-
setup() {
|
|
32
|
-
return {
|
|
33
|
-
args,
|
|
34
|
-
overflowContent: false,
|
|
35
|
-
tabItems: [
|
|
36
|
-
{
|
|
37
|
-
id: "1",
|
|
38
|
-
label: "Tab"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: "2",
|
|
42
|
-
label: "Tab"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
id: "3",
|
|
46
|
-
label: "Tab"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
template: `
|
|
52
|
-
<AntCrudDetail v-bind="args">
|
|
53
|
-
<template #header>
|
|
54
|
-
<AntCrudDetailNav
|
|
55
|
-
:tab-items="tabItems"
|
|
56
|
-
:get-entity-name="() => 'Lorem ipsum'"
|
|
57
|
-
/>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<div
|
|
61
|
-
class="m-2.5 slot"
|
|
62
|
-
:class="{'h-96': overflowContent}"
|
|
63
|
-
>
|
|
64
|
-
SLOT
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<template #footer>
|
|
68
|
-
<AntCrudDetailActions/>
|
|
69
|
-
</template>
|
|
70
|
-
</AntCrudDetail>
|
|
71
|
-
`
|
|
72
|
-
}),
|
|
73
|
-
args: {}
|
|
74
|
-
};
|
|
75
|
-
export const overflownContent = {
|
|
76
|
-
render: (args, ctx) => ({
|
|
77
|
-
// @ts-ignore
|
|
78
|
-
components: Docs.render(args, ctx).components,
|
|
79
|
-
setup() {
|
|
80
|
-
return {
|
|
81
|
-
// @ts-ignore
|
|
82
|
-
...Docs.render(args, ctx).setup(),
|
|
83
|
-
overflowContent: true
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
// @ts-ignore
|
|
87
|
-
template: Docs.render(args, ctx).template
|
|
88
|
-
}),
|
|
89
|
-
args: {
|
|
90
|
-
...Docs.args
|
|
91
|
-
}
|
|
92
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type Meta, type StoryObj } from '@storybook/vue3';
|
|
2
|
-
import AntCrudDetailActions from '../AntCrudDetailActions.vue';
|
|
3
|
-
declare const meta: Meta<typeof AntCrudDetailActions>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AntCrudDetailActions>;
|
|
6
|
-
export declare const Docs: Story;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
module.exports = exports.Docs = void 0;
|
|
7
|
-
var _AntTabs = _interopRequireDefault(require("../../tabs/AntTabs.vue"));
|
|
8
|
-
var _AntCrudDetailActions = _interopRequireDefault(require("../AntCrudDetailActions.vue"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
const meta = {
|
|
11
|
-
title: "Crud/Crud Detail Actions",
|
|
12
|
-
component: _AntCrudDetailActions.default,
|
|
13
|
-
parameters: {
|
|
14
|
-
controls: {
|
|
15
|
-
sort: "requiredFirst"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
decorators: [() => ({
|
|
19
|
-
template: '<div class="border border-dashed border-base-300"><story/></div>'
|
|
20
|
-
})],
|
|
21
|
-
argTypes: {}
|
|
22
|
-
};
|
|
23
|
-
module.exports = meta;
|
|
24
|
-
const Docs = exports.Docs = {
|
|
25
|
-
render: args => ({
|
|
26
|
-
components: {
|
|
27
|
-
AntTabs: _AntTabs.default,
|
|
28
|
-
AntCrudDetailActions: _AntCrudDetailActions.default
|
|
29
|
-
},
|
|
30
|
-
setup() {
|
|
31
|
-
return {
|
|
32
|
-
args
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
template: '<AntCrudDetailActions v-bind="args"/>'
|
|
36
|
-
}),
|
|
37
|
-
args: {}
|
|
38
|
-
};
|