@antify/ui 1.0.4 → 1.2.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 +32 -7
- package/dist/components/AntAccordionItem.vue +48 -15
- package/dist/components/AntAlert.vue +8 -6
- package/dist/components/AntDropdown.vue +50 -36
- package/dist/components/AntIcon.vue +8 -6
- package/dist/components/AntKeycap.vue +22 -17
- package/dist/components/AntListGroup.vue +5 -3
- package/dist/components/AntModal.vue +17 -7
- package/dist/components/AntPopover.vue +118 -42
- package/dist/components/AntSkeleton.vue +1 -1
- package/dist/components/AntTooltip.vue +102 -76
- package/dist/components/__stories/AntAccordion.stories.d.ts +1 -0
- package/dist/components/__stories/AntAccordion.stories.js +73 -1
- package/dist/components/__stories/AntAccordion.stories.mjs +68 -0
- package/dist/components/__stories/AntDropdown.stories.js +27 -23
- package/dist/components/__stories/AntDropdown.stories.mjs +26 -22
- package/dist/components/__stories/AntKeycap.stories.js +13 -15
- package/dist/components/__stories/AntKeycap.stories.mjs +13 -13
- package/dist/components/__stories/AntListGroup.stories.js +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +1 -1
- package/dist/components/__stories/AntModal.stories.js +2 -1
- package/dist/components/__stories/AntModal.stories.mjs +2 -1
- package/dist/components/__stories/AntPopover.stories.js +22 -21
- package/dist/components/__stories/AntPopover.stories.mjs +22 -20
- package/dist/components/__stories/AntTooltip.stories.d.ts +0 -10
- package/dist/components/__stories/AntTooltip.stories.js +32 -212
- package/dist/components/__stories/AntTooltip.stories.mjs +29 -193
- package/dist/components/__types/AntKeycap.types.d.ts +1 -0
- package/dist/components/__types/AntKeycap.types.js +1 -0
- package/dist/components/__types/AntKeycap.types.mjs +1 -0
- package/dist/components/buttons/AntButton.vue +41 -44
- package/dist/components/crud/AntCrud.vue +1 -1
- package/dist/components/crud/AntCrudDetailActions.vue +1 -0
- package/dist/components/crud/AntCrudTableFilter.vue +20 -18
- package/dist/components/forms/AntField.vue +7 -2
- package/dist/components/forms/__stories/AntField.stories.js +0 -16
- package/dist/components/forms/__stories/AntField.stories.mjs +2 -16
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +7 -7
- package/dist/components/index.mjs +2 -2
- package/dist/components/inputs/AntCheckbox.vue +25 -6
- package/dist/components/inputs/AntDateInput.vue +1 -1
- package/dist/components/inputs/AntRadio.vue +2 -1
- package/dist/components/inputs/AntSelect.vue +25 -22
- package/dist/components/inputs/AntSwitch.vue +2 -7
- package/dist/components/inputs/AntTagInput.vue +91 -114
- package/dist/components/inputs/AntTextarea.vue +7 -3
- package/dist/components/inputs/Elements/AntBaseInput.vue +2 -2
- package/dist/components/inputs/Elements/{AntDropDown.vue → AntSelectMenu.vue} +85 -40
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +0 -1
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +1 -29
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +0 -22
- package/dist/components/inputs/Elements/index.d.ts +2 -1
- package/dist/components/inputs/Elements/index.js +7 -0
- package/dist/components/inputs/Elements/index.mjs +3 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.js +1 -43
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +0 -35
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.js +1 -31
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +0 -28
- package/dist/components/inputs/__stories/AntDateInput.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntDateInput.stories.js +1 -32
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +0 -28
- package/dist/components/inputs/__stories/AntNumberInput.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntNumberInput.stories.js +1 -65
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +1 -54
- package/dist/components/inputs/__stories/AntPasswordInput.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntPasswordInput.stories.js +1 -35
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +0 -25
- package/dist/components/inputs/__stories/AntRadioGroup.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntRadioGroup.stories.js +1 -47
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +0 -46
- package/dist/components/inputs/__stories/AntRangeSlider.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntRangeSlider.stories.js +1 -33
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +1 -28
- package/dist/components/inputs/__stories/AntSelect.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntSelect.stories.js +18 -46
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +16 -47
- package/dist/components/inputs/__stories/AntSwitch.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntSwitch.stories.js +1 -42
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +1 -37
- package/dist/components/inputs/__stories/AntSwitcher.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntSwitcher.stories.js +1 -51
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +1 -51
- package/dist/components/inputs/__stories/AntTagInput.stories.d.ts +0 -1
- package/dist/components/inputs/__stories/AntTagInput.stories.js +1 -35
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +0 -33
- package/dist/components/inputs/__stories/AntTextInput.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntTextInput.stories.js +1 -107
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +0 -104
- package/dist/components/inputs/__stories/AntTextarea.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntTextarea.stories.js +7 -66
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +6 -55
- package/dist/components/inputs/__stories/AntUnitInput.stories.d.ts +0 -2
- package/dist/components/inputs/__stories/AntUnitInput.stories.js +1 -61
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +0 -53
- package/dist/components/table/AntTable.vue +17 -15
- package/dist/components/table/AntTd.vue +1 -2
- package/dist/components/table/__stories/AntTable.stories.js +7 -14
- package/dist/components/table/__stories/AntTable.stories.mjs +7 -15
- package/dist/components/tabs/AntTabItem.vue +16 -6
- package/dist/components/tabs/AntTabs.vue +8 -0
- package/dist/components/tabs/__types/AntTabItem.types.d.ts +1 -0
- package/package.json +2 -1
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.Docs = void 0;
|
|
7
7
|
var _AntDropdown = _interopRequireDefault(require("../AntDropdown.vue"));
|
|
8
8
|
var _AntButton = _interopRequireDefault(require("../buttons/AntButton.vue"));
|
|
9
|
-
var
|
|
9
|
+
var _AntTextInput = _interopRequireDefault(require("../inputs/AntTextInput.vue"));
|
|
10
10
|
var _vue = require("vue");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
const meta = {
|
|
@@ -18,12 +18,6 @@ const meta = {
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
argTypes: {
|
|
21
|
-
position: {
|
|
22
|
-
control: {
|
|
23
|
-
type: "select"
|
|
24
|
-
},
|
|
25
|
-
options: Object.values(_Position.Position)
|
|
26
|
-
},
|
|
27
21
|
contentPadding: {
|
|
28
22
|
description: "If the content require a paddingless dropdown to expand over the whole size, set this to false"
|
|
29
23
|
}
|
|
@@ -34,7 +28,8 @@ const Docs = exports.Docs = {
|
|
|
34
28
|
render: args => ({
|
|
35
29
|
components: {
|
|
36
30
|
AntDropdown: _AntDropdown.default,
|
|
37
|
-
AntButton: _AntButton.default
|
|
31
|
+
AntButton: _AntButton.default,
|
|
32
|
+
AntTextInput: _AntTextInput.default
|
|
38
33
|
},
|
|
39
34
|
setup() {
|
|
40
35
|
const showDropdown = (0, _vue.computed)({
|
|
@@ -45,27 +40,36 @@ const Docs = exports.Docs = {
|
|
|
45
40
|
args.showDropdown = val;
|
|
46
41
|
}
|
|
47
42
|
});
|
|
43
|
+
const scrollContainer = (0, _vue.ref)(void 0);
|
|
44
|
+
(0, _vue.onMounted)(() => {
|
|
45
|
+
if (scrollContainer.value) {
|
|
46
|
+
scrollContainer.value.scrollLeft = (scrollContainer.value.scrollWidth - scrollContainer.value.clientWidth) / 2;
|
|
47
|
+
scrollContainer.value.scrollTop = (scrollContainer.value.scrollHeight - scrollContainer.value.clientHeight) / 2;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
48
50
|
return {
|
|
49
51
|
args,
|
|
50
|
-
showDropdown
|
|
52
|
+
showDropdown,
|
|
53
|
+
scrollContainer
|
|
51
54
|
};
|
|
52
55
|
},
|
|
53
56
|
template: `
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
<div ref="scrollContainer" class="dashed overflow-scroll" :style="{height: '500px', width: '500px'}">
|
|
58
|
+
<div class="flex justify-center items-center" :style="{height: '1000px', width: '1000px'}">
|
|
59
|
+
<AntDropdown dropdown-classes="w-64" v-bind="args" v-model:show-dropdown="showDropdown">
|
|
60
|
+
<AntButton @click="() => showDropdown = !showDropdown" filled>Click me</AntButton>
|
|
61
|
+
|
|
62
|
+
<template #content>
|
|
63
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing
|
|
64
|
+
elitr, sed diam nonumy eirmod tempor invidunt ut
|
|
65
|
+
labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
66
|
+
</template>
|
|
67
|
+
</AntDropdown>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
`
|
|
67
71
|
}),
|
|
68
72
|
args: {
|
|
69
|
-
showDropdown:
|
|
73
|
+
showDropdown: false
|
|
70
74
|
}
|
|
71
75
|
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import AntDropdown from "../AntDropdown.vue";
|
|
2
2
|
import AntButton from "../buttons/AntButton.vue";
|
|
3
|
-
import
|
|
4
|
-
import { computed } from "vue";
|
|
3
|
+
import AntTextInput from "../inputs/AntTextInput.vue";
|
|
4
|
+
import { computed, onMounted, ref } from "vue";
|
|
5
5
|
const meta = {
|
|
6
6
|
title: "Components/Dropdown",
|
|
7
7
|
component: AntDropdown,
|
|
8
8
|
parameters: { controls: { sort: "requiredFirst" } },
|
|
9
9
|
argTypes: {
|
|
10
|
-
position: {
|
|
11
|
-
control: { type: "select" },
|
|
12
|
-
options: Object.values(Position)
|
|
13
|
-
},
|
|
14
10
|
contentPadding: {
|
|
15
11
|
description: "If the content require a paddingless dropdown to expand over the whole size, set this to false"
|
|
16
12
|
}
|
|
@@ -19,7 +15,7 @@ const meta = {
|
|
|
19
15
|
export default meta;
|
|
20
16
|
export const Docs = {
|
|
21
17
|
render: (args) => ({
|
|
22
|
-
components: { AntDropdown, AntButton },
|
|
18
|
+
components: { AntDropdown, AntButton, AntTextInput },
|
|
23
19
|
setup() {
|
|
24
20
|
const showDropdown = computed({
|
|
25
21
|
get() {
|
|
@@ -29,24 +25,32 @@ export const Docs = {
|
|
|
29
25
|
args.showDropdown = val;
|
|
30
26
|
}
|
|
31
27
|
});
|
|
32
|
-
|
|
28
|
+
const scrollContainer = ref(void 0);
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
if (scrollContainer.value) {
|
|
31
|
+
scrollContainer.value.scrollLeft = (scrollContainer.value.scrollWidth - scrollContainer.value.clientWidth) / 2;
|
|
32
|
+
scrollContainer.value.scrollTop = (scrollContainer.value.scrollHeight - scrollContainer.value.clientHeight) / 2;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return { args, showDropdown, scrollContainer };
|
|
33
36
|
},
|
|
34
37
|
template: `
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
<div ref="scrollContainer" class="dashed overflow-scroll" :style="{height: '500px', width: '500px'}">
|
|
39
|
+
<div class="flex justify-center items-center" :style="{height: '1000px', width: '1000px'}">
|
|
40
|
+
<AntDropdown dropdown-classes="w-64" v-bind="args" v-model:show-dropdown="showDropdown">
|
|
41
|
+
<AntButton @click="() => showDropdown = !showDropdown" filled>Click me</AntButton>
|
|
42
|
+
|
|
43
|
+
<template #content>
|
|
44
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing
|
|
45
|
+
elitr, sed diam nonumy eirmod tempor invidunt ut
|
|
46
|
+
labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
47
|
+
</template>
|
|
48
|
+
</AntDropdown>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
`
|
|
48
52
|
}),
|
|
49
53
|
args: {
|
|
50
|
-
showDropdown:
|
|
54
|
+
showDropdown: false
|
|
51
55
|
}
|
|
52
56
|
};
|
|
@@ -69,28 +69,26 @@ const Summary = exports.Summary = {
|
|
|
69
69
|
},
|
|
70
70
|
render: args => ({
|
|
71
71
|
components: {
|
|
72
|
-
AntKeycap: _AntKeycap.default
|
|
73
|
-
faChevronUp: _freeSolidSvgIcons.faChevronUp,
|
|
74
|
-
faChevronDown: _freeSolidSvgIcons.faChevronDown
|
|
72
|
+
AntKeycap: _AntKeycap.default
|
|
75
73
|
},
|
|
76
74
|
setup() {
|
|
77
75
|
return {
|
|
78
76
|
args,
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
AntKeycapSize: _AntKeycap2.AntKeycapSize,
|
|
78
|
+
faPlus: _freeSolidSvgIcons.faPlus
|
|
81
79
|
};
|
|
82
80
|
},
|
|
83
81
|
template: `
|
|
84
|
-
<div class="p-4">
|
|
85
|
-
|
|
86
|
-
<AntKeycap v-bind="args" :
|
|
87
|
-
|
|
88
|
-
<AntKeycap v-bind="args" :
|
|
89
|
-
|
|
90
|
-
<AntKeycap v-bind="args">
|
|
91
|
-
|
|
92
|
-
<AntKeycap v-bind="args"
|
|
93
|
-
|
|
82
|
+
<div class="flex gap-2 p-4">
|
|
83
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.xs">K</AntKeycap>
|
|
84
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.sm">K</AntKeycap>
|
|
85
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.md">K</AntKeycap>
|
|
86
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.xs">Strg</AntKeycap>
|
|
87
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.sm">Strg</AntKeycap>
|
|
88
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.md">Strg</AntKeycap>
|
|
89
|
+
<AntKeycap v-bind="args" :icon="faPlus" :size="AntKeycapSize.xs"/>
|
|
90
|
+
<AntKeycap v-bind="args" :icon="faPlus" :size="AntKeycapSize.sm"/>
|
|
91
|
+
<AntKeycap v-bind="args" :icon="faPlus" :size="AntKeycapSize.md"/>
|
|
94
92
|
</div>
|
|
95
93
|
`
|
|
96
94
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import AntKeycap from "../AntKeycap.vue";
|
|
2
2
|
import { AntKeycapSize } from "../__types/AntKeycap.types.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { faPlus, faChevronUp } from "@fortawesome/free-solid-svg-icons";
|
|
4
4
|
const meta = {
|
|
5
5
|
title: "Components/Keycap",
|
|
6
6
|
component: AntKeycap,
|
|
@@ -47,21 +47,21 @@ export const Summary = {
|
|
|
47
47
|
chromatic: { disableSnapshot: false }
|
|
48
48
|
},
|
|
49
49
|
render: (args) => ({
|
|
50
|
-
components: { AntKeycap
|
|
50
|
+
components: { AntKeycap },
|
|
51
51
|
setup() {
|
|
52
|
-
return { args,
|
|
52
|
+
return { args, AntKeycapSize, faPlus };
|
|
53
53
|
},
|
|
54
54
|
template: `
|
|
55
|
-
<div class="p-4">
|
|
56
|
-
|
|
57
|
-
<AntKeycap v-bind="args" :
|
|
58
|
-
|
|
59
|
-
<AntKeycap v-bind="args" :
|
|
60
|
-
|
|
61
|
-
<AntKeycap v-bind="args">
|
|
62
|
-
|
|
63
|
-
<AntKeycap v-bind="args"
|
|
64
|
-
|
|
55
|
+
<div class="flex gap-2 p-4">
|
|
56
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.xs">K</AntKeycap>
|
|
57
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.sm">K</AntKeycap>
|
|
58
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.md">K</AntKeycap>
|
|
59
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.xs">Strg</AntKeycap>
|
|
60
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.sm">Strg</AntKeycap>
|
|
61
|
+
<AntKeycap v-bind="args" :size="AntKeycapSize.md">Strg</AntKeycap>
|
|
62
|
+
<AntKeycap v-bind="args" :icon="faPlus" :size="AntKeycapSize.xs"/>
|
|
63
|
+
<AntKeycap v-bind="args" :icon="faPlus" :size="AntKeycapSize.sm"/>
|
|
64
|
+
<AntKeycap v-bind="args" :icon="faPlus" :size="AntKeycapSize.md"/>
|
|
65
65
|
</div>
|
|
66
66
|
`
|
|
67
67
|
}),
|
|
@@ -35,7 +35,7 @@ const Docs = exports.Docs = {
|
|
|
35
35
|
};
|
|
36
36
|
},
|
|
37
37
|
template: `
|
|
38
|
-
<div class="p-4">
|
|
38
|
+
<div class="p-4 bg-neutral-100">
|
|
39
39
|
<AntListGroup v-bind="args">
|
|
40
40
|
<AntListGroupItem to="/example" :icon-left="faUser">Profile</AntListGroupItem>
|
|
41
41
|
<AntListGroupItem to="/example" :icon-left="faDownload">Downloads</AntListGroupItem>
|
|
@@ -15,7 +15,7 @@ export const Docs = {
|
|
|
15
15
|
return { args, faUser, faDownload, faMessage, faCog };
|
|
16
16
|
},
|
|
17
17
|
template: `
|
|
18
|
-
<div class="p-4">
|
|
18
|
+
<div class="p-4 bg-neutral-100">
|
|
19
19
|
<AntListGroup v-bind="args">
|
|
20
20
|
<AntListGroupItem to="/example" :icon-left="faUser">Profile</AntListGroupItem>
|
|
21
21
|
<AntListGroupItem to="/example" :icon-left="faDownload">Downloads</AntListGroupItem>
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
module.exports = exports.Docs = void 0;
|
|
7
7
|
var _AntPopover = _interopRequireDefault(require("../AntPopover.vue"));
|
|
8
8
|
var _AntButton = _interopRequireDefault(require("../buttons/AntButton.vue"));
|
|
9
|
-
var _Position = require("../../enums/Position.enum");
|
|
10
9
|
var _vue = require("vue");
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
const meta = {
|
|
@@ -17,14 +16,7 @@ const meta = {
|
|
|
17
16
|
sort: "requiredFirst"
|
|
18
17
|
}
|
|
19
18
|
},
|
|
20
|
-
argTypes: {
|
|
21
|
-
position: {
|
|
22
|
-
control: {
|
|
23
|
-
type: "select"
|
|
24
|
-
},
|
|
25
|
-
options: Object.values(_Position.Position)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
19
|
+
argTypes: {}
|
|
28
20
|
};
|
|
29
21
|
module.exports = meta;
|
|
30
22
|
const Docs = exports.Docs = {
|
|
@@ -43,25 +35,34 @@ const Docs = exports.Docs = {
|
|
|
43
35
|
args.showPopover = val;
|
|
44
36
|
}
|
|
45
37
|
});
|
|
38
|
+
const scrollContainer = (0, _vue.ref)(void 0);
|
|
39
|
+
(0, _vue.onMounted)(() => {
|
|
40
|
+
if (scrollContainer.value) {
|
|
41
|
+
scrollContainer.value.scrollLeft = (scrollContainer.value.scrollWidth - scrollContainer.value.clientWidth) / 2;
|
|
42
|
+
scrollContainer.value.scrollTop = (scrollContainer.value.scrollHeight - scrollContainer.value.clientHeight) / 3;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
46
45
|
return {
|
|
47
46
|
args,
|
|
48
47
|
showPopover,
|
|
49
|
-
dummyText
|
|
48
|
+
dummyText,
|
|
49
|
+
scrollContainer
|
|
50
50
|
};
|
|
51
51
|
},
|
|
52
52
|
template: `
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</
|
|
60
|
-
</
|
|
61
|
-
|
|
53
|
+
<div ref="scrollContainer" class="dashed overflow-scroll" :style="{height: '500px', width: '500px'}">
|
|
54
|
+
<div class="flex justify-center items-center" :style="{height: '1000px', width: '1000px'}">
|
|
55
|
+
<AntPopover popover-classes="w-64" v-bind="args" v-model:show-popover="showPopover">
|
|
56
|
+
<AntButton @click="() => showPopover = !showPopover" filled>Click me</AntButton>
|
|
57
|
+
|
|
58
|
+
<template #content>{{ dummyText }}</template>
|
|
59
|
+
<template #title>{{ 'Title' }}</template>
|
|
60
|
+
</AntPopover>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
`
|
|
62
64
|
}),
|
|
63
65
|
args: {
|
|
64
|
-
showPopover: true
|
|
65
|
-
title: "Title"
|
|
66
|
+
showPopover: true
|
|
66
67
|
}
|
|
67
68
|
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import AntPopover from "../AntPopover.vue";
|
|
2
2
|
import AntButton from "../buttons/AntButton.vue";
|
|
3
|
-
import {
|
|
4
|
-
import { computed } from "vue";
|
|
3
|
+
import { computed, onMounted, ref } from "vue";
|
|
5
4
|
const meta = {
|
|
6
5
|
title: "Components/Popover",
|
|
7
6
|
component: AntPopover,
|
|
8
7
|
parameters: { controls: { sort: "requiredFirst" } },
|
|
9
|
-
argTypes: {
|
|
10
|
-
position: {
|
|
11
|
-
control: { type: "select" },
|
|
12
|
-
options: Object.values(Position)
|
|
13
|
-
}
|
|
14
|
-
}
|
|
8
|
+
argTypes: {}
|
|
15
9
|
};
|
|
16
10
|
export default meta;
|
|
17
11
|
export const Docs = {
|
|
@@ -27,21 +21,29 @@ export const Docs = {
|
|
|
27
21
|
args.showPopover = val;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
30
|
-
|
|
24
|
+
const scrollContainer = ref(void 0);
|
|
25
|
+
onMounted(() => {
|
|
26
|
+
if (scrollContainer.value) {
|
|
27
|
+
scrollContainer.value.scrollLeft = (scrollContainer.value.scrollWidth - scrollContainer.value.clientWidth) / 2;
|
|
28
|
+
scrollContainer.value.scrollTop = (scrollContainer.value.scrollHeight - scrollContainer.value.clientHeight) / 3;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return { args, showPopover, dummyText, scrollContainer };
|
|
31
32
|
},
|
|
32
33
|
template: `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</
|
|
40
|
-
</
|
|
41
|
-
|
|
34
|
+
<div ref="scrollContainer" class="dashed overflow-scroll" :style="{height: '500px', width: '500px'}">
|
|
35
|
+
<div class="flex justify-center items-center" :style="{height: '1000px', width: '1000px'}">
|
|
36
|
+
<AntPopover popover-classes="w-64" v-bind="args" v-model:show-popover="showPopover">
|
|
37
|
+
<AntButton @click="() => showPopover = !showPopover" filled>Click me</AntButton>
|
|
38
|
+
|
|
39
|
+
<template #content>{{ dummyText }}</template>
|
|
40
|
+
<template #title>{{ 'Title' }}</template>
|
|
41
|
+
</AntPopover>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
`
|
|
42
45
|
}),
|
|
43
46
|
args: {
|
|
44
|
-
showPopover: true
|
|
45
|
-
title: "Title"
|
|
47
|
+
showPopover: true
|
|
46
48
|
}
|
|
47
49
|
};
|
|
@@ -4,13 +4,3 @@ declare const meta: Meta<typeof AntTooltip>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof AntTooltip>;
|
|
6
6
|
export declare const Docs: Story;
|
|
7
|
-
/**
|
|
8
|
-
* Make sure, no tooltip get shown if no content is provided.
|
|
9
|
-
*/
|
|
10
|
-
export declare const WithoutContent: Story;
|
|
11
|
-
/**
|
|
12
|
-
* Test multiple tooltips in one page to make sure that
|
|
13
|
-
* each tooltips delay does not bug with others.
|
|
14
|
-
*/
|
|
15
|
-
export declare const Multiple: Story;
|
|
16
|
-
export declare const Summary: Story;
|