Comparing version 0.4.3 to 0.4.4
@@ -1,3 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { FC, ReactNode } from 'react'; | ||
import type { AlertProps as AntdAlertProps } from 'antd/es/alert'; | ||
@@ -9,4 +8,4 @@ /** | ||
export type AlertProps = Omit<AntdAlertProps, 'closeText'> & { | ||
closeIcon?: boolean | React.ReactNode; | ||
closeIcon?: boolean | ReactNode; | ||
}; | ||
export declare const Alert: FC<AlertProps>; |
@@ -1,6 +0,5 @@ | ||
import React from 'react'; | ||
import { Button as AntdButton } from "antd"; | ||
import type { ExoticComponent, ReactNode } from 'react'; | ||
import type { BaseItem } from '../../basetype'; | ||
import type { ButtonProps as AntdButtonProps } from 'antd/es/button'; | ||
import type { ExoticComponent } from 'react'; | ||
import type { BaseItem } from '../../basetype'; | ||
import type { SizeType, ButtonType } from './_Antd5'; | ||
@@ -11,3 +10,3 @@ export type ButtonProps = Omit<AntdButtonProps, 'type' | 'icon' | 'size'> & BaseItem & { | ||
size?: SizeType; | ||
icon?: string | React.ReactNode; | ||
icon?: string | ReactNode; | ||
}; | ||
@@ -14,0 +13,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import { ColProps as AntdColprops } from 'antd/es/grid/col'; | ||
import type { FC, CSSProperties, ReactNode } from 'react'; | ||
import type { ColProps as AntdColprops } from 'antd/es/grid/col'; | ||
import type { ActButton } from '../SearchBar/ActionButtons'; | ||
@@ -13,11 +13,11 @@ import type { UTitleProps } from '../_common/UTitle'; | ||
*/ | ||
title?: React.ReactNode; | ||
title?: ReactNode; | ||
/** | ||
* 标题下标额外内容(以 small小一号)展示 | ||
*/ | ||
titleSub?: React.ReactNode; | ||
titleSub?: ReactNode; | ||
/** | ||
* 标题后面的帮助文案 | ||
*/ | ||
help?: React.ReactNode; | ||
help?: ReactNode; | ||
/** | ||
@@ -43,3 +43,3 @@ * 皮肤样式,测试中 | ||
*/ | ||
actions?: ActButton[] | React.ReactNode; | ||
actions?: ActButton[] | ReactNode; | ||
/** | ||
@@ -54,4 +54,4 @@ * 空数据判断 | ||
height?: number; | ||
bodySytle?: React.CSSProperties; | ||
bodySytle?: CSSProperties; | ||
}; | ||
export declare const Col: React.FC<ColProps>; | ||
export declare const Col: FC<ColProps>; |
@@ -71,3 +71,3 @@ "use strict"; | ||
return props.children; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("i", { style: { backgroundColor: value } }), | ||
@@ -128,3 +128,3 @@ " ", | ||
}; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("span", __assign({}, spanProps, { ref: spanRef, onClick: function (evt) { return utils_1.PageUtil.stopEvent(evt, show); } }), | ||
@@ -131,0 +131,0 @@ content, |
@@ -1,6 +0,6 @@ | ||
import React from 'react'; | ||
import { ConfigProviderProps as AntdConfigProviderProps } from 'antd/es/config-provider'; | ||
import type { FC } from 'react'; | ||
import type { ConfigProviderProps as AntdConfigProviderProps } from 'antd/es/config-provider'; | ||
export type ConfigProviderProps = AntdConfigProviderProps & { | ||
[properties: string]: any; | ||
}; | ||
export declare const ConfigProvider: React.FC<ConfigProviderProps>; | ||
export declare const ConfigProvider: FC<ConfigProviderProps>; |
@@ -1,4 +0,3 @@ | ||
import React from 'react'; | ||
import type { DrawerProps as AntdDrawerProps } from 'antd/es/drawer'; | ||
import type { FC } from 'react'; | ||
import type { FC, ReactNode } from 'react'; | ||
/** | ||
@@ -15,5 +14,5 @@ * 说明: 排除 Drawer 组件已被 antd 标记为 deprecated 的属性: | ||
open?: boolean; | ||
footer?: React.ReactNode; | ||
footer?: ReactNode; | ||
afterOpenChange?: (open: boolean) => void; | ||
}; | ||
export declare const Drawer: FC<DrawerProps>; |
@@ -46,3 +46,3 @@ "use strict"; | ||
clazz.push(props.className); | ||
if (props.footer && react_1.default.isValidElement(props.footer)) | ||
if (props.footer && (0, react_1.isValidElement)(props.footer)) | ||
clazz.push('ant-drawer-has-footer'); | ||
@@ -53,4 +53,4 @@ return clazz.join(' '); | ||
props.children, | ||
(props.footer && react_1.default.isValidElement(props.footer)) && react_1.default.createElement("div", { className: 'ant-drawer-footer' }, props.footer)); | ||
(props.footer && (0, react_1.isValidElement)(props.footer)) && react_1.default.createElement("div", { className: 'ant-drawer-footer' }, props.footer)); | ||
}; | ||
exports.Drawer = Drawer; |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import { BackTop } from 'antd'; | ||
import type { CSSProperties, ReactNode, MouseEventHandler } from 'react'; | ||
import type { BadgeProps } from 'antd/es/badge'; | ||
@@ -10,5 +10,5 @@ import type { ExoticComponent } from 'react'; | ||
className?: string; | ||
style?: React.CSSProperties; | ||
icon?: React.ReactNode; | ||
description?: React.ReactNode; | ||
style?: CSSProperties; | ||
icon?: ReactNode; | ||
description?: ReactNode; | ||
type?: FloatButtonType; | ||
@@ -19,3 +19,3 @@ title?: string; | ||
badge?: FloatButtonBadgeProps; | ||
onClick?: React.MouseEventHandler<HTMLElement>; | ||
onClick?: MouseEventHandler<HTMLElement>; | ||
}; | ||
@@ -22,0 +22,0 @@ type FloatButtonComponent = ExoticComponent<FloatButtonProps> & { |
@@ -10,3 +10,3 @@ // import React, { useMemo } from 'react'; | ||
// export type FormItemProps = AntdFormItemProps & { | ||
// tooltip?: React.ReactNode | ||
// tooltip?: ReactNode | ||
// } | ||
@@ -23,3 +23,3 @@ // type FormComponent = ExoticComponent<PropsWithChildren<AntdFormProps>> & { | ||
// if (props.tooltip) { | ||
// return <React.Fragment> | ||
// return <Fragment> | ||
// <Popover> | ||
@@ -29,3 +29,3 @@ // <Icon type='help' /> | ||
// </Popover> | ||
// </React.Fragment> | ||
// </Fragment> | ||
// } | ||
@@ -32,0 +32,0 @@ // return props.label; |
import React from 'react'; | ||
import type { CSSProperties } from 'react'; | ||
export type IconProps = { | ||
@@ -6,3 +7,3 @@ type: string; | ||
onClick?: () => void; | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
title?: string; | ||
@@ -9,0 +10,0 @@ /** |
@@ -8,5 +8,5 @@ /** | ||
// export type OImageProps = Omit<ImageProps, 'onPreviewClose'>; | ||
// export interface CompositionOImage<P> extends React.FC<P> { | ||
// export interface CompositionOImage<P> extends FC<P> { | ||
// PreviewGroup: typeof AntdImage.PreviewGroup; | ||
// } | ||
// export const Image = AntdImage as CompositionOImage<OImageProps>; |
@@ -1,4 +0,3 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import type { HTMLAttributes, ForwardRefExoticComponent, RefAttributes } from 'react'; | ||
import { Layout as AntdLayout } from 'antd'; | ||
import type { PropsWithChildren, HTMLAttributes, ForwardRefExoticComponent, RefAttributes } from 'react'; | ||
type LayoutComponent = ForwardRefExoticComponent<PropsWithChildren<HTMLAttributes<HTMLDivElement>> & RefAttributes<HTMLDivElement>> & { | ||
@@ -5,0 +4,0 @@ displayName: string; |
@@ -132,3 +132,3 @@ "use strict"; | ||
return BasicLayout; | ||
}(react_1.default.Component)); | ||
}(react_1.Component)); | ||
var _Layout = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(context_1.ConfigConsumer, null, function () { return react_1.default.createElement(BasicLayout, __assign({}, props, { elref: ref })); }); }); | ||
@@ -135,0 +135,0 @@ // const Content = generator({ |
@@ -1,2 +0,1 @@ | ||
import React from 'react'; | ||
import { Menu as AntdMenu } from 'antd'; | ||
@@ -6,3 +5,3 @@ import type { MenuProps as AntdMenuProps } from 'antd/es/menu'; | ||
import type { SubMenuProps as AntdSubMenuProps } from 'antd/es/menu/SubMenu'; | ||
import type { PropsWithChildren, ExoticComponent } from 'react'; | ||
import type { ReactNode, PropsWithChildren, ExoticComponent } from 'react'; | ||
import type { Key } from '../../basetype'; | ||
@@ -12,5 +11,5 @@ export interface MenuItemType extends AntdMenuItemProps { | ||
danger?: boolean; | ||
icon?: string | React.ReactNode; | ||
icon?: string | ReactNode; | ||
ik?: string; | ||
label?: React.ReactNode; | ||
label?: ReactNode; | ||
title?: string; | ||
@@ -20,5 +19,5 @@ } | ||
key: Key; | ||
icon?: string | React.ReactNode; | ||
icon?: string | ReactNode; | ||
ik?: string; | ||
label?: React.ReactNode; | ||
label?: ReactNode; | ||
children: ItemType<T>[]; | ||
@@ -25,0 +24,0 @@ } |
@@ -13,2 +13,25 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -19,3 +42,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.Menu = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -32,3 +55,3 @@ var antd_1 = require("antd"); | ||
if (props.icon) { | ||
result.title = react_1.default.createElement(react_1.default.Fragment, null, | ||
result.title = react_1.default.createElement(react_1.Fragment, null, | ||
lodash_1.default.isString(props.icon) ? react_1.default.createElement(Icon_1.Icon, { type: props.icon }) : props.icon, | ||
@@ -35,0 +58,0 @@ " ", |
import React, { Component } from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import type { ModalProps as AntdModalProps } from 'antd/es/modal'; | ||
@@ -21,3 +22,3 @@ import type { PlainObject } from '../../basetype'; | ||
renderFooter(): React.ReactNode; | ||
render(): React.ReactNode; | ||
render(): ReactNode; | ||
} |
@@ -92,3 +92,3 @@ "use strict"; | ||
return footer; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(Button_1.Button, __assign({ type: okType, loading: confirmLoading, onClick: function (evt) { return utils_1.PageUtil.stopEvent(evt, function () { return onOk(); }); } }, okButtonProps), okText || utils_1.i18n.ant('Modal.okText')), | ||
@@ -95,0 +95,0 @@ react_1.default.createElement(Button_1.Button, __assign({ onClick: function (evt) { return utils_1.PageUtil.stopEvent(evt, function () { return onCancel(); }); } }, cancelButtonProps), cancelText || utils_1.i18n.ant('Modal.cancelText'))); |
@@ -1,2 +0,3 @@ | ||
import React, { Component } from 'react'; | ||
import { Component } from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import type { ProgressProps as AntdProgressProps, ProgressSize } from 'antd/es/progress/progress'; | ||
@@ -12,4 +13,4 @@ type SuccessProps = { | ||
export declare class Progress extends Component<ProgressProps> { | ||
render(): React.ReactNode; | ||
render(): ReactNode; | ||
} | ||
export {}; |
@@ -57,4 +57,4 @@ "use strict"; | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var utils_1 = require("./utils"); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
/** | ||
@@ -61,0 +61,0 @@ * 说明: 排除 Progress 组件已被 antd 标记为 deprecated 的属性: |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { RowProps as AntdRowProps } from 'antd/es/grid/row'; | ||
@@ -10,2 +10,2 @@ /** | ||
}; | ||
export declare const Row: React.FC<RowProps>; | ||
export declare const Row: FC<RowProps>; |
@@ -49,3 +49,3 @@ "use strict"; | ||
} | ||
if (react_1.default.isValidElement(child)) { | ||
if ((0, react_1.isValidElement)(child)) { | ||
return getLabel(child); | ||
@@ -52,0 +52,0 @@ } |
import { SliderProps as AntdSliderProps } from 'antd/es/slider'; | ||
import type { ComponentType } from 'react'; | ||
import type { ComponentType, CSSProperties } from 'react'; | ||
export type SliderBaseProps = Omit<AntdSliderProps, 'value' | 'defaultValue' | 'onChange' | 'onAfterChange'>; | ||
@@ -13,5 +13,5 @@ export type SliderSingleProps = SliderBaseProps & { | ||
* */ | ||
handleStyle?: React.CSSProperties; | ||
trackStyle?: React.CSSProperties; | ||
railStyle?: React.CSSProperties; | ||
handleStyle?: CSSProperties; | ||
trackStyle?: CSSProperties; | ||
railStyle?: CSSProperties; | ||
}; | ||
@@ -27,7 +27,7 @@ export type SliderRangeProps = SliderBaseProps & { | ||
* */ | ||
handleStyle?: React.CSSProperties[]; | ||
trackStyle?: React.CSSProperties[]; | ||
railStyle?: React.CSSProperties; | ||
handleStyle?: CSSProperties[]; | ||
trackStyle?: CSSProperties[]; | ||
railStyle?: CSSProperties; | ||
}; | ||
export type SliderProps = SliderSingleProps | SliderRangeProps; | ||
export declare const Slider: ComponentType<SliderProps>; |
import React from 'react'; | ||
import type { HTMLAttributes, CSSProperties, ReactNode } from 'react'; | ||
export type SizeType = 'small' | 'middle' | 'large' | undefined; | ||
export type SpaceSize = SizeType | number; | ||
export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> { | ||
export interface SpaceProps extends HTMLAttributes<HTMLDivElement> { | ||
prefixCls?: string; | ||
className?: string; | ||
rootClassName?: string; | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
size?: SpaceSize | [SpaceSize, SpaceSize]; | ||
direction?: 'horizontal' | 'vertical'; | ||
align?: 'start' | 'end' | 'center' | 'baseline'; | ||
split?: React.ReactNode; | ||
split?: ReactNode; | ||
wrap?: boolean; | ||
} | ||
export declare const Space: (props: SpaceProps) => React.JSX.Element; |
@@ -1,4 +0,4 @@ | ||
import React from 'react'; | ||
import type { FC, ReactNode, MouseEvent } from 'react'; | ||
import type { TableProps as AntdTableProps } from 'antd/es/table/interface'; | ||
export type TriggerEventHandler<RecordType> = (record: RecordType, event: React.MouseEvent<HTMLElement>) => void; | ||
export type TriggerEventHandler<RecordType> = (record: RecordType, event: MouseEvent<HTMLElement>) => void; | ||
export interface RenderExpandIconProps<RecordType> { | ||
@@ -15,4 +15,4 @@ prefixCls: string; | ||
defaultExpandedRowKeys?: string[] | number[]; | ||
expandedRowRender?: (record: T, index: number, indent: number, expanded: boolean) => React.ReactNode; | ||
expandIcon?: (props: RenderExpandIconProps<T>) => React.ReactNode; | ||
expandedRowRender?: (record: T, index: number, indent: number, expanded: boolean) => ReactNode; | ||
expandIcon?: (props: RenderExpandIconProps<T>) => ReactNode; | ||
onExpandedRowsChange?: (expandedRowKeys: string[] | number[]) => void; | ||
@@ -27,2 +27,2 @@ onExpand?: (expanded: boolean, record: T) => void; | ||
}; | ||
export declare const Table: React.FC<TableProps<any>>; | ||
export declare const Table: FC<TableProps<any>>; |
@@ -1,8 +0,7 @@ | ||
import React from 'react'; | ||
import { Tabs as AntdTabs } from 'antd'; | ||
import type { TabsProps as AntdTabsProps, TabPaneProps as AntdTabPaneProps } from 'antd/es/tabs'; | ||
import type { ExoticComponent, PropsWithChildren } from 'react'; | ||
import type { ReactNode, ExoticComponent, PropsWithChildren } from 'react'; | ||
export interface Tab extends Omit<AntdTabPaneProps, 'tab'> { | ||
key: string; | ||
label: React.ReactNode; | ||
label: ReactNode; | ||
} | ||
@@ -9,0 +8,0 @@ export type TabsProps = AntdTabsProps & { |
@@ -13,2 +13,25 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -19,3 +42,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.Tag = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var antd_1 = require("antd"); | ||
@@ -32,3 +55,3 @@ var Icon_1 = require("./Icon"); | ||
} | ||
var children = props.icon ? react_1.default.createElement(react_1.default.Fragment, null, | ||
var children = props.icon ? react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(Icon_1.Icon, { type: props.icon, className: 'c-tag-icon' }), | ||
@@ -35,0 +58,0 @@ " ", |
@@ -70,5 +70,5 @@ "use strict"; | ||
// overlayClassName?: string; | ||
// style?: React.CSSProperties; | ||
// style?:CSSProperties; | ||
// className?: string; | ||
// overlayStyle?: React.CSSProperties; | ||
// overlayStyle?:CSSProperties; | ||
// placement?: TooltipPlacement; | ||
@@ -88,3 +88,3 @@ // builtinPlacements?: Object; | ||
// getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; | ||
// children?: React.ReactNode; | ||
// children?:ReactNode; | ||
// align?: TooltipAlignConfig; | ||
@@ -99,9 +99,9 @@ // /** Internal. Hide tooltip when hidden. This will be renamed in future. */ | ||
// mask?: boolean; | ||
// maskStyle?: React.CSSProperties; | ||
// style?: React.CSSProperties; | ||
// maskStyle?:CSSProperties; | ||
// style?:CSSProperties; | ||
// /** wrapper dom node style of header and body */ | ||
// drawerStyle?: React.CSSProperties; | ||
// headerStyle?: React.CSSProperties; | ||
// bodyStyle?: React.CSSProperties; | ||
// title?: React.ReactNode; | ||
// drawerStyle?:CSSProperties; | ||
// headerStyle?:CSSProperties; | ||
// bodyStyle?:CSSProperties; | ||
// title?:ReactNode; | ||
// visible?: boolean; | ||
@@ -118,3 +118,3 @@ // width?: number | string; | ||
// className?: string; | ||
// handler?: React.ReactNode; | ||
// handler?:ReactNode; | ||
// keyboard?: boolean; |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import { AutoCompleteProps } from 'antd/es/auto-complete'; | ||
import type { FC } from 'react'; | ||
import type { AutoCompleteProps } from 'antd/es/auto-complete'; | ||
/** | ||
@@ -32,2 +32,2 @@ * 搜索工具:自动完成输入,必须传入符合VAP规范的接口 | ||
*/ | ||
export declare const IAutoComplete: React.FC<IAutoCompleteProps>; | ||
export declare const IAutoComplete: FC<IAutoCompleteProps>; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC, CSSProperties } from 'react'; | ||
import type { NumberFormat, FractionDigits } from '../../utils/Format'; | ||
@@ -12,3 +12,3 @@ type FormatFunction = (number: any) => string; | ||
*/ | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
/** | ||
@@ -40,3 +40,3 @@ * 数量 | ||
*/ | ||
export declare const CountUp: React.FC<CountUpProps>; | ||
export declare const CountUp: FC<CountUpProps>; | ||
export {}; |
@@ -46,4 +46,4 @@ "use strict"; | ||
exports.CountUp = void 0; | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var react_1 = __importStar(require("react")); | ||
var Format_1 = require("../../utils/Format"); | ||
@@ -50,0 +50,0 @@ var loop = function (from, to, el, format, startTime, ms) { |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { Moment as Dayjs } from 'dayjs'; | ||
@@ -60,2 +60,2 @@ export type DateRangeProps = { | ||
*/ | ||
export declare const DateRange: React.FC<DateRangeProps>; | ||
export declare const DateRange: FC<DateRangeProps>; |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
export type HighLightProps = { | ||
@@ -15,2 +15,2 @@ /** | ||
*/ | ||
export declare const HighLight: React.FC<HighLightProps>; | ||
export declare const HighLight: FC<HighLightProps>; |
@@ -51,4 +51,4 @@ "use strict"; | ||
(0, react_1.useLayoutEffect)(function () { return setPtns((0, StringUtil_1.searchText)(props.text, props.keyword)); }, [props]); | ||
return react_1.default.createElement(react_1.default.Fragment, null, ptns.map(function (ptn) { return ptn.hit ? react_1.default.createElement("span", { className: 'v-highlight' }, ptn.text) : ptn.text; })); | ||
return react_1.default.createElement(react_1.Fragment, null, ptns.map(function (ptn) { return ptn.hit ? react_1.default.createElement("span", { className: 'v-highlight' }, ptn.text) : ptn.text; })); | ||
}; | ||
exports.HighLight = HighLight; |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
type I18NTextProps = { | ||
@@ -6,3 +6,3 @@ txt: string; | ||
}; | ||
export declare const I: React.FC<I18NTextProps>; | ||
export declare const I: FC<I18NTextProps>; | ||
export {}; |
@@ -1,4 +0,4 @@ | ||
import React from 'react'; | ||
import type { FC, ReactNode } from 'react'; | ||
export type LoadingProps = { | ||
title?: React.ReactNode; | ||
title?: ReactNode; | ||
}; | ||
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export declare const Loading: React.FC<LoadingProps>; | ||
export declare const Loading: FC<LoadingProps>; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { Moment as Dayjs } from 'dayjs'; | ||
@@ -46,2 +46,2 @@ export type MonthRangeProps = { | ||
}; | ||
export declare const MonthRange: React.FC<MonthRangeProps>; | ||
export declare const MonthRange: FC<MonthRangeProps>; |
@@ -1,6 +0,6 @@ | ||
import React from 'react'; | ||
import { Key } from '../../basetype'; | ||
import type { FC, ReactNode } from 'react'; | ||
import type { Key } from '../../basetype'; | ||
export type PromiseLabelProps = { | ||
value: Key; | ||
fetcher: (Key: any) => Promise<React.ReactNode>; | ||
fetcher: (Key: any) => Promise<ReactNode>; | ||
showKey?: boolean; | ||
@@ -11,2 +11,2 @@ }; | ||
*/ | ||
export declare const PromiseLabel: React.FC<PromiseLabelProps>; | ||
export declare const PromiseLabel: FC<PromiseLabelProps>; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { PaginationProps } from '../_adapt/Pagination'; | ||
@@ -21,2 +21,2 @@ export interface UPaginationProps extends PaginationProps { | ||
} | ||
export declare const UPagination: React.FC<UPaginationProps>; | ||
export declare const UPagination: FC<UPaginationProps>; |
import React from 'react'; | ||
import type { ReactNode, CSSProperties } from 'react'; | ||
import type { ActButton } from '../SearchBar/ActionButtons'; | ||
export type UTitleProps = { | ||
className?: string; | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
/** | ||
@@ -13,16 +14,16 @@ * 面板标题前的 ICON | ||
*/ | ||
title?: React.ReactNode; | ||
title?: ReactNode; | ||
/** | ||
* 标题下标额外内容(以 small小一号)展示 | ||
*/ | ||
titleSub?: React.ReactNode; | ||
titleSub?: ReactNode; | ||
/** | ||
* 标题后面的帮助文案 | ||
*/ | ||
help?: React.ReactNode; | ||
help?: ReactNode; | ||
/** | ||
* 右上角按钮 | ||
*/ | ||
actions?: ActButton[] | React.ReactNode; | ||
actions?: ActButton[] | ReactNode; | ||
}; | ||
export declare const UTitle: (props: UTitleProps) => React.JSX.Element; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,3 +30,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.UTitle = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -25,3 +48,3 @@ var utils_1 = require("../../utils"); | ||
} | ||
else if (lodash_1.default.isObject(props.actions) && react_1.default.isValidElement(props.actions)) { | ||
else if (lodash_1.default.isObject(props.actions) && (0, react_1.isValidElement)(props.actions)) { | ||
elAction = props.actions; | ||
@@ -28,0 +51,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export declare const register: (map: Map<string, any>, type: string, def: object, component: any, options?: object, forceOverWrite?: boolean) => void; | ||
export declare const register: (map: Map<string, any>, type: string, defaultValue: object, component: any, options?: object, forceOverWrite?: boolean) => void; |
@@ -20,3 +20,3 @@ "use strict"; | ||
var StringUtil_1 = require("../utils/StringUtil"); | ||
var register = function (map, type, def, component, options, forceOverWrite) { | ||
var register = function (map, type, defaultValue, component, options, forceOverWrite) { | ||
if (forceOverWrite === void 0) { forceOverWrite = false; } | ||
@@ -34,3 +34,3 @@ var key = (0, StringUtil_1.trimLower)(type); | ||
} | ||
var element = __assign({ component: component }, def); | ||
var element = __assign({ component: component }, defaultValue); | ||
lodash_1.default.keys(options).map(function (key) { return element[key] = options[key]; }); | ||
@@ -37,0 +37,0 @@ map.set(key, element); |
import React from 'react'; | ||
import type { MutableRefObject } from 'react'; | ||
import type { MutableRefObject, ReactNode, CSSProperties } from 'react'; | ||
import type { SelectBarProps } from './SelectBar'; | ||
@@ -81,3 +81,3 @@ import type { SearchBarProps } from '../SearchBar'; | ||
*/ | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
/** | ||
@@ -98,3 +98,3 @@ * 展示模式 | ||
*/ | ||
actionBar?: (ActButton[]) | React.ReactNode; | ||
actionBar?: (ActButton[]) | ReactNode; | ||
/** | ||
@@ -101,0 +101,0 @@ * 分页区域 |
@@ -97,25 +97,34 @@ "use strict"; | ||
var selectRef = (0, react_1.useRef)(null); | ||
var className = ['c-box']; | ||
if (props.nobg) | ||
className.push('c-box-nobg'); | ||
var style = __assign({}, props.style); | ||
className.push(props.mode ? ('c-box-' + props.mode) : 'c-box-common'); | ||
if (props.mode == 'inner') { | ||
if (rootRef.current == null) { | ||
// style.height = 0; | ||
style.display = 'none'; | ||
var mode = (0, react_1.useMemo)(function () { | ||
return props.mode || 'common'; | ||
}, [props.mode]); | ||
var className = (0, react_1.useMemo)(function () { | ||
var clazz = ['c-box']; | ||
clazz.push('c-box-nobg'); | ||
clazz.push('c-box-' + mode); | ||
if (props.className) | ||
clazz.push(props.className); | ||
return clazz.join(' '); | ||
}, [props.className, props.nobg, mode]); | ||
var style = (0, react_1.useMemo)(function () { | ||
var css = __assign({}, props.style); | ||
if (mode == 'inner') { | ||
if (rootRef.current == null) { | ||
css.display = 'none'; | ||
} | ||
else { | ||
var container = utils_1.PageUtil.getParentByClassName(rootRef.current.parentElement, 'c-box'); | ||
css.height = Math.floor(container.parentElement.getBoundingClientRect().height); | ||
} | ||
} | ||
else { | ||
var container = utils_1.PageUtil.getParentByClassName(rootRef.current.parentElement, 'c-box'); | ||
style.height = Math.floor(container.parentElement.getBoundingClientRect().height); | ||
else if (mode == 'fixed') { | ||
if (app != null) { | ||
css.height = app.theme.contentHeight; | ||
} | ||
else { | ||
css.height = '100%'; | ||
} | ||
} | ||
} | ||
else if (props.mode == 'fixed') { | ||
if (app != null) { | ||
style.height = app.theme.contentHeight; | ||
} | ||
else { | ||
style.height = '100%'; | ||
} | ||
} | ||
return css; | ||
}, [props.style, mode, state === null || state === void 0 ? void 0 : state.height]); | ||
(0, react_1.useEffect)(function () { | ||
@@ -126,4 +135,4 @@ if (state && state.height && contextRef && contextRef.current) { | ||
}, [state === null || state === void 0 ? void 0 : state.height]); | ||
var resize = function () { | ||
if (props.mode == undefined || props.mode == 'common' || app == null) { | ||
var resize = (0, react_1.useCallback)(function () { | ||
if (mode == 'common' || app == null) { | ||
if (state === null) | ||
@@ -139,3 +148,3 @@ setState({}); | ||
var total = el.getBoundingClientRect().height; | ||
if (props.mode == 'inner') { | ||
if (mode == 'inner') { | ||
total = el.parentElement.parentElement.getBoundingClientRect().height; | ||
@@ -153,11 +162,11 @@ } | ||
} | ||
document.body.classList.remove('v-resizing'); | ||
setState({ height: Math.floor(total) }); | ||
document.body.classList.remove('v-resizing'); | ||
}; | ||
}, [mode]); | ||
(0, react_1.useEffect)(function () { setTimeout(resize, 120); }, [app === null || app === void 0 ? void 0 : app.theme.contentHeight]); // 1.5 版本:延时 120ms | ||
(0, react_1.useImperativeHandle)(ref, function () { return ({ resize: resize }); }, []); | ||
(0, react_1.useImperativeHandle)(ref, function () { return ({ resize: resize }); }, [mode]); | ||
(0, react_1.useLayoutEffect)(function () { | ||
setTimeout(resize, 5); | ||
}, []); | ||
return react_1.default.createElement(Layout_1.Layout, { id: domId, className: utils_1.StringUtil.className(className, props.className), style: style, ref: _layoutRef }, | ||
return react_1.default.createElement(Layout_1.Layout, { id: domId, className: className, style: style, ref: _layoutRef }, | ||
props.selectBar && (0, _register_1.getSelectBar)(props.selectBar.type) != null && react_1.default.createElement(SelectBar_1.SelectBar, __assign({}, props.selectBar, { ref: props.selectBar.selectRef ? props.selectBar.selectRef : selectRef, onSelect: function () { | ||
@@ -185,3 +194,3 @@ var args = []; | ||
(props.actionBar && ((lodash_1.default.isArray(props.actionBar) && props.actionBar.length > 0) | ||
|| (!lodash_1.default.isArray(props.actionBar) && react_1.default.isValidElement(props.actionBar))))) && react_1.default.createElement(SearchBar_1.SearchBar, __assign({}, props.searchBar, { default: props.default, className: HEIGHT_OMIT, onExpand: function (isExpand) { | ||
|| (!lodash_1.default.isArray(props.actionBar) && (0, react_1.isValidElement)(props.actionBar))))) && react_1.default.createElement(SearchBar_1.SearchBar, __assign({}, props.searchBar, { default: props.default, className: HEIGHT_OMIT, onExpand: function (isExpand) { | ||
resize(); | ||
@@ -188,0 +197,0 @@ if (lodash_1.default.isFunction(props.searchBar.onExpand)) { |
import React from 'react'; | ||
import type { ComponentType } from 'react'; | ||
import type { ComponentType, MutableRefObject, ReactNode } from 'react'; | ||
import type { Key, BaseItem, PlainObject } from '../../basetype'; | ||
@@ -24,3 +24,3 @@ import type { STreeProps } from '../Trees/STree'; | ||
*/ | ||
confirm?: React.ReactNode; | ||
confirm?: ReactNode; | ||
}; | ||
@@ -67,3 +67,3 @@ type _BoxSelectBarProps = BaseItem & { | ||
*/ | ||
selectRef?: React.MutableRefObject<any>; | ||
selectRef?: MutableRefObject<any>; | ||
}; | ||
@@ -70,0 +70,0 @@ /** |
@@ -1,8 +0,7 @@ | ||
import React from 'react'; | ||
import type { FC, CSSProperties, ReactNode } from 'react'; | ||
import type { PlainObject, Key } from '../../basetype'; | ||
import type { ReactNode } from 'react'; | ||
import type { IconProps } from '../_adapt/Icon'; | ||
type ItemRenderFunction = (record: PlainObject, searchValue?: string) => ReactNode; | ||
export type SListProps = { | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
className?: string; | ||
@@ -41,3 +40,3 @@ /** | ||
renders?: { | ||
icon?: (record: PlainObject, searchValue?: string) => IconProps | string | React.ReactNode; | ||
icon?: (record: PlainObject, searchValue?: string) => IconProps | string | ReactNode; | ||
title: ItemRenderFunction; | ||
@@ -60,3 +59,3 @@ value?: ItemRenderFunction; | ||
}; | ||
export declare const SList: React.FC<SListProps>; | ||
export declare const SList: FC<SListProps>; | ||
export {}; |
@@ -81,3 +81,3 @@ "use strict"; | ||
} | ||
if (react_1.default.isValidElement(value)) { | ||
if ((0, react_1.isValidElement)(value)) { | ||
return value; | ||
@@ -117,3 +117,2 @@ } | ||
}; | ||
// export const SList: React.FC<SListPorps> = memo((props) => { | ||
exports.SList = (0, react_1.memo)(function (props) { | ||
@@ -120,0 +119,0 @@ var searchValue = props.searchValue, onSelect = props.onSelect, keyField = props.keyField; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC, ReactNode } from 'react'; | ||
import type { ButtonType } from '../_adapt/_Antd5'; | ||
@@ -9,3 +9,3 @@ import type { ButtonProps } from '../_adapt/Button'; | ||
*/ | ||
icon?: string | React.ReactNode; | ||
icon?: string | ReactNode; | ||
/** | ||
@@ -30,3 +30,3 @@ * 按钮样式类型 | ||
*/ | ||
confirm?: string | ((props?: any) => string | React.ReactNode); | ||
confirm?: string | ((props?: any) => string | ReactNode); | ||
/** | ||
@@ -49,5 +49,5 @@ * 自定义的按钮属性 | ||
}; | ||
export declare const ActionButtons: React.FC<{ | ||
export declare const ActionButtons: FC<{ | ||
buttons: (ActButton | null | false)[]; | ||
size?: ButtonSize; | ||
}>; |
@@ -13,2 +13,25 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __values = (this && this.__values) || function(o) { | ||
@@ -30,3 +53,3 @@ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
exports.ActionButtons = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -101,3 +124,3 @@ var Popconfirm_1 = require("../_adapt/Popconfirm"); | ||
if (((_b = props.buttons) === null || _b === void 0 ? void 0 : _b.length) <= 0) | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
return utils_1.Const.NONE; | ||
var groups = [[]]; | ||
@@ -130,4 +153,4 @@ try { | ||
groupProps.size = props.size; | ||
return react_1.default.createElement(react_1.default.Fragment, null, groups.map(function (group, gi) { return react_1.default.createElement(Button_1.Button.Group, __assign({ key: gi }, groupProps), group.map(function (btn, bi) { return react_1.default.createElement(ActionButton, __assign({ key: bi }, btn)); })); })); | ||
return react_1.default.createElement(react_1.Fragment, null, groups.map(function (group, gi) { return react_1.default.createElement(Button_1.Button.Group, __assign({ key: gi }, groupProps), group.map(function (btn, bi) { return react_1.default.createElement(ActionButton, __assign({ key: bi }, btn)); })); })); | ||
}; | ||
exports.ActionButtons = ActionButtons; |
@@ -0,3 +1,3 @@ | ||
import type { FC, RefAttributes, ForwardRefExoticComponent } from 'react'; | ||
import type { SearchBarByFieldProps } from './index'; | ||
import type { FC, RefAttributes, ForwardRefExoticComponent } from 'react'; | ||
/** | ||
@@ -4,0 +4,0 @@ * 仅内容使用 |
@@ -194,3 +194,3 @@ "use strict"; | ||
return utils_1.Const.NONE; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'search', type: "primary", onClick: function (e) { return utils_1.PageUtil.stopEvent(e, search); } }), | ||
@@ -238,3 +238,3 @@ react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'redo', onClick: function (e) { return utils_1.PageUtil.stopEvent(e, clear); } }), | ||
return react_1.default.createElement("div", { className: 'c-searchbar-fields' }); | ||
return react_1.default.createElement("div", { className: 'c-searchbar-fields', style: fieldsStyle }, layout.rows.length && react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement("div", { className: 'c-searchbar-fields', style: fieldsStyle }, layout.rows.length && react_1.default.createElement(react_1.Fragment, null, | ||
layout.isOutSide ? react_1.default.createElement("div", { className: "c-searchbar-outgroup c-searchbar-fixgroup" }, | ||
@@ -241,0 +241,0 @@ rowRender(layout.rows[0]), |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { SearchBarProps } from './index'; | ||
export declare const SearchBarByKeyword: React.FC<SearchBarProps>; | ||
export declare const SearchBarByKeyword: FC<SearchBarProps>; |
@@ -84,5 +84,5 @@ "use strict"; | ||
if (props.fields && props.fields.length) { | ||
suffixProps.suffix = react_1.default.createElement(react_1.default.Fragment, null, | ||
suffixProps.suffix = react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("span", { ref: spanRef, onClick: function () { return setOpen(true); }, style: { pointerEvents: props.disabled ? 'none' : 'unset' }, className: 'vicon vicon-menu', title: utils_1.i18n.txt(_i18n_1.V.INPUT_SEARCH_ADVANCE) }, "\u00A0"), | ||
react_1.default.createElement(Popover_1.Popover, { open: open, onOpenChange: setOpen, trigger: "click", placement: "bottom", content: react_1.default.createElement(react_1.default.Fragment, null, | ||
react_1.default.createElement(Popover_1.Popover, { open: open, onOpenChange: setOpen, trigger: "click", placement: "bottom", content: react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("h3", null, utils_1.i18n.txt(_i18n_1.V.INPUT_SEARCH_ADVANCE)), | ||
@@ -89,0 +89,0 @@ react_1.default.createElement("div", { className: 'c-searchbar' }, |
@@ -34,3 +34,3 @@ "use strict"; | ||
if (!lodash_1.default.has(props, 'children')) | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
return utils_1.Const.NONE; | ||
return react_1.default.createElement("div", { className: utils_1.StringUtil.className(clazz, props.className) }, | ||
@@ -37,0 +37,0 @@ react_1.default.createElement("div", { className: 'c-searchbar-fields' }), |
@@ -1,5 +0,5 @@ | ||
import React from 'react'; | ||
import { SearchFieldComponent } from './_register'; | ||
import type { FC } from 'react'; | ||
import type { Field } from './index'; | ||
export type FieldInput = React.FC<{ | ||
export type FieldInput = FC<{ | ||
SearchField: SearchFieldComponent; | ||
@@ -6,0 +6,0 @@ disabled: boolean; |
@@ -1,5 +0,4 @@ | ||
import React from 'react'; | ||
import type { FC, MutableRefObject } from 'react'; | ||
import type { Key, PlainObject } from '../../../basetype'; | ||
import type { ActButton } from '../../SearchBar/ActionButtons'; | ||
import type { MutableRefObject } from 'react'; | ||
export type TableAction = (ids?: Key[], objs?: PlainObject[], param?: PlainObject) => void; | ||
@@ -35,3 +34,3 @@ /** | ||
}; | ||
export declare const ActionBar: React.FC<TableActionBar>; | ||
export declare const ActionBar: FC<TableActionBar>; | ||
/** | ||
@@ -38,0 +37,0 @@ * 通用添加按钮 |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC, ReactNode } from 'react'; | ||
import type { TableColumn } from '../index'; | ||
@@ -41,8 +41,8 @@ import type { BaseItem } from '../../../basetype'; | ||
*/ | ||
confrim?: React.ReactNode; | ||
confrim?: ReactNode; | ||
}; | ||
export declare const INFO: React.FC<ActionPorps>; | ||
export declare const EDIT: React.FC<ActionPorps>; | ||
export declare const DELETE: React.FC<ActionPorps>; | ||
export declare const ACTION: React.FC<CustomAcitonProps>; | ||
export declare const COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => React.ReactNode)) => TableColumn; | ||
export declare const INFO: FC<ActionPorps>; | ||
export declare const EDIT: FC<ActionPorps>; | ||
export declare const DELETE: FC<ActionPorps>; | ||
export declare const ACTION: FC<CustomAcitonProps>; | ||
export declare const COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn; |
@@ -31,3 +31,3 @@ "use strict"; | ||
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode)) | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
return utils_1.Const.NONE; | ||
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.BTN_INFO); | ||
@@ -41,3 +41,3 @@ return react_1.default.createElement("span", { className: DEFAULT_CLASS.INFO, onClick: function (evt) { return utils_1.PageUtil.stopEvent(evt, props.onClick); }, title: "".concat(title, " ").concat(props.name || '') }, | ||
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode)) | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
return utils_1.Const.NONE; | ||
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.ACT_UPDATE); | ||
@@ -51,3 +51,3 @@ return react_1.default.createElement("span", { className: DEFAULT_CLASS.EDIT, onClick: function (evt) { return utils_1.PageUtil.stopEvent(evt, props.onClick); }, title: "".concat(title, " ").concat(props.name || '') }, | ||
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode)) | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
return utils_1.Const.NONE; | ||
var title = utils_1.i18n.getText(props.ik, props.title, _i18n_1.V.ACT_DELETE); | ||
@@ -63,3 +63,3 @@ var popTitle = utils_1.i18n.txt(_i18n_1.V.ACT_DELETE_CONFIRM, props.name || ''); | ||
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode)) | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
return utils_1.Const.NONE; | ||
var title = utils_1.i18n.getText(props.ik, props.title); | ||
@@ -66,0 +66,0 @@ var className = lodash_1.default.has(DEFAULT_CLASS, props.type) ? DEFAULT_CLASS[props.type] : DEFAULT_CLASS.EDIT; |
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import type { FC, ReactNode } from 'react'; | ||
import type { TableColumn } from '../index'; | ||
@@ -7,7 +7,7 @@ import type { ActionPorps, CustomAcitonProps } from './Actions'; | ||
export type TableDefined = { | ||
INFO: React.FC<ActionPorps>; | ||
EDIT: React.FC<ActionPorps>; | ||
DELETE: React.FC<ActionPorps>; | ||
ACTION: React.FC<CustomAcitonProps>; | ||
COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => React.ReactNode)) => TableColumn; | ||
INFO: FC<ActionPorps>; | ||
EDIT: FC<ActionPorps>; | ||
DELETE: FC<ActionPorps>; | ||
ACTION: FC<CustomAcitonProps>; | ||
COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => ReactNode)) => TableColumn; | ||
BUTTON_ADD: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton; | ||
@@ -14,0 +14,0 @@ BUTTON_DELETE: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton; |
@@ -1,4 +0,3 @@ | ||
import React from 'react'; | ||
import type { TableDefined } from './Components'; | ||
import type { ForwardRefExoticComponent, ExoticComponent, RefAttributes } from 'react'; | ||
import type { ReactNode, ForwardRefExoticComponent, ExoticComponent, RefAttributes } from 'react'; | ||
import type { TableProps } from '../_adapt/Table'; | ||
@@ -11,3 +10,5 @@ import type { ColumnProps } from 'antd/es/table/interface'; | ||
import type { SelectBarProps } from '../Box/SelectBar'; | ||
export type TableColumn = BaseItem & Omit<ColumnProps<any>, 'children'>; | ||
export type TableColumn = BaseItem & Omit<ColumnProps<any>, 'children'> & { | ||
wrap?: boolean; | ||
}; | ||
export type TableColumnGroup = Pick<TableColumn, 'className' | 'width' | 'align'> & { | ||
@@ -56,3 +57,3 @@ title: string; | ||
*/ | ||
actionBar?: (TableActionButton[]) | React.ReactNode; | ||
actionBar?: (TableActionButton[]) | ReactNode; | ||
/** | ||
@@ -59,0 +60,0 @@ * 表格选择区域 |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { BaseTableProps, TableColumn } from './index'; | ||
@@ -25,2 +25,2 @@ import type { PlainObject } from '../../basetype'; | ||
}; | ||
export declare const TopTable: React.FC<TopTableProps>; | ||
export declare const TopTable: FC<TopTableProps>; |
@@ -93,21 +93,3 @@ "use strict"; | ||
(0, react_1.useEffect)(function () { | ||
var cols = []; | ||
if (props.showIndex !== false) { | ||
cols.push((0, Util_1.getIdxColumn)({ current: 0 }, props.showIndex, true)); | ||
} | ||
props.columns.map(function (col) { | ||
if (col.roleCode) { | ||
if (!utils_1.PageUtil.hasRole(col.roleCode)) { | ||
return; | ||
} | ||
} | ||
if (col.ik) { | ||
var title = utils_1.i18n.txt(col.ik); | ||
cols.push(__assign(__assign({}, col), { title: title == '' ? col.title : title })); | ||
} | ||
else { | ||
cols.push(col); | ||
} | ||
}); | ||
setColumns(cols); | ||
setColumns((0, Util_1.convertColumns)(props, { ref: { current: 0 }, isRank: true })); | ||
}, [props.columns]); | ||
@@ -131,2 +113,5 @@ var onRowSelect = (0, react_1.useCallback)(function (data) { | ||
resizePid.current = setTimeout(function () { | ||
if (tableRef.current == null) | ||
return; | ||
clearTimeout(resizePid.current); | ||
var thead = (0, VTable_1.getHeightByTagName)(tableRef.current, 'thead') || 40; | ||
@@ -169,2 +154,3 @@ tableRef.current.style.display = 'none'; | ||
} | ||
console.log(scroll); | ||
return react_1.default.createElement("div", { ref: tableRef, className: 'c-table-top-container' }, | ||
@@ -171,0 +157,0 @@ react_1.default.createElement(Table_1.Table, __assign({}, tableProps, props, { rowClassName: function (record, i) { |
@@ -1,5 +0,5 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { ModalProps } from '../_adapt/Modal'; | ||
import type { TopTableProps } from './TopTable'; | ||
export type TopTableModalProps = TopTableProps & ModalProps; | ||
export declare const TopTableModal: React.FC<TopTableModalProps>; | ||
export declare const TopTableModal: FC<TopTableModalProps>; |
@@ -28,5 +28,5 @@ "use strict"; | ||
var tableProps = lodash_1.default.pick(props, TOP_TABLE_PROPERTIES); | ||
return react_1.default.createElement(Modal_1.Modal, __assign({}, modalProps), | ||
return react_1.default.createElement(Modal_1.Modal, __assign({ footer: null }, modalProps), | ||
react_1.default.createElement(TopTable_1.TopTable, __assign({}, tableProps))); | ||
}; | ||
exports.TopTableModal = TopTableModal; |
import type { MutableRefObject } from 'react'; | ||
import type { BaseTableProps } from './index'; | ||
import type { ColumnProps } from 'antd/es/table/interface'; | ||
export declare const getIdxColumn: (ref: MutableRefObject<number>, showIndex?: string, isRank?: boolean) => ColumnProps<any>; | ||
export declare const convertColumns: (props: BaseTableProps, rank: { | ||
ref: MutableRefObject<number>; | ||
isRank?: boolean; | ||
}) => ColumnProps<any>[]; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,3 +17,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getIdxColumn = void 0; | ||
exports.convertColumns = void 0; | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -44,2 +55,58 @@ var utils_1 = require("../../utils"); | ||
}; | ||
exports.getIdxColumn = getIdxColumn; | ||
var convertCol = function (col) { | ||
if (col.roleCode && !utils_1.PageUtil.hasRole(col.roleCode)) | ||
return null; | ||
var item = __assign({}, col); | ||
if (col.ik) { | ||
var title = utils_1.i18n.txt(col.ik); | ||
item.title = title == '' ? item.title : title; | ||
} | ||
var clazz = []; | ||
if (col.wrap) { | ||
clazz.push('c-table-col-wrap'); | ||
} | ||
else if (!lodash_1.default.has(col, 'ellipsis')) { | ||
item.ellipsis = true; | ||
} | ||
if (!lodash_1.default.has(item, 'width')) { | ||
if (lodash_1.default.isString(item.title)) { | ||
clazz.push('c-table-col-' + (item.title.length + (item.sorter ? 2 : 0))); | ||
} | ||
if (lodash_1.default.isString(col.dataIndex) && col.dataIndex.length && col.dataIndex.indexOf('.') < 0 && col.dataIndex.indexOf('[') < 0) { | ||
clazz.push('table-col-' + col.dataIndex); | ||
if (col.sorter) { | ||
clazz.push('c-table-col-has-sorter'); | ||
} | ||
} | ||
} | ||
if (col.className) { | ||
clazz.push(col.className); | ||
} | ||
item.className = clazz.join(' '); | ||
return item; | ||
}; | ||
var convertColumns = function (props, rank) { | ||
// props.columns[0] | ||
var cols = (props.showIndex == false) ? [] : [getIdxColumn(rank.ref, props.showIndex, rank.isRank)]; | ||
props.columns.map(function (col) { | ||
// @ts-ignore | ||
var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children); | ||
if (isGroup) { | ||
console.error('Not Support group mode in 1.5'); | ||
// let column: ColumnGroupType<any> = { ..._.pick(col, ['width', 'align']), children: [], title: col.title, className: 'c-table-header-group' }; | ||
// if (col.className) column.className = `c-table-header-group ${col.className}`; | ||
// (col as TableColumnGroup).children.map((item => { | ||
// let subCol = convertCol(item); | ||
// if (subCol != null) column.children.push(subCol); | ||
// })); | ||
// if (column.children.length > 0) cols.push(column); | ||
} | ||
else { | ||
var column = convertCol(col); | ||
if (column != null) | ||
cols.push(column); | ||
} | ||
}); | ||
return cols; | ||
}; | ||
exports.convertColumns = convertColumns; |
@@ -101,2 +101,9 @@ "use strict"; | ||
var _a = (0, Box_1.useBox)(), state = _a.state, root = _a.root, resize = _a.resize; | ||
var inModal = (0, react_1.useMemo)(function () { | ||
if (root.current == null) | ||
return false; | ||
return root.current.parentElement.parentElement.classList.contains('ant-modal-body') | ||
|| root.current.parentElement.parentElement.parentElement.classList.contains('ant-modal-body') | ||
|| root.current.parentElement.parentElement.parentElement.parentElement.classList.contains('ant-modal-body'); | ||
}, []); | ||
// const [scroll, setScroll] = useState<TableProps<PlainObject>['scroll']>(undefined); | ||
@@ -177,81 +184,41 @@ var _b = props.model, rowKey = _b.rowKey, list = _b.list, isQuerying = _b.isQuerying, pageNo = _b.pageNo, pageSize = _b.pageSize, orderBy = _b.orderBy, query = _b.query, total = _b.total; | ||
var columns = (0, react_1.useMemo)(function () { | ||
var cols = []; | ||
if (props.showIndex !== false) | ||
cols.push((0, Util_1.getIdxColumn)(start, props.showIndex)); | ||
var cols = (0, Util_1.convertColumns)(props, { ref: start, isRank: false }); | ||
if (!utils_1.GLOBAL.CONFIG.SEARCHBAR.DISABLE_KEYWORD || !lodash_1.default.has(props, 'searchBar.keyword')) | ||
return cols; | ||
var HighKeys = new Set(); | ||
if (!utils_1.GLOBAL.CONFIG.SEARCHBAR.DISABLE_KEYWORD && lodash_1.default.has(props, 'searchBar.keyword')) { | ||
if (lodash_1.default.isObject(props.searchBar.keyword)) { | ||
(props.searchBar.keyword.highlight || []).map(function (key) { return HighKeys.add(key); }); | ||
} | ||
else { | ||
props.columns.map(function (col) { | ||
// @ts-ignore | ||
var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children); | ||
if (isGroup) { | ||
col.children.map((function (item) { | ||
if (lodash_1.default.isString(item.dataIndex)) | ||
HighKeys.add(item.dataIndex); | ||
})); | ||
} | ||
else { | ||
var dataIndex = col.dataIndex; | ||
if (lodash_1.default.isString(dataIndex)) | ||
HighKeys.add(dataIndex); | ||
} | ||
}); | ||
} | ||
if (lodash_1.default.isObject(props.searchBar.keyword)) { | ||
(props.searchBar.keyword.highlight || []).map(function (key) { return HighKeys.add(key); }); | ||
} | ||
var convertCol = function (col) { | ||
if (col.roleCode && !utils_1.PageUtil.hasRole(col.roleCode)) | ||
return null; | ||
var item = __assign({}, col); | ||
if (col.ik) { | ||
var title = utils_1.i18n.txt(col.ik); | ||
item.title = title == '' ? item.title : title; | ||
} | ||
if (HighKeys.has(item.dataIndex) && item.render == null) { | ||
item.render = function (record) { | ||
if (!lodash_1.default.isString(record)) | ||
return record; | ||
var keyword = ''; | ||
if (record && keyword) { | ||
return react_1.default.createElement(HighLight_1.HighLight, { text: record, keyword: keyword }); | ||
} | ||
return record; | ||
}; | ||
} | ||
if (!lodash_1.default.has(item, 'ellipsis')) | ||
item.ellipsis = true; | ||
if (!lodash_1.default.has(item, 'width') && lodash_1.default.isString(item.title)) { | ||
var clz = item.title.length + (item.sorter ? 2 : 0); | ||
if (col.className) { | ||
item.className = 'c-table-col-' + clz + ' ' + col.className; | ||
else { | ||
props.columns.map(function (col) { | ||
// @ts-ignore | ||
var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children); | ||
if (isGroup) { | ||
col.children.map((function (item) { | ||
if (lodash_1.default.isString(item.dataIndex)) | ||
HighKeys.add(item.dataIndex); | ||
})); | ||
} | ||
else { | ||
item.className = 'c-table-col-' + clz; | ||
var dataIndex = col.dataIndex; | ||
if (lodash_1.default.isString(dataIndex)) | ||
HighKeys.add(dataIndex); | ||
} | ||
} | ||
return item; | ||
}; | ||
props.columns.map(function (col) { | ||
// @ts-ignore | ||
var isGroup = lodash_1.default.has(col, 'children') && lodash_1.default.isArray(col.children); | ||
if (isGroup) { | ||
var column_1 = __assign(__assign({}, lodash_1.default.pick(col, ['width', 'align'])), { children: [], title: col.title, className: 'c-table-header-group' }); | ||
if (col.className) | ||
column_1.className = "c-table-header-group ".concat(col.className); | ||
col.children.map((function (item) { | ||
var subCol = convertCol(item); | ||
if (subCol != null) | ||
column_1.children.push(subCol); | ||
})); | ||
if (column_1.children.length > 0) | ||
cols.push(column_1); | ||
} | ||
else { | ||
var column = convertCol(col); | ||
if (column != null) | ||
cols.push(column); | ||
} | ||
}); | ||
}); | ||
} | ||
if (HighKeys.size > 0) { | ||
cols.map(function (col) { | ||
if (HighKeys.has(col.dataIndex) && col.render == null) { | ||
col.render = function (record) { | ||
if (!lodash_1.default.isString(record)) | ||
return record; | ||
var keyword = ''; | ||
if (record && keyword) { | ||
return react_1.default.createElement(HighLight_1.HighLight, { text: record, keyword: keyword }); | ||
} | ||
return record; | ||
}; | ||
} | ||
}); | ||
} | ||
return cols; | ||
@@ -274,2 +241,6 @@ }, [props.columns]); | ||
// useEffect(() => { | ||
// if (inModal) { | ||
// setScroll({ x: true }) | ||
// return; | ||
// } | ||
// if (props.scroll === null) return; | ||
@@ -276,0 +247,0 @@ // if (props.mode == undefined || props.mode == 'common') return; |
import React from 'react'; | ||
import { Language } from '../../utils/_Support'; | ||
import type { FC, PropsWithChildren, ReactNode } from 'react'; | ||
import type { BaseTreeOpts, SearchResult, TreeNodeData } from '../../utils/TreeUtil'; | ||
import type { AntTreeNodeProps, AntTreeNodeSelectedEvent, TreeProps } from 'antd/es/tree'; | ||
import type { PropsWithChildren, ReactNode } from 'react'; | ||
import type { BaseTreeProps } from './index'; | ||
@@ -30,4 +30,4 @@ import type { Key, PlainObject } from '../../basetype'; | ||
export declare const useBaseTree: () => BaseTreeContext; | ||
export declare const BaseTree: React.FC<PropsWithChildren<BaseTreeProps>>; | ||
export declare const BaseTree: FC<PropsWithChildren<BaseTreeProps>>; | ||
export declare const getNodeParam: (node: any, position: number[], state: BaseTreeState, search: SearchResult, disabledNode: (node: PlainObject) => boolean, folderChecker: (node: PlainObject) => boolean) => AntTreeNodeProps; | ||
export {}; |
@@ -137,3 +137,3 @@ "use strict"; | ||
react_1.default.createElement(index_1.Modal, { open: open, title: "\u8BF7\u9009\u62E9\u673A\u6784", bodyStyle: { maxHeight: 540, overflow: 'auto' }, width: 720, onCancel: function () { return setOpen(false); }, onOk: onOk }, | ||
react_1.default.createElement(index_1.Alert, { message: react_1.default.createElement(react_1.default.Fragment, null, | ||
react_1.default.createElement(index_1.Alert, { message: react_1.default.createElement(react_1.Fragment, null, | ||
"\u9009\u4E2D\u72B6\u6001\u8BF4\u660E \uFF1A ", | ||
@@ -140,0 +140,0 @@ (0, COTreeUtil_1.flagRender)(0, ' :'), |
@@ -106,3 +106,3 @@ "use strict"; | ||
return react_1.default.createElement(index_1.Input.Group, { compact: true, style: { width: props.width || '100%', display: 'flex' } }, | ||
react_1.default.createElement(index_1.Select, { maxTagCount: 1, mode: "tags", disabled: props.disabled, maxTagPlaceholder: react_1.default.createElement(react_1.default.Fragment, null), showSearch: false, className: 'co-select', allowClear: props.allowClear, | ||
react_1.default.createElement(index_1.Select, { maxTagCount: 1, mode: "tags", disabled: props.disabled, maxTagPlaceholder: utils_1.Const.NONE, showSearch: false, className: 'co-select', allowClear: props.allowClear, | ||
// onClear={() => props.onChange([])} | ||
@@ -109,0 +109,0 @@ placeholder: props.placeholder || '请选择机构', style: { flexGrow: 1 }, showAction: ["click"], options: [], labelInValue: true, value: selectValue, dropdownStyle: { width: props.width || '100%', maxHeight: 360, overflow: 'auto' }, dropdownRender: function () { return react_1.default.createElement(COTree_1.COTree, __assign({}, props, { value: value, onChange: onChange })); }, getPopupContainer: function (evt) { |
import React from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import type { TreeProps } from 'antd/es/tree/Tree'; | ||
@@ -12,3 +13,3 @@ import type { COTreeProps, COTreeValueItem, FLAG } from './COTree'; | ||
}; | ||
export declare const flagRender: (flag: FLAG, split?: React.ReactNode) => React.JSX.Element; | ||
export declare const flagRender: (flag: FLAG, split?: ReactNode) => React.JSX.Element; | ||
export declare const getTreeDataByLoaded: (all: any[], treeProps: COTreeProps, FIELDS: TreeFields) => [TreeProps, Set<string>, Set<string>, Set<string>]; | ||
@@ -15,0 +16,0 @@ export declare const convertFormObject: (obj: PlainObject) => COTreeValueItem[]; |
@@ -37,2 +37,9 @@ import React from 'react'; | ||
iconField?: string | ((item: any) => React.ReactNode); | ||
/** | ||
* 展开子节点: | ||
* | ||
* 方式一:传一个 api 接口地址,必须返回 VData<Array<Object>> 格式 | ||
* | ||
* 方式二:传一个方法 ,接收一个父节点参数,必须返回 Promise<TreeNodeData[]> (不要返回 children, 仅返回一级) | ||
*/ | ||
titleField: string | import("./index").LanguageField; | ||
@@ -39,0 +46,0 @@ mustSelect?: boolean; |
@@ -5,3 +5,2 @@ import React from 'react'; | ||
import type { BaseTreeProps, BaseActionTreeProps, ActionTreeRef } from './index'; | ||
import type { PlainObject } from '../../basetype'; | ||
export type FTreeData = { | ||
@@ -24,5 +23,5 @@ /** | ||
mustSelect?: boolean; | ||
disabledNode?: (node: PlainObject) => boolean; | ||
onSelect?: (key: import("../../basetype").Key, node: PlainObject, parentNode: PlainObject, crumb: PlainObject[], pos: number[]) => void; | ||
disabledNode?: (node: import("../..").PlainObject) => boolean; | ||
onSelect?: (key: import("../..").Key, node: import("../..").PlainObject, parentNode: import("../..").PlainObject, crumb: import("../..").PlainObject[], pos: number[]) => void; | ||
searchValue?: string; | ||
} & BaseActionTreeProps & FTreeData & React.RefAttributes<ActionTreeRef>>>; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { BaseTreeProps } from './index'; | ||
@@ -22,2 +22,2 @@ import type { TreeNodeData } from '../../utils/TreeUtil'; | ||
*/ | ||
export declare const STree: React.FC<STreeProps>; | ||
export declare const STree: FC<STreeProps>; |
import React from 'react'; | ||
import type { ReactNode, PropsWithChildren } from 'react'; | ||
import type { FC, ReactNode, PropsWithChildren } from 'react'; | ||
import type { TreeNodeData } from '../../utils/TreeUtil'; | ||
@@ -28,5 +28,5 @@ import type { TreeSelectProps } from 'antd/es/tree-select'; | ||
export declare const useBaseTree: () => BaseTreeSelectContext; | ||
export declare const BaseTreeSelect: React.FC<PropsWithChildren<BaseTreeSelectProps>>; | ||
export declare const BaseTreeSelect: FC<PropsWithChildren<BaseTreeSelectProps>>; | ||
export declare const getNodeParam: (node: any, state: BaseTreeSelectState, disabledNode: (node: PlainObject) => boolean) => any; | ||
export declare const renderRoot: (props: BaseTreeSelectProps, state: BaseTreeSelectState) => React.ReactNode; | ||
export declare const renderRoot: (props: BaseTreeSelectProps, state: BaseTreeSelectState) => ReactNode; | ||
export {}; |
@@ -61,6 +61,9 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.renderRoot = exports.getNodeParam = exports.BaseTreeSelect = exports.useBaseTree = void 0; | ||
var lodash_1 = __importStar(require("lodash")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var antd_1 = require("antd"); | ||
@@ -140,3 +143,3 @@ var HighLight_1 = require("../_common/HighLight"); | ||
if (props.multiple) { | ||
if ((0, lodash_1.isArray)(props.value)) | ||
if (lodash_1.default.isArray(props.value)) | ||
return props.value; | ||
@@ -211,3 +214,3 @@ if (props.value) | ||
if (icon.indexOf('/') >= 0) { | ||
param.title = react_1.default.createElement(react_1.default.Fragment, null, | ||
param.title = react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("span", { className: 'v-icon-bg' }, | ||
@@ -218,3 +221,3 @@ react_1.default.createElement("img", { style: { marginTop: -4 }, src: node[iconField] })), | ||
else { | ||
param.title = react_1.default.createElement(react_1.default.Fragment, null, | ||
param.title = react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(Icon_1.Icon, { type: node[iconField] }), | ||
@@ -228,3 +231,3 @@ title); | ||
if (icon) { | ||
param.title = react_1.default.createElement(react_1.default.Fragment, null, | ||
param.title = react_1.default.createElement(react_1.Fragment, null, | ||
icon, | ||
@@ -231,0 +234,0 @@ title); |
@@ -1,5 +0,5 @@ | ||
import React from 'react'; | ||
import type { BaseTreeSelectProps } from './index'; | ||
import type { DTreeData } from '../Trees/DTree'; | ||
import type { FC } from 'react'; | ||
export type DTreeSelectProps = BaseTreeSelectProps & DTreeData; | ||
export declare const DTreeSelect: React.FC<DTreeSelectProps>; | ||
export declare const DTreeSelect: FC<DTreeSelectProps>; |
@@ -114,4 +114,4 @@ "use strict"; | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var antd_1 = require("antd"); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var BaseTreeSelect_1 = require("./BaseTreeSelect"); | ||
@@ -118,0 +118,0 @@ var hooks_1 = require("../../hooks"); |
@@ -1,5 +0,5 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { BaseTreeSelectProps } from './index'; | ||
import type { FTreeData } from '../Trees/FTree'; | ||
export type FTreeSelectProps = BaseTreeSelectProps & Required<FTreeData>; | ||
export declare const FTreeSelect: React.FC<FTreeSelectProps>; | ||
export declare const FTreeSelect: FC<FTreeSelectProps>; |
@@ -1,5 +0,5 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { STreeData } from '../Trees/STree'; | ||
import type { BaseTreeSelectProps } from './index'; | ||
export type STreeSelectProps = BaseTreeSelectProps & STreeData; | ||
export declare const STreeSelect: React.FC<STreeSelectProps>; | ||
export declare const STreeSelect: FC<STreeSelectProps>; |
@@ -8,2 +8,2 @@ /** | ||
*/ | ||
export declare const _FieldType: readonly ["text", "textarea", "password", "color", "number", "slider", "slider-range", "slider-range", "input-with-select", "select", "multi-select", "switch", "switch-checkbox", "radio", "radio-button", "radio-with-more", "checkbox", "checkbox-with-all", "icon", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "date", "datetime", "month", "week", "time", "daterange", "datetimerange", "daterange-single", "datetimerange-single", "timerange", "monthrange", "json-array", "json-table", "file", "multi-file", "img", "idcard", "ip", "ip4", "ip6", "phone", "telephone", "mobilephone", "port", "mac", "url", "email", "crontab", "organization", "role", "roles", "cems-org-button"]; | ||
export declare const _FieldType: readonly ["text", "textarea", "password", "color", "number", "slider", "slider-range", "slider-range", "input-with-select", "button", "select", "multi-select", "switch", "switch-checkbox", "radio", "radio-button", "radio-with-more", "checkbox", "checkbox-with-all", "icon", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "date", "datetime", "month", "week", "time", "daterange", "datetimerange", "daterange-single", "datetimerange-single", "timerange", "monthrange", "json-array", "json-table", "file", "multi-file", "img", "idcard", "ip", "ip4", "ip6", "phone", "telephone", "mobilephone", "port", "mac", "url", "email", "crontab", "organization", "role", "roles", "cems-org-button"]; |
@@ -51,2 +51,6 @@ "use strict"; | ||
/** | ||
* 一个没有任何意义的按钮,使用时,请设置 dataType:'none' | ||
*/ | ||
'button', | ||
/** | ||
* 下拉选择 | ||
@@ -53,0 +57,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import type { UFormField } from './index'; | ||
@@ -23,3 +23,3 @@ import type { PlainObject } from '../../basetype'; | ||
*/ | ||
title: React.ReactNode; | ||
title: ReactNode; | ||
/** | ||
@@ -54,3 +54,3 @@ * 选择弹框宽度 | ||
*/ | ||
render?: (obj: PlainObject) => React.ReactNode; | ||
render?: (obj: PlainObject) => ReactNode; | ||
}; | ||
@@ -57,0 +57,0 @@ /** |
@@ -143,4 +143,4 @@ "use strict"; | ||
}; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
values[0] != undefined ? react_1.default.createElement(Button_1.Button, __assign({}, params, { onClick: function () { return setOpen(true); } }), getTip(values)) : react_1.default.createElement(Button_1.Button, __assign({}, params, { icon: 'select', onClick: function () { return setOpen(true); } }), (0, exports.getPlaceholder)(field, true)), | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
values[0] != undefined ? react_1.default.createElement(Button_1.Button, __assign({}, params, { icon: 'select', onClick: function () { return setOpen(true); } }), getTip(values)) : react_1.default.createElement(Button_1.Button, __assign({}, params, { icon: 'select', onClick: function () { return setOpen(true); } }), (0, exports.getPlaceholder)(field, true)), | ||
react_1.default.createElement(Tables_1.ApiTableModal, __assign({ title: options.title, searchBar: options.searchBar, width: options.width || 720 }, field.config, { api: options.api, columns: __spreadArray(__spreadArray([], __read(options.columns), false), [ | ||
@@ -147,0 +147,0 @@ Tables_1.ApiTable.COL_OPERACTION({ render: function (data) { return react_1.default.createElement(Tables_1.ApiTable.ACTION, { title: "\u9009\u62E9", icon: "select", onClick: function () { return onSelect(data); } }); } }) |
@@ -1,6 +0,5 @@ | ||
import React from 'react'; | ||
import type { ComponentType, ReactNode } from 'react'; | ||
import type { BaseOption, PlainObject } from '../../basetype'; | ||
import type { UFormField } from './index'; | ||
import type { ValidationRule, WrappedFormUtils } from 'antd/es/form/Form'; | ||
import type { ComponentType } from 'react'; | ||
/** | ||
@@ -68,3 +67,3 @@ * 自定义组件实现时,为组件提供的参数 | ||
*/ | ||
render?: (value: any, data?: PlainObject, field?: UFormField) => React.ReactNode; | ||
render?: (value: any, data?: PlainObject, field?: UFormField) => ReactNode; | ||
/** | ||
@@ -71,0 +70,0 @@ * 校验规则 |
@@ -1,4 +0,3 @@ | ||
import React from 'react'; | ||
import type { FC, MutableRefObject, PropsWithChildren } from 'react'; | ||
import type { UFromProps } from './index'; | ||
import type { MutableRefObject, PropsWithChildren } from 'react'; | ||
export type FormState = { | ||
@@ -20,4 +19,4 @@ width: number; | ||
export declare const getDefault: (props: UFromProps) => [boolean, number, 1 | 2 | 3, number]; | ||
export declare const FormWrapper: React.FC<PropsWithChildren<UFromProps & { | ||
export declare const FormWrapper: FC<PropsWithChildren<UFromProps & { | ||
isInfo: boolean; | ||
}>>; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="react" /> | ||
export { UForm } from './UForm'; | ||
@@ -8,2 +7,3 @@ export { UFormModal } from './UFormModal'; | ||
export { UDescriptions } from './UDescriptions'; | ||
import type { ReactNode, CSSProperties } from 'react'; | ||
import type { BaseOption, PlainObject, BaseItem } from '../../basetype'; | ||
@@ -20,4 +20,7 @@ import type { ModalProps } from '../_adapt/Modal'; | ||
export type UFormLayout = 'common' | 'simple' | 'compress'; | ||
export type FieldDataType = 'string' | 'number' | 'boolean' | 'array' | 'object'; | ||
/** | ||
* | ||
*/ | ||
export type FieldDataType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'NONE'; | ||
/** | ||
* 分组展示的方式 default = 默认 | tabs = 标签 | collapse = 折叠风琴 | ||
@@ -160,3 +163,3 @@ */ | ||
*/ | ||
tip?: React.ReactNode; | ||
tip?: ReactNode; | ||
/** | ||
@@ -167,7 +170,7 @@ * FormItem 的 extra 信息 | ||
*/ | ||
extra?: React.ReactNode; | ||
extra?: ReactNode; | ||
/** | ||
* FormItem 的 help 信息 | ||
*/ | ||
help?: React.ReactNode; | ||
help?: ReactNode; | ||
/** | ||
@@ -202,3 +205,3 @@ * rules 用法: https://github.com/yiminghe/async-validator | ||
*/ | ||
render?: (txt: any, obj?: any) => React.ReactNode; | ||
render?: (txt: any, obj?: any) => ReactNode; | ||
/** | ||
@@ -231,3 +234,3 @@ * 字段选项,适用于 `table` `json-table` 等 | ||
*/ | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
/** | ||
@@ -266,3 +269,3 @@ * 列表 | ||
*/ | ||
tip?: React.ReactNode; | ||
tip?: ReactNode; | ||
/** | ||
@@ -313,3 +316,3 @@ * 默认 | ||
*/ | ||
confirm?: React.ReactNode; | ||
confirm?: ReactNode; | ||
}; | ||
@@ -364,7 +367,7 @@ /** | ||
*/ | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
/** | ||
* 标题 | ||
*/ | ||
title?: React.ReactNode; | ||
title?: ReactNode; | ||
/** | ||
@@ -406,3 +409,3 @@ * 标题 i18n Key | ||
*/ | ||
label?: React.ReactNode; | ||
label?: ReactNode; | ||
/** | ||
@@ -419,3 +422,3 @@ * 横跨制表格数,默认:1 | ||
*/ | ||
children: React.ReactNode; | ||
children: ReactNode; | ||
}; | ||
@@ -422,0 +425,0 @@ export type UFormRef = { |
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { UDescriptionsItemProps, UDescriptionsProps } from './index'; | ||
export declare const UDescriptions: React.ExoticComponent<React.PropsWithChildren<UDescriptionsProps>> & { | ||
Item: React.FC<UDescriptionsItemProps>; | ||
Item: FC<UDescriptionsItemProps>; | ||
}; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,3 +30,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.UDescriptions = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -13,3 +36,3 @@ var utils_1 = require("../../utils"); | ||
if (variableToInspect.type) | ||
return variableToInspect.type === react_1.default.Fragment; | ||
return variableToInspect.type === react_1.Fragment; | ||
return false; | ||
@@ -19,3 +42,3 @@ }; | ||
var ret = []; | ||
react_1.default.Children.forEach(children, function (child) { | ||
react_1.Children.forEach(children, function (child) { | ||
if (child === undefined || child === null) { | ||
@@ -94,3 +117,3 @@ return; | ||
var lastNode = columns.pop(); | ||
columns.push(react_1.default.cloneElement(lastNode, { span: lastNode.props.span + diffSpan })); | ||
columns.push((0, react_1.cloneElement)(lastNode, { span: lastNode.props.span + diffSpan })); | ||
leftSpans = column - span; | ||
@@ -100,3 +123,3 @@ columns = []; | ||
} | ||
columns.push(react_1.default.cloneElement(node, { span: span })); | ||
columns.push((0, react_1.cloneElement)(node, { span: span })); | ||
if (leftSpans <= 0) { | ||
@@ -103,0 +126,0 @@ columns = null; |
@@ -222,3 +222,3 @@ "use strict"; | ||
if (hiddenFields.current.has(field.field)) { | ||
return react_1.default.createElement(antd_1.Form.Item, { style: { display: 'none' } }, form.getFieldDecorator(field.field)(react_1.default.createElement(input.component, { | ||
return react_1.default.createElement(antd_1.Form.Item, { style: { display: 'none' } }, form.getFieldDecorator(field.field)((0, react_1.createElement)(input.component, { | ||
form: form, | ||
@@ -302,3 +302,3 @@ field: field, | ||
return react_1.default.createElement(antd_1.Col, __assign({}, colProps), | ||
react_1.default.createElement(antd_1.Form.Item, __assign({}, itemProps), form.getFieldDecorator(field.field, options)(react_1.default.createElement(input.component, { | ||
react_1.default.createElement(antd_1.Form.Item, __assign({}, itemProps), form.getFieldDecorator(field.field, options)((0, react_1.createElement)(input.component, { | ||
form: form, | ||
@@ -499,3 +499,3 @@ field: field, | ||
return utils_1.Const.NONE; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(antd_1.Col, { span: 24, className: "c-form-group-title" }, utils_1.i18n.getText(group.ik, group.title)), | ||
@@ -576,3 +576,3 @@ group.fields.map(function (field) { | ||
return _UFormAdaptor; | ||
}(react_1.default.Component)); | ||
}(react_1.Component)); | ||
// 3.0 适配层 | ||
@@ -579,0 +579,0 @@ var UFormAdaptor = (0, react_1.memo)((0, react_1.forwardRef)(function (props, ref) { |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { UModalProps } from './index'; | ||
export declare const UFormModal: React.FC<UModalProps>; | ||
export declare const UFormModal: FC<UModalProps>; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { UFromProps, UDescriptionsProps } from './index'; | ||
@@ -10,2 +10,2 @@ import type { PlainObject } from '../../basetype'; | ||
}; | ||
export declare const UInfo: React.FC<UInfoProps>; | ||
export declare const UInfo: FC<UInfoProps>; |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { UModalProps } from './index'; | ||
export declare const UInfoModal: React.FC<UModalProps>; | ||
export declare const UInfoModal: FC<UModalProps>; |
@@ -58,5 +58,5 @@ "use strict"; | ||
param.width = (0, FormWrapper_1.getDefault)(props)[1]; | ||
return react_1.default.createElement(Modal_1.Modal, __assign({ maskClosable: true, footer: null }, param), | ||
return react_1.default.createElement(Modal_1.Modal, __assign({ className: utils_1.StringUtil.className(['c-info-modal'], props.className), maskClosable: true, footer: null }, param), | ||
react_1.default.createElement(UInfo_1.UInfo, __assign({}, lodash_1.default.pick(props, FORM_FIELDS)))); | ||
}; | ||
exports.UInfoModal = UInfoModal; |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { UModalProps } from './index'; | ||
export declare const UModal: React.FC<UModalProps>; | ||
export declare const UModal: FC<UModalProps>; |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { BaseUploadProps } from './index'; | ||
export declare const UploadFile: React.FC<BaseUploadProps>; | ||
export declare const UploadFile: FC<BaseUploadProps>; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { BaseUploadProps } from './index'; | ||
@@ -29,2 +29,2 @@ import type { PlainObject } from '../../basetype'; | ||
}; | ||
export declare const UploadImage: React.FC<UploadImageProps>; | ||
export declare const UploadImage: FC<UploadImageProps>; |
@@ -106,3 +106,3 @@ "use strict"; | ||
}, [imgUrl]); | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("div", __assign({}, divProps), showPreview && react_1.default.createElement(Icon_1.Icon, { type: "zoom-in" })), | ||
@@ -109,0 +109,0 @@ showPreview && react_1.default.createElement(Modal_1.Modal, { className: 'picture-card-preview', style: { top: 0, backgroundImage: "url(\"".concat(imgUrl, "\")") }, open: open, maskClosable: true, width: '100%', footer: null, onCancel: show })); |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC, ReactNode } from 'react'; | ||
import type { BaseUploadProps } from './index'; | ||
@@ -12,3 +12,3 @@ import type { ModalProps } from '../../components/_adapt/Modal'; | ||
type ImportResult = boolean | { | ||
message: React.ReactNode; | ||
message: ReactNode; | ||
ok: boolean; | ||
@@ -35,3 +35,3 @@ }; | ||
*/ | ||
tip?: React.ReactNode; | ||
tip?: ReactNode; | ||
/** | ||
@@ -51,3 +51,3 @@ * 二步模式,且上传接口非标准接口时,必传 onUpload | ||
}; | ||
export declare const UploadModal: React.FC<UploadModalProps>; | ||
export declare const UploadModal: FC<UploadModalProps>; | ||
export {}; |
@@ -199,5 +199,5 @@ "use strict"; | ||
; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(antd_1.Upload, __assign({}, uploadProps, { onChange: onChange }), | ||
react_1.default.createElement(Button_1.Button, { loading: state.uploading, disabled: state.uploading, icon: "upload" }, utils_1.i18n.txt(_i18n_1.V.UPLOAD_FILE))), | ||
react_1.default.createElement(Button_1.Button, { loading: state.uploading, disabled: state.uploading, icon: "upload", type: "primary" }, utils_1.i18n.txt(_i18n_1.V.UPLOAD_FILE))), | ||
react_1.default.createElement(Button_1.Button, { onClick: function () { return props.onCancel(); } }, utils_1.i18n.ant('Modal.cancelText'))); | ||
@@ -204,0 +204,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import type { UploadProps as AntdUploadProps } from 'antd/es/upload'; | ||
@@ -10,3 +10,3 @@ import type { BaseUploadProps } from './index'; | ||
percent: number; | ||
errMsg?: React.ReactNode; | ||
errMsg?: ReactNode; | ||
name?: string; | ||
@@ -13,0 +13,0 @@ info?: any; |
@@ -27,3 +27,3 @@ "use strict"; | ||
var utils_1 = require("../../utils"); | ||
var _i18n_1 = require("../../components/_i18n"); | ||
var _i18n_1 = require("../_i18n"); | ||
var getBaseOptions = function (props) { | ||
@@ -30,0 +30,0 @@ var uploadProps = { |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { PlainObject, UFormField } from "../../index"; | ||
@@ -25,4 +25,4 @@ type LookUp = { | ||
}; | ||
export declare const LookUpInfo: React.FC<LookUpModalProps>; | ||
export declare const LookUpModal: React.FC<LookUpModalProps>; | ||
export declare const LookUpInfo: FC<LookUpModalProps>; | ||
export declare const LookUpModal: FC<LookUpModalProps>; | ||
export {}; |
@@ -103,6 +103,6 @@ "use strict"; | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var utils_1 = require("../../utils"); | ||
var index_1 = require("../../index"); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var hooks_1 = require("../../hooks"); | ||
var utils_1 = require("../../utils"); | ||
var useLookup = function () { | ||
@@ -109,0 +109,0 @@ var _a = __read((0, hooks_1.useGlobal)('lookup', { |
@@ -10,3 +10,3 @@ // import React, { useEffect } from 'react'; | ||
// import { useCallback } from 'react'; | ||
// export const sourceTypeRender = (type: SOURCE_TYPE): React.ReactNode => { | ||
// export const sourceTypeRender = (type: SOURCE_TYPE): ReactNode => { | ||
// switch (type) { | ||
@@ -34,3 +34,3 @@ // case 1: | ||
// status: Map<number, any>, | ||
// sourceIdRender: (id: number) => React.ReactNode, | ||
// sourceIdRender: (id: number) => ReactNode, | ||
// query: (param) => void; | ||
@@ -37,0 +37,0 @@ // add: (param) => void; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { EChartsOption } from 'echarts'; | ||
@@ -25,3 +25,3 @@ interface EchartProps { | ||
*/ | ||
export declare const EChart: React.FC<EchartProps>; | ||
export declare const EChart: FC<EchartProps>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC, CSSProperties } from 'react'; | ||
import type { Descendant } from 'slate'; | ||
@@ -18,4 +18,4 @@ /** | ||
*/ | ||
sytle?: React.CSSProperties; | ||
sytle?: CSSProperties; | ||
}; | ||
export declare const Article: React.FC<ArticleProps>; | ||
export declare const Article: FC<ArticleProps>; |
@@ -1,5 +0,5 @@ | ||
import React from 'react'; | ||
import { Editor } from 'slate'; | ||
import type { FC } from 'react'; | ||
import type { ButtonProps } from '../../types'; | ||
export declare const insertImage: (editor: Editor, url: string) => void; | ||
export declare const ImageButton: React.FC<ButtonProps>; | ||
export declare const ImageButton: FC<ButtonProps>; |
@@ -65,3 +65,3 @@ "use strict"; | ||
} | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Dropdown, { placement: "bottomLeft", arrow: true, trigger: ['click'], menu: { | ||
@@ -68,0 +68,0 @@ items: [ |
@@ -1,4 +0,4 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { ButtonProps } from '../types'; | ||
export declare const TEXT_ALIGN_TYPES: string[]; | ||
export declare const BlockButton: React.FC<ButtonProps>; | ||
export declare const BlockButton: FC<ButtonProps>; |
@@ -1,5 +0,5 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { ButtonProps } from '../types'; | ||
export declare const HR: React.FC<ButtonProps>; | ||
export declare const Audio: React.FC<ButtonProps>; | ||
export declare const Video: React.FC<ButtonProps>; | ||
export declare const HR: FC<ButtonProps>; | ||
export declare const Audio: FC<ButtonProps>; | ||
export declare const Video: FC<ButtonProps>; |
@@ -1,6 +0,6 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { CommandType, ButtonDefine } from '../types'; | ||
export declare const MarkButton: React.FC<ButtonDefine & { | ||
export declare const MarkButton: FC<ButtonDefine & { | ||
cmd: CommandType; | ||
disabled: boolean; | ||
}>; |
@@ -1,7 +0,7 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { ButtonProps } from '../types'; | ||
export declare const Link: React.FC<ButtonProps>; | ||
export declare const FontFamily: React.FC<ButtonProps>; | ||
export declare const FontSize: React.FC<ButtonProps>; | ||
export declare const Color: React.FC<ButtonProps>; | ||
export declare const BgColor: React.FC<ButtonProps>; | ||
export declare const Link: FC<ButtonProps>; | ||
export declare const FontFamily: FC<ButtonProps>; | ||
export declare const FontSize: FC<ButtonProps>; | ||
export declare const Color: FC<ButtonProps>; | ||
export declare const BgColor: FC<ButtonProps>; |
@@ -13,2 +13,25 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
@@ -30,8 +53,5 @@ var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BgColor = exports.Color = exports.FontSize = exports.FontFamily = exports.Link = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var slate_1 = require("slate"); | ||
@@ -79,3 +99,3 @@ var slate_react_1 = require("slate-react"); | ||
} | ||
return react_1.default.createElement(react_1.default.Fragment, null, value ? react_1.default.createElement(index_1.Popover, { placement: "bottomLeft", content: react_1.default.createElement("div", { style: { width: 320 } }, | ||
return react_1.default.createElement(react_1.Fragment, null, value ? react_1.default.createElement(index_1.Popover, { placement: "bottomLeft", content: react_1.default.createElement("div", { style: { width: 320 } }, | ||
react_1.default.createElement("p", null, | ||
@@ -82,0 +102,0 @@ "\u94FE\u63A5\u5230 : ", |
@@ -1,6 +0,6 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { CommandType } from '../types'; | ||
export declare const Button: React.FC<{ | ||
export declare const Button: FC<{ | ||
type: CommandType; | ||
disabled: boolean; | ||
}>; |
@@ -25,4 +25,4 @@ "use strict"; | ||
var _InsertButton_1 = require("./_InsertButton"); | ||
var _TxtButton_1 = require("./_TxtButton"); | ||
var ImageButton_1 = require("../support/buttons/ImageButton"); | ||
var _TxtButton_1 = require("./_TxtButton"); | ||
var BUTTONS = { | ||
@@ -29,0 +29,0 @@ bold: { type: 'mark', icon: 'bold', ik: i18n_1.EDITOR.BOLD }, |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { CommandType } from '../types'; | ||
@@ -7,3 +7,3 @@ type ToolbarProps = { | ||
}; | ||
export declare const Toolbar: React.FC<ToolbarProps>; | ||
export declare const Toolbar: FC<ToolbarProps>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { CSSProperties } from 'react'; | ||
import type { BaseElement } from 'slate'; | ||
@@ -145,4 +145,4 @@ import type { ReactEditor } from 'slate-react'; | ||
*/ | ||
sytle?: React.CSSProperties; | ||
sytle?: CSSProperties; | ||
}; | ||
export {}; |
@@ -39,7 +39,2 @@ "use strict"; | ||
exports.DEFAULT_VALUE = [{ type: 'paragraph', children: [{ text: '' }] }]; | ||
// export const containerProps = (props: Partial<ArticleProps>) => useMemo<React.HTMLAttributes<HTMLDivElement>>(() => { | ||
// return { | ||
// style: props.sytle | ||
// } | ||
// }, []) | ||
var initValue = function (props) { return (0, react_1.useMemo)(function () { | ||
@@ -46,0 +41,0 @@ if (props.value == null || props.value == '') |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { ReactJsonViewProps } from 'react-json-view'; | ||
@@ -6,2 +6,2 @@ export type JsonViewProps = Omit<ReactJsonViewProps, 'src'> & { | ||
}; | ||
export declare const JsonView: React.FC<JsonViewProps>; | ||
export declare const JsonView: FC<JsonViewProps>; |
@@ -41,9 +41,12 @@ "use strict"; | ||
exports.JsonView = void 0; | ||
// 依赖 | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var react_json_view_1 = __importDefault(require("react-json-view")); | ||
var hooks_1 = require("../hooks"); | ||
// 依赖于REACT-JSON-VIEW | ||
var JsonView = function (props) { | ||
var app = (0, hooks_1.useApp)(); | ||
var jsonViewProps = (0, react_1.useMemo)(function () { | ||
var params = __assign(__assign({ name: false }, props), { src: props.data }); | ||
var _a; | ||
var params = __assign(__assign({ name: false, theme: ((_a = app === null || app === void 0 ? void 0 : app.theme) === null || _a === void 0 ? void 0 : _a.darkMode) ? 'harmonic' : 'rjv-default' }, props), { src: props.data }); | ||
if (props.data == null) | ||
@@ -50,0 +53,0 @@ return params; |
@@ -151,3 +151,3 @@ "use strict"; | ||
doLoad({ | ||
list: response.list, total: response.total, totalAcc: response.totalAcc || response.total, | ||
list: response.list || [], total: response.total, totalAcc: response.totalAcc || response.total, | ||
cost: Date.now() - _start, | ||
@@ -154,0 +154,0 @@ isQuerying: false |
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import type { ReactNode } from 'react'; | ||
import type { PlainObject } from '../basetype'; | ||
@@ -162,3 +162,3 @@ import type { Language } from '../utils/_Support'; | ||
*/ | ||
ipRender: (ip: string) => React.ReactNode; | ||
ipRender: (ip: string) => ReactNode; | ||
/** | ||
@@ -168,3 +168,3 @@ * 通用 idCard Render,用于统一跳转 | ||
*/ | ||
idRender: (idCard: string) => React.ReactNode; | ||
idRender: (idCard: string) => ReactNode; | ||
/** | ||
@@ -171,0 +171,0 @@ * 通用 应用系统 Render,用于统一跳转 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useApp = void 0; | ||
var react_1 = require("react"); | ||
var _Support_1 = require("../utils/_Support"); | ||
var react_1 = require("react"); | ||
; | ||
@@ -7,0 +7,0 @@ ; |
@@ -78,2 +78,5 @@ "use strict"; | ||
var getList = function (result) { | ||
if (lodash_1.default.isArray(result)) { | ||
return result; | ||
} | ||
if (lodash_1.default.has(result, 'code')) { | ||
@@ -86,13 +89,8 @@ if (result.code != '0') { | ||
} | ||
if (lodash_1.default.has(result, 'list')) { | ||
if (lodash_1.default.has(result, 'list')) | ||
return result.list; | ||
} | ||
if (lodash_1.default.has(result, 'data') && lodash_1.default.isArray(result.data)) { | ||
if (lodash_1.default.isArray(result.data)) | ||
return result.data; | ||
} | ||
return []; | ||
} | ||
if (lodash_1.default.isArray(result)) { | ||
return result; | ||
} | ||
return []; | ||
@@ -99,0 +97,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { ReactElement } from 'react'; | ||
export declare const noop: () => void; | ||
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export type Element = ((state: boolean) => React.ReactElement<any>) | React.ReactElement<any>; | ||
export declare const useHover: (element: Element) => [React.ReactElement<any>, boolean]; | ||
export type Element = ((state: boolean) => ReactElement<any>) | ReactElement<any>; | ||
export declare const useHover: (element: Element) => [ReactElement<any>, boolean]; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
@@ -43,3 +20,3 @@ var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
exports.useHover = exports.noop = void 0; | ||
var react_1 = __importStar(require("react")); | ||
var react_1 = require("react"); | ||
var noop = function () { }; | ||
@@ -60,3 +37,3 @@ exports.noop = noop; | ||
} | ||
var el = react_1.default.cloneElement(element, { | ||
var el = (0, react_1.cloneElement)(element, { | ||
onMouseEnter: onMouseEnter(element.props.onMouseEnter), | ||
@@ -63,0 +40,0 @@ onMouseLeave: onMouseLeave(element.props.onMouseLeave), |
@@ -1,1 +0,1 @@ | ||
{"name":"vap1","version":"0.4.3","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"} | ||
{"name":"vap1","version":"0.4.4","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"} |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC, PropsWithChildren, CSSProperties } from 'react'; | ||
/** | ||
@@ -9,3 +9,3 @@ * 大屏组件属性 | ||
*/ | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
/** | ||
@@ -32,2 +32,2 @@ * class 属性 | ||
}; | ||
export declare const Comment: React.FC<React.PropsWithChildren<CommentProps>>; | ||
export declare const Comment: FC<PropsWithChildren<CommentProps>>; |
@@ -15,3 +15,3 @@ // import React from 'react'; | ||
// */ | ||
// style?:React.CSSProperties, | ||
// style?:CSSProperties, | ||
// /** | ||
@@ -38,3 +38,3 @@ // * 组件宽度 | ||
// */ | ||
// export default abstract class extends React.PureComponent<EchartCommentProps>{ | ||
// export default abstract class extends PureComponent<EchartCommentProps>{ | ||
// id = genId(); | ||
@@ -41,0 +41,0 @@ // chart:echarts.ECharts = null; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC, PropsWithChildren } from 'react'; | ||
type PageProps = { | ||
@@ -12,3 +12,3 @@ /** | ||
}; | ||
export declare const Page: React.FC<React.PropsWithChildren<PageProps>>; | ||
export declare const Page: FC<PropsWithChildren<PageProps>>; | ||
export {}; |
@@ -1,5 +0,5 @@ | ||
import React from 'react'; | ||
import type { ReactNode } from 'react'; | ||
/** | ||
* 大屏 render 方法根节点请用 Page | ||
*/ | ||
export declare const render: (children: React.ReactNode) => Element; | ||
export declare const render: (children: ReactNode) => Element; |
@@ -1,2 +0,2 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { FormSchema, FixField } from './schema'; | ||
@@ -38,2 +38,2 @@ /** | ||
}; | ||
export declare const FormEditor: React.FC<FormEditorProps>; | ||
export declare const FormEditor: FC<FormEditorProps>; |
@@ -52,2 +52,3 @@ "use strict"; | ||
var useForm_1 = require("./hooks/useForm"); | ||
var Const_1 = require("../utils/Const"); | ||
var FormViewer_1 = require("./FormViewer"); | ||
@@ -111,5 +112,5 @@ var CanvasProperties_1 = __importDefault(require("./panel/Propreties/CanvasProperties")); | ||
style: { padding: 0 }, | ||
icon: react_1.default.createElement(react_1.default.Fragment, null), | ||
icon: Const_1.NONE, | ||
placement: 'top', | ||
message: react_1.default.createElement(react_1.default.Fragment, null, | ||
message: react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("h4", null, "JSON \u9884\u89C8"), | ||
@@ -116,0 +117,0 @@ react_1.default.createElement("pre", null, JSON.stringify(data, null, 1))) |
@@ -19,5 +19,5 @@ "use strict"; | ||
var react_1 = __importDefault(require("react")); | ||
var index_1 = require("../../index"); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var dayjs_1 = __importDefault(require("dayjs")); | ||
var index_1 = require("../../index"); | ||
var utils_1 = require("../../utils"); | ||
@@ -24,0 +24,0 @@ var defaultPlaceholder = '请选择'; |
@@ -19,4 +19,4 @@ "use strict"; | ||
var react_1 = __importDefault(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var index_1 = require("../../index"); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var defaultPlaceholder = '请输入'; | ||
@@ -23,0 +23,0 @@ var style = { pointerEvents: 'none' }; |
@@ -19,4 +19,4 @@ "use strict"; | ||
var react_1 = __importDefault(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var index_1 = require("../../index"); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var defaultPlaceholder = '请选择'; | ||
@@ -23,0 +23,0 @@ var style = { pointerEvents: 'none', width: '100%' }; |
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import type { FC } from 'react'; | ||
import type { FormItem } from '../schema'; | ||
@@ -15,3 +15,3 @@ import type { PlainObject } from '../../basetype'; | ||
icon?: string; | ||
Component?: React.FC<FormItem>; | ||
Component?: FC<FormItem>; | ||
breakTitle?: boolean; | ||
@@ -18,0 +18,0 @@ breakCol?: boolean; |
@@ -9,8 +9,8 @@ "use strict"; | ||
var _FieldItems_1 = require("./_FieldItems"); | ||
var Const_1 = require("../../../utils/Const"); | ||
var index_1 = require("../../../index"); | ||
exports.default = (function () { | ||
var _a = (0, useEditor_1.useEditor)(), fields = _a.form.fields, selected = _a.selected; | ||
if (fields.length == 0) { | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
} | ||
if (fields.length == 0) | ||
return Const_1.NONE; | ||
return react_1.default.createElement(index_1.Collapse, { activeKey: fields.map(function (item) { return item.id; }), onChange: function () { return index_1.message.info('编辑模式暂不支持折叠'); } }, fields.map(function (group) { | ||
@@ -17,0 +17,0 @@ var clazz = ['form-group']; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var useEditor_1 = require("../../hooks/useEditor"); | ||
@@ -11,3 +31,3 @@ var _FieldItems_1 = require("./_FieldItems"); | ||
var _a = (0, useEditor_1.useEditor)(), selected = _a.selected, deleteGroup = _a.deleteGroup, fields = _a.form.fields; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
" ", | ||
@@ -14,0 +34,0 @@ fields.map(function (group) { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,4 +29,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var Const_1 = require("../../../utils/Const"); | ||
var index_1 = require("../../../index"); | ||
@@ -15,5 +39,4 @@ var useEditor_1 = require("../../hooks/useEditor"); | ||
var editor = (0, useEditor_1.useEditor)(); | ||
if (fields.length == 0) { | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
} | ||
if (fields.length == 0) | ||
return Const_1.NONE; | ||
var idx = 0; | ||
@@ -39,3 +62,3 @@ if (lodash_1.default.isNumber(__idx)) { | ||
} | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("div", { onClick: function (evt) { | ||
@@ -42,0 +65,0 @@ evt.preventDefault(); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,3 +29,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -34,3 +57,3 @@ var useEditor_1 = require("../../hooks/useEditor"); | ||
} | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("div", { onClick: function (evt) { | ||
@@ -37,0 +60,0 @@ evt.preventDefault(); |
@@ -14,2 +14,3 @@ "use strict"; | ||
var _GroupTab_1 = __importDefault(require("./_GroupTab")); | ||
var Const_1 = require("../../../utils/Const"); | ||
var getElement = function (el) { | ||
@@ -44,5 +45,4 @@ if (el == null) { | ||
var editor = (0, useEditor_1.useEditor)(); | ||
if (!editor.form.isGroup) { | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
} | ||
if (!editor.form.isGroup) | ||
return Const_1.NONE; | ||
var _b = editor.form, groupType = _b.groupType, baseSpan = _b.baseSpan; | ||
@@ -49,0 +49,0 @@ var Editor = function () { |
@@ -107,3 +107,3 @@ "use strict"; | ||
}; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Form, { labelCol: { sm: 6 }, wrapperCol: { sm: 18 }, onClick: onClick, className: clazz.join(' ') }, | ||
@@ -110,0 +110,0 @@ (tip && tip.text) && react_1.default.createElement("div", { onClick: function (evt) { |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { FormEditorProps } from '../../FormEditor'; | ||
export declare const Fields: React.FC<Pick<FormEditorProps, 'fields'>>; | ||
export declare const Fields: FC<Pick<FormEditorProps, 'fields'>>; |
@@ -28,3 +28,5 @@ "use strict"; | ||
var react_1 = __importStar(require("react")); | ||
// import { SList, Modal } from '../../../index'; | ||
var useEditor_1 = require("../../hooks/useEditor"); | ||
// import type { FormInput } from '../../inputs'; | ||
var Fields = function (props) { | ||
@@ -37,3 +39,3 @@ var _a = (0, useEditor_1.useEditor)(), fieldFixed = _a.fieldFixed, fieldUsed = _a.fieldUsed; | ||
}, [fieldFixed, fieldUsed]); | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("ul", { className: 'uform-editor-fields' }, fields.map(function (item) { return react_1.default.createElement("li", { key: item.field, draggable: true, onDragStart: function (evt) { return evt.dataTransfer.setData("field", item.field); } }, | ||
@@ -40,0 +42,0 @@ react_1.default.createElement("span", null, item.field), |
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { FormInput } from '../../inputs'; | ||
export declare const Item: React.FC<FormInput>; | ||
export declare const Item: FC<FormInput>; | ||
export declare const Inputs: () => React.JSX.Element; |
@@ -13,8 +13,28 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Inputs = exports.Item = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var inputs_1 = require("../../inputs"); | ||
@@ -27,3 +47,3 @@ var utils_1 = require("../../../utils"); | ||
exports.Item = Item; | ||
var Inputs = function () { return react_1.default.createElement(react_1.default.Fragment, null, | ||
var Inputs = function () { return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("div", { className: 'panel-title' }, "\u8F93\u5165"), | ||
@@ -30,0 +50,0 @@ react_1.default.createElement("div", { className: 'panel-content uform-editor-item' }, |
@@ -1,6 +0,6 @@ | ||
import React from 'react'; | ||
import type { FC } from 'react'; | ||
import type { FixField } from '../../schema'; | ||
export declare const InputSelector: React.FC<{ | ||
export declare const InputSelector: FC<{ | ||
field: FixField; | ||
onChange: (type: string) => void; | ||
}>; |
@@ -67,2 +67,3 @@ "use strict"; | ||
var inputs_1 = require("../../inputs"); | ||
var Const_1 = require("../../../utils/Const"); | ||
var index_1 = require("../../../index"); | ||
@@ -117,3 +118,3 @@ var Inputs_1 = require("./Inputs"); | ||
if (inputs.length == 0) | ||
return react_1.default.createElement(react_1.default.Fragment, null); | ||
return Const_1.NONE; | ||
return react_1.default.createElement(index_1.Collapse.Panel, { key: group.title, header: group.title }, | ||
@@ -120,0 +121,0 @@ react_1.default.createElement("ul", null, inputs.map(function (item) { return react_1.default.createElement("li", { className: item.type == currentType ? 'uform-editor-item-field-active' : undefined, key: item.type, onClick: function () { return setCurrentType(item.type); } }, |
@@ -13,2 +13,25 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -18,3 +41,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -73,3 +96,3 @@ var index_1 = require("../../../index"); | ||
var STATUS = extra ? '显示' : '禁用'; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Form.Item, { label: "\u56FD\u9645\u5316\u952E" }, | ||
@@ -76,0 +99,0 @@ react_1.default.createElement(index_1.Input, { size: 'small', value: field.ik, onChange: function (evt) { return setFieldProperties('ik', evt.target.value); } })), |
@@ -59,3 +59,3 @@ "use strict"; | ||
}; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Form.Item, { label: "\u5B57\u6BB5\u540D", required: true }, | ||
@@ -62,0 +62,0 @@ react_1.default.createElement(index_1.Input, { disabled: disabled, size: 'small', value: field.field, onChange: function (evt) { return setFieldProperties('field', evt.target.value); } })), |
@@ -13,7 +13,27 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var plugins_1 = require("../../plugins"); | ||
@@ -24,5 +44,5 @@ var FieldPlugin_1 = require("./Component/FieldPlugin"); | ||
var setFieldProperties = props.setFieldProperties, field = props.field, input = props.input, baseSpan = props.baseSpan; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(Links_1.Links, __assign({}, props)), | ||
react_1.default.createElement(FieldPlugin_1.FieldPlugin, __assign({}, props, { slot: plugins_1.PluginSlot.FIELD_LINK }))); | ||
}); |
@@ -13,7 +13,27 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var index_1 = require("../../../index"); | ||
@@ -30,3 +50,3 @@ var hooks_1 = require("../../../hooks"); | ||
var regexpState = (0, hooks_1.useOpenState)(); | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Form.Item, { label: "\u662F\u5426\u5FC5\u586B" }, | ||
@@ -33,0 +53,0 @@ react_1.default.createElement(index_1.Switch, { size: 'small', checked: field.required, onChange: function (required) { return setFieldProperties('required', required); }, checkedChildren: "\u662F", unCheckedChildren: "\u5426" })), |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,3 +29,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -14,3 +37,3 @@ var useEditor_1 = require("../../hooks/useEditor"); | ||
var _a = editor.form, fields = _a.fields, isGroup = _a.isGroup, groupType = _a.groupType, layout = _a.layout, tip = _a.tip, size = _a.size; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Form.Item, { label: "\u5206\u7EC4\u6A21\u5F0F" }, fields.length > 0 ? react_1.default.createElement(index_1.Popover, { title: "\u5206\u7EC4\u6A21\u5F0F\u8BF4\u660E", content: react_1.default.createElement(index_1.Alert, { message: "\u5982\u679C\u9700\u8981\u5F00\u542F/\u5173\u95ED\u5206\u7EC4\u6A21\u5F0F\uFF0C\u8BF7\u9009\u5220\u9664\u5168\u90E8\u8868\u5355\u5B57\u6BB5", type: "warning" }) }, | ||
@@ -17,0 +40,0 @@ react_1.default.createElement(index_1.Switch, { checked: isGroup, checkedChildren: "\u5F00\u542F", unCheckedChildren: "\u5173\u95ED", size: "small", disabled: true })) : react_1.default.createElement(index_1.Switch, { checked: isGroup, checkedChildren: "\u5F00\u542F", unCheckedChildren: "\u5173\u95ED", onChange: function (isGroup) { return editor.setFormProperties({ isGroup: isGroup }); }, size: "small" })), |
@@ -1,3 +0,3 @@ | ||
import React from 'react'; | ||
import { PluginSlot } from '../../../plugins'; | ||
import type { FC } from 'react'; | ||
import type { ItemPanelProps } from '../_util'; | ||
@@ -11,3 +11,3 @@ /** | ||
}; | ||
export declare const FieldPlugin: React.FC<PluginProps>; | ||
export declare const FieldPlugin: FC<PluginProps>; | ||
export {}; |
@@ -36,5 +36,5 @@ "use strict"; | ||
return utils_1.Const.NONE; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Divider, { orientation: "left" }, "\u6269\u5C55\u5C5E\u6027")); | ||
}; | ||
exports.FieldPlugin = FieldPlugin; |
@@ -1,5 +0,5 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { UModalProps } from '../../../../index'; | ||
import type { FormItem, FormGroup } from "../../../schema"; | ||
export declare const LinkAsyncFunction: React.FC<Omit<UModalProps, 'fields'> & { | ||
export declare const LinkAsyncFunction: FC<Omit<UModalProps, 'fields'> & { | ||
field: FormItem; | ||
@@ -6,0 +6,0 @@ fields: (FormItem[]) | (FormGroup[]); |
@@ -34,3 +34,3 @@ "use strict"; | ||
var index_1 = require("../../../../index"); | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.default.Fragment, null, | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("h5", null, "\u793A\u4F8B\u4EE3\u78011\uFF0C\u6570\u5B57\u7C7B\u578B"), | ||
@@ -37,0 +37,0 @@ react_1.default.createElement("pre", { style: { border: '1px solid #ccc', padding: '6px 12px 2px', backgroundColor: '#f1e8af' }, dangerouslySetInnerHTML: { |
@@ -76,3 +76,3 @@ "use strict"; | ||
var delLink = (0, react_1.useCallback)(function (data) { return setFieldProperties('_links', utils_1.ArrayUtil.del(field._links, data.id)); }, [field._links]); | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.STable, { list: field._links || [], actionBar: [ | ||
@@ -79,0 +79,0 @@ { |
@@ -1,5 +0,5 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { UModalProps } from '../../../../index'; | ||
import type { FormItem, FormGroup } from "../../../schema"; | ||
export declare const LinkSyncFunction: React.FC<Omit<UModalProps, 'fields'> & { | ||
export declare const LinkSyncFunction: FC<Omit<UModalProps, 'fields'> & { | ||
field: FormItem; | ||
@@ -6,0 +6,0 @@ fields: (FormItem[]) | (FormGroup[]); |
@@ -34,3 +34,3 @@ "use strict"; | ||
var index_1 = require("../../../../index"); | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.default.Fragment, null, | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("h5", null, "\u793A\u4F8B\u4EE3\u78011\uFF0C\u6570\u5B57\u7C7B\u578B"), | ||
@@ -37,0 +37,0 @@ react_1.default.createElement("pre", { style: { border: '1px solid #ccc', padding: '6px 12px 2px', backgroundColor: '#f1e8af' }, dangerouslySetInnerHTML: { |
@@ -13,2 +13,25 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __values = (this && this.__values) || function(o) { | ||
@@ -25,8 +48,5 @@ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OptionTable = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var utils_1 = require("../../../../utils"); | ||
@@ -142,3 +162,3 @@ var index_1 = require("../../../../index"); | ||
}; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Divider, { orientation: "left" }, "\u9009\u9879"), | ||
@@ -145,0 +165,0 @@ !Const_1.MUST_STRING.has(field.type) && react_1.default.createElement(index_1.Form.Item, { label: "\u6570\u5B57" }, |
@@ -1,5 +0,5 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { ModalProps } from '../../../../index'; | ||
export declare const RegexpModal: React.FC<ModalProps & { | ||
export declare const RegexpModal: FC<ModalProps & { | ||
data: string; | ||
}>; |
@@ -71,3 +71,3 @@ "use strict"; | ||
}, [field._rules]); | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Divider, { orientation: "left" }, "\u65B9\u6CD5\u9A8C\u8BC1"), | ||
@@ -74,0 +74,0 @@ react_1.default.createElement(index_1.STable, { list: field._rules || [], actionBar: [ |
@@ -1,3 +0,3 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { UModalProps } from '../../../../index'; | ||
export declare const ValidateAsyncFunction: React.FC<Omit<UModalProps, 'fields'>>; | ||
export declare const ValidateAsyncFunction: FC<Omit<UModalProps, 'fields'>>; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,7 +30,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.ValidateAsyncFunction = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var dayjs_1 = __importDefault(require("dayjs")); | ||
var index_1 = require("../../../../index"); | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.default.Fragment, null, | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("h5", null, "\u5224\u65AD\u54CD\u5E94"), | ||
@@ -14,0 +37,0 @@ react_1.default.createElement("pre", { style: { border: '1px solid #ccc', padding: '6px 12px 2px', backgroundColor: '#f1e8af' }, dangerouslySetInnerHTML: { |
@@ -1,3 +0,3 @@ | ||
import React from "react"; | ||
import type { FC } from 'react'; | ||
import type { UModalProps } from '../../../../index'; | ||
export declare const ValidateSyncFunction: React.FC<Omit<UModalProps, 'fields'>>; | ||
export declare const ValidateSyncFunction: FC<Omit<UModalProps, 'fields'>>; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,3 +30,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.ValidateSyncFunction = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
var react_1 = __importStar(require("react")); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
@@ -13,3 +36,3 @@ var dayjs_1 = __importDefault(require("dayjs")); | ||
var Const_1 = require("../../../utils/Const"); | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.default.Fragment, null, | ||
var CodeTip = function () { return react_1.default.createElement(index_1.Popover, { overlayStyle: { width: 540 }, content: react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement("h5", null, "\u793A\u4F8B\u4EE3\u78011\uFF0C\u6570\u5B57\u7C7B\u578B"), | ||
@@ -16,0 +39,0 @@ react_1.default.createElement("pre", { style: { border: '1px solid #ccc', padding: '6px 12px 2px', backgroundColor: '#f1e8af' }, dangerouslySetInnerHTML: { |
@@ -67,3 +67,3 @@ "use strict"; | ||
var _a = __read((0, react_1.useState)('1'), 2), tab = _a[0], setTab = _a[1]; | ||
return react_1.default.createElement(react_1.default.Fragment, null, | ||
return react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(index_1.Tabs, { onChange: setTab, activeKey: tab }, | ||
@@ -70,0 +70,0 @@ react_1.default.createElement(index_1.Tabs.TabPane, { tab: "\u57FA\u7840", key: "1" }), |
@@ -190,3 +190,3 @@ "use strict"; | ||
}; | ||
var convertFields = function (fields, def) { return fields.map(function (item) { | ||
var convertFields = function (fields, defaultValue) { return fields.map(function (item) { | ||
var field = { field: item.field, title: item.title, type: item.type }; | ||
@@ -196,7 +196,7 @@ if (lodash_1.default.has(item, '_default')) { | ||
if (!isNaN(item._default)) { | ||
def[item.field] = parseInt(item._default); | ||
defaultValue[item.field] = parseInt(item._default); | ||
} | ||
} | ||
else { | ||
def[item.field] = item._default; | ||
defaultValue[item.field] = item._default; | ||
} | ||
@@ -291,3 +291,3 @@ } | ||
}); }; | ||
var convertGroups = function (groups, def) { return groups.map(function (group) { return ({ title: group.title, fields: convertFields(group.fields, def) }); }); }; | ||
var convertGroups = function (groups, defaultValue) { return groups.map(function (group) { return ({ title: group.title, fields: convertFields(group.fields, defaultValue) }); }); }; | ||
var schemaToForm = function (schema) { | ||
@@ -305,17 +305,17 @@ var uformProps = { | ||
uformProps.layout = schema.layout; | ||
var def = {}; | ||
var defaultValue = {}; | ||
if (schema.isGroup) { | ||
if (schema.groupType) | ||
uformProps.groupType = schema.groupType; | ||
uformProps.fields = convertGroups(schema.fields, def); | ||
uformProps.fields = convertGroups(schema.fields, defaultValue); | ||
} | ||
else { | ||
uformProps.fields = convertFields(schema.fields, def); | ||
uformProps.fields = convertFields(schema.fields, defaultValue); | ||
} | ||
if (schema.size) | ||
uformProps.size = schema.size; | ||
if (lodash_1.default.keys(def).length > 0) | ||
uformProps.default = def; | ||
if (lodash_1.default.keys(defaultValue).length > 0) | ||
uformProps.default = defaultValue; | ||
return uformProps; | ||
}; | ||
exports.schemaToForm = schemaToForm; |
@@ -5,7 +5,7 @@ export declare const set: (key: string, value: any) => void; | ||
*/ | ||
export declare const getData: <T extends object = any>(key: string, def?: T) => any; | ||
export declare const getData: <T extends object = any>(key: string, defaultValue?: T) => any; | ||
/** | ||
* 获取 Session 缓存, 并以 String 返回 | ||
*/ | ||
export declare const getString: (key: string, def?: string) => string; | ||
export declare const getString: (key: string, defaultValue?: string) => string; | ||
/** | ||
@@ -17,6 +17,6 @@ * 获取 Session 缓存,并以 Boolean 值返回 | ||
*/ | ||
export declare const getBoolean: (key: string, def?: boolean) => boolean; | ||
export declare const getBoolean: (key: string, defaultValue?: boolean) => boolean; | ||
/** | ||
* 获取 Session 缓存, 并以 Integer 返回 | ||
*/ | ||
export declare const getInteger: (key: string, def?: number) => number; | ||
export declare const getInteger: (key: string, defaultValue?: number) => number; |
@@ -36,7 +36,7 @@ "use strict"; | ||
*/ | ||
var getData = function (key, def) { | ||
if (def === void 0) { def = null; } | ||
var getData = function (key, defaultValue) { | ||
if (defaultValue === void 0) { defaultValue = null; } | ||
var value = SESSION.getItem(key); | ||
if (value === null) | ||
return def; | ||
return defaultValue; | ||
try { | ||
@@ -47,3 +47,3 @@ return JSON.parse(value); | ||
console.error('Invalidate JSON : ' + value); | ||
return def; | ||
return defaultValue; | ||
} | ||
@@ -55,5 +55,5 @@ }; | ||
*/ | ||
var getString = function (key, def) { | ||
if (def === void 0) { def = ''; } | ||
return get(key) || def; | ||
var getString = function (key, defaultValue) { | ||
if (defaultValue === void 0) { defaultValue = ''; } | ||
return get(key) || defaultValue; | ||
}; | ||
@@ -67,7 +67,7 @@ exports.getString = getString; | ||
*/ | ||
var getBoolean = function (key, def) { | ||
if (def === void 0) { def = false; } | ||
var getBoolean = function (key, defaultValue) { | ||
if (defaultValue === void 0) { defaultValue = false; } | ||
var value = SESSION.getItem(key); | ||
if (value === null) | ||
return def; | ||
return defaultValue; | ||
var txt = lodash_1.default.toLower(lodash_1.default.trim(value)); | ||
@@ -78,3 +78,3 @@ if (_Support_1.TRUE_SET.has(txt)) | ||
return false; | ||
return def; | ||
return defaultValue; | ||
}; | ||
@@ -85,7 +85,7 @@ exports.getBoolean = getBoolean; | ||
*/ | ||
var getInteger = function (key, def) { | ||
if (def === void 0) { def = 0; } | ||
var getInteger = function (key, defaultValue) { | ||
if (defaultValue === void 0) { defaultValue = 0; } | ||
var value = SESSION.getItem(key); | ||
if (value === null) | ||
return def; | ||
return defaultValue; | ||
try { | ||
@@ -95,5 +95,5 @@ return parseInt(value); | ||
catch (_a) { | ||
return def; | ||
return defaultValue; | ||
} | ||
}; | ||
exports.getInteger = getInteger; |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import type { ReactElement } from 'react'; | ||
import type { AjaxOptions } from './Ajax'; | ||
@@ -9,3 +9,4 @@ /** | ||
*/ | ||
export declare const NONE: React.ReactElement<any, any>; | ||
export declare const NONE: ReactElement<any, any>; | ||
export declare const DATE_FORMAT = "YYYY-MM-DD HH:mm:ss"; | ||
/** | ||
@@ -12,0 +13,0 @@ * Ajax 不显示进度参数 |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DO_NOT_SHOW_PROCESS = exports.NONE = void 0; | ||
var react_1 = __importDefault(require("react")); | ||
exports.DO_NOT_SHOW_PROCESS = exports.DATE_FORMAT = exports.NONE = void 0; | ||
var react_1 = __importStar(require("react")); | ||
/** | ||
@@ -14,3 +34,4 @@ * CONST 存放通用的常量 | ||
*/ | ||
exports.NONE = react_1.default.createElement(react_1.default.Fragment, null); | ||
exports.NONE = react_1.default.createElement(react_1.Fragment, null); | ||
exports.DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss'; | ||
/** | ||
@@ -17,0 +38,0 @@ * Ajax 不显示进度参数 |
@@ -1,2 +0,2 @@ | ||
/// <reference types="react" /> | ||
import type { FC } from 'react'; | ||
import type { PopoverProps } from '../components/_adapt/Popover'; | ||
@@ -220,3 +220,3 @@ import type { DropdownProps } from '../components/_adapt/dropdown'; | ||
} | { | ||
modal: React.FC<{ | ||
modal: FC<{ | ||
open: boolean; | ||
@@ -239,3 +239,3 @@ onCancel: () => void; | ||
} | { | ||
modal: React.FC<{ | ||
modal: FC<{ | ||
open: boolean; | ||
@@ -242,0 +242,0 @@ onCancel: () => void; |
@@ -24,2 +24,3 @@ "use strict"; | ||
var lodash_1 = __importDefault(require("lodash")); | ||
var Const_1 = require("./Const"); | ||
var StringUtil_1 = require("./StringUtil"); | ||
@@ -191,3 +192,3 @@ var dayjs_1 = __importDefault(require("dayjs")); | ||
if (date.isValid()) | ||
return date.format('YYYY-MM-DD HH:mm:ss'); | ||
return date.format(Const_1.DATE_FORMAT); | ||
return ''; | ||
@@ -194,0 +195,0 @@ }; |
@@ -1,4 +0,4 @@ | ||
/// <reference types="react" /> | ||
import { Language } from './_Support'; | ||
export { Language }; | ||
import type { ReactNode } from 'react'; | ||
/** | ||
@@ -25,3 +25,3 @@ * | ||
*/ | ||
type LanguageValue = string | React.ReactNode | ((...args: any[]) => React.ReactNode); | ||
type LanguageValue = string | ReactNode | ((...args: any[]) => ReactNode); | ||
type LanguageItem = Record<string, LanguageValue>; | ||
@@ -55,3 +55,3 @@ /** | ||
export declare const txt: (key: string, ...param: string[]) => string; | ||
export declare const node: (key: string, ...param: any[]) => React.ReactNode; | ||
export declare const node: (key: string, ...param: any[]) => ReactNode; | ||
/** | ||
@@ -58,0 +58,0 @@ * 获取 antd 下的资源文件,需要传 antd 下的路径 |
@@ -1,6 +0,6 @@ | ||
import React from 'react'; | ||
import type { ReactNode } from 'react'; | ||
import type { BaseOption, PlainObject } from '../../basetype'; | ||
export type BaseRenderOptions = { | ||
className?: string; | ||
default?: React.ReactNode; | ||
default?: ReactNode; | ||
onlyText?: boolean; | ||
@@ -28,5 +28,5 @@ bold?: boolean; | ||
cacheKey?: string; | ||
render?: (info: BaseOption) => React.ReactNode; | ||
render?: (info: BaseOption) => ReactNode; | ||
}; | ||
export declare const getValue: (txt: string, options: BaseRenderOptions) => string | React.ReactNode; | ||
export declare const getValue: (txt: string, options: BaseRenderOptions) => string | ReactNode; | ||
export type OptionConvertConfig = { | ||
@@ -38,5 +38,5 @@ shift?: BaseOption | true; | ||
export interface Render { | ||
(value: string | number, ...args: any[]): (string | React.ReactNode); | ||
getText: (value: string | number | boolean, def?: string) => string; | ||
(value: string | number, ...args: any[]): (string | ReactNode); | ||
getText: (value: string | number | boolean, defaultValue?: string) => string; | ||
} | ||
export declare const getList: (result: any) => PlainObject[]; |
@@ -57,19 +57,14 @@ "use strict"; | ||
var getList = function (result) { | ||
if (lodash_1.default.has(result, 'code')) { | ||
if (result.code != '0') { | ||
return []; | ||
} | ||
if (lodash_1.default.has(result, 'list')) { | ||
return result.list; | ||
} | ||
if (lodash_1.default.has(result, 'data') && lodash_1.default.isArray(result.data)) { | ||
return result.data; | ||
} | ||
if (lodash_1.default.isArray(result)) | ||
return result; | ||
if (!lodash_1.default.isPlainObject(result)) | ||
return []; | ||
} | ||
if (lodash_1.default.isArray(result)) { | ||
return result; | ||
} | ||
if (!lodash_1.default.has(result, 'code') || result.code != '0') | ||
return []; | ||
if (lodash_1.default.has(result, 'list')) | ||
return result.list; | ||
if (lodash_1.default.isArray(result.data)) | ||
return result.data; | ||
return []; | ||
}; | ||
exports.getList = getList; |
import type { ReactNode } from 'react'; | ||
type DictFormartRender = (itemFormat: string, value: string | number, def?: ReactNode) => ReactNode; | ||
type DictFormartRender = (itemFormat: string, value: string | number, defaultValue?: ReactNode) => ReactNode; | ||
export declare const renderTag: DictFormartRender; | ||
@@ -4,0 +4,0 @@ export declare const renderColor: DictFormartRender; |
@@ -16,14 +16,14 @@ "use strict"; | ||
*/ | ||
var getLabel = function (value, def) { | ||
var getLabel = function (value, defaultValue) { | ||
if (typeof value == 'number') | ||
return value + ''; | ||
if (value === undefined || value === null) | ||
return def === undefined ? null : def; | ||
return defaultValue === undefined ? null : defaultValue; | ||
var label = lodash_1.default.trim(value); | ||
if (label == '') | ||
return def === undefined ? null : def; | ||
return defaultValue === undefined ? null : defaultValue; | ||
return label; | ||
}; | ||
var renderTag = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderTag = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -34,4 +34,4 @@ return Const_1.NONE; | ||
exports.renderTag = renderTag; | ||
var renderColor = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderColor = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -42,4 +42,4 @@ return Const_1.NONE; | ||
exports.renderColor = renderColor; | ||
var renderStatus = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderStatus = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -52,4 +52,4 @@ return Const_1.NONE; | ||
exports.renderStatus = renderStatus; | ||
var renderSub = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderSub = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -63,4 +63,4 @@ return Const_1.NONE; | ||
exports.renderSub = renderSub; | ||
var renderSup = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderSup = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -74,4 +74,4 @@ return Const_1.NONE; | ||
exports.renderSup = renderSup; | ||
var renderBadge = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderBadge = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -98,4 +98,4 @@ return Const_1.NONE; | ||
exports.renderBadge = renderBadge; | ||
var renderIcon = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderIcon = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -116,4 +116,4 @@ return Const_1.NONE; | ||
exports.renderIcon = renderIcon; | ||
var renderProgress = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderProgress = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -153,4 +153,4 @@ return Const_1.NONE; | ||
exports.renderProgress = renderProgress; | ||
var renderClazz = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderClazz = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -164,4 +164,4 @@ return Const_1.NONE; | ||
exports.renderClazz = renderClazz; | ||
var renderTip = function (itemFormat, value, def) { | ||
var label = getLabel(value, def); | ||
var renderTip = function (itemFormat, value, defaultValue) { | ||
var label = getLabel(value, defaultValue); | ||
if (label === null) | ||
@@ -168,0 +168,0 @@ return Const_1.NONE; |
@@ -253,7 +253,7 @@ "use strict"; | ||
}; | ||
fn.getText = function (val, def) { | ||
fn.getText = function (val, defaultValue) { | ||
if (API_CACHES.has(CACHE_KEY)) { | ||
var CACHE_MAPPER = API_CACHES.get(CACHE_KEY); | ||
if (CACHE_MAPPER.loaded) { | ||
return CACHE_MAPPER.map.get(val) || (def === undefined ? val : def); | ||
return CACHE_MAPPER.map.get(val) || (defaultValue === undefined ? val : defaultValue); | ||
} | ||
@@ -270,3 +270,3 @@ } | ||
}); | ||
return map.get(val) || (def === undefined ? val : def); | ||
return map.get(val) || (defaultValue === undefined ? val : defaultValue); | ||
}; | ||
@@ -273,0 +273,0 @@ fn.reflush = function () { |
@@ -202,3 +202,3 @@ "use strict"; | ||
}; | ||
fn.getText = function (key, def) { | ||
fn.getText = function (key, defaultValue) { | ||
var _a; | ||
@@ -211,3 +211,3 @@ var result = getInCache(KEY, key); | ||
if (result == false) | ||
return def === undefined ? '' : def; | ||
return defaultValue === undefined ? '' : defaultValue; | ||
return result; | ||
@@ -214,0 +214,0 @@ }; |
@@ -20,13 +20,13 @@ "use strict"; | ||
if (config.className) { | ||
return react_1.default.createElement("span", { className: config.className }, date.format(config.targetFormat || 'YYYY-MM-DD HH:mm:ss')); | ||
return react_1.default.createElement("span", { className: config.className }, date.format(config.targetFormat || Const_1.DATE_FORMAT)); | ||
} | ||
return date.format(config.targetFormat || 'YYYY-MM-DD HH:mm:ss'); | ||
return date.format(config.targetFormat || Const_1.DATE_FORMAT); | ||
}; | ||
fn.getText = function (txt, def) { | ||
fn.getText = function (txt, defaultValue) { | ||
if (txt == null) | ||
return (def || ''); | ||
return (defaultValue || ''); | ||
var date = (0, dayjs_1.default)(txt, config.sourceFormat || undefined); | ||
if (!date.isValid()) | ||
return txt + ''; | ||
return date.format(config.targetFormat || 'YYYY-MM-DD HH:mm:ss'); | ||
return date.format(config.targetFormat || Const_1.DATE_FORMAT); | ||
}; | ||
@@ -33,0 +33,0 @@ return fn; |
@@ -117,12 +117,12 @@ "use strict"; | ||
}; | ||
fn.getText = function (key, def) { | ||
fn.getText = function (key, defaultValue) { | ||
if (key === null) | ||
return lodash_1.default.isString(def) ? def : ''; | ||
return lodash_1.default.isString(defaultValue) ? defaultValue : ''; | ||
var dictInfo = DICT.get(props.dictType); | ||
if (dictInfo == null) | ||
return lodash_1.default.isString(def) ? def : ''; | ||
return lodash_1.default.isString(defaultValue) ? defaultValue : ''; | ||
var dictKey = key + ''; | ||
var idx = lodash_1.default.findIndex(dictInfo.nodes, function (item) { return dictKey == item.value; }); | ||
if (idx < 0) | ||
return lodash_1.default.isString(def) ? def : ''; | ||
return lodash_1.default.isString(defaultValue) ? defaultValue : ''; | ||
return dictInfo.nodes[idx].label; | ||
@@ -137,4 +137,3 @@ }; | ||
var value = lodash_1.default.trim(item.code); | ||
if (value.length > 0) | ||
nodes.push({ label: item.codeValue, value: value, format: item.format }); | ||
nodes.push({ label: item.codeValue, value: value, format: item.format }); | ||
var subChildren = lodash_1.default.filter(dict, function (sub) { return sub.parentType == item.type; }); | ||
@@ -141,0 +140,0 @@ if (subChildren.length > 0) { |
import React from "react"; | ||
import type { CSSProperties } from 'react'; | ||
export declare const fileRender: (fileId: string, fileName?: string) => React.JSX.Element; | ||
type ImgRenderOptions = { | ||
style?: React.CSSProperties; | ||
style?: CSSProperties; | ||
width?: number; | ||
@@ -6,0 +7,0 @@ height?: number; |
@@ -68,6 +68,6 @@ "use strict"; | ||
exports.fileRender = fileRender; | ||
var getUrl = function (link, def) { | ||
var getUrl = function (link, defaultValue) { | ||
if (link == null) { | ||
if (def != null) | ||
return index_1.PageUtil.resolveURL(def); | ||
if (defaultValue != null) | ||
return index_1.PageUtil.resolveURL(defaultValue); | ||
return ''; | ||
@@ -102,3 +102,3 @@ } | ||
} | ||
var def = (option === null || option === void 0 ? void 0 : option.default) || null; | ||
var defaultValue = (option === null || option === void 0 ? void 0 : option.default) || null; | ||
if (lodash_1.default.has(option, 'style')) { | ||
@@ -108,3 +108,3 @@ style = __assign(__assign({}, style), option.style); | ||
return function (link) { | ||
var url = getUrl(link, def); | ||
var url = getUrl(link, defaultValue); | ||
return react_1.default.createElement("img", { src: url, style: style }); | ||
@@ -111,0 +111,0 @@ }; |
@@ -10,1 +10,2 @@ export { ApiGetRender } from './ApiGetRender'; | ||
export { DictRender, DICT } from './DictRender'; | ||
export { conditionRender } from './CondictionRender'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DICT = exports.DictRender = exports.strCopyRender = exports.StrCopyRender = exports.htmlRender = exports.strRender = exports.HTMRender = exports.StrRender = exports.StatusRender = exports.percentRender = exports.chineseRender = exports.usdRender = exports.sizeRender = exports.numberRender = exports.intRender = exports.NumberRender = exports.switchHideRender = exports.switchShowRender = exports.switchDisableRender = exports.switchEnableRender = exports.switchCloseRender = exports.switchOpenRender = exports.switchYesNoRender = exports.ListRender = exports.imgRender = exports.ImgRender = exports.fileRender = exports.dateRender = exports.DateRender = exports.ApiPostRender = exports.ApiGetRender = void 0; | ||
exports.conditionRender = exports.DICT = exports.DictRender = exports.strCopyRender = exports.StrCopyRender = exports.htmlRender = exports.strRender = exports.HTMRender = exports.StrRender = exports.StatusRender = exports.percentRender = exports.chineseRender = exports.usdRender = exports.sizeRender = exports.numberRender = exports.intRender = exports.NumberRender = exports.switchHideRender = exports.switchShowRender = exports.switchDisableRender = exports.switchEnableRender = exports.switchCloseRender = exports.switchOpenRender = exports.switchYesNoRender = exports.ListRender = exports.imgRender = exports.ImgRender = exports.fileRender = exports.dateRender = exports.DateRender = exports.ApiPostRender = exports.ApiGetRender = void 0; | ||
var ApiGetRender_1 = require("./ApiGetRender"); | ||
@@ -44,1 +44,3 @@ Object.defineProperty(exports, "ApiGetRender", { enumerable: true, get: function () { return ApiGetRender_1.ApiGetRender; } }); | ||
Object.defineProperty(exports, "DICT", { enumerable: true, get: function () { return DictRender_1.DICT; } }); | ||
var CondictionRender_1 = require("./CondictionRender"); | ||
Object.defineProperty(exports, "conditionRender", { enumerable: true, get: function () { return CondictionRender_1.conditionRender; } }); |
@@ -16,3 +16,3 @@ "use strict"; | ||
var valueField = 'value'; | ||
var def = null; | ||
var defaultValue = null; | ||
var showValue = false; | ||
@@ -27,3 +27,3 @@ var list; | ||
if (options.default) | ||
def = options.default; | ||
defaultValue = options.default; | ||
if (options.showValue) | ||
@@ -52,4 +52,4 @@ showValue = options.showValue; | ||
if (!MAP.has(key)) { | ||
if (def) | ||
return def; | ||
if (defaultValue) | ||
return defaultValue; | ||
if (showValue) { | ||
@@ -69,10 +69,10 @@ text = value + ''; | ||
}; | ||
fn.getText = function (value, def) { | ||
fn.getText = function (value, defaultValue) { | ||
if (value === null) | ||
return def || ''; | ||
return defaultValue || ''; | ||
var key = lodash_1.default.trim(value + ''); | ||
var text = ''; | ||
if (!MAP.has(key)) { | ||
if (def) | ||
return def; | ||
if (defaultValue) | ||
return defaultValue; | ||
if (showValue) { | ||
@@ -82,3 +82,3 @@ text = value + ''; | ||
else { | ||
return def || ''; | ||
return defaultValue || ''; | ||
; | ||
@@ -85,0 +85,0 @@ } |
@@ -34,6 +34,6 @@ "use strict"; | ||
}; | ||
fn.getText = function (txt, def) { | ||
if (def === void 0) { def = '0'; } | ||
fn.getText = function (txt, defaultValue) { | ||
if (defaultValue === void 0) { defaultValue = '0'; } | ||
if (txt === null) | ||
return def; | ||
return defaultValue; | ||
var num = null; | ||
@@ -45,3 +45,3 @@ if (lodash_1.default.isString(txt)) { | ||
catch (_a) { | ||
return def; | ||
return defaultValue; | ||
} | ||
@@ -48,0 +48,0 @@ } |
@@ -53,3 +53,3 @@ "use strict"; | ||
}; | ||
fn.getText = function (value, def) { | ||
fn.getText = function (value, defaultValue) { | ||
var key = value + ''; | ||
@@ -65,3 +65,3 @@ var info = null; | ||
return info.label; | ||
return def || key; | ||
return defaultValue || key; | ||
}; | ||
@@ -68,0 +68,0 @@ return fn; |
@@ -29,3 +29,3 @@ "use strict"; | ||
}; | ||
fn.getText = function (str, def) { | ||
fn.getText = function (str, defaultValue) { | ||
return str; | ||
@@ -47,3 +47,3 @@ }; | ||
}; | ||
fn.getText = function (str, def) { | ||
fn.getText = function (str, defaultValue) { | ||
return str; | ||
@@ -78,4 +78,4 @@ }; | ||
}; | ||
fn.getText = function (str, def) { | ||
return (str || def); | ||
fn.getText = function (str, defaultValue) { | ||
return (str || defaultValue); | ||
}; | ||
@@ -82,0 +82,0 @@ return fn; |
@@ -107,15 +107,15 @@ import type { MatchPatterns } from './_Support'; | ||
*/ | ||
export declare const getString: (txt: string, def?: string) => string; | ||
export declare const getString: (txt: string, defaultValue?: string) => string; | ||
/** | ||
* 获取布尔值 | ||
*/ | ||
export declare const getBoolean: (key: string, def?: boolean) => boolean; | ||
export declare const getBoolean: (key: string, defaultValue?: boolean) => boolean; | ||
/** | ||
* 获取数字 | ||
*/ | ||
export declare const getInteger: (txt: string, def?: number) => number; | ||
export declare const getInteger: (txt: string, defaultValue?: number) => number; | ||
/** | ||
* 获取浮点数 | ||
*/ | ||
export declare const getFloat: (txt: string, def?: number) => number; | ||
export declare const getFloat: (txt: string, defaultValue?: number) => number; | ||
export declare const getFileName: (uri: string) => string; | ||
@@ -122,0 +122,0 @@ /** |
@@ -268,4 +268,5 @@ "use strict"; | ||
var copy = function (text, onCopied) { | ||
var input = document.createElement('input'); | ||
input.setAttribute('readonly', 'readonly'); // 防止手机上弹出软键盘 | ||
var input = document.createElement('textarea'); | ||
// input.setAttribute('readonly', 'readonly'); // 防止手机上弹出软键盘 | ||
input.value = text; | ||
input.setAttribute('value', text); | ||
@@ -285,7 +286,7 @@ document.body.appendChild(input); | ||
*/ | ||
var getString = function (txt, def) { | ||
var getString = function (txt, defaultValue) { | ||
var result = lodash_1.default.trim(txt); | ||
if (result.length) | ||
return result; | ||
return def || ''; | ||
return defaultValue || ''; | ||
}; | ||
@@ -296,5 +297,5 @@ exports.getString = getString; | ||
*/ | ||
var getBoolean = function (key, def) { | ||
var getBoolean = function (key, defaultValue) { | ||
if (key === null || key === undefined) | ||
return def || false; | ||
return defaultValue || false; | ||
var txt = lodash_1.default.trim(lodash_1.default.toLower(key)); | ||
@@ -305,5 +306,5 @@ if (_Support_1.TRUE_SET.has(txt)) | ||
return false; | ||
if (!lodash_1.default.isBoolean(def)) | ||
if (!lodash_1.default.isBoolean(defaultValue)) | ||
return false; // 默认返回 false | ||
return def || false; | ||
return defaultValue || false; | ||
}; | ||
@@ -314,5 +315,5 @@ exports.getBoolean = getBoolean; | ||
*/ | ||
var getInteger = function (txt, def) { | ||
var getInteger = function (txt, defaultValue) { | ||
if (txt === null || txt === undefined) | ||
return def || 0; | ||
return defaultValue || 0; | ||
try { | ||
@@ -322,3 +323,3 @@ return parseInt(txt); | ||
catch (_a) { | ||
return lodash_1.default.isNumber(def) ? def : 0; | ||
return lodash_1.default.isNumber(defaultValue) ? defaultValue : 0; | ||
} | ||
@@ -330,5 +331,5 @@ }; | ||
*/ | ||
var getFloat = function (txt, def) { | ||
var getFloat = function (txt, defaultValue) { | ||
if (txt === null || txt === undefined) | ||
return def || 0; | ||
return defaultValue || 0; | ||
try { | ||
@@ -338,3 +339,3 @@ return parseFloat(txt); | ||
catch (_a) { | ||
return lodash_1.default.isNumber(def) ? def : 0; | ||
return lodash_1.default.isNumber(defaultValue) ? defaultValue : 0; | ||
} | ||
@@ -341,0 +342,0 @@ }; |
@@ -6,6 +6,6 @@ export type VAP = { | ||
getConfig: (key: string) => string; | ||
getString: (key: string, def?: string) => string; | ||
getBoolean: (key: string, def?: boolean) => boolean; | ||
getInteger: (key: string, def?: number) => number; | ||
getFloat: (key: string, def?: number) => number; | ||
getString: (key: string, defaultValue?: string) => string; | ||
getBoolean: (key: string, defaultValue?: boolean) => boolean; | ||
getInteger: (key: string, defaultValue?: number) => number; | ||
getFloat: (key: string, defaultValue?: number) => number; | ||
}; | ||
@@ -12,0 +12,0 @@ declare const _VAP: VAP; |
@@ -18,45 +18,13 @@ "use strict"; | ||
}, | ||
getString: function (key, def) { | ||
return (0, StringUtil_1.getString)(_VAP.KEYMAP.get(key), def); | ||
getString: function (key, defaultValue) { | ||
return (0, StringUtil_1.getString)(_VAP.KEYMAP.get(key), defaultValue); | ||
}, | ||
getBoolean: function (key, def) { | ||
return (0, StringUtil_1.getBoolean)(_VAP.KEYMAP.get(key), def); | ||
// if (!_VAP.KEYMAP.has(key)) return def || false; | ||
// let txt = _.toLower(_.trim(_VAP.KEYMAP.get(key))); | ||
// if (TRUE_SET.has(txt)) return true; | ||
// if (FALSE_SET.has(txt)) return false; | ||
// if (!_.isBoolean(def)) return false; // 默认返回 false | ||
// return def; | ||
getBoolean: function (key, defaultValue) { | ||
return (0, StringUtil_1.getBoolean)(_VAP.KEYMAP.get(key), defaultValue); | ||
}, | ||
getInteger: function (key, def) { | ||
return (0, StringUtil_1.getInteger)(_VAP.KEYMAP.get(key), def); | ||
// let defReturn = def != undefined ? def : 0; | ||
// if (!_VAP.KEYMAP.has(key)) { | ||
// return defReturn; | ||
// } | ||
// let txt = _VAP.KEYMAP.get(key); | ||
// try { | ||
// let val = parseInt(txt); | ||
// if (val) { | ||
// return val | ||
// } | ||
// } catch { | ||
// return defReturn; | ||
// } | ||
getInteger: function (key, defaultValue) { | ||
return (0, StringUtil_1.getInteger)(_VAP.KEYMAP.get(key), defaultValue); | ||
}, | ||
getFloat: function (key, def) { | ||
return (0, StringUtil_1.getFloat)(_VAP.KEYMAP.get(key), def); | ||
// let defReturn = def != undefined ? def : 0; | ||
// if (!_VAP.KEYMAP.has(key)) { | ||
// return defReturn; | ||
// } | ||
// let txt = _VAP.KEYMAP.get(key); | ||
// try { | ||
// let val = parseFloat(txt); | ||
// if (val) { | ||
// return val | ||
// } | ||
// } catch { | ||
// return defReturn; | ||
// } | ||
getFloat: function (key, defaultValue) { | ||
return (0, StringUtil_1.getFloat)(_VAP.KEYMAP.get(key), defaultValue); | ||
}, | ||
@@ -63,0 +31,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import type { ComponentType } from 'react'; | ||
import type { ComponentType, ReactNode } from 'react'; | ||
/** | ||
@@ -35,2 +35,2 @@ * 自定义小组件 | ||
*/ | ||
export declare const showWidget: (path: string, props?: object) => React.ReactNode; | ||
export declare const showWidget: (path: string, props?: object) => ReactNode; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1409554
548
33366