@geektech/one 0.3.1 → 0.3.3
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/README-zh.md +8 -7
- package/README.md +8 -7
- package/dist/cascader/OneCascader.d.ts +47 -0
- package/dist/cascader/index.d.ts +2 -0
- package/dist/categories.d.ts +5 -5
- package/dist/descriptions/OneDescriptions.d.ts +20 -0
- package/dist/descriptions/index.d.ts +2 -0
- package/dist/divider/OneDivider.d.ts +16 -0
- package/dist/divider/index.d.ts +2 -0
- package/dist/dropdown/floating.d.ts +9 -0
- package/dist/dropdown/index.d.ts +1 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.js +3329 -1574
- package/dist/index.js.map +17 -8
- package/dist/overlay/types.d.ts +1 -1
- package/dist/popover/OnePopover.d.ts +42 -0
- package/dist/popover/PopoverBubble.d.ts +29 -0
- package/dist/popover/index.d.ts +4 -0
- package/dist/popover/types.d.ts +18 -0
- package/dist/select/OneSelect.d.ts +2 -0
- package/dist/space/OneSpace.d.ts +20 -0
- package/dist/space/index.d.ts +2 -0
- package/dist/steps/OneSteps.d.ts +23 -0
- package/dist/steps/index.d.ts +2 -0
- package/dist/time-picker/OneTimePicker.d.ts +1 -0
- package/dist/timeline/OneTimeline.d.ts +19 -0
- package/dist/timeline/index.d.ts +2 -0
- package/package.json +4 -4
package/dist/overlay/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type OneFeedbackVariant = 'info' | 'success' | 'warning' | 'error';
|
|
2
2
|
export type OneOverlayContainer = HTMLElement | (() => HTMLElement | null);
|
|
3
3
|
export type OneOverlayPlacement = 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end';
|
|
4
|
-
export type OneOverlayKind = 'message' | 'dialog' | 'tooltip';
|
|
4
|
+
export type OneOverlayKind = 'message' | 'dialog' | 'tooltip' | 'popover';
|
|
5
5
|
export interface OneOverlayHandle<TOptions extends object> {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
update(options: Partial<TOptions>): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Component, type VNode } from '@geektech/tsone';
|
|
2
|
+
import type { OnePopoverProps } from './types';
|
|
3
|
+
interface OnePopoverState {
|
|
4
|
+
internalOpen: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class OnePopover extends Component<OnePopoverProps, OnePopoverState> {
|
|
7
|
+
private readonly positioner;
|
|
8
|
+
private controller;
|
|
9
|
+
private triggerElement;
|
|
10
|
+
private targetDocument;
|
|
11
|
+
private popoverId;
|
|
12
|
+
private hovered;
|
|
13
|
+
private focused;
|
|
14
|
+
private openTimer;
|
|
15
|
+
private closeTimer;
|
|
16
|
+
protected initState(): OnePopoverState;
|
|
17
|
+
protected initStyles(): void;
|
|
18
|
+
protected onMounted(): void;
|
|
19
|
+
protected beforeUpdate(): void;
|
|
20
|
+
protected beforeUnmount(): void;
|
|
21
|
+
protected render(): VNode;
|
|
22
|
+
private createBubble;
|
|
23
|
+
private synchronizeOverlay;
|
|
24
|
+
private bubbleOptions;
|
|
25
|
+
private requestedOpen;
|
|
26
|
+
private requestOpen;
|
|
27
|
+
private handleMouseEnter;
|
|
28
|
+
private handleMouseLeave;
|
|
29
|
+
private handleFocusIn;
|
|
30
|
+
private handleFocusOut;
|
|
31
|
+
private handleTriggerClick;
|
|
32
|
+
private readonly handleDocumentClick;
|
|
33
|
+
private readonly handleDocumentKeydown;
|
|
34
|
+
private scheduleOpen;
|
|
35
|
+
private scheduleClose;
|
|
36
|
+
private clearTimers;
|
|
37
|
+
private cancelOpenTimer;
|
|
38
|
+
private cancelCloseTimer;
|
|
39
|
+
private applyExpanded;
|
|
40
|
+
private normalizedTrigger;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component, type VNode } from '@geektech/tsone';
|
|
2
|
+
import type { OneOverlayPlacement, OneOverlayPositioner } from '../overlay';
|
|
3
|
+
import { type OneNamedStyle } from '../styles/shared';
|
|
4
|
+
export interface PopoverBubbleProps {
|
|
5
|
+
id: string;
|
|
6
|
+
content: VNode | string;
|
|
7
|
+
reference: HTMLElement;
|
|
8
|
+
placement: OneOverlayPlacement;
|
|
9
|
+
offset: number;
|
|
10
|
+
boundaryPadding: number;
|
|
11
|
+
arrow: boolean;
|
|
12
|
+
container: HTMLElement;
|
|
13
|
+
positioner: OneOverlayPositioner;
|
|
14
|
+
}
|
|
15
|
+
export declare const ONE_POPOVER_STYLES: OneNamedStyle[];
|
|
16
|
+
interface PopoverBubbleState {
|
|
17
|
+
}
|
|
18
|
+
export declare class PopoverBubble extends Component<PopoverBubbleProps, PopoverBubbleState> {
|
|
19
|
+
private stopAutoUpdate;
|
|
20
|
+
mount(container: HTMLElement): void;
|
|
21
|
+
setProps(props: Partial<PopoverBubbleProps>): void;
|
|
22
|
+
protected initState(): PopoverBubbleState;
|
|
23
|
+
protected initStyles(): void;
|
|
24
|
+
protected onUnmounted(): void;
|
|
25
|
+
protected render(): VNode;
|
|
26
|
+
private updatePosition;
|
|
27
|
+
private boundaryRect;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { VNode } from '@geektech/tsone';
|
|
2
|
+
import type { OneOverlayContainer, OneOverlayPlacement } from '../overlay';
|
|
3
|
+
export type OnePopoverTrigger = 'hover-focus' | 'click' | 'manual';
|
|
4
|
+
export interface OnePopoverProps {
|
|
5
|
+
content: VNode | string;
|
|
6
|
+
placement?: OneOverlayPlacement;
|
|
7
|
+
trigger?: OnePopoverTrigger;
|
|
8
|
+
haspopup?: string;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
openDelay?: number;
|
|
12
|
+
closeDelay?: number;
|
|
13
|
+
offset?: number;
|
|
14
|
+
container?: OneOverlayContainer;
|
|
15
|
+
arrow?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
children?: Array<VNode | string>;
|
|
18
|
+
}
|
|
@@ -33,10 +33,12 @@ export declare const ONE_SELECT_STYLES: OneNamedStyle[];
|
|
|
33
33
|
export declare class OneSelect extends Component<OneSelectProps, OneSelectState> {
|
|
34
34
|
private fieldContext;
|
|
35
35
|
private unsubscribe;
|
|
36
|
+
private floatingCleanup;
|
|
36
37
|
protected initState(): OneSelectState;
|
|
37
38
|
protected initStyles(): void;
|
|
38
39
|
protected beforeMount(): void;
|
|
39
40
|
protected onMounted(): void;
|
|
41
|
+
protected onUpdated(): void;
|
|
40
42
|
protected onUnmounted(): void;
|
|
41
43
|
protected render(): VNode;
|
|
42
44
|
private getValue;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, type VNode } from '@geektech/tsone';
|
|
2
|
+
import { type OneNamedStyle } from '../styles/shared';
|
|
3
|
+
import type { OneComponentSize } from '../types';
|
|
4
|
+
export type OneSpaceDirection = 'horizontal' | 'vertical';
|
|
5
|
+
export type OneSpaceSize = OneComponentSize | number;
|
|
6
|
+
export type OneSpaceAlign = 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
7
|
+
export interface OneSpaceProps {
|
|
8
|
+
direction?: OneSpaceDirection;
|
|
9
|
+
size?: OneSpaceSize;
|
|
10
|
+
wrap?: boolean;
|
|
11
|
+
align?: OneSpaceAlign;
|
|
12
|
+
children?: Array<VNode | string>;
|
|
13
|
+
}
|
|
14
|
+
export declare const ONE_SPACE_STYLES: OneNamedStyle[];
|
|
15
|
+
export declare function normalizeOneSpaceSize(value: unknown): string;
|
|
16
|
+
export declare class OneSpace extends Component<OneSpaceProps, Record<string, never>> {
|
|
17
|
+
protected initState(): Record<string, never>;
|
|
18
|
+
protected initStyles(): void;
|
|
19
|
+
protected render(): VNode;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Component, type VNode } from '@geektech/tsone';
|
|
2
|
+
import { type OneNamedStyle } from '../styles/shared';
|
|
3
|
+
export type OneStepsStatus = 'wait' | 'process' | 'finish' | 'error';
|
|
4
|
+
export type OneStepsDirection = 'horizontal' | 'vertical';
|
|
5
|
+
export interface OneStepsItem {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
status?: OneStepsStatus;
|
|
9
|
+
}
|
|
10
|
+
export interface OneStepsProps {
|
|
11
|
+
current?: number;
|
|
12
|
+
items: OneStepsItem[];
|
|
13
|
+
direction?: OneStepsDirection;
|
|
14
|
+
onChange?: (current: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const ONE_STEPS_STYLES: OneNamedStyle[];
|
|
17
|
+
export declare function normalizeOneStepsStatus(value: unknown): OneStepsStatus;
|
|
18
|
+
export declare function resolveOneStepsStatus(item: OneStepsItem, current: number, index: number): OneStepsStatus;
|
|
19
|
+
export declare class OneSteps extends Component<OneStepsProps, Record<string, never>> {
|
|
20
|
+
protected initState(): Record<string, never>;
|
|
21
|
+
protected initStyles(): void;
|
|
22
|
+
protected render(): VNode;
|
|
23
|
+
}
|
|
@@ -29,6 +29,7 @@ export declare const ONE_TIME_PICKER_STYLES: OneNamedStyle[];
|
|
|
29
29
|
export declare class OneTimePicker extends Component<OneTimePickerProps, OneTimePickerState> {
|
|
30
30
|
private fieldContext;
|
|
31
31
|
private unsubscribe;
|
|
32
|
+
private floatingCleanup;
|
|
32
33
|
protected initState(): OneTimePickerState;
|
|
33
34
|
protected initStyles(): void;
|
|
34
35
|
protected render(): VNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, type VNode } from '@geektech/tsone';
|
|
2
|
+
import { type OneNamedStyle } from '../styles/shared';
|
|
3
|
+
export type OneTimelineColor = 'primary' | 'success' | 'warning' | 'danger' | 'muted';
|
|
4
|
+
export interface OneTimelineItem {
|
|
5
|
+
title: string;
|
|
6
|
+
content?: string;
|
|
7
|
+
time?: string;
|
|
8
|
+
color?: OneTimelineColor;
|
|
9
|
+
}
|
|
10
|
+
export interface OneTimelineProps {
|
|
11
|
+
items: OneTimelineItem[];
|
|
12
|
+
}
|
|
13
|
+
export declare const ONE_TIMELINE_STYLES: OneNamedStyle[];
|
|
14
|
+
export declare function normalizeOneTimelineColor(value: unknown): OneTimelineColor;
|
|
15
|
+
export declare class OneTimeline extends Component<OneTimelineProps, Record<string, never>> {
|
|
16
|
+
protected initState(): Record<string, never>;
|
|
17
|
+
protected initStyles(): void;
|
|
18
|
+
protected render(): VNode;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geektech/one",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "One UI 是基于 TSone 的轻量级纯 TypeScript UI 组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"docs:build": "bun scripts/docs.ts --build"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@geektech/tsone": ">=0.
|
|
23
|
+
"@geektech/tsone": ">=0.3.0 <0.4.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@geektech/tsone": "0.
|
|
27
|
-
"@geektech/tsone-cli": "0.
|
|
26
|
+
"@geektech/tsone": "0.3.0",
|
|
27
|
+
"@geektech/tsone-cli": "0.3.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|