@chayns-components/core 5.0.0-beta.14 → 5.0.0-beta.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -9
- package/lib/components/accordion/Accordion.d.ts +41 -2
- package/lib/components/accordion/Accordion.js +73 -75
- package/lib/components/accordion/Accordion.js.map +1 -1
- package/lib/components/accordion/Accordion.styles.d.ts +3 -2
- package/lib/components/accordion/Accordion.styles.js +67 -26
- package/lib/components/accordion/Accordion.styles.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.d.ts +13 -2
- package/lib/components/accordion/accordion-body/AccordionBody.js +19 -11
- package/lib/components/accordion/accordion-body/AccordionBody.js.map +1 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.d.ts +4 -1
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js +15 -10
- package/lib/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.d.ts +16 -2
- package/lib/components/accordion/accordion-content/AccordionContent.js +13 -11
- package/lib/components/accordion/accordion-content/AccordionContent.js.map +1 -1
- package/lib/components/accordion/accordion-content/AccordionContent.styles.d.ts +2 -1
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js +24 -14
- package/lib/components/accordion/accordion-content/AccordionContent.styles.js.map +1 -1
- package/lib/components/accordion/accordion-group/AccordionGroup.d.ts +10 -2
- package/lib/components/accordion/accordion-group/AccordionGroup.js +31 -44
- package/lib/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.d.ts +5 -2
- package/lib/components/accordion/accordion-head/AccordionHead.js +74 -58
- package/lib/components/accordion/accordion-head/AccordionHead.js.map +1 -1
- package/lib/components/accordion/accordion-head/AccordionHead.styles.d.ts +9 -1
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js +138 -45
- package/lib/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
- package/lib/components/accordion/accordion-intro/AccordionIntro.d.ts +9 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.js +21 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.js.map +1 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.d.ts +1 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js +13 -0
- package/lib/components/accordion/accordion-intro/AccordionIntro.styles.js.map +1 -0
- package/lib/components/accordion/utils.js +10 -12
- package/lib/components/accordion/utils.js.map +1 -1
- package/lib/components/badge/Badge.d.ts +9 -1
- package/lib/components/badge/Badge.js +12 -12
- package/lib/components/badge/Badge.js.map +1 -1
- package/lib/components/badge/Badge.styles.d.ts +4 -1
- package/lib/components/badge/Badge.styles.js +22 -15
- package/lib/components/badge/Badge.styles.js.map +1 -1
- package/lib/components/button/Button.d.ts +2 -2
- package/lib/components/button/Button.js +12 -20
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/button/Button.styles.js +46 -23
- package/lib/components/button/Button.styles.js.map +1 -1
- package/lib/components/checkbox/Checkbox.d.ts +25 -0
- package/lib/components/checkbox/Checkbox.js +44 -0
- package/lib/components/checkbox/Checkbox.js.map +1 -0
- package/lib/components/checkbox/Checkbox.styles.d.ts +6 -0
- package/lib/components/checkbox/Checkbox.styles.js +131 -0
- package/lib/components/checkbox/Checkbox.styles.js.map +1 -0
- package/lib/components/color-scheme-provider/ColorSchemeProvider.d.ts +2 -2
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js +44 -81
- package/lib/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/components/color-scheme-provider/font.d.ts +6 -0
- package/lib/components/color-scheme-provider/font.js +59 -0
- package/lib/components/color-scheme-provider/font.js.map +1 -0
- package/lib/components/context-menu/ContextMenu.d.ts +51 -0
- package/lib/components/context-menu/ContextMenu.js +154 -0
- package/lib/components/context-menu/ContextMenu.js.map +1 -0
- package/lib/components/context-menu/ContextMenu.styles.d.ts +1 -0
- package/lib/components/context-menu/ContextMenu.styles.js +13 -0
- package/lib/components/context-menu/ContextMenu.styles.js.map +1 -0
- package/lib/components/context-menu/constants/alignment.d.ts +8 -0
- package/lib/components/context-menu/constants/alignment.js +17 -0
- package/lib/components/context-menu/constants/alignment.js.map +1 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.d.ts +10 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js +78 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.js.map +1 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +11 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js +117 -0
- package/lib/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -0
- package/lib/components/grid-image/GridImage.d.ts +2 -2
- package/lib/components/grid-image/GridImage.js +15 -52
- package/lib/components/grid-image/GridImage.js.map +1 -1
- package/lib/components/grid-image/GridImage.styles.d.ts +3 -3
- package/lib/components/grid-image/GridImage.styles.js +83 -39
- package/lib/components/grid-image/GridImage.styles.js.map +1 -1
- package/lib/components/icon/Icon.d.ts +7 -3
- package/lib/components/icon/Icon.js +23 -33
- package/lib/components/icon/Icon.js.map +1 -1
- package/lib/components/icon/Icon.styles.d.ts +1 -1
- package/lib/components/icon/Icon.styles.js +62 -40
- package/lib/components/icon/Icon.styles.js.map +1 -1
- package/lib/components/icon/utils.js +2 -5
- package/lib/components/icon/utils.js.map +1 -1
- package/lib/components/input/Input.d.ts +37 -0
- package/lib/components/input/Input.js +75 -0
- package/lib/components/input/Input.js.map +1 -0
- package/lib/components/input/Input.styles.d.ts +7 -0
- package/lib/components/input/Input.styles.js +71 -0
- package/lib/components/input/Input.styles.js.map +1 -0
- package/lib/components/list/List.d.ts +1 -1
- package/lib/components/list/List.js +26 -63
- package/lib/components/list/List.js.map +1 -1
- package/lib/components/list/list-item/ListItem.d.ts +11 -2
- package/lib/components/list/list-item/ListItem.js +37 -51
- package/lib/components/list/list-item/ListItem.js.map +1 -1
- package/lib/components/list/list-item/ListItem.styles.js +44 -26
- package/lib/components/list/list-item/ListItem.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.d.ts +1 -2
- package/lib/components/list/list-item/list-item-body/ListItemBody.js +8 -8
- package/lib/components/list/list-item/list-item-body/ListItemBody.js.map +1 -1
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js +3 -9
- package/lib/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-content/ListItemContent.js +4 -7
- package/lib/components/list/list-item/list-item-content/ListItemContent.js.map +1 -1
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js +8 -11
- package/lib/components/list/list-item/list-item-content/ListItemContent.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.d.ts +3 -2
- package/lib/components/list/list-item/list-item-head/ListItemHead.js +45 -91
- package/lib/components/list/list-item/list-item-head/ListItemHead.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +2 -11
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js +89 -79
- package/lib/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.d.ts +6 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js +23 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.d.ts +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js +32 -0
- package/lib/components/list/list-item/list-item-head/list-item-icon/ListItemIcon.styles.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.d.ts +7 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js +44 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.js.map +1 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.d.ts +10 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js +52 -0
- package/lib/components/list/list-item/list-item-head/list-item-image/ListItemImage.styles.js.map +1 -0
- package/lib/components/mention-finder/MentionFinder.d.ts +31 -0
- package/lib/components/mention-finder/MentionFinder.js +140 -0
- package/lib/components/mention-finder/MentionFinder.js.map +1 -0
- package/lib/components/mention-finder/MentionFinder.styles.d.ts +5 -0
- package/lib/components/mention-finder/MentionFinder.styles.js +94 -0
- package/lib/components/mention-finder/MentionFinder.styles.js.map +1 -0
- package/lib/components/mention-finder/constants/alignment.d.ts +4 -0
- package/lib/components/mention-finder/constants/alignment.js +13 -0
- package/lib/components/mention-finder/constants/alignment.js.map +1 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.d.ts +10 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js +32 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.js.map +1 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.d.ts +8 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js +100 -0
- package/lib/components/mention-finder/mention-finder-item/MentionFinderItem.styles.js.map +1 -0
- package/lib/hooks/uuid.js +2 -21
- package/lib/hooks/uuid.js.map +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.js +55 -25
- package/lib/index.js.map +1 -1
- package/lib/types/chayns.d.ts +59 -0
- package/lib/types/chayns.js +14 -0
- package/lib/types/chayns.js.map +1 -0
- package/package.json +22 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionFinder.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_MentionFinderItem","_interopRequireDefault","_MentionFinder","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","MentionFinder","_ref","inputValue","members","onSelect","popupAlignment","activeMember","setActiveMember","useState","fullMatch","searchString","useMemo","_regExpMatchArray$1$t","_regExpMatchArray$","regExpMatchArray","match","toLowerCase","filteredMembers","filter","_ref2","id","info","name","includes","handleKeyDown","useCallback","event","shouldPreventDefault","currentIndex","findIndex","_ref3","prevIndex","Math","max","member","_ref4","nextIndex","min","length","preventDefault","stopPropagation","handleMemberClick","handleMemberHover","useEffect","isActiveMemberShown","some","_ref5","items","map","createElement","isActive","onClick","onHover","shouldShowPopup","window","addEventListener","removeEventListener","StyledMentionFinder","className","AnimatePresence","initial","StyledMotionMentionFinderPopup","animate","height","opacity","exit","transition","duration","displayName","_default","exports"],"sources":["../../../src/components/mention-finder/MentionFinder.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, { FC, useCallback, useEffect, useMemo, useState } from 'react';\nimport type { MentionFinderPopupAlignment } from './constants/alignment';\nimport MentionFinderItem from './mention-finder-item/MentionFinderItem';\nimport { StyledMentionFinder, StyledMotionMentionFinderPopup } from './MentionFinder.styles';\n\nexport type MentionMember = {\n id: string;\n info: string;\n imageUrl: string;\n name: string;\n};\n\nexport type MentionFinderProps = {\n /**\n * The text from the input field\n */\n inputValue: string;\n /**\n * Members that can be selected\n */\n members: MentionMember[];\n /**\n * Function to be executed when a member is selected\n */\n onSelect: ({ fullMatch, member }: { fullMatch: string; member: MentionMember }) => void;\n /**\n * Alignment of the popup\n */\n popupAlignment: MentionFinderPopupAlignment;\n};\n\nconst MentionFinder: FC<MentionFinderProps> = ({\n inputValue,\n members,\n onSelect,\n popupAlignment,\n}) => {\n const [activeMember, setActiveMember] = useState(members[0]);\n\n const [fullMatch, searchString] = useMemo(() => {\n const regExpMatchArray = inputValue.match(/@(\\w*)(?:\\S|$)/);\n\n return [regExpMatchArray?.[0], regExpMatchArray?.[1]?.toLowerCase() ?? ''];\n }, [inputValue]);\n\n const filteredMembers = useMemo(\n () =>\n searchString !== ''\n ? members.filter(\n ({ id, info, name }) =>\n id.toLowerCase().includes(searchString) ||\n info.toLowerCase().includes(searchString) ||\n name.toLowerCase().includes(searchString)\n )\n : members,\n [members, searchString]\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n let shouldPreventDefault = false;\n\n if (event.key === 'ArrowUp') {\n const currentIndex = filteredMembers.findIndex(({ id }) => id === activeMember?.id);\n\n const prevIndex = Math.max(currentIndex - 1, 0);\n\n const member = filteredMembers[prevIndex];\n\n setActiveMember(member);\n\n shouldPreventDefault = true;\n } else if (event.key === 'ArrowDown') {\n const currentIndex = filteredMembers.findIndex(({ id }) => id === activeMember?.id);\n\n const nextIndex = Math.min(currentIndex + 1, filteredMembers.length - 1);\n\n const member = filteredMembers[nextIndex];\n\n setActiveMember(member);\n\n shouldPreventDefault = true;\n } else if (event.key === 'Enter') {\n if (fullMatch && activeMember) {\n onSelect({ fullMatch, member: activeMember });\n\n shouldPreventDefault = true;\n }\n }\n\n if (shouldPreventDefault) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [activeMember, filteredMembers, fullMatch, onSelect]\n );\n\n const handleMemberClick = useCallback(\n (member: MentionMember) => {\n if (fullMatch) {\n onSelect({ fullMatch, member });\n }\n },\n [fullMatch, onSelect]\n );\n\n const handleMemberHover = useCallback((member: MentionMember) => {\n setActiveMember(member);\n }, []);\n\n useEffect(() => {\n if (filteredMembers.length > 0) {\n const isActiveMemberShown = filteredMembers.some(({ id }) => id === activeMember?.id);\n\n if (!isActiveMemberShown) {\n setActiveMember(filteredMembers[0]);\n }\n }\n }, [activeMember?.id, filteredMembers]);\n\n const items = useMemo(\n () =>\n filteredMembers.map((member) => (\n <MentionFinderItem\n isActive={member.id === activeMember?.id}\n key={member.id}\n member={member}\n onClick={handleMemberClick}\n onHover={handleMemberHover}\n />\n )),\n [activeMember, filteredMembers, handleMemberClick, handleMemberHover]\n );\n\n const shouldShowPopup = useMemo(() => fullMatch && items.length > 0, [fullMatch, items.length]);\n\n useEffect(() => {\n if (shouldShowPopup) {\n window.addEventListener('keydown', handleKeyDown, true);\n }\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown, true);\n };\n }, [handleKeyDown, shouldShowPopup]);\n\n return (\n <StyledMentionFinder className=\"beta-chayns-mention-finder\">\n <AnimatePresence initial={false}>\n {shouldShowPopup && (\n <StyledMotionMentionFinderPopup\n animate={{ height: 'auto', opacity: 1 }}\n className=\"prevent-lose-focus\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n popupAlignment={popupAlignment}\n transition={{ duration: 0.15 }}\n >\n {items}\n </StyledMotionMentionFinderPopup>\n )}\n </AnimatePresence>\n </StyledMentionFinder>\n );\n};\n\nMentionFinder.displayName = 'MentionFinder';\n\nexport default MentionFinder;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,kBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAA6F,SAAAI,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAI,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ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A,aAAa,EAAE6B,eAAe,CAAC,CAAC;EAEpC,oBACIhF,MAAA,CAAAO,OAAA,CAAAqE,aAAA,CAACxE,cAAA,CAAAgF,mBAAmB;IAACC,SAAS,EAAC;EAA4B,gBACvDrF,MAAA,CAAAO,OAAA,CAAAqE,aAAA,CAAC9E,aAAA,CAAAwF,eAAe;IAACC,OAAO,EAAE;EAAM,GAC3BP,eAAe,iBACZhF,MAAA,CAAAO,OAAA,CAAAqE,aAAA,CAACxE,cAAA,CAAAoF,8BAA8B;IAC3BC,OAAO,EAAE;MAAEC,MAAM,EAAE,MAAM;MAAEC,OAAO,EAAE;IAAE,CAAE;IACxCN,SAAS,EAAC,oBAAoB;IAC9BO,IAAI,EAAE;MAAEF,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IAChCJ,OAAO,EAAE;MAAEG,MAAM,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IACnC3D,cAAc,EAAEA,cAAe;IAC/B6D,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAK;EAAE,GAE9BpB,KAAK,CAEb,CACa,CACA;AAE9B,CAAC;AAED/C,aAAa,CAACoE,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAE7BrE,aAAa;AAAAsE,OAAA,CAAA1F,OAAA,GAAAyF,QAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MentionFinderProps } from './MentionFinder';
|
|
2
|
+
export declare const StyledMentionFinder: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const StyledMotionMentionFinderPopup: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, Pick<MentionFinderProps, "popupAlignment"> & {
|
|
4
|
+
theme: import("../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
5
|
+
}, never>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledMotionMentionFinderPopup = exports.StyledMentionFinder = void 0;
|
|
7
|
+
var _framerMotion = require("framer-motion");
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
var _alignment = require("./constants/alignment");
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
const StyledMentionFinder = _styledComponents.default.div`
|
|
13
|
+
position: relative;
|
|
14
|
+
`;
|
|
15
|
+
exports.StyledMentionFinder = StyledMentionFinder;
|
|
16
|
+
const StyledMotionMentionFinderPopup = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
17
|
+
background-color: ${_ref => {
|
|
18
|
+
let {
|
|
19
|
+
theme
|
|
20
|
+
} = _ref;
|
|
21
|
+
return theme['001'];
|
|
22
|
+
}};
|
|
23
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
24
|
+
border-radius: 3px;
|
|
25
|
+
box-shadow: 1px 3px 8px rgba(0, 0, 0, 0.1);
|
|
26
|
+
left: 0;
|
|
27
|
+
max-height: 300px;
|
|
28
|
+
overflow-y: scroll;
|
|
29
|
+
position: absolute;
|
|
30
|
+
width: 100%;
|
|
31
|
+
|
|
32
|
+
${_ref2 => {
|
|
33
|
+
let {
|
|
34
|
+
popupAlignment
|
|
35
|
+
} = _ref2;
|
|
36
|
+
switch (popupAlignment) {
|
|
37
|
+
case _alignment.MentionFinderPopupAlignment.Bottom:
|
|
38
|
+
return (0, _styledComponents.css)`
|
|
39
|
+
top: 0;
|
|
40
|
+
`;
|
|
41
|
+
case _alignment.MentionFinderPopupAlignment.Top:
|
|
42
|
+
return (0, _styledComponents.css)`
|
|
43
|
+
bottom: 0;
|
|
44
|
+
`;
|
|
45
|
+
default:
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}}
|
|
49
|
+
|
|
50
|
+
// Styles for custom scrollbar
|
|
51
|
+
::-webkit-scrollbar {
|
|
52
|
+
width: 5px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
::-webkit-scrollbar-track {
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::-webkit-scrollbar-button {
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
height: 5px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
::-webkit-scrollbar-thumb {
|
|
65
|
+
background-color: rgba(
|
|
66
|
+
${_ref3 => {
|
|
67
|
+
let {
|
|
68
|
+
theme
|
|
69
|
+
} = _ref3;
|
|
70
|
+
return theme['text-rgb'];
|
|
71
|
+
}},
|
|
72
|
+
0.15
|
|
73
|
+
);
|
|
74
|
+
border-radius: 20px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Scrollbar styles for Firefox. The above styles are not supported in Firefox, these styles are
|
|
78
|
+
// only supported in Firefox:
|
|
79
|
+
* {
|
|
80
|
+
scrollbar-color: rgba(
|
|
81
|
+
${_ref4 => {
|
|
82
|
+
let {
|
|
83
|
+
theme
|
|
84
|
+
} = _ref4;
|
|
85
|
+
return theme['text-rgb'];
|
|
86
|
+
}},
|
|
87
|
+
0.15
|
|
88
|
+
)
|
|
89
|
+
transparent;
|
|
90
|
+
scrollbar-width: thin;
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
exports.StyledMotionMentionFinderPopup = StyledMotionMentionFinderPopup;
|
|
94
|
+
//# sourceMappingURL=MentionFinder.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionFinder.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_alignment","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledMentionFinder","styled","div","exports","StyledMotionMentionFinderPopup","motion","_ref","theme","_ref2","popupAlignment","MentionFinderPopupAlignment","Bottom","css","Top","undefined","_ref3","_ref4"],"sources":["../../../src/components/mention-finder/MentionFinder.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { MentionFinderPopupAlignment } from './constants/alignment';\nimport type { MentionFinderProps } from './MentionFinder';\n\nexport const StyledMentionFinder = styled.div`\n position: relative;\n`;\n\ntype StyledMentionFinderPopupProps = WithTheme<Pick<MentionFinderProps, 'popupAlignment'>>;\n\nexport const StyledMotionMentionFinderPopup = styled(motion.div)<StyledMentionFinderPopupProps>`\n background-color: ${({ theme }: StyledMentionFinderPopupProps) => theme['001']};\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n box-shadow: 1px 3px 8px rgba(0, 0, 0, 0.1);\n left: 0;\n max-height: 300px;\n overflow-y: scroll;\n position: absolute;\n width: 100%;\n\n ${({ popupAlignment }) => {\n switch (popupAlignment) {\n case MentionFinderPopupAlignment.Bottom:\n return css`\n top: 0;\n `;\n case MentionFinderPopupAlignment.Top:\n return css`\n bottom: 0;\n `;\n default:\n return undefined;\n }\n }}\n\n // Styles for custom scrollbar\n ::-webkit-scrollbar {\n width: 5px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n ::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: rgba(\n ${({ theme }: StyledMentionFinderPopupProps) => theme['text-rgb']},\n 0.15\n );\n border-radius: 20px;\n }\n\n // Scrollbar styles for Firefox. The above styles are not supported in Firefox, these styles are\n // only supported in Firefox:\n * {\n scrollbar-color: rgba(\n ${({ theme }: StyledMentionFinderPopupProps) => theme['text-rgb']},\n 0.15\n )\n transparent;\n scrollbar-width: thin;\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAAoE,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,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A;AACA;AACA;AACA;AACA;AACA,cAAcC,KAAA;EAAA,IAAC;IAAER;EAAqC,CAAC,GAAAQ,KAAA;EAAA,OAAKR,KAAK,CAAC,UAAU,CAAC;AAAA,CAAC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBS,KAAA;EAAA,IAAC;IAAET;EAAqC,CAAC,GAAAS,KAAA;EAAA,OAAKT,KAAK,CAAC,UAAU,CAAC;AAAA,CAAC;AAClF;AACA;AACA;AACA;AACA;AACA,CAAC;AAACJ,OAAA,CAAAC,8BAAA,GAAAA,8BAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MentionFinderPopupAlignment = void 0;
|
|
7
|
+
let MentionFinderPopupAlignment = /*#__PURE__*/function (MentionFinderPopupAlignment) {
|
|
8
|
+
MentionFinderPopupAlignment[MentionFinderPopupAlignment["Top"] = 0] = "Top";
|
|
9
|
+
MentionFinderPopupAlignment[MentionFinderPopupAlignment["Bottom"] = 1] = "Bottom";
|
|
10
|
+
return MentionFinderPopupAlignment;
|
|
11
|
+
}({});
|
|
12
|
+
exports.MentionFinderPopupAlignment = MentionFinderPopupAlignment;
|
|
13
|
+
//# sourceMappingURL=alignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alignment.js","names":["MentionFinderPopupAlignment","exports"],"sources":["../../../../src/components/mention-finder/constants/alignment.ts"],"sourcesContent":["export enum MentionFinderPopupAlignment {\n Top,\n Bottom,\n}\n"],"mappings":";;;;;;IAAYA,2BAA2B,0BAA3BA,2BAA2B;EAA3BA,2BAA2B,CAA3BA,2BAA2B;EAA3BA,2BAA2B,CAA3BA,2BAA2B;EAAA,OAA3BA,2BAA2B;AAAA;AAAAC,OAAA,CAAAD,2BAAA,GAAAA,2BAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { MentionMember } from '../MentionFinder';
|
|
3
|
+
export type MentionFinderItemProps = {
|
|
4
|
+
isActive: boolean;
|
|
5
|
+
member: MentionMember;
|
|
6
|
+
onClick: (member: MentionMember) => void;
|
|
7
|
+
onHover: (member: MentionMember) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const MentionFinderItem: FC<MentionFinderItemProps>;
|
|
10
|
+
export default MentionFinderItem;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _MentionFinderItem = require("./MentionFinderItem.styles");
|
|
9
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
const MentionFinderItem = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
isActive,
|
|
14
|
+
member,
|
|
15
|
+
onClick,
|
|
16
|
+
onHover
|
|
17
|
+
} = _ref;
|
|
18
|
+
const handleItemClick = (0, _react.useCallback)(() => onClick(member), [member, onClick]);
|
|
19
|
+
const handleItemMouseEnter = (0, _react.useCallback)(() => onHover(member), [member, onHover]);
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_MentionFinderItem.StyledMentionFinderItem, {
|
|
21
|
+
className: "prevent-lose-focus",
|
|
22
|
+
isActive: isActive,
|
|
23
|
+
onClick: handleItemClick,
|
|
24
|
+
onMouseEnter: handleItemMouseEnter
|
|
25
|
+
}, /*#__PURE__*/_react.default.createElement(_MentionFinderItem.StyledMentionFinderItemImage, {
|
|
26
|
+
src: member.imageUrl
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement(_MentionFinderItem.StyledMentionFinderItemContent, null, /*#__PURE__*/_react.default.createElement(_MentionFinderItem.StyledMentionFinderItemContentName, null, member.name), /*#__PURE__*/_react.default.createElement(_MentionFinderItem.StyledMentionFinderItemContentInfo, null, member.info)));
|
|
28
|
+
};
|
|
29
|
+
MentionFinderItem.displayName = 'MentionFinderItem';
|
|
30
|
+
var _default = MentionFinderItem;
|
|
31
|
+
exports.default = _default;
|
|
32
|
+
//# sourceMappingURL=MentionFinderItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionFinderItem.js","names":["_react","_interopRequireWildcard","require","_MentionFinderItem","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","MentionFinderItem","_ref","isActive","member","onClick","onHover","handleItemClick","useCallback","handleItemMouseEnter","createElement","StyledMentionFinderItem","className","onMouseEnter","StyledMentionFinderItemImage","src","imageUrl","StyledMentionFinderItemContent","StyledMentionFinderItemContentName","name","StyledMentionFinderItemContentInfo","info","displayName","_default","exports"],"sources":["../../../../src/components/mention-finder/mention-finder-item/MentionFinderItem.tsx"],"sourcesContent":["import React, { FC, useCallback } from 'react';\nimport type { MentionMember } from '../MentionFinder';\nimport {\n StyledMentionFinderItem,\n StyledMentionFinderItemContent,\n StyledMentionFinderItemContentInfo,\n StyledMentionFinderItemContentName,\n StyledMentionFinderItemImage,\n} from './MentionFinderItem.styles';\n\nexport type MentionFinderItemProps = {\n isActive: boolean;\n member: MentionMember;\n onClick: (member: MentionMember) => void;\n onHover: (member: MentionMember) => void;\n};\n\nconst MentionFinderItem: FC<MentionFinderItemProps> = ({ isActive, member, onClick, onHover }) => {\n const handleItemClick = useCallback(() => onClick(member), [member, onClick]);\n\n const handleItemMouseEnter = useCallback(() => onHover(member), [member, onHover]);\n\n return (\n <StyledMentionFinderItem\n className=\"prevent-lose-focus\"\n isActive={isActive}\n onClick={handleItemClick}\n onMouseEnter={handleItemMouseEnter}\n >\n <StyledMentionFinderItemImage src={member.imageUrl} />\n <StyledMentionFinderItemContent>\n <StyledMentionFinderItemContentName>\n {member.name}\n </StyledMentionFinderItemContentName>\n <StyledMentionFinderItemContentInfo>\n {member.info}\n </StyledMentionFinderItemContentInfo>\n </StyledMentionFinderItemContent>\n </StyledMentionFinderItem>\n );\n};\n\nMentionFinderItem.displayName = 'MentionFinderItem';\n\nexport default MentionFinderItem;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,kBAAA,GAAAD,OAAA;AAMoC,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QA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AAAiC,uBAAuB;IACpBC,SAAS,EAAC,oBAAoB;IAC9BT,QAAQ,EAAEA,QAAS;IACnBE,OAAO,EAAEE,eAAgB;IACzBM,YAAY,EAAEJ;EAAqB,gBAEnClC,MAAA,CAAAW,OAAA,CAAAwB,aAAA,CAAChC,kBAAA,CAAAoC,4BAA4B;IAACC,GAAG,EAAEX,MAAM,CAACY;EAAS,EAAG,eACtDzC,MAAA,CAAAW,OAAA,CAAAwB,aAAA,CAAChC,kBAAA,CAAAuC,8BAA8B,qBAC3B1C,MAAA,CAAAW,OAAA,CAAAwB,aAAA,CAAChC,kBAAA,CAAAwC,kCAAkC,QAC9Bd,MAAM,CAACe,IAAI,CACqB,eACrC5C,MAAA,CAAAW,OAAA,CAAAwB,aAAA,CAAChC,kBAAA,CAAA0C,kCAAkC,QAC9BhB,MAAM,CAACiB,IAAI,CACqB,CACR,CACX;AAElC,CAAC;AAEDpB,iBAAiB,CAACqB,WAAW,GAAG,mBAAmB;AAAC,IAAAC,QAAA,GAErCtB,iBAAiB;AAAAuB,OAAA,CAAAtC,OAAA,GAAAqC,QAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MentionFinderItemProps } from './MentionFinderItem';
|
|
2
|
+
export declare const StyledMentionFinderItem: import("styled-components").StyledComponent<"div", any, Pick<MentionFinderItemProps, "isActive"> & {
|
|
3
|
+
theme: import("../../color-scheme-provider/ColorSchemeProvider").Theme;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const StyledMentionFinderItemImage: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
6
|
+
export declare const StyledMentionFinderItemContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const StyledMentionFinderItemContentName: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
+
export declare const StyledMentionFinderItemContentInfo: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledMentionFinderItemImage = exports.StyledMentionFinderItemContentName = exports.StyledMentionFinderItemContentInfo = exports.StyledMentionFinderItemContent = exports.StyledMentionFinderItem = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
+
const StyledMentionFinderItem = _styledComponents.default.div`
|
|
11
|
+
align-items: center;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
display: flex;
|
|
14
|
+
height: 64px;
|
|
15
|
+
padding: 12px 9px;
|
|
16
|
+
|
|
17
|
+
:not(:last-child) {
|
|
18
|
+
border-bottom: 1px solid
|
|
19
|
+
rgba(${_ref => {
|
|
20
|
+
let {
|
|
21
|
+
theme
|
|
22
|
+
} = _ref;
|
|
23
|
+
return theme['text-rgb'];
|
|
24
|
+
}}, 0.15);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:nth-child(even) {
|
|
28
|
+
background-color: ${_ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
theme
|
|
31
|
+
} = _ref2;
|
|
32
|
+
return theme['002'];
|
|
33
|
+
}};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${_ref3 => {
|
|
37
|
+
let {
|
|
38
|
+
isActive
|
|
39
|
+
} = _ref3;
|
|
40
|
+
return isActive && (0, _styledComponents.css)`
|
|
41
|
+
background-color: ${_ref4 => {
|
|
42
|
+
let {
|
|
43
|
+
theme
|
|
44
|
+
} = _ref4;
|
|
45
|
+
return theme['102'];
|
|
46
|
+
}} !important;
|
|
47
|
+
`;
|
|
48
|
+
}}
|
|
49
|
+
`;
|
|
50
|
+
exports.StyledMentionFinderItem = StyledMentionFinderItem;
|
|
51
|
+
const StyledMentionFinderItemImage = _styledComponents.default.img`
|
|
52
|
+
background-color: rgba(
|
|
53
|
+
${_ref5 => {
|
|
54
|
+
let {
|
|
55
|
+
theme
|
|
56
|
+
} = _ref5;
|
|
57
|
+
return theme['text-rgb'];
|
|
58
|
+
}},
|
|
59
|
+
0.1
|
|
60
|
+
);
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
box-shadow: 0 0 0 1px
|
|
63
|
+
rgba(${_ref6 => {
|
|
64
|
+
let {
|
|
65
|
+
theme
|
|
66
|
+
} = _ref6;
|
|
67
|
+
return theme['009-rgb'];
|
|
68
|
+
}}, 0.08) inset;
|
|
69
|
+
flex: 0 0 auto;
|
|
70
|
+
height: 40px;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
transition: border-radius 0.3s ease;
|
|
73
|
+
width: 40px;
|
|
74
|
+
`;
|
|
75
|
+
exports.StyledMentionFinderItemImage = StyledMentionFinderItemImage;
|
|
76
|
+
const StyledMentionFinderItemContent = _styledComponents.default.div`
|
|
77
|
+
color: ${_ref7 => {
|
|
78
|
+
let {
|
|
79
|
+
theme
|
|
80
|
+
} = _ref7;
|
|
81
|
+
return theme.text;
|
|
82
|
+
}};
|
|
83
|
+
display: flex;
|
|
84
|
+
flex: 1 1 auto;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
line-height: normal;
|
|
88
|
+
margin-left: 10px;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
`;
|
|
91
|
+
exports.StyledMentionFinderItemContent = StyledMentionFinderItemContent;
|
|
92
|
+
const StyledMentionFinderItemContentName = _styledComponents.default.div``;
|
|
93
|
+
exports.StyledMentionFinderItemContentName = StyledMentionFinderItemContentName;
|
|
94
|
+
const StyledMentionFinderItemContentInfo = _styledComponents.default.div`
|
|
95
|
+
font-size: 85%;
|
|
96
|
+
margin-top: 2px;
|
|
97
|
+
opacity: 0.75;
|
|
98
|
+
`;
|
|
99
|
+
exports.StyledMentionFinderItemContentInfo = StyledMentionFinderItemContentInfo;
|
|
100
|
+
//# sourceMappingURL=MentionFinderItem.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionFinderItem.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledMentionFinderItem","styled","div","_ref","theme","_ref2","_ref3","isActive","css","_ref4","exports","StyledMentionFinderItemImage","img","_ref5","_ref6","StyledMentionFinderItemContent","_ref7","text","StyledMentionFinderItemContentName","StyledMentionFinderItemContentInfo"],"sources":["../../../../src/components/mention-finder/mention-finder-item/MentionFinderItem.styles.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\nimport type { MentionFinderItemProps } from './MentionFinderItem';\n\ntype StyledMentionFinderItemProps = WithTheme<Pick<MentionFinderItemProps, 'isActive'>>;\n\nexport const StyledMentionFinderItem = styled.div<StyledMentionFinderItemProps>`\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 64px;\n padding: 12px 9px;\n\n :not(:last-child) {\n border-bottom: 1px solid\n rgba(${({ theme }: StyledMentionFinderItemProps) => theme['text-rgb']}, 0.15);\n }\n\n :nth-child(even) {\n background-color: ${({ theme }: StyledMentionFinderItemProps) => theme['002']};\n }\n\n ${({ isActive }) =>\n isActive &&\n css`\n background-color: ${({ theme }: StyledMentionFinderItemProps) =>\n theme['102']} !important;\n `}\n`;\n\ntype StyledMentionFinderItemImageProps = WithTheme<unknown>;\n\nexport const StyledMentionFinderItemImage = styled.img`\n background-color: rgba(\n ${({ theme }: StyledMentionFinderItemImageProps) => theme['text-rgb']},\n 0.1\n );\n border-radius: 50%;\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMentionFinderItemImageProps) => theme['009-rgb']}, 0.08) inset;\n flex: 0 0 auto;\n height: 40px;\n overflow: hidden;\n transition: border-radius 0.3s ease;\n width: 40px;\n`;\n\ntype StyledMentionFinderItemContentProps = WithTheme<unknown>;\n\nexport const StyledMentionFinderItemContent = styled.div`\n color: ${({ theme }: StyledMentionFinderItemContentProps) => theme.text};\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n justify-content: center;\n line-height: normal;\n margin-left: 10px;\n min-width: 0;\n`;\n\nexport const StyledMentionFinderItemContentName = styled.div``;\n\nexport const StyledMentionFinderItemContentInfo = styled.div`\n font-size: 85%;\n margin-top: 2px;\n opacity: 0.75;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IA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|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _uuid = require("uuid");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
|
|
18
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
19
|
-
|
|
20
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
21
|
-
|
|
22
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23
|
-
|
|
24
|
-
var useUuid = function useUuid() {
|
|
25
|
-
var _useState = (0, _react.useState)((0, _uuid.v4)()),
|
|
26
|
-
_useState2 = _slicedToArray(_useState, 1),
|
|
27
|
-
uuid = _useState2[0];
|
|
28
|
-
|
|
9
|
+
const useUuid = () => {
|
|
10
|
+
const [uuid] = (0, _react.useState)((0, _uuid.v4)());
|
|
29
11
|
return uuid;
|
|
30
12
|
};
|
|
31
|
-
|
|
32
13
|
exports.useUuid = useUuid;
|
|
33
14
|
//# sourceMappingURL=uuid.js.map
|
package/lib/hooks/uuid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"uuid.js","names":["_react","require","_uuid","useUuid","uuid","useState","uuidV4","exports"],"sources":["../../src/hooks/uuid.ts"],"sourcesContent":["import { useState } from 'react';\nimport { v4 as uuidV4 } from 'uuid';\n\nexport const useUuid = () => {\n const [uuid] = useState(uuidV4());\n\n return uuid;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,OAAO,GAAGA,CAAA,KAAM;EACzB,MAAM,CAACC,IAAI,CAAC,GAAG,IAAAC,eAAQ,EAAC,IAAAC,QAAM,GAAE,CAAC;EAEjC,OAAOF,IAAI;AACf,CAAC;AAACG,OAAA,CAAAJ,OAAA,GAAAA,OAAA"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
export { default as Accordion } from './components/accordion/Accordion';
|
|
2
2
|
export { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';
|
|
3
3
|
export { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';
|
|
4
|
+
export { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';
|
|
4
5
|
export { default as Badge } from './components/badge/Badge';
|
|
5
6
|
export { default as Button } from './components/button/Button';
|
|
7
|
+
export { default as Checkbox } from './components/checkbox/Checkbox';
|
|
6
8
|
export { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';
|
|
9
|
+
export type { WithTheme } from './components/color-scheme-provider/ColorSchemeProvider';
|
|
10
|
+
export { default as ContextMenu } from './components/context-menu/ContextMenu';
|
|
7
11
|
export { default as GridImage } from './components/grid-image/GridImage';
|
|
8
12
|
export { default as Icon } from './components/icon/Icon';
|
|
13
|
+
export { default as Input } from './components/input/Input';
|
|
9
14
|
export { default as List } from './components/list/List';
|
|
10
15
|
export { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';
|
|
11
16
|
export { default as ListItem } from './components/list/list-item/ListItem';
|
|
17
|
+
export { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';
|
|
18
|
+
export { default as MentionFinder } from './components/mention-finder/MentionFinder';
|
|
19
|
+
export type { MentionMember } from './components/mention-finder/MentionFinder';
|
package/lib/index.js
CHANGED
|
@@ -5,92 +5,122 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "Accordion", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _Accordion.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "AccordionContent", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _AccordionContent.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "AccordionGroup", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _AccordionGroup.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "AccordionIntro", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _AccordionIntro.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "Badge", {
|
|
25
31
|
enumerable: true,
|
|
26
|
-
get: function
|
|
32
|
+
get: function () {
|
|
27
33
|
return _Badge.default;
|
|
28
34
|
}
|
|
29
35
|
});
|
|
30
36
|
Object.defineProperty(exports, "Button", {
|
|
31
37
|
enumerable: true,
|
|
32
|
-
get: function
|
|
38
|
+
get: function () {
|
|
33
39
|
return _Button.default;
|
|
34
40
|
}
|
|
35
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "Checkbox", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _Checkbox.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
36
48
|
Object.defineProperty(exports, "ColorSchemeProvider", {
|
|
37
49
|
enumerable: true,
|
|
38
|
-
get: function
|
|
50
|
+
get: function () {
|
|
39
51
|
return _ColorSchemeProvider.default;
|
|
40
52
|
}
|
|
41
53
|
});
|
|
54
|
+
Object.defineProperty(exports, "ContextMenu", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _ContextMenu.default;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
42
60
|
Object.defineProperty(exports, "GridImage", {
|
|
43
61
|
enumerable: true,
|
|
44
|
-
get: function
|
|
62
|
+
get: function () {
|
|
45
63
|
return _GridImage.default;
|
|
46
64
|
}
|
|
47
65
|
});
|
|
48
66
|
Object.defineProperty(exports, "Icon", {
|
|
49
67
|
enumerable: true,
|
|
50
|
-
get: function
|
|
68
|
+
get: function () {
|
|
51
69
|
return _Icon.default;
|
|
52
70
|
}
|
|
53
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "Input", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _Input.default;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
54
78
|
Object.defineProperty(exports, "List", {
|
|
55
79
|
enumerable: true,
|
|
56
|
-
get: function
|
|
80
|
+
get: function () {
|
|
57
81
|
return _List.default;
|
|
58
82
|
}
|
|
59
83
|
});
|
|
84
|
+
Object.defineProperty(exports, "ListItem", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _ListItem.default;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
60
90
|
Object.defineProperty(exports, "ListItemContent", {
|
|
61
91
|
enumerable: true,
|
|
62
|
-
get: function
|
|
92
|
+
get: function () {
|
|
63
93
|
return _ListItemContent.default;
|
|
64
94
|
}
|
|
65
95
|
});
|
|
66
|
-
Object.defineProperty(exports, "
|
|
96
|
+
Object.defineProperty(exports, "MentionFinder", {
|
|
67
97
|
enumerable: true,
|
|
68
|
-
get: function
|
|
69
|
-
return
|
|
98
|
+
get: function () {
|
|
99
|
+
return _MentionFinder.default;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "MentionFinderPopupAlignment", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _alignment.MentionFinderPopupAlignment;
|
|
70
106
|
}
|
|
71
107
|
});
|
|
72
|
-
|
|
73
108
|
var _Accordion = _interopRequireDefault(require("./components/accordion/Accordion"));
|
|
74
|
-
|
|
75
109
|
var _AccordionContent = _interopRequireDefault(require("./components/accordion/accordion-content/AccordionContent"));
|
|
76
|
-
|
|
77
110
|
var _AccordionGroup = _interopRequireDefault(require("./components/accordion/accordion-group/AccordionGroup"));
|
|
78
|
-
|
|
111
|
+
var _AccordionIntro = _interopRequireDefault(require("./components/accordion/accordion-intro/AccordionIntro"));
|
|
79
112
|
var _Badge = _interopRequireDefault(require("./components/badge/Badge"));
|
|
80
|
-
|
|
81
113
|
var _Button = _interopRequireDefault(require("./components/button/Button"));
|
|
82
|
-
|
|
114
|
+
var _Checkbox = _interopRequireDefault(require("./components/checkbox/Checkbox"));
|
|
83
115
|
var _ColorSchemeProvider = _interopRequireDefault(require("./components/color-scheme-provider/ColorSchemeProvider"));
|
|
84
|
-
|
|
116
|
+
var _ContextMenu = _interopRequireDefault(require("./components/context-menu/ContextMenu"));
|
|
85
117
|
var _GridImage = _interopRequireDefault(require("./components/grid-image/GridImage"));
|
|
86
|
-
|
|
87
118
|
var _Icon = _interopRequireDefault(require("./components/icon/Icon"));
|
|
88
|
-
|
|
119
|
+
var _Input = _interopRequireDefault(require("./components/input/Input"));
|
|
89
120
|
var _List = _interopRequireDefault(require("./components/list/List"));
|
|
90
|
-
|
|
91
121
|
var _ListItemContent = _interopRequireDefault(require("./components/list/list-item/list-item-content/ListItemContent"));
|
|
92
|
-
|
|
93
122
|
var _ListItem = _interopRequireDefault(require("./components/list/list-item/ListItem"));
|
|
94
|
-
|
|
123
|
+
var _alignment = require("./components/mention-finder/constants/alignment");
|
|
124
|
+
var _MentionFinder = _interopRequireDefault(require("./components/mention-finder/MentionFinder"));
|
|
95
125
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
96
126
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ContextMenu","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_alignment","_MentionFinder","obj","__esModule","default"],"sources":["../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type { WithTheme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem } from './components/list/list-item/ListItem';\nexport { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,UAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,KAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,MAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,SAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,cAAA,GAAAjB,sBAAA,CAAAC,OAAA;AAAqF,SAAAD,uBAAAkB,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
let chayns: Chayns;
|
|
3
|
+
}
|
|
4
|
+
export interface Chayns {
|
|
5
|
+
dialog: Dialog;
|
|
6
|
+
env: Env;
|
|
7
|
+
openImage(urls: string | string[], start?: number): Promise<undefined>;
|
|
8
|
+
openVideo(url: string): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface Dialog {
|
|
11
|
+
select(config: {
|
|
12
|
+
title?: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
list: Array<SelectDialogItem>;
|
|
15
|
+
multiselect?: boolean;
|
|
16
|
+
type?: SelectType;
|
|
17
|
+
preventCloseOnClick?: boolean;
|
|
18
|
+
buttons?: DialogButton[];
|
|
19
|
+
selectAllButton?: string;
|
|
20
|
+
}): Promise<SelectDialogResult>;
|
|
21
|
+
}
|
|
22
|
+
declare enum ButtonText {
|
|
23
|
+
Cancel = "Abbrechen",
|
|
24
|
+
No = "Nein",
|
|
25
|
+
Ok = "OK",
|
|
26
|
+
Yes = "Ja"
|
|
27
|
+
}
|
|
28
|
+
export declare enum ButtonType {
|
|
29
|
+
Cancel = -1,
|
|
30
|
+
Negative = 0,
|
|
31
|
+
Positive = 1
|
|
32
|
+
}
|
|
33
|
+
export interface DialogButton {
|
|
34
|
+
text: ButtonText | string;
|
|
35
|
+
buttonType: ButtonType | number;
|
|
36
|
+
collapseTime?: number;
|
|
37
|
+
textColor?: string;
|
|
38
|
+
backgroundColor?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SelectDialogItem {
|
|
41
|
+
name: string;
|
|
42
|
+
value: string | number;
|
|
43
|
+
isSelected?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface SelectDialogResult {
|
|
46
|
+
buttonType: ButtonType | number;
|
|
47
|
+
selection: Array<SelectDialogItem>;
|
|
48
|
+
}
|
|
49
|
+
declare enum SelectType {
|
|
50
|
+
Default = 0,
|
|
51
|
+
Icon = 1,
|
|
52
|
+
IconAndText
|
|
53
|
+
}
|
|
54
|
+
export interface Env {
|
|
55
|
+
isApp: boolean;
|
|
56
|
+
isMobile: boolean;
|
|
57
|
+
isTablet: boolean;
|
|
58
|
+
}
|
|
59
|
+
export {};
|