Skip to content

Commit abc05fb

Browse files
author
Shammamah Hossain
authored
Use dash generate components (#67)
* Update styled-components, webpack, and babel-loader. * Remove builder and use dash-generate-components. * Add webpack config. * Update bundle location and .eslintignore. * Remove old build artefacts. * Fix tests. Change shallow mount to full mount; call render(); check props and not state of components. * Split exponentials and regular digits for PrecisionInput test. * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps. * Add default value for required precision prop in PrecisionInput. * Comply with prop type for min in GraduatedBar test. * Comply with prop type for secondary in Indicator component. * Add jest-canvas-mock for Chrome colorpicker. See: hustcc/jest-canvas-mock#2 (comment) * Update requirements. * Move jest-canvas-mock to dev dependencies. * Update CHANGELOG. * Update version in package.json. * Add back build artifacts.
1 parent c2071e3 commit abc05fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+16277
-9511
lines changed

.babelrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "./node_modules/dash-components-archetype/config/babel/babelrc"
2+
"presets": [["@babel/preset-env", {
3+
"useBuiltIns": "usage",
4+
"corejs": 3
5+
}], "@babel/preset-react"]
36
}

.builderrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ build/
22
coverage/
33
dist/
44
lib/
5-
lib/bundle.js*
5+
lib/*.js*
66
node_modules/
77
dash_daq/metadata.json
8-
dash_daq/bundle.js*
9-
inst/deps/bundle.js*
8+
dash_daq/*.js*
9+
inst/deps/*.js*
10+
webpack.config.js
1011
.npm
1112
vv/
1213
venv/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The format is based on [Keep a
66
Changelog](http://keepachangelog.com/en/1.0.0/) and this project
77
adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9+
## [0.2.2] - 2019-10-04
10+
11+
### Fixed
12+
* Fixed ThemeProvider warning by updating `styled-components` to `v4.4.0`.
13+
914
## [0.2.1] - 2019-09-24
1015

1116
### Fixed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Package: dashDaq
22
Title: DAQ components for Dash
3-
Version: 0.1.5
3+
Version: 0.2.2
44
Authors @R: as.person(c(The Plotly Team <[email protected]>))
55
Description: DAQ components for Dash
66
Depends: R (>= 3.0.2)
7-
Imports: dash
7+
Imports:
88
Suggests:
99
License: MIT + file LICENSE
1010
URL: https://github.com/plotly/dash-daq

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
include dash_daq/bundle.js
2-
include dash_daq/bundle.js.map
1+
include dash_daq/dash_daq.min.js
2+
include dash_daq/dash_daq.min.js.map
33
include dash_daq/metadata.json
44
include dash_daq/[email protected]
55
include dash_daq/package-info.json

NAMESPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,3 @@ export(daqStopButton)
1717
export(daqTank)
1818
export(daqThermometer)
1919
export(daqToggleSwitch)
20-
21-
import(dash)

R/daqTank.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# AUTO GENERATED FILE - DO NOT EDIT
22

3-
daqTank <- function(id=NULL, value=NULL, size=NULL, color=NULL, min=NULL, max=NULL, base=NULL, logarithmic=NULL, showCurrentValue=NULL, units=NULL, label=NULL, labelPosition=NULL, scale=NULL, className=NULL, style=NULL) {
3+
daqTank <- function(id=NULL, value=NULL, height=NULL, width=NULL, color=NULL, min=NULL, max=NULL, base=NULL, logarithmic=NULL, showCurrentValue=NULL, units=NULL, label=NULL, labelPosition=NULL, scale=NULL, className=NULL, style=NULL) {
44

5-
props <- list(id=id, value=value, size=size, color=color, min=min, max=max, base=base, logarithmic=logarithmic, showCurrentValue=showCurrentValue, units=units, label=label, labelPosition=labelPosition, scale=scale, className=className, style=style)
5+
props <- list(id=id, value=value, height=height, width=width, color=color, min=min, max=max, base=base, logarithmic=logarithmic, showCurrentValue=showCurrentValue, units=units, label=label, labelPosition=labelPosition, scale=scale, className=className, style=style)
66
if (length(props) > 0) {
77
props <- props[!vapply(props, is.null, logical(1))]
88
}
99
component <- list(
1010
props = props,
1111
type = 'Tank',
1212
namespace = 'dash_daq',
13-
propNames = c('id', 'value', 'size', 'color', 'min', 'max', 'base', 'logarithmic', 'showCurrentValue', 'units', 'label', 'labelPosition', 'scale', 'className', 'style'),
13+
propNames = c('id', 'value', 'height', 'width', 'color', 'min', 'max', 'base', 'logarithmic', 'showCurrentValue', 'units', 'label', 'labelPosition', 'scale', 'className', 'style'),
1414
package = 'dashDaq'
1515
)
1616

R/daqThermometer.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# AUTO GENERATED FILE - DO NOT EDIT
22

3-
daqThermometer <- function(id=NULL, value=NULL, size=NULL, color=NULL, min=NULL, max=NULL, base=NULL, logarithmic=NULL, showCurrentValue=NULL, units=NULL, theme=NULL, label=NULL, labelPosition=NULL, scale=NULL, className=NULL, style=NULL) {
3+
daqThermometer <- function(id=NULL, value=NULL, height=NULL, width=NULL, color=NULL, min=NULL, max=NULL, base=NULL, logarithmic=NULL, showCurrentValue=NULL, units=NULL, theme=NULL, label=NULL, labelPosition=NULL, scale=NULL, className=NULL, style=NULL) {
44

5-
props <- list(id=id, value=value, size=size, color=color, min=min, max=max, base=base, logarithmic=logarithmic, showCurrentValue=showCurrentValue, units=units, theme=theme, label=label, labelPosition=labelPosition, scale=scale, className=className, style=style)
5+
props <- list(id=id, value=value, height=height, width=width, color=color, min=min, max=max, base=base, logarithmic=logarithmic, showCurrentValue=showCurrentValue, units=units, theme=theme, label=label, labelPosition=labelPosition, scale=scale, className=className, style=style)
66
if (length(props) > 0) {
77
props <- props[!vapply(props, is.null, logical(1))]
88
}
99
component <- list(
1010
props = props,
1111
type = 'Thermometer',
1212
namespace = 'dash_daq',
13-
propNames = c('id', 'value', 'size', 'color', 'min', 'max', 'base', 'logarithmic', 'showCurrentValue', 'units', 'theme', 'label', 'labelPosition', 'scale', 'className', 'style'),
13+
propNames = c('id', 'value', 'height', 'width', 'color', 'min', 'max', 'base', 'logarithmic', 'showCurrentValue', 'units', 'theme', 'label', 'labelPosition', 'scale', 'className', 'style'),
1414
package = 'dashDaq'
1515
)
1616

R/internal.R

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
11
.dashDaq_js_metadata <- function() {
22
deps_metadata <- list(`dash_daq` = structure(list(name = "dash_daq",
3-
version = "0.1.5", src = list(href = NULL,
3+
version = "0.2.2", src = list(href = NULL,
44
file = "deps"), meta = NULL,
5-
script = 'bundle.js',
5+
script = 'dash_daq.min.js',
66
stylesheet = NULL, head = NULL, attachment = NULL, package = "dashDaq",
77
all_files = FALSE), class = "html_dependency"))
88
return(deps_metadata)
99
}
10-
11-
dash_assert_valid_wildcards <- function (attrib = list("data", "aria"), ...)
12-
{
13-
args <- list(...)
14-
validation_results <- lapply(names(args), function(x) {
15-
grepl(paste0("^", attrib, "-[a-zA-Z0-9]{1,}$", collapse = "|"),
16-
x)
17-
})
18-
if (FALSE %in% validation_results) {
19-
stop(sprintf("The following wildcards are not currently valid in Dash: '%s'",
20-
paste(names(args)[grepl(FALSE, unlist(validation_results))],
21-
collapse = ", ")), call. = FALSE)
22-
}
23-
else {
24-
return(args)
25-
}
26-
}

0 commit comments

Comments
 (0)