Best JavaScript code snippet using argos
Dropdowns.js
Source:Dropdowns.js
1import React from 'react';2import {3 Row,4 Col,5 Grid,6 Panel,7 Button,8 MenuItem,9 PanelBody,10 PanelHeader,11 ButtonGroup,12 SplitButton,13 ButtonToolbar,14 PanelContainer,15 DropdownButton,16 SplitHoverButton,17 DropdownHoverButton,18} from '@sketchpixy/rubix';19class DropdownsAndDropups extends React.Component {20 render() {21 return (22 <PanelContainer noOverflow>23 <Panel>24 <PanelHeader className='bg-darkgreen45 fg-white'>25 <Grid>26 <Row>27 <Col xs={12}>28 <h4>Dropdowns and Dropups</h4>29 </Col>30 </Row>31 </Grid>32 </PanelHeader>33 <PanelBody>34 <Grid>35 <Row>36 <Col xs={6}>37 <div>38 <DropdownButton bsStyle='darkgreen45' title='Basic' id='dropdown-basic'>39 <MenuItem eventKey="1">Action</MenuItem>40 <MenuItem eventKey="2">Another action</MenuItem>41 <MenuItem eventKey="3" active>Active Item</MenuItem>42 <MenuItem divider />43 <MenuItem disabled eventKey="4">Disabled link</MenuItem>44 <MenuItem eventKey="5">Separated link</MenuItem>45 </DropdownButton>46 </div>47 <br />48 <div>49 <DropdownButton bsStyle='lightblue' title='With headers' id='dropdown-headers'>50 <MenuItem header>Dropdown Header</MenuItem>51 <MenuItem eventKey="1">Action</MenuItem>52 <MenuItem eventKey="2">Another action</MenuItem>53 <MenuItem eventKey="3" active>Active Item</MenuItem>54 <MenuItem divider />55 <MenuItem header>Dropdown Header</MenuItem>56 <MenuItem disabled eventKey="4">Disabled link</MenuItem>57 <MenuItem eventKey="5">Separated link</MenuItem>58 </DropdownButton>59 </div>60 </Col>61 <Col xs={6} className='text-right'>62 <div>63 <DropdownButton outlined bsStyle='darkgreen45' title='Outlined' id='dropdown-outlined' pullRight>64 <MenuItem eventKey="1">Action</MenuItem>65 <MenuItem eventKey="2">Another action</MenuItem>66 <MenuItem eventKey="3" active>Active Item</MenuItem>67 <MenuItem divider />68 <MenuItem disabled eventKey="4">Disabled link</MenuItem>69 <MenuItem eventKey="5">Separated link</MenuItem>70 </DropdownButton>71 </div>72 <br />73 <div>74 <DropdownButton bsStyle='orange' title='Disabled' id='dropdown-disabled' disabled outlined>75 <MenuItem header>Dropdown Header</MenuItem>76 <MenuItem eventKey="1">Action</MenuItem>77 <MenuItem eventKey="2">Another action</MenuItem>78 <MenuItem eventKey="3" active>Active Item</MenuItem>79 <MenuItem divider />80 <MenuItem header>Dropdown Header</MenuItem>81 <MenuItem disabled eventKey="4">Disabled link</MenuItem>82 <MenuItem eventKey="5">Separated link</MenuItem>83 </DropdownButton>84 </div>85 </Col>86 </Row>87 <hr />88 <Row>89 <Col xs={6}>90 <div>91 <DropdownButton bsStyle='darkgreen45' title='Basic' id='dropdown-basic-dropup' dropup>92 <MenuItem eventKey="1">Action</MenuItem>93 <MenuItem eventKey="2">Another action</MenuItem>94 <MenuItem eventKey="3" active>Active Item</MenuItem>95 <MenuItem divider />96 <MenuItem disabled eventKey="4">Disabled link</MenuItem>97 <MenuItem eventKey="5">Separated link</MenuItem>98 </DropdownButton>99 </div>100 <br />101 <div>102 <DropdownButton bsStyle='lightblue' title='With headers' id='dropdown-headers-dropup' dropup>103 <MenuItem header>Dropdown Header</MenuItem>104 <MenuItem eventKey="1">Action</MenuItem>105 <MenuItem eventKey="2">Another action</MenuItem>106 <MenuItem eventKey="3" active>Active Item</MenuItem>107 <MenuItem divider />108 <MenuItem header>Dropdown Header</MenuItem>109 <MenuItem disabled eventKey="4">Disabled link</MenuItem>110 <MenuItem eventKey="5">Separated link</MenuItem>111 </DropdownButton>112 </div>113 </Col>114 <Col xs={6} className='text-right'>115 <div>116 <DropdownButton outlined bsStyle='darkgreen45' title='Outlined' id='dropdown-outlined-dropup' pullRight dropup>117 <MenuItem eventKey="1">Action</MenuItem>118 <MenuItem eventKey="2">Another action</MenuItem>119 <MenuItem eventKey="3" active>Active Item</MenuItem>120 <MenuItem divider />121 <MenuItem disabled eventKey="4">Disabled link</MenuItem>122 <MenuItem eventKey="5">Separated link</MenuItem>123 </DropdownButton>124 </div>125 <br />126 <div>127 <DropdownButton bsStyle='orange' title='Disabled' id='dropdown-disabled-dropup' disabled dropup outlined>128 <MenuItem header>Dropdown Header</MenuItem>129 <MenuItem eventKey="1">Action</MenuItem>130 <MenuItem eventKey="2">Another action</MenuItem>131 <MenuItem eventKey="3" active>Active Item</MenuItem>132 <MenuItem divider />133 <MenuItem header>Dropdown Header</MenuItem>134 <MenuItem disabled eventKey="4">Disabled link</MenuItem>135 <MenuItem eventKey="5">Separated link</MenuItem>136 </DropdownButton>137 </div>138 </Col>139 </Row>140 <br />141 </Grid>142 </PanelBody>143 </Panel>144 </PanelContainer>145 );146 }147}148class DropdownsAndDropupsHover extends React.Component {149 render() {150 return (151 <PanelContainer noOverflow>152 <Panel>153 <PanelHeader className='bg-brown fg-white'>154 <Grid>155 <Row>156 <Col xs={12}>157 <h4>Dropdowns and Dropups (Hover buttons)</h4>158 </Col>159 </Row>160 </Grid>161 </PanelHeader>162 <PanelBody>163 <Grid>164 <Row>165 <Col xs={6}>166 <div>167 <DropdownHoverButton bsStyle='brown' title='Basic' id='dropdown-hover-basic'>168 <MenuItem eventKey="1">Action</MenuItem>169 <MenuItem eventKey="2">Another action</MenuItem>170 <MenuItem eventKey="3" active>Active Item</MenuItem>171 <MenuItem divider />172 <MenuItem disabled eventKey="4">Disabled link</MenuItem>173 <MenuItem eventKey="5">Separated link</MenuItem>174 </DropdownHoverButton>175 </div>176 <br />177 <div>178 <DropdownHoverButton bsStyle='lightblue' title='With headers' id='dropdown-hover-headers'>179 <MenuItem header>Dropdown Header</MenuItem>180 <MenuItem eventKey="1">Action</MenuItem>181 <MenuItem eventKey="2">Another action</MenuItem>182 <MenuItem eventKey="3" active>Active Item</MenuItem>183 <MenuItem divider />184 <MenuItem header>Dropdown Header</MenuItem>185 <MenuItem disabled eventKey="4">Disabled link</MenuItem>186 <MenuItem eventKey="5">Separated link</MenuItem>187 </DropdownHoverButton>188 </div>189 </Col>190 <Col xs={6} className='text-right'>191 <div>192 <DropdownHoverButton outlined bsStyle='darkgreen45' title='Outlined' id='dropdown-hover-outlined' pullRight>193 <MenuItem eventKey="1">Action</MenuItem>194 <MenuItem eventKey="2">Another action</MenuItem>195 <MenuItem eventKey="3" active>Active Item</MenuItem>196 <MenuItem divider />197 <MenuItem disabled eventKey="4">Disabled link</MenuItem>198 <MenuItem eventKey="5">Separated link</MenuItem>199 </DropdownHoverButton>200 </div>201 <br />202 <div>203 <DropdownHoverButton bsStyle='orange' title='Disabled' id='dropdown-hover-disabled' disabled outlined>204 <MenuItem header>Dropdown Header</MenuItem>205 <MenuItem eventKey="1">Action</MenuItem>206 <MenuItem eventKey="2">Another action</MenuItem>207 <MenuItem eventKey="3" active>Active Item</MenuItem>208 <MenuItem divider />209 <MenuItem header>Dropdown Header</MenuItem>210 <MenuItem disabled eventKey="4">Disabled link</MenuItem>211 <MenuItem eventKey="5">Separated link</MenuItem>212 </DropdownHoverButton>213 </div>214 </Col>215 </Row>216 <hr />217 <Row>218 <Col xs={6}>219 <div>220 <DropdownHoverButton bsStyle='brown' title='Basic' id='dropdown-hover-basic-dropup' dropup>221 <MenuItem eventKey="1">Action</MenuItem>222 <MenuItem eventKey="2">Another action</MenuItem>223 <MenuItem eventKey="3" active>Active Item</MenuItem>224 <MenuItem divider />225 <MenuItem disabled eventKey="4">Disabled link</MenuItem>226 <MenuItem eventKey="5">Separated link</MenuItem>227 </DropdownHoverButton>228 </div>229 <br />230 <div>231 <DropdownHoverButton bsStyle='lightblue' title='With headers' id='dropdown-hover-headers-dropup' dropup>232 <MenuItem header>Dropdown Header</MenuItem>233 <MenuItem eventKey="1">Action</MenuItem>234 <MenuItem eventKey="2">Another action</MenuItem>235 <MenuItem eventKey="3" active>Active Item</MenuItem>236 <MenuItem divider />237 <MenuItem header>Dropdown Header</MenuItem>238 <MenuItem disabled eventKey="4">Disabled link</MenuItem>239 <MenuItem eventKey="5">Separated link</MenuItem>240 </DropdownHoverButton>241 </div>242 </Col>243 <Col xs={6} className='text-right'>244 <div>245 <DropdownHoverButton outlined bsStyle='darkgreen45' title='Outlined' id='dropdown-hover-outlined-dropup' pullRight dropup>246 <MenuItem eventKey="1">Action</MenuItem>247 <MenuItem eventKey="2">Another action</MenuItem>248 <MenuItem eventKey="3" active>Active Item</MenuItem>249 <MenuItem divider />250 <MenuItem disabled eventKey="4">Disabled link</MenuItem>251 <MenuItem eventKey="5">Separated link</MenuItem>252 </DropdownHoverButton>253 </div>254 <br />255 <div>256 <DropdownHoverButton bsStyle='orange' title='Disabled' id='dropdown-hover-disabled-dropup' disabled dropup outlined>257 <MenuItem header>Dropdown Header</MenuItem>258 <MenuItem eventKey="1">Action</MenuItem>259 <MenuItem eventKey="2">Another action</MenuItem>260 <MenuItem eventKey="3" active>Active Item</MenuItem>261 <MenuItem divider />262 <MenuItem header>Dropdown Header</MenuItem>263 <MenuItem disabled eventKey="4">Disabled link</MenuItem>264 <MenuItem eventKey="5">Separated link</MenuItem>265 </DropdownHoverButton>266 </div>267 </Col>268 </Row>269 <br />270 </Grid>271 </PanelBody>272 </Panel>273 </PanelContainer>274 );275 }276}277class DropdownsAndDropupsInverse extends React.Component {278 render() {279 return (280 <PanelContainer noOverflow containerClasses='bg-darkgreen45 fg-white'>281 <Panel>282 <PanelHeader className='bg-darkgreen45 fg-white'>283 <Grid>284 <Row>285 <Col xs={12}>286 <h4>Dropdowns and Dropups (inverse)</h4>287 </Col>288 </Row>289 </Grid>290 </PanelHeader>291 <PanelBody>292 <Grid>293 <Row>294 <Col xs={6}>295 <div>296 <DropdownButton inverse bsStyle='darkgreen45' title='Basic' id='dropdown-basic-inverse'>297 <MenuItem eventKey="1">Action</MenuItem>298 <MenuItem eventKey="2">Another action</MenuItem>299 <MenuItem eventKey="3" active>Active Item</MenuItem>300 <MenuItem divider />301 <MenuItem disabled eventKey="4">Disabled link</MenuItem>302 <MenuItem eventKey="5">Separated link</MenuItem>303 </DropdownButton>304 </div>305 <br />306 <div>307 <DropdownButton inverse bsStyle='lightblue' title='With headers' id='dropdown-headers-inverse'>308 <MenuItem header>Dropdown Header</MenuItem>309 <MenuItem eventKey="1">Action</MenuItem>310 <MenuItem eventKey="2">Another action</MenuItem>311 <MenuItem eventKey="3" active>Active Item</MenuItem>312 <MenuItem divider />313 <MenuItem header>Dropdown Header</MenuItem>314 <MenuItem disabled eventKey="4">Disabled link</MenuItem>315 <MenuItem eventKey="5">Separated link</MenuItem>316 </DropdownButton>317 </div>318 </Col>319 <Col xs={6} className='text-right'>320 <div>321 <DropdownButton inverse bsStyle='darkgreen45' title='Outlined' id='dropdown-outlined-inverse' pullRight>322 <MenuItem eventKey="1">Action</MenuItem>323 <MenuItem eventKey="2">Another action</MenuItem>324 <MenuItem eventKey="3" active>Active Item</MenuItem>325 <MenuItem divider />326 <MenuItem disabled eventKey="4">Disabled link</MenuItem>327 <MenuItem eventKey="5">Separated link</MenuItem>328 </DropdownButton>329 </div>330 <br />331 <div>332 <DropdownButton inverse bsStyle='orange' title='Disabled' id='dropdown-disabled-inverse' disabled>333 <MenuItem header>Dropdown Header</MenuItem>334 <MenuItem eventKey="1">Action</MenuItem>335 <MenuItem eventKey="2">Another action</MenuItem>336 <MenuItem eventKey="3" active>Active Item</MenuItem>337 <MenuItem divider />338 <MenuItem header>Dropdown Header</MenuItem>339 <MenuItem disabled eventKey="4">Disabled link</MenuItem>340 <MenuItem eventKey="5">Separated link</MenuItem>341 </DropdownButton>342 </div>343 </Col>344 </Row>345 <hr className='border-lightgreen' />346 <Row>347 <Col xs={6}>348 <div>349 <DropdownButton inverse bsStyle='darkgreen45' title='Basic' id='dropdown-basic-dropup-inverse' dropup>350 <MenuItem eventKey="1">Action</MenuItem>351 <MenuItem eventKey="2">Another action</MenuItem>352 <MenuItem eventKey="3" active>Active Item</MenuItem>353 <MenuItem divider />354 <MenuItem disabled eventKey="4">Disabled link</MenuItem>355 <MenuItem eventKey="5">Separated link</MenuItem>356 </DropdownButton>357 </div>358 <br />359 <div>360 <DropdownButton inverse bsStyle='lightblue' title='With headers' id='dropdown-headers-dropup-inverse' dropup>361 <MenuItem header>Dropdown Header</MenuItem>362 <MenuItem eventKey="1">Action</MenuItem>363 <MenuItem eventKey="2">Another action</MenuItem>364 <MenuItem eventKey="3" active>Active Item</MenuItem>365 <MenuItem divider />366 <MenuItem header>Dropdown Header</MenuItem>367 <MenuItem disabled eventKey="4">Disabled link</MenuItem>368 <MenuItem eventKey="5">Separated link</MenuItem>369 </DropdownButton>370 </div>371 </Col>372 <Col xs={6} className='text-right'>373 <div>374 <DropdownButton inverse bsStyle='darkgreen45' title='Outlined' id='dropdown-outlined-dropup-inverse' pullRight dropup>375 <MenuItem eventKey="1">Action</MenuItem>376 <MenuItem eventKey="2">Another action</MenuItem>377 <MenuItem eventKey="3" active>Active Item</MenuItem>378 <MenuItem divider />379 <MenuItem disabled eventKey="4">Disabled link</MenuItem>380 <MenuItem eventKey="5">Separated link</MenuItem>381 </DropdownButton>382 </div>383 <br />384 <div>385 <DropdownButton inverse bsStyle='orange' title='Disabled' id='dropdown-disabled-dropup-inverse' disabled dropup>386 <MenuItem header>Dropdown Header</MenuItem>387 <MenuItem eventKey="1">Action</MenuItem>388 <MenuItem eventKey="2">Another action</MenuItem>389 <MenuItem eventKey="3" active>Active Item</MenuItem>390 <MenuItem divider />391 <MenuItem header>Dropdown Header</MenuItem>392 <MenuItem disabled eventKey="4">Disabled link</MenuItem>393 <MenuItem eventKey="5">Separated link</MenuItem>394 </DropdownButton>395 </div>396 </Col>397 </Row>398 <br />399 </Grid>400 </PanelBody>401 </Panel>402 </PanelContainer>403 );404 }405}406class SplitDropdownsAndDropups extends React.Component {407 render() {408 return (409 <PanelContainer noOverflow>410 <Panel>411 <PanelHeader className='bg-pinkishred fg-white'>412 <Grid>413 <Row>414 <Col xs={12}>415 <h4>Split Button Dropdowns and Dropups</h4>416 </Col>417 </Row>418 </Grid>419 </PanelHeader>420 <PanelBody>421 <Grid>422 <Row>423 <Col xs={6}>424 <div>425 <SplitButton bsStyle='pinkishred' title='Basic' id='split-dropdown-basic'>426 <MenuItem eventKey="1">Action</MenuItem>427 <MenuItem eventKey="2">Another action</MenuItem>428 <MenuItem eventKey="3" active>Active Item</MenuItem>429 <MenuItem divider />430 <MenuItem disabled eventKey="4">Disabled link</MenuItem>431 <MenuItem eventKey="5">Separated link</MenuItem>432 </SplitButton>433 </div>434 <br />435 <div>436 <SplitButton bsStyle='lightblue' title='With headers' id='split-dropdown-headers'>437 <MenuItem header>Dropdown Header</MenuItem>438 <MenuItem eventKey="1">Action</MenuItem>439 <MenuItem eventKey="2">Another action</MenuItem>440 <MenuItem eventKey="3" active>Active Item</MenuItem>441 <MenuItem divider />442 <MenuItem header>Dropdown Header</MenuItem>443 <MenuItem disabled eventKey="4">Disabled link</MenuItem>444 <MenuItem eventKey="5">Separated link</MenuItem>445 </SplitButton>446 </div>447 </Col>448 <Col xs={6} className='text-right'>449 <div>450 <SplitButton outlined bsStyle='darkgreen45' title='Outlined' id='split-dropdown-outlined' pullRight>451 <MenuItem eventKey="1">Action</MenuItem>452 <MenuItem eventKey="2">Another action</MenuItem>453 <MenuItem eventKey="3" active>Active Item</MenuItem>454 <MenuItem divider />455 <MenuItem disabled eventKey="4">Disabled link</MenuItem>456 <MenuItem eventKey="5">Separated link</MenuItem>457 </SplitButton>458 </div>459 <br />460 <div>461 <SplitButton bsStyle='orange' title='Disabled' id='split-dropdown-disabled' disabled outlined>462 <MenuItem header>Dropdown Header</MenuItem>463 <MenuItem eventKey="1">Action</MenuItem>464 <MenuItem eventKey="2">Another action</MenuItem>465 <MenuItem eventKey="3" active>Active Item</MenuItem>466 <MenuItem divider />467 <MenuItem header>Dropdown Header</MenuItem>468 <MenuItem disabled eventKey="4">Disabled link</MenuItem>469 <MenuItem eventKey="5">Separated link</MenuItem>470 </SplitButton>471 </div>472 </Col>473 </Row>474 <hr />475 <Row>476 <Col xs={6}>477 <div>478 <SplitButton bsStyle='pinkishred' title='Basic' id='split-dropdown-basic-dropup' dropup>479 <MenuItem eventKey="1">Action</MenuItem>480 <MenuItem eventKey="2">Another action</MenuItem>481 <MenuItem eventKey="3" active>Active Item</MenuItem>482 <MenuItem divider />483 <MenuItem disabled eventKey="4">Disabled link</MenuItem>484 <MenuItem eventKey="5">Separated link</MenuItem>485 </SplitButton>486 </div>487 <br />488 <div>489 <SplitButton bsStyle='lightblue' title='With headers' id='split-dropdown-headers-dropup' dropup>490 <MenuItem header>Dropdown Header</MenuItem>491 <MenuItem eventKey="1">Action</MenuItem>492 <MenuItem eventKey="2">Another action</MenuItem>493 <MenuItem eventKey="3" active>Active Item</MenuItem>494 <MenuItem divider />495 <MenuItem header>Dropdown Header</MenuItem>496 <MenuItem disabled eventKey="4">Disabled link</MenuItem>497 <MenuItem eventKey="5">Separated link</MenuItem>498 </SplitButton>499 </div>500 </Col>501 <Col xs={6} className='text-right'>502 <div>503 <SplitButton outlined bsStyle='darkgreen45' title='Outlined' id='split-dropdown-outlined-dropup' pullRight dropup>504 <MenuItem eventKey="1">Action</MenuItem>505 <MenuItem eventKey="2">Another action</MenuItem>506 <MenuItem eventKey="3" active>Active Item</MenuItem>507 <MenuItem divider />508 <MenuItem disabled eventKey="4">Disabled link</MenuItem>509 <MenuItem eventKey="5">Separated link</MenuItem>510 </SplitButton>511 </div>512 <br />513 <div>514 <SplitButton bsStyle='orange' title='Disabled' id='split-dropdown-disabled-dropup' disabled dropup outlined>515 <MenuItem header>Dropdown Header</MenuItem>516 <MenuItem eventKey="1">Action</MenuItem>517 <MenuItem eventKey="2">Another action</MenuItem>518 <MenuItem eventKey="3" active>Active Item</MenuItem>519 <MenuItem divider />520 <MenuItem header>Dropdown Header</MenuItem>521 <MenuItem disabled eventKey="4">Disabled link</MenuItem>522 <MenuItem eventKey="5">Separated link</MenuItem>523 </SplitButton>524 </div>525 </Col>526 </Row>527 <br />528 </Grid>529 </PanelBody>530 </Panel>531 </PanelContainer>532 );533 }534}535class SplitDropdownsAndDropupsHover extends React.Component {536 render() {537 return (538 <PanelContainer noOverflow>539 <Panel>540 <PanelHeader className='bg-blue fg-white'>541 <Grid>542 <Row>543 <Col xs={12}>544 <h4>Split Button Dropdowns and Dropups (Hover buttons)</h4>545 </Col>546 </Row>547 </Grid>548 </PanelHeader>549 <PanelBody>550 <Grid>551 <Row>552 <Col xs={6}>553 <div>554 <SplitHoverButton bsStyle='blue' title='Basic' id='split-hover-dropdown-basic'>555 <MenuItem eventKey="1">Action</MenuItem>556 <MenuItem eventKey="2">Another action</MenuItem>557 <MenuItem eventKey="3" active>Active Item</MenuItem>558 <MenuItem divider />559 <MenuItem disabled eventKey="4">Disabled link</MenuItem>560 <MenuItem eventKey="5">Separated link</MenuItem>561 </SplitHoverButton>562 </div>563 <br />564 <div>565 <SplitHoverButton bsStyle='lightblue' title='With headers' id='split-hover-dropdown-headers'>566 <MenuItem header>Dropdown Header</MenuItem>567 <MenuItem eventKey="1">Action</MenuItem>568 <MenuItem eventKey="2">Another action</MenuItem>569 <MenuItem eventKey="3" active>Active Item</MenuItem>570 <MenuItem divider />571 <MenuItem header>Dropdown Header</MenuItem>572 <MenuItem disabled eventKey="4">Disabled link</MenuItem>573 <MenuItem eventKey="5">Separated link</MenuItem>574 </SplitHoverButton>575 </div>576 </Col>577 <Col xs={6} className='text-right'>578 <div>579 <SplitHoverButton outlined bsStyle='darkgreen45' title='Outlined' id='split-hover-dropdown-outlined' pullRight>580 <MenuItem eventKey="1">Action</MenuItem>581 <MenuItem eventKey="2">Another action</MenuItem>582 <MenuItem eventKey="3" active>Active Item</MenuItem>583 <MenuItem divider />584 <MenuItem disabled eventKey="4">Disabled link</MenuItem>585 <MenuItem eventKey="5">Separated link</MenuItem>586 </SplitHoverButton>587 </div>588 <br />589 <div>590 <SplitHoverButton bsStyle='orange' title='Disabled' id='split-hover-dropdown-disabled' disabled outlined>591 <MenuItem header>Dropdown Header</MenuItem>592 <MenuItem eventKey="1">Action</MenuItem>593 <MenuItem eventKey="2">Another action</MenuItem>594 <MenuItem eventKey="3" active>Active Item</MenuItem>595 <MenuItem divider />596 <MenuItem header>Dropdown Header</MenuItem>597 <MenuItem disabled eventKey="4">Disabled link</MenuItem>598 <MenuItem eventKey="5">Separated link</MenuItem>599 </SplitHoverButton>600 </div>601 </Col>602 </Row>603 <hr />604 <Row>605 <Col xs={6}>606 <div>607 <SplitHoverButton bsStyle='blue' title='Basic' id='split-hover-dropdown-basic-dropup' dropup>608 <MenuItem eventKey="1">Action</MenuItem>609 <MenuItem eventKey="2">Another action</MenuItem>610 <MenuItem eventKey="3" active>Active Item</MenuItem>611 <MenuItem divider />612 <MenuItem disabled eventKey="4">Disabled link</MenuItem>613 <MenuItem eventKey="5">Separated link</MenuItem>614 </SplitHoverButton>615 </div>616 <br />617 <div>618 <SplitHoverButton bsStyle='lightblue' title='With headers' id='split-hover-dropdown-headers-dropup' dropup>619 <MenuItem header>Dropdown Header</MenuItem>620 <MenuItem eventKey="1">Action</MenuItem>621 <MenuItem eventKey="2">Another action</MenuItem>622 <MenuItem eventKey="3" active>Active Item</MenuItem>623 <MenuItem divider />624 <MenuItem header>Dropdown Header</MenuItem>625 <MenuItem disabled eventKey="4">Disabled link</MenuItem>626 <MenuItem eventKey="5">Separated link</MenuItem>627 </SplitHoverButton>628 </div>629 </Col>630 <Col xs={6} className='text-right'>631 <div>632 <SplitHoverButton outlined bsStyle='darkgreen45' title='Outlined' id='split-hover-dropdown-outlined-dropup' pullRight dropup>633 <MenuItem eventKey="1">Action</MenuItem>634 <MenuItem eventKey="2">Another action</MenuItem>635 <MenuItem eventKey="3" active>Active Item</MenuItem>636 <MenuItem divider />637 <MenuItem disabled eventKey="4">Disabled link</MenuItem>638 <MenuItem eventKey="5">Separated link</MenuItem>639 </SplitHoverButton>640 </div>641 <br />642 <div>643 <SplitHoverButton bsStyle='orange' title='Disabled' id='split-hover-dropdown-disabled-dropup' disabled dropup outlined>644 <MenuItem header>Dropdown Header</MenuItem>645 <MenuItem eventKey="1">Action</MenuItem>646 <MenuItem eventKey="2">Another action</MenuItem>647 <MenuItem eventKey="3" active>Active Item</MenuItem>648 <MenuItem divider />649 <MenuItem header>Dropdown Header</MenuItem>650 <MenuItem disabled eventKey="4">Disabled link</MenuItem>651 <MenuItem eventKey="5">Separated link</MenuItem>652 </SplitHoverButton>653 </div>654 </Col>655 </Row>656 <br />657 </Grid>658 </PanelBody>659 </Panel>660 </PanelContainer>661 );662 }663}664class SplitDropdownsAndDropupsInverse extends React.Component {665 render() {666 return (667 <PanelContainer noOverflow containerClasses='bg-pinkishred fg-white'>668 <Panel>669 <PanelHeader className='bg-pinkishred fg-white'>670 <Grid>671 <Row>672 <Col xs={12}>673 <h4>Split Button Dropdowns and Dropups (inverse)</h4>674 </Col>675 </Row>676 </Grid>677 </PanelHeader>678 <PanelBody>679 <Grid>680 <Row>681 <Col xs={6}>682 <div>683 <SplitButton inverse bsStyle='pinkishred' title='Basic' id='split-dropdown-basic-inverse'>684 <MenuItem eventKey="1">Action</MenuItem>685 <MenuItem eventKey="2">Another action</MenuItem>686 <MenuItem eventKey="3" active>Active Item</MenuItem>687 <MenuItem divider />688 <MenuItem disabled eventKey="4">Disabled link</MenuItem>689 <MenuItem eventKey="5">Separated link</MenuItem>690 </SplitButton>691 </div>692 <br />693 <div>694 <SplitButton inverse bsStyle='lightblue' title='With headers' id='split-dropdown-headers-inverse'>695 <MenuItem header>Dropdown Header</MenuItem>696 <MenuItem eventKey="1">Action</MenuItem>697 <MenuItem eventKey="2">Another action</MenuItem>698 <MenuItem eventKey="3" active>Active Item</MenuItem>699 <MenuItem divider />700 <MenuItem header>Dropdown Header</MenuItem>701 <MenuItem disabled eventKey="4">Disabled link</MenuItem>702 <MenuItem eventKey="5">Separated link</MenuItem>703 </SplitButton>704 </div>705 </Col>706 <Col xs={6} className='text-right'>707 <div>708 <SplitButton inverse bsStyle='pinkishred' title='Outlined' id='split-dropdown-outlined-inverse' pullRight>709 <MenuItem eventKey="1">Action</MenuItem>710 <MenuItem eventKey="2">Another action</MenuItem>711 <MenuItem eventKey="3" active>Active Item</MenuItem>712 <MenuItem divider />713 <MenuItem disabled eventKey="4">Disabled link</MenuItem>714 <MenuItem eventKey="5">Separated link</MenuItem>715 </SplitButton>716 </div>717 <br />718 <div>719 <SplitButton inverse bsStyle='orange' title='Disabled' id='split-dropdown-disabled-inverse' disabled>720 <MenuItem header>Dropdown Header</MenuItem>721 <MenuItem eventKey="1">Action</MenuItem>722 <MenuItem eventKey="2">Another action</MenuItem>723 <MenuItem eventKey="3" active>Active Item</MenuItem>724 <MenuItem divider />725 <MenuItem header>Dropdown Header</MenuItem>726 <MenuItem disabled eventKey="4">Disabled link</MenuItem>727 <MenuItem eventKey="5">Separated link</MenuItem>728 </SplitButton>729 </div>730 </Col>731 </Row>732 <hr className='border-lightred' />733 <Row>734 <Col xs={6}>735 <div>736 <SplitButton inverse bsStyle='darkgreen45' title='Basic' id='split-dropdown-basic-dropup-inverse' dropup>737 <MenuItem eventKey="1">Action</MenuItem>738 <MenuItem eventKey="2">Another action</MenuItem>739 <MenuItem eventKey="3" active>Active Item</MenuItem>740 <MenuItem divider />741 <MenuItem disabled eventKey="4">Disabled link</MenuItem>742 <MenuItem eventKey="5">Separated link</MenuItem>743 </SplitButton>744 </div>745 <br />746 <div>747 <SplitButton inverse bsStyle='lightblue' title='With headers' id='split-dropdown-headers-dropup-inverse' dropup>748 <MenuItem header>Dropdown Header</MenuItem>749 <MenuItem eventKey="1">Action</MenuItem>750 <MenuItem eventKey="2">Another action</MenuItem>751 <MenuItem eventKey="3" active>Active Item</MenuItem>752 <MenuItem divider />753 <MenuItem header>Dropdown Header</MenuItem>754 <MenuItem disabled eventKey="4">Disabled link</MenuItem>755 <MenuItem eventKey="5">Separated link</MenuItem>756 </SplitButton>757 </div>758 </Col>759 <Col xs={6} className='text-right'>760 <div>761 <SplitButton inverse bsStyle='darkgreen45' title='Outlined' id='split-dropdown-outlined-dropup-inverse' pullRight dropup>762 <MenuItem eventKey="1">Action</MenuItem>763 <MenuItem eventKey="2">Another action</MenuItem>764 <MenuItem eventKey="3" active>Active Item</MenuItem>765 <MenuItem divider />766 <MenuItem disabled eventKey="4">Disabled link</MenuItem>767 <MenuItem eventKey="5">Separated link</MenuItem>768 </SplitButton>769 </div>770 <br />771 <div>772 <SplitButton inverse bsStyle='orange' title='Disabled' id='split-dropdown-disabled-dropup-inverse' disabled dropup>773 <MenuItem header>Dropdown Header</MenuItem>774 <MenuItem eventKey="1">Action</MenuItem>775 <MenuItem eventKey="2">Another action</MenuItem>776 <MenuItem eventKey="3" active>Active Item</MenuItem>777 <MenuItem divider />778 <MenuItem header>Dropdown Header</MenuItem>779 <MenuItem disabled eventKey="4">Disabled link</MenuItem>780 <MenuItem eventKey="5">Separated link</MenuItem>781 </SplitButton>782 </div>783 </Col>784 </Row>785 <br />786 </Grid>787 </PanelBody>788 </Panel>789 </PanelContainer>790 );791 }792}793export default class Dropdowns extends React.Component {794 render() {795 return (796 <div>797 <Row>798 <Col sm={6} collapseRight>799 <DropdownsAndDropups />800 <DropdownsAndDropupsInverse />801 <DropdownsAndDropupsHover />802 </Col>803 <Col sm={6}>804 <SplitDropdownsAndDropups />805 <SplitDropdownsAndDropupsInverse />806 <SplitDropdownsAndDropupsHover />807 </Col>808 </Row>809 </div>810 );811 }...
_OLD_CurrencySelect.js
Source:_OLD_CurrencySelect.js
1import React from 'react';2import { makeStyles } from '@material-ui/core/styles';3import InputLabel from '@material-ui/core/InputLabel';4import MenuItem from '@material-ui/core/MenuItem';5import FormHelperText from '@material-ui/core/FormHelperText';6import FormControl from '@material-ui/core/FormControl';7import Select from '@material-ui/core/Select';8const useStyles = makeStyles((theme) => ({9 formControl: {10 // margin: theme.spacing(1),11 minWidth: 120,12 },13 selectEmpty: {14 // marginTop: theme.spacing(2),15 },16}));17export default function CurrencySelect() {18 const classes = useStyles();19 const [currency, setCurrency] = React.useState('');20 const handleChange = (event) => {21 setCurrency(event.target.value);22 };23 return (24 // <div>25 // <FormControl className={classes.formControl}>26 // <InputLabel id="demo-simple-select-label">Age</InputLabel>27 // <Select28 // labelId="demo-simple-select-label"29 // id="demo-simple-select"30 // value={age}31 // onChange={handleChange}32 // >33 // <MenuItem value={10}>Ten</MenuItem>34 // <MenuItem value={20}>Twenty</MenuItem>35 // <MenuItem value={30}>Thirty</MenuItem>36 // </Select>37 // </FormControl>38 // <FormControl className={classes.formControl}>39 // <InputLabel id="demo-simple-select-helper-label">Age</InputLabel>40 // <Select41 // labelId="demo-simple-select-helper-label"42 // id="demo-simple-select-helper"43 // value={age}44 // onChange={handleChange}45 // >46 // <MenuItem value="">47 // <em>None</em>48 // </MenuItem>49 // <MenuItem value={10}>Ten</MenuItem>50 // <MenuItem value={20}>Twenty</MenuItem>51 // <MenuItem value={30}>Thirty</MenuItem>52 // </Select>53 // <FormHelperText>Some important helper text</FormHelperText>54 // </FormControl>55 // <FormControl className={classes.formControl}>56 // <Select57 // value={age}58 // onChange={handleChange}59 // displayEmpty60 // className={classes.selectEmpty}61 // inputProps={{ 'aria-label': 'Without label' }}62 // >63 // <MenuItem value="">64 // <em>None</em>65 // </MenuItem>66 // <MenuItem value={10}>Ten</MenuItem>67 // <MenuItem value={20}>Twenty</MenuItem>68 // <MenuItem value={30}>Thirty</MenuItem>69 // </Select>70 // <FormHelperText>Without label</FormHelperText>71 // </FormControl>72 // <FormControl className={classes.formControl}>73 // <InputLabel shrink id="demo-simple-select-placeholder-label-label">74 // Age75 // </InputLabel>76 // <Select77 // labelId="demo-simple-select-placeholder-label-label"78 // id="demo-simple-select-placeholder-label"79 // value={age}80 // onChange={handleChange}81 // displayEmpty82 // className={classes.selectEmpty}83 // >84 // <MenuItem value="">85 // <em>None</em>86 // </MenuItem>87 // <MenuItem value={10}>Ten</MenuItem>88 // <MenuItem value={20}>Twenty</MenuItem>89 // <MenuItem value={30}>Thirty</MenuItem>90 // </Select>91 // <FormHelperText>Label + placeholder</FormHelperText>92 // </FormControl>93 // <FormControl className={classes.formControl} disabled>94 // <InputLabel id="demo-simple-select-disabled-label">Name</InputLabel>95 // <Select96 // labelId="demo-simple-select-disabled-label"97 // id="demo-simple-select-disabled"98 // value={age}99 // onChange={handleChange}100 // >101 // <MenuItem value="">102 // <em>None</em>103 // </MenuItem>104 // <MenuItem value={10}>Ten</MenuItem>105 // <MenuItem value={20}>Twenty</MenuItem>106 // <MenuItem value={30}>Thirty</MenuItem>107 // </Select>108 // <FormHelperText>Disabled</FormHelperText>109 // </FormControl>110 // <FormControl className={classes.formControl} error>111 // <InputLabel id="demo-simple-select-error-label">Name</InputLabel>112 // <Select113 // labelId="demo-simple-select-error-label"114 // id="demo-simple-select-error"115 // value={age}116 // onChange={handleChange}117 // renderValue={(value) => `â ï¸ - ${value}`}118 // >119 // <MenuItem value="">120 // <em>None</em>121 // </MenuItem>122 // <MenuItem value={10}>Ten</MenuItem>123 // <MenuItem value={20}>Twenty</MenuItem>124 // <MenuItem value={30}>Thirty</MenuItem>125 // </Select>126 // <FormHelperText>Error</FormHelperText>127 // </FormControl>128 // <FormControl className={classes.formControl}>129 // <InputLabel id="demo-simple-select-readonly-label">Name</InputLabel>130 // <Select131 // labelId="demo-simple-select-readonly-label"132 // id="demo-simple-select-readonly"133 // value={age}134 // onChange={handleChange}135 // inputProps={{ readOnly: true }}136 // >137 // <MenuItem value="">138 // <em>None</em>139 // </MenuItem>140 // <MenuItem value={10}>Ten</MenuItem>141 // <MenuItem value={20}>Twenty</MenuItem>142 // <MenuItem value={30}>Thirty</MenuItem>143 // </Select>144 // <FormHelperText>Read only</FormHelperText>145 // </FormControl>146 // <FormControl className={classes.formControl}>147 // <InputLabel id="demo-simple-select-autowidth-label">Age</InputLabel>148 // <Select149 // labelId="demo-simple-select-autowidth-label"150 // id="demo-simple-select-autowidth"151 // value={age}152 // onChange={handleChange}153 // autoWidth154 // >155 // <MenuItem value="">156 // <em>None</em>157 // </MenuItem>158 // <MenuItem value={10}>Ten</MenuItem>159 // <MenuItem value={20}>Twenty</MenuItem>160 // <MenuItem value={30}>Thirty</MenuItem>161 // </Select>162 // <FormHelperText>Auto width</FormHelperText>163 // </FormControl>164 // <FormControl className={classes.formControl}>165 // <Select166 // value={age}167 // onChange={handleChange}168 // displayEmpty169 // className={classes.selectEmpty}170 // inputProps={{ 'aria-label': 'Without label' }}171 // >172 // <MenuItem value="" disabled>173 // Placeholder174 // </MenuItem>175 // <MenuItem value={10}>Ten</MenuItem>176 // <MenuItem value={20}>Twenty</MenuItem>177 // <MenuItem value={30}>Thirty</MenuItem>178 // </Select>179 // <FormHelperText>Placeholder</FormHelperText>180 // </FormControl>181 // <FormControl required className={classes.formControl}>182 // <InputLabel id="demo-simple-select-required-label">Age</InputLabel>183 // <Select184 // labelId="demo-simple-select-required-label"185 // id="demo-simple-select-required"186 // value={age}187 // onChange={handleChange}188 // className={classes.selectEmpty}189 // >190 // <MenuItem value="">191 // <em>None</em>192 // </MenuItem>193 // <MenuItem value={10}>Ten</MenuItem>194 // <MenuItem value={20}>Twenty</MenuItem>195 // <MenuItem value={30}>Thirty</MenuItem>196 // </Select>197 // <FormHelperText>Required</FormHelperText>198 // </FormControl>199 <FormControl variant="outlined" className={classes.formControl}>200 <InputLabel id="demo-simple-select-outlined-label">Currency</InputLabel>201 <Select202 labelId="demo-simple-select-outlined-label"203 id="demo-simple-select-outlined"204 value={currency}205 onChange={handleChange}206 label="Currency"207 >208 {/* <MenuItem value="">209 <em>None</em>210 </MenuItem>211 <MenuItem value={10}>Ten</MenuItem>212 <MenuItem value={20}>Twenty</MenuItem>213 <MenuItem value={30}>Thirty</MenuItem> */}214 <MenuItem value="USD" selected="selected" label="US dollar">USD</MenuItem>215 <MenuItem value="SGD" label="Singapore dollar">SGD</MenuItem>216 <MenuItem value="AUD" label="Australian dollar">AUD</MenuItem>217 <MenuItem value="EUR" label="Euro">EUR</MenuItem>218 <MenuItem value="GBP" label="Pound sterling">GBP</MenuItem>219 <MenuItem disabled>ââââââââââ</MenuItem>220 <MenuItem value="AED" label="United Arab Emirates dirham">AED</MenuItem>221 <MenuItem value="AFN" label="Afghan afghani">AFN</MenuItem>222 <MenuItem value="ALL" label="Albanian lek">ALL</MenuItem>223 <MenuItem value="AMD" label="Armenian dram">AMD</MenuItem>224 <MenuItem value="ANG" label="Netherlands Antillean guilder">ANG</MenuItem>225 <MenuItem value="AOA" label="Angolan kwanza">AOA</MenuItem>226 <MenuItem value="ARS" label="Argentine peso">ARS</MenuItem>227 <MenuItem value="AUD" label="Australian dollar">AUD</MenuItem>228 <MenuItem value="AWG" label="Aruban florin">AWG</MenuItem>229 <MenuItem value="AZN" label="Azerbaijani manat">AZN</MenuItem>230 <MenuItem value="BAM" label="Bosnia and Herzegovina convertible mark">BAM</MenuItem>231 <MenuItem value="BBD" label="Barbadian dollar">BBD</MenuItem>232 <MenuItem value="BDT" label="Bangladeshi taka">BDT</MenuItem>233 <MenuItem value="BGN" label="Bulgarian lev">BGN</MenuItem>234 <MenuItem value="BHD" label="Bahraini dinar">BHD</MenuItem>235 <MenuItem value="BIF" label="Burundian franc">BIF</MenuItem>236 <MenuItem value="BMD" label="Bermudian dollar">BMD</MenuItem>237 <MenuItem value="BND" label="Brunei dollar">BND</MenuItem>238 <MenuItem value="BOB" label="Bolivian boliviano">BOB</MenuItem>239 <MenuItem value="BRL" label="Brazilian real">BRL</MenuItem>240 <MenuItem value="BSD" label="Bahamian dollar">BSD</MenuItem>241 <MenuItem value="BTN" label="Bhutanese ngultrum">BTN</MenuItem>242 <MenuItem value="BWP" label="Botswana pula">BWP</MenuItem>243 <MenuItem value="BYN" label="Belarusian ruble">BYN</MenuItem>244 <MenuItem value="BZD" label="Belize dollar">BZD</MenuItem>245 <MenuItem value="CAD" label="Canadian dollar">CAD</MenuItem>246 <MenuItem value="CDF" label="Congolese franc">CDF</MenuItem>247 <MenuItem value="CHF" label="Swiss franc">CHF</MenuItem>248 <MenuItem value="CLP" label="Chilean peso">CLP</MenuItem>249 <MenuItem value="CNY" label="Chinese yuan">CNY</MenuItem>250 <MenuItem value="COP" label="Colombian peso">COP</MenuItem>251 <MenuItem value="CRC" label="Costa Rican colón">CRC</MenuItem>252 <MenuItem value="CUC" label="Cuban convertible peso">CUC</MenuItem>253 <MenuItem value="CUP" label="Cuban peso">CUP</MenuItem>254 <MenuItem value="CVE" label="Cape Verdean escudo">CVE</MenuItem>255 <MenuItem value="CZK" label="Czech koruna">CZK</MenuItem>256 <MenuItem value="DJF" label="Djiboutian franc">DJF</MenuItem>257 <MenuItem value="DKK" label="Danish krone">DKK</MenuItem>258 <MenuItem value="DOP" label="Dominican peso">DOP</MenuItem>259 <MenuItem value="DZD" label="Algerian dinar">DZD</MenuItem>260 <MenuItem value="EGP" label="Egyptian pound">EGP</MenuItem>261 <MenuItem value="ERN" label="Eritrean nakfa">ERN</MenuItem>262 <MenuItem value="ETB" label="Ethiopian birr">ETB</MenuItem>263 <MenuItem value="EUR" label="EURO">EUR</MenuItem>264 <MenuItem value="FJD" label="Fijian dollar">FJD</MenuItem>265 <MenuItem value="FKP" label="Falkland Islands pound">FKP</MenuItem>266 <MenuItem value="GBP" label="British pound">GBP</MenuItem>267 <MenuItem value="GEL" label="Georgian lari">GEL</MenuItem>268 <MenuItem value="GGP" label="Guernsey pound">GGP</MenuItem>269 <MenuItem value="GHS" label="Ghanaian cedi">GHS</MenuItem>270 <MenuItem value="GIP" label="Gibraltar pound">GIP</MenuItem>271 <MenuItem value="GMD" label="Gambian dalasi">GMD</MenuItem>272 <MenuItem value="GNF" label="Guinean franc">GNF</MenuItem>273 <MenuItem value="GTQ" label="Guatemalan quetzal">GTQ</MenuItem>274 <MenuItem value="GYD" label="Guyanese dollar">GYD</MenuItem>275 <MenuItem value="HKD" label="Hong Kong dollar">HKD</MenuItem>276 <MenuItem value="HNL" label="Honduran lempira">HNL</MenuItem>277 <MenuItem value="HKD" label="Hong Kong dollar">HKD</MenuItem>278 <MenuItem value="HRK" label="Croatian kuna">HRK</MenuItem>279 <MenuItem value="HTG" label="Haitian gourde">HTG</MenuItem>280 <MenuItem value="HUF" label="Hungarian forint">HUF</MenuItem>281 <MenuItem value="IDR" label="Indonesian rupiah">IDR</MenuItem>282 <MenuItem value="ILS" label="Israeli new shekel">ILS</MenuItem>283 <MenuItem value="IMP" label="Manx pound">IMP</MenuItem>284 <MenuItem value="INR" label="Indian rupee">INR</MenuItem>285 <MenuItem value="IQD" label="Iraqi dinar">IQD</MenuItem>286 <MenuItem value="IRR" label="Iranian rial">IRR</MenuItem>287 <MenuItem value="ISK" label="Icelandic króna">ISK</MenuItem>288 <MenuItem value="JEP" label="Jersey pound">JEP</MenuItem>289 <MenuItem value="JMD" label="Jamaican dollar">JMD</MenuItem>290 <MenuItem value="JOD" label="Jordanian dinar">JOD</MenuItem>291 <MenuItem value="JPY" label="Japanese yen">JPY</MenuItem>292 <MenuItem value="KES" label="Kenyan shilling">KES</MenuItem>293 <MenuItem value="KGS" label="Kyrgyzstani som">KGS</MenuItem>294 <MenuItem value="KHR" label="Cambodian riel">KHR</MenuItem>295 <MenuItem value="KID" label="Kiribati dollar">KID</MenuItem>296 <MenuItem value="KMF" label="Comorian franc">KMF</MenuItem>297 <MenuItem value="KPW" label="North Korean won">KPW</MenuItem>298 <MenuItem value="KRW" label="South Korean won">KRW</MenuItem>299 <MenuItem value="KWD" label="Kuwaiti dinar">KWD</MenuItem>300 <MenuItem value="KYD" label="Cayman Islands dollar">KYD</MenuItem>301 <MenuItem value="KZT" label="Kazakhstani tenge">KZT</MenuItem>302 <MenuItem value="LAK" label="Lao kip">LAK</MenuItem>303 <MenuItem value="LBP" label="Lebanese pound">LBP</MenuItem>304 <MenuItem value="LKR" label="Sri Lankan rupee">LKR</MenuItem>305 <MenuItem value="LRD" label="Liberian dollar">LRD</MenuItem>306 <MenuItem value="LSL" label="Lesotho loti">LSL</MenuItem>307 <MenuItem value="LYD" label="Libyan dinar">LYD</MenuItem>308 <MenuItem value="MAD" label="Moroccan dirham">MAD</MenuItem>309 <MenuItem value="MDL" label="Moldovan leu">MDL</MenuItem>310 <MenuItem value="MGA" label="Malagasy ariary">MGA</MenuItem>311 <MenuItem value="MKD" label="Macedonian denar">MKD</MenuItem>312 <MenuItem value="MMK" label="Burmese kyat">MMK</MenuItem>313 <MenuItem value="MNT" label="Mongolian tögrög">MNT</MenuItem>314 <MenuItem value="MOP" label="Macanese pataca">MOP</MenuItem>315 <MenuItem value="MRU" label="Mauritanian ouguiya">MRU</MenuItem>316 <MenuItem value="MUR" label="Mauritian rupee">MUR</MenuItem>317 <MenuItem value="MVR" label="Maldivian rufiyaa">MVR</MenuItem>318 <MenuItem value="MWK" label="Malawian kwacha">MWK</MenuItem>319 <MenuItem value="MXN" label="Mexican peso">MXN</MenuItem>320 <MenuItem value="MYR" label="Malaysian ringgit">MYR</MenuItem>321 <MenuItem value="MZN" label="Mozambican metical">MZN</MenuItem>322 <MenuItem value="NAD" label="Namibian dollar">NAD</MenuItem>323 <MenuItem value="NGN" label="Nigerian naira">NGN</MenuItem>324 <MenuItem value="NIO" label="Nicaraguan córdoba">NIO</MenuItem>325 <MenuItem value="NOK" label="Norwegian krone">NOK</MenuItem>326 <MenuItem value="NPR" label="Nepalese rupee">NPR</MenuItem>327 <MenuItem value="NZD" label="New Zealand dollar">NZD</MenuItem>328 <MenuItem value="OMR" label="Omani rial">OMR</MenuItem>329 <MenuItem value="PAB" label="Panamanian balboa">PAB</MenuItem>330 <MenuItem value="PEN" label="Peruvian sol">PEN</MenuItem>331 <MenuItem value="PGK" label="Papua New Guinean kina">PGK</MenuItem>332 <MenuItem value="PHP" label="Philippine peso">PHP</MenuItem>333 <MenuItem value="PKR" label="Pakistani rupee">PKR</MenuItem>334 <MenuItem value="PLN" label="Polish zÅoty">PLN</MenuItem>335 <MenuItem value="PRB" label="Transnistrian ruble">PRB</MenuItem>336 <MenuItem value="PYG" label="Paraguayan guaranÃ">PYG</MenuItem>337 <MenuItem value="QAR" label="Qatari riyal">QAR</MenuItem>338 <MenuItem value="RON" label="Romanian leu">RON</MenuItem>339 <MenuItem value="RON" label="Romanian leu">RON</MenuItem>340 <MenuItem value="RSD" label="Serbian dinar">RSD</MenuItem>341 <MenuItem value="RUB" label="Russian ruble">RUB</MenuItem>342 <MenuItem value="RWF" label="Rwandan franc">RWF</MenuItem>343 <MenuItem value="SAR" label="Saudi riyal">SAR</MenuItem>344 <MenuItem value="SEK" label="Swedish krona">SEK</MenuItem>345 <MenuItem value="SGD" label="Singapore dollar">SGD</MenuItem>346 <MenuItem value="SHP" label="Saint Helena pound">SHP</MenuItem>347 <MenuItem value="SLL" label="Sierra Leonean leone">SLL</MenuItem>348 <MenuItem value="SLS" label="Somaliland shilling">SLS</MenuItem>349 <MenuItem value="SOS" label="Somali shilling">SOS</MenuItem>350 <MenuItem value="SRD" label="Surinamese dollar">SRD</MenuItem>351 <MenuItem value="SSP" label="South Sudanese pound">SSP</MenuItem>352 <MenuItem value="STN" label="São Tomé and PrÃncipe dobra">STN</MenuItem>353 <MenuItem value="SYP" label="Syrian pound">SYP</MenuItem>354 <MenuItem value="SZL" label="Swazi lilangeni">SZL</MenuItem>355 <MenuItem value="THB" label="Thai baht">THB</MenuItem>356 <MenuItem value="TJS" label="Tajikistani somoni">TJS</MenuItem>357 <MenuItem value="TMT" label="Turkmenistan manat">TMT</MenuItem>358 <MenuItem value="TND" label="Tunisian dinar">TND</MenuItem>359 <MenuItem value="TOP" label="Tongan paÊ»anga">TOP</MenuItem>360 <MenuItem value="TRY" label="Turkish lira">TRY</MenuItem>361 <MenuItem value="TTD" label="Trinidad and Tobago dollar">TTD</MenuItem>362 <MenuItem value="TVD" label="Tuvaluan dollar">TVD</MenuItem>363 <MenuItem value="TWD" label="New Taiwan dollar">TWD</MenuItem>364 <MenuItem value="TZS" label="Tanzanian shilling">TZS</MenuItem>365 <MenuItem value="UAH" label="Ukrainian hryvnia">UAH</MenuItem>366 <MenuItem value="UGX" label="Ugandan shilling">UGX</MenuItem>367 <MenuItem value="USD" label="United States dollar">USD</MenuItem>368 <MenuItem value="UYU" label="Uruguayan peso">UYU</MenuItem>369 <MenuItem value="UZS" label="Uzbekistani soÊ»m">UZS</MenuItem>370 <MenuItem value="VES" label="Venezuelan bolÃvar soberano">VES</MenuItem>371 <MenuItem value="VND" label="Vietnamese Äá»ng">VND</MenuItem>372 <MenuItem value="VUV" label="Vanuatu vatu">VUV</MenuItem>373 <MenuItem value="WST" label="Samoan tÄlÄ">WST</MenuItem>374 <MenuItem value="XAF" label="Central African CFA franc">XAF</MenuItem>375 <MenuItem value="XCD" label="Eastern Caribbean dollar">XCD</MenuItem>376 <MenuItem value="XOF" label="West African CFA franc">XOF</MenuItem>377 <MenuItem value="XPF" label="CFP franc">XPF</MenuItem>378 <MenuItem value="ZAR" label="South African rand">ZAR</MenuItem>379 <MenuItem value="ZMW" label="Zambian kwacha">ZMW</MenuItem>380 <MenuItem value="ZWB" label="Zimbabwean bonds">ZWB</MenuItem>381 </Select>382 </FormControl>383 /* <FormControl variant="filled" className={classes.formControl}>384 <InputLabel id="demo-simple-select-filled-label">Age</InputLabel>385 <Select386 labelId="demo-simple-select-filled-label"387 id="demo-simple-select-filled"388 value={age}389 onChange={handleChange}390 >391 <MenuItem value="">392 <em>None</em>393 </MenuItem>394 <MenuItem value={10}>Ten</MenuItem>395 <MenuItem value={20}>Twenty</MenuItem>396 <MenuItem value={30}>Thirty</MenuItem>397 </Select>398 </FormControl>399 </div> */400 );...
_OLD_CurrencyItems.js
Source:_OLD_CurrencyItems.js
1import MenuItem from '@material-ui/core/MenuItem';2function CurrencyItems() {3 return (4 <>5 <MenuItem value="USD" label="US dollar">USD</MenuItem>6 <MenuItem value="SGD" label="Singapore dollar">SGD</MenuItem>7 <MenuItem value="AUD" label="Australian dollar">AUD</MenuItem>8 <MenuItem value="EUR" label="Euro">EUR</MenuItem>9 <MenuItem value="GBP" label="Pound sterling">GBP</MenuItem>10 <MenuItem disabled>ââââââââââ</MenuItem>11 <MenuItem value="AED" label="United Arab Emirates dirham">AED</MenuItem>12 <MenuItem value="AFN" label="Afghan afghani">AFN</MenuItem>13 <MenuItem value="ALL" label="Albanian lek">ALL</MenuItem>14 <MenuItem value="AMD" label="Armenian dram">AMD</MenuItem>15 <MenuItem value="ANG" label="Netherlands Antillean guilder">ANG</MenuItem>16 <MenuItem value="AOA" label="Angolan kwanza">AOA</MenuItem>17 <MenuItem value="ARS" label="Argentine peso">ARS</MenuItem>18 <MenuItem value="AUD" label="Australian dollar">AUD</MenuItem>19 <MenuItem value="AWG" label="Aruban florin">AWG</MenuItem>20 <MenuItem value="AZN" label="Azerbaijani manat">AZN</MenuItem>21 <MenuItem value="BAM" label="Bosnia and Herzegovina convertible mark">BAM</MenuItem>22 <MenuItem value="BBD" label="Barbadian dollar">BBD</MenuItem>23 <MenuItem value="BDT" label="Bangladeshi taka">BDT</MenuItem>24 <MenuItem value="BGN" label="Bulgarian lev">BGN</MenuItem>25 <MenuItem value="BHD" label="Bahraini dinar">BHD</MenuItem>26 <MenuItem value="BIF" label="Burundian franc">BIF</MenuItem>27 <MenuItem value="BMD" label="Bermudian dollar">BMD</MenuItem>28 <MenuItem value="BND" label="Brunei dollar">BND</MenuItem>29 <MenuItem value="BOB" label="Bolivian boliviano">BOB</MenuItem>30 <MenuItem value="BRL" label="Brazilian real">BRL</MenuItem>31 <MenuItem value="BSD" label="Bahamian dollar">BSD</MenuItem>32 <MenuItem value="BTN" label="Bhutanese ngultrum">BTN</MenuItem>33 <MenuItem value="BWP" label="Botswana pula">BWP</MenuItem>34 <MenuItem value="BYN" label="Belarusian ruble">BYN</MenuItem>35 <MenuItem value="BZD" label="Belize dollar">BZD</MenuItem>36 <MenuItem value="CAD" label="Canadian dollar">CAD</MenuItem>37 <MenuItem value="CDF" label="Congolese franc">CDF</MenuItem>38 <MenuItem value="CHF" label="Swiss franc">CHF</MenuItem>39 <MenuItem value="CLP" label="Chilean peso">CLP</MenuItem>40 <MenuItem value="CNY" label="Chinese yuan">CNY</MenuItem>41 <MenuItem value="COP" label="Colombian peso">COP</MenuItem>42 <MenuItem value="CRC" label="Costa Rican colón">CRC</MenuItem>43 <MenuItem value="CUC" label="Cuban convertible peso">CUC</MenuItem>44 <MenuItem value="CUP" label="Cuban peso">CUP</MenuItem>45 <MenuItem value="CVE" label="Cape Verdean escudo">CVE</MenuItem>46 <MenuItem value="CZK" label="Czech koruna">CZK</MenuItem>47 <MenuItem value="DJF" label="Djiboutian franc">DJF</MenuItem>48 <MenuItem value="DKK" label="Danish krone">DKK</MenuItem>49 <MenuItem value="DOP" label="Dominican peso">DOP</MenuItem>50 <MenuItem value="DZD" label="Algerian dinar">DZD</MenuItem>51 <MenuItem value="EGP" label="Egyptian pound">EGP</MenuItem>52 <MenuItem value="ERN" label="Eritrean nakfa">ERN</MenuItem>53 <MenuItem value="ETB" label="Ethiopian birr">ETB</MenuItem>54 <MenuItem value="EUR" label="EURO">EUR</MenuItem>55 <MenuItem value="FJD" label="Fijian dollar">FJD</MenuItem>56 <MenuItem value="FKP" label="Falkland Islands pound">FKP</MenuItem>57 <MenuItem value="GBP" label="British pound">GBP</MenuItem>58 <MenuItem value="GEL" label="Georgian lari">GEL</MenuItem>59 <MenuItem value="GGP" label="Guernsey pound">GGP</MenuItem>60 <MenuItem value="GHS" label="Ghanaian cedi">GHS</MenuItem>61 <MenuItem value="GIP" label="Gibraltar pound">GIP</MenuItem>62 <MenuItem value="GMD" label="Gambian dalasi">GMD</MenuItem>63 <MenuItem value="GNF" label="Guinean franc">GNF</MenuItem>64 <MenuItem value="GTQ" label="Guatemalan quetzal">GTQ</MenuItem>65 <MenuItem value="GYD" label="Guyanese dollar">GYD</MenuItem>66 <MenuItem value="HKD" label="Hong Kong dollar">HKD</MenuItem>67 <MenuItem value="HNL" label="Honduran lempira">HNL</MenuItem>68 <MenuItem value="HKD" label="Hong Kong dollar">HKD</MenuItem>69 <MenuItem value="HRK" label="Croatian kuna">HRK</MenuItem>70 <MenuItem value="HTG" label="Haitian gourde">HTG</MenuItem>71 <MenuItem value="HUF" label="Hungarian forint">HUF</MenuItem>72 <MenuItem value="IDR" label="Indonesian rupiah">IDR</MenuItem>73 <MenuItem value="ILS" label="Israeli new shekel">ILS</MenuItem>74 <MenuItem value="IMP" label="Manx pound">IMP</MenuItem>75 <MenuItem value="INR" label="Indian rupee">INR</MenuItem>76 <MenuItem value="IQD" label="Iraqi dinar">IQD</MenuItem>77 <MenuItem value="IRR" label="Iranian rial">IRR</MenuItem>78 <MenuItem value="ISK" label="Icelandic króna">ISK</MenuItem>79 <MenuItem value="JEP" label="Jersey pound">JEP</MenuItem>80 <MenuItem value="JMD" label="Jamaican dollar">JMD</MenuItem>81 <MenuItem value="JOD" label="Jordanian dinar">JOD</MenuItem>82 <MenuItem value="JPY" label="Japanese yen">JPY</MenuItem>83 <MenuItem value="KES" label="Kenyan shilling">KES</MenuItem>84 <MenuItem value="KGS" label="Kyrgyzstani som">KGS</MenuItem>85 <MenuItem value="KHR" label="Cambodian riel">KHR</MenuItem>86 <MenuItem value="KID" label="Kiribati dollar">KID</MenuItem>87 <MenuItem value="KMF" label="Comorian franc">KMF</MenuItem>88 <MenuItem value="KPW" label="North Korean won">KPW</MenuItem>89 <MenuItem value="KRW" label="South Korean won">KRW</MenuItem>90 <MenuItem value="KWD" label="Kuwaiti dinar">KWD</MenuItem>91 <MenuItem value="KYD" label="Cayman Islands dollar">KYD</MenuItem>92 <MenuItem value="KZT" label="Kazakhstani tenge">KZT</MenuItem>93 <MenuItem value="LAK" label="Lao kip">LAK</MenuItem>94 <MenuItem value="LBP" label="Lebanese pound">LBP</MenuItem>95 <MenuItem value="LKR" label="Sri Lankan rupee">LKR</MenuItem>96 <MenuItem value="LRD" label="Liberian dollar">LRD</MenuItem>97 <MenuItem value="LSL" label="Lesotho loti">LSL</MenuItem>98 <MenuItem value="LYD" label="Libyan dinar">LYD</MenuItem>99 <MenuItem value="MAD" label="Moroccan dirham">MAD</MenuItem>100 <MenuItem value="MDL" label="Moldovan leu">MDL</MenuItem>101 <MenuItem value="MGA" label="Malagasy ariary">MGA</MenuItem>102 <MenuItem value="MKD" label="Macedonian denar">MKD</MenuItem>103 <MenuItem value="MMK" label="Burmese kyat">MMK</MenuItem>104 <MenuItem value="MNT" label="Mongolian tögrög">MNT</MenuItem>105 <MenuItem value="MOP" label="Macanese pataca">MOP</MenuItem>106 <MenuItem value="MRU" label="Mauritanian ouguiya">MRU</MenuItem>107 <MenuItem value="MUR" label="Mauritian rupee">MUR</MenuItem>108 <MenuItem value="MVR" label="Maldivian rufiyaa">MVR</MenuItem>109 <MenuItem value="MWK" label="Malawian kwacha">MWK</MenuItem>110 <MenuItem value="MXN" label="Mexican peso">MXN</MenuItem>111 <MenuItem value="MYR" label="Malaysian ringgit">MYR</MenuItem>112 <MenuItem value="MZN" label="Mozambican metical">MZN</MenuItem>113 <MenuItem value="NAD" label="Namibian dollar">NAD</MenuItem>114 <MenuItem value="NGN" label="Nigerian naira">NGN</MenuItem>115 <MenuItem value="NIO" label="Nicaraguan córdoba">NIO</MenuItem>116 <MenuItem value="NOK" label="Norwegian krone">NOK</MenuItem>117 <MenuItem value="NPR" label="Nepalese rupee">NPR</MenuItem>118 <MenuItem value="NZD" label="New Zealand dollar">NZD</MenuItem>119 <MenuItem value="OMR" label="Omani rial">OMR</MenuItem>120 <MenuItem value="PAB" label="Panamanian balboa">PAB</MenuItem>121 <MenuItem value="PEN" label="Peruvian sol">PEN</MenuItem>122 <MenuItem value="PGK" label="Papua New Guinean kina">PGK</MenuItem>123 <MenuItem value="PHP" label="Philippine peso">PHP</MenuItem>124 <MenuItem value="PKR" label="Pakistani rupee">PKR</MenuItem>125 <MenuItem value="PLN" label="Polish zÅoty">PLN</MenuItem>126 <MenuItem value="PRB" label="Transnistrian ruble">PRB</MenuItem>127 <MenuItem value="PYG" label="Paraguayan guaranÃ">PYG</MenuItem>128 <MenuItem value="QAR" label="Qatari riyal">QAR</MenuItem>129 <MenuItem value="RON" label="Romanian leu">RON</MenuItem>130 <MenuItem value="RON" label="Romanian leu">RON</MenuItem>131 <MenuItem value="RSD" label="Serbian dinar">RSD</MenuItem>132 <MenuItem value="RUB" label="Russian ruble">RUB</MenuItem>133 <MenuItem value="RWF" label="Rwandan franc">RWF</MenuItem>134 <MenuItem value="SAR" label="Saudi riyal">SAR</MenuItem>135 <MenuItem value="SEK" label="Swedish krona">SEK</MenuItem>136 <MenuItem value="SGD" label="Singapore dollar">SGD</MenuItem>137 <MenuItem value="SHP" label="Saint Helena pound">SHP</MenuItem>138 <MenuItem value="SLL" label="Sierra Leonean leone">SLL</MenuItem>139 <MenuItem value="SLS" label="Somaliland shilling">SLS</MenuItem>140 <MenuItem value="SOS" label="Somali shilling">SOS</MenuItem>141 <MenuItem value="SRD" label="Surinamese dollar">SRD</MenuItem>142 <MenuItem value="SSP" label="South Sudanese pound">SSP</MenuItem>143 <MenuItem value="STN" label="São Tomé and PrÃncipe dobra">STN</MenuItem>144 <MenuItem value="SYP" label="Syrian pound">SYP</MenuItem>145 <MenuItem value="SZL" label="Swazi lilangeni">SZL</MenuItem>146 <MenuItem value="THB" label="Thai baht">THB</MenuItem>147 <MenuItem value="TJS" label="Tajikistani somoni">TJS</MenuItem>148 <MenuItem value="TMT" label="Turkmenistan manat">TMT</MenuItem>149 <MenuItem value="TND" label="Tunisian dinar">TND</MenuItem>150 <MenuItem value="TOP" label="Tongan paÊ»anga">TOP</MenuItem>151 <MenuItem value="TRY" label="Turkish lira">TRY</MenuItem>152 <MenuItem value="TTD" label="Trinidad and Tobago dollar">TTD</MenuItem>153 <MenuItem value="TVD" label="Tuvaluan dollar">TVD</MenuItem>154 <MenuItem value="TWD" label="New Taiwan dollar">TWD</MenuItem>155 <MenuItem value="TZS" label="Tanzanian shilling">TZS</MenuItem>156 <MenuItem value="UAH" label="Ukrainian hryvnia">UAH</MenuItem>157 <MenuItem value="UGX" label="Ugandan shilling">UGX</MenuItem>158 <MenuItem value="USD" label="United States dollar">USD</MenuItem>159 <MenuItem value="UYU" label="Uruguayan peso">UYU</MenuItem>160 <MenuItem value="UZS" label="Uzbekistani soÊ»m">UZS</MenuItem>161 <MenuItem value="VES" label="Venezuelan bolÃvar soberano">VES</MenuItem>162 <MenuItem value="VND" label="Vietnamese Äá»ng">VND</MenuItem>163 <MenuItem value="VUV" label="Vanuatu vatu">VUV</MenuItem>164 <MenuItem value="WST" label="Samoan tÄlÄ">WST</MenuItem>165 <MenuItem value="XAF" label="Central African CFA franc">XAF</MenuItem>166 <MenuItem value="XCD" label="Eastern Caribbean dollar">XCD</MenuItem>167 <MenuItem value="XOF" label="West African CFA franc">XOF</MenuItem>168 <MenuItem value="XPF" label="CFP franc">XPF</MenuItem>169 <MenuItem value="ZAR" label="South African rand">ZAR</MenuItem>170 <MenuItem value="ZMW" label="Zambian kwacha">ZMW</MenuItem>171 <MenuItem value="ZWB" label="Zimbabwean bonds">ZWB</MenuItem>172 </>173 )174}...
menu.py
Source:menu.py
...34 def init_with_context(self, context):35 user = context['request'].user36 if user.is_superuser:37 self.children += [38 items.MenuItem(_('Dashboard'), reverse('admin:index')),39 items.Bookmarks(),40 items.MenuItem(_('Companies'),41 children=[42 items.MenuItem(_('Companies'), '/extranet/pyfreebill/company/',43 children=[44 items.MenuItem(_('List'), '/extranet/pyfreebill/company/',45 children=[46 items.MenuItem(_('All'), '/extranet/pyfreebill/company/'),47 items.MenuItem(_('Customers'), '/extranet/pyfreebill/company/?customer_enabled__exact=1',48 children=[49 items.MenuItem(_('All'), '/extranet/pyfreebill/company/?customer_enabled__exact=1'),50 items.MenuItem(_('Prepaid Account'), '/extranet/pyfreebill/company/?customer_enabled__exact=1&prepaid__exact=1'),51 items.MenuItem(_('Postpaid account'), '/extranet/pyfreebill/company/?customer_enabled__exact=1&prepaid__exact=0'),52 ]53 ),54 items.MenuItem(_('Providers'), '/extranet/pyfreebill/company/?supplier_enabled__exact=1'),55 items.MenuItem(_('Add new company'), '/extranet/pyfreebill/company/add/'),56 ]57 ),58 items.MenuItem(_('Balance history'), '/extranet/pyfreebill/companybalancehistory/'),59 items.MenuItem(_('Add payment'), '/extranet/pyfreebill/companybalancehistory/add/'),60 items.MenuItem(_('customer management'),61 children=[62 items.MenuItem(_('Customer SIP accounts'), '/extranet/pyfreebill/customerdirectory/'),63 items.MenuItem(_('Destination number normalization rules'), '/extranet/pyfreebill/customernormalizationrules/'),64 items.MenuItem(_('CallerID Normalization Rules'), '/extranet/pyfreebill/customercidnormalizationrules/'),65 ]66 ),67 items.MenuItem(_('provider management'),68 children=[69 items.MenuItem(_('Provider gateways'), '/extranet/pyfreebill/sofiagateway/'),70 items.MenuItem(_('CallerID Normalization Rules'), '/extranet/pyfreebill/carriercidnormalizationrules/'),71 ]72 ),73 ]74 ),75 items.MenuItem(_('Contacts'), '/extranet/pyfreebill/person/',76 children=[77 items.MenuItem(_('List'), '/extranet/pyfreebill/person/'),78 items.MenuItem(_('Add'), '/extranet/pyfreebill/person/add/'),79 ]80 ),81 items.MenuItem(_('Groups'), '/extranet/pyfreebill/group/',82 children=[83 items.MenuItem(_('List'), '/extranet/pyfreebill/group/'),84 items.MenuItem(_('Add'), '/extranet/pyfreebill/group/add/'),85 ]86 ),87 ]88 ),89 items.MenuItem(_('Rates'),90 children=[91 items.MenuItem(_('Sell rates'),92 children=[93 items.MenuItem(_('Ratecards'), '/extranet/pyfreebill/ratecard/'),94 items.MenuItem(_('Customer ratecards'), '/extranet/pyfreebill/customerratecards/'),95 items.MenuItem(_('Rates'), '/extranet/pyfreebill/customerrates/'),96 ]97 ),98 items.MenuItem(_('LCRs'), '/extranet/pyfreebill/lcrgroup/'),99 items.MenuItem(_('Provider rates'),100 children=[101 items.MenuItem(_('Provider tariffs'), '/extranet/pyfreebill/providertariff/'),102 items.MenuItem(_('Provider rates'), '/extranet/pyfreebill/providerrates/'),103 ]104 ),105 ]106 ),107 items.MenuItem(_('Reports'),108 children=[109 items.MenuItem(_('CDRs'), '/extranet/pyfreebill/cdr/',110 children=[111 items.MenuItem(_('CDRs view'), '/extranet/pyfreebill/cdr/'),112 items.MenuItem(_('Successfull CDRs'), '/extranet/pyfreebill/cdr/?effective_duration__gt=0'),113 items.MenuItem(_('Failed CDRs'), '/extranet/pyfreebill/cdr/?effective_duration__exact=0'),114 items.MenuItem(_('Hangup Cause'), '/extranet/pyfreebill/hangupcause/'),115 ]116 ),117 items.MenuItem(_('Reports'), '/extranet/report/'),118 ]119 ),120 items.MenuItem(_('Admin'),121 children=[122 items.MenuItem(_('Users'), '/extranet/auth/',123 children=[124 items.MenuItem(_('Groups'), '/extranet/auth/group/'),125 items.MenuItem(_('Users'), '/extranet/auth/user/'),126 items.MenuItem(_('Rates'), '/extranet/pyfreebill/customerrates/'),127 ]128 ),129 items.MenuItem(_('VoIP switches'),130 children=[131 items.MenuItem(_('VoIP switches'), '/extranet/pyfreebill/voipswitch/'),132 items.MenuItem(_('SIP profiles'), '/extranet/pyfreebill/sipprofile/'),133 items.MenuItem(_('Destination Number Normalization Rules'), '/extranet/pyfreebill/destinationnumberrules/'),134 items.MenuItem(_('ACL'), '/extranet/pyfreebill/acllists/'),135 ]136 ),137 items.MenuItem(_('Logs'),138 children=[139 items.MenuItem(_('Access logs'), '/extranet/axes/accesslog/'),140 items.MenuItem(_('Access attemps'), '/extranet/axes/accessattempt/'),141 items.MenuItem(_('Honeypot access attemps'), '/extranet/admin_honeypot/loginattempt/'),142 items.MenuItem(_('Recurring tasks logs'), '/extranet/chroniker/log/'),143 ]144 ),145 items.MenuItem(_('Databases'),146 children=[147 items.MenuItem(_('Database size'), '/extranet/database_size/table/'),148 ]149 ),150 items.MenuItem(_('Status'), '/extranet/status/'),151 ]152 ),153 ]154 else:155 self.children += [156 items.MenuItem(_('Dashboard'), reverse('admin:index')),157 items.MenuItem(_('My Account'), '/extranet/pyfreebill/company/'),158 items.MenuItem(_('My CDR'), '/extranet/pyfreebill/cdr/'),159 ]160# self.children += [161# ReturnToSiteItem()162# ]...
views.py
Source:views.py
1from django.shortcuts import render, get_object_or_4042from django.http import Http4043from django.views.generic import ListView, DetailView4from carts.models import Cart5# from analytics.signals import object_viewed_signal6from analytics.mixins import ObjectViewedMixin7from .models import MenuItem8# Create your views here.9class MenuFeaturedListView(ListView):10 template_name = "menuitem/list.html"11 def get_queryset(self, *args, **kwargs ):12 request = self.request13 return MenuItem.objects.features()14class MenuFeaturedDetailView(ObjectViewedMixin, DetailView):15 queryset = MenuItem.objects.features()16 template_name = "menuitem/featured-detail.html"17 # def get_queryset(self, *args, **kwargs ):18 # request = self.request19 # return MenuItem.objects.featured()20class MenuListView(ListView):21 queryset = MenuItem.objects.all()22 template_name = "menuitem/list.html"23 # def get_context_data(self, *args, **kwargs):24 # context = super(MenuListView, self).get_context_data(*args, **kwargs)25 # print(context)26 # return context27 def get_context_data(self, *args, **kwargs):28 context = super(MenuListView, self).get_context_data(*args, **kwargs)29 cart_obj, new_obj = Cart.objects.new_or_get(self.request)30 context["cart"] = cart_obj31 return context32 def get_queryset(self, *args, **kwargs ):33 request = self.request34 return MenuItem.objects.all()35def menu_list_view(request): #same as class view above but more complex36 queryset = MenuItem.objects.all()37 context = {38 "object_list": queryset39 }40 return render(request, "menuitem/list.html", context)41class MenuDetailSlugView(ObjectViewedMixin, DetailView):42 queryset = MenuItem.objects.all()43 template_name = "menuitem/detail.html"44 def get_context_data(self, *args, **kwargs):45 context = super(MenuDetailSlugView, self).get_context_data(*args, **kwargs)46 cart_obj, new_obj = Cart.objects.new_or_get(self.request)47 context["cart"] = cart_obj48 return context49 def get_object(self, *args, **kwargs):50 request = self.request51 slug = self.kwargs.get("slug")52 # instance = get_object_or_404(MenuItem, slug=slug, active=True)53 try:54 instance = MenuItem.objects.get(slug=slug, active=True)55 except MenuItem.DoesNotExist:56 raise Http404("Not found ...")57 except MenuItem.MultipleObjectsReturned:58 qs = MenuItem.objects.filter(slug=slug, active=True)59 instance = qs.first()60 except:61 raise Http404("some other error")62 # analytics.py. Send the class when sending the signal63 # sender of the view as class, instance, and request64 # function based views need to do this for every function65 # but mixins allow to bypass using a class definition only once66 # object_viewed_signal.send(instance.__class__, instance=instance, request=request )67 return instance68class MenuDetailView(ObjectViewedMixin, DetailView):69 # queryset = MenuItem.objects.all()70 template_name = "menuitem/detail.html"71 def get_context_data(self, *args, **kwargs):72 context = super(MenuDetailView, self).get_context_data(*args, **kwargs)73 print(context)74 return context75 def get_queryset(self, *args, **kwargs ):76 request = self.request77 pk = self.kwargs.get('pk')78 return MenuItem.objects.filter(pk = pk)79 def get_object(self, *args, **kwargs):80 request = self.request81 pk = self.kwargs.get("pk")82 instance = MenuItem.objects.get_by_id(pk)83 if instance is None:84 raise Http404("Menu Item does NOT exist!")85 return instance86def menu_detail_view(request, pk=None, *args, **kwargs): #same as class view above but more complex87 # instance = MenuItem.objects.get(id=pk)88 # instance = get_object_or_404(MenuItem, pk=pk)89 # try:90 # instance = MenuItem.objects.get(id=pk)91 # except MenuItem.DoesNotExist:92 # print("item does not exist")93 # raise Http404("Menu Item does NOT exist!")94 # except:95 # print("Some other problem")96 instance = MenuItem.objects.get_by_id(pk)97 if instance is None:98 raise Http404("Menu Item does NOT exist!")99 # qs = MenuItem.objects.filter(id=pk)100 # print(qs)101 # print(instance)102 #103 # if qs.exists() and qs.count() == 1:104 # instance = qs.first()105 # else:106 # raise Http404("Menu item does NOT exists!")107 context = {108 "object": instance109 }...
menus.py
Source:menus.py
...5import logging6logger = logging.getLogger(__name__)7settings_url = 'mtimetables:settings:%s_list'8settings_children = (9 menu.MenuItem('General', reverse('mtimetables:settings:index')),10 menu.MenuItem('Hours', reverse(settings_url % 'timetablegrid')),11 menu.MenuItem('Activity types', reverse(settings_url % 'activitytype')),12 menu.MenuItem('Requirement types', reverse(settings_url % 'requirementtype')),13)14data_url = 'mtimetables:data:%s_list'15data_children = (16 # menu.MenuItem('Activity types', reverse(data_url % 'activitytype')),17 menu.MenuItem('Departments', reverse(data_url % 'department')),18 menu.MenuItem('Groups', reverse(data_url % 'group')),19 menu.MenuItem('Users', reverse(data_url % 'user')),20 menu.MenuItem('Study types', reverse(data_url % 'studytype')),21 menu.MenuItem('Subjects', reverse(data_url % 'subject')),22 menu.MenuItem('Activity definitions', reverse(data_url % 'activitydefinition')),23 menu.MenuItem('Rooms', reverse(data_url % 'room')),24 menu.MenuItem('Room types', reverse(data_url % 'roomtype')),25 menu.MenuItem('Equipments', reverse(data_url % 'equipment')),26)27requirement_url = 'mtimetables:requirements:%s_list'28requirements_children = (29 menu.MenuItem('Requirement packages', reverse(requirement_url % 'requirementpackage')),30 # menu.MenuItem('Requirement types', reverse(requirement_url % 'requirementtype')),31 menu.MenuItem('Requirements', reverse(requirement_url % 'requirement')),32 menu.MenuItem('Groups', reverse(requirement_url % 'group'), separator=True),33 menu.MenuItem('Users', reverse(requirement_url % 'user')),34 menu.MenuItem('Subjects', reverse(requirement_url % 'subject')),35 menu.MenuItem('Activity types', reverse(requirement_url % 'activitytype')),36 menu.MenuItem('Activity definitions', reverse(requirement_url % 'activitydefinition')),37 menu.MenuItem('Rooms', reverse(requirement_url % 'room')),38 menu.MenuItem('Room types', reverse(requirement_url % 'roomtype')),39)40timetable_url = 'mtimetables:timetable:%s_list'41events_children = (42 menu.MenuItem('All events', reverse(timetable_url % 'event')),43 menu.MenuItem('One time events', reverse(timetable_url % 'onetimeevent')),44 menu.MenuItem('Semeter events', reverse(timetable_url % 'semesterevent')),45 menu.MenuItem('Collisions', reverse(timetable_url % 'collision')),46)47semester_calendar_children = (48)49examination_period_calendar_children = (50)51calendar_children = (52)53# menu.Menu.add_item('main', menu.MenuItem('Home', '/', icon='home'))54menu.Menu.add_item('main', menu.MenuItem('Data', reverse('mtimetables:data:index'), icon='hdd', children=data_children))55menu.Menu.add_item('main', menu.MenuItem('Requirements', reverse('mtimetables:requirements:index'), icon='filter', children=requirements_children))56menu.Menu.add_item('main', menu.MenuItem('Events', reverse('mtimetables:timetable:index'), icon='list-alt', children=events_children))57menu.Menu.add_item('main', menu.MenuItem('Semester timetable', reverse('mtimetables:calendar:semester'), icon='th', children=semester_calendar_children))58menu.Menu.add_item('main', menu.MenuItem('Examination period timetable', reverse('mtimetables:calendar:examinationperiod'), icon='th-list', children=examination_period_calendar_children))59menu.Menu.add_item('main', menu.MenuItem('Calendar', reverse('mtimetables:calendar:index'), icon='calendar', children=calendar_children))60menu.Menu.add_item('right', menu.MenuItem('Settings', reverse('mtimetables:settings:index'), icon_only=True, icon='wrench', children=settings_children))...
Using AI Code Generation
1require({cache:{2'Sage/Platform/Mobile/Menu':function(){3define("Sage/Platform/Mobile/Menu", [4], function(5) {6 return declare('Sage.Platform.Mobile.Menu', [_WidgetBase, _TemplatedMixin, _Contained, _Container], {
Using AI Code Generation
1require(['argos/Menu'], function(Menu) {2 var mnu = new Menu();3 mnu.addItem({4 fn: function() {5 console.log('Menu Item 1 clicked');6 }7 });8 mnu.addItem({9 fn: function() {10 console.log('Menu Item 2 clicked');11 }12 });13 mnu.show();14});
Using AI Code Generation
1import MenuItem from 'argos-sdk/src/MenuItem';2import Utility from 'argos-sdk/src/Utility';3import ErrorManager from 'argos-sdk/src/ErrorManager';4import Utility from 'argos-sdk/src/Utility';5import ErrorManager from 'argos-sdk/src/ErrorManager';6import Utility from 'argos-sdk/src/Utility';7import ErrorManager from 'argos-sdk/src/ErrorManager';8import Utility from 'argos-sdk/src/Utility';9import ErrorManager from 'argos-sdk/src/ErrorManager';10import Utility from 'argos-sdk/src/Utility';11import ErrorManager from 'argos-sdk/src/ErrorManager';12import Utility from 'argos-sdk/src/Utility';13import ErrorManager from 'argos-sdk/src/ErrorManager';
Using AI Code Generation
1var MenuItem = require('argos-sdk/src/MenuItem');2var menu = new MenuItem({3});4var MenuManager = require('argos-sdk/src/MenuManager');5var menuManager = new MenuManager();6menuManager.register('test', menu);7var View = require('argos-sdk/src/View');8var view = new View({9});10view.prototype.createToolLayout = function() {11 return this.tools || (this.tools = {12 tbar: [{
Using AI Code Generation
1import { MenuItem } from 'argos-sdk';2 new MenuItem({3 }),4 new MenuItem({5 id: 'import',6 action: 'import',7 label: this.importText,8 }),9];10const menu = this.tools.createMenu({11});12menu.show({13});14menu.destroy();15 new MenuItem({16 }),17 new MenuItem({18 id: 'import',19 action: 'import',20 label: this.importText,21 }),22];23const menu = this.tools.createMenu({24});25menu.show({26});27menu.destroy();28 new MenuItem({
Using AI Code Generation
1require('argos-sdk').declareClass('argos.Test', null, {2 init: function() {3 var menu = new argos.Menu();4 var menuItem = new argos.MenuItem({5 });6 menu.add(menuItem);7 this.tools.menus.push(menu);8 }9});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!