@antify/ui 1.1.0 → 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 +15 -7
- package/dist/components/AntAccordionItem.vue +19 -5
- 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 +10 -10
- 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.js +12 -3
- package/dist/components/__stories/AntAccordion.stories.mjs +12 -3
- package/dist/components/__stories/AntDropdown.stories.js +27 -23
- package/dist/components/__stories/AntDropdown.stories.mjs +26 -22
- 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/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
|
@@ -1,57 +1,59 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {computed,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {classesToObjectSyntax} from '../utils';
|
|
2
|
+
import {computed, ref} from 'vue';
|
|
3
|
+
import {InputState} from '../enums';
|
|
4
|
+
import {arrow, autoUpdate, flip, offset, useFloating} from "@floating-ui/vue";
|
|
6
5
|
import {hasSlotContent} from '../utils';
|
|
6
|
+
import {classesToObjectSyntax} from '../utils';
|
|
7
7
|
|
|
8
8
|
const props = withDefaults(defineProps<{
|
|
9
|
-
|
|
9
|
+
state?: InputState,
|
|
10
|
+
delay?: number,
|
|
10
11
|
tooltipClasses?: string | Record<string, boolean>
|
|
11
|
-
state?: InputState
|
|
12
|
-
expanded?: boolean
|
|
13
|
-
delay?: number
|
|
14
12
|
}>(), {
|
|
15
|
-
position: Position.left,
|
|
16
|
-
tooltipClasses: '',
|
|
17
13
|
state: InputState.base,
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
delay: 600,
|
|
15
|
+
tooltipClasses: '',
|
|
20
16
|
});
|
|
21
|
-
const visible = ref(false);
|
|
22
|
-
const _tooltipClasses = computed(() => ({
|
|
23
|
-
'absolute w-max inline-flex': true,
|
|
24
|
-
// Position
|
|
25
|
-
'bottom-full pb-3.5': props.position === Position.top,
|
|
26
|
-
'top-full pt-3.5': props.position === Position.bottom,
|
|
27
|
-
'right-full pr-3.5': props.position === Position.left,
|
|
28
|
-
'left-full pl-3.5': props.position === Position.right,
|
|
29
|
-
...classesToObjectSyntax(props.tooltipClasses)
|
|
30
|
-
}));
|
|
31
|
-
const classes = computed(() => ({
|
|
32
|
-
'z-10 absolute flex': true,
|
|
33
|
-
'top-0 left-0 right-0 -m-[2px] justify-center': props.position === Position.bottom,
|
|
34
|
-
'bottom-0 left-0 right-0 -m-[2px] justify-center': props.position === Position.top,
|
|
35
|
-
'top-0 left-0 bottom-0 -ml-[2.2px] items-center': props.position === Position.right,
|
|
36
|
-
'top-0 right-0 bottom-0 -mr-[2.2px] items-center': props.position === Position.left,
|
|
37
|
-
}));
|
|
38
|
-
const itemContainerClasses = computed(() => ({
|
|
39
|
-
'relative flex items-center': true,
|
|
40
|
-
'justify-center': props.position === Position.bottom,
|
|
41
|
-
'justify-center rotate-180': props.position === Position.top,
|
|
42
|
-
'justify-center -rotate-90': props.position === Position.right,
|
|
43
|
-
'justify-center rotate-90': props.position === Position.left,
|
|
44
|
-
}));
|
|
45
|
-
const contentClasses = computed(() => {
|
|
46
|
-
const variants: Record<InputState, string> = {
|
|
47
|
-
[InputState.base]: 'text-for-white-bg-font bg-white border-neutral-300',
|
|
48
|
-
[InputState.danger]: 'text-danger-500-font bg-danger-500 border-danger-500',
|
|
49
|
-
[InputState.info]: 'text-info-500-font bg-info-500 border-info-500',
|
|
50
|
-
[InputState.success]: 'text-success-500-font bg-success-500 border-success-500',
|
|
51
|
-
[InputState.warning]: 'text-warning-500-font bg-warning-500 border-warning-500',
|
|
52
|
-
};
|
|
53
17
|
|
|
54
|
-
|
|
18
|
+
const floatOpen = ref<boolean>(false)
|
|
19
|
+
const clickLock = ref(false);
|
|
20
|
+
const timeout = ref<number | undefined>();
|
|
21
|
+
|
|
22
|
+
const reference = ref<HTMLElement | null>(null)
|
|
23
|
+
const floating = ref<HTMLElement | null>(null)
|
|
24
|
+
const floatingArrow = ref<HTMLElement | null>(null);
|
|
25
|
+
|
|
26
|
+
const {floatingStyles, middlewareData, placement} = useFloating(reference, floating, {
|
|
27
|
+
placement: 'top',
|
|
28
|
+
whileElementsMounted: autoUpdate,
|
|
29
|
+
middleware: [
|
|
30
|
+
offset(() => 16),
|
|
31
|
+
flip({
|
|
32
|
+
fallbackPlacements: ['bottom', 'left', 'right'],
|
|
33
|
+
fallbackAxisSideDirection: 'none',
|
|
34
|
+
}),
|
|
35
|
+
arrow({element: floatingArrow})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
const side = computed(() => placement.value.split('-')[0]);
|
|
39
|
+
const staticSide = computed(() => {
|
|
40
|
+
return {
|
|
41
|
+
top: "bottom",
|
|
42
|
+
right: "left",
|
|
43
|
+
bottom: "top",
|
|
44
|
+
left: "right"
|
|
45
|
+
}[side.value] as string
|
|
46
|
+
})
|
|
47
|
+
const arrowTransform = computed(() => {
|
|
48
|
+
if (placement.value === 'bottom') {
|
|
49
|
+
return 'rotate(0deg)'
|
|
50
|
+
} else if (placement.value === 'top') {
|
|
51
|
+
return 'rotate(180deg)'
|
|
52
|
+
} else if (placement.value === 'left') {
|
|
53
|
+
return 'rotate(90deg)'
|
|
54
|
+
} else {
|
|
55
|
+
return 'rotate(270deg)'
|
|
56
|
+
}
|
|
55
57
|
});
|
|
56
58
|
const svgPathClasses = computed(() => {
|
|
57
59
|
const variants: Record<InputState, string> = {
|
|
@@ -75,17 +77,24 @@ const arrowSvgPathClasses = computed(() => {
|
|
|
75
77
|
|
|
76
78
|
return {[variants[props.state]]: true};
|
|
77
79
|
});
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
|
|
80
|
+
const contentClasses = computed(() => {
|
|
81
|
+
const variants: Record<InputState, string> = {
|
|
82
|
+
[InputState.base]: 'text-for-white-bg-font bg-white border-neutral-300',
|
|
83
|
+
[InputState.danger]: 'text-danger-500-font bg-danger-500 border-danger-500',
|
|
84
|
+
[InputState.info]: 'text-info-500-font bg-info-500 border-info-500',
|
|
85
|
+
[InputState.success]: 'text-success-500-font bg-success-500 border-success-500',
|
|
86
|
+
[InputState.warning]: 'text-warning-500-font bg-warning-500 border-warning-500',
|
|
87
|
+
};
|
|
81
88
|
|
|
82
|
-
|
|
83
|
-
handleEnumValidation(props.position, Position, 'position');
|
|
84
|
-
handleEnumValidation(props.state, InputState, 'state');
|
|
89
|
+
return {[variants[props.state]]: true};
|
|
85
90
|
});
|
|
91
|
+
const _tooltipClasses = computed(() => ({
|
|
92
|
+
'w-max inline-flex shadow-lg text-sm z-[90] rounded-md': true,
|
|
93
|
+
...classesToObjectSyntax(props.tooltipClasses)
|
|
94
|
+
}));
|
|
86
95
|
|
|
87
96
|
function onMouseOver() {
|
|
88
|
-
if (
|
|
97
|
+
if (floatOpen.value || clickLock.value) {
|
|
89
98
|
return;
|
|
90
99
|
}
|
|
91
100
|
|
|
@@ -95,52 +104,76 @@ function onMouseOver() {
|
|
|
95
104
|
*/
|
|
96
105
|
clearTimeout(timeout.value);
|
|
97
106
|
|
|
98
|
-
timeout.value = setTimeout(() =>
|
|
107
|
+
timeout.value = setTimeout(() => floatOpen.value = true, props.delay) as unknown as number;
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
function onMouseLeave() {
|
|
102
111
|
clearTimeout(timeout.value);
|
|
103
112
|
|
|
104
|
-
|
|
113
|
+
floatOpen.value = false;
|
|
105
114
|
clickLock.value = false;
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
function onClick() {
|
|
109
118
|
clearTimeout(timeout.value);
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
floatOpen.value = false;
|
|
112
121
|
clickLock.value = true;
|
|
113
122
|
}
|
|
114
123
|
</script>
|
|
115
124
|
|
|
116
125
|
<template>
|
|
117
126
|
<div
|
|
118
|
-
|
|
119
|
-
class="relative justify-center items-center"
|
|
120
|
-
:class="{'flex w-full': props.expanded, 'inline-flex': !props.expanded}"
|
|
127
|
+
class="relative"
|
|
121
128
|
data-e2e="tooltip"
|
|
122
|
-
@mouseover="() => onMouseOver()"
|
|
123
|
-
@mouseleave="() => onMouseLeave()"
|
|
124
129
|
>
|
|
125
130
|
<div
|
|
126
|
-
|
|
131
|
+
ref="reference"
|
|
132
|
+
@mouseenter="() => onMouseOver()"
|
|
133
|
+
@mouseleave="() => onMouseLeave()"
|
|
127
134
|
@click="() => onClick()"
|
|
128
135
|
>
|
|
129
136
|
<slot/>
|
|
130
137
|
</div>
|
|
131
138
|
|
|
132
|
-
<
|
|
133
|
-
v-if="visible && hasSlotContent($slots.content)"
|
|
134
|
-
:class="_tooltipClasses"
|
|
135
|
-
>
|
|
139
|
+
<teleport to="body">
|
|
136
140
|
<div
|
|
137
|
-
|
|
141
|
+
v-if="floatOpen && hasSlotContent($slots.content)"
|
|
142
|
+
:class="_tooltipClasses"
|
|
143
|
+
ref="floating"
|
|
144
|
+
:style="{
|
|
145
|
+
...floatingStyles,
|
|
146
|
+
display: floatOpen
|
|
147
|
+
? 'block'
|
|
148
|
+
: 'none',
|
|
149
|
+
}"
|
|
150
|
+
data-e2e="tooltip-content"
|
|
138
151
|
>
|
|
139
152
|
<div
|
|
140
|
-
|
|
153
|
+
class="p-2 rounded-md border"
|
|
154
|
+
:class="contentClasses"
|
|
155
|
+
>
|
|
156
|
+
<slot name="content"/>
|
|
157
|
+
</div>
|
|
158
|
+
<div
|
|
159
|
+
class="flex items-center justify-center"
|
|
160
|
+
ref="floatingArrow"
|
|
161
|
+
:style="{
|
|
162
|
+
position: 'absolute',
|
|
163
|
+
left:
|
|
164
|
+
middlewareData.arrow?.x != null
|
|
165
|
+
? `${middlewareData.arrow.x}px`
|
|
166
|
+
: '',
|
|
167
|
+
top:
|
|
168
|
+
middlewareData.arrow?.y != null
|
|
169
|
+
? `${middlewareData.arrow.y}px`
|
|
170
|
+
: '',
|
|
171
|
+
[staticSide]: '-2px',
|
|
172
|
+
transform: arrowTransform
|
|
173
|
+
}"
|
|
141
174
|
>
|
|
142
175
|
<div
|
|
143
|
-
|
|
176
|
+
class="flex items-center justify-center"
|
|
144
177
|
>
|
|
145
178
|
<svg
|
|
146
179
|
class="absolute mt-[.5px]"
|
|
@@ -176,14 +209,7 @@ function onClick() {
|
|
|
176
209
|
</svg>
|
|
177
210
|
</div>
|
|
178
211
|
</div>
|
|
179
|
-
|
|
180
|
-
<div
|
|
181
|
-
class="p-2 rounded-md border"
|
|
182
|
-
:class="contentClasses"
|
|
183
|
-
>
|
|
184
|
-
<slot name="content"/>
|
|
185
|
-
</div>
|
|
186
212
|
</div>
|
|
187
|
-
</
|
|
213
|
+
</teleport>
|
|
188
214
|
</div>
|
|
189
215
|
</template>
|
|
@@ -145,15 +145,22 @@ const mixedVariants = exports.mixedVariants = {
|
|
|
145
145
|
>
|
|
146
146
|
<template #icon-left="{item, index, isOpen}">
|
|
147
147
|
<AntIcon
|
|
148
|
+
v-if="index === 0"
|
|
148
149
|
:class="{'text-success-500-font': isOpen, 'text-success-200-font': !isOpen}"
|
|
149
150
|
:icon="faEye"/>
|
|
150
151
|
</template>
|
|
152
|
+
|
|
153
|
+
<template #item-content="{index}">
|
|
154
|
+
<div v-if="index === 0">
|
|
155
|
+
This content comes from <code>#item-content</code> slot instead of <code>items.content</code> prop. <br>
|
|
156
|
+
This should not be in skeleton state. The user need to handle it self.
|
|
157
|
+
</div>
|
|
158
|
+
</template>
|
|
151
159
|
</AntAccordion>`
|
|
152
160
|
}),
|
|
153
161
|
args: {
|
|
154
162
|
items: [{
|
|
155
|
-
label: "First entry"
|
|
156
|
-
content: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
|
|
163
|
+
label: "First entry"
|
|
157
164
|
}, {
|
|
158
165
|
label: `Second entry`,
|
|
159
166
|
content: `<div class="bg-success-100 p-4"><span class="font-bold text-success-500">Success</span> Content</div>`,
|
|
@@ -178,6 +185,8 @@ const mixedVariants = exports.mixedVariants = {
|
|
|
178
185
|
inactiveLabelClasses: "bg-danger-200 text-danger-200-font",
|
|
179
186
|
inactiveIconClasses: "text-danger-200-font",
|
|
180
187
|
contentPadding: false
|
|
181
|
-
}]
|
|
188
|
+
}],
|
|
189
|
+
skeleton: true,
|
|
190
|
+
collapseStrategy: _AntAccordion2.CollapseStrategy.multiple
|
|
182
191
|
}
|
|
183
192
|
};
|
|
@@ -117,16 +117,23 @@ export const mixedVariants = {
|
|
|
117
117
|
>
|
|
118
118
|
<template #icon-left="{item, index, isOpen}">
|
|
119
119
|
<AntIcon
|
|
120
|
+
v-if="index === 0"
|
|
120
121
|
:class="{'text-success-500-font': isOpen, 'text-success-200-font': !isOpen}"
|
|
121
122
|
:icon="faEye"/>
|
|
122
123
|
</template>
|
|
124
|
+
|
|
125
|
+
<template #item-content="{index}">
|
|
126
|
+
<div v-if="index === 0">
|
|
127
|
+
This content comes from <code>#item-content</code> slot instead of <code>items.content</code> prop. <br>
|
|
128
|
+
This should not be in skeleton state. The user need to handle it self.
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
123
131
|
</AntAccordion>`
|
|
124
132
|
}),
|
|
125
133
|
args: {
|
|
126
134
|
items: [
|
|
127
135
|
{
|
|
128
|
-
label: "First entry"
|
|
129
|
-
content: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
|
|
136
|
+
label: "First entry"
|
|
130
137
|
},
|
|
131
138
|
{
|
|
132
139
|
label: `Second entry`,
|
|
@@ -155,6 +162,8 @@ export const mixedVariants = {
|
|
|
155
162
|
inactiveIconClasses: "text-danger-200-font",
|
|
156
163
|
contentPadding: false
|
|
157
164
|
}
|
|
158
|
-
]
|
|
165
|
+
],
|
|
166
|
+
skeleton: true,
|
|
167
|
+
collapseStrategy: CollapseStrategy.multiple
|
|
159
168
|
}
|
|
160
169
|
};
|
|
@@ -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
|
};
|
|
@@ -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
|
};
|