@teammodlr/ui-kit 2.1.45 → 2.1.47
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/configprovider/ConfigProvider.vue.d.ts +4 -0
- package/lib/components/select/Select.vue.d.ts +90 -2
- package/lib/components/select/types.d.ts +4 -0
- package/lib/index.cjs.js +7 -7
- package/lib/index.es.js +2186 -2154
- package/lib/types/props.d.ts +1 -0
- package/lib/utils/call.d.ts +7 -0
- package/lib/utils/injection.d.ts +2 -1
- package/package.json +2 -2
- package/src/components/configprovider/ConfigProvider.vue +31 -26
- package/src/components/select/Select.vue +755 -781
- package/src/components/select/examples/basic.vue +26 -21
- package/src/components/select/types.ts +27 -0
- package/src/composables/useCachedUid.ts +2 -2
- package/src/composables/useInput.ts +151 -151
- package/src/types/props.ts +21 -19
- package/src/utils/call.ts +34 -0
- package/src/utils/injection.ts +45 -1
package/lib/types/props.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
2
|
export type Color = 'white' | 'black' | 'blue' | 'green' | 'red' | 'yellow' | 'gray';
|
|
3
3
|
export type Variant = 'default' | 'tertiary' | 'primary' | 'dark' | 'success' | 'warning' | 'error';
|
|
4
|
+
export type MaybeArray<T> = T | T[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare function call(funcs: MaybeArray<() => void>): void;
|
|
2
|
+
declare function call<A1>(funcs: MaybeArray<(a1: A1) => void>, a1: A1): void;
|
|
3
|
+
declare function call<A1, A2>(funcs: MaybeArray<(a1: A1, a2: A2) => void>, a1: A1, a2: A2): void;
|
|
4
|
+
declare function call<A1, A2, A3>(funcs: MaybeArray<(a1: A1, a2: A2, a3: A3) => void>, a1: A1, a2: A2, a3: A3): void;
|
|
5
|
+
declare function call<A1, A2, A3, A4>(funcs: MaybeArray<(a1: A1, a2: A2, a3: A3, a4: A4) => void>, a1: A1, a2: A2, a3: A3, a4: A4): void;
|
|
6
|
+
export { call };
|
|
7
|
+
export type MaybeArray<T> = T | T[];
|
package/lib/utils/injection.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type InjectionKey } from 'vue';
|
|
2
2
|
export declare function createInjectionKey<T>(key: string): InjectionKey<T>;
|
|
3
|
+
export declare function createContext<ContextValue>(providerComponentName: string | string[], contextName?: string): readonly [<T extends ContextValue | null | undefined = ContextValue>(fallback?: T) => T extends null ? ContextValue | null : ContextValue, (contextValue: ContextValue) => ContextValue];
|
package/package.json
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createContext } from "../../utils/injection";
|
|
3
|
+
|
|
4
|
+
interface ConfigProviderContextValue {
|
|
5
|
+
useId?: () => string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const [injectConfigProviderContext, provideConfigProviderContext] = createContext<ConfigProviderContextValue>('ConfigProvider');
|
|
9
|
+
|
|
10
|
+
export interface ConfigProviderProps {
|
|
11
|
+
useId?: () => string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'ConfigProvider',
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(defineProps<ConfigProviderProps>(), {
|
|
22
|
+
useId: undefined
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
provideConfigProviderContext({
|
|
26
|
+
useId: props.useId
|
|
27
|
+
})
|
|
28
|
+
</script>
|
|
29
|
+
<template>
|
|
30
|
+
<slot />
|
|
31
|
+
</template>
|