id
stringlengths
1
6
tokens
sequence
labels
sequence
1100
[ "import", "{", "omit", "}", "from", "'lodash-es'", ";", "import", "React", "from", "'react'", ";", "import", "{", "useImage", ",", "UseImageProps", "}", "from", "'./use-image'", ";", "export", "interface", "ImageProps", "extends", "UseImageProps", "{", "/**\n * 备选图片地址\n */", "fallbackSrc", "?", ":", "string", ";", "/**\n * 备选渲染元素\n */", "fallback", "?", ":", "React", ".", "ReactElement", ";", "/**\n * 图片宽度\n */", "width", "?", ":", "string", ";", "/**\n * 图片高度\n */", "height", "?", ":", "string", ";", "className", "?", ":", "string", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "}", "export", "const", "Image", "=", "React", ".", "forwardRef", "<", "HTMLImageElement", ",", "ImageProps", ">", "(", "(", "props", ",", "ref", ")", ":", "React", ".", "ReactElement", "=>", "{", "const", "{", "src", ",", "fallbackSrc", ",", "fallback", ",", "ignoreFallback", ",", "...", "rest", "}", "=", "props", ";", "const", "status", "=", "useImage", "(", "props", ")", ";", "const", "passed", "=", "{", "ref", ",", "...", "(", "ignoreFallback", "?", "rest", ":", "omit", "(", "rest", ",", "[", "'onError'", ",", "'onLoad'", "]", ")", ")", ",", "}", ";", "if", "(", "status", "!==", "'loaded'", ")", "{", "if", "(", "fallback", ")", "return", "fallback", ";", "return", "<", "img", "src", "=", "{", "fallbackSrc", "}", "{", "...", "passed", "}", "/>;", "}", "return", "<", "img", "src", "=", "{", "src", "}", "{", "...", "passed", "}", "/>;", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1101
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", ",", "{", "forwardRef", "}", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "useTheme", "}", "from", "'../../providers'", ";", "import", "{", "colors", ",", "rgba", "}", "from", "'../../utils'", ";", "import", "{", "Button", "}", "from", "'../button'", ";", "import", "{", "Box", "}", "from", "'../layout'", ";", "import", "{", "Toast", ",", "Toaster", ",", "ToasterProps", ",", "ToastRequest", "}", "from", "'../overlays'", ";", "import", "{", "ToastConfigCommon", "}", "from", "'../overlays/toast'", ";", "const", "AlertHead", "=", "styled", ".", "div", "`\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: var(--rex-fontSizes-body);\n`", ";", "const", "AlertTitle", "=", "styled", ".", "div", "`\n flex: 1;\n display: flex;\n align-items: center;\n\n > svg {\n color: var(--rex-notice-iconColor);\n font-size: 20px;\n }\n`", ";", "const", "AlertExtra", "=", "styled", ".", "div", "`\n display: inline-flex;\n align-items: center;\n\n > * {\n margin-left: var(--rex-space-m);\n }\n`", ";", "const", "AlertContent", "=", "styled", ".", "div", "`\n margin-left: 20px;\n font-size: var(--rex-fontSizes-body);\n`", ";", "function", "getMeta", "(", "status", ")", "{", "return", "(", "{", "error", ":", "[", "'error'", ",", "'colors.red.10'", ",", "'colors.red.50'", "]", ",", "success", ":", "[", "'success'", ",", "'colors.green.10'", ",", "'colors.green.50'", "]", ",", "warning", ":", "[", "'prompt'", ",", "'colors.yellow.10'", ",", "'colors.yellow.50'", "]", ",", "info", ":", "[", "'prompt'", ",", "'colors.primary.10'", ",", "'colors.primary.50'", "]", ",", "}", "[", "status", "]", "||", "status", ")", ";", "}", "export", "interface", "NoticeProps", "{", "/**\n * 状态\n */", "status", ":", "'error'", "|", "'success'", "|", "'warning'", "|", "'info'", ";", "/**\n * 标题\n */", "title", "?", ":", "string", ";", "/**\n * 标题附加内容节点\n */", "extra", "?", ":", "React", ".", "ReactNode", ";", "/**\n * 是否可关闭\n */", "closeable", "?", ":", "boolean", ";", "/**\n * 点击关闭按钮的回调\n */", "onClose", "?", ":", "React", ".", "MouseEventHandler", "<", "HTMLButtonElement", ">", ";", "className", "?", ":", "string", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "children", "?", ":", "React", ".", "ReactNode", ";", "}", "type", "NoticeType", "=", "React", ".", "ForwardRefExoticComponent", "<", "React", ".", "PropsWithoutRef", "<", "NoticeProps", ">", "&", "React", ".", "RefAttributes", "<", "HTMLDivElement", ">", ">", "&", "{", "show", "?", "(", "req", ")", ":", "string", ";", "error", "?", "(", "req", ")", ":", "string", ";", "success", "?", "(", "req", ")", ":", "string", ";", "warning", "?", "(", "req", ")", ":", "string", ";", "info", "?", "(", "req", ")", ":", "string", ";", "config", "?", "(", "nextConfig", ")", ":", "void", ";", "getConfig", "?", "(", ")", ":", "ToastConfigCommon", ";", "close", "?", "(", "key", ")", ":", "void", ";", "closeAll", "?", "(", ")", ":", "void", ";", "useNotice", "?", ":", "typeof", "useNotice", ";", "}", ";", "export", "const", "Notice", "=", "forwardRef", "<", "HTMLDivElement", ",", "NoticeProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "status", ",", "title", ",", "extra", ",", "closeable", ",", "onClose", ",", "style", ":", "styleProp", ",", "className", ",", "children", ",", "...", "rest", "}", "=", "props", ";", "const", "{", "getValue", "}", "=", "useTheme", "(", ")", ";", "const", "[", "icon", ",", "bg", ",", "color", "]", "=", "getMeta", "(", "status", ")", ";", "const", "style", "=", "{", "[", "'--rex-notice-iconColor'", "]", ":", "colors", "(", "color", ")", ",", "...", "styleProp", ",", "}", ";", "const", "bgColor", "=", "rgba", "(", "getValue", "(", "bg", ")", ",", "0.55", ")", ";", "const", "clazz", "=", "cx", "(", "{", "[", "`rex-${", "status", "}`", "]", ":", "status", ",", "}", ",", "className", ")", ";", "return", "(", "<", "Box", "borderRadius", "=", "\"s\"", "p", "=", "\"l\"", "bg", "=", "{", "bgColor", "}", "ref", "=", "{", "ref", "}", "className", "=", "{", "clazz", "}", "style", "=", "{", "style", "}", "{", "...", "rest", "}", ">", "<", "AlertHead", ">", "<", "AlertTitle", ">", "<", "Icon", "type", "=", "{", "icon", "as", "any", "}", "style", "=", "{", "{", "flexShrink", ":", "0", "}", "}", "/>", "{", "title", "&&", "<", "Box", "ml", "=", "\"m\"", ">", "{", "title", "}", "<", "/Box>}", "<", "/AlertTitle>", "<", "AlertExtra", ">", "{", "extra", "}", "{", "closeable", "&&", "(", "<", "Button", "shape", "=", "\"text\"", "size", "=", "\"small\"", "iconOnly", "onClick", "=", "{", "onClose", "}", ">", "<", "Icon", "type", "=", "\"close\"", "/", ">", "<", "/Button>)}", "<", "/AlertExtra>", "<", "/AlertHead>", "{", "children", "&&", "<", "AlertContent", ">", "{", "children", "}", "<", "/AlertContent>}", "<", "/Box>);", "}", ")", ";", "type", "NoticeToastRequest", "=", "Omit", "<", "ToastRequest", ",", "'content'", "|", "'renderContent'", ">", "&", "Partial", "<", "NoticeProps", ">", ";", "function", "showNoticeFactory", "(", "toaster", ",", "predefinedStatus", "?", ")", "{", "return", "(", "req", ")", "=>", "{", "return", "toaster", ".", "show", "(", "{", "...", "req", ",", "renderContent", "(", "{", "ref", ",", "...", "eventHandlers", "}", ",", "{", "close", "}", ")", "{", "return", "(", "<", "Toast", ".", "Panel", "ref", "=", "{", "ref", "as", "React", ".", "Ref", "<", "HTMLDivElement", ">", "}", "{", "...", "eventHandlers", "}", "style", "=", "{", "{", "padding", ":", "0", ",", "...", "req", ".", "style", "}", "}", "className", "=", "{", "req", ".", "className", "}", ">", "<", "Notice", "style", "=", "{", "{", "borderRadius", ":", "0", "}", "}", "status", "=", "{", "predefinedStatus", "??", "req", ".", "status", "}", "title", "=", "{", "req", ".", "title", "}", "extra", "=", "{", "req", ".", "extra", "}", "closeable", "=", "{", "req", ".", "closeable", "}", "onClose", "=", "{", "close", "}", "/", ">", "<", "/Toast.Panel>);", "}", ",", "}", ")", ";", "}", ";", "}", "Notice", ".", "show", "=", "showNoticeFactory", "(", "Toaster", ")", ";", "Notice", ".", "error", "=", "showNoticeFactory", "(", "Toaster", ",", "'error'", ")", ";", "Notice", ".", "success", "=", "showNoticeFactory", "(", "Toaster", ",", "'success'", ")", ";", "Notice", ".", "warning", "=", "showNoticeFactory", "(", "Toaster", ",", "'warning'", ")", ";", "Notice", ".", "info", "=", "showNoticeFactory", "(", "Toaster", ",", "'info'", ")", ";", "Notice", ".", "config", "=", "Toaster", ".", "config", ";", "Notice", ".", "getConfig", "=", "Toaster", ".", "getConfig", ";", "Notice", ".", "close", "=", "Toaster", ".", "close", ";", "Notice", ".", "closeAll", "=", "Toaster", ".", "closeAll", ";", "Notice", ".", "useNotice", "=", "useNotice", ";", "function", "useNotice", "(", "toasterProps", "=", "{", "}", ")", "{", "const", "[", "toaster", ",", "contextHolder", "]", "=", "Toaster", ".", "useToaster", "(", "toasterProps", ")", ";", "const", "notice", "=", "{", "show", ":", "showNoticeFactory", "(", "toaster", ",", "undefined", ")", ",", "error", ":", "showNoticeFactory", "(", "toaster", ",", "'error'", ")", ",", "success", ":", "showNoticeFactory", "(", "toaster", ",", "'success'", ")", ",", "warning", ":", "showNoticeFactory", "(", "toaster", ",", "'warning'", ")", ",", "info", ":", "showNoticeFactory", "(", "toaster", ",", "'info'", ")", ",", "close", ":", "toaster", ".", "close", ",", "closeAll", ":", "toaster", ".", "closeAll", ",", "}", ";", "return", "[", "notice", ",", "contextHolder", "]", "as", "const", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 25949, null, null, null, null, null, null, null, 25949, null, null, null, null, null, null, null, 25949, null, null, null, null, null, null, null, 25949, null, null, null, null, null, null, null, 20, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1102
[ "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "StringOrNumber", "}", "from", "'../../types'", ";", "import", "{", "Box", "}", "from", "'../layout'", ";", "import", "{", "useTabsContext", "}", "from", "'./context'", ";", "const", "TabPaneBox", "=", "styled", "<", "any", ">", "(", "Box", ")", "`\n flex: ${", "(", "props", ")", "=>", "props", ".", "$flex", "};\n position: relative;\n user-select: none;\n cursor: pointer;\n text-align: center;\n padding: var(--rex-space-l) var(--rex-space-xl);\n font-size: var(--rex-fontSizes-body);\n color: var(--rex-colors-text-body);\n\n &:hover {\n background-color: var(--rex-colors-emphasis-10);\n }\n\n &.rex-active {\n color: var(--rex-colors-brand-normal);\n font-weight: bold;\n }\n\n &.rex-disabled {\n color: var(--rex-colors-text-disabled);\n pointer-events: none;\n }\n`", ";", "export", "interface", "TabPaneProps", "extends", "TabProps", "{", "flex", "?", ":", "StringOrNumber", ";", "}", "export", "const", "TabPane", "=", "React", ".", "forwardRef", "<", "HTMLLIElement", ",", "TabPaneProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "title", ",", "selected", ",", "disabled", ",", "flex", ",", "...", "rest", "}", "=", "props", ";", "const", "clazz", "=", "cx", "(", "{", "'rex-tab'", ":", "true", ",", "'rex-active'", ":", "selected", ",", "'rex-disabled'", ":", "disabled", ",", "}", ")", ";", "return", "(", "<", "TabPaneBox", "as", "=", "\"li\"", "ref", "=", "{", "ref", "}", "className", "=", "{", "clazz", "}", "$flex", "=", "{", "flex", "}", "{", "...", "rest", "}", ">", "{", "title", "}", "<", "/TabPaneBox>);", "}", ")", ";", "export", "interface", "TabProps", "{", "/**\n * 唯一标识符\n */", "value", "?", ":", "string", ";", "/**\n * 标题\n */", "title", "?", ":", "React", ".", "ReactNode", ";", "/**\n * 是否选中\n */", "selected", "?", ":", "boolean", ";", "/**\n * 是否禁用\n */", "disabled", "?", ":", "boolean", ";", "children", "?", ":", "any", ";", "}", "export", "function", "Tab", "(", "props", ")", "{", "const", "{", "value", ",", "selected", ":", "selectedProp", ",", "children", "}", "=", "props", ";", "const", "tabs", "=", "useTabsContext", "(", ")", ";", "let", "selected", "=", "selectedProp", ";", "if", "(", "tabs", "&&", "tabs", ".", "value", ")", "{", "selected", "=", "tabs", ".", "value", "===", "value", ";", "}", "if", "(", "!", "selected", ")", "{", "return", "null", ";", "}", "return", "<", "Box", "as", "=", "\"section\"", ">", "{", "children", "}", "<", "/Box>;", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 5684, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1103
[ "import", "cx", "from", "'classnames'", ";", "import", "{", "omit", "}", "from", "'lodash-es'", ";", "import", "React", ",", "{", "useEffect", ",", "useMemo", ",", "useRef", ",", "useState", "}", "from", "'react'", ";", "import", "{", "useControllableState", "}", "from", "'../../hooks'", ";", "import", "{", "isNull", "}", "from", "'../../utils'", ";", "import", "{", "TabProps", "}", "from", "'./tab'", ";", "type", "Direction", "=", "'column'", "|", "'row'", ";", "const", "getFirstValidValue", "=", "(", "list", "=", "[", "]", ")", "=>", "{", "let", "value", ";", "for", "(", "const", "item", "of", "list", ")", "{", "if", "(", "item", "&&", "'value'", "in", "item", "&&", "!", "item", ".", "disabled", ")", "{", "value", "=", "item", ".", "value", ";", "break", ";", "}", "}", "return", "value", ";", "}", ";", "const", "scrollToTab", "=", "(", "listNode", ",", "activeTabNode", ",", "direction", ")", "=>", "{", "if", "(", "!", "listNode", "||", "!", "activeTabNode", "||", "typeof", "listNode", ".", "scrollTo", "!==", "'function'", ")", "{", "return", ";", "}", "const", "nodeWidthProp", "=", "direction", "===", "'row'", "?", "'clientWidth'", ":", "'clientHeight'", ";", "const", "nodeOffsetProp", "=", "direction", "===", "'row'", "?", "'offsetLeft'", ":", "'offsetTop'", ";", "const", "nodeScrollProp", "=", "direction", "===", "'row'", "?", "'scrollLeft'", ":", "'scrollTop'", ";", "const", "listWidth", "=", "listNode", "[", "nodeWidthProp", "]", ";", "const", "listScrollLeft", "=", "listNode", "[", "nodeScrollProp", "]", ";", "const", "currentOffsetLeft", "=", "activeTabNode", "[", "nodeOffsetProp", "]", ";", "const", "currentWidth", "=", "activeTabNode", "[", "nodeWidthProp", "]", ";", "const", "isLeftInView", "=", "currentOffsetLeft", ">", "listScrollLeft", ";", "const", "isRightInView", "=", "currentWidth", "+", "currentOffsetLeft", "<", "listWidth", "+", "listScrollLeft", ";", "const", "isInView", "=", "isLeftInView", "&&", "isRightInView", ";", "if", "(", "!", "isInView", ")", "{", "const", "distance", "=", "!", "isLeftInView", "?", "listScrollLeft", "-", "currentWidth", ":", "listScrollLeft", "+", "currentWidth", ";", "listNode", ".", "scrollTo", "(", "{", "top", ":", "0", ",", "left", ":", "distance", ",", "behavior", ":", "'smooth'", ",", "}", ")", ";", "}", "}", ";", "export", "interface", "UseTabsProps", "{", "/**\n * 默认选中的 tab\n */", "defaultValue", "?", ":", "string", ";", "/**\n * 受控选中的 tab\n */", "value", "?", ":", "string", ";", "/**\n * 选项卡切换时的回调\n */", "onChange", "?", ":", "(", "nextValue", ":", "string", ")", "=>", "void", ";", "/**\n * 对于较小视图,实现满屏等宽效果(仅作用于水平模式)\n */", "fill", "?", ":", "boolean", ";", "/**\n * 选项卡方向\n */", "direction", "?", ":", "Direction", ";", "className", "?", ":", "string", ";", "children", "?", ":", "any", ";", "}", "export", "function", "useTabs", "(", "props", ",", "tabsRef", ")", "{", "const", "{", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "children", ",", "fill", ",", "direction", "=", "'row'", ",", "className", "}", "=", "props", ";", "const", "[", "scrollbarStyle", ",", "setScollbarStyle", "]", "=", "useState", "<", "any", ">", "(", ")", ";", "const", "activeRef", "=", "useRef", "<", "HTMLLIElement", ">", "(", ")", ";", "const", "tabs", "=", "useMemo", "(", "(", ")", "=>", "{", "const", "list", "=", "[", "]", ";", "React", ".", "Children", ".", "forEach", "(", "children", ",", "(", "child", ")", "=>", "{", "if", "(", "child", ")", "{", "list", ".", "push", "(", "omit", "(", "child", ".", "props", ",", "[", "'children'", "]", ")", ")", ";", "}", "}", ")", ";", "return", "list", ";", "}", ",", "[", "children", "]", ")", ";", "const", "[", "value", ",", "updateValue", "]", "=", "useControllableState", "<", "any", ">", "(", "{", "value", ":", "valueProp", ",", "defaultValue", ":", "(", ")", "=>", "{", "if", "(", "isNull", "(", "defaultValue", ")", ")", "{", "return", "getFirstValidValue", "(", "tabs", ")", "as", "string", ";", "}", "return", "defaultValue", ";", "}", ",", "onChange", ",", "}", ")", ";", "useEffect", "(", "(", ")", "=>", "{", "if", "(", "activeRef", ".", "current", ")", "{", "const", "widthProp", "=", "direction", "===", "'row'", "?", "'offsetWidth'", ":", "'offsetHeight'", ";", "const", "offsetProp", "=", "direction", "===", "'row'", "?", "'offsetLeft'", ":", "'offsetTop'", ";", "setScollbarStyle", "(", "{", "'--rex-tabs-scrollbar-width'", ":", "`${", "activeRef", ".", "current", "[", "widthProp", "]", "}px`", ",", "'--rex-tabs-scrollbar-offset'", ":", "`${", "activeRef", ".", "current", "[", "offsetProp", "]", "}px`", ",", "}", ")", ";", "scrollToTab", "(", "tabsRef", ".", "current", ",", "activeRef", ".", "current", ",", "direction", ")", ";", "}", "}", ",", "[", "value", ",", "tabsRef", ",", "direction", "]", ")", ";", "const", "tabPropsList", "=", "useMemo", "(", "(", ")", "=>", "{", "return", "tabs", ".", "map", "(", "(", "item", ")", "=>", "{", "const", "selected", "=", "item", ".", "selected", "||", "value", "===", "item", ".", "value", ";", "return", "{", "...", "item", ",", "ref", ":", "selected", "?", "activeRef", ":", "undefined", ",", "selected", ",", "flex", ":", "fill", "?", "'1 0 auto'", ":", "'0 0 auto'", ",", "onClick", ":", "(", ")", "=>", "{", "if", "(", "item", ".", "value", "!==", "value", ")", "{", "updateValue", "(", "item", ".", "value", ")", ";", "}", "}", ",", "}", ";", "}", ")", ";", "}", ",", "[", "tabs", ",", "fill", ",", "value", ",", "updateValue", "]", ")", ";", "const", "rootProps", "=", "{", "className", ":", "cx", "(", "{", "'rex-tabs'", ":", "true", ",", "[", "`rex-${", "direction", "}`", "]", ":", "direction", ",", "}", ",", "className", ")", ",", "}", ";", "const", "dividerProps", "=", "{", "style", ":", "scrollbarStyle", ",", "}", ";", "const", "context", "=", "{", "value", ",", "}", ";", "return", "{", "tabPropsList", ",", "dividerProps", ",", "rootProps", ",", "context", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, 2305, null, 750, null, 485, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, 823, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 35, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, 5684, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1104
[ "import", "React", ",", "{", "useRef", "}", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "Box", "}", "from", "'../layout'", ";", "import", "{", "useTabs", ",", "UseTabsProps", "}", "from", "'./use-tabs'", ";", "import", "{", "TabPane", "}", "from", "'./tab'", ";", "import", "{", "TabsProvider", "}", "from", "'./context'", ";", "const", "TabsBar", "=", "styled", "(", "Box", ")", "`\n position: relative;\n overflow-x: auto;\n\n /* Hide Scrollbar */\n -ms-overflow-style: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n`", ";", "const", "TabsList", "=", "styled", "(", "Box", ")", "<", "any", ">", "`\n position: relative;\n display: flex;\n list-style: none;\n margin: 0;\n padding: 0;\n`", ";", "const", "TabsDivider", "=", "styled", "(", "Box", ")", "`\n position: relative;\n bottom: 1px;\n left: 0;\n right: 0;\n height: 1px;\n background-color: var(--rex-colors-line-divider);\n`", ";", "const", "TabsActiveBar", "=", "styled", "(", "Box", ")", "`\n height: 2px;\n width: var(--rex-tabs-scrollbar-width);\n background-color: var(--rex-colors-brand-normal);\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n position: absolute;\n z-index: 1;\n bottom: 0;\n left: var(--rex-tabs-scrollbar-offset);\n`", ";", "export", "interface", "TabsProps", "extends", "UseTabsProps", "{", "}", "export", "function", "Tabs", "(", "props", ")", "{", "const", "{", "direction", "}", "=", "props", ";", "if", "(", "direction", "===", "'column'", ")", "{", "return", "<", "ColumnTabs", "{", "...", "props", "}", "/", ">", ";", "}", "return", "<", "RowsTabs", "{", "...", "props", "}", "/", ">", ";", "}", "function", "RowsTabs", "(", "props", ")", "{", "const", "{", "children", "}", "=", "props", ";", "const", "tabsRef", "=", "useRef", "(", ")", ";", "const", "{", "tabPropsList", ",", "dividerProps", ",", "rootProps", ",", "context", "}", "=", "useTabs", "(", "props", ",", "tabsRef", ")", ";", "return", "(", "<", "TabsProvider", "value", "=", "{", "context", "}", ">", "<", "Box", "{", "...", "rootProps", "}", ">", "<", "TabsBar", "ref", "=", "{", "tabsRef", "}", "className", "=", "\"rex-tabs-bar\"", ">", "<", "TabsList", "as", "=", "\"ul\"", ">", "{", "tabPropsList", ".", "map", "(", "(", "tab", ")", "=>", "(", "<", "TabPane", "key", "=", "{", "tab", ".", "value", "}", "{", "...", "tab", "}", "/", ">", ")", ")", "}", "<", "/TabsList>", "<", "TabsActiveBar", "{", "...", "dividerProps", "}", "/>", "<", "/TabsBar>", "<", "TabsDivider", "/", ">", "<", "Box", ">", "{", "children", "}", "<", "/Box>", "<", "/Box>", "<", "/TabsProvider>);", "}", "const", "ColumnTabsBox", "=", "styled", ".", "div", "`\n position: relative;\n display: flex;\n overflow-y: auto;\n`", ";", "const", "ColumnTabsList", "=", "styled", ".", "div", "`\n position: relative;\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: 0;\n`", ";", "const", "ColumnTabsDivider", "=", "styled", "(", "Box", ")", "`\n position: relative;\n left: -1px;\n top: 0;\n bottom: 0;\n width: 1px;\n background-color: var(--rex-colors-line-divider);\n`", ";", "const", "ColumnTabsActiveBar", "=", "styled", "(", "Box", ")", "`\n width: 2px;\n height: var(--rex-tabs-scrollbar-width);\n background-color: var(--rex-colors-brand-normal);\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n position: absolute;\n z-index: 1;\n right: 0;\n top: var(--rex-tabs-scrollbar-offset);\n`", ";", "function", "ColumnTabs", "(", "props", ")", "{", "const", "{", "children", "}", "=", "props", ";", "const", "tabsRef", "=", "useRef", "(", ")", ";", "const", "{", "tabPropsList", ",", "dividerProps", ",", "rootProps", ",", "context", "}", "=", "useTabs", "(", "props", ",", "tabsRef", ")", ";", "return", "(", "<", "TabsProvider", "value", "=", "{", "context", "}", ">", "<", "ColumnTabsBox", "{", "...", "rootProps", "}", ">", "<", "Box", "ref", "=", "{", "tabsRef", "}", "position", "=", "\"relative\"", "className", "=", "\"rex-tabs-bar\"", ">", "<", "ColumnTabsList", "as", "=", "\"ul\"", ">", "{", "tabPropsList", ".", "map", "(", "(", "tab", ")", "=>", "(", "<", "TabPane", "key", "=", "{", "tab", ".", "value", "}", "{", "...", "tab", "}", "/", ">", ")", ")", "}", "<", "/ColumnTabsList>", "<", "ColumnTabsActiveBar", "{", "...", "dividerProps", "}", "/>", "<", "/Box>", "<", "ColumnTabsDivider", "/", ">", "<", "Box", "flex", "=", "\"1\"", ">", "{", "children", "}", "<", "/Box>", "<", "/ColumnTabsBox>", "<", "/TabsProvider>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 6312, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 6312, null, null, null, null, null, null, null, null, null, null, 35, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 9, null, 6312, null, null, null, null, null, null, null, null, null, null, 35, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1105
[ "import", "{", "toNumber", "}", "from", "'lodash-es'", ";", "import", "{", "StringOrNumber", "}", "from", "'../types'", ";", "type", "LocaleType", "=", "'zh-CN'", "|", "string", ";", "export", "class", "NumberStore", "{", "private", "numberFormatter", ":", "Intl", ".", "NumberFormat", ";", "constructor", "(", "locale", ",", "options", "=", "{", "}", ")", "{", "this", ".", "numberFormatter", "=", "new", "Intl", ".", "NumberFormat", "(", "locale", ",", "options", ")", ";", "}", "parse", "(", "value", ")", "{", "if", "(", "typeof", "value", "===", "'number'", ")", "{", "return", "value", ";", "}", "const", "newValue", "=", "value", ".", "replace", "(", "/,/g", ",", "''", ")", ";", "return", "Number", "(", "newValue", ")", ";", "}", "format", "(", "value", ")", "{", "const", "number", "=", "toNumber", "(", "value", ")", ";", "const", "ret", "=", "this", ".", "numberFormatter", ".", "format", "(", "number", ")", ";", "return", "ret", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 35100, null, 16519, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, 7259, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 7259, null, null, null, 3, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1106
[ "import", "{", "useCallback", ",", "useState", ",", "useMemo", "}", "from", "'react'", ";", "import", "{", "useControllableProp", "}", "from", "'../../hooks'", ";", "import", "{", "StringOrNumber", "}", "from", "'../../types'", ";", "import", "{", "toNumber", ",", "toPrecision", ",", "isNull", "}", "from", "'../../utils'", ";", "import", "{", "NumberStore", "}", "from", "'../../stores'", ";", "export", "interface", "UseCounterProps", "{", "/**\n * 非受控初值\n */", "defaultValue", "?", ":", "StringOrNumber", ";", "/**\n * 受控值\n */", "value", "?", ":", "StringOrNumber", ";", "/**\n * 值变化时的回调\n */", "onChange", "?", ":", "(", "val", ":", "number", ")", "=>", "void", ";", "/**\n * 精度(小数点保留位数)\n */", "precision", "?", ":", "number", ";", "/**\n * 步长\n */", "step", "?", ":", "number", ";", "/**\n * 最小值\n */", "min", "?", ":", "number", ";", "/**\n * 最大值\n */", "max", "?", ":", "number", ";", "/**\n * 格式化选项,参考 Intl.NumberFormat\n */", "formatOptions", "?", ":", "Intl", ".", "NumberFormatOptions", ";", "}", "export", "function", "useCounter", "(", "props", ")", "{", "const", "{", "onChange", ",", "defaultValue", ",", "value", ":", "valueProp", ",", "precision", ",", "step", ":", "stepProp", "=", "1", ",", "min", "=", "Number", ".", "MIN_SAFE_INTEGER", ",", "max", "=", "Number", ".", "MAX_SAFE_INTEGER", ",", "formatOptions", ",", "}", "=", "props", ";", "const", "[", "valueState", ",", "setValue", "]", "=", "useState", "<", "number", ">", "(", "(", ")", "=>", "{", "if", "(", "isNull", "(", "defaultValue", ")", ")", "{", "return", "0", ";", "}", "return", "toNumber", "(", "defaultValue", ")", ";", "}", ")", ";", "const", "[", "isControlled", ",", "value", "]", "=", "useControllableProp", "(", "valueProp", ",", "valueState", ")", ";", "const", "numberStore", "=", "useMemo", "(", "(", ")", "=>", "{", "return", "new", "NumberStore", "(", "'zh-CN'", ",", "formatOptions", ")", ";", "}", ",", "[", "formatOptions", "]", ")", ";", "const", "correct", "=", "useCallback", "(", "(", "value", ")", "=>", "{", "const", "nextValue", "=", "correctValue", "(", "value", ",", "min", ",", "max", ")", ";", "return", "formatValue", "(", "nextValue", ",", "precision", ")", ";", "}", ",", "[", "min", ",", "max", ",", "precision", "]", ")", ";", "const", "update", "=", "useCallback", "(", "(", "next", ")", "=>", "{", "if", "(", "!", "isControlled", ")", "{", "setValue", "(", "next", ")", ";", "}", "onChange", "?.", "(", "next", ")", ";", "}", ",", "[", "onChange", ",", "isControlled", "]", ")", ";", "const", "increment", "=", "useCallback", "(", "(", "step", "=", "stepProp", ")", "=>", "{", "let", "next", "=", "toNumber", "(", "value", ")", "+", "step", ";", "next", "=", "correct", "(", "next", ")", ";", "update", "(", "next", ")", ";", "return", "next", ";", "}", ",", "[", "update", ",", "value", ",", "stepProp", ",", "correct", "]", ")", ";", "const", "decrement", "=", "useCallback", "(", "(", "step", "=", "stepProp", ")", "=>", "{", "let", "next", "=", "toNumber", "(", "value", ")", "-", "step", ";", "next", "=", "correct", "(", "next", ")", ";", "update", "(", "next", ")", ";", "return", "next", ";", "}", ",", "[", "update", ",", "value", ",", "stepProp", ",", "correct", "]", ")", ";", "return", "{", "isAtMax", ":", "value", "===", "max", ",", "isAtMin", ":", "value", "===", "min", ",", "value", ",", "update", ",", "increment", ",", "decrement", ",", "correct", ",", "numberStore", ",", "}", ";", "}", "param", "value", "param", "precision", "function", "formatValue", "(", "value", ",", "precision", ")", "{", "return", "toPrecision", "(", "toNumber", "(", "value", ")", ",", "precision", ")", ";", "}", "param", "value", "param", "min", "param", "max", "function", "correctValue", "(", "value", ",", "min", ",", "max", ")", "{", "return", "Math", ".", "min", "(", "Math", ".", "max", "(", "value", ",", "min", ")", ",", "max", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, 3, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, 7259, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, 3, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1107
[ "import", "{", "useState", "}", "from", "'react'", ";", "import", "{", "pickStyleAndDataProps", "}", "from", "'../../utils'", ";", "import", "{", "useCounter", ",", "UseCounterProps", "}", "from", "'./use-counter'", ";", "export", "interface", "UseNumberInputProps", "extends", "UseCounterProps", "{", "readOnly", "?", ":", "boolean", ";", "disabled", "?", ":", "boolean", ";", "status", "?", ":", "'error'", "|", "'success'", ";", "}", "export", "function", "useNumberInput", "(", "props", ")", "{", "const", "{", "readOnly", ",", "disabled", ",", "status", ",", "...", "rest", "}", "=", "props", ";", "const", "counter", "=", "useCounter", "(", "props", ")", ";", "const", "{", "update", ",", "increment", ",", "decrement", ",", "correct", ",", "numberStore", "}", "=", "counter", ";", "const", "getInputProps", "=", "(", ")", "=>", "{", "return", "{", "type", ":", "'text'", ",", "status", ",", "readOnly", ",", "disabled", ",", "value", ":", "numberStore", ".", "format", "(", "counter", ".", "value", ")", ",", "onChange", ":", "(", "input", ")", "=>", "{", "update", "(", "numberStore", ".", "parse", "(", "input", ")", ")", ";", "}", ",", "onBlur", ":", "(", ")", "=>", "{", "const", "val", "=", "correct", "(", "counter", ".", "value", "as", "number", ")", ";", "if", "(", "val", "!==", "counter", ".", "value", ")", "{", "update", "(", "val", ")", ";", "}", "}", ",", "}", ";", "}", ";", "const", "getIncrementButtonProps", "=", "(", ")", "=>", "{", "return", "{", "disabled", ":", "disabled", "||", "counter", ".", "isAtMax", ",", "onClick", ":", "(", ")", "=>", "{", "increment", "(", ")", ";", "}", ",", "}", ";", "}", ";", "const", "getDecrementButtonProps", "=", "(", ")", "=>", "{", "return", "{", "disabled", ":", "disabled", "||", "counter", ".", "isAtMin", ",", "onClick", ":", "(", ")", "=>", "{", "decrement", "(", ")", ";", "}", ",", "}", ";", "}", ";", "return", "{", "htmlProps", ":", "pickStyleAndDataProps", "(", "rest", ")", ",", "getInputProps", ",", "getIncrementButtonProps", ",", "getDecrementButtonProps", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1108
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "React", "from", "'react'", ";", "import", "{", "Button", "}", "from", "'../button'", ";", "import", "{", "Input", "}", "from", "'../input'", ";", "import", "{", "Group", "}", "from", "'../layout'", ";", "import", "{", "useNumberInput", ",", "UseNumberInputProps", "}", "from", "'./use-number-input'", ";", "export", "interface", "NumberInputProps", "extends", "UseNumberInputProps", "{", "}", "export", "function", "NumberInput", "(", "props", ")", "{", "const", "{", "getInputProps", ",", "getDecrementButtonProps", ",", "getIncrementButtonProps", ",", "htmlProps", "}", "=", "useNumberInput", "(", "props", ")", ";", "const", "inputProps", "=", "getInputProps", "(", ")", ";", "const", "incBtnProps", "=", "getIncrementButtonProps", "(", ")", ";", "const", "decBtnProps", "=", "getDecrementButtonProps", "(", ")", ";", "return", "(", "<", "Group", "attached", "{", "...", "htmlProps", "}", ">", "<", "Button", "{", "...", "decBtnProps", "}", ">", "<", "Icon", "type", "=", "\"minus-bold\"", "/", ">", "<", "/Button>", "<", "Input", "width", "=", "\"100px\"", "{", "...", "inputProps", "}", "/>", "<", "Button", "{", "...", "incBtnProps", "}", ">", "<", "Icon", "type", "=", "\"add-bold\"", "/", ">", "<", "/Button>", "<", "/Group>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 19656, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, 6, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1109
[ "export", "const", "OVERSCAN_SIZE", "=", "100", ";", "export", "function", "sum", "(", "arr", ")", "{", "let", "result", "=", "0", ";", "arr", ".", "forEach", "(", "(", "x", ")", "=>", "{", "result", "+=", "x", ";", "}", ")", ";", "return", "result", ";", "}", "export", "interface", "VerticalRenderRange", "{", "topIndex", ":", "number", ";", "topBlank", ":", "number", ";", "bottomIndex", ":", "number", ";", "bottomBlank", ":", "number", ";", "}", "export", "function", "getFullRenderRange", "(", "rowCount", ")", "{", "return", "{", "topIndex", ":", "0", ",", "topBlank", ":", "0", ",", "bottomIndex", ":", "rowCount", ",", "bottomBlank", ":", "0", ",", "}", ";", "}", "export", "function", "makeRowHeightManager", "(", "initRowCount", ",", "estimatedRowHeight", ")", "{", "const", "cache", "=", "new", "Array", "<", "number", ">", "(", "initRowCount", ")", ".", "fill", "(", "estimatedRowHeight", ")", ";", "function", "getRenderRange", "(", "offset", ",", "maxRenderHeight", ",", "rowCount", ")", "{", "if", "(", "cache", ".", "length", "!==", "rowCount", ")", "{", "setRowCount", "(", "rowCount", ")", ";", "}", "if", "(", "maxRenderHeight", "<=", "0", ")", "{", "if", "(", "offset", "<=", "0", ")", "{", "return", "getRenderRangeWhenBelowView", "(", ")", ";", "}", "else", "{", "return", "getRenderRangeWhenAboveView", "(", ")", ";", "}", "}", "else", "{", "return", "getRenderRangeWhenInView", "(", ")", ";", "}", "function", "getRenderRangeWhenBelowView", "(", ")", "{", "const", "start", "=", "{", "topIndex", ":", "0", ",", "topBlank", ":", "0", "}", ";", "const", "end", "=", "getEnd", "(", "0", ",", "start", ")", ";", "return", "{", "...", "start", ",", "...", "end", "}", ";", "}", "function", "getRenderRangeWhenAboveView", "(", ")", "{", "const", "totalSize", "=", "getEstimatedTotalSize", "(", "rowCount", ")", ";", "const", "start", "=", "getStart", "(", "totalSize", ")", ";", "const", "end", "=", "getEnd", "(", "totalSize", ",", "start", ")", ";", "return", "{", "...", "start", ",", "...", "end", "}", ";", "}", "function", "getRenderRangeWhenInView", "(", ")", "{", "const", "start", "=", "getStart", "(", "offset", ")", ";", "const", "end", "=", "getEnd", "(", "offset", "+", "maxRenderHeight", ",", "start", ")", ";", "return", "{", "...", "start", ",", "...", "end", "}", ";", "}", "/** 获取虚拟滚动在 开始位置上的信息 */", "function", "getStart", "(", "offset", ")", "{", "if", "(", "cache", ".", "length", "===", "0", ")", "{", "return", "{", "topIndex", ":", "0", ",", "topBlank", ":", "0", "}", ";", "}", "let", "topIndex", "=", "0", ";", "let", "topBlank", "=", "0", ";", "while", "(", "topIndex", "<", "cache", ".", "length", ")", "{", "const", "h", "=", "cache", "[", "topIndex", "]", ";", "if", "(", "topBlank", "+", "h", ">=", "offset", ")", "{", "break", ";", "}", "topBlank", "+=", "h", ";", "topIndex", "+=", "1", ";", "}", "return", "overscanUpwards", "(", "topIndex", ",", "topBlank", ")", ";", "}", "function", "overscanUpwards", "(", "topIndex", ",", "topBlank", ")", "{", "let", "overscanSize", "=", "0", ";", "let", "overscanCount", "=", "0", ";", "while", "(", "overscanCount", "<", "topIndex", "&&", "overscanSize", "<", "OVERSCAN_SIZE", ")", "{", "overscanCount", "+=", "1", ";", "overscanSize", "+=", "cache", "[", "topIndex", "-", "overscanCount", "]", ";", "}", "return", "{", "topIndex", ":", "topIndex", "-", "overscanCount", ",", "topBlank", ":", "topBlank", "-", "overscanSize", ",", "}", ";", "}", "/** 获取虚拟滚动 在结束位置上的信息 */", "function", "getEnd", "(", "endOffset", ",", "startInfo", ")", "{", "let", "bottomIndex", "=", "startInfo", ".", "topIndex", ";", "let", "offset", "=", "startInfo", ".", "topBlank", ";", "while", "(", "bottomIndex", "<", "rowCount", "&&", "offset", "<", "endOffset", ")", "{", "offset", "+=", "cache", "[", "bottomIndex", "]", ";", "bottomIndex", "+=", "1", ";", "}", "const", "bottomBlank", "=", "getEstimatedTotalSize", "(", "rowCount", ")", "-", "offset", ";", "return", "overscanDownwards", "(", "bottomIndex", ",", "bottomBlank", ")", ";", "}", "function", "overscanDownwards", "(", "bottomIndex", ",", "bottomBlank", ")", "{", "let", "overscanSize", "=", "0", ";", "let", "overscanCount", "=", "0", ";", "while", "(", "overscanCount", "<", "rowCount", "-", "bottomIndex", "&&", "overscanSize", "<", "OVERSCAN_SIZE", ")", "{", "overscanSize", "+=", "cache", "[", "bottomIndex", "+", "overscanCount", "]", ";", "overscanCount", "+=", "1", ";", "}", "return", "{", "bottomIndex", ":", "bottomIndex", "+", "overscanCount", ",", "bottomBlank", ":", "bottomBlank", "-", "overscanSize", ",", "}", ";", "}", "function", "getEstimatedTotalSize", "(", "rowCount", ")", "{", "return", "sum", "(", "cache", ")", "+", "(", "rowCount", "-", "cache", ".", "length", ")", "*", "estimatedRowHeight", ";", "}", "function", "setRowCount", "(", "count", ")", "{", "if", "(", "count", "<", "cache", ".", "length", ")", "{", "cache", ".", "length", "=", "count", ";", "}", "else", "{", "const", "prevSize", "=", "cache", ".", "length", ";", "cache", ".", "length", "=", "count", ";", "cache", ".", "fill", "(", "estimatedRowHeight", ",", "prevSize", ")", ";", "}", "}", "}", "function", "updateRow", "(", "index", ",", "offset", ",", "size", ")", "{", "cache", "[", "index", "]", "=", "size", ";", "}", "return", "{", "getRenderRange", ",", "updateRow", ",", "cache", ",", "}", ";", "}" ]
[ null, null, 3, null, null, null, null, null, 3, null, 5, null, null, null, 3, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21741, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 3, null, 3, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21741, null, 3, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21741, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21741, null, null, null, null, 3, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21741, null, null, null, null, 6, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 3, null, 3, null, null, null, 3, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 3, null, 141, null, null, null, 3, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 3, null, 3, null, null, null, 3, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 3, null, 3, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1110
[ "import", "cx", "from", "'classnames'", ";", "import", "_", "from", "'lodash-es'", ";", "import", "React", "from", "'react'", ";", "import", "{", "Subscription", "}", "from", "'rxjs'", ";", "import", "*", "as", "op", "from", "'rxjs/operators'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "mergeRefs", "}", "from", "'../../utils'", ";", "import", "{", "domUtils", "}", "from", "'./dom-utils'", ";", "import", "{", "getFullRenderRange", ",", "makeRowHeightManager", ",", "OVERSCAN_SIZE", ",", "sum", "}", "from", "'./makeRowHeightManager'", ";", "const", "ROW_INDEX", "=", "'data-rex-virtual-list-row-index'", ";", "const", "VirtualListDiv", "=", "styled", ".", "div", "`\n position: relative;\n`", ";", "export", "interface", "VirtualListProps", "<", "Row", ">", "{", "rows", ":", "Row", "[", "]", ";", "renderRow", "(", "row", ",", "rowIndex", ",", "listRowDataset", ")", ":", "React", ".", "ReactElement", ";", "estimatedRowHeight", ":", "number", ";", "virtualThreshold", "?", ":", "number", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "className", "?", ":", "string", ";", "containerRef", "?", ":", "React", ".", "ForwardedRef", "<", "HTMLDivElement", ">", ";", "}", "interface", "VirtualListState", "{", "offset", ":", "number", ";", "maxRenderHeight", ":", "number", ";", "}", "export", "enum", "VirtualListAlign", "{", "start", "=", "'start'", ",", "center", "=", "'center'", ",", "end", "=", "'end'", "}", "/**\n * 虚拟滚动列表组件\n */", "export", "class", "VirtualList", "<", "Row", ">", "extends", "React", ".", "Component", "<", "VirtualListProps", "<", "Row", ">", ",", "VirtualListState", ">", "{", "static", "defaultProps", "=", "{", "virtualThreshold", ":", "200", ",", "}", ";", "readonly", "manager", "=", "makeRowHeightManager", "(", "this", ".", "props", ".", "rows", ".", "length", ",", "this", ".", "props", ".", "estimatedRowHeight", ")", ";", "readonly", "containerRef", "=", "React", ".", "createRef", "<", "HTMLDivElement", ">", "(", ")", ";", "readonly", "composedContainerRef", "=", "mergeRefs", "(", "this", ".", "props", ".", "containerRef", ",", "this", ".", "containerRef", ")", ";", "get", "container", "(", ")", "{", "return", "this", ".", "containerRef", ".", "current", ";", "}", "public", "scrollToRow", "(", "rowIndex", ",", "align", "=", "VirtualListAlign", ".", "center", ")", "{", "rowIndex", "=", "_", ".", "clamp", "(", "rowIndex", ",", "0", ",", "this", ".", "manager", ".", "cache", ".", "length", "-", "1", ")", ";", "const", "rowHeight", "=", "this", ".", "manager", ".", "cache", "[", "rowIndex", "]", ";", "const", "scrollParent", "=", "domUtils", ".", "getScrollParent", "(", "this", ".", "container", ")", ";", "const", "commonOffsetAncestor", "=", "domUtils", ".", "findCommonOffsetAncestor", "(", "this", ".", "container", ",", "scrollParent", ")", ";", "const", "targetRect", "=", "domUtils", ".", "getRelativeLayoutRect", "(", "commonOffsetAncestor", ",", "this", ".", "container", ")", ";", "const", "scrollParentRect", "=", "domUtils", ".", "getRelativeLayoutRect", "(", "commonOffsetAncestor", ",", "scrollParent", ")", ";", "const", "currentOffset", "=", "scrollParentRect", ".", "top", "-", "targetRect", ".", "top", ";", "const", "desiredOffset", "=", "sum", "(", "this", ".", "manager", ".", "cache", ".", "slice", "(", "0", ",", "rowIndex", ")", ")", ";", "const", "clipTop", "=", "Math", ".", "max", "(", "targetRect", ".", "top", ",", "scrollParentRect", ".", "top", ")", ";", "const", "clipBottom", "=", "Math", ".", "min", "(", "targetRect", ".", "bottom", ",", "scrollParentRect", ".", "bottom", ")", ";", "const", "maxRenderHeight", "=", "clipBottom", "-", "clipTop", ";", "let", "delta", "=", "desiredOffset", "-", "currentOffset", ";", "if", "(", "align", "===", "VirtualListAlign", ".", "center", ")", "{", "delta", "-=", "(", "maxRenderHeight", "-", "rowHeight", ")", "/", "2", ";", "}", "else", "if", "(", "align", "===", "VirtualListAlign", ".", "end", ")", "{", "delta", "-=", "maxRenderHeight", "-", "rowHeight", ";", "}", "domUtils", ".", "applyScrollDelta", "(", "scrollParent", ",", "delta", ")", ";", "}", "private", "subscription", ":", "Subscription", ";", "state", "=", "{", "offset", ":", "0", ",", "maxRenderHeight", ":", "400", ",", "}", ";", "private", "trySubscribeRichVisibleRects", "(", ")", "{", "if", "(", "this", ".", "subscription", "!=", "null", ")", "{", "return", ";", "}", "const", "{", "rows", ",", "virtualThreshold", "}", "=", "this", ".", "props", ";", "const", "rowCount", "=", "rows", ".", "length", ";", "if", "(", "rowCount", "<", "virtualThreshold", ")", "{", "return", ";", "}", "const", "richVisibleRects$", "=", "domUtils", ".", "getRichVisibleRectsStream", "(", "this", ".", "container", ")", ";", "this", ".", "subscription", "=", "richVisibleRects$", ".", "pipe", "(", "op", ".", "map", "(", "(", "{", "clipRect", ",", "offsetY", ":", "offset", "}", ")", "=>", "(", "{", "maxRenderHeight", ":", "clipRect", ".", "bottom", "-", "clipRect", ".", "top", ",", "offset", ",", "}", ")", ")", ",", "op", ".", "distinctUntilChanged", "(", "(", "prev", ",", "next", ")", "=>", "{", "return", "(", "Math", ".", "abs", "(", "prev", ".", "maxRenderHeight", "-", "next", ".", "maxRenderHeight", ")", "<", "OVERSCAN_SIZE", "/", "2", "&&", "Math", ".", "abs", "(", "prev", ".", "offset", "-", "next", ".", "offset", ")", "<", "OVERSCAN_SIZE", "/", "2", ")", ";", "}", ")", ")", ".", "subscribe", "(", "(", "nextPartialState", ")", "=>", "{", "this", ".", "setState", "(", "nextPartialState", ")", ";", "}", ")", ";", "}", "componentDidMount", "(", ")", "{", "this", ".", "trySubscribeRichVisibleRects", "(", ")", ";", "}", "componentDidUpdate", "(", ")", "{", "this", ".", "trySubscribeRichVisibleRects", "(", ")", ";", "if", "(", "!", "this", ".", "subscription", ")", "{", "return", ";", "}", "const", "container", "=", "this", ".", "containerRef", ".", "current", ";", "const", "manager", "=", "this", ".", "manager", ";", "let", "zeroHeightRowCount", "=", "0", ";", "let", "maxRowIndex", "=", "-", "1", ";", "let", "maxRowBottom", "=", "-", "1", ";", "const", "rows", "=", "container", ".", "querySelectorAll", "<", "HTMLDivElement", ">", "(", "`:scope > *[${", "ROW_INDEX", "}]`", ")", ";", "for", "(", "const", "row", "of", "rows", ")", "{", "const", "rowIndex", "=", "Number", "(", "row", ".", "dataset", ".", "rexVirtualListRowIndex", ")", ";", "if", "(", "isNaN", "(", "rowIndex", ")", ")", "{", "continue", ";", "}", "maxRowIndex", "=", "Math", ".", "max", "(", "maxRowIndex", ",", "rowIndex", ")", ";", "const", "offset", "=", "row", ".", "offsetTop", ";", "const", "size", "=", "row", ".", "offsetHeight", ";", "if", "(", "size", "===", "0", ")", "{", "zeroHeightRowCount", "+=", "1", ";", "}", "maxRowBottom", "=", "Math", ".", "max", "(", "maxRowBottom", ",", "offset", "+", "size", ")", ";", "manager", ".", "updateRow", "(", "rowIndex", ",", "offset", ",", "size", ")", ";", "}", "if", "(", "maxRowIndex", "!==", "-", "1", "&&", "zeroHeightRowCount", "===", "0", ")", "{", "const", "{", "offset", ",", "maxRenderHeight", "}", "=", "this", ".", "state", ";", "if", "(", "maxRowBottom", "<", "offset", "+", "maxRenderHeight", ")", "{", "const", "nextVerticalRenderRange", "=", "this", ".", "manager", ".", "getRenderRange", "(", "offset", ",", "maxRenderHeight", ",", "this", ".", "props", ".", "rows", ".", "length", ")", ";", "if", "(", "nextVerticalRenderRange", ".", "bottomIndex", "-", "1", ">", "maxRowIndex", ")", "{", "this", ".", "forceUpdate", "(", ")", ";", "}", "}", "}", "}", "componentWillUnmount", "(", ")", "{", "this", ".", "subscription", "?.", "unsubscribe", "(", ")", ";", "}", "render", "(", ")", "{", "const", "{", "rows", ",", "renderRow", ",", "style", ",", "className", ",", "virtualThreshold", "}", "=", "this", ".", "props", ";", "const", "{", "offset", ",", "maxRenderHeight", "}", "=", "this", ".", "state", ";", "const", "rowCount", "=", "rows", ".", "length", ";", "const", "range", "=", "rowCount", ">=", "virtualThreshold", "?", "this", ".", "manager", ".", "getRenderRange", "(", "offset", ",", "maxRenderHeight", ",", "rowCount", ")", ":", "getFullRenderRange", "(", "rowCount", ")", ";", "const", "visibleRows", "=", "rows", ".", "slice", "(", "range", ".", "topIndex", ",", "range", ".", "bottomIndex", ")", ";", "if", "(", "process", ".", "env", ".", "NODE_ENV", "!==", "'production'", ")", "{", "if", "(", "style", "?.", "height", "!=", "null", "||", "style", "?.", "maxHeight", "!=", "null", "||", "style", "?.", "overflow", "!=", "null", ")", "{", "console", ".", "log", "(", "'[rexd] 不要为 <VirtualList /> 设置 style.height/style.maxHeight/style.overflow,请在上层元素中设置这些样式'", ")", ";", "}", "}", "return", "(", "<", "VirtualListDiv", "ref", "=", "{", "this", ".", "composedContainerRef", "}", "style", "=", "{", "style", "}", "className", "=", "{", "cx", "(", "'rex-virtual-list'", ",", "className", ")", "}", ">", "{", "range", ".", "topBlank", ">", "0", "&&", "<", "div", "style", "=", "{", "{", "height", ":", "range", ".", "topBlank", "}", "}", "data", "-", "rex", "-", "virtual", "-", "top", "-", "blank", "=", "\"true\"", "/", ">", "}", "{", "visibleRows", ".", "map", "(", "(", "row", ",", "visibleRowIndex", ")", "=>", "{", "const", "rowIndex", "=", "visibleRowIndex", "+", "range", ".", "topIndex", ";", "const", "listRowDataset", "=", "{", "[", "ROW_INDEX", "]", ":", "String", "(", "rowIndex", ")", "}", ";", "return", "renderRow", "(", "row", ",", "rowIndex", ",", "listRowDataset", ")", ";", "}", ")", "}", "{", "range", ".", "bottomBlank", ">", "0", "&&", "<", "div", "style", "=", "{", "{", "height", ":", "range", ".", "bottomBlank", "}", "}", "data", "-", "rex", "-", "virtual", "-", "bottom", "-", "blank", "=", "\"true\"", "/", ">", "}", "<", "/VirtualListDiv>);", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 392, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 3, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 51, null, null, null, null, null, null, null, null, null, null, null, null, null, 51, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 18, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 39, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, 3, null, null, null, null, 3, null, null, null, null, null, 3, null, null, null, null, null, 199, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 39, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 21741, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1111
[ "import", "React", "from", "'react'", ";", "import", "{", "PopupProps", "}", "from", "'../overlays'", ";", "export", "interface", "TreeSelectItem", "{", "value", ":", "string", ";", "label", "?", ":", "React", ".", "ReactNode", ";", "disabled", "?", ":", "boolean", ";", "detached", "?", ":", "boolean", ";", "children", "?", ":", "TreeSelectItem", "[", "]", ";", "}", "export", "type", "CascaderSelectItem", "=", "TreeSelectItem", ";", "export", "interface", "SelectItem", "{", "value", ":", "string", ";", "label", "?", ":", "React", ".", "ReactNode", ";", "/** 是否禁用交互 */", "disabled", "?", ":", "boolean", ";", "}", "export", "interface", "ISelectAppearanceProps", "{", "category", "className", "?", ":", "string", ";", "category", "style", "?", ":", "React", ".", "CSSProperties", ";", "category", "containerProps", "?", ":", "React", ".", "HTMLAttributes", "<", "HTMLDivElement", ">", ";", "category", "size", "?", ":", "string", ";", "category", "fill", "?", ":", "boolean", ";", "category", "status", "?", ":", "'normal'", "|", "'error'", "|", "'warning'", "|", "'success'", ";", "category", "placeholder", "?", ":", "string", ";", "category", "shape", "?", ":", "'simple'", "|", "'solid'", ";", "category", "hasArrow", "?", ":", "boolean", ";", "category", "hasClear", "?", ":", "boolean", ";", "}", "export", "const", "selectAppearancePropKeys", "=", "[", "'className'", ",", "'style'", ",", "'containerProps'", ",", "'size'", ",", "'fill'", ",", "'status'", ",", "'placeholder'", ",", "'shape'", ",", "'hasArrow'", ",", "'hasClear'", ",", "]", ";", "export", "interface", "ISelectSearchProps", "{", "category", "showSearch", "?", ":", "boolean", ";", "category", "searchValue", ":", "string", ";", "category", "defaultSearchValue", "?", ":", "string", ";", "category", "onSearch", "(", "nextSearchValue", ",", "detail", ")", ":", "void", ";", "category", "notFoundContent", "?", ":", "React", ".", "ReactNode", ";", "}", "export", "interface", "ISelectPopupProps", "{", "category", "defaultVisible", "?", ":", "boolean", ";", "category", "visible", ":", "boolean", ";", "category", "onRequestClose", "(", "reason", "?", ")", ":", "void", ";", "category", "onRequestOpen", "(", "reason", "?", ")", ":", "void", ";", "category", "default", "autoWidth", "?", ":", "boolean", ";", "category", "default", "autoHeight", "?", ":", "boolean", ";", "category", "default", "autoScrollToFirstItemWhenOpen", "?", ":", "boolean", ";", "category", "autoCloseAfterSelect", "?", ":", "boolean", ";", "category", "displayType", "popupProps", "?", ":", "Omit", "<", "PopupProps", ",", "'children'", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1112
[ "import", "{", "AbstractTreeNode", ",", "isLeafNode", "}", "from", "'ali-react-table'", ";", "import", "React", "from", "'react'", ";", "import", "{", "SelectItem", "}", "from", "'../types'", ";", "export", "function", "toggleValue", "(", "value", ",", "targetValue", ")", "{", "return", "value", ".", "includes", "(", "targetValue", ")", "?", "value", ".", "filter", "(", "(", "v", ")", "=>", "v", "!==", "targetValue", ")", ":", "[", "...", "value", ",", "targetValue", "]", ";", "}", "export", "function", "filterDataSourceBySearchValue", "(", "trimmedSearchValue", ",", "dataSource", ")", "{", "const", "lowerCaseTrimmed", "=", "trimmedSearchValue", ".", "toLowerCase", "(", ")", ";", "if", "(", "!", "lowerCaseTrimmed", ")", "{", "return", "dataSource", ";", "}", "return", "dataSource", ".", "filter", "(", "(", "row", ")", "=>", "row", ".", "value", ".", "toLowerCase", "(", ")", ".", "includes", "(", "lowerCaseTrimmed", ")", "||", "(", "typeof", "row", ".", "label", "===", "'string'", "&&", "row", ".", "label", ".", "toLowerCase", "(", ")", ".", "includes", "(", "lowerCaseTrimmed", ")", ")", ")", ";", "}", "export", "const", "DefaultNotFoundContent", "=", "React", ".", "memo", "(", "(", ")", "=>", "(", "<", "div", "style", "=", "{", "{", "color", ":", "'#999'", ",", "lineHeight", ":", "'32px'", ",", "padding", ":", "8", "}", "}", ">", "无选项", "<", "/div>));", "export", "function", "getLast", "(", "value", ")", "{", "return", "value", ".", "length", "===", "0", "?", "null", ":", "value", "[", "value", ".", "length", "-", "1", "]", ";", "}", "export", "const", "arrayUtils", "=", "{", "diff", "(", "arr1", ",", "arr2", ")", "{", "const", "set", "=", "new", "Set", "(", "arr2", ")", ";", "return", "arr1", ".", "filter", "(", "(", "x", ")", "=>", "!", "set", ".", "has", "(", "x", ")", ")", ";", "}", ",", "merge", "(", "arr1", ",", "arr2", ")", "{", "const", "set", "=", "new", "Set", "(", "arr1", ")", ";", "return", "arr1", ".", "concat", "(", "arr2", ".", "filter", "(", "(", "x", ")", "=>", "!", "set", ".", "has", "(", "x", ")", ")", ")", ";", "}", ",", "}", "as", "const", ";", "/** 对树进行过滤,只保留深度小于等于 maxDepth 的部分 */", "export", "function", "filterTreeByMaxDepth", "<", "N", "extends", "AbstractTreeNode", ">", "(", "input", ",", "maxDepth", ")", "{", "return", "dfs", "(", "input", ",", "0", ")", ";", "function", "dfs", "(", "nodes", ",", "depth", ")", "{", "const", "result", "=", "[", "]", ";", "for", "(", "const", "node", "of", "nodes", ")", "{", "result", ".", "push", "(", "{", "...", "node", ",", "children", ":", "isLeafNode", "(", "node", ")", "||", "depth", "===", "maxDepth", "?", "null", ":", "dfs", "(", "node", ".", "children", "as", "N", "[", "]", ",", "depth", "+", "1", ")", ",", "}", ")", ";", "}", "return", "result", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, 5, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4579, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 534, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, 5, null, 5, null, 114, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, 5, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, 5, null, 3, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, 3, null, null, null, 5, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1113
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "getToken", ",", "useMemoizedMergeRefs", "}", "from", "'../../utils'", ";", "import", "{", "PopupTargetRenderArgs", "}", "from", "'../overlays'", ";", "import", "{", "CaretDownIcon", ",", "ClearIcon", "}", "from", "'./icons'", ";", "import", "{", "ISelectAppearanceProps", ",", "SelectItem", "}", "from", "'./types'", ";", "import", "{", "toggleValue", "}", "from", "'./utils/select-utils'", ";", "const", "ValueTagDiv", "=", "styled", ".", "div", ".", "withConfig", "(", "{", "componentId", ":", "'rex-select-value-tag'", "}", ")", "`\n display: inline-flex;\n align-items: center;\n padding: 0 8px;\n border-radius: 2px;\n color: var(--rex-colors-text-body);\n height: var(--rex-sizes-s6);\n font-size: var(--rex-fontSizes-note);\n background-color: var(--rex-colors-emphasis-20);\n\n &:hover {\n background-color: var(--rex-colors-emphasis-30);\n }\n\n > .delete-icon {\n color: var(--rex-colors-emphasis-50);\n margin-left: 6px;\n display: flex;\n align-items: center;\n cursor: pointer;\n &:hover {\n color: var(--rex-colors-emphasis-60);\n }\n }\n`", ";", "interface", "ValueTagProps", "{", "value", ":", "string", ";", "label", ":", "React", ".", "ReactNode", ";", "showDelete", ":", "boolean", ";", "onDelete", "(", "v", ",", "event", ")", ":", "void", ";", "}", "const", "ValueTag", "=", "React", ".", "memo", "(", "(", "{", "value", ",", "label", ",", "onDelete", ",", "showDelete", "}", ")", "=>", "(", "<", "ValueTagDiv", ">", "{", "label", "}", "{", "showDelete", "&&", "(", "<", "span", "className", "=", "\"delete-icon\"", "onClick", "=", "{", "(", "event", ")", "=>", "{", "event", ".", "stopPropagation", "(", ")", ";", "onDelete", "(", "value", ",", "event", ")", ";", "}", "}", ">", "<", "Icon", "type", "=", "\"close-bold\"", "/", ">", "<", "/span>)}", "<", "/ValueTagDiv>));", "const", "SelectTriggerDiv", "=", "styled", ".", "div", "`\n cursor: pointer;\n height: var(--rex-sizes-formHeights-m);\n display: inline-flex;\n width: 200px;\n align-items: center;\n font-size: var(--rex-fontSizes-body);\n padding: 2px 2px 2px 12px;\n border-radius: var(--rex-radii-s);\n position: relative;\n overflow: hidden;\n color: ${", "getToken", "(", "'Input.textColor'", ")", "};\n transition: box-shadow 300ms cubic-bezier(0.19, 1, 0.22, 1), border-color 300ms cubic-bezier(0.19, 1, 0.22, 1);\n\n &.rex-fill {\n width: 100%;\n }\n\n &.rex-solid {\n border: var(--rex-borders-solid) ${", "getToken", "(", "'Input.borderColor'", ")", "};\n border-radius: var(--rex-radii-s);\n\n &:focus-within {\n outline: 0;\n box-shadow: 0 0 0 3px ${", "getToken", "(", "'Input.borderColorFocus'", ")", "};\n }\n\n &:hover {\n border-color: ${", "getToken", "(", "'Input.borderColorHover'", ")", "};\n }\n\n &.rex-error {\n border-color: ${", "getToken", "(", "'Input.borderColorError'", ")", "};\n\n &:focus-within {\n box-shadow: 0 0 0 3px ${", "getToken", "(", "'Input.borderColorErrorFocus'", ")", "};\n }\n }\n\n &.rex-warning {\n border-color: ${", "getToken", "(", "'Input.borderColorWarning'", ")", "};\n\n &:focus-within {\n box-shadow: 0 0 0 3px ${", "getToken", "(", "'Input.borderColorWarningFocus'", ")", "};\n }\n }\n\n &.rex-success {\n border-color: ${", "getToken", "(", "'Input.borderColorSuccess'", ")", "};\n\n &:focus-within {\n box-shadow: 0 0 0 3px ${", "getToken", "(", "'Input.borderColorSuccessFocus'", ")", "};\n }\n }\n }\n\n &.rex-simple {\n border: 0;\n background-color: transparent;\n }\n\n &.rex-disabled,\n &.rex-disabled:hover,\n &.rex-disabled:focus-within {\n cursor: not-allowed;\n color: ${", "getToken", "(", "'Input.textColorDisabled'", ")", "};\n border-color: ${", "getToken", "(", "'Input.borderColorDisabled'", ")", "};\n background-color: ${", "getToken", "(", "'Input.bgDisabled'", ")", "};\n /* safari */\n -webkit-text-fill-color: ${", "getToken", "(", "'Input.textColorDisabled'", ")", "};\n\n .rex-select-trigger-controls {\n pointer-events: none;\n background-color: ${", "getToken", "(", "'Input.bgDisabled'", ")", "};\n }\n }\n\n .rex-select-placeholder {\n color: var(--rex-colors-emphasis-50);\n }\n\n .rex-select-value-group {\n display: inline-flex;\n flex-wrap: nowrap;\n flex: 1 1 auto;\n margin-left: -4px;\n\n > * {\n flex: 0 0 auto;\n margin-left: 4px;\n\n &:first-child {\n margin-left: 0;\n }\n }\n }\n\n .rex-select-trigger-controls {\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n padding: 4px 4px 4px 12px;\n background: var(--rex-colors-emphasis-0);\n position: absolute;\n }\n\n &.rex-simple .rex-select-trigger-controls {\n margin-left: 4px;\n position: static;\n }\n\n .rex-select-clear {\n cursor: pointer;\n margin-right: 4px;\n }\n\n .rex-select-arrow {\n transition: transform var(--animate-duration, 200ms) cubic-bezier(0.4, 1, 0.75, 0.9);\n cursor: pointer;\n margin-right: 4px;\n\n &.expanded {\n transform: rotate(180deg);\n }\n }\n`", ";", "export", "interface", "SelectTriggerProps", "extends", "ISelectAppearanceProps", "{", "visible", ":", "boolean", ";", "value", ":", "string", "[", "]", ";", "dataSource", ":", "SelectItem", "[", "]", ";", "onChange", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "disabled", "?", ":", "boolean", ";", "selectMode", ":", "'single'", "|", "'multiple'", ";", "popupTargetRenderArg", ":", "PopupTargetRenderArgs", "[", "0", "]", ";", "getLabelByValue", "(", "value", ")", ":", "React", ".", "ReactNode", ";", "}", "export", "const", "SelectTrigger", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "SelectTriggerProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "popupTargetRenderArg", ",", "visible", ",", "value", ",", "dataSource", ",", "onChange", ",", "containerProps", ",", "shape", "=", "'solid'", ",", "className", ",", "style", ",", "hasClear", ",", "selectMode", ",", "placeholder", "=", "'请选择'", ",", "hasArrow", "=", "true", ",", "status", "=", "'normal'", ",", "disabled", ",", "size", ",", "fill", ",", "getLabelByValue", ",", "}", "=", "props", ";", "const", "mergeRefs", "=", "useMemoizedMergeRefs", "(", ")", ";", "const", "onClear", "=", "(", "event", ")", "=>", "{", "event", ".", "stopPropagation", "(", ")", ";", "onChange", "(", "[", "]", ",", "{", "event", "}", ")", ";", "}", ";", "return", "(", "<", "SelectTriggerDiv", "ref", "=", "{", "mergeRefs", "(", "popupTargetRenderArg", ".", "ref", ",", "ref", ")", "}", "{", "...", "containerProps", "}", "className", "=", "{", "cx", "(", "{", "'rex-solid'", ":", "shape", "===", "'solid'", ",", "'rex-simple'", ":", "shape", "===", "'simple'", ",", "'rex-error'", ":", "status", "===", "'error'", ",", "'rex-warning'", ":", "status", "===", "'warning'", ",", "'rex-success'", ":", "status", "===", "'success'", ",", "'rex-disabled'", ":", "disabled", ",", "'rex-fill'", ":", "fill", ",", "}", ",", "className", ")", "}", "style", "=", "{", "style", "}", "onClick", "=", "{", "(", "event", ")", "=>", "{", "if", "(", "!", "disabled", ")", "{", "popupTargetRenderArg", ".", "onClick", "(", "event", ")", ";", "}", "containerProps", "?.", "onClick", "(", "event", ")", ";", "}", "}", "tabIndex", "=", "{", "0", "}", ">", "{", "value", ".", "length", "===", "0", "?", "(", "<", "span", "className", "=", "\"rex-select-placeholder\"", ">", "{", "placeholder", "}", "<", "/span>) : selectMode === 'single' ? (<span className=\"rex-select-value-preview\">{getLabelByValue(value[0])}</span", ">", ")", ":", "(", "<", "span", "className", "=", "\"rex-select-value-group\"", ">", "{", "value", ".", "map", "(", "(", "v", ")", "=>", "(", "<", "ValueTag", "key", "=", "{", "v", "}", "value", "=", "{", "v", "}", "label", "=", "{", "getLabelByValue", "(", "v", ")", "}", "showDelete", "=", "{", "!", "disabled", "}", "onDelete", "=", "{", "(", "v", ",", "event", ")", "=>", "{", "onChange", "(", "toggleValue", "(", "value", ",", "v", ")", ",", "{", "event", ",", "reason", ":", "'tag-close'", "}", ")", ";", "}", "}", "/>))}", "<", "/span>)}", "{", "renderTriggerControls", "(", ")", "}", "<", "/SelectTriggerDiv>);", "function", "renderTriggerControls", "(", ")", "{", "const", "controls", "=", "[", "]", ";", "if", "(", "selectMode", "===", "'multiple'", "&&", "value", ".", "length", ">", "0", ")", "{", "controls", ".", "push", "(", "<", "span", "key", "=", "\"count\"", "style", "=", "{", "{", "marginRight", ":", "4", "}", "}", ">", "共", "{", "value", ".", "length", "}", "项", "<", "/span>);", "}", "if", "(", "hasClear", "&&", "value", ".", "length", ">", "0", ")", "{", "controls", ".", "push", "(", "<", "ClearIcon", "key", "=", "\"select-clear\"", "className", "=", "\"rex-select-clear\"", "onClick", "=", "{", "onClear", "}", "/", ">", ")", ";", "}", "if", "(", "hasArrow", ")", "{", "controls", ".", "push", "(", "<", "CaretDownIcon", "key", "=", "\"select-arrow\"", "className", "=", "{", "cx", "(", "'rex-select-arrow'", ",", "{", "expanded", ":", "visible", "}", ")", "}", "/", ">", ")", ";", "}", "return", "<", "div", "className", "=", "\"rex-select-trigger-controls\"", ">", "{", "controls", "}", "<", "/div>;", "}", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 534, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1114
[ "import", "cx", "from", "'classnames'", ";", "import", "React", ",", "{", "useRef", "}", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "pick", "}", "from", "'../../utils'", ";", "import", "{", "Input", "}", "from", "'../input'", ";", "import", "{", "AdaptivePopup", ",", "PopupChildrenRenderArg", ",", "PopupTargetRenderArgs", "}", "from", "'../overlays'", ";", "import", "{", "VirtualList", ",", "VirtualListAlign", "}", "from", "'../virtual-list'", ";", "import", "{", "TickIcon", "}", "from", "'./icons'", ";", "import", "{", "SelectTrigger", "}", "from", "'./select-trigger'", ";", "import", "{", "DefaultNotFoundContent", ",", "filterDataSourceBySearchValue", "}", "from", "'./utils/select-utils'", ";", "import", "{", "ISelectAppearanceProps", ",", "ISelectPopupProps", ",", "ISelectSearchProps", ",", "selectAppearancePropKeys", ",", "SelectItem", ",", "}", "from", "'./types'", ";", "export", "const", "SelectPanelDiv", "=", "styled", "(", "AdaptivePopup", ".", "Panel", ")", "`\n max-height: 350px;\n overflow: hidden;\n display: flex;\n flex-flow: column;\n\n *[data-popper-placement^='top'] > & {\n box-shadow: var(--rex-shadows-lowUp);\n }\n\n .rex-select-search {\n margin: 8px;\n flex: 0 0 auto;\n width: auto;\n }\n\n .rex-select-item-list-wrapper {\n margin: 8px 4px;\n flex: auto;\n overflow: auto;\n\n &.rex-empty {\n margin: 0;\n }\n }\n\n .rex-select-search + .rex-select-item-list-wrapper {\n margin-top: 0;\n }\n\n ${", "(", "{", "theme", ",", "$showSearch", ":", "showSearch", "}", ")", "=>", "{", "if", "(", "theme", ".", "device", "?.", "name", "===", "'phone'", ")", "{", "return", "{", "width", ":", "'90vw'", ",", "height", ":", "showSearch", "?", "350", ":", "undefined", "}", ";", "}", "}", "}\n`", ";", "const", "SelectItemDiv", "=", "styled", ".", "div", "`\n font-size: var(--rex-fontSizes-body);\n height: var(--rex-components-Select-rowHeight);\n padding: 0 8px;\n border-radius: var(--rex-radii-s);\n display: flex;\n align-items: center;\n transition: background-color 200ms;\n\n &.disabled {\n color: var(--rex-colors-text-disabled);\n }\n\n &:not(.disabled) {\n cursor: pointer;\n &:hover {\n background: var(--rex-colors-emphasis-10);\n }\n }\n\n &.selected {\n font-weight: 500;\n }\n\n .rex-select-item-tick {\n margin-left: auto;\n }\n`", ";", "function", "toggleValue", "(", "value", ",", "targetValue", ")", "{", "return", "value", ".", "includes", "(", "targetValue", ")", "?", "value", ".", "filter", "(", "(", "v", ")", "=>", "v", "!==", "targetValue", ")", ":", "[", "...", "value", ",", "targetValue", "]", ";", "}", "export", "interface", "SelectViewProps", "extends", "ISelectAppearanceProps", ",", "ISelectSearchProps", ",", "ISelectPopupProps", "{", "value", ":", "string", "[", "]", ";", "onChange", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "disabled", "?", ":", "boolean", ";", "dataSource", ":", "SelectItem", "[", "]", ";", "selectMode", ":", "'single'", "|", "'multiple'", ";", "}", "export", "const", "SelectView", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "SelectViewProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "dataSource", ",", "value", ",", "onChange", ",", "selectMode", ",", "showSearch", ",", "autoWidth", "=", "true", ",", "autoHeight", "=", "true", ",", "searchValue", ",", "onSearch", ",", "notFoundContent", "=", "<", "DefaultNotFoundContent", "/>, onRequestOpen, onRequestClose, visible, popupProps, disabled, autoScrollToFirstItemWhenOpen = true, autoCloseAfterSelect = selectMode === 'single', } = props;", "const", "virtualListRef", "=", "useRef", "<", "VirtualList", "<", "SelectItem", ">", ">", "(", ")", ";", "const", "searchInputWrapperRef", "=", "useRef", "<", "HTMLDivElement", ">", "(", "null", ")", ";", "const", "valueSet", "=", "new", "Set", "(", "value", ")", ";", "const", "trimmedSearchValue", "=", "searchValue", ".", "trim", "(", ")", ";", "const", "searchActive", "=", "showSearch", "&&", "trimmedSearchValue", ";", "const", "filteredDataSource", "=", "searchActive", "?", "filterDataSourceBySearchValue", "(", "trimmedSearchValue", ",", "dataSource", ")", ":", "dataSource", ";", "const", "isNotFound", "=", "dataSource", ".", "length", ">", "0", "&&", "filteredDataSource", ".", "length", "===", "0", ";", "const", "appearance", "=", "pick", "(", "props", ",", "selectAppearancePropKeys", ")", ";", "const", "valueMap", "=", "new", "Map", "(", "dataSource", ".", "map", "(", "(", "item", ")", "=>", "[", "item", ".", "value", ",", "item", "]", ")", ")", ";", "const", "getLabelByValue", "=", "(", "v", ")", "=>", "valueMap", ".", "get", "(", "v", ")", "?.", "label", "??", "v", ";", "return", "(", "<", "AdaptivePopup", "visible", "=", "{", "visible", "}", "onRequestOpen", "=", "{", "onRequestOpen", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "autoWidth", "=", "{", "autoWidth", "}", "autoHeight", "=", "{", "autoHeight", "}", "offset", "=", "{", "[", "0", ",", "4", "]", "}", "interactionKind", "=", "\"click\"", "onOpen", "=", "{", "(", ")", "=>", "{", "if", "(", "autoScrollToFirstItemWhenOpen", ")", "{", "const", "list", "=", "virtualListRef", ".", "current", ";", "const", "index", "=", "list", ".", "props", ".", "rows", ".", "findIndex", "(", "(", "row", ")", "=>", "valueSet", ".", "has", "(", "row", ".", "value", ")", ")", ";", "if", "(", "index", "!==", "-", "1", ")", "{", "list", ".", "scrollToRow", "(", "index", ",", "VirtualListAlign", ".", "center", ")", ";", "}", "const", "input", "=", "searchInputWrapperRef", ".", "current", "?.", "querySelector", "(", "'input'", ")", ";", "input", "?.", "focus", "(", ")", ";", "}", "}", "}", "renderTarget", "=", "{", "(", "arg", ")", "=>", "(", "<", "SelectTrigger", "ref", "=", "{", "ref", "}", "visible", "=", "{", "visible", "}", "value", "=", "{", "value", "}", "dataSource", "=", "{", "dataSource", "}", "onChange", "=", "{", "onChange", "}", "popupTargetRenderArg", "=", "{", "arg", "as", "PopupTargetRenderArgs", "[", "0", "]", "}", "selectMode", "=", "{", "selectMode", "}", "getLabelByValue", "=", "{", "getLabelByValue", "}", "disabled", "=", "{", "disabled", "}", "{", "...", "appearance", "}", "/>)} renderChildren={renderSelectPanel} {...popupProps}/", ">", ")", ";", "function", "renderSelectPanel", "(", "arg", ")", "{", "return", "(", "<", "SelectPanelDiv", "className", "=", "\"rex-select-panel\"", "ref", "=", "{", "arg", ".", "ref", "as", "React", ".", "RefObject", "<", "HTMLDivElement", ">", "}", "$showSearch", "=", "{", "showSearch", "}", ">", "{", "showSearch", "&&", "(", "<", "Input", "className", "=", "\"rex-select-search\"", "ref", "=", "{", "searchInputWrapperRef", "}", "placeholder", "=", "\"搜索\"", "hasClear", "value", "=", "{", "searchValue", "}", "onChange", "=", "{", "(", "nextSearchValue", ")", "=>", "{", "if", "(", "showSearch", ")", "{", "onSearch", "(", "nextSearchValue", ",", "{", "event", ":", "null", "}", ")", ";", "}", "if", "(", "!", "visible", ")", "{", "onRequestOpen", "(", "'search'", ")", ";", "}", "}", "}", "/>)}", "{", "isNotFound", "&&", "notFoundContent", "}", "<", "div", "className", "=", "{", "cx", "(", "'rex-select-item-list-wrapper'", ",", "{", "'rex-empty'", ":", "isNotFound", "}", ")", "}", ">", "<", "VirtualList", "estimatedRowHeight", "=", "{", "28", "}", "ref", "=", "{", "virtualListRef", "}", "rows", "=", "{", "filteredDataSource", "}", "renderRow", "=", "{", "(", "row", ",", "rowIndex", ",", "listRowDataset", ")", "=>", "{", "const", "selected", "=", "valueSet", ".", "has", "(", "row", ".", "value", ")", ";", "return", "(", "<", "SelectItemDiv", "key", "=", "{", "row", ".", "value", "}", "className", "=", "{", "cx", "(", "'rex-select-item'", ",", "{", "selected", ":", "selected", ",", "disabled", ":", "row", ".", "disabled", ",", "}", ")", "}", "{", "...", "listRowDataset", "}", "onClick", "=", "{", "(", "event", ")", "=>", "{", "if", "(", "row", ".", "disabled", ")", "{", "return", ";", "}", "onChange", "(", "toggleValue", "(", "value", ",", "row", ".", "value", ")", ",", "{", "event", "}", ")", ";", "if", "(", "autoCloseAfterSelect", ")", "{", "onRequestClose", "(", ")", ";", "}", "}", "}", ">", "<", "span", "className", "=", "\"rex-select-item-label\"", ">", "{", "row", ".", "label", "}", "<", "/span>", "{", "selected", "&&", "<", "TickIcon", "className", "=", "\"rex-select-item-tick\"", "/", ">", "}", "<", "/SelectItemDiv>);", "}", "}", "/>", "<", "/div>", "<", "/SelectPanelDiv>);", "}", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1115
[ "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "composeHandlers", ",", "composeState", "}", "from", "'../../utils'", ";", "import", "{", "SelectView", "}", "from", "'./select-view'", ";", "import", "{", "ISelectAppearanceProps", ",", "ISelectPopupProps", ",", "ISelectSearchProps", ",", "SelectItem", "}", "from", "'./types'", ";", "export", "interface", "MultiSelectProps", "extends", "ISelectAppearanceProps", ",", "Partial", "<", "ISelectSearchProps", ">", ",", "Partial", "<", "ISelectPopupProps", ">", "{", "defaultValue", "?", ":", "string", "[", "]", ";", "value", "?", ":", "string", "[", "]", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "/** 是否禁用 */", "disabled", "?", ":", "boolean", ";", "displayType", "dataSource", "?", ":", "(", "string", "|", "SelectItem", ")", "[", "]", ";", "}", "export", "const", "MultiSelect", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "MultiSelectProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "dataSource", ":", "dataSourceProp", ",", "value", ":", "valueProp", ",", "onChange", ":", "onChangeProp", ",", "defaultValue", ",", "visible", ":", "visibleProp", ",", "defaultVisible", ",", "onRequestOpen", ":", "onRequestOpenProp", ",", "onRequestClose", ":", "onRequestCloseProp", ",", "defaultSearchValue", ",", "searchValue", ":", "searchValueProp", ",", "onSearch", ":", "onSearchProp", ",", "...", "others", "}", "=", "props", ";", "const", "[", "_value", ",", "_onChange", "]", "=", "useState", "(", "defaultValue", "??", "[", "]", ")", ";", "const", "value", "=", "composeState", "(", "valueProp", ",", "_value", ")", ";", "const", "onChange", "=", "composeHandlers", "(", "onChangeProp", ",", "_onChange", ")", ";", "const", "[", "_visible", ",", "_onVisibleChange", "]", "=", "useState", "(", "defaultVisible", ")", ";", "const", "visible", "=", "composeState", "(", "visibleProp", ",", "_visible", ")", ";", "const", "onRequestOpen", "=", "composeHandlers", "(", "onRequestOpenProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "true", ")", ")", ";", "const", "onRequestClose", "=", "composeHandlers", "(", "onRequestCloseProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "false", ")", ")", ";", "const", "[", "_searchValue", ",", "_onSearch", "]", "=", "useState", "(", "defaultSearchValue", "??", "''", ")", ";", "const", "searchValue", "=", "composeState", "(", "searchValueProp", ",", "_searchValue", ")", ";", "const", "onSearch", "=", "composeHandlers", "(", "onSearchProp", ",", "_onSearch", ")", ";", "const", "dataSource", "=", "dataSourceProp", ".", "map", "(", "(", "item", ")", "=>", "(", "typeof", "item", "===", "'string'", "?", "{", "value", ":", "item", ",", "label", ":", "item", "}", ":", "item", ")", ")", ";", "return", "(", "<", "SelectView", "ref", "=", "{", "ref", "}", "{", "...", "others", "}", "selectMode", "=", "\"multiple\"", "value", "=", "{", "value", "}", "onChange", "=", "{", "onChange", "}", "dataSource", "=", "{", "dataSource", "}", "searchValue", "=", "{", "searchValue", "}", "onSearch", "=", "{", "onSearch", "}", "visible", "=", "{", "visible", "}", "onRequestOpen", "=", "{", "onRequestOpen", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "/", ">", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1116
[ "import", "React", "from", "'react'", ";", "import", "{", "MultiSelect", ",", "MultiSelectProps", "}", "from", "'./multi-select'", ";", "import", "{", "SingleSelect", ",", "SingleSelectProps", "}", "from", "'./single-select'", ";", "export", "interface", "SelectProps", "extends", "Omit", "<", "MultiSelectProps", ",", "'defaultValue'", "|", "'value'", "|", "'onChange'", ">", "{", "defaultValue", "?", ":", "string", "|", "string", "[", "]", ";", "value", "?", ":", "string", "|", "string", "[", "]", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "/** 是否多选 */", "multiple", "?", ":", "boolean", ";", "}", "type", "SelectType", "=", "React", ".", "ExoticComponent", "<", "SelectProps", "&", "React", ".", "RefAttributes", "<", "HTMLDivElement", ">", ">", "&", "{", "Single", ":", "typeof", "SingleSelect", ";", "Multi", ":", "typeof", "MultiSelect", ";", "}", ";", "export", "const", "Select", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "SelectProps", ">", "(", "(", "{", "multiple", ",", "...", "props", "}", ",", "ref", ")", "=>", "{", "if", "(", "multiple", ")", "{", "return", "<", "MultiSelect", "ref", "=", "{", "ref", "}", "{", "...", "(", "props", "as", "MultiSelectProps", ")", "}", "/>;", "}", "else", "{", "return", "<", "SingleSelect", "ref", "=", "{", "ref", "}", "{", "...", "(", "props", "as", "SingleSelectProps", ")", "}", "/>;", "}", "}", ")", ";", "Select", ".", "Single", "=", "SingleSelect", ";", "Select", ".", "Multi", "=", "MultiSelect", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1117
[ "import", "{", "isLeafNode", ",", "AbstractTreeNode", "}", "from", "'ali-react-table'", ";", "import", "{", "arrayUtils", "}", "from", "'./select-utils'", ";", "class", "Wrapper", "<", "N", "extends", "AbstractTreeNode", ">", "{", "constructor", "(", "input", "?", ")", "{", "Object", ".", "assign", "(", "this", ",", "input", ")", ";", "}", "/** 是否为根节点 */", "root", "?", ":", "boolean", ";", "/** 子节点数组 */", "children", "?", ":", "Wrapper", "<", "N", ">", "[", "]", ";", "/** 父节点 (parent wrapper node) */", "parent", "?", ":", "Wrapper", "<", "N", ">", ";", "/** 指向对应的普通节点 */", "node", ":", "N", ";", "/** 该节点是否「选中」 */", "checked", "?", ":", "boolean", ";", "}", "export", "interface", "StrictTreeDataHelperOptions", "<", "N", "extends", "AbstractTreeNode", ">", "{", "tree", ":", "N", "[", "]", ";", "getNodeValue", "(", "node", ")", ":", "string", ";", "value", ":", "string", "[", "]", ";", "}", "export", "default", "class", "StrictTreeDataHelper", "<", "N", "extends", "AbstractTreeNode", ">", "{", "private", "readonly", "opts", ":", "StrictTreeDataHelperOptions", "<", "N", ">", ";", "private", "readonly", "valueSet", ":", "ReadonlySet", "<", "string", ">", ";", "private", "wrapperMap", ":", "Map", "<", "string", ",", "Wrapper", "<", "N", ">", ">", ";", "private", "rootWrapper", ":", "Wrapper", "<", "N", ">", ";", "constructor", "(", "opts", ")", "{", "this", ".", "opts", "=", "opts", ";", "this", ".", "valueSet", "=", "new", "Set", "(", "opts", ".", "value", ")", ";", "this", ".", "initWrapperTree", "(", ")", ";", "}", "private", "initWrapperTree", "(", ")", "{", "const", "{", "getNodeValue", "}", "=", "this", ".", "opts", ";", "this", ".", "rootWrapper", "=", "new", "Wrapper", "<", "N", ">", "(", "{", "root", ":", "true", ",", "children", ":", "[", "]", "}", ")", ";", "this", ".", "wrapperMap", "=", "new", "Map", "<", "string", ",", "Wrapper", "<", "N", ">", ">", "(", ")", ";", "const", "dfs", "=", "(", "parentWrapper", ",", "nodes", ")", "=>", "{", "for", "(", "const", "node", "of", "nodes", ")", "{", "const", "wrapper", "=", "new", "Wrapper", "<", "N", ">", "(", "{", "parent", ":", "parentWrapper", ",", "node", ",", "checked", ":", "this", ".", "valueSet", ".", "has", "(", "getNodeValue", "(", "node", ")", ")", ",", "}", ")", ";", "this", ".", "wrapperMap", ".", "set", "(", "getNodeValue", "(", "node", ")", ",", "wrapper", ")", ";", "parentWrapper", ".", "children", ".", "push", "(", "wrapper", ")", ";", "if", "(", "!", "isLeafNode", "(", "node", ")", ")", "{", "wrapper", ".", "children", "=", "[", "]", ";", "dfs", "(", "wrapper", ",", "node", ".", "children", "as", "N", "[", "]", ")", ";", "}", "}", "}", ";", "dfs", "(", "this", ".", "rootWrapper", ",", "this", ".", "opts", ".", "tree", ")", ";", "}", "private", "get", "value", "(", ")", "{", "return", "this", ".", "opts", ".", "value", ";", "}", "public", "isIndeterminate", "(", "nodeValue", ")", "{", "return", "false", ";", "}", "public", "isChecked", "(", "nodeValue", ")", "{", "return", "this", ".", "valueSet", ".", "has", "(", "nodeValue", ")", ";", "}", "public", "getValueAfterCheck", "(", "nodeValue", ")", "{", "if", "(", "!", "this", ".", "isChecked", "(", "nodeValue", ")", ")", "{", "return", "arrayUtils", ".", "merge", "(", "this", ".", "value", ",", "[", "nodeValue", "]", ")", ";", "}", "return", "this", ".", "value", ";", "}", "public", "getValueAfterUncheck", "(", "nodeValue", ")", "{", "if", "(", "this", ".", "isChecked", "(", "nodeValue", ")", ")", "{", "return", "arrayUtils", ".", "diff", "(", "this", ".", "value", ",", "[", "nodeValue", "]", ")", ";", "}", "return", "this", ".", "value", ";", "}", "public", "getValueAfterToggle", "(", "nodeValue", ")", "{", "if", "(", "this", ".", "isChecked", "(", "nodeValue", ")", ")", "{", "return", "this", ".", "getValueAfterUncheck", "(", "nodeValue", ")", ";", "}", "else", "{", "return", "this", ".", "getValueAfterCheck", "(", "nodeValue", ")", ";", "}", "}", "public", "getNode", "(", "nodeValue", ")", "{", "return", "this", ".", "wrapperMap", ".", "get", "(", "nodeValue", ")", "?.", "node", ";", "}", "public", "getCleanValue", "(", ")", "{", "return", "this", ".", "value", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 20, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, 546, null, 5, null, null, null, null, null, null, 709, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, null, null, null, null, 8, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null ]
1118
[ "import", "{", "AbstractTreeNode", ",", "isLeafNode", "}", "from", "'ali-react-table'", ";", "import", "{", "arrayUtils", "}", "from", "'./select-utils'", ";", "class", "Wrapper", "<", "N", "extends", "AbstractTreeNode", ">", "{", "constructor", "(", "input", "?", ")", "{", "Object", ".", "assign", "(", "this", ",", "input", ")", ";", "}", "/** 是否为根节点 */", "root", "?", ":", "boolean", ";", "/** 子节点数组 */", "children", "?", ":", "Wrapper", "<", "N", ">", "[", "]", ";", "/** 父节点 (parent wrapper node) */", "parent", "?", ":", "Wrapper", "<", "N", ">", ";", "/** 指向对应的普通节点 */", "node", ":", "N", ";", "/** 是否与其父节点脱离关联 */", "detached", "?", ":", "boolean", ";", "/** 是否「选中」 */", "checked", "?", ":", "boolean", ";", "/** 该节点是否「恰好选中」 (即节点的值是否在 value 数组中) */", "exactChecked", "?", ":", "boolean", ";", "/** 父节点是否被选中 */", "parentChecked", "?", ":", "boolean", ";", "/** 是否有任意子孙节点被选中 */", "anyDescendentsChecked", "?", ":", "boolean", ";", "/** 该节点的所有子孙节点是否均为选中 */", "allChildrenChecked", "?", ":", "boolean", ";", "}", "export", "type", "TreeCheckedStrategy", "=", "'all'", "|", "'parent'", "|", "'child'", ";", "export", "interface", "TreeDataHelperOptions", "<", "N", "extends", "AbstractTreeNode", ">", "{", "tree", ":", "N", "[", "]", ";", "getNodeValue", "(", "node", ")", ":", "string", ";", "value", ":", "string", "[", "]", ";", "checkedStrategy", ":", "TreeCheckedStrategy", ";", "isDetached", "?", "(", "node", ")", ":", "boolean", ";", "}", "export", "default", "class", "TreeDataHelper", "<", "N", "extends", "AbstractTreeNode", ">", "{", "private", "readonly", "opts", ":", "TreeDataHelperOptions", "<", "N", ">", ";", "private", "readonly", "valueSet", ":", "ReadonlySet", "<", "string", ">", ";", "private", "wrapperMap", ":", "Map", "<", "string", ",", "Wrapper", "<", "N", ">", ">", ";", "private", "rootWrapper", ":", "Wrapper", "<", "N", ">", ";", "constructor", "(", "opts", ")", "{", "this", ".", "opts", "=", "opts", ";", "this", ".", "valueSet", "=", "new", "Set", "(", "opts", ".", "value", ")", ";", "this", ".", "initWrapperTree", "(", ")", ";", "}", "private", "get", "value", "(", ")", "{", "return", "this", ".", "opts", ".", "value", ";", "}", "private", "isDetached", "=", "(", "node", ")", "=>", "{", "return", "this", ".", "opts", ".", "isDetached", "?.", "(", "node", ")", "??", "false", ";", "}", ";", "private", "initWrapperTree", "(", ")", "{", "const", "valueSet", "=", "new", "Set", "(", "this", ".", "value", ")", ";", "this", ".", "rootWrapper", "=", "new", "Wrapper", "<", "N", ">", "(", "{", "root", ":", "true", ",", "children", ":", "[", "]", "}", ")", ";", "this", ".", "wrapperMap", "=", "new", "Map", "<", "string", ",", "Wrapper", "<", "N", ">", ">", "(", ")", ";", "const", "getNodeValue", "=", "this", ".", "opts", ".", "getNodeValue", ";", "const", "{", "isDetached", ",", "wrapperMap", "}", "=", "this", ";", "dfs", "(", "this", ".", "rootWrapper", ",", "this", ".", "opts", ".", "tree", ",", "false", ")", ";", "function", "dfs", "(", "parentWrapper", ",", "nodes", ",", "inheritParentChecked", ")", "{", "parentWrapper", ".", "allChildrenChecked", "=", "true", ";", "if", "(", "process", ".", "env", ".", "NODE_ENV", "!==", "'production'", ")", "{", "if", "(", "nodes", ".", "length", ">", "0", "&&", "nodes", ".", "every", "(", "isDetached", ")", ")", "{", "console", ".", "warn", "(", "'TreeDataHelper 检测到部分节点的下所有子节点均为 detached 状态,这将导致该节点变为「无效节点」'", ",", "parentWrapper", ".", "node", ")", ";", "}", "}", "for", "(", "const", "node", "of", "nodes", ")", "{", "const", "detached", "=", "isDetached", "(", "node", ")", ";", "const", "exactChecked", "=", "valueSet", ".", "has", "(", "getNodeValue", "(", "node", ")", ")", ";", "if", "(", "exactChecked", "&&", "!", "detached", ")", "{", "parentWrapper", ".", "anyDescendentsChecked", "=", "true", ";", "}", "const", "parentChecked", "=", "!", "detached", "&&", "inheritParentChecked", ";", "const", "checked", "=", "exactChecked", "||", "parentChecked", ";", "const", "wrapper", "=", "new", "Wrapper", "<", "N", ">", "(", "{", "parent", ":", "parentWrapper", ",", "node", ",", "checked", ",", "exactChecked", ",", "parentChecked", ",", "anyDescendentsChecked", ":", "checked", ",", "detached", ",", "}", ")", ";", "wrapperMap", ".", "set", "(", "getNodeValue", "(", "node", ")", ",", "wrapper", ")", ";", "parentWrapper", ".", "children", ".", "push", "(", "wrapper", ")", ";", "if", "(", "!", "isLeafNode", "(", "node", ")", ")", "{", "wrapper", ".", "children", "=", "[", "]", ";", "dfs", "(", "wrapper", ",", "node", ".", "children", "as", "N", "[", "]", ",", "checked", ")", ";", "if", "(", "wrapper", ".", "anyDescendentsChecked", "&&", "!", "detached", ")", "{", "parentWrapper", ".", "anyDescendentsChecked", "=", "true", ";", "}", "if", "(", "wrapper", ".", "allChildrenChecked", ")", "{", "wrapper", ".", "checked", "=", "true", ";", "for", "(", "const", "child", "of", "wrapper", ".", "children", ")", "{", "if", "(", "!", "child", ".", "detached", ")", "{", "child", ".", "parentChecked", "=", "true", ";", "}", "}", "}", "}", "if", "(", "!", "wrapper", ".", "checked", "&&", "!", "detached", ")", "{", "parentWrapper", ".", "allChildrenChecked", "=", "false", ";", "}", "}", "}", "}", "public", "isIndeterminate", "(", "nodeValue", ")", "{", "const", "wrapper", "=", "this", ".", "wrapperMap", ".", "get", "(", "nodeValue", ")", ";", "return", "!", "wrapper", ".", "checked", "&&", "wrapper", ".", "anyDescendentsChecked", ";", "}", "public", "isChecked", "(", "nodeValue", ")", "{", "const", "wrapper", "=", "this", ".", "wrapperMap", ".", "get", "(", "nodeValue", ")", ";", "return", "wrapper", ".", "checked", ";", "}", "public", "getValueAfterCheck", "(", "nodeValue", ")", "{", "if", "(", "this", ".", "isChecked", "(", "nodeValue", ")", ")", "{", "return", "this", ".", "getCleanValue", "(", ")", ";", "}", "const", "nextValue", "=", "arrayUtils", ".", "merge", "(", "this", ".", "value", ",", "[", "nodeValue", "]", ")", ";", "return", "new", "TreeDataHelper", "(", "{", "...", "this", ".", "opts", ",", "value", ":", "nextValue", "}", ")", ".", "getCleanValue", "(", ")", ";", "}", "public", "getValueAfterUncheck", "(", "nodeValue", ")", "{", "if", "(", "!", "this", ".", "isChecked", "(", "nodeValue", ")", ")", "{", "return", "this", ".", "getCleanValue", "(", ")", ";", "}", "const", "wrapper", "=", "this", ".", "wrapperMap", ".", "get", "(", "nodeValue", ")", ";", "const", "{", "getNodeValue", "}", "=", "this", ".", "opts", ";", "const", "appendArray", "=", "getAppendArray", "(", "wrapper", ")", ";", "const", "removeSet", "=", "getRemoveSet", "(", "wrapper", ")", ";", "const", "nextValue", "=", "arrayUtils", ".", "diff", "(", "this", ".", "value", ".", "concat", "(", "appendArray", ")", ",", "removeSet", ")", ";", "return", "new", "TreeDataHelper", "(", "{", "...", "this", ".", "opts", ",", "value", ":", "nextValue", "}", ")", ".", "getCleanValue", "(", ")", ";", "function", "getAppendArray", "(", "startWrapper", ")", "{", "const", "result", "=", "[", "]", ";", "let", "current", "=", "startWrapper", ";", "while", "(", "current", ".", "parentChecked", "&&", "!", "current", ".", "detached", ")", "{", "for", "(", "const", "sibling", "of", "current", ".", "parent", ".", "children", ")", "{", "if", "(", "sibling", "===", "current", "||", "sibling", ".", "exactChecked", "||", "sibling", ".", "detached", ")", "{", "continue", ";", "}", "result", ".", "push", "(", "getNodeValue", "(", "sibling", ".", "node", ")", ")", ";", "}", "current", "=", "current", ".", "parent", ";", "}", "return", "result", ";", "}", "function", "getRemoveSet", "(", "startWrapper", ")", "{", "const", "result", "=", "new", "Set", "<", "string", ">", "(", ")", ";", "let", "wrapper", "=", "startWrapper", ";", "while", "(", "true", ")", "{", "result", ".", "add", "(", "getNodeValue", "(", "wrapper", ".", "node", ")", ")", ";", "if", "(", "wrapper", ".", "detached", "||", "!", "wrapper", ".", "parentChecked", ")", "{", "break", ";", "}", "wrapper", "=", "wrapper", ".", "parent", ";", "}", "function", "dfs", "(", "wrappers", ")", "{", "if", "(", "wrappers", "==", "null", ")", "{", "return", ";", "}", "for", "(", "const", "wrapper", "of", "wrappers", ")", "{", "if", "(", "wrapper", ".", "detached", "||", "!", "wrapper", ".", "checked", ")", "{", "continue", ";", "}", "result", ".", "add", "(", "getNodeValue", "(", "wrapper", ".", "node", ")", ")", ";", "if", "(", "!", "isLeafNode", "(", "wrapper", ")", "&&", "wrapper", ".", "anyDescendentsChecked", ")", "{", "dfs", "(", "wrapper", ".", "children", ")", ";", "}", "}", "}", "dfs", "(", "startWrapper", ".", "children", ")", ";", "return", "result", ";", "}", "}", "public", "getValueAfterToggle", "(", "nodeValue", ")", "{", "if", "(", "this", ".", "isChecked", "(", "nodeValue", ")", ")", "{", "return", "this", ".", "getValueAfterUncheck", "(", "nodeValue", ")", ";", "}", "else", "{", "return", "this", ".", "getValueAfterCheck", "(", "nodeValue", ")", ";", "}", "}", "public", "getNode", "(", "nodeValue", ")", "{", "return", "this", ".", "wrapperMap", ".", "get", "(", "nodeValue", ")", "?.", "node", ";", "}", "public", "getCleanValue", "(", ")", "{", "const", "{", "checkedStrategy", ",", "getNodeValue", "}", "=", "this", ".", "opts", ";", "const", "result", "=", "this", ".", "value", ".", "filter", "(", "(", "nodeValue", ")", "=>", "{", "return", "!", "this", ".", "wrapperMap", ".", "has", "(", "nodeValue", ")", ";", "}", ")", ";", "dfs", "(", "this", ".", "rootWrapper", ".", "children", ")", ";", "return", "result", ";", "function", "dfs", "(", "wrappers", ")", "{", "for", "(", "const", "wrapper", "of", "wrappers", ")", "{", "if", "(", "wrapper", ".", "checked", ")", "{", "if", "(", "checkedStrategy", "===", "'all'", ")", "{", "result", ".", "push", "(", "getNodeValue", "(", "wrapper", ".", "node", ")", ")", ";", "}", "else", "if", "(", "checkedStrategy", "===", "'parent'", ")", "{", "if", "(", "!", "wrapper", ".", "parentChecked", ")", "{", "result", ".", "push", "(", "getNodeValue", "(", "wrapper", ".", "node", ")", ")", ";", "}", "}", "else", "{", "if", "(", "isLeafNode", "(", "wrapper", ")", ")", "{", "result", ".", "push", "(", "getNodeValue", "(", "wrapper", ".", "node", ")", ")", ";", "}", "}", "}", "if", "(", "!", "isLeafNode", "(", "wrapper", ")", ")", "{", "dfs", "(", "wrapper", ".", "children", ")", ";", "}", "}", "}", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 20, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 546, null, 5, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 30, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 546, null, null, null, 5, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 30, null, 546, null, null, null, 30, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 5, null, null, null, null, null, 546, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1119
[ "import", "{", "isLeafNode", "}", "from", "'ali-react-table'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "Checkbox", "}", "from", "'../checkbox'", ";", "import", "{", "CaretDownIcon", "}", "from", "'./icons'", ";", "import", "{", "VirtualList", "}", "from", "'../virtual-list'", ";", "export", "interface", "TreeItem", "{", "/** */", "key", ":", "string", ";", "/** 节点标签 */", "label", "?", ":", "React", ".", "ReactNode", ";", "/** 是否禁用交互 */", "disabled", "?", ":", "boolean", ";", "/** 是否可选择 */", "checkable", "?", ":", "boolean", ";", "checked", "?", ":", "boolean", ";", "indeterminate", "?", ":", "boolean", ";", "onCheck", "?", "(", "nextChecked", ",", "detail", ")", ":", "void", ";", "onClick", "?", "(", "event", ")", ":", "void", ";", "hasChild", "?", ":", "boolean", ";", "children", "?", ":", "TreeItem", "[", "]", ";", "}", "export", "interface", "FlattenTreeItem", "extends", "TreeItem", "{", "expanded", ":", "boolean", ";", "depth", "?", ":", "number", ";", "}", "const", "TreeDiv", "=", "styled", ".", "div", ".", "withConfig", "(", "{", "componentId", ":", "'rex-tree'", "}", ")", "`\n font-size: var(--rex-fontSizes-body);\n cursor: default;\n`", ";", "const", "TreeItemDiv", "=", "styled", ".", "div", ".", "withConfig", "(", "{", "componentId", ":", "'rex-tree-item'", "}", ")", "`\n height: var(--rex-components-Tree-rowHeight);\n padding: 0 8px;\n display: flex;\n align-items: center;\n border-radius: 2px;\n\n &:hover {\n background: var(--rex-colors-emphasis-10);\n }\n\n .rex-tree-item-checkbox {\n height: auto;\n margin-left: 4px;\n // TODO 需要优化一下 checkbox 的样式\n margin-right: -16px;\n }\n\n .rex-tree-item-label {\n line-height: var(--rex-components-Tree-labelHeight);\n border-radius: 2px;\n margin: var(--rex-components-Tree-labelMargin);\n padding: var(--rex-components-Tree-labelPadding);\n\n &.selectable {\n cursor: pointer;\n &:hover {\n background: var(--rex-colors-emphasis-30);\n }\n &.selected {\n background: var(--rex-colors-primary-50);\n color: white;\n }\n }\n }\n\n .rex-tree-item-expand-icon {\n flex: 0 0 22px;\n display: flex;\n justify-content: center;\n align-self: stretch;\n align-items: center;\n cursor: pointer;\n\n > svg {\n transform: rotate(-90deg);\n transition: transform var(--animate-duration, 200ms) cubic-bezier(0.4, 1, 0.75, 0.9);\n }\n\n &.expanded > svg {\n transform: rotate(0deg);\n }\n\n &.none {\n cursor: default;\n }\n }\n`", ";", "export", "interface", "TreeViewProps", "{", "style", ":", "React", ".", "CSSProperties", ";", "className", ":", "string", ";", "dataSource", ":", "TreeItem", "[", "]", ";", "selectable", ":", "boolean", ";", "/** 受控用法,当前展开的节点的 key 数组 */", "expandedKeys", ":", "string", "[", "]", ";", "/** 受控用法,节点展开时的回调 */", "onExpand", "(", "nextExpandedKeys", ",", "detail", ")", ":", "void", ";", "selectedKeys", ":", "string", "[", "]", ";", "onSelect", "(", "nextSelectedKeys", ",", "detail", ")", ":", "void", ";", "virtualListRef", "?", ":", "React", ".", "Ref", "<", "VirtualList", "<", "FlattenTreeItem", ">", ">", ";", "}", "const", "INDENT_SIZE", "=", "16", ";", "function", "flattenDataSource", "(", "items", ",", "{", "expandedKeys", "}", ")", "{", "const", "expandedKeySet", "=", "new", "Set", "(", "expandedKeys", ")", ";", "const", "result", "=", "[", "]", ";", "dfs", "(", "items", ",", "0", ")", ";", "return", "result", ";", "function", "dfs", "(", "items", ",", "depth", ")", "{", "if", "(", "items", "==", "null", ")", "{", "return", ";", "}", "for", "(", "const", "item", "of", "items", ")", "{", "const", "expanded", "=", "expandedKeySet", ".", "has", "(", "item", ".", "key", ")", ";", "result", ".", "push", "(", "{", "...", "item", ",", "depth", ",", "expanded", "}", ")", ";", "if", "(", "expanded", ")", "{", "dfs", "(", "item", ".", "children", ",", "depth", "+", "1", ")", ";", "}", "}", "}", "}", "export", "const", "TreeView", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "TreeViewProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "dataSource", ",", "style", ",", "className", ",", "expandedKeys", ",", "onExpand", ",", "onSelect", ",", "selectedKeys", ",", "selectable", ",", "virtualListRef", ",", "}", "=", "props", ";", "const", "selectedKeySet", "=", "new", "Set", "(", "selectedKeys", ")", ";", "function", "renderTreeItem", "(", "item", ",", "flattenItemIndex", ",", "listRowDataset", ")", "{", "const", "depth", "=", "item", ".", "depth", "??", "0", ";", "let", "indentNode", "=", "null", ";", "if", "(", "depth", ">", "0", ")", "{", "indentNode", "=", "<", "span", "className", "=", "\"rex-tree-item-indention\"", "style", "=", "{", "{", "minWidth", ":", "INDENT_SIZE", "*", "depth", "}", "}", "/>;", "}", "let", "caret", "=", "<", "span", "className", "=", "\"rex-tree-item-expand-icon none\"", "/", ">", ";", "const", "needCaret", "=", "item", ".", "hasChild", "??", "!", "isLeafNode", "(", "item", ")", ";", "if", "(", "needCaret", ")", "{", "if", "(", "item", ".", "expanded", ")", "{", "caret", "=", "(", "<", "span", "className", "=", "\"rex-tree-item-expand-icon expanded\"", "onClick", "=", "{", "(", "event", ")", "=>", "{", "onExpand", "(", "expandedKeys", ".", "filter", "(", "(", "k", ")", "=>", "k", "!==", "item", ".", "key", ")", ",", "{", "key", ":", "item", ".", "key", ",", "action", ":", "'collapse'", ",", "event", ",", "}", ")", ";", "}", "}", ">", "<", "CaretDownIcon", "/>", "<", "/span>);", "}", "else", "{", "caret", "=", "(", "<", "span", "className", "=", "\"rex-tree-item-expand-icon collapsed\"", "onClick", "=", "{", "(", "event", ")", "=>", "{", "onExpand", "(", "[", "...", "expandedKeys", ",", "item", ".", "key", "]", ",", "{", "key", ":", "item", ".", "key", ",", "action", ":", "'expand'", ",", "event", ",", "}", ")", ";", "}", "}", ">", "<", "CaretDownIcon", "/>", "<", "/span>);", "}", "}", "let", "checkbox", "=", "null", ";", "if", "(", "item", ".", "checkable", ")", "{", "checkbox", "=", "(", "<", "Checkbox", "className", "=", "\"rex-tree-item-checkbox\"", "checked", "=", "{", "item", ".", "checked", "}", "indeterminate", "=", "{", "item", ".", "indeterminate", "}", "onChange", "=", "{", "(", "nextChecked", ",", "detail", ")", "=>", "{", "item", ".", "onCheck", "?.", "(", "nextChecked", ",", "{", "event", ":", "detail", "?.", "event", "}", ")", ";", "}", "}", "/>);", "}", "let", "label", "=", "<", "span", "className", "=", "{", "'rex-tree-item-label'", "}", ">", "{", "item", ".", "label", "}", "<", "/span>;", "if", "(", "selectable", ")", "{", "const", "selected", "=", "selectedKeySet", ".", "has", "(", "item", ".", "key", ")", ";", "label", "=", "(", "<", "span", "className", "=", "{", "cx", "(", "'rex-tree-item-label'", ",", "'selectable'", ",", "{", "selected", "}", ")", "}", "onClick", "=", "{", "(", "event", ")", "=>", "{", "const", "action", "=", "selected", "?", "'unselect'", ":", "'select'", ";", "const", "nextSelectedKeys", "=", "action", "===", "'unselect'", "?", "selectedKeys", ".", "filter", "(", "(", "k", ")", "=>", "k", "!==", "item", ".", "key", ")", ":", "selectedKeys", ".", "concat", "(", "[", "item", ".", "key", "]", ")", ";", "onSelect", "(", "nextSelectedKeys", ",", "{", "event", ",", "item", ",", "action", "}", ")", ";", "}", "}", ">", "{", "item", ".", "label", "}", "<", "/span>);", "}", "return", "(", "<", "TreeItemDiv", "key", "=", "{", "item", ".", "key", "}", "{", "...", "listRowDataset", "}", ">", "{", "indentNode", "}", "{", "caret", "}", "{", "checkbox", "}", "{", "label", "}", "<", "/TreeItemDiv>);", "}", "const", "flattened", "=", "flattenDataSource", "(", "dataSource", ",", "{", "expandedKeys", "}", ")", ";", "return", "(", "<", "TreeDiv", "ref", "=", "{", "ref", "}", "className", "=", "{", "cx", "(", "'rex-tree'", ",", "className", ")", "}", "style", "=", "{", "style", "}", ">", "<", "VirtualList", "ref", "=", "{", "virtualListRef", "}", "estimatedRowHeight", "=", "{", "32", "}", "renderRow", "=", "{", "renderTreeItem", "}", "rows", "=", "{", "flattened", "}", "/", ">", "<", "/TreeDiv>);", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 6, null, null, null, null, null, null, null, 103, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, 5, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1120
[ "import", "{", "collectNodes", ",", "makeRecursiveMapper", "}", "from", "'ali-react-table'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "composeHandlers", ",", "composeState", "}", "from", "'../../utils'", ";", "import", "StrictTreeDataHelper", "from", "'./utils/StrictTreeDataHelper'", ";", "import", "TreeDataHelper", ",", "{", "TreeCheckedStrategy", "}", "from", "'./utils/TreeDataHelper'", ";", "import", "{", "TreeItem", ",", "TreeView", ",", "TreeViewProps", "}", "from", "'./tree-view'", ";", "export", "interface", "TreeProps", "extends", "Partial", "<", "TreeViewProps", ">", "{", "/** 数据源,每个元素的结构为 { key, label, children } */", "dataSource", ":", "TreeItem", "[", "]", ";", "/** 非受控用法,是否默认展开所有节点 */", "defaultExpandAll", "?", ":", "boolean", ";", "/** 非受控用法,默认展开的节点的 key 数组 */", "defaultExpandedKeys", "?", ":", "string", "[", "]", ";", "/** 非受控用法,默认选中的节点的 key 数组 */", "defaultSelectedKeys", "?", ":", "string", "[", "]", ";", "/** 是否开启复选 */", "checkable", "?", ":", "boolean", ";", "/** 非受控用法,默认选中的节点 */", "defaultCheckedKeys", "?", ":", "string", "[", "]", ";", "/** 下拉框中的树勾选节点复选框是否完全受控(父子节点选中状态不再关联) */", "checkStrictly", "?", ":", "boolean", ";", "/**\n * 定义选中时回填的方式\n * - 'all'(返回所有选中的节点)\n * - 'parent'(父子节点都选中时只返回父节点)\n * - 'child'(父子节点都选中时只返回子节点)\n */", "checkedStrategy", "?", ":", "TreeCheckedStrategy", ";", "/** 受控用法,当前选中的节点 */", "checkedKeys", "?", ":", "string", "[", "]", ";", "/** 节点勾选时的回调 */", "onCheck", "?", "(", "nextCheckedKeys", ",", "detail", ")", ":", "void", ";", "}", "export", "const", "Tree", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "TreeProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "dataSource", ",", "className", ",", "style", ",", "expandedKeys", ":", "expandedKeysProp", ",", "onExpand", ":", "onExpandProp", ",", "defaultExpandAll", ",", "defaultExpandedKeys", ",", "checkable", ",", "checkedStrategy", "=", "'parent'", ",", "checkStrictly", ",", "checkedKeys", ":", "checkedKeysProp", ",", "onCheck", ":", "onCheckProp", ",", "defaultCheckedKeys", ",", "selectable", ",", "selectedKeys", ":", "selectedKeysProp", ",", "onSelect", ":", "onSelectProp", ",", "defaultSelectedKeys", ",", "virtualListRef", ",", "}", "=", "props", ";", "const", "[", "_expandedKey", ",", "_onExpand", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "defaultExpandAll", "?", "collectNodes", "(", "dataSource", ")", ".", "map", "(", "(", "item", ")", "=>", "item", ".", "key", ")", ":", "defaultExpandedKeys", "??", "[", "]", ")", ";", "const", "expandedKeys", "=", "composeState", "(", "expandedKeysProp", ",", "_expandedKey", ")", ";", "const", "onExpand", "=", "composeHandlers", "(", "onExpandProp", ",", "_onExpand", ")", ";", "const", "[", "_selectedKeys", ",", "_onSelect", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "defaultSelectedKeys", "??", "[", "]", ")", ";", "const", "selectedKeys", "=", "composeState", "(", "selectedKeysProp", ",", "_selectedKeys", ")", ";", "const", "onSelect", "=", "composeHandlers", "(", "onSelectProp", ",", "_onSelect", ")", ";", "const", "[", "_checkedKeys", ",", "_onCheck", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "defaultCheckedKeys", "??", "[", "]", ")", ";", "const", "checkedKeys", "=", "composeState", "(", "checkedKeysProp", ",", "_checkedKeys", ")", ";", "const", "onCheck", "=", "composeHandlers", "(", "onCheckProp", ",", "_onCheck", ")", ";", "const", "treeDataHelper", "=", "getTreeDataHelper", "(", ")", ";", "const", "processedDataSource", "=", "makeRecursiveMapper", "<", "TreeItem", ">", "(", "(", "item", ")", "=>", "(", "{", "...", "item", ",", "checkable", ",", "checked", ":", "treeDataHelper", ".", "isChecked", "(", "item", ".", "key", ")", ",", "indeterminate", ":", "treeDataHelper", ".", "isIndeterminate", "(", "item", ".", "key", ")", ",", "onCheck", "(", "nextChecked", ",", "{", "event", "}", ")", "{", "const", "action", "=", "nextChecked", "?", "'check'", ":", "'uncheck'", ";", "const", "nextCheckedKeys", "=", "action", "===", "'check'", "?", "treeDataHelper", ".", "getValueAfterCheck", "(", "item", ".", "key", ")", ":", "treeDataHelper", ".", "getValueAfterUncheck", "(", "item", ".", "key", ")", ";", "onCheck", "(", "nextCheckedKeys", ",", "{", "item", ",", "action", ",", "event", "}", ")", ";", "}", ",", "}", ")", ")", "(", "dataSource", ")", ";", "return", "(", "<", "TreeView", "ref", "=", "{", "ref", "}", "virtualListRef", "=", "{", "virtualListRef", "}", "className", "=", "{", "className", "}", "style", "=", "{", "style", "}", "dataSource", "=", "{", "processedDataSource", "}", "expandedKeys", "=", "{", "expandedKeys", "}", "onExpand", "=", "{", "onExpand", "}", "selectedKeys", "=", "{", "selectedKeys", "}", "onSelect", "=", "{", "onSelect", "}", "selectable", "=", "{", "Boolean", "(", "selectable", ")", "}", "/", ">", ")", ";", "function", "getTreeDataHelper", "(", ")", "{", "return", "checkStrictly", "?", "new", "StrictTreeDataHelper", "<", "TreeItem", ">", "(", "{", "value", ":", "checkedKeys", ",", "getNodeValue", ":", "(", "item", ")", "=>", "item", ".", "key", ",", "tree", ":", "dataSource", ",", "}", ")", ":", "new", "TreeDataHelper", "<", "TreeItem", ">", "(", "{", "value", ":", "checkedKeys", ",", "getNodeValue", ":", "(", "item", ")", "=>", "item", ".", "key", ",", "tree", ":", "dataSource", ",", "isDetached", ":", "(", ")", "=>", "false", ",", "checkedStrategy", ",", "}", ")", ";", "}", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 787, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 787, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1121
[ "import", "{", "isLeafNode", "}", "from", "'ali-react-table'", ";", "import", "React", "from", "'react'", ";", "import", "{", "TreeItem", "}", "from", "'../tree-view'", ";", "interface", "MatchResult", "{", "matched", ":", "boolean", ";", "startIndex", ":", "number", ";", "endIndex", ":", "number", ";", "input", ":", "string", ";", "}", "function", "match", "(", "item", ",", "keyword", ")", "{", "if", "(", "typeof", "item", ".", "label", "===", "'string'", ")", "{", "const", "str", "=", "item", ".", "label", ".", "toLowerCase", "(", ")", ";", "const", "needle", "=", "keyword", ".", "toLocaleLowerCase", "(", ")", ";", "const", "index", "=", "str", ".", "indexOf", "(", "needle", ")", ";", "return", "{", "matched", ":", "index", ">", "-", "1", ",", "startIndex", ":", "index", ",", "endIndex", ":", "index", "+", "needle", ".", "length", ",", "input", ":", "item", ".", "label", ",", "}", ";", "}", "return", "{", "matched", ":", "false", ",", "startIndex", ":", "0", ",", "endIndex", ":", "0", ",", "input", ":", "(", "item", ".", "label", "as", "unknown", ")", "as", "string", "}", ";", "}", "function", "decorate", "(", "matchResult", ")", "{", "const", "{", "input", ",", "startIndex", ",", "endIndex", ",", "matched", "}", "=", "matchResult", ";", "if", "(", "!", "matched", ")", "{", "return", "input", ";", "}", "return", "(", "<", "span", ">", "{", "input", ".", "slice", "(", "0", ",", "startIndex", ")", "}", "<", "span", "style", "=", "{", "{", "margin", ":", "1", ",", "fontWeight", ":", "'bold'", ",", "color", ":", "'#333'", ",", "background", ":", "'#fff8bd'", "}", "}", ">", "{", "input", ".", "slice", "(", "startIndex", ",", "endIndex", ")", "}", "<", "/span>", "{", "input", ".", "slice", "(", "endIndex", ")", "}", "<", "/span>);", "}", "const", "dfsResultOfLeafNode", "=", "{", "anyItemMatched", ":", "false", ",", "anyDescendentMatched", ":", "false", ",", "list", ":", "[", "]", ",", "}", ";", "interface", "DfsResult", "{", "list", ":", "TreeItem", "[", "]", ";", "anyItemMatched", ":", "boolean", ";", "anyDescendentMatched", ":", "boolean", ";", "}", "/**\n * 根据关键字 `keyword` 在树中进行搜索,返回结果为一个对象,表示本次搜索的结果。\n *\n * * `skipped` 搜索是否被跳过了(keyword 为空时搜索将被跳过)\n * * `filteredDataSource` 过滤之后的数据源\n * * `preferredExpandedKeys` 根据关键字计算得到的理想的 expandedKeys\n *\n * */", "export", "function", "searchTreeByKeyword", "(", "untrimmedKeyword", ",", "dataSource", ")", "{", "const", "keyword", "=", "untrimmedKeyword", ".", "trim", "(", ")", ";", "if", "(", "keyword", "===", "''", ")", "{", "return", "{", "filteredDataSource", ":", "dataSource", ",", "preferredExpandedKeys", ":", "[", "]", ",", "skipped", ":", "true", ",", "}", ";", "}", "const", "ctx", "=", "{", "expandedKeys", ":", "new", "Set", "<", "string", ">", "(", ")", ",", "}", ";", "const", "dfsResult", "=", "dfs", "(", "ctx", ",", "dataSource", ",", "false", ")", ";", "return", "{", "skipped", ":", "false", ",", "filteredDataSource", ":", "dfsResult", ".", "list", ",", "preferredExpandedKeys", ":", "Array", ".", "from", "(", "ctx", ".", "expandedKeys", ")", ",", "}", ";", "function", "dfs", "(", "ctx", ",", "items", ",", "anyAncestorMatched", ")", "{", "let", "anyDescendentMatched", "=", "false", ";", "let", "anyItemMatched", "=", "false", ";", "const", "result", "=", "[", "]", ";", "for", "(", "const", "item", "of", "items", ")", "{", "const", "selfMatchResult", "=", "match", "(", "item", ",", "keyword", ")", ";", "const", "subDfsResult", "=", "isLeafNode", "(", "item", ")", "?", "dfsResultOfLeafNode", ":", "dfs", "(", "ctx", ",", "item", ".", "children", ",", "selfMatchResult", ".", "matched", "||", "anyAncestorMatched", ")", ";", "const", "needIncludeInResult", "=", "anyAncestorMatched", "||", "selfMatchResult", ".", "matched", "||", "subDfsResult", ".", "anyDescendentMatched", ";", "if", "(", "needIncludeInResult", ")", "{", "result", ".", "push", "(", "{", "...", "item", ",", "label", ":", "decorate", "(", "selfMatchResult", ")", ",", "children", ":", "subDfsResult", ".", "list", ",", "}", ")", ";", "}", "if", "(", "subDfsResult", ".", "anyDescendentMatched", ")", "{", "ctx", ".", "expandedKeys", ".", "add", "(", "item", ".", "key", ")", ";", "}", "anyItemMatched", "||=", "selfMatchResult", ".", "matched", ";", "anyDescendentMatched", "||=", "selfMatchResult", ".", "matched", "||", "subDfsResult", ".", "anyDescendentMatched", ";", "}", "return", "{", "list", ":", "result", ",", "anyItemMatched", ",", "anyDescendentMatched", "}", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4522, null, 787, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4522, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 31911, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 2, null, 5, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 31911, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 31911, null, 6, null, 5, null, 8, null, null, null, 8, null, null, null, null, 8, null, null, null, null, 5, null, null, null, null, null, null, null, 787, null, null, null, null, null, 4522, null, null, null, null, null, null, null, null, null, 31911, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1122
[ "import", "{", "collectNodes", ",", "makeRecursiveMapper", "}", "from", "'ali-react-table'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", ",", "{", "useMemo", ",", "useRef", "}", "from", "'react'", ";", "import", "{", "pick", "}", "from", "'../../utils'", ";", "import", "{", "Input", "}", "from", "'../input'", ";", "import", "{", "AdaptivePopup", "}", "from", "'../overlays'", ";", "import", "{", "VirtualList", ",", "VirtualListAlign", "}", "from", "'../virtual-list'", ";", "import", "{", "SelectTrigger", "}", "from", "'./select-trigger'", ";", "import", "{", "SelectPanelDiv", "}", "from", "'./select-view'", ";", "import", "{", "Tree", ",", "TreeProps", "}", "from", "'./tree'", ";", "import", "{", "TreeItem", "}", "from", "'./tree-view'", ";", "import", "{", "ISelectAppearanceProps", ",", "ISelectPopupProps", ",", "ISelectSearchProps", ",", "selectAppearancePropKeys", ",", "TreeSelectItem", ",", "}", "from", "'./types'", ";", "import", "{", "searchTreeByKeyword", "}", "from", "'./utils/searchTreeByKeyword'", ";", "import", "{", "TreeCheckedStrategy", "}", "from", "'./utils/TreeDataHelper'", ";", "export", "interface", "TreeSelectViewProps", "extends", "ISelectPopupProps", ",", "ISelectAppearanceProps", ",", "ISelectSearchProps", "{", "value", ":", "string", "[", "]", ";", "onChange", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "disabled", "?", ":", "boolean", ";", "dataSource", "?", ":", "TreeSelectItem", "[", "]", ";", "expandedKeys", "?", ":", "TreeProps", "[", "'expandedKeys'", "]", ";", "onExpand", "?", ":", "TreeProps", "[", "'onExpand'", "]", ";", "selectMode", ":", "'single'", "|", "'multiple'", ";", "checkStrictly", "?", ":", "boolean", ";", "checkedStrategy", "?", ":", "TreeCheckedStrategy", ";", "}", "export", "const", "TreeSelectView", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "TreeSelectViewProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "value", ",", "onChange", ",", "dataSource", ",", "autoWidth", "=", "true", ",", "autoHeight", "=", "true", ",", "selectMode", ",", "disabled", ",", "expandedKeys", ",", "onExpand", ",", "visible", ",", "onRequestOpen", ",", "onRequestClose", ",", "searchValue", ",", "onSearch", ",", "showSearch", ",", "notFoundContent", ",", "autoScrollToFirstItemWhenOpen", "=", "true", ",", "autoCloseAfterSelect", "=", "selectMode", "===", "'single'", ",", "checkStrictly", ",", "checkedStrategy", ",", "popupProps", ",", "}", "=", "props", ";", "const", "appearance", "=", "pick", "(", "props", ",", "selectAppearancePropKeys", ")", ";", "const", "searchInputWrapperRef", "=", "useRef", "<", "HTMLDivElement", ">", "(", "null", ")", ";", "const", "virtualListRef", "=", "useRef", "<", "VirtualList", "<", "unknown", ">", ">", "(", ")", ";", "const", "treeDataSource", "=", "useMemo", "(", "(", ")", "=>", "(", "makeRecursiveMapper", "<", "TreeSelectItem", ">", "(", "(", "item", ")", "=>", "(", "{", "...", "item", ",", "key", ":", "item", ".", "value", ",", "}", ")", ")", "(", "dataSource", ")", "as", "unknown", ")", "as", "TreeItem", "[", "]", ",", "[", "dataSource", "]", ")", ";", "const", "getLabelByValue", "=", "useMemo", "(", "(", ")", "=>", "{", "const", "map", "=", "new", "Map", "(", "collectNodes", "(", "dataSource", ")", ".", "map", "(", "(", "item", ")", "=>", "[", "item", ".", "value", ",", "item", "]", ")", ")", ";", "return", "(", "v", ")", "=>", "map", ".", "get", "(", "v", ")", "?.", "label", "??", "v", ";", "}", ",", "[", "dataSource", "]", ")", ";", "const", "filteredTreeDataSource", "=", "useMemo", "(", "(", ")", "=>", "{", "let", "_filteredTreeDataSource", "=", "treeDataSource", ";", "if", "(", "showSearch", "&&", "searchValue", ".", "trim", "(", ")", ")", "{", "_filteredTreeDataSource", "=", "searchTreeByKeyword", "(", "searchValue", ",", "treeDataSource", ")", ".", "filteredDataSource", ";", "}", "return", "_filteredTreeDataSource", ";", "}", ",", "[", "searchValue", ",", "showSearch", ",", "treeDataSource", "]", ")", ";", "const", "isNotFound", "=", "dataSource", ".", "length", ">", "0", "&&", "filteredTreeDataSource", ".", "length", "===", "0", ";", "return", "(", "<", "AdaptivePopup", "{", "...", "popupProps", "}", "visible", "=", "{", "visible", "}", "onRequestOpen", "=", "{", "onRequestOpen", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "offset", "=", "{", "[", "0", ",", "4", "]", "}", "autoWidth", "=", "{", "autoWidth", "}", "autoHeight", "=", "{", "autoHeight", "}", "interactionKind", "=", "\"click\"", "onOpen", "=", "{", "(", ")", "=>", "{", "if", "(", "autoScrollToFirstItemWhenOpen", ")", "{", "const", "valueSet", "=", "new", "Set", "(", "value", ")", ";", "const", "list", "=", "virtualListRef", ".", "current", "as", "VirtualList", "<", "TreeSelectItem", ">", ";", "const", "index", "=", "list", ".", "props", ".", "rows", ".", "findIndex", "(", "(", "row", ")", "=>", "valueSet", ".", "has", "(", "row", ".", "value", ")", ")", ";", "if", "(", "index", "!==", "-", "1", ")", "{", "list", ".", "scrollToRow", "(", "index", ",", "VirtualListAlign", ".", "center", ")", ";", "}", "const", "input", "=", "searchInputWrapperRef", ".", "current", "?.", "querySelector", "(", "'input'", ")", ";", "input", "?.", "focus", "(", ")", ";", "}", "}", "}", "renderTarget", "=", "{", "(", "arg", ")", "=>", "(", "<", "SelectTrigger", "ref", "=", "{", "ref", "}", "visible", "=", "{", "visible", "}", "value", "=", "{", "value", "}", "dataSource", "=", "{", "dataSource", "}", "onChange", "=", "{", "onChange", "}", "selectMode", "=", "{", "selectMode", "}", "popupTargetRenderArg", "=", "{", "arg", "}", "getLabelByValue", "=", "{", "getLabelByValue", "}", "{", "...", "appearance", "}", "/>)} renderChildren={({ ref }) => (<SelectPanelDiv className=\"rex-select-panel\" ref={ref as React.RefObject<HTMLDivElement>}>", "{", "showSearch", "&&", "(", "<", "Input", "className", "=", "\"rex-select-search\"", "ref", "=", "{", "searchInputWrapperRef", "}", "placeholder", "=", "\"搜索\"", "hasClear", "value", "=", "{", "searchValue", "}", "onChange", "=", "{", "(", "nextSearchValue", ")", "=>", "{", "onSearch", "(", "nextSearchValue", ",", "{", "event", ":", "null", "}", ")", ";", "if", "(", "!", "visible", ")", "{", "onRequestOpen", "(", "'search'", ")", ";", "}", "}", "}", "/>)}", "{", "isNotFound", "&&", "notFoundContent", "}", "<", "Tree", "className", "=", "{", "cx", "(", "'rex-select-item-list-wrapper'", ",", "{", "'rex-empty'", ":", "isNotFound", "}", ")", "}", "virtualListRef", "=", "{", "virtualListRef", "as", "React", ".", "Ref", "<", "VirtualList", "<", "any", ">", ">", "}", "dataSource", "=", "{", "filteredTreeDataSource", "}", "expandedKeys", "=", "{", "expandedKeys", "}", "onExpand", "=", "{", "onExpand", "}", "checkable", "=", "{", "selectMode", "===", "'multiple'", "}", "checkStrictly", "=", "{", "checkStrictly", "}", "checkedStrategy", "=", "{", "checkedStrategy", "}", "checkedKeys", "=", "{", "value", "}", "onCheck", "=", "{", "(", "nextCheckedKeys", ",", "detail", ")", "=>", "{", "onChange", "(", "nextCheckedKeys", ",", "detail", ")", ";", "if", "(", "autoCloseAfterSelect", ")", "{", "onRequestClose", "(", ")", ";", "}", "}", "}", "selectable", "=", "{", "selectMode", "===", "'single'", "}", "selectedKeys", "=", "{", "value", "}", "onSelect", "=", "{", "(", "nextSelectedKeys", ",", "detail", ")", "=>", "{", "onChange", "(", "nextSelectedKeys", ",", "detail", ")", ";", "if", "(", "autoCloseAfterSelect", ")", "{", "onRequestClose", "(", ")", ";", "}", "}", "}", "/>", "<", "/SelectPanelDiv>)}/", ">", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 141, null, null, null, null, null, null, null, null, null, 35, null, null, null, null, null, null, null, null, null, null, 35, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, 31912, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 194, null, null, null, null, null, null, null, null, 19, null, null, null, null, null, null, null, null, null, null, null, null, 31912, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 30, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, 31912, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 83, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1123
[ "import", "{", "collectNodes", ",", "isLeafNode", ",", "makeRecursiveMapper", "}", "from", "'ali-react-table'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "composeHandlers", ",", "composeState", "}", "from", "'../../utils'", ";", "import", "{", "TreeProps", "}", "from", "'./tree'", ";", "import", "{", "TreeSelectView", "}", "from", "'./tree-select-view'", ";", "import", "{", "TreeItem", "}", "from", "'./tree-view'", ";", "import", "{", "ISelectAppearanceProps", ",", "ISelectPopupProps", ",", "ISelectSearchProps", ",", "TreeSelectItem", "}", "from", "'./types'", ";", "import", "{", "TreeCheckedStrategy", "}", "from", "'./utils/TreeDataHelper'", ";", "export", "interface", "MultiTreeSelectProps", "extends", "Partial", "<", "ISelectPopupProps", ">", ",", "ISelectAppearanceProps", ",", "Partial", "<", "ISelectSearchProps", ">", "{", "defaultValue", "?", ":", "string", "[", "]", ";", "value", "?", ":", "string", "[", "]", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "disabled", "?", ":", "boolean", ";", "dataSource", "?", ":", "TreeSelectItem", "[", "]", ";", "expandedKeys", "?", ":", "TreeProps", "[", "'expandedKeys'", "]", ";", "onExpand", "?", ":", "TreeProps", "[", "'onExpand'", "]", ";", "defaultExpandAll", "?", ":", "TreeProps", "[", "'defaultExpandAll'", "]", ";", "defaultExpandedKeys", "?", ":", "TreeProps", "[", "'defaultExpandedKeys'", "]", ";", "checkStrictly", "?", ":", "boolean", ";", "checkedStrategy", "?", ":", "TreeCheckedStrategy", ";", "}", "export", "const", "MultiTreeSelect", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "MultiTreeSelectProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "visible", ":", "visibleProp", ",", "defaultVisible", ",", "onRequestClose", ":", "onRequestCloseProp", ",", "onRequestOpen", ":", "onRequestOpenProp", ",", "defaultValue", ",", "value", ":", "valueProp", ",", "onChange", ":", "onChangeProp", ",", "expandedKeys", ":", "expandedKeysProp", ",", "onExpand", ":", "onExpandProp", ",", "defaultExpandAll", ",", "defaultExpandedKeys", ",", "searchValue", ":", "searchValueProp", ",", "onSearch", ":", "onSearchProp", ",", "dataSource", ",", "...", "others", "}", "=", "props", ";", "const", "[", "_value", ",", "_onChange", "]", "=", "useState", "(", "defaultValue", ")", ";", "const", "value", "=", "composeState", "(", "valueProp", ",", "_value", ")", ";", "const", "onChange", "=", "composeHandlers", "(", "onChangeProp", ",", "_onChange", ")", ";", "const", "treeDataSource", "=", "(", "makeRecursiveMapper", "<", "TreeSelectItem", ">", "(", "(", "item", ")", "=>", "(", "{", "...", "item", ",", "key", ":", "item", ".", "value", ",", "}", ")", ")", "(", "dataSource", ")", "as", "unknown", ")", "as", "TreeItem", "[", "]", ";", "const", "[", "_visible", ",", "_onVisibleChange", "]", "=", "useState", "(", "defaultVisible", ")", ";", "const", "visible", "=", "composeState", "(", "visibleProp", ",", "_visible", ")", ";", "const", "onRequestOpen", "=", "composeHandlers", "(", "onRequestOpenProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "true", ")", ")", ";", "const", "onRequestClose", "=", "composeHandlers", "(", "onRequestCloseProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "false", ")", ")", ";", "const", "[", "_searchValue", ",", "_onSearch", "]", "=", "useState", "(", "''", ")", ";", "const", "searchValue", "=", "composeState", "(", "searchValueProp", ",", "_searchValue", ")", ";", "const", "onSearch", "=", "composeHandlers", "(", "onSearchProp", ",", "_onSearch", ")", ";", "const", "[", "_expandedKeys", ",", "_onExpand", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "defaultExpandAll", "?", "collectNodes", "(", "treeDataSource", ")", ".", "filter", "(", "(", "item", ")", "=>", "!", "isLeafNode", "(", "item", ")", ")", ".", "map", "(", "(", "item", ")", "=>", "item", ".", "key", ")", ":", "defaultExpandedKeys", "??", "[", "]", ")", ";", "const", "expandedKeys", "=", "composeState", "(", "expandedKeysProp", ",", "_expandedKeys", ")", ";", "const", "onExpand", "=", "composeHandlers", "(", "onExpandProp", ",", "_onExpand", ")", ";", "return", "(", "<", "TreeSelectView", "ref", "=", "{", "ref", "}", "{", "...", "others", "}", "dataSource", "=", "{", "dataSource", "}", "value", "=", "{", "value", "}", "onChange", "=", "{", "onChange", "}", "selectMode", "=", "\"multiple\"", "searchValue", "=", "{", "searchValue", "}", "onSearch", "=", "{", "onSearch", "}", "visible", "=", "{", "visible", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "onRequestOpen", "=", "{", "onRequestOpen", "}", "expandedKeys", "=", "{", "expandedKeys", "}", "onExpand", "=", "{", "onExpand", "}", "/", ">", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 31912, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 787, null, null, null, null, null, null, null, null, null, null, null, null, 787, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1124
[ "import", "React", "from", "'react'", ";", "import", "{", "MultiTreeSelect", ",", "MultiTreeSelectProps", "}", "from", "'./multi-tree-select'", ";", "import", "{", "SingleTreeSelect", ",", "SingleTreeSelectProps", "}", "from", "'./single-tree-select'", ";", "export", "interface", "TreeSelectProps", "extends", "Omit", "<", "MultiTreeSelectProps", ",", "'defaultValue'", "|", "'value'", "|", "'onChange'", ">", "{", "defaultValue", "?", ":", "string", "|", "string", "[", "]", ";", "value", "?", ":", "string", "|", "string", "[", "]", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "multiple", "?", ":", "boolean", ";", "}", "type", "TreeSelectType", "=", "React", ".", "ExoticComponent", "<", "TreeSelectProps", "&", "React", ".", "RefAttributes", "<", "HTMLDivElement", ">", ">", "&", "{", "Single", ":", "typeof", "SingleTreeSelect", ";", "Multi", ":", "typeof", "MultiTreeSelect", ";", "}", ";", "export", "const", "TreeSelect", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "TreeSelectProps", ">", "(", "(", "{", "multiple", ",", "...", "props", "}", ",", "ref", ")", "=>", "{", "if", "(", "multiple", ")", "{", "return", "<", "MultiTreeSelect", "ref", "=", "{", "ref", "}", "{", "...", "(", "props", "as", "MultiTreeSelectProps", ")", "}", "/>;", "}", "else", "{", "return", "<", "SingleTreeSelect", "ref", "=", "{", "ref", "}", "{", "...", "(", "props", "as", "SingleTreeSelectProps", ")", "}", "/>;", "}", "}", ")", ";", "TreeSelect", ".", "Single", "=", "SingleTreeSelect", ";", "TreeSelect", ".", "Multi", "=", "MultiTreeSelect", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1125
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "{", "isLeafNode", ",", "makeRecursiveMapper", "}", "from", "'ali-react-table'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", ",", "{", "useMemo", ",", "useState", "}", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "composeHandlers", ",", "composeState", "}", "from", "'../../utils'", ";", "import", "{", "TickIcon", "}", "from", "'./icons'", ";", "import", "{", "TreeItem", "}", "from", "'./tree-view'", ";", "import", "{", "filterTreeByMaxDepth", ",", "toggleValue", "}", "from", "'./utils/select-utils'", ";", "export", "interface", "CascaderItem", "{", "label", "?", ":", "React", ".", "ReactNode", ";", "value", ":", "string", ";", "children", "?", ":", "CascaderItem", "[", "]", ";", "disabled", "?", ":", "boolean", ";", "}", "export", "interface", "ICascaderExpansionProps", "{", "/** 默认展开的节点 */", "defaultExpandedKeys", "?", ":", "string", "[", "]", ";", "/** 展开节点 */", "expandedKeys", "?", ":", "string", "[", "]", ";", "/** 节点展开的回调函数 */", "onExpand", "?", ":", "React", ".", "Dispatch", "<", "React", ".", "SetStateAction", "<", "string", "[", "]", ">", ">", ";", "}", "export", "interface", "CascaderProps", "extends", "ICascaderExpansionProps", "{", "style", "?", ":", "React", ".", "CSSProperties", ";", "className", "?", ":", "string", ";", "dataSource", ":", "CascaderItem", "[", "]", ";", "/** 选中的值,受控用法 */", "selectedKeys", "?", ":", "string", "[", "]", ";", "/** 默认选中的值,非受控用法 */", "defaultSelectedKeys", "?", ":", "string", "[", "]", ";", "/** 选中值改变的回调 */", "onSelect", "?", "(", "nextSelectedKeys", ",", "detail", ")", ":", "void", ";", "default", "maxDepth", "?", ":", "number", ";", "}", "const", "CascaderItemDiv", "=", "styled", ".", "div", "`\n font-size: var(--rex-fontSizes-body);\n height: var(--rex-components-Select-rowHeight);\n padding: 0 8px;\n border-radius: var(--rex-radii-s);\n display: flex;\n align-items: center;\n transition: background-color 200ms;\n cursor: pointer;\n\n &.expanded {\n background: var(--rex-colors-emphasis-10);\n }\n\n &:not(.disabled):hover {\n background: var(--rex-colors-emphasis-20);\n }\n\n &.disabled {\n color: var(--rex-colors-text-disabled);\n cursor: default;\n }\n\n &.selected,\n &.within-select {\n font-weight: 500;\n }\n\n .rex-cascader-item-label {\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .rex-cascader-icon-right {\n margin-left: auto;\n }\n`", ";", "const", "CascaderDiv", "=", "styled", ".", "div", "`\n display: inline-flex;\n\n .rex-cascader-column {\n width: 140px;\n height: 200px;\n overflow: auto;\n padding: 8px 4px;\n\n &.border-left {\n border-left: 1px solid var(--rex-colors-emphasis-20);\n }\n }\n`", ";", "export", "const", "Cascader", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "CascaderProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "dataSource", ":", "dataSourceProp", ",", "style", ",", "className", ",", "defaultExpandedKeys", ",", "expandedKeys", ":", "expandedKeysProp", ",", "onExpand", ":", "onExpandProp", ",", "selectedKeys", ":", "selectedKeysProp", ",", "onSelect", ":", "onSelectProp", ",", "defaultSelectedKeys", ",", "maxDepth", "=", "Infinity", ",", "}", "=", "props", ";", "const", "{", "dataSource", ",", "itemMap", ",", "parentMap", "}", "=", "useMemo", "(", "(", ")", "=>", "{", "const", "parentMap", "=", "new", "Map", "<", "string", ",", "string", ">", "(", ")", ";", "const", "itemMap", "=", "new", "Map", "<", "string", ",", "TreeItem", ">", "(", ")", ";", "let", "inputDataSource", "=", "dataSourceProp", ";", "if", "(", "isFinite", "(", "maxDepth", ")", "&&", "maxDepth", ">=", "0", ")", "{", "inputDataSource", "=", "filterTreeByMaxDepth", "(", "inputDataSource", ",", "maxDepth", ")", ";", "}", "const", "dataSource", "=", "makeRecursiveMapper", "(", "(", "input", ",", "{", "path", "}", ")", "=>", "{", "const", "depth", "=", "path", ".", "length", "-", "1", ";", "const", "resolvedKey", "=", "input", ".", "key", "??", "input", ".", "value", ";", "const", "parent", "=", "path", "[", "depth", "-", "1", "]", ";", "const", "item", "=", "{", "...", "input", ",", "key", ":", "resolvedKey", ",", "value", ":", "resolvedKey", ",", "}", ";", "itemMap", ".", "set", "(", "resolvedKey", ",", "item", ")", ";", "parentMap", ".", "set", "(", "resolvedKey", ",", "parent", "?.", "value", ")", ";", "return", "item", ";", "}", ")", "(", "inputDataSource", ")", "as", "TreeItem", "[", "]", ";", "return", "{", "parentMap", ",", "itemMap", ",", "dataSource", "}", ";", "}", ",", "[", "dataSourceProp", ",", "maxDepth", "]", ")", ";", "const", "[", "_selectedKeys", ",", "_onSelect", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "defaultSelectedKeys", "??", "[", "]", ")", ";", "const", "selectedKeys", "=", "composeState", "(", "selectedKeysProp", ",", "_selectedKeys", ")", ";", "const", "onSelect", "=", "composeHandlers", "(", "onSelectProp", ",", "_onSelect", ")", ";", "const", "selectParentKeys", "=", "getFirstSelectParentKeys", "(", ")", ";", "const", "[", "_expandedKeys", ",", "_onExpand", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "defaultExpandedKeys", "??", "selectParentKeys", ")", ";", "const", "expandedKeys", "=", "composeState", "(", "expandedKeysProp", ",", "_expandedKeys", ")", ";", "const", "onExpand", "=", "composeHandlers", "(", "onExpandProp", ",", "_onExpand", ")", ";", "const", "columns", "=", "[", "{", "key", ":", "'root'", ",", "depth", ":", "0", ",", "rows", ":", "dataSource", "}", "]", ";", "for", "(", "const", "key", "of", "expandedKeys", ")", "{", "const", "lastColumn", "=", "columns", "[", "columns", ".", "length", "-", "1", "]", ";", "const", "openCol", "=", "lastColumn", ".", "rows", ".", "find", "(", "(", "row", ")", "=>", "row", ".", "key", "===", "key", ")", ";", "if", "(", "openCol", "==", "null", "||", "isLeafNode", "(", "openCol", ")", ")", "{", "break", ";", "}", "columns", ".", "push", "(", "{", "depth", ":", "columns", ".", "length", ",", "rows", ":", "openCol", ".", "children", ",", "key", "}", ")", ";", "}", "return", "(", "<", "CascaderDiv", "ref", "=", "{", "ref", "}", "className", "=", "{", "cx", "(", "'rex-cascader'", ",", "className", ")", "}", "style", "=", "{", "style", "}", ">", "{", "columns", ".", "map", "(", "(", "{", "rows", ",", "depth", ",", "key", "}", ")", "=>", "(", "<", "div", "key", "=", "{", "`${", "depth", "}__${", "key", "}`", "}", "className", "=", "{", "cx", "(", "'rex-cascader-column'", ",", "{", "'border-left'", ":", "depth", ">", "0", "}", ")", "}", ">", "{", "rows", ".", "map", "(", "(", "row", ")", "=>", "{", "const", "selected", "=", "selectedKeys", ".", "includes", "(", "row", ".", "key", ")", ";", "const", "expanded", "=", "expandedKeys", ".", "includes", "(", "row", ".", "key", ")", ";", "const", "disabled", "=", "row", ".", "disabled", ";", "const", "withinSelect", "=", "selectParentKeys", ".", "includes", "(", "row", ".", "key", ")", ";", "const", "hasChildren", "=", "!", "isLeafNode", "(", "row", ")", ";", "const", "onClick", "=", "(", "event", ")", "=>", "{", "if", "(", "hasChildren", ")", "{", "onExpand", "(", "(", "keys", ")", "=>", "keys", ".", "slice", "(", "0", ",", "depth", ")", ".", "concat", "(", "expanded", "?", "[", "]", ":", "[", "row", ".", "key", "]", ")", ")", ";", "}", "else", "{", "const", "parent", "=", "parentMap", ".", "get", "(", "row", ".", "key", ")", ";", "const", "nextSelectedKeys", "=", "toggleValue", "(", "selectedKeys", ".", "filter", "(", "(", "v", ")", "=>", "parentMap", ".", "get", "(", "v", ")", "===", "parent", ")", ",", "row", ".", "key", ")", ";", "onSelect", "(", "nextSelectedKeys", ",", "{", "event", ",", "action", ":", "'select'", ",", "item", ":", "row", "}", ")", ";", "onExpand", "(", "(", "keys", ")", "=>", "keys", ".", "slice", "(", "0", ",", "depth", ")", ")", ";", "}", "}", ";", "return", "(", "<", "CascaderItemDiv", "key", "=", "{", "row", ".", "key", "}", "className", "=", "{", "cx", "(", "'rex-cascader-item'", ",", "{", "selected", ",", "'within-select'", ":", "withinSelect", ",", "expanded", ",", "disabled", ",", "}", ")", "}", "onClick", "=", "{", "disabled", "?", "null", ":", "onClick", "}", ">", "<", "div", "className", "=", "\"rex-cascader-item-label\"", "title", "=", "{", "String", "(", "row", ".", "label", ")", "}", ">", "{", "row", ".", "label", "}", "<", "/div>", "{", "hasChildren", "?", "(", "<", "Icon", "type", "=", "\"arrow-right-filling\"", "className", "=", "\"rex-cascader-icon-right\"", "/", ">", ")", ":", "selected", "?", "(", "<", "TickIcon", "className", "=", "\"rex-cascader-icon-right\"", "/", ">", ")", ":", "null", "}", "<", "/CascaderItemDiv>);", "}", ")", "}", "<", "/div>))}", "<", "/CascaderDiv>);", "function", "getFirstSelectParentKeys", "(", ")", "{", "if", "(", "selectedKeys", ".", "length", "===", "0", ")", "{", "return", "[", "]", ";", "}", "let", "key", "=", "selectedKeys", "[", "0", "]", ";", "const", "result", "=", "[", "]", ";", "while", "(", "true", ")", "{", "const", "parentKey", "=", "parentMap", ".", "get", "(", "key", ")", ";", "if", "(", "parentKey", "==", "null", ")", "{", "return", "result", ";", "}", "result", ".", "unshift", "(", "parentKey", ")", ";", "key", "=", "parentKey", ";", "}", "}", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 19, null, null, null, null, null, null, null, null, null, null, null, null, 19, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 787, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, 787, null, null, null, null, null, null, null, null, 787, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1126
[ "import", "{", "collectNodes", ",", "makeRecursiveMapper", "}", "from", "'ali-react-table'", ";", "import", "React", ",", "{", "useMemo", ",", "useRef", "}", "from", "'react'", ";", "import", "{", "pick", "}", "from", "'../../utils'", ";", "import", "{", "Input", "}", "from", "'../input'", ";", "import", "{", "AdaptivePopup", "}", "from", "'../overlays'", ";", "import", "{", "Cascader", ",", "ICascaderExpansionProps", "}", "from", "'./cascader'", ";", "import", "{", "SelectTrigger", "}", "from", "'./select-trigger'", ";", "import", "{", "SelectPanelDiv", "}", "from", "'./select-view'", ";", "import", "{", "TreeItem", "}", "from", "'./tree-view'", ";", "import", "{", "CascaderSelectItem", ",", "ISelectAppearanceProps", ",", "ISelectPopupProps", ",", "ISelectSearchProps", ",", "selectAppearancePropKeys", ",", "}", "from", "'./types'", ";", "import", "{", "searchTreeByKeyword", "}", "from", "'./utils/searchTreeByKeyword'", ";", "export", "interface", "CascaderSelectViewProps", "extends", "Partial", "<", "ISelectPopupProps", ">", ",", "ISelectAppearanceProps", ",", "Partial", "<", "ISelectSearchProps", ">", ",", "ICascaderExpansionProps", "{", "selectMode", ":", "'single'", "|", "'multiple'", ";", "value", "?", ":", "string", "[", "]", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "disabled", "?", ":", "boolean", ";", "dataSource", "?", ":", "CascaderSelectItem", "[", "]", ";", "maxDepth", "?", ":", "number", ";", "}", "/** 级联选择视图组件,完全受控,状态均由上层提供 */", "export", "const", "CascaderSelectView", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "CascaderSelectViewProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "value", ",", "onChange", ",", "dataSource", ",", "autoWidth", "=", "true", ",", "autoHeight", "=", "true", ",", "selectMode", ",", "disabled", ",", "expandedKeys", ",", "onExpand", ",", "visible", ",", "onRequestOpen", ",", "onRequestClose", ",", "searchValue", ",", "onSearch", ",", "showSearch", ",", "notFoundContent", ",", "maxDepth", ",", "autoScrollToFirstItemWhenOpen", "=", "true", ",", "autoCloseAfterSelect", "=", "selectMode", "===", "'single'", ",", "popupProps", ",", "}", "=", "props", ";", "const", "appearance", "=", "pick", "(", "props", ",", "selectAppearancePropKeys", ")", ";", "const", "searchInputWrapperRef", "=", "useRef", "<", "HTMLDivElement", ">", "(", "null", ")", ";", "const", "treeDataSource", "=", "useMemo", "(", "(", ")", "=>", "{", "return", "(", "makeRecursiveMapper", "<", "CascaderSelectItem", ">", "(", "(", "item", ")", "=>", "(", "{", "...", "item", ",", "key", ":", "item", ".", "value", ",", "}", ")", ")", "(", "dataSource", ")", "as", "unknown", ")", "as", "TreeItem", "[", "]", ";", "}", ",", "[", "dataSource", "]", ")", ";", "const", "getLabelByValue", "=", "useMemo", "(", "(", ")", "=>", "{", "const", "map", "=", "new", "Map", "(", "collectNodes", "(", "dataSource", ")", ".", "map", "(", "(", "item", ")", "=>", "[", "item", ".", "value", ",", "item", "]", ")", ")", ";", "return", "(", "v", ")", "=>", "map", ".", "get", "(", "v", ")", "?.", "label", "??", "v", ";", "}", ",", "[", "dataSource", "]", ")", ";", "const", "filteredTreeDataSource", "=", "useMemo", "(", "(", ")", "=>", "{", "let", "_filteredTreeDataSource", "=", "treeDataSource", ";", "if", "(", "showSearch", "&&", "searchValue", ".", "trim", "(", ")", ")", "{", "_filteredTreeDataSource", "=", "searchTreeByKeyword", "(", "searchValue", ",", "treeDataSource", ")", ".", "filteredDataSource", ";", "}", "return", "_filteredTreeDataSource", ";", "}", ",", "[", "searchValue", ",", "showSearch", ",", "treeDataSource", "]", ")", ";", "const", "isNotFound", "=", "dataSource", ".", "length", ">", "0", "&&", "filteredTreeDataSource", ".", "length", "===", "0", ";", "return", "(", "<", "AdaptivePopup", "{", "...", "popupProps", "}", "visible", "=", "{", "visible", "}", "onRequestOpen", "=", "{", "onRequestOpen", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "offset", "=", "{", "[", "0", ",", "4", "]", "}", "autoWidth", "=", "{", "autoWidth", "}", "autoHeight", "=", "{", "autoHeight", "}", "interactionKind", "=", "\"click\"", "onOpen", "=", "{", "(", ")", "=>", "{", "if", "(", "autoScrollToFirstItemWhenOpen", ")", "{", "}", "const", "input", "=", "searchInputWrapperRef", ".", "current", "?.", "querySelector", "(", "'input'", ")", ";", "input", "?.", "focus", "(", ")", ";", "}", "}", "renderTarget", "=", "{", "(", "arg", ")", "=>", "(", "<", "SelectTrigger", "ref", "=", "{", "ref", "}", "visible", "=", "{", "visible", "}", "value", "=", "{", "value", "}", "dataSource", "=", "{", "dataSource", "}", "onChange", "=", "{", "onChange", "}", "selectMode", "=", "{", "selectMode", "}", "popupTargetRenderArg", "=", "{", "arg", "}", "getLabelByValue", "=", "{", "getLabelByValue", "}", "disabled", "=", "{", "disabled", "}", "{", "...", "appearance", "}", "/>)} renderChildren={({ ref }) => (<SelectPanelDiv className=\"rex-select-panel\" ref={ref as React.RefObject<HTMLDivElement>}>", "{", "showSearch", "&&", "(", "<", "Input", "className", "=", "\"rex-select-search\"", "placeholder", "=", "\"搜索\"", "hasClear", "value", "=", "{", "searchValue", "}", "ref", "=", "{", "searchInputWrapperRef", "}", "onChange", "=", "{", "(", "nextSearchValue", ")", "=>", "{", "onSearch", "(", "nextSearchValue", ",", "{", "event", ":", "null", "}", ")", ";", "if", "(", "!", "visible", ")", "{", "onRequestOpen", "(", "'search'", ")", ";", "}", "}", "}", "/>)}", "{", "isNotFound", "&&", "notFoundContent", "}", "<", "Cascader", "dataSource", "=", "{", "filteredTreeDataSource", "as", "any", "}", "selectedKeys", "=", "{", "value", "}", "onSelect", "=", "{", "(", "...", "args", ")", "=>", "{", "onChange", "(", "...", "args", ")", ";", "if", "(", "autoCloseAfterSelect", ")", "{", "onRequestClose", "(", "'reason'", ")", ";", "}", "}", "}", "maxDepth", "=", "{", "maxDepth", "}", "expandedKeys", "=", "{", "expandedKeys", "}", "onExpand", "=", "{", "onExpand", "}", "/", ">", "<", "/SelectPanelDiv>)}/", ">", ")", ";", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 141, null, null, null, null, null, null, null, null, null, 35, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 31912, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 194, null, null, null, null, null, null, null, null, 19, null, null, null, null, null, null, null, null, null, null, null, null, 31912, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 83, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1127
[ "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "composeHandlers", ",", "composeState", "}", "from", "'../../utils'", ";", "import", "{", "ICascaderExpansionProps", "}", "from", "'./cascader'", ";", "import", "{", "CascaderSelectView", "}", "from", "'./cascader-select-view'", ";", "import", "{", "CascaderSelectItem", ",", "ISelectAppearanceProps", ",", "ISelectPopupProps", ",", "ISelectSearchProps", "}", "from", "'./types'", ";", "import", "{", "getLast", "}", "from", "'./utils/select-utils'", ";", "export", "interface", "SingleCascaderSelectProps", "extends", "Partial", "<", "ISelectPopupProps", ">", ",", "ISelectAppearanceProps", ",", "Partial", "<", "ISelectSearchProps", ">", ",", "ICascaderExpansionProps", "{", "defaultValue", "?", ":", "string", ";", "value", "?", ":", "string", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "disabled", "?", ":", "boolean", ";", "dataSource", "?", ":", "CascaderSelectItem", "[", "]", ";", "maxDepth", "?", ":", "number", ";", "}", "export", "const", "SingleCascaderSelect", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "SingleCascaderSelectProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "visible", ":", "visibleProp", ",", "defaultVisible", ",", "onRequestClose", ":", "onRequestCloseProp", ",", "onRequestOpen", ":", "onRequestOpenProp", ",", "defaultValue", ",", "value", ":", "valueProp", ",", "onChange", ":", "onChangeProp", ",", "expandedKeys", ":", "expandedKeysProp", ",", "onExpand", ":", "onExpandProp", ",", "defaultExpandedKeys", ",", "defaultSearchValue", ",", "searchValue", ":", "searchValueProp", ",", "onSearch", ":", "onSearchProp", ",", "dataSource", ",", "...", "others", "}", "=", "props", ";", "const", "[", "_value", ",", "_onChange", "]", "=", "useState", "(", "composeState", "(", "defaultValue", ",", "null", ")", ")", ";", "const", "value", "=", "composeState", "(", "valueProp", ",", "_value", ")", ";", "const", "onChange", "=", "composeHandlers", "(", "onChangeProp", ",", "_onChange", ")", ";", "const", "[", "_visible", ",", "_onVisibleChange", "]", "=", "useState", "(", "defaultVisible", ")", ";", "const", "visible", "=", "composeState", "(", "visibleProp", ",", "_visible", ")", ";", "const", "onRequestOpen", "=", "composeHandlers", "(", "onRequestOpenProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "true", ")", ")", ";", "const", "onRequestClose", "=", "composeHandlers", "(", "onRequestCloseProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "false", ")", ")", ";", "const", "[", "_searchValue", ",", "_onSearch", "]", "=", "useState", "(", "composeState", "(", "defaultSearchValue", ",", "''", ")", ")", ";", "const", "searchValue", "=", "composeState", "(", "searchValueProp", ",", "_searchValue", ")", ";", "const", "onSearch", "=", "composeHandlers", "(", "onSearchProp", ",", "_onSearch", ")", ";", "const", "[", "_expandedKeys", ",", "_onExpand", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "composeState", "(", "defaultExpandedKeys", ",", "[", "]", ")", ")", ";", "const", "expandedKeys", "=", "composeState", "(", "expandedKeysProp", ",", "_expandedKeys", ")", ";", "const", "onExpand", "=", "composeHandlers", "(", "onExpandProp", ",", "_onExpand", ")", ";", "return", "(", "<", "CascaderSelectView", "ref", "=", "{", "ref", "}", "{", "...", "others", "}", "selectMode", "=", "\"single\"", "dataSource", "=", "{", "dataSource", "}", "value", "=", "{", "[", "value", "]", "}", "onChange", "=", "{", "(", "nextValue", ",", "detail", ")", "=>", "onChange", "(", "getLast", "(", "nextValue", ")", ",", "detail", ")", "}", "searchValue", "=", "{", "searchValue", "}", "onSearch", "=", "{", "onSearch", "}", "visible", "=", "{", "visible", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "onRequestOpen", "=", "{", "onRequestOpen", "}", "expandedKeys", "=", "{", "expandedKeys", "}", "onExpand", "=", "{", "onExpand", "}", "/", ">", ")", ";", "}", ")", ";", "export", "interface", "MultiCascaderSelectProps", "extends", "Partial", "<", "ISelectPopupProps", ">", ",", "ISelectAppearanceProps", ",", "Partial", "<", "ISelectSearchProps", ">", ",", "ICascaderExpansionProps", "{", "defaultValue", "?", ":", "string", "[", "]", ";", "value", "?", ":", "string", "[", "]", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "disabled", "?", ":", "boolean", ";", "dataSource", "?", ":", "CascaderSelectItem", "[", "]", ";", "maxDepth", "?", ":", "number", ";", "}", "export", "const", "MultiCascaderSelect", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "MultiCascaderSelectProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "visible", ":", "visibleProp", ",", "defaultVisible", ",", "onRequestClose", ":", "onRequestCloseProp", ",", "onRequestOpen", ":", "onRequestOpenProp", ",", "defaultValue", ",", "value", ":", "valueProp", ",", "onChange", ":", "onChangeProp", ",", "expandedKeys", ":", "expandedKeysProp", ",", "onExpand", ":", "onExpandProp", ",", "defaultExpandedKeys", ",", "defaultSearchValue", ",", "searchValue", ":", "searchValueProp", ",", "onSearch", ":", "onSearchProp", ",", "dataSource", ",", "...", "others", "}", "=", "props", ";", "const", "[", "_value", ",", "_onChange", "]", "=", "useState", "(", "composeState", "(", "defaultValue", ",", "[", "]", ")", ")", ";", "const", "value", "=", "composeState", "(", "valueProp", ",", "_value", ")", ";", "const", "onChange", "=", "composeHandlers", "(", "onChangeProp", ",", "_onChange", ")", ";", "const", "[", "_visible", ",", "_onVisibleChange", "]", "=", "useState", "(", "defaultVisible", ")", ";", "const", "visible", "=", "composeState", "(", "visibleProp", ",", "_visible", ")", ";", "const", "onRequestOpen", "=", "composeHandlers", "(", "onRequestOpenProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "true", ")", ")", ";", "const", "onRequestClose", "=", "composeHandlers", "(", "onRequestCloseProp", ",", "(", ")", "=>", "_onVisibleChange", "(", "false", ")", ")", ";", "const", "[", "_searchValue", ",", "_onSearch", "]", "=", "useState", "(", "composeState", "(", "defaultSearchValue", ",", "''", ")", ")", ";", "const", "searchValue", "=", "composeState", "(", "searchValueProp", ",", "_searchValue", ")", ";", "const", "onSearch", "=", "composeHandlers", "(", "onSearchProp", ",", "_onSearch", ")", ";", "const", "[", "_expandedKeys", ",", "_onExpand", "]", "=", "useState", "<", "string", "[", "]", ">", "(", "composeState", "(", "defaultExpandedKeys", ",", "[", "]", ")", ")", ";", "const", "expandedKeys", "=", "composeState", "(", "expandedKeysProp", ",", "_expandedKeys", ")", ";", "const", "onExpand", "=", "composeHandlers", "(", "onExpandProp", ",", "_onExpand", ")", ";", "return", "(", "<", "CascaderSelectView", "ref", "=", "{", "ref", "}", "{", "...", "others", "}", "dataSource", "=", "{", "dataSource", "}", "value", "=", "{", "value", "}", "onChange", "=", "{", "onChange", "}", "selectMode", "=", "\"multiple\"", "searchValue", "=", "{", "searchValue", "}", "onSearch", "=", "{", "onSearch", "}", "visible", "=", "{", "visible", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "onRequestOpen", "=", "{", "onRequestOpen", "}", "expandedKeys", "=", "{", "expandedKeys", "}", "onExpand", "=", "{", "onExpand", "}", "/", ">", ")", ";", "}", ")", ";", "export", "interface", "CascaderSelectProps", "extends", "Omit", "<", "SingleCascaderSelectProps", ",", "'defaultValue'", "|", "'value'", "|", "'onChange'", ">", "{", "defaultValue", "?", ":", "string", "|", "string", "[", "]", ";", "value", "?", ":", "string", "|", "string", "[", "]", ";", "onChange", "?", "(", "nextValue", ",", "detail", ")", ":", "void", ";", "/** 是否多选 */", "multiple", "?", ":", "boolean", ";", "}", "type", "CascaderSelectType", "=", "React", ".", "ExoticComponent", "<", "CascaderSelectProps", "&", "React", ".", "RefAttributes", "<", "HTMLDivElement", ">", ">", "&", "{", "Single", ":", "typeof", "SingleCascaderSelect", ";", "Multi", ":", "typeof", "MultiCascaderSelect", ";", "}", ";", "export", "const", "CascaderSelect", "=", "React", ".", "forwardRef", "<", "HTMLDivElement", ",", "SelectProps", ">", "(", "(", "{", "multiple", ",", "...", "props", "}", ",", "ref", ")", "=>", "{", "if", "(", "multiple", ")", "{", "return", "<", "MultiCascaderSelect", "ref", "=", "{", "ref", "}", "{", "...", "(", "props", "as", "MultiCascaderSelectProps", ")", "}", "/>;", "}", "else", "{", "return", "<", "SingleCascaderSelect", "ref", "=", "{", "ref", "}", "{", "...", "(", "props", "as", "SingleCascaderSelectProps", ")", "}", "/>;", "}", "}", ")", ";", "CascaderSelect", ".", "Single", "=", "SingleCascaderSelect", ";", "CascaderSelect", ".", "Multi", "=", "MultiCascaderSelect", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1128
[ "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "cx", "from", "'classnames'", ";", "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "{", "useCheckbox", ",", "UseCheckboxProps", "}", "from", "'../checkbox/use-checkbox'", ";", "import", "{", "getToken", "}", "from", "'../../utils'", ";", "const", "SwitchBox", "=", "styled", ".", "span", "`\n position: relative;\n display: inline-block;\n vertical-align: middle;\n width: var(--rex-switch-width);\n height: var(--rex-switch-height);\n\n > input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n &.rex-checked > .rex-switch-track {\n background-color: var(--rex-colors-success-normal);\n }\n\n &.rex-checked > .rex-switch-slider {\n transform: var(--rex-switch-sliderCheckedTransform);\n }\n\n &.rex-disabled > .rex-switch-track {\n opacity: 0.48;\n }\n`", ";", "const", "SwitchTrack", "=", "styled", ".", "span", "<", "any", ">", "`\n display: flex;\n align-items: center;\n justify-content: ${", "(", "props", ")", "=>", "props", ".", "$justify", "};\n position: absolute;\n top: var(--rex-switch-sliderOffsetTop);\n left: 0;\n right: 0;\n color: var(--rex-colors-emphasis-0);\n background-color: var(--rex-colors-emphasis-40);\n height: var(--rex-switch-trackHeight);\n border-radius: var(--rex-switch-trackHeight);\n font-size: var(--rex-fontSizes-body);\n padding-left: var(--rex-space-m);\n padding-right: var(--rex-space-m);\n`", ";", "const", "SwitchSlider", "=", "styled", ".", "span", "`\n position: absolute;\n content: '';\n height: var(--rex-switch-height);\n width: var(--rex-switch-height);\n border-radius: 100%;\n box-shadow: var(--rex-shadows-lowDown);\n background-color: var(--rex-colors-emphasis-10);\n left: 0;\n -webkit-transition: 0.4s;\n transition: 0.4s;\n`", ";", "export", "interface", "SwitchProps", "extends", "Omit", "<", "UseCheckboxProps", ",", "'indeterminate'", "|", "'value'", ">", "{", "/**\n * 非受控初值\n */", "defaultValue", "?", ":", "boolean", ";", "/**\n * 受控值\n */", "value", "?", ":", "boolean", ";", "/**\n * 是否显示标签图标\n */", "hasLabel", "?", ":", "boolean", ";", "}", "export", "function", "Switch", "(", "props", ")", "{", "const", "{", "defaultValue", ",", "value", ",", "checked", ",", "defaultChecked", ",", "size", "=", "'medium'", ",", "hasLabel", ",", "style", ",", "className", ",", "...", "rest", "}", "=", "props", ";", "const", "{", "getInputProps", ",", "state", "}", "=", "useCheckbox", "(", "{", "defaultChecked", ":", "defaultValue", "??", "defaultChecked", ",", "checked", ":", "value", "??", "checked", ",", "...", "rest", ",", "}", ")", ";", "const", "clazz", "=", "cx", "(", "{", "'rex-checkbox'", ":", "true", ",", "[", "`rex-${", "size", "}`", "]", ":", "size", ",", "'rex-checked'", ":", "state", ".", "checked", ",", "'rex-disabled'", ":", "rest", ".", "disabled", ",", "}", ",", "className", ")", ";", "const", "switchStyle", "=", "{", "'--rex-switch-width'", ":", "getToken", "(", "`Switch.${", "size", "}.width`", ")", ",", "'--rex-switch-height'", ":", "getToken", "(", "`Switch.${", "size", "}.height`", ")", ",", "'--rex-switch-trackHeight'", ":", "getToken", "(", "`Switch.${", "size", "}.trackHeight`", ")", ",", "'--rex-switch-sliderOffsetTop'", ":", "getToken", "(", "`Switch.${", "size", "}.sliderOffsetTop`", ")", ",", "'--rex-switch-sliderCheckedTransform'", ":", "getToken", "(", "`Switch.${", "size", "}.sliderCheckedTransform`", ")", ",", "...", "style", ",", "}", ";", "let", "trackContent", ";", "if", "(", "hasLabel", ")", "{", "trackContent", "=", "state", ".", "checked", "?", "<", "Icon", "type", "=", "\"select-bold\"", "/", ">", ":", "<", "Icon", "type", "=", "\"close-bold\"", "/", ">", ";", "}", "return", "(", "<", "SwitchBox", "as", "=", "\"label\"", "style", "=", "{", "switchStyle", "}", "className", "=", "{", "clazz", "}", ">", "<", "input", "{", "...", "getInputProps", "(", "{", "}", ")", "}", "/", ">", "<", "SwitchTrack", "className", "=", "\"rex-switch-track\"", "$justify", "=", "{", "state", ".", "checked", "?", "'flex-start'", ":", "'flex-end'", "}", ">", "{", "trackContent", "}", "<", "/SwitchTrack>", "<", "SwitchSlider", "className", "=", "\"rex-switch-slider\"", "/", ">", "<", "/SwitchBox>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 4079, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1129
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "composeHandlers", ",", "composeState", "}", "from", "'../../utils'", ";", "import", "{", "Button", ",", "ButtonProps", "}", "from", "'../button'", ";", "import", "{", "Select", "}", "from", "'../select'", ";", "const", "defaultLocale", "=", "{", "previous", ":", "'上一页'", ",", "next", ":", "'下一页'", ",", "}", ";", "const", "range", "=", "(", "start", ",", "end", ")", "=>", "{", "const", "length", "=", "end", "-", "start", "+", "1", ";", "return", "Array", ".", "from", "(", "{", "length", "}", ",", "(", "_", ",", "i", ")", "=>", "start", "+", "i", ")", ";", "}", ";", "example", "const", "BOUNDARY_COUNT", "=", "1", ";", "example", "const", "SIBLING_COUNT", "=", "1", ";", "const", "PaginationDiv", "=", "styled", ".", "div", "`\n display: inline-flex;\n align-items: center;\n user-select: none;\n\n &.rex-fill {\n width: 100%;\n }\n\n > * {\n margin-left: var(--rex-space-m);\n &:first-child {\n margin-left: 0;\n }\n }\n\n .rex-pagination-page-size-select {\n display: inline-flex;\n align-items: center;\n margin-left: var(--rex-space-xl);\n\n .rex-pagination-page-size-select-label {\n margin-right: var(--rex-space-m);\n }\n }\n`", ";", "export", "interface", "PaginationProps", "{", "style", "?", ":", "React", ".", "CSSProperties", ";", "className", "?", ":", "string", ";", "fill", "?", ":", "boolean", ";", "/** 分页器按钮尺寸 */", "size", "?", ":", "ButtonProps", "[", "'size'", "]", ";", "/** 外观类型 */", "shape", "?", ":", "'normal'", "|", "'simple'", ";", "/** 总记录数 */", "total", "?", ":", "number", ";", "/** 受控的 page 页码值(页码从 1 开始) */", "current", "?", ":", "number", ";", "/** 默认激活的页码(页码从 1 开始) */", "defaultCurrent", "?", ":", "number", ";", "/** 页码变化时的回调 */", "onChange", "?", ":", "(", "nextValue", ":", "number", ")", "=>", "void", ";", "/** 是否禁用 */", "disabled", "?", ":", "boolean", ";", "/** 是否有下翻页按钮 */", "hasNextButton", "?", ":", "boolean", ";", "/** 是否有上翻页按钮 */", "hasPrevButton", "?", ":", "boolean", ";", "/** 每页数据的个数,需受控使用 */", "pageSize", "?", ":", "number", ";", "/** 非受控用法下,pageSize 的默认值 */", "defaultPageSize", "?", ":", "number", ";", "/** 每页个数选择的列表 */", "pageSizeList", "?", ":", "number", "[", "]", ";", "/** 是否有页数选择列表 */", "hasPageSizeList", "?", ":", "boolean", ";", "param", "nextPageSize", "onPageSizeChange", "?", "(", "nextPageSize", ")", ":", "void", ";", "/** 文案 */", "locale", "?", ":", "{", "previous", ":", "string", ";", "next", ":", "string", ";", "}", ";", "/**\n * type 设置为 normal 时,在页码数超过5页后,会显示跳转输入框与按钮;\n * 当设置 showJump 为 false 时,不再显示该跳转区域 */", "showJump", "?", ":", "boolean", ";", "}", "export", "function", "Pagination", "(", "{", "style", ",", "className", ",", "fill", ",", "size", "=", "'medium'", ",", "shape", "=", "'normal'", ",", "current", ":", "currentProp", ",", "defaultCurrent", "=", "1", ",", "onChange", ":", "onChangeProp", ",", "total", "=", "100", ",", "disabled", ",", "hasNextButton", "=", "true", ",", "hasPrevButton", "=", "true", ",", "hasPageSizeList", "=", "false", ",", "pageSize", ":", "pageSizeProp", ",", "defaultPageSize", "=", "10", ",", "pageSizeList", "=", "[", "5", ",", "10", ",", "20", "]", ",", "onPageSizeChange", ":", "onPageSizeChangeProp", ",", "locale", "=", "defaultLocale", ",", "}", ")", "{", "const", "[", "_pageSize", ",", "_onPageSizeChange", "]", "=", "useState", "(", "defaultPageSize", ")", ";", "const", "pageSize", "=", "composeState", "(", "pageSizeProp", ",", "_pageSize", ")", ";", "const", "onPageSizeChange", "=", "composeHandlers", "(", "onPageSizeChangeProp", ",", "_onPageSizeChange", ")", ";", "const", "[", "_current", ",", "_onChange", "]", "=", "useState", "(", "defaultCurrent", ")", ";", "const", "current", "=", "composeState", "(", "currentProp", ",", "_current", ")", ";", "const", "onChange", "=", "composeHandlers", "(", "onChangeProp", ",", "_onChange", ")", ";", "const", "pageCount", "=", "Math", ".", "max", "(", "1", ",", "Math", ".", "ceil", "(", "total", "/", "pageSize", ")", ")", ";", "const", "startPages", "=", "range", "(", "1", ",", "Math", ".", "min", "(", "BOUNDARY_COUNT", ",", "pageCount", ")", ")", ";", "const", "endPages", "=", "range", "(", "Math", ".", "max", "(", "pageCount", "-", "BOUNDARY_COUNT", "+", "1", ",", "BOUNDARY_COUNT", "+", "1", ")", ",", "pageCount", ")", ";", "const", "siblingsStart", "=", "Math", ".", "max", "(", "Math", ".", "min", "(", "current", "-", "SIBLING_COUNT", ",", "pageCount", "-", "BOUNDARY_COUNT", "-", "SIBLING_COUNT", "*", "2", "-", "1", ")", ",", "BOUNDARY_COUNT", "+", "2", ")", ";", "const", "siblingsEnd", "=", "Math", ".", "min", "(", "Math", ".", "max", "(", "current", "+", "SIBLING_COUNT", ",", "BOUNDARY_COUNT", "+", "SIBLING_COUNT", "*", "2", "+", "2", ")", ",", "endPages", ".", "length", ">", "0", "?", "endPages", "[", "0", "]", "-", "2", ":", "pageCount", "-", "1", ")", ";", "const", "nodes", "=", "[", "]", ";", "const", "pageBtn", "=", "(", "page", ")", "=>", "(", "<", "Button", "key", "=", "{", "page", "}", "size", "=", "{", "size", "}", "selected", "=", "{", "current", "===", "page", "}", "onClick", "=", "{", "(", ")", "=>", "onChange", "(", "page", ")", "}", ">", "{", "page", "}", "<", "/Button>);", "const", "prevBtn", "=", "(", ")", "=>", "(", "<", "Button", "key", "=", "\"prev\"", "size", "=", "{", "size", "}", "disabled", "=", "{", "disabled", "||", "current", "<=", "1", "}", "onClick", "=", "{", "(", ")", "=>", "onChange", "(", "current", "-", "1", ")", "}", ">", "{", "locale", ".", "previous", "}", "<", "/Button>);", "const", "nextBtn", "=", "(", ")", "=>", "(", "<", "Button", "key", "=", "\"next\"", "size", "=", "{", "size", "}", "disabled", "=", "{", "disabled", "||", "current", ">=", "pageCount", "}", "onClick", "=", "{", "(", ")", "=>", "onChange", "(", "current", "+", "1", ")", "}", ">", "{", "locale", ".", "next", "}", "<", "/Button>);", "if", "(", "shape", "===", "'simple'", ")", "{", "nodes", ".", "push", "(", "prevBtn", "(", ")", ",", "<", "span", "key", "=", "\"current\"", ">", "{", "current", "}", "/", "{", "pageCount", "}", "页", "<", "/span>, nextBtn());", "}", "else", "{", "if", "(", "hasPrevButton", ")", "{", "nodes", ".", "push", "(", "prevBtn", "(", ")", ")", ";", "}", "startPages", ".", "forEach", "(", "(", "page", ")", "=>", "{", "nodes", ".", "push", "(", "pageBtn", "(", "page", ")", ")", ";", "}", ")", ";", "if", "(", "siblingsStart", ">", "BOUNDARY_COUNT", "+", "2", ")", "{", "nodes", ".", "push", "(", "<", "Button", "key", "=", "\"start-ellipsis\"", "iconOnly", "shape", "=", "\"text\"", ">", "<", "Icon", "type", "=", "\"ellipsis\"", "/", ">", "<", "/Button>);", "}", "else", "if", "(", "BOUNDARY_COUNT", "+", "1", "<", "pageCount", "-", "BOUNDARY_COUNT", ")", "{", "nodes", ".", "push", "(", "pageBtn", "(", "BOUNDARY_COUNT", "+", "1", ")", ")", ";", "}", "range", "(", "siblingsStart", ",", "siblingsEnd", ")", ".", "forEach", "(", "(", "page", ")", "=>", "{", "nodes", ".", "push", "(", "pageBtn", "(", "page", ")", ")", ";", "}", ")", ";", "if", "(", "siblingsEnd", "<", "pageCount", "-", "BOUNDARY_COUNT", "-", "1", ")", "{", "nodes", ".", "push", "(", "<", "Button", "key", "=", "\"end-ellipsis\"", "iconOnly", "shape", "=", "\"text\"", ">", "<", "Icon", "type", "=", "\"ellipsis\"", "/", ">", "<", "/Button>);", "}", "else", "if", "(", "pageCount", "-", "BOUNDARY_COUNT", ">", "BOUNDARY_COUNT", ")", "{", "nodes", ".", "push", "(", "pageBtn", "(", "pageCount", "-", "BOUNDARY_COUNT", ")", ")", ";", "}", "endPages", ".", "forEach", "(", "(", "page", ")", "=>", "{", "nodes", ".", "push", "(", "pageBtn", "(", "page", ")", ")", ";", "}", ")", ";", "if", "(", "hasNextButton", ")", "{", "nodes", ".", "push", "(", "nextBtn", "(", ")", ")", ";", "}", "}", "if", "(", "hasPageSizeList", ")", "{", "nodes", ".", "push", "(", "<", "div", "key", "=", "\"page-size-select\"", "className", "=", "\"rex-pagination-page-size-select\"", ">", "<", "span", "className", "=", "\"rex-pagination-page-size-select-label\"", ">", "每页显示", "<", "/span>", "<", "Select", ".", "Single", "dataSource", "=", "{", "pageSizeList", ".", "map", "(", "String", ")", "}", "value", "=", "{", "String", "(", "pageSize", ")", "}", "onChange", "=", "{", "(", "value", ")", "=>", "onPageSizeChange", "(", "Number", "(", "value", ")", ")", "}", "size", "=", "{", "size", "}", "disabled", "=", "{", "disabled", "}", "style", "=", "{", "{", "width", ":", "80", "}", "}", "/>", "<", "/div>);", "}", "return", "(", "<", "PaginationDiv", "className", "=", "{", "cx", "(", "'rex-pagination'", ",", "{", "'rex-fill'", ":", "fill", "}", ",", "className", ")", "}", "style", "=", "{", "style", "}", ">", "{", "nodes", "}", "<", "/PaginationDiv>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, 3, null, 3, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, 3, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1130
[ "import", "{", "useDevice", "}", "from", "'../../../providers'", ";", "import", "{", "ActionListProps", "}", "from", "'../../action-list'", ";", "import", "{", "BoxProps", "}", "from", "'../../layout'", ";", "const", "getMaxNodes", "=", "(", "device", ")", "=>", "{", "if", "(", "device", "===", "'phone'", ")", "{", "return", "2", ";", "}", "return", "Infinity", ";", "}", ";", "export", "interface", "UseLegacyToolbarProps", "extends", "BoxProps", "{", "actions", "?", ":", "ActionListProps", "[", "'actions'", "]", ";", "}", "export", "function", "useLegacyToolbar", "(", "props", ")", "{", "const", "{", "actions", ":", "actionsProp", "=", "[", "]", ",", "...", "htmlProps", "}", "=", "props", ";", "const", "device", "=", "useDevice", "(", ")", ";", "const", "max", "=", "getMaxNodes", "(", "device", ".", "name", ")", ";", "let", "left", "=", "actionsProp", ";", "let", "more", "=", "[", "]", ";", "if", "(", "actionsProp", ".", "length", ">", "max", ")", "{", "left", "=", "actionsProp", ".", "slice", "(", "0", ",", "max", ")", ";", "more", "=", "actionsProp", ".", "slice", "(", "max", ",", "actionsProp", ".", "length", ")", ";", "}", "if", "(", "more", ".", "length", ")", "{", "left", ".", "push", "(", "{", "key", ":", "'more'", ",", "label", ":", "'更多'", ",", "children", ":", "more", ",", "}", ")", ";", "}", "return", "{", "actions", ":", "left", ",", "htmlProps", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 414, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1131
[ "import", "React", "from", "'react'", ";", "import", "{", "Box", "}", "from", "'../../layout'", ";", "import", "{", "ActionList", "}", "from", "'../../action-list'", ";", "import", "{", "useLegacyToolbar", ",", "UseLegacyToolbarProps", "}", "from", "'./use-legacy-toolbar'", ";", "export", "interface", "LegacyToolbarProps", "extends", "UseLegacyToolbarProps", "{", "}", "export", "function", "LegacyToolbar", "(", "props", ")", "{", "const", "{", "actions", ",", "htmlProps", "}", "=", "useLegacyToolbar", "(", "props", ")", ";", "return", "(", "<", "Box", "display", "=", "\"flex\"", "justifyContent", "=", "\"flex-end\"", "{", "...", "htmlProps", "}", ">", "<", "ActionList", "actions", "=", "{", "actions", "}", "/>", "<", "/Box>);", "}", "export", "function", "LegacyFooterToolbar", "(", "props", ")", "{", "const", "{", "actions", "}", "=", "useLegacyToolbar", "(", "props", ")", ";", "return", "(", "<", "Box", "bg", "=", "\"emphasis.0\"", "display", "=", "\"flex\"", "justifyContent", "=", "\"center\"", "borderTop", "=", "\"solid\"", "borderTopColor", "=", "\"line.border\"", "py", "=", "\"m\"", ">", "<", "ActionList", "hasSeparator", "=", "{", "false", "}", "actions", "=", "{", "actions", "}", "/", ">", "<", "/Box>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1132
[ "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "noop", "}", "from", "'../../utils'", ";", "import", "{", "ActionList", ",", "ActionListItem", "}", "from", "'../action-list'", ";", "const", "defaultConfigs", "=", "{", "new", ":", "{", "icon", ":", "'add'", ",", "label", ":", "'新增'", "}", ",", "refresh", ":", "{", "icon", ":", "'refresh'", ",", "label", ":", "'刷新'", "}", ",", "print", ":", "{", "icon", ":", "'print'", ",", "label", ":", "'打印'", "}", ",", "import", ":", "{", "icon", ":", "'import'", ",", "label", ":", "'导入'", "}", ",", "export", ":", "{", "icon", ":", "'download'", ",", "label", ":", "'导出'", "}", ",", "}", ";", "function", "mergeConfig", "(", "userConfig", ")", "{", "const", "defaultConfig", "=", "defaultConfigs", "[", "userConfig", ".", "key", "]", "||", "{", "}", ";", "return", "{", "...", "defaultConfig", ",", "...", "userConfig", ",", "props", ":", "{", "...", "defaultConfig", ".", "props", ",", "...", "userConfig", ".", "props", ",", "}", ",", "}", ";", "}", "const", "ToolbarDiv", "=", "styled", ".", "div", "`\n display: flex;\n align-items: center;\n\n .rex-toolbar-tip-node {\n margin-left: 6px;\n }\n\n .rex-toolbar-search-node:not(:first-child) {\n margin-left: 40px;\n }\n\n .rex-toolbar-second-actions {\n display: flex;\n flex: 1;\n justify-content: flex-end;\n }\n`", ";", "export", "interface", "ToolbarProps", "{", "/** 主操作列表(左侧) */", "leftActions", "?", ":", "ActionListItem", "[", "]", ";", "/** 次操作列表(左侧) */", "rightActions", "?", ":", "ActionListItem", "[", "]", ";", "param", "{", "string", "}", "key", "onActionClick", "?", "(", "key", ")", ":", "void", ";", "/**\n * 右侧节点(如果 rightNode 存在,则忽略 rightActions)\n */", "rightNode", "?", ":", "React", ".", "ReactNode", ";", "/**\n * 提示节点\n */", "tipNode", "?", ":", "React", ".", "ReactNode", ";", "/**\n * 搜索节点\n */", "searchNode", "?", ":", "React", ".", "ReactNode", ";", "className", "?", ":", "string", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "}", "export", "class", "Toolbar", "extends", "React", ".", "PureComponent", "<", "ToolbarProps", ">", "{", "static", "defaultProps", "=", "{", "leftActions", ":", "[", "]", "as", "ActionListItem", "[", "]", ",", "rightActions", ":", "[", "]", "as", "ActionListItem", "[", "]", ",", "onActionClick", ":", "noop", ",", "}", ";", "normalizeActions", "(", "actions", ")", "{", "return", "actions", ".", "map", "(", "(", "item", ")", "=>", "mergeConfig", "(", "item", ")", ")", ";", "}", "render", "(", ")", "{", "const", "{", "searchNode", ",", "tipNode", ",", "leftActions", ",", "rightActions", ",", "onActionClick", ",", "rightNode", ":", "rightNodeProp", ",", "className", ",", "style", ",", "}", "=", "this", ".", "props", ";", "let", "leftNode", "=", "null", ";", "if", "(", "leftActions", ".", "length", ")", "{", "leftNode", "=", "(", "<", "ActionList", "className", "=", "\"rex-toolbar-main-actions\"", "actions", "=", "{", "this", ".", "normalizeActions", "(", "leftActions", ")", "}", "onSelect", "=", "{", "onActionClick", "}", "/", ">", ")", ";", "}", "let", "rightNode", "=", "null", ";", "if", "(", "rightNodeProp", ")", "{", "rightNode", "=", "<", "div", "className", "=", "\"rex-toolbar-second-actions\"", ">", "{", "rightNodeProp", "}", "<", "/div>;", "}", "else", "if", "(", "rightActions", ".", "length", ">", "0", ")", "{", "rightNode", "=", "(", "<", "ActionList", "className", "=", "\"rex-toolbar-second-actions\"", "actions", "=", "{", "this", ".", "normalizeActions", "(", "rightActions", ")", "}", "onSelect", "=", "{", "onActionClick", "}", "/", ">", ")", ";", "}", "return", "(", "<", "ToolbarDiv", "className", "=", "{", "cx", "(", "'rex-toolbar'", ",", "className", ")", "}", "style", "=", "{", "style", "}", ">", "{", "leftNode", "}", "{", "tipNode", "&&", "<", "div", "className", "=", "\"rex-toolbar-tip-node\"", ">", "{", "tipNode", "}", "<", "/div>}", "{", "searchNode", "&&", "<", "div", "className", "=", "\"rex-toolbar-search-node\"", ">", "{", "searchNode", "}", "<", "/div>}", "{", "rightNode", "}", "<", "/ToolbarDiv>);", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 29919, null, null, null, 29919, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 5, null, null, null, null, null, null, null, null, 29919, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1133
[ "import", "{", "ChangeEvent", ",", "HTMLAttributes", ",", "useCallback", "}", "from", "'react'", ";", "import", "cx", "from", "'classnames'", ";", "export", "interface", "UseRadioProps", "{", "/**\n * 所属分组名\n */", "name", "?", ":", "string", ";", "/**\n * 分组值\n */", "value", "?", ":", "string", ";", "/**\n * 受控选中态\n */", "checked", "?", ":", "boolean", ";", "/**\n * 非受控选中初值\n */", "defaultChecked", "?", ":", "boolean", ";", "/**\n * 禁用\n */", "disabled", "?", ":", "boolean", ";", "/**\n * 只读\n */", "readOnly", "?", ":", "boolean", ";", "/**\n * 选中状态变化时的回调\n */", "onChange", "?", ":", "(", "event", ":", "ChangeEvent", "<", "HTMLInputElement", ">", ")", "=>", "void", ";", "className", "?", ":", "string", ";", "}", "export", "function", "useRadio", "(", "props", ")", "{", "const", "{", "checked", ",", "readOnly", ",", "disabled", ",", "onChange", ",", "value", ",", "name", ",", "className", ",", "...", "htmlProps", "}", "=", "props", ";", "const", "handleChange", "=", "useCallback", "(", "(", "event", ")", "=>", "{", "if", "(", "readOnly", "||", "disabled", ")", "{", "event", ".", "preventDefault", "(", ")", ";", "return", ";", "}", "onChange", "?.", "(", "event", ")", ";", "}", ",", "[", "disabled", ",", "readOnly", ",", "onChange", "]", ")", ";", "const", "getInputProps", "=", "useCallback", "(", "(", "props", ",", "ref", "=", "null", ")", "=>", "{", "return", "{", "type", ":", "'radio'", ",", "name", ",", "value", ",", "checked", ",", "onChange", ":", "handleChange", ",", "onClick", ":", "(", "e", ")", "=>", "{", "e", ".", "stopPropagation", "(", ")", ";", "}", ",", "ref", ",", "}", ";", "}", ",", "[", "name", ",", "value", ",", "handleChange", ",", "checked", "]", ")", ";", "const", "clazz", "=", "cx", "(", "{", "'rex-radio'", ":", "true", ",", "'rex-disabled'", ":", "disabled", ",", "}", ",", "className", ")", ";", "const", "getRootProps", "=", "(", ")", "=>", "{", "return", "{", "...", "htmlProps", ",", "disabled", ",", "className", ":", "clazz", ",", "}", "as", "HTMLAttributes", "<", "HTMLLabelElement", ">", ";", "}", ";", "return", "{", "getInputProps", ",", "getRootProps", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 103, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4787, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1134
[ "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "getToken", "}", "from", "'../../utils'", ";", "import", "{", "useRadioGroupContext", "}", "from", "'./context'", ";", "import", "{", "useRadio", ",", "UseRadioProps", "}", "from", "'./use-radio'", ";", "const", "RexRadio", "=", "styled", ".", "label", "`\n display: inline-flex;\n align-items: center;\n vertical-align: top;\n position: relative;\n cursor: pointer;\n\n .rex-radio-input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n }\n\n .rex-radio-checkmark {\n position: relative;\n height: ${", "getToken", "(", "'Radio.radioSize'", ")", "};\n width: ${", "getToken", "(", "'Radio.radioSize'", ")", "};\n border: 1px solid var(--rex-colors-line-border);\n border-radius: 50%;\n\n &:after {\n content: '';\n position: absolute;\n display: none;\n top: ${", "getToken", "(", "'Radio.radioMarkOffset'", ")", "};\n left: ${", "getToken", "(", "'Radio.radioMarkOffset'", ")", "};\n width: ${", "getToken", "(", "'Radio.radioMarkSize'", ")", "};\n height: ${", "getToken", "(", "'Radio.radioMarkSize'", ")", "};\n border-radius: 50%;\n background: var(--rex-colors-emphasis-0);\n }\n }\n\n .rex-radio-input:checked ~ .rex-radio-checkmark {\n border-color: var(--rex-colors-brand-normal);\n background-color: var(--rex-colors-brand-normal);\n\n &:after {\n display: block;\n }\n }\n\n .rex-radio-label {\n color: var(--rex-colors-text-body);\n font-size: var(--rex-fontSizes-body);\n margin-left: var(--rex-space-m);\n margin-right: var(--rex-space-m);\n }\n\n &.rex-disabled {\n .rex-radio-label {\n color: var(--rex-colors-text-disabled);\n }\n\n .rex-radio-checkmark {\n border-color: var(--rex-colors-line-disabled);\n background-color: var(--rex-colors-fill-disabled);\n }\n\n .rex-radio-input:checked ~ .rex-radio-checkmark {\n border-color: var(--rex-colors-brand-disabled);\n background-color: var(--rex-colors-brand-disabled);\n }\n }\n`", ";", "export", "interface", "RadioProps", "extends", "UseRadioProps", "{", "children", "?", ":", "React", ".", "ReactNode", ";", "}", "export", "const", "Radio", "=", "React", ".", "forwardRef", "<", "HTMLInputElement", ",", "RadioProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "checked", ":", "checkedProp", ",", "defaultChecked", "=", "false", ",", "value", ":", "valueProp", ",", "onChange", ":", "onChangeProp", ",", "children", ",", "...", "others", "}", "=", "props", ";", "const", "group", "=", "useRadioGroupContext", "(", ")", ";", "let", "checked", "=", "checkedProp", ";", "if", "(", "group", "?.", "value", "&&", "valueProp", ")", "{", "checked", "=", "group", ".", "value", "===", "valueProp", ";", "}", "let", "onChange", "=", "onChangeProp", ";", "if", "(", "group", "?.", "onSelect", "&&", "valueProp", ")", "{", "onChange", "=", "(", "e", ")", "=>", "{", "if", "(", "valueProp", "!==", "group", ".", "value", ")", "{", "group", ".", "onSelect", "(", "valueProp", ",", "true", ")", ";", "}", "onChangeProp", "&&", "onChangeProp", "(", "e", ")", ";", "}", ";", "}", "const", "name", "=", "props", "?.", "name", "??", "group", "?.", "name", ";", "const", "{", "getInputProps", ",", "getRootProps", "}", "=", "useRadio", "(", "{", "...", "others", ",", "value", ":", "valueProp", ",", "name", ",", "checked", ",", "defaultChecked", ",", "onChange", ",", "}", ")", ";", "const", "inputProps", "=", "getInputProps", "(", "{", "}", ",", "ref", ")", ";", "return", "(", "<", "RexRadio", "{", "...", "getRootProps", "(", ")", "}", ">", "<", "input", "className", "=", "\"rex-radio-input\"", "{", "...", "inputProps", "}", "/>", "<", "div", "className", "=", "\"rex-radio-checkmark\"", "/", ">", "{", "children", "&&", "<", "div", "className", "=", "\"rex-radio-label\"", ">", "{", "children", "}", "<", "/div>}", "<", "/RexRadio>);", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 64, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1135
[ "import", "React", ",", "{", "forwardRef", "}", "from", "'react'", ";", "import", "{", "useId", ",", "useSelectableList", ",", "UseSelectableListProps", "}", "from", "'../../hooks'", ";", "import", "{", "ListNode", "}", "from", "'../../types'", ";", "import", "{", "Flex", ",", "FlexProps", "}", "from", "'../layout'", ";", "import", "{", "RadioGroupProvider", "}", "from", "'./context'", ";", "import", "{", "Radio", "}", "from", "'./radio'", ";", "export", "interface", "RadioGroupProps", "extends", "Omit", "<", "UseSelectableListProps", "<", "string", ">", ",", "'selectMode'", "|", "'component'", ">", "{", "/**\n * 分组名,用于当页面存在多个 Group 时进行区分\n */", "name", "?", ":", "string", ";", "/**\n * 列表\n */", "dataSource", "?", ":", "ListNode", "<", "string", ">", "[", "]", ";", "/**\n * 排列方向\n */", "direction", "?", ":", "FlexProps", "[", "'direction'", "]", ";", "}", "export", "const", "RadioGroup", "=", "forwardRef", "<", "HTMLDivElement", ",", "RadioGroupProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "name", ":", "nameProp", ",", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "dataSource", "=", "[", "]", ",", "direction", "=", "'row'", ",", "...", "rest", "}", "=", "props", ";", "const", "{", "value", ",", "onSelect", "}", "=", "useSelectableList", "(", "{", "component", ":", "'RadioGroup'", ",", "selectMode", ":", "'single'", ",", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "}", ")", ";", "const", "fallbackName", "=", "useId", "(", "'radioGroup'", ")", ";", "const", "group", "=", "{", "name", ":", "nameProp", "||", "fallbackName", ",", "value", ",", "onSelect", ",", "}", ";", "return", "(", "<", "RadioGroupProvider", "value", "=", "{", "group", "}", ">", "<", "Flex", "role", "=", "\"radiogroup\"", "display", "=", "\"inline-flex\"", "wrap", "=", "\"wrap\"", "spacing", "=", "{", "4", "}", "direction", "=", "{", "direction", "}", "{", "...", "rest", "}", ">", "{", "dataSource", ".", "map", "(", "(", "{", "label", ",", "value", ",", "...", "rest", "}", ")", "=>", "(", "<", "Radio", "key", "=", "{", "value", "}", "value", "=", "{", "value", "}", "checked", "=", "{", "false", "}", "{", "...", "rest", "}", ">", "{", "label", "}", "<", "/Radio>))}", "<", "/Flex>", "<", "/RadioGroupProvider>);", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1136
[ "import", "{", "BaseTable", "as", "ArtBaseTable", ",", "BaseTableProps", ",", "getTreeDepth", ",", "LoadingContentWrapperProps", ",", "useTablePipeline", "as", "useArtTablePipeline", ",", "}", "from", "'ali-react-table'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "useColorMode", ",", "useDevice", "}", "from", "'../../providers'", ";", "import", "{", "THEMES", "}", "from", "'../../theme'", ";", "import", "{", "Checkbox", "}", "from", "'../checkbox'", ";", "import", "{", "Loading", "}", "from", "'../loading'", ";", "import", "{", "Tooltip", "}", "from", "'../overlays'", ";", "import", "{", "Radio", "}", "from", "'../radio'", ";", "function", "LoadingContentWrapper", "(", "props", ")", "{", "const", "{", "visible", ",", "children", "}", "=", "props", ";", "return", "(", "<", "div", "className", "=", "\"rex-loading-content-wrapper\"", ">", "{", "children", "}", "{", "visible", "&&", "(", "<", "div", "style", "=", "{", "{", "background", ":", "'var(--bgcolor)'", ",", "opacity", ":", "0.4", ",", "position", ":", "'absolute'", ",", "top", ":", "0", ",", "bottom", ":", "0", ",", "left", ":", "0", ",", "right", ":", "0", ",", "zIndex", ":", "50", ",", "pointerEvents", ":", "'none'", ",", "}", "}", "/>)}", "<", "/div>);", "}", "const", "LoadingIcon", "=", "styled", "(", "Loading", ".", "Icon", ")", "`\n display: block;\n margin: auto;\n width: 40px;\n height: 40px;\n`", ";", "const", "StyledArtBaseTable", "=", "styled", "(", "ArtBaseTable", ")", "`\n --row-height: 50px;\n --header-row-height: 36px;\n --border-color: #eee;\n --lock-shadow: rgba(100, 100, 100, 0.25) 0px 0 4px 2px;\n --cell-padding: 8px 20px;\n --line-height: 20px;\n\n --color: #333;\n --header-color: #333;\n --bgcolor: #fff;\n --header-bgcolor: #f5f5f5;\n --hover-bgcolor: #f5f5f5;\n --header-hover-bgcolor: #eee;\n --highlight-bgcolor: #f5f5f5;\n --header-highlight-bgcolor: #eee;\n\n &.dark {\n --bgcolor: #333;\n --header-bgcolor: #45494f;\n --hover-bgcolor: #46484a;\n --header-hover-bgcolor: #606164;\n --highlight-bgcolor: #191a1b;\n --header-highlight-bgcolor: #191a1b;\n --color: #dadde1;\n --header-color: #dadde1;\n --lock-shadow: rgb(37 37 37 / 0.5) 0 0 6px 2px;\n --border-color: #3c4045;\n }\n\n &.header-depth-1 {\n --header-row-height: 40px;\n }\n\n &.header-depth-0 {\n --header-row-height: 50px;\n }\n\n &:not(.bordered) {\n --cell-border-vertical: none;\n --header-cell-border-vertical: none;\n\n thead > tr.first th {\n border-top: none;\n }\n\n thead > tr.last th {\n border-bottom: none;\n }\n }\n\n th {\n font-weight: 500;\n }\n\n &.compact {\n --row-height: 40px;\n --header-row-height: 40px;\n --cell-padding: 8px 16px;\n }\n\n &.zebra tr.odd,\n tr.alternative {\n --bgcolor: var(--hover-bgcolor);\n }\n\n &.small {\n --cell-border-horizontal: none;\n --cell-padding: 8px;\n\n tr.odd {\n --bgcolor: #f1f6fa;\n }\n }\n`", ";", "export", "{", "BaseTableProps", ",", "ArtColumn", "as", "Column", "}", "from", "'ali-react-table'", ";", "see", "https", "export", "const", "BaseTable", "=", "React", ".", "forwardRef", "<", "ArtBaseTable", ",", "BaseTableProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "headerDepth", "=", "getTreeDepth", "(", "props", ".", "columns", ")", ";", "const", "colorMode", "=", "useColorMode", "(", ")", ";", "const", "device", "=", "useDevice", "(", ")", ";", "return", "(", "<", "StyledArtBaseTable", "theme", "=", "{", "THEMES", ".", "base", "}", "ref", "=", "{", "ref", "}", "{", "...", "props", "}", "className", "=", "{", "cx", "(", "props", ".", "className", ",", "{", "'header-depth-0'", ":", "headerDepth", "===", "0", ",", "'header-depth-1'", ":", "headerDepth", "===", "1", ",", "dark", ":", "colorMode", "===", "'dark'", ",", "small", ":", "device", ".", "name", "===", "'phone'", ",", "}", ")", "}", "components", "=", "{", "{", "LoadingContentWrapper", ",", "LoadingIcon", ",", "}", "}", "/>);", "}", ")", ";", "export", "const", "REX_TABLE_PIPELINE_CTX", "=", "{", "components", ":", "{", "Radio", ",", "Checkbox", ",", "Tooltip", "}", ",", "indents", ":", "{", "iconIndent", ":", "-", "8", ",", "iconGap", ":", "16", ",", "iconWidth", ":", "16", ",", "indentSize", ":", "24", "}", "as", "const", ",", "}", ";", "export", "function", "useTablePipeline", "(", ")", "{", "return", "useArtTablePipeline", "(", "REX_TABLE_PIPELINE_CTX", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, 4310, null, null, null, null, null, null, 414, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1137
[ "import", "{", "isLeafNode", "}", "from", "'ali-react-table'", ";", "import", "React", ",", "{", "useEffect", ",", "useState", "}", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "Button", "}", "from", "'../button'", ";", "import", "{", "Checkbox", "}", "from", "'../checkbox'", ";", "import", "{", "Drawer", "}", "from", "'../overlays'", ";", "import", "{", "Column", "}", "from", "'./base-table'", ";", "const", "TreeDiv", "=", "styled", ".", "div", "`\n .group {\n margin: 8px 0;\n .group {\n margin: 4px 0;\n }\n }\n\n .line {\n height: 28px;\n display: flex;\n align-items: center;\n\n .checkbox {\n flex: 0 0 50%;\n }\n }\n\n .group-header {\n height: 32px;\n display: flex;\n align-items: center;\n }\n\n .group-content {\n margin-left: 16px;\n }\n`", ";", "const", "StyledDrawerTitle", "=", "styled", ".", "div", "`\n display: flex;\n align-items: center;\n\n .actions {\n margin-left: auto;\n margin-right: 32px;\n\n > .action {\n padding: 0 4px;\n color: #3468ca;\n cursor: pointer;\n font-size: 14px;\n }\n }\n`", ";", "const", "Footer", "=", "styled", ".", "footer", "`\n flex: 0 0 48px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-top: 1px solid var(--rex-colors-emphasis-20);\n margin-top: auto;\n`", ";", "export", "interface", "ColumnFilterDrawerProps", "{", "visible", ":", "boolean", ";", "onRequestClose", "(", ")", ":", "void", ";", "enforceCheckedCodes", ":", "string", "[", "]", ";", "checkedCodes", ":", "string", "[", "]", ";", "onChange", "(", "nextCheckedCodes", ")", ":", "void", ";", "columns", ":", "Column", "[", "]", ";", "width", ":", "number", ";", "title", ":", "React", ".", "ReactNode", ";", "showCheckAll", ":", "boolean", ";", "showUncheckAll", ":", "boolean", ";", "}", "export", "function", "ColumnFilterDrawer", "(", "{", "visible", ",", "onRequestClose", ",", "enforceCheckedCodes", "=", "[", "]", ",", "checkedCodes", ",", "onChange", ",", "columns", ",", "width", "=", "500", ",", "title", "=", "'自定义显示列'", ",", "showCheckAll", "=", "true", ",", "showUncheckAll", "=", "true", ",", "}", ")", "{", "const", "[", "editingCheckedCodes", ",", "updateEditingCheckedCodes", "]", "=", "useState", "(", "checkedCodes", ")", ";", "const", "editingCheckedCodeSet", "=", "new", "Set", "(", "editingCheckedCodes", ")", ";", "const", "enforceCheckedCodeSet", "=", "new", "Set", "(", "enforceCheckedCodes", ")", ";", "useEffect", "(", "(", ")", "=>", "{", "if", "(", "visible", ")", "{", "updateEditingCheckedCodes", "(", "checkedCodes", ")", ";", "}", "}", ",", "[", "checkedCodes", ",", "visible", "]", ")", ";", "const", "onOk", "=", "(", ")", "=>", "{", "onRequestClose", "(", ")", ";", "onChange", "(", "editingCheckedCodes", ")", ";", "}", ";", "const", "onCheck", "=", "(", "targetCodes", ",", "action", ")", "=>", "{", "if", "(", "action", "===", "'check'", ")", "{", "updateEditingCheckedCodes", "(", "editingCheckedCodes", ".", "concat", "(", "targetCodes", ".", "filter", "(", "(", "code", ")", "=>", "!", "editingCheckedCodeSet", ".", "has", "(", "code", ")", ")", ")", ")", ";", "}", "else", "{", "const", "targetCodeSet", "=", "new", "Set", "(", "targetCodes", ")", ";", "updateEditingCheckedCodes", "(", "editingCheckedCodes", ".", "filter", "(", "(", "code", ")", "=>", "!", "targetCodeSet", ".", "has", "(", "code", ")", ")", ")", ";", "}", "}", ";", "function", "dfs", "(", "columns", ")", "{", "let", "lineCount", "=", "0", ";", "let", "tempLine", "=", "[", "]", ";", "const", "nodes", "=", "[", "]", ";", "const", "codes", "=", "[", "]", ";", "let", "allCheck", "=", "true", ";", "let", "anyCheck", "=", "false", ";", "function", "flushTempLine", "(", "force", ")", "{", "const", "FLAT_COUNT", "=", "2", ";", "if", "(", "(", "force", "&&", "tempLine", ".", "length", ">", "0", ")", "||", "tempLine", ".", "length", ">=", "FLAT_COUNT", ")", "{", "nodes", ".", "push", "(", "<", "div", "className", "=", "\"line\"", "key", "=", "{", "`line-${", "lineCount", "}`", "}", ">", "{", "tempLine", "}", "<", "/div>);", "lineCount", "+=", "1", ";", "tempLine", "=", "[", "]", ";", "}", "}", "function", "addToTempLine", "(", "node", ")", "{", "flushTempLine", "(", "false", ")", ";", "tempLine", ".", "push", "(", "node", ")", ";", "}", "for", "(", "let", "colIndex", "=", "0", ";", "colIndex", "<", "columns", ".", "length", ";", "colIndex", "++", ")", "{", "const", "col", "=", "columns", "[", "colIndex", "]", ";", "if", "(", "isLeafNode", "(", "col", ")", ")", "{", "if", "(", "col", ".", "code", ")", "{", "const", "enforceChecked", "=", "enforceCheckedCodeSet", ".", "has", "(", "col", ".", "code", ")", ";", "const", "checked", "=", "editingCheckedCodeSet", ".", "has", "(", "col", ".", "code", ")", ";", "if", "(", "!", "enforceChecked", ")", "{", "codes", ".", "push", "(", "col", ".", "code", ")", ";", "if", "(", "checked", ")", "{", "anyCheck", "=", "true", ";", "}", "else", "{", "allCheck", "=", "false", ";", "}", "}", "addToTempLine", "(", "<", "Checkbox", "key", "=", "{", "colIndex", "}", "className", "=", "\"checkbox\"", "checked", "=", "{", "checked", "||", "enforceChecked", "}", "disabled", "=", "{", "enforceChecked", "}", "onChange", "=", "{", "(", ")", "=>", "onCheck", "(", "[", "col", ".", "code", "]", ",", "checked", "?", "'uncheck'", ":", "'check'", ")", "}", ">", "{", "col", ".", "title", "??", "col", ".", "name", "}", "<", "/Checkbox>);", "}", "}", "else", "{", "const", "sub", "=", "dfs", "(", "col", ".", "children", ")", ";", "if", "(", "!", "sub", ".", "allCheck", ")", "{", "allCheck", "=", "false", ";", "}", "if", "(", "sub", ".", "anyCheck", ")", "{", "anyCheck", "=", "true", ";", "}", "codes", ".", "push", "(", "...", "sub", ".", "codes", ")", ";", "flushTempLine", "(", "true", ")", ";", "nodes", ".", "push", "(", "<", "div", "className", "=", "\"group\"", "key", "=", "{", "colIndex", "}", ">", "<", "div", "className", "=", "\"group-header\"", ">", "<", "Checkbox", "className", "=", "\"checkbox\"", "checked", "=", "{", "sub", ".", "allCheck", "}", "indeterminate", "=", "{", "!", "sub", ".", "allCheck", "&&", "sub", ".", "anyCheck", "}", "onChange", "=", "{", "(", ")", "=>", "onCheck", "(", "sub", ".", "codes", ",", "sub", ".", "allCheck", "?", "'uncheck'", ":", "'check'", ")", "}", ">", "{", "col", ".", "title", "??", "col", ".", "name", "}", "<", "/Checkbox>", "<", "/div>", "<", "div", "className", "=", "\"group-content\"", ">", "{", "sub", ".", "nodes", "}", "<", "/div>", "<", "/div>);", "}", "}", "flushTempLine", "(", "true", ")", ";", "return", "{", "nodes", ",", "allCheck", ",", "anyCheck", ",", "codes", "}", ";", "}", "const", "dfsResult", "=", "dfs", "(", "columns", ")", ";", "return", "(", "<", "Drawer", "visible", "=", "{", "visible", "}", "onRequestClose", "=", "{", "onRequestClose", "}", "canCloseByIcon", "canCloseByOutSideClick", "canCloseByEsc", "title", "=", "{", "<", "StyledDrawerTitle", ">", "<", "span", "style", "=", "{", "{", "fontSize", ":", "14", "}", "}", ">", "{", "title", "}", "<", "/span>", "<", "div", "className", "=", "\"actions\"", ">", "{", "showCheckAll", "&&", "(", "<", "span", "className", "=", "\"action\"", "onClick", "=", "{", "(", ")", "=>", "onCheck", "(", "dfsResult", ".", "codes", ",", "'check'", ")", "}", ">", "全选", "<", "/span>)}", "{", "showUncheckAll", "&&", "(", "<", "span", "className", "=", "\"action\"", "onClick", "=", "{", "(", ")", "=>", "onCheck", "(", "dfsResult", ".", "codes", ",", "'uncheck'", ")", "}", ">", "清空", "<", "/span>)}", "<", "/div>", "<", "/StyledDrawerTitle>} style={{ width }} footer={<Footer>", "<", "Button", "type", "=", "\"primary\"", "onClick", "=", "{", "onOk", "}", ">", "确认", "<", "/Button>", "<", "Button", "style", "=", "{", "{", "marginLeft", ":", "8", "}", "}", "onClick", "=", "{", "onRequestClose", "}", ">", "取消", "<", "/Button>", "<", "/Footer>}>", "<", "TreeDiv", ">", "{", "dfsResult", ".", "nodes", "}", "<", "/TreeDiv>", "<", "/Drawer>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1138
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "{", "isLeafNode", ",", "makeRecursiveMapper", ",", "TablePipeline", "}", "from", "'ali-react-table'", ";", "import", "React", "from", "'react'", ";", "function", "ColumnGroupTitle", "(", "{", "expanded", ",", "name", ",", "onExpand", ",", "}", ")", "{", "return", "(", "<", "div", "style", "=", "{", "{", "display", ":", "'flex'", ",", "alignItems", ":", "'center'", "}", "}", ">", "<", "Icon", "type", "=", "{", "expanded", "?", "'minus'", ":", "'add'", "}", "onClick", "=", "{", "(", ")", "=>", "onExpand", "(", "!", "expanded", ")", "}", "style", "=", "{", "{", "border", ":", "'1px solid #dcdcdc'", ",", "borderRadius", ":", "2", ",", "background", ":", "'white'", ",", "display", ":", "'flex'", ",", "alignItems", ":", "'center'", ",", "justifyContent", ":", "'center'", ",", "cursor", ":", "'pointer'", ",", "width", ":", "20", ",", "height", ":", "20", ",", "marginRight", ":", "8", ",", "color", ":", "'#999999'", ",", "}", "}", "/>", "<", "span", ">", "{", "name", "}", "<", "/span>", "<", "/div>);", "}", "const", "stateKey", "=", "'columnCollapse'", ";", "export", "interface", "ColumnCollapseFeatureOptions", "{", "expandedGroups", "?", ":", "string", "[", "]", ";", "onExpand", "?", ":", "(", "nextExpandedGroups", ":", "string", "[", "]", ")", "=>", "void", ";", "defaultExpandedGroups", "?", ":", "string", "[", "]", ";", "}", "export", "function", "columnCollapse", "(", "opts", "=", "{", "}", ")", "{", "return", "function", "columnCollapseFeature", "(", "pipeline", ")", "{", "const", "expandedGroups", "=", "opts", ".", "expandedGroups", "??", "pipeline", ".", "getStateAtKey", "(", "stateKey", ")", "??", "opts", ".", "defaultExpandedGroups", "??", "[", "]", ";", "const", "onExpand", "=", "(", "nextExpandedGroups", ")", "=>", "{", "opts", ".", "onExpand", "?.", "(", "nextExpandedGroups", ")", ";", "pipeline", ".", "setStateAtKey", "(", "stateKey", ",", "nextExpandedGroups", ")", ";", "}", ";", "return", "pipeline", ".", "mapColumns", "(", "makeRecursiveMapper", "(", "(", "col", ")", "=>", "{", "const", "isColumnGroup", "=", "!", "isLeafNode", "(", "col", ")", "&&", "col", ".", "code", "!=", "null", "&&", "col", ".", "features", "?.", "collapsible", "&&", "col", ".", "children", ".", "length", ">", "1", ";", "if", "(", "!", "isColumnGroup", ")", "{", "return", "col", ";", "}", "const", "group", "=", "col", ";", "const", "expanded", "=", "expandedGroups", ".", "includes", "(", "group", ".", "code", ")", ";", "const", "primaryColumn", "=", "group", ".", "children", ".", "find", "(", "(", "col", ")", "=>", "col", ".", "features", "?.", "primaryColumn", ")", "??", "group", ".", "children", "[", "0", "]", ";", "return", "{", "...", "group", ",", "title", ":", "(", "<", "ColumnGroupTitle", "expanded", "=", "{", "expanded", "}", "name", "=", "{", "group", ".", "name", "}", "onExpand", "=", "{", "(", ")", "=>", "{", "if", "(", "expanded", ")", "{", "onExpand", "(", "expandedGroups", ".", "filter", "(", "(", "g", ")", "=>", "g", "!==", "group", ".", "code", ")", ")", ";", "}", "else", "{", "onExpand", "(", "expandedGroups", ".", "concat", "(", "[", "group", ".", "code", "]", ")", ")", ";", "}", "}", "}", "/>),", "children", ":", "expanded", "?", "group", ".", "children", ":", "[", "primaryColumn", "]", ",", "}", ";", "}", ")", ")", ";", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1139
[ "import", "{", "flatMap", "}", "from", "'lodash-es'", ";", "import", "React", "from", "'react'", ";", "import", "*", "as", "ReactIs", "from", "'react-is'", ";", "import", "{", "Column", "}", "from", "'./base-table'", ";", "import", "{", "ProTable", "}", "from", "'./pro-table'", ";", "function", "getDisplayName", "(", "Component", ")", "{", "return", "Component", ".", "displayName", "||", "Component", ".", "name", "||", "'Component'", ";", "}", "/**\n * 从 JSX 中解析出 columns 数组。\n * 该方法主要是方便从老代码迁移,一般情况下推荐用户使用标准的 columns 数组写法来生成表格列。\n *\n * parseColumns 注意点:\n * - 使用 React.Fragment 来包括所有的 `<Column>`;\n * - column.dataIndex 是 column.code 的别名,在 ProTable 中推荐用 code 来代替 dataIndex;\n * - 解析过程中 div, h1 等 html 标签将被忽略\n * - 无效的组件将生成一个红色的警告列\n * */", "export", "function", "parseColumns", "(", "jsx", ")", "{", "function", "processChildren", "(", "children", ")", "{", "return", "flatMap", "(", "React", ".", "Children", ".", "toArray", "(", "children", ")", ",", "dfs", ")", ".", "filter", "(", "Boolean", ")", ";", "}", "return", "dfs", "(", "jsx", ")", ";", "function", "dfs", "(", "element", ")", "{", "if", "(", "typeof", "element", "===", "'string'", "||", "typeof", "element", "===", "'number'", ")", "{", "return", "null", ";", "}", "else", "if", "(", "ReactIs", ".", "isFragment", "(", "element", ")", "||", "typeof", "element", ".", "type", "===", "'string'", ")", "{", "return", "processChildren", "(", "element", ".", "props", ".", "children", ")", ";", "}", "else", "{", "const", "{", "type", ",", "props", "}", "=", "element", ";", "if", "(", "type", "===", "ProTable", ".", "Column", ")", "{", "return", "props", ";", "}", "else", "if", "(", "type", "===", "ProTable", ".", "ColumnGroup", ")", "{", "return", "{", "...", "props", ",", "children", ":", "processChildren", "(", "props", ".", "children", ")", ",", "}", ";", "}", "else", "{", "return", "{", "width", ":", "160", ",", "...", "props", ",", "title", ":", "(", "<", "span", "style", "=", "{", "{", "display", ":", "'inline-block'", ",", "maxWidth", ":", "'100%'", ",", "overflow", ":", "'hidden'", ",", "textOverflow", ":", "'ellipsis'", ",", "color", ":", "'red'", ",", "fontWeight", ":", "500", ",", "}", "}", "title", "=", "{", "getDisplayName", "(", "type", ")", "}", ">", "Unknown", "jsx", "tag", ":", "<", "br", "/> {getDisplayName(type)}", "<", "/span>),", "children", ":", "processChildren", "(", "props", ".", "children", ")", ",", "}", ";", "}", "}", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1140
[ "import", "{", "features", ",", "makeRecursiveMapper", ",", "SortItem", "as", "StandardSortItem", ",", "SortOrder", "}", "from", "'ali-react-table'", ";", "import", "React", "from", "'react'", ";", "import", "{", "Column", "}", "from", "'./base-table'", ";", "function", "warnFactory", "(", "fn", ")", "{", "let", "warned", "=", "false", ";", "return", "function", "(", ")", "{", "if", "(", "warned", ")", "{", "return", ";", "}", "warned", "=", "true", ";", "fn", "(", ")", ";", "}", ";", "}", "const", "warnColumnDataIndexIsDeprecated", "=", "warnFactory", "(", "(", ")", "=>", "{", "console", ".", "warn", "(", "'[@rexd/core] 用 `dataIndex` 来指定列的数据字段已经过时,请使用 `code` 进行代替'", ")", ";", "}", ")", ";", "export", "const", "compatWithDataIndex", "=", "makeRecursiveMapper", "<", "Column", "&", "{", "dataIndex", "?", ":", "string", ";", "}", ">", "(", "(", "col", ")", "=>", "{", "if", "(", "col", ".", "code", "==", "null", "&&", "col", ".", "dataIndex", "!=", "null", ")", "{", "warnColumnDataIndexIsDeprecated", "(", ")", ";", "return", "{", "...", "col", ",", "code", ":", "col", ".", "dataIndex", "}", ";", "}", "return", "col", ";", "}", ")", ";", "const", "warnColumnCellIsDeprecated", "=", "warnFactory", "(", "(", ")", "=>", "{", "console", ".", "warn", "(", "'[@rexd/core] 用 `cell` 来自定义列的渲染方法已经过时,请使用 `render` 进行代替。注意两者的参数顺序有所不同,详见相关文档'", ")", ";", "}", ")", ";", "export", "const", "compatWithColumnCell", "=", "makeRecursiveMapper", "<", "Column", "&", "{", "cell", "?", ":", "any", ";", "}", ">", "(", "(", "col", ")", "=>", "{", "if", "(", "col", ".", "render", "==", "null", "&&", "col", ".", "cell", "!=", "null", ")", "{", "warnColumnCellIsDeprecated", "(", ")", ";", "const", "cell", "=", "col", ".", "cell", ";", "col", "=", "{", "...", "col", ",", "render", "(", "value", ",", "row", ",", "index", ")", "{", "return", "cell", "(", "value", ",", "index", ",", "row", ")", ";", "}", ",", "}", ";", "}", "return", "col", ";", "}", ")", ";", "type", "CompatibleSortItem", "=", "{", "code", "?", ":", "string", ";", "dataIndex", "?", ":", "string", ";", "order", ":", "SortOrder", ";", "}", ";", "export", "type", "SortCompatibleWithDataIndexFeatureOptions", "=", "Omit", "<", "features", ".", "SortFeatureOptions", ",", "'sorts'", "|", "'defaultSorts'", ">", "&", "{", "sorts", "?", ":", "CompatibleSortItem", "[", "]", ";", "defaultSorts", "?", ":", "CompatibleSortItem", "[", "]", ";", "onChangeSorts", "?", "(", "nextSorts", ")", ":", "void", ";", "}", ";", "const", "warnSortDataIndexIsDeprecated", "=", "warnFactory", "(", "(", ")", "=>", "{", "console", ".", "warn", "(", "'[@rexd/core] 用 `dataIndex` 来指定表格排序字段已经过时,请使用 `code` 进行代替'", ")", ";", "}", ")", ";", "export", "function", "sortCompatibleWithDataIndex", "(", "opts", "=", "{", "}", ")", "{", "let", "defaultSorts", "=", "opts", ".", "defaultSorts", ";", "if", "(", "defaultSorts", ")", "{", "defaultSorts", "=", "defaultSorts", ".", "map", "(", "(", "item", ")", "=>", "{", "if", "(", "item", ".", "code", "==", "null", "&&", "item", ".", "dataIndex", "!=", "null", ")", "{", "warnSortDataIndexIsDeprecated", "(", ")", ";", "return", "{", "code", ":", "item", ".", "dataIndex", ",", "...", "item", "}", ";", "}", "return", "item", ";", "}", ")", ";", "}", "let", "sorts", "=", "opts", ".", "sorts", ";", "if", "(", "sorts", ")", "{", "sorts", "=", "sorts", ".", "map", "(", "(", "item", ")", "=>", "(", "{", "code", ":", "item", ".", "code", "??", "item", ".", "dataIndex", ",", "...", "item", "}", ")", ")", ";", "}", "let", "onChangeSorts", "=", "opts", ".", "onChangeSorts", ";", "if", "(", "onChangeSorts", ")", "{", "onChangeSorts", "=", "(", "nextSorts", ")", "=>", "{", "opts", ".", "onChangeSorts", "(", "nextSorts", ".", "map", "(", "(", "item", ")", "=>", "(", "{", "dataIndex", ":", "item", ".", "code", ",", "...", "item", "}", ")", ")", ")", ";", "}", ";", "}", "return", "features", ".", "sort", "(", "{", "...", "opts", ",", "defaultSorts", ":", "defaultSorts", "as", "StandardSortItem", "[", "]", ",", "sorts", ":", "sorts", "as", "StandardSortItem", "[", "]", ",", "onChangeSorts", ",", "}", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 33, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 19657, null, 0, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1141
[ "import", "{", "BaseTableProps", ",", "collectNodes", ",", "features", ",", "isLeafNode", ",", "makeRecursiveMapper", ",", "TablePipeline", ",", "}", "from", "'ali-react-table'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "omit", "}", "from", "'../../utils'", ";", "import", "{", "Pagination", ",", "PaginationProps", "}", "from", "'../pagination'", ";", "import", "{", "Toolbar", ",", "ToolbarProps", "}", "from", "'../toolbar'", ";", "import", "{", "BaseTable", ",", "Column", ",", "REX_TABLE_PIPELINE_CTX", "}", "from", "'./base-table'", ";", "import", "{", "ColumnFilterDrawer", "}", "from", "'./column-filter-drawer'", ";", "import", "{", "columnCollapse", ",", "ColumnCollapseFeatureOptions", "}", "from", "'./feature-columnCollapse'", ";", "import", "{", "parseColumns", "}", "from", "'./parseColumns'", ";", "import", "*", "as", "tableUtils", "from", "'./table-utils'", ";", "const", "ProTableWrapperDiv", "=", "styled", ".", "div", "`\n > .rex-toolbar {\n margin-bottom: 8px;\n }\n\n > .rex-table-footer {\n margin-top: 8px;\n }\n`", ";", "const", "featDict", "=", "{", "sort", ":", "tableUtils", ".", "sortCompatibleWithDataIndex", ",", "singleSelect", ":", "features", ".", "singleSelect", ",", "multiSelect", ":", "features", ".", "multiSelect", ",", "treeMode", ":", "features", ".", "treeMode", ",", "treeSelect", ":", "features", ".", "treeSelect", ",", "rowGrouping", ":", "features", ".", "rowGrouping", ",", "columnRangeHover", ":", "features", ".", "columnRangeHover", ",", "columnHover", ":", "features", ".", "columnHover", ",", "rowDetail", ":", "features", ".", "rowDetail", ",", "tips", ":", "features", ".", "tips", ",", "columnResize", ":", "features", ".", "columnResize", ",", "autoRowSpan", ":", "features", ".", "autoRowSpan", ",", "columnCollapse", ":", "columnCollapse", ",", "}", ";", "const", "featureNames", "=", "Object", ".", "keys", "(", "featDict", ")", "as", "(", "keyof", "typeof", "featDict", ")", "[", "]", ";", "export", "interface", "ProTableFeatureProps", "{", "sort", "?", ":", "boolean", "|", "tableUtils", ".", "SortCompatibleWithDataIndexFeatureOptions", ";", "singleSelect", "?", ":", "boolean", "|", "features", ".", "SingleSelectFeatureOptions", ";", "multiSelect", "?", ":", "boolean", "|", "features", ".", "MultiSelectFeatureOptions", ";", "treeMode", "?", ":", "boolean", "|", "features", ".", "TreeModeFeatureOptions", ";", "treeSelect", "?", ":", "boolean", "|", "features", ".", "TreeSelectFeatureOptions", ";", "rowGrouping", "?", ":", "boolean", "|", "features", ".", "RowGroupingFeatureOptions", ";", "columnRangeHover", "?", ":", "boolean", ";", "columnHover", "?", ":", "boolean", ";", "rowDetail", "?", ":", "boolean", "|", "features", ".", "RowDetailFeatureOptions", ";", "tips", "?", ":", "boolean", ";", "columnResize", "?", ":", "boolean", "|", "features", ".", "ColumnResizeFeatureOptions", ";", "autoRowSpan", "?", ":", "boolean", ";", "columnCollapse", "?", ":", "boolean", "|", "ColumnCollapseFeatureOptions", ";", "columnFilter", "?", ":", "ColumnFilterOptions", ";", "}", "const", "BEFORE_COLUMN_FILTER", "=", "'BEFORE_COLUMN_FILTER'", ";", "/**\n * 获取 pipeline 实例上的 cache,用于缓存一些中间计算结果\n * pro table 会使用 cache 来存放 visibleCodes 的计算结果 */", "function", "getPipelineCache", "(", "_pipeline", ")", "{", "const", "pipeline", "=", "_pipeline", ";", "if", "(", "pipeline", ".", "_cache", "==", "null", ")", "{", "pipeline", ".", "_cache", "=", "{", "}", ";", "}", "return", "pipeline", ".", "_cache", ";", "}", "interface", "ColumnFilterOptions", "{", "/**\n * 受控用法,当前可见的列;\n * 设置 column.features.enforceVisible=true 时,对应的列总是可见;\n * 不设置 visibleCodes 时为非受控用法,所有列均默认可见,可以通过 column.features.defaultVisible=false 配置默认不可见\n * */", "visibleCodes", "?", ":", "string", "[", "]", ";", "/** 受控用法,visibleCodes 发生变化的回调 */", "onChange", "?", "(", "nextVisibleCodes", ")", ":", "void", ";", "/** 为 columnFilter 提供自定义的列配置 */", "columns", "?", ":", "Column", "[", "]", ";", "/** 设置自定义列抽屉标题 */", "drawerTitle", "?", ":", "React", ".", "ReactNode", ";", "/** 设置自定义列抽屉宽度,默认 500px */", "drawerWidth", "?", ":", "number", ";", "/** 是否显示「全选」按钮 */", "showCheckAll", "?", ":", "boolean", ";", "/** 是否显示「清空」按钮 */", "showUncheckAll", "?", ":", "boolean", ";", "/** 设置为 true 后,columnFilter 将不对表格产生影响(表格会根据 props.columns 来决定渲染哪些列) */", "keepTableColumns", "?", ":", "boolean", ";", "}", "export", "interface", "ProTableProps", "extends", "BaseTableProps", ",", "ProTableFeatureProps", "{", "pagination", "?", ":", "PaginationProps", "&", "{", "keepDataSource", "?", ":", "boolean", ";", "}", ";", "toolbar", "?", ":", "ToolbarProps", "&", "{", "totalCount", "?", ":", "number", "|", "'auto'", "|", "'-'", ";", "}", ";", "footer", "?", ":", "ToolbarProps", ";", "wrapperProps", "?", ":", "React", ".", "HTMLAttributes", "<", "HTMLDivElement", ">", ";", "wrapperStyle", "?", ":", "React", ".", "CSSProperties", ";", "wrapperClassName", "?", ":", "string", ";", "}", "interface", "ProTableState", "{", "columnFilterState", ":", "{", "drawerVisible", ":", "boolean", ";", "visibleCodes", ":", "null", "|", "string", "[", "]", ";", "}", ";", "pipelineState", ":", "object", ";", "pagination", ":", "{", "pageSize", ":", "number", ";", "current", ":", "number", ";", "}", ";", "}", "/** 开箱即用的 ReX Design 表格组件 */", "export", "class", "ProTable", "extends", "React", ".", "Component", "<", "ProTableProps", ",", "ProTableState", ">", "{", "static", "Column", "=", "(", "props", ")", "=>", "{", "/** <ProTable.Column /> */", "return", "null", "as", "React", ".", "ReactElement", ";", "}", ";", "static", "ColumnGroup", "=", "(", "props", ")", "=>", "{", "/** <ProTable.ColumnGroup /> */", "return", "null", "as", "React", ".", "ReactElement", ";", "}", ";", "static", "parseColumns", "=", "parseColumns", ";", "static", "features", "=", "{", "...", "features", ",", "...", "featDict", ",", "}", ";", "constructor", "(", "props", ")", "{", "super", "(", "props", ")", ";", "this", ".", "state", "=", "{", "columnFilterState", ":", "{", "drawerVisible", ":", "false", ",", "visibleCodes", ":", "null", ",", "}", ",", "pipelineState", ":", "{", "}", ",", "pagination", ":", "{", "current", ":", "props", ".", "pagination", "?.", "defaultCurrent", "??", "1", ",", "pageSize", ":", "props", ".", "pagination", "?.", "pageSize", "??", "10", ",", "}", ",", "}", ";", "}", "_setPipelineState", "=", "(", "updater", ")", "=>", "{", "this", ".", "setState", "(", "(", "prev", ")", "=>", "(", "{", "pipelineState", ":", "updater", "(", "prev", ".", "pipelineState", ")", ",", "}", ")", ")", ";", "}", ";", "_setupFeatures", "(", "pipeline", ")", "{", "const", "props", "=", "this", ".", "props", ";", "for", "(", "const", "featName", "of", "featureNames", ")", "{", "let", "opts", "=", "props", "[", "featName", "]", ";", "if", "(", "opts", "==", "null", "||", "opts", "===", "false", ")", "{", "continue", ";", "}", "if", "(", "opts", "===", "true", ")", "{", "opts", "=", "{", "}", ";", "}", "const", "feature", "=", "featDict", "[", "featName", "]", ";", "pipeline", ".", "use", "(", "feature", "(", "opts", ")", ")", ";", "}", "}", "_onPaginationChange", "=", "(", "current", ")", "=>", "{", "this", ".", "props", ".", "pagination", ".", "onChange", "?.", "(", "current", ")", ";", "this", ".", "setState", "(", "(", "prev", ")", "=>", "(", "{", "pagination", ":", "{", "...", "prev", ".", "pagination", ",", "current", "}", ",", "}", ")", ")", ";", "}", ";", "_onPaginationPageSizeChange", "=", "(", "pageSize", ")", "=>", "{", "this", ".", "props", ".", "pagination", ".", "onPageSizeChange", "?.", "(", "pageSize", ")", ";", "this", ".", "setState", "(", "(", "prev", ")", "=>", "(", "{", "pagination", ":", "{", "...", "prev", ".", "pagination", ",", "pageSize", "}", ",", "}", ")", ")", ";", "}", ";", "_setColumnFilterDrawerVisibility", "=", "(", "visible", ")", "=>", "{", "this", ".", "setState", "(", "(", "prev", ")", "=>", "(", "{", "columnFilterState", ":", "{", "...", "prev", ".", "columnFilterState", ",", "drawerVisible", ":", "visible", ",", "}", ",", "}", ")", ")", ";", "}", ";", "_setColumnFilterVisibleCodes", "=", "(", "nextVisibleCodes", ")", "=>", "{", "this", ".", "setState", "(", "(", "prev", ")", "=>", "(", "{", "columnFilterState", ":", "{", "...", "prev", ".", "columnFilterState", ",", "visibleCodes", ":", "nextVisibleCodes", ",", "}", ",", "}", ")", ")", ";", "}", ";", "_renderToolbar", "(", "pipeline", ")", "{", "const", "{", "toolbar", ",", "columnFilter", "}", "=", "this", ".", "props", ";", "if", "(", "toolbar", "==", "null", "&&", "columnFilter", "==", "null", ")", "{", "return", "null", ";", "}", "let", "renderedColumnFilter", "=", "null", ";", "const", "{", "columnFilterState", "}", "=", "this", ".", "state", ";", "let", "{", "tipNode", ",", "totalCount", ",", "rightActions", "=", "[", "]", ",", "...", "others", "}", "=", "toolbar", "??", "{", "}", ";", "if", "(", "tipNode", "==", "null", ")", "{", "if", "(", "typeof", "totalCount", "===", "'string'", "||", "typeof", "totalCount", "===", "'number'", ")", "{", "tipNode", "=", "`共 ${", "totalCount", "} 条数据`", ";", "}", "}", "if", "(", "columnFilter", "!=", "null", ")", "{", "rightActions", ".", "push", "(", "{", "key", ":", "'columnFilter'", ",", "label", ":", "'自定义列'", ",", "icon", ":", "'setting'", ",", "onSelect", ":", "(", ")", "=>", "this", ".", "_setColumnFilterDrawerVisibility", "(", "true", ")", ",", "}", ")", ";", "const", "columnsBeforeFilter", "=", "pipeline", ".", "getColumns", "(", "BEFORE_COLUMN_FILTER", ")", ";", "const", "leafColumnsBeforeFilter", "=", "collectNodes", "(", "columnsBeforeFilter", ",", "'leaf-only'", ")", ";", "const", "enforceVisibleCodes", "=", "leafColumnsBeforeFilter", ".", "filter", "(", "(", "col", ")", "=>", "col", ".", "features", "?.", "enforceVisible", ")", ".", "map", "(", "(", "col", ")", "=>", "col", ".", "code", ")", ";", "const", "{", "visibleCodes", "}", "=", "getPipelineCache", "(", "pipeline", ")", ";", "renderedColumnFilter", "=", "(", "<", "ColumnFilterDrawer", "title", "=", "{", "columnFilter", ".", "drawerTitle", "}", "width", "=", "{", "columnFilter", ".", "drawerWidth", "}", "visible", "=", "{", "columnFilterState", ".", "drawerVisible", "}", "onRequestClose", "=", "{", "(", ")", "=>", "this", ".", "_setColumnFilterDrawerVisibility", "(", "false", ")", "}", "columns", "=", "{", "columnFilter", ".", "columns", "??", "columnsBeforeFilter", "}", "showCheckAll", "=", "{", "columnFilter", ".", "showCheckAll", "}", "showUncheckAll", "=", "{", "columnFilter", ".", "showUncheckAll", "}", "enforceCheckedCodes", "=", "{", "enforceVisibleCodes", "}", "checkedCodes", "=", "{", "visibleCodes", "}", "onChange", "=", "{", "(", "nextVisibleCodes", ")", "=>", "{", "columnFilter", ".", "onChange", "?.", "(", "nextVisibleCodes", ")", ";", "this", ".", "_setColumnFilterVisibleCodes", "(", "nextVisibleCodes", ")", ";", "}", "}", "/>);", "}", "return", "(", "<", ">", "<", "Toolbar", "tipNode", "=", "{", "tipNode", "}", "rightActions", "=", "{", "rightActions", "}", "{", "...", "others", "}", "/>", "{", "renderedColumnFilter", "}", "<", "/>);", "}", "_renderFooter", "(", ")", "{", "const", "{", "dataSource", ",", "pagination", ",", "footer", "}", "=", "this", ".", "props", ";", "if", "(", "footer", "||", "pagination", ")", "{", "return", "(", "<", "Toolbar", "{", "...", "footer", "}", "className", "=", "{", "cx", "(", "'rex-table-footer'", ",", "footer", "?.", "className", ")", "}", "rightNode", "=", "{", "footer", "?.", "rightNode", "??", "(", "pagination", "?", "(", "<", "Pagination", "total", "=", "{", "dataSource", ".", "length", "}", "{", "...", "omit", "(", "pagination", ",", "[", "'keepDataSource'", "]", ")", "}", "onChange", "=", "{", "this", ".", "_onPaginationChange", "}", "onPageSizeChange", "=", "{", "this", ".", "_onPaginationPageSizeChange", "}", "/", ">", ")", ":", "null", ")", "}", "/>);", "}", "return", "null", ";", "}", "render", "(", ")", "{", "const", "{", "style", ",", "className", ",", "primaryKey", ",", "dataSource", ",", "columns", ",", "getRowProps", ",", "wrapperProps", ",", "wrapperClassName", ",", "wrapperStyle", ",", "toolbar", ",", "pagination", ",", "columnFilter", ",", "...", "others", "}", "=", "this", ".", "props", ";", "const", "{", "columnFilterState", "}", "=", "this", ".", "state", ";", "const", "pipeline", "=", "new", "TablePipeline", "(", "{", "state", ":", "this", ".", "state", ".", "pipelineState", ",", "setState", ":", "this", ".", "_setPipelineState", ",", "ctx", ":", "REX_TABLE_PIPELINE_CTX", ",", "}", ")", ";", "pipeline", ".", "input", "(", "{", "dataSource", ",", "columns", "}", ")", ";", "if", "(", "primaryKey", "!=", "null", ")", "{", "pipeline", ".", "primaryKey", "(", "primaryKey", ")", ";", "}", "pipeline", ".", "mapColumns", "(", "tableUtils", ".", "compatWithDataIndex", ")", ";", "pipeline", ".", "mapColumns", "(", "tableUtils", ".", "compatWithColumnCell", ")", ";", "if", "(", "columnFilter", "!=", "null", ")", "{", "pipeline", ".", "snapshot", "(", "BEFORE_COLUMN_FILTER", ")", ";", "const", "columnsBeforeFilter", "=", "pipeline", ".", "getColumns", "(", "BEFORE_COLUMN_FILTER", ")", ";", "const", "leafColumnsBeforeFilter", "=", "collectNodes", "(", "columnsBeforeFilter", ",", "'leaf-only'", ")", ";", "const", "visibleCodes", "=", "columnFilter", ".", "visibleCodes", "??", "columnFilterState", ".", "visibleCodes", "??", "leafColumnsBeforeFilter", ".", "filter", "(", "(", "col", ")", "=>", "col", ".", "features", "?.", "defaultVisible", "!==", "false", ")", ".", "map", "(", "(", "col", ")", "=>", "col", ".", "code", ")", ";", "getPipelineCache", "(", "pipeline", ")", ".", "visibleCodes", "=", "visibleCodes", ";", "if", "(", "!", "columnFilter", ".", "keepTableColumns", ")", "{", "const", "visibleCodeSet", "=", "new", "Set", "(", "visibleCodes", ")", ";", "pipeline", ".", "mapColumns", "(", "makeRecursiveMapper", "(", "(", "col", ")", "=>", "{", "if", "(", "!", "isLeafNode", "(", "col", ")", ")", "{", "return", "col", ";", "}", "const", "enforceChecked", "=", "col", ".", "features", "?.", "enforceVisible", ";", "const", "checked", "=", "visibleCodeSet", ".", "has", "(", "col", ".", "code", ")", ";", "return", "checked", "||", "enforceChecked", "?", "col", ":", "[", "]", ";", "}", ")", ")", ";", "}", "}", "if", "(", "pagination", "&&", "!", "pagination", ".", "keepDataSource", ")", "{", "const", "pageSize", "=", "pagination", ".", "pageSize", "??", "this", ".", "state", ".", "pagination", ".", "pageSize", ";", "const", "current", "=", "pagination", ".", "current", "??", "this", ".", "state", ".", "pagination", ".", "current", ";", "pipeline", ".", "mapDataSource", "(", "(", "rows", ")", "=>", "rows", ".", "slice", "(", "(", "current", "-", "1", ")", "*", "pageSize", ",", "current", "*", "pageSize", ")", ")", ";", "}", "this", ".", "_setupFeatures", "(", "pipeline", ")", ";", "if", "(", "getRowProps", ")", "{", "pipeline", ".", "appendRowPropsGetter", "(", "getRowProps", ")", ";", "}", "return", "(", "<", "ProTableWrapperDiv", "{", "...", "wrapperProps", "}", "className", "=", "{", "cx", "(", "'rex-table-wrapper'", ",", "wrapperClassName", ")", "}", "style", "=", "{", "wrapperStyle", "}", ">", "{", "this", ".", "_renderToolbar", "(", "pipeline", ")", "}", "<", "BaseTable", "{", "...", "omit", "(", "others", ",", "featureNames", ")", "}", "style", "=", "{", "style", "}", "className", "=", "{", "cx", "(", "className", ",", "'rex-table'", ")", "}", "{", "...", "pipeline", ".", "getProps", "(", ")", "}", "/>", "{", "this", ".", "_renderFooter", "(", ")", "}", "<", "/ProTableWrapperDiv>);", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, 19657, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 171, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, 51, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 19657, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 51, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 51, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, 51, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, 51, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 19657, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1142
[ "import", "cx", "from", "'classnames'", ";", "import", "_", "from", "'lodash-es'", ";", "import", "React", ",", "{", "useCallback", ",", "useLayoutEffect", ",", "useMemo", ",", "useRef", ",", "useState", "}", "from", "'react'", ";", "import", "{", "fromEvent", "}", "from", "'rxjs'", ";", "import", "*", "as", "op", "from", "'rxjs/operators'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "composeHandlers", ",", "composeState", "}", "from", "'../../utils'", ";", "import", "{", "Tooltip", "}", "from", "'../overlays'", ";", "import", "{", "batchedUpdates", "}", "from", "'../overlays/overlay-utils/batchUpdate'", ";", "import", "{", "domUtils", "}", "from", "'../virtual-list/dom-utils'", ";", "import", "{", "Box", ",", "Flex", "}", "from", "'../layout'", ";", "type", "MarkType", "=", "Record", "<", "number", ",", "any", ">", "|", "number", "[", "]", "|", "number", ";", "export", "interface", "RangeProps", "{", "className", "?", ":", "string", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "/** 最小值 */", "min", "?", ":", "number", ";", "/** 最大值 */", "max", "?", ":", "number", ";", "/** 步长,取值必须大于 0,并且可被 (max - min) 整除 */", "step", "?", ":", "number", ";", "/** 受控用法,当前值 */", "value", "?", ":", "number", ";", "/** 非受控用法,默认值 */", "defaultValue", "?", ":", "number", ";", "/** 受控用法,当前值改变的回调,注意只有当鼠标松开的时候该函数才会被调用 */", "onChange", "?", ":", "(", "value", ":", "number", ")", "=>", "void", ";", "/** 是否禁用 */", "disabled", "?", ":", "boolean", ";", "/** 是否显示 tip */", "hasTip", "?", ":", "boolean", ";", "marks", "?", ":", "MarkType", ";", "marksPosition", "?", ":", "'above'", "|", "'below'", ";", "tipRender", "?", ":", "(", "value", ":", "number", ")", "=>", "React", ".", "ReactNode", ";", "}", "const", "RangeMarks", "=", "styled", ".", "div", "`\n height: 24px;\n position: relative;\n display: flex;\n\n > .rex-range-mark-text {\n position: absolute;\n transform: translateX(-50%);\n padding-bottom: 12px;\n\n &::before {\n content: '';\n position: absolute;\n background-color: var(--rex-colors-emphasis-30);\n border-radius: 2px;\n width: 4px;\n height: 8px;\n bottom: 0;\n left: 50%;\n margin-left: -2px;\n }\n\n &:hover {\n color: var(--rex-colors-primary-50);\n\n &::before {\n background-color: var(--rex-colors-emphasis-50);\n }\n }\n }\n\n > button {\n background: none;\n border: none;\n padding: 0;\n margin: 0;\n font-size: inherit;\n color: inherit;\n border-radius: 0;\n cursor: pointer;\n }\n\n &.rex-range-marks-below {\n align-items: flex-end;\n\n > .rex-range-mark-text {\n padding-top: 12px;\n padding-bottom: 0;\n\n &::before {\n top: 0;\n bottom: auto;\n }\n }\n }\n\n &.rex-disabled {\n .rex-range-mark-text {\n cursor: not-allowed;\n }\n }\n`", ";", "const", "RangeDiv", "=", "styled", ".", "div", "`\n height: 12px;\n position: relative;\n user-select: none;\n\n .rex-range-track {\n cursor: pointer;\n position: absolute;\n left: 0;\n right: 0;\n background-color: var(--rex-colors-emphasis-30);\n height: 6px;\n // top = 50% 减去自身高度的一半 calc(50% - 3px);\n top: 3px;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .rex-range-track-highlight {\n background: var(--rex-colors-primary-50);\n position: absolute;\n top: 0;\n bottom: 0;\n // left 和 right 会通过 style 进行设置\n }\n\n .rex-range-handle {\n position: absolute;\n // left=0 为默认值,组件渲染时会通过 style.left 覆盖该值\n left: 0;\n top: 50%;\n }\n\n .rex-range-handle-inner {\n position: absolute;\n cursor: pointer;\n background: var(--rex-colors-emphasis-0);\n border: 3px solid var(--rex-colors-primary-50);\n border-radius: 50%;\n\n height: 16px;\n width: 16px;\n transform: translate(-50%, -50%) scale(1);\n transition: 200ms transform;\n }\n\n &:not(.rex-disabled) {\n .rex-range-handle-inner:hover {\n transform: translate(-50%, -50%) scale(1.2);\n }\n\n .rex-range-handle-moving .rex-range-handle-inner {\n border-width: 2px;\n }\n }\n\n &.rex-disabled {\n .rex-range-track,\n .rex-range-handle-inner {\n cursor: not-allowed;\n }\n\n .rex-range-track-highlight {\n background: var(--rex-colors-emphasis-30);\n }\n\n .rex-range-handle-inner {\n border-color: var(--rex-colors-emphasis-40);\n }\n }\n`", ";", "const", "percentChecker", "=", "(", "value", ")", "=>", "{", "if", "(", "typeof", "value", "!==", "'number'", "||", "Number", ".", "isNaN", "(", "value", ")", ")", "{", "return", "false", ";", "}", "if", "(", "value", "<", "0", "||", "value", ">", "100", ")", "{", "console", ".", "error", "(", "'key of mark should be an integer, between 0 and 100'", ")", ";", "return", "false", ";", "}", "return", "true", ";", "}", ";", "export", "function", "Range", "(", "{", "min", "=", "0", ",", "max", "=", "100", ",", "step", "=", "1", ",", "defaultValue", "=", "0", ",", "value", ":", "valueProp", ",", "onChange", ":", "onChangeProp", ",", "marks", ",", "marksPosition", "=", "'above'", ",", "tipRender", ",", "style", ",", "className", ",", "disabled", ",", "hasTip", "=", "true", ",", "}", ")", "{", "const", "[", "_value", ",", "_onChange", "]", "=", "useState", "(", "defaultValue", ")", ";", "const", "value", "=", "composeState", "(", "valueProp", ",", "_value", ")", ";", "const", "onChange", "=", "composeHandlers", "(", "onChangeProp", ",", "_onChange", ")", ";", "const", "[", "dragState", ",", "setDragState", "]", "=", "useState", "(", "{", "moving", ":", "false", ",", "tempValue", ":", "value", "}", ")", ";", "const", "[", "visible", ",", "setVisible", "]", "=", "useState", "(", "false", ")", ";", "const", "tempValueRef", "=", "useRef", "(", "dragState", ".", "tempValue", ")", ";", "const", "trackRef", "=", "useRef", "<", "HTMLDivElement", ">", "(", "null", ")", ";", "const", "startDrag", "=", "(", "event", ")", "=>", "{", "const", "trackDiv", "=", "trackRef", ".", "current", ";", "const", "getRatio", "=", "(", "x", ")", "=>", "{", "const", "rect", "=", "domUtils", ".", "getRelativeLayoutRect", "(", "window", ",", "trackDiv", ")", ";", "const", "ration", "=", "(", "x", "-", "rect", ".", "left", ")", "/", "(", "rect", ".", "right", "-", "rect", ".", "left", ")", ";", "return", "_", ".", "clamp", "(", "ration", ",", "0", ",", "1", ")", ";", "}", ";", "fromEvent", "<", "MouseEvent", ">", "(", "window", ",", "'mousemove'", ")", ".", "pipe", "(", "op", ".", "takeUntil", "(", "fromEvent", "(", "window", ",", "'mouseup'", ")", ")", ",", "op", ".", "map", "(", "(", "move", ")", "=>", "(", "{", "type", ":", "'move'", ",", "x", ":", "move", ".", "clientX", "}", ")", ")", ",", "op", ".", "startWith", "(", "{", "type", ":", "'start'", ",", "x", ":", "event", ".", "clientX", "}", ")", ",", "op", ".", "endWith", "(", "{", "type", ":", "'end'", ",", "x", ":", "-", "1", "}", ")", ")", ".", "subscribe", "(", "(", "action", ")", "=>", "{", "batchedUpdates", "(", "(", ")", "=>", "{", "if", "(", "action", ".", "type", "===", "'move'", "||", "action", ".", "type", "===", "'start'", ")", "{", "const", "nextValue", "=", "getRatio", "(", "action", ".", "x", ")", "*", "(", "max", "-", "min", ")", "+", "min", ";", "const", "tempValue", "=", "Math", ".", "round", "(", "(", "nextValue", "-", "min", ")", "/", "step", ")", "*", "step", "+", "min", ";", "setDragState", "(", "(", "prev", ")", "=>", "{", "if", "(", "prev", ".", "tempValue", "==", "tempValue", ")", "{", "return", "prev", ";", "}", "return", "{", "moving", ":", "true", ",", "tempValue", ":", "tempValue", "}", ";", "}", ")", ";", "tempValueRef", ".", "current", "=", "tempValue", ";", "}", "else", "{", "setDragState", "(", "{", "moving", ":", "false", ",", "tempValue", ":", "-", "1", "}", ")", ";", "onChange", "(", "tempValueRef", ".", "current", ")", ";", "}", "}", ")", ";", "}", ")", ";", "}", ";", "const", "normalizeMarks", "=", "useCallback", "(", "(", "marks", ")", "=>", "{", "let", "result", ";", "if", "(", "typeof", "marks", "===", "'number'", ")", "{", "result", "=", "_", ".", "range", "(", "min", ",", "max", "+", "1e-5", ",", "marks", ")", ".", "map", "(", "(", "percent", ")", "=>", "(", "{", "label", ":", "percent", ",", "value", ":", "percent", ",", "}", ")", ")", ";", "}", "else", "if", "(", "Array", ".", "isArray", "(", "marks", ")", ")", "{", "result", "=", "marks", ".", "filter", "(", "percentChecker", ")", ".", "map", "(", "(", "percent", ")", "=>", "(", "{", "label", ":", "percent", ",", "value", ":", "percent", ",", "}", ")", ")", ";", "}", "else", "{", "result", "=", "Object", ".", "keys", "(", "marks", ")", ".", "map", "(", "(", "x", ")", "=>", "Number", "(", "x", ")", ")", ".", "filter", "(", "percentChecker", ")", ".", "map", "(", "(", "percent", ")", "=>", "(", "{", "label", ":", "marks", "[", "percent", "]", ",", "value", ":", "percent", ",", "}", ")", ")", ";", "}", "return", "result", ";", "}", ",", "[", "max", ",", "min", "]", ")", ";", "const", "normalizedMarks", "=", "useMemo", "(", "(", ")", "=>", "{", "if", "(", "marks", ")", "{", "return", "normalizeMarks", "(", "marks", ")", ";", "}", "return", "null", ";", "}", ",", "[", "marks", ",", "normalizeMarks", "]", ")", ";", "const", "movingValue", "=", "dragState", ".", "moving", "?", "dragState", ".", "tempValue", ":", "value", ";", "const", "ratio", "=", "(", "movingValue", "-", "min", ")", "/", "(", "max", "-", "min", ")", ";", "const", "marksWrapperRef", "=", "useRef", "<", "HTMLDivElement", ">", "(", "null", ")", ";", "useLayoutEffect", "(", "(", ")", "=>", "{", "if", "(", "!", "window", "||", "!", "marksWrapperRef", "?.", "current", ")", "{", "return", ";", "}", "/**\n * 修复由于元素宽度不为正偶数而导致 :after 标记偏移的问题\n */", "(", "marksWrapperRef", ".", "current", ".", "childNodes", "as", "NodeListOf", "<", "HTMLButtonElement", ">", ")", ".", "forEach", "(", "(", "node", ")", "=>", "{", "const", "currentWidth", "=", "window", ".", "getComputedStyle", "(", "node", ")", ".", "width", ";", "if", "(", "!", "currentWidth", ".", "endsWith", "(", "'px'", ")", ")", "{", "return", ";", "}", "let", "parsed", "=", "parseInt", "(", "currentWidth", ".", "replace", "(", "'px'", ",", "''", ")", ")", ";", "if", "(", "parsed", "%", "2", "!==", "0", ")", "{", "parsed", "=", "parsed", "+", "1", ";", "}", "node", ".", "style", ".", "width", "=", "`${", "parsed", "}px`", ";", "}", ")", ";", "}", ",", "[", "marksWrapperRef", "]", ")", ";", "return", "(", "<", "Flex", "direction", "=", "{", "marksPosition", "===", "'below'", "?", "'column-reverse'", ":", "'column'", "}", "style", "=", "{", "style", "}", ">", "{", "normalizedMarks", "&&", "(", "<", "RangeMarks", "className", "=", "{", "cx", "(", "'rex-range-marks'", ",", "{", "'rex-range-marks-below'", ":", "marksPosition", "===", "'below'", ",", "'rex-disabled'", ":", "disabled", ",", "}", ")", "}", "ref", "=", "{", "marksWrapperRef", "}", ">", "{", "normalizedMarks", ".", "map", "(", "(", "{", "label", ",", "value", ":", "percent", "}", ")", "=>", "(", "<", "button", "disabled", "=", "{", "disabled", "}", "className", "=", "{", "cx", "(", "'rex-range-mark-text'", ",", "{", "active", ":", "value", ">=", "percent", ",", "}", ")", "}", "style", "=", "{", "{", "left", ":", "`${", "percent", "}%`", "}", "}", "onClick", "=", "{", "(", ")", "=>", "onChange", "(", "percent", ")", "}", "key", "=", "{", "`range-${", "percent", "}`", "}", ">", "{", "label", "}", "<", "/button>))}", "<", "/RangeMarks>)}", "<", "RangeDiv", "className", "=", "{", "cx", "(", "'rex-range'", ",", "{", "'rex-disabled'", ":", "disabled", "}", ",", "className", ")", "}", ">", "<", "Box", "className", "=", "\"rex-range-track\"", "ref", "=", "{", "trackRef", "}", "onMouseDown", "=", "{", "disabled", "?", "null", ":", "startDrag", "}", ">", "<", "Box", "className", "=", "\"rex-range-track-highlight\"", "style", "=", "{", "{", "left", ":", "0", ",", "right", ":", "`${", "(", "1", "-", "ratio", ")", "*", "100", "}%`", "}", "}", "/>", "<", "/Box>", "<", "Box", "className", "=", "{", "cx", "(", "'rex-range-handle'", ",", "{", "'rex-range-handle-moving'", ":", "dragState", ".", "moving", ",", "}", ")", "}", "style", "=", "{", "{", "left", ":", "`${", "ratio", "*", "100", "}%`", "}", "}", ">", "<", "Tooltip", "visible", "=", "{", "hasTip", "&&", "(", "dragState", ".", "moving", "||", "visible", ")", "}", "onRequestOpen", "=", "{", "(", ")", "=>", "setVisible", "(", "true", ")", "}", "onRequestClose", "=", "{", "(", ")", "=>", "setVisible", "(", "false", ")", "}", "title", "=", "{", "tipRender", "?", "(", "tipRender", "(", "movingValue", ")", ")", ":", "(", "<", "Box", "style", "=", "{", "{", "minWidth", ":", "16", ",", "textAlign", ":", "'center'", "}", "}", ">", "{", "movingValue", "}", "<", "/Box>)} usePortal={false} attachOverlayManager={false} renderTarget={(arg) => (<Box className=\"rex-range-handle-inner\" ", "onMouseDown", "=", "{", "disabled", "?", "null", ":", "startDrag", "}", "{", "...", "arg", "}", "/>)}/", ">", "<", "/Box>", "<", "/RangeDiv>", "<", "/Flex>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1143
[ "import", "{", "isFunction", "}", "from", "'../../utils'", ";", "import", "{", "useControllableState", "}", "from", "'../../hooks'", ";", "import", "{", "InputProps", "}", "from", "'../input'", ";", "export", "interface", "UseSearchProps", "{", "/**\n * 输入框受控制\n */", "value", "?", ":", "string", ";", "/**\n * 输入框非受控值\n */", "defaultValue", "?", ":", "string", ";", "/**\n * 输入框值变化时的回调\n */", "onChange", "?", ":", "(", "value", ":", "string", ")", "=>", "void", ";", "/**\n * 点击提交时的回调\n */", "onSubmit", "?", ":", "(", "value", ":", "string", ")", "=>", "void", ";", "/**\n * 输入框占位符\n */", "placeholder", "?", ":", "string", ";", "/**\n * 是否有清空\n */", "hasClear", "?", ":", "boolean", ";", "/**\n * 输入框宽度\n */", "inputWidth", "?", ":", "string", ";", "}", "export", "function", "useSearch", "(", "props", ")", "{", "const", "{", "value", ":", "valueProp", ",", "defaultValue", "=", "''", ",", "onChange", ",", "onSubmit", ",", "placeholder", "=", "'输入关键词'", ",", "hasClear", "=", "false", ",", "inputWidth", ",", "...", "htmlProps", "}", "=", "props", ";", "const", "[", "value", ",", "updateValue", "]", "=", "useControllableState", "<", "string", ">", "(", "{", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "}", ")", ";", "const", "getInputProps", "=", "(", ")", "=>", "{", "return", "{", "width", ":", "inputWidth", ",", "hasClear", ",", "placeholder", ",", "value", ",", "onChange", "(", "nextValue", ")", "{", "if", "(", "nextValue", "!==", "value", ")", "{", "updateValue", "(", "nextValue", ")", ";", "}", "}", ",", "}", "as", "InputProps", ";", "}", ";", "const", "getSubmitProps", "=", "(", ")", "=>", "{", "return", "{", "onClick", ":", "(", ")", "=>", "{", "if", "(", "isFunction", "(", "onSubmit", ")", ")", "{", "onSubmit", "(", "value", ")", ";", "}", "}", ",", "}", ";", "}", ";", "return", "{", "htmlProps", ",", "getInputProps", ",", "getSubmitProps", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2568, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1144
[ "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "{", "Button", "}", "from", "'../button'", ";", "import", "{", "Input", "}", "from", "'../input'", ";", "import", "{", "Group", ",", "Box", "}", "from", "'../layout'", ";", "import", "{", "useSearch", ",", "UseSearchProps", "}", "from", "'./use-search'", ";", "const", "SimpleSearchButton", "=", "styled", "(", "Box", ")", "`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 100%;\n border-radius: var(--rex-radii-s);\n\n &:hover {\n background-color: var(--rex-colors-fill-layer1);\n }\n`", ";", "export", "interface", "SearchProps", "extends", "UseSearchProps", "{", "/**\n * 形态\n */", "shape", "?", ":", "'normal'", "|", "'simple'", ";", "/**\n * 搜索按钮文案\n */", "buttonText", "?", ":", "React", ".", "ReactNode", ";", "}", "export", "function", "Search", "(", "props", ")", "{", "const", "{", "shape", ",", "...", "rest", "}", "=", "props", ";", "if", "(", "shape", "===", "'simple'", ")", "{", "return", "<", "SimpleSearch", "{", "...", "rest", "}", "/", ">", ";", "}", "return", "<", "NormalSearch", "{", "...", "rest", "}", "/", ">", ";", "}", "function", "NormalSearch", "(", "props", ")", "{", "const", "{", "buttonText", "=", "'搜索'", ",", "...", "rest", "}", "=", "props", ";", "const", "{", "htmlProps", ",", "getInputProps", ",", "getSubmitProps", "}", "=", "useSearch", "(", "rest", ")", ";", "const", "inputProps", "=", "getInputProps", "(", ")", ";", "const", "submitProps", "=", "getSubmitProps", "(", ")", ";", "return", "(", "<", "Group", "attached", "{", "...", "htmlProps", "}", ">", "<", "Input", "{", "...", "inputProps", "}", "/", ">", "<", "Button", "type", "=", "\"primary\"", "{", "...", "submitProps", "}", ">", "{", "buttonText", "}", "<", "/Button>", "<", "/Group>);", "}", "function", "SimpleSearch", "(", "props", ")", "{", "const", "{", "htmlProps", ",", "getInputProps", ",", "getSubmitProps", "}", "=", "useSearch", "(", "props", ")", ";", "const", "inputProps", "=", "getInputProps", "(", ")", ";", "const", "submitProps", "=", "getSubmitProps", "(", ")", ";", "return", "(", "<", "Input", "{", "...", "htmlProps", "}", "{", "...", "inputProps", "}", "renderRightElement", "=", "{", "(", ")", "=>", "(", "<", "SimpleSearchButton", "{", "...", "submitProps", "}", ">", "<", "Icon", "type", "=", "\"search\"", "/", ">", "<", "/SimpleSearchButton>)}/", ">", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 11947, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 11947, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2568, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 11947, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2568, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1145
[ "import", "cx", "from", "'classnames'", ";", "import", "{", "useControllableState", "}", "from", "'../../hooks'", ";", "import", "{", "FormValidateStatusType", "}", "from", "'../../types'", ";", "export", "interface", "UseTextareaProps", "{", "rows", "?", ":", "number", ";", "readOnly", "?", ":", "boolean", ";", "disabled", "?", ":", "boolean", ";", "status", "?", ":", "FormValidateStatusType", ";", "placeholder", "?", ":", "string", ";", "value", "?", ":", "string", ";", "defaultValue", "?", ":", "string", ";", "onChange", "?", ":", "(", "val", ":", "string", ")", "=>", "void", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "className", "?", ":", "string", ";", "}", "export", "function", "useTextarea", "(", "props", ")", "{", "const", "{", "value", ":", "valueProp", ",", "defaultValue", "=", "''", ",", "onChange", ",", "disabled", ",", "status", ",", "className", ",", "...", "htmlProps", "}", "=", "props", ";", "const", "[", "value", ",", "updateValue", "]", "=", "useControllableState", "(", "{", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "}", ")", ";", "const", "clazz", "=", "cx", "(", "{", "'rex-textarea'", ":", "true", ",", "'rex-disabled'", ":", "disabled", ",", "[", "`rex-${", "status", "}`", "]", ":", "status", ",", "}", ",", "className", ")", ";", "const", "getInputProps", "=", "(", "props", ",", "ref", ")", "=>", "{", "return", "{", "placeholder", ":", "'请输入'", ",", "...", "htmlProps", ",", "...", "props", ",", "className", ":", "clazz", ",", "ref", ",", "value", ",", "disabled", ",", "onChange", "(", "e", ")", "{", "updateValue", "(", "e", "?.", "target", ".", "value", ")", ";", "}", ",", "}", ";", "}", ";", "return", "{", "getInputProps", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 105, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1146
[ "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "useTextarea", ",", "UseTextareaProps", "}", "from", "'./use-textarea'", ";", "import", "{", "getToken", "}", "from", "'../../utils'", ";", "import", "{", "Dict", "}", "from", "'../../types'", ";", "interface", "OneTextareaProps", "{", "onConfirm", ":", "(", "e", ":", "React", ".", "KeyboardEvent", "<", "HTMLTextAreaElement", ">", ")", "=>", "void", ";", "onKeyPress", ":", "(", "e", ":", "React", ".", "KeyboardEvent", "<", "HTMLTextAreaElement", ">", ")", "=>", "void", ";", "}", "const", "OneTextarea", "=", "React", ".", "forwardRef", "<", "HTMLTextAreaElement", ",", "OneTextareaProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "onConfirm", ",", "onKeyPress", "}", "=", "props", ";", "const", "handleKeyPress", "=", "(", "e", ")", "=>", "{", "if", "(", "e", ".", "key", "===", "'Enter'", "&&", "typeof", "onConfirm", "===", "'function'", ")", "{", "onConfirm", "(", "e", ")", ";", "}", "if", "(", "typeof", "onKeyPress", "===", "'function'", ")", "{", "onKeyPress", "(", "e", ")", ";", "}", "}", ";", "return", "<", "textarea", "{", "...", "props", "}", "onKeyPress", "=", "{", "handleKeyPress", "}", "ref", "=", "{", "ref", "}", "/", ">", ";", "}", ")", ";", "const", "TextBox", "=", "styled", "(", "OneTextarea", ")", "<", "Dict", "<", "any", ">", ">", "`\n position: relative;\n outline: 0;\n appearance: none;\n transition: all 0.2s;\n font-size: var(--rex-fontSizes-body);\n line-height: 1.4;\n padding: var(--rex-space-m);\n width: 100%;\n border: var(--rex-borders-solid) var(--rex-colors-line-border);\n border-radius: var(--rex-radii-s);\n color: var(--rex-colors-text-body);\n background-color: transparent;\n\n &:focus {\n border-color: var(--rex-colors-brand-normal);\n }\n\n &.rex-disabled {\n color: ${", "getToken", "(", "'Input.textColorDisabled'", ")", "};\n border-color: ${", "getToken", "(", "'Input.borderColorDisabled'", ")", "};\n background-color: ${", "getToken", "(", "'Input.bgDisabled'", ")", "};\n }\n\n &.rex-error {\n border-color: ${", "getToken", "(", "'Input.borderColorError'", ")", "};\n }\n`", ";", "export", "interface", "TextareaProps", "extends", "UseTextareaProps", "{", "}", "export", "const", "Textarea", "=", "React", ".", "forwardRef", "<", "HTMLTextAreaElement", ",", "TextareaProps", ">", "(", "(", "props", ",", "ref", ")", "=>", "{", "const", "{", "getInputProps", "}", "=", "useTextarea", "(", "props", ")", ";", "const", "inputProps", "=", "getInputProps", "(", "{", "}", ",", "ref", ")", ";", "return", "<", "TextBox", "ref", "=", "{", "ref", "}", "{", "...", "inputProps", "}", "/>;", "}", ")", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, 287, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 128, null, null, null, null, null, null, null, null, null, null, null, 44, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1147
[ "import", "React", "from", "'react'", ";", "import", "cx", "from", "'classnames'", ";", "import", "dayjs", ",", "{", "Dayjs", "}", "from", "'../../dayjs'", ";", "import", "{", "Input", "}", "from", "'../input'", ";", "import", "{", "Box", "}", "from", "'../layout'", ";", "import", "{", "AdaptivePopup", "}", "from", "'../overlays'", ";", "import", "{", "TimePanel", ",", "TimePanelGetItemsProps", "}", "from", "'./time-panel'", ";", "import", "{", "useControllableState", "}", "from", "'../../hooks'", ";", "import", "{", "getToken", ",", "noop", ",", "pickStyleAndDataAndEventProps", "}", "from", "'../../utils'", ";", "import", "{", "PopupProps", "}", "from", "'../overlays'", ";", "import", "{", "FormControlOnChangeHandler", "}", "from", "'../../types'", ";", "export", "interface", "TimePickerProps", "extends", "TimePanelGetItemsProps", "{", "placeholder", "?", ":", "string", ";", "/**\n * 选择模式\n */", "mode", "?", ":", "'simple'", "|", "'normal'", ";", "/**\n * 时间格式\n */", "format", "?", ":", "string", ";", "value", "?", ":", "string", ";", "defaultValue", "?", ":", "string", ";", "onChange", "?", ":", "FormControlOnChangeHandler", "<", "string", ">", ";", "/**\n * 输入框状态\n */", "status", "?", ":", "string", ";", "/**\n * 弹层属性\n */", "popupProps", "?", ":", "Omit", "<", "PopupProps", ",", "'children'", ">", ";", "className", "?", ":", "string", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "}", "function", "formatTimeValue", "(", "str", ",", "format", ")", "{", "if", "(", "str", ")", "{", "return", "dayjs", "(", "str", ",", "format", ")", ";", "}", "return", "str", ";", "}", "export", "function", "TimePicker", "(", "props", ")", "{", "const", "{", "placeholder", "=", "'请选择时间'", ",", "mode", "=", "'normal'", ",", "value", ":", "valueProp", ",", "defaultValue", ",", "format", "=", "mode", "===", "'simple'", "?", "'HH:mm'", ":", "'HH:mm:ss'", ",", "onChange", "=", "noop", ",", "status", ",", "popupProps", ",", "className", ",", "...", "rest", "}", "=", "props", ";", "const", "[", "triggerProps", ",", "restProps", "]", "=", "pickStyleAndDataAndEventProps", "(", "rest", ")", ";", "const", "[", "value", ",", "updateValue", "]", "=", "useControllableState", "<", "any", ">", "(", "{", "value", ":", "formatTimeValue", "(", "valueProp", ",", "format", ")", ",", "defaultValue", ":", "formatTimeValue", "(", "defaultValue", ",", "format", ")", ",", "onChange", ":", "(", "date", ")", "=>", "{", "const", "display", "=", "date", ".", "format", "(", "format", ")", ";", "onChange", "(", "display", ",", "{", "data", ":", "date", "}", ")", ";", "}", ",", "}", ")", ";", "const", "inputValue", "=", "value", "?", "value", ".", "format", "(", "format", ")", ":", "''", ";", "const", "panelWidth", "=", "mode", "===", "'simple'", "?", "getToken", "(", "'TimePicker.simplePanelWidth'", ")", ":", "getToken", "(", "'TimePicker.normalPanelWidth'", ")", ";", "return", "(", "<", "AdaptivePopup", "offset", "=", "{", "[", "0", ",", "4", "]", "}", "{", "...", "popupProps", "}", "renderTarget", "=", "{", "(", "pass", ")", "=>", "(", "<", "Input", "{", "...", "pass", "}", "{", "...", "triggerProps", "}", "width", "=", "{", "getToken", "(", "'TimePicker.triggerWidth'", ")", "}", "className", "=", "{", "cx", "(", "'rex-time-picker'", ",", "className", ")", "}", "placeholder", "=", "{", "placeholder", "}", "value", "=", "{", "inputValue", "}", "readOnly", "status", "=", "{", "status", "}", "/", ">", ")", "}", "renderChildren", "=", "{", "(", "{", "ref", "}", ")", "=>", "(", "<", "AdaptivePopup", ".", "Panel", "ref", "=", "{", "ref", "}", "width", "=", "{", "panelWidth", "}", "borderRadius", "=", "\"m\"", ">", "<", "TimePanel", "value", "=", "{", "value", "}", "onChange", "=", "{", "(", "value", ")", "=>", "updateValue", "(", "value", ")", "}", "mode", "=", "{", "mode", "}", "{", "...", "restProps", "}", "/>", "<", "/AdaptivePopup.Panel>)}/", ">", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 23112, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 792, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1148
[ "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "colors", "}", "from", "'../../utils'", ";", "import", "{", "Box", ",", "BoxProps", "}", "from", "'../layout'", ";", "const", "Dot", "=", "styled", "(", "Box", ")", "`\n position: relative;\n padding-left: var(--dot-size);\n padding-right: var(--dot-size);\n\n &::before {\n content: '';\n width: var(--dot-size);\n height: var(--dot-size);\n border-radius: 100%;\n background-color: var(--active-color);\n position: absolute;\n z-index: 1;\n left: 50%;\n top: 8px;\n transform: translateX(-50%);\n }\n\n &::after {\n content: '';\n visibility: var(--dot-line-visible);\n position: absolute;\n top: 50%;\n bottom: -36px;\n width: 1px;\n background-color: var(--active-color);\n transform: translate(-50%, -50%);\n }\n`", ";", "const", "HozDot", "=", "styled", "(", "Box", ")", "`\n position: relative;\n padding-top: var(--dot-size);\n padding-bottom: var(--dot-size);\n\n &::before {\n content: '';\n width: var(--dot-size);\n height: var(--dot-size);\n border-radius: 100%;\n background-color: var(--active-color);\n position: absolute;\n z-index: 1;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n }\n\n &::after {\n content: '';\n visibility: var(--dot-line-visible);\n position: absolute;\n top: 50%;\n left: 18px;\n right: 6px;\n transform: translateY(-50%);\n height: 1px;\n background-color: var(--active-color);\n }\n`", ";", "export", "type", "TimePostionType", "=", "'left'", "|", "'right'", ";", "type", "TimelineStatusType", "=", "'success'", "|", "'error'", "|", "'process'", ";", "export", "interface", "TimelineItemProps", "{", "/**\n * 状态\n */", "status", "?", ":", "TimelineStatusType", ";", "/**\n * 标题\n */", "title", "?", ":", "React", ".", "ReactNode", ";", "/**\n * 时间文本\n */", "label", "?", ":", "React", ".", "ReactNode", ";", "/**\n * 时间文本的位置\n */", "labelPosition", "?", ":", "TimePostionType", ";", "showDotLine", "?", ":", "boolean", ";", "children", "?", ":", "React", ".", "ReactNode", ";", "}", "const", "LeftNode", "=", "(", "{", "children", ",", "...", "rest", "}", ")", "=>", "(", "<", "Box", "fontSize", "=", "\"body\"", "color", "=", "\"text.note\"", "{", "...", "rest", "}", ">", "{", "children", "}", "<", "/Box>);", "const", "TitleNode", "=", "(", "{", "children", ",", "...", "rest", "}", ")", "=>", "(", "<", "Box", "fontSize", "=", "\"title1\"", "mb", "=", "\"m\"", "{", "...", "rest", "}", ">", "{", "children", "}", "<", "/Box>);", "const", "ContentNode", "=", "(", "{", "children", ",", "...", "rest", "}", ")", "=>", "(", "<", "Box", "fontSize", "=", "\"body\"", "color", "=", "\"text.note\"", "{", "...", "rest", "}", ">", "{", "children", "}", "<", "/Box>);", "const", "getDotProps", "=", "(", "{", "style", ",", "status", ",", "showDotLine", ",", "...", "rest", "}", ")", "=>", "{", "const", "color", "=", "{", "success", ":", "'success.normal'", ",", "error", ":", "'error.normal'", ",", "process", ":", "'brand.normal'", ",", "}", "[", "status", "]", "||", "'fill.layer3'", ";", "return", "{", "...", "rest", ",", "style", ":", "{", "...", "style", ",", "[", "'--dot-size'", "as", "any", "]", ":", "'12px'", ",", "[", "'--active-color'", "as", "any", "]", ":", "colors", "(", "color", ")", ",", "[", "'--dot-line-visible'", "as", "any", "]", ":", "showDotLine", "?", "'visible'", ":", "'hidden'", ",", "}", ",", "}", ";", "}", ";", "export", "function", "TimelineItem", "(", "props", ")", "{", "const", "{", "status", ",", "label", ",", "labelPosition", ",", "title", ",", "showDotLine", ",", "children", ",", "...", "rest", "}", "=", "props", ";", "const", "dotProps", "=", "getDotProps", "(", "{", "status", ",", "showDotLine", "}", ")", ";", "const", "alignRight", "=", "labelPosition", "===", "'right'", ";", "const", "labelNode", "=", "<", "LeftNode", ">", "{", "label", "}", "<", "/LeftNode>;", "return", "(", "<", "Box", "as", "=", "\"li\"", "display", "=", "\"table-row\"", "{", "...", "rest", "}", ">", "{", "!", "alignRight", "&&", "labelNode", "}", "<", "Dot", "display", "=", "\"table-cell\"", "{", "...", "dotProps", "}", "/>", "<", "Box", "display", "=", "\"table-cell\"", ">", "<", "TitleNode", ">", "{", "title", "}", "<", "/TitleNode>", "{", "alignRight", "&&", "labelNode", "}", "<", "ContentNode", "pb", "=", "\"64px\"", ">", "{", "children", "}", "<", "/ContentNode>", "<", "/Box>", "<", "/Box>);", "}", "export", "function", "HozTimelineItem", "(", "props", ")", "{", "const", "{", "status", ",", "title", ",", "label", ",", "showDotLine", "=", "true", ",", "children", ",", "...", "rest", "}", "=", "props", ";", "const", "dotProps", "=", "getDotProps", "(", "{", "status", ",", "showDotLine", "}", ")", ";", "return", "(", "<", "Box", "as", "=", "\"li\"", "flex", "=", "\"1\"", "display", "=", "\"flex\"", "flexDirection", "=", "\"column\"", "{", "...", "rest", "}", ">", "<", "LeftNode", ">", "{", "label", "}", "<", "/LeftNode>", "<", "HozDot", "{", "...", "dotProps", "}", "/>", "<", "Box", ">", "<", "TitleNode", ">", "{", "title", "}", "<", "/TitleNode>", "<", "ContentNode", ">", "{", "children", "}", "<", "/ContentNode>", "<", "/Box>", "<", "/Box>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1149
[ "import", "React", "from", "'react'", ";", "import", "{", "useConfig", "}", "from", "'../../providers'", ";", "import", "{", "Box", "}", "from", "'../layout'", ";", "import", "{", "HozTimelineItem", ",", "TimePostionType", "}", "from", "'./timeline-item'", ";", "export", "interface", "TimelineProps", "extends", "React", ".", "ComponentPropsWithoutRef", "<", "'ul'", ">", "{", "/**\n * 排列方向\n */", "direction", "?", ":", "'row'", "|", "'column'", ";", "/**\n * 标签位置\n */", "labelPosition", "?", ":", "TimePostionType", ";", "}", "export", "function", "Timeline", "(", "props", ")", "{", "const", "{", "direction", "=", "'column'", ",", "labelPosition", "=", "'left'", ",", "children", ",", "...", "rest", "}", "=", "useConfig", "(", "'Timeline'", ",", "props", ")", ";", "const", "display", "=", "direction", "===", "'row'", "?", "'flex'", ":", "'table'", ";", "const", "total", "=", "React", ".", "Children", ".", "count", "(", "children", ")", ";", "return", "(", "<", "Box", "as", "=", "\"ul\"", "display", "=", "{", "display", "}", "p", "=", "{", "0", "}", "{", "...", "rest", "}", ">", "{", "React", ".", "Children", ".", "map", "(", "children", ",", "(", "child", ",", "index", ")", "=>", "{", "if", "(", "!", "React", ".", "isValidElement", "(", "child", ")", ")", "{", "return", "null", ";", "}", "const", "showDotLine", "=", "!", "(", "index", "+", "1", "===", "total", ")", ";", "if", "(", "direction", "===", "'row'", ")", "{", "return", "<", "HozTimelineItem", "showDotLine", "=", "{", "showDotLine", "}", "{", "...", "child", ".", "props", "}", "/", ">", ";", "}", "return", "React", ".", "cloneElement", "(", "child", ",", "{", "labelPosition", ",", "showDotLine", ",", "}", ")", ";", "}", ")", "}", "<", "/Box>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 15968, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1150
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "colors", "}", "from", "'../../utils'", ";", "import", "{", "Box", "}", "from", "'../layout'", ";", "const", "StepBox", "=", "styled", "(", "Box", ")", "`\n position: relative;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n\n &::before {\n content: '';\n position: absolute;\n top: 16px;\n left: -50%;\n height: var(--rex-step-line-width);\n width: 100%;\n background-color: var(--rex-step-color);\n }\n`", ";", "const", "StepNode", "=", "styled", "(", "Box", ")", "`\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n z-index: 1;\n border: 0;\n width: var(--rex-step-size);\n height: var(--rex-step-size);\n border-radius: 100%;\n outline: none;\n background-color: var(--rex-step-color);\n color: var(--rex-colors-emphasis-0);\n font-size: var(--rex-fontSizes-title1);\n`", ";", "const", "ColumnStepBox", "=", "styled", "(", "Box", ")", "`\n position: relative;\n`", ";", "const", "ColumnStepHeader", "=", "styled", "(", "Box", ")", "`\n display: flex;\n align-items: center;\n`", ";", "const", "ColumnStepContent", "=", "styled", "(", "Box", ")", "`\n margin-top: var(--rex-space-m);\n margin-bottom: var(--rex-space-m);\n margin-left: calc(var(--rex-step-size) / 2);\n padding-left: calc(var(--rex-step-size) / 2 + var(--rex-space-m) - var(--rex-step-line-width));\n border-left: var(--rex-step-line-width) solid var(--rex-step-color);\n min-height: 40px;\n`", ";", "const", "getColorByStatus", "=", "(", "status", ")", "=>", "{", "return", "{", "complete", ":", "'brand.normal'", ",", "incomplete", ":", "'emphasis.40'", ",", "error", ":", "'error.normal'", ",", "warning", ":", "'warning.normal'", ",", "success", ":", "'success.normal'", ",", "disabled", ":", "'fill.disabled'", ",", "}", "[", "status", "]", ";", "}", ";", "export", "type", "StatusType", "=", "'complete'", "|", "'incomplete'", "|", "'error'", "|", "'warning'", "|", "'disabled'", "|", "string", "|", "undefined", ";", "export", "interface", "UseStepProps", "{", "step", "?", ":", "number", ";", "/**\n * 状态\n */", "status", "?", ":", "StatusType", ";", "/**\n * 是否激活项\n */", "active", "?", ":", "boolean", ";", "}", "function", "useStep", "(", "props", ")", "{", "const", "{", "step", ",", "status", "=", "'incomplete'", ",", "active", "}", "=", "props", ";", "const", "completeColor", "=", "getColorByStatus", "(", "'complete'", ")", ";", "const", "statusColor", "=", "getColorByStatus", "(", "status", ")", ";", "const", "color", "=", "active", "?", "completeColor", ":", "statusColor", ";", "const", "label", "=", "status", "===", "'complete'", "?", "<", "Icon", "type", "=", "\"select-bold\"", "/", ">", ":", "step", ";", "const", "clazz", "=", "cx", "(", "{", "'rex-step'", ":", "true", ",", "[", "`rex-${", "status", "}`", "]", ":", "status", ",", "}", ")", ";", "return", "{", "rootProps", ":", "{", "className", ":", "clazz", ",", "style", ":", "{", "[", "'--rex-step-color'", "as", "any", "]", ":", "colors", "(", "color", ")", ",", "[", "'--rex-step-size'", "as", "any", "]", ":", "'32px'", ",", "[", "'--rex-step-line-width'", "as", "any", "]", ":", "'2px'", ",", "}", ",", "}", ",", "label", ",", "}", ";", "}", "export", "interface", "StepProps", "extends", "UseStepProps", "{", "/**\n * 标题\n */", "title", "?", ":", "string", ";", "/**\n * 点击步骤按钮回调\n */", "onClick", "?", ":", "any", ";", "children", "?", ":", "any", ";", "}", "export", "function", "Step", "(", "props", ")", "{", "const", "{", "title", ",", "onClick", ",", "children", "}", "=", "props", ";", "const", "{", "rootProps", ",", "label", "}", "=", "useStep", "(", "props", ")", ";", "return", "(", "<", "StepBox", "as", "=", "\"li\"", "{", "...", "rootProps", "}", ">", "<", "StepNode", "as", "=", "\"button\"", "onClick", "=", "{", "onClick", "}", ">", "{", "label", "}", "<", "/StepNode>", "<", "Box", "as", "=", "\"span\"", "fontSize", "=", "\"title1\"", "mt", "=", "\"m\"", "mx", "=", "\"xl\"", "color", "=", "\"text.title\"", ">", "{", "title", "}", "<", "/Box>", "<", "Box", "fontSize", "=", "\"body\"", "mt", "=", "\"m\"", "mx", "=", "\"xl\"", "color", "=", "\"text.body\"", ">", "{", "children", "}", "<", "/Box>", "<", "/StepBox>);", "}", "export", "function", "ColumnStep", "(", "props", ")", "{", "const", "{", "title", ",", "onClick", ",", "children", "}", "=", "props", ";", "const", "{", "rootProps", ",", "label", "}", "=", "useStep", "(", "props", ")", ";", "return", "(", "<", "ColumnStepBox", "as", "=", "\"li\"", "{", "...", "rootProps", "}", ">", "<", "ColumnStepHeader", "className", "=", "\"rex-step-header\"", ">", "<", "StepNode", "as", "=", "\"button\"", "onClick", "=", "{", "onClick", "}", ">", "{", "label", "}", "<", "/StepNode>", "<", "Box", "as", "=", "\"span\"", "fontSize", "=", "\"title1\"", "color", "=", "\"text.title\"", "ml", "=", "\"m\"", ">", "{", "title", "}", "<", "/Box>", "<", "/ColumnStepHeader>", "<", "ColumnStepContent", "className", "=", "\"rex-step-content\"", ">", "{", "children", "}", "<", "/ColumnStepContent>", "<", "/ColumnStepBox>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 2, null, null, 12269, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 8566, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 8566, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1151
[ "import", "{", "FormControlOnChangeHandler", "}", "from", "'../../types'", ";", "import", "{", "StepProps", "}", "from", "'./step'", ";", "const", "getStatus", "=", "(", "isComplete", ",", "detail", ")", "=>", "{", "const", "status", "=", "detail", ".", "status", "||", "(", "isComplete", "?", "'complete'", ":", "'incomplete'", ")", ";", "return", "status", ";", "}", ";", "export", "interface", "UseStepsProps", "{", "/**\n * 步骤列表\n */", "steps", ":", "StepProps", "[", "]", ";", "/**\n * 当前步骤\n */", "step", "?", ":", "number", ";", "/**\n * 步骤变化时的回调\n */", "onChange", "?", ":", "FormControlOnChangeHandler", "<", "number", ">", ";", "}", "export", "function", "useSteps", "(", "props", ")", "{", "const", "{", "step", ",", "onChange", ",", "steps", "=", "[", "]", "}", "=", "props", ";", "const", "items", "=", "steps", ".", "map", "(", "(", "item", ",", "key", ")", "=>", "{", "const", "itemStep", "=", "key", "+", "1", ";", "return", "{", "...", "item", ",", "step", ":", "itemStep", ",", "status", ":", "getStatus", "(", "itemStep", "<", "step", ",", "item", ")", ",", "active", ":", "item", ".", "active", "||", "itemStep", "===", "step", ",", "onClick", ":", "(", ")", "=>", "{", "if", "(", "itemStep", "!==", "step", "&&", "onChange", ")", "{", "onChange", "(", "itemStep", ",", "{", "data", ":", "item", "}", ")", ";", "}", "}", ",", "}", ";", "}", ")", ";", "return", "{", "items", ",", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, 8, null, 8566, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, 8566, null, 3, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1152
[ "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "Box", "}", "from", "'../layout'", ";", "import", "{", "useSteps", ",", "UseStepsProps", "}", "from", "'./use-steps'", ";", "import", "{", "Step", ",", "ColumnStep", "}", "from", "'./step'", ";", "const", "StepsBox", "=", "styled", "(", "Box", ")", "<", "any", ">", "`\n display: flex;\n flex-direction: ${", "(", "props", ")", "=>", "props", ".", "$direction", "};\n list-style: none;\n margin: 0;\n padding: 0;\n\n > li:first-child::before {\n display: none;\n }\n\n > li:last-child::after {\n display: none;\n }\n\n > li:last-child .rex-step-content {\n border-left-color: transparent;\n }\n`", ";", "export", "interface", "StepsProps", "extends", "UseStepsProps", "{", "/**\n * 方向\n */", "direction", "?", ":", "'row'", "|", "'column'", ";", "}", "export", "function", "Steps", "(", "props", ")", "{", "const", "{", "direction", "=", "'row'", "}", "=", "props", ";", "const", "{", "items", "}", "=", "useSteps", "(", "props", ")", ";", "const", "Tag", "=", "direction", "===", "'row'", "?", "Step", ":", "ColumnStep", ";", "return", "(", "<", "StepsBox", "as", "=", "\"ol\"", "className", "=", "\"rex-steps\"", "$direction", "=", "{", "direction", "}", ">", "{", "items", ".", "map", "(", "(", "item", ")", "=>", "(", "<", "Tag", "key", "=", "{", "item", ".", "step", "}", "{", "...", "item", "}", "/", ">", ")", ")", "}", "<", "/StepsBox>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 29920, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1153
[ "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "Box", ",", "BoxProps", "}", "from", "'../layout'", ";", "const", "StyledTag", "=", "styled", "(", "Box", ")", "`\n user-select: none;\n display: inline-flex;\n align-items: center;\n vertical-align: middle;\n\n svg {\n margin-right: var(--rex-space-m);\n }\n`", ";", "const", "sizeMap", "=", "{", "small", ":", "{", "height", ":", "'sizes.formHeights.s'", ",", "fontSize", ":", "'body'", ",", "}", ",", "medium", ":", "{", "height", ":", "'sizes.formHeights.m'", ",", "fontSize", ":", "'body'", ",", "}", ",", "large", ":", "{", "height", ":", "'sizes.formHeights.l'", ",", "fontSize", ":", "'subtitle'", ",", "}", ",", "}", ";", "export", "interface", "CheckableTagProps", "extends", "BoxProps", "{", "selected", "?", ":", "boolean", ";", "size", "?", ":", "'small'", "|", "'medium'", "|", "'large'", ";", "}", "export", "const", "CheckableTag", "=", "(", "props", ")", "=>", "{", "const", "{", "selected", "=", "false", ",", "size", "=", "'medium'", ",", "children", ",", "...", "others", "}", "=", "props", ";", "const", "colorStyles", "=", "selected", "?", "{", "borderColor", ":", "'brand.normal'", ",", "color", ":", "'brand.normal'", ",", "}", ":", "{", "borderColor", ":", "'line.border'", ",", "color", ":", "'text.body'", ",", "}", ";", "const", "sizeStyles", "=", "sizeMap", "[", "size", "]", ";", "const", "icon", "=", "selected", "?", "<", "Icon", "type", "=", "\"select-bold\"", "/", ">", ":", "null", ";", "return", "(", "<", "StyledTag", "border", "=", "\"solid\"", "px", "=", "\"xl\"", "borderRadius", "=", "\"s\"", "{", "...", "colorStyles", "}", "{", "...", "sizeStyles", "}", "{", "...", "others", "}", ">", "{", "icon", "}", "{", "children", "}", "<", "/StyledTag>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 14, null, null, null, null, null, null, null, null, 17, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1194, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 1194, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1154
[ "import", "cx", "from", "'classnames'", ";", "import", "React", "from", "'react'", ";", "import", "{", "useSelectableList", ",", "UseSelectableListProps", "}", "from", "'../../hooks'", ";", "import", "{", "ListNode", "}", "from", "'../../types'", ";", "import", "{", "createContext", "}", "from", "'../../utils'", ";", "import", "{", "Group", ",", "GroupProps", "}", "from", "'../layout'", ";", "import", "{", "CheckableTag", ",", "CheckableTagProps", "}", "from", "'./tag'", ";", "interface", "TagFilterContext", "{", "value", "?", ":", "string", "|", "string", "[", "]", ";", "onSelect", "?", ":", "(", "value", ":", "string", ",", "checked", ":", "boolean", ")", "=>", "void", ";", "}", "const", "[", "TagFilterProvider", ",", "useTagFilter", "]", "=", "createContext", "<", "TagFilterContext", ">", "(", "{", "name", ":", "'ToggleButtonGroupContext'", ",", "strict", ":", "false", ",", "}", ")", ";", "export", "interface", "TagFilterProps", "extends", "Omit", "<", "UseSelectableListProps", "<", "string", "|", "string", "[", "]", ">", ",", "'component'", ">", "{", "/**\n * 数据源\n */", "dataSource", "?", ":", "ListNode", "<", "string", ">", "[", "]", ";", "/**\n * 尺寸\n */", "size", "?", ":", "CheckableTagProps", "[", "'size'", "]", ";", "/**\n * 布局属性\n */", "layoutProps", "?", ":", "GroupProps", ";", "className", "?", ":", "string", ";", "}", "export", "function", "TagFilter", "(", "props", ")", "{", "const", "{", "size", "=", "'medium'", ",", "dataSource", "=", "[", "]", ",", "selectMode", "=", "'single'", ",", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "layoutProps", ",", "className", ",", "...", "rest", "}", "=", "props", ";", "const", "{", "value", ",", "onSelect", "}", "=", "useSelectableList", "(", "{", "component", ":", "'TagFilter'", ",", "selectMode", ",", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "}", ")", ";", "const", "clazz", "=", "cx", "(", "'rex-tag-filter'", ",", "className", ")", ";", "const", "group", "=", "{", "value", ",", "onSelect", ",", "}", ";", "return", "(", "<", "TagFilterProvider", "value", "=", "{", "group", "}", ">", "<", "Group", "className", "=", "{", "clazz", "}", "{", "...", "layoutProps", "}", "{", "...", "rest", "}", ">", "{", "dataSource", ".", "map", "(", "(", "{", "label", ",", "value", ",", "...", "others", "}", ")", "=>", "(", "<", "TagFilterItem", "size", "=", "{", "size", "}", "key", "=", "{", "value", "}", "value", "=", "{", "value", "}", "{", "...", "others", "}", ">", "{", "label", "}", "<", "/TagFilterItem>))}", "<", "/Group>", "<", "/TagFilterProvider>);", "}", "interface", "TagFilterItemProps", "extends", "CheckableTagProps", "{", "value", "?", ":", "string", ";", "}", "function", "TagFilterItem", "(", "props", ")", "{", "const", "{", "value", ",", "selected", ":", "selectedProp", ",", "children", ",", "...", "rest", "}", "=", "props", ";", "const", "group", "=", "useTagFilter", "(", ")", ";", "let", "selected", "=", "selectedProp", ";", "if", "(", "group", "?.", "value", "!==", "undefined", "&&", "value", ")", "{", "selected", "=", "(", "group", ".", "value", "||", "[", "]", ")", ".", "includes", "(", "value", ")", ";", "}", "let", "onSelect", ";", "if", "(", "group", ".", "onSelect", "&&", "value", ")", "{", "onSelect", "=", "(", ")", "=>", "{", "group", ".", "onSelect", "(", "value", ",", "!", "selected", ")", ";", "}", ";", "}", "return", "(", "<", "CheckableTag", "selected", "=", "{", "selected", "}", "onClick", "=", "{", "onSelect", "}", "{", "...", "rest", "}", ">", "{", "children", "}", "<", "/CheckableTag>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1155
[ "import", "React", "from", "'react'", ";", "import", "{", "ActionList", ",", "ActionListProps", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'ActionList'", ",", "component", ":", "ActionList", "}", ";", "const", "actions", "=", "[", "{", "label", ":", "'编辑'", ",", "key", ":", "'edit'", ",", "}", ",", "{", "label", ":", "'删除'", ",", "key", ":", "'remove'", ",", "confirm", ":", "true", ",", "}", ",", "{", "label", ":", "'更多'", ",", "key", ":", "'more'", ",", "children", ":", "[", "{", "label", ":", "'同意'", ",", "key", ":", "'approve'", "}", ",", "{", "label", ":", "'拒绝'", ",", "key", ":", "'reject'", "}", ",", "{", "label", ":", "'转发'", ",", "key", ":", "'forward'", "}", ",", "]", ",", "}", ",", "]", ";", "export", "const", "Basic", "=", "(", ")", "=>", "<", "ActionList", "actions", "=", "{", "actions", "}", "onSelect", "=", "{", "console", ".", "log", "}", "/", ">", ";", "export", "const", "CustomConfirm", "=", "(", ")", "=>", "{", "return", "(", "<", "ActionList", "actions", "=", "{", "[", "{", "label", ":", "'编辑'", ",", "key", ":", "'edit'", ",", "}", ",", "{", "label", ":", "'删除'", ",", "key", ":", "'remove'", ",", "confirm", ":", "'确认删除吗?'", ",", "}", ",", "]", "}", "onSelect", "=", "{", "console", ".", "log", "}", "/", ">", ")", ";", "}", ";", "export", "const", "HideSeparator", "=", "(", ")", "=>", "{", "return", "<", "ActionList", "hasSeparator", "=", "{", "false", "}", "actions", "=", "{", "actions", "}", "onSelect", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";", "export", "const", "Icons", "=", "(", ")", "=>", "{", "const", "actions", "=", "[", "{", "key", ":", "'add'", ",", "icon", ":", "'add'", "}", ",", "{", "key", ":", "'print'", ",", "icon", ":", "'print'", "}", ",", "{", "key", ":", "'import'", ",", "icon", ":", "'import'", "}", ",", "]", "as", "ActionListProps", "[", "'actions'", "]", ";", "return", "<", "ActionList", "actions", "=", "{", "actions", "}", "onSelect", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";", "export", "const", "Custom", "=", "(", ")", "=>", "{", "const", "actions2", "=", "[", "{", "key", ":", "'custom1'", ",", "render", ":", "(", "{", "onClick", "}", ")", "=>", "<", "button", "onClick", "=", "{", "onClick", "}", ">", "自定义按钮", "<", "/button>,", "}", ",", "{", "key", ":", "'custom2'", ",", "render", ":", "(", "{", "onClick", "}", ")", "=>", "<", "button", "onClick", "=", "{", "onClick", "}", ">", "自定义按钮", "<", "/button>,", "}", ",", "]", ";", "return", "<", "ActionList", "actions", "=", "{", "actions2", "}", "onSelect", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1156
[ "import", "React", "from", "'react'", ";", "import", "{", "ActionSheet", ",", "Button", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'ActionSheet'", "}", ";", "const", "dataSource", "=", "[", "{", "label", ":", "'同意'", ",", "key", ":", "'accept'", "}", ",", "{", "label", ":", "'拒绝'", ",", "key", ":", "'reject'", "}", ",", "{", "label", ":", "'转发'", ",", "key", ":", "'forward'", "}", ",", "{", "label", ":", "'删除'", ",", "key", ":", "'delete'", "}", ",", "]", "as", "any", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "ActionSheet", "target", "=", "{", "<", "Button", ">", "选择操作", "<", "/Button>} title=\"选择你的操作\" dataSource={dataSource} onItemClick={console.log}/", ">", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1157
[ "import", "{", "Affix", "}", "from", "'@rexd/core'", ";", "import", "_", "from", "'lodash-es'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "export", "default", "{", "title", ":", "'Affix'", "}", ";", "const", "StyledDiv", "=", "styled", ".", "div", "`\n width: 100%;\n padding: 10px;\n font-size: 12px;\n background: var(--rex-colors-emphasis-10);\n`", ";", "function", "BalaBala", "(", "{", "text", "}", ")", "{", "return", "(", "<", "StyledDiv", ">", "<", "p", "style", "=", "{", "{", "margin", ":", "0", ",", "fontSize", ":", "20", "}", "}", ">", "<", "code", ">", "{", "text", "}", "<", "/code>", "<", "/p>", "吸附内容", ".111", "<", "br", "/", ">", "吸附内容", ".222", "<", "br", "/", ">", "吸附内容", ".333", "<", "/StyledDiv>);", "}", "const", "repeat", "=", "(", "txt", ",", "n", ")", "=>", "{", "return", "_", ".", "range", "(", "n", ")", ".", "map", "(", "(", "i", ")", "=>", "(", "<", "p", "key", "=", "{", "i", "}", "style", "=", "{", "{", "fontSize", ":", "20", ",", "padding", ":", "16", ",", "margin", ":", "0", "}", "}", ">", "{", "txt", "}", "{", "i", "}", "<", "/p>));", "}", ";", "export", "function", "BasicAffixTop", "(", ")", "{", "return", "(", "<", "div", ">", "{", "repeat", "(", "'TOP CONTENT'", ",", "3", ")", "}", "<", "div", "style", "=", "{", "{", "display", ":", "'flex'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 70%'", ",", "background", ":", "'#f2f2f2'", "}", "}", ">", "{", "repeat", "(", "'LONG CONTENT'", ",", "50", ")", "}", "<", "/div>", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 30%'", ",", "background", ":", "'#ffebeb'", "}", "}", ">", "<", "Affix", "offsetTop", "=", "{", "10", "}", ">", "<", "BalaBala", "text", "=", "\"offsetTop=10\"", "/", ">", "<", "/Affix>", "<", "/div>", "<", "/div>", "<", "/div>);", "}", "export", "function", "BasicAffixBottom", "(", ")", "{", "return", "(", "<", "div", ">", "{", "repeat", "(", "'TOP CONTENT'", ",", "3", ")", "}", "<", "div", "style", "=", "{", "{", "display", ":", "'flex'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 70%'", ",", "background", ":", "'#f2f2f2'", "}", "}", ">", "{", "repeat", "(", "'LONG CONTENT'", ",", "20", ")", "}", "<", "/div>", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 30%'", ",", "background", ":", "'#ffebeb'", ",", "display", ":", "'flex'", ",", "alignItems", ":", "'flex-end'", "}", "}", ">", "<", "Affix", "offsetBottom", "=", "{", "20", "}", ">", "<", "BalaBala", "text", "=", "\"offsetBottom={20}\"", "/", ">", "<", "/Affix>", "<", "/div>", "<", "/div>", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 70%'", ",", "background", ":", "'#b3b1f1'", "}", "}", ">", "{", "repeat", "(", "'BOTTOM CONTENT'", ",", "20", ")", "}", "<", "/div>", "<", "/div>);", "}", "export", "function", "AffixTopInContainer", "(", ")", "{", "return", "(", "<", "div", ">", "{", "repeat", "(", "'OUTER TOP CONTENT'", ",", "5", ")", "}", "<", "div", "style", "=", "{", "{", "height", ":", "400", ",", "overflow", ":", "'auto'", ",", "background", ":", "'#d9e6ff'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "height", ":", "100", ",", "background", ":", "'#d2fcc9'", "}", "}", "/>", "<", "Affix", "offsetTop", "=", "{", "10", "}", ">", "<", "BalaBala", "text", "=", "\"offsetTop={10}\"", "/", ">", "<", "/Affix>", "<", "div", "style", "=", "{", "{", "height", ":", "600", ",", "background", ":", "'#fcc9fb'", "}", "}", "/>", "<", "/div>", "{", "repeat", "(", "'OUTER BOTTOM CONTENT'", ",", "15", ")", "}", "<", "/div>);", "}", "export", "function", "AffixBottomInContainer", "(", ")", "{", "return", "(", "<", "div", ">", "{", "repeat", "(", "'OUTER TOP CONTENT'", ",", "5", ")", "}", "<", "div", "style", "=", "{", "{", "height", ":", "400", ",", "overflow", ":", "'auto'", ",", "background", ":", "'#d9e6ff'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "height", ":", "600", ",", "background", ":", "'#d2fcc9'", "}", "}", "/>", "<", "Affix", "offsetBottom", "=", "{", "10", "}", ">", "<", "BalaBala", "text", "=", "\"offsetBottom={10}\"", "/", ">", "<", "/Affix>", "<", "div", "style", "=", "{", "{", "height", ":", "400", ",", "background", ":", "'#fcc9fb'", "}", "}", "/>", "<", "/div>", "{", "repeat", "(", "'OUTER BOTTOM CONTENT'", ",", "15", ")", "}", "<", "/div>);", "}", "export", "function", "AffixDocExample", "(", ")", "{", "return", "(", "<", "div", "style", "=", "{", "{", "display", ":", "'flex'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 70%'", ",", "background", ":", "'#f2f2f2'", ",", "height", ":", "400", "}", "}", "/>", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 30%'", ",", "background", ":", "'#ffebeb'", "}", "}", ">", "<", "Affix", "offsetTop", "=", "{", "40", "}", "style", "=", "{", "{", "zIndex", ":", "1000", "}", "}", ">", "<", "BalaBala", "text", "=", "\"offsetTop={40}\"", "/", ">", "<", "/Affix>", "<", "/div>", "<", "/div>);", "}", "export", "function", "AffixDocExample2", "(", ")", "{", "return", "(", "<", "div", "style", "=", "{", "{", "display", ":", "'flex'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 70%'", ",", "background", ":", "'#f2f2f2'", ",", "height", ":", "400", "}", "}", "/>", "<", "div", "style", "=", "{", "{", "flex", ":", "'0 0 30%'", ",", "background", ":", "'#ffebeb'", ",", "display", ":", "'flex'", ",", "alignItems", ":", "'flex-end'", "}", "}", ">", "<", "Affix", "offsetBottom", "=", "{", "20", "}", "style", "=", "{", "{", "zIndex", ":", "1000", "}", "}", ">", "<", "BalaBala", "text", "=", "\"offsetBottom={20}\"", "/", ">", "<", "/Affix>", "<", "/div>", "<", "/div>);", "}", "export", "function", "AffixDocExample3", "(", ")", "{", "const", "jpg5050Repeat", "=", "'url(\"https://img.alicdn.com/tfs/TB1AbJXSpXXXXXJXpXXXXXXXXXX-32-32.jpg\") 50% 50% repeat'", ";", "return", "(", "<", "div", ">", "<", "div", "style", "=", "{", "{", "height", ":", "400", ",", "overflow", ":", "'auto'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "height", ":", "100", ",", "background", ":", "jpg5050Repeat", "}", "}", "/>", "<", "Affix", "offsetTop", "=", "{", "10", "}", ">", "<", "BalaBala", "text", "=", "\"offsetTop={10}\"", "/", ">", "<", "/Affix>", "<", "div", "style", "=", "{", "{", "height", ":", "1000", ",", "background", ":", "jpg5050Repeat", "}", "}", "/>", "<", "/div>", "<", "/div>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1158
[ "import", "{", "Anchor", "}", "from", "'@rexd/core'", ";", "import", "_", "from", "'lodash-es'", ";", "import", "React", "from", "'react'", ";", "import", "styled", "from", "'styled-components'", ";", "export", "default", "{", "title", ":", "'Anchor'", "}", ";", "const", "StyledH2", "=", "styled", ".", "h2", "`\n &:target {\n background: #ccc;\n color: red;\n }\n`", ";", "const", "StyledH3", "=", "styled", ".", "h3", "`\n &:target {\n background: #ccc;\n color: red;\n }\n`", ";", "export", "function", "Basic", "(", ")", "{", "const", "repeat", "=", "(", "txt", ",", "n", ")", "=>", "{", "return", "_", ".", "range", "(", "n", ")", ".", "map", "(", "(", "i", ")", "=>", "(", "<", "p", "key", "=", "{", "i", "}", "style", "=", "{", "{", "fontSize", ":", "16", ",", "padding", ":", "4", ",", "paddingLeft", ":", "0", ",", "margin", ":", "0", "}", "}", ">", "{", "txt", "}", "{", "i", "}", "<", "/p>));", "}", ";", "return", "(", "<", "div", "style", "=", "{", "{", "display", ":", "'flex'", "}", "}", ">", "<", "div", "style", "=", "{", "{", "flex", ":", "'auto'", "}", "}", ">", "{", "repeat", "(", "'主题文案'", ",", "5", ")", "}", "<", "div", ">", "<", "StyledH2", "id", "=", "\"s1\"", ">", "1", "Section1", "<", "/StyledH2>", "<", "StyledH3", "id", "=", "\"s1_1\"", ">", "1_1", "Section1_1", "<", "/StyledH3>", "<", "Contentful", "repeat", "=", "{", "10", "}", "/", ">", "<", "StyledH3", "id", "=", "\"s1_2\"", ">", "1_2", "Section1_2", "<", "/StyledH3>", "<", "Contentful", "repeat", "=", "{", "10", "}", "/", ">", "<", "StyledH3", "id", "=", "\"s1_3\"", ">", "1_3", "Section1_3", "<", "/StyledH3>", "<", "Contentful", "repeat", "=", "{", "10", "}", "/", ">", "<", "/div>", "<", "div", ">", "<", "StyledH2", "id", "=", "\"s2\"", ">", "2", "Section2", "<", "/StyledH2>", "<", "Contentful", "repeat", "=", "{", "10", "}", "/", ">", "<", "Contentful", "repeat", "=", "{", "10", "}", "/>", "<", "/div>", "<", "div", ">", "<", "StyledH2", "id", "=", "\"s3\"", ">", "3", "Section3", "<", "/StyledH2>", "<", "Contentful", "repeat", "=", "{", "10", "}", "/", ">", "<", "Contentful", "repeat", "=", "{", "10", "}", "/>", "<", "/div>", "<", "/div>", "<", "Anchor", "style", "=", "{", "{", "marginLeft", ":", "12", ",", "flex", ":", "'0 0 140px'", ",", "alignSelf", ":", "'flex-start'", "}", "}", ">", "<", "Anchor", ".", "Item", "title", "=", "\"1 Section\"", "href", "=", "\"#s1\"", ">", "<", "Anchor", ".", "Item", "title", "=", "\"1_1 Section1_1\"", "href", "=", "\"#s1_1\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"1_2 Section1_2\"", "href", "=", "\"#s1_2\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"1_3 Section1_3\"", "href", "=", "\"#s1_3\"", "/", ">", "<", "/Anchor.Item>", "<", "Anchor", ".", "Item", "title", "=", "\"2 Section 2\"", "href", "=", "\"#s2\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"3 Section 3\"", "href", "=", "\"#s3\"", "/", ">", "<", "/Anchor>", "<", "/div>);", "}", "const", "hippo", "=", "'盒马是阿里巴巴集团旗下,以数据和技术驱动的新零售平台。盒马希望为消费者打造社区化的一站式新零售体验中心,用科技和人情味带给人们“鲜美生活”。'", ";", "const", "Contentful", "=", "(", "{", "repeat", "=", "2", "}", ")", "=>", "{", "return", "<", "p", "style", "=", "{", "{", "fontSize", ":", "14", ",", "color", ":", "'var(--rex-colors-emphasis-60)'", "}", "}", ">", "{", "hippo", ".", "repeat", "(", "repeat", ")", "}", "<", "/p>;", "}", ";", "export", "function", "Basic2", "(", ")", "{", "return", "(", "<", "div", "style", "=", "{", "{", "display", ":", "'flex'", ",", "height", ":", "400", ",", "overflow", ":", "'auto'", ",", "outline", ":", "'1px dashed var(--rex-colors-emphasis-40)'", ",", "}", "}", ">", "<", "div", "style", "=", "{", "{", "flex", ":", "'auto'", "}", "}", ">", "<", "StyledH2", "id", "=", "\"test_usage\"", ">", "使用场景", "<", "/StyledH2>", "<", "p", "style", "=", "{", "{", "fontSize", ":", "14", ",", "color", ":", "'var(--rex-colors-emphasis-60)'", "}", "}", ">", "ProTable", "负责将数据渲染为", "HTML", "表格", ",", "其核心功能是将结构化的数据用表格的方式展现在页面中", ",", "并以组件", "props", "的形式提供了丰富的表格功能", ",", "例如排序", ",", "过滤", ",", "滚动", ",", "锁列", ",", "行多选等", "。", "<", "br", "/>", "在实现层面", ",", "ProTable", "是对", "ali", "-", "react", "-", "table", "的封装", ",", "除了保留", "基础的表格特性", "之外", ",", "ProTable", "也默认集成了", "大量表格功能拓展", "。", "<", "/p>", "<", "StyledH3", "id", "=", "\"test_caution\"", ">", "注意事项", "<", "/StyledH3>", "<", "Contentful", "/", ">", "<", "StyledH3", "id", "=", "\"test_extensions\"", ">", "拓展功能", "<", "/StyledH3>", "<", "Contentful", "/", ">", "<", "StyledH3", "id", "=", "\"test_virtual\"", ">", "虚拟滚动", "<", "/StyledH3>", "<", "Contentful", "/", ">", "<", "StyledH2", "id", "=", "\"test_examples\"", ">", "用法示例", "<", "/StyledH2>", "<", "StyledH3", "id", "=", "\"test_basic\"", ">", "基本表格", "<", "/StyledH3>", "<", "Contentful", "/", ">", "<", "Contentful", "/>", "<", "StyledH3", "id", "=", "\"test_style\"", ">", "表格样式", "<", "/StyledH3>", "<", "Contentful", "/", ">", "<", "Contentful", "/>", "<", "StyledH3", "id", "=", "\"test_loading\"", ">", "数据加载状态", "<", "/StyledH3>", "<", "Contentful", "/", ">", "<", "Contentful", "/>", "<", "StyledH3", "id", "=", "\"test_tree\"", ">", "树形表格", "<", "/StyledH3>", "<", "Contentful", "/", ">", "<", "Contentful", "/>", "<", "StyledH2", "id", "=", "\"test_api\"", ">", "API", "<", "/StyledH2>", "<", "Contentful", "repeat", "=", "{", "5", "}", "/", ">", "<", "Contentful", "repeat", "=", "{", "5", "}", "/>", "<", "Contentful", "repeat", "=", "{", "5", "}", "/", ">", "<", "/div>", "<", "Anchor", "style", "=", "{", "{", "marginLeft", ":", "12", ",", "flex", ":", "'0 0 120px'", ",", "alignSelf", ":", "'flex-start'", "}", "}", ">", "<", "Anchor", ".", "Item", "title", "=", "\"使用场景\"", "href", "=", "\"#test_usage\"", ">", "<", "Anchor", ".", "Item", "title", "=", "\"注意事项\"", "href", "=", "\"#test_caution\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"拓展功能\"", "href", "=", "\"#test_extensions\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"虚拟滚动\"", "href", "=", "\"#test_virtual\"", "/", ">", "<", "/Anchor.Item>", "<", "Anchor", ".", "Item", "title", "=", "\"用法示例\"", "href", "=", "\"#test_examples\"", ">", "<", "Anchor", ".", "Item", "title", "=", "\"基本表格\"", "href", "=", "\"#test_basic\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"表格样式\"", "href", "=", "\"#test_style\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"数据加载状态数据加载状态数据加载状态数据加载状态\"", "href", "=", "\"#test_loading\"", "/", ">", "<", "Anchor", ".", "Item", "title", "=", "\"树形表格\"", "href", "=", "\"#test_tree\"", "/", ">", "<", "/Anchor.Item>", "<", "Anchor", ".", "Item", "title", "=", "\"API\"", "href", "=", "\"#test_api\"", "/", ">", "<", "/Anchor>", "<", "/div>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, 5, null, null, 2, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1159
[ "import", "React", "from", "'react'", ";", "import", "{", "Box", ",", "Badge", ",", "Group", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Badge'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "Badge", "shape", "=", "\"pill\"", ">", "99", "<", "/Badge>", "<", "Badge", "shape", "=", "\"dot\"", "/", ">", "<", "Badge", "shape", "=", "\"badge\"", ">", "普通标签", "<", "/Badge>", "<", "/Group>);", "export", "const", "StatusBadge", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "Badge", "status", "=", "\"normal\"", ">", "普通", "<", "/Badge>", "<", "Badge", "status", "=", "\"success\"", ">", "成功", "<", "/Badge>", "<", "Badge", "status", "=", "\"error\"", ">", "错误", "<", "/Badge>", "<", "Badge", "status", "=", "\"warning\"", ">", "警告", "<", "/Badge>", "<", "/Group>);", "export", "const", "CustomColor", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "Badge", "bg", "=", "\"#BADA55\"", "color", "=", "\"#FFF\"", ">", "#BADA55", "<", "/Badge>", "<", "Badge", "bg", "=", "\"#FFA500\"", "color", "=", "\"#FFF\"", ">", "#FFA500", "<", "/Badge>", "<", "Badge", "bg", "=", "\"#0000FF\"", "color", "=", "\"#FFF\"", ">", "#", "0000", "FF", "<", "/Badge>", "<", "/Group>);", "export", "const", "NumberBadge", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "Badge", "shape", "=", "\"pill\"", ">", "1", "<", "/Badge>", "<", "Badge", "shape", "=", "\"pill\"", ">", "99", "<", "/Badge>", "<", "Badge", "shape", "=", "\"pill\"", ">", "129", "<", "/Badge>", "<", "/Group>);", "export", "const", "TopRight", "=", "(", ")", "=>", "(", "<", "Box", "display", "=", "\"inline-block\"", "position", "=", "\"relative\"", ">", "<", "Box", "display", "=", "\"inline-block\"", "size", "=", "\"40px\"", "borderRadius", "=", "\"2px\"", "bg", "=", "\"#333\"", "/", ">", "<", "Badge", "shape", "=", "\"pill\"", "style", "=", "{", "{", "verticalAlign", ":", "'top'", "}", "}", ">", "99", "+", "<", "/Badge>", "<", "/Box>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1160
[ "import", "{", "Breadcrumb", ",", "BreadcrumbItem", "}", "from", "'@rexd/core'", ";", "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "React", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Breadcrumb'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "(", "<", "Breadcrumb", "onItemClick", "=", "{", "console", ".", "log", "}", ">", "<", "BreadcrumbItem", "key", "=", "\"home\"", ">", "首页", "<", "/BreadcrumbItem>", "<", "BreadcrumbItem", "key", "=", "\"doc\"", ">", "文档", "<", "/BreadcrumbItem>", "<", "BreadcrumbItem", "key", "=", "\"breadcrumb\"", ">", "Breadcurmb", "<", "/BreadcrumbItem>", "<", "/Breadcrumb>);", "export", "const", "CustomSeparator", "=", "(", ")", "=>", "(", "<", "Breadcrumb", "separator", "=", "{", "<", "Icon", "type", "=", "\"arrow-right-bold\"", "/", ">", "}", ">", "<", "BreadcrumbItem", ">", "首页", "<", "/BreadcrumbItem>", "<", "BreadcrumbItem", ">", "文档", "<", "/BreadcrumbItem>", "<", "BreadcrumbItem", ">", "Breadcurmb", "<", "/BreadcrumbItem>", "<", "/Breadcrumb>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1161
[ "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "Box", ",", "Button", ",", "Group", "}", "from", "'@rexd/core'", ";", "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "export", "default", "{", "title", ":", "'Button'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Group", ">", "<", "Button", ">", "按钮", "<", "/Button>", "<", "/Group>", "<", "Group", "mt", "=", "\"l\"", ">", "<", "Button", "type", "=", "\"normal\"", ">", "普通按钮", "<", "/Button>", "<", "Button", "type", "=", "\"primary\"", ">", "焦点按钮", "<", "/Button>", "<", "Button", "type", "=", "\"secondary\"", ">", "次级按钮", "<", "/Button>", "<", "Button", "disabled", ">", "禁用按钮", "<", "/Button>", "<", "/Group>", "<", "Group", "mt", "=", "\"l\"", ">", "<", "Button", "shape", "=", "\"warning\"", "type", "=", "\"normal\"", ">", "普通警告按钮", "<", "/Button>", "<", "Button", "shape", "=", "\"warning\"", "type", "=", "\"primary\"", ">", "焦点警告按钮", "<", "/Button>", "<", "/Group>", "<", "Group", "mt", "=", "\"l\"", ">", "<", "Button", "shape", "=", "\"text\"", "type", "=", "\"normal\"", ">", "普通文本按钮", "<", "/Button>", "<", "Button", "shape", "=", "\"text\"", "type", "=", "\"primary\"", ">", "焦点链接按钮", "<", "/Button>", "<", "Button", "shape", "=", "\"text\"", "type", "=", "\"primary\"", "disabled", ">", "焦点链接按钮", "<", "/Button>", "<", "/Group>", "<", "/Group>);", "}", "/**\n * 与文本按钮相比,链接型按钮没有内间距\n */", "export", "function", "LinkButton", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Button", "shape", "=", "\"link\"", "type", "=", "\"normal\"", ">", "普通链接按钮", "<", "/Button>", "<", "Button", "shape", "=", "\"link\"", "type", "=", "\"primary\"", ">", "焦点链接按钮", "<", "/Button>", "<", "/Group>);", "}", "/**\n * 不推荐这么用,建议直接用 Link 组件\n */", "export", "function", "AnchorButton", "(", ")", "{", "return", "(", "<", "Button", "as", "=", "\"a\"", "shape", "=", "\"link\"", "href", "=", "\"https://taobao.com\"", "target", "=", "\"_blank\"", ">", "anchor", "button", "<", "/Button>);", "}", "export", "function", "Size", "(", ")", "{", "return", "(", "<", "Box", ">", "<", "Group", ">", "<", "Button", "size", "=", "\"small\"", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "}", ">", "小尺寸按钮", "<", "/Button>", "<", "Button", "size", "=", "\"medium\"", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "}", ">", "中尺寸按钮", "<", "/Button>", "<", "Button", "size", "=", "\"large\"", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "}", ">", "大尺寸按钮", "<", "/Button>", "<", "/Group>", "<", "Group", "mt", "=", "\"l\"", ">", "<", "Button", "size", "=", "\"small\"", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"arrow-left-bold\"", "/", ">", "}", ">", "小尺寸按钮", "<", "/Button>", "<", "Button", "size", "=", "\"medium\"", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"arrow-left-bold\"", "/", ">", "}", ">", "中尺寸按钮", "<", "/Button>", "<", "Button", "size", "=", "\"large\"", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"arrow-left-bold\"", "/", ">", "}", ">", "大尺寸按钮", "<", "/Button>", "<", "/Group>", "<", "Group", "mt", "=", "\"l\"", ">", "<", "Button", "size", "=", "\"small\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"arrow-left-bold\"", "/", ">", "<", "/Button>", "<", "Button", "size", "=", "\"medium\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"arrow-left-bold\"", "/", ">", "<", "/Button>", "<", "Button", "size", "=", "\"large\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"arrow-left-bold\"", "/", ">", "<", "/Button>", "<", "/Group>", "<", "/Box>);", "}", "export", "const", "Fill", "=", "(", ")", "=>", "(", "<", "Button", "type", "=", "\"primary\"", "fill", ">", "整行按钮", "<", "/Button>);", "export", "const", "AddIcon", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "Button", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"email\"", "/", ">", "}", "type", "=", "\"primary\"", ">", "邮箱", "<", "/Button>", "<", "Button", "rightElement", "=", "{", "<", "Icon", "type", "=", "\"arrow-right\"", "/", ">", "}", ">", "点击了解更多", "<", "/Button>", "<", "Button", "shape", "=", "\"text\"", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"add\"", "/", ">", "}", ">", "新建", "<", "/Button>", "<", "/Group>);", "/**\n * 仅图标的按钮\n */", "export", "const", "OnlyIcon", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "h3", ">", "外观", "<", "/h3>", "<", "Button", "iconOnly", ">", "<", "Icon", "type", "=", "\"arrow-right-bold\"", "/", ">", "<", "/Button>", "<", "Button", "iconOnly", "type", "=", "\"secondary\"", ">", "<", "Icon", "type", "=", "\"arrow-right-bold\"", "/", ">", "<", "/Button>", "<", "Button", "iconOnly", "type", "=", "\"primary\"", ">", "<", "Icon", "type", "=", "\"arrow-right-bold\"", "/", ">", "<", "/Button>", "<", "Button", "iconOnly", "disabled", ">", "<", "Icon", "type", "=", "\"arrow-right-bold\"", "/", ">", "<", "/Button>", "<", "br", "/", ">", "<", "br", "/>", "<", "Button", "iconOnly", "shape", "=", "\"text\"", ">", "<", "Icon", "type", "=", "\"close\"", "/", ">", "<", "/Button>", "<", "Button", "iconOnly", "shape", "=", "\"text\"", "type", "=", "\"secondary\"", ">", "<", "Icon", "type", "=", "\"close\"", "/", ">", "<", "/Button>", "<", "Button", "iconOnly", "shape", "=", "\"text\"", "type", "=", "\"primary\"", ">", "<", "Icon", "type", "=", "\"close\"", "/", ">", "<", "/Button>", "<", "Button", "iconOnly", "shape", "=", "\"text\"", "disabled", ">", "<", "Icon", "type", "=", "\"close\"", "/", ">", "<", "/Button>", "<", "h3", ">", "尺寸", "<", "/h3>", "<", "Button", "size", "=", "\"small\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "<", "/Button>", "<", "Button", "size", "=", "\"medium\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "<", "/Button>", "<", "Button", "size", "=", "\"large\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "<", "/Button>", "<", "br", "/", ">", "<", "Button", "shape", "=", "\"text\"", "size", "=", "\"small\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "<", "/Button>", "<", "Button", "shape", "=", "\"text\"", "size", "=", "\"medium\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "<", "/Button>", "<", "Button", "shape", "=", "\"text\"", "size", "=", "\"large\"", "iconOnly", ">", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "<", "/Button>", "<", "/Group>);", "export", "const", "Loading", "=", "(", ")", "=>", "{", "const", "[", "loading", ",", "setLoading", "]", "=", "useState", "(", "false", ")", ";", "return", "(", "<", "Group", ">", "<", "Button", "loading", "=", "{", "loading", "}", "onClick", "=", "{", "(", ")", "=>", "setLoading", "(", "!", "loading", ")", "}", ">", "点击切换加载状态", "<", "/Button>", "<", "Button", "type", "=", "\"primary\"", "loading", "=", "{", "loading", "}", "onClick", "=", "{", "(", ")", "=>", "setLoading", "(", "!", "loading", ")", "}", ">", "点击切换加载状态", "<", "/Button>", "<", "/Group>);", "}", ";", "export", "const", "ButtonGroup", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "Group", "attached", ">", "<", "Button", ">", "Left", "Button", "<", "/Button>", "<", "Button", ">", "Center", "Button", "<", "/Button>", "<", "Button", ">", "Right", "Button", "<", "/Button>", "<", "/Group>", "<", "br", "/", ">", "<", "br", "/>", "<", "Group", ">", "<", "Button", ">", "Left", "Button", "<", "/Button>", "<", "Button", ">", "Center", "Button", "<", "/Button>", "<", "Button", ">", "Right", "Button", "<", "/Button>", "<", "/Group>", "<", "/Group>);", "export", "const", "Toggle", "=", "(", ")", "=>", "{", "const", "[", "selected", ",", "setSelected", "]", "=", "useState", "(", "false", ")", ";", "return", "(", "<", "Button", "selected", "=", "{", "selected", "}", "onClick", "=", "{", "(", ")", "=>", "setSelected", "(", "!", "selected", ")", "}", ">", "{", "selected", "?", "'已订阅'", ":", "'订阅'", "}", "<", "/Button>);", "}", ";", "export", "const", "Toggled", "=", "(", ")", "=>", "{", "return", "(", "<", "Group", ">", "<", "Button", "selected", ">", "已订阅", "<", "/Button>", "<", "Button", "selected", "type", "=", "\"primary\"", ">", "已订阅", "<", "/Button>", "<", "Button", "selected", "type", "=", "\"secondary\"", ">", "已订阅", "<", "/Button>", "<", "Button", "selected", "type", "=", "\"primary\"", "shape", "=", "\"warning\"", ">", "已订阅", "<", "/Button>", "<", "Button", "selected", "type", "=", "\"primary\"", "shape", "=", "\"text\"", ">", "已订阅", "<", "/Button>", "<", "/Group>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1162
[ "import", "{", "Checkbox", ",", "CheckboxGroup", ",", "Group", "}", "from", "'@rexd/core'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Checkbox'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "Checkbox", "onChange", "=", "{", "console", ".", "log", "}", ">", "订阅", "<", "/Checkbox>", "<", "Checkbox", "defaultChecked", "onChange", "=", "{", "console", ".", "log", "}", ">", "订阅", "<", "/Checkbox>", "<", "Checkbox", "defaultIndeterminate", "onChange", "=", "{", "console", ".", "log", "}", ">", "订阅", "<", "/Checkbox>", "<", "Checkbox", "checked", ">", "订阅", "(", "受控", ")", "<", "/Checkbox>", "<", "Checkbox", "indeterminate", ">", "订阅", "(", "受控", ")", "<", "/Checkbox>", "<", "Checkbox", "disabled", ">", "订阅", "(", "禁用", ")", "<", "/Checkbox>", "<", "/Group>);", "export", "const", "Controlled", "=", "(", ")", "=>", "{", "const", "[", "checked", ",", "setChecked", "]", "=", "useState", "(", ")", ";", "return", "(", "<", "Group", ">", "<", "Checkbox", "defaultChecked", ">", "订阅", "(", "非受控", ")", "<", "/Checkbox>", "<", "Checkbox", "checked", "=", "{", "checked", "}", "onChange", "=", "{", "(", "val", ")", "=>", "setChecked", "(", "checked", ")", "}", ">", "订阅", "(", "受控", ")", "<", "/Checkbox>", "<", "/Group>);", "}", ";", "const", "dataSource", "=", "[", "{", "label", ":", "'客服'", ",", "value", ":", "'01'", "}", ",", "{", "label", ":", "'店长'", ",", "value", ":", "'02'", "}", ",", "{", "label", ":", "'师傅'", ",", "value", ":", "'03'", "}", ",", "]", ";", "export", "const", "GroupDemo", "=", "(", ")", "=>", "{", "return", "(", "<", "Group", ">", "<", "h3", ">", "水平", "<", "/h3>", "<", "CheckboxGroup", "dataSource", "=", "{", "dataSource", "}", "defaultValue", "=", "{", "[", "'01'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "br", "/>", "<", "h3", ">", "垂直", "<", "/h3>", "<", "CheckboxGroup", "direction", "=", "\"column\"", "dataSource", "=", "{", "dataSource", "}", "defaultValue", "=", "{", "[", "'01'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}", ";", "export", "const", "ControlledGroup", "=", "(", ")", "=>", "{", "const", "[", "val", ",", "setVal", "]", "=", "useState", "(", "null", ")", ";", "return", "<", "CheckboxGroup", "dataSource", "=", "{", "dataSource", "}", "value", "=", "{", "val", "}", "onChange", "=", "{", "(", "val", ")", "=>", "setVal", "(", "val", ")", "}", "/>;", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1163
[ "import", "React", "from", "'react'", ";", "import", "{", "Collapse", ",", "CollapseGroup", "}", "from", "'@rexd/core/src/components/collapse'", ";", "import", "{", "useCollapse", "}", "from", "'@rexd/core/src/components/collapse/use-collapse'", ";", "import", "{", "Button", ",", "Flex", ",", "Text", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Collapse'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "(", "<", "CollapseGroup", ">", "<", "Collapse", "title", "=", "\"MFDT 多因子设计\"", ">", "<", "ul", ">", "<", "li", ">", "随着新零售的快速发展", ",", "新的端源源不断的出现", ",", "小二每天要面对大量的设备", ",", "PC", "、", "Pad", "、", "POS", "、", "Phone", "、", "RF", "、", "Watch", "、", "TV", "...", "每个端因为分辨率", "、", "屏幕精度", "、", "使用场景等条件等不同", "<", "/li>", "<", "li", ">", "为了保持每个端更好的体验", ",", "设计师都需要分别设计一套组件和定义一套设计规范", ",", "开发者的维护成本也越来越高", "。", "<", "/li>", "<", "/ul>", "<", "/Collapse>", "<", "Collapse", "title", "=", "\"品牌色\"", ">", "<", "ul", ">", "<", "li", ">", "主色", "<", "/li>", "<", "li", ">", "辅色", "<", "/li>", "<", "/ul>", "<", "/Collapse>", "<", "Collapse", "title", "=", "\"色彩体系\"", ">", "<", "img", "src", "=", "\"https://hippo-oss.oss-cn-hangzhou.aliyuncs.com/rex/design-images/colors/c166967f.png\"", "/", ">", "<", "/Collapse>", "<", "Collapse", "title", "=", "\"语义色\"", ">", "语义色代表明确的信息以及状态", ",", "比如成功", "、", "出错", "、", "失败", "、", "提醒", "、", "链接等", "。", "功能色的选择需要按照常规色彩认知", "。", "比如", ":", "红色表达危险状态", ",", "橙色表达警示状态", ",", "绿色表达成功状态", ",", "蓝色为链接", "。", "在颜色选择上", ",", "请参考色板语义", "。", "<", "/Collapse>", "<", "/CollapseGroup>);", "const", "ds", "=", "[", "{", "title", ":", "'simple title'", ",", "content", ":", "(", "<", "ul", ">", "<", "li", ">", "Promotions", "are", "marketing", "campaigns", "ran", "by", "Marketplace", "<", "/", "li", ">", "<", "li", ">", "Participate", "to", "sale", "your", "products", "during", "that", "promotion", "and", "make", "a", "profit", "<", "/li>", "<", "/ul>),", "}", ",", "{", "title", ":", "'simple title 2'", ",", "panelKey", ":", "'title2'", ",", "content", ":", "<", "div", ">", "wow", "<", "/div>,", "}", ",", "{", "title", ":", "'simple title 3'", ",", "panelKey", ":", "'wow'", ",", "content", ":", "<", "div", ">", "WOW", "<", "/div>,", "}", ",", "]", ";", "const", "nestedDataSource", "=", "[", "{", "title", ":", "'simple title'", ",", "content", ":", "(", "<", "ul", ">", "<", "li", ">", "Promotions", "are", "marketing", "campaigns", "ran", "by", "Marketplace", "<", "/", "li", ">", "<", "li", ">", "Participate", "to", "sale", "your", "products", "during", "that", "promotion", "and", "make", "a", "profit", "<", "/li>", "<", "/ul>),", "}", ",", "{", "title", ":", "'simple title 2'", ",", "content", ":", "<", "CollapseGroup", "dataSource", "=", "{", "ds", "}", "onExpand", "=", "{", "console", ".", "log", "}", "/", ">", ",", "}", ",", "]", ";", "export", "const", "DataSource", "=", "(", ")", "=>", "<", "CollapseGroup", "dataSource", "=", "{", "ds", "}", "onExpand", "=", "{", "console", ".", "log", "}", "/", ">", ";", "export", "const", "Accordion", "=", "(", ")", "=>", "<", "CollapseGroup", "dataSource", "=", "{", "ds", "}", "accordion", "onExpand", "=", "{", "console", ".", "log", "}", "/", ">", ";", "export", "const", "Disabled", "=", "(", ")", "=>", "<", "CollapseGroup", "dataSource", "=", "{", "ds", "}", "disabled", "/>;", "export", "const", "Nested", "=", "(", ")", "=>", "<", "CollapseGroup", "dataSource", "=", "{", "nestedDataSource", "}", "onExpand", "=", "{", "console", ".", "log", "}", "/", ">", ";", "export", "const", "Hooks", "=", "(", ")", "=>", "{", "const", "{", "getCollapseProps", ",", "getToggleProps", ",", "isExpanded", "}", "=", "useCollapse", "(", "{", "defaultExpanded", ":", "true", ",", "}", ")", ";", "return", "(", "<", "Flex", "width", "=", "\"300px\"", "direction", "=", "\"column\"", "border", "=", "\"1px solid rgba(0, 0, 0, 0.12)\"", "borderRadius", "=", "\"4px\"", "p", "=", "\"16px\"", ">", "<", "Text", "as", "=", "\"h2\"", ">", "小盒马大促销", "<", "/Text>", "<", "div", ">", "<", "Button", "{", "...", "getToggleProps", "(", ")", "}", ">", "{", "isExpanded", "?", "'关闭'", ":", "'更多'", "}", "<", "/Button>", "<", "/div>", "<", "div", "{", "...", "getCollapseProps", "(", "{", "}", ")", "}", ">", "三元一斤十元三斤", "Lorem", "ipsum", "dolor", "sit", "amet", ",", "consectetur", "adipisicing", "elit", ".", "Asperiores", "deleniti", "eius", "facere", "iusto", "nobis", "?", "Libero", "sequi", "veritatis", "vitae", "?", "Ex", "illo", "itaque", "modi", "molestiae", "quas", ",", "quis", "ratione", "unde", "veniam", ".", "Quis", ",", "voluptatibus", "?", "<", "/div>", "<", "/Flex>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1164
[ "import", "React", "from", "'react'", ";", "import", "{", "Confirm", ",", "Button", ",", "Group", ",", "Box", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Confirm'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "{", "const", "handlers", "=", "{", "onOk", "(", ")", "{", "console", ".", "log", "(", "'clicked ok'", ")", ";", "}", ",", "onCancel", "(", ")", "{", "console", ".", "log", "(", "'clicked cancel'", ")", ";", "}", ",", "}", ";", "return", "(", "<", "Group", ">", "<", "Confirm", "title", "=", "\"确认删除吗?\"", "{", "...", "handlers", "}", ">", "<", "Button", "shape", "=", "\"warning\"", ">", "删除", "<", "/Button>", "<", "/Confirm>", "<", "Confirm", "{", "...", "handlers", "}", ">", "<", "Box", "display", "=", "\"inline-block\"", "p", "=", "\"m\"", "bg", "=", "\"#333\"", "color", "=", "\"#fff\"", ">", "点击盒子试试", "<", "/Box>", "<", "/Confirm>", "<", "/Group>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, 6, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1165
[ "import", "React", "from", "'react'", ";", "import", "{", "Group", ",", "DatePicker", ",", "DateRangePicker", ",", "dayjs", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'DatePicker'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "DatePicker", "onChange", "=", "{", "console", ".", "log", "}", "defaultValue", "=", "\"2021-03-15\"", "/", ">", "<", "DateRangePicker", "defaultValue", "=", "{", "[", "'2021-03-12'", ",", "'2021-04-02'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}", "export", "function", "HasTime", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "DatePicker", "hasTime", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "DatePicker", "hasTime", "timeProps", "=", "{", "{", "mode", ":", "'normal'", "}", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "DateRangePicker", "hasTime", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}", "export", "function", "GetVisibleMonth", "(", ")", "{", "return", "<", "DatePicker", "getDefaultVisibleMonth", "=", "{", "(", ")", "=>", "dayjs", "(", "'2020-12'", ",", "'YYYY-MM'", ")", "}", "/>;", "}", "export", "function", "DisabledDate", "(", ")", "{", "const", "today", "=", "dayjs", "(", ")", ";", "return", "(", "<", "DatePicker", "getDisabledDate", "=", "{", "(", "date", ")", "=>", "{", "if", "(", "date", ".", "isBefore", "(", "today", ")", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}", "}", "/>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, 792, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1166
[ "import", "React", "from", "'react'", ";", "import", "{", "Description", ",", "Group", ",", "Image", ",", "BaseTable", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Description'", "}", ";", "export", "function", "Basic", "(", ")", "{", "const", "items", "=", "[", "{", "label", ":", "'退款单号'", ",", "content", ":", "'2342345231515'", ",", "}", ",", "{", "label", ":", "'这是一个比较长的标签'", ",", "content", ":", "'45654645'", ",", "}", ",", "{", "label", ":", "'退款金额'", ",", "content", ":", "'¥18.00'", ",", "}", ",", "{", "label", ":", "'退款原因'", ",", "content", ":", "'无理由退货'", ",", "color", ":", "'error.normal'", ",", "}", ",", "{", "label", ":", "'交易金额'", ",", "content", ":", "'¥28.00'", ",", "}", ",", "{", "label", ":", "'退款说明'", ",", "content", ":", "'备注备注'", ",", "}", ",", "{", "label", ":", "'收货地址'", ",", "content", ":", "'浙江省 杭州市 余杭区 文一西路 969 号一号楼邮局'", ",", "span", ":", "3", ",", "}", ",", "]", ";", "return", "<", "Description", "items", "=", "{", "items", "}", "/>;", "}", "export", "function", "Complex", "(", ")", "{", "const", "items", "=", "[", "{", "label", ":", "'退款单号'", ",", "content", ":", "'2342345231515'", ",", "}", ",", "{", "label", ":", "'采退类型'", ",", "content", ":", "'45654645'", ",", "}", ",", "{", "label", ":", "'退款金额'", ",", "content", ":", "'¥18.00'", ",", "}", ",", "{", "label", ":", "'退款原因'", ",", "content", ":", "'无理由退货'", ",", "}", ",", "{", "label", ":", "'交易金额'", ",", "content", ":", "'¥28.00'", ",", "}", ",", "{", "label", ":", "'退款说明'", ",", "content", ":", "'备注备注'", ",", "}", ",", "{", "label", ":", "'收货地址'", ",", "content", ":", "'浙江省 杭州市 余杭区 文一西路 969 号一号楼邮局'", ",", "span", ":", "3", ",", "}", ",", "{", "label", ":", "'图片列表'", ",", "content", ":", "[", "{", "url", ":", "'https://img.alicdn.com/tfs/TB1atWRDgHqK1RjSZFkXXX.WFXa-460-462.png'", ",", "}", ",", "{", "url", ":", "'https://img.alicdn.com/tfs/TB1atWRDgHqK1RjSZFkXXX.WFXa-460-462.png'", ",", "}", ",", "]", ",", "span", ":", "3", ",", "renderContent", ":", "(", "{", "content", "}", ")", "=>", "{", "return", "(", "<", "Group", ">", "{", "content", ".", "map", "(", "(", "item", ",", "index", ")", "=>", "(", "<", "Image", "key", "=", "{", "index", "}", "src", "=", "{", "item", ".", "url", "}", "width", "=", "\"100px\"", "height", "=", "\"100px\"", "/", ">", ")", ")", "}", "<", "/Group>);", "}", ",", "}", ",", "{", "label", ":", "'退款详情'", ",", "content", ":", "[", "{", "title", ":", "'配送服务'", ",", "price", ":", "'10.00'", ",", "}", ",", "{", "title", ":", "'盒马公仔'", ",", "price", ":", "'18.00'", ",", "}", ",", "]", ",", "span", ":", "3", ",", "renderContent", ":", "(", "{", "content", "}", ")", "=>", "{", "return", "(", "<", "BaseTable", "dataSource", "=", "{", "content", "}", "columns", "=", "{", "[", "{", "name", ":", "'商品名称'", ",", "code", ":", "'title'", "}", ",", "{", "name", ":", "'商品价格'", ",", "code", ":", "'price'", "}", ",", "]", "}", "/", ">", ")", ";", "}", ",", "}", ",", "]", ";", "return", "<", "Description", "items", "=", "{", "items", "as", "any", "[", "]", "}", "/>;", "}", "export", "function", "Columns", "(", ")", "{", "const", "items", "=", "[", "{", "label", ":", "'退款单号'", ",", "content", ":", "'2342345231515'", ",", "}", ",", "{", "label", ":", "'采退类型'", ",", "content", ":", "'45654645'", ",", "}", ",", "{", "label", ":", "'退款金额'", ",", "content", ":", "'¥18.00'", ",", "}", ",", "{", "label", ":", "'退款原因'", ",", "content", ":", "'无理由退货'", ",", "}", ",", "{", "label", ":", "'交易金额'", ",", "content", ":", "'¥28.00'", ",", "}", ",", "{", "label", ":", "'退款说明'", ",", "content", ":", "'备注备注'", ",", "}", ",", "{", "label", ":", "'收货地址'", ",", "content", ":", "'浙江省 杭州市 余杭区 文一西路 969 号一号楼邮局'", ",", "}", ",", "]", ";", "return", "<", "Description", "columns", "=", "{", "1", "}", "items", "=", "{", "items", "}", "/", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1167
[ "import", "React", "from", "'react'", ";", "import", "axios", "from", "'axios'", ";", "import", "{", "Group", ",", "FilePicker", ",", "FilePickerProps", ",", "MediaPicker", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'FilePicker'", ",", "component", ":", "FilePicker", "}", ";", "const", "files", "=", "[", "{", "id", ":", "'01'", ",", "name", ":", "'IMG1.png'", ",", "url", ":", "'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'", ",", "downloadUrl", ":", "'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'", ",", "previewUrl", ":", "'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'", ",", "}", ",", "{", "id", ":", "'02'", ",", "name", ":", "'IMG2.png'", ",", "url", ":", "'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'", ",", "percent", ":", "20", ",", "}", ",", "{", "id", ":", "'03'", ",", "name", ":", "'IMG3.png'", ",", "url", ":", "'https://img.alicdn.com/tfs/TB1gjPyp9slXu8jSZFuXXXg7FXa-750-272.png'", ",", "}", ",", "]", "as", "FilePickerProps", "[", "'value'", "]", ";", "const", "getRequest", "=", "(", "options", ")", "=>", "axios", "(", "{", "method", ":", "'post'", ",", "url", ":", "'http://127.0.0.1:7001/api/upload'", ",", "transformResponse", ":", "[", "]", ".", "concat", "(", "axios", ".", "defaults", ".", "transformResponse", ",", "(", "data", ")", "=>", "{", "return", "{", "url", ":", "data", ".", "data", ",", "message", ":", "data", ".", "message", ",", "}", ";", "}", ")", ",", "onUploadProgress", ":", "(", "e", ")", "=>", "{", "console", ".", "log", "(", "e", ")", ";", "}", ",", "...", "options", ",", "}", ")", ".", "then", "(", "(", "ret", ")", "=>", "{", "return", "ret", ".", "data", ";", "}", ")", ";", "const", "props", "=", "{", "defaultValue", ":", "files", ",", "request", ":", "getRequest", ",", "onChange", ":", "(", "...", "args", ")", "=>", "console", ".", "log", "(", "'change:'", ",", "...", "args", ")", ",", "onRemove", ":", "(", "...", "args", ")", "=>", "console", ".", "log", "(", "'remove:'", ",", "...", "args", ")", ",", "}", "as", "FilePickerProps", ";", "export", "const", "Basic", "=", "(", ")", "=>", "(", "<", "Group", "spacingY", "=", "\"l\"", "display", "=", "\"block\"", ">", "<", "FilePicker", "{", "...", "props", "}", "/", ">", "<", "FilePicker", "{", "...", "props", "}", "disabled", "/>", "<", "/Group>);", "export", "const", "Media", "=", "(", ")", "=>", "{", "return", "(", "<", "Group", "spacingY", "=", "\"l\"", ">", "<", "MediaPicker", "{", "...", "props", "}", "/", ">", "<", "MediaPicker", "{", "...", "props", "}", "disabled", "/", ">", "<", "/Group>);", "}", ";", "/**\n * 拖拽上传\n */", "export", "const", "DragFile", "=", "(", ")", "=>", "{", "return", "(", "<", "Group", "spacingY", "=", "\"l\"", "width", "=", "\"800px\"", ">", "<", "FilePicker", "renderTrigger", "=", "{", "(", "props", ")", "=>", "<", "FilePicker", ".", "DragFileTrigger", "{", "...", "props", "}", "/", ">", "}", "request", "=", "{", "getRequest", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "FilePicker", "renderTrigger", "=", "{", "(", "props", ")", "=>", "<", "FilePicker", ".", "DragFileTrigger", "{", "...", "props", "}", "/", ">", "}", "request", "=", "{", "getRequest", "}", "onChange", "=", "{", "console", ".", "log", "}", "disabled", "/", ">", "<", "/Group>);", "}", ";", "export", "const", "Status", "=", "(", ")", "=>", "{", "const", "files", "=", "[", "{", "id", ":", "'01'", ",", "name", ":", "'img.png'", ",", "url", ":", "'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'", ",", "status", ":", "'success'", ",", "}", ",", "{", "id", ":", "'02'", ",", "name", ":", "'test.png'", ",", "url", ":", "'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'", ",", "status", ":", "'error'", ",", "}", ",", "{", "id", ":", "'03'", ",", "name", ":", "'test02.png'", ",", "url", ":", "'https://img.alicdn.com/tps/TB19O79MVXXXXcZXVXXXXXXXXXX-1024-1024.jpg'", ",", "status", ":", "'process'", ",", "}", ",", "]", ";", "return", "(", "<", "Group", "spacingY", "=", "\"l\"", "display", "=", "\"block\"", ">", "<", "FilePicker", "defaultValue", "=", "{", "files", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "MediaPicker", "defaultValue", "=", "{", "files", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}", ";", "export", "const", "FileTypes", "=", "(", ")", "=>", "{", "return", "<", "MediaPicker", "accept", "=", "\"image/*\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";", "export", "const", "Multiple", "=", "(", ")", "=>", "{", "return", "<", "FilePicker", "multiple", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 92, null, null, null, null, null, null, null, null, null, null, null, null, 46490, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1168
[ "import", "React", "from", "'react'", ";", "import", "{", "Group", ",", "Input", ",", "FormLayout", ",", "FieldSet", ",", "FormControl", ",", "DatePicker", ",", "SearchFormLayout", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'FormLayout'", "}", ";", "/**\n * 基本用法\n */", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "FormControl", "labelPosition", "=", "\"left\"", "label", "=", "\"邮箱地址\"", "labelTips", "=", "\"这里填入有效的邮箱地址,不支持 qq 邮箱\"", "help", "=", "\"我们不会公开您的邮箱地址。\"", "error", "=", "\"这是一条错误消息\"", "required", ">", "<", "Input", "type", "=", "\"email\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/FormControl>);", "}", "/**\n * 标签位于上方\n */", "export", "function", "LabelTop", "(", ")", "{", "return", "(", "<", "FormControl", "labelPosition", "=", "\"top\"", "label", "=", "\"邮箱地址\"", "labelTips", "=", "\"这里填入有效的邮箱地址,不支持 qq 邮箱\"", "help", "=", "\"我们不会公开您的邮箱地址。\"", "error", "=", "\"这是一条错误消息\"", "required", ">", "<", "Input", "type", "=", "\"email\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/FormControl>);", "}", "/**\n * 没有标签\n */", "export", "function", "NoLabelControl", "(", ")", "{", "return", "(", "<", "FormControl", "help", "=", "\"我们不会公开您的邮箱地址。\"", "error", "=", "\"这是一条错误消息\"", "required", ">", "<", "Input", "type", "=", "\"email\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/FormControl>);", "}", "/**\n * 自定义标签区域宽度\n */", "export", "function", "LongLabels", "(", ")", "{", "return", "(", "<", "FormLayout", "labelWidth", "=", "\"200px\"", ">", "<", "FormControl", "label", "=", "\"物料供应商全称\"", ">", "<", "Input", "placeholder", "=", "\"文一西路超市\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"联系人所在城市街道和门牌号\"", ">", "<", "Input", "placeholder", "=", "\"街道\"", "style", "=", "{", "{", "width", ":", "180", ",", "marginRight", ":", "12", "}", "}", "/>", "<", "Input", "placeholder", "=", "\"邮政编码\"", "style", "=", "{", "{", "width", ":", "180", "}", "}", "/>", "<", "/FormControl>", "<", "/FormLayout>);", "}", "export", "function", "Inline", "(", ")", "{", "return", "(", "<", "FormLayout", "inline", ">", "<", "FormControl", "label", "=", "\"邮箱地址\"", "required", "help", "=", "\"我们不会公开您的邮箱地址。\"", "error", "=", "\"这是一条错误消息\"", ">", "<", "Input", "width", "=", "\"200px\"", "type", "=", "\"email\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"邮箱地址\"", "required", "help", "=", "\"我们不会公开您的邮箱地址。\"", "error", "=", "\"这是一条错误消息\"", ">", "<", "Input", "width", "=", "\"200px\"", "type", "=", "\"email\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/FormControl>", "<", "/FormLayout>);", "}", "export", "function", "NestFormControls", "(", ")", "{", "return", "(", "<", "FormLayout", ">", "<", "FormControl", "label", "=", "\"姓名\"", ">", "<", "Input", "placeholder", "=", "\"姓名\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"地址\"", ">", "<", "Group", ">", "<", "FormControl", "inline", ">", "<", "Input", "placeholder", "=", "\"城市\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "inline", ">", "<", "Input", "placeholder", "=", "\"邮政编码\"", "/", ">", "<", "/FormControl>", "<", "/Group>", "<", "/FormControl>", "<", "/FormLayout>);", "}", "export", "function", "SimpleFormLayout", "(", ")", "{", "return", "(", "<", "FormLayout", ">", "<", "FormControl", "label", "=", "\"店名\"", "required", "help", "=", "\"辅助文本\"", ">", "<", "Input", "placeholder", "=", "\"文一西路超市\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"地址\"", ">", "<", "Group", ">", "<", "Input", "placeholder", "=", "\"城市\"", "/", ">", "<", "Input", "placeholder", "=", "\"邮政编码\"", "/", ">", "<", "/Group>", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"日期\"", ">", "<", "Group", ">", "<", "DatePicker", "placeholder", "=", "\"开始日期\"", "/", ">", "<", "DatePicker", "placeholder", "=", "\"结束日期\"", "/", ">", "<", "/Group>", "<", "/FormControl>", "<", "/FormLayout>);", "}", "export", "function", "FormFieldSets", "(", ")", "{", "return", "(", "<", "FormLayout", ">", "<", "FieldSet", "title", "=", "\"办公室信息\"", ">", "<", "FormControl", "label", "=", "\"地址名称\"", "required", "help", "=", "\"辅助文本\"", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"街道地址\"", "required", "error", "=", "\"必填字段\"", ">", "<", "Input", "placeholder", "=", "\"请选择\"", "/", ">", "<", "/FormControl>", "<", "/FieldSet>", "<", "FieldSet", "title", "=", "\"联系信息\"", ">", "<", "FormControl", "label", "=", "\"电子邮箱\"", "required", "help", "=", "\"辅助文本\"", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"电话\"", "required", "error", "=", "\"必填字段\"", ">", "<", "Input", "placeholder", "=", "\"请选择\"", "/", ">", "<", "/FormControl>", "<", "/FieldSet>", "<", "/FormLayout>);", "}", "export", "function", "MultiColumnFormFieldSet", "(", ")", "{", "return", "(", "<", "FieldSet", "title", "=", "\"办公室信息\"", "columns", "=", "{", "2", "}", ">", "<", "FormControl", "label", "=", "\"城市\"", "required", "help", "=", "\"辅助文本\"", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"地址名称\"", "required", "help", "=", "\"辅助文本\"", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"街道地址\"", "required", "error", "=", "\"必填字段\"", ">", "<", "Input", "placeholder", "=", "\"请选择\"", "/", ">", "<", "/FormControl>", "<", "/FieldSet>);", "}", "export", "function", "BasicSearchFormLayout", "(", ")", "{", "return", "(", "<", "SearchFormLayout", ">", "<", "FormControl", "label", "=", "\"订单号\"", "required", "labelTips", "=", "\"请输入 16 位订单编码\"", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"仓库\"", "required", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"商家\"", "required", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"门店\"", "required", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"创建人\"", "required", ">", "<", "Input", "placeholder", "=", "\"请输入\"", "/", ">", "<", "/FormControl>", "<", "FormControl", "label", "=", "\"更新人\"", "required", ">", "<", "Input", "placeholder", "=", "\"请选择\"", "/", ">", "<", "/FormControl>", "<", "/SearchFormLayout>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1169
[ "import", "{", "Box", ",", "Grid", ",", "Group", ",", "Input", ",", "GridItem", "}", "from", "'@rexd/core'", ";", "import", "{", "Icon", ",", "ICON_TYPE_LIST", ",", "useIconfont", "}", "from", "'@rexd/icon'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Icons'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "{", "const", "[", "query", ",", "setQuery", "]", "=", "useState", "<", "string", ">", "(", "''", ")", ";", "return", "(", "<", "Box", ">", "<", "Box", ">", "<", "Input", "placeholder", "=", "\"输入图标名称进行检索\"", "onChange", "=", "{", "setQuery", "}", "/", ">", "<", "/Box>", "<", "Grid", "columns", "=", "{", "5", "}", ">", "{", "ICON_TYPE_LIST", ".", "filter", "(", "(", "name", ")", "=>", "!", "query", "||", "name", ".", "includes", "(", "query", ")", ")", ".", "map", "(", "(", "iconType", ")", "=>", "(", "<", "GridItem", "key", "=", "{", "iconType", "}", "textAlign", "=", "\"center\"", "py", "=", "\"l\"", ">", "<", "Icon", "type", "=", "{", "iconType", "}", "style", "=", "{", "{", "height", ":", "'50px'", ",", "width", ":", "'50px'", "}", "}", "/", ">", "<", "Box", "fontSize", "=", "\"16px\"", ">", "{", "iconType", "}", "<", "/Box>", "<", "/GridItem>))}", "<", "/Grid>", "<", "/Box>);", "}", ";", "export", "const", "Iconfont", "=", "(", ")", "=>", "{", "const", "SvgIcon", "=", "useIconfont", "(", "{", "scriptUrl", ":", "'//at.alicdn.com/t/font_1062849_wshbvt9mp1.js'", ",", "}", ")", ";", "return", "(", "<", "Group", "fontSize", "=", "\"body\"", ">", "<", "SvgIcon", "type", "=", "\"audio\"", "size", "=", "\"40px\"", "/", ">", "<", "SvgIcon", "type", "=", "\"mouse\"", "size", "=", "\"40px\"", "/", ">", "<", "SvgIcon", "type", "=", "\"eye\"", "size", "=", "\"40px\"", "/", ">", "<", "SvgIcon", "type", "=", "\"gesture\"", "size", "=", "\"40px\"", "/", ">", "<", "/Group>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1170
[ "import", "React", "from", "'react'", ";", "import", "{", "Group", ",", "Image", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Image'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Image", "src", "=", "\"https://img.alicdn.com/tfs/TB1gjPyp9slXu8jSZFuXXXg7FXa-750-272.png\"", "width", "=", "\"400px\"", "/", ">", "<", "/Group>);", "}", "export", "function", "Size", "(", ")", "{", "const", "sourceUrl", "=", "'https://img.alicdn.com/tfs/TB1atWRDgHqK1RjSZFkXXX.WFXa-460-462.png'", ";", "return", "(", "<", "Group", ">", "<", "Image", "width", "=", "\"100px\"", "height", "=", "\"100px\"", "src", "=", "{", "sourceUrl", "}", "/", ">", "<", "Image", "width", "=", "\"150px\"", "height", "=", "\"150px\"", "src", "=", "{", "sourceUrl", "}", "/", ">", "<", "/Group>);", "}", "export", "function", "Fallback", "(", ")", "{", "return", "<", "Image", "src", "=", "\"notfound.png\"", "fallbackSrc", "=", "\"https://via.placeholder.com/150\"", "/", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1171
[ "import", "{", "Flex", ",", "Group", ",", "Input", ",", "InputAddon", "}", "from", "'@rexd/core'", ";", "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Input'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Flex", "spacing", "=", "\"l\"", "direction", "=", "\"column\"", ">", "<", "Input", "onChange", "=", "{", "console", ".", "log", "}", "/>", "<", "Input", "defaultValue", "=", "\"默认值\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Input", "defaultValue", "=", "\"只读输入框\"", "onChange", "=", "{", "console", ".", "log", "}", "readOnly", "/", ">", "<", "Input", "defaultValue", "=", "\"只读输入框\"", "onChange", "=", "{", "console", ".", "log", "}", "disabled", "/", ">", "<", "/Flex>);", "}", "export", "function", "Fill", "(", ")", "{", "return", "<", "Input", "fill", "placeholder", "=", "\"详细配送地址\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", "export", "function", "Status", "(", ")", "{", "return", "(", "<", "Flex", "spacing", "=", "\"l\"", "direction", "=", "\"column\"", ">", "<", "Input", "defaultValue", "=", "\"hippo\"", "status", "=", "\"error\"", "/", ">", "<", "Input", "defaultValue", "=", "\"hippo\"", "status", "=", "\"success\"", "/", ">", "<", "Input", "defaultValue", "=", "\"hippo\"", "status", "=", "\"warning\"", "/", ">", "<", "/Flex>);", "}", "export", "function", "HasClear", "(", ")", "{", "return", "<", "Input", "hasClear", "defaultValue", "=", "\"点击右侧图标清空当前文本\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", "export", "function", "NoBorder", "(", ")", "{", "return", "<", "Input", "shape", "=", "\"simple\"", "placeholder", "=", "\"简单输入框\"", "/", ">", ";", "}", "export", "function", "Elements", "(", ")", "{", "return", "(", "<", "Flex", "spacing", "=", "\"l\"", "direction", "=", "\"column\"", ">", "<", "Input", "hasClear", "leftElement", "=", "{", "<", "Icon", "type", "=", "\"search\"", "/", ">", "}", "rightElement", "=", "{", "<", "Icon", "type", "=", "\"calendar\"", "/", ">", "}", "defaultValue", "=", "\"default value\"", "/", ">", "<", "/Flex>);", "}", "export", "function", "Controlled", "(", ")", "{", "const", "[", "input", ",", "setInput", "]", "=", "useState", "(", "'rex'", ")", ";", "return", "<", "Input", "placeholder", "=", "\"Basic usage\"", "onChange", "=", "{", "(", "val", ")", "=>", "setInput", "(", "val", ")", "}", "value", "=", "{", "input", "}", "/", ">", ";", "}", "export", "function", "Password", "(", ")", "{", "const", "[", "hide", ",", "setHide", "]", "=", "useState", "(", "true", ")", ";", "return", "(", "<", "Input", "type", "=", "{", "hide", "?", "'password'", ":", "'text'", "}", "defaultValue", "=", "\"1234\"", "rightElement", "=", "{", "<", "Icon", "type", "=", "{", "hide", "?", "'eye-close'", ":", "'browse'", "}", "onClick", "=", "{", "(", ")", "=>", "setHide", "(", "!", "hide", ")", "}", "/>}/", ">", ")", ";", "}", "export", "function", "AutoCompleteOff", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "h3", ">", "禁用表单自动填充", "<", "/h3>", "<", "Input", "autoComplete", "=", "\"off\"", "/", ">", "<", "h3", ">", "阻止密码字段的自动填充", "<", "/h3>", "<", "Input", "autoComplete", "=", "\"new-password\"", "/", ">", "<", "/Group>);", "}", "export", "function", "Addons", "(", ")", "{", "return", "(", "<", "Flex", "spacing", "=", "\"l\"", "direction", "=", "\"column\"", ">", "<", "Group", "attached", ">", "<", "InputAddon", ">", "https", ":", "<", "Input", "placeholder", "=", "\"portal.hemaos\"", "/", ">", "<", "InputAddon", ">", ".", "com", "<", "/InputAddon>", "<", "/Group>", "<", "Group", "attached", ">", "<", "InputAddon", ">", "+", "86", "<", "/InputAddon>", "<", "Input", "placeholder", "=", "\"11 位手机号码\"", "/", ">", "<", "/Group>", "<", "/Flex>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1172
[ "import", "{", "Link", ",", "Text", "}", "from", "'@rexd/core'", ";", "import", "{", "Icon", "}", "from", "'@rexd/icon'", ";", "import", "React", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Link'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "<", "Link", "href", "=", "\"#\"", ">", "Hippo", "Design", "<", "/Link>;", "export", "const", "ExternalLink", "=", "(", ")", "=>", "(", "<", "Link", "href", "=", "\"https://alibaba.github.io/rex-design/\"", "external", ">", "Chakra", "Design", "system", "<", "Icon", "type", "=", "\"link\"", "/", ">", "<", "/Link>);", "export", "const", "TextWithLink", "=", "(", ")", "=>", "(", "<", "Text", ">", "你可以将", "<", "Link", "href", "=", "\"#\"", ">", "Link", "用于文本内容中", "<", "/Link>", "<", "/Text>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1173
[ "import", "{", "Flex", ",", "Loading", ",", "RadioGroup", "}", "from", "'@rexd/core'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Loading'", "}", ";", "const", "hippoIntroduction", "=", "'盒马是阿里巴巴集团旗下,以数据和技术驱动的新零售平台。盒马希望为消费者打造社区化的一站式新零售体验中心,用科技和人情味带给人们“鲜美生活”。'", ";", "const", "Content", "=", "(", ")", "=>", "(", "<", ">", "{", "hippoIntroduction", "}", "{", "hippoIntroduction", "}", "{", "hippoIntroduction", "}", "<", "br", "/>", "{", "hippoIntroduction", "}", "{", "hippoIntroduction", "}", "{", "hippoIntroduction", "}", "<", "br", "/>", "{", "hippoIntroduction", "}", "{", "hippoIntroduction", "}", "{", "hippoIntroduction", "}", "<", "br", "/>", "<", "/>);", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Loading", "visible", ">", "<", "div", "style", "=", "{", "{", "minHeight", ":", "400", ",", "fontSize", ":", "16", ",", "lineHeight", ":", "1.5", ",", "background", ":", "'var(--rex-colors-emphasis-20)'", "}", "}", ">", "<", "Content", "/>", "<", "/div>", "<", "/Loading>);", "}", "export", "function", "Controlled", "(", ")", "{", "const", "[", "size", ",", "setSize", "]", "=", "useState", "(", "'large'", ")", ";", "const", "[", "visible", ",", "setVisible", "]", "=", "useState", "(", "true", ")", ";", "return", "(", "<", "div", ">", "<", "Flex", "alignItems", "=", "\"center\"", ">", "可见", ":", "<", "RadioGroup", "dataSource", "=", "{", "[", "{", "value", ":", "'true'", ",", "label", ":", "'显示'", "}", ",", "{", "value", ":", "'false'", ",", "label", ":", "'隐藏'", "}", ",", "]", "}", "value", "=", "{", "String", "(", "visible", ")", "}", "onChange", "=", "{", "(", "s", ")", "=>", "setVisible", "(", "s", "===", "'true'", ")", "}", "/>", "<", "/Flex>", "<", "Flex", "alignItems", "=", "\"center\"", ">", "尺寸", ":", "<", "RadioGroup", "dataSource", "=", "{", "[", "{", "value", ":", "'mediun'", ",", "label", ":", "'中尺寸'", "}", ",", "{", "value", ":", "'large'", ",", "label", ":", "'大尺寸'", "}", ",", "]", "}", "value", "=", "{", "size", "}", "onChange", "=", "{", "setSize", "}", "/", ">", "<", "/Flex>", "<", "Loading", "visible", "=", "{", "visible", "}", "size", "=", "{", "size", "as", "any", "}", ">", "<", "div", "style", "=", "{", "{", "minHeight", ":", "400", ",", "fontSize", ":", "16", ",", "lineHeight", ":", "1.5", ",", "background", ":", "'var(--rex-colors-emphasis-20)'", "}", "}", ">", "<", "Content", "/>", "<", "/div>", "<", "/Loading>", "<", "/div>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1174
[ "import", "{", "Button", ",", "Menu", ",", "MenuItem", ",", "Popup", "}", "from", "'@rexd/core'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Menu'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Menu", "style", "=", "{", "{", "width", ":", "200", "}", "}", "dataSource", "=", "{", "[", "{", "key", ":", "'1'", ",", "label", ":", "'选项 1'", "}", ",", "{", "key", ":", "'2'", ",", "label", ":", "'选项 2'", ",", "disabled", ":", "true", "}", ",", "{", "key", ":", "'3'", ",", "label", ":", "'Option 2'", "}", ",", "]", "}", "onItemClick", "=", "{", "(", "key", ",", "detail", ")", "=>", "{", "console", ".", "log", "(", "'YOUR click'", ",", "key", ",", "detail", ")", ";", "}", "}", "/>);", "}", "const", "menuItems", "=", "[", "{", "key", ":", "'1'", ",", "label", ":", "'选项 1'", ",", "selected", ":", "true", ",", "helper", ":", "'Ctrl+P'", "}", ",", "{", "key", ":", "'2'", ",", "label", ":", "'Option 2'", ",", "disabled", ":", "true", "}", ",", "{", "key", ":", "'3'", ",", "type", ":", "'divider'", "}", ",", "{", "key", ":", "'4'", ",", "label", ":", "'动物园'", ",", "icon", ":", "'layout'", "}", ",", "{", "key", ":", "'zoo'", ",", "type", ":", "'submenu'", ",", "label", ":", "'阿里动物园'", ",", "children", ":", "[", "{", "key", ":", "'盒马'", ",", "label", ":", "'盒马'", "}", ",", "{", "key", ":", "'淘宝'", ",", "label", ":", "'淘宝'", ",", "selected", ":", "true", "}", ",", "{", "key", ":", "'天猫'", ",", "label", ":", "'天猫'", "}", ",", "{", "key", ":", "'foo-4'", ",", "type", ":", "'submenu'", ",", "label", ":", "'其他小朋友'", ",", "children", ":", "[", "{", "key", ":", "'小红红'", ",", "label", ":", "'小红红'", "}", ",", "{", "key", ":", "'小蓝蓝'", ",", "label", ":", "'小蓝蓝'", "}", ",", "{", "key", ":", "'小灰灰'", ",", "label", ":", "'小灰灰'", "}", ",", "]", ",", "}", ",", "]", ",", "}", ",", "{", "key", ":", "'2号动物园'", ",", "type", ":", "'group'", ",", "helper", ":", "'1.12 盛大开业'", ",", "label", ":", "'2号动物园'", ",", "children", ":", "[", "{", "key", ":", "'小脑虎'", ",", "label", ":", "'小脑虎'", "}", ",", "{", "key", ":", "'小狮子'", ",", "label", ":", "'小狮子'", ",", "selected", ":", "true", "}", ",", "{", "key", ":", "'小企鹅'", ",", "label", ":", "'小企鹅'", "}", ",", "{", "key", ":", "'bar-4'", ",", "type", ":", "'submenu'", ",", "label", ":", "'小朋友'", ",", "children", ":", "[", "{", "key", ":", "'小红红'", ",", "label", ":", "'小红红'", "}", ",", "{", "key", ":", "'小蓝蓝'", ",", "label", ":", "'小蓝蓝'", "}", ",", "{", "key", ":", "'小灰灰'", ",", "label", ":", "'小灰灰'", "}", ",", "]", ",", "}", ",", "]", ",", "}", ",", "]", ";", "export", "function", "GroupAndSubMenu", "(", ")", "{", "return", "(", "<", "Menu", "style", "=", "{", "{", "width", ":", "200", "}", "}", "dataSource", "=", "{", "menuItems", "}", "onItemClick", "=", "{", "(", "key", ",", "detail", ")", "=>", "{", "console", ".", "log", "(", "'YOUR click'", ",", "key", ",", "detail", ")", ";", "}", "}", "/>);", "}", "export", "function", "MultiSelect", "(", ")", "{", "const", "[", "selectedKeys", ",", "onSelect", "]", "=", "useState", "(", "[", "'1'", ",", "'3'", "]", ")", ";", "return", "(", "<", "div", ">", "<", "p", ">", "selectedKeys", ":", "{", "selectedKeys", ".", "join", "(", "','", ")", "}", "<", "/p>", "<", "Menu", "style", "=", "{", "{", "width", ":", "200", "}", "}", "dataSource", "=", "{", "[", "{", "key", ":", "'1'", ",", "label", ":", "'选项 1 '", ",", "helper", ":", "'Ctrl+P'", "}", ",", "{", "key", ":", "'2'", ",", "label", ":", "'选项 2'", "}", ",", "{", "key", ":", "'3'", ",", "label", ":", "'Option 3'", "}", ",", "]", "}", "selectMode", "=", "\"multiple\"", "selectedKeys", "=", "{", "selectedKeys", "}", "onSelect", "=", "{", "onSelect", "}", "/", ">", "<", "/div>);", "}", "export", "function", "UncontrolledSingleSelect", "(", ")", "{", "return", "(", "<", "Menu", "style", "=", "{", "{", "width", ":", "200", "}", "}", "dataSource", "=", "{", "[", "{", "key", ":", "'1'", ",", "label", ":", "'选项 1 '", ",", "helper", ":", "'Ctrl+P'", "}", ",", "{", "key", ":", "'2'", ",", "label", ":", "'选项 2'", "}", ",", "{", "key", ":", "'3'", ",", "label", ":", "'Option 3'", "}", ",", "]", "}", "selectMode", "=", "\"single\"", "defaultSelectedKeys", "=", "{", "[", "'1'", "]", "}", "onSelect", "=", "{", "(", "nextKeys", ",", "detail", ")", "=>", "{", "console", ".", "log", "(", "'onSelect'", ",", "{", "nextKeys", ",", "detail", "}", ")", ";", "}", "}", "/>);", "}", "export", "function", "DropdownMenu", "(", ")", "{", "return", "(", "<", "Popup", "target", "=", "{", "<", "Button", ">", "更多操作", "<", "/Button>} hasArrow>", "<", "Menu", "autoDismissPopup", "dataSource", "=", "{", "menuItems", "}", "onItemClick", "=", "{", "(", "key", ")", "=>", "{", "console", ".", "log", "(", "'onItemClick'", ",", "key", ")", ";", "}", "}", "/>", "<", "/Popup>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1175
[ "import", "{", "Box", ",", "Grid", ",", "Link", ",", "Notice", "}", "from", "'@rexd/core'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Notice'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "<", "Notice", "status", "=", "\"error\"", "title", "=", "\"您当前的浏览器已过期,请使用最新版的浏览器!\"", "/", ">", ";", "export", "const", "Extra", "=", "(", ")", "=>", "(", "<", "Notice", "status", "=", "\"error\"", "title", "=", "\"您当前的浏览器已过期,请使用最新版的浏览器!\"", "extra", "=", "{", "<", "Link", ">", "查看详情", "<", "/Link>}/", ">", ")", ";", "export", "function", "Closeable", "(", ")", "{", "const", "[", "visible", ",", "setVisible", "]", "=", "useState", "(", "true", ")", ";", "const", "onClose", "=", "(", ")", "=>", "setVisible", "(", "false", ")", ";", "return", "(", "<", "Box", ">", "{", "visible", "&&", "(", "<", "Notice", "status", "=", "\"error\"", "title", "=", "\"您当前的浏览器已过期!\"", "closeable", "onClose", "=", "{", "onClose", "}", ">", "请升级到最新版的浏览器", ",", "否则部分功能可能不可用", "!", "<", "/Notice>)}", "<", "/Box>);", "}", "export", "const", "Content", "=", "(", ")", "=>", "(", "<", "Notice", "status", "=", "\"error\"", "title", "=", "\"您当前的浏览器已过期!\"", "extra", "=", "{", "<", "Link", ">", "查看详情", "<", "/Link>} closeable>", "请升级到最新版的浏览器", ",", "否则部分功能可能不可用", "!", "请升级到最新版的浏览器", ",", "否则部分功能可能不可用", "!", "请升级到最新版的浏览器", ",", "否则部分功能可能不可用", "!", "请升级到最新版的浏览器", ",", "否则部分功能可能不可用", "!", "请升级到最新版的浏览器", ",", "否则部分功能可能不可用", "!", "<", "/Notice>);", "export", "const", "Status", "=", "(", ")", "=>", "(", "<", "Grid", "spacingY", "=", "\"l\"", "columns", "=", "{", "1", "}", ">", "<", "Notice", "status", "=", "\"error\"", "title", "=", "\"发起的请求出现错误\"", "/", ">", "<", "Notice", "status", "=", "\"success\"", "title", "=", "\"文件已上传成功\"", "/", ">", "<", "Notice", "status", "=", "\"warning\"", "title", "=", "\"你的账号密码似乎已经过期,请尽快更换\"", "/", ">", "<", "Notice", "status", "=", "\"info\"", "title", "=", "\"Hippo 将在 2021 年 3 月发布新版本更新\"", "/", ">", "<", "/Grid>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1176
[ "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "Group", ",", "NumberInput", ",", "Button", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'NumberInput'", ",", "component", ":", "NumberInput", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "h3", ">", "普通", "<", "/h3>", "<", "NumberInput", "defaultValue", "=", "{", "1688", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "h3", ">", "输入框只读", "<", "/h3>", "<", "NumberInput", "defaultValue", "=", "{", "1688", "}", "onChange", "=", "{", "console", ".", "log", "}", "readOnly", "/", ">", "<", "h3", ">", "禁用", "<", "/h3>", "<", "NumberInput", "defaultValue", "=", "{", "1688", "}", "onChange", "=", "{", "console", ".", "log", "}", "disabled", "/", ">", "<", "/Group>);", "}", "export", "function", "MinMaxStep", "(", ")", "{", "return", "<", "NumberInput", "defaultValue", "=", "{", "20", "}", "min", "=", "{", "10", "}", "max", "=", "{", "30", "}", "step", "=", "{", "5", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", "export", "function", "Precision", "(", ")", "{", "return", "<", "NumberInput", "defaultValue", "=", "{", "11.11", "}", "precision", "=", "{", "2", "}", "step", "=", "{", "0.01", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", "export", "function", "Format", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "NumberInput", "defaultValue", "=", "{", "999999", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "NumberInput", "defaultValue", "=", "{", "0.05", "}", "step", "=", "{", "0.01", "}", "onChange", "=", "{", "console", ".", "log", "}", "formatOptions", "=", "{", "{", "style", ":", "'percent'", "}", "}", "/>", "<", "/Group>);", "}", "export", "function", "Controlled", "(", ")", "{", "const", "[", "value", ",", "setValue", "]", "=", "useState", "(", "20", ")", ";", "const", "random", "=", "(", ")", "=>", "{", "return", "Math", ".", "floor", "(", "Math", ".", "random", "(", ")", "*", "100", ")", ";", "}", ";", "return", "(", "<", "Group", ">", "<", "Button", "onClick", "=", "{", "(", ")", "=>", "setValue", "(", "random", "(", ")", ")", "}", ">", "设置随机值", "<", "/Button>", "<", "NumberInput", "value", "=", "{", "value", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1177
[ "import", "{", "Button", ",", "Description", ",", "Grid", ",", "Pagination", "}", "from", "'@rexd/core'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Pagination'", ",", "component", ":", "Pagination", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "<", "Pagination", "total", "=", "{", "100", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", "export", "function", "Size", "(", ")", "{", "const", "[", "current", ",", "onChange", "]", "=", "useState", "(", "1", ")", ";", "return", "(", "<", "Grid", "columns", "=", "{", "1", "}", "spacingY", "=", "\"l\"", ">", "<", "Pagination", "size", "=", "\"small\"", "current", "=", "{", "current", "}", "onChange", "=", "{", "onChange", "}", "/", ">", "<", "Pagination", "size", "=", "\"medium\"", "current", "=", "{", "current", "}", "onChange", "=", "{", "onChange", "}", "/", ">", "<", "Pagination", "size", "=", "\"large\"", "current", "=", "{", "current", "}", "onChange", "=", "{", "onChange", "}", "/", ">", "<", "/Grid>);", "}", "export", "function", "PageSizeList", "(", ")", "{", "const", "[", "pageSize", ",", "setPageSize", "]", "=", "useState", "(", "10", ")", ";", "const", "total", "=", "200", ";", "return", "(", "<", "div", ">", "<", "Description", "items", "=", "{", "[", "{", "label", ":", "'总条目'", ",", "content", ":", "total", "}", ",", "{", "label", ":", "'每页条目数'", ",", "content", ":", "pageSize", "}", ",", "]", "}", "/", ">", "<", "Pagination", "hasPageSizeList", "pageSize", "=", "{", "pageSize", "}", "onPageSizeChange", "=", "{", "setPageSize", "}", "total", "=", "{", "total", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/div>);", "}", "export", "function", "Simple", "(", ")", "{", "return", "<", "Pagination", "shape", "=", "\"simple\"", "/", ">", ";", "}", "export", "function", "Controlled", "(", ")", "{", "const", "[", "current", ",", "onChange", "]", "=", "useState", "(", "2", ")", ";", "return", "(", "<", "div", ">", "<", "Description", "items", "=", "{", "[", "{", "label", ":", "'总条目'", ",", "content", ":", "100", "}", ",", "{", "label", ":", "'当前页码'", ",", "content", ":", "current", "}", ",", "]", "}", "/", ">", "<", "Button", "onClick", "=", "{", "(", ")", "=>", "onChange", "(", "1", ")", "}", ">", "回到第1页", "<", "/Button>", "<", "Button", "onClick", "=", "{", "(", ")", "=>", "onChange", "(", "10", ")", "}", "style", "=", "{", "{", "marginLeft", ":", "32", "}", "}", ">", "跳转到最后一页", "<", "/Button>", "<", "Pagination", "style", "=", "{", "{", "marginTop", ":", "8", "}", "}", "fill", "current", "=", "{", "current", "}", "total", "=", "{", "100", "}", "onChange", "=", "{", "onChange", "}", "/", ">", "<", "/div>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1178
[ "import", "React", "from", "'react'", ";", "import", "{", "Group", ",", "Progress", ",", "CircleProgress", ",", "Text", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Progress'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "<", "Progress", "value", "=", "{", "20", "}", "/>;", "}", "export", "function", "RenderLabel", "(", ")", "{", "return", "<", "Progress", "value", "=", "{", "30", "}", "renderLabel", "=", "{", "(", "{", "value", "}", ")", "=>", "`${", "value", "}/100 人已提交`", "}", "/>;", "}", "export", "function", "Circle", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "CircleProgress", "value", "=", "{", "50", "}", "/", ">", "<", "CircleProgress", "value", "=", "{", "50", "}", "lineColor", "=", "\"error.normal\"", "/", ">", "<", "CircleProgress", "value", "=", "{", "50", "}", "lineColor", "=", "\"success.normal\"", "/", ">", "<", "/Group>);", "}", "export", "function", "CircleSize", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "CircleProgress", "value", "=", "{", "50", "}", "size", "=", "\"50px\"", "renderLabel", "=", "{", "(", ")", "=>", "null", "}", "/>", "<", "CircleProgress", "value", "=", "{", "50", "}", "size", "=", "\"100px\"", "renderLabel", "=", "{", "(", "{", "value", "}", ")", "=>", "<", "Text", "fontSize", "=", "\"24px\"", ">", "{", "value", "}", "%", "<", "/Text>}/", ">", "<", "CircleProgress", "value", "=", "{", "50", "}", "size", "=", "\"200px\"", "renderLabel", "=", "{", "(", "{", "value", "}", ")", "=>", "<", "Text", "fontSize", "=", "\"48px\"", ">", "{", "value", "}", "%", "<", "/Text>}/", ">", "<", "/Group>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1179
[ "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "Radio", ",", "RadioGroup", ",", "Group", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Radio'", "}", ";", "const", "dataSource", "=", "[", "{", "label", ":", "'盒马鲜生'", ",", "value", ":", "'hmxs'", "}", ",", "{", "label", ":", "'盒马 Mini'", ",", "value", ":", "'mini'", "}", ",", "{", "label", ":", "'盒马X会员店'", ",", "value", ":", "'hmx'", "}", ",", "{", "label", ":", "'盒马菜场'", ",", "value", ":", "'hmcc'", ",", "disabled", ":", "true", "}", ",", "]", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Radio", ">", "盒马先生", "<", "/Radio>", "<", "Radio", "checked", ">", "盒马先生", "<", "/Radio>", "<", "Radio", "disabled", ">", "盒马迷你", "<", "/Radio>", "<", "Radio", "checked", "disabled", ">", "盒马会员店", "<", "/Radio>", "<", "/Group>);", "}", "export", "function", "GroupDemo", "(", ")", "{", "return", "(", "<", "Group", "spacingY", "=", "{", "8", "}", ">", "<", "h3", ">", "无默认值", "<", "/h3>", "<", "RadioGroup", "dataSource", "=", "{", "dataSource", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "h3", ">", "有默认值", "<", "/h3>", "<", "RadioGroup", "defaultValue", "=", "\"mini\"", "dataSource", "=", "{", "dataSource", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}", "export", "function", "Direction", "(", ")", "{", "return", "<", "RadioGroup", "direction", "=", "\"column\"", "dataSource", "=", "{", "dataSource", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", "export", "function", "Controlled", "(", ")", "{", "const", "[", "value", ",", "setValue", "]", "=", "useState", "<", "string", ">", "(", "'mini'", ")", ";", "return", "<", "RadioGroup", "value", "=", "{", "value", "}", "dataSource", "=", "{", "dataSource", "}", "onChange", "=", "{", "setValue", "}", "/", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1180
[ "import", "{", "Range", "}", "from", "'@rexd/core'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Range'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "defaultValue", "=", "{", "20", "}", "onChange", "=", "{", "(", "nextValue", ")", "=>", "{", "console", ".", "log", "(", "'range onChange:'", ",", "nextValue", ")", ";", "}", "}", "/>);", "}", "export", "function", "WithMarks", "(", ")", "{", "return", "(", "<", "div", ">", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "defaultValue", "=", "{", "50", "}", "marks", "=", "{", "{", "0", ":", "'0°C'", ",", "26", ":", "'26'", ",", "37", ":", "'37°C'", ",", "100", ":", "'100%'", ",", "}", "}", "onChange", "=", "{", "(", "nextValue", ")", "=>", "{", "console", ".", "log", "(", "'range onChange:'", ",", "nextValue", ")", ";", "}", "}", "/>", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "defaultValue", "=", "{", "37", "}", "marks", "=", "{", "[", "0", ",", "26", ",", "37", ",", "100", "]", "}", "onChange", "=", "{", "(", "nextValue", ")", "=>", "{", "console", ".", "log", "(", "'range onChange:'", ",", "nextValue", ")", ";", "}", "}", "/>", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "defaultValue", "=", "{", "20", "}", "marks", "=", "{", "20", "}", "onChange", "=", "{", "(", "nextValue", ")", "=>", "{", "console", ".", "log", "(", "'range onChange:'", ",", "nextValue", ")", ";", "}", "}", "/>", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "defaultValue", "=", "{", "20", "}", "marks", "=", "{", "20", "}", "marksPosition", "=", "\"below\"", "disabled", "onChange", "=", "{", "(", "nextValue", ")", "=>", "{", "console", ".", "log", "(", "'range onChange:'", ",", "nextValue", ")", ";", "}", "}", "/>", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "defaultValue", "=", "{", "20", "}", "marks", "=", "{", "20", "}", "marksPosition", "=", "\"below\"", "onChange", "=", "{", "(", "nextValue", ")", "=>", "{", "console", ".", "log", "(", "'range onChange:'", ",", "nextValue", ")", ";", "}", "}", "/>", "<", "/div>);", "}", "export", "function", "MaxMin", "(", ")", "{", "return", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "max", "=", "{", "1e5", "}", "min", "=", "{", "1e-5", "}", "defaultValue", "=", "{", "30", "}", "/", ">", ";", "}", "export", "function", "CustomTip", "(", ")", "{", "const", "[", "per", ",", "setPer", "]", "=", "useState", "(", "0", ")", ";", "return", "(", "<", "Range", "value", "=", "{", "per", "}", "onChange", "=", "{", "setPer", "}", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "tipRender", "=", "{", "(", "percent", ")", "=>", "<", "div", "style", "=", "{", "{", "width", ":", "80", "}", "}", ">", "人数上限", ":", "{", "percent", "}", "人", "<", "/div>} max={1e5} min={0} defaultValue={30}/", ">", ")", ";", "}", "export", "function", "Disabled", "(", ")", "{", "return", "<", "Range", "style", "=", "{", "{", "margin", ":", "40", "}", "}", "value", "=", "{", "30", "}", "disabled", "/", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1181
[ "import", "React", "from", "'react'", ";", "import", "{", "Search", ",", "Group", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Search'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Search", "onChange", "=", "{", "(", "val", ")", "=>", "console", ".", "log", "(", "'change:'", ",", "val", ")", "}", "onSubmit", "=", "{", "(", "val", ")", "=>", "console", ".", "log", "(", "'submit:'", ",", "val", ")", "}", "/>", "<", "Search", "buttonText", "=", "\"搜索订单\"", "onChange", "=", "{", "(", "val", ")", "=>", "console", ".", "log", "(", "'change:'", ",", "val", ")", "}", "onSubmit", "=", "{", "(", "val", ")", "=>", "console", ".", "log", "(", "'submit:'", ",", "val", ")", "}", "/>", "<", "/Group>);", "}", "export", "function", "Simple", "(", ")", "{", "return", "(", "<", "Search", "shape", "=", "\"simple\"", "onChange", "=", "{", "(", "val", ")", "=>", "console", ".", "log", "(", "'change:'", ",", "val", ")", "}", "onSubmit", "=", "{", "(", "val", ")", "=>", "console", ".", "log", "(", "'submit:'", ",", "val", ")", "}", "/>);", "}", "export", "function", "HasClear", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Search", "hasClear", "defaultValue", "=", "\"hello world\"", "onChange", "=", "{", "console", ".", "log", "}", "onSubmit", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Search", "shape", "=", "\"simple\"", "hasClear", "defaultValue", "=", "\"hello world\"", "onChange", "=", "{", "console", ".", "log", "}", "onSubmit", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1182
[ "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "Steps", ",", "Box", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Steps'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "{", "const", "[", "step", ",", "setStep", "]", "=", "useState", "<", "number", ">", "(", "2", ")", ";", "const", "steps", "=", "[", "{", "title", ":", "'基本信息'", ",", "children", ":", "(", "<", "Box", ">", "首先做这件事首先做这件事首先做这件事首先做这件事首先做这件事首先做这件事", "首先做这件事", "首先做这件事", "首先做这件事", "<", "/", "Box", ">", ")", ",", "}", ",", "{", "title", ":", "'店仓范围'", ",", "children", ":", "<", "Box", ">", "其次做这件事其次做这件事其次做这件事其次做这件事其次做这件事其次做这件事", "其次做这件事", "<", "/Box>,", "}", ",", "{", "title", ":", "'合同条款'", ",", "children", ":", "<", "Box", ">", "然后做这件事", "<", "/Box> },", "{", "title", ":", "'附加信息'", ",", "children", ":", "<", "Box", ">", "最后做这件事", "<", "/Box> },", "]", ";", "return", "<", "Steps", "step", "=", "{", "step", "}", "steps", "=", "{", "steps", "}", "onChange", "=", "{", "(", "val", ")", "=>", "setStep", "(", "val", ")", "}", "/>;", "}", ";", "export", "const", "Status", "=", "(", ")", "=>", "{", "const", "steps", "=", "[", "{", "title", ":", "'基本信息'", ",", "status", ":", "'complete'", "}", ",", "{", "title", ":", "'店仓范围'", ",", "status", ":", "'complete'", "}", ",", "{", "title", ":", "'合同条款'", ",", "status", ":", "'error'", "}", ",", "{", "title", ":", "'合同条款'", "}", ",", "{", "title", ":", "'附加信息'", "}", ",", "]", ";", "return", "<", "Steps", "steps", "=", "{", "steps", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";", "/**\n * 垂直方向步骤条\n */", "export", "const", "Column", "=", "(", ")", "=>", "{", "const", "[", "step", ",", "setStep", "]", "=", "useState", "<", "number", ">", "(", "2", ")", ";", "const", "steps", "=", "[", "{", "title", ":", "'基本信息'", ",", "children", ":", "(", "<", "Box", ">", "首先做这件事首先做这件事首先做这件事首先做这件事首先做这件事首先做这件事", "首先做这件事", "首先做这件事", "首先做这件事", "<", "/", "Box", ">", ")", ",", "}", ",", "{", "title", ":", "'店仓范围'", ",", "children", ":", "<", "Box", ">", "其次做这件事其次做这件事其次做这件事其次做这件事其次做这件事其次做这件事", "其次做这件事", "<", "/Box>,", "}", ",", "{", "title", ":", "'合同条款'", ",", "children", ":", "<", "Box", ">", "然后做这件事", "<", "/Box> },", "{", "title", ":", "'附加信息'", ",", "children", ":", "<", "Box", ">", "最后做这件事", "<", "/Box> },", "]", ";", "return", "<", "Steps", "direction", "=", "\"column\"", "step", "=", "{", "step", "}", "steps", "=", "{", "steps", "}", "onChange", "=", "{", "(", "val", ")", "=>", "setStep", "(", "val", ")", "}", "/>;", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1183
[ "import", "React", "from", "'react'", ";", "import", "{", "Switch", ",", "Group", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Switch'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Switch", "defaultChecked", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Switch", "defaultChecked", "=", "{", "false", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Switch", "disabled", "/", ">", "<", "Switch", "checked", "disabled", "/", ">", "<", "/Group>);", "}", "export", "function", "HasLabel", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Switch", "hasLabel", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Switch", "hasLabel", "defaultChecked", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}", "export", "function", "Size", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Switch", "size", "=", "\"small\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Switch", "size", "=", "\"small\"", "defaultChecked", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Switch", "size", "=", "\"medium\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Switch", "size", "=", "\"medium\"", "defaultChecked", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1184
[ "import", "{", "Box", ",", "Tab", ",", "Tabs", "}", "from", "'@rexd/core'", ";", "import", "React", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Tabs'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "{", "return", "(", "<", "Tabs", "onChange", "=", "{", "console", ".", "log", "}", ">", "<", "Tab", "value", "=", "\"t1\"", "title", "=", "\"例子\"", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "例子内容", "<", "/Box>", "<", "/Tab>", "<", "Tab", "value", "=", "\"t2\"", "title", "=", "\"代码片段\"", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "代码片段内容", "<", "/Box>", "<", "/Tab>", "<", "Tab", "value", "=", "\"t3\"", "title", "=", "\"组件属性\"", "disabled", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "组件属性内容", "<", "/Box>", "<", "/Tab>", "<", "Tab", "value", "=", "\"t4\"", "title", "=", "\"设计文档\"", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "设计文档内容", "<", "/Box>", "<", "/Tab>", "<", "/Tabs>);", "}", ";", "/**\n * 对于较小视图,可以实现等宽满屏效果\n */", "export", "const", "Fill", "=", "(", ")", "=>", "{", "return", "(", "<", "Tabs", "fill", "onChange", "=", "{", "console", ".", "log", "}", ">", "<", "Tab", "value", "=", "\"t1\"", "title", "=", "\"例子\"", "/", ">", "<", "Tab", "value", "=", "\"t2\"", "title", "=", "\"代码片段\"", "/", ">", "<", "Tab", "value", "=", "\"t3\"", "title", "=", "\"组件属性\"", "/", ">", "<", "Tab", "value", "=", "\"t4\"", "title", "=", "\"设计文档\"", "/", ">", "<", "/Tabs>);", "}", ";", "/**\n * 垂直 Tabs\n */", "export", "const", "Vertical", "=", "(", ")", "=>", "{", "return", "(", "<", "Tabs", "direction", "=", "\"column\"", "onChange", "=", "{", "console", ".", "log", "}", ">", "<", "Tab", "value", "=", "\"t1\"", "title", "=", "\"例子\"", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "例子内容", "<", "/Box>", "<", "/Tab>", "<", "Tab", "value", "=", "\"t2\"", "title", "=", "\"代码片段\"", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "代码片段内容", "<", "/Box>", "<", "/Tab>", "<", "Tab", "value", "=", "\"t3\"", "title", "=", "\"组件属性\"", "disabled", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "组件属性内容", "<", "/Box>", "<", "/Tab>", "<", "Tab", "value", "=", "\"t4\"", "title", "=", "\"设计文档\"", ">", "<", "Box", "fontSize", "=", "\"body\"", "p", "=", "\"m\"", ">", "设计文档内容", "<", "/Box>", "<", "/Tab>", "<", "/Tabs>);", "}", ";", "/**\n * 超出滚动的例子\n */", "export", "const", "Scrollable", "=", "(", ")", "=>", "{", "return", "(", "<", "Tabs", "onChange", "=", "{", "console", ".", "log", "}", ">", "<", "Tab", "value", "=", "\"t1\"", "title", "=", "\"选项卡 1\"", "/", ">", "<", "Tab", "value", "=", "\"t2\"", "title", "=", "\"选项卡 2\"", "/", ">", "<", "Tab", "value", "=", "\"t3\"", "title", "=", "\"选项卡 3\"", "/", ">", "<", "Tab", "value", "=", "\"t4\"", "title", "=", "\"选项卡 4\"", "/", ">", "<", "Tab", "value", "=", "\"t5\"", "title", "=", "\"选项卡 5\"", "/", ">", "<", "Tab", "value", "=", "\"t6\"", "title", "=", "\"选项卡 6\"", "/", ">", "<", "Tab", "value", "=", "\"t7\"", "title", "=", "\"选项卡 7\"", "/", ">", "<", "Tab", "value", "=", "\"t8\"", "title", "=", "\"选项卡 8\"", "/", ">", "<", "/Tabs>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1185
[ "import", "React", "from", "'react'", ";", "import", "{", "TagFilter", ",", "Group", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'TagFilter'", "}", ";", "const", "list", "=", "[", "{", "value", ":", "'front-end'", ",", "label", ":", "'前端开发'", "}", ",", "{", "value", ":", "'visual-design'", ",", "label", ":", "'视觉设计'", "}", ",", "{", "value", ":", "'ux'", ",", "label", ":", "'交互设计'", "}", ",", "{", "value", ":", "'pm'", ",", "label", ":", "'产品经理'", "}", ",", "{", "value", ":", "'back-end'", ",", "label", ":", "'后端开发'", "}", ",", "{", "value", ":", "'data'", ",", "label", ":", "'数据分析'", "}", ",", "{", "value", ":", "'po'", ",", "label", ":", "'产品运营'", "}", ",", "{", "value", ":", "'marketing'", ",", "label", ":", "'市场营销'", "}", ",", "]", ";", "export", "const", "Basic", "=", "(", ")", "=>", "{", "return", "<", "TagFilter", "dataSource", "=", "{", "list", "}", "defaultValue", "=", "{", "[", "'front-end'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";", "export", "const", "Multiple", "=", "(", ")", "=>", "{", "return", "<", "TagFilter", "dataSource", "=", "{", "list", "}", "selectMode", "=", "\"multiple\"", "defaultValue", "=", "{", "[", "'front-end'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}", ";", "export", "const", "Size", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "TagFilter", "size", "=", "\"small\"", "selectMode", "=", "\"multiple\"", "dataSource", "=", "{", "list", "}", "defaultValue", "=", "{", "[", "'front-end'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "layoutProps", "=", "{", "{", "spacingY", ":", "'m'", "}", "}", "/>", "<", "br", "/", ">", "<", "TagFilter", "size", "=", "\"medium\"", "selectMode", "=", "\"multiple\"", "dataSource", "=", "{", "list", "}", "defaultValue", "=", "{", "[", "'front-end'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "layoutProps", "=", "{", "{", "spacingY", ":", "'m'", "}", "}", "/>", "<", "br", "/", ">", "<", "TagFilter", "size", "=", "\"large\"", "selectMode", "=", "\"multiple\"", "dataSource", "=", "{", "list", "}", "defaultValue", "=", "{", "[", "'front-end'", "]", "}", "onChange", "=", "{", "console", ".", "log", "}", "layoutProps", "=", "{", "{", "spacingY", ":", "'m'", "}", "}", "/>", "<", "/Group>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1186
[ "import", "{", "TreeItem", "}", "from", "'@rexd/core'", ";", "import", "{", "makeRecursiveMapper", "}", "from", "'ali-react-table'", ";", "import", "{", "useEffect", ",", "useState", "}", "from", "'react'", ";", "import", "{", "defer", "}", "from", "'rxjs'", ";", "import", "*", "as", "op", "from", "'rxjs/operators'", ";", "export", "interface", "CateTreeItem", "{", "children", ":", "CateTreeItem", "[", "]", ";", "code", ":", "string", ";", "freezeCat", ":", "boolean", ";", "id", ":", "number", ";", "isAutoSpu", ":", "string", ";", "key", ":", "string", ";", "leaf", ":", "boolean", ";", "level", ":", "number", ";", "name", ":", "string", ";", "sellerUnusedCategory", ":", "boolean", ";", "service", ":", "boolean", ";", "}", "const", "cateTree$", "=", "defer", "(", "(", ")", "=>", "fetch", "(", "'https://item.hemaos.com/itemAPI/QueryMerchantCategoryTree.json'", ",", "{", "credentials", ":", "'include'", ",", "}", ")", ")", ".", "pipe", "(", "op", ".", "switchMap", "(", "(", "res", ")", "=>", "res", ".", "json", "(", ")", ")", ",", "op", ".", "map", "(", "(", "result", ")", "=>", "result", ".", "result", "[", "0", "]", ".", "children", "as", "CateTreeItem", "[", "]", ")", ",", "op", ".", "map", "(", "(", "cateTree", ")", "=>", "{", "const", "mapper", "=", "makeRecursiveMapper", "<", "any", ">", "(", "(", "cateItem", ")", "=>", "{", "const", "treeItem", "=", "{", "key", ":", "cateItem", ".", "key", ",", "label", ":", "cateItem", ".", "name", ",", "children", ":", "cateItem", ".", "children", ",", "}", ";", "return", "treeItem", ";", "}", ")", ";", "const", "result", "=", "mapper", "(", "cateTree", ")", ";", "return", "result", ";", "}", ")", ",", "op", ".", "shareReplay", "(", "1", ")", ")", ";", "export", "function", "useCateTree", "(", ")", "{", "const", "[", "dataSource", ",", "setDataSource", "]", "=", "useState", "<", "TreeItem", "[", "]", ">", "(", "[", "]", ")", ";", "useEffect", "(", "(", ")", "=>", "{", "cateTree$", ".", "subscribe", "(", "setDataSource", ")", ";", "}", ",", "[", "]", ")", ";", "return", "dataSource", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 18, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 16, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, 787, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1187
[ "import", "React", "from", "'react'", ";", "import", "{", "Textarea", ",", "Flex", ",", "Group", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Textarea'", "}", ";", "export", "function", "Basic", "(", ")", "{", "const", "text", "=", "'盒马是阿里巴巴集团旗下,以数据和技术驱动的新零售平台。盒马以鲜活水产和新鲜蔬果为主打,开创了“不卖隔夜菜”的“盒马日日鲜”等系列心智商品,为您提供最快30分钟极速送达的智能购物体验。盒马希望为消费者打造社区化的一站式新零售体验中心,期待用科技和人情味带给盒区居民“鲜美生活”,让远亲更近,让近邻更亲!'", ";", "return", "(", "<", "Flex", "direction", "=", "\"column\"", "spacing", "=", "\"m\"", ">", "<", "Textarea", "onChange", "=", "{", "console", ".", "log", "}", "/>", "<", "Textarea", "defaultValue", "=", "{", "text", "}", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "Textarea", "defaultValue", "=", "{", "text", "}", "onChange", "=", "{", "console", ".", "log", "}", "readOnly", "/", ">", "<", "Textarea", "defaultValue", "=", "{", "text", "}", "onChange", "=", "{", "console", ".", "log", "}", "disabled", "/", ">", "<", "/Flex>);", "}", "export", "function", "Rows", "(", ")", "{", "return", "(", "<", "Group", ">", "<", "Textarea", "rows", "=", "{", "2", "}", "/", ">", "<", "Textarea", "rows", "=", "{", "5", "}", "/>", "<", "/Group>);", "}", "export", "function", "Controlled", "(", ")", "{", "return", "<", "Textarea", "value", "=", "\"hello\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1188
[ "import", "React", "from", "'react'", ";", "import", "{", "TimePicker", ",", "Group", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'TimePicker'", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "TimePicker", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "TimePicker", "defaultValue", "=", "\"12:30:00\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "export", "const", "Simple", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "TimePicker", "mode", "=", "\"simple\"", "onChange", "=", "{", "console", ".", "log", "}", "/", ">", "<", "/Group>);", "export", "const", "CustomTimeItems", "=", "(", ")", "=>", "{", "const", "items", "=", "[", "]", ";", "let", "i", "=", "9", ";", "while", "(", "i", "<", "22", ")", "{", "const", "key", "=", "i", "<", "10", "?", "`0${", "i", "}`", ":", "i", ";", "items", ".", "push", "(", "{", "label", ":", "`${", "key", "}:00`", ",", "value", ":", "`${", "key", "}:00`", "}", ")", ";", "i", "++", ";", "}", "return", "(", "<", "Group", ">", "<", "TimePicker", "getHourItems", "=", "{", "(", ")", "=>", "[", "8", ",", "9", ",", "10", ",", "11", ",", "12", "]", ".", "map", "(", "(", "item", ")", "=>", "(", "{", "label", ":", "item", ",", "value", ":", "item", "}", ")", ")", "}", "getMinuteItems", "=", "{", "(", ")", "=>", "[", "0", ",", "15", ",", "30", ",", "45", "]", ".", "map", "(", "(", "item", ")", "=>", "(", "{", "label", ":", "item", ",", "value", ":", "item", "}", ")", ")", "}", "getSecondItems", "=", "{", "(", ")", "=>", "[", "0", ",", "59", "]", ".", "map", "(", "(", "item", ")", "=>", "(", "{", "label", ":", "item", ",", "value", ":", "item", "}", ")", ")", "}", "/>", "<", "TimePicker", "mode", "=", "\"simple\"", "getQuickItems", "=", "{", "(", ")", "=>", "items", "}", "/>", "<", "/Group>);", "}", ";", "export", "const", "CustomTimePanels", "=", "(", ")", "=>", "(", "<", "Group", ">", "<", "TimePicker", "hasSeconds", "=", "{", "false", "}", "format", "=", "\"HH:mm\"", "/", ">", "<", "/Group>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1189
[ "import", "React", "from", "'react'", ";", "import", "{", "Timeline", ",", "TimelineItem", "}", "from", "'@rexd/core'", ";", "export", "default", "{", "title", ":", "'Timeline'", ",", "component", ":", "Timeline", ",", "subcomponents", ":", "{", "TimelineItem", "}", "}", ";", "export", "const", "Basic", "=", "(", ")", "=>", "{", "return", "(", "<", "Timeline", ">", "<", "TimelineItem", "title", "=", "\"下单\"", "label", "=", "\"2018-05-10 18:00:00\"", "status", "=", "\"success\"", ">", "订单已受理", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"打包\"", "label", "=", "\"2018-05-10 18:10:00\"", "status", "=", "\"success\"", ">", "订单已打包完成", ",", "等待骑手取货", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"配送\"", "label", "=", "\"2018-05-10 18:15:00\"", "status", "=", "\"process\"", ">", "骑手正在火速配送中", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"送件失败\"", "label", "=", "\"2018-05-10 18:25:00\"", "status", "=", "\"error\"", ">", "失败原因", ":", "地址错误", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"客户退单\"", "label", "=", "\"2018-05-10 18:30:00\"", ">", "客户退单", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"完成\"", "label", "=", "\"2018-05-10 18:30:00\"", ">", "订单完成", "<", "/TimelineItem>", "<", "/Timeline>);", "}", ";", "export", "const", "LabelPosition", "=", "(", ")", "=>", "{", "return", "(", "<", "Timeline", "labelPosition", "=", "\"right\"", ">", "<", "TimelineItem", "title", "=", "\"下单\"", "label", "=", "\"2018-05-10 18:00:00\"", "status", "=", "\"success\"", ">", "订单已受理", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"打包\"", "label", "=", "\"2018-05-10 18:10:00\"", "status", "=", "\"success\"", ">", "订单已打包完成", ",", "等待骑手取货", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"配送\"", "label", "=", "\"2018-05-10 18:15:00\"", "status", "=", "\"process\"", ">", "骑手正在火速配送中", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"送件失败\"", "label", "=", "\"2018-05-10 18:25:00\"", "status", "=", "\"error\"", ">", "失败原因", ":", "地址错误", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"客户退单\"", "label", "=", "\"2018-05-10 18:30:00\"", ">", "客户退单", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"完成\"", "label", "=", "\"2018-05-10 18:30:00\"", ">", "订单完成", "<", "/TimelineItem>", "<", "/Timeline>);", "}", ";", "export", "const", "Hoz", "=", "(", ")", "=>", "(", "<", "Timeline", "direction", "=", "\"row\"", ">", "<", "TimelineItem", "title", "=", "\"下单\"", "label", "=", "\"2018-05-10 18:00:00\"", "status", "=", "\"success\"", ">", "订单已受理", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"打包\"", "label", "=", "\"2018-05-10 18:10:00\"", "status", "=", "\"success\"", ">", "订单已打包完成", ",", "等待骑手取货", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"配送\"", "label", "=", "\"2018-05-10 18:15:00\"", "status", "=", "\"process\"", ">", "骑手正在火速配送中", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"送件失败\"", "label", "=", "\"2018-05-10 18:25:00\"", "status", "=", "\"error\"", ">", "失败原因", ":", "地址错误", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"客户退单\"", "label", "=", "\"2018-05-10 18:30:00\"", ">", "客户退单", "<", "/TimelineItem>", "<", "TimelineItem", "title", "=", "\"完成\"", "label", "=", "\"2018-05-10 18:30:00\"", ">", "订单完成", "<", "/TimelineItem>", "<", "/Timeline>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1190
[ "import", "{", "ActionListItem", ",", "LegacyFooterToolbar", ",", "Search", ",", "Toolbar", "}", "from", "'@rexd/core'", ";", "import", "React", "from", "'react'", ";", "export", "default", "{", "title", ":", "'Toolbar'", "}", ";", "export", "function", "Basic", "(", ")", "{", "return", "(", "<", "Toolbar", "leftActions", "=", "{", "[", "{", "key", ":", "'search'", ",", "render", ":", "(", ")", "=>", "<", "Search", "shape", "=", "\"simple\"", "/> },", "{", "key", ":", "'print'", ",", "label", ":", "'打印'", "}", ",", "{", "key", ":", "'export'", ",", "label", ":", "'导出'", "}", ",", "{", "key", ":", "'sort'", ",", "label", ":", "'排序'", "}", ",", "{", "key", ":", "'reset'", ",", "label", ":", "'重置'", "}", ",", "{", "key", ":", "'refresh'", ",", "label", ":", "'刷新'", "}", ",", "]", "}", "onActionClick", "=", "{", "(", "...", "args", ")", "=>", "{", "console", ".", "log", "(", "'onActionClick'", ",", "...", "args", ")", ";", "}", "}", "/>);", "}", "export", "function", "Complex", "(", ")", "{", "const", "mainActions", "=", "[", "{", "key", ":", "'import'", ",", "type", ":", "'primary'", "}", ",", "{", "key", ":", "'other'", ",", "label", ":", "'其他操作'", ",", "children", ":", "[", "{", "key", ":", "'menu01'", ",", "label", ":", "'操作项 1'", "}", ",", "{", "key", ":", "'menu02'", ",", "label", ":", "'操作项 2'", "}", ",", "]", ",", "}", ",", "]", ";", "const", "secondActions", "=", "[", "{", "key", ":", "'print'", "}", ",", "{", "key", ":", "'export'", ",", "props", ":", "{", "shape", ":", "'text'", "}", ",", "children", ":", "[", "{", "key", ":", "'group'", ",", "label", ":", "'导出 xlsx'", ",", "children", ":", "[", "{", "key", ":", "'xlsx_all'", ",", "label", ":", "'导出全部自动'", "}", ",", "{", "key", ":", "'xlsx_item'", ",", "label", ":", "'导出商品字段'", "}", ",", "]", ",", "}", ",", "]", ",", "}", ",", "{", "key", ":", "'refresh'", "}", ",", "]", ";", "return", "(", "<", "Toolbar", "leftActions", "=", "{", "mainActions", "}", "rightActions", "=", "{", "secondActions", "}", "onActionClick", "=", "{", "(", "key", ")", "=>", "console", ".", "log", "(", "'clicked:'", ",", "key", ")", "}", "/>);", "}", "export", "function", "Legacy__Footer", "(", ")", "{", "return", "(", "<", "LegacyFooterToolbar", "actions", "=", "{", "[", "{", "key", ":", "'approve'", ",", "label", ":", "'同意'", ",", "shape", ":", "'solid'", ",", "type", ":", "'primary'", "}", ",", "{", "key", ":", "'reject'", ",", "label", ":", "'拒绝'", ",", "shape", ":", "'warning'", ",", "type", ":", "'normal'", "}", ",", "{", "key", ":", "'other1'", ",", "label", ":", "'动作1'", ",", "shape", ":", "'solid'", ",", "type", ":", "'normal'", "}", ",", "{", "key", ":", "'other2'", ",", "label", ":", "'动作2'", ",", "shape", ":", "'solid'", ",", "type", ":", "'normal'", "}", ",", "]", "}", "/", ">", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1191
[ "import", "{", "set", ",", "get", ",", "cloneDeep", "}", "from", "'lodash-es'", ";", "export", "default", "class", "TokenStore", "{", "namespace", ":", "string", ";", "model", ":", "any", ";", "constructor", "(", "namespace", ",", "model", ")", "{", "const", "exist", "=", "window", ".", "localStorage", ".", "getItem", "(", "namespace", ")", ";", "this", ".", "namespace", "=", "namespace", ";", "this", ".", "model", "=", "exist", "?", "JSON", ".", "parse", "(", "exist", ")", ":", "cloneDeep", "(", "model", ")", ";", "}", "clear", "(", ")", "{", "window", ".", "localStorage", ".", "removeItem", "(", "this", ".", "namespace", ")", ";", "}", "sync", "(", ")", "{", "window", ".", "localStorage", ".", "setItem", "(", "this", ".", "namespace", ",", "JSON", ".", "stringify", "(", "this", ".", "model", ")", ")", ";", "}", "set", "(", "path", ",", "value", ")", "{", "set", "(", "this", ".", "model", ",", "path", ",", "value", ")", ";", "}", "get", "(", "path", ")", "{", "get", "(", "this", ".", "model", ",", "path", ")", ";", "}", "getModel", "(", ")", "{", "return", "this", ".", "model", ";", "}", "toString", "(", ")", "{", "return", "JSON", ".", "stringify", "(", "this", ".", "model", ")", ";", "}", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1192
[ "import", "{", "createContext", ",", "useContext", "}", "from", "'react'", ";", "export", "const", "StoreContext", "=", "createContext", "<", "{", "store", ":", "any", ";", "update", ":", "(", "path", ":", "string", ",", "value", ":", "string", ")", "=>", "void", ";", "}", ">", "(", "{", "store", ":", "{", "}", ",", "update", ":", "(", ")", "=>", "{", "}", ",", "}", ")", ";", "export", "const", "StoreProvider", "=", "StoreContext", ".", "Provider", ";", "export", "function", "useStore", "(", ")", "{", "return", "useContext", "(", "StoreContext", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, 31, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 379, null, null, null, null, null, null, null, 6, null, null, null, null, null, null, null, null, null, null ]
1193
[ "import", "{", "Box", ",", "Button", ",", "ButtonProps", ",", "Group", ",", "GroupProps", ",", "Input", ",", "NumberInput", ",", "Popup", ",", "Text", ",", "Textarea", "}", "from", "'@rexd/core'", ";", "import", "{", "useSelectableList", ",", "UseSelectableListProps", "}", "from", "'@rexd/core/src/hooks'", ";", "import", "{", "ListNode", ",", "StringOrNumber", "}", "from", "'@rexd/core/src/types'", ";", "import", "{", "createContext", "}", "from", "'@rexd/core/src/utils/react-helpers'", ";", "import", "cx", "from", "'classnames'", ";", "import", "React", ",", "{", "useState", "}", "from", "'react'", ";", "import", "{", "BlockPicker", "}", "from", "'react-color'", ";", "import", "styled", "from", "'styled-components'", ";", "import", "{", "useStore", "}", "from", "'./store-context'", ";", "export", "interface", "HeaderProps", "{", "title", ":", "string", ";", "filename", "?", ":", "string", ";", "jsonData", "?", ":", "string", ";", "onSave", "?", ":", "(", ")", "=>", "void", ";", "onReset", "?", ":", "(", ")", "=>", "void", ";", "}", "export", "function", "Header", "(", "props", ")", "{", "const", "{", "title", ",", "onSave", ",", "onReset", ",", "filename", ",", "jsonData", "=", "''", "}", "=", "props", ";", "const", "blob", "=", "new", "Blob", "(", "[", "jsonData", "]", ",", "{", "type", ":", "'text/plain'", "}", ")", ";", "return", "(", "<", "Box", "display", "=", "\"flex\"", "justifyContent", "=", "\"space-between\"", "alignItems", "=", "\"center\"", "mb", "=", "\"l\"", "p", "=", "\"m\"", "bg", "=", "\"fill.layer2\"", "borderLeft", "=", "\"4px solid\"", "borderLeftColor", "=", "\"brand.normal\"", "color", "=", "\"text.body\"", ">", "<", "Text", ">", "{", "title", "}", "<", "/Text>", "<", "Group", ">", "<", "Button", "type", "=", "\"primary\"", "onClick", "=", "{", "onSave", "}", ">", "保存", "<", "/Button>", "{", "}", "<", "Button", "as", "=", "\"a\"", "target", "=", "\"blank\"", "href", "=", "{", "window", ".", "URL", ".", "createObjectURL", "(", "blob", ")", "}", "download", "=", "{", "filename", "}", ">", "导出", "<", "/Button>", "<", "Button", "onClick", "=", "{", "onReset", "}", ">", "重置", "<", "/Button>", "<", "/Group>", "<", "/Box>);", "}", "export", "function", "SectionHeader", "(", "props", ")", "{", "const", "{", "title", "}", "=", "props", ";", "return", "(", "<", "Box", "my", "=", "\"l\"", "p", "=", "\"m\"", "bg", "=", "\"fill.layer2\"", "borderLeft", "=", "\"4px solid\"", "borderLeftColor", "=", "\"brand.normal\"", "color", "=", "\"text.body\"", ">", "{", "title", "}", "<", "/Box>);", "}", "interface", "ConfigBoxProps", "{", "value", "?", ":", "StringOrNumber", ";", "label", "?", ":", "string", ";", "tokenPath", "?", ":", "string", ";", "component", "?", ":", "'textarea'", "|", "'numberInput'", "|", "'input'", ";", "parseValue", "?", ":", "(", "value", ":", "any", ")", "=>", "any", ";", "getValue", "?", ":", "(", "value", ":", "any", ")", "=>", "any", ";", "renderContent", "?", ":", "(", "props", ":", "any", ")", "=>", "any", ";", "renderLabel", "?", ":", "(", "props", ":", "any", ")", "=>", "any", ";", "style", "?", ":", "React", ".", "CSSProperties", ";", "}", "const", "defaultGetValue", "=", "(", "val", ")", "=>", "val", ";", "const", "defaultParseValue", "=", "(", "val", ")", "=>", "val", ";", "export", "function", "ConfigBox", "(", "props", ")", "{", "const", "{", "tokenPath", ",", "value", ",", "parseValue", "=", "defaultParseValue", ",", "getValue", "=", "defaultGetValue", ",", "renderContent", ",", "renderLabel", "=", "(", "props", ")", "=>", "(", "<", "Text", "as", "=", "\"code\"", "fontSize", "=", "\"title1\"", ">", "{", "props", ".", "tokenPath", "}", "<", "/Text>), component = 'numberInput', ...others } = props;", "const", "[", "val", ",", "setVal", "]", "=", "useState", "(", "(", ")", "=>", "parseValue", "(", "value", ")", ")", ";", "const", "ctx", "=", "useStore", "(", ")", ";", "const", "handleChange", "=", "(", "val", ")", "=>", "{", "setVal", "(", "val", ")", ";", "if", "(", "ctx", "&&", "tokenPath", ")", "{", "ctx", ".", "update", "(", "tokenPath", ",", "getValue", "(", "val", ")", ")", ";", "}", "}", ";", "const", "renderProps", "=", "{", "value", ":", "val", ",", "tokenPath", ",", "}", ";", "return", "(", "<", "Box", "display", "=", "\"flex\"", "alignItems", "=", "\"center\"", "mb", "=", "\"m\"", "color", "=", "\"text.body\"", "borderBottom", "=", "\"solid\"", "borderBottomColor", "=", "\"line.border\"", "{", "...", "others", "}", ">", "<", "Box", "flexBasis", "=", "\"280px\"", ">", "{", "renderLabel", "(", "renderProps", ")", "}", "<", "/Box>", "<", "Box", "px", "=", "\"m\"", "py", "=", "\"s\"", ">", "{", "component", "===", "'numberInput'", "&&", "<", "NumberInput", "value", "=", "{", "val", "}", "onChange", "=", "{", "handleChange", "}", "/", ">", "}", "{", "component", "===", "'textarea'", "&&", "<", "Textarea", "rows", "=", "{", "4", "}", "value", "=", "{", "val", "}", "onChange", "=", "{", "handleChange", "}", "style", "=", "{", "{", "width", ":", "260", "}", "}", "/>}", "{", "component", "===", "'input'", "&&", "<", "Input", "value", "=", "{", "val", "}", "onChange", "=", "{", "handleChange", "}", "/", ">", "}", "<", "/Box>", "<", "Box", "p", "=", "\"m\"", ">", "{", "typeof", "renderContent", "===", "'function'", "&&", "renderContent", "(", "renderProps", ")", "}", "<", "/Box>", "<", "/Box>);", "}", "export", "function", "ColorPicker", "(", "props", ")", "{", "const", "{", "value", ",", "onChange", "}", "=", "props", ";", "const", "handleChange", "=", "(", "color", ")", "=>", "{", "if", "(", "typeof", "onChange", "===", "'function'", ")", "{", "onChange", "(", "color", ".", "hex", ")", ";", "}", "}", ";", "return", "(", "<", "Popup", "interactionKind", "=", "\"click\"", "offset", "=", "{", "[", "0", ",", "18", "]", "}", "renderTarget", "=", "{", "(", "pass", ")", "=>", "(", "<", "Box", "{", "...", "pass", "}", "border", "=", "\"solid\"", "borderColor", "=", "\"line.border\"", "color", "=", "\"text.body\"", ">", "{", "value", "}", "<", "/Box>)}>", "<", "BlockPicker", "color", "=", "{", "value", "}", "onChangeComplete", "=", "{", "handleChange", "}", "/", ">", "<", "/Popup>);", "}", "const", "MenuBox", "=", "styled", "(", "Box", ")", "`\n margin: 0;\n padding: 0;\n box-shadow: var(--rex-shadows-medianDown);\n border-radius: var(--rex-radii-m);\n list-style: none;\n background: #fff;\n min-width: 120px;\n max-height: 240px;\n overflow-y: scroll;\n`", ";", "const", "MenuItem", "=", "styled", "(", "Box", ")", "`\n display: flex;\n align-items: center;\n line-height: 1.5;\n padding: var(--rex-space-m);\n font-size: var(--rex-fontSizes-body);\n cursor: pointer;\n user-select: none;\n\n &:hover {\n background-color: #ddd;\n }\n\n &.active {\n font-weight: bold;\n color: var(--rex-colors-brand-active);\n }\n`", ";", "export", "function", "TokenPicker", "(", "props", ")", "{", "const", "{", "value", ",", "dataSource", "=", "[", "]", ",", "onChange", "}", "=", "props", ";", "const", "renderTarget", "=", "(", "pass", ")", "=>", "(", "<", "Box", "{", "...", "pass", "}", "border", "=", "\"solid\"", "borderColor", "=", "\"line.border\"", "color", "=", "\"text.body\"", ">", "{", "value", "}", "<", "/Box>);", "const", "handleSelect", "=", "(", "val", ",", "data", ")", "=>", "{", "if", "(", "val", "!==", "value", "&&", "typeof", "onChange", "===", "'function'", ")", "{", "onChange", "(", "data", ".", "label", ",", "data", ")", ";", "}", "}", ";", "return", "(", "<", "Popup", "interactionKind", "=", "\"click\"", "renderTarget", "=", "{", "renderTarget", "}", ">", "<", "MenuBox", "as", "=", "\"ul\"", ">", "{", "dataSource", ".", "map", "(", "(", "item", ")", "=>", "(", "<", "MenuItem", "as", "=", "\"li\"", "key", "=", "{", "item", ".", "value", "}", "onClick", "=", "{", "(", ")", "=>", "handleSelect", "(", "item", ".", "value", ",", "item", ")", "}", "className", "=", "{", "value", "===", "item", ".", "label", "?", "'active'", ":", "undefined", "}", ">", "<", "Box", "display", "=", "\"inline-block\"", "size", "=", "\"20px\"", "bg", "=", "{", "item", ".", "color", "}", "borderRadius", "=", "\"m\"", "mr", "=", "\"m\"", "/", ">", "{", "item", ".", "label", "}", "<", "/MenuItem>))}", "<", "/MenuBox>", "<", "/Popup>);", "}", "interface", "ToggleButtonGroupContext", "{", "value", "?", ":", "string", "|", "string", "[", "]", ";", "onSelect", "?", ":", "(", "value", ":", "string", ",", "checked", ":", "boolean", ")", "=>", "void", ";", "}", "const", "[", "ToggleButtonGroupProvider", ",", "useToggleButtonGroup", "]", "=", "createContext", "<", "ToggleButtonGroupContext", ">", "(", "{", "name", ":", "'ToggleButtonGroupContext'", ",", "strict", ":", "false", ",", "}", ")", ";", "export", "interface", "ToggleButtonGroupProps", "extends", "Omit", "<", "UseSelectableListProps", "<", "string", "|", "string", "[", "]", ">", ",", "'component'", ">", "{", "/**\n * 数据源\n */", "dataSource", "?", ":", "ListNode", "<", "string", ">", "[", "]", ";", "/**\n * 透传给按钮的属性\n */", "buttonProps", "?", ":", "ButtonProps", ";", "/**\n * 按钮是否贴合在一起\n */", "attached", "?", ":", "GroupProps", "[", "'attached'", "]", ";", "className", "?", ":", "string", ";", "}", "export", "function", "ToggleButtonGroup", "(", "props", ")", "{", "const", "{", "dataSource", "=", "[", "]", ",", "attached", "=", "false", ",", "selectMode", "=", "'single'", ",", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "buttonProps", ",", "className", ",", "...", "rest", "}", "=", "props", ";", "const", "{", "value", ",", "onSelect", "}", "=", "useSelectableList", "(", "{", "component", ":", "'ToggleButtonGroup'", ",", "selectMode", ",", "value", ":", "valueProp", ",", "defaultValue", ",", "onChange", ",", "}", ")", ";", "const", "clazz", "=", "cx", "(", "'rex-toggleButton-group'", ",", "className", ")", ";", "const", "group", "=", "{", "value", ",", "onSelect", ",", "}", ";", "return", "(", "<", "ToggleButtonGroupProvider", "value", "=", "{", "group", "}", ">", "<", "Group", "attached", "=", "{", "attached", "}", "className", "=", "{", "clazz", "}", "{", "...", "rest", "}", ">", "{", "dataSource", ".", "map", "(", "(", "{", "label", ",", "value", ",", "...", "others", "}", ")", "=>", "(", "<", "ToggleButtonItem", "{", "...", "buttonProps", "}", "key", "=", "{", "value", "}", "value", "=", "{", "value", "}", "{", "...", "others", "}", ">", "{", "label", "}", "<", "/ToggleButtonItem>))}", "<", "/Group>", "<", "/ToggleButtonGroupProvider>);", "}", "function", "ToggleButtonItem", "(", "props", ")", "{", "const", "{", "value", ",", "selected", ":", "selectedProp", ",", "children", ",", "...", "rest", "}", "=", "props", ";", "const", "group", "=", "useToggleButtonGroup", "(", ")", ";", "let", "selected", "=", "selectedProp", ";", "if", "(", "group", "?.", "value", "!==", "undefined", "&&", "value", ")", "{", "selected", "=", "(", "group", ".", "value", "||", "[", "]", ")", ".", "includes", "(", "value", ")", ";", "}", "let", "onSelect", ";", "if", "(", "group", ".", "onSelect", "&&", "value", ")", "{", "onSelect", "=", "(", ")", "=>", "{", "group", ".", "onSelect", "(", "value", ",", "!", "selected", ")", ";", "}", ";", "}", "return", "(", "<", "Button", "selected", "=", "{", "selected", "}", "onClick", "=", "{", "onSelect", "}", "{", "...", "rest", "}", ">", "{", "children", "}", "<", "/Button>);", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 2693, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 239, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1194
[ "import", "React", ",", "{", "createContext", ",", "useContext", ",", "useState", "}", "from", "'react'", ";", "import", "{", "AppProvider", ",", "Grid", ",", "GridItem", ",", "Box", ",", "Text", ",", "THEMES", ",", "getThemeValue", "}", "from", "'@rexd/core'", ";", "import", "{", "get", "}", "from", "'lodash-es'", ";", "import", "TokenStore", "from", "'./token-store'", ";", "import", "{", "Header", ",", "SectionHeader", ",", "ColorPicker", ",", "TokenPicker", "}", "from", "'./components'", ";", "export", "default", "{", "title", ":", "'Config/Colors'", "}", ";", "interface", "ColorBoxProps", "{", "getValue", "?", ":", "(", "value", ":", "string", ")", "=>", "string", ";", "tokenValue", "?", ":", "string", ";", "tokenPath", "?", ":", "string", ";", "onChange", "?", ":", "(", "value", ":", "string", ",", "label", ":", "string", ")", "=>", "void", ";", "picker", "?", ":", "any", ";", "pickerProps", "?", ":", "any", ";", "}", "function", "ColorBox", "(", "props", ")", "{", "const", "{", "getValue", ",", "tokenValue", ",", "tokenPath", ",", "onChange", ",", "picker", ":", "Picker", ",", "pickerProps", "}", "=", "props", ";", "const", "[", "value", ",", "setValue", "]", "=", "useState", "(", "tokenValue", ")", ";", "const", "handleChange", "=", "(", "color", ")", "=>", "{", "setValue", "(", "color", ")", ";", "typeof", "onChange", "===", "'function'", "&&", "onChange", "(", "color", ",", "tokenPath", ")", ";", "}", ";", "return", "(", "<", "GridItem", ">", "<", "Box", "bg", "=", "{", "getValue", "(", "value", ")", "}", "height", "=", "\"100px\"", "mb", "=", "\"m\"", "/", ">", "<", "Box", ">", "{", "Picker", "&&", "<", "Picker", "{", "...", "pickerProps", "}", "value", "=", "{", "value", "}", "onChange", "=", "{", "handleChange", "}", "/", ">", "}", "<", "Text", "as", "=", "\"div\"", "fontSize", "=", "\"body\"", ">", "{", "tokenPath", "}", "<", "/Text>", "<", "/Box>", "<", "/GridItem>);", "}", "interface", "ColorListProps", "{", "variant", "?", ":", "string", ";", "picker", "?", ":", "any", ";", "pickerProps", "?", ":", "any", ";", "}", "function", "ColorList", "(", "{", "variant", ",", "picker", "=", "ColorPicker", ",", "pickerProps", "}", ")", "{", "const", "ctx", "=", "useContext", "(", "ThemeContext", ")", ";", "const", "handleChange", "=", "(", "color", ",", "tokenPath", ")", "=>", "{", "if", "(", "ctx", ")", "{", "ctx", ".", "update", "(", "tokenPath", ",", "color", ")", ";", "}", "}", ";", "const", "model", "=", "ctx", "?", "ctx", ".", "store", ".", "getModel", "(", ")", ":", "{", "}", ";", "const", "colors", "=", "ctx", "?", "ctx", ".", "store", ".", "model", ".", "colors", "[", "variant", "]", ":", "[", "]", ";", "return", "(", "<", "Box", "py", "=", "\"m\"", ">", "<", "Text", "as", "=", "\"div\"", ">", "{", "variant", "}", "<", "/Text>", "<", "Grid", "spacing", "=", "\"12px\"", "columns", "=", "{", "8", "}", ">", "{", "Object", ".", "keys", "(", "colors", ")", ".", "map", "(", "(", "colorKey", ")", "=>", "{", "const", "tokenPath", "=", "`colors.${", "variant", "}.${", "colorKey", "}`", ";", "const", "tokenValue", "=", "colors", "[", "colorKey", "]", ";", "return", "(", "<", "ColorBox", "key", "=", "{", "colorKey", "}", "getValue", "=", "{", "(", "value", ")", "=>", "getThemeValue", "(", "value", ",", "model", ")", "}", "tokenValue", "=", "{", "tokenValue", "}", "tokenPath", "=", "{", "tokenPath", "}", "onChange", "=", "{", "handleChange", "}", "picker", "=", "{", "picker", "}", "pickerProps", "=", "{", "pickerProps", "}", "/", ">", ")", ";", "}", ")", "}", "<", "/Grid>", "<", "/Box>);", "}", "const", "ThemeContext", "=", "createContext", "<", "{", "store", ":", "any", ";", "update", ":", "(", "path", ":", "string", ",", "value", ":", "string", ")", "=>", "void", ";", "}", ">", "(", "{", "store", ":", "{", "}", ",", "update", ":", "(", ")", "=>", "{", "}", ",", "}", ")", ";", "const", "generateTokenDataSource", "=", "(", "theme", "=", "{", "}", ",", "cates", "=", "[", "]", ")", "=>", "{", "const", "list", "=", "[", "]", ";", "cates", ".", "forEach", "(", "(", "cate", ")", "=>", "{", "const", "obj", "=", "get", "(", "theme", ",", "cate", ")", ";", "Object", ".", "keys", "(", "obj", ")", ".", "forEach", "(", "(", "key", ")", "=>", "{", "list", ".", "push", "(", "{", "label", ":", "`${", "cate", "}.${", "key", "}`", ",", "value", ":", "obj", "[", "key", "]", ",", "color", ":", "getThemeValue", "(", "obj", "[", "key", "]", ",", "theme", ")", ",", "}", ")", ";", "}", ")", ";", "}", ")", ";", "return", "list", ";", "}", ";", "export", "const", "Light", "=", "(", ")", "=>", "{", "const", "lightStore", "=", "new", "TokenStore", "(", "'lightColors'", ",", "THEMES", ".", "base", ")", ";", "const", "ctx", "=", "{", "store", ":", "lightStore", ",", "update", ":", "(", "path", ",", "value", ")", "=>", "{", "lightStore", ".", "set", "(", "path", ",", "value", ")", ";", "}", ",", "}", ";", "const", "tokenPickerProps", "=", "{", "picker", ":", "TokenPicker", ",", "pickerProps", ":", "{", "dataSource", ":", "generateTokenDataSource", "(", "lightStore", ".", "getModel", "(", ")", ",", "[", "'colors.primary'", ",", "'colors.secondary'", ",", "'colors.emphasis'", ",", "'colors.red'", ",", "'colors.green'", ",", "'colors.yellow'", ",", "]", ")", ",", "}", ",", "}", ";", "return", "(", "<", "ThemeContext", ".", "Provider", "value", "=", "{", "ctx", "}", ">", "<", "AppProvider", "colorMode", "=", "\"light\"", ">", "<", "Box", "bg", "=", "\"white\"", "p", "=", "\"xl\"", ">", "<", "Header", "title", "=", "\"基础色板\"", "onSave", "=", "{", "(", ")", "=>", "lightStore", ".", "sync", "(", ")", "}", "onReset", "=", "{", "(", ")", "=>", "lightStore", ".", "clear", "(", ")", "}", "filename", "=", "\"lightColors.txt\"", "jsonData", "=", "{", "lightStore", ".", "toString", "(", ")", "}", "/", ">", "<", "ColorList", "variant", "=", "\"primary\"", "/", ">", "<", "ColorList", "variant", "=", "\"secondary\"", "/", ">", "<", "ColorList", "variant", "=", "\"gray\"", "/", ">", "<", "ColorList", "variant", "=", "\"red\"", "/", ">", "<", "ColorList", "variant", "=", "\"green\"", "/", ">", "<", "ColorList", "variant", "=", "\"yellow\"", "/", ">", "<", "SectionHeader", "title", "=", "\"语义化色板\"", "/", ">", "<", "ColorList", "variant", "=", "\"brand\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"text\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"link\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"fill\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"line\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"success\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"error\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"warning\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "/Box>", "<", "/AppProvider>", "<", "/ThemeContext.Provider>);", "}", ";", "export", "const", "Dark", "=", "(", ")", "=>", "{", "const", "darkStore", "=", "new", "TokenStore", "(", "'darkColors'", ",", "THEMES", ".", "dark", ".", "desktop", ")", ";", "const", "ctx", "=", "{", "store", ":", "darkStore", ",", "update", ":", "(", "path", ",", "value", ")", "=>", "{", "darkStore", ".", "set", "(", "path", ",", "value", ")", ";", "}", ",", "}", ";", "const", "tokenPickerProps", "=", "{", "picker", ":", "TokenPicker", ",", "pickerProps", ":", "{", "dataSource", ":", "generateTokenDataSource", "(", "darkStore", ".", "getModel", "(", ")", ",", "[", "'colors.primary'", ",", "'colors.secondary'", ",", "'colors.gray'", ",", "'colors.red'", ",", "'colors.green'", ",", "'colors.yellow'", ",", "]", ")", ",", "}", ",", "}", ";", "return", "(", "<", "ThemeContext", ".", "Provider", "value", "=", "{", "ctx", "}", ">", "<", "AppProvider", "colorMode", "=", "\"dark\"", "theme", "=", "{", "THEMES", ".", "dark", ".", "desktop", "}", ">", "<", "Box", "bg", "=", "\"black\"", "p", "=", "\"xl\"", ">", "<", "Header", "title", "=", "\"基础色板\"", "onSave", "=", "{", "(", ")", "=>", "darkStore", ".", "sync", "(", ")", "}", "onReset", "=", "{", "(", ")", "=>", "darkStore", ".", "clear", "(", ")", "}", "filename", "=", "\"darkColors.txt\"", "jsonData", "=", "{", "darkStore", ".", "toString", "(", ")", "}", "/", ">", "<", "ColorList", "variant", "=", "\"primary\"", "/", ">", "<", "ColorList", "variant", "=", "\"secondary\"", "/", ">", "<", "ColorList", "variant", "=", "\"gray\"", "/", ">", "<", "ColorList", "variant", "=", "\"red\"", "/", ">", "<", "ColorList", "variant", "=", "\"green\"", "/", ">", "<", "ColorList", "variant", "=", "\"yellow\"", "/", ">", "<", "SectionHeader", "title", "=", "\"语义化色板\"", "/", ">", "<", "ColorList", "variant", "=", "\"emphasis\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"brand\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"text\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"link\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"fill\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"line\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"success\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"error\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "ColorList", "variant", "=", "\"warning\"", "{", "...", "tokenPickerProps", "}", "/>", "<", "/Box>", "<", "/AppProvider>", "<", "/ThemeContext.Provider>);", "}", ";" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1195
[ "export", "const", "getPxValue", "=", "(", "val", ")", "=>", "{", "if", "(", "typeof", "val", "===", "'number'", ")", "{", "return", "val", ";", "}", "if", "(", "!", "val", ")", "{", "return", "0", ";", "}", "const", "match", "=", "/^(\\d+)px$/", ".", "exec", "(", "val", ")", ";", "if", "(", "match", "&&", "match", ".", "length", ")", "{", "return", "Number", "(", "match", "[", "1", "]", ")", ";", "}", "return", "0", ";", "}", ";", "export", "const", "toPxValue", "=", "(", "val", ")", "=>", "{", "return", "`${", "val", "}px`", ";", "}", ";" ]
[ null, null, 3, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 86, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, 3, null, null, null, null, null, null, null, null, null, null ]
1196
[ "import", "React", "from", "'react'", ";", "import", "{", "Box", ",", "Text", ",", "THEMES", "}", "from", "'@rexd/core'", ";", "import", "ThemeStore", "from", "'./token-store'", ";", "import", "{", "Header", ",", "SectionHeader", ",", "ConfigBox", "}", "from", "'./components'", ";", "import", "{", "getPxValue", ",", "toPxValue", "}", "from", "'./utils'", ";", "import", "{", "StoreProvider", "}", "from", "'./store-context'", ";", "export", "default", "{", "title", ":", "'Config/Frameworkds'", "}", ";", "interface", "FrameworkConfigProps", "{", "store", ":", "ThemeStore", ";", "}", "function", "FrameworkConfig", "(", "{", "store", ":", "tokenStore", "}", ")", "{", "const", "{", "fontSizes", ",", "radii", ",", "shadows", ",", "sizes", ",", "components", "}", "=", "tokenStore", ".", "getModel", "(", ")", ";", "const", "formHeights", "=", "sizes", ".", "formHeights", ";", "const", "ctx", "=", "{", "store", ":", "tokenStore", ",", "update", "(", "path", ",", "val", ")", "{", "tokenStore", ".", "set", "(", "path", ",", "val", ")", ";", "}", ",", "}", ";", "return", "(", "<", "StoreProvider", "value", "=", "{", "ctx", "}", ">", "<", "Box", ">", "<", "Header", "title", "=", "\"fontSizes\"", "onReset", "=", "{", "(", ")", "=>", "tokenStore", ".", "clear", "(", ")", "}", "onSave", "=", "{", "(", ")", "=>", "tokenStore", ".", "sync", "(", ")", "}", "filename", "=", "\"pc.txt\"", "jsonData", "=", "{", "tokenStore", ".", "toString", "(", ")", "}", "/", ">", "{", "Object", ".", "keys", "(", "fontSizes", ")", ".", "map", "(", "(", "item", ")", "=>", "(", "<", "ConfigBox", "key", "=", "{", "item", "}", "tokenPath", "=", "{", "`fontSizes.${", "item", "}`", "}", "value", "=", "{", "fontSizes", "[", "item", "]", "}", "parseValue", "=", "{", "getPxValue", "}", "getValue", "=", "{", "toPxValue", "}", "renderContent", "=", "{", "(", "{", "value", "}", ")", "=>", "<", "Text", "fontSize", "=", "{", "value", "}", ">", "Hello", "World", "你好", ",", "世界", "<", "/Text>}/", ">", ")", ")", "}", "<", "SectionHeader", "title", "=", "\"Radii\"", "/", ">", "<", "Box", ">", "{", "Object", ".", "keys", "(", "radii", ")", ".", "map", "(", "(", "item", ")", "=>", "{", "return", "(", "<", "ConfigBox", "key", "=", "{", "item", "}", "tokenPath", "=", "{", "`radii.${", "item", "}`", "}", "value", "=", "{", "radii", "[", "item", "]", "}", "parseValue", "=", "{", "getPxValue", "}", "getValue", "=", "{", "toPxValue", "}", "renderContent", "=", "{", "(", "{", "value", "}", ")", "=>", "<", "Box", "borderRadius", "=", "{", "value", "}", "size", "=", "\"80px\"", "bg", "=", "\"brand.normal\"", "/", ">", "}", "/", ">", ")", ";", "}", ")", "}", "<", "/Box>", "<", "SectionHeader", "title", "=", "\"Shadows\"", "/", ">", "<", "Box", ">", "{", "Object", ".", "keys", "(", "shadows", ")", ".", "map", "(", "(", "item", ")", "=>", "(", "<", "ConfigBox", "key", "=", "{", "item", "}", "tokenPath", "=", "{", "`shadows.${", "item", "}`", "}", "value", "=", "{", "shadows", "[", "item", "]", "}", "renderContent", "=", "{", "(", "{", "value", "}", ")", "=>", "<", "Box", "boxShadow", "=", "{", "value", "}", "size", "=", "\"80px\"", "bg", "=", "\"#fff\"", "/", ">", "}", "component", "=", "\"textarea\"", "/", ">", ")", ")", "}", "<", "/Box>", "<", "SectionHeader", "title", "=", "\"Form Item Heights\"", "/", ">", "<", "Box", ">", "{", "Object", ".", "keys", "(", "formHeights", ")", ".", "map", "(", "(", "item", ")", "=>", "(", "<", "ConfigBox", "key", "=", "{", "item", "}", "tokenPath", "=", "{", "`sizes.formHeights.${", "item", "}`", "}", "value", "=", "{", "formHeights", "[", "item", "]", "}", "parseValue", "=", "{", "getPxValue", "}", "getValue", "=", "{", "toPxValue", "}", "renderContent", "=", "{", "(", "{", "value", "}", ")", "=>", "<", "Box", "height", "=", "{", "value", "}", "width", "=", "\"80x\"", "bg", "=", "\"#000\"", "/", ">", "}", "/>))}", "<", "/Box>", "<", "SectionHeader", "title", "=", "\"Components\"", "/", ">", "{", "Object", ".", "keys", "(", "components", ")", ".", "map", "(", "(", "comp", ")", "=>", "{", "return", "(", "<", "Box", "key", "=", "{", "comp", "}", "borderBottom", "=", "\"solid\"", "borderBottomColor", "=", "\"line.divider\"", "my", "=", "\"l\"", ">", "{", "Object", ".", "keys", "(", "components", "[", "comp", "]", ")", ".", "map", "(", "(", "item", ")", "=>", "(", "<", "ConfigBox", "key", "=", "{", "item", "}", "tokenPath", "=", "{", "`components.${", "comp", "}.${", "item", "}`", "}", "value", "=", "{", "components", "[", "comp", "]", "[", "item", "]", "}", "component", "=", "\"input\"", "/", ">", ")", ")", "}", "<", "/Box>);", "}", ")", "}", "<", "/Box>", "<", "/StoreProvider>);", "}", "export", "function", "PC", "(", ")", "{", "const", "tokenStore", "=", "new", "ThemeStore", "(", "'pcTokens'", ",", "THEMES", ".", "light", ".", "desktop", ")", ";", "return", "<", "FrameworkConfig", "store", "=", "{", "tokenStore", "}", "/>;", "}", "export", "function", "Pad", "(", ")", "{", "const", "tokenStore", "=", "new", "ThemeStore", "(", "'padTokens'", ",", "THEMES", ".", "light", ".", "tablet", ")", ";", "return", "<", "FrameworkConfig", "store", "=", "{", "tokenStore", "}", "/>;", "}", "export", "function", "Phone", "(", ")", "{", "const", "tokenStore", "=", "new", "ThemeStore", "(", "'phoneTokens'", ",", "THEMES", ".", "light", ".", "phone", ")", ";", "return", "<", "FrameworkConfig", "store", "=", "{", "tokenStore", "}", "/>;", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1197
[ "import", "React", ",", "{", "SVGAttributes", "}", "from", "'react'", ";", "export", "const", "AudioIcon", "=", "(", "props", ")", "=>", "(", "<", "svg", "viewBox", "=", "\"0 0 1024 1024\"", "version", "=", "\"1.1\"", "xmlns", "=", "\"http://www.w3.org/2000/svg\"", "fill", "=", "\"currentColor\"", "{", "...", "props", "}", ">", "<", "path", "d", "=", "\"M512.021333 889.898667a32 32 0 0 1-32-32V165.184a32 32 0 1 1 64 0v692.714667a32 32 0 0 1-32 32zM314.816 732.181333a32 32 0 0 1-32-32v-396.373333a32 32 0 1 1 64 0v396.373333a32 32 0 0 1-32 32zM720.021333 732.181333a32 32 0 0 1-32-32v-396.373333a32 32 0 1 1 64 0v396.373333a32 32 0 0 1-32 32zM117.632 608.661333a32 32 0 0 1-32-32V469.12a32 32 0 1 1 64 0v107.541333a32 32 0 0 1-32 32zM911.018667 608.661333a32 32 0 0 1-32-32V469.12a32 32 0 1 1 64 0v107.541333a32 32 0 0 1-32 32z\"", ">", "<", "/path>", "<", "/svg>);", "export", "const", "MouseIcon", "=", "(", "props", ")", "=>", "(", "<", "svg", "viewBox", "=", "\"0 0 1024 1024\"", "version", "=", "\"1.1\"", "xmlns", "=", "\"http://www.w3.org/2000/svg\"", "fill", "=", "\"currentColor\"", "{", "...", "props", "}", ">", "<", "path", "d", "=", "\"M753.117461 265.937747c-121.307942-121.297239-317.975793-121.297239-439.283734 0l-166.164266 166.174969c-121.307942 121.307942-121.307942 317.975793 0 439.283734 121.297239 121.297239 317.975793 121.297239 439.273031 0l166.174969-166.174969c121.307942-121.307942 121.307942-317.975793 0-439.283734z m-219.144177 552.478792c-91.896064 91.896064-241.438552 91.896064-333.334615 0s-91.896064-241.427849 0-333.323912l166.174969-166.174969c91.896064-91.896064 241.427849-91.896064 333.323912 0s91.896064 241.427849 0 333.323912l-166.164266 166.174969z\"", ">", "<", "/path>", "<", "path", "d", "=", "\"M348.746953 318.061417l363.099693 363.099693-52.979911 52.979911-363.110396-363.099693zM610.949349 472.067061a37.481949 37.481949 0 0 1-52.979911 0 37.481949 37.481949 0 0 1 0-52.979911l60.546941-60.546941a37.460543 37.460543 0 0 1 52.97991 0 37.481949 37.481949 0 0 1 0 52.979911l-60.54694 60.546941zM964.448439 131.968142a37.481949 37.481949 0 0 0-12.340573-51.524301 37.481949 37.481949 0 0 0-51.524301 12.351276c-0.78132 1.295064-1.305768 2.654347-1.915839 4.002926l-0.396012-0.235466c-51.973828 83.611932-115.646048 153.81299-185.247737 208.70874l67.407572 41.324331c68.135376-57.336037 130.244957-128.01873 181.715743-210.860046l-0.385309-0.224763c0.909756-1.166628 1.894433-2.258336 2.686456-3.542697z\"", ">", "<", "/path>", "<", "/svg>);", "export", "const", "EyeIcon", "=", "(", "props", ")", "=>", "(", "<", "svg", "viewBox", "=", "\"0 0 1024 1024\"", "version", "=", "\"1.1\"", "xmlns", "=", "\"http://www.w3.org/2000/svg\"", "fill", "=", "\"currentColor\"", "{", "...", "props", "}", ">", "<", "path", "d", "=", "\"M512.004096 170.667008c-307.160064 0-455.114752 298.305536-455.114752 312.88832 0 14.599168 144.003072 312.889344 455.114752 312.889344 311.105536 0 455.10656-298.2912 455.10656-312.889344 0-14.582784-147.954688-312.88832-455.10656-312.88832z m0 483.555328c-94.2592 0-170.67008-76.41088-170.67008-170.669056 0-94.2592 76.41088-170.663936 170.67008-170.663936 94.251008 0 170.662912 76.40576 170.662912 170.663936 0 94.257152-76.411904 170.669056-170.662912 170.669056z m0-256c-47.136768 0-85.337088 38.20544-85.337088 85.32992 0 47.13472 38.20032 85.33504 85.337088 85.33504 47.123456 0 85.32992-38.20032 85.32992-85.33504 0-47.12448-38.206464-85.32992-85.32992-85.32992z\"", ">", "<", "/path>", "<", "/svg>);", "export", "const", "GestureIcon", "=", "(", "props", ")", "=>", "(", "<", "svg", "viewBox", "=", "\"0 0 1024 1024\"", "version", "=", "\"1.1\"", "xmlns", "=", "\"http://www.w3.org/2000/svg\"", "fill", "=", "\"currentColor\"", "{", "...", "props", "}", ">", "<", "path", "d", "=", "\"M298.666667 256c0-87.296 87.893333-170.666667 213.333333-170.666667s213.333333 83.370667 213.333333 170.666667a42.666667 42.666667 0 0 0 85.333334 0c0-148.352-141.354667-256-298.666667-256-157.354667 0-298.666667 107.648-298.666667 256a42.666667 42.666667 0 1 0 85.333334 0z m273.066666 0a102.4 102.4 0 0 0-95.317333 64.938667A102.314667 102.314667 0 0 0 349.866667 420.352V599.168a105.642667 105.642667 0 0 0-151.168 139.776l102.485333 178.133333A213.333333 213.333333 0 0 0 486.101333 1024h124.586667a213.333333 213.333333 0 0 0 210.986667-181.845333l14.421333-96.597334a170.666667 170.666667 0 0 0-123.946667-189.866666l-38.016-10.368V358.4A102.4 102.4 0 0 0 571.733333 256z m-119.466666 147.413333a17.066667 17.066667 0 0 1 17.066666 17.066667v126.464a42.666667 42.666667 0 0 0 85.333334 0V358.4a17.066667 17.066667 0 0 1 34.133333 0v219.562667a42.666667 42.666667 0 0 0 31.445333 41.130666l69.461334 18.944a85.333333 85.333333 0 0 1 61.994666 94.933334l-14.421333 96.597333A128 128 0 0 1 610.645333 938.666667h-124.586666a128 128 0 0 1-110.933334-64.128L272.64 696.405333a20.224 20.224 0 0 1 33.962667-21.888l51.285333 71.381334a42.666667 42.666667 0 0 0 77.312-24.917334V420.394667c0-9.344 7.552-16.938667 17.066667-16.938667z\"", ">", "<", "/path>", "<", "/svg>);" ]
[ null, null, null, null, null, null, null, null, null, null, null, 9, null, null, 1039, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]
1198
[ "import", "*", "as", "mobx", "from", "'mobx'", ";", "import", "React", "from", "'react'", ";", "function", "isNumericKey", "(", "key", ")", "{", "return", "String", "(", "Number", ".", "parseInt", "(", "key", ")", ")", "===", "key", ";", "}", "export", "function", "keyToValueShape", "(", "key", ")", "{", "return", "isNumericKey", "(", "key", ")", "?", "'array'", ":", "'object'", ";", "}", "/** lodash.get(...) for mobx observables */", "export", "function", "observableGetIn", "(", "obj", ",", "key", ",", "defaultValue", "?", ")", "{", "const", "path", "=", "Array", ".", "isArray", "(", "key", ")", "?", "key", ":", "splitToPath", "(", "key", ")", ";", "let", "target", "=", "obj", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "path", ".", "length", ";", "i", "+=", "1", ")", "{", "if", "(", "!", "mobx", ".", "isObservable", "(", "target", ")", ")", "{", "return", "defaultValue", ";", "}", "target", "=", "mobx", ".", "get", "(", "target", ",", "path", "[", "i", "]", ")", ";", "}", "if", "(", "target", "===", "undefined", ")", "{", "return", "defaultValue", ";", "}", "return", "target", ";", "}", "/** lodash.set(...) for mobx observables */", "export", "function", "observableSetIn", "(", "obj", ",", "key", ",", "value", ")", "{", "const", "path", "=", "Array", ".", "isArray", "(", "key", ")", "?", "key", ":", "splitToPath", "(", "key", ")", ";", "const", "lastPartIndex", "=", "path", ".", "length", "-", "1", ";", "let", "target", "=", "obj", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "lastPartIndex", ";", "i", "+=", "1", ")", "{", "const", "part", "=", "path", "[", "i", "]", ";", "if", "(", "mobx", ".", "get", "(", "target", ",", "part", ")", "==", "null", ")", "{", "if", "(", "isNumericKey", "(", "path", "[", "i", "+", "1", "]", ")", ")", "{", "mobx", ".", "set", "(", "target", ",", "part", ",", "[", "]", ")", ";", "}", "else", "{", "mobx", ".", "set", "(", "target", ",", "part", ",", "{", "}", ")", ";", "}", "}", "target", "=", "mobx", ".", "get", "(", "target", ",", "part", ")", ";", "if", "(", "!", "mobx", ".", "isObservable", "(", "target", ")", ")", "{", "return", ";", "}", "}", "if", "(", "mobx", ".", "isObservable", "(", "target", ")", ")", "{", "mobx", ".", "set", "(", "target", ",", "path", "[", "lastPartIndex", "]", ",", "value", ")", ";", "}", "}", "/** 合并受控状态和 非受控状态 */", "export", "function", "composeState", "<", "S", ">", "(", "controlledState", ",", "uncontrolledState", ")", "{", "if", "(", "controlledState", "!==", "undefined", ")", "{", "return", "controlledState", ";", "}", "return", "uncontrolledState", ";", "}", "export", "function", "splitToPath", "(", "name", ")", "{", "return", "name", ".", "split", "(", "'.'", ")", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 208, null, null, null, null, 208, null, 208, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, 2, null, null, null, null, null, null, null, null, null, null, null ]
1199
[ "import", "invariant", "from", "'invariant'", ";", "import", "{", "action", ",", "computed", ",", "makeObservable", ",", "observable", "}", "from", "'mobx'", ";", "import", "React", ",", "{", "useLayoutEffect", "}", "from", "'react'", ";", "import", "{", "composeState", ",", "keyToValueShape", ",", "observableGetIn", ",", "observableSetIn", ",", "splitToPath", "}", "from", "'./common-utils'", ";", "type", "valueOf", "<", "T", ">", "=", "T", "[", "keyof", "T", "]", ";", "export", "type", "DottedObjectKeyPath", "<", "D", ">", "=", "D", "extends", "any", "[", "]", "?", "never", ":", "D", "extends", "object", "?", "valueOf", "<", "{", "[", "K", "in", "keyof", "D", "&", "string", "]", ":", "`${", "K", "}`", "|", "`${", "K", "}.${", "DottedObjectKeyPath", "<", "D", "[", "K", "]", ">", "}`", ";", "}", ">", ":", "never", ";", "type", "XName", "<", "D", ">", "=", "D", "extends", "any", "[", "]", "?", "number", ":", "DottedObjectKeyPath", "<", "D", ">", ";", "type", "ResolveXName", "<", "D", ",", "Path", "extends", "string", "|", "number", ">", "=", "0", "extends", "Path", "&", "1", "?", "any", ":", "string", "extends", "Path", "?", "unknown", ":", "Path", "extends", "number", "?", "D", "extends", "Array", "<", "infer", "U", ">", "?", "U", ":", "unknown", ":", "Path", "extends", "keyof", "D", "?", "D", "[", "Path", "]", ":", "Path", "extends", "`${", "infer", "K", "}.${", "infer", "R", "}`", "?", "K", "extends", "keyof", "D", "?", "ResolveXName", "<", "D", "[", "K", "]", ",", "R", ">", ":", "unknown", ":", "unknown", ";", "export", "type", "ValueShape", "=", "'array'", "|", "'object'", ";", "export", "type", "FieldValidateTrigger", "=", "'*'", "|", "'blur'", "|", "'change'", "|", "'mount'", ";", "export", "interface", "FieldConfig", "<", "D", "=", "unknown", ">", "{", "label", ":", "React", ".", "ReactNode", ";", "help", "?", ":", "React", ".", "ReactNode", ";", "tip", "?", ":", "React", ".", "ReactNode", ";", "asterisk", "?", ":", "boolean", ";", "fallbackValue", "?", ":", "any", ";", "isEmpty", "?", "(", "value", ")", ":", "boolean", ";", "required", "?", ":", "boolean", ";", "requiredMessage", "?", ":", "string", ";", "validate", "?", "(", "value", ",", "field", ",", "trigger", ")", ":", "string", "|", "Promise", "<", "any", ">", ";", "validateOnMount", "?", ":", "boolean", ";", "validateOnChange", "?", ":", "boolean", ";", "validateOnBlur", "?", ":", "boolean", ";", "disabled", "?", ":", "boolean", ";", "readOnly", "?", ":", "boolean", ";", "status", "?", ":", "string", ";", "}", "export", "interface", "IModel", "<", "D", "=", "unknown", ">", "{", "readonly", "root", ":", "FormModel", ";", "readonly", "path", ":", "string", "[", "]", ";", "readonly", "parent", ":", "IModel", ";", "/** model 级别的状态 */", "state", ":", "any", ";", "values", ":", "D", ";", "getValue", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ",", "defaultValue", "?", ")", ":", "ResolveXName", "<", "D", ",", "N", ">", ";", "setValue", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ",", "value", ")", ":", "void", ";", "getSubModel", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ")", ":", "SubModel", "<", "ResolveXName", "<", "D", ",", "N", ">", ">", ";", "getField", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ")", ":", "Field", "<", "ResolveXName", "<", "D", ",", "N", ">", ">", ";", "getTupleField", "<", "NS", "extends", "(", "keyof", "D", "&", "string", ")", "[", "]", ">", "(", "...", "tupleParts", ")", ":", "Field", "<", "{", "[", "Index", "in", "keyof", "NS", "]", ":", "NS", "[", "Index", "]", "extends", "keyof", "D", "?", "D", "[", "NS", "[", "Index", "]", "]", ":", "never", ";", "}", ">", ";", "readonly", "_proxy", ":", "SubModelProxy", ";", "_asField", "(", ")", ":", "Field", "<", "D", ">", ";", "}", "export", "class", "SubModelProxy", "<", "D", "=", "unknown", ">", "{", "readonly", "model", ":", "IModel", "<", "D", ">", ";", "readonly", "fieldMap", "=", "new", "Map", "<", "string", ",", "Field", ">", "(", ")", ";", "valueShape", ":", "'auto'", "|", "ValueShape", ";", "subModels", ":", "{", "[", "key", "]", ":", "SubModel", ";", "}", ";", "constructor", "(", "model", ")", "{", "this", ".", "model", "=", "model", ";", "this", ".", "valueShape", "=", "'auto'", ";", "}", "_updateValueShape", "(", "valueShape", ")", "{", "if", "(", "this", ".", "valueShape", "===", "'auto'", ")", "{", "this", ".", "valueShape", "=", "valueShape", ";", "this", ".", "subModels", "=", "valueShape", "===", "'object'", "?", "{", "}", ":", "(", "[", "]", "as", "any", ")", ";", "}", "else", "{", "invariant", "(", "this", ".", "valueShape", "===", "valueShape", ",", "'[xform] Model 的结构需要在使用过程中保持一致,一个数据索引对应的结构不能从数组变为对象,也不能从对象变为数组'", ")", ";", "}", "}", "/** 递归前序遍历该 proxy 下(不包含 proxy 本身)所有存在的 model 对象 */", "iterateModels", "(", "iteratee", ")", "{", "const", "dfs", "=", "(", "proxy", ")", "=>", "{", "if", "(", "proxy", ".", "subModels", "!=", "null", ")", "{", "for", "(", "const", "mod", "of", "Object", ".", "values", "(", "proxy", ".", "subModels", ")", ")", "{", "iteratee", "(", "mod", ")", ";", "dfs", "(", "mod", ".", "_proxy", ")", ";", "}", "}", "}", ";", "dfs", "(", "this", ")", ";", "}", "/** 递归遍历该 proxy 下(包括 proxy 本身)所有存在的 field 对象(包括 fork field) */", "iterateFields", "(", "iteratee", ")", "{", "this", ".", "fieldMap", ".", "forEach", "(", "(", "fd", ")", "=>", "{", "fd", ".", "_forkMap", ".", "forEach", "(", "iteratee", ")", ";", "}", ")", ";", "this", ".", "iterateModels", "(", "(", "mod", ")", "=>", "{", "mod", ".", "_proxy", ".", "fieldMap", ".", "forEach", "(", "(", "fd", ")", "=>", "{", "fd", ".", "_forkMap", ".", "forEach", "(", "iteratee", ")", ";", "}", ")", ";", "}", ")", ";", "}", "getSubModel", "(", "longName", ")", "{", "const", "path", "=", "Array", ".", "isArray", "(", "longName", ")", "?", "longName", ":", "splitToPath", "(", "longName", ")", ";", "let", "mod", "=", "this", ".", "model", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "path", ".", "length", "-", "1", ";", "i", "++", ")", "{", "mod", "=", "mod", ".", "_proxy", ".", "_getSubModel", "(", "path", "[", "i", "]", ")", ";", "}", "return", "mod", ".", "_proxy", ".", "_getSubModel", "(", "path", "[", "path", ".", "length", "-", "1", "]", ")", ";", "}", "_getSubModel", "(", "name", ")", "{", "this", ".", "_updateValueShape", "(", "keyToValueShape", "(", "name", ")", ")", ";", "let", "subModel", "=", "this", ".", "subModels", "[", "name", "]", ";", "if", "(", "subModel", "==", "null", ")", "{", "subModel", "=", "new", "SubModel", "(", "this", ".", "model", ",", "name", ")", ";", "this", ".", "subModels", "[", "name", "]", "=", "subModel", ";", "}", "return", "subModel", ";", "}", "getField", "(", "longName", ")", "{", "const", "path", "=", "Array", ".", "isArray", "(", "longName", ")", "?", "longName", ":", "splitToPath", "(", "longName", ")", ";", "if", "(", "path", ".", "length", ">", "1", ")", "{", "const", "lastName", "=", "path", "[", "path", ".", "length", "-", "1", "]", ";", "const", "subModel", "=", "this", ".", "getSubModel", "(", "path", ".", "slice", "(", "0", ",", "-", "1", ")", ")", ";", "return", "subModel", ".", "_proxy", ".", "getField", "(", "[", "lastName", "]", ")", ";", "}", "const", "name", "=", "path", "[", "0", "]", ";", "this", ".", "_updateValueShape", "(", "keyToValueShape", "(", "name", ")", ")", ";", "return", "this", ".", "ensureField", "(", "name", ")", ";", "}", "ensureField", "(", "name", ",", "forkName", "?", ",", "tupleParts", "?", ")", "{", "let", "field", "=", "this", ".", "fieldMap", ".", "get", "(", "name", ")", ";", "if", "(", "field", "==", "null", ")", "{", "field", "=", "new", "Field", "(", "this", ".", "model", ",", "name", ",", "forkName", ",", "tupleParts", ")", ";", "this", ".", "fieldMap", ".", "set", "(", "name", ",", "field", ")", ";", "}", "return", "field", ";", "}", "getTupleField", "(", "...", "tupleParts", ")", "{", "this", ".", "_updateValueShape", "(", "'object'", ")", ";", "const", "name", "=", "tupleParts", ".", "join", "(", "'...'", ")", ";", "return", "this", ".", "ensureField", "(", "name", ",", "Field", ".", "ORIGINAL", ",", "tupleParts", ")", ";", "}", "}", "const", "EMPTY_PATH", "=", "[", "]", "as", "string", "[", "]", ";", "export", "class", "FormModel", "<", "D", "extends", "{", "[", "key", "]", ":", "any", ";", "}", "=", "unknown", ">", "implements", "IModel", "<", "D", ">", "{", "private", "_nextModelId", "=", "1", ";", "getNextModelId", "(", ")", "{", "return", "`Model_${", "this", ".", "_nextModelId", "++", "}`", ";", "}", "private", "_nextFieldId", "=", "1", ";", "getNextFieldId", "(", ")", "{", "return", "`Field_${", "this", ".", "_nextFieldId", "++", "}`", ";", "}", "public", "values", ":", "D", ";", "public", "state", ":", "any", "=", "{", "}", ";", "public", "readonly", "root", "=", "this", ";", "public", "readonly", "parent", "=", "this", "as", "IModel", "<", "any", ">", ";", "public", "readonly", "path", "=", "EMPTY_PATH", ";", "readonly", "_proxy", ":", "SubModelProxy", "<", "D", ">", "=", "new", "SubModelProxy", "(", "this", ")", ";", "constructor", "(", "values", "=", "{", "}", "as", "any", ")", "{", "this", ".", "values", "=", "values", ";", "makeObservable", "(", "this", ",", "{", "values", ":", "observable", ",", "state", ":", "observable", ",", "setValue", ":", "action", ",", "}", ")", ";", "}", "getValue", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ",", "defaultValue", "?", ")", "{", "return", "observableGetIn", "(", "this", ".", "values", ",", "String", "(", "name", ")", ",", "defaultValue", ")", ";", "}", "setValue", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ",", "value", ")", "{", "observableSetIn", "(", "this", ".", "values", ",", "name", ",", "value", ")", ";", "}", "getSubModel", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ")", "{", "return", "this", ".", "_proxy", ".", "getSubModel", "(", "String", "(", "name", ")", ")", ";", "}", "getField", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ")", "{", "return", "this", ".", "_proxy", ".", "getField", "(", "name", ")", ";", "}", "getTupleField", "<", "NS", "extends", "(", "keyof", "D", "&", "string", ")", "[", "]", ">", "(", "...", "tupleParts", ")", "{", "return", "this", ".", "_proxy", ".", "getTupleField", "(", "...", "tupleParts", ")", ";", "}", "_asField", "(", ")", "{", "throw", "new", "Error", "(", "'FormModel 下不支持使用 name=& 的 Field'", ")", ";", "}", "}", "export", "class", "SubModel", "<", "D", "=", "unknown", ">", "implements", "IModel", "<", "D", ">", "{", "readonly", "root", ":", "FormModel", "<", "any", ">", ";", "readonly", "parent", ":", "IModel", "<", "any", ">", ";", "public", "state", "=", "{", "}", ";", "readonly", "id", ":", "string", ";", "public", "name", ":", "string", ";", "readonly", "_proxy", ":", "SubModelProxy", "<", "D", ">", ";", "constructor", "(", "parent", ",", "name", ")", "{", "invariant", "(", "!", "name", ".", "includes", "(", "'.'", ")", ",", "'name 中不能包含 .'", ")", ";", "this", ".", "root", "=", "parent", ".", "root", ";", "this", ".", "parent", "=", "parent", ";", "this", ".", "name", "=", "name", ";", "this", ".", "_proxy", "=", "new", "SubModelProxy", "<", "D", ">", "(", "this", ")", ";", "this", ".", "id", "=", "this", ".", "root", ".", "getNextModelId", "(", ")", ";", "makeObservable", "(", "this", ",", "{", "values", ":", "computed", ",", "state", ":", "observable", ",", "setValue", ":", "action", ",", "name", ":", "observable", ",", "}", ",", "{", "name", ":", "`${", "this", ".", "id", "}(${", "this", ".", "name", "})`", "}", ")", ";", "}", "get", "path", "(", ")", ":", "string", "[", "]", "{", "return", "[", "...", "this", ".", "parent", ".", "path", ",", "this", ".", "name", "]", ";", "}", "getSubModel", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ")", "{", "return", "this", ".", "_proxy", ".", "getSubModel", "(", "String", "(", "name", ")", ")", ";", "}", "getField", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ")", "{", "return", "this", ".", "_proxy", ".", "getField", "(", "String", "(", "name", ")", ")", ";", "}", "getTupleField", "<", "NS", "extends", "(", "keyof", "D", "&", "string", ")", "[", "]", ">", "(", "...", "tupleParts", ")", "{", "return", "this", ".", "_proxy", ".", "getTupleField", "(", "...", "tupleParts", ")", ";", "}", "get", "values", "(", ")", "{", "return", "this", ".", "parent", ".", "getValue", "(", "this", ".", "name", ")", "as", "D", ";", "}", "set", "values", "(", "nextValues", ")", "{", "this", ".", "parent", ".", "setValue", "(", "this", ".", "name", ",", "nextValues", ")", ";", "}", "getValue", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ",", "defaultValue", "?", ")", "{", "return", "observableGetIn", "(", "this", ".", "values", ",", "String", "(", "name", ")", ",", "defaultValue", ")", ";", "}", "setValue", "<", "N", "extends", "XName", "<", "D", ">", ">", "(", "name", ",", "value", ")", "{", "if", "(", "this", ".", "values", "==", "null", ")", "{", "this", ".", "_proxy", ".", "_updateValueShape", "(", "keyToValueShape", "(", "splitToPath", "(", "String", "(", "name", ")", ")", "[", "0", "]", ")", ")", ";", "this", ".", "values", "=", "(", "this", ".", "_proxy", ".", "valueShape", "===", "'array'", "?", "[", "]", ":", "{", "}", ")", "as", "D", ";", "}", "observableSetIn", "(", "this", ".", "values", ",", "String", "(", "name", ")", ",", "value", ")", ";", "}", "_asField", "(", ")", "{", "return", "this", ".", "parent", ".", "getField", "(", "this", ".", "name", ")", "as", "Field", "<", "D", ">", ";", "}", "}", "export", "interface", "FieldState", "{", "error", "?", ":", "any", ";", "validating", "?", ":", "boolean", ";", "cancelValidation", "?", "(", ")", ":", "void", ";", "[", "key", "]", ":", "any", ";", "}", "export", "class", "Field", "<", "V", "=", "unknown", ">", "{", "static", "ORIGINAL", "=", "'original'", ";", "/** 字段配置的最新缓存(注意不要修改该值)*/", "config", "?", ":", "FieldConfig", "<", "V", ">", "=", "null", ";", "/** 字段是否在视图中被渲染 */", "isMounted", "=", "false", ";", "readonly", "parent", ":", "IModel", "<", "any", ">", ";", "readonly", "name", ":", "string", ";", "readonly", "forkName", ":", "string", ";", "readonly", "tupleParts", ":", "string", "[", "]", ";", "readonly", "id", ":", "string", ";", "readonly", "_forkMap", ":", "Map", "<", "string", ",", "Field", ">", ";", "state", ":", "FieldState", "=", "{", "}", ";", "get", "value", "(", ")", ":", "V", "{", "if", "(", "this", ".", "tupleParts", ")", "{", "return", "this", ".", "tupleParts", ".", "map", "(", "(", "part", ")", "=>", "this", ".", "parent", ".", "getValue", "(", "part", ")", ")", "as", "any", ";", "}", "return", "this", ".", "parent", ".", "getValue", "(", "this", ".", "name", ")", "as", "any", ";", "}", "set", "value", "(", "value", ")", "{", "if", "(", "this", ".", "tupleParts", ")", "{", "this", ".", "tupleParts", ".", "forEach", "(", "(", "part", ",", "index", ")", "=>", "{", "this", ".", "parent", ".", "setValue", "(", "part", ",", "value", "[", "index", "]", ")", ";", "}", ")", ";", "return", ";", "}", "this", ".", "parent", ".", "setValue", "(", "this", ".", "name", ",", "value", ")", ";", "}", "get", "path", "(", ")", "{", "return", "this", ".", "parent", ".", "path", ".", "concat", "(", "[", "this", ".", "name", "]", ")", ";", "}", "constructor", "(", "parent", ",", "name", ",", "forkName", "=", "Field", ".", "ORIGINAL", ",", "tupleParts", "?", ")", "{", "this", ".", "parent", "=", "parent", ";", "this", ".", "name", "=", "name", ";", "this", ".", "forkName", "=", "forkName", ";", "this", ".", "tupleParts", "=", "tupleParts", ";", "this", ".", "id", "=", "this", ".", "parent", ".", "root", ".", "getNextFieldId", "(", ")", ";", "makeObservable", "(", "this", ",", "{", "state", ":", "observable", ",", "value", ":", "computed", ",", "path", ":", "computed", ",", "validate", ":", "action", ",", "handleBlur", ":", "action", ",", "handleChange", ":", "action", ",", "}", ",", "{", "name", ":", "`${", "this", ".", "id", "}(${", "name", "}${", "forkName", "===", "Field", ".", "ORIGINAL", "?", "''", ":", "'#'", "+", "forkName", "})`", "}", ")", ";", "if", "(", "forkName", "===", "Field", ".", "ORIGINAL", ")", "{", "this", ".", "_forkMap", "=", "new", "Map", "(", ")", ";", "}", "else", "{", "const", "original", "=", "this", ".", "parent", ".", "getField", "(", "name", ")", ";", "this", ".", "_forkMap", "=", "original", ".", "_forkMap", ";", "}", "this", ".", "_forkMap", ".", "set", "(", "forkName", ",", "this", ")", ";", "}", "_useTrack", "(", "config", ")", "{", "useLayoutEffect", "(", "(", ")", "=>", "{", "if", "(", "this", ".", "isMounted", ")", "{", "console", ".", "warn", "(", "`[xform] field \\`${", "this", ".", "path", ".", "join", "(", "'.'", ")", "}\\` 已在视图中被加载,你需要 fork 该字段来进行多次加载.`", ")", ";", "return", ";", "}", "this", ".", "config", "=", "config", ";", "this", ".", "isMounted", "=", "true", ";", "return", "(", ")", "=>", "{", "this", ".", "config", "=", "null", ";", "this", ".", "isMounted", "=", "false", ";", "}", ";", "}", ",", "[", "config", "]", ")", ";", "}", "getFork", "(", "forkName", ")", "{", "if", "(", "this", ".", "_forkMap", ".", "has", "(", "forkName", ")", ")", "{", "return", "this", ".", "_forkMap", ".", "get", "(", "forkName", ")", "as", "Field", "<", "V", ">", ";", "}", "else", "{", "return", "new", "Field", "<", "V", ">", "(", "this", ".", "parent", ",", "this", ".", "name", ",", "forkName", ",", "this", ".", "tupleParts", ")", ";", "}", "}", "async", "validate", "(", "trigger", "=", "'*'", ")", "{", "if", "(", "!", "this", ".", "isMounted", ")", "{", "return", ";", "}", "const", "{", "validate", ",", "fallbackValue", ",", "isEmpty", ",", "required", ",", "requiredMessage", "=", "'该字段为必填项'", ",", "validateOnMount", ",", "validateOnBlur", ",", "validateOnChange", ",", "}", "=", "this", ".", "config", ";", "const", "value", "=", "composeState", "(", "this", ".", "value", ",", "fallbackValue", ")", ";", "const", "needValidate", "=", "trigger", "===", "'*'", "||", "(", "validateOnBlur", "&&", "trigger", "===", "'blur'", ")", "||", "(", "validateOnMount", "&&", "trigger", "===", "'mount'", ")", "||", "(", "validateOnChange", "&&", "trigger", "===", "'change'", ")", ";", "if", "(", "!", "needValidate", ")", "{", "return", ";", "}", "const", "actualValidate", "=", "async", "(", ")", "=>", "{", "if", "(", "required", "&&", "isEmpty", "(", "value", ")", ")", "{", "return", "requiredMessage", ";", "}", "if", "(", "validate", ")", "{", "return", "validate", "(", "value", ",", "this", ",", "trigger", ")", ";", "}", "return", "null", ";", "}", ";", "let", "cancelled", "=", "false", ";", "this", ".", "state", ".", "cancelValidation", "?.", "(", ")", ";", "this", ".", "state", ".", "validating", "=", "true", ";", "this", ".", "state", ".", "cancelValidation", "=", "action", "(", "(", ")", "=>", "{", "cancelled", "=", "true", ";", "this", ".", "state", ".", "cancelValidation", "=", "null", ";", "this", ".", "state", ".", "validating", "=", "false", ";", "}", ")", ";", "return", "actualValidate", "(", ")", ".", "then", "(", "action", "(", "(", "error", ")", "=>", "{", "if", "(", "cancelled", ")", "{", "return", ";", "}", "this", ".", "state", ".", "cancelValidation", "=", "null", ";", "this", ".", "state", ".", "validating", "=", "false", ";", "this", ".", "state", ".", "error", "=", "error", ";", "return", "error", ";", "}", ")", ")", ";", "}", "handleBlur", "=", "(", ")", "=>", "{", "return", "this", ".", "validate", "(", "'blur'", ")", ";", "}", ";", "handleChange", "=", "(", "nextValue", ")", "=>", "{", "this", ".", "value", "=", "composeState", "(", "nextValue", ",", "this", ".", "config", "?.", "fallbackValue", ")", ";", "return", "this", ".", "validate", "(", "'change'", ")", ";", "}", ";", "}" ]
[ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, 24290, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, 24290, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 896, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, 4, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 23113, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 4, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 23113, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 23113, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 896, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 23113, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, 23113, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, 23113, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, 2, null, 2, null, null, 5, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, 5, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 344, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 24290, null, null, null, null, null, null, null, null, null, 709, null, 24290, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 709, null, 24290, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 23113, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 896, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 23113, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, 709, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 344, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 24290, null, null, null, null, null, null, null, null, null, 709, null, 24290, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, null, null, null, null, null, null, null, null, 709, null, 24290, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 215, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2, null, 3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 896, null, 2, null, 2, null, null, null, null, null, 5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 4, null, 9384, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 254, null, 2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, 0, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null ]