You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
11 KiB

{"ast":null,"code":"var _jsxFileName = \"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign2/index.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from \"react\";\nimport IconText from \"../IconText\";\nimport ButtonDivTag from \"../ButtonDivTag\";\nimport TitleSubtitle from \"../TitleSubtitle\";\nimport { DragDropContext, Droppable, Draggable } from \"react-beautiful-dnd\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst CardDesign2 = _ref => {\n _s();\n\n let {\n buttons\n } = _ref;\n const [dokmeha, updateDokmeha] = useState(buttons);\n\n function handleOnDragEnd(result) {\n if (!result.destination) return;\n const items = Array.from(dokmeha);\n const [reorderedItem] = items.splice(result.source.index, 1);\n items.splice(result.destination.index, 0, reorderedItem);\n updateDokmeha(items);\n }\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"max-h-[400px] overflow-y-auto scrollYDesign w-full flex flex-col p-4 bg-white shadow rounded mt-3\",\n children: [/*#__PURE__*/_jsxDEV(TitleSubtitle, {\n subTitle: false,\n title: \"افراد حاضر در این سالن\",\n titleClassName: \"font-bold text-primary\",\n titleBorderClassName: \"w-1 h-5 bg-green-400 ml-1.5\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(IconText, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(DragDropContext, {\n onDragEnd: handleOnDragEnd,\n children: /*#__PURE__*/_jsxDEV(Droppable, {\n droppableId: \"container\",\n children: provided => /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"flex flex-col gap-y-4 justify-around mt-4 w-full\",\n ...provided.droppableProps,\n ref: provided.innerRef,\n id: \"container\",\n children: [dokmeha.map((btn, index) => /*#__PURE__*/_jsxDEV(Draggable, {\n draggableId: \"e\" + btn.id,\n index: index,\n children: provided => /*#__PURE__*/_jsxDEV(\"div\", {\n className: `w-full px-1`,\n children: /*#__PURE__*/_jsxDEV(ButtonDivTag, {\n props: {\n ref: provided.innerRef,\n ...provided.draggableProps,\n ...provided.dragHandleProps\n },\n className: `${btn.className} w-full h-full text-white py-3 border-none text-xs rounded-sm`,\n style: provided.draggableProps.style,\n text: btn.name\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 23\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 21\n }, this)\n }, btn.id, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 17\n }, this)), provided.placeholder]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 5\n }, this);\n};\n\n_s(CardDesign2, \"KEE5snQsBqXc0Kww9bnRe6PZ6fQ=\");\n\n_c = CardDesign2;\nexport default CardDesign2;\nCardDesign2.defaultProps = {\n buttons: [{\n id: 1,\n name: \"پنجره\",\n className: \"bg-[#FFF7BF]\"\n }, {\n id: 2,\n name: \"کمک اولیه\",\n className: \"bg-[#DBFDFF]\"\n }, {\n id: 3,\n name: \"درب خروجی\",\n className: \"bg-[#828282]\"\n }, {\n id: 4,\n name: \"سیستم سرمایش\",\n className: \"bg-[#F6FFEB]\"\n }, {\n id: 5,\n name: \"آب سردکن\",\n className: \"bg-[#F0FFB4]\"\n }, {\n id: 6,\n name: \"سرویس بهداشتی\",\n className: \"bg-[#FFDD8E]\"\n }, {\n id: 7,\n name: \"حمام\",\n className: \"bg-[#EEEFFF]\"\n }, {\n id: 8,\n name: \"تخت\",\n className: \"bg-[#FFF5EE]\"\n }]\n};\n\nvar _c;\n\n$RefreshReg$(_c, \"CardDesign2\");","map":{"version":3,"names":["React","useState","IconText","ButtonDivTag","TitleSubtitle","DragDropContext","Droppable","Draggable","CardDesign2","buttons","dokmeha","updateDokmeha","handleOnDragEnd","result","destination","items","Array","from","reorderedItem","splice","source","index","provided","droppableProps","innerRef","map","btn","id","ref","draggableProps","dragHandleProps","className","style","name","placeholder","defaultProps"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign2/index.js"],"sourcesContent":["import React, { useState } from \"react\";\n\nimport IconText from \"../IconText\";\nimport ButtonDivTag from \"../ButtonDivTag\";\nimport TitleSubtitle from \"../TitleSubtitle\";\n\nimport { DragDropContext, Droppable, Draggable } from \"react-beautiful-dnd\";\n\nconst CardDesign2 = ({ buttons }) => {\n const [dokmeha, updateDokmeha] = useState(buttons);\n\n function handleOnDragEnd(result) {\n if (!result.destination) return;\n\n const items = Array.from(dokmeha);\n const [reorderedItem] = items.splice(result.source.index, 1);\n items.splice(result.destination.index, 0, reorderedItem);\n\n updateDokmeha(items);\n }\n\n return (\n <div className=\"max-h-[400px] overflow-y-auto scrollYDesign w-full flex flex-col p-4 bg-white shadow rounded mt-3\">\n <TitleSubtitle\n subTitle={false}\n title={\"افراد حاضر در این سالن\"}\n titleClassName={\"font-bold text-primary\"}\n titleBorderClassName={\"w-1 h-5 bg-green-400 ml-1.5\"}\n />\n <IconText />\n <DragDropContext onDragEnd={handleOnDragEnd}>\n <Droppable droppableId=\"container\">\n {(provided) => (\n <div\n className=\"flex flex-col gap-y-4 justify-around mt-4 w-full\"\n {...provided.droppableProps}\n ref={provided.innerRef}\n id=\"container\"\n >\n {dokmeha.map((btn, index) => (\n <Draggable\n key={btn.id}\n draggableId={\"e\" + btn.id}\n index={index}\n >\n {(provided) => (\n <div className={`w-full px-1`}>\n <ButtonDivTag\n props={{\n ref: provided.innerRef,\n ...provided.draggableProps,\n ...provided.dragHandleProps,\n }}\n className={`${btn.className} w-full h-full text-white py-3 border-none text-xs rounded-sm`}\n style={provided.draggableProps.style}\n text={btn.name}\n />\n </div>\n )}\n </Draggable>\n ))}\n {provided.placeholder}\n </div>\n )}\n </Droppable>\n </DragDropContext>\n </div>\n );\n};\n\nexport default CardDesign2;\n\nCardDesign2.defaultProps = {\n buttons: [\n {\n id: 1,\n name: \"پنجره\",\n className: \"bg-[#FFF7BF]\",\n },\n {\n id: 2,\n name: \"کمک اولیه\",\n className: \"bg-[#DBFDFF]\",\n },\n {\n id: 3,\n name: \"درب خروجی\",\n className: \"bg-[#828282]\",\n },\n {\n id: 4,\n name: \"سیستم سرمایش\",\n className: \"bg-[#F6FFEB]\",\n },\n {\n id: 5,\n name: \"آب سردکن\",\n className: \"bg-[#F0FFB4]\",\n },\n {\n id: 6,\n name: \"سرویس بهداشتی\",\n className: \"bg-[#FFDD8E]\",\n },\n {\n id: 7,\n name: \"حمام\",\n className: \"bg-[#EEEFFF]\",\n },\n {\n id: 8,\n name: \"تخت\",\n className: \"bg-[#FFF5EE]\",\n },\n ],\n};\n"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AAEA,SAASC,eAAT,EAA0BC,SAA1B,EAAqCC,SAArC,QAAsD,qBAAtD;;;AAEA,MAAMC,WAAW,GAAG,QAAiB;EAAA;;EAAA,IAAhB;IAAEC;EAAF,CAAgB;EACnC,MAAM,CAACC,OAAD,EAAUC,aAAV,IAA2BV,QAAQ,CAACQ,OAAD,CAAzC;;EAEA,SAASG,eAAT,CAAyBC,MAAzB,EAAiC;IAC/B,IAAI,CAACA,MAAM,CAACC,WAAZ,EAAyB;IAEzB,MAAMC,KAAK,GAAGC,KAAK,CAACC,IAAN,CAAWP,OAA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