react-bsdd-search
Version:
bSDD Search React Component
52 lines (48 loc) • 1.93 kB
HTML
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="./css/viewer.css" />
<title>bSDD search example</title>
</head>
<body>
<div class="container-fluid h-100">
<div class="row h-100">
<div class="col-sm">
<div id="header" class="row">
<h1>bSDD search component example</h1>
<p>Check the page source for an example how to use this React bSDD search module</p>
</div>
<div class="overflow-auto" id="bsdd"></div>
</div>
<div class="col-sm overflow-auto" id="viewer">2D view</div>
</div>
</div>
<script type="module">
function callback(data) {
console.log(data);
document.getElementById('viewer').innerHTML = '<pre>' + JSON.stringify(data, undefined, 2) + '</pre>';
}
const config = {
baseUrl: 'https://test.bsdd.buildingsmart.org',
defaultDomains: [
{
value: 'https://identifier.buildingsmart.org/uri/digibase/volkerwesselsbv-0.1',
label: 'VolkerWessels Bouw & Vastgoed',
},
],
defaultSearch: {
value:
'https://identifier.buildingsmart.org/uri/digibase/volkerwesselsbv-0.1/class/vloer_beton_kanaalplaat_geisoleerd',
label: 'vloer_beton_kanaalplaat_geisoleerd',
},
};
const root = document.getElementById('bsdd');
BsddSearch.insertBsddSearch(root, callback, config);
</script>
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
<script src="./react-bsdd-search.umd.cjs"></script>
</body>
</html>