sprintify-ui 0.0.75 → 0.0.77
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/sprintify-ui.es.js +6849 -5821
- package/dist/types/src/components/BaseDropdown.vue.d.ts +96 -0
- package/dist/types/src/components/BaseMenu.vue.d.ts +1 -0
- package/dist/types/src/components/index.d.ts +2 -1
- package/package.json +3 -1
- package/src/components/BaseDropdown.stories.js +36 -0
- package/src/components/BaseDropdown.vue +51 -0
- package/src/components/BaseMenu.vue +1 -1
- package/src/components/index.ts +2 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Placement } from '@popperjs/core';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
new (...args: any[]): {
|
|
5
|
+
$: import("vue").ComponentInternalInstance;
|
|
6
|
+
$data: {};
|
|
7
|
+
$props: Partial<{
|
|
8
|
+
placement: Placement;
|
|
9
|
+
offset: [number, number];
|
|
10
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
placement: {
|
|
12
|
+
type: PropType<Placement>;
|
|
13
|
+
default(): "bottom";
|
|
14
|
+
};
|
|
15
|
+
offset: {
|
|
16
|
+
default(): number[];
|
|
17
|
+
type: PropType<[number, number]>;
|
|
18
|
+
};
|
|
19
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "placement" | "offset">;
|
|
20
|
+
$attrs: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
$refs: {
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
$slots: Readonly<{
|
|
27
|
+
[name: string]: import("vue").Slot | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
30
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
|
|
31
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
32
|
+
$el: any;
|
|
33
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
34
|
+
placement: {
|
|
35
|
+
type: PropType<Placement>;
|
|
36
|
+
default(): "bottom";
|
|
37
|
+
};
|
|
38
|
+
offset: {
|
|
39
|
+
default(): number[];
|
|
40
|
+
type: PropType<[number, number]>;
|
|
41
|
+
};
|
|
42
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
43
|
+
placement: Placement;
|
|
44
|
+
offset: [number, number];
|
|
45
|
+
}, {}, string> & {
|
|
46
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
47
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
48
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
49
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
50
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
51
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
52
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
53
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
54
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
55
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
56
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
57
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
58
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
59
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
60
|
+
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
|
|
61
|
+
};
|
|
62
|
+
$forceUpdate: () => void;
|
|
63
|
+
$nextTick: typeof import("vue").nextTick;
|
|
64
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
65
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
placement: {
|
|
67
|
+
type: PropType<Placement>;
|
|
68
|
+
default(): "bottom";
|
|
69
|
+
};
|
|
70
|
+
offset: {
|
|
71
|
+
default(): number[];
|
|
72
|
+
type: PropType<[number, number]>;
|
|
73
|
+
};
|
|
74
|
+
}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
|
|
75
|
+
__isFragment?: undefined;
|
|
76
|
+
__isTeleport?: undefined;
|
|
77
|
+
__isSuspense?: undefined;
|
|
78
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
79
|
+
placement: {
|
|
80
|
+
type: PropType<Placement>;
|
|
81
|
+
default(): "bottom";
|
|
82
|
+
};
|
|
83
|
+
offset: {
|
|
84
|
+
default(): number[];
|
|
85
|
+
type: PropType<[number, number]>;
|
|
86
|
+
};
|
|
87
|
+
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
88
|
+
placement: Placement;
|
|
89
|
+
offset: [number, number];
|
|
90
|
+
}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
91
|
+
$slots: {
|
|
92
|
+
button: (_: {}) => any;
|
|
93
|
+
dropdown: (_: {}) => any;
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
export default _default;
|
|
@@ -26,6 +26,7 @@ import BaseDateSelect from './BaseDateSelect.vue';
|
|
|
26
26
|
import BaseDescriptionList from './BaseDescriptionList.vue';
|
|
27
27
|
import BaseDescriptionListItem from './BaseDescriptionListItem.vue';
|
|
28
28
|
import BaseDialog from './BaseDialog.vue';
|
|
29
|
+
import BaseDropdown from './BaseDropdown.vue';
|
|
29
30
|
import BaseField from './BaseField.vue';
|
|
30
31
|
import BaseFieldI18n from './BaseFieldI18n.vue';
|
|
31
32
|
import BaseFilePicker from './BaseFilePicker.vue';
|
|
@@ -74,4 +75,4 @@ import BaseLayoutStacked from './BaseLayoutStacked.vue';
|
|
|
74
75
|
import BaseLayoutStackedConfigurable from './BaseLayoutStackedConfigurable.vue';
|
|
75
76
|
import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
|
|
76
77
|
import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
|
|
77
|
-
export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseAvatarGroup, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseField, BaseFieldI18n, BaseFilePicker, BaseFileUploader, BaseForm, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
|
|
78
|
+
export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseAvatarGroup, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseDropdown, BaseField, BaseFieldI18n, BaseFilePicker, BaseFileUploader, BaseForm, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sprintify-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "rimraf dist && vue-tsc && vite build",
|
|
6
6
|
"build-fast": "rimraf dist && vite build",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"prepack": "npm run build"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
+
"@popperjs/core": "^2.11.6",
|
|
15
16
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
16
17
|
"@tailwindcss/forms": "^0.5.3",
|
|
17
18
|
"@tailwindcss/line-clamp": "^0.4.2",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@babel/core": "^7.20.2",
|
|
39
40
|
"@iconify/vue": "^4.0.0",
|
|
41
|
+
"@popperjs/core": "^2.11.6",
|
|
40
42
|
"@storybook/addon-actions": "^6.5.13",
|
|
41
43
|
"@storybook/addon-essentials": "^6.5.13",
|
|
42
44
|
"@storybook/addon-interactions": "^6.5.13",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import BaseDropdown from './BaseDropdown.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/BaseDropdown',
|
|
5
|
+
component: BaseDropdown,
|
|
6
|
+
args: {
|
|
7
|
+
placement: 'top-start',
|
|
8
|
+
offset: [0, 8],
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Template = (args) => ({
|
|
13
|
+
components: { BaseDropdown },
|
|
14
|
+
setup() {
|
|
15
|
+
return { args };
|
|
16
|
+
},
|
|
17
|
+
template: `
|
|
18
|
+
<div style="height: 2000px">
|
|
19
|
+
<BaseDropdown v-bind="args" style="margin-top: 200px;">
|
|
20
|
+
<template #button>
|
|
21
|
+
<div class="btn btn-primary">Click me</div>
|
|
22
|
+
</template>
|
|
23
|
+
<template #dropdown>
|
|
24
|
+
<div class="bg-white shadow py-1 px-1 rounded">
|
|
25
|
+
<button type="button" class="block text-sm px-4 py-1.5">Item 1</button>
|
|
26
|
+
<button type="button" class="block text-sm px-4 py-1.5">Item 2</button>
|
|
27
|
+
<button type="button" class="block text-sm px-4 py-1.5">Item 3</button>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
</BaseDropdown>
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const Demo = Template.bind({});
|
|
36
|
+
Demo.args = {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button ref="button" type="button" @click="showDropdown = !showDropdown">
|
|
4
|
+
<slot name="button"></slot>
|
|
5
|
+
</button>
|
|
6
|
+
<div v-show="showDropdown" ref="dropdown">
|
|
7
|
+
<slot name="dropdown"></slot>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import { bottom, createPopper, Placement } from '@popperjs/core';
|
|
14
|
+
import { PropType } from 'vue';
|
|
15
|
+
|
|
16
|
+
const button = ref<HTMLElement | null>(null);
|
|
17
|
+
const dropdown = ref<HTMLElement | null>(null);
|
|
18
|
+
|
|
19
|
+
const showDropdown = ref(false);
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
placement: {
|
|
23
|
+
type: String as PropType<Placement>,
|
|
24
|
+
default() {
|
|
25
|
+
return bottom;
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
offset: {
|
|
29
|
+
default() {
|
|
30
|
+
return [0, 8];
|
|
31
|
+
},
|
|
32
|
+
type: Array as unknown as PropType<[number, number]>,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
onMounted(() => {
|
|
37
|
+
if (button.value && dropdown.value) {
|
|
38
|
+
createPopper(button.value, dropdown.value, {
|
|
39
|
+
placement: props.placement,
|
|
40
|
+
modifiers: [
|
|
41
|
+
{
|
|
42
|
+
name: 'offset',
|
|
43
|
+
options: {
|
|
44
|
+
offset: props.offset,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
</script>
|
package/src/components/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ import BaseDateSelect from './BaseDateSelect.vue';
|
|
|
26
26
|
import BaseDescriptionList from './BaseDescriptionList.vue';
|
|
27
27
|
import BaseDescriptionListItem from './BaseDescriptionListItem.vue';
|
|
28
28
|
import BaseDialog from './BaseDialog.vue';
|
|
29
|
+
import BaseDropdown from './BaseDropdown.vue';
|
|
29
30
|
import BaseField from './BaseField.vue';
|
|
30
31
|
import BaseFieldI18n from './BaseFieldI18n.vue';
|
|
31
32
|
import BaseFilePicker from './BaseFilePicker.vue';
|
|
@@ -105,6 +106,7 @@ export {
|
|
|
105
106
|
BaseDescriptionList,
|
|
106
107
|
BaseDescriptionListItem,
|
|
107
108
|
BaseDialog,
|
|
109
|
+
BaseDropdown,
|
|
108
110
|
BaseField,
|
|
109
111
|
BaseFieldI18n,
|
|
110
112
|
BaseFilePicker,
|