@hoci/core 0.8.0 → 0.8.1
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/index.cjs +4 -2
- package/dist/index.d.cts +21 -20
- package/dist/index.d.mts +21 -20
- package/dist/index.d.ts +21 -20
- package/dist/index.mjs +4 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -831,14 +831,16 @@ const useFileUpload = shared.defineHookComponent({
|
|
|
831
831
|
return null;
|
|
832
832
|
};
|
|
833
833
|
useEventListener(fileInputRef, "change", (event) => {
|
|
834
|
-
const
|
|
835
|
-
|
|
834
|
+
const input = event.target;
|
|
835
|
+
const newFiles = Array.from(input.files ?? []);
|
|
836
|
+
if (newFiles.length) {
|
|
836
837
|
if (props.multiple) {
|
|
837
838
|
files.value.push(...newFiles);
|
|
838
839
|
} else {
|
|
839
840
|
files.value = newFiles.slice(newFiles.length - 1);
|
|
840
841
|
}
|
|
841
842
|
}
|
|
843
|
+
input.value = "";
|
|
842
844
|
const value = toModelValue(files.value);
|
|
843
845
|
emit("update:modelValue", value);
|
|
844
846
|
emit("change", value);
|
package/dist/index.d.cts
CHANGED
|
@@ -49,7 +49,7 @@ declare const AFFIX_TARGET_KEY: InjectionKey<MaybeRefOrGetter<Element | null | u
|
|
|
49
49
|
declare const useAffix: _hoci_shared.HookComponent<{
|
|
50
50
|
className: vue.ComputedRef<string>;
|
|
51
51
|
wrapperRef: _hoci_shared.ElementRef<HTMLElement>;
|
|
52
|
-
containerRef: vue.ComputedRef<(Window & typeof globalThis) |
|
|
52
|
+
containerRef: vue.ComputedRef<Element | (Window & typeof globalThis) | null>;
|
|
53
53
|
isFixed: Ref<boolean, boolean>;
|
|
54
54
|
placeholderStyle: Ref<CSSProperties, CSSProperties>;
|
|
55
55
|
fixedStyle: Ref<CSSProperties, CSSProperties>;
|
|
@@ -125,10 +125,10 @@ declare const useAffix: _hoci_shared.HookComponent<{
|
|
|
125
125
|
default: number;
|
|
126
126
|
};
|
|
127
127
|
}>, {
|
|
128
|
-
|
|
129
|
-
offset: number;
|
|
130
|
-
position: "top" | "bottom";
|
|
128
|
+
position: "bottom" | "top";
|
|
131
129
|
zIndex: number;
|
|
130
|
+
offset: number;
|
|
131
|
+
fixedClass: string;
|
|
132
132
|
}>;
|
|
133
133
|
declare function provideAffixTarget(target: MaybeRefOrGetter<Element | null | undefined>): void;
|
|
134
134
|
|
|
@@ -151,7 +151,7 @@ declare const fileUploadProps: {
|
|
|
151
151
|
default: boolean;
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
-
declare const fileUploadEmits: ("
|
|
154
|
+
declare const fileUploadEmits: ("update:modelValue" | "change")[];
|
|
155
155
|
type HiFileUploadProps = typeof fileUploadProps;
|
|
156
156
|
interface HiFileUploadSlotData {
|
|
157
157
|
files: File[];
|
|
@@ -165,9 +165,9 @@ declare const useFileUpload: _hoci_shared.HookComponent<{
|
|
|
165
165
|
readonly size: number;
|
|
166
166
|
readonly type: string;
|
|
167
167
|
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
168
|
-
bytes: () => Promise<Uint8Array
|
|
168
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
169
169
|
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
170
|
-
stream: () => ReadableStream<Uint8Array
|
|
170
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
171
171
|
text: () => Promise<string>;
|
|
172
172
|
}[], File[] | {
|
|
173
173
|
readonly lastModified: number;
|
|
@@ -176,13 +176,13 @@ declare const useFileUpload: _hoci_shared.HookComponent<{
|
|
|
176
176
|
readonly size: number;
|
|
177
177
|
readonly type: string;
|
|
178
178
|
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
179
|
-
bytes: () => Promise<Uint8Array
|
|
179
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
180
180
|
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
181
|
-
stream: () => ReadableStream<Uint8Array
|
|
181
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
182
182
|
text: () => Promise<string>;
|
|
183
183
|
}[]>;
|
|
184
184
|
openFileInput: () => void;
|
|
185
|
-
}, ("
|
|
185
|
+
}, ("update:modelValue" | "change")[], {
|
|
186
186
|
modelValue: {
|
|
187
187
|
type: PropType<File | File[]>;
|
|
188
188
|
default: () => never[];
|
|
@@ -276,8 +276,8 @@ declare const useIcon: _hoci_shared.HookComponent<{
|
|
|
276
276
|
default: () => "auto";
|
|
277
277
|
};
|
|
278
278
|
}>, {
|
|
279
|
-
mask: boolean | "auto";
|
|
280
279
|
color: string;
|
|
280
|
+
mask: boolean | "auto";
|
|
281
281
|
}>;
|
|
282
282
|
|
|
283
283
|
declare const itemProps: {
|
|
@@ -351,8 +351,8 @@ declare const useSelectionItem: _hoci_shared.HookComponent<{
|
|
|
351
351
|
};
|
|
352
352
|
}>, {
|
|
353
353
|
value: any;
|
|
354
|
-
disabled: boolean;
|
|
355
354
|
keepAlive: boolean;
|
|
355
|
+
disabled: boolean;
|
|
356
356
|
}>;
|
|
357
357
|
interface HiItemSlotsData {
|
|
358
358
|
active: boolean;
|
|
@@ -486,9 +486,9 @@ declare const usePopover: _hoci_shared.HookComponent<{
|
|
|
486
486
|
default: () => true;
|
|
487
487
|
};
|
|
488
488
|
}>, {
|
|
489
|
-
offset: number;
|
|
490
|
-
visible: boolean;
|
|
491
489
|
disabled: boolean;
|
|
490
|
+
visible: boolean;
|
|
491
|
+
offset: number;
|
|
492
492
|
placement: Placement;
|
|
493
493
|
triggerEvent: TriggerEvent;
|
|
494
494
|
lazy: boolean;
|
|
@@ -573,7 +573,7 @@ declare const selectionProps: {
|
|
|
573
573
|
};
|
|
574
574
|
};
|
|
575
575
|
type SelectionProps = typeof selectionProps;
|
|
576
|
-
declare const selectionEmits: ("
|
|
576
|
+
declare const selectionEmits: ("reject" | "update:modelValue" | "change" | "load" | "unload")[];
|
|
577
577
|
declare function useSelectionContext(): HiSelectionContext;
|
|
578
578
|
declare const useSelectionList: _hoci_shared.HookComponent<{
|
|
579
579
|
options: vue.Reactive<Option[]>;
|
|
@@ -584,7 +584,7 @@ declare const useSelectionList: _hoci_shared.HookComponent<{
|
|
|
584
584
|
render: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
585
585
|
[key: string]: any;
|
|
586
586
|
}>;
|
|
587
|
-
}, ("
|
|
587
|
+
}, ("reject" | "update:modelValue" | "change" | "load" | "unload")[], {
|
|
588
588
|
modelValue: {
|
|
589
589
|
type: PropType<any>;
|
|
590
590
|
default: () => null;
|
|
@@ -726,14 +726,14 @@ declare const switchProps: {
|
|
|
726
726
|
};
|
|
727
727
|
};
|
|
728
728
|
type HiSwitchProps = typeof switchProps;
|
|
729
|
-
declare const switchEmits: ("
|
|
729
|
+
declare const switchEmits: ("reject" | "update:modelValue" | "change")[];
|
|
730
730
|
declare const useSwitch: _hoci_shared.HookComponent<{
|
|
731
731
|
toggle: (value?: any) => void;
|
|
732
732
|
modelValue: vue.Ref<boolean, boolean>;
|
|
733
733
|
className: vue.ComputedRef<string>;
|
|
734
734
|
isDisabled: vue.ComputedRef<boolean>;
|
|
735
735
|
activateEvent: vue.ComputedRef<ActivateEvent>;
|
|
736
|
-
}, ("
|
|
736
|
+
}, ("reject" | "update:modelValue" | "change")[], {
|
|
737
737
|
modelValue: {
|
|
738
738
|
type: BooleanConstructor;
|
|
739
739
|
default: () => false;
|
|
@@ -864,9 +864,10 @@ declare const useVirtualList: _hoci_shared.HookComponent<{
|
|
|
864
864
|
};
|
|
865
865
|
}>, {
|
|
866
866
|
horizontal: boolean;
|
|
867
|
+
options: PartialKeys<VirtualizerOptions<HTMLElement, HTMLElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn" | "getScrollElement">;
|
|
867
868
|
count: number;
|
|
868
869
|
estimateSize: number | ((index: number) => number);
|
|
869
|
-
options: PartialKeys<VirtualizerOptions<HTMLElement, HTMLElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn" | "getScrollElement">;
|
|
870
870
|
}>;
|
|
871
871
|
|
|
872
|
-
export { AFFIX_TARGET_KEY,
|
|
872
|
+
export { AFFIX_TARGET_KEY, affixEmits, affixProps, configProviderProps, fileUploadEmits, fileUploadProps, iconProps, itemEmits, itemProps, popoverEmits, popoverProps, provideAffixTarget, selectionEmits, selectionProps, switchEmits, switchProps, useAffix, useFileUpload, useIcon, usePopover, useSelectionContext, useSelectionItem, useSelectionList, useSwitch, useVirtualList, virtualListEmits, virtualListProps };
|
|
873
|
+
export type { AffixProps, HiFileUploadProps, HiFileUploadSlotData, HiIconProps, HiItemSlotsData, HiSelectionContext, HiSelectionSlotData, HiSwitchProps, InitFunction, Option, Placement, SelectionProps, TriggerEvent, VirtualListSlotData, VirtualizerOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -49,7 +49,7 @@ declare const AFFIX_TARGET_KEY: InjectionKey<MaybeRefOrGetter<Element | null | u
|
|
|
49
49
|
declare const useAffix: _hoci_shared.HookComponent<{
|
|
50
50
|
className: vue.ComputedRef<string>;
|
|
51
51
|
wrapperRef: _hoci_shared.ElementRef<HTMLElement>;
|
|
52
|
-
containerRef: vue.ComputedRef<(Window & typeof globalThis) |
|
|
52
|
+
containerRef: vue.ComputedRef<Element | (Window & typeof globalThis) | null>;
|
|
53
53
|
isFixed: Ref<boolean, boolean>;
|
|
54
54
|
placeholderStyle: Ref<CSSProperties, CSSProperties>;
|
|
55
55
|
fixedStyle: Ref<CSSProperties, CSSProperties>;
|
|
@@ -125,10 +125,10 @@ declare const useAffix: _hoci_shared.HookComponent<{
|
|
|
125
125
|
default: number;
|
|
126
126
|
};
|
|
127
127
|
}>, {
|
|
128
|
-
|
|
129
|
-
offset: number;
|
|
130
|
-
position: "top" | "bottom";
|
|
128
|
+
position: "bottom" | "top";
|
|
131
129
|
zIndex: number;
|
|
130
|
+
offset: number;
|
|
131
|
+
fixedClass: string;
|
|
132
132
|
}>;
|
|
133
133
|
declare function provideAffixTarget(target: MaybeRefOrGetter<Element | null | undefined>): void;
|
|
134
134
|
|
|
@@ -151,7 +151,7 @@ declare const fileUploadProps: {
|
|
|
151
151
|
default: boolean;
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
-
declare const fileUploadEmits: ("
|
|
154
|
+
declare const fileUploadEmits: ("update:modelValue" | "change")[];
|
|
155
155
|
type HiFileUploadProps = typeof fileUploadProps;
|
|
156
156
|
interface HiFileUploadSlotData {
|
|
157
157
|
files: File[];
|
|
@@ -165,9 +165,9 @@ declare const useFileUpload: _hoci_shared.HookComponent<{
|
|
|
165
165
|
readonly size: number;
|
|
166
166
|
readonly type: string;
|
|
167
167
|
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
168
|
-
bytes: () => Promise<Uint8Array
|
|
168
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
169
169
|
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
170
|
-
stream: () => ReadableStream<Uint8Array
|
|
170
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
171
171
|
text: () => Promise<string>;
|
|
172
172
|
}[], File[] | {
|
|
173
173
|
readonly lastModified: number;
|
|
@@ -176,13 +176,13 @@ declare const useFileUpload: _hoci_shared.HookComponent<{
|
|
|
176
176
|
readonly size: number;
|
|
177
177
|
readonly type: string;
|
|
178
178
|
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
179
|
-
bytes: () => Promise<Uint8Array
|
|
179
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
180
180
|
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
181
|
-
stream: () => ReadableStream<Uint8Array
|
|
181
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
182
182
|
text: () => Promise<string>;
|
|
183
183
|
}[]>;
|
|
184
184
|
openFileInput: () => void;
|
|
185
|
-
}, ("
|
|
185
|
+
}, ("update:modelValue" | "change")[], {
|
|
186
186
|
modelValue: {
|
|
187
187
|
type: PropType<File | File[]>;
|
|
188
188
|
default: () => never[];
|
|
@@ -276,8 +276,8 @@ declare const useIcon: _hoci_shared.HookComponent<{
|
|
|
276
276
|
default: () => "auto";
|
|
277
277
|
};
|
|
278
278
|
}>, {
|
|
279
|
-
mask: boolean | "auto";
|
|
280
279
|
color: string;
|
|
280
|
+
mask: boolean | "auto";
|
|
281
281
|
}>;
|
|
282
282
|
|
|
283
283
|
declare const itemProps: {
|
|
@@ -351,8 +351,8 @@ declare const useSelectionItem: _hoci_shared.HookComponent<{
|
|
|
351
351
|
};
|
|
352
352
|
}>, {
|
|
353
353
|
value: any;
|
|
354
|
-
disabled: boolean;
|
|
355
354
|
keepAlive: boolean;
|
|
355
|
+
disabled: boolean;
|
|
356
356
|
}>;
|
|
357
357
|
interface HiItemSlotsData {
|
|
358
358
|
active: boolean;
|
|
@@ -486,9 +486,9 @@ declare const usePopover: _hoci_shared.HookComponent<{
|
|
|
486
486
|
default: () => true;
|
|
487
487
|
};
|
|
488
488
|
}>, {
|
|
489
|
-
offset: number;
|
|
490
|
-
visible: boolean;
|
|
491
489
|
disabled: boolean;
|
|
490
|
+
visible: boolean;
|
|
491
|
+
offset: number;
|
|
492
492
|
placement: Placement;
|
|
493
493
|
triggerEvent: TriggerEvent;
|
|
494
494
|
lazy: boolean;
|
|
@@ -573,7 +573,7 @@ declare const selectionProps: {
|
|
|
573
573
|
};
|
|
574
574
|
};
|
|
575
575
|
type SelectionProps = typeof selectionProps;
|
|
576
|
-
declare const selectionEmits: ("
|
|
576
|
+
declare const selectionEmits: ("reject" | "update:modelValue" | "change" | "load" | "unload")[];
|
|
577
577
|
declare function useSelectionContext(): HiSelectionContext;
|
|
578
578
|
declare const useSelectionList: _hoci_shared.HookComponent<{
|
|
579
579
|
options: vue.Reactive<Option[]>;
|
|
@@ -584,7 +584,7 @@ declare const useSelectionList: _hoci_shared.HookComponent<{
|
|
|
584
584
|
render: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
585
585
|
[key: string]: any;
|
|
586
586
|
}>;
|
|
587
|
-
}, ("
|
|
587
|
+
}, ("reject" | "update:modelValue" | "change" | "load" | "unload")[], {
|
|
588
588
|
modelValue: {
|
|
589
589
|
type: PropType<any>;
|
|
590
590
|
default: () => null;
|
|
@@ -726,14 +726,14 @@ declare const switchProps: {
|
|
|
726
726
|
};
|
|
727
727
|
};
|
|
728
728
|
type HiSwitchProps = typeof switchProps;
|
|
729
|
-
declare const switchEmits: ("
|
|
729
|
+
declare const switchEmits: ("reject" | "update:modelValue" | "change")[];
|
|
730
730
|
declare const useSwitch: _hoci_shared.HookComponent<{
|
|
731
731
|
toggle: (value?: any) => void;
|
|
732
732
|
modelValue: vue.Ref<boolean, boolean>;
|
|
733
733
|
className: vue.ComputedRef<string>;
|
|
734
734
|
isDisabled: vue.ComputedRef<boolean>;
|
|
735
735
|
activateEvent: vue.ComputedRef<ActivateEvent>;
|
|
736
|
-
}, ("
|
|
736
|
+
}, ("reject" | "update:modelValue" | "change")[], {
|
|
737
737
|
modelValue: {
|
|
738
738
|
type: BooleanConstructor;
|
|
739
739
|
default: () => false;
|
|
@@ -864,9 +864,10 @@ declare const useVirtualList: _hoci_shared.HookComponent<{
|
|
|
864
864
|
};
|
|
865
865
|
}>, {
|
|
866
866
|
horizontal: boolean;
|
|
867
|
+
options: PartialKeys<VirtualizerOptions<HTMLElement, HTMLElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn" | "getScrollElement">;
|
|
867
868
|
count: number;
|
|
868
869
|
estimateSize: number | ((index: number) => number);
|
|
869
|
-
options: PartialKeys<VirtualizerOptions<HTMLElement, HTMLElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn" | "getScrollElement">;
|
|
870
870
|
}>;
|
|
871
871
|
|
|
872
|
-
export { AFFIX_TARGET_KEY,
|
|
872
|
+
export { AFFIX_TARGET_KEY, affixEmits, affixProps, configProviderProps, fileUploadEmits, fileUploadProps, iconProps, itemEmits, itemProps, popoverEmits, popoverProps, provideAffixTarget, selectionEmits, selectionProps, switchEmits, switchProps, useAffix, useFileUpload, useIcon, usePopover, useSelectionContext, useSelectionItem, useSelectionList, useSwitch, useVirtualList, virtualListEmits, virtualListProps };
|
|
873
|
+
export type { AffixProps, HiFileUploadProps, HiFileUploadSlotData, HiIconProps, HiItemSlotsData, HiSelectionContext, HiSelectionSlotData, HiSwitchProps, InitFunction, Option, Placement, SelectionProps, TriggerEvent, VirtualListSlotData, VirtualizerOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare const AFFIX_TARGET_KEY: InjectionKey<MaybeRefOrGetter<Element | null | u
|
|
|
49
49
|
declare const useAffix: _hoci_shared.HookComponent<{
|
|
50
50
|
className: vue.ComputedRef<string>;
|
|
51
51
|
wrapperRef: _hoci_shared.ElementRef<HTMLElement>;
|
|
52
|
-
containerRef: vue.ComputedRef<(Window & typeof globalThis) |
|
|
52
|
+
containerRef: vue.ComputedRef<Element | (Window & typeof globalThis) | null>;
|
|
53
53
|
isFixed: Ref<boolean, boolean>;
|
|
54
54
|
placeholderStyle: Ref<CSSProperties, CSSProperties>;
|
|
55
55
|
fixedStyle: Ref<CSSProperties, CSSProperties>;
|
|
@@ -125,10 +125,10 @@ declare const useAffix: _hoci_shared.HookComponent<{
|
|
|
125
125
|
default: number;
|
|
126
126
|
};
|
|
127
127
|
}>, {
|
|
128
|
-
|
|
129
|
-
offset: number;
|
|
130
|
-
position: "top" | "bottom";
|
|
128
|
+
position: "bottom" | "top";
|
|
131
129
|
zIndex: number;
|
|
130
|
+
offset: number;
|
|
131
|
+
fixedClass: string;
|
|
132
132
|
}>;
|
|
133
133
|
declare function provideAffixTarget(target: MaybeRefOrGetter<Element | null | undefined>): void;
|
|
134
134
|
|
|
@@ -151,7 +151,7 @@ declare const fileUploadProps: {
|
|
|
151
151
|
default: boolean;
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
-
declare const fileUploadEmits: ("
|
|
154
|
+
declare const fileUploadEmits: ("update:modelValue" | "change")[];
|
|
155
155
|
type HiFileUploadProps = typeof fileUploadProps;
|
|
156
156
|
interface HiFileUploadSlotData {
|
|
157
157
|
files: File[];
|
|
@@ -165,9 +165,9 @@ declare const useFileUpload: _hoci_shared.HookComponent<{
|
|
|
165
165
|
readonly size: number;
|
|
166
166
|
readonly type: string;
|
|
167
167
|
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
168
|
-
bytes: () => Promise<Uint8Array
|
|
168
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
169
169
|
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
170
|
-
stream: () => ReadableStream<Uint8Array
|
|
170
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
171
171
|
text: () => Promise<string>;
|
|
172
172
|
}[], File[] | {
|
|
173
173
|
readonly lastModified: number;
|
|
@@ -176,13 +176,13 @@ declare const useFileUpload: _hoci_shared.HookComponent<{
|
|
|
176
176
|
readonly size: number;
|
|
177
177
|
readonly type: string;
|
|
178
178
|
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
179
|
-
bytes: () => Promise<Uint8Array
|
|
179
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
180
180
|
slice: (start?: number, end?: number, contentType?: string) => Blob;
|
|
181
|
-
stream: () => ReadableStream<Uint8Array
|
|
181
|
+
stream: () => ReadableStream<Uint8Array<ArrayBuffer>>;
|
|
182
182
|
text: () => Promise<string>;
|
|
183
183
|
}[]>;
|
|
184
184
|
openFileInput: () => void;
|
|
185
|
-
}, ("
|
|
185
|
+
}, ("update:modelValue" | "change")[], {
|
|
186
186
|
modelValue: {
|
|
187
187
|
type: PropType<File | File[]>;
|
|
188
188
|
default: () => never[];
|
|
@@ -276,8 +276,8 @@ declare const useIcon: _hoci_shared.HookComponent<{
|
|
|
276
276
|
default: () => "auto";
|
|
277
277
|
};
|
|
278
278
|
}>, {
|
|
279
|
-
mask: boolean | "auto";
|
|
280
279
|
color: string;
|
|
280
|
+
mask: boolean | "auto";
|
|
281
281
|
}>;
|
|
282
282
|
|
|
283
283
|
declare const itemProps: {
|
|
@@ -351,8 +351,8 @@ declare const useSelectionItem: _hoci_shared.HookComponent<{
|
|
|
351
351
|
};
|
|
352
352
|
}>, {
|
|
353
353
|
value: any;
|
|
354
|
-
disabled: boolean;
|
|
355
354
|
keepAlive: boolean;
|
|
355
|
+
disabled: boolean;
|
|
356
356
|
}>;
|
|
357
357
|
interface HiItemSlotsData {
|
|
358
358
|
active: boolean;
|
|
@@ -486,9 +486,9 @@ declare const usePopover: _hoci_shared.HookComponent<{
|
|
|
486
486
|
default: () => true;
|
|
487
487
|
};
|
|
488
488
|
}>, {
|
|
489
|
-
offset: number;
|
|
490
|
-
visible: boolean;
|
|
491
489
|
disabled: boolean;
|
|
490
|
+
visible: boolean;
|
|
491
|
+
offset: number;
|
|
492
492
|
placement: Placement;
|
|
493
493
|
triggerEvent: TriggerEvent;
|
|
494
494
|
lazy: boolean;
|
|
@@ -573,7 +573,7 @@ declare const selectionProps: {
|
|
|
573
573
|
};
|
|
574
574
|
};
|
|
575
575
|
type SelectionProps = typeof selectionProps;
|
|
576
|
-
declare const selectionEmits: ("
|
|
576
|
+
declare const selectionEmits: ("reject" | "update:modelValue" | "change" | "load" | "unload")[];
|
|
577
577
|
declare function useSelectionContext(): HiSelectionContext;
|
|
578
578
|
declare const useSelectionList: _hoci_shared.HookComponent<{
|
|
579
579
|
options: vue.Reactive<Option[]>;
|
|
@@ -584,7 +584,7 @@ declare const useSelectionList: _hoci_shared.HookComponent<{
|
|
|
584
584
|
render: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
585
585
|
[key: string]: any;
|
|
586
586
|
}>;
|
|
587
|
-
}, ("
|
|
587
|
+
}, ("reject" | "update:modelValue" | "change" | "load" | "unload")[], {
|
|
588
588
|
modelValue: {
|
|
589
589
|
type: PropType<any>;
|
|
590
590
|
default: () => null;
|
|
@@ -726,14 +726,14 @@ declare const switchProps: {
|
|
|
726
726
|
};
|
|
727
727
|
};
|
|
728
728
|
type HiSwitchProps = typeof switchProps;
|
|
729
|
-
declare const switchEmits: ("
|
|
729
|
+
declare const switchEmits: ("reject" | "update:modelValue" | "change")[];
|
|
730
730
|
declare const useSwitch: _hoci_shared.HookComponent<{
|
|
731
731
|
toggle: (value?: any) => void;
|
|
732
732
|
modelValue: vue.Ref<boolean, boolean>;
|
|
733
733
|
className: vue.ComputedRef<string>;
|
|
734
734
|
isDisabled: vue.ComputedRef<boolean>;
|
|
735
735
|
activateEvent: vue.ComputedRef<ActivateEvent>;
|
|
736
|
-
}, ("
|
|
736
|
+
}, ("reject" | "update:modelValue" | "change")[], {
|
|
737
737
|
modelValue: {
|
|
738
738
|
type: BooleanConstructor;
|
|
739
739
|
default: () => false;
|
|
@@ -864,9 +864,10 @@ declare const useVirtualList: _hoci_shared.HookComponent<{
|
|
|
864
864
|
};
|
|
865
865
|
}>, {
|
|
866
866
|
horizontal: boolean;
|
|
867
|
+
options: PartialKeys<VirtualizerOptions<HTMLElement, HTMLElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn" | "getScrollElement">;
|
|
867
868
|
count: number;
|
|
868
869
|
estimateSize: number | ((index: number) => number);
|
|
869
|
-
options: PartialKeys<VirtualizerOptions<HTMLElement, HTMLElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn" | "getScrollElement">;
|
|
870
870
|
}>;
|
|
871
871
|
|
|
872
|
-
export { AFFIX_TARGET_KEY,
|
|
872
|
+
export { AFFIX_TARGET_KEY, affixEmits, affixProps, configProviderProps, fileUploadEmits, fileUploadProps, iconProps, itemEmits, itemProps, popoverEmits, popoverProps, provideAffixTarget, selectionEmits, selectionProps, switchEmits, switchProps, useAffix, useFileUpload, useIcon, usePopover, useSelectionContext, useSelectionItem, useSelectionList, useSwitch, useVirtualList, virtualListEmits, virtualListProps };
|
|
873
|
+
export type { AffixProps, HiFileUploadProps, HiFileUploadSlotData, HiIconProps, HiItemSlotsData, HiSelectionContext, HiSelectionSlotData, HiSwitchProps, InitFunction, Option, Placement, SelectionProps, TriggerEvent, VirtualListSlotData, VirtualizerOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -830,14 +830,16 @@ const useFileUpload = defineHookComponent({
|
|
|
830
830
|
return null;
|
|
831
831
|
};
|
|
832
832
|
useEventListener(fileInputRef, "change", (event) => {
|
|
833
|
-
const
|
|
834
|
-
|
|
833
|
+
const input = event.target;
|
|
834
|
+
const newFiles = Array.from(input.files ?? []);
|
|
835
|
+
if (newFiles.length) {
|
|
835
836
|
if (props.multiple) {
|
|
836
837
|
files.value.push(...newFiles);
|
|
837
838
|
} else {
|
|
838
839
|
files.value = newFiles.slice(newFiles.length - 1);
|
|
839
840
|
}
|
|
840
841
|
}
|
|
842
|
+
input.value = "";
|
|
841
843
|
const value = toModelValue(files.value);
|
|
842
844
|
emit("update:modelValue", value);
|
|
843
845
|
emit("change", value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hoci/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Chizuki <chizukicn@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"vue": "^3.0.0-0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tanstack/virtual-core": "^3.13.
|
|
30
|
+
"@tanstack/virtual-core": "^3.13.12",
|
|
31
31
|
"maybe-types": "^0.2.0",
|
|
32
32
|
"tslx": "^0.1.1",
|
|
33
|
-
"@hoci/shared": "0.8.
|
|
33
|
+
"@hoci/shared": "0.8.1"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "unbuild",
|