frst-components 0.21.16 → 0.21.18

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/index.js CHANGED
@@ -18660,9 +18660,17 @@ function DropdownMultiselect(props) {
18660
18660
  const [textFilter, setTextFilter] = React.useState('');
18661
18661
  const [listItemsFilter, setListItemsFilter] = React.useState(props.listItems);
18662
18662
  const [showModal, setShowModal] = React.useState(false);
18663
- const listFilterSearch = React.useMemo(() => {
18664
- return listItemsFilter.filter((resp) => resp.name.toLowerCase().includes(textFilter));
18663
+ const [listFilterSearch, setListFilterSearch] = React.useState();
18664
+ React.useEffect(() => {
18665
+ setListFilterSearch(props.listItems);
18666
+ }, [props.listItems]);
18667
+ React.useEffect(() => {
18668
+ let temp = listItemsFilter.filter((resp) => resp.name.toLowerCase().includes(textFilter));
18669
+ setListFilterSearch(temp);
18665
18670
  }, [textFilter]);
18671
+ React.useEffect(() => {
18672
+ setSelectedValues(props?.selectedDefault);
18673
+ }, [props?.selectedDefault]);
18666
18674
  React.useEffect(() => {
18667
18675
  setListItemsFilter(props.listItems);
18668
18676
  }, [props.listItems]);
@@ -18691,7 +18699,7 @@ function DropdownMultiselect(props) {
18691
18699
  jsxRuntime.jsxs(selectTag, { children: [jsxRuntime.jsx(Avatar, { src: item.avatar, size: "24px" }), jsxRuntime.jsxs("p", { children: [" ", item.name, " "] }), jsxRuntime.jsx(material.IconButton, { onClick: () => removeSelectedValue(item.id), children: jsxRuntime.jsx(CloseIcon, { width: "8", height: "8", fill: "#FFFFFF" }) })] }, index));
18692
18700
  }
18693
18701
  else if (index === props.maxSelectedShow) {
18694
- return (jsxRuntime.jsx(overShowInfo, { onClick: () => setShowModal(true), children: jsxRuntime.jsx("p", { children: `+ ${pessoasAMais} ${pessoasAMais > 1 ? 'pessoas' : 'pessoa'}` }) }, index));
18702
+ return (jsxRuntime.jsx(overShowInfo, { onClick: () => setShowModal(true), children: jsxRuntime.jsx("p", { children: `+ ${pessoasAMais} ${pessoasAMais > 1 ? props.people : props.person}` }) }, index));
18695
18703
  }
18696
18704
  }) }));
18697
18705
  }
@@ -18709,7 +18717,7 @@ function DropdownMultiselect(props) {
18709
18717
  } })] })) : jsxRuntime.jsx(jsxRuntime.Fragment, {});
18710
18718
  };
