@activecollab/components 2.0.278 → 2.0.280
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/dist/cjs/components/ConfirmDialog/ConfirmDialog.js +2 -5
- package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.js +2 -6
- package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/Dialog/Styles.js +3 -5
- package/dist/cjs/components/Dialog/Styles.js.map +1 -1
- package/dist/cjs/components/Filter/Filter.js +45 -6
- package/dist/cjs/components/Filter/Filter.js.map +1 -1
- package/dist/cjs/components/Filter/InputSubmenu.js +59 -0
- package/dist/cjs/components/Filter/InputSubmenu.js.map +1 -0
- package/dist/cjs/components/Filter/StartMenu.js +3 -2
- package/dist/cjs/components/Filter/StartMenu.js.map +1 -1
- package/dist/cjs/components/Filter/Styles.js +28 -1
- package/dist/cjs/components/Filter/Styles.js.map +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts +0 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js +2 -4
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.d.ts +0 -1
- package/dist/esm/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +3 -6
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/Styles.d.ts +1 -3
- package/dist/esm/components/Dialog/Styles.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Styles.js +2 -2
- package/dist/esm/components/Dialog/Styles.js.map +1 -1
- package/dist/esm/components/Filter/Filter.d.ts +8 -0
- package/dist/esm/components/Filter/Filter.d.ts.map +1 -1
- package/dist/esm/components/Filter/Filter.js +40 -7
- package/dist/esm/components/Filter/Filter.js.map +1 -1
- package/dist/esm/components/Filter/InputSubmenu.d.ts +12 -0
- package/dist/esm/components/Filter/InputSubmenu.d.ts.map +1 -0
- package/dist/esm/components/Filter/InputSubmenu.js +43 -0
- package/dist/esm/components/Filter/InputSubmenu.js.map +1 -0
- package/dist/esm/components/Filter/StartMenu.js +3 -2
- package/dist/esm/components/Filter/StartMenu.js.map +1 -1
- package/dist/esm/components/Filter/Styles.d.ts +3 -0
- package/dist/esm/components/Filter/Styles.d.ts.map +1 -1
- package/dist/esm/components/Filter/Styles.js +27 -0
- package/dist/esm/components/Filter/Styles.js.map +1 -1
- package/dist/index.js +135 -36
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartMenu.js","names":["React","useRef","useEffect","StyledStartMenuTitle","StyledStartMenuListItem","StyledStartMenuList","StyledStartMenuNoResults","useResizeObserver","Badge","ArrowRightIcon","StartMenu","_ref","data","selected","onItemClick","style","onHeightChange","shouldRenderSubmenus","emptyFilterText","children","ref","dimensions","height","createElement","map","_ref2","index","id","title","submenu","count","_selected$id","length","key","onClick","dimension","value","isStandalone"],"sources":["../../../../src/components/Filter/StartMenu.tsx"],"sourcesContent":["import React, { FC, useRef, useEffect, HTMLAttributes } from \"react\";\n\nimport { DataType, SelectedType } from \"./Filter\";\nimport {\n StyledStartMenuTitle,\n StyledStartMenuListItem,\n StyledStartMenuList,\n StyledStartMenuNoResults,\n} from \"./Styles\";\nimport { useResizeObserver } from \"../../utils\";\nimport { Badge } from \"../Badge\";\nimport { ArrowRightIcon } from \"../Icons\";\n\nexport interface StartMenuProps {\n data: Array<DataType>;\n selected: SelectedType;\n onItemClick: (id: number | string) => void;\n onHeightChange: (height: number) => void;\n shouldRenderSubmenus: boolean;\n emptyFilterText?: string;\n}\n\nexport const StartMenu: FC<StartMenuProps & HTMLAttributes<HTMLDivElement>> = ({\n data,\n selected,\n onItemClick,\n style,\n onHeightChange,\n shouldRenderSubmenus,\n emptyFilterText,\n children,\n}) => {\n const ref = useRef(null);\n const dimensions = useResizeObserver(ref);\n const height = dimensions?.height;\n\n useEffect(() => {\n if (height && height > 0) {\n onHeightChange(height);\n }\n }, [height, onHeightChange]);\n\n return (\n <div style={style} ref={ref}>\n <StyledStartMenuList>\n {shouldRenderSubmenus ? (\n data.map(({ id, title, submenu }, index: number) => {\n let count = 0;\n // Popricati o ovome kada je selected[id] vrednost 0.\n if (typeof selected[id] === \"string\") {\n count += 1;\n } else {\n count = selected[id]?.length;\n }\n\n if (submenu?.length > 1) {\n return (\n <StyledStartMenuListItem\n key={`filter-list-item-${index}`}\n onClick={() => onItemClick(id)}\n >\n <StyledStartMenuTitle>{title}</StyledStartMenuTitle>\n {count > 0 ? (\n <Badge dimension={16} value={count} isStandalone={true} />\n ) : null}\n <ArrowRightIcon />\n </StyledStartMenuListItem>\n );\n }\n })\n ) : emptyFilterText ? (\n <StyledStartMenuNoResults>{emptyFilterText}</StyledStartMenuNoResults>\n ) : null}\n {children}\n </StyledStartMenuList>\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,MAAM,EAAEC,SAAS,QAAwB,OAAO;AAGpE,SACEC,oBAAoB,EACpBC,uBAAuB,EACvBC,mBAAmB,EACnBC,wBAAwB,QACnB,UAAU;AACjB,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,cAAc,QAAQ,UAAU;AAWzC,OAAO,MAAMC,SAA8D,GAAGC,IAAA,IASxE;EAAA,IATyE;IAC7EC,IAAI;IACJC,QAAQ;IACRC,WAAW;IACXC,KAAK;IACLC,cAAc;IACdC,oBAAoB;IACpBC,eAAe;IACfC;EACF,CAAC,GAAAR,IAAA;EACC,MAAMS,GAAG,GAAGnB,MAAM,CAAC,IAAI,CAAC;EACxB,MAAMoB,UAAU,GAAGd,iBAAiB,CAACa,GAAG,CAAC;EACzC,MAAME,MAAM,GAAGD,UAAU,oBAAVA,UAAU,CAAEC,MAAM;EAEjCpB,SAAS,CAAC,MAAM;IACd,IAAIoB,MAAM,IAAIA,MAAM,GAAG,CAAC,EAAE;MACxBN,cAAc,CAACM,MAAM,CAAC;IACxB;EACF,CAAC,EAAE,CAACA,MAAM,EAAEN,cAAc,CAAC,CAAC;EAE5B,oBACEhB,KAAA,CAAAuB,aAAA;IAAKR,KAAK,EAAEA,KAAM;IAACK,GAAG,EAAEA;EAAI,gBAC1BpB,KAAA,CAAAuB,aAAA,CAAClB,mBAAmB,QACjBY,oBAAoB,GACnBL,IAAI,CAACY,GAAG,CAAC,CAAAC,KAAA,
|
|
1
|
+
{"version":3,"file":"StartMenu.js","names":["React","useRef","useEffect","StyledStartMenuTitle","StyledStartMenuListItem","StyledStartMenuList","StyledStartMenuNoResults","useResizeObserver","Badge","ArrowRightIcon","StartMenu","_ref","data","selected","onItemClick","style","onHeightChange","shouldRenderSubmenus","emptyFilterText","children","ref","dimensions","height","createElement","map","_ref2","index","id","title","submenu","type","count","_selected$id","length","key","onClick","dimension","value","isStandalone"],"sources":["../../../../src/components/Filter/StartMenu.tsx"],"sourcesContent":["import React, { FC, useRef, useEffect, HTMLAttributes } from \"react\";\n\nimport { DataType, SelectedType } from \"./Filter\";\nimport {\n StyledStartMenuTitle,\n StyledStartMenuListItem,\n StyledStartMenuList,\n StyledStartMenuNoResults,\n} from \"./Styles\";\nimport { useResizeObserver } from \"../../utils\";\nimport { Badge } from \"../Badge\";\nimport { ArrowRightIcon } from \"../Icons\";\n\nexport interface StartMenuProps {\n data: Array<DataType>;\n selected: SelectedType;\n onItemClick: (id: number | string) => void;\n onHeightChange: (height: number) => void;\n shouldRenderSubmenus: boolean;\n emptyFilterText?: string;\n}\n\nexport const StartMenu: FC<StartMenuProps & HTMLAttributes<HTMLDivElement>> = ({\n data,\n selected,\n onItemClick,\n style,\n onHeightChange,\n shouldRenderSubmenus,\n emptyFilterText,\n children,\n}) => {\n const ref = useRef(null);\n const dimensions = useResizeObserver(ref);\n const height = dimensions?.height;\n\n useEffect(() => {\n if (height && height > 0) {\n onHeightChange(height);\n }\n }, [height, onHeightChange]);\n\n return (\n <div style={style} ref={ref}>\n <StyledStartMenuList>\n {shouldRenderSubmenus ? (\n data.map(({ id, title, submenu, type }, index: number) => {\n let count = 0;\n // Popricati o ovome kada je selected[id] vrednost 0.\n if (typeof selected[id] === \"string\") {\n count += 1;\n } else {\n count = selected[id]?.length;\n }\n\n if (type === \"input\" || submenu?.length > 1) {\n return (\n <StyledStartMenuListItem\n key={`filter-list-item-${index}`}\n onClick={() => onItemClick(id)}\n >\n <StyledStartMenuTitle>{title}</StyledStartMenuTitle>\n {count > 0 ? (\n <Badge dimension={16} value={count} isStandalone={true} />\n ) : null}\n <ArrowRightIcon />\n </StyledStartMenuListItem>\n );\n }\n })\n ) : emptyFilterText ? (\n <StyledStartMenuNoResults>{emptyFilterText}</StyledStartMenuNoResults>\n ) : null}\n {children}\n </StyledStartMenuList>\n </div>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,MAAM,EAAEC,SAAS,QAAwB,OAAO;AAGpE,SACEC,oBAAoB,EACpBC,uBAAuB,EACvBC,mBAAmB,EACnBC,wBAAwB,QACnB,UAAU;AACjB,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,cAAc,QAAQ,UAAU;AAWzC,OAAO,MAAMC,SAA8D,GAAGC,IAAA,IASxE;EAAA,IATyE;IAC7EC,IAAI;IACJC,QAAQ;IACRC,WAAW;IACXC,KAAK;IACLC,cAAc;IACdC,oBAAoB;IACpBC,eAAe;IACfC;EACF,CAAC,GAAAR,IAAA;EACC,MAAMS,GAAG,GAAGnB,MAAM,CAAC,IAAI,CAAC;EACxB,MAAMoB,UAAU,GAAGd,iBAAiB,CAACa,GAAG,CAAC;EACzC,MAAME,MAAM,GAAGD,UAAU,oBAAVA,UAAU,CAAEC,MAAM;EAEjCpB,SAAS,CAAC,MAAM;IACd,IAAIoB,MAAM,IAAIA,MAAM,GAAG,CAAC,EAAE;MACxBN,cAAc,CAACM,MAAM,CAAC;IACxB;EACF,CAAC,EAAE,CAACA,MAAM,EAAEN,cAAc,CAAC,CAAC;EAE5B,oBACEhB,KAAA,CAAAuB,aAAA;IAAKR,KAAK,EAAEA,KAAM;IAACK,GAAG,EAAEA;EAAI,gBAC1BpB,KAAA,CAAAuB,aAAA,CAAClB,mBAAmB,QACjBY,oBAAoB,GACnBL,IAAI,CAACY,GAAG,CAAC,CAAAC,KAAA,EAA+BC,KAAa,KAAK;IAAA,IAAhD;MAAEC,EAAE;MAAEC,KAAK;MAAEC,OAAO;MAAEC;IAAK,CAAC,GAAAL,KAAA;IACpC,IAAIM,KAAK,GAAG,CAAC;IACb;IACA,IAAI,OAAOlB,QAAQ,CAACc,EAAE,CAAC,KAAK,QAAQ,EAAE;MACpCI,KAAK,IAAI,CAAC;IACZ,CAAC,MAAM;MAAA,IAAAC,YAAA;MACLD,KAAK,IAAAC,YAAA,GAAGnB,QAAQ,CAACc,EAAE,CAAC,qBAAZK,YAAA,CAAcC,MAAM;IAC9B;IAEA,IAAIH,IAAI,KAAK,OAAO,IAAI,CAAAD,OAAO,oBAAPA,OAAO,CAAEI,MAAM,IAAG,CAAC,EAAE;MAC3C,oBACEjC,KAAA,CAAAuB,aAAA,CAACnB,uBAAuB;QACtB8B,GAAG,wBAAsBR,KAAQ;QACjCS,OAAO,EAAEA,CAAA,KAAMrB,WAAW,CAACa,EAAE;MAAE,gBAE/B3B,KAAA,CAAAuB,aAAA,CAACpB,oBAAoB,QAAEyB,KAA4B,CAAC,EACnDG,KAAK,GAAG,CAAC,gBACR/B,KAAA,CAAAuB,aAAA,CAACf,KAAK;QAAC4B,SAAS,EAAE,EAAG;QAACC,KAAK,EAAEN,KAAM;QAACO,YAAY,EAAE;MAAK,CAAE,CAAC,GACxD,IAAI,eACRtC,KAAA,CAAAuB,aAAA,CAACd,cAAc,MAAE,CACM,CAAC;IAE9B;EACF,CAAC,CAAC,GACAS,eAAe,gBACjBlB,KAAA,CAAAuB,aAAA,CAACjB,wBAAwB,QAAEY,eAA0C,CAAC,GACpE,IAAI,EACPC,QACkB,CAClB,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -19,4 +19,7 @@ export declare const StyledStartMenuListItem: import("styled-components").Styled
|
|
|
19
19
|
export declare const StyledStartMenuTitle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
20
|
export declare const StyledStartMenuNoResults: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
21
21
|
export declare const StyledStartMenuDot: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
22
|
+
export declare const StyledInputSubmenu: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
|
+
export declare const StyledInputSubmenuFooter: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<IMenuFooter & import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>, any, IMenuFooter, never>;
|
|
24
|
+
export declare const StyledInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").InputProps & import("react").RefAttributes<HTMLInputElement>>, any, {}, never>;
|
|
22
25
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/Styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/Styles.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,SAAS,EAAQ,aAAa,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAQ,KAAK,EAAc,WAAW,EAAE,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,UAAU,2FAGtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+NAE5B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;yBAE/B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;6HAEnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oEAEhC,CAAC;AAEF,eAAO,MAAM,wBAAwB,oEAGpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,qEAU9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,oEAE9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,+NAGpC,CAAC;AAEF,eAAO,MAAM,WAAW,mLAEvB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
+
import { Input } from "../Input";
|
|
2
3
|
import { ListItem, List } from "../List";
|
|
3
4
|
import { Menu, MenuFooter } from "../Menu";
|
|
4
5
|
export const StyledMenu = styled(Menu).withConfig({
|
|
@@ -47,6 +48,29 @@ export const StyledStartMenuDot = styled.span.withConfig({
|
|
|
47
48
|
displayName: "Styles__StyledStartMenuDot",
|
|
48
49
|
componentId: "sc-lxuoiz-6"
|
|
49
50
|
})(["border-radius:50%;background-color:var(--color-primary);color:var(--page-paper-main);line-height:15px;width:15px;font-weight:bold;font-size:10px;text-align:center;margin-left:4px;"]);
|
|
51
|
+
export const StyledInputSubmenu = styled.div.withConfig({
|
|
52
|
+
displayName: "Styles__StyledInputSubmenu",
|
|
53
|
+
componentId: "sc-lxuoiz-7"
|
|
54
|
+
})(["", ""], {
|
|
55
|
+
"paddingLeft": "0.75rem",
|
|
56
|
+
"paddingRight": "0.75rem",
|
|
57
|
+
"paddingBottom": "0.5rem",
|
|
58
|
+
"paddingTop": "0.75rem"
|
|
59
|
+
});
|
|
60
|
+
export const StyledInputSubmenuFooter = styled(MenuFooter).withConfig({
|
|
61
|
+
displayName: "Styles__StyledInputSubmenuFooter",
|
|
62
|
+
componentId: "sc-lxuoiz-8"
|
|
63
|
+
})(["", " height:auto;"], {
|
|
64
|
+
"justifyContent": "space-between",
|
|
65
|
+
"paddingTop": "0.75rem"
|
|
66
|
+
});
|
|
67
|
+
export const StyledInput = styled(Input).withConfig({
|
|
68
|
+
displayName: "Styles__StyledInput",
|
|
69
|
+
componentId: "sc-lxuoiz-9"
|
|
70
|
+
})(["", ""], {
|
|
71
|
+
"marginBottom": "1.25rem",
|
|
72
|
+
"width": "100%"
|
|
73
|
+
});
|
|
50
74
|
StyledMenu.displayName = "StyledMenu";
|
|
51
75
|
StyledMenuFooter.displayName = "StyledMenuFooter";
|
|
52
76
|
StyledStartMenuList.displayName = "StyledStartMenuList";
|
|
@@ -54,4 +78,7 @@ StyledStartMenuListItem.displayName = "StyledStartMenuListItem";
|
|
|
54
78
|
StyledStartMenuTitle.displayName = "StyledStartMenuTitle";
|
|
55
79
|
StyledStartMenuDot.displayName = "StyledStartMenuDot";
|
|
56
80
|
StyledStartMenuNoResults.displayName = "StyledStartMenuNoResults";
|
|
81
|
+
StyledInputSubmenu.displayName = "StyledInputSubmenu";
|
|
82
|
+
StyledInputSubmenuFooter.displayName = "StyledInputSubmenuFooter";
|
|
83
|
+
StyledInput.displayName = "StyledInput";
|
|
57
84
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","ListItem","List","Menu","MenuFooter","StyledMenu","withConfig","displayName","componentId","StyledMenuFooter","StyledStartMenuList","StyledStartMenuListItem","StyledStartMenuTitle","div","StyledStartMenuNoResults","StyledStartMenuDot","span"],"sources":["../../../../src/components/Filter/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { ListItem, ListProps, List, ListItemProps } from \"../List\";\nimport { Menu, IMenu, MenuFooter, IMenuFooter } from \"../Menu\";\n\nexport const StyledMenu = styled(Menu)<IMenu>`\n ${tw`tw-relative`}\n ${tw`tw-overflow-hidden`}\n`;\n\nexport const StyledMenuFooter = styled(MenuFooter)<IMenuFooter>`\n ${tw`tw-justify-center`}\n`;\n\nexport const StyledStartMenuList = styled(List)<ListProps>`\n ${tw`tw-py-2`}\n`;\n\nexport const StyledStartMenuListItem = styled(ListItem)<ListItemProps>`\n ${tw`tw-pr-3`}\n`;\n\nexport const StyledStartMenuTitle = styled.div`\n ${tw`tw-flex-1`}\n`;\n\nexport const StyledStartMenuNoResults = styled.div`\n ${tw`tw-py-0.5`}\n ${tw`tw-text-center`}\n`;\n\nexport const StyledStartMenuDot = styled.span`\n border-radius: 50%;\n background-color: var(--color-primary);\n color: var(--page-paper-main);\n line-height: 15px;\n width: 15px;\n font-weight: bold;\n font-size: 10px;\n text-align: center;\n margin-left: 4px;\n`;\n\nStyledMenu.displayName = \"StyledMenu\";\nStyledMenuFooter.displayName = \"StyledMenuFooter\";\nStyledStartMenuList.displayName = \"StyledStartMenuList\";\nStyledStartMenuListItem.displayName = \"StyledStartMenuListItem\";\nStyledStartMenuTitle.displayName = \"StyledStartMenuTitle\";\nStyledStartMenuDot.displayName = \"StyledStartMenuDot\";\nStyledStartMenuNoResults.displayName = \"StyledStartMenuNoResults\";\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAGtC,SAASC,QAAQ,EAAaC,IAAI,QAAuB,SAAS;AAClE,SAASC,IAAI,EAASC,UAAU,QAAqB,SAAS;AAE9D,OAAO,MAAMC,UAAU,
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","Input","ListItem","List","Menu","MenuFooter","StyledMenu","withConfig","displayName","componentId","StyledMenuFooter","StyledStartMenuList","StyledStartMenuListItem","StyledStartMenuTitle","div","StyledStartMenuNoResults","StyledStartMenuDot","span","StyledInputSubmenu","StyledInputSubmenuFooter","StyledInput"],"sources":["../../../../src/components/Filter/Styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { Input } from \"../Input\";\nimport { ListItem, ListProps, List, ListItemProps } from \"../List\";\nimport { Menu, IMenu, MenuFooter, IMenuFooter } from \"../Menu\";\n\nexport const StyledMenu = styled(Menu)<IMenu>`\n ${tw`tw-relative`}\n ${tw`tw-overflow-hidden`}\n`;\n\nexport const StyledMenuFooter = styled(MenuFooter)<IMenuFooter>`\n ${tw`tw-justify-center`}\n`;\n\nexport const StyledStartMenuList = styled(List)<ListProps>`\n ${tw`tw-py-2`}\n`;\n\nexport const StyledStartMenuListItem = styled(ListItem)<ListItemProps>`\n ${tw`tw-pr-3`}\n`;\n\nexport const StyledStartMenuTitle = styled.div`\n ${tw`tw-flex-1`}\n`;\n\nexport const StyledStartMenuNoResults = styled.div`\n ${tw`tw-py-0.5`}\n ${tw`tw-text-center`}\n`;\n\nexport const StyledStartMenuDot = styled.span`\n border-radius: 50%;\n background-color: var(--color-primary);\n color: var(--page-paper-main);\n line-height: 15px;\n width: 15px;\n font-weight: bold;\n font-size: 10px;\n text-align: center;\n margin-left: 4px;\n`;\n\nexport const StyledInputSubmenu = styled.div`\n ${tw`tw-px-3 tw-pt-3 tw-pb-2`}\n`;\n\nexport const StyledInputSubmenuFooter = styled(MenuFooter)<IMenuFooter>`\n ${tw`tw-justify-between tw-pt-3`}\n height: auto;\n`;\n\nexport const StyledInput = styled(Input)`\n ${tw`tw-w-full tw-mb-5`}\n`;\n\nStyledMenu.displayName = \"StyledMenu\";\nStyledMenuFooter.displayName = \"StyledMenuFooter\";\nStyledStartMenuList.displayName = \"StyledStartMenuList\";\nStyledStartMenuListItem.displayName = \"StyledStartMenuListItem\";\nStyledStartMenuTitle.displayName = \"StyledStartMenuTitle\";\nStyledStartMenuDot.displayName = \"StyledStartMenuDot\";\nStyledStartMenuNoResults.displayName = \"StyledStartMenuNoResults\";\nStyledInputSubmenu.displayName = \"StyledInputSubmenu\";\nStyledInputSubmenuFooter.displayName = \"StyledInputSubmenuFooter\";\nStyledInput.displayName = \"StyledInput\";\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAGtC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,QAAQ,EAAaC,IAAI,QAAuB,SAAS;AAClE,SAASC,IAAI,EAASC,UAAU,QAAqB,SAAS;AAE9D,OAAO,MAAMC,UAAU,GAAGN,MAAM,CAACI,IAAI,CAAC,CAAAG,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kBAChC;EAAA;AAAY,CAAC,EACb;EAAA;AAAmB,CAAC,CACzB;AAED,OAAO,MAAMC,gBAAgB,GAAGV,MAAM,CAACK,UAAU,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aAC5C;EAAA;AAAkB,CAAC,CACxB;AAED,OAAO,MAAME,mBAAmB,GAAGX,MAAM,CAACG,IAAI,CAAC,CAAAI,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aACzC;EAAA;EAAA;AAAQ,CAAC,CACd;AAED,OAAO,MAAMG,uBAAuB,GAAGZ,MAAM,CAACE,QAAQ,CAAC,CAAAK,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aACjD;EAAA;AAAQ,CAAC,CACd;AAED,OAAO,MAAMI,oBAAoB,GAAGb,MAAM,CAACc,GAAG,CAAAP,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aACxC;EAAA;AAAU,CAAC,CAChB;AAED,OAAO,MAAMM,wBAAwB,GAAGf,MAAM,CAACc,GAAG,CAAAP,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kBAC5C;EAAA;EAAA;AAAU,CAAC,EACX;EAAA;AAAe,CAAC,CACrB;AAED,OAAO,MAAMO,kBAAkB,GAAGhB,MAAM,CAACiB,IAAI,CAAAV,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,2LAU5C;AAED,OAAO,MAAMS,kBAAkB,GAAGlB,MAAM,CAACc,GAAG,CAAAP,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aACtC;EAAA;EAAA;EAAA;EAAA;AAAwB,CAAC,CAC9B;AAED,OAAO,MAAMU,wBAAwB,GAAGnB,MAAM,CAACK,UAAU,CAAC,CAAAE,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,0BACpD;EAAA;EAAA;AAA2B,CAAC,CAEjC;AAED,OAAO,MAAMW,WAAW,GAAGpB,MAAM,CAACC,KAAK,CAAC,CAAAM,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,aAClC;EAAA;EAAA;AAAkB,CAAC,CACxB;AAEDH,UAAU,CAACE,WAAW,GAAG,YAAY;AACrCE,gBAAgB,CAACF,WAAW,GAAG,kBAAkB;AACjDG,mBAAmB,CAACH,WAAW,GAAG,qBAAqB;AACvDI,uBAAuB,CAACJ,WAAW,GAAG,yBAAyB;AAC/DK,oBAAoB,CAACL,WAAW,GAAG,sBAAsB;AACzDQ,kBAAkB,CAACR,WAAW,GAAG,oBAAoB;AACrDO,wBAAwB,CAACP,WAAW,GAAG,0BAA0B;AACjEU,kBAAkB,CAACV,WAAW,GAAG,oBAAoB;AACrDW,wBAAwB,CAACX,WAAW,GAAG,0BAA0B;AACjEY,WAAW,CAACZ,WAAW,GAAG,aAAa","ignoreList":[]}
|
package/dist/index.js
CHANGED
|
@@ -12817,9 +12817,7 @@
|
|
|
12817
12817
|
var StyledDialog = styled__default["default"].div.withConfig({
|
|
12818
12818
|
displayName: "Styles__StyledDialog",
|
|
12819
12819
|
componentId: "sc-jwpvgm-0"
|
|
12820
|
-
})(["display:flex;flex-direction:column;flex:1 1 auto;max-height:calc(100vh - 156px);background-color:var(--page-paper-main);color:var(--color-theme-900);box-shadow:var(--shadow-primary);border-radius:8px;width:310px;margin:60px auto 30px auto;position:relative;
|
|
12821
|
-
return props.$fullWidth && styled.css(["@media (max-width:640px){width:calc(100% - 32px);max-width:640px;margin-left:16px;margin-right:16px;}"]);
|
|
12822
|
-
}, FontStyle, BoxSizingStyle, screen.sm);
|
|
12820
|
+
})(["display:flex;flex-direction:column;flex:1 1 auto;max-height:calc(100vh - 156px);background-color:var(--page-paper-main);color:var(--color-theme-900);box-shadow:var(--shadow-primary);border-radius:8px;width:310px;margin:60px auto 30px auto;position:relative;@media (max-width:640px){width:calc(100% - 32px);max-width:640px;margin-left:16px !important;margin-right:16px !important;}", " ", " ", "{width:540px;margin:126px auto 30px auto;}"], FontStyle, BoxSizingStyle, screen.sm);
|
|
12823
12821
|
StyledDialog.displayName = "StyledDialog";
|
|
12824
12822
|
var StyledDialogTitle = styled__default["default"].div.withConfig({
|
|
12825
12823
|
displayName: "Styles__StyledDialogTitle",
|
|
@@ -13312,7 +13310,7 @@
|
|
|
13312
13310
|
};
|
|
13313
13311
|
Scale.displayName = "Scale";
|
|
13314
13312
|
|
|
13315
|
-
var _excluded$1b = ["children", "open", "onClose", "className", "enableBackgroundClick", "disableCloseOnEsc", "animate", "onClickOutside"
|
|
13313
|
+
var _excluded$1b = ["children", "open", "onClose", "className", "enableBackgroundClick", "disableCloseOnEsc", "animate", "onClickOutside"];
|
|
13316
13314
|
var _Dialog = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
13317
13315
|
var children = _ref.children,
|
|
13318
13316
|
_ref$open = _ref.open,
|
|
@@ -13326,8 +13324,6 @@
|
|
|
13326
13324
|
_ref$animate = _ref.animate,
|
|
13327
13325
|
animate = _ref$animate === void 0 ? "slide" : _ref$animate,
|
|
13328
13326
|
onClickOutside = _ref.onClickOutside,
|
|
13329
|
-
_ref$fullWidth = _ref.fullWidth,
|
|
13330
|
-
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
13331
13327
|
rest = _objectWithoutProperties(_ref, _excluded$1b);
|
|
13332
13328
|
var animateDialog = function animateDialog() {
|
|
13333
13329
|
switch (animate) {
|
|
@@ -13335,15 +13331,13 @@
|
|
|
13335
13331
|
return /*#__PURE__*/React__default["default"].createElement(Fade, {
|
|
13336
13332
|
in: open
|
|
13337
13333
|
}, /*#__PURE__*/React__default["default"].createElement(StyledDialog, {
|
|
13338
|
-
$fullWidth: fullWidth,
|
|
13339
13334
|
className: classNames__default["default"]("c-dialog", className)
|
|
13340
13335
|
}, children));
|
|
13341
13336
|
default:
|
|
13342
13337
|
return /*#__PURE__*/React__default["default"].createElement(SlideFromTop, {
|
|
13343
13338
|
in: open
|
|
13344
13339
|
}, /*#__PURE__*/React__default["default"].createElement(StyledDialog, {
|
|
13345
|
-
className: classNames__default["default"]("c-dialog", className)
|
|
13346
|
-
$fullWidth: fullWidth
|
|
13340
|
+
className: classNames__default["default"]("c-dialog", className)
|
|
13347
13341
|
}, children));
|
|
13348
13342
|
}
|
|
13349
13343
|
};
|
|
@@ -13388,9 +13382,7 @@
|
|
|
13388
13382
|
_ref$shouldShowCancel = _ref.shouldShowCancelButton,
|
|
13389
13383
|
shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel,
|
|
13390
13384
|
_ref$isLoading = _ref.isLoading,
|
|
13391
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading
|
|
13392
|
-
_ref$fullWidth = _ref.fullWidth,
|
|
13393
|
-
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth;
|
|
13385
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
13394
13386
|
React.useEffect(function () {
|
|
13395
13387
|
var handleKeyDown = function handleKeyDown(event) {
|
|
13396
13388
|
if (event.key === "Enter" && onConfirm) {
|
|
@@ -13410,8 +13402,7 @@
|
|
|
13410
13402
|
open: open,
|
|
13411
13403
|
onClose: onCancel,
|
|
13412
13404
|
className: classNames__default["default"]("c-confirm-dialog", className),
|
|
13413
|
-
disableCloseOnEsc: isLoading
|
|
13414
|
-
fullWidth: fullWidth
|
|
13405
|
+
disableCloseOnEsc: isLoading
|
|
13415
13406
|
}, /*#__PURE__*/React__default["default"].createElement(Dialog.Title, null, dialogTitle), /*#__PURE__*/React__default["default"].createElement(Dialog.ContentDivider, null), /*#__PURE__*/React__default["default"].createElement(Dialog.Content, null, /*#__PURE__*/React__default["default"].createElement(Body2, {
|
|
13416
13407
|
lineHeight: "loose",
|
|
13417
13408
|
color: "secondary",
|
|
@@ -16415,11 +16406,11 @@
|
|
|
16415
16406
|
CheckboxIcon.displayName = "CheckboxIcon";
|
|
16416
16407
|
var CheckboxIcon$1 = CheckboxIcon;
|
|
16417
16408
|
|
|
16418
|
-
var StyledInput$
|
|
16409
|
+
var StyledInput$4 = styled__default["default"].input.withConfig({
|
|
16419
16410
|
displayName: "Styles__StyledInput",
|
|
16420
16411
|
componentId: "sc-y7zymm-0"
|
|
16421
16412
|
})(["border:0px;clip:rect(0px,0px,0px,0px);cursor:pointer;height:1px;margin:-1px;opacity:0;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:1px;"]);
|
|
16422
|
-
StyledInput$
|
|
16413
|
+
StyledInput$4.displayName = "StyledInput";
|
|
16423
16414
|
var StyledLabel$1 = styled__default["default"].label.withConfig({
|
|
16424
16415
|
displayName: "Styles__StyledLabel",
|
|
16425
16416
|
componentId: "sc-y7zymm-1"
|
|
@@ -16434,13 +16425,13 @@
|
|
|
16434
16425
|
return !props.mixed && styled.css(["stroke:var(--color-theme-500);"]);
|
|
16435
16426
|
}, function (props) {
|
|
16436
16427
|
return props.mixed && styled.css(["stroke:transparent;"]);
|
|
16437
|
-
}, StyledInput$
|
|
16428
|
+
}, StyledInput$4, StyledLabel$1, StyledInput$4, StyledLabel$1, function (props) {
|
|
16438
16429
|
return !props.mixed && styled.css(["rect{stroke:var(--color-secondary);stroke-width:3px;}"]);
|
|
16439
|
-
}, StyledInput$
|
|
16430
|
+
}, StyledInput$4, StyledLabel$1, function (props) {
|
|
16440
16431
|
return props.mixed && styled.css(["stroke:transparent;"]);
|
|
16441
16432
|
}, function (props) {
|
|
16442
|
-
return props.hover && !props.mixed && styled.css(["", ":not(:checked) ~ ", "{path{stroke:var(--color-secondary-500);stroke-dashoffset:24;}rect{stroke:var(--color-secondary);stroke-width:3px;}}"], StyledInput$
|
|
16443
|
-
}, StyledInput$
|
|
16433
|
+
return props.hover && !props.mixed && styled.css(["", ":not(:checked) ~ ", "{path{stroke:var(--color-secondary-500);stroke-dashoffset:24;}rect{stroke:var(--color-secondary);stroke-width:3px;}}"], StyledInput$4, StyledLabel$1);
|
|
16434
|
+
}, StyledInput$4, StyledLabel$1, function (props) {
|
|
16444
16435
|
return !props.mixed && styled.css(["stroke:var(--page-paper-main);stroke-dashoffset:24;"]);
|
|
16445
16436
|
}, function (props) {
|
|
16446
16437
|
return props.mixed && styled.css(["stroke:transparent;"]);
|
|
@@ -16499,7 +16490,7 @@
|
|
|
16499
16490
|
tabIndex: -1,
|
|
16500
16491
|
mixed: indeterminate,
|
|
16501
16492
|
$disabled: disabled
|
|
16502
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledInput$
|
|
16493
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledInput$4, _extends({
|
|
16503
16494
|
role: "checkbox",
|
|
16504
16495
|
id: id,
|
|
16505
16496
|
className: "c-checkbox--input",
|
|
@@ -16542,7 +16533,7 @@
|
|
|
16542
16533
|
return !props.$disabled && props.$invalid && props.$mode === "outlined" && styled.css(["border-color:var(--red-alert);"]);
|
|
16543
16534
|
});
|
|
16544
16535
|
StyledInputWrapper.displayName = "StyledInputWrapper";
|
|
16545
|
-
var StyledInput$
|
|
16536
|
+
var StyledInput$3 = styled__default["default"].input.withConfig({
|
|
16546
16537
|
displayName: "Styles__StyledInput",
|
|
16547
16538
|
componentId: "sc-ce8kcp-1"
|
|
16548
16539
|
})(["", " ", " background-color:var(--input-background-color);border:none;color:var(--color-theme-900);font-size:0.875rem;font-weight:400;letter-spacing:0.02em;margin-block:0;margin-inline:4px;outline:none;padding:0;width:100%;", " &::placeholder{color:var(--color-theme-transparent-500);}", " ", " ", " ", " ", " ", ""], BoxSizingStyle, InputResetStyle, function (props) {
|
|
@@ -16560,7 +16551,7 @@
|
|
|
16560
16551
|
}, function (props) {
|
|
16561
16552
|
return props.$mode === "flat" && props.$invalid && styled.css(["color:var(--red-alert);"]);
|
|
16562
16553
|
});
|
|
16563
|
-
StyledInput$
|
|
16554
|
+
StyledInput$3.displayName = "StyledInput";
|
|
16564
16555
|
var StyledPasswordIndicatorWrapper = styled__default["default"].div.withConfig({
|
|
16565
16556
|
displayName: "Styles__StyledPasswordIndicatorWrapper",
|
|
16566
16557
|
componentId: "sc-ce8kcp-2"
|
|
@@ -16672,7 +16663,7 @@
|
|
|
16672
16663
|
className: classNames__default["default"]("c-input-wrapper", className),
|
|
16673
16664
|
onClick: handleWrapperClick,
|
|
16674
16665
|
ref: wrapRef
|
|
16675
|
-
}, startAdornment, /*#__PURE__*/React__default["default"].createElement(StyledInput$
|
|
16666
|
+
}, startAdornment, /*#__PURE__*/React__default["default"].createElement(StyledInput$3, _extends({
|
|
16676
16667
|
ref: handleRef,
|
|
16677
16668
|
type: type,
|
|
16678
16669
|
$size: size,
|
|
@@ -19920,7 +19911,7 @@
|
|
|
19920
19911
|
$open: open,
|
|
19921
19912
|
ref: chipWrapper,
|
|
19922
19913
|
$_css5: autoSize === "auto" && scrollWrapper ? sizeMap[size] * 3 + 8 + "px" : undefined
|
|
19923
|
-
}, startAdornment, /*#__PURE__*/React__default["default"].createElement(StyledInput$
|
|
19914
|
+
}, startAdornment, /*#__PURE__*/React__default["default"].createElement(StyledInput$3, {
|
|
19924
19915
|
className: "c-combo-box-input",
|
|
19925
19916
|
onBlur: handleBlur,
|
|
19926
19917
|
onFocus: function onFocus() {
|
|
@@ -22698,7 +22689,7 @@
|
|
|
22698
22689
|
return invalid && styled.css(["border:1px solid var(--red-alert);"]);
|
|
22699
22690
|
});
|
|
22700
22691
|
StyledSpan.displayName = "StyledSpan";
|
|
22701
|
-
var StyledInput$
|
|
22692
|
+
var StyledInput$2 = styled__default["default"](Typography).withConfig({
|
|
22702
22693
|
displayName: "Styles__StyledInput",
|
|
22703
22694
|
componentId: "sc-1wapx2a-2"
|
|
22704
22695
|
})(["", " background-color:inherit;padding-left:4px;padding-right:4px;padding-top:1px;padding-bottom:1px;text-overflow:ellipsis;font-variant-numeric:tabular-nums;&:focus-whitin{text-overflow:clip;}outline-width:0px;outline:none;&:disabled{opacity:0;}", ""], {
|
|
@@ -22723,7 +22714,7 @@
|
|
|
22723
22714
|
var invalid = _ref4.invalid;
|
|
22724
22715
|
return invalid && styled.css(["border-color:var(--red-alert) !important;"]);
|
|
22725
22716
|
});
|
|
22726
|
-
StyledInput$
|
|
22717
|
+
StyledInput$2.displayName = "StyledInput";
|
|
22727
22718
|
var StyledMultilineSpan = styled__default["default"](StyledSpan).withConfig({
|
|
22728
22719
|
displayName: "Styles__StyledMultilineSpan",
|
|
22729
22720
|
componentId: "sc-1wapx2a-3"
|
|
@@ -22783,7 +22774,7 @@
|
|
|
22783
22774
|
weight: weight,
|
|
22784
22775
|
$disabled: disabled,
|
|
22785
22776
|
className: "presentation"
|
|
22786
|
-
}, children ? children : inputProps === null || inputProps === void 0 ? void 0 : inputProps.value), /*#__PURE__*/React__default["default"].createElement(StyledInput$
|
|
22777
|
+
}, children ? children : inputProps === null || inputProps === void 0 ? void 0 : inputProps.value), /*#__PURE__*/React__default["default"].createElement(StyledInput$2, _extends({}, inputProps, {
|
|
22787
22778
|
ref: handleRef,
|
|
22788
22779
|
forwardedAs: "input",
|
|
22789
22780
|
variant: variant,
|
|
@@ -23392,6 +23383,29 @@
|
|
|
23392
23383
|
displayName: "Styles__StyledStartMenuDot",
|
|
23393
23384
|
componentId: "sc-lxuoiz-6"
|
|
23394
23385
|
})(["border-radius:50%;background-color:var(--color-primary);color:var(--page-paper-main);line-height:15px;width:15px;font-weight:bold;font-size:10px;text-align:center;margin-left:4px;"]);
|
|
23386
|
+
var StyledInputSubmenu = styled__default["default"].div.withConfig({
|
|
23387
|
+
displayName: "Styles__StyledInputSubmenu",
|
|
23388
|
+
componentId: "sc-lxuoiz-7"
|
|
23389
|
+
})(["", ""], {
|
|
23390
|
+
"paddingLeft": "0.75rem",
|
|
23391
|
+
"paddingRight": "0.75rem",
|
|
23392
|
+
"paddingBottom": "0.5rem",
|
|
23393
|
+
"paddingTop": "0.75rem"
|
|
23394
|
+
});
|
|
23395
|
+
var StyledInputSubmenuFooter = styled__default["default"](MenuFooter).withConfig({
|
|
23396
|
+
displayName: "Styles__StyledInputSubmenuFooter",
|
|
23397
|
+
componentId: "sc-lxuoiz-8"
|
|
23398
|
+
})(["", " height:auto;"], {
|
|
23399
|
+
"justifyContent": "space-between",
|
|
23400
|
+
"paddingTop": "0.75rem"
|
|
23401
|
+
});
|
|
23402
|
+
var StyledInput$1 = styled__default["default"](Input).withConfig({
|
|
23403
|
+
displayName: "Styles__StyledInput",
|
|
23404
|
+
componentId: "sc-lxuoiz-9"
|
|
23405
|
+
})(["", ""], {
|
|
23406
|
+
"marginBottom": "1.25rem",
|
|
23407
|
+
"width": "100%"
|
|
23408
|
+
});
|
|
23395
23409
|
StyledMenu.displayName = "StyledMenu";
|
|
23396
23410
|
StyledMenuFooter.displayName = "StyledMenuFooter";
|
|
23397
23411
|
StyledStartMenuList.displayName = "StyledStartMenuList";
|
|
@@ -23399,6 +23413,52 @@
|
|
|
23399
23413
|
StyledStartMenuTitle.displayName = "StyledStartMenuTitle";
|
|
23400
23414
|
StyledStartMenuDot.displayName = "StyledStartMenuDot";
|
|
23401
23415
|
StyledStartMenuNoResults.displayName = "StyledStartMenuNoResults";
|
|
23416
|
+
StyledInputSubmenu.displayName = "StyledInputSubmenu";
|
|
23417
|
+
StyledInputSubmenuFooter.displayName = "StyledInputSubmenuFooter";
|
|
23418
|
+
StyledInput$1.displayName = "StyledInput";
|
|
23419
|
+
|
|
23420
|
+
var InputSubmenu = function InputSubmenu(_ref) {
|
|
23421
|
+
var _ref$value = _ref.value,
|
|
23422
|
+
value = _ref$value === void 0 ? "" : _ref$value,
|
|
23423
|
+
placeholder = _ref.placeholder,
|
|
23424
|
+
saveLabel = _ref.saveLabel,
|
|
23425
|
+
_ref$clearLabel = _ref.clearLabel,
|
|
23426
|
+
clearLabel = _ref$clearLabel === void 0 ? "Clear" : _ref$clearLabel,
|
|
23427
|
+
onSave = _ref.onSave,
|
|
23428
|
+
onClear = _ref.onClear;
|
|
23429
|
+
var _useState = React.useState(value),
|
|
23430
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23431
|
+
inputValue = _useState2[0],
|
|
23432
|
+
setInputValue = _useState2[1];
|
|
23433
|
+
React.useEffect(function () {
|
|
23434
|
+
setInputValue(value);
|
|
23435
|
+
}, [value]);
|
|
23436
|
+
var handleChange = React.useCallback(function (event) {
|
|
23437
|
+
setInputValue(event.target.value);
|
|
23438
|
+
}, []);
|
|
23439
|
+
var handleSave = React.useCallback(function () {
|
|
23440
|
+
onSave(inputValue);
|
|
23441
|
+
}, [inputValue, onSave]);
|
|
23442
|
+
var handleKeyDown = React.useCallback(function (event) {
|
|
23443
|
+
if (event.key === "Enter") {
|
|
23444
|
+
onSave(inputValue);
|
|
23445
|
+
}
|
|
23446
|
+
}, [inputValue, onSave]);
|
|
23447
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledInputSubmenu, null, /*#__PURE__*/React__default["default"].createElement(StyledInput$1, {
|
|
23448
|
+
value: inputValue,
|
|
23449
|
+
onChange: handleChange,
|
|
23450
|
+
onKeyDown: handleKeyDown,
|
|
23451
|
+
placeholder: placeholder
|
|
23452
|
+
}), /*#__PURE__*/React__default["default"].createElement(StyledInputSubmenuFooter, null, /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
23453
|
+
variant: "primary",
|
|
23454
|
+
size: "small",
|
|
23455
|
+
onClick: handleSave
|
|
23456
|
+
}, saveLabel), /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
23457
|
+
variant: "text gray",
|
|
23458
|
+
size: "small",
|
|
23459
|
+
onClick: onClear
|
|
23460
|
+
}, clearLabel)));
|
|
23461
|
+
};
|
|
23402
23462
|
|
|
23403
23463
|
var StartMenu = function StartMenu(_ref) {
|
|
23404
23464
|
var data = _ref.data,
|
|
@@ -23423,7 +23483,8 @@
|
|
|
23423
23483
|
}, /*#__PURE__*/React__default["default"].createElement(StyledStartMenuList, null, shouldRenderSubmenus ? data.map(function (_ref2, index) {
|
|
23424
23484
|
var id = _ref2.id,
|
|
23425
23485
|
title = _ref2.title,
|
|
23426
|
-
submenu = _ref2.submenu
|
|
23486
|
+
submenu = _ref2.submenu,
|
|
23487
|
+
type = _ref2.type;
|
|
23427
23488
|
var count = 0;
|
|
23428
23489
|
// Popricati o ovome kada je selected[id] vrednost 0.
|
|
23429
23490
|
if (typeof selected[id] === "string") {
|
|
@@ -23432,7 +23493,7 @@
|
|
|
23432
23493
|
var _selected$id;
|
|
23433
23494
|
count = (_selected$id = selected[id]) === null || _selected$id === void 0 ? void 0 : _selected$id.length;
|
|
23434
23495
|
}
|
|
23435
|
-
if ((submenu === null || submenu === void 0 ? void 0 : submenu.length) > 1) {
|
|
23496
|
+
if (type === "input" || (submenu === null || submenu === void 0 ? void 0 : submenu.length) > 1) {
|
|
23436
23497
|
return /*#__PURE__*/React__default["default"].createElement(StyledStartMenuListItem, {
|
|
23437
23498
|
key: "filter-list-item-".concat(index),
|
|
23438
23499
|
onClick: function onClick() {
|
|
@@ -23475,7 +23536,7 @@
|
|
|
23475
23536
|
}), children);
|
|
23476
23537
|
};
|
|
23477
23538
|
|
|
23478
|
-
var _excluded$7 = ["id", "title", "submenu", "searchPlaceholder", "disableInternalSort", "isSingleSelect", "defaultValue"];
|
|
23539
|
+
var _excluded$7 = ["id", "title", "submenu", "searchPlaceholder", "disableInternalSort", "isSingleSelect", "defaultValue", "type", "inputPlaceholder", "saveLabel", "clearLabel"];
|
|
23479
23540
|
var Filter = function Filter(_ref) {
|
|
23480
23541
|
var data = _ref.data,
|
|
23481
23542
|
_ref$selected = _ref.selected,
|
|
@@ -23572,6 +23633,27 @@
|
|
|
23572
23633
|
setFilter(newFilters);
|
|
23573
23634
|
onChange(newFilters);
|
|
23574
23635
|
}, [filter, menu, onChange]);
|
|
23636
|
+
var handleInputSave = React.useCallback(function (id, value) {
|
|
23637
|
+
var newFilters = {};
|
|
23638
|
+
if (value.trim()) {
|
|
23639
|
+
newFilters = _objectSpread2(_objectSpread2({}, filter), {}, {
|
|
23640
|
+
[id]: [value]
|
|
23641
|
+
});
|
|
23642
|
+
} else {
|
|
23643
|
+
newFilters = _objectSpread2({}, filter);
|
|
23644
|
+
delete newFilters[id];
|
|
23645
|
+
}
|
|
23646
|
+
setFilter(newFilters);
|
|
23647
|
+
onChange(newFilters);
|
|
23648
|
+
setIndex();
|
|
23649
|
+
}, [filter, onChange, setIndex]);
|
|
23650
|
+
var handleInputClear = React.useCallback(function (id) {
|
|
23651
|
+
var newFilters = _objectSpread2({}, filter);
|
|
23652
|
+
delete newFilters[id];
|
|
23653
|
+
setFilter(newFilters);
|
|
23654
|
+
onChange(newFilters);
|
|
23655
|
+
setIndex();
|
|
23656
|
+
}, [filter, onChange, setIndex]);
|
|
23575
23657
|
var count = React.useMemo(function () {
|
|
23576
23658
|
var c = 0;
|
|
23577
23659
|
Object.values(filter).forEach(function (entry) {
|
|
@@ -23588,7 +23670,7 @@
|
|
|
23588
23670
|
}
|
|
23589
23671
|
for (var entry of data) {
|
|
23590
23672
|
var _entry$submenu;
|
|
23591
|
-
if (((_entry$submenu = entry.submenu) === null || _entry$submenu === void 0 ? void 0 : _entry$submenu.length) > 1) {
|
|
23673
|
+
if (entry.type === "input" || ((_entry$submenu = entry.submenu) === null || _entry$submenu === void 0 ? void 0 : _entry$submenu.length) > 1) {
|
|
23592
23674
|
return true;
|
|
23593
23675
|
}
|
|
23594
23676
|
}
|
|
@@ -23634,7 +23716,7 @@
|
|
|
23634
23716
|
shouldRenderSubmenus: shouldRenderSubmenus,
|
|
23635
23717
|
emptyFilterText: emptyFilterText
|
|
23636
23718
|
}, children))), shouldRenderSubmenus && data.map(function (_ref2, index) {
|
|
23637
|
-
var _filter$id;
|
|
23719
|
+
var _filter$id$, _filter$id, _filter$id2;
|
|
23638
23720
|
var id = _ref2.id,
|
|
23639
23721
|
title = _ref2.title,
|
|
23640
23722
|
submenu = _ref2.submenu,
|
|
@@ -23642,6 +23724,12 @@
|
|
|
23642
23724
|
disableInternalSort = _ref2.disableInternalSort,
|
|
23643
23725
|
isSingleSelect = _ref2.isSingleSelect,
|
|
23644
23726
|
defaultValue = _ref2.defaultValue,
|
|
23727
|
+
_ref2$type = _ref2.type,
|
|
23728
|
+
submenuType = _ref2$type === void 0 ? "select" : _ref2$type,
|
|
23729
|
+
inputPlaceholder = _ref2.inputPlaceholder,
|
|
23730
|
+
_ref2$saveLabel = _ref2.saveLabel,
|
|
23731
|
+
saveLabel = _ref2$saveLabel === void 0 ? "Save" : _ref2$saveLabel,
|
|
23732
|
+
clearLabel = _ref2.clearLabel,
|
|
23645
23733
|
rest = _objectWithoutProperties(_ref2, _excluded$7);
|
|
23646
23734
|
return /*#__PURE__*/React__default["default"].createElement(SlideLeftRightTransition, {
|
|
23647
23735
|
key: "filter-submenu-".concat(index),
|
|
@@ -23661,7 +23749,18 @@
|
|
|
23661
23749
|
indexPage: menu === "index"
|
|
23662
23750
|
}, /*#__PURE__*/React__default["default"].createElement(FocusLock.MoveFocusInside, {
|
|
23663
23751
|
disabled: enteredMenu !== id
|
|
23664
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
23752
|
+
}, submenuType === "input" ? /*#__PURE__*/React__default["default"].createElement(InputSubmenu, {
|
|
23753
|
+
value: (_filter$id$ = (_filter$id = filter[id]) === null || _filter$id === void 0 ? void 0 : _filter$id[0]) !== null && _filter$id$ !== void 0 ? _filter$id$ : "",
|
|
23754
|
+
placeholder: inputPlaceholder,
|
|
23755
|
+
saveLabel: saveLabel,
|
|
23756
|
+
clearLabel: clearLabel,
|
|
23757
|
+
onSave: function onSave(value) {
|
|
23758
|
+
return handleInputSave(id, value);
|
|
23759
|
+
},
|
|
23760
|
+
onClear: function onClear() {
|
|
23761
|
+
return handleInputClear(id);
|
|
23762
|
+
}
|
|
23763
|
+
}) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Select, _extends({
|
|
23665
23764
|
options: submenu,
|
|
23666
23765
|
selected: filter[id],
|
|
23667
23766
|
onChange: handleChange,
|
|
@@ -23673,11 +23772,11 @@
|
|
|
23673
23772
|
disableSearch: Boolean(submenu.length <= 7),
|
|
23674
23773
|
disabledInternalSort: disableInternalSort,
|
|
23675
23774
|
defaultValue: defaultValue
|
|
23676
|
-
}, rest)), (_filter$
|
|
23775
|
+
}, rest)), (_filter$id2 = filter[id]) !== null && _filter$id2 !== void 0 && _filter$id2.length ? /*#__PURE__*/React__default["default"].createElement(StyledMenuFooter, null, /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
23677
23776
|
variant: "text colored",
|
|
23678
23777
|
size: "small",
|
|
23679
23778
|
onClick: handleReset
|
|
23680
|
-
}, resetLabel)) : null)));
|
|
23779
|
+
}, resetLabel)) : null))));
|
|
23681
23780
|
}))));
|
|
23682
23781
|
};
|
|
23683
23782
|
|