@unite-us/app-create-referral 0.15.81 → 0.15.82
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { isEmpty } from 'lodash';
|
|
4
|
-
import { CheckBoxField, Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from '@unite-us/
|
|
4
|
+
import { CheckBoxField, Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from '@unite-us/app-components';
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
function ContactDocumentsSelector(_ref) {
|
|
7
7
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactDocumentsSelector.js","names":["React","useState","useEffect","PropTypes","isEmpty","CheckBoxField","Table","TableBody","TableHeader","TableHeaderColumn","TableRow","TableRowColumn","jsx","_jsx","jsxs","_jsxs","ContactDocumentsSelector","_ref","documentFields","initialDocumentFields","setDocumentFields","openInNewWindow","url","window","open","handleOnCheck","index","updatedDocumentFields","attached","rows","map","field","i","documentTitle","document","title","documentUrl","clickable","children","className","concat","id","checked","label","hideLabel","showError","showHint","onChange","onClick","propTypes","array","defaultProps"],"sources":["../../../../../src/common/form/DocumentUploader/components/ContactDocumentsSelector.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'lodash';\nimport {\n CheckBoxField,\n Table,\n TableBody,\n TableHeader,\n TableHeaderColumn,\n TableRow,\n TableRowColumn,\n} from '@unite-us/
|
|
1
|
+
{"version":3,"file":"ContactDocumentsSelector.js","names":["React","useState","useEffect","PropTypes","isEmpty","CheckBoxField","Table","TableBody","TableHeader","TableHeaderColumn","TableRow","TableRowColumn","jsx","_jsx","jsxs","_jsxs","ContactDocumentsSelector","_ref","documentFields","initialDocumentFields","setDocumentFields","openInNewWindow","url","window","open","handleOnCheck","index","updatedDocumentFields","attached","rows","map","field","i","documentTitle","document","title","documentUrl","clickable","children","className","concat","id","checked","label","hideLabel","showError","showHint","onChange","onClick","propTypes","array","defaultProps"],"sources":["../../../../../src/common/form/DocumentUploader/components/ContactDocumentsSelector.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'lodash';\nimport {\n CheckBoxField,\n Table,\n TableBody,\n TableHeader,\n TableHeaderColumn,\n TableRow,\n TableRowColumn,\n} from '@unite-us/app-components';\n\nfunction ContactDocumentsSelector({ documentFields: initialDocumentFields = [] }) {\n const [documentFields, setDocumentFields] = useState(initialDocumentFields);\n\n useEffect(() => {\n setDocumentFields(initialDocumentFields);\n }, [initialDocumentFields]);\n\n const openInNewWindow = (url) => {\n window.open(url);\n };\n\n const handleOnCheck = (index) => {\n const updatedDocumentFields = [...documentFields];\n updatedDocumentFields[index].attached = !updatedDocumentFields[index].attached;\n setDocumentFields(updatedDocumentFields);\n };\n\n if (isEmpty(documentFields)) {\n return null;\n }\n\n const rows = documentFields.map((field, i) => {\n const documentTitle = field.document.title;\n const documentUrl = field.document.url;\n return (\n <TableRow key={i} clickable={false}>\n <TableRowColumn className=\"contact-documents-selector__checkboxes\">\n <div data-test-element={`document-${i}-checkbox`}>\n <CheckBoxField\n id={`document-${i}-checkbox`}\n checked={field.attached}\n label=\"\"\n hideLabel\n showError={false}\n showHint={false}\n onChange={() => handleOnCheck(i)}\n />\n </div>\n </TableRowColumn>\n <TableRowColumn>\n {\n documentUrl ? (<a onClick={() => openInNewWindow(documentUrl)}>{documentTitle}</a>\n ) : documentTitle\n }\n </TableRowColumn>\n <TableRowColumn>\n </TableRowColumn>\n <TableRowColumn>\n </TableRowColumn>\n </TableRow>\n );\n });\n\n return (\n <Table\n id=\"contact-documents-selector-table\"\n className=\"contact-documents-selector\"\n >\n <TableHeader>\n <TableRow>\n <TableHeaderColumn />\n <TableHeaderColumn>File Name</TableHeaderColumn>\n <TableHeaderColumn>Uploaded By</TableHeaderColumn>\n <TableHeaderColumn>Date Modified</TableHeaderColumn>\n </TableRow>\n </TableHeader>\n <TableBody>{rows}</TableBody>\n </Table>\n );\n}\n\nContactDocumentsSelector.propTypes = {\n documentFields: PropTypes.array,\n};\n\nContactDocumentsSelector.defaultProps = {\n documentFields: [],\n};\n\nexport default ContactDocumentsSelector;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SACEC,aAAa,EACbC,KAAK,EACLC,SAAS,EACTC,WAAW,EACXC,iBAAiB,EACjBC,QAAQ,EACRC,cAAc,QACT,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElC,SAASC,wBAAwBA,CAAAC,IAAA,EAAiD;EAAA,IAAhD;IAAEC,cAAc,EAAEC,qBAAqB,GAAG;EAAG,CAAC,GAAAF,IAAA;EAC9E,MAAM,CAACC,cAAc,EAAEE,iBAAiB,CAAC,GAAGnB,QAAQ,CAACkB,qBAAqB,CAAC;EAE3EjB,SAAS,CAAC,MAAM;IACdkB,iBAAiB,CAACD,qBAAqB,CAAC;EAC1C,CAAC,EAAE,CAACA,qBAAqB,CAAC,CAAC;EAE3B,MAAME,eAAe,GAAIC,GAAG,IAAK;IAC/BC,MAAM,CAACC,IAAI,CAACF,GAAG,CAAC;EAClB,CAAC;EAED,MAAMG,aAAa,GAAIC,KAAK,IAAK;IAC/B,MAAMC,qBAAqB,GAAG,CAAC,GAAGT,cAAc,CAAC;IACjDS,qBAAqB,CAACD,KAAK,CAAC,CAACE,QAAQ,GAAG,CAACD,qBAAqB,CAACD,KAAK,CAAC,CAACE,QAAQ;IAC9ER,iBAAiB,CAACO,qBAAqB,CAAC;EAC1C,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