18711
18719
  const selectValuesModal = () => {
18712
- return (jsxRuntime.jsx(material.Modal, { open: showModal, onClose: () => setShowModal(false), children: jsxRuntime.jsxs(modalContainer, { children: [jsxRuntime.jsx(modalHeader, { children: jsxRuntime.jsxs("p", { children: [" ", props.modalTitle ? props.modalTitle : 'Este grupo é administrado por', " ", selectedValues.length, " ", selectedValues.length > 1 ? 'pessoas' : 'pessoa', " "] }) }), jsxRuntime.jsx(modalContent, { children: selectedValues.map((item, index) => {
18720
+ return (jsxRuntime.jsx(material.Modal, { open: showModal, onClose: () => setShowModal(false), children: jsxRuntime.jsxs(modalContainer, { children: [jsxRuntime.jsx(modalHeader, { children: jsxRuntime.jsxs("p", { children: [" ", props.modalTitle ? props.modalTitle : 'Este grupo é administrado por', " ", selectedValues.length, " ", selectedValues.length > 1 ? props.people : props.person, " "] }) }), jsxRuntime.jsx(modalContent, { children: selectedValues.map((item, index) => {
18713
18721
  return (jsxRuntime.jsxs(modalCards, { style: { background: index % 2 === 0 ? '#F2F2F2' : '#FFF' }, children: [jsxRuntime.jsxs("div", { style: { display: "flex", gap: '12px' }, children: [jsxRuntime.jsx(Avatar, { src: item.avatar, size: "50px" }), jsxRuntime.jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [jsxRuntime.jsxs(cardTitle, { children: [" ", item.name, " "] }), jsxRuntime.jsxs(cardDescription, { children: [" ", item.description, " "] })] })] }), jsxRuntime.jsxs("div", { style: { display: 'flex', cursor: 'pointer' }, onClick: () => removeSelectedValue(item.id), children: [jsxRuntime.jsx(Trash, { fill: "#A50000", width: "24", height: "24" }), jsxRuntime.jsxs(cardTitle, { style: { color: '#A50000' }, children: [" ", props.removeModalText ? props.removeModalText : 'Remover', " "] })] })] }, index));
18714
18722
  }) }), jsxRuntime.jsx(closeModal, { children: jsxRuntime.jsx(material.IconButton, { onClick: () => setShowModal(false), children: jsxRuntime.jsx(CloseIcon, {}) }) })] }) }));
18715
18723
  };
@@ -3,9 +3,11 @@ import './styles/primereact.css';
3
3
  import './styles/primeflex.css';
4
4
  import './styles/theme.css';
5
5
  interface IDropdownMultiselect {
6
- listItems?: any;
6
+ listItems?: ISelectedValue;
7
7
  selectPlaceholder?: string;
8
8
  searchSelectPlaceholder?: string;
9
+ people: string;
10
+ person: string;
9
11
  maxSelectedShow?: number;
10
12
  isDisabled?: boolean;
11
13
  removeItemsToolTip?: string;
@@ -15,7 +17,14 @@ interface IDropdownMultiselect {
15
17
  getSelectedItems?: (selectedItems: any) => void;
16
18
  style?: React.CSSProperties;
17
19
  optionLayout?: (options: any) => void;
20
+ selectedDefault?: ISelectedValue;
18
21
  }
22
+ type ISelectedValue = {
23
+ id: string;
24
+ avatar: string;
25
+ name: string;
26
+ description: string;
27
+ }[];
19
28
  export default function DropdownMultiselect(props: IDropdownMultiselect): JSX.Element;
20
29
  export {};
21
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DS/dropdown-Multiselect/index.tsx"],"names":[],"mappings":";AASA,OAAO,yBAAyB,CAAA;AAChC,OAAO,wBAAwB,CAAA;AAC/B,OAAO,oBAAoB,CAAA;AAK3B,UAAU,oBAAoB;IAC1B,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM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,MAAM,CAAA;CACtB,EAAE,CAAA;AAGH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,eAyMtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/IJ/learningCycleCard/components/menu/index.tsx"],"names":[],"mappings":";AAUA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE;;;CAAA,eAiFnD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/IJ/learningCycleCard/components/menu/index.tsx"],"names":[],"mappings":";AAUA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE;;;CAAA,eAiFnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"menuStyle.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/IJ/learningCycleCard/components/menu/menuStyle.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,oEAuBxB,CAAA"}
1
+ {"version":3,"file":"menuStyle.d.ts","sourceRoot":"","sources":["../../../../../../src/components/IJ/learningCycleCard/components/menu/menuStyle.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,oEAuBxB,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "frst-components",
3
3
  "homepage": "http://FRST-Falconi.github.io/storybook.frstfalconi.com",
4
- "version": "0.21.16",
4
+ "version": "0.21.18",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -95,4 +95,4 @@
95
95
  "bugs": {
96
96
  "url": "https://github.com/FRST-Falconi/storybook.frstfalconi.com/issues"
97
97
  }
98
- }
98
+ }