@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.
Files changed (105) hide show
  1. package/dist/components/AntAccordion.vue +32 -7
  2. package/dist/components/AntAccordionItem.vue +48 -15
  3. package/dist/components/AntAlert.vue +8 -6
  4. package/dist/components/AntDropdown.vue +50 -36
  5. package/dist/components/AntIcon.vue +8 -6
  6. package/dist/components/AntKeycap.vue +22 -17
  7. package/dist/components/AntListGroup.vue +5 -3
  8. package/dist/components/AntModal.vue +17 -7
  9. package/dist/components/AntPopover.vue +118 -42
  10. package/dist/components/AntSkeleton.vue +1 -1
  11. package/dist/components/AntTooltip.vue +102 -76
  12. package/dist/components/__stories/AntAccordion.stories.d.ts +1 -0
  13. package/dist/components/__stories/AntAccordion.stories.js +73 -1
  14. package/dist/components/__stories/AntAccordion.stories.mjs +68 -0
  15. package/dist/components/__stories/AntDropdown.stories.js +27 -23
  16. package/dist/components/__stories/AntDropdown.stories.mjs +26 -22
  17. package/dist/components/__stories/AntKeycap.stories.js +13 -15
  18. package/dist/components/__stories/AntKeycap.stories.mjs +13 -13
  19. package/dist/components/__stories/AntListGroup.stories.js +1 -1
  20. package/dist/components/__stories/AntListGroup.stories.mjs +1 -1
  21. package/dist/components/__stories/AntModal.stories.js +2 -1
  22. package/dist/components/__stories/AntModal.stories.mjs +2 -1
  23. package/dist/components/__stories/AntPopover.stories.js +22 -21
  24. package/dist/components/__stories/AntPopover.stories.mjs +22 -20
  25. package/dist/components/__stories/AntTooltip.stories.d.ts +0 -10
  26. package/dist/components/__stories/AntTooltip.stories.js +32 -212
  27. package/dist/components/__stories/AntTooltip.stories.mjs +29 -193
  28. package/dist/components/__types/AntKeycap.types.d.ts +1 -0
  29. package/dist/components/__types/AntKeycap.types.js +1 -0
  30. package/dist/components/__types/AntKeycap.types.mjs +1 -0
  31. package/dist/components/buttons/AntButton.vue +41 -44
  32. package/dist/components/crud/AntCrud.vue +1 -1
  33. package/dist/components/crud/AntCrudDetailActions.vue +1 -0
  34. package/dist/components/crud/AntCrudTableFilter.vue +20 -18
  35. package/dist/components/forms/AntField.vue +7 -2
  36. package/dist/components/forms/__stories/AntField.stories.js +0 -16
  37. package/dist/components/forms/__stories/AntField.stories.mjs +2 -16
  38. package/dist/components/index.d.ts +2 -2
  39. package/dist/components/index.js +7 -7
  40. package/dist/components/index.mjs +2 -2
  41. package/dist/components/inputs/AntCheckbox.vue +25 -6
  42. package/dist/components/inputs/AntDateInput.vue +1 -1
  43. package/dist/components/inputs/AntRadio.vue +2 -1
  44. package/dist/components/inputs/AntSelect.vue +25 -22
  45. package/dist/components/inputs/AntSwitch.vue +2 -7
  46. package/dist/components/inputs/AntTagInput.vue +91 -114
  47. package/dist/components/inputs/AntTextarea.vue +7 -3
  48. package/dist/components/inputs/Elements/AntBaseInput.vue +2 -2
  49. package/dist/components/inputs/Elements/{AntDropDown.vue → AntSelectMenu.vue} +85 -40
  50. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +0 -1
  51. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +1 -29
  52. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +0 -22
  53. package/dist/components/inputs/Elements/index.d.ts +2 -1
  54. package/dist/components/inputs/Elements/index.js +7 -0
  55. package/dist/components/inputs/Elements/index.mjs +3 -1
  56. package/dist/components/inputs/__stories/AntCheckbox.stories.d.ts +0 -1
  57. package/dist/components/inputs/__stories/AntCheckbox.stories.js +1 -43
  58. package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +0 -35
  59. package/dist/components/inputs/__stories/AntCheckboxGroup.stories.d.ts +0 -1
  60. package/dist/components/inputs/__stories/AntCheckboxGroup.stories.js +1 -31
  61. package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +0 -28
  62. package/dist/components/inputs/__stories/AntDateInput.stories.d.ts +0 -1
  63. package/dist/components/inputs/__stories/AntDateInput.stories.js +1 -32
  64. package/dist/components/inputs/__stories/AntDateInput.stories.mjs +0 -28
  65. package/dist/components/inputs/__stories/AntNumberInput.stories.d.ts +0 -2
  66. package/dist/components/inputs/__stories/AntNumberInput.stories.js +1 -65
  67. package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +1 -54
  68. package/dist/components/inputs/__stories/AntPasswordInput.stories.d.ts +0 -1
  69. package/dist/components/inputs/__stories/AntPasswordInput.stories.js +1 -35
  70. package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +0 -25
  71. package/dist/components/inputs/__stories/AntRadioGroup.stories.d.ts +0 -1
  72. package/dist/components/inputs/__stories/AntRadioGroup.stories.js +1 -47
  73. package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +0 -46
  74. package/dist/components/inputs/__stories/AntRangeSlider.stories.d.ts +0 -1
  75. package/dist/components/inputs/__stories/AntRangeSlider.stories.js +1 -33
  76. package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +1 -28
  77. package/dist/components/inputs/__stories/AntSelect.stories.d.ts +0 -1
  78. package/dist/components/inputs/__stories/AntSelect.stories.js +18 -46
  79. package/dist/components/inputs/__stories/AntSelect.stories.mjs +16 -47
  80. package/dist/components/inputs/__stories/AntSwitch.stories.d.ts +0 -1
  81. package/dist/components/inputs/__stories/AntSwitch.stories.js +1 -42
  82. package/dist/components/inputs/__stories/AntSwitch.stories.mjs +1 -37
  83. package/dist/components/inputs/__stories/AntSwitcher.stories.d.ts +0 -1
  84. package/dist/components/inputs/__stories/AntSwitcher.stories.js +1 -51
  85. package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +1 -51
  86. package/dist/components/inputs/__stories/AntTagInput.stories.d.ts +0 -1
  87. package/dist/components/inputs/__stories/AntTagInput.stories.js +1 -35
  88. package/dist/components/inputs/__stories/AntTagInput.stories.mjs +0 -33
  89. package/dist/components/inputs/__stories/AntTextInput.stories.d.ts +0 -2
  90. package/dist/components/inputs/__stories/AntTextInput.stories.js +1 -107
  91. package/dist/components/inputs/__stories/AntTextInput.stories.mjs +0 -104
  92. package/dist/components/inputs/__stories/AntTextarea.stories.d.ts +0 -2
  93. package/dist/components/inputs/__stories/AntTextarea.stories.js +7 -66
  94. package/dist/components/inputs/__stories/AntTextarea.stories.mjs +6 -55
  95. package/dist/components/inputs/__stories/AntUnitInput.stories.d.ts +0 -2
  96. package/dist/components/inputs/__stories/AntUnitInput.stories.js +1 -61
  97. package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +0 -53
  98. package/dist/components/table/AntTable.vue +17 -15
  99. package/dist/components/table/AntTd.vue +1 -2
  100. package/dist/components/table/__stories/AntTable.stories.js +7 -14
  101. package/dist/components/table/__stories/AntTable.stories.mjs +7 -15
  102. package/dist/components/tabs/AntTabItem.vue +16 -6
  103. package/dist/components/tabs/AntTabs.vue +8 -0
  104. package/dist/components/tabs/__types/AntTabItem.types.d.ts +1 -0
  105. 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 _Position = require("../../enums/Position.enum");
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
- <div class="p-64 flex justify-center items-center">
55
- <AntDropdown dropdown-classes="w-64" v-bind="args" v-model:show-dropdown="showDropdown">
56
- <template #content>
57
- Lorem ipsum dolor sit amet, consetetur sadipscing
58
- elitr, sed diam nonumy eirmod tempor invidunt ut
59
- labore et dolore magna aliquyam erat, sed diam voluptua.
60
- </template>
61
- <template #default>
62
- <AntButton @click="() => showDropdown = !showDropdown" filled>Click me</AntButton>
63
- </template>
64
- </AntDropdown>
65
- </div>
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: true
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 { Position } from "../../enums/Position.enum.mjs";
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
- return { args, showDropdown };
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
- <div class="p-64 flex justify-center items-center">
36
- <AntDropdown dropdown-classes="w-64" v-bind="args" v-model:show-dropdown="showDropdown">
37
- <template #content>
38
- Lorem ipsum dolor sit amet, consetetur sadipscing
39
- elitr, sed diam nonumy eirmod tempor invidunt ut
40
- labore et dolore magna aliquyam erat, sed diam voluptua.
41
- </template>
42
- <template #default>
43
- <AntButton @click="() => showDropdown = !showDropdown" filled>Click me</AntButton>
44
- </template>
45
- </AntDropdown>
46
- </div>
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: true
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
- faChevronUp: _freeSolidSvgIcons.faChevronUp,
80
- faChevronDown: _freeSolidSvgIcons.faChevronDown
77
+ AntKeycapSize: _AntKeycap2.AntKeycapSize,
78
+ faPlus: _freeSolidSvgIcons.faPlus
81
79
  };
82
80
  },
83
81
  template: `
84
- <div class="p-4">
85
- Press
86
- <AntKeycap v-bind="args" :icon="faChevronUp"/>
87
- or
88
- <AntKeycap v-bind="args" :icon="faChevronDown"/>
89
- to navigate. Press
90
- <AntKeycap v-bind="args">ctl</AntKeycap>
91
- +
92
- <AntKeycap v-bind="args">K</AntKeycap>
93
- to search.
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 { faChevronUp, faChevronDown } from "@fortawesome/free-solid-svg-icons";
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, faChevronUp, faChevronDown },
50
+ components: { AntKeycap },
51
51
  setup() {
52
- return { args, faChevronUp, faChevronDown };
52
+ return { args, AntKeycapSize, faPlus };
53
53
  },
54
54
  template: `
55
- <div class="p-4">
56
- Press
57
- <AntKeycap v-bind="args" :icon="faChevronUp"/>
58
- or
59
- <AntKeycap v-bind="args" :icon="faChevronDown"/>
60
- to navigate. Press
61
- <AntKeycap v-bind="args">ctl</AntKeycap>
62
- +
63
- <AntKeycap v-bind="args">K</AntKeycap>
64
- to search.
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>
@@ -83,7 +83,8 @@ const Docs = exports.Docs = {
83
83
  `
84
84
  }),
85
85
  args: {
86
- title: "Lorem ipsum dolor"
86
+ title: "Lorem ipsum dolor",
87
+ open: false
87
88
  }
88
89
  };
89
90
  const Fullscreen = exports.Fullscreen = {
@@ -65,7 +65,8 @@ export const Docs = {
65
65
  `
66
66
  }),
67
67
  args: {
68
- title: "Lorem ipsum dolor"
68
+ title: "Lorem ipsum dolor",
69
+ open: false
69
70
  }
70
71
  };
71
72
  export const Fullscreen = {
@@ -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
- <div class="p-64 flex justify-center items-center">
54
- <AntPopover popover-classes="w-64" v-bind="args">
55
- <template #content>{{ dummyText }}</template>
56
- <template #default>
57
- <AntButton @click="() => showPopover = !showPopover" filled>Click me</AntButton>
58
- </template>
59
- </AntPopover>
60
- </div>
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 { Position } from "../../enums/Position.enum.mjs";
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
- return { args, showPopover, dummyText };
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
- <div class="p-64 flex justify-center items-center">
34
- <AntPopover popover-classes="w-64" v-bind="args">
35
- <template #content>{{ dummyText }}</template>
36
- <template #default>
37
- <AntButton @click="() => showPopover = !showPopover" filled>Click me</AntButton>
38
- </template>
39
- </AntPopover>
40
- </div>
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;