|
| 1 | +<!DOCTYPE html> |
| 2 | + |
| 3 | +<html lang="en"> |
| 4 | +<head> |
| 5 | + <meta charset="utf-8"> |
| 6 | + <meta name="viewport" content="width=device-width"> |
| 7 | + <title>FAIRsharing.org Source: components/Records/Search/Input/AdvancedSearch/QueryBuilderComponents/Countries.vue</title> |
| 8 | + |
| 9 | + <!--[if lt IE 9]> |
| 10 | + <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
| 11 | + <![endif]--> |
| 12 | + <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> |
| 13 | + |
| 14 | + <link type="text/css" rel="stylesheet" href="styles/site.yeti.css"> |
| 15 | + |
| 16 | +</head> |
| 17 | + |
| 18 | +<body> |
| 19 | + |
| 20 | +<div class="navbar navbar-default navbar-fixed-top navbar-inverse"> |
| 21 | +<div class="container"> |
| 22 | + <div class="navbar-header"> |
| 23 | + <a class="navbar-brand" href="index.html">FAIRsharing.org</a> |
| 24 | + <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation"> |
| 25 | + <span class="icon-bar"></span> |
| 26 | + <span class="icon-bar"></span> |
| 27 | + <span class="icon-bar"></span> |
| 28 | + </button> |
| 29 | + </div> |
| 30 | + <div class="navbar-collapse collapse" id="topNavigation"> |
| 31 | + <ul class="nav navbar-nav"> |
| 32 | + |
| 33 | + <li class="dropdown"> |
| 34 | + <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> |
| 35 | + <ul class="dropdown-menu "> |
| 36 | + <li><a href="Static.html">Static</a></li> |
| 37 | + </ul> |
| 38 | + </li> |
| 39 | + |
| 40 | + <li class="dropdown"> |
| 41 | + <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> |
| 42 | + <ul class="dropdown-menu "> |
| 43 | + <li><a href="module-Curator.html">Curator</a></li><li><a href="module-Home.html">Home</a></li><li><a href="module-Login.html">Login</a></li><li><a href="module-NewRecord.html">NewRecord</a></li><li><a href="module-Pagination.html">Pagination</a></li><li><a href="module-Signup.html">Signup</a></li><li><a href="module-User.html">User</a></li> |
| 44 | + </ul> |
| 45 | + </li> |
| 46 | + |
| 47 | + <li class="dropdown"> |
| 48 | + <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> |
| 49 | + <ul class="dropdown-menu "> |
| 50 | + <li><a href="ExternalRESTClients.html">ExternalRESTClients</a></li><li><a href="GraphQLClient.html">GraphQLClient</a></li><li><a href="RESTClient.html">RESTClient</a></li> |
| 51 | + </ul> |
| 52 | + </li> |
| 53 | + |
| 54 | + <li class="dropdown"> |
| 55 | + <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> |
| 56 | + <ul class="dropdown-menu "> |
| 57 | + <li><a href="global.html#buildFacets">buildFacets</a></li><li><a href="global.html#buildFilters">buildFilters</a></li><li><a href="global.html#filtersStore">filtersStore</a></li><li><a href="global.html#hackSearch">hackSearch</a></li><li><a href="global.html#hasValue">hasValue</a></li><li><a href="global.html#introspectionStore">introspectionStore</a></li><li><a href="global.html#isAllowedSize">isAllowedSize</a></li><li><a href="global.html#isEmail">isEmail</a></li><li><a href="global.html#isEmailOrUrl">isEmailOrUrl</a></li><li><a href="global.html#isImage">isImage</a></li><li><a href="global.html#isLongEnough">isLongEnough</a></li><li><a href="global.html#isMastodon">isMastodon</a></li><li><a href="global.html#isOrcid">isOrcid</a></li><li><a href="global.html#isRequired">isRequired</a></li><li><a href="global.html#isUrl">isUrl</a></li><li><a href="global.html#paramsAreExpired">paramsAreExpired</a></li><li><a href="global.html#parseParam">parseParam</a></li><li><a href="global.html#recordStore">recordStore</a></li><li><a href="global.html#recordTypes">recordTypes</a></li><li><a href="global.html#recordsStore">recordsStore</a></li><li><a href="global.html#removeItem">removeItem</a></li><li><a href="global.html#states">states</a></li><li><a href="global.html#uniqueValues">uniqueValues</a></li> |
| 58 | + </ul> |
| 59 | + </li> |
| 60 | + |
| 61 | + </ul> |
| 62 | + |
| 63 | + <div class="col-sm-3 col-md-3"> |
| 64 | + <form class="navbar-form" role="search"> |
| 65 | + <div class="input-group"> |
| 66 | + <input type="text" class="form-control" placeholder="Search" name="q" id="search-input"> |
| 67 | + <div class="input-group-btn"> |
| 68 | + <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button> |
| 69 | + </div> |
| 70 | + </div> |
| 71 | + </form> |
| 72 | + </div> |
| 73 | + |
| 74 | + </div> |
| 75 | + |
| 76 | +</div> |
| 77 | +</div> |
| 78 | + |
| 79 | + |
| 80 | +<div class="container" id="toc-content"> |
| 81 | +<div class="row"> |
| 82 | + |
| 83 | + |
| 84 | + <div class="col-md-12"> |
| 85 | + |
| 86 | + <div id="main"> |
| 87 | + |
| 88 | + |
| 89 | + <h1 class="page-title">Source: components/Records/Search/Input/AdvancedSearch/QueryBuilderComponents/Countries.vue</h1> |
| 90 | + |
| 91 | +<section> |
| 92 | + <article> |
| 93 | + <pre |
| 94 | + class="sunlight-highlight-javascript linenums"><template> |
| 95 | + <div class="d-flex width-90"> |
| 96 | + <TooltipComponent :tool-tip-text="toolTipText" /> |
| 97 | + <AutoCompleteComponent |
| 98 | + v-model="model" |
| 99 | + :item-value="itemValue" |
| 100 | + :item-list="getSearchCountries" |
| 101 | + :loading="getLoadingStatus" |
| 102 | + @input="selectedValue" |
| 103 | + @fetchData="getResults" |
| 104 | + /> |
| 105 | + </div> |
| 106 | +</template> |
| 107 | +<script> |
| 108 | +import { mapActions, mapGetters } from "vuex"; |
| 109 | + |
| 110 | +import countriesSearch from "@/store"; |
| 111 | + |
| 112 | +import AutoCompleteComponent from "./AutoCompleteComponent.vue"; |
| 113 | +import TooltipComponent from "./TooltipComponent.vue"; |
| 114 | + |
| 115 | +export default { |
| 116 | + name: "Countries", |
| 117 | + components: { TooltipComponent, AutoCompleteComponent }, |
| 118 | + props: { |
| 119 | + value: { |
| 120 | + type: Array, |
| 121 | + default: () => [], |
| 122 | + }, |
| 123 | + }, |
| 124 | + data: () => { |
| 125 | + return { |
| 126 | + itemSelected: [], |
| 127 | + itemValue: [], |
| 128 | + toolTipText: |
| 129 | + "Countries applicable to this resource or its data. Multiple selections will be joined with OR. Start typing to see Countries.", |
| 130 | + }; |
| 131 | + }, |
| 132 | + |
| 133 | + computed: { |
| 134 | + ...mapGetters("countriesSearch", ["getSearchCountries", "getLoadingStatus"]), |
| 135 | + ...mapGetters("advancedSearch", ["getEditDialogStatus"]), |
| 136 | + |
| 137 | + model: { |
| 138 | + get() { |
| 139 | + return this.itemSelected; |
| 140 | + }, |
| 141 | + set(value) { |
| 142 | + this.$emit("input", value); |
| 143 | + }, |
| 144 | + }, |
| 145 | + }, |
| 146 | + watch: { |
| 147 | + itemSelected(newValue) { |
| 148 | + this.itemValue = newValue; |
| 149 | + }, |
| 150 | + /** |
| 151 | + * Item list for the autocomplete should not be empty |
| 152 | + * It is assigned with selected values when edit field is opened |
| 153 | + */ |
| 154 | + getEditDialogStatus: { |
| 155 | + handler(open) { |
| 156 | + if (open) { |
| 157 | + if (this.value && this.value.length) { |
| 158 | + countriesSearch.commit( |
| 159 | + "countriesSearch/setSearchCountries", |
| 160 | + this.value |
| 161 | + ); |
| 162 | + } |
| 163 | + } |
| 164 | + }, |
| 165 | + immediate: true, |
| 166 | + }, |
| 167 | + }, |
| 168 | + mounted() { |
| 169 | + //Pre-fill selected values on edit advanced search is clicked and open |
| 170 | + this.itemValue = this.value; |
| 171 | + }, |
| 172 | + methods: { |
| 173 | + ...mapActions("countriesSearch", ["fetchSearchCountries"]), |
| 174 | + |
| 175 | + selectedValue(item) { |
| 176 | + this.itemSelected = item; |
| 177 | + }, |
| 178 | + getResults(queryParams) { |
| 179 | + if (queryParams) this.fetchSearchCountries(queryParams); |
| 180 | + }, |
| 181 | + }, |
| 182 | +}; |
| 183 | +</script> |
| 184 | +</pre> |
| 185 | + </article> |
| 186 | +</section> |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + </div> |
| 193 | + </div> |
| 194 | + |
| 195 | + <div class="clearfix"></div> |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | +</div> |
| 200 | +</div> |
| 201 | + |
| 202 | + |
| 203 | + <div class="modal fade" id="searchResults"> |
| 204 | + <div class="modal-dialog"> |
| 205 | + <div class="modal-content"> |
| 206 | + <div class="modal-header"> |
| 207 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 208 | + <h4 class="modal-title">Search results</h4> |
| 209 | + </div> |
| 210 | + <div class="modal-body"></div> |
| 211 | + <div class="modal-footer"> |
| 212 | + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> |
| 213 | + </div> |
| 214 | + </div><!-- /.modal-content --> |
| 215 | + </div><!-- /.modal-dialog --> |
| 216 | + </div> |
| 217 | + |
| 218 | + |
| 219 | +<footer> |
| 220 | + |
| 221 | + |
| 222 | + <span class="copyright"> |
| 223 | + DocStrap Copyright © 2012-2015 The contributors to the JSDoc3 and DocStrap projects. |
| 224 | + </span> |
| 225 | + |
| 226 | +<span class="jsdoc-message"> |
| 227 | + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> |
| 228 | + |
| 229 | + on Wed Jun 26th 2024 |
| 230 | + |
| 231 | + using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>. |
| 232 | +</span> |
| 233 | +</footer> |
| 234 | + |
| 235 | +<script src="scripts/docstrap.lib.js"></script> |
| 236 | +<script src="scripts/toc.js"></script> |
| 237 | + |
| 238 | + <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script> |
| 239 | + |
| 240 | + |
| 241 | +<script> |
| 242 | +$( function () { |
| 243 | + $( "[id*='$']" ).each( function () { |
| 244 | + var $this = $( this ); |
| 245 | + |
| 246 | + $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); |
| 247 | + } ); |
| 248 | + |
| 249 | + $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () { |
| 250 | + var $this = $( this ); |
| 251 | + |
| 252 | + var example = $this.find( "code" ); |
| 253 | + exampleText = example.html(); |
| 254 | + var lang = /{@lang (.*?)}/.exec( exampleText ); |
| 255 | + if ( lang && lang[1] ) { |
| 256 | + exampleText = exampleText.replace( lang[0], "" ); |
| 257 | + example.html( exampleText ); |
| 258 | + lang = lang[1]; |
| 259 | + } else { |
| 260 | + var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/); |
| 261 | + lang = langClassMatch ? langClassMatch[1] : "javascript"; |
| 262 | + } |
| 263 | + |
| 264 | + if ( lang ) { |
| 265 | + |
| 266 | + $this |
| 267 | + .addClass( "sunlight-highlight-" + lang ) |
| 268 | + .addClass( "linenums" ) |
| 269 | + .html( example.html() ); |
| 270 | + |
| 271 | + } |
| 272 | + } ); |
| 273 | + |
| 274 | + Sunlight.highlightAll( { |
| 275 | + lineNumbers : true, |
| 276 | + showMenu : true, |
| 277 | + enableDoclinks : true |
| 278 | + } ); |
| 279 | + |
| 280 | + $.catchAnchorLinks( { |
| 281 | + navbarOffset: 10 |
| 282 | + } ); |
| 283 | + $( "#toc" ).toc( { |
| 284 | + anchorName : function ( i, heading, prefix ) { |
| 285 | + return $( heading ).attr( "id" ) || ( prefix + i ); |
| 286 | + }, |
| 287 | + selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4", |
| 288 | + showAndHide : false, |
| 289 | + smoothScrolling: true |
| 290 | + } ); |
| 291 | + |
| 292 | + $( "#main span[id^='toc']" ).addClass( "toc-shim" ); |
| 293 | + $( '.dropdown-toggle' ).dropdown(); |
| 294 | + |
| 295 | + $( "table" ).each( function () { |
| 296 | + var $this = $( this ); |
| 297 | + $this.addClass('table'); |
| 298 | + } ); |
| 299 | + |
| 300 | +} ); |
| 301 | +</script> |
| 302 | + |
| 303 | + |
| 304 | + |
| 305 | +<!--Navigation and Symbol Display--> |
| 306 | + |
| 307 | + |
| 308 | +<!--Google Analytics--> |
| 309 | + |
| 310 | + |
| 311 | + |
| 312 | + <script type="text/javascript"> |
| 313 | + $(document).ready(function() { |
| 314 | + SearcherDisplay.init(); |
| 315 | + }); |
| 316 | + </script> |
| 317 | + |
| 318 | + |
| 319 | +</body> |
| 320 | +</html> |
0 commit comments