Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger ui redesign/custom dropdown #5381

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
58d48f7
improvement: OAS3 $ref friendly-name regex in model.jsx (via #5334)
May 2, 2019
96c444e
improvement: relax schema description styling so Markdown can be effe…
May 16, 2019
5d25a0b
improvement: add `isShown` check to <ModelCollapse />'s prop `expande…
May 16, 2019
af2d308
Add and apply default button classes, styling
May 17, 2019
c982c99
Update buttons to use custom component
May 17, 2019
da74896
Fix breaking unit tests
May 20, 2019
d4142af
Replace button transition, replace EOF new-line
May 20, 2019
47a28a5
Apply custom sui-btn-wrapper class
May 20, 2019
56d333e
Add span wrapper for button-text (allows us to apply em padding / mar…
May 20, 2019
5628ff0
security: CVE-2018-20834 (via #5368)
shockey May 22, 2019
54c045f
release: v3.22.2
swaggerhub-bot May 22, 2019
3ca5c6b
Abstract default classnames to Button component
May 22, 2019
2c96056
Use classnames lib where applicable
May 22, 2019
31f7242
Fix unit tests
May 22, 2019
52c64f5
Tidy up, remove unused classnames
May 22, 2019
b3396fb
eliminate `auth` class
shockey May 22, 2019
7f98d2c
eliminate `authorize` class
shockey May 22, 2019
bc440b3
move `.sui-btn--authorize` to buttons stylesheet
shockey May 22, 2019
11e7873
Merge remote-tracking branch 'upstream/facelift' into swagger-ui-rede…
May 23, 2019
9447b77
Remove duplicate import after merge
May 23, 2019
e5017bc
Merge remote-tracking branch 'upstream/master' into facelift
May 23, 2019
c5b3051
Merge remote-tracking branch 'upstream/facelift' into facelift
May 24, 2019
c22347b
Dropdown component set up
taraokelly May 27, 2019
bb13e90
Dropdown id & custom class props
taraokelly May 27, 2019
94ca144
Dropdown disabled prop
taraokelly May 27, 2019
91a9fdc
Merge with facelift branch
taraokelly May 27, 2019
daadac5
Basic DropDownItem, Updated Dropdown child classnames to not inherit …
taraokelly May 28, 2019
9049352
Layout-utils restucture
taraokelly May 28, 2019
8859fd7
Merge remote-tracking branch 'upstream/facelift' into facelift
May 29, 2019
2164c1a
Dropdown Basic controls
taraokelly May 29, 2019
9e04847
Dropdown Labels
taraokelly May 29, 2019
ea76c04
Moved Dropdown to LayoutUtils
taraokelly May 29, 2019
1f8e606
Dropdowm relocation cleanup
taraokelly May 29, 2019
d3ba30d
Dropdowm relocation cleanup P2
taraokelly May 29, 2019
704e702
Dropdown refs rough draft
taraokelly May 30, 2019
1533cd5
Dropdown movement controls
taraokelly May 31, 2019
2e6c45d
Dropdown select option functionality
taraokelly May 31, 2019
0ad9c85
Dropdown default selected value and default placeholder
taraokelly May 31, 2019
d1f7a27
Add temporary dropdown icon - to be replaced by fontawesome
May 31, 2019
3da2770
Move clickhandler to li element
May 31, 2019
e5c3a19
Wrap dropdown text in span
May 31, 2019
8ad79d0
Update alter-hue mixin to accept custom degree
May 31, 2019
76ce7e5
Update dropdown styling
May 31, 2019
e915637
Apply custom Dropdown to "schemes"
May 31, 2019
5e914a4
Merge branch 'swagger-ui-redesign/custom-dropdown' of https://github.…
May 31, 2019
5775f8b
Dropdown onChange
taraokelly May 31, 2019
1ce1e49
Merge branch 'swagger-ui-redesign/custom-dropdown' of https://github.…
taraokelly May 31, 2019
0d0194c
Removed Dropdown labels
taraokelly May 31, 2019
82a4ba5
Dropdown classname improvements
taraokelly May 31, 2019
47ae9fd
IE/Edge specific keyboard event keys
taraokelly May 31, 2019
6eaa1a2
Removed onKeyPress
taraokelly May 31, 2019
031f9cb
Dropdown classname improvements
taraokelly May 31, 2019
10fda7b
Dropdown move item focus function
taraokelly Jun 4, 2019
3ed9ef0
Dropdown move item focus function update
taraokelly Jun 4, 2019
4052cd2
Replaced xclass with classnames
taraokelly Jun 4, 2019
6f5ea91
Merge with facelift
taraokelly Jun 4, 2019
926d49e
Merge pull request #6 from swagger-api/facelift
lshaw-sb Jun 4, 2019
dee5ac0
Merge with facelift
taraokelly Jun 4, 2019
17088b6
Dropdown styling
taraokelly Jun 4, 2019
9727bc3
Dropdown seperate children function
taraokelly Jun 4, 2019
61eca0b
Dropdown icon
taraokelly Jun 5, 2019
0a690da
Dropdown error handling - no children
taraokelly Jun 5, 2019
64bd568
Dropdown no options available msg
taraokelly Jun 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
272 changes: 0 additions & 272 deletions src/core/components/layout-utils.jsx

This file was deleted.

31 changes: 31 additions & 0 deletions src/core/components/layout-utils/button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react"
import PropTypes from "prop-types"
import cx from "classnames"

export default class Button extends React.Component {

static propTypes = {
className: PropTypes.string,
unstyled: PropTypes.bool,
mod: PropTypes.string
}

static defaultProps = {
className: "",
unstyled: false,
mod: "primary"
}

defaultClasses = ({ unstyled, mod }) => !unstyled ? `sui-btn sui-btn--${mod}` : ""

render() {
const { unstyled, mod, className, ...props } = this.props

return (
<button
{...props}
className={cx(className, this.defaultClasses({ unstyled, mod }))}
/>
)
}
}
69 changes: 69 additions & 0 deletions src/core/components/layout-utils/col.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from "react"
import PropTypes from "prop-types"
import cx from "classnames"

const DEVICES = {
"mobile": "",
"tablet": "-tablet",
"desktop": "-desktop",
"large": "-hd"
}

export default class Col extends React.Component {

render() {
const {
hide,
keepContents,
/* we don't want these in the `rest` object that passes to the final component,
since React now complains. So we extract them */
/* eslint-disable no-unused-vars */
mobile,
tablet,
desktop,
large,
/* eslint-enable no-unused-vars */
...rest
} = this.props

if(hide && !keepContents)
return <span/>

let classesAr = []

for (let device in DEVICES) {
if (!DEVICES.hasOwnProperty(device)) {
continue
}
let deviceClass = DEVICES[device]
if(device in this.props) {
let val = this.props[device]

if(val < 1) {
classesAr.push("none" + deviceClass)
continue
}

classesAr.push("block" + deviceClass)
classesAr.push("col-" + val + deviceClass)
}
}

let classes = cx(rest.className, classesAr.join(" "))

return (
<section {...rest} style={{display: hide ? "none": null}} className={classes}/>
)
}

}

Col.propTypes = {
hide: PropTypes.bool,
keepContents: PropTypes.bool,
mobile: PropTypes.number,
tablet: PropTypes.number,
desktop: PropTypes.number,
large: PropTypes.number,
className: PropTypes.string
}
Loading