@pinnacle0/web-ui 0.4.5 → 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.
Files changed (43) hide show
  1. package/admin/AdminApp/Default/NavigatorSide/index.d.ts +1 -1
  2. package/core/AmountRangeInput.d.ts +1 -1
  3. package/core/AuthenticationCodeInput.js +1 -1
  4. package/core/Button/index.d.ts +4 -4
  5. package/core/Collapse.d.ts +1 -1
  6. package/core/FlatList/VirtualFlatList/type.d.ts +2 -2
  7. package/core/FlatList/shared/hooks/useBounceSwipe.d.ts +3 -3
  8. package/core/FlatList/type.d.ts +4 -4
  9. package/core/Form/Item.d.ts +1 -1
  10. package/core/Form/Item.js +1 -1
  11. package/core/Form/context.d.ts +1 -1
  12. package/core/Form/index.js +1 -1
  13. package/core/ImageUploader/index.js +1 -1
  14. package/core/Input/index.d.ts +2 -2
  15. package/core/LocalImporter.js +1 -1
  16. package/core/Markdown/index.d.ts +1 -1
  17. package/core/NumberInput/NumberInputPercentage.d.ts +1 -1
  18. package/core/NumberInput/index.d.ts +3 -3
  19. package/core/Spin.d.ts +2 -2
  20. package/core/Table/index.d.ts +2 -2
  21. package/core/Tag.d.ts +1 -1
  22. package/core/Tooltip.d.ts +1 -1
  23. package/core/TypedTabs/index.d.ts +2 -2
  24. package/core/VirtualList.d.ts +1 -1
  25. package/core/VirtualTable/hooks/useScroll.js +2 -2
  26. package/core/VirtualTable/hooks/useScroll.js.map +1 -1
  27. package/core/VirtualTable/type.d.ts +5 -5
  28. package/hooks/useSwipe/type.d.ts +3 -3
  29. package/internal/Memo.d.ts +1 -1
  30. package/internal/StorageHelper.d.ts +1 -1
  31. package/internal/type.d.ts +2 -2
  32. package/package.json +4 -4
  33. package/util/BrowserUtil.d.ts +2 -2
  34. package/util/Clipboard.js +1 -1
  35. package/util/ExportUtil.d.ts +1 -1
  36. package/util/ImportUtil.js +1 -1
  37. package/util/LocaleUtil.d.ts +1 -1
  38. package/util/ModalUtil/index.d.ts +3 -3
  39. package/util/OrientationUtil.d.ts +1 -1
  40. package/util/PromptUtil/PromptBody.js +1 -1
  41. package/util/PromptUtil/index.d.ts +1 -1
  42. package/util/RecentUsedStorageUtil.d.ts +1 -1
  43. package/util/UploadUtil/type.d.ts +3 -3
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import "./index.less";
3
- declare type DrawerUserInfo = {
3
+ type DrawerUserInfo = {
4
4
  [title: string]: React.ReactElement | string | null;
5
5
  };
6
6
  interface Props {
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { ControlledFormValue, PickOptional } from "../internal/type";
3
- export declare type AmountRangeValue<T extends boolean> = T extends true ? [number | null, number | null] : [number, number];
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]) {
@@ -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 declare type ButtonSize = "small" | "medium" | "large" | "x-large";
14
- export declare type ButtonColor = "primary" | "wire-frame" | "green" | "red";
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
- declare type ExtendableColor<ExtraColor extends string> = ButtonColor extends ExtraColor ? ExtraColor | ButtonColor : ButtonColor;
22
- declare type ExtendableSize<ExtraSize extends string> = ButtonSize extends ExtraSize ? ExtraSize | ButtonSize : ButtonSize;
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;
@@ -9,4 +9,4 @@ export declare class Collapse extends React.PureComponent<Props> {
9
9
  static Panel: React.FC<CollapsePanelProps>;
10
10
  render(): JSX.Element;
11
11
  }
12
- export declare type PanelProps = CollapsePanelProps;
12
+ export type PanelProps = CollapsePanelProps;
@@ -1,6 +1,6 @@
1
1
  import type React from "react";
2
2
  import type { FlatListItemProps, FlatListProps } from "../type";
3
- export declare type Measure = (node: HTMLElement | null) => void;
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 declare type ItemRenderer<T> = React.FunctionComponent<VirtualFlatListItemProps<T>>;
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 declare type Boundary = "upper" | "lower" | null;
3
+ export type Boundary = "upper" | "lower" | null;
4
4
  interface BounceSwipeState extends SwipeState {
5
5
  boundary: Boundary;
6
6
  }
7
- export declare type BounceSwipeHandler = (state: BounceSwipeState) => void;
8
- declare type BounceSwipeHookResult = SwipeHookResult;
7
+ export type BounceSwipeHandler = (state: BounceSwipeState) => void;
8
+ type BounceSwipeHookResult = SwipeHookResult;
9
9
  interface BounceSwipeHandlers {
10
10
  onMove?: BounceSwipeHandler;
11
11
  onStart?: BounceSwipeHandler;
@@ -1,18 +1,18 @@
1
1
  /// <reference types="react" />
2
2
  export declare const PULL_DOWN_REFRESH_THRESHOLD = 50;
3
- export declare type LoadingType = "refresh" | "loading" | null;
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 declare type Gap = {
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 declare type ItemRenderer<T> = React.FunctionComponent<FlatListItemProps<T>>;
15
- export declare type RowKey<T> = (keyof T & string) | ((data: T, index: number) => string) | "index";
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>;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { FormValidationContext } from "./context";
3
- export declare type FormValidator = () => string | null | Promise<string | null>;
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]) {
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { TooltipPlacement } from "../Tooltip";
3
- export declare type FormErrorDisplayMode = {
3
+ export type FormErrorDisplayMode = {
4
4
  type: "popover";
5
5
  placement?: TooltipPlacement;
6
6
  } | {
@@ -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]) {
@@ -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
- declare type ExcludedAntInputKeys = "value" | "onChange" | "addonBefore" | "addonAfter";
8
- export declare type FocusType = "cursor-at-start" | "cursor-at-last" | "select-all" | "prevent-scroll";
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
  }
@@ -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]) {
@@ -8,7 +8,7 @@ import "./index.less";
8
8
  *
9
9
  * Nested usage not supported yet.
10
10
  */
11
- declare type MarkdownSymbol = "**" | "__" | "`";
11
+ type MarkdownSymbol = "**" | "__" | "`";
12
12
  export interface Props {
13
13
  children: string;
14
14
  whitelist?: MarkdownSymbol[];
@@ -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
- declare type OmitPropsKeys = "displayRenderer" | "scale" | "step" | "min" | "max" | "value" | "onChange";
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
- declare type DefaultPropsKeys = "scale" | "min" | "max" | "editable" | "stepperMode";
8
- declare type PropsWithDefault<AllowNull extends boolean = true> = {
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 declare type InputRef = AntInputRef;
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 declare type SpinSize = AntSpinSize;
12
- export declare type SpinIndicator = AntSpinIndicator;
11
+ export type SpinSize = AntSpinSize;
12
+ export type SpinIndicator = AntSpinIndicator;
@@ -8,7 +8,7 @@ declare enum SortOrder {
8
8
  DESC = "DESC",
9
9
  ASC = "ASC"
10
10
  }
11
- declare type RenderedCell<T extends object> = Exclude<ReturnType<NonNullable<AntColumnsProps<T>["render"]>>, React.ReactNode>;
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 declare type TableColumns<RowType extends object, OrderByFieldType = undefined> = Array<TableColumn<RowType, OrderByFieldType>>;
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
@@ -8,4 +8,4 @@ export declare class Tag extends React.PureComponent<Props> {
8
8
  static displayName: string;
9
9
  render(): JSX.Element;
10
10
  }
11
- export declare type TagColor = PresetColorType | PresetStatusColorType;
11
+ export type TagColor = PresetColorType | PresetStatusColorType;
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 declare type Props = TooltipProps;
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 declare type TypedTabMap<T extends string> = Record<T, TabData>;
11
- export declare type TypedTabList<T extends string> = Array<TabData & {
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"> {
@@ -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
- declare type Direction = "horizontal" | "vertical";
5
+ type Direction = "horizontal" | "vertical";
6
6
  export interface ItemProps<T extends object> {
7
7
  index: number;
8
8
  data: T;
@@ -27,12 +27,12 @@ export var useScroll = function (_a) {
27
27
  }
28
28
  });
29
29
  }, [scrollContentRef, headerRef, checkIsScrollToEdge]);
30
- var tableBodyRef = function (node) {
30
+ var tableBodyRef = React.useCallback(function (node) {
31
31
  if (node) {
32
32
  checkIsScrollToEdge();
33
33
  calculateScrollBarSize();
34
34
  }
35
- };
35
+ }, [calculateScrollBarSize, checkIsScrollToEdge]);
36
36
  return {
37
37
  onScroll: onScroll,
38
38
  scrollBarSize: scrollBarSize,
@@ -1 +1 @@
1
- {"version":3,"file":"useScroll.js","sourceRoot":"","sources":["../../../../src/core/VirtualTable/hooks/useScroll.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,IAAM,SAAS,GAAG,UAAC,EAAkD;QAAjD,gBAAgB,sBAAA,EAAE,SAAS,eAAA,EAAE,YAAY,kBAAA;IAChE,IAAM,mBAAmB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;IACxD,IAAA,KAA0C,gBAAgB,CAAC,gBAAgB,EAAE,YAAY,CAAC,EAAzF,aAAa,mBAAA,EAAE,sBAAsB,4BAAoD,CAAC;IAEjG,IAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC;QAC/B,qBAAqB,CAAC;YAClB,IAAI,gBAAgB,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,IAAI,gBAAgB,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,OAAO,CAAC,UAAU,EAAE;gBACvH,SAAS,CAAC,OAAO,CAAC,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC;gBACnE,mBAAmB,EAAE,CAAC;aACzB;QACL,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAEvD,IAAM,YAAY,GAAG,UAAC,IAA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,gBAAgB,CAAC,WAAW,GAAG,WAAW,CAAC,CAAC;SAC/C;IACL,CAAC,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAEzC,KAAK,CAAC,SAAS,CAAC;QACZ,sBAAsB,EAAE,CAAC;IAC7B,CAAC,EAAE,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC;IAE3C,OAAO;QACH,aAAa,eAAA;QACb,sBAAsB,wBAAA;KACzB,CAAC;AACN,CAAC,CAAC"}
@@ -1,15 +1,15 @@
1
1
  /// <reference types="react" />
2
- declare type ColumnIndex = number;
3
- export declare type ColumnFixedPosition = "left" | "right";
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 declare type ColumnsStickyPosition = Record<ColumnIndex, StickyPosition>;
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 declare type VirtualTableRowSelection<RowType extends object> = {
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 declare type VirtualTableColumn<RowType extends object> = {
28
+ export type VirtualTableColumn<RowType extends object> = {
29
29
  title: React.ReactElement | string | number;
30
30
  width: number;
31
31
  /**
@@ -1,5 +1,5 @@
1
1
  import type React from "react";
2
- export declare type TouchHandler = Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "onTouchStart" | "onTouchMove" | "onTouchEndCapture" | "onTouchCancelCapture">;
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
- declare type SwipeHookHandler = (event: SwipeState) => void;
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 declare type Vector2 = [number, number];
41
+ export type Vector2 = [number, number];
42
42
  export {};
@@ -1,4 +1,4 @@
1
- declare type AnyFunctionDecorator = (target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => TypedPropertyDescriptor<(...args: any[]) => any>;
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
- declare type ClearOptions = {
5
+ type ClearOptions = {
6
6
  keys: string[] | ((key: string) => boolean);
7
7
  } | {
8
8
  exceptKeys: string[] | ((key: string) => boolean);
@@ -1,9 +1,9 @@
1
- export declare type PickOptional<T> = Pick<T, {
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 declare type StringKey<T extends object> = {
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.5",
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.6",
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/devtool-util": "1.1.5",
55
- "@pinnacle0/webpack-util": "0.3.42"
54
+ "@pinnacle0/webpack-util": "0.3.42",
55
+ "@pinnacle0/devtool-util": "1.1.5"
56
56
  },
57
57
  "publishConfig": {
58
58
  "directory": "build"
@@ -1,5 +1,5 @@
1
- export declare type BrowserOS = "windows" | "mac" | "ios" | "android" | "other";
2
- export declare type BrowserKernel = "wechat" | "webkit" | "firefox" | "ie" | "other";
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]) {
@@ -1,4 +1,4 @@
1
- export declare type ExportColumn<T> = {
1
+ export type ExportColumn<T> = {
2
2
  title: string;
3
3
  renderData: (data: T, index: number) => string | number;
4
4
  };
@@ -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]) {
@@ -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 declare type Locale = "zh" | "en";
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 declare type CreateModalReturnType = ReturnType<ModalFunc>;
6
- export declare type ModalConfigWithoutEvent = Omit<ModalConfig, "onOk" | "onCancel">;
7
- export declare type CreateAsyncModalPromise<WithCloseHandling extends boolean> = WithCloseHandling extends true ? Promise<"ok" | "cancel" | "close"> : Promise<boolean>;
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 declare type OrientationType = "portrait" | "landscape";
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]) {
@@ -1,4 +1,4 @@
1
- export declare type PromptResult = {
1
+ export type PromptResult = {
2
2
  value: string;
3
3
  } | null;
4
4
  export interface PromptConfig {
@@ -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
- declare type ListItemType = string | number | boolean;
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 declare type UploadLogInfo = {
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 declare type UploadSuccessCallback<ResponseType = any> = (logEntry: UploadSuccessLogEntry, response: ResponseType) => void;
21
- export declare type UploadFailureCallback<ResponseType = any> = (logEntry: UploadFailureLogEntry, response?: ResponseType) => void;
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.