@pinnacle0/web-ui 0.4.6 → 0.4.7
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/admin/AdminApp/Default/NavigatorSide/index.d.ts +1 -1
- package/core/AmountRangeInput.d.ts +1 -1
- package/core/AuthenticationCodeInput.js +1 -1
- package/core/Button/index.d.ts +4 -4
- package/core/Collapse.d.ts +1 -1
- package/core/FlatList/VirtualFlatList/type.d.ts +2 -2
- package/core/FlatList/shared/hooks/useBounceSwipe.d.ts +3 -3
- package/core/FlatList/type.d.ts +4 -4
- package/core/Form/Item.d.ts +1 -1
- package/core/Form/Item.js +1 -1
- package/core/Form/context.d.ts +1 -1
- package/core/Form/index.js +1 -1
- package/core/ImageUploader/index.js +1 -1
- package/core/Input/index.d.ts +2 -2
- package/core/LocalImporter.js +1 -1
- package/core/Markdown/index.d.ts +1 -1
- package/core/NumberInput/NumberInputPercentage.d.ts +1 -1
- package/core/NumberInput/index.d.ts +3 -3
- package/core/Spin.d.ts +2 -2
- package/core/Table/index.d.ts +2 -2
- package/core/Tag.d.ts +1 -1
- package/core/Tooltip.d.ts +1 -1
- package/core/TypedTabs/index.d.ts +2 -2
- package/core/VirtualList.d.ts +1 -1
- package/core/VirtualTable/type.d.ts +5 -5
- package/hooks/useSwipe/type.d.ts +3 -3
- package/internal/Memo.d.ts +1 -1
- package/internal/StorageHelper.d.ts +1 -1
- package/internal/type.d.ts +2 -2
- package/package.json +4 -4
- package/util/BrowserUtil.d.ts +2 -2
- package/util/Clipboard.js +1 -1
- package/util/ExportUtil.d.ts +1 -1
- package/util/ImportUtil.js +1 -1
- package/util/LocaleUtil.d.ts +1 -1
- package/util/ModalUtil/index.d.ts +3 -3
- package/util/OrientationUtil.d.ts +1 -1
- package/util/PromptUtil/PromptBody.js +1 -1
- package/util/PromptUtil/index.d.ts +1 -1
- package/util/RecentUsedStorageUtil.d.ts +1 -1
- package/util/UploadUtil/type.d.ts +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ControlledFormValue, PickOptional } from "../internal/type";
|
|
3
|
-
export
|
|
3
|
+
export type AmountRangeValue<T extends boolean> = T extends true ? [number | null, number | null] : [number, number];
|
|
4
4
|
export interface Props<T extends boolean> extends ControlledFormValue<AmountRangeValue<T>> {
|
|
5
5
|
allowNull: T;
|
|
6
6
|
scale?: number;
|
|
@@ -39,7 +39,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
39
39
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
40
|
function step(op) {
|
|
41
41
|
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
-
while (_) try {
|
|
42
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
43
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
44
44
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
45
|
switch (op[0]) {
|
package/core/Button/index.d.ts
CHANGED
|
@@ -10,16 +10,16 @@ import "./index.less";
|
|
|
10
10
|
*
|
|
11
11
|
* If we change Props<Color extends string = ButtonColor>, it will lose the type-checking for original Button.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type ButtonSize = "small" | "medium" | "large" | "x-large";
|
|
14
|
+
export type ButtonColor = "primary" | "wire-frame" | "green" | "red";
|
|
15
15
|
/**
|
|
16
16
|
* This typing is needed for customization of ButtonColor and ButtonSize, since a customized color is actually widening, therefore we cannot use extends, because extends means subset of for type literals
|
|
17
17
|
*
|
|
18
18
|
* Truth side ButtonColor is for type hinting only, such that Typescript can factor out ButtonColor before the conditional is actually resolved.
|
|
19
19
|
* (Although ButtonColor extends ExtraColor should have the same effect, but doesn't)
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
type ExtendableColor<ExtraColor extends string> = ButtonColor extends ExtraColor ? ExtraColor | ButtonColor : ButtonColor;
|
|
22
|
+
type ExtendableSize<ExtraSize extends string> = ButtonSize extends ExtraSize ? ExtraSize | ButtonSize : ButtonSize;
|
|
23
23
|
export interface Props<Color extends string, Size extends string = ButtonSize> extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
24
24
|
/** Set link to open when clicked. If set, use a `<Link />` instead of a `<button />` */
|
|
25
25
|
link?: string;
|
package/core/Collapse.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
import type { FlatListItemProps, FlatListProps } from "../type";
|
|
3
|
-
export
|
|
3
|
+
export type Measure = (node: HTMLElement | null) => void;
|
|
4
4
|
export interface VirtualFlatListHandle {
|
|
5
5
|
measure: () => void;
|
|
6
6
|
}
|
|
@@ -17,4 +17,4 @@ export interface VirtualFlatListProps<T> extends Omit<FlatListProps<T>, "renderI
|
|
|
17
17
|
export interface VirtualFlatListItemProps<T> extends FlatListItemProps<T> {
|
|
18
18
|
measure: Measure;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type ItemRenderer<T> = React.FunctionComponent<VirtualFlatListItemProps<T>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { SwipeHookResult, SwipeState } from "../../../../hooks/useSwipe";
|
|
3
|
-
export
|
|
3
|
+
export type Boundary = "upper" | "lower" | null;
|
|
4
4
|
interface BounceSwipeState extends SwipeState {
|
|
5
5
|
boundary: Boundary;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
|
|
7
|
+
export type BounceSwipeHandler = (state: BounceSwipeState) => void;
|
|
8
|
+
type BounceSwipeHookResult = SwipeHookResult;
|
|
9
9
|
interface BounceSwipeHandlers {
|
|
10
10
|
onMove?: BounceSwipeHandler;
|
|
11
11
|
onStart?: BounceSwipeHandler;
|
package/core/FlatList/type.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const PULL_DOWN_REFRESH_THRESHOLD = 50;
|
|
3
|
-
export
|
|
3
|
+
export type LoadingType = "refresh" | "loading" | null;
|
|
4
4
|
export interface FlatListItemProps<T> {
|
|
5
5
|
data: T;
|
|
6
6
|
index: number;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type Gap = {
|
|
9
9
|
top?: number;
|
|
10
10
|
bottom?: number;
|
|
11
11
|
left?: number;
|
|
12
12
|
right?: number;
|
|
13
13
|
} | number;
|
|
14
|
-
export
|
|
15
|
-
export
|
|
14
|
+
export type ItemRenderer<T> = React.FunctionComponent<FlatListItemProps<T>>;
|
|
15
|
+
export type RowKey<T> = (keyof T & string) | ((data: T, index: number) => string) | "index";
|
|
16
16
|
export interface FlatListProps<T> {
|
|
17
17
|
data: T[];
|
|
18
18
|
renderItem: ItemRenderer<T>;
|
package/core/Form/Item.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FormValidationContext } from "./context";
|
|
3
|
-
export
|
|
3
|
+
export type FormValidator = () => string | null | Promise<string | null>;
|
|
4
4
|
export interface Props {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
label?: React.ReactElement | string | number | null;
|
package/core/Form/Item.js
CHANGED
|
@@ -28,7 +28,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
28
28
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
29
|
function step(op) {
|
|
30
30
|
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
32
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
33
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
34
|
switch (op[0]) {
|
package/core/Form/context.d.ts
CHANGED
package/core/Form/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
28
28
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
29
|
function step(op) {
|
|
30
30
|
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
32
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
33
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
34
|
switch (op[0]) {
|
|
@@ -39,7 +39,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
39
39
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
40
|
function step(op) {
|
|
41
41
|
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
-
while (_) try {
|
|
42
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
43
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
44
44
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
45
|
switch (op[0]) {
|
package/core/Input/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { InputProps, PasswordProps, SearchProps, TextAreaProps, InputRef }
|
|
|
4
4
|
import type { ControlledFormValue } from "../../internal/type";
|
|
5
5
|
import "antd/es/input/style";
|
|
6
6
|
import "./index.less";
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
type ExcludedAntInputKeys = "value" | "onChange" | "addonBefore" | "addonAfter";
|
|
8
|
+
export type FocusType = "cursor-at-start" | "cursor-at-last" | "select-all" | "prevent-scroll";
|
|
9
9
|
export interface InputReadonlyProps extends Omit<InputProps, ExcludedAntInputKeys | "readonly" | "disabled" | "allowClear"> {
|
|
10
10
|
value: string;
|
|
11
11
|
}
|
package/core/LocalImporter.js
CHANGED
|
@@ -28,7 +28,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
28
28
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
29
|
function step(op) {
|
|
30
30
|
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
32
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
33
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
34
|
switch (op[0]) {
|
package/core/Markdown/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { PickOptional } from "../../internal/type";
|
|
3
3
|
import type { Props as NumberInputProps } from "./index";
|
|
4
|
-
|
|
4
|
+
type OmitPropsKeys = "displayRenderer" | "scale" | "step" | "min" | "max" | "value" | "onChange";
|
|
5
5
|
export interface Props<AllowNull extends boolean> extends Omit<NumberInputProps<AllowNull>, OmitPropsKeys> {
|
|
6
6
|
/**
|
|
7
7
|
* Number of decimal points used for **percentage** values.
|
|
@@ -4,13 +4,13 @@ import { NumberInputPercentage } from "./NumberInputPercentage";
|
|
|
4
4
|
import type { InputRef as AntInputRef } from "antd/es";
|
|
5
5
|
import type { ControlledFormValue } from "../../internal/type";
|
|
6
6
|
import "./index.less";
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
type DefaultPropsKeys = "scale" | "min" | "max" | "editable" | "stepperMode";
|
|
8
|
+
type PropsWithDefault<AllowNull extends boolean = true> = {
|
|
9
9
|
[K in Exclude<keyof Props<AllowNull>, DefaultPropsKeys>]: Props<AllowNull>[K];
|
|
10
10
|
} & {
|
|
11
11
|
[K in DefaultPropsKeys]: NonNullable<Props<AllowNull>[K]>;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type InputRef = AntInputRef;
|
|
14
14
|
export interface Props<AllowNull extends boolean> extends ControlledFormValue<AllowNull extends true ? number | null : number> {
|
|
15
15
|
/** Whether `null` is allowed in `value` */
|
|
16
16
|
allowNull: AllowNull;
|
package/core/Spin.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export declare class Spin extends React.PureComponent<Props> {
|
|
|
8
8
|
static displayName: string;
|
|
9
9
|
render(): JSX.Element;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type SpinSize = AntSpinSize;
|
|
12
|
+
export type SpinIndicator = AntSpinIndicator;
|
package/core/Table/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare enum SortOrder {
|
|
|
8
8
|
DESC = "DESC",
|
|
9
9
|
ASC = "ASC"
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
type RenderedCell<T extends object> = Exclude<ReturnType<NonNullable<AntColumnsProps<T>["render"]>>, React.ReactNode>;
|
|
12
12
|
export interface TableColumn<RowType extends object, OrderByFieldType = undefined> {
|
|
13
13
|
title: React.ReactElement | string | number;
|
|
14
14
|
renderData: (record: RowType, index: number) => React.ReactNode | RenderedCell<RowType> | undefined;
|
|
@@ -23,7 +23,7 @@ export interface TableColumn<RowType extends object, OrderByFieldType = undefine
|
|
|
23
23
|
customizedKey?: string;
|
|
24
24
|
onCell?: (data: RowType, index?: number) => React.HTMLAttributes<any> | React.TdHTMLAttributes<any>;
|
|
25
25
|
}
|
|
26
|
-
export
|
|
26
|
+
export type TableColumns<RowType extends object, OrderByFieldType = undefined> = Array<TableColumn<RowType, OrderByFieldType>>;
|
|
27
27
|
export interface TableSorter<OrderByFieldType = undefined> {
|
|
28
28
|
currentOrder: SortOrder;
|
|
29
29
|
onSortChange: (sortOrder: SortOrder, orderBy: OrderByFieldType | undefined) => void;
|
package/core/Tag.d.ts
CHANGED
package/core/Tooltip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TooltipPlacement, TooltipProps } from "antd/es/tooltip";
|
|
2
2
|
import "antd/es/tooltip/style";
|
|
3
3
|
import React from "react";
|
|
4
|
-
export
|
|
4
|
+
export type Props = TooltipProps;
|
|
5
5
|
export declare class Tooltip extends React.PureComponent<Props> {
|
|
6
6
|
static displayName: string;
|
|
7
7
|
render(): JSX.Element;
|
|
@@ -7,8 +7,8 @@ export interface TabData {
|
|
|
7
7
|
display?: "default" | "hidden";
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type TypedTabMap<T extends string> = Record<T, TabData>;
|
|
11
|
+
export type TypedTabList<T extends string> = Array<TabData & {
|
|
12
12
|
key: T;
|
|
13
13
|
}>;
|
|
14
14
|
export interface Props<T extends string> extends Omit<TabsProps, "onChange"> {
|
package/core/VirtualList.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import "../internal/polyfill/ResizeObserver";
|
|
|
2
2
|
import type { VirtualizerOptions } from "@tanstack/react-virtual";
|
|
3
3
|
import type { ComponentType } from "react";
|
|
4
4
|
import type { StringKey } from "../internal/type";
|
|
5
|
-
|
|
5
|
+
type Direction = "horizontal" | "vertical";
|
|
6
6
|
export interface ItemProps<T extends object> {
|
|
7
7
|
index: number;
|
|
8
8
|
data: T;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
export
|
|
2
|
+
type ColumnIndex = number;
|
|
3
|
+
export type ColumnFixedPosition = "left" | "right";
|
|
4
4
|
export interface StickyPosition {
|
|
5
5
|
value: number;
|
|
6
6
|
isLast: boolean;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type ColumnsStickyPosition = Record<ColumnIndex, StickyPosition>;
|
|
9
9
|
/**
|
|
10
10
|
* Similar usage of Antd Table but only support partial features: fixed columns, row selection, on row click
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type VirtualTableRowSelection<RowType extends object> = {
|
|
13
13
|
width: number;
|
|
14
14
|
selectedRowKeys: React.Key[];
|
|
15
15
|
onChange: (selectedRowKeys: React.Key[], selectedRows: RowType[]) => void;
|
|
@@ -25,7 +25,7 @@ export declare type VirtualTableRowSelection<RowType extends object> = {
|
|
|
25
25
|
*/
|
|
26
26
|
title?: React.ReactElement | string | number | null;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type VirtualTableColumn<RowType extends object> = {
|
|
29
29
|
title: React.ReactElement | string | number;
|
|
30
30
|
width: number;
|
|
31
31
|
/**
|
package/hooks/useSwipe/type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
export
|
|
2
|
+
export type TouchHandler = Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onTouchStart" | "onTouchMove" | "onTouchEndCapture" | "onTouchCancelCapture">;
|
|
3
3
|
export interface TouchEventHandlers {
|
|
4
4
|
onTouchMove: React.TouchEventHandler;
|
|
5
5
|
onTouchStart: React.TouchEventHandler;
|
|
@@ -20,7 +20,7 @@ export interface SwipeState {
|
|
|
20
20
|
direction: Direction;
|
|
21
21
|
cancel: () => void;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
type SwipeHookHandler = (event: SwipeState) => void;
|
|
24
24
|
export interface SwipeHookHandlers {
|
|
25
25
|
onStart?: SwipeHookHandler;
|
|
26
26
|
onEnd?: SwipeHookHandler;
|
|
@@ -38,5 +38,5 @@ export declare enum Direction {
|
|
|
38
38
|
LEFT = "LEFT",
|
|
39
39
|
RIGHT = "RIGHT"
|
|
40
40
|
}
|
|
41
|
-
export
|
|
41
|
+
export type Vector2 = [number, number];
|
|
42
42
|
export {};
|
package/internal/Memo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type AnyFunctionDecorator = (target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => TypedPropertyDescriptor<(...args: any[]) => any>;
|
|
2
2
|
/**
|
|
3
3
|
* For pure functions:
|
|
4
4
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* In mobile Safari, the user may turn on "Block All Cookies".
|
|
3
3
|
* In such situation, accessing to localStorage/sessionStorage will throw error.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type ClearOptions = {
|
|
6
6
|
keys: string[] | ((key: string) => boolean);
|
|
7
7
|
} | {
|
|
8
8
|
exceptKeys: string[] | ((key: string) => boolean);
|
package/internal/type.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type PickOptional<T> = Pick<T, {
|
|
2
2
|
[K in keyof T]-?: {} extends {
|
|
3
3
|
[P in K]: T[K];
|
|
4
4
|
} ? K : never;
|
|
5
5
|
}[keyof T]>;
|
|
6
|
-
export
|
|
6
|
+
export type StringKey<T extends object> = {
|
|
7
7
|
[P in keyof T]: T[P] extends string ? P : never;
|
|
8
8
|
}[keyof T] & string;
|
|
9
9
|
export interface ControlledFormValue<T> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pinnacle0/web-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"author": "Pinnacle",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@tanstack/react-virtual": "3.0.0-beta.18",
|
|
23
23
|
"antd": "4.24.2",
|
|
24
24
|
"classnames": "2.3.2",
|
|
25
|
-
"dayjs": "1.11.
|
|
25
|
+
"dayjs": "1.11.7",
|
|
26
26
|
"rc-picker": "2.7.0",
|
|
27
27
|
"rc-resize-observer": "1.2.0",
|
|
28
28
|
"react-virtual": "2.10.4"
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"react-dom": "18.2.0",
|
|
52
52
|
"react-router-dom": "5.3.0",
|
|
53
53
|
"typescript": "4.9.3",
|
|
54
|
-
"@pinnacle0/
|
|
55
|
-
"@pinnacle0/
|
|
54
|
+
"@pinnacle0/webpack-util": "0.3.42",
|
|
55
|
+
"@pinnacle0/devtool-util": "1.1.5"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"directory": "build"
|
package/util/BrowserUtil.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type BrowserOS = "windows" | "mac" | "ios" | "android" | "other";
|
|
2
|
+
export type BrowserKernel = "wechat" | "webkit" | "firefox" | "ie" | "other";
|
|
3
3
|
export interface BrowserNewTabSizeOptions {
|
|
4
4
|
width: number;
|
|
5
5
|
height: number;
|
package/util/Clipboard.js
CHANGED
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
package/util/ExportUtil.d.ts
CHANGED
package/util/ImportUtil.js
CHANGED
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
package/util/LocaleUtil.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import React from "react";
|
|
|
8
8
|
*
|
|
9
9
|
* Page refresh is required if you want to switch language.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type Locale = "zh" | "en";
|
|
12
12
|
export declare const LocaleContext: React.Context<Locale>;
|
|
13
13
|
declare class LocaleManager {
|
|
14
14
|
private readonly storageKey;
|
|
@@ -2,9 +2,9 @@ import React from "react";
|
|
|
2
2
|
import type { ModalFunc } from "antd/es/modal/confirm";
|
|
3
3
|
import "antd/es/modal/style";
|
|
4
4
|
import "./index.less";
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export type CreateModalReturnType = ReturnType<ModalFunc>;
|
|
6
|
+
export type ModalConfigWithoutEvent = Omit<ModalConfig, "onOk" | "onCancel">;
|
|
7
|
+
export type CreateAsyncModalPromise<WithCloseHandling extends boolean> = WithCloseHandling extends true ? Promise<"ok" | "cancel" | "close"> : Promise<boolean>;
|
|
8
8
|
export interface ModalConfig {
|
|
9
9
|
body: React.ReactNode;
|
|
10
10
|
title?: React.ReactElement | string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/orientationchange_event
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type OrientationType = "portrait" | "landscape";
|
|
12
12
|
declare function mode(): OrientationType;
|
|
13
13
|
declare function onOrientationChange(callback: () => void): void;
|
|
14
14
|
declare function removeOnChange(callback: () => void): void;
|
|
@@ -28,7 +28,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
28
28
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
29
|
function step(op) {
|
|
30
30
|
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
32
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
33
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
34
|
switch (op[0]) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* In mobile Safari, the user may turn on "Block All Cookies".
|
|
3
3
|
* In such situation, accessing to localStorage will throw error.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
type ListItemType = string | number | boolean;
|
|
6
6
|
declare function get<T extends ListItemType>(key: string, validator?: T[]): T[];
|
|
7
7
|
interface Option {
|
|
8
8
|
maxSize: number;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* - Use snake_case, for logging purpose.
|
|
3
3
|
* - Reason of using `type` instead of `interface`: https://github.com/microsoft/TypeScript/issues/15300
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type UploadLogInfo = {
|
|
6
6
|
file_name: string;
|
|
7
7
|
file_size: string;
|
|
8
8
|
file_type: string;
|
|
@@ -17,8 +17,8 @@ export interface UploadFailureLogEntry extends UploadSuccessLogEntry {
|
|
|
17
17
|
errorMessage: string;
|
|
18
18
|
statusCode?: number;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
21
|
-
export
|
|
20
|
+
export type UploadSuccessCallback<ResponseType = any> = (logEntry: UploadSuccessLogEntry, response: ResponseType) => void;
|
|
21
|
+
export type UploadFailureCallback<ResponseType = any> = (logEntry: UploadFailureLogEntry, response?: ResponseType) => void;
|
|
22
22
|
export interface UploaderProps<SuccessResponseType = any, ErrorResponseType = any> {
|
|
23
23
|
/**
|
|
24
24
|
* POST form field for image content.
|