@unicom-cloud/ui 0.8.113 → 0.8.115
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/Affix.js +2 -2
- package/Alert.js +2 -2
- package/AutoComplete.js +1 -1
- package/BackTop.js +3 -3
- package/Badge.js +2 -2
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +1 -1
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/ColorPicker.js +1 -1
- package/Comment.js +1 -1
- package/ConfigProvider.js +1 -1
- package/Copy.js +1 -1
- package/Countdown.js +4 -4
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Details.js +4 -4
- package/Development.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +2 -2
- package/Empty.js +1 -1
- package/Flex.js +4 -4
- package/Form.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/LiquidFill.js +4 -4
- package/List.js +6 -5
- package/Loading.js +4 -4
- package/Marquee.js +7 -6
- package/Mentions.js +1 -1
- package/Menu.js +1 -1
- package/Message.js +2 -2
- package/Modal.js +1 -1
- package/Notice.js +4 -4
- package/Notification.js +2 -2
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +4 -2
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/QrCode.js +7 -7
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +2 -2
- package/Result.js +1 -1
- package/RichText.js +1 -1
- package/Segmented.js +4 -4
- package/Skeleton.js +1 -1
- package/Slider.js +2 -2
- package/Space.js +4 -4
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +2 -2
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +1 -1
- package/Tour.js +4 -4
- package/Transfer.js +1 -1
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +3 -3
- package/affix/index.js +2 -2
- package/alert/index.js +2 -2
- package/anchor/Anchor.js +2 -2
- package/anchor/Link.js +1 -1
- package/app/App.js +2 -2
- package/auto-complete/index.js +1 -1
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +3 -3
- package/badge/Count.js +1 -1
- package/badge/index.js +2 -2
- package/breadcrumb/index.js +2 -2
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +2 -2
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +2 -2
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/GroupBlock.js +2 -2
- package/checkbox/index.js +2 -2
- package/chunk/{C6A94b7f.js → BcWPf1id.js} +1 -1
- package/chunk/BcdTSJks.js +48 -0
- package/chunk/{RjJoagzL.js → CEAeR6xB.js} +1 -1
- package/chunk/{yWKJUe_w.js → CKojyqln.js} +4 -4
- package/chunk/{DrYaod6k.js → CRgtPpMG.js} +1 -1
- package/chunk/{3t4FwEoB.js → CVjWKHBo.js} +1 -1
- package/chunk/{DB0hUIM1.js → CYPFoLks.js} +4 -4
- package/chunk/{D0dVE1v1.js → CcH9qbbg.js} +418 -416
- package/chunk/{Bzx5BueA.js → Ch4iApRQ.js} +2 -2
- package/chunk/{CbXCgtzv.js → Cs9GrNJa.js} +5 -5
- package/chunk/CxbF1opI.js +231 -0
- package/chunk/{CRdegvoa.js → D3F0iWPu.js} +1 -1
- package/chunk/{DzlfiVe2.js → D6I1_o6O.js} +1 -1
- package/chunk/{DA5AMZwY.js → DPDyV8yt.js} +3 -3
- package/chunk/{B--6x-RL.js → DQ8_XXrH.js} +1 -1
- package/chunk/{hc_ufgVf.js → DmHIX8hU.js} +166 -121
- package/chunk/{CYDaUML7.js → DstheLSK.js} +4 -4
- package/chunk/{BHAu6wbC.js → HFPyZ48d.js} +37 -35
- package/chunk/{Bcl7dWlJ.js → efH9HX0H.js} +3 -3
- package/chunk/exc7v_Hl.js +53 -0
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +2 -2
- package/color-picker/index.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +1 -1
- package/config-provider/context.js +1 -1
- package/config-provider/index.js +2 -2
- package/copy/index.js +1 -1
- package/countdown/index.js +4 -4
- package/date-picker/Picker.js +1 -1
- package/date-picker/RangePicker.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +1 -1
- package/details/index.js +4 -4
- package/development/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +89 -93
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +2 -2
- package/empty/index.js +1 -1
- package/flex/index.js +4 -4
- package/form/Control.js +115 -103
- package/form/Form.js +2 -2
- package/form/FormItem.js +2 -2
- package/form/index.js +1 -1
- package/form/promisify.js +10 -19
- package/form/store.js +3 -3
- package/form/util.js +62 -52
- package/grid/Grid.js +1 -1
- package/grid/Item.js +1 -1
- package/hooks/index.js +3 -3
- package/hooks/useInView.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/useWatermark.js +1 -1
- package/icon/addFromIconFontCn.js +1 -1
- package/icon/index.js +2 -2
- package/icon-hover/index.js +1 -1
- package/icons/file.js +1 -1
- package/image/Image.js +3 -3
- package/image/ImagePreview.js +6 -6
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +739 -726
- package/input/Button.js +1 -1
- package/input/Group.js +1 -1
- package/input/Input.js +2 -2
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input/autoSizeTextAreaHeight.js +29 -20
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +2 -2
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/liquid-fill/index.js +4 -4
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +2 -1
- package/loading/index.js +4 -4
- package/locale/en-US.js +5 -3
- package/locale/tr-TR.js +5 -3
- package/marquee/index.js +7 -6
- package/marquee-/index.js +7 -6
- package/mentions/index.js +1 -1
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +2 -2
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +5 -5
- package/modal/index.js +2 -2
- package/notice/index.js +4 -4
- package/notification/index.js +2 -2
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.js +1 -1
- package/package.json +1 -1
- package/page-header/index.js +1 -1
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +103 -31
- package/pagination/Pagination.js +38 -35
- package/pagination/index.js +2 -0
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popover/index.js +1 -1
- package/progress/index.js +1 -1
- package/qr-code/index.js +1233 -45
- package/radio/Group.js +2 -2
- package/radio/GroupBlock.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +1 -1
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +2 -2
- package/resize-box/SplitGroup.js +2 -2
- package/resize-box/index.js +2 -2
- package/result/index.js +1 -1
- package/rich-text/index.js +1 -1
- package/row-col/Col-.js +1 -1
- package/row-col/Col.js +1 -1
- package/row-col/Row.js +1 -1
- package/segmented/index.js +21 -21
- package/select/Option.js +1 -1
- package/select/Select.js +2 -2
- package/select-view/Core.js +1 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +2 -2
- package/slider/index.js +2 -2
- package/space/index.js +4 -4
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/splitter/Panel.js +1 -1
- package/splitter/SplitBar.js +2 -2
- package/splitter/Splitter.js +2 -2
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/style.css +1 -1
- package/switch/index.js +2 -2
- package/table/Table.js +5 -4
- package/table/index.js +4 -4
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +1 -1
- package/tour/index.js +4 -4
- package/transfer/Item.js +2 -2
- package/transfer/List.js +2 -2
- package/transfer/index.js +1 -1
- package/tree/Animation.js +3 -3
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/Select.js +2 -2
- package/tree-select/index.js +1 -1
- package/trigger/getPopupStyle.js +1 -1
- package/trigger/index.js +145 -145
- package/types/common/hooks/useWindowSize.d.ts +4 -4
- package/types/common/utils/dom.d.ts +1 -1
- package/types/common/utils/lodash.d.ts +2 -1
- package/types/common/utils/reactDOM.d.ts +10 -1
- package/types/common/utils/validate.d.ts +2 -0
- package/types/pc/form/interface.d.ts +6 -1
- package/types/pc/form/promisify.d.ts +5 -0
- package/types/pc/form/store.d.ts +1 -1
- package/types/pc/form/util.d.ts +1 -1
- package/types/pc/input/autoSizeTextAreaHeight.d.ts +4 -2
- package/types/pc/pagination/PageOption.d.ts +3 -0
- package/types/pc/pagination/index.d.ts +2 -0
- package/types/pc/pagination/interface.d.ts +5 -0
- package/types/pc/qr-code/examples/demo.d.ts +1 -0
- package/types/pc/qr-code/examples/download.d.ts +2 -0
- package/types/pc/qr-code/examples/full.d.ts +2 -0
- package/types/pc/qr-code/examples/image.d.ts +2 -0
- package/types/pc/qr-code/index.d.ts +2 -0
- package/types/pc/qr-code/src/index.d.ts +116 -0
- package/types/pc/qr-code/src/qrcodegen.d.ts +95 -0
- package/types/pc/qr-code/src/qrcodegen2.d.ts +325 -0
- package/types/pc/utils/validate.d.ts +1 -1
- package/typography/Base.js +1 -1
- package/typography/Ellipsis.js +2 -2
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +2 -2
- package/upload/Uploader.js +1 -1
- package/upload/request_.js +1972 -41
- package/utils/PqbCSSTransition.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/dom.js +1 -1
- package/utils/index.js +247 -235
- package/utils/lodash.js +33 -32
- package/utils/react19Adapter.js +1 -1
- package/utils/reactDOM.js +1 -1
- package/utils/validate.js +15 -5
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/chunk/CXrVhA6-.js +0 -54
- package/chunk/De8RLlOK.js +0 -231
- package/chunk/d1c9z8T1.js +0 -49
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 获取页面视口宽高大小,并在页面有 resize 时更新大小
|
|
3
3
|
* @desc {en} Get the width and height of the page viewport, and update the size when the page is resized
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @returns 页面宽高,{
|
|
4
|
+
* @param debounceFlag 是否开启防抖处理
|
|
5
|
+
* @param resizeCallback 回调函数
|
|
6
|
+
* @returns 页面宽高,{ width, height }
|
|
7
7
|
* @example
|
|
8
8
|
* ```
|
|
9
9
|
* import { useWindowSize } from './hooks';
|
|
10
10
|
*
|
|
11
|
-
* const {
|
|
11
|
+
* const { width, height } = useWindowSize();
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
declare function useWindowSize(debounceFlag: boolean | undefined, resizeCallback: any): {
|
|
@@ -2,7 +2,7 @@ export declare const isServerRendering: boolean;
|
|
|
2
2
|
export declare const on: (element: EventTarget | null, event: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void;
|
|
3
3
|
export declare const off: (element: EventTarget | null, event: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void;
|
|
4
4
|
export declare const contains: (root: HTMLElement, ele: any) => boolean;
|
|
5
|
-
export declare function isScrollElement(element:
|
|
5
|
+
export declare function isScrollElement(element: HTMLElement): boolean;
|
|
6
6
|
/**
|
|
7
7
|
* 从当前节点向上查找所有的滚动元素
|
|
8
8
|
* @param container 当前节点
|
|
@@ -2,6 +2,7 @@ import camelCase from 'lodash/camelCase';
|
|
|
2
2
|
import capitalize from 'lodash/capitalize';
|
|
3
3
|
import cloneDeep from 'lodash/cloneDeep';
|
|
4
4
|
import debounce from 'lodash/debounce';
|
|
5
|
+
import defaultsDeep from 'lodash/defaultsDeep';
|
|
5
6
|
import get from 'lodash/get';
|
|
6
7
|
import has from 'lodash/has';
|
|
7
8
|
import kebabCase from 'lodash/kebabCase';
|
|
@@ -14,4 +15,4 @@ import startCase from 'lodash/startCase';
|
|
|
14
15
|
import throttle from 'lodash/throttle';
|
|
15
16
|
import uniq from 'lodash/uniq';
|
|
16
17
|
import upperFirst from 'lodash/upperFirst';
|
|
17
|
-
export { camelCase, capitalize, cloneDeep, debounce, get, has, kebabCase, merge, mergeWith, set, setWith, snakeCase, startCase, throttle, uniq, upperFirst, };
|
|
18
|
+
export { camelCase, capitalize, cloneDeep, debounce, defaultsDeep, get, has, kebabCase, merge, mergeWith, set, setWith, snakeCase, startCase, throttle, uniq, upperFirst, };
|
|
@@ -7,13 +7,22 @@ type RenderResult = {
|
|
|
7
7
|
render: (element: ReactElement) => void;
|
|
8
8
|
_unmount: () => void;
|
|
9
9
|
};
|
|
10
|
+
type ElementLike = {
|
|
11
|
+
dom?: Element;
|
|
12
|
+
current?: Element;
|
|
13
|
+
props?: {
|
|
14
|
+
ref?: RefObject<Element> | ((instance: Element | null) => void);
|
|
15
|
+
};
|
|
16
|
+
ref?: RefObject<Element> | ((instance: Element | null) => void);
|
|
17
|
+
getRootDOMNode?: () => Element | null;
|
|
18
|
+
};
|
|
10
19
|
/**
|
|
11
20
|
*
|
|
12
21
|
* @param element
|
|
13
22
|
* @param instance 兜底 findDOMNode 查找,一般都是 this
|
|
14
23
|
* @returns
|
|
15
24
|
*/
|
|
16
|
-
export declare function findDOMNode_(element:
|
|
25
|
+
export declare function findDOMNode_(element: ElementLike, instance?: ReactInstance): Element | null;
|
|
17
26
|
export declare function callbackOriginRef(children: {
|
|
18
27
|
ref?: RefObject<Element> | ((instance: Element | null) => void);
|
|
19
28
|
props?: {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ArrayValidator, BooleanValidator, CustomValidator, defaultValidateLocale, DefaultValidateMessage, enUSValidateLocale, mergeTemplate, NumberValidator, ObjectValidator, Schema, StringValidator, TypeValidator, default as validate, zhCNValidateLocale, } from '@unicom-cloud/validate';
|
|
2
|
+
export type { CustomValidatorType, GlobalConfig, InnerValidateOptions, RuleType, SchemaRuleType, SchemaType, ValidateMessagesTemplateType, ValidateMessagesType, ValidateOptions, ValidatorError, } from '@unicom-cloud/validate';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Options as ScrollIntoViewOptions } from '@unicom-cloud/scroll-into-view-if-needed';
|
|
2
|
-
import { ValidateMessagesTemplateType } from '@unicom-cloud/validate/types';
|
|
3
2
|
import React, { CSSProperties, FormHTMLAttributes, HTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
4
3
|
import { JSX } from 'react/jsx-runtime';
|
|
5
4
|
import type { ColProps } from '../row-col/interface';
|
|
6
5
|
import { TooltipProps } from '../tooltip/interface';
|
|
6
|
+
import type { ValidateOptions as SchemaOptions, ValidateMessagesTemplateType } from '../utils/validate';
|
|
7
7
|
import Store from './store';
|
|
8
8
|
export type IndexedObject = {
|
|
9
9
|
[key: string]: any;
|
|
@@ -139,6 +139,10 @@ export interface FormProps<FormData = any, FieldValue = FormData[keyof FormData]
|
|
|
139
139
|
label: any;
|
|
140
140
|
}) => any)>>;
|
|
141
141
|
}>;
|
|
142
|
+
/**
|
|
143
|
+
* @zh 校验信息配置
|
|
144
|
+
*/
|
|
145
|
+
schemaOptions?: SchemaOptions;
|
|
142
146
|
/**
|
|
143
147
|
* @zh 数据验证成功后回调事件
|
|
144
148
|
* @en Callback when submit data
|
|
@@ -444,6 +448,7 @@ export type FormContextProps<FormData = any, FieldValue = FormData[keyof FormDat
|
|
|
444
448
|
};
|
|
445
449
|
export type FormItemContextProps<FormData = any, FieldValue = FormData[keyof FormData], FieldKey extends KeyType = keyof FormData> = FormContextProps<FormData, FieldValue, FieldKey> & {
|
|
446
450
|
validateMessages?: FormProps['validateMessages'];
|
|
451
|
+
schemaOptions?: SchemaOptions;
|
|
447
452
|
updateFormItem?: (field: string, params: {
|
|
448
453
|
errors?: FieldError<FieldValue>;
|
|
449
454
|
warnings?: ReactNode[];
|
package/types/pc/form/store.d.ts
CHANGED
|
@@ -89,8 +89,8 @@ declare class Store<FormData = unknown, FieldValue = FormData[keyof FormData], F
|
|
|
89
89
|
setInitialValue: (field: FieldKey, value: FieldValue) => void;
|
|
90
90
|
resetFields: (fieldKeys?: FieldKey | FieldKey[]) => void;
|
|
91
91
|
validate: FormValidateFn<FormData, FieldValue, FieldKey>;
|
|
92
|
-
private toggleSubmitStatus;
|
|
93
92
|
submit: () => void;
|
|
93
|
+
private toggleSubmitStatus;
|
|
94
94
|
getFieldsState: (fields?: FieldKey[]) => { [key in FieldKey]?: FieldState<FieldValue>; };
|
|
95
95
|
clearFields: (fieldKeys?: FieldKey | FieldKey[]) => void;
|
|
96
96
|
}
|
package/types/pc/form/util.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare const formatValidateMsg: (validateMessages: FormProps["validateMe
|
|
|
9
9
|
export declare function set<T extends IndexedObject>(target: T, field: PropertyPath, value: any): T;
|
|
10
10
|
export declare function iterativelyGetKeys(_obj: any, _prefix?: string): any;
|
|
11
11
|
export declare function isSyntheticEvent(e: any): boolean;
|
|
12
|
-
export declare function schemaValidate(field: any, value: any, _rules: RulesProps[], validateMessages: any): Promise<unknown>;
|
|
12
|
+
export declare function schemaValidate(field: any, value: any, _rules: RulesProps[], validateMessages: any, schemaOptions: any): Promise<unknown>;
|
|
13
13
|
export declare function isFieldMatch(field: any, fields: any): any;
|
|
14
14
|
export declare const ID_INPUT_SUFFIX = "_input";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
type AutoSizeType = {
|
|
2
3
|
minRows?: number;
|
|
3
4
|
maxRows?: number;
|
|
4
|
-
}
|
|
5
|
+
};
|
|
6
|
+
declare function autoSizeTextAreaHeight(autoSize?: boolean | AutoSizeType, node?: HTMLTextAreaElement): CSSProperties | undefined;
|
|
5
7
|
export default autoSizeTextAreaHeight;
|
|
@@ -8,7 +8,10 @@ export interface PageOptionProps {
|
|
|
8
8
|
pageSize?: number;
|
|
9
9
|
size?: 'mini' | 'small' | 'default' | 'large';
|
|
10
10
|
selectProps?: Partial<SelectProps>;
|
|
11
|
+
allowCreate?: SelectProps['allowCreate'];
|
|
11
12
|
}
|
|
13
|
+
declare const SIZE_OPTIONS: number[];
|
|
12
14
|
declare function PageOption(props: PageOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { SIZE_OPTIONS as PAGE_SIZE_OPTIONS };
|
|
13
16
|
declare const _default: React.MemoExoticComponent<typeof PageOption>;
|
|
14
17
|
export default _default;
|
|
@@ -128,6 +128,11 @@ export interface PaginationProps {
|
|
|
128
128
|
* @en Is it possible to change page size
|
|
129
129
|
*/
|
|
130
130
|
showPageOption?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* @zh 是否允许通过输入创建新的选项。
|
|
133
|
+
* @en Whether to allow new options to be created by input.
|
|
134
|
+
*/
|
|
135
|
+
allowCreate?: SelectProps['allowCreate'];
|
|
131
136
|
}
|
|
132
137
|
type itemRenderType = (page: number, type: 'page' | 'more' | 'prev' | 'next', originElement: ReactNode) => ReactNode;
|
|
133
138
|
export interface PagerProps {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license qrcode.react
|
|
3
|
+
* Copyright (c) Paul O'Shannessy
|
|
4
|
+
* SPDX-License-Identifier: ISC
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import qrcodegen from './qrcodegen';
|
|
8
|
+
type ErrorCorrectionLevel = 'L' | 'M' | 'Q' | 'H';
|
|
9
|
+
type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined;
|
|
10
|
+
type ImageSettings = {
|
|
11
|
+
/**
|
|
12
|
+
* The URI of the embedded image.
|
|
13
|
+
*/
|
|
14
|
+
src: string;
|
|
15
|
+
/**
|
|
16
|
+
* The height, in pixels, of the image.
|
|
17
|
+
*/
|
|
18
|
+
height: number;
|
|
19
|
+
/**
|
|
20
|
+
* The width, in pixels, of the image.
|
|
21
|
+
*/
|
|
22
|
+
width: number;
|
|
23
|
+
/**
|
|
24
|
+
* Whether or not to "excavate" the modules around the embedded image. This
|
|
25
|
+
* means that any modules the embedded image overlaps will use the background
|
|
26
|
+
* color.
|
|
27
|
+
*/
|
|
28
|
+
excavate: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The horiztonal offset of the embedded image, starting from the top left corner.
|
|
31
|
+
* Will center if not specified.
|
|
32
|
+
*/
|
|
33
|
+
x?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The vertical offset of the embedded image, starting from the top left corner.
|
|
36
|
+
* Will center if not specified.
|
|
37
|
+
*/
|
|
38
|
+
y?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The opacity of the embedded image in the range of 0-1.
|
|
41
|
+
* @defaultValue 1
|
|
42
|
+
*/
|
|
43
|
+
opacity?: number;
|
|
44
|
+
/**
|
|
45
|
+
* The cross-origin value to use when loading the image. This is used to
|
|
46
|
+
* ensure compatibility with CORS, particularly when extracting image data
|
|
47
|
+
* from QRCodeCanvas.
|
|
48
|
+
* Note: `undefined` is treated differently than the seemingly equivalent
|
|
49
|
+
* empty string. This is intended to align with HTML behavior where omitting
|
|
50
|
+
* the attribute behaves differently than the empty string.
|
|
51
|
+
*/
|
|
52
|
+
crossOrigin?: CrossOrigin;
|
|
53
|
+
};
|
|
54
|
+
type QRProps = {
|
|
55
|
+
/**
|
|
56
|
+
* The value to encode into the QR Code. An array of strings can be passed in
|
|
57
|
+
* to represent multiple segments to further optimize the QR Code.
|
|
58
|
+
*/
|
|
59
|
+
value: string | string[];
|
|
60
|
+
/**
|
|
61
|
+
* The size, in pixels, to render the QR Code.
|
|
62
|
+
* @defaultValue 128
|
|
63
|
+
*/
|
|
64
|
+
size?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The Error Correction Level to use.
|
|
67
|
+
* @see https://www.qrcode.com/en/about/error_correction.html
|
|
68
|
+
* @defaultValue L
|
|
69
|
+
*/
|
|
70
|
+
level?: ErrorCorrectionLevel;
|
|
71
|
+
/**
|
|
72
|
+
* The background color used to render the QR Code.
|
|
73
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
|
|
74
|
+
* @defaultValue #FFFFFF
|
|
75
|
+
*/
|
|
76
|
+
bgColor?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The foreground color used to render the QR Code.
|
|
79
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
|
|
80
|
+
* @defaultValue #000000
|
|
81
|
+
*/
|
|
82
|
+
fgColor?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The number of _modules_ to use for margin. The QR Code specification
|
|
85
|
+
* requires `4`, however you can specify any number. Values will be turned to
|
|
86
|
+
* integers with `Math.floor`.
|
|
87
|
+
* @defaultValue 0
|
|
88
|
+
*/
|
|
89
|
+
marginSize?: number;
|
|
90
|
+
/**
|
|
91
|
+
* The title to assign to the QR Code. Used for accessibility reasons.
|
|
92
|
+
*/
|
|
93
|
+
title?: string;
|
|
94
|
+
/**
|
|
95
|
+
* The minimum version used when encoding the QR Code. Valid values are 1-40
|
|
96
|
+
* with higher values resulting in more complex QR Codes. The optimal
|
|
97
|
+
* (lowest) version is determined for the `value` provided, using `minVersion`
|
|
98
|
+
* as the lower bound.
|
|
99
|
+
* @defaultValue 1
|
|
100
|
+
*/
|
|
101
|
+
minVersion?: number;
|
|
102
|
+
/**
|
|
103
|
+
* If enabled, the Error Correction Level of the result may be higher than
|
|
104
|
+
* the specified Error Correction Level option if it can be done without
|
|
105
|
+
* increasing the version.
|
|
106
|
+
* @defaultValue true
|
|
107
|
+
*/
|
|
108
|
+
boostLevel?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* The settings for the embedded image.
|
|
111
|
+
*/
|
|
112
|
+
imageSettings?: ImageSettings;
|
|
113
|
+
};
|
|
114
|
+
declare const QRCodeCanvas: React.ForwardRefExoticComponent<QRProps & React.CanvasHTMLAttributes<HTMLCanvasElement> & React.RefAttributes<HTMLCanvasElement>>;
|
|
115
|
+
declare const QRCodeSVG: React.ForwardRefExoticComponent<QRProps & React.SVGAttributes<SVGSVGElement> & React.RefAttributes<SVGSVGElement>>;
|
|
116
|
+
export { QRCodeCanvas, qrcodegen, QRCodeSVG };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
declare namespace qrcodegen {
|
|
2
|
+
type bit = number;
|
|
3
|
+
type byte = number;
|
|
4
|
+
type int = number;
|
|
5
|
+
export class QrCode {
|
|
6
|
+
readonly version: int;
|
|
7
|
+
readonly errorCorrectionLevel: QrCode.Ecc;
|
|
8
|
+
static encodeText(text: string, ecl: QrCode.Ecc): QrCode;
|
|
9
|
+
static encodeBinary(data: Readonly<Array<byte>>, ecl: QrCode.Ecc): QrCode;
|
|
10
|
+
static encodeSegments(segs: Readonly<Array<QrSegment>>, ecl: QrCode.Ecc, minVersion?: int, maxVersion?: int, mask?: int, boostEcl?: boolean): QrCode;
|
|
11
|
+
readonly size: int;
|
|
12
|
+
readonly mask: int;
|
|
13
|
+
private readonly modules;
|
|
14
|
+
private readonly isFunction;
|
|
15
|
+
constructor(version: int, errorCorrectionLevel: QrCode.Ecc, dataCodewords: Readonly<Array<byte>>, msk: int);
|
|
16
|
+
getModule(x: int, y: int): boolean;
|
|
17
|
+
getModules(): boolean[][];
|
|
18
|
+
private drawFunctionPatterns;
|
|
19
|
+
private drawFormatBits;
|
|
20
|
+
private drawVersion;
|
|
21
|
+
private drawFinderPattern;
|
|
22
|
+
private drawAlignmentPattern;
|
|
23
|
+
private setFunctionModule;
|
|
24
|
+
private addEccAndInterleave;
|
|
25
|
+
private drawCodewords;
|
|
26
|
+
private applyMask;
|
|
27
|
+
private getPenaltyScore;
|
|
28
|
+
private getAlignmentPatternPositions;
|
|
29
|
+
private static getNumRawDataModules;
|
|
30
|
+
private static getNumDataCodewords;
|
|
31
|
+
private static reedSolomonComputeDivisor;
|
|
32
|
+
private static reedSolomonComputeRemainder;
|
|
33
|
+
private static reedSolomonMultiply;
|
|
34
|
+
private finderPenaltyCountPatterns;
|
|
35
|
+
private finderPenaltyTerminateAndCount;
|
|
36
|
+
private finderPenaltyAddHistory;
|
|
37
|
+
static readonly MIN_VERSION: int;
|
|
38
|
+
static readonly MAX_VERSION: int;
|
|
39
|
+
private static readonly PENALTY_N1;
|
|
40
|
+
private static readonly PENALTY_N2;
|
|
41
|
+
private static readonly PENALTY_N3;
|
|
42
|
+
private static readonly PENALTY_N4;
|
|
43
|
+
private static readonly ECC_CODEWORDS_PER_BLOCK;
|
|
44
|
+
private static readonly NUM_ERROR_CORRECTION_BLOCKS;
|
|
45
|
+
}
|
|
46
|
+
export class QrSegment {
|
|
47
|
+
readonly mode: QrSegment.Mode;
|
|
48
|
+
readonly numChars: int;
|
|
49
|
+
private readonly bitData;
|
|
50
|
+
static makeBytes(data: Readonly<Array<byte>>): QrSegment;
|
|
51
|
+
static makeNumeric(digits: string): QrSegment;
|
|
52
|
+
static makeAlphanumeric(text: string): QrSegment;
|
|
53
|
+
static makeSegments(text: string): Array<QrSegment>;
|
|
54
|
+
static makeEci(assignVal: int): QrSegment;
|
|
55
|
+
static isNumeric(text: string): boolean;
|
|
56
|
+
static isAlphanumeric(text: string): boolean;
|
|
57
|
+
constructor(mode: QrSegment.Mode, numChars: int, bitData: Array<bit>);
|
|
58
|
+
getData(): Array<bit>;
|
|
59
|
+
static getTotalBits(segs: Readonly<Array<QrSegment>>, version: int): number;
|
|
60
|
+
private static toUtf8ByteArray;
|
|
61
|
+
private static readonly NUMERIC_REGEX;
|
|
62
|
+
private static readonly ALPHANUMERIC_REGEX;
|
|
63
|
+
private static readonly ALPHANUMERIC_CHARSET;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
}
|
|
67
|
+
declare namespace qrcodegen.QrCode {
|
|
68
|
+
type int = number;
|
|
69
|
+
export class Ecc {
|
|
70
|
+
readonly ordinal: int;
|
|
71
|
+
readonly formatBits: int;
|
|
72
|
+
static readonly LOW: Ecc;
|
|
73
|
+
static readonly MEDIUM: Ecc;
|
|
74
|
+
static readonly QUARTILE: Ecc;
|
|
75
|
+
static readonly HIGH: Ecc;
|
|
76
|
+
private constructor();
|
|
77
|
+
}
|
|
78
|
+
export {};
|
|
79
|
+
}
|
|
80
|
+
declare namespace qrcodegen.QrSegment {
|
|
81
|
+
type int = number;
|
|
82
|
+
export class Mode {
|
|
83
|
+
readonly modeBits: int;
|
|
84
|
+
private readonly numBitsCharCount;
|
|
85
|
+
static readonly NUMERIC: Mode;
|
|
86
|
+
static readonly ALPHANUMERIC: Mode;
|
|
87
|
+
static readonly BYTE: Mode;
|
|
88
|
+
static readonly KANJI: Mode;
|
|
89
|
+
static readonly ECI: Mode;
|
|
90
|
+
private constructor();
|
|
91
|
+
numCharCountBits(ver: int): int;
|
|
92
|
+
}
|
|
93
|
+
export {};
|
|
94
|
+
}
|
|
95
|
+
export default qrcodegen;
|