@teammodlr/ui-kit 2.0.8 → 2.0.10
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/lib/components/dropdown/DropdownSeperator.vue.d.ts +4 -0
- package/lib/components/dropdown/style/Dropdown.css.d.ts +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/select/Select.vue.d.ts +1 -0
- package/lib/components/table/Table.vue.d.ts +2 -1
- package/lib/composables/index.d.ts +1 -0
- package/lib/index.cjs.js +4 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.es.js +1279 -1245
- package/lib/style.css +1 -1
- package/package.json +2 -1
- package/src/components/dropdown/Dropdown.vue +5 -5
- package/src/components/dropdown/DropdownSeperator.vue +23 -0
- package/src/components/dropdown/examples/index.stories.ts +5 -2
- package/src/components/dropdown/style/Dropdown.css.ts +6 -0
- package/src/components/index.ts +1 -0
- package/src/components/select/Select.vue +18 -7
- package/src/components/table/Table.vue +3 -1
- package/src/components/table/examples/basic.vue +5 -0
- package/src/composables/index.ts +1 -0
- package/src/index.ts +1 -0
- package/lib/composables/usePopperV2.d.ts +0 -231
- package/src/composables/usePopperV2.ts +0 -89
- package/src/types/popper.d.ts +0 -14
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { ref, onMounted, watchEffect, unref } from 'vue'
|
|
2
|
-
import type { Ref } from 'vue'
|
|
3
|
-
import { popperGenerator, defaultModifiers } from '@popperjs/core/lib/popper-lite'
|
|
4
|
-
import type { Instance, VirtualElement } from '@popperjs/core'
|
|
5
|
-
import flip from '@popperjs/core/lib/modifiers/flip'
|
|
6
|
-
import offset from '@popperjs/core/lib/modifiers/offset'
|
|
7
|
-
import preventOverflow from '@popperjs/core/lib/modifiers/preventOverflow'
|
|
8
|
-
import computeStyles from '@popperjs/core/lib/modifiers/computeStyles'
|
|
9
|
-
import eventListeners from '@popperjs/core/lib/modifiers/eventListeners'
|
|
10
|
-
import type { PopperOptions } from 'src/types/popper'
|
|
11
|
-
import { unrefElement } from '@vueuse/core'
|
|
12
|
-
import type { MaybeElement } from '@vueuse/core'
|
|
13
|
-
|
|
14
|
-
export const createPopper = popperGenerator({
|
|
15
|
-
defaultModifiers: [
|
|
16
|
-
...defaultModifiers,
|
|
17
|
-
offset,
|
|
18
|
-
flip,
|
|
19
|
-
preventOverflow,
|
|
20
|
-
computeStyles,
|
|
21
|
-
eventListeners
|
|
22
|
-
]
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
export function usePopper ({
|
|
26
|
-
locked = false,
|
|
27
|
-
overflowPadding = 8,
|
|
28
|
-
offsetDistance = 8,
|
|
29
|
-
offsetSkid = 0,
|
|
30
|
-
gpuAcceleration = true,
|
|
31
|
-
adaptive = true,
|
|
32
|
-
scroll = true,
|
|
33
|
-
resize = true,
|
|
34
|
-
placement,
|
|
35
|
-
strategy
|
|
36
|
-
}: PopperOptions, virtualReference?: Ref<Element | VirtualElement>) {
|
|
37
|
-
const reference = ref<MaybeElement>(null)
|
|
38
|
-
const popper = ref<MaybeElement>(null)
|
|
39
|
-
const instance = ref<Instance | null>(null)
|
|
40
|
-
|
|
41
|
-
onMounted(() => {
|
|
42
|
-
watchEffect((onInvalidate) => {
|
|
43
|
-
if (!popper.value) { return }
|
|
44
|
-
if (!reference.value && !virtualReference?.value) { return }
|
|
45
|
-
|
|
46
|
-
const popperEl = unrefElement(popper)
|
|
47
|
-
const referenceEl = virtualReference?.value || unrefElement(reference)
|
|
48
|
-
|
|
49
|
-
// if (!(referenceEl instanceof HTMLElement)) { return }
|
|
50
|
-
if (!(popperEl instanceof HTMLElement)) { return }
|
|
51
|
-
if (!referenceEl) { return }
|
|
52
|
-
|
|
53
|
-
instance.value = createPopper(referenceEl, popperEl, {
|
|
54
|
-
placement,
|
|
55
|
-
strategy,
|
|
56
|
-
modifiers: [{
|
|
57
|
-
name: 'flip',
|
|
58
|
-
enabled: !locked
|
|
59
|
-
}, {
|
|
60
|
-
name: 'preventOverflow',
|
|
61
|
-
options: {
|
|
62
|
-
padding: overflowPadding
|
|
63
|
-
}
|
|
64
|
-
}, {
|
|
65
|
-
name: 'offset',
|
|
66
|
-
options: {
|
|
67
|
-
offset: [offsetSkid, offsetDistance]
|
|
68
|
-
}
|
|
69
|
-
}, {
|
|
70
|
-
name: 'computeStyles',
|
|
71
|
-
options: {
|
|
72
|
-
adaptive,
|
|
73
|
-
gpuAcceleration
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
name: 'eventListeners',
|
|
77
|
-
options: {
|
|
78
|
-
scroll,
|
|
79
|
-
resize
|
|
80
|
-
}
|
|
81
|
-
}]
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
onInvalidate(instance.value.destroy)
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
return [reference, popper, instance] as const
|
|
89
|
-
}
|
package/src/types/popper.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Placement, PositioningStrategy } from '@popperjs/core'
|
|
2
|
-
|
|
3
|
-
export interface PopperOptions {
|
|
4
|
-
locked?: boolean
|
|
5
|
-
overflowPadding?: number
|
|
6
|
-
offsetDistance?: number
|
|
7
|
-
offsetSkid?: number
|
|
8
|
-
placement?: Placement
|
|
9
|
-
strategy?: PositioningStrategy
|
|
10
|
-
gpuAcceleration?: boolean
|
|
11
|
-
adaptive?: boolean
|
|
12
|
-
scroll?: boolean
|
|
13
|
-
resize?: boolean
|
|
14
|
-
}
|