mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-11 16:08:19 -05:00
Compare commits
113 Commits
v1.7.4
...
tests/upda
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a9e3b6930 | ||
|
|
1240223a4b | ||
|
|
dbbe7f9679 | ||
|
|
61a51a869f | ||
|
|
298822fc44 | ||
|
|
283c71e772 | ||
|
|
b1297395a9 | ||
|
|
b850cd2509 | ||
|
|
56878ebbaa | ||
|
|
6a09fda08e | ||
|
|
77bc4e9ec7 | ||
|
|
a1b9fda809 | ||
|
|
97a12ec601 | ||
|
|
81bdde64c4 | ||
|
|
c4ef42337b | ||
|
|
ce78d0dcf1 | ||
|
|
7069064dd6 | ||
|
|
a0a83d5fe3 | ||
|
|
8fbc4ad4c1 | ||
|
|
5346a00373 | ||
|
|
2dc69aea37 | ||
|
|
be6f6716bf | ||
|
|
7f59f93692 | ||
|
|
798b336df6 | ||
|
|
bef6b4bfd9 | ||
|
|
80ab088e2d | ||
|
|
481a692b07 | ||
|
|
8ae936ba01 | ||
|
|
6dc377842f | ||
|
|
837307fe8c | ||
|
|
dfe359c1b6 | ||
|
|
b8923e9497 | ||
|
|
9ebcbf8a2d | ||
|
|
a6fc6bf8cb | ||
|
|
eddc3047d4 | ||
|
|
6db17d4f67 | ||
|
|
d21f9493fb | ||
|
|
e87f942e89 | ||
|
|
1eb9ed7345 | ||
|
|
9d923d079a | ||
|
|
b054e45402 | ||
|
|
8b1d30aefe | ||
|
|
ab87a0708d | ||
|
|
0b97ee1ecc | ||
|
|
68546c319e | ||
|
|
69188fef22 | ||
|
|
6be6dfbfeb | ||
|
|
6fc06281bd | ||
|
|
f724128d41 | ||
|
|
518ef0f9f8 | ||
|
|
f5b395485e | ||
|
|
31aca7aa70 | ||
|
|
b38a630224 | ||
|
|
1b7709411b | ||
|
|
2b48aa0d91 | ||
|
|
6fdf23752e | ||
|
|
8542f5d017 | ||
|
|
e7b830755a | ||
|
|
23c7b0683a | ||
|
|
5805895581 | ||
|
|
90539bff25 | ||
|
|
62bb21d5b6 | ||
|
|
4f85268d44 | ||
|
|
611e517bb8 | ||
|
|
4d05a568c1 | ||
|
|
1330325519 | ||
|
|
92d850efa6 | ||
|
|
7bf56125eb | ||
|
|
69f861cc8a | ||
|
|
a94be7b128 | ||
|
|
703766fb2e | ||
|
|
8e73749e21 | ||
|
|
dc8ffa115b | ||
|
|
a0385da0d7 | ||
|
|
a6b7dee4cd | ||
|
|
f9ff5c2637 | ||
|
|
6a1fbc57f4 | ||
|
|
38337a926f | ||
|
|
bf6b87886c | ||
|
|
33e6b0a305 | ||
|
|
cb5eac052f | ||
|
|
39fee3782f | ||
|
|
654f30a312 | ||
|
|
a763da2b94 | ||
|
|
0c177d30dc | ||
|
|
20f8a181d4 | ||
|
|
eebcf70bb9 | ||
|
|
e7d62f55ca | ||
|
|
3a4e5f3982 | ||
|
|
3381c3a6b9 | ||
|
|
e42c920587 | ||
|
|
4635665394 | ||
|
|
08ff066fa3 | ||
|
|
816072fc29 | ||
|
|
5eb442aa03 | ||
|
|
c32db50585 | ||
|
|
1d9dde52df | ||
|
|
6176f03ad0 | ||
|
|
0fc1be52eb | ||
|
|
db2ad780c0 | ||
|
|
5cd848bd28 | ||
|
|
a063540407 | ||
|
|
aa932532f3 | ||
|
|
8160f8c726 | ||
|
|
af900d1037 | ||
|
|
49320e6edd | ||
|
|
4308887296 | ||
|
|
dffd8bc7fd | ||
|
|
554f835293 | ||
|
|
50e7b6768d | ||
|
|
db222af7e0 | ||
|
|
5b688707b7 | ||
|
|
8dfd8f5b33 |
@@ -15,6 +15,11 @@ parser: '@typescript-eslint/parser'
|
||||
parserOptions:
|
||||
ecmaVersion: 2018
|
||||
sourceType: module
|
||||
project:
|
||||
- './tsconfig.json'
|
||||
ignorePatterns: # mirrors tsconfig.json's exclude
|
||||
- '**/__tests__'
|
||||
- '**/*.d.ts'
|
||||
plugins:
|
||||
- '@typescript-eslint'
|
||||
- prettier
|
||||
@@ -70,6 +75,10 @@ rules:
|
||||
|
||||
"@typescript-eslint/consistent-type-imports":
|
||||
- error
|
||||
|
||||
"@typescript-eslint/no-floating-promises":
|
||||
- error
|
||||
|
||||
"@typescript-eslint/naming-convention":
|
||||
- error
|
||||
|
||||
|
||||
@@ -7,3 +7,4 @@ plugins:
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.2.3.cjs
|
||||
checksumBehavior: update
|
||||
|
||||
31
DESCRIPTION
31
DESCRIPTION
@@ -1,19 +1,19 @@
|
||||
Package: shiny
|
||||
Type: Package
|
||||
Title: Web Application Framework for R
|
||||
Version: 1.7.3.9001
|
||||
Version: 1.8.0.9000
|
||||
Authors@R: c(
|
||||
person("Winston", "Chang", role = c("aut", "cre"), email = "winston@rstudio.com", comment = c(ORCID = "0000-0002-1576-2126")),
|
||||
person("Joe", "Cheng", role = "aut", email = "joe@rstudio.com"),
|
||||
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
|
||||
person("Carson", "Sievert", role = "aut", email = "carson@rstudio.com", comment = c(ORCID = "0000-0002-4958-2844")),
|
||||
person("Barret", "Schloerke", role = "aut", email = "barret@rstudio.com", comment = c(ORCID = "0000-0001-9986-114X")),
|
||||
person("Yihui", "Xie", role = "aut", email = "yihui@rstudio.com"),
|
||||
person("Jeff", "Allen", role = "aut", email = "jeff@rstudio.com"),
|
||||
person("Jonathan", "McPherson", role = "aut", email = "jonathan@rstudio.com"),
|
||||
person("Winston", "Chang", role = c("aut", "cre"), email = "winston@posit.co", comment = c(ORCID = "0000-0002-1576-2126")),
|
||||
person("Joe", "Cheng", role = "aut", email = "joe@posit.co"),
|
||||
person("JJ", "Allaire", role = "aut", email = "jj@posit.co"),
|
||||
person("Carson", "Sievert", role = "aut", email = "carson@posit.co", comment = c(ORCID = "0000-0002-4958-2844")),
|
||||
person("Barret", "Schloerke", role = "aut", email = "barret@posit.co", comment = c(ORCID = "0000-0001-9986-114X")),
|
||||
person("Yihui", "Xie", role = "aut", email = "yihui@posit.co"),
|
||||
person("Jeff", "Allen", role = "aut"),
|
||||
person("Jonathan", "McPherson", role = "aut", email = "jonathan@posit.co"),
|
||||
person("Alan", "Dipert", role = "aut"),
|
||||
person("Barbara", "Borges", role = "aut"),
|
||||
person(family = "RStudio", role = "cph"),
|
||||
person("Posit Software, PBC", role = c("cph", "fnd")),
|
||||
person(family = "jQuery Foundation", role = "cph",
|
||||
comment = "jQuery library and jQuery UI library"),
|
||||
person(family = "jQuery contributors", role = c("ctb", "cph"),
|
||||
@@ -79,7 +79,7 @@ Imports:
|
||||
jsonlite (>= 0.9.16),
|
||||
xtable,
|
||||
fontawesome (>= 0.4.0),
|
||||
htmltools (>= 0.5.3.9001),
|
||||
htmltools (>= 0.5.4),
|
||||
R6 (>= 2.0),
|
||||
sourcetools,
|
||||
later (>= 1.0.0),
|
||||
@@ -87,7 +87,7 @@ Imports:
|
||||
tools,
|
||||
crayon,
|
||||
rlang (>= 0.4.10),
|
||||
fastmap (>= 1.1.0),
|
||||
fastmap (>= 1.1.1),
|
||||
withr,
|
||||
commonmark (>= 1.7),
|
||||
glue (>= 1.3.2),
|
||||
@@ -111,7 +111,8 @@ Suggests:
|
||||
ragg,
|
||||
showtext,
|
||||
sass
|
||||
URL: https://shiny.rstudio.com/
|
||||
URL: https://shiny.posit.co/,
|
||||
https://github.com/rstudio/shiny
|
||||
BugReports: https://github.com/rstudio/shiny/issues
|
||||
Collate:
|
||||
'globals.R'
|
||||
@@ -202,12 +203,10 @@ Collate:
|
||||
'version_selectize.R'
|
||||
'version_strftime.R'
|
||||
'viewer.R'
|
||||
RoxygenNote: 7.2.2
|
||||
RoxygenNote: 7.2.3
|
||||
Encoding: UTF-8
|
||||
Roxygen: list(markdown = TRUE)
|
||||
RdMacros: lifecycle
|
||||
Config/testthat/edition: 3
|
||||
Config/Needs/check:
|
||||
shinytest2
|
||||
Remotes:
|
||||
rstudio/htmltools
|
||||
|
||||
278
NEWS.md
278
NEWS.md
@@ -1,5 +1,75 @@
|
||||
shiny 1.7.3.9000
|
||||
================
|
||||
# shiny (development version)
|
||||
|
||||
## New features and improvements
|
||||
|
||||
* Added an console that shows some errors in the browser. Also provide better error messages for duplicate input and output bindings. (#3931)
|
||||
|
||||
# shiny 1.8.0
|
||||
|
||||
## Breaking changes
|
||||
|
||||
* Closed #3899: The JS function `Shiny.bindAll()` is now asynchronous. This change is driven by the recent push toward making dynamic UI rendering asynchronous, which is necessary for [shinylive](https://shinylive.io/r) (and should've happened when it was first introduced in Shiny v1.7.5). The vast majority of existing `Shiny.bindAll()` uses should continue to work as before, but some cases may break if downstream code relies on it being synchronous (i.e., blocking the main thread). In this case, consider placing any downstream code in a `.then()` callback (or `await` the result in a `async` function). (#3929)
|
||||
* Since `renderContent()` calls `bindAll()` (after it inserts content), it now returns a `Promise<void>` instead of `void`, which can be useful if downstream code needs to wait for the binding to complete.
|
||||
|
||||
## New features and improvements
|
||||
|
||||
* Updated `selectizeInput()`'s selectize.js dependency from v0.12.4 to v0.15.2. In addition to many bug fixes and improvements, this update also adds several new [plugin options](https://selectize.dev/docs/demos/plugins). (#3875)
|
||||
|
||||
* Shiny's CSS styling (for things like `showNotification()`, `withProgress()`, `inputPanel()`, etc.), has been updated with `{bslib}`'s upcoming CSS-only dark mode feature in mind. (#3882, #3914)
|
||||
|
||||
* Default styles for `showNotification()` were tweaked slightly to improve accessibility, sizing, and padding. (#3913)
|
||||
|
||||
* Shiny inputs and `{htmlwidgets}` are no longer treated as draggable inside of `absolutePanel()`/`fixedPanel()` with `draggable = TRUE`. As a result, interactions like zooming and panning now work as expected with widgets like `{plotly}` and `{leaflet}` when they appear in a draggable panel. (#3752, #3933)
|
||||
|
||||
* For `InputBinding`s, the `.receiveMessage()` method can now be asynchronous or synchronous (previously it could only be synchronous). (#3930)
|
||||
|
||||
## Bug fixes
|
||||
|
||||
* `fileInput()` no longer has unwanted round corners applied to the `buttonLabel`. (#3879)
|
||||
|
||||
* Fixed #3898: `wrapFunctionLabel()` no longer throws an error if the `name` is longer than 10000 bytes. (#3903)
|
||||
|
||||
# shiny 1.7.5.1
|
||||
|
||||
## Bug fixes
|
||||
|
||||
* On r-devel (R > 4.3.1), `isTruthy(NULL)` now returns `FALSE` (as it does with older versions of R). (#3906)
|
||||
|
||||
# shiny 1.7.5
|
||||
|
||||
## Possibly breaking changes
|
||||
|
||||
* For `reactiveValues()` objects, whenever the `$names()` or `$values()` methods are called, the keys are now returned in the order that they were inserted. (#3774)
|
||||
|
||||
* The value provided to `options(shiny.json.digits)` is now interpreted as number of _digits after the decimal_ instead of _significant digits_. To treat the value as significant digits, wrap it in `I()` (e.g., `options(shiny.json.digits = I(4))`). This new default behavior not only helps with reducing digits in testing snapshots, but is also more consistent with `{jsonlite}`'s default behavior. (#3819)
|
||||
|
||||
## New features and improvements
|
||||
|
||||
* Closed #789: Dynamic UI is now rendered asynchronously, thanks in part to the newly exported `Shiny.renderDependenciesAsync()`, `Shiny.renderHtmlAsync()`, and `Shiny.renderContentAsync()`. Importantly, this means `<script>` tags are now loaded asynchronously (the old way used `XMLHttpRequest`, which is synchronous). In addition, `Shiny` now manages a queue of async tasks (exposed via `Shiny.shinyapp.taskQueue`) so that order of execution is preserved. (#3666)
|
||||
|
||||
* Fixes #3840: `updateSliderInput()` now warns when attempting to set invalid `min`, `max`, or `value` values. Sending an invalid update message to an input no longer causes other update messages to fail. (#3843)
|
||||
|
||||
* `sliderInput()` now has a larger target area for clicking or tapping on the slider handle or range. (#3859)
|
||||
|
||||
* Closed #2956: Component authors can now prevent Shiny from creating an input binding on specific elements by adding the `data-shiny-no-bind-input` attribute to the element. The attribute may have any or no value; its presence will prevent binding. This feature is primarily useful for input component authors who want to use standard HTML input elements without causing Shiny to create an input binding for them. Additionally, Shiny now adds custom classes to its inputs. For example, `checkboxInput()` now has a `shiny-input-checkbox` class. These custom classes may be utilized in future updates to Shiny's input binding logic. (#3861)
|
||||
|
||||
* `Map` objects are now initialized at load time instead of build time. This avoids potential problems that could arise from storing `fastmap` objects into the built Shiny package. (#3775)
|
||||
|
||||
## Bug fixes
|
||||
|
||||
* Fixed #3771: Sometimes the error `ion.rangeSlider.min.js: i.stopPropagation is not a function` would appear in the JavaScript console. (#3772)
|
||||
|
||||
* Fixed #3833: When `width` is provided to `textAreaInput()`, we now correctly set the width of the `<textarea>` element. (#3838)
|
||||
|
||||
|
||||
# shiny 1.7.4.1
|
||||
|
||||
## Full changelog
|
||||
|
||||
* Closed #3849: In R-devel, a warning was raised when Shiny was loaded because `as.numeric_version()` was called with a number instead of a string. (#3850)
|
||||
|
||||
|
||||
# shiny 1.7.4
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -11,25 +81,21 @@ shiny 1.7.3.9000
|
||||
|
||||
### New features and improvements
|
||||
|
||||
* `plotOutput()`, `imageOutput()`, and `uiOutput()` gain a `fill` argument. If `TRUE` (the default for `plotOutput()`), the output container is allowed to grow/shrink to fit a fill container (created via `htmltools::bindFillRole()`) with an opinionated height. This means `plotOutput()` will grow/shrink by default [inside of `bslib::card_body_fill()`](https://rstudio.github.io/bslib/articles/cards.html#responsive-sizing), but `imageOutput()` and `uiOutput()` will have to opt-in to similar behavior with `fill = TRUE`. (#3715)
|
||||
|
||||
* Internal: Added clearer and strict TypeScript type definitions (#3644)
|
||||
|
||||
### Bug fixes
|
||||
* `plotOutput()`, `imageOutput()`, and `uiOutput()` gain a `fill` argument. If `TRUE` (the default for `plotOutput()`), the output container is allowed to grow/shrink to fit a fill container (created via `htmltools::bindFillRole()`) with an opinionated height. This means `plotOutput()` will grow/shrink by default [inside of `bslib::card_body_fill()`](https://rstudio.github.io/bslib/articles/cards.html#responsive-sizing), but `imageOutput()` and `uiOutput()` will have to opt-in to similar behavior with `fill = TRUE`. (#3715)
|
||||
|
||||
* Closed #3687: Updated jQuery-UI to v1.13.2. (#3697)
|
||||
|
||||
* Internal: Added clearer and strict TypeScript type definitions (#3644)
|
||||
|
||||
shiny 1.7.3
|
||||
===========
|
||||
|
||||
# shiny 1.7.3
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* Shiny 1.7.0 changed the `icon(lib="fontawesome")` implementation from a bundled copy of fontawesome, to the {fontawesome} package. This led to issue #3688, where icons that were previously working, were now breaking. That's because {fontawesome} 0.3.0 and earlier did not have support for icon names used in Font Awesome 5 and earlier, only the newest icon names used in Font Awesome 6. Now, {fontawesome} 0.4.0 has restored support for those older icon names, and Shiny 1.7.2.1 has updated its {fontawesome} requirement to >=0.4.0.
|
||||
|
||||
|
||||
shiny 1.7.2
|
||||
===========
|
||||
# shiny 1.7.2
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -80,8 +146,7 @@ shiny 1.7.2
|
||||
* HTML dependencies that are sent to dynamic UI now have better type checking, and no longer require a `dep.src.href` field. (#3537)
|
||||
|
||||
|
||||
shiny 1.7.1
|
||||
===========
|
||||
# shiny 1.7.1
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
@@ -90,8 +155,7 @@ shiny 1.7.1
|
||||
* Re-arranged conditions for testthat 1.0.0 compatibility. (#3512)
|
||||
|
||||
|
||||
shiny 1.7.0
|
||||
===========
|
||||
# shiny 1.7.0
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -148,14 +212,13 @@ shiny 1.7.0
|
||||
|
||||
* Updated to jQuery 3.6.0. (#3311)
|
||||
|
||||
shiny 1.6.0
|
||||
===========
|
||||
# shiny 1.6.0
|
||||
|
||||
This release focuses on improvements in three main areas:
|
||||
|
||||
1. Better theming (and Bootstrap 4) support:
|
||||
* The `theme` argument of `fluidPage()`, `navbarPage()`, and `bootstrapPage()` all now understand `bslib::bs_theme()` objects, which can be used to opt-into Bootstrap 4, use any Bootswatch theme, and/or implement custom themes without writing any CSS.
|
||||
* The `session` object now includes `$setCurrentTheme()` and `$getCurrentTheme()` methods to dynamically update (or obtain) the page's `theme` after initial load, which is useful for things such as [adding a dark mode switch to an app](https://rstudio.github.io/bslib/articles/bslib.html#dynamic) or some other "real-time" theming tool like `bslib::bs_themer()`.
|
||||
* The `session` object now includes `$setCurrentTheme()` and `$getCurrentTheme()` methods to dynamically update (or obtain) the page's `theme` after initial load, which is useful for things such as [adding a dark mode switch to an app](https://rstudio.github.io/bslib/articles/theming.html#dynamic) or some other "real-time" theming tool like `bslib::bs_themer()`.
|
||||
* For more details, see [`{bslib}`'s website](https://rstudio.github.io/bslib/)
|
||||
|
||||
2. Caching of `reactive()` and `render*()` (e.g. `renderText()`, `renderTable()`, etc) expressions.
|
||||
@@ -258,8 +321,7 @@ This release focuses on improvements in three main areas:
|
||||
* Removed es5-shim library, which was internally used within `selectInput()` for ECMAScript 5 compatibility. (#2993)
|
||||
|
||||
|
||||
shiny 1.5.0
|
||||
===========
|
||||
# shiny 1.5.0
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -312,20 +374,17 @@ shiny 1.5.0
|
||||
* Updated from Font-Awesome 5.3.1 to 5.13.0, which includes icons related to COVID-19. For upgrade notes, see https://github.com/FortAwesome/Font-Awesome/blob/master/UPGRADING.md. (#2891)
|
||||
|
||||
|
||||
shiny 1.4.0.2
|
||||
===========
|
||||
# shiny 1.4.0.2
|
||||
|
||||
Minor patch release: fixed some timing-dependent tests failed intermittently on CRAN build machines.
|
||||
|
||||
|
||||
shiny 1.4.0.1
|
||||
===========
|
||||
# shiny 1.4.0.1
|
||||
|
||||
Minor patch release to account for changes to the grid package that will be upcoming in the R 4.0 release (#2776).
|
||||
|
||||
|
||||
shiny 1.4.0
|
||||
===========
|
||||
# shiny 1.4.0
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -388,8 +447,7 @@ shiny 1.4.0
|
||||
* Fixed #2329, #1817: These bugs were reported as fixed in Shiny 1.3.0 but were not actually fixed because some JavaScript changes were accidentally not included in the release. The fix resolves issues that occur when `withProgressBar()` or bookmarking are combined with the [networkD3](https://christophergandrud.github.io/networkD3/) package's Sankey plot.
|
||||
|
||||
|
||||
shiny 1.3.2
|
||||
===========
|
||||
# shiny 1.3.2
|
||||
|
||||
### Bug fixes
|
||||
|
||||
@@ -398,8 +456,7 @@ shiny 1.3.2
|
||||
* Fixed #2280: Shiny applications that used a www/index.html file did not serve up the index file. (#2382)
|
||||
|
||||
|
||||
shiny 1.3.1
|
||||
===========
|
||||
# shiny 1.3.1
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -408,8 +465,7 @@ shiny 1.3.1
|
||||
* Fixed a performance issue introduced in v1.3.0 when using large nested lists within Shiny. (#2377)
|
||||
|
||||
|
||||
shiny 1.3.0
|
||||
===========
|
||||
# shiny 1.3.0
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -440,8 +496,7 @@ shiny 1.3.0
|
||||
* Fixed #2247: `renderCachedPlot` now supports using promises for either `expr` or `cacheKeyExpr`. (Shiny v1.2.0 supported async `expr`, but only if `cacheKeyExpr` was async as well; now you can use any combination of sync/async for `expr` and `cacheKeyExpr`.) #2261
|
||||
|
||||
|
||||
shiny 1.2.0
|
||||
===========
|
||||
# shiny 1.2.0
|
||||
|
||||
This release features plot caching, an important new tool for improving performance and scalability. Using `renderCachedPlot` in place of `renderPlot` can greatly improve responsiveness for apps that show the same plot many times (for example, a dashboard or report where all users view the same data). Shiny gives you a fair amount of control in where the cache is stored and how cached plots are invalidated, so be sure to read [this article](https://shiny.rstudio.com/articles/plot-caching.html) to get the most out of this feature.
|
||||
|
||||
@@ -506,8 +561,7 @@ This release features plot caching, an important new tool for improving performa
|
||||
* Addressed #1864 by changing `optgroup` documentation to use `list` instead of `c`. (#2084)
|
||||
|
||||
|
||||
shiny 1.1.0
|
||||
===========
|
||||
# shiny 1.1.0
|
||||
|
||||
This is a significant release for Shiny, with a major new feature that was nearly a year in the making: support for asynchronous operations! Until now, R's single-threaded nature meant that performing long-running calculations or tasks from Shiny would bring your app to a halt for other users of that process. This release of Shiny deeply integrates the [promises](https://rstudio.github.io/promises/) package to allow you to execute some tasks asynchronously, including as part of reactive expressions and outputs. See the [promises](https://rstudio.github.io/promises/) documentation to learn more.
|
||||
|
||||
@@ -557,7 +611,7 @@ This is a significant release for Shiny, with a major new feature that was nearl
|
||||
|
||||
* Fixed #1600: URL-encoded bookmarking did not work with sliders that had dates or date-times. (#1961)
|
||||
|
||||
* Fixed #1962: [File dragging and dropping](https://www.rstudio.com/blog/shiny-1-0-4/) broke in the presence of jQuery version 3.0 as introduced by the [rhandsontable](https://jrowen.github.io/rhandsontable/) [htmlwidget](https://www.htmlwidgets.org/). (#2005)
|
||||
* Fixed #1962: [File dragging and dropping](https://posit.co/blog/shiny-1-0-4/) broke in the presence of jQuery version 3.0 as introduced by the [rhandsontable](https://jrowen.github.io/rhandsontable/) [htmlwidget](https://www.htmlwidgets.org/). (#2005)
|
||||
|
||||
* Improved the error handling inside the `addResourcePath()` function, to give end users more informative error messages when the `directoryPath` argument cannot be normalized. This is especially useful for `runtime: shiny_prerendered` Rmd documents, like `learnr` tutorials. (#1968)
|
||||
|
||||
@@ -580,8 +634,7 @@ This is a significant release for Shiny, with a major new feature that was nearl
|
||||
In some rare cases, interrupting an application (by pressing Ctrl-C or Esc) may result in the message `Error in execCallbacks(timeoutSecs) : c++ exception (unknown reason)`. Although this message sounds alarming, it is harmless, and will go away in a future version of the later package (more information [here](https://github.com/r-lib/later/issues/55)).
|
||||
|
||||
|
||||
shiny 1.0.5
|
||||
===========
|
||||
# shiny 1.0.5
|
||||
|
||||
## Full changelog
|
||||
|
||||
@@ -594,8 +647,7 @@ shiny 1.0.5
|
||||
* Fixed #1824: HTTP HEAD requests on static files caused the application to stop. (#1825)
|
||||
|
||||
|
||||
shiny 1.0.4
|
||||
===========
|
||||
# shiny 1.0.4
|
||||
|
||||
There are three headlining features in this release of Shiny. It is now possible to add and remove tabs from a `tabPanel`; there is a new function, `onStop()`, which registers callbacks that execute when an application exits; and `fileInput`s now can have files dragged and dropped on them. In addition to these features, this release has a number of minor features and bug fixes. See the full changelog below for more details.
|
||||
|
||||
@@ -656,8 +708,7 @@ There are three headlining features in this release of Shiny. It is now possible
|
||||
* Fixed #1474: A `browser()` call in an observer could cause an error in the RStudio IDE on Windows. (#1802)
|
||||
|
||||
|
||||
shiny 1.0.3
|
||||
================
|
||||
# shiny 1.0.3
|
||||
|
||||
This is a hotfix release of Shiny. With previous versions of Shiny, when running an application on the newly-released version of R, 3.4.0, it would print a message: `Warning in body(fun) : argument is not a function`. This has no effect on the application, but because the message could be alarming to users, we are releasing a new version of Shiny that fixes this issue.
|
||||
|
||||
@@ -670,8 +721,7 @@ This is a hotfix release of Shiny. With previous versions of Shiny, when running
|
||||
* Fixed #1676: On R 3.4.0, running a Shiny application gave a warning: `Warning in body(fun) : argument is not a function`. (#1677)
|
||||
|
||||
|
||||
shiny 1.0.2
|
||||
================
|
||||
# shiny 1.0.2
|
||||
|
||||
This is a hotfix release of Shiny. The primary reason for this release is because the web host for MathJax JavaScript library is scheduled to be shut down in the next few weeks. After it is shut down, Shiny applications that use MathJax will no longer be able to load the MathJax library if they are run with Shiny 1.0.1 and below. (If you don't know whether your application uses MathJax, it probably does not.) For more information about why the MathJax CDN is shutting down, see https://www.mathjax.org/cdn-shutting-down/.
|
||||
|
||||
@@ -690,8 +740,7 @@ This is a hotfix release of Shiny. The primary reason for this release is becaus
|
||||
* Fixed #1653: wrong code example in documentation. (#1658)
|
||||
|
||||
|
||||
shiny 1.0.1
|
||||
================
|
||||
# shiny 1.0.1
|
||||
|
||||
This is a maintenance release of Shiny, mostly aimed at fixing bugs and introducing minor features. The most notable additions in this version of Shiny are the introduction of the `reactiveVal()` function (it's like `reactiveValues()`, but it only stores a single value), and that the choices of `radioButtons()` and `checkboxGroupInput()` can now contain HTML content instead of just plain text.
|
||||
|
||||
@@ -761,8 +810,7 @@ in shiny apps. For more info, see the documentation (`?updateQueryString` and `?
|
||||
* Closed #1500: Updated ion.rangeSlider to 2.1.6. (#1540)
|
||||
|
||||
|
||||
shiny 1.0.0
|
||||
===========
|
||||
# shiny 1.0.0
|
||||
|
||||
Shiny has reached a milestone: version 1.0.0! In the last year, we've added two major features that we considered essential for a 1.0.0 release: bookmarking, and support for testing Shiny applications. As usual, this version of Shiny also includes many minor features and bug fixes.
|
||||
|
||||
@@ -827,8 +875,7 @@ Now there's an official way to slow down reactive values and expressions that in
|
||||
* Updated to Font Awesome 4.7.0.
|
||||
|
||||
|
||||
shiny 0.14.2
|
||||
============
|
||||
# shiny 0.14.2
|
||||
|
||||
This is a maintenance release of Shiny, with some bug fixes and minor new features.
|
||||
|
||||
@@ -856,8 +903,7 @@ This is a maintenance release of Shiny, with some bug fixes and minor new featur
|
||||
|
||||
* Fixed a bug where, in versions of R before 3.2, Shiny applications could crash due to a bug in R's implementation of `list2env()`. (#1446)
|
||||
|
||||
shiny 0.14.1
|
||||
============
|
||||
# shiny 0.14.1
|
||||
|
||||
This is a maintenance release of Shiny, with some bug fixes and minor new features.
|
||||
|
||||
@@ -887,8 +933,7 @@ This is a maintenance release of Shiny, with some bug fixes and minor new featur
|
||||
* Updated to jQuery UI 1.12.1. Previously, Shiny included a build of 1.11.4 which was missing the datepicker component due to a conflict with the bootstrap-datepicker used by Shiny's `dateInput()` and `dateRangeInput()`. (#1374)
|
||||
|
||||
|
||||
shiny 0.14
|
||||
==========
|
||||
# shiny 0.14
|
||||
|
||||
A new Shiny release is upon us! There are many new exciting features, bug fixes, and library updates. We'll just highlight the most important changes here, but you can browse through the full changelog below for details. This will likely be the last release before shiny 1.0, so get out your party hats!
|
||||
|
||||
@@ -1087,14 +1132,12 @@ There are many more minor features, small improvements, and bug fixes than we ca
|
||||
* Updated to jQuery 1.12.4.
|
||||
|
||||
|
||||
shiny 0.13.2
|
||||
============
|
||||
# shiny 0.13.2
|
||||
|
||||
* Updated documentation for `htmlTemplate`.
|
||||
|
||||
|
||||
shiny 0.13.1
|
||||
============
|
||||
# shiny 0.13.1
|
||||
|
||||
* `flexCol` did not work on RStudio for Windows or Linux.
|
||||
|
||||
@@ -1103,8 +1146,7 @@ shiny 0.13.1
|
||||
* BREAKING CHANGE: The long-deprecated ability to pass functions (rather than expressions) to reactive() and observe() has finally been removed.
|
||||
|
||||
|
||||
shiny 0.13.0
|
||||
============
|
||||
# shiny 0.13.0
|
||||
|
||||
* Fixed #962: plot interactions did not work with the development version of ggplot2 (after ggplot2 1.0.1).
|
||||
|
||||
@@ -1155,8 +1197,7 @@ shiny 0.13.0
|
||||
* Added support for the new htmltools 0.3 feature `htmlTemplate`. It's now possible to use regular HTML markup to design your UI, but still use R expressions to define inputs, outputs, and HTML widgets.
|
||||
|
||||
|
||||
shiny 0.12.2
|
||||
============
|
||||
# shiny 0.12.2
|
||||
|
||||
* GitHub changed URLs for gists from .tar.gz to .zip, so `runGist` was updated to work with the new URLs.
|
||||
|
||||
@@ -1179,16 +1220,14 @@ shiny 0.12.2
|
||||
* Shiny now correctly handles HTTP HEAD requests. (#876)
|
||||
|
||||
|
||||
shiny 0.12.1
|
||||
============
|
||||
# shiny 0.12.1
|
||||
|
||||
* Fixed an issue where unbindAll() causes subsequent bindAll() to be ignored for previously bound outputs. (#856)
|
||||
|
||||
* Undeprecate `dataTableOutput` and `renderDataTable`, which had been deprecated in favor of the new DT package. The DT package is a bit too new and has a slightly different API, we were too hasty in deprecating the existing Shiny functions.
|
||||
|
||||
|
||||
shiny 0.12.0
|
||||
============
|
||||
# shiny 0.12.0
|
||||
|
||||
In addition to the changes listed below (in the *Full Changelog* section), there is an infrastructure change that could affect existing Shiny apps.
|
||||
|
||||
@@ -1244,8 +1283,7 @@ Shiny 0.12.0 deprecated Shiny's dataTableOutput and renderDataTable functions an
|
||||
* renderDataTable() and dataTableOutput() have been deprecated in shiny and will be removed in future versions of shiny. Please use the DT package instead: http://rstudio.github.io/DT/ (#807)
|
||||
|
||||
|
||||
shiny 0.11.1
|
||||
============
|
||||
# shiny 0.11.1
|
||||
|
||||
* Major client-side performance improvements for pages that have many conditionalPanels, tabPanels, and plotOutputs. (#693, #717, #723)
|
||||
|
||||
@@ -1272,8 +1310,7 @@ shiny 0.11.1
|
||||
* downloadHandler content callback functions are now invoked with a temp file name that has the same extension as the final filename that will be used by the download. This is to deal with the fact that some file writing functions in R will auto-append the extension for their file type (pdf, zip).
|
||||
|
||||
|
||||
shiny 0.11
|
||||
==========
|
||||
# shiny 0.11
|
||||
|
||||
Shiny 0.11 switches away from the Bootstrap 2 web framework to the next version, Bootstrap 3. This is in part because Bootstrap 2 is no longer being developed, and in part because it allows us to tap into the ecosystem of Bootstrap 3 themes.
|
||||
|
||||
@@ -1351,20 +1388,17 @@ Along with the release of Shiny 0.11, we've packaged up some Bootstrap 3 themes
|
||||
* Password input fields can now be used, with `passwordInput()`. (#672)
|
||||
|
||||
|
||||
shiny 0.10.2.2
|
||||
==============
|
||||
# shiny 0.10.2.2
|
||||
|
||||
* Remove use of `rstudio::viewer` in a code example, for R CMD check.
|
||||
|
||||
|
||||
shiny 0.10.2.1
|
||||
==============
|
||||
# shiny 0.10.2.1
|
||||
|
||||
* Changed some examples to use \donttest instead of \dontrun.
|
||||
|
||||
|
||||
shiny 0.10.2
|
||||
============
|
||||
# shiny 0.10.2
|
||||
|
||||
* The minimal version of R required for the shiny package is 3.0.0 now.
|
||||
|
||||
@@ -1397,8 +1431,7 @@ shiny 0.10.2
|
||||
* Added `position` parameter to `navbarPage`.
|
||||
|
||||
|
||||
shiny 0.10.1
|
||||
============
|
||||
# shiny 0.10.1
|
||||
|
||||
* Added Unicode support for Windows. Shiny apps running on Windows must use the UTF-8 encoding for ui.R and server.R (also the optional global.R) if they contain non-ASCII characters. See this article for details and examples: http://shiny.rstudio.com/gallery/unicode-characters.html (#516)
|
||||
|
||||
@@ -1411,8 +1444,7 @@ shiny 0.10.1
|
||||
* Added support for option groups in the select/selectize inputs. When the `choices` argument for `selectInput()`/`selectizeInput()` is a list of sub-lists and any sub-list is of length greater than 1, the HTML tag `<optgroup>` will be used. See an example at http://shiny.rstudio.com/gallery/option-groups-for-selectize-input.html (#542)
|
||||
|
||||
|
||||
shiny 0.10.0
|
||||
============
|
||||
# shiny 0.10.0
|
||||
|
||||
* BREAKING CHANGE: By default, observers now terminate themselves if they were created during a session and that session ends. See ?domains for more details.
|
||||
|
||||
@@ -1449,14 +1481,12 @@ shiny 0.10.0
|
||||
* `runGitHub()` can also take a value of the form "username/repo" in its first argument, e.g. both runGitHub("shiny_example", "rstudio") and runGitHub("rstudio/shiny_example") are valid ways to run the GitHub repo.
|
||||
|
||||
|
||||
shiny 0.9.1
|
||||
===========
|
||||
# shiny 0.9.1
|
||||
|
||||
* Fixed warning 'Error in Context$new : could not find function "loadMethod"' that was happening to dependent packages on "R CMD check".
|
||||
|
||||
|
||||
shiny 0.9.0
|
||||
===========
|
||||
# shiny 0.9.0
|
||||
|
||||
* BREAKING CHANGE: Added a `host` parameter to runApp() and runExample(), which defaults to the shiny.host option if it is non-NULL, or "127.0.0.1" otherwise. This means that by default, Shiny applications can only be accessed on the same machine from which they are served. To allow other clients to connect, as in previous versions of Shiny, use "0.0.0.0" (or the IP address of one of your network interfaces, if you care to be explicit about it).
|
||||
|
||||
@@ -1529,8 +1559,7 @@ shiny 0.9.0
|
||||
* Dots are now legal characters for inputId/outputId. (Thanks, Kevin Lindquist. #358)
|
||||
|
||||
|
||||
shiny 0.8.0
|
||||
===========
|
||||
# shiny 0.8.0
|
||||
|
||||
* Debug hooks are registered on all user-provided functions and (reactive) expressions (e.g., in renderPlot()), which makes it possible to set breakpoints in these functions using the latest version of the RStudio IDE, and the RStudio visual debugging tools can be used to debug Shiny apps. Internally, the registration is done via installExprFunction(), which is a new function introduced in this version to replace exprToFunction() so that the registration can be automatically done.
|
||||
|
||||
@@ -1549,8 +1578,7 @@ shiny 0.8.0
|
||||
* The minimal required version for the httpuv package was increased to 1.2 (on CRAN now).
|
||||
|
||||
|
||||
shiny 0.7.0
|
||||
===========
|
||||
# shiny 0.7.0
|
||||
|
||||
* Stopped sending websocket subprotocol. This fixes a compatibility issue with Google Chrome 30.
|
||||
|
||||
@@ -1579,8 +1607,7 @@ shiny 0.7.0
|
||||
* Add shiny.sharedSecret option, to require the HTTP header Shiny-Shared-Secret to be set to the given value.
|
||||
|
||||
|
||||
shiny 0.6.0
|
||||
===========
|
||||
# shiny 0.6.0
|
||||
|
||||
* `tabsetPanel()` can be directed to start with a specific tab selected.
|
||||
|
||||
@@ -1611,8 +1638,7 @@ shiny 0.6.0
|
||||
* Shiny apps can be run without a server.r and ui.r file.
|
||||
|
||||
|
||||
shiny 0.5.0
|
||||
===========
|
||||
# shiny 0.5.0
|
||||
|
||||
* Switch from websockets package for handling websocket connections to httpuv.
|
||||
|
||||
@@ -1629,16 +1655,14 @@ shiny 0.5.0
|
||||
* Fix bug #55, where `renderTable()` would throw error with an empty data frame.
|
||||
|
||||
|
||||
shiny 0.4.1
|
||||
===========
|
||||
# shiny 0.4.1
|
||||
|
||||
* Fix bug where width and height weren't passed along properly from `reactivePlot` to `renderPlot`.
|
||||
|
||||
* Fix bug where infinite recursion would happen when `reactivePlot` was passed a function for width or height.
|
||||
|
||||
|
||||
shiny 0.4.0
|
||||
===========
|
||||
# shiny 0.4.0
|
||||
|
||||
* Added suspend/resume capability to observers.
|
||||
|
||||
@@ -1653,8 +1677,7 @@ shiny 0.4.0
|
||||
* Fixed a bug where empty values in a numericInput were sent to the R process as 0. They are now sent as NA.
|
||||
|
||||
|
||||
shiny 0.3.1
|
||||
===========
|
||||
# shiny 0.3.1
|
||||
|
||||
* Fix issue #91: bug where downloading files did not work.
|
||||
|
||||
@@ -1663,8 +1686,7 @@ shiny 0.3.1
|
||||
* Reactive functions now preserve the visible/invisible state of their returned values.
|
||||
|
||||
|
||||
shiny 0.3.0
|
||||
===========
|
||||
# shiny 0.3.0
|
||||
|
||||
* Reactive functions are now evaluated lazily.
|
||||
|
||||
@@ -1689,52 +1711,44 @@ shiny 0.3.0
|
||||
* Fix issue #64, where pressing Enter in a textbox would cause a form to submit.
|
||||
|
||||
|
||||
shiny 0.2.4
|
||||
===========
|
||||
# shiny 0.2.4
|
||||
|
||||
* `runGist` has been updated to use the new download URLs from https://gist.github.com.
|
||||
|
||||
* Shiny now uses `CairoPNG()` for output, when the Cairo package is available. This provides better-looking output on Linux and Windows.
|
||||
|
||||
|
||||
shiny 0.2.3
|
||||
===========
|
||||
# shiny 0.2.3
|
||||
|
||||
* Ignore request variables for routing purposes
|
||||
|
||||
|
||||
shiny 0.2.2
|
||||
===========
|
||||
# shiny 0.2.2
|
||||
|
||||
* Fix CRAN warning (assigning to global environment)
|
||||
|
||||
|
||||
shiny 0.2.1
|
||||
===========
|
||||
# shiny 0.2.1
|
||||
|
||||
* [BREAKING] Modify API of `downloadHandler`: The `content` function now takes a file path, not writable connection, as an argument. This makes it much easier to work with APIs that only write to file paths, not connections.
|
||||
|
||||
|
||||
shiny 0.2.0
|
||||
===========
|
||||
# shiny 0.2.0
|
||||
|
||||
* Fix subtle name resolution bug--the usual symptom being S4 methods not being invoked correctly when called from inside of ui.R or server.R
|
||||
|
||||
|
||||
shiny 0.1.14
|
||||
===========
|
||||
# shiny 0.1.14
|
||||
|
||||
* Fix slider animator, which broke in 0.1.10
|
||||
|
||||
|
||||
shiny 0.1.13
|
||||
===========
|
||||
# shiny 0.1.13
|
||||
|
||||
* Fix temp file leak in reactivePlot
|
||||
|
||||
|
||||
shiny 0.1.12
|
||||
===========
|
||||
# shiny 0.1.12
|
||||
|
||||
* Fix problems with runGist on Windows
|
||||
|
||||
@@ -1743,8 +1757,7 @@ shiny 0.1.12
|
||||
* Add CSS hooks for app-wide busy indicators
|
||||
|
||||
|
||||
shiny 0.1.11
|
||||
===========
|
||||
# shiny 0.1.11
|
||||
|
||||
* Fix input binding with IE8 on Shiny Server
|
||||
|
||||
@@ -1753,8 +1766,7 @@ shiny 0.1.11
|
||||
* Allow dynamic sizing of reactivePlot (i.e. using a function instead of a fixed value)
|
||||
|
||||
|
||||
shiny 0.1.10
|
||||
===========
|
||||
# shiny 0.1.10
|
||||
|
||||
* Support more MIME types when serving out of www
|
||||
|
||||
@@ -1767,8 +1779,7 @@ shiny 0.1.10
|
||||
* Fix plot rendering with IE8 on Shiny Server
|
||||
|
||||
|
||||
shiny 0.1.9
|
||||
===========
|
||||
# shiny 0.1.9
|
||||
|
||||
* Much less flicker when updating plots
|
||||
|
||||
@@ -1777,8 +1788,7 @@ shiny 0.1.9
|
||||
* Add `includeText`, `includeHTML`, and `includeMarkdown` functions for putting text, HTML, and Markdown content from external files in the application's UI.
|
||||
|
||||
|
||||
shiny 0.1.8
|
||||
===========
|
||||
# shiny 0.1.8
|
||||
|
||||
* Add `runGist` function for conveniently running a Shiny app that is published on gist.github.com.
|
||||
|
||||
@@ -1791,8 +1801,7 @@ shiny 0.1.8
|
||||
* Add `bootstrapPage` function for creating new Bootstrap based layouts from scratch.
|
||||
|
||||
|
||||
shiny 0.1.7
|
||||
===========
|
||||
# shiny 0.1.7
|
||||
|
||||
* Fix issue #26: Shiny.OutputBindings not correctly exported.
|
||||
|
||||
@@ -1801,8 +1810,7 @@ shiny 0.1.7
|
||||
* Transcode JSON into UTF-8 (prevents non-ASCII reactivePrint values from causing errors on Windows).
|
||||
|
||||
|
||||
shiny 0.1.6
|
||||
===========
|
||||
# shiny 0.1.6
|
||||
|
||||
* Import package dependencies, instead of attaching them (with the exception of websockets, which doesn't currently work unless attached).
|
||||
|
||||
@@ -1811,8 +1819,7 @@ shiny 0.1.6
|
||||
* bindAll was not correctly sending initial values to the server; fixed.
|
||||
|
||||
|
||||
shiny 0.1.5
|
||||
===========
|
||||
# shiny 0.1.5
|
||||
|
||||
* BREAKING CHANGE: JS APIs Shiny.bindInput and Shiny.bindOutput removed and replaced with Shiny.bindAll; Shiny.unbindInput and Shiny.unbindOutput removed and replaced with Shiny.unbindAll.
|
||||
|
||||
@@ -1827,8 +1834,7 @@ shiny 0.1.5
|
||||
* htmlOutput (CSS class `shiny-html-output`) can contain inputs and outputs.
|
||||
|
||||
|
||||
shiny 0.1.4
|
||||
===========
|
||||
# shiny 0.1.4
|
||||
|
||||
* Allow Bootstrap tabsets to act as reactive inputs; their value indicates which tab is active
|
||||
|
||||
@@ -1841,8 +1847,7 @@ shiny 0.1.4
|
||||
* Add Shiny.bindInputs(scope), .unbindInputs(scope), .bindOutputs(scope), and .unbindOutputs(scope) JS API calls to allow dynamic binding/unbinding of HTML elements
|
||||
|
||||
|
||||
shiny 0.1.3
|
||||
===========
|
||||
# shiny 0.1.3
|
||||
|
||||
* Introduce Shiny.inputBindings.register JS API and InputBinding class, for creating custom input controls
|
||||
|
||||
@@ -1855,7 +1860,6 @@ shiny 0.1.3
|
||||
* Fix issue #10: Plots in tabsets not rendered
|
||||
|
||||
|
||||
shiny 0.1.2
|
||||
===========
|
||||
# shiny 0.1.2
|
||||
|
||||
* Initial private beta release!
|
||||
|
||||
@@ -159,8 +159,8 @@ utils::globalVariables(".GenericCallEnv", add = TRUE)
|
||||
#' ```
|
||||
#'
|
||||
#' To use different settings for a session-scoped cache, you can set
|
||||
#' `self$cache` at the top of your server function. By default, it will create
|
||||
#' a 200 MB memory cache for each session, but you can replace it with
|
||||
#' `session$cache` at the top of your server function. By default, it will
|
||||
#' create a 200 MB memory cache for each session, but you can replace it with
|
||||
#' something different. To use the session-scoped cache, you must also call
|
||||
#' `bindCache()` with `cache="session"`. This will create a 100 MB cache for
|
||||
#' the session:
|
||||
|
||||
@@ -452,8 +452,10 @@ RestoreInputSet <- R6Class("RestoreInputSet",
|
||||
)
|
||||
)
|
||||
|
||||
# This is a fastmap::faststack(); value is assigned in .onLoad().
|
||||
restoreCtxStack <- NULL
|
||||
on_load({
|
||||
restoreCtxStack <- fastmap::faststack()
|
||||
})
|
||||
|
||||
withRestoreContext <- function(ctx, expr) {
|
||||
restoreCtxStack$push(ctx)
|
||||
|
||||
@@ -374,8 +374,7 @@ collapseSizes <- function(padding) {
|
||||
#' @param inverse `TRUE` to use a dark background and light text for the
|
||||
#' navigation bar
|
||||
#' @param collapsible `TRUE` to automatically collapse the navigation
|
||||
#' elements into a menu when the width of the browser is less than 940 pixels
|
||||
#' (useful for viewing on smaller touchscreen device)
|
||||
#' elements into an expandable menu on mobile devices or narrow window widths.
|
||||
#' @param fluid `TRUE` to use a fluid layout. `FALSE` to use a fixed
|
||||
#' layout.
|
||||
#' @param windowTitle the browser window title (as a character string). The
|
||||
@@ -1200,19 +1199,25 @@ uiOutput <- htmlOutput
|
||||
#' @examples
|
||||
#' \dontrun{
|
||||
#' ui <- fluidPage(
|
||||
#' p("Choose a dataset to download."),
|
||||
#' selectInput("dataset", "Dataset", choices = c("mtcars", "airquality")),
|
||||
#' downloadButton("downloadData", "Download")
|
||||
#' )
|
||||
#'
|
||||
#' server <- function(input, output) {
|
||||
#' # Our dataset
|
||||
#' data <- mtcars
|
||||
#' # The requested dataset
|
||||
#' data <- reactive({
|
||||
#' get(input$dataset)
|
||||
#' })
|
||||
#'
|
||||
#' output$downloadData <- downloadHandler(
|
||||
#' filename = function() {
|
||||
#' paste("data-", Sys.Date(), ".csv", sep="")
|
||||
#' # Use the selected dataset as the suggested file name
|
||||
#' paste0(input$dataset, ".csv")
|
||||
#' },
|
||||
#' content = function(file) {
|
||||
#' write.csv(data, file)
|
||||
#' # Write the dataset to the `file` that will be downloaded
|
||||
#' write.csv(data(), file)
|
||||
#' }
|
||||
#' )
|
||||
#' }
|
||||
|
||||
39
R/devmode.R
39
R/devmode.R
@@ -190,8 +190,10 @@ devmode_inform <- function(
|
||||
|
||||
|
||||
|
||||
#' @include map.R
|
||||
registered_devmode_options <- Map$new()
|
||||
registered_devmode_options <- NULL
|
||||
on_load({
|
||||
registered_devmode_options <- Map$new()
|
||||
})
|
||||
|
||||
#' @describeIn devmode Registers a Shiny Developer Mode option with an updated
|
||||
#' value and Developer message. This registration method allows package
|
||||
@@ -340,21 +342,22 @@ get_devmode_option <- function(
|
||||
}
|
||||
|
||||
|
||||
on_load({
|
||||
register_devmode_option(
|
||||
"shiny.autoreload",
|
||||
"Turning on shiny autoreload. To disable, call `options(shiny.autoreload = FALSE)`",
|
||||
TRUE
|
||||
)
|
||||
|
||||
register_devmode_option(
|
||||
"shiny.autoreload",
|
||||
"Turning on shiny autoreload. To disable, call `options(shiny.autoreload = FALSE)`",
|
||||
TRUE
|
||||
)
|
||||
register_devmode_option(
|
||||
"shiny.minified",
|
||||
"Using full shiny javascript file. To use the minified version, call `options(shiny.minified = TRUE)`",
|
||||
FALSE
|
||||
)
|
||||
|
||||
register_devmode_option(
|
||||
"shiny.minified",
|
||||
"Using full shiny javascript file. To use the minified version, call `options(shiny.minified = TRUE)`",
|
||||
FALSE
|
||||
)
|
||||
|
||||
register_devmode_option(
|
||||
"shiny.fullstacktrace",
|
||||
"Turning on full stack trace. To disable, call `options(shiny.fullstacktrace = FALSE)`",
|
||||
TRUE
|
||||
)
|
||||
register_devmode_option(
|
||||
"shiny.fullstacktrace",
|
||||
"Turning on full stack trace. To disable, call `options(shiny.fullstacktrace = FALSE)`",
|
||||
TRUE
|
||||
)
|
||||
})
|
||||
|
||||
20
R/globals.R
20
R/globals.R
@@ -7,19 +7,21 @@
|
||||
# the private seed during load.
|
||||
withPrivateSeed(set.seed(NULL))
|
||||
|
||||
# Create this at the top level, but since the object is from a different
|
||||
# package, we don't want to bake it into the built binary package.
|
||||
restoreCtxStack <<- fastmap::faststack()
|
||||
for (expr in on_load_exprs) {
|
||||
eval(expr, envir = environment(.onLoad))
|
||||
}
|
||||
|
||||
# Make sure these methods are available to knitr if shiny is loaded but not
|
||||
# attached.
|
||||
s3_register("knitr::knit_print", "reactive")
|
||||
s3_register("knitr::knit_print", "shiny.appobj")
|
||||
s3_register("knitr::knit_print", "shiny.render.function")
|
||||
|
||||
# Shiny 1.4.0 bumps jQuery 1.x to 3.x, which caused a problem
|
||||
# with static-rendering of htmlwidgets, and htmlwidgets 1.5
|
||||
# includes a fix for this problem
|
||||
# https://github.com/rstudio/shiny/issues/2630
|
||||
register_upgrade_message("htmlwidgets", 1.5)
|
||||
}
|
||||
|
||||
|
||||
on_load_exprs <- list()
|
||||
# Register an expression to be evaluated when the package is loaded (in the
|
||||
# .onLoad function).
|
||||
on_load <- function(expr) {
|
||||
on_load_exprs[[length(on_load_exprs) + 1]] <<- substitute(expr)
|
||||
}
|
||||
|
||||
@@ -559,4 +559,6 @@ MessageLogger = R6Class(
|
||||
)
|
||||
)
|
||||
|
||||
rLog <- RLog$new("shiny.reactlog", "shiny.reactlog.console")
|
||||
on_load({
|
||||
rLog <- RLog$new("shiny.reactlog", "shiny.reactlog.console")
|
||||
})
|
||||
|
||||
@@ -182,8 +182,8 @@ brushedPoints <- function(df, brush, xvar = NULL, yvar = NULL,
|
||||
# $ xmax : num 3.78
|
||||
# $ ymin : num 17.1
|
||||
# $ ymax : num 20.4
|
||||
# $ panelvar1: int 6
|
||||
# $ panelvar2: int 0
|
||||
# $ panelvar1: chr "6"
|
||||
# $ panelvar2: chr "0
|
||||
# $ coords_css:List of 4
|
||||
# ..$ xmin: int 260
|
||||
# ..$ xmax: int 298
|
||||
@@ -367,8 +367,8 @@ nearPoints <- function(df, coordinfo, xvar = NULL, yvar = NULL,
|
||||
# $ img_css_ratio:List of 2
|
||||
# ..$ x: num 1.25
|
||||
# ..$ y: num 1.25
|
||||
# $ panelvar1 : int 6
|
||||
# $ panelvar2 : int 0
|
||||
# $ panelvar1 : chr "6"
|
||||
# $ panelvar2 : chr "0"
|
||||
# $ mapping :List of 4
|
||||
# ..$ x : chr "wt"
|
||||
# ..$ y : chr "mpg"
|
||||
|
||||
@@ -31,7 +31,7 @@ checkboxInput <- function(inputId, label, value = FALSE, width = NULL) {
|
||||
|
||||
value <- restoreInput(id = inputId, default = value)
|
||||
|
||||
inputTag <- tags$input(id = inputId, type="checkbox")
|
||||
inputTag <- tags$input(id = inputId, type="checkbox", class = "shiny-input-checkbox")
|
||||
if (!is.null(value) && value)
|
||||
inputTag$attribs$checked <- "checked"
|
||||
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
#'
|
||||
#' Create a file upload control that can be used to upload one or more files.
|
||||
#'
|
||||
#' Whenever a file upload completes, the corresponding input variable is set
|
||||
#' to a dataframe. See the `Server value` section.
|
||||
#' Whenever a file upload completes, the corresponding input variable is set to
|
||||
#' a dataframe. See the `Server value` section.
|
||||
#'
|
||||
#' Each time files are uploaded, they are written to a new random subdirectory
|
||||
#' inside of R's process-level temporary directory. The Shiny user session keeps
|
||||
#' track of all uploads in the session, and when the session ends, Shiny deletes
|
||||
#' all of the subdirectories where files where uploaded to.
|
||||
#'
|
||||
#' @family input elements
|
||||
#'
|
||||
@@ -11,21 +16,21 @@
|
||||
#' @param multiple Whether the user should be allowed to select and upload
|
||||
#' multiple files at once. **Does not work on older browsers, including
|
||||
#' Internet Explorer 9 and earlier.**
|
||||
#' @param accept A character vector of "unique file type specifiers" which
|
||||
#' gives the browser a hint as to the type of file the server expects.
|
||||
#' Many browsers use this prevent the user from selecting an invalid file.
|
||||
#' @param accept A character vector of "unique file type specifiers" which gives
|
||||
#' the browser a hint as to the type of file the server expects. Many browsers
|
||||
#' use this prevent the user from selecting an invalid file.
|
||||
#'
|
||||
#' A unique file type specifier can be:
|
||||
#' * A case insensitive extension like `.csv` or `.rds`.
|
||||
#' * A valid MIME type, like `text/plain` or `application/pdf`
|
||||
#' * One of `audio/*`, `video/*`, or `image/*` meaning any audio, video,
|
||||
#' or image type, respectively.
|
||||
#' or image type, respectively.
|
||||
#' @param buttonLabel The label used on the button. Can be text or an HTML tag
|
||||
#' object.
|
||||
#' @param placeholder The text to show before a file has been uploaded.
|
||||
#' @param capture What source to use for capturing image, audio or video data.
|
||||
#' This attribute facilitates user access to a device's media capture
|
||||
#' mechanism, such as a camera, or microphone, from within a file upload
|
||||
#' This attribute facilitates user access to a device's media capture
|
||||
#' mechanism, such as a camera, or microphone, from within a file upload
|
||||
#' control.
|
||||
#'
|
||||
#' A value of `user` indicates that the user-facing camera and/or microphone
|
||||
@@ -67,7 +72,9 @@
|
||||
#' }
|
||||
#'
|
||||
#' @section Server value:
|
||||
#' A `data.frame` that contains one row for each selected file, and following columns:
|
||||
#'
|
||||
#' A `data.frame` that contains one row for each selected file, and following
|
||||
#' columns:
|
||||
#' \describe{
|
||||
#' \item{`name`}{The filename provided by the web browser. This is
|
||||
#' **not** the path to read to get at the actual data that was uploaded
|
||||
@@ -101,6 +108,7 @@ fileInput <- function(inputId, label, multiple = FALSE, accept = NULL,
|
||||
|
||||
inputTag <- tags$input(
|
||||
id = inputId,
|
||||
class = "shiny-input-file",
|
||||
name = inputId,
|
||||
type = "file",
|
||||
# Don't use "display: none;" style, which causes keyboard accessibility issue; instead use the following workaround: https://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/
|
||||
|
||||
@@ -35,7 +35,7 @@ numericInput <- function(inputId, label, value, min = NA, max = NA, step = NA,
|
||||
value <- restoreInput(id = inputId, default = value)
|
||||
|
||||
# build input tag
|
||||
inputTag <- tags$input(id = inputId, type = "number", class="form-control",
|
||||
inputTag <- tags$input(id = inputId, type = "number", class="shiny-input-number form-control",
|
||||
value = formatNoSci(value))
|
||||
if (!is.na(min))
|
||||
inputTag$attribs$min = min
|
||||
|
||||
@@ -35,7 +35,7 @@ passwordInput <- function(inputId, label, value = "", width = NULL,
|
||||
div(class = "form-group shiny-input-container",
|
||||
style = css(width = validateCssUnit(width)),
|
||||
shinyInputLabel(inputId, label),
|
||||
tags$input(id = inputId, type="password", class="form-control", value=value,
|
||||
tags$input(id = inputId, type="password", class="shiny-input-password form-control", value=value,
|
||||
placeholder = placeholder)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#' from a list of values.
|
||||
#'
|
||||
#' By default, `selectInput()` and `selectizeInput()` use the JavaScript library
|
||||
#' \pkg{selectize.js} (<https://github.com/selectize/selectize.js>) instead of
|
||||
#' \pkg{selectize.js} (<https://selectize.dev/>) instead of
|
||||
#' the basic select input element. To use the standard HTML select input
|
||||
#' element, use `selectInput()` with `selectize=FALSE`.
|
||||
#'
|
||||
@@ -106,6 +106,7 @@ selectInput <- function(inputId, label, choices, selected = NULL,
|
||||
# create select tag and add options
|
||||
selectTag <- tags$select(
|
||||
id = inputId,
|
||||
class = "shiny-input-select",
|
||||
class = if (!selectize) "form-control",
|
||||
size = size,
|
||||
selectOptions(choices, selected, inputId, selectize)
|
||||
@@ -172,7 +173,7 @@ needOptgroup <- function(choices) {
|
||||
|
||||
#' @rdname selectInput
|
||||
#' @param ... Arguments passed to `selectInput()`.
|
||||
#' @param options A list of options. See the documentation of \pkg{selectize.js}
|
||||
#' @param options A list of options. See the documentation of \pkg{selectize.js}(<https://selectize.dev/docs/usage>)
|
||||
#' for possible options (character option values inside [base::I()] will
|
||||
#' be treated as literal JavaScript code; see [renderDataTable()]
|
||||
#' for details).
|
||||
@@ -252,9 +253,8 @@ selectizeDependencyFunc <- function(theme) {
|
||||
# name, the JS/CSS would be loaded/included twice, which leads to
|
||||
# strange issues, especially since we now include a 3rd party
|
||||
# accessibility plugin https://github.com/rstudio/shiny/pull/3153
|
||||
script <- file.path(
|
||||
selectizeDir, c("js/selectize.min.js", "accessibility/js/selectize-plugin-a11y.min.js")
|
||||
)
|
||||
script <- file.path(selectizeDir, selectizeScripts())
|
||||
|
||||
bslib::bs_dependency(
|
||||
input = sass::sass_file(stylesheet),
|
||||
theme = theme,
|
||||
@@ -272,10 +272,18 @@ selectizeStaticDependency <- function(version) {
|
||||
src = "www/shared/selectize",
|
||||
package = "shiny",
|
||||
stylesheet = "css/selectize.bootstrap3.css",
|
||||
script = c(
|
||||
"js/selectize.min.js",
|
||||
"accessibility/js/selectize-plugin-a11y.min.js"
|
||||
)
|
||||
script = selectizeScripts()
|
||||
)
|
||||
}
|
||||
|
||||
selectizeScripts <- function() {
|
||||
isMinified <- isTRUE(get_devmode_option("shiny.minified", TRUE))
|
||||
paste0(
|
||||
c(
|
||||
"js/selectize",
|
||||
"accessibility/js/selectize-plugin-a11y"
|
||||
),
|
||||
if (isMinified) ".min.js" else ".js"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -287,7 +295,7 @@ selectizeStaticDependency <- function(version) {
|
||||
#'
|
||||
#' By default, `varSelectInput()` and `selectizeInput()` use the
|
||||
#' JavaScript library \pkg{selectize.js}
|
||||
#' (<https://github.com/selectize/selectize.js>) to instead of the basic
|
||||
#' (<https://selectize.dev/>) to instead of the basic
|
||||
#' select input element. To use the standard HTML select input element, use
|
||||
#' `selectInput()` with `selectize=FALSE`.
|
||||
#'
|
||||
@@ -383,7 +391,7 @@ varSelectInput <- function(
|
||||
|
||||
#' @rdname varSelectInput
|
||||
#' @param ... Arguments passed to `varSelectInput()`.
|
||||
#' @param options A list of options. See the documentation of \pkg{selectize.js}
|
||||
#' @param options A list of options. See the documentation of \pkg{selectize.js}(<https://selectize.dev/docs/usage>)
|
||||
#' for possible options (character option values inside [base::I()] will
|
||||
#' be treated as literal JavaScript code; see [renderDataTable()]
|
||||
#' for details).
|
||||
|
||||
@@ -42,7 +42,7 @@ textInput <- function(inputId, label, value = "", width = NULL,
|
||||
div(class = "form-group shiny-input-container",
|
||||
style = css(width = validateCssUnit(width)),
|
||||
shinyInputLabel(inputId, label),
|
||||
tags$input(id = inputId, type="text", class="form-control", value=value,
|
||||
tags$input(id = inputId, type="text", class="shiny-input-text form-control", value=value,
|
||||
placeholder = placeholder)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ textAreaInput <- function(inputId, label, value = "", width = NULL, height = NUL
|
||||
|
||||
style <- css(
|
||||
# The width is specified on the parent div.
|
||||
width = if (!is.null(width)) "width: 100%;",
|
||||
width = if (!is.null(width)) "100%",
|
||||
height = validateCssUnit(height),
|
||||
resize = resize
|
||||
)
|
||||
@@ -62,7 +62,7 @@ textAreaInput <- function(inputId, label, value = "", width = NULL, height = NUL
|
||||
style = if (!is.null(width)) paste0("width: ", validateCssUnit(width), ";"),
|
||||
tags$textarea(
|
||||
id = inputId,
|
||||
class = "form-control",
|
||||
class = "shiny-input-textarea form-control",
|
||||
placeholder = placeholder,
|
||||
style = style,
|
||||
rows = rows,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#' Insert and remove UI objects
|
||||
#'
|
||||
#' These functions allow you to dynamically add and remove arbirary UI
|
||||
#' These functions allow you to dynamically add and remove arbitrary UI
|
||||
#' into your app, whenever you want, as many times as you want.
|
||||
#' Unlike [renderUI()], the UI generated with `insertUI()` is persistent:
|
||||
#' once it's created, it stays there until removed by `removeUI()`. Each
|
||||
@@ -11,7 +11,7 @@
|
||||
#' function.
|
||||
#'
|
||||
#' It's particularly useful to pair `removeUI` with `insertUI()`, but there is
|
||||
#' no restriction on what you can use on. Any element that can be selected
|
||||
#' no restriction on what you can use it on. Any element that can be selected
|
||||
#' through a jQuery selector can be removed through this function.
|
||||
#'
|
||||
#' @param selector A string that is accepted by jQuery's selector
|
||||
|
||||
20
R/jqueryui.R
20
R/jqueryui.R
@@ -76,16 +76,20 @@ absolutePanel <- function(...,
|
||||
|
||||
style <- paste(paste(names(cssProps), cssProps, sep = ':', collapse = ';'), ';', sep='')
|
||||
divTag <- tags$div(style=style, ...)
|
||||
if (isTRUE(draggable)) {
|
||||
divTag <- tagAppendAttributes(divTag, class='draggable')
|
||||
return(tagList(
|
||||
divTag,
|
||||
jqueryuiDependency(),
|
||||
tags$script('$(".draggable").draggable();')
|
||||
))
|
||||
} else {
|
||||
|
||||
if (identical(draggable, FALSE)) {
|
||||
return(divTag)
|
||||
}
|
||||
|
||||
# Add Shiny inputs and htmlwidgets to 'non-draggable' elements
|
||||
# Cf. https://api.jqueryui.com/draggable/#option-cancel
|
||||
dragOpts <- '{cancel: ".shiny-input-container,.html-widget,input,textarea,button,select,option"}'
|
||||
dragJS <- sprintf('$(".draggable").draggable(%s);', dragOpts)
|
||||
tagList(
|
||||
tagAppendAttributes(divTag, class='draggable'),
|
||||
jqueryuiDependency(),
|
||||
tags$script(HTML(dragJS))
|
||||
)
|
||||
}
|
||||
|
||||
#' @rdname absolutePanel
|
||||
|
||||
8
R/map.R
8
R/map.R
@@ -48,9 +48,9 @@ Map <- R6Class(
|
||||
)
|
||||
)
|
||||
|
||||
as.list.Map <- function(map) {
|
||||
map$values()
|
||||
as.list.Map <- function(x, ...) {
|
||||
x$values()
|
||||
}
|
||||
length.Map <- function(map) {
|
||||
map$size()
|
||||
length.Map <- function(x) {
|
||||
x$size()
|
||||
}
|
||||
|
||||
@@ -43,7 +43,10 @@ removeModal <- function(session = getDefaultReactiveDomain()) {
|
||||
#' @param title An optional title for the dialog.
|
||||
#' @param footer UI for footer. Use `NULL` for no footer.
|
||||
#' @param size One of `"s"` for small, `"m"` (the default) for medium,
|
||||
#' or `"l"` for large.
|
||||
#' `"l"` for large, or `"xl"` for extra large. Note that `"xl"` only
|
||||
#' works with Bootstrap 4 and above (to opt-in to Bootstrap 4+,
|
||||
#' pass [bslib::bs_theme()] to the `theme` argument of a page container
|
||||
#' like [fluidPage()]).
|
||||
#' @param easyClose If `TRUE`, the modal dialog can be dismissed by
|
||||
#' clicking outside the dialog box, or be pressing the Escape key. If
|
||||
#' `FALSE` (the default), the modal dialog can't be dismissed in those
|
||||
|
||||
@@ -326,6 +326,9 @@ ReactiveValues <- R6Class(
|
||||
.dedupe = logical(0),
|
||||
# Key, asList(), or names() have been retrieved
|
||||
.hasRetrieved = list(),
|
||||
# All names, in insertion order. The names are also stored in the .values
|
||||
# object, but it does not preserve order.
|
||||
.nameOrder = character(0),
|
||||
|
||||
|
||||
initialize = function(
|
||||
@@ -403,6 +406,11 @@ ReactiveValues <- R6Class(
|
||||
return(invisible())
|
||||
}
|
||||
|
||||
# If it's new, append key to the name order
|
||||
if (!key_exists) {
|
||||
.nameOrder[length(.nameOrder) + 1] <<- key
|
||||
}
|
||||
|
||||
# set the value for better logging
|
||||
.values$set(key, value)
|
||||
|
||||
@@ -444,14 +452,13 @@ ReactiveValues <- R6Class(
|
||||
},
|
||||
|
||||
names = function() {
|
||||
nameValues <- .values$keys()
|
||||
if (!isTRUE(.hasRetrieved$names)) {
|
||||
domain <- getDefaultReactiveDomain()
|
||||
rLog$defineNames(.reactId, nameValues, .label, domain)
|
||||
rLog$defineNames(.reactId, .nameOrder, .label, domain)
|
||||
.hasRetrieved$names <<- TRUE
|
||||
}
|
||||
.namesDeps$register()
|
||||
return(nameValues)
|
||||
return(.nameOrder)
|
||||
},
|
||||
|
||||
# Get a metadata value. Does not trigger reactivity.
|
||||
@@ -499,7 +506,7 @@ ReactiveValues <- R6Class(
|
||||
},
|
||||
|
||||
toList = function(all.names=FALSE) {
|
||||
listValue <- .values$values()
|
||||
listValue <- .values$mget(.nameOrder)
|
||||
if (!all.names) {
|
||||
listValue <- listValue[!grepl("^\\.", base::names(listValue))]
|
||||
}
|
||||
@@ -2180,8 +2187,8 @@ maskReactiveContext <- function(expr) {
|
||||
#' @param autoDestroy If `TRUE` (the default), the observer will be
|
||||
#' automatically destroyed when its domain (if any) ends.
|
||||
#' @param ignoreNULL Whether the action should be triggered (or value
|
||||
#' calculated, in the case of `eventReactive`) when the input is
|
||||
#' `NULL`. See Details.
|
||||
#' calculated, in the case of `eventReactive`) when the input event expression
|
||||
#' is `NULL`. See Details.
|
||||
#' @param ignoreInit If `TRUE`, then, when this `observeEvent` is
|
||||
#' first created/initialized, ignore the `handlerExpr` (the second
|
||||
#' argument), whether it is otherwise supposed to run or not. The default is
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# Create a map for input handlers and register the defaults.
|
||||
inputHandlers <- Map$new()
|
||||
# Create a Map object for input handlers and register the defaults.
|
||||
# This is assigned in .onLoad time.
|
||||
inputHandlers <- NULL
|
||||
on_load({
|
||||
inputHandlers <- Map$new()
|
||||
})
|
||||
|
||||
#' Register an Input Handler
|
||||
#'
|
||||
@@ -125,115 +129,117 @@ applyInputHandlers <- function(inputs, shinysession = getDefaultReactiveDomain()
|
||||
inputs
|
||||
}
|
||||
|
||||
on_load({
|
||||
# Takes a list-of-lists and returns a matrix. The lists
|
||||
# must all be the same length. NULL is replaced by NA.
|
||||
registerInputHandler("shiny.matrix", function(data, ...) {
|
||||
if (length(data) == 0)
|
||||
return(matrix(nrow=0, ncol=0))
|
||||
|
||||
# Takes a list-of-lists and returns a matrix. The lists
|
||||
# must all be the same length. NULL is replaced by NA.
|
||||
registerInputHandler("shiny.matrix", function(data, ...) {
|
||||
if (length(data) == 0)
|
||||
return(matrix(nrow=0, ncol=0))
|
||||
|
||||
m <- matrix(unlist(lapply(data, function(x) {
|
||||
sapply(x, function(y) {
|
||||
ifelse(is.null(y), NA, y)
|
||||
})
|
||||
})), nrow = length(data[[1]]), ncol = length(data))
|
||||
return(m)
|
||||
})
|
||||
|
||||
|
||||
registerInputHandler("shiny.number", function(val, ...){
|
||||
ifelse(is.null(val), NA, val)
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.password", function(val, shinysession, name) {
|
||||
# Mark passwords as not serializable
|
||||
setSerializer(name, serializerUnserializable)
|
||||
val
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.date", function(val, ...){
|
||||
# First replace NULLs with NA, then convert to Date vector
|
||||
datelist <- ifelse(lapply(val, is.null), NA, val)
|
||||
|
||||
res <- NULL
|
||||
tryCatch({
|
||||
res <- as.Date(unlist(datelist))
|
||||
},
|
||||
error = function(e) {
|
||||
# It's possible for client to send a string like "99999-01-01", which
|
||||
# as.Date can't handle.
|
||||
warning(e$message)
|
||||
res <<- as.Date(rep(NA, length(datelist)))
|
||||
}
|
||||
)
|
||||
|
||||
res
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.datetime", function(val, ...){
|
||||
# First replace NULLs with NA, then convert to POSIXct vector
|
||||
times <- lapply(val, function(x) {
|
||||
if (is.null(x)) NA
|
||||
else x
|
||||
m <- matrix(unlist(lapply(data, function(x) {
|
||||
sapply(x, function(y) {
|
||||
ifelse(is.null(y), NA, y)
|
||||
})
|
||||
})), nrow = length(data[[1]]), ncol = length(data))
|
||||
return(m)
|
||||
})
|
||||
as.POSIXct(unlist(times), origin = "1970-01-01", tz = "UTC")
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.action", function(val, shinysession, name) {
|
||||
# mark up the action button value with a special class so we can recognize it later
|
||||
class(val) <- c("shinyActionButtonValue", class(val))
|
||||
val
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.file", function(val, shinysession, name) {
|
||||
# This function is only used when restoring a Shiny fileInput. When a file is
|
||||
# uploaded the usual way, it takes a different code path and won't hit this
|
||||
# function.
|
||||
if (is.null(val))
|
||||
return(NULL)
|
||||
|
||||
# The data will be a named list of lists; convert to a data frame.
|
||||
val <- as.data.frame(lapply(val, unlist), stringsAsFactors = FALSE)
|
||||
|
||||
# `val$datapath` should be a filename without a path, for security reasons.
|
||||
if (basename(val$datapath) != val$datapath) {
|
||||
stop("Invalid '/' found in file input path.")
|
||||
}
|
||||
|
||||
# Prepend the persistent dir
|
||||
oldfile <- file.path(getCurrentRestoreContext()$dir, val$datapath)
|
||||
|
||||
# Copy the original file to a new temp dir, so that a restored session can't
|
||||
# modify the original.
|
||||
newdir <- file.path(tempdir(), createUniqueId(12))
|
||||
dir.create(newdir)
|
||||
val$datapath <- file.path(newdir, val$datapath)
|
||||
file.copy(oldfile, val$datapath)
|
||||
|
||||
# Need to mark this input value with the correct serializer. When a file is
|
||||
# uploaded the usual way (instead of being restored), this occurs in
|
||||
# session$`@uploadEnd`.
|
||||
setSerializer(name, serializerFileInput)
|
||||
|
||||
snapshotPreprocessInput(name, snapshotPreprocessorFileInput)
|
||||
|
||||
val
|
||||
})
|
||||
|
||||
|
||||
# to be used with !!!answer
|
||||
registerInputHandler("shiny.symbolList", function(val, ...) {
|
||||
if (is.null(val)) {
|
||||
list()
|
||||
} else {
|
||||
lapply(val, as.symbol)
|
||||
}
|
||||
})
|
||||
# to be used with !!answer
|
||||
registerInputHandler("shiny.symbol", function(val, ...) {
|
||||
if (is.null(val) || identical(val, "")) {
|
||||
NULL
|
||||
} else {
|
||||
as.symbol(val)
|
||||
}
|
||||
|
||||
|
||||
registerInputHandler("shiny.number", function(val, ...){
|
||||
ifelse(is.null(val), NA, val)
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.password", function(val, shinysession, name) {
|
||||
# Mark passwords as not serializable
|
||||
setSerializer(name, serializerUnserializable)
|
||||
val
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.date", function(val, ...){
|
||||
# First replace NULLs with NA, then convert to Date vector
|
||||
datelist <- ifelse(lapply(val, is.null), NA, val)
|
||||
|
||||
res <- NULL
|
||||
tryCatch({
|
||||
res <- as.Date(unlist(datelist))
|
||||
},
|
||||
error = function(e) {
|
||||
# It's possible for client to send a string like "99999-01-01", which
|
||||
# as.Date can't handle.
|
||||
warning(e$message)
|
||||
res <<- as.Date(rep(NA, length(datelist)))
|
||||
}
|
||||
)
|
||||
|
||||
res
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.datetime", function(val, ...){
|
||||
# First replace NULLs with NA, then convert to POSIXct vector
|
||||
times <- lapply(val, function(x) {
|
||||
if (is.null(x)) NA
|
||||
else x
|
||||
})
|
||||
as.POSIXct(unlist(times), origin = "1970-01-01", tz = "UTC")
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.action", function(val, shinysession, name) {
|
||||
# mark up the action button value with a special class so we can recognize it later
|
||||
class(val) <- c("shinyActionButtonValue", class(val))
|
||||
val
|
||||
})
|
||||
|
||||
registerInputHandler("shiny.file", function(val, shinysession, name) {
|
||||
# This function is only used when restoring a Shiny fileInput. When a file is
|
||||
# uploaded the usual way, it takes a different code path and won't hit this
|
||||
# function.
|
||||
if (is.null(val))
|
||||
return(NULL)
|
||||
|
||||
# The data will be a named list of lists; convert to a data frame.
|
||||
val <- as.data.frame(lapply(val, unlist), stringsAsFactors = FALSE)
|
||||
|
||||
# `val$datapath` should be a filename without a path, for security reasons.
|
||||
if (basename(val$datapath) != val$datapath) {
|
||||
stop("Invalid '/' found in file input path.")
|
||||
}
|
||||
|
||||
# Prepend the persistent dir
|
||||
oldfile <- file.path(getCurrentRestoreContext()$dir, val$datapath)
|
||||
|
||||
# Copy the original file to a new temp dir, so that a restored session can't
|
||||
# modify the original.
|
||||
newdir <- file.path(tempdir(), createUniqueId(12))
|
||||
dir.create(newdir)
|
||||
val$datapath <- file.path(newdir, val$datapath)
|
||||
file.copy(oldfile, val$datapath)
|
||||
|
||||
# Need to mark this input value with the correct serializer. When a file is
|
||||
# uploaded the usual way (instead of being restored), this occurs in
|
||||
# session$`@uploadEnd`.
|
||||
setSerializer(name, serializerFileInput)
|
||||
|
||||
snapshotPreprocessInput(name, snapshotPreprocessorFileInput)
|
||||
|
||||
val
|
||||
})
|
||||
|
||||
|
||||
# to be used with !!!answer
|
||||
registerInputHandler("shiny.symbolList", function(val, ...) {
|
||||
if (is.null(val)) {
|
||||
list()
|
||||
} else {
|
||||
lapply(val, as.symbol)
|
||||
}
|
||||
})
|
||||
# to be used with !!answer
|
||||
registerInputHandler("shiny.symbol", function(val, ...) {
|
||||
if (is.null(val) || identical(val, "")) {
|
||||
NULL
|
||||
} else {
|
||||
as.symbol(val)
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
14
R/server.R
14
R/server.R
@@ -1,7 +1,12 @@
|
||||
#' @include server-input-handlers.R
|
||||
|
||||
appsByToken <- Map$new()
|
||||
appsNeedingFlush <- Map$new()
|
||||
appsByToken <- NULL
|
||||
appsNeedingFlush <- NULL
|
||||
on_load({
|
||||
appsByToken <- Map$new()
|
||||
appsNeedingFlush <- Map$new()
|
||||
})
|
||||
|
||||
|
||||
# Provide a character representation of the WS that can be used
|
||||
# as a key in a Map.
|
||||
@@ -122,7 +127,10 @@ decodeMessage <- function(data) {
|
||||
return(mainMessage)
|
||||
}
|
||||
|
||||
autoReloadCallbacks <- Callbacks$new()
|
||||
autoReloadCallbacks <- NULL
|
||||
on_load({
|
||||
autoReloadCallbacks <- Callbacks$new()
|
||||
})
|
||||
|
||||
createAppHandlers <- function(httpHandlers, serverFuncSource) {
|
||||
appvars <- new.env()
|
||||
|
||||
@@ -90,8 +90,9 @@ getShinyOption <- function(name, default = NULL) {
|
||||
#' \item{shiny.jquery.version (defaults to `3`)}{The major version of jQuery to use.
|
||||
#' Currently only values of `3` or `1` are supported. If `1`, then jQuery 1.12.4 is used. If `3`,
|
||||
#' then jQuery `r version_jquery` is used.}
|
||||
#' \item{shiny.json.digits (defaults to `16`)}{The number of digits to use when converting
|
||||
#' numbers to JSON format to send to the client web browser.}
|
||||
#' \item{shiny.json.digits (defaults to `I(16)`)}{Max number of digits to use when converting
|
||||
#' numbers to JSON format to send to the client web browser. Use [I()] to specify significant digits.
|
||||
#' Use `NA` for max precision.}
|
||||
#' \item{shiny.launch.browser (defaults to `interactive()`)}{A boolean which controls the default behavior
|
||||
#' when an app is run. See [runApp()] for more information.}
|
||||
#' \item{shiny.mathjax.url (defaults to `"https://mathjax.rstudio.com/latest/MathJax.js"`)}{
|
||||
|
||||
@@ -34,3 +34,11 @@ NULL
|
||||
# since we call require(shiny) as part of loading the app.
|
||||
#' @import methods
|
||||
NULL
|
||||
|
||||
|
||||
# For usethis::use_release_issue()
|
||||
release_bullets <- function() {
|
||||
c(
|
||||
"Update static imports: `staticimports::import()`"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -33,8 +33,12 @@ createUniqueId <- function(bytes, prefix = "", suffix = "") {
|
||||
}
|
||||
|
||||
toJSON <- function(x, ..., dataframe = "columns", null = "null", na = "null",
|
||||
auto_unbox = TRUE, digits = getOption("shiny.json.digits", 16),
|
||||
use_signif = TRUE, force = TRUE, POSIXt = "ISO8601", UTC = TRUE,
|
||||
auto_unbox = TRUE,
|
||||
# Shiny has had a legacy value of 16 significant digits
|
||||
# We can use `I(16)` mixed with the default behavior in jsonlite's `use_signif=`
|
||||
# https://github.com/jeroen/jsonlite/commit/728efa9
|
||||
digits = getOption("shiny.json.digits", I(16)), use_signif = is(digits, "AsIs"),
|
||||
force = TRUE, POSIXt = "ISO8601", UTC = TRUE,
|
||||
rownames = FALSE, keep_vec_names = TRUE, strict_atomic = TRUE) {
|
||||
|
||||
if (strict_atomic) {
|
||||
|
||||
@@ -133,8 +133,11 @@ shinyDependencyCSS <- function(theme) {
|
||||
))
|
||||
}
|
||||
|
||||
bs_version <- bslib::theme_version(theme)
|
||||
bootstrap_scss <- paste0("shiny.bootstrap", bs_version, ".scss")
|
||||
|
||||
scss_home <- system_file("www/shared/shiny_scss", package = "shiny")
|
||||
scss_files <- file.path(scss_home, c("bootstrap.scss", "shiny.scss"))
|
||||
scss_files <- file.path(scss_home, c(bootstrap_scss, "shiny.scss"))
|
||||
scss_files <- lapply(scss_files, sass::sass_file)
|
||||
|
||||
bslib::bs_dependency(
|
||||
|
||||
@@ -42,36 +42,20 @@ get_package_version <- function(pkg) {
|
||||
|
||||
is_installed <- function(pkg, version = NULL) {
|
||||
installed <- isNamespaceLoaded(pkg) || nzchar(system_file_cached(package = pkg))
|
||||
|
||||
if (is.null(version)) {
|
||||
return(installed)
|
||||
}
|
||||
installed && isTRUE(get_package_version(pkg) >= version)
|
||||
}
|
||||
|
||||
register_upgrade_message <- function(pkg, version, error = FALSE) {
|
||||
if (!is.character(version) && !inherits(version, "numeric_version")) {
|
||||
# Avoid https://bugs.r-project.org/show_bug.cgi?id=18548
|
||||
alert <- if (identical(Sys.getenv("TESTTHAT"), "true")) stop else warning
|
||||
alert("`version` must be a character string or a `package_version` or `numeric_version` object.")
|
||||
|
||||
msg <- sprintf(
|
||||
"This version of '%s' is designed to work with '%s' >= %s.
|
||||
Please upgrade via install.packages('%s').",
|
||||
environmentName(environment(register_upgrade_message)),
|
||||
pkg, version, pkg
|
||||
)
|
||||
|
||||
cond <- if (error) stop else packageStartupMessage
|
||||
|
||||
if (pkg %in% loadedNamespaces() && !is_installed(pkg, version)) {
|
||||
cond(msg)
|
||||
version <- numeric_version(sprintf("%0.9g", version))
|
||||
}
|
||||
|
||||
# Always register hook in case pkg is loaded at some
|
||||
# point the future (or, potentially, but less commonly,
|
||||
# unloaded & reloaded)
|
||||
setHook(
|
||||
packageEvent(pkg, "onLoad"),
|
||||
function(...) {
|
||||
if (!is_installed(pkg, version)) cond(msg)
|
||||
}
|
||||
)
|
||||
installed && isTRUE(get_package_version(pkg) >= version)
|
||||
}
|
||||
|
||||
# Simplified version rlang:::s3_register() that just uses
|
||||
@@ -190,11 +174,9 @@ system_file <- function(..., package = "base") {
|
||||
normalizePath(files, winslash = "/")
|
||||
}
|
||||
|
||||
# A wrapper for `system.file()`, which caches the results, because
|
||||
# `system.file()` can be slow. Note that because of caching, if
|
||||
# `system_file_cached()` is called on a package that isn't installed, then the
|
||||
# package is installed, and then `system_file_cached()` is called again, it will
|
||||
# still return "".
|
||||
# A wrapper for `system.file()`, which caches the package path because
|
||||
# `system.file()` can be slow. If a package is not installed, the result won't
|
||||
# be cached.
|
||||
system_file_cached <- local({
|
||||
pkg_dir_cache <- character()
|
||||
|
||||
@@ -206,7 +188,9 @@ system_file_cached <- local({
|
||||
not_cached <- is.na(match(package, names(pkg_dir_cache)))
|
||||
if (not_cached) {
|
||||
pkg_dir <- system.file(package = package)
|
||||
pkg_dir_cache[[package]] <<- pkg_dir
|
||||
if (nzchar(pkg_dir)) {
|
||||
pkg_dir_cache[[package]] <<- pkg_dir
|
||||
}
|
||||
} else {
|
||||
pkg_dir <- pkg_dir_cache[[package]]
|
||||
}
|
||||
|
||||
@@ -423,6 +423,23 @@ updateSliderInput <- function(session = getDefaultReactiveDomain(), inputId, lab
|
||||
{
|
||||
validate_session_object(session)
|
||||
|
||||
if (!is.null(value)) {
|
||||
if (!is.null(min) && !is.null(max)) {
|
||||
# Validate value/min/max together if all three are provided
|
||||
tryCatch(
|
||||
validate_slider_value(min, max, value, "updateSliderInput"),
|
||||
error = function(err) warning(conditionMessage(err), call. = FALSE)
|
||||
)
|
||||
} else if (length(value) < 1 || length(value) > 2 || any(is.na(value))) {
|
||||
# Otherwise ensure basic assumptions about value are met
|
||||
warning(
|
||||
"In updateSliderInput(): value must be a single value or a length-2 ",
|
||||
"vector and cannot contain NA values.",
|
||||
call. = FALSE
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
# If no min/max/value is provided, we won't know the
|
||||
# type, and this will return an empty string
|
||||
dataType <- getSliderType(min, max, value)
|
||||
|
||||
18
R/utils.R
18
R/utils.R
@@ -4,7 +4,7 @@ NULL
|
||||
|
||||
# @staticimports pkg:staticimports
|
||||
# is_installed get_package_version system_file
|
||||
# s3_register register_upgrade_message
|
||||
# s3_register
|
||||
# any_named any_unnamed
|
||||
|
||||
#' Make a random number generator repeatable
|
||||
@@ -1240,14 +1240,12 @@ dotloop <- function(fun_, ...) {
|
||||
#' @param x An expression whose truthiness value we want to determine
|
||||
#' @export
|
||||
isTruthy <- function(x) {
|
||||
if (inherits(x, 'try-error'))
|
||||
return(FALSE)
|
||||
|
||||
if (!is.atomic(x))
|
||||
return(TRUE)
|
||||
|
||||
if (is.null(x))
|
||||
return(FALSE)
|
||||
if (inherits(x, 'try-error'))
|
||||
return(FALSE)
|
||||
if (!is.atomic(x))
|
||||
return(TRUE)
|
||||
if (length(x) == 0)
|
||||
return(FALSE)
|
||||
if (all(is.na(x)))
|
||||
@@ -1431,6 +1429,12 @@ wrapFunctionLabel <- function(func, name, ..stacktraceon = FALSE, dots = TRUE) {
|
||||
if (name == "name" || name == "func" || name == "relabelWrapper") {
|
||||
stop("Invalid name for wrapFunctionLabel: ", name)
|
||||
}
|
||||
if (nchar(name, "bytes") > 10000) {
|
||||
# Max variable length in R is 10000 bytes. Truncate to a shorter number of
|
||||
# chars because some characters could be multi-byte.
|
||||
name <- substr(name, 1, 5000)
|
||||
}
|
||||
|
||||
assign(name, func, environment())
|
||||
registerDebugHook(name, environment(), name)
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Generated by tools/updateSelectize.R; do not edit by hand
|
||||
version_selectize <- "0.12.4"
|
||||
version_selectize <- "0.15.2"
|
||||
|
||||
@@ -16,7 +16,7 @@ Easily build rich and productive interactive web apps in R — no HTML/CSS/J
|
||||
* A prebuilt set of highly sophisticated, customizable, and easy-to-use widgets (e.g., plots, tables, sliders, dropdowns, date pickers, and more).
|
||||
* An attractive default look based on [Bootstrap](https://getbootstrap.com/) which can also be easily customized with the [bslib](https://github.com/rstudio/bslib) package or avoided entirely with more direct R bindings to HTML/CSS/JavaScript.
|
||||
* Seamless integration with [R Markdown](https://shiny.rstudio.com/articles/interactive-docs.html), making it easy to embed numerous applications natively within a larger dynamic document.
|
||||
* Tools for improving and monitoring performance, including native support for [async programming](https://www.rstudio.com/blog/shiny-1-1-0/), [caching](https://talks.cpsievert.me/20201117), [load testing](https://rstudio.github.io/shinyloadtest/), and more.
|
||||
* Tools for improving and monitoring performance, including native support for [async programming](https://posit.co/blog/shiny-1-1-0/), [caching](https://talks.cpsievert.me/20201117), [load testing](https://rstudio.github.io/shinyloadtest/), and more.
|
||||
* [Modules](https://shiny.rstudio.com/articles/modules.html): a framework for reducing code duplication and complexity.
|
||||
* An ability to [bookmark application state](https://shiny.rstudio.com/articles/bookmarking-state.html) and/or [generate code to reproduce output(s)](https://github.com/rstudio/shinymeta).
|
||||
* A rich ecosystem of extension packages for more [custom widgets](http://www.htmlwidgets.org/), [input validation](https://github.com/rstudio/shinyvalidate), [unit testing](https://github.com/rstudio/shinytest), and more.
|
||||
@@ -45,6 +45,10 @@ For more examples and inspiration, check out the [Shiny User Gallery](https://sh
|
||||
|
||||
For help with learning fundamental Shiny programming concepts, check out the [Mastering Shiny](https://mastering-shiny.org/) book and the [Shiny Tutorial](https://shiny.rstudio.com/tutorial/). The former is currently more up-to-date with modern Shiny features, whereas the latter takes a deeper, more visual, dive into fundamental concepts.
|
||||
|
||||
## Join the conversation
|
||||
|
||||
If you want to chat about Shiny, meet other developers, or help us decide what to work on next, [join us on Discord](https://discord.com/invite/yMGCamUMnS).
|
||||
|
||||
## Getting Help
|
||||
|
||||
To ask a question about Shiny, please use the [RStudio Community website](https://community.rstudio.com/new-topic?category=shiny&tags=shiny).
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@charset "UTF-8";
|
||||
/* 'shiny' skin for Ion.RangeSlider, largely based on the 'big' skin, but with smaller dimensions, grayscale grid text, and without gradients
|
||||
© Posit, PBC, 2023
|
||||
© RStudio, Inc, 2014
|
||||
© Denis Ineshin, 2014 https://github.com/IonDen
|
||||
© guybowden, 2014 https://github.com/guybowden
|
||||
@@ -174,6 +175,18 @@
|
||||
background-color: #ededed;
|
||||
border: 1px solid #cccccc;
|
||||
border-radius: 8px;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.irs--shiny .irs-line::before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: relative;
|
||||
cursor: s-resize;
|
||||
width: 100%;
|
||||
height: 22px;
|
||||
top: -9px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.irs--shiny .irs-bar {
|
||||
@@ -182,12 +195,24 @@
|
||||
border-top: 1px solid #428bca;
|
||||
border-bottom: 1px solid #428bca;
|
||||
background: #428bca;
|
||||
cursor: s-resize;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.irs--shiny .irs-bar--single {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.irs--shiny .irs-bar::before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 22px;
|
||||
top: -9px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.irs--shiny .irs-shadow {
|
||||
top: 38px;
|
||||
height: 2px;
|
||||
@@ -207,6 +232,7 @@
|
||||
background-color: #dedede;
|
||||
box-shadow: 1px 1px 3px rgba(255, 255, 255, 0.3);
|
||||
border-radius: 22px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.irs--shiny .irs-handle.state_hover, .irs--shiny .irs-handle:hover {
|
||||
|
||||
@@ -753,7 +753,7 @@
|
||||
x = $handle.offset().left;
|
||||
x += ($handle.width() / 2) - 1;
|
||||
|
||||
this.pointerClick("single", {preventDefault: function () {}, pageX: x});
|
||||
this.pointerClick("single", {preventDefault: function () {}, stopPropagation: function () {}, pageX: x});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,5 @@
|
||||
/* 'shiny' skin for Ion.RangeSlider, largely based on the 'big' skin, but with smaller dimensions, grayscale grid text, and without gradients
|
||||
© Posit, PBC, 2023
|
||||
© RStudio, Inc, 2014
|
||||
© Denis Ineshin, 2014 https://github.com/IonDen
|
||||
© guybowden, 2014 https://github.com/guybowden
|
||||
@@ -79,6 +80,19 @@ $font-family: $font-family-base !default;
|
||||
background-color: $line_bg_color;
|
||||
border: $line_border;
|
||||
@include border-radius-shim($line_height);
|
||||
|
||||
// Increase the touch target area of the slider line
|
||||
overflow: visible;
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: relative;
|
||||
cursor: s-resize; // downward arrow
|
||||
width: 100%;
|
||||
height: $handle_height;
|
||||
top: -(($handle_height - $line_height / 2) / 2);
|
||||
z-index: 1; // raise touch area above grid
|
||||
}
|
||||
}
|
||||
|
||||
.#{$name}-bar {
|
||||
@@ -87,10 +101,23 @@ $font-family: $font-family-base !default;
|
||||
border-top: 1px solid $bar_color;
|
||||
border-bottom: 1px solid $bar_color;
|
||||
background: $bar_color;
|
||||
cursor: s-resize; // downard arrow, overwritten when a range
|
||||
z-index: 2;
|
||||
|
||||
&--single {
|
||||
@include border-radius-shim($line_height 0 0 $line_height);
|
||||
}
|
||||
|
||||
// Increase the touch target area of the slider bar
|
||||
&::before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: $handle_height;
|
||||
top: -(($handle_height - $line_height / 2) / 2);
|
||||
z-index: 2; // raise touch area above line touch target
|
||||
}
|
||||
}
|
||||
|
||||
// sliderInput() doesn't currently support from_min/from_max, so this isn't relevant
|
||||
@@ -114,6 +141,7 @@ $font-family: $font-family-base !default;
|
||||
background-color: $handle_color;
|
||||
box-shadow: $handle_box_shadow;
|
||||
border-radius: $handle_width;
|
||||
z-index: 2;
|
||||
|
||||
&.state_hover,
|
||||
&:hover {
|
||||
|
||||
File diff suppressed because one or more lines are too long
3486
inst/www/shared/selectize/js/selectize.js
Normal file
3486
inst/www/shared/selectize/js/selectize.js
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
16
inst/www/shared/selectize/scss/plugins/auto_position.scss
Normal file
16
inst/www/shared/selectize/scss/plugins/auto_position.scss
Normal file
@@ -0,0 +1,16 @@
|
||||
.#{selectize}-dropdown.plugin-auto_position.#{$selectize}-position-top {
|
||||
border-top: 1px solid $select-color-border;
|
||||
border-bottom: 0 none;
|
||||
border-radius: 3px 3px 0 0;
|
||||
box-shadow: 0 -6px 12px rgba(var(--bs-body-color-rgb, 0,0,0), .18);
|
||||
}
|
||||
|
||||
.#{selectize}-control.plugin-auto_position .#{selectize}-input.#{$selectize}-position-top.dropdown-active {
|
||||
border-radius: 0 0 3px 3px;
|
||||
border-top: 0 none;
|
||||
|
||||
&::before {
|
||||
top: 0;
|
||||
bottom: unset;
|
||||
}
|
||||
}
|
||||
29
inst/www/shared/selectize/scss/plugins/clear_button.scss
Normal file
29
inst/www/shared/selectize/scss/plugins/clear_button.scss
Normal file
@@ -0,0 +1,29 @@
|
||||
.#{$selectize}-control.plugin-clear_button {
|
||||
.clear {
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 25px;
|
||||
top: 0;
|
||||
right: calc(#{$select-padding-x} - #{$select-padding-item-x});
|
||||
color: var(--bs-body-color, black);
|
||||
opacity: 0.4;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
font-size: 21px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.clear:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&.single .clear {
|
||||
right: calc(#{$select-padding-x} - #{$select-padding-item-x} + 1.5rem);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
.selectize-control.plugin-drag_drop {
|
||||
&.multi > .selectize-input > div.ui-sortable-placeholder {
|
||||
visibility: visible !important;
|
||||
background: #f2f2f2 !important;
|
||||
background: rgba(0,0,0,0.06) !important;
|
||||
border: 0 none !important;
|
||||
@include selectize-box-shadow(inset 0 0 12px 4px #fff);
|
||||
.#{$selectize}-control.plugin-drag_drop {
|
||||
&.multi > .#{$selectize}-input.dragging {
|
||||
overflow: visible;
|
||||
}
|
||||
&.multi > .#{$selectize}-input > div.ui-sortable-placeholder {
|
||||
visibility: visible !important;
|
||||
background: #f2f2f2 !important;
|
||||
background: rgba(0, 0, 0, 0.06) !important;
|
||||
border: 0 none !important;
|
||||
box-shadow: inset 0 0 12px 4px #fff;
|
||||
}
|
||||
.ui-sortable-placeholder::after {
|
||||
content: '!';
|
||||
visibility: hidden;
|
||||
content: "!";
|
||||
visibility: hidden;
|
||||
}
|
||||
.ui-sortable-helper {
|
||||
@include selectize-box-shadow(0 2px 5px rgba(0,0,0,0.2));
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
.selectize-dropdown-header {
|
||||
position: relative;
|
||||
padding: $selectize-padding-dropdown-item-y $selectize-padding-dropdown-item-x;
|
||||
border-bottom: 1px solid $selectize-color-border;
|
||||
background: mix($selectize-color-dropdown, $selectize-color-border, 85%);
|
||||
@include selectize-border-radius($selectize-border-radius $selectize-border-radius 0 0);
|
||||
.#{$selectize}-dropdown.plugin-dropdown_header {
|
||||
.#{$selectize}-dropdown-header {
|
||||
position: relative;
|
||||
padding: ($select-padding-dropdown-item-y * 2)
|
||||
$select-padding-dropdown-item-x;
|
||||
border-bottom: 1px solid $select-color-border;
|
||||
background: RGBA($select-color-dropdown, 0.15);
|
||||
border-radius: $select-border-radius $select-border-radius 0 0;
|
||||
}
|
||||
.#{$selectize}-dropdown-header-close {
|
||||
position: absolute;
|
||||
right: $select-padding-dropdown-item-x;
|
||||
top: 50%;
|
||||
color: $select-color-text;
|
||||
opacity: 0.4;
|
||||
margin-top: -12px;
|
||||
line-height: 20px;
|
||||
font-size: 20px !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
.#{$selectize}-dropdown-header-close:hover {
|
||||
color: RGB($select-color-rgb);
|
||||
}
|
||||
}
|
||||
.selectize-dropdown-header-close {
|
||||
position: absolute;
|
||||
right: $selectize-padding-dropdown-item-x;
|
||||
top: 50%;
|
||||
color: $selectize-color-text;
|
||||
opacity: 0.4;
|
||||
margin-top: -12px;
|
||||
line-height: 20px;
|
||||
font-size: 20px !important;
|
||||
}
|
||||
.selectize-dropdown-header-close:hover {
|
||||
color: darken($selectize-color-text, 25%);
|
||||
}
|
||||
@@ -1,17 +1,22 @@
|
||||
.selectize-dropdown.plugin-optgroup_columns {
|
||||
.#{$selectize}-dropdown.plugin-optgroup_columns {
|
||||
.#{$selectize}-dropdown-content {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.optgroup {
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-top: 0 none;
|
||||
float: left;
|
||||
@include selectize-box-sizing(border-box);
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-top: 0 none;
|
||||
flex-grow: 1;
|
||||
flex-basis: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
.optgroup:last-child {
|
||||
border-right: 0 none;
|
||||
border-right: 0 none;
|
||||
}
|
||||
.optgroup:before {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
.optgroup-header {
|
||||
border-top: 0 none;
|
||||
border-top: 0 none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,38 @@
|
||||
.selectize-control.plugin-remove_button {
|
||||
[data-value] {
|
||||
position: relative;
|
||||
padding-right: 24px !important;
|
||||
.#{$selectize}-control.plugin-remove_button {
|
||||
.item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
[data-value] .remove {
|
||||
z-index: 1; /* fixes ie bug (see #392) */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 17px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
padding: $selectize-padding-item-y 0 0 0;
|
||||
border-left: 1px solid $selectize-color-item-border;
|
||||
@include selectize-border-radius(0 2px 2px 0);
|
||||
@include selectize-box-sizing(border-box);
|
||||
|
||||
.item .remove {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
padding: $select-padding-item-y $select-padding-item-x;
|
||||
border-left: 1px solid $select-color-item-border;
|
||||
border-radius: 0 2px 2px 0;
|
||||
box-sizing: border-box;
|
||||
margin-left: $select-padding-item-x;
|
||||
}
|
||||
[data-value] .remove:hover {
|
||||
background: rgba(0,0,0,0.05);
|
||||
|
||||
.item .remove:hover {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
[data-value].active .remove {
|
||||
border-left-color: $selectize-color-item-active-border;
|
||||
|
||||
.item.active .remove {
|
||||
border-left-color: $select-color-item-active-border;
|
||||
}
|
||||
.disabled [data-value] .remove:hover {
|
||||
background: none;
|
||||
|
||||
.disabled .item .remove:hover {
|
||||
background: none;
|
||||
}
|
||||
.disabled [data-value] .remove {
|
||||
border-left-color: lighten(desaturate($selectize-color-item-border, 100%), $selectize-lighten-disabled-item-border);
|
||||
}
|
||||
.remove-single {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
font-size: 23px;
|
||||
|
||||
.disabled .item .remove {
|
||||
border-left-color: lighten(
|
||||
desaturate($select-color-item-border, 100%),
|
||||
$select-lighten-disabled-item-border
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,158 +1,136 @@
|
||||
/**
|
||||
* selectize.bootstrap3.css (v0.12.3) - Bootstrap 3 Theme
|
||||
* Copyright (c) 2013–2015 Brian Reavis & contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
||||
* file except in compliance with the License. You may obtain a copy of the License at:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under
|
||||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
* ANY KIND, either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*
|
||||
* @author Brian Reavis <brian@thirdroute.com>
|
||||
*/
|
||||
|
||||
$selectize-font-family: inherit !default;
|
||||
$selectize-font-size: inherit !default;
|
||||
$selectize-line-height: $line-height-computed !default;
|
||||
$select-font-family: inherit;
|
||||
$select-font-size: inherit;
|
||||
$select-line-height: $line-height-computed;
|
||||
|
||||
$selectize-color-text: $input-color !default;
|
||||
$selectize-color-highlight: rgba(255,237,40,0.4) !default;
|
||||
$selectize-color-input: $input-bg !default;
|
||||
$selectize-color-input-full: $input-bg !default;
|
||||
$selectize-color-input-error: $state-danger-text !default;
|
||||
$selectize-color-input-error-focus: darken($selectize-color-input-error, 10%) !default;
|
||||
$selectize-color-disabled: $input-bg !default;
|
||||
$selectize-color-item: mix($selectize-color-input, $selectize-color-text, 90%) !default;
|
||||
$selectize-color-item-border: rgba(black, 0) !default;
|
||||
$selectize-color-item-active: $component-active-bg !default;
|
||||
$selectize-color-item-active-text: color-contrast($selectize-color-item-active) !default;
|
||||
$selectize-color-item-active-border: rgba(black, 0) !default;
|
||||
$selectize-color-optgroup: $dropdown-bg !default;
|
||||
$selectize-color-optgroup-text: $dropdown-header-color !default;
|
||||
$selectize-color-optgroup-border: $dropdown-divider-bg !default;
|
||||
$selectize-color-dropdown: $dropdown-bg !default;
|
||||
$selectize-color-dropdown-text: $dropdown-link-color !default;
|
||||
$selectize-color-dropdown-border-top: mix($input-border, $input-bg, 0.8) !default;
|
||||
$selectize-color-dropdown-item-active: $dropdown-link-hover-bg !default;
|
||||
$selectize-color-dropdown-item-active-text: $dropdown-link-hover-color !default;
|
||||
$selectize-color-dropdown-item-create-active-text: $dropdown-link-hover-color !default;
|
||||
$selectize-opacity-disabled: 0.5 !default;
|
||||
$selectize-shadow-input: none !default;
|
||||
$selectize-shadow-input-focus: inset 0 1px 2px rgba(black, 0.15) !default;
|
||||
$selectize-shadow-input-error: inset 0 1px 1px rgba(black, .075) !default;
|
||||
$selectize-shadow-input-error-focus: inset 0 1px 1px rgba(black, .075), 0 0 6px lighten($selectize-color-input-error, 20%) !default;
|
||||
$selectize-border: 1px solid $input-border !default;
|
||||
$selectize-border-radius: $input-border-radius !default;
|
||||
$select-color-text: $text-color;
|
||||
$select-color-highlight: rgba(255, 237, 40, 0.4);
|
||||
$select-color-input: $input-bg;
|
||||
$select-color-input-full: $input-bg;
|
||||
$select-color-input-error: $state-danger-text;
|
||||
$select-color-input-error-focus: darken($select-color-input-error, 10%);
|
||||
$select-color-disabled: $input-bg;
|
||||
$select-color-item: RGBA($select-color-text, 0.1);
|
||||
$select-color-item-border: rgba(0, 0, 0, 0);
|
||||
$select-color-item-active: $component-active-bg;
|
||||
$select-color-item-active-text: color-contrast($select-color-item-active);
|
||||
$select-color-item-active-border: rgba(0, 0, 0, 0);
|
||||
$select-color-optgroup: $dropdown-bg;
|
||||
$select-color-optgroup-text: $dropdown-header-color;
|
||||
$select-color-optgroup-border: $dropdown-divider-bg;
|
||||
$select-color-dropdown: $dropdown-bg;
|
||||
$select-color-dropdown-border-top: mix($input-border, $input-bg, 80%);
|
||||
$select-color-dropdown-item-active: $dropdown-link-hover-bg;
|
||||
$select-color-dropdown-item-active-text: $dropdown-link-hover-color;
|
||||
$select-color-dropdown-item-create-active-text: $dropdown-link-hover-color;
|
||||
$select-opacity-disabled: 0.5;
|
||||
$select-shadow-input: none;
|
||||
$select-shadow-input-focus: inset 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||
$select-shadow-input-error: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
$select-shadow-input-error-focus: inset 0 1px 1px rgba(0, 0, 0, 0.075),
|
||||
0 0 6px lighten($select-color-input-error, 20%);
|
||||
$select-border: 1px solid $input-border;
|
||||
$select-border-radius: $input-border-radius;
|
||||
|
||||
$selectize-width-item-border: 0 !default;
|
||||
$selectize-padding-x: $padding-base-horizontal !default;
|
||||
$selectize-padding-y: $padding-base-vertical !default;
|
||||
$selectize-padding-dropdown-item-x: $padding-base-horizontal !default;
|
||||
$selectize-padding-dropdown-item-y: 3px !default;
|
||||
$selectize-padding-item-x: 3px !default;
|
||||
$selectize-padding-item-y: 1px !default;
|
||||
$selectize-margin-item-x: 3px !default;
|
||||
$selectize-margin-item-y: 3px !default;
|
||||
$selectize-caret-margin: 0 !default;
|
||||
$select-width-item-border: 0px;
|
||||
$select-padding-x: $padding-base-horizontal;
|
||||
$select-padding-y: $padding-base-vertical;
|
||||
$select-padding-dropdown-item-x: $padding-base-horizontal;
|
||||
$select-padding-dropdown-item-y: 3px;
|
||||
$select-padding-item-x: 5px;
|
||||
$select-padding-item-y: 1px;
|
||||
$select-margin-item-x: 3px;
|
||||
$select-margin-item-y: 3px;
|
||||
|
||||
$selectize-arrow-size: 5px !default;
|
||||
$selectize-arrow-color: $selectize-color-text !default;
|
||||
$selectize-arrow-offset: $selectize-padding-x + 5px !default;
|
||||
$select-arrow-size: 5px;
|
||||
$select-arrow-color: $select-color-text;
|
||||
$select-arrow-offset: $select-padding-x + 5px;
|
||||
|
||||
@import "selectize";
|
||||
|
||||
//Import Plugins
|
||||
@import "plugins/drag_drop";
|
||||
@import "plugins/dropdown_header";
|
||||
@import "plugins/optgroup_columns";
|
||||
@import "plugins/remove_button";
|
||||
|
||||
.selectize-dropdown, .selectize-dropdown.form-control {
|
||||
height: auto;
|
||||
padding: 0;
|
||||
margin: 2px 0 0 0;
|
||||
z-index: $zindex-dropdown;
|
||||
background: $selectize-color-dropdown;
|
||||
color: $selectize-color-dropdown-text;
|
||||
border: 1px solid $dropdown-fallback-border;
|
||||
border: 1px solid $dropdown-border;
|
||||
@include selectize-border-radius ($border-radius-base);
|
||||
@include selectize-box-shadow (0 6px 12px rgba(black, .175));
|
||||
.#{$selectize}-dropdown,
|
||||
.#{$selectize}-dropdown.form-control {
|
||||
height: auto;
|
||||
padding: 0;
|
||||
margin: 2px 0 0 0;
|
||||
z-index: $zindex-dropdown;
|
||||
background: $select-color-dropdown;
|
||||
border: 1px solid $dropdown-fallback-border;
|
||||
border: 1px solid $dropdown-border;
|
||||
border-radius: $border-radius-base;
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
||||
}
|
||||
|
||||
.selectize-dropdown {
|
||||
.optgroup-header {
|
||||
font-size: $font-size-small;
|
||||
line-height: $line-height-base;
|
||||
}
|
||||
.optgroup:first-child:before {
|
||||
display: none;
|
||||
}
|
||||
.optgroup:before {
|
||||
content: ' ';
|
||||
display: block;
|
||||
@include nav-divider;
|
||||
margin-left: $selectize-padding-dropdown-item-x * -1;
|
||||
margin-right: $selectize-padding-dropdown-item-x * -1;
|
||||
}
|
||||
.#{$selectize}-dropdown {
|
||||
.optgroup-header {
|
||||
font-size: $font-size-small;
|
||||
line-height: $line-height-base;
|
||||
}
|
||||
.optgroup:first-child:before {
|
||||
display: none;
|
||||
}
|
||||
.optgroup:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
@include nav-divider();
|
||||
margin-left: $select-padding-dropdown-item-x * -1;
|
||||
margin-right: $select-padding-dropdown-item-x * -1;
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-dropdown-content {
|
||||
padding: 5px 0;
|
||||
.#{$selectize}-dropdown-content {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.selectize-dropdown-header {
|
||||
padding: $selectize-padding-dropdown-item-y * 2 $selectize-padding-dropdown-item-x;
|
||||
.#{$selectize}-dropdown-emptyoptionlabel {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.selectize-input {
|
||||
min-height: $input-height-base;
|
||||
.#{$selectize}-input {
|
||||
min-height: $input-height-base;
|
||||
|
||||
&.dropdown-active {
|
||||
@include selectize-border-radius ($selectize-border-radius);
|
||||
&.dropdown-active {
|
||||
border-radius: $select-border-radius;
|
||||
}
|
||||
&.dropdown-active::before {
|
||||
display: none;
|
||||
}
|
||||
&.focus {
|
||||
$color: $input-border-focus;
|
||||
$color-rgba: rgba(red($color), green($color), blue($color), 0.6);
|
||||
border-color: $color;
|
||||
outline: 0;
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px $color-rgba;
|
||||
}
|
||||
}
|
||||
|
||||
.has-error .#{$selectize}-input {
|
||||
border-color: $select-color-input-error;
|
||||
box-shadow: $select-shadow-input-error;
|
||||
|
||||
&:focus {
|
||||
border-color: $select-color-input-error-focus;
|
||||
box-shadow: $select-shadow-input-error-focus;
|
||||
}
|
||||
}
|
||||
|
||||
.#{$selectize}-control {
|
||||
&.multi {
|
||||
.#{$selectize}-input.has-items {
|
||||
padding-left: $select-padding-x - $select-padding-item-x;
|
||||
padding-right: $select-padding-x - $select-padding-item-x;
|
||||
}
|
||||
&.dropdown-active::before {
|
||||
display: none;
|
||||
}
|
||||
&.focus {
|
||||
$color: $input-border-focus;
|
||||
$color-rgba: rgba(red($color), green($color), blue($color), .6);
|
||||
border-color: $color;
|
||||
outline: 0;
|
||||
@include selectize-box-shadow ("inset 0 1px 1px rgba(black, .075), 0 0 8px #{$color-rgba}");
|
||||
.#{$selectize}-input > div {
|
||||
border-radius: $select-border-radius - 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.has-error .selectize-input {
|
||||
border-color: $selectize-color-input-error;
|
||||
@include selectize-box-shadow ($selectize-shadow-input-error);
|
||||
|
||||
&:focus {
|
||||
border-color: $selectize-color-input-error-focus;
|
||||
@include selectize-box-shadow ($selectize-shadow-input-error-focus);
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-control {
|
||||
&.multi {
|
||||
.selectize-input.has-items {
|
||||
padding-left: $selectize-padding-x - $selectize-padding-item-x;
|
||||
padding-right: $selectize-padding-x - $selectize-padding-item-x;
|
||||
}
|
||||
.selectize-input > div {
|
||||
@include selectize-border-radius ($selectize-border-radius - 1px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-control.selectize-control {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
border: none;
|
||||
background: none;
|
||||
@include selectize-box-shadow (none);
|
||||
@include selectize-border-radius (0);
|
||||
.form-control.#{$selectize}-control {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
@@ -1,118 +1,112 @@
|
||||
/**
|
||||
* Selectize bootstrap 4
|
||||
*/
|
||||
|
||||
//Import Boostrap 4 functions and variables
|
||||
|
||||
$enable-shadows: true !default;
|
||||
$selectize-font-family: inherit !default;
|
||||
$selectize-font-size: inherit !default;
|
||||
$selectize-line-height: $input-btn-line-height !default; //formerly line-height-computed
|
||||
$select-font-family: inherit !default;
|
||||
$select-font-size: inherit !default;
|
||||
$select-line-height: $input-btn-line-height !default; //formerly line-height-computed
|
||||
|
||||
$selectize-color-text: $input-color !default;
|
||||
$selectize-color-highlight: rgba(255,237,40,0.4) !default;
|
||||
$selectize-color-input: $input-bg !default;
|
||||
$selectize-color-input-full: $input-bg !default;
|
||||
$selectize-color-input-error: $danger !default;
|
||||
$selectize-color-input-error-focus: darken($selectize-color-input-error, 10%) !default;
|
||||
$selectize-color-disabled: $input-bg !default;
|
||||
$selectize-color-item: mix($selectize-color-input, $selectize-color-text, 90%) !default;
|
||||
$selectize-color-item-border: $input-border-color !default;
|
||||
$selectize-color-item-active: $component-active-bg !default;
|
||||
$selectize-color-item-active-text: color-contrast($selectize-color-item-active) !default;
|
||||
$selectize-color-item-active-border: rgba(0,0,0,0) !default;
|
||||
$selectize-color-optgroup: $dropdown-bg !default;
|
||||
$selectize-color-optgroup-text: $dropdown-header-color !default;
|
||||
$selectize-color-optgroup-border: $dropdown-divider-bg !default;
|
||||
$selectize-color-dropdown: $dropdown-bg !default;
|
||||
$selectize-color-dropdown-text: $dropdown-link-color !default;
|
||||
$selectize-color-dropdown-border-top: mix($input-border-color, $input-bg, 0.8) !default;
|
||||
$selectize-color-dropdown-item-active: $dropdown-link-hover-bg !default;
|
||||
$selectize-color-dropdown-item-active-text: $dropdown-link-hover-color !default;
|
||||
$selectize-color-dropdown-item-create-active-text: $dropdown-link-hover-color !default;
|
||||
$selectize-opacity-disabled: 0.5 !default;
|
||||
$selectize-shadow-input: none !default;
|
||||
$selectize-shadow-input-focus: inset 0 1px 2px rgba(0,0,0,0.15) !default;
|
||||
$selectize-shadow-input-error: inset 0 1px 1px rgba(0, 0, 0, .075) !default;
|
||||
$selectize-shadow-input-error-focus: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px lighten($selectize-color-input-error, 20%) !default;
|
||||
$selectize-border: 1px solid $input-border-color !default;
|
||||
$selectize-border-radius: $input-border-radius !default;
|
||||
$select-color-text: gray("800") !default; //$gray-800
|
||||
$select-color-highlight: rgba(255, 237, 40, 0.4) !default;
|
||||
$select-color-input: $input-bg !default;
|
||||
$select-color-input-full: $input-bg !default;
|
||||
$select-color-input-error: theme-color("danger") !default;
|
||||
$select-color-input-error-focus: darken(
|
||||
$select-color-input-error,
|
||||
10%
|
||||
) !default;
|
||||
$select-color-disabled: $input-bg !default;
|
||||
$select-color-item: RGBA($select-color-text, 0.1) !default;
|
||||
$select-color-item-border: $border-color !default;
|
||||
$select-color-item-active: $component-active-bg !default;
|
||||
$select-color-item-active-text: color-contrast($select-color-item-active) !default;
|
||||
$select-color-item-active-border: rgba(0, 0, 0, 0) !default;
|
||||
$select-color-optgroup: $dropdown-bg !default;
|
||||
$select-color-optgroup-text: $dropdown-header-color !default;
|
||||
$select-color-optgroup-border: $dropdown-divider-bg !default;
|
||||
$select-color-dropdown: $dropdown-bg !default;
|
||||
$select-color-dropdown-border-top: mix(
|
||||
$input-border-color,
|
||||
$input-bg,
|
||||
80%
|
||||
) !default;
|
||||
$select-color-dropdown-item-active: $dropdown-link-hover-bg !default;
|
||||
$select-color-dropdown-item-active-text: $dropdown-link-hover-color !default;
|
||||
$select-color-dropdown-item-create-active-text: $dropdown-link-hover-color !default;
|
||||
$select-opacity-disabled: 0.5 !default;
|
||||
$select-shadow-input: none !default;
|
||||
$select-shadow-input-focus: inset 0 1px 2px rgba(0, 0, 0, 0.15) !default;
|
||||
$select-shadow-input-error: inset 0 1px 1px rgba(0, 0, 0, 0.075) !default;
|
||||
$select-shadow-input-error-focus: inset 0 1px 1px rgba(0, 0, 0, 0.075),
|
||||
0 0 6px lighten($select-color-input-error, 20%) !default;
|
||||
$select-border: 1px solid $input-border-color !default;
|
||||
$select-border-radius: $input-border-radius !default;
|
||||
|
||||
$selectize-width-item-border: 0px !default;
|
||||
$selectize-padding-x: $input-btn-padding-x !default;
|
||||
$selectize-padding-y: $input-btn-padding-y !default;
|
||||
$selectize-padding-dropdown-item-x: $input-btn-padding-x !default;
|
||||
$selectize-padding-dropdown-item-y: 3px !default;
|
||||
$selectize-padding-item-x: 3px !default;
|
||||
$selectize-padding-item-y: 1px !default;
|
||||
$selectize-margin-item-x: 3px !default;
|
||||
$selectize-margin-item-y: 3px !default;
|
||||
$selectize-caret-margin: 0 !default;
|
||||
|
||||
$selectize-arrow-size: 5px !default;
|
||||
$selectize-arrow-color: $selectize-color-text !default;
|
||||
$selectize-arrow-offset: calc(#{$selectize-padding-x} + 5px) !default;
|
||||
$select-width-item-border: 0px !default;
|
||||
$select-padding-x: $input-btn-padding-x !default;
|
||||
$select-padding-y: $input-btn-padding-y !default;
|
||||
$select-padding-dropdown-item-x: $input-btn-padding-x !default;
|
||||
$select-padding-dropdown-item-y: 3px !default;
|
||||
$select-padding-item-x: 5px !default;
|
||||
$select-padding-item-y: 1px !default;
|
||||
$select-margin-item-x: 3px !default;
|
||||
$select-margin-item-y: 3px !default;
|
||||
|
||||
$select-arrow-size: 5px !default;
|
||||
$select-arrow-color: $select-color-text !default;
|
||||
$select-arrow-offset: calc(#{$select-padding-x} + 5px) !default;
|
||||
|
||||
@import "selectize";
|
||||
|
||||
//Import Plugins
|
||||
@import "plugins/drag_drop";
|
||||
@import "plugins/dropdown_header";
|
||||
@import "plugins/optgroup_columns";
|
||||
@import "plugins/remove_button";
|
||||
|
||||
.selectize-dropdown, .selectize-dropdown.form-control {
|
||||
.#{$selectize}-dropdown,
|
||||
.#{$selectize}-dropdown.form-control {
|
||||
height: auto;
|
||||
padding: 0;
|
||||
margin: 2px 0 0 0;
|
||||
z-index: $zindex-dropdown;
|
||||
background: $selectize-color-dropdown;
|
||||
color: $selectize-color-dropdown-text;
|
||||
background: $select-color-dropdown;
|
||||
border: 1px solid $dropdown-border-color; //$dropdown-fallback-border
|
||||
@include selectize-border-radius($border-radius);
|
||||
@include selectize-box-shadow(0 6px 12px rgba(0,0,0,.175));
|
||||
border-radius: $border-radius;
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
||||
}
|
||||
|
||||
.selectize-dropdown {
|
||||
.#{$selectize}-dropdown {
|
||||
.optgroup-header {
|
||||
font-size: $font-size-sm;
|
||||
line-height: $line-height-base;
|
||||
font-size: $font-size-sm;
|
||||
line-height: $line-height-base;
|
||||
}
|
||||
.optgroup:first-child:before {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
.optgroup:before {
|
||||
content: ' ';
|
||||
display: block;
|
||||
height: 0;
|
||||
margin: $dropdown-divider-margin-y 0;
|
||||
overflow: hidden;
|
||||
border-top: 1px solid $dropdown-divider-bg;
|
||||
margin-left: $selectize-padding-dropdown-item-x * -1;
|
||||
margin-right: $selectize-padding-dropdown-item-x * -1;
|
||||
content: " ";
|
||||
display: block;
|
||||
height: 0;
|
||||
margin: $dropdown-divider-margin-y 0;
|
||||
overflow: hidden;
|
||||
border-top: 1px solid $dropdown-divider-bg;
|
||||
margin-left: $select-padding-dropdown-item-x * -1;
|
||||
margin-right: $select-padding-dropdown-item-x * -1;
|
||||
}
|
||||
|
||||
.create {
|
||||
padding-left: $selectize-padding-dropdown-item-x;
|
||||
padding-left: $select-padding-dropdown-item-x;
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-dropdown-content {
|
||||
.#{$selectize}-dropdown-content {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.selectize-dropdown-header {
|
||||
padding: $selectize-padding-dropdown-item-y * 2 $selectize-padding-dropdown-item-x;
|
||||
.#{$selectize}-dropdown-emptyoptionlabel {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.selectize-input {
|
||||
.#{$selectize}-input {
|
||||
min-height: $input-height;
|
||||
@include box-shadow($input-box-shadow);
|
||||
@include transition($input-transition);
|
||||
|
||||
&.dropdown-active {
|
||||
@include selectize-border-radius($selectize-border-radius);
|
||||
border-radius: $select-border-radius;
|
||||
}
|
||||
&.dropdown-active::before {
|
||||
display: none;
|
||||
@@ -128,22 +122,21 @@ $selectize-arrow-offset: calc(#{$selectize-padding-x} + 5px) !default;
|
||||
}
|
||||
}
|
||||
|
||||
.is-invalid .selectize-input {
|
||||
border-color: $selectize-color-input-error;
|
||||
@include selectize-box-shadow($selectize-shadow-input-error);
|
||||
.is-invalid .#{$selectize}-input {
|
||||
border-color: $select-color-input-error;
|
||||
box-shadow: $select-shadow-input-error;
|
||||
|
||||
&:focus {
|
||||
border-color: $selectize-color-input-error-focus;
|
||||
// @include selectize-box-shadow(none)
|
||||
@include selectize-box-shadow($selectize-shadow-input-error-focus);
|
||||
border-color: $select-color-input-error-focus;
|
||||
box-shadow: $select-shadow-input-error-focus;
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-control {
|
||||
&.form-control-sm{
|
||||
.selectize-input.has-items{
|
||||
.#{$selectize}-control {
|
||||
&.form-control-sm {
|
||||
.#{$selectize}-input.has-items {
|
||||
min-height: $input-height-sm !important;
|
||||
height: $input-height-sm !important;
|
||||
height: $input-height-sm;
|
||||
padding: $input-padding-y-sm $input-padding-x-sm !important;
|
||||
font-size: $input-font-size-sm;
|
||||
line-height: $input-line-height-sm;
|
||||
@@ -151,26 +144,53 @@ $selectize-arrow-offset: calc(#{$selectize-padding-x} + 5px) !default;
|
||||
}
|
||||
|
||||
&.multi {
|
||||
.selectize-input.has-items {
|
||||
padding-left: calc(#{$selectize-padding-x} - #{$selectize-padding-item-x});
|
||||
padding-right: calc(#{$selectize-padding-x} - #{$selectize-padding-item-x});
|
||||
}
|
||||
.selectize-input > div {
|
||||
@include selectize-border-radius(calc(#{$selectize-border-radius} - 1px));
|
||||
}
|
||||
.#{$selectize}-input.has-items {
|
||||
height: auto;
|
||||
padding-left: calc(#{$select-padding-x} - #{$select-padding-item-x});
|
||||
padding-right: calc(#{$select-padding-x} - #{$select-padding-item-x});
|
||||
}
|
||||
.#{$selectize}-input > div {
|
||||
border-radius: calc(#{$select-border-radius} - 1px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-control.selectize-control {
|
||||
.form-control.#{$selectize}-control {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
border: none;
|
||||
background: none;
|
||||
@include selectize-box-shadow(none);
|
||||
@include selectize-border-radius(0);
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.input-group .selectize-input {
|
||||
overflow: unset;
|
||||
@include selectize-border-radius(0 $selectize-border-radius $selectize-border-radius 0);
|
||||
.input-group .#{$selectize}-control:not(:last-child) {
|
||||
.#{$selectize}-input{
|
||||
overflow: unset;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group .#{$selectize}-control:not(:first-child) {
|
||||
.#{$selectize}-input{
|
||||
overflow: unset;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// .input-group .#{$selectize}-input {
|
||||
// overflow: unset;
|
||||
// border-radius: 0 $select-border-radius $select-border-radius 0;
|
||||
// }
|
||||
|
||||
.#{selectize}-dropdown.plugin-auto_position.#{$selectize}-position-top {
|
||||
border-top: $select-border!important;
|
||||
border-bottom: $select-border!important;
|
||||
border-radius: $select-border-radius!important;
|
||||
}
|
||||
.#{selectize}-control.plugin-auto_position .#{selectize}-input.#{$selectize}-position-top.dropdown-active {
|
||||
border-radius: $select-border-radius!important;
|
||||
border-top: $select-border!important;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,200 @@
|
||||
$input-line-height-sm: $form-select-line-height !default;
|
||||
@import 'selectize.bootstrap4';
|
||||
.selectize-control{padding:0;}
|
||||
|
||||
$enable-shadows: true !default;
|
||||
$select-font-family: if($input-btn-font-family, $input-btn-font-family, inherit) !default;
|
||||
$select-font-size: $input-btn-font-size !default;
|
||||
$select-line-height: $input-btn-line-height !default; //formerly line-height-computed
|
||||
|
||||
$select-color-rgb: var(--bs-emphasis-color-rgb, 0, 0, 0) !default;
|
||||
$select-color-text: RGBA($select-color-rgb, 0.83) !default;
|
||||
$select-color-highlight: rgba(255, 237, 40, 0.4) !default;
|
||||
$select-color-input: $input-bg !default;
|
||||
$select-color-input-full: $input-bg !default;
|
||||
$select-color-input-error: $danger !default;
|
||||
$select-color-input-error-focus: darken(
|
||||
$select-color-input-error,
|
||||
10%
|
||||
) !default;
|
||||
$select-color-disabled: $input-bg !default;
|
||||
$select-color-item: RGBA($select-color-rgb, 0.05) !default;
|
||||
$select-color-item-border: $border-color !default;
|
||||
$select-color-item-active: $component-active-bg !default;
|
||||
$select-color-item-active-text: color-contrast($select-color-item-active) !default;
|
||||
$select-color-item-active-border: rgba(0, 0, 0, 0) !default;
|
||||
$select-color-optgroup: $dropdown-bg !default;
|
||||
$select-color-optgroup-text: $dropdown-header-color !default;
|
||||
$select-color-optgroup-border: $dropdown-divider-bg !default;
|
||||
$select-color-dropdown: $dropdown-bg !default;
|
||||
$select-color-dropdown-border-top: rgba($input-border-color, 0.8) !default;
|
||||
$select-color-dropdown-item-active: $dropdown-link-hover-bg !default;
|
||||
$select-color-dropdown-item-active-text: $dropdown-link-hover-color !default;
|
||||
$select-color-dropdown-item-create-active-text: $dropdown-link-hover-color !default;
|
||||
$select-opacity-disabled: 0.5 !default;
|
||||
$select-shadow-input: none !default;
|
||||
$select-shadow-input-focus: inset 0 1px 2px rgba(0, 0, 0, 0.15) !default;
|
||||
$select-shadow-input-error: inset 0 1px 1px rgba(0, 0, 0, 0.075) !default;
|
||||
$select-shadow-input-error-focus: inset 0 1px 1px rgba(0, 0, 0, 0.075),
|
||||
0 0 6px lighten($select-color-input-error, 20%) !default;
|
||||
$select-border: 1px solid $input-border-color !default;
|
||||
$select-border-radius: $input-border-radius !default;
|
||||
|
||||
$select-width-item-border: 0px !default;
|
||||
$select-padding-x: $input-btn-padding-x !default;
|
||||
$select-padding-y: $input-btn-padding-y !default;
|
||||
$select-padding-dropdown-item-x: $input-btn-padding-x !default;
|
||||
$select-padding-dropdown-item-y: 3px !default;
|
||||
$select-padding-item-x: 5px !default;
|
||||
$select-padding-item-y: 1px !default;
|
||||
$select-margin-item-x: 3px !default;
|
||||
$select-margin-item-y: 3px !default;
|
||||
|
||||
$select-arrow-size: 5px !default;
|
||||
$select-arrow-color: $select-color-text !default;
|
||||
$select-arrow-offset: calc(#{$select-padding-x} + 5px) !default;
|
||||
|
||||
@import "selectize";
|
||||
|
||||
.#{$selectize}-dropdown,
|
||||
.#{$selectize}-dropdown.form-control {
|
||||
height: auto;
|
||||
padding: 0;
|
||||
margin: 2px 0 0 0;
|
||||
z-index: $zindex-dropdown;
|
||||
background: $select-color-dropdown;
|
||||
border: 1px solid $dropdown-border-color; //$dropdown-fallback-border
|
||||
border-radius: $border-radius;
|
||||
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
||||
}
|
||||
|
||||
.#{$selectize}-dropdown {
|
||||
.optgroup-header {
|
||||
font-size: $font-size-sm;
|
||||
line-height: $line-height-base;
|
||||
}
|
||||
.optgroup:first-child:before {
|
||||
display: none;
|
||||
}
|
||||
.optgroup:before {
|
||||
content: " ";
|
||||
display: block;
|
||||
height: 0;
|
||||
margin: $dropdown-divider-margin-y 0;
|
||||
overflow: hidden;
|
||||
border-top: 1px solid $dropdown-divider-bg;
|
||||
margin-left: $select-padding-dropdown-item-x * -1;
|
||||
margin-right: $select-padding-dropdown-item-x * -1;
|
||||
}
|
||||
|
||||
.create {
|
||||
padding-left: $select-padding-dropdown-item-x;
|
||||
}
|
||||
}
|
||||
|
||||
.#{$selectize}-dropdown-content {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.#{$selectize}-dropdown-emptyoptionlabel {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.#{$selectize}-input {
|
||||
min-height: $input-height;
|
||||
@include box-shadow($input-box-shadow);
|
||||
@include transition($input-transition);
|
||||
|
||||
&.dropdown-active {
|
||||
border-radius: $select-border-radius;
|
||||
}
|
||||
&.dropdown-active::before {
|
||||
display: none;
|
||||
}
|
||||
&.focus {
|
||||
border-color: $input-focus-border-color;
|
||||
outline: 0;
|
||||
@if $enable-shadows {
|
||||
box-shadow: $input-box-shadow, $input-focus-box-shadow;
|
||||
} @else {
|
||||
box-shadow: $input-focus-box-shadow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.is-invalid .#{$selectize}-input {
|
||||
border-color: $select-color-input-error;
|
||||
box-shadow: $select-shadow-input-error;
|
||||
|
||||
&:focus {
|
||||
border-color: $select-color-input-error-focus;
|
||||
box-shadow: $select-shadow-input-error-focus;
|
||||
}
|
||||
}
|
||||
|
||||
.#{$selectize}-control {
|
||||
&.form-control-sm {
|
||||
.#{$selectize}-input {
|
||||
min-height: $input-height-sm !important;
|
||||
height: $input-height-sm;
|
||||
padding: $input-padding-y-sm $input-padding-x-sm !important;
|
||||
font-size: $input-font-size-sm;
|
||||
line-height: $line-height-sm;
|
||||
}
|
||||
}
|
||||
|
||||
&.multi {
|
||||
.#{$selectize}-input {
|
||||
height: auto;
|
||||
padding-left: calc(#{$select-padding-x} - #{$select-padding-item-x});
|
||||
padding-right: calc(#{$select-padding-x} - #{$select-padding-item-x});
|
||||
}
|
||||
.#{$selectize}-input > div {
|
||||
border-radius: calc(#{$select-border-radius} - 1px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-select.#{$selectize}-control,
|
||||
.form-control.#{$selectize}-control {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
border: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.input-group>.input-group-append>.btn, .input-group>.form-control:not(:first-child) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.input-group>.input-group-prepend>.btn {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
.input-group .#{$selectize}-control:not(:last-child) {
|
||||
.#{$selectize}-input{
|
||||
overflow: unset;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-group .#{$selectize}-control:not(:first-child) {
|
||||
.#{$selectize}-input{
|
||||
overflow: unset;
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.#{selectize}-dropdown.plugin-auto_position.#{$selectize}-position-top {
|
||||
border-top: $select-border!important;
|
||||
border-bottom: $select-border!important;
|
||||
border-radius: $select-border-radius!important;
|
||||
}
|
||||
.#{selectize}-control.plugin-auto_position .#{selectize}-input.#{$selectize}-position-top.dropdown-active {
|
||||
border-radius: $select-border-radius!important;
|
||||
border-top: $select-border!important;
|
||||
}
|
||||
|
||||
@@ -1,84 +1,71 @@
|
||||
/**
|
||||
* selectize.default.css (v$$version) - Default Theme
|
||||
* Copyright (c) 2013–2015 Brian Reavis & contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
||||
* file except in compliance with the License. You may obtain a copy of the License at:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under
|
||||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
* ANY KIND, either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*
|
||||
* $author Brian Reavis <brian$thirdroute.com>
|
||||
*/
|
||||
$select-color-item: #1da7ee;
|
||||
$select-color-item-text: #fff;
|
||||
$select-color-item-active-text: #fff;
|
||||
$select-color-item-border: #0073bb;
|
||||
$select-color-item-active: #92c836;
|
||||
$select-color-item-active-border: #00578d;
|
||||
$select-width-item-border: 1px;
|
||||
|
||||
@import "selectize";
|
||||
@import "selectize.scss";
|
||||
|
||||
$selectize-color-item: #1da7ee;
|
||||
$selectize-color-item-text: #fff;
|
||||
$selectize-color-item-active-text: #fff;
|
||||
$selectize-color-item-border: #0073bb;
|
||||
$selectize-color-item-active: #92c836;
|
||||
$selectize-color-item-active-border: #00578d;
|
||||
$selectize-width-item-border: 1px;
|
||||
$selectize-caret-margin: 0 1px;
|
||||
|
||||
.selectize-control {
|
||||
.#{$selectize}-control {
|
||||
&.multi {
|
||||
.selectize-input {
|
||||
&.has-items {
|
||||
$padding-x: $selectize-padding-x - 3px;
|
||||
padding-left: $padding-x;
|
||||
padding-right: $padding-x;
|
||||
}
|
||||
&.disabled [data-value] {
|
||||
color: #999;
|
||||
text-shadow: none;
|
||||
background: none;
|
||||
@include selectize-box-shadow(none);
|
||||
.#{$selectize}-input {
|
||||
&.has-items {
|
||||
$padding-x: $select-padding-x - 3px;
|
||||
padding-left: $padding-x;
|
||||
padding-right: $padding-x;
|
||||
}
|
||||
&.disabled [data-value] {
|
||||
color: #999;
|
||||
text-shadow: none;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
|
||||
&, .remove {
|
||||
border-color: #e6e6e6;
|
||||
}
|
||||
.remove {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
[data-value] {
|
||||
text-shadow: 0 1px 0 rgba(0,51,83,0.3);
|
||||
@include selectize-border-radius(3px);
|
||||
@include selectize-vertical-gradient(#1da7ee, #178ee9);
|
||||
@include selectize-box-shadow(#{"0 1px 0 rgba(0,0,0,0.2),inset 0 1px rgba(255,255,255,0.03)"});
|
||||
&.active {
|
||||
@include selectize-vertical-gradient(#008fd8, #0075cf);
|
||||
}
|
||||
}
|
||||
}
|
||||
&,
|
||||
.remove {
|
||||
border-color: #e6e6e6;
|
||||
}
|
||||
.remove {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
[data-value] {
|
||||
text-shadow: 0 1px 0 rgba(0, 51, 83, 0.3);
|
||||
border-radius: 3px;
|
||||
@include selectize-vertical-gradient(#1da7ee, #178ee9);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2),
|
||||
inset 0 1px rgba(255, 255, 255, 0.03);
|
||||
&.active {
|
||||
@include selectize-vertical-gradient(#008fd8, #0075cf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.single {
|
||||
.selectize-input {
|
||||
@include selectize-box-shadow(#{"0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.8)"});
|
||||
@include selectize-vertical-gradient(#fefefe, #f2f2f2);
|
||||
}
|
||||
.#{$selectize}-input {
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
||||
@include selectize-vertical-gradient(#fefefe, #f2f2f2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-control.single .selectize-input, .selectize-dropdown.single {
|
||||
.#{$selectize}-control.single .#{$selectize}-input,
|
||||
.#{$selectize}-dropdown.single {
|
||||
border-color: #b8b8b8;
|
||||
}
|
||||
|
||||
.selectize-dropdown {
|
||||
.#{$selectize}-dropdown {
|
||||
.optgroup-header {
|
||||
padding-top: $selectize-padding-dropdown-item-y + 2px;
|
||||
font-weight: bold;
|
||||
font-size: 0.85em;
|
||||
padding-top: $select-padding-dropdown-item-y + 2px;
|
||||
font-weight: bold;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
.optgroup {
|
||||
border-top: 1px solid $selectize-color-dropdown-border-top;
|
||||
&:first-child {
|
||||
border-top: 0 none;
|
||||
}
|
||||
border-top: 1px solid $select-color-dropdown-border-top;
|
||||
&:first-child {
|
||||
border-top: 0 none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,300 +1,364 @@
|
||||
@use "sass:math";
|
||||
|
||||
// base styles
|
||||
$selectize: "selectize" !default;
|
||||
$select-font-family: inherit !default;
|
||||
$select-font-smoothing: inherit !default;
|
||||
$select-font-size: 13px !default;
|
||||
$select-line-height: 18px !default;
|
||||
|
||||
$selectize-font-family: inherit !default;
|
||||
$selectize-font-smoothing: inherit !default;
|
||||
$selectize-font-size: 13px !default;
|
||||
$selectize-line-height: 18px !default;
|
||||
$select-color-rgb: 0,0,0 !default;
|
||||
$select-color-text: RGBA($select-color-rgb, 0.83) !default;
|
||||
$select-color-border: #d0d0d0 !default;
|
||||
$select-color-highlight: rgba(125, 168, 208, 0.2) !default;
|
||||
$select-color-input: #fff !default;
|
||||
$select-color-input-full: $select-color-input !default;
|
||||
$select-color-disabled: #fafafa !default;
|
||||
$select-color-item: #f2f2f2 !default;
|
||||
$select-color-item-text: $select-color-text !default;
|
||||
$select-color-item-border: #d0d0d0 !default;
|
||||
$select-color-item-active: #e8e8e8 !default;
|
||||
$select-color-item-active-text: $select-color-text !default;
|
||||
$select-color-item-active-border: #cacaca !default;
|
||||
$select-color-dropdown: #fff !default;
|
||||
$select-color-dropdown-border: $select-color-border !default;
|
||||
$select-color-dropdown-border-top: #f0f0f0 !default;
|
||||
$select-color-dropdown-item-active: #f5fafd !default;
|
||||
$select-color-dropdown-item-active-text: #495c68 !default;
|
||||
$select-color-dropdown-item-create-text: RGBA($select-color-rgb, 0.5) !default;
|
||||
$select-color-dropdown-item-create-active-text: $select-color-dropdown-item-active-text !default;
|
||||
$select-color-optgroup: $select-color-dropdown !default;
|
||||
$select-color-optgroup-text: $select-color-text !default;
|
||||
$select-lighten-disabled-item: 30% !default;
|
||||
$select-lighten-disabled-item-text: 30% !default;
|
||||
$select-lighten-disabled-item-border: 30% !default;
|
||||
$select-opacity-disabled: 0.5 !default;
|
||||
|
||||
$selectize-color-text: #303030 !default;
|
||||
$selectize-color-border: #d0d0d0 !default;
|
||||
$selectize-color-highlight: rgba(125,168,208,0.2) !default;
|
||||
$selectize-color-input: #fff !default;
|
||||
$selectize-color-input-full: $selectize-color-input !default;
|
||||
$selectize-color-disabled: #fafafa !default;
|
||||
$selectize-color-item: #f2f2f2 !default;
|
||||
$selectize-color-item-text: $selectize-color-text !default;
|
||||
$selectize-color-item-border: #d0d0d0 !default;
|
||||
$selectize-color-item-active: #e8e8e8 !default;
|
||||
$selectize-color-item-active-text: $selectize-color-text !default;
|
||||
$selectize-color-item-active-border: #cacaca !default;
|
||||
$selectize-color-dropdown: #fff !default;
|
||||
$selectize-color-dropdown-border: $selectize-color-border !default;
|
||||
$selectize-color-dropdown-border-top: #f0f0f0 !default;
|
||||
$selectize-color-dropdown-item-active: #f5fafd !default;
|
||||
$selectize-color-dropdown-item-active-text: #495c68 !default;
|
||||
$selectize-color-dropdown-item-create-text: rgba(red($selectize-color-text), green($selectize-color-text), blue($selectize-color-text), 0.5) !default;
|
||||
$selectize-color-dropdown-item-create-active-text: $selectize-color-dropdown-item-active-text !default;
|
||||
$selectize-color-optgroup: $selectize-color-dropdown !default;
|
||||
$selectize-color-optgroup-text: $selectize-color-text !default;
|
||||
$selectize-lighten-disabled-item: 30% !default;
|
||||
$selectize-lighten-disabled-item-text: 30% !default;
|
||||
$selectize-lighten-disabled-item-border: 30% !default;
|
||||
$selectize-opacity-disabled: 0.5 !default;
|
||||
$select-shadow-input: inset 0 1px 1px rgba(0, 0, 0, 0.1) !default;
|
||||
$select-shadow-input-focus: inset 0 1px 2px rgba(0, 0, 0, 0.15) !default;
|
||||
$select-border: 1px solid $select-color-border !default;
|
||||
$select-dropdown-border: 1px solid $select-color-dropdown-border !default;
|
||||
$select-border-radius: 3px !default;
|
||||
|
||||
$selectize-shadow-input: inset 0 1px 1px rgba(0,0,0,0.1) !default;
|
||||
$selectize-shadow-input-focus: inset 0 1px 2px rgba(0,0,0,0.15) !default;
|
||||
$selectize-border: 1px solid $selectize-color-border !default;
|
||||
$selectize-dropdown-border: 1px solid $selectize-color-dropdown-border !default;
|
||||
$selectize-border-radius: 3px !default;
|
||||
$select-width-item-border: 0px !default;
|
||||
$select-max-height-dropdown: 200px !default;
|
||||
|
||||
$selectize-width-item-border: 0 !default;
|
||||
$selectize-max-height-dropdown: 200px !default;
|
||||
$select-padding-x: 8px !default;
|
||||
$select-padding-y: 8px !default;
|
||||
$select-padding-item-x: 6px !default;
|
||||
$select-padding-item-y: 2px !default;
|
||||
$select-padding-dropdown-item-x: $select-padding-x !default;
|
||||
$select-padding-dropdown-item-y: 5px !default;
|
||||
$select-margin-item-x: 3px !default;
|
||||
$select-margin-item-y: 3px !default;
|
||||
|
||||
$selectize-padding-x: 8px !default;
|
||||
$selectize-padding-y: 8px !default;
|
||||
$selectize-padding-item-x: 6px !default;
|
||||
$selectize-padding-item-y: 2px !default;
|
||||
$selectize-padding-dropdown-item-x: $selectize-padding-x !default;
|
||||
$selectize-padding-dropdown-item-y: 5px !default;
|
||||
$selectize-margin-item-x: 3px !default;
|
||||
$selectize-margin-item-y: 3px !default;
|
||||
$select-arrow-size: 5px !default;
|
||||
$select-arrow-color: #808080 !default;
|
||||
$select-arrow-offset: 15px !default;
|
||||
|
||||
$selectize-arrow-size: 5px !default;
|
||||
$selectize-arrow-color: #808080 !default;
|
||||
$selectize-arrow-offset: 15px !default;
|
||||
$select-caret-margin: 0 0px !default;
|
||||
$select-caret-margin-rtl: 0 4px 0 -2px !default;
|
||||
|
||||
$selectize-caret-margin: 0 2px 0 0 !default;
|
||||
$selectize-caret-margin-rtl: 0 4px 0 -2px !default;
|
||||
$select-spinner-size: 30px;
|
||||
$select-spinner-border-size: 5px;
|
||||
$select-spinner-border-color: $select-color-border;
|
||||
|
||||
@mixin selectize-border-radius($radii){
|
||||
@if mixin-exists("border-radius") {
|
||||
@include border-radius($radii)
|
||||
} @else {
|
||||
border-radius: $radii;
|
||||
}
|
||||
}
|
||||
@mixin selectize-unselectable(){
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
@mixin selectize-box-shadow($shadow){
|
||||
-webkit-box-shadow: $shadow;
|
||||
box-shadow: $shadow;
|
||||
}
|
||||
@mixin selectize-box-sizing($type: border-box){
|
||||
-webkit-box-sizing: $type;
|
||||
-moz-box-sizing: $type;
|
||||
box-sizing: $type;
|
||||
}
|
||||
@mixin selectize-vertical-gradient($color-top, $color-bottom){
|
||||
@mixin selectize-vertical-gradient($color-top, $color-bottom) {
|
||||
background-color: mix($color-top, $color-bottom, 60%);
|
||||
background-image: -moz-linear-gradient(top, $color-top, $color-bottom); // FF 3.6+
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from($color-top), to($color-bottom)); // Safari 4+, Chrome 2+
|
||||
background-image: -webkit-linear-gradient(top, $color-top, $color-bottom); // Safari 5.1+, Chrome 10+
|
||||
background-image: -o-linear-gradient(top, $color-top, $color-bottom); // Opera 11.10
|
||||
background-image: linear-gradient(to bottom, $color-top, $color-bottom); // Standard, IE10
|
||||
background-image: linear-gradient(to bottom, $color-top, $color-bottom);
|
||||
background-repeat: repeat-x;
|
||||
//filter: e(%("progid:DXImageTransform.Microsoft@include gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb($color-top),argb($color-bottom))); // IE9 and down
|
||||
}
|
||||
|
||||
.selectize-control {
|
||||
@import "plugins/drag_drop.scss";
|
||||
@import "plugins/dropdown_header.scss";
|
||||
@import "plugins/optgroup_columns.scss";
|
||||
@import "plugins/remove_button.scss";
|
||||
@import "plugins/clear_button.scss";
|
||||
@import "plugins/auto_position.scss";
|
||||
|
||||
.#{$selectize}-control {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.selectize-dropdown, .selectize-input, .selectize-input input {
|
||||
color: $selectize-color-text;
|
||||
font-family: $selectize-font-family;
|
||||
font-size: $selectize-font-size;
|
||||
line-height: $selectize-line-height;
|
||||
-webkit-font-smoothing: $selectize-font-smoothing;
|
||||
.#{$selectize}-dropdown,
|
||||
.#{$selectize}-input,
|
||||
.#{$selectize}-input input {
|
||||
color: $select-color-text;
|
||||
font-family: $select-font-family;
|
||||
font-size: $select-font-size;
|
||||
line-height: $select-line-height;
|
||||
font-smoothing: $select-font-smoothing;
|
||||
}
|
||||
|
||||
.selectize-input, .selectize-control.single .selectize-input.input-active {
|
||||
background: $selectize-color-input;
|
||||
.#{$selectize}-input,
|
||||
.#{$selectize}-control.single .#{$selectize}-input.input-active {
|
||||
background: $select-color-input;
|
||||
cursor: text;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.selectize-input {
|
||||
border: $selectize-border;
|
||||
padding: $selectize-padding-y $selectize-padding-x;
|
||||
.#{$selectize}-input {
|
||||
border: $select-border;
|
||||
padding: $select-padding-y $select-padding-x;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
// overflow: hidden;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
@include selectize-box-sizing(border-box);
|
||||
@include selectize-box-shadow($selectize-shadow-input);
|
||||
@include selectize-border-radius($selectize-border-radius);
|
||||
box-sizing: border-box;
|
||||
box-shadow: $select-shadow-input;
|
||||
border-radius: $select-border-radius;
|
||||
|
||||
.selectize-control.multi &.has-items {
|
||||
$padding-x: $selectize-padding-x;
|
||||
$padding-top: calc(#{$selectize-padding-y} - #{$selectize-padding-item-y} - #{$selectize-width-item-border});
|
||||
$padding-bottom: calc(#{$selectize-padding-y} - #{$selectize-padding-item-y} - #{$selectize-margin-item-y} - #{$selectize-width-item-border});
|
||||
padding: $padding-top $padding-x $padding-bottom;
|
||||
.#{$selectize}-control.multi &.has-items {
|
||||
$padding-x: $select-padding-x;
|
||||
$padding-top: calc(
|
||||
#{$select-padding-y} - #{$select-padding-item-y} - #{$select-width-item-border}
|
||||
);
|
||||
$padding-bottom: calc(
|
||||
#{$select-padding-y} - #{$select-padding-item-y} - #{$select-margin-item-y} -
|
||||
#{$select-width-item-border}
|
||||
);
|
||||
padding: $padding-top $padding-x $padding-bottom;
|
||||
}
|
||||
|
||||
&.full {
|
||||
background-color: $selectize-color-input-full;
|
||||
background-color: $select-color-input-full;
|
||||
}
|
||||
&.disabled, &.disabled * {
|
||||
cursor: default !important;
|
||||
&.disabled,
|
||||
&.disabled * {
|
||||
cursor: default !important;
|
||||
}
|
||||
&.focus {
|
||||
@include selectize-box-shadow($selectize-shadow-input-focus);
|
||||
box-shadow: $select-shadow-input-focus;
|
||||
}
|
||||
&.dropdown-active {
|
||||
@include selectize-border-radius($selectize-border-radius $selectize-border-radius 0 0);
|
||||
border-radius: $select-border-radius $select-border-radius 0 0;
|
||||
}
|
||||
|
||||
> * {
|
||||
vertical-align: baseline;
|
||||
display: -moz-inline-stack;
|
||||
display: inline-block;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
vertical-align: baseline;
|
||||
display: inline-block;
|
||||
zoom: 1;
|
||||
}
|
||||
.selectize-control.multi & > div {
|
||||
cursor: pointer;
|
||||
margin: 0 $selectize-margin-item-x $selectize-margin-item-y 0;
|
||||
padding: $selectize-padding-item-y $selectize-padding-item-x;
|
||||
background: $selectize-color-item;
|
||||
color: $selectize-color-item-text;
|
||||
border: $selectize-width-item-border solid $selectize-color-item-border;
|
||||
.#{$selectize}-control.multi & > div {
|
||||
cursor: pointer;
|
||||
margin: 0 $select-margin-item-x $select-margin-item-y 0;
|
||||
padding: $select-padding-item-y $select-padding-item-x;
|
||||
background: $select-color-item;
|
||||
color: $select-color-item-text;
|
||||
border: $select-width-item-border solid $select-color-item-border;
|
||||
|
||||
&.active {
|
||||
background: $selectize-color-item-active;
|
||||
color: $selectize-color-item-active-text;
|
||||
border: $selectize-width-item-border solid $selectize-color-item-active-border;
|
||||
}
|
||||
&.active {
|
||||
background: $select-color-item-active;
|
||||
color: $select-color-item-active-text;
|
||||
border: $select-width-item-border solid $select-color-item-active-border;
|
||||
}
|
||||
}
|
||||
.selectize-control.multi &.disabled > div {
|
||||
&, &.active {
|
||||
color: lighten(desaturate($selectize-color-item-text, 100%), $selectize-lighten-disabled-item-text);
|
||||
background: lighten(desaturate($selectize-color-item, 100%), $selectize-lighten-disabled-item);
|
||||
border: $selectize-width-item-border solid lighten(desaturate($selectize-color-item-border, 100%), $selectize-lighten-disabled-item-border);
|
||||
}
|
||||
.#{$selectize}-control.multi &.disabled > div {
|
||||
&,
|
||||
&.active {
|
||||
color: lighten(gray, $select-lighten-disabled-item-text);
|
||||
background: lighten(gray, $select-lighten-disabled-item);
|
||||
border: $select-width-item-border solid
|
||||
lighten(gray, $select-lighten-disabled-item-border);
|
||||
}
|
||||
}
|
||||
> input {
|
||||
&::-ms-clear {
|
||||
display: none;
|
||||
}
|
||||
display: inline-block !important;
|
||||
padding: 0 !important;
|
||||
min-height: 0 !important;
|
||||
max-height: none !important;
|
||||
max-width: 100% !important;
|
||||
margin: $selectize-caret-margin !important;
|
||||
text-indent: 0 !important;
|
||||
border: 0 none !important;
|
||||
background: none !important;
|
||||
line-height: inherit !important;
|
||||
-webkit-user-select: auto !important;
|
||||
@include selectize-box-shadow(none);
|
||||
&:focus { outline: none !important; }
|
||||
&::-ms-clear {
|
||||
display: none;
|
||||
}
|
||||
display: inline-block !important;
|
||||
padding: 0 !important;
|
||||
min-height: 0 !important;
|
||||
max-height: none !important;
|
||||
max-width: 100% !important;
|
||||
margin: 0 !important;
|
||||
text-indent: 0 !important;
|
||||
border: 0 none !important;
|
||||
background: none !important;
|
||||
line-height: inherit !important;
|
||||
user-select: auto !important;
|
||||
box-shadow: none !important;
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
&[placeholder] {
|
||||
box-sizing: initial;
|
||||
}
|
||||
}
|
||||
&.has-items > input {
|
||||
margin: $select-caret-margin !important;
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-input::after {
|
||||
content: ' ';
|
||||
.#{$selectize}-input::after {
|
||||
content: " ";
|
||||
display: block;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
.selectize-input.dropdown-active::before {
|
||||
content: ' ';
|
||||
.#{$selectize}-input.dropdown-active::before {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
background: $selectize-color-dropdown-border-top;
|
||||
background: $select-color-dropdown-border-top;
|
||||
height: 1px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.selectize-dropdown {
|
||||
.#{$selectize}-dropdown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
border: $selectize-dropdown-border;
|
||||
background: $selectize-color-dropdown;
|
||||
|
||||
border: $select-dropdown-border;
|
||||
background: $select-color-dropdown;
|
||||
margin: -1px 0 0 0;
|
||||
border-top: 0 none;
|
||||
@include selectize-box-sizing(border-box);
|
||||
@include selectize-box-shadow(0 1px 3px rgba(0,0,0,0.1));
|
||||
@include selectize-border-radius(0 0 $selectize-border-radius $selectize-border-radius);
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0 0 $select-border-radius $select-border-radius;
|
||||
|
||||
[data-selectable] {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
.highlight {
|
||||
background: $selectize-color-highlight;
|
||||
@include selectize-border-radius(1px);
|
||||
}
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
.highlight {
|
||||
background: $select-color-highlight;
|
||||
border-radius: 1px;
|
||||
}
|
||||
}
|
||||
.option, .optgroup-header {
|
||||
padding: $selectize-padding-dropdown-item-y $selectize-padding-dropdown-item-x;
|
||||
.option,
|
||||
.optgroup-header,
|
||||
.no-results,
|
||||
.create {
|
||||
padding: $select-padding-dropdown-item-y $select-padding-dropdown-item-x;
|
||||
}
|
||||
.option, [data-disabled], [data-disabled] [data-selectable].option {
|
||||
cursor: inherit;
|
||||
opacity: 0.5;
|
||||
.option,
|
||||
[data-disabled],
|
||||
[data-disabled] [data-selectable].option {
|
||||
cursor: inherit;
|
||||
opacity: 0.5;
|
||||
}
|
||||
[data-selectable].option {
|
||||
opacity: 1;
|
||||
opacity: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
.optgroup:first-child .optgroup-header {
|
||||
border-top: 0 none;
|
||||
border-top: 0 none;
|
||||
}
|
||||
.optgroup-header {
|
||||
color: $selectize-color-optgroup-text;
|
||||
background: $selectize-color-optgroup;
|
||||
cursor: default;
|
||||
color: $select-color-optgroup-text;
|
||||
background: $select-color-optgroup;
|
||||
cursor: default;
|
||||
}
|
||||
.active {
|
||||
background-color: $selectize-color-dropdown-item-active;
|
||||
color: $selectize-color-dropdown-item-active-text;
|
||||
&.create {
|
||||
color: $selectize-color-dropdown-item-create-active-text;
|
||||
}
|
||||
background-color: $select-color-item-active;
|
||||
color: $select-color-item-active-text;
|
||||
&.create {
|
||||
color: $select-color-dropdown-item-create-active-text;
|
||||
}
|
||||
}
|
||||
|
||||
.selected {
|
||||
background-color: $select-color-item-active;
|
||||
color: $select-color-item-active-text;
|
||||
}
|
||||
.create {
|
||||
color: $selectize-color-dropdown-item-create-text;
|
||||
color: $select-color-dropdown-item-create-text;
|
||||
}
|
||||
|
||||
.active:not(.selected) {
|
||||
background: $select-color-dropdown-item-active;
|
||||
color: $select-color-dropdown-item-active-text;
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-dropdown-content {
|
||||
.#{$selectize}-dropdown-content {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
max-height: $selectize-max-height-dropdown;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
max-height: $select-max-height-dropdown;
|
||||
overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.selectize-control.single .selectize-input {
|
||||
&, input { cursor: pointer; }
|
||||
&.input-active, &.input-active input { cursor: text; }
|
||||
.#{$selectize}-dropdown-emptyoptionlabel {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.#{$selectize}-dropdown .spinner {
|
||||
display: inline-block;
|
||||
width: $select-spinner-size;
|
||||
height: $select-spinner-size;
|
||||
margin: $select-padding-dropdown-item-y $select-padding-dropdown-item-x;
|
||||
|
||||
&:after {
|
||||
content: ' ';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: $selectize-arrow-offset;
|
||||
margin-top: round((-1 * $selectize-arrow-size / 2));
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: $selectize-arrow-size $selectize-arrow-size 0 $selectize-arrow-size;
|
||||
border-color: $selectize-arrow-color transparent transparent transparent;
|
||||
content: " ";
|
||||
display: block;
|
||||
width: $select-spinner-size * 0.8;
|
||||
height: $select-spinner-size * 0.8;
|
||||
margin: $select-spinner-size * 0.1;
|
||||
border-radius: 50%;
|
||||
border: $select-spinner-border-size solid $select-spinner-border-color;
|
||||
border-color: $select-spinner-border-color transparent
|
||||
$select-spinner-border-color transparent;
|
||||
animation: lds-dual-ring 1.2s linear infinite;
|
||||
}
|
||||
&.dropdown-active:after {
|
||||
margin-top: $selectize-arrow-size * -0.8;
|
||||
border-width: 0 $selectize-arrow-size $selectize-arrow-size $selectize-arrow-size;
|
||||
border-color: transparent transparent $selectize-arrow-color transparent;
|
||||
@keyframes lds-dual-ring {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-control.rtl {
|
||||
&.single .selectize-input:after {
|
||||
left: $selectize-arrow-offset;
|
||||
right: auto;
|
||||
.#{$selectize}-control.single .#{$selectize}-input {
|
||||
&,
|
||||
input {
|
||||
cursor: pointer;
|
||||
}
|
||||
.selectize-input > input {
|
||||
margin: $selectize-caret-margin-rtl !important;
|
||||
&.input-active,
|
||||
&.input-active input:not(:read-only) {
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
&:not(.no-arrow):after {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: $select-arrow-offset;
|
||||
margin-top: round(divide(-1 * $select-arrow-size, 2));
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: $select-arrow-size $select-arrow-size 0 $select-arrow-size;
|
||||
border-color: $select-arrow-color transparent transparent transparent;
|
||||
}
|
||||
&:not(.no-arrow).dropdown-active:after {
|
||||
margin-top: $select-arrow-size * -0.8;
|
||||
border-width: 0 $select-arrow-size $select-arrow-size $select-arrow-size;
|
||||
border-color: transparent transparent $select-arrow-color transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.selectize-control .selectize-input.disabled {
|
||||
opacity: $selectize-opacity-disabled;
|
||||
background-color: $selectize-color-disabled;
|
||||
.#{$selectize}-control.rtl {
|
||||
text-align: right;
|
||||
&.single .#{$selectize}-input:after {
|
||||
left: $select-arrow-offset;
|
||||
right: auto;
|
||||
}
|
||||
.#{$selectize}-input > input {
|
||||
margin: $select-caret-margin-rtl !important;
|
||||
}
|
||||
}
|
||||
|
||||
.#{$selectize}-control .#{$selectize}-input.disabled {
|
||||
opacity: $select-opacity-disabled;
|
||||
background-color: $select-color-disabled;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
/*! shiny 1.7.3.9001 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
|
||||
/*! shiny 1.8.0.9000 | (c) 2012-2023 RStudio, PBC. | License: GPL-3 | file LICENSE */
|
||||
#showcase-well{border-radius:0}.shiny-code{background-color:#fff;margin-bottom:0}.shiny-code code{font-family:Menlo,Consolas,Courier New,monospace}.shiny-code-container{margin-top:20px;clear:both}.shiny-code-container h3{display:inline;margin-right:15px}.showcase-header{font-size:16px;font-weight:400}.showcase-code-link{text-align:right;padding:15px}#showcase-app-container{vertical-align:top}#showcase-code-tabs{margin-right:15px}#showcase-code-tabs pre{border:none;line-height:1em}#showcase-code-tabs .nav,#showcase-code-tabs ul{margin-bottom:0}#showcase-code-tabs .tab-content{border-style:solid;border-color:#e5e5e5;border-width:0px 1px 1px 1px;overflow:auto;border-bottom-right-radius:4px;border-bottom-left-radius:4px}#showcase-app-code{width:100%}#showcase-code-position-toggle{float:right}#showcase-sxs-code{padding-top:20px;vertical-align:top}.showcase-code-license{display:block;text-align:right}#showcase-code-content pre{background-color:#fff}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
/*! shiny 1.7.3.9001 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
|
||||
/*! shiny 1.8.0.9000 | (c) 2012-2023 RStudio, PBC. | License: GPL-3 | file LICENSE */
|
||||
"use strict";(function(){var a=eval;window.addEventListener("message",function(i){var e=i.data;e.code&&a(e.code)});})();
|
||||
//# sourceMappingURL=shiny-testmode.js.map
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../../srcts/src/utils/eval.ts", "../../../srcts/extras/shiny-testmode.ts"],
|
||||
"sourcesContent": ["//esbuild.github.io/content-types/#direct-eval\n//tl/dr;\n// * Direct usage of `eval(\"x\")` is bad with bundled code.\n// * Instead, use indirect calls to `eval` such as `indirectEval(\"x\")`\n// * Even just renaming the function works well enough.\n// > This is known as \"indirect eval\" because eval is not being called directly, and so does not trigger the grammatical special case for direct eval in the JavaScript VM. You can call indirect eval using any syntax at all except for an expression of the exact form eval('x'). For example, var eval2 = eval; eval2('x') and [eval][0]('x') and window.eval('x') are all indirect eval calls.\n// > When you use indirect eval, the code is evaluated in the global scope instead of in the inline scope of the caller.\nvar indirectEval = eval;\nexport { indirectEval };", "/* eslint-disable unicorn/filename-case */\nimport { indirectEval } from \"../src/utils/eval\"; // Listen for messages from parent frame. This file is only added when the\n// shiny.testmode option is TRUE.\n\nwindow.addEventListener(\"message\", function (e) {\n var message = e.data;\n if (message.code) indirectEval(message.code);\n});"],
|
||||
"mappings": ";yBAOA,IAAIA,EAAe,KCHnB,OAAO,iBAAiB,UAAW,SAAUC,EAAG,CAC9C,IAAIC,EAAUD,EAAE,KACZC,EAAQ,MAAMC,EAAaD,EAAQ,IAAI,CAC7C,CAAC",
|
||||
"sourcesContent": ["//esbuild.github.io/content-types/#direct-eval\n//tl/dr;\n// * Direct usage of `eval(\"x\")` is bad with bundled code.\n// * Instead, use indirect calls to `eval` such as `indirectEval(\"x\")`\n// * Even just renaming the function works well enough.\n// > This is known as \"indirect eval\" because eval is not being called directly, and so does not trigger the grammatical special case for direct eval in the JavaScript VM. You can call indirect eval using any syntax at all except for an expression of the exact form eval('x'). For example, var eval2 = eval; eval2('x') and [eval][0]('x') and window.eval('x') are all indirect eval calls.\n// > When you use indirect eval, the code is evaluated in the global scope instead of in the inline scope of the caller.\n\nvar indirectEval = eval;\nexport { indirectEval };", "/* eslint-disable unicorn/filename-case */\nimport { indirectEval } from \"../src/utils/eval\";\n\n// Listen for messages from parent frame. This file is only added when the\n// shiny.testmode option is TRUE.\nwindow.addEventListener(\"message\", function (e) {\n var message = e.data;\n if (message.code) indirectEval(message.code);\n});"],
|
||||
"mappings": ";yBAQA,IAAIA,EAAe,KCHnB,OAAO,iBAAiB,UAAW,SAAUC,EAAG,CAC9C,IAAIC,EAAUD,EAAE,KACZC,EAAQ,MAAMC,EAAaD,EAAQ,IAAI,CAC7C,CAAC",
|
||||
"names": ["indirectEval", "e", "message", "indirectEval"]
|
||||
}
|
||||
|
||||
20814
inst/www/shared/shiny.js
20814
inst/www/shared/shiny.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
4
inst/www/shared/shiny.min.css
vendored
4
inst/www/shared/shiny.min.css
vendored
File diff suppressed because one or more lines are too long
20
inst/www/shared/shiny.min.js
vendored
20
inst/www/shared/shiny.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,13 +1,7 @@
|
||||
$bg: $body-bg !default;
|
||||
$fg: $text-color !default; // BS3
|
||||
$theme-colors: ("primary": $brand-primary, "info": $brand-info, "warning": $brand-warning, "danger": $brand-danger) !default;
|
||||
|
||||
$fg: null !default;
|
||||
$theme-colors: null !default;
|
||||
@if variable-exists('text-color') {
|
||||
$fg: $text-color !default; // BS3
|
||||
$theme-colors: ("primary": $brand-primary, "info": $brand-info, "warning": $brand-warning, "danger": $brand-danger) !default;
|
||||
} @else {
|
||||
$fg: $body-color !default; // BS4
|
||||
}
|
||||
// No $border-width, $border-color, or $border-radius in BS3
|
||||
$border-width: 1px !default;
|
||||
$border-color: mix($bg, $fg, 70%) !default;
|
||||
@@ -16,7 +10,6 @@ $border-radius: $border-radius-base !default;
|
||||
$shiny-disconnected-bg: mix($bg, $fg, 58%) !default;
|
||||
$shiny-table-na: mix($bg, $fg, 54%) !default;
|
||||
$shiny-error-validated-color: mix($bg, $fg, 50%) !default;
|
||||
// TODO: what should this be? mix of primary and bg?
|
||||
$shiny-progress-text-bg-color: #eef8ff !default;
|
||||
$shiny-input-panel-bg: mix($bg, $fg, 96%) !default;
|
||||
$shiny-input-panel-border: $border-width solid $border-color !default;
|
||||
@@ -39,11 +32,3 @@ $notification-close-color: mix($bg, $fg, 20%) !default;
|
||||
$notification-close-hover-color: $fg !default;
|
||||
$notification-content-action-color: map-get($theme-colors, "primary") !default;
|
||||
$datepicker-disabled-color: $dropdown-link-disabled-color !default;
|
||||
|
||||
// I don't think BS3 has a file input box shadow setting
|
||||
@if variable-exists('custom-file-focus-box-shadow') {
|
||||
$shiny-file-active-shadow: $custom-file-focus-box-shadow !default;
|
||||
}
|
||||
|
||||
// TODO: should this be changed to danger?
|
||||
//$shiny-error-color: red !default;
|
||||
30
inst/www/shared/shiny_scss/shiny.bootstrap4.scss
Normal file
30
inst/www/shared/shiny_scss/shiny.bootstrap4.scss
Normal file
@@ -0,0 +1,30 @@
|
||||
$bg: $body-bg !default;
|
||||
$fg: $body-color !default;
|
||||
|
||||
$shiny-disconnected-bg: mix($bg, $fg, 58%) !default;
|
||||
$shiny-table-na: mix($bg, $fg, 54%) !default;
|
||||
$shiny-error-validated-color: mix($bg, $fg, 50%) !default;
|
||||
$shiny-progress-text-bg-color: #eef8ff !default;
|
||||
$shiny-input-panel-bg: mix($bg, $fg, 96%) !default;
|
||||
$shiny-input-panel-border: $border-width solid $border-color !default;
|
||||
$shiny-input-panel-border-radius: $border-radius !default;
|
||||
$shiny-text-output-border-radius: $border-radius !default;
|
||||
$notification-bg-color: mix($bg, $fg, 90%) !default;
|
||||
$notification-color: $fg !default;
|
||||
$notification-border: $border-width solid $border-color !default;
|
||||
$notification-border-radius: $border-radius !default;
|
||||
$notification-message-bg: mix($bg, map-get($theme-colors, "info"), 90%) !default;
|
||||
$notification-message-color: mix($fg, map-get($theme-colors, "info"), 10%) !default;
|
||||
$notification-message-border: $border-width solid mix($bg, map-get($theme-colors, "info"), 53%) !default;
|
||||
$notification-warning-bg: mix($bg, map-get($theme-colors, "warning"), 90%) !default;
|
||||
$notification-warning-color: mix($fg, map-get($theme-colors, "warning"), 10%) !default;
|
||||
$notification-warning-border: $border-width solid mix($bg, map-get($theme-colors, "warning"), 71%) !default;
|
||||
$notification-error-bg: mix($bg, map-get($theme-colors, "danger"), 90%) !default;
|
||||
$notification-error-color: mix($fg, map-get($theme-colors, "danger"), 10%) !default;
|
||||
$notification-error-border: $border-width solid mix($bg, map-get($theme-colors, "danger"), 79%) !default;
|
||||
$notification-close-color: mix($bg, $fg, 20%) !default;
|
||||
$notification-close-hover-color: $fg !default;
|
||||
$notification-content-action-color: map-get($theme-colors, "primary") !default;
|
||||
$datepicker-disabled-color: $dropdown-link-disabled-color !default;
|
||||
|
||||
$shiny-file-active-shadow: $custom-file-focus-box-shadow !default;
|
||||
39
inst/www/shared/shiny_scss/shiny.bootstrap5.scss
Normal file
39
inst/www/shared/shiny_scss/shiny.bootstrap5.scss
Normal file
@@ -0,0 +1,39 @@
|
||||
$body-emphasis-color: $body-color !default; // introduced in BS 5.3
|
||||
|
||||
$shiny-emphasis-color-rgb: var(--#{$prefix}emphasis-color-rgb, 0,0,0) !default;
|
||||
|
||||
$shiny-disconnected-bg: RGBA($shiny-emphasis-color-rgb, 0.42) !default;
|
||||
$shiny-table-na: RGBA($shiny-emphasis-color-rgb, 0.46) !default;
|
||||
$shiny-error-color: var(--#{$prefix}danger-text-emphasis) !default;
|
||||
$shiny-error-validated-color: RGBA($shiny-emphasis-color-rgb, 0.5) !default;
|
||||
$shiny-progress-text-bg-color: RGBA(var(--#{$prefix}primary-rgb, #{to-rgb($primary)}), 0.05) !default;
|
||||
|
||||
$shiny-input-panel-bg: RGBA($shiny-emphasis-color-rgb, 0.04) !default;
|
||||
$shiny-input-panel-border: $border-width solid var(--#{$prefix}border-color, #{$border-color}) !default;
|
||||
$shiny-input-panel-border-radius: $border-radius !default;
|
||||
$shiny-text-output-border-radius: $border-radius !default;
|
||||
|
||||
$notification-color: var(--#{$prefix}emphasis-color, #{$body-emphasis-color}) !default;
|
||||
$notification-bg-color: var(--#{$prefix}body-bg, #{$body-bg}) !default;
|
||||
$notification-border: $border-width solid var(--#{$prefix}border-color, #{$border-color}) !default;
|
||||
$notification-border-radius: $border-radius !default;
|
||||
|
||||
$notification-message-color: var(--#{$prefix}info-text-emphasis) !default;
|
||||
$notification-message-bg: var(--#{$prefix}info-bg-subtle) !default;
|
||||
$notification-message-border: $border-width solid var(--#{$prefix}info-border-subtle) !default;
|
||||
|
||||
$notification-warning-color: var(--#{$prefix}warning-text-emphasis) !default;
|
||||
$notification-warning-bg: var(--#{$prefix}warning-bg-subtle) !default;
|
||||
$notification-warning-border: $border-width solid var(--#{$prefix}warning-border-subtle) !default;
|
||||
|
||||
$notification-error-color: var(--#{$prefix}danger-text-emphasis) !default;
|
||||
$notification-error-bg: var(--#{$prefix}danger-bg-subtle) !default;
|
||||
$notification-error-border: $border-width solid var(--#{$prefix}danger-border-subtle) !default;
|
||||
|
||||
$notification-close-color: RGBA($shiny-emphasis-color-rgb, 0.8) !default;
|
||||
$notification-close-hover-color: RGB($shiny-emphasis-color-rgb) !default;
|
||||
$notification-content-action-color: RGB(var(--#{$prefix}primary-rgb, #{to-rgb($primary)})) !default;
|
||||
|
||||
$datepicker-disabled-color: $dropdown-link-disabled-color !default;
|
||||
|
||||
$shiny-file-active-shadow: $input-focus-box-shadow !default;
|
||||
@@ -13,7 +13,7 @@ $notification-bg-color: #e8e8e8 !default;
|
||||
$notification-color: #333 !default;
|
||||
$notification-border: 1px solid #ccc !default;
|
||||
$notification-border-radius: 3px !default;
|
||||
$notification-padding: 10px 8px 10px 10px !default;
|
||||
$notification-padding: 10px 2rem 10px 10px !default;
|
||||
$notification-message-bg: #d9edf7 !default;
|
||||
$notification-message-color: #31708f !default;
|
||||
$notification-message-border: 1px solid #bce8f1 !default;
|
||||
@@ -88,10 +88,7 @@ pre.shiny-text-output {
|
||||
|
||||
#shiny-disconnected-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
inset: 0;
|
||||
background-color: $shiny-disconnected-bg;
|
||||
opacity: 0.5;
|
||||
overflow: hidden;
|
||||
@@ -99,6 +96,17 @@ pre.shiny-text-output {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
html.autoreload-enabled #shiny-disconnected-overlay.reloading {
|
||||
opacity: 0;
|
||||
animation: fadeIn 250ms forwards;
|
||||
animation-delay: 1s;
|
||||
}
|
||||
@keyframes fadeIn {
|
||||
to {
|
||||
opacity: 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
.table.shiny-table {
|
||||
@include table-padding($left: 12px, $right: 12px);
|
||||
}
|
||||
@@ -157,6 +165,9 @@ pre.shiny-text-output {
|
||||
margin-top: -9px;
|
||||
}
|
||||
.slider-animate-button {
|
||||
/* Ensure controls above slider line touch target */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
opacity: 0.5;
|
||||
.pause {
|
||||
display: none;
|
||||
@@ -181,6 +192,12 @@ pre.shiny-text-output {
|
||||
}
|
||||
}
|
||||
|
||||
// fileInput()'s button should never have a top-right or bottom-right border-radius
|
||||
.btn-file {
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
}
|
||||
|
||||
/* Make sure the filename doesn't extend past the bounds of the container */
|
||||
.shiny-input-container input[type=file] {
|
||||
overflow: hidden;
|
||||
@@ -304,11 +321,6 @@ pre.shiny-text-output {
|
||||
zoom: 1.0000001;
|
||||
}
|
||||
|
||||
/* consistency with bootstrap.css for selectize.js */
|
||||
.selectize-control {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.shiny-frame {
|
||||
border: none;
|
||||
}
|
||||
@@ -378,18 +390,19 @@ pre.shiny-text-output {
|
||||
right: 0;
|
||||
background-color: rgba(0,0,0,0);
|
||||
padding: 2px;
|
||||
width: 250px;
|
||||
width: 300px;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.shiny-notification {
|
||||
position: relative;
|
||||
background-color: $notification-bg-color;
|
||||
color: $notification-color;
|
||||
border: $notification-border;
|
||||
@include border-radius-shim($notification-border-radius);
|
||||
opacity: 0.85;
|
||||
padding: $notification-padding;
|
||||
margin: 2px;
|
||||
margin: 5px;
|
||||
&-message {
|
||||
color: $notification-message-color;
|
||||
background-color: $notification-message-bg;
|
||||
@@ -406,17 +419,23 @@ pre.shiny-text-output {
|
||||
border: $notification-error-border;
|
||||
}
|
||||
&-close {
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
bottom: 9px;
|
||||
position: relative;
|
||||
padding-left: 4px;
|
||||
position: absolute;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
top: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: normal;
|
||||
font-size: 1.125em;
|
||||
padding: 0.25rem;
|
||||
color: $notification-close-color;
|
||||
cursor: default;
|
||||
cursor: pointer;
|
||||
}
|
||||
&-close:hover {
|
||||
color: $notification-close-hover-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
&-content-action a {
|
||||
color: $notification-content-action-color;
|
||||
|
||||
@@ -166,8 +166,8 @@ instead of the default 200 MB:
|
||||
}\if{html}{\out{</div>}}
|
||||
|
||||
To use different settings for a session-scoped cache, you can set
|
||||
\code{self$cache} at the top of your server function. By default, it will create
|
||||
a 200 MB memory cache for each session, but you can replace it with
|
||||
\code{session$cache} at the top of your server function. By default, it will
|
||||
create a 200 MB memory cache for each session, but you can replace it with
|
||||
something different. To use the session-scoped cache, you must also call
|
||||
\code{bindCache()} with \code{cache="session"}. This will create a 100 MB cache for
|
||||
the session:
|
||||
|
||||
@@ -36,19 +36,25 @@ function.
|
||||
\examples{
|
||||
\dontrun{
|
||||
ui <- fluidPage(
|
||||
p("Choose a dataset to download."),
|
||||
selectInput("dataset", "Dataset", choices = c("mtcars", "airquality")),
|
||||
downloadButton("downloadData", "Download")
|
||||
)
|
||||
|
||||
server <- function(input, output) {
|
||||
# Our dataset
|
||||
data <- mtcars
|
||||
# The requested dataset
|
||||
data <- reactive({
|
||||
get(input$dataset)
|
||||
})
|
||||
|
||||
output$downloadData <- downloadHandler(
|
||||
filename = function() {
|
||||
paste("data-", Sys.Date(), ".csv", sep="")
|
||||
# Use the selected dataset as the suggested file name
|
||||
paste0(input$dataset, ".csv")
|
||||
},
|
||||
content = function(file) {
|
||||
write.csv(data, file)
|
||||
# Write the dataset to the `file` that will be downloaded
|
||||
write.csv(data(), file)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ fileInput(
|
||||
multiple files at once. \strong{Does not work on older browsers, including
|
||||
Internet Explorer 9 and earlier.}}
|
||||
|
||||
\item{accept}{A character vector of "unique file type specifiers" which
|
||||
gives the browser a hint as to the type of file the server expects.
|
||||
Many browsers use this prevent the user from selecting an invalid file.
|
||||
\item{accept}{A character vector of "unique file type specifiers" which gives
|
||||
the browser a hint as to the type of file the server expects. Many browsers
|
||||
use this prevent the user from selecting an invalid file.
|
||||
|
||||
A unique file type specifier can be:
|
||||
\itemize{
|
||||
@@ -61,12 +61,19 @@ still photos only, also use \code{accept="image/*"}. For video only, use
|
||||
Create a file upload control that can be used to upload one or more files.
|
||||
}
|
||||
\details{
|
||||
Whenever a file upload completes, the corresponding input variable is set
|
||||
to a dataframe. See the \verb{Server value} section.
|
||||
Whenever a file upload completes, the corresponding input variable is set to
|
||||
a dataframe. See the \verb{Server value} section.
|
||||
|
||||
Each time files are uploaded, they are written to a new random subdirectory
|
||||
inside of R's process-level temporary directory. The Shiny user session keeps
|
||||
track of all uploads in the session, and when the session ends, Shiny deletes
|
||||
all of the subdirectories where files where uploaded to.
|
||||
}
|
||||
\section{Server value}{
|
||||
|
||||
A \code{data.frame} that contains one row for each selected file, and following columns:
|
||||
|
||||
A \code{data.frame} that contains one row for each selected file, and following
|
||||
columns:
|
||||
\describe{
|
||||
\item{\code{name}}{The filename provided by the web browser. This is
|
||||
\strong{not} the path to read to get at the actual data that was uploaded
|
||||
|
||||
@@ -64,7 +64,7 @@ updated and all observers have been run (default).}
|
||||
\item{session}{The shiny session. Advanced use only.}
|
||||
}
|
||||
\description{
|
||||
These functions allow you to dynamically add and remove arbirary UI
|
||||
These functions allow you to dynamically add and remove arbitrary UI
|
||||
into your app, whenever you want, as many times as you want.
|
||||
Unlike \code{\link[=renderUI]{renderUI()}}, the UI generated with \code{insertUI()} is persistent:
|
||||
once it's created, it stays there until removed by \code{removeUI()}. Each
|
||||
@@ -76,7 +76,7 @@ function.
|
||||
}
|
||||
\details{
|
||||
It's particularly useful to pair \code{removeUI} with \code{insertUI()}, but there is
|
||||
no restriction on what you can use on. Any element that can be selected
|
||||
no restriction on what you can use it on. Any element that can be selected
|
||||
through a jQuery selector can be removed through this function.
|
||||
}
|
||||
\examples{
|
||||
|
||||
@@ -17,7 +17,7 @@ memoryCache(
|
||||
\arguments{
|
||||
\item{max_size}{Maximum size of the cache, in bytes. If the cache exceeds
|
||||
this size, cached objects will be removed according to the value of the
|
||||
\code{evict}. Use \code{Inf} for no size limit. The default is 1 gigabyte.}
|
||||
\code{evict}. Use \code{Inf} for no size limit. The default is 512 megabytes.}
|
||||
|
||||
\item{max_age}{Maximum age of files in cache before they are evicted, in
|
||||
seconds. Use \code{Inf} for no age limit.}
|
||||
|
||||
@@ -24,7 +24,10 @@ modalButton(label, icon = NULL)
|
||||
\item{footer}{UI for footer. Use \code{NULL} for no footer.}
|
||||
|
||||
\item{size}{One of \code{"s"} for small, \code{"m"} (the default) for medium,
|
||||
or \code{"l"} for large.}
|
||||
\code{"l"} for large, or \code{"xl"} for extra large. Note that \code{"xl"} only
|
||||
works with Bootstrap 4 and above (to opt-in to Bootstrap 4+,
|
||||
pass \code{\link[bslib:bs_theme]{bslib::bs_theme()}} to the \code{theme} argument of a page container
|
||||
like \code{\link[=fluidPage]{fluidPage()}}).}
|
||||
|
||||
\item{easyClose}{If \code{TRUE}, the modal dialog can be dismissed by
|
||||
clicking outside the dialog box, or be pressing the Escape key. If
|
||||
|
||||
@@ -58,8 +58,7 @@ tabPanels}
|
||||
navigation bar}
|
||||
|
||||
\item{collapsible}{\code{TRUE} to automatically collapse the navigation
|
||||
elements into a menu when the width of the browser is less than 940 pixels
|
||||
(useful for viewing on smaller touchscreen device)}
|
||||
elements into an expandable menu on mobile devices or narrow window widths.}
|
||||
|
||||
\item{fluid}{\code{TRUE} to use a fluid layout. \code{FALSE} to use a fixed
|
||||
layout.}
|
||||
|
||||
@@ -86,8 +86,8 @@ Positive, negative, and zero values are allowed.}
|
||||
automatically destroyed when its domain (if any) ends.}
|
||||
|
||||
\item{ignoreNULL}{Whether the action should be triggered (or value
|
||||
calculated, in the case of \code{eventReactive}) when the input is
|
||||
\code{NULL}. See Details.}
|
||||
calculated, in the case of \code{eventReactive}) when the input event expression
|
||||
is \code{NULL}. See Details.}
|
||||
|
||||
\item{ignoreInit}{If \code{TRUE}, then, when this \code{observeEvent} is
|
||||
first created/initialized, ignore the \code{handlerExpr} (the second
|
||||
|
||||
@@ -48,7 +48,7 @@ but when \code{size} is set, it will be a box instead.}
|
||||
|
||||
\item{...}{Arguments passed to \code{selectInput()}.}
|
||||
|
||||
\item{options}{A list of options. See the documentation of \pkg{selectize.js}
|
||||
\item{options}{A list of options. See the documentation of \pkg{selectize.js}(\url{https://selectize.dev/docs/usage})
|
||||
for possible options (character option values inside \code{\link[base:AsIs]{base::I()}} will
|
||||
be treated as literal JavaScript code; see \code{\link[=renderDataTable]{renderDataTable()}}
|
||||
for details).}
|
||||
@@ -62,7 +62,7 @@ from a list of values.
|
||||
}
|
||||
\details{
|
||||
By default, \code{selectInput()} and \code{selectizeInput()} use the JavaScript library
|
||||
\pkg{selectize.js} (\url{https://github.com/selectize/selectize.js}) instead of
|
||||
\pkg{selectize.js} (\url{https://selectize.dev/}) instead of
|
||||
the basic select input element. To use the standard HTML select input
|
||||
element, use \code{selectInput()} with \code{selectize=FALSE}.
|
||||
|
||||
|
||||
@@ -69,8 +69,9 @@ be done 100\% correctly.}
|
||||
\item{shiny.jquery.version (defaults to \code{3})}{The major version of jQuery to use.
|
||||
Currently only values of \code{3} or \code{1} are supported. If \code{1}, then jQuery 1.12.4 is used. If \code{3},
|
||||
then jQuery 3.6.0 is used.}
|
||||
\item{shiny.json.digits (defaults to \code{16})}{The number of digits to use when converting
|
||||
numbers to JSON format to send to the client web browser.}
|
||||
\item{shiny.json.digits (defaults to \code{I(16)})}{Max number of digits to use when converting
|
||||
numbers to JSON format to send to the client web browser. Use \code{\link[=I]{I()}} to specify significant digits.
|
||||
Use \code{NA} for max precision.}
|
||||
\item{shiny.launch.browser (defaults to \code{interactive()})}{A boolean which controls the default behavior
|
||||
when an app is run. See \code{\link[=runApp]{runApp()}} for more information.}
|
||||
\item{shiny.mathjax.url (defaults to \code{"https://mathjax.rstudio.com/latest/MathJax.js"})}{
|
||||
|
||||
@@ -62,7 +62,7 @@ the example section for a small demo of this feature.}
|
||||
\item{selected}{The initially selected value (or multiple values if \code{multiple = TRUE}). If not specified then defaults to the first value for
|
||||
single-select lists and no values for multiple select lists.}
|
||||
|
||||
\item{options}{A list of options. See the documentation of \pkg{selectize.js}
|
||||
\item{options}{A list of options. See the documentation of \pkg{selectize.js}(\url{https://selectize.dev/docs/usage})
|
||||
for possible options (character option values inside \code{\link[base:AsIs]{base::I()}} will
|
||||
be treated as literal JavaScript code; see \code{\link[=renderDataTable]{renderDataTable()}}
|
||||
for details).}
|
||||
|
||||
@@ -42,7 +42,7 @@ but when \code{size} is set, it will be a box instead.}
|
||||
|
||||
\item{...}{Arguments passed to \code{varSelectInput()}.}
|
||||
|
||||
\item{options}{A list of options. See the documentation of \pkg{selectize.js}
|
||||
\item{options}{A list of options. See the documentation of \pkg{selectize.js}(\url{https://selectize.dev/docs/usage})
|
||||
for possible options (character option values inside \code{\link[base:AsIs]{base::I()}} will
|
||||
be treated as literal JavaScript code; see \code{\link[=renderDataTable]{renderDataTable()}}
|
||||
for details).}
|
||||
@@ -57,7 +57,7 @@ from the column names of a data frame.
|
||||
\details{
|
||||
By default, \code{varSelectInput()} and \code{selectizeInput()} use the
|
||||
JavaScript library \pkg{selectize.js}
|
||||
(\url{https://github.com/selectize/selectize.js}) to instead of the basic
|
||||
(\url{https://selectize.dev/}) to instead of the basic
|
||||
select input element. To use the standard HTML select input element, use
|
||||
\code{selectInput()} with \code{selectize=FALSE}.
|
||||
}
|
||||
|
||||
14
package.json
14
package.json
@@ -3,7 +3,7 @@
|
||||
"homepage": "https://shiny.rstudio.com",
|
||||
"repository": "github:rstudio/shiny",
|
||||
"name": "@types/rstudio-shiny",
|
||||
"version": "1.7.3-alpha.9001",
|
||||
"version": "1.8.0-alpha.9000",
|
||||
"license": "GPL-3.0-only",
|
||||
"main": "",
|
||||
"browser": "",
|
||||
@@ -24,7 +24,8 @@
|
||||
"@types/datatables.net": "^1.10.19",
|
||||
"@types/ion-rangeslider": "2.3.0",
|
||||
"@types/jquery": "3.5.14",
|
||||
"@types/selectize": "0.12.34"
|
||||
"@types/selectize": "0.12.34",
|
||||
"lit": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.3",
|
||||
@@ -33,6 +34,7 @@
|
||||
"@babel/preset-typescript": "^7.13.0",
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@deanc/esbuild-plugin-postcss": "^1.0.2",
|
||||
"@selectize/selectize": "https://github.com/selectize/selectize.js.git#e3f2e0b4aa251375bc21b5fcd8ca7d374a921f08",
|
||||
"@testing-library/dom": "^7.31.0",
|
||||
"@testing-library/jest-dom": "^5.12.0",
|
||||
"@testing-library/user-event": "^13.1.9",
|
||||
@@ -40,12 +42,11 @@
|
||||
"@types/jest": "^26.0.23",
|
||||
"@types/jqueryui": "1.12.16",
|
||||
"@types/lodash": "^4.14.170",
|
||||
"@types/node": "^15.6.1",
|
||||
"@types/node": "^18.14.2",
|
||||
"@types/showdown": "^1.9.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.38.1",
|
||||
"@typescript-eslint/parser": "^5.38.1",
|
||||
"autoprefixer": "^10.2.6",
|
||||
"bootstrap-datepicker": "1.9.0",
|
||||
"browserslist": "^4.19.1",
|
||||
"caniuse-lite": "^1.0.30001312",
|
||||
"core-js": "^3.13.0",
|
||||
@@ -60,9 +61,8 @@
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-unicorn": "^43.0.2",
|
||||
"fs-readdir-recursive": "^1.1.0",
|
||||
"ion-rangeslider": "2.3.1",
|
||||
"jest": "^26.6.3",
|
||||
"jquery": "3.6.0",
|
||||
"jquery": "^3.6.0",
|
||||
"lodash": "^4.17.21",
|
||||
"madge": "^4.0.2",
|
||||
"node-gyp": "^8.1.0",
|
||||
@@ -71,8 +71,6 @@
|
||||
"prettier": "^2.7.1",
|
||||
"readcontrol": "^1.0.0",
|
||||
"replace": "^1.2.1",
|
||||
"selectize": "0.12.4",
|
||||
"strftime": "0.9.2",
|
||||
"ts-jest": "^26",
|
||||
"ts-node": "^10.9.1",
|
||||
"type-coverage": "^2.22.0",
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
# Revdeps
|
||||
|
||||
## Failed to check (5)
|
||||
## Failed to check (15)
|
||||
|
||||
|package |version |error |warning |note |
|
||||
|:----------|:-------|:-----|:-------|:----|
|
||||
|ctsem |3.6.0 |1 | | |
|
||||
|diveR |? | | | |
|
||||
|loon.shiny |? | | | |
|
||||
|NA |? | | | |
|
||||
|SSVS |? | | | |
|
||||
|package |version |error |warning |note |
|
||||
|:------------------|:-------|:-----|:-------|:----|
|
||||
|bigPint |? | | | |
|
||||
|bioCancer |? | | | |
|
||||
|ctsem |3.9.1 |1 | | |
|
||||
|diveR |? | | | |
|
||||
|EBImage |? | | | |
|
||||
|GeneNetworkBuilder |? | | | |
|
||||
|InterCellar |? | | | |
|
||||
|LACE |? | | | |
|
||||
|loon.shiny |? | | | |
|
||||
|MatrixQCvis |? | | | |
|
||||
|modchart |? | | | |
|
||||
|omicsViewer |? | | | |
|
||||
|parcats |? | | | |
|
||||
|RQuantLib |0.4.19 |1 | | |
|
||||
|rstanarm |2.26.1 |1 | | |
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
## revdepcheck results
|
||||
|
||||
We checked 1039 reverse dependencies (1038 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
|
||||
We checked 1172 reverse dependencies (1162 from CRAN + 10 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
|
||||
|
||||
* We saw 0 new problems
|
||||
* We failed to check 4 packages
|
||||
* We failed to check 5 packages
|
||||
|
||||
Issues with CRAN packages are summarised below.
|
||||
|
||||
@@ -12,4 +12,5 @@ Issues with CRAN packages are summarised below.
|
||||
* ctsem (NA)
|
||||
* diveR (NA)
|
||||
* loon.shiny (NA)
|
||||
* SSVS (NA)
|
||||
* RQuantLib (NA)
|
||||
* rstanarm (NA)
|
||||
|
||||
@@ -55,6 +55,14 @@ build({
|
||||
minify: true,
|
||||
});
|
||||
|
||||
build({
|
||||
...opts,
|
||||
entryPoints: [outDir + "selectize/js/selectize.js"],
|
||||
outfile: outDir + "selectize/js/selectize.min.js",
|
||||
minify: true,
|
||||
target: "es6",
|
||||
});
|
||||
|
||||
build({
|
||||
...opts,
|
||||
entryPoints: [outDir + "selectize/accessibility/js/selectize-plugin-a11y.js"],
|
||||
|
||||
@@ -1,18 +1,86 @@
|
||||
/* eslint-disable unicorn/filename-case */
|
||||
const protocol = (window.location.protocol === "https:") ? "wss:" : "ws:";
|
||||
|
||||
document.documentElement.classList.add("autoreload-enabled");
|
||||
|
||||
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
// Add trailing slash to path, if necessary, before appending "autoreload"
|
||||
const defaultPath = window.location.pathname.replace(/\/?$/, "/") + "autoreload/";
|
||||
const defaultPath =
|
||||
window.location.pathname.replace(/\/?$/, "/") + "autoreload/";
|
||||
const defaultUrl = `${protocol}//${window.location.host}${defaultPath}`;
|
||||
|
||||
// By default, use the defaultUrl. But if there's a data-ws-url attribute on our
|
||||
// <script> tag, use that instead.
|
||||
const wsUrl = document.currentScript.dataset.wsUrl || defaultUrl;
|
||||
const ws = new WebSocket(wsUrl);
|
||||
const wsUrl = document.currentScript?.dataset?.wsUrl || defaultUrl;
|
||||
|
||||
ws.onmessage = function (event) {
|
||||
if (event.data === "autoreload") {
|
||||
window.location.reload();
|
||||
/**
|
||||
* Connects to an autoreload URL and waits for the server to tell us what to do.
|
||||
*
|
||||
* @param url The ws:// or wss:// URL to connect to.
|
||||
* @returns true if the server requests a reload, or false if the connection was
|
||||
* successfully established but then closed without the server requesting a
|
||||
* reload
|
||||
* @throws A nondescript error if the connection fails to be established.
|
||||
*/
|
||||
async function autoreload(url: string): Promise<boolean> {
|
||||
const ws = new WebSocket(url);
|
||||
|
||||
let success = false;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
ws.onopen = () => {
|
||||
success = true;
|
||||
};
|
||||
|
||||
ws.onerror = (err) => {
|
||||
reject(err);
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
if (!success) {
|
||||
reject(new Error("WebSocket connection failed"));
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
};
|
||||
|
||||
ws.onmessage = function (event) {
|
||||
if (event.data === "autoreload") {
|
||||
resolve(true);
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function sleep(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
async function initialize() {
|
||||
while (true) {
|
||||
try {
|
||||
if (await autoreload(wsUrl)) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
} catch (err) {
|
||||
// It's possible for the autoreload() call to throw. If it does, that
|
||||
// means we tried but failed to connect to the autoreload socket. This
|
||||
// probably means that the entire `shiny run --reload` process was
|
||||
// restarted. As of today, the autoreload websocket port number is
|
||||
// randomly chosen for each `shiny run --reload` process, so it's
|
||||
// impossible for us to recover.
|
||||
console.debug("Giving up on autoreload");
|
||||
return;
|
||||
}
|
||||
// If we get here, the connection to the autoreload server was
|
||||
// successful but then got broken. Wait for a second, and then
|
||||
// try to re-establish the connection.
|
||||
await sleep(1000);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initialize().catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
export {};
|
||||
|
||||
@@ -9,6 +9,7 @@ type CheckboxReceiveMessageData = { value?: CheckboxChecked; label?: string };
|
||||
|
||||
class CheckboxInputBinding extends InputBinding {
|
||||
find(scope: HTMLElement): JQuery<HTMLElement> {
|
||||
// Inputs also have .shiny-input-checkbox class
|
||||
return $(scope).find('input[type="checkbox"]');
|
||||
}
|
||||
getValue(el: CheckedHTMLElement): CheckboxChecked {
|
||||
|
||||
@@ -195,6 +195,7 @@ function fileInputBindingGetId(this: any, el: HTMLInputElement): string {
|
||||
|
||||
class FileInputBinding extends InputBinding {
|
||||
find(scope: HTMLElement): JQuery<HTMLElement> {
|
||||
// Inputs also have .shiny-input-file class
|
||||
return $(scope).find('input[type="file"]');
|
||||
}
|
||||
getId(el: HTMLInputElement): string {
|
||||
|
||||
@@ -44,7 +44,7 @@ class InputBinding {
|
||||
// 'data' should be an object with elements corresponding to value, min,
|
||||
// max, etc., as appropriate for the type of input object. It also should
|
||||
// trigger a change event.
|
||||
receiveMessage(el: HTMLElement, data: unknown): void {
|
||||
receiveMessage(el: HTMLElement, data: unknown): Promise<void> | void {
|
||||
throw "Not implemented";
|
||||
el; // unused var
|
||||
data; // unused var
|
||||
|
||||
@@ -20,6 +20,7 @@ function getLabelNode(el: NumberHTMLElement): JQuery<HTMLElement> {
|
||||
|
||||
class NumberInputBinding extends TextInputBindingBase {
|
||||
find(scope: HTMLElement): JQuery<HTMLElement> {
|
||||
// Inputs also have .shiny-input-number class
|
||||
return $(scope).find('input[type="number"]');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TextInputBinding } from "./text";
|
||||
|
||||
class PasswordInputBinding extends TextInputBinding {
|
||||
find(scope: HTMLElement): JQuery<HTMLElement> {
|
||||
// Inputs also have .shiny-input-password class
|
||||
return $(scope).find('input[type="password"]');
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import $ from "jquery";
|
||||
import { InputBinding } from "./inputBinding";
|
||||
import { $escape, hasDefinedProperty, updateLabel } from "../../utils";
|
||||
import { indirectEval } from "../../utils/eval";
|
||||
import type { NotUndefined } from "../../utils/extraTypes";
|
||||
|
||||
type SelectHTMLElement = HTMLSelectElement & { nonempty: boolean };
|
||||
|
||||
@@ -42,6 +41,7 @@ function isSelectize(el: HTMLElement): boolean {
|
||||
|
||||
class SelectInputBinding extends InputBinding {
|
||||
find(scope: HTMLElement): JQuery<HTMLElement> {
|
||||
// Inputs also have .shiny-input-select class
|
||||
return $(scope).find("select");
|
||||
}
|
||||
getType(el: HTMLElement): string | null {
|
||||
@@ -60,10 +60,14 @@ class SelectInputBinding extends InputBinding {
|
||||
getId(el: SelectHTMLElement): string {
|
||||
return InputBinding.prototype.getId.call(this, el) || el.name;
|
||||
}
|
||||
getValue(
|
||||
el: HTMLElement
|
||||
): NotUndefined<ReturnType<JQuery<HTMLElement>["val"]>> {
|
||||
return $(el).val() as NotUndefined<ReturnType<JQuery<HTMLElement>["val"]>>;
|
||||
getValue(el: SelectHTMLElement): any {
|
||||
if (!isSelectize(el)) {
|
||||
return $(el).val();
|
||||
} else {
|
||||
const selectize = this._selectize(el);
|
||||
|
||||
return selectize?.getValue();
|
||||
}
|
||||
}
|
||||
setValue(el: SelectHTMLElement, value: string): void {
|
||||
if (!isSelectize(el)) {
|
||||
@@ -144,6 +148,7 @@ class SelectInputBinding extends InputBinding {
|
||||
selectize.settings.load = function (query: string, callback: CallbackFn) {
|
||||
const settings = selectize.settings;
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises */
|
||||
$.ajax({
|
||||
url: data.url,
|
||||
data: {
|
||||
@@ -291,6 +296,7 @@ class SelectInputBinding extends InputBinding {
|
||||
control.destroy();
|
||||
control = $el.selectize(settings)[0].selectize as SelectizeInfo;
|
||||
}
|
||||
|
||||
return control;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,16 @@ class SliderInputBinding extends TextInputBindingBase {
|
||||
msg.to = data.value[1];
|
||||
} else {
|
||||
if (Array.isArray(data.value)) {
|
||||
throw "Slider only contains a single value and cannot be updated with an array";
|
||||
const errorReason = [
|
||||
"an empty array.",
|
||||
"a single-value array.",
|
||||
"an array with more than two values.",
|
||||
];
|
||||
throw (
|
||||
"Slider requires two values to update with an array, " +
|
||||
"but message value was " +
|
||||
errorReason[Math.min(data.value.length, 2)]
|
||||
);
|
||||
}
|
||||
msg.from = data.value;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,8 @@ class TextInputBindingBase extends InputBinding {
|
||||
// id that ends in '-selectized'. The .not() selector below
|
||||
// is to prevent textInputBinding from accidentally picking up
|
||||
// this hidden element as a shiny input (#2396)
|
||||
|
||||
//
|
||||
// Inputs also now have .shiny-input-text class
|
||||
return $inputs.not('input[type="text"][id$="-selectized"]');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { TextInputBinding } from "./text";
|
||||
|
||||
class TextareaInputBinding extends TextInputBinding {
|
||||
find(scope: HTMLElement): JQuery<HTMLElement> {
|
||||
// Inputs now also have the .shiny-input-textarea class
|
||||
return $(scope).find("textarea");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import $ from "jquery";
|
||||
|
||||
import { OutputBinding } from "./outputBinding";
|
||||
import { shinyUnbindAll } from "../../shiny/initedMethods";
|
||||
import { renderContent } from "../../shiny/render";
|
||||
import { renderContentAsync } from "../../shiny/render";
|
||||
import type { ErrorsMessageValue } from "../../shiny/shinyapp";
|
||||
|
||||
class HtmlOutputBinding extends OutputBinding {
|
||||
@@ -13,11 +13,11 @@ class HtmlOutputBinding extends OutputBinding {
|
||||
shinyUnbindAll(el);
|
||||
this.renderError(el, err);
|
||||
}
|
||||
renderValue(
|
||||
override async renderValue(
|
||||
el: HTMLElement,
|
||||
data: Parameters<typeof renderContent>[1]
|
||||
): void {
|
||||
renderContent(el, data);
|
||||
data: Parameters<typeof renderContentAsync>[1]
|
||||
): Promise<void> {
|
||||
await renderContentAsync(el, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class OutputBinding {
|
||||
throw "Not implemented";
|
||||
scope;
|
||||
}
|
||||
renderValue(el: HTMLElement, data: unknown): void {
|
||||
renderValue(el: HTMLElement, data: unknown): Promise<void> | void {
|
||||
throw "Not implemented";
|
||||
el;
|
||||
data;
|
||||
@@ -21,9 +21,9 @@ class OutputBinding {
|
||||
return el.getAttribute("data-input-id") || el.id;
|
||||
}
|
||||
|
||||
onValueChange(el: HTMLElement, data: unknown): void {
|
||||
async onValueChange(el: HTMLElement, data: unknown): Promise<void> {
|
||||
this.clearError(el);
|
||||
this.renderValue(el, data);
|
||||
await this.renderValue(el, data);
|
||||
}
|
||||
onValueError(el: HTMLElement, err: ErrorsMessageValue): void {
|
||||
this.renderError(el, err);
|
||||
|
||||
@@ -31,8 +31,8 @@ class OutputBindingAdapter {
|
||||
getId(): string {
|
||||
return this.binding.getId(this.el);
|
||||
}
|
||||
onValueChange(data: unknown): void {
|
||||
this.binding.onValueChange(this.el, data);
|
||||
async onValueChange(data: unknown): Promise<void> {
|
||||
await this.binding.onValueChange(this.el, data);
|
||||
}
|
||||
onValueError(err: ErrorsMessageValue): void {
|
||||
this.binding.onValueError(this.el, err);
|
||||
|
||||
520
srcts/src/components/errorConsole.ts
Normal file
520
srcts/src/components/errorConsole.ts
Normal file
@@ -0,0 +1,520 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { ShinyClientError } from "../shiny/error";
|
||||
|
||||
const buttonStyles = css`
|
||||
button {
|
||||
background-color: transparent;
|
||||
outline: none;
|
||||
border-style: none;
|
||||
padding: var(--space-3);
|
||||
border-radius: var(--space-1);
|
||||
font-size: 1.5rem;
|
||||
background-color: inherit;
|
||||
display: block;
|
||||
}
|
||||
|
||||
button > svg {
|
||||
display: block;
|
||||
}
|
||||
`;
|
||||
class ShinyErrorConsole extends LitElement {
|
||||
static styles = [
|
||||
css`
|
||||
:host {
|
||||
/* These are all taken from open-props */
|
||||
--space-1: 0.5rem;
|
||||
--space-2: calc(var(--space-1) * 2);
|
||||
--space-3: calc(var(--space-1) * 3);
|
||||
--space-4: calc(var(--space-1) * 4);
|
||||
|
||||
--red-2: #ffc9c9;
|
||||
--red-6: #fa5252;
|
||||
--red-7: #f03e3e;
|
||||
--red-8: #e03131;
|
||||
--red-10: #b02525;
|
||||
--red-11: #962020;
|
||||
--red-12: #7d1a1a;
|
||||
|
||||
--gray-1: #f8f9fa;
|
||||
--gray-2: #e9ecef;
|
||||
--gray-3: #dee2e6;
|
||||
--gray-4: #ced4da;
|
||||
--gray-6: #868e96;
|
||||
--gray-8: #6c757d;
|
||||
|
||||
--green-8: #51cf66;
|
||||
|
||||
--shadow-color: 220 3% 15%;
|
||||
--shadow-strength: 1%;
|
||||
--shadow-3: 0 -1px 3px 0 hsl(var(--shadow-color) /
|
||||
calc(var(--shadow-strength) + 2%)),
|
||||
0 1px 2px -5px hsl(var(--shadow-color) /
|
||||
calc(var(--shadow-strength) + 2%)),
|
||||
0 2px 5px -5px hsl(var(--shadow-color) /
|
||||
calc(var(--shadow-strength) + 4%)),
|
||||
0 4px 12px -5px hsl(var(--shadow-color) /
|
||||
calc(var(--shadow-strength) + 5%)),
|
||||
0 12px 15px -5px hsl(var(--shadow-color) /
|
||||
calc(var(--shadow-strength) + 7%));
|
||||
|
||||
--ring-shadow: 0 0 0 1px var(--gray-2);
|
||||
|
||||
/* How fast should the message pop in and out of the screen? */
|
||||
--animation-speed: 500ms;
|
||||
|
||||
/* Taken from open-props */
|
||||
--ease-3: cubic-bezier(0.25, 0, 0.3, 1);
|
||||
--animation-slide-in-left: slide-in-left var(--animation-speed)
|
||||
var(--ease-3);
|
||||
|
||||
--animation-slide-out-left: slide-out-left var(--animation-speed)
|
||||
var(--ease-3);
|
||||
--modal-bg-color: white;
|
||||
|
||||
position: fixed;
|
||||
top: var(--space-1);
|
||||
right: var(--space-1);
|
||||
z-index: 1000;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
background-color: var(--modal-bg-color);
|
||||
border-radius: var(--space-1);
|
||||
|
||||
animation: var(--animation-slide-in-left);
|
||||
box-shadow: var(--shadow-3), var(--ring-shadow);
|
||||
|
||||
/* Dont let the error console burst out of the viewport */
|
||||
max-height: calc(100vh - 2 * var(--space-1));
|
||||
}
|
||||
|
||||
@keyframes slide-in-left {
|
||||
from {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
@keyframes slide-out-left {
|
||||
to {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
|
||||
:host(.leaving) {
|
||||
animation: var(--animation-slide-out-left);
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 1.6rem;
|
||||
margin-right: auto;
|
||||
padding: var(--space-3);
|
||||
line-height: 1;
|
||||
font-weight: 600;
|
||||
color: var(--red-12);
|
||||
}
|
||||
|
||||
${buttonStyles}
|
||||
|
||||
button:hover {
|
||||
background-color: var(--gray-2);
|
||||
}
|
||||
|
||||
.toggle-button {
|
||||
width: fit-content;
|
||||
border: none;
|
||||
aspect-ratio: 1;
|
||||
border-color: var(--gray-4);
|
||||
}
|
||||
|
||||
.close-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--red-11);
|
||||
}
|
||||
|
||||
.close-button > svg {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.toggle-button:focus {
|
||||
outline: 1px solid black;
|
||||
}
|
||||
|
||||
.toggle-icon {
|
||||
transition: transform var(--animation-speed) ease-in-out;
|
||||
}
|
||||
|
||||
:host(.collapsed) .toggle-icon {
|
||||
transform: scaleX(-1) scaleY(-1);
|
||||
}
|
||||
|
||||
:host(.collapsed) .close-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: block;
|
||||
padding: var(--space-4);
|
||||
padding-top: var(--space-2);
|
||||
max-height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:host(.collapsed) .content {
|
||||
display: none;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
toggleCollapsed(): void {
|
||||
this.classList.toggle("collapsed");
|
||||
// Remove focus from the toggle button
|
||||
(this.querySelector(".toggle-button") as HTMLButtonElement)?.blur();
|
||||
}
|
||||
|
||||
handleDismissAll(): void {
|
||||
// Animate out by adding the class "leaving" and then
|
||||
// wait for the animation to finish before removing the element
|
||||
this.classList.add("leaving");
|
||||
this.addEventListener("animationend", () => {
|
||||
this.remove();
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return html` <div class="header">
|
||||
<span class="title"> Shiny Client Errors </span>
|
||||
<button
|
||||
class="close-button"
|
||||
@click=${this.handleDismissAll}
|
||||
title="Dismiss all console messages and close console"
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
height="1em"
|
||||
width="1em"
|
||||
stroke="currentColor"
|
||||
class="close-icon"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M6 18L18 6M6 6l12 12"
|
||||
/>
|
||||
</svg>
|
||||
Dismiss all
|
||||
</button>
|
||||
<button class="toggle-button" @click=${this.toggleCollapsed}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
height="1em"
|
||||
width="1em"
|
||||
stroke="currentColor"
|
||||
class="toggle-icon"
|
||||
>
|
||||
<path
|
||||
class="collapse"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<slot class="content"></slot>`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("shiny-error-console", ShinyErrorConsole);
|
||||
|
||||
export class ShinyErrorMessage extends LitElement {
|
||||
static properties = {
|
||||
headline: {},
|
||||
message: {},
|
||||
};
|
||||
|
||||
headline = "";
|
||||
message = "";
|
||||
|
||||
static styles = [
|
||||
css`
|
||||
:host {
|
||||
color: var(--red-11);
|
||||
display: block;
|
||||
font-size: 1.4rem;
|
||||
|
||||
position: relative;
|
||||
--icon-size: 1.5rem;
|
||||
|
||||
--padding-top: var(--space-1);
|
||||
--padding-bottom: var(--space-3);
|
||||
|
||||
/* Reset box sizing */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.contents {
|
||||
width: 40ch;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-1);
|
||||
padding-bottom: var(--padding-bottom);
|
||||
padding-top: var(--padding-top);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:host(:last-of-type) .contents {
|
||||
--padding-bottom: var(--space-1);
|
||||
}
|
||||
|
||||
.contents > h3 {
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
color: var(--red-12);
|
||||
}
|
||||
|
||||
.contents > * {
|
||||
margin-block: 0;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
}
|
||||
|
||||
.decoration-container {
|
||||
flex-shrink: 0;
|
||||
padding-inline: var(0.375rem);
|
||||
position: relative;
|
||||
|
||||
--line-w: 2px;
|
||||
--dot-size: 1rem;
|
||||
}
|
||||
|
||||
:host(:hover) .decoration-container {
|
||||
--scale: 1.25;
|
||||
}
|
||||
|
||||
.vertical-line {
|
||||
margin-inline: auto;
|
||||
width: var(--line-w);
|
||||
height: 100%;
|
||||
|
||||
background-color: var(--red-10);
|
||||
}
|
||||
|
||||
:host(:first-of-type) .vertical-line {
|
||||
height: calc(100% - var(--dot-size));
|
||||
margin-top: var(--dot-size);
|
||||
}
|
||||
|
||||
.dot {
|
||||
position: absolute;
|
||||
width: var(--dot-size);
|
||||
height: var(--dot-size);
|
||||
top: var(--dot-size);
|
||||
left: calc(50% - var(--dot-size) / 2);
|
||||
border-radius: 100%;
|
||||
transform: scale(var(--scale, 1));
|
||||
|
||||
color: var(--red-6);
|
||||
background-color: var(--red-10);
|
||||
}
|
||||
|
||||
.actions {
|
||||
transform: scaleX(0);
|
||||
transition: transform calc(var(--animation-speed) / 2) ease-in-out;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Delay transition on mouseout so the buttons don't jump away if the user
|
||||
overshoots them with their mouse */
|
||||
:host(:not(:hover)) .actions {
|
||||
transition-delay: 0.15s;
|
||||
}
|
||||
|
||||
:host(:hover) .actions {
|
||||
transform: scaleX(1);
|
||||
}
|
||||
|
||||
${buttonStyles}
|
||||
|
||||
.copy-button {
|
||||
padding: 0;
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
position: relative;
|
||||
--pad: var(--space-2);
|
||||
}
|
||||
|
||||
.copy-button-inner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: inherit;
|
||||
transition: transform 0.5s;
|
||||
transform-style: preserve-3d;
|
||||
}
|
||||
|
||||
/* Animate flipping to the other side when the .copy-success class is
|
||||
added to the host */
|
||||
:host(.copy-success) .copy-button-inner {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
/* Position the front and back side */
|
||||
.copy-button .front,
|
||||
.copy-button .back {
|
||||
--side: calc(100% - 2 * var(--pad));
|
||||
position: absolute;
|
||||
inset: var(--pad);
|
||||
height: var(--side);
|
||||
width: var(--side);
|
||||
-webkit-backface-visibility: hidden; /* Safari */
|
||||
backface-visibility: hidden;
|
||||
}
|
||||
|
||||
.copy-button:hover .copy-button-inner {
|
||||
background-color: var(--gray-2);
|
||||
}
|
||||
|
||||
/* Style the back side */
|
||||
.copy-button .back {
|
||||
--pad: var(--space-1);
|
||||
color: var(--green-8);
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
async copyErrorToClipboard(): Promise<void> {
|
||||
await navigator.clipboard.writeText(this.message);
|
||||
|
||||
this.classList.add("copy-success");
|
||||
|
||||
// After a second, remove the copy success class
|
||||
setTimeout(() => {
|
||||
this.classList.remove("copy-success");
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
render() {
|
||||
return html`
|
||||
<div class="container">
|
||||
<div class="decoration-container">
|
||||
<div class="vertical-line"></div>
|
||||
<div class="dot"></div>
|
||||
</div>
|
||||
<div class="contents">
|
||||
<h3>${this.headline}</h3>
|
||||
<pre class="error-message">${this.message}</pre>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<button
|
||||
class="copy-button"
|
||||
@click=${this.copyErrorToClipboard}
|
||||
title="Copy error to clipboard"
|
||||
>
|
||||
<div class="copy-button-inner">
|
||||
<svg
|
||||
class="front"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
height="1em"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
<svg
|
||||
class="back"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="1.5"
|
||||
stroke="currentColor"
|
||||
height="1em"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("shiny-error-message", ShinyErrorMessage);
|
||||
|
||||
/**
|
||||
* Function to show an error message to user in shiny-error-message web
|
||||
* component
|
||||
* @param e - Error object to show to user. This is whatever is caught in
|
||||
* a try-catch statement so it may be a string or it may be a proper Error
|
||||
* object.
|
||||
*/
|
||||
export function showErrorInClientConsole(e: unknown): void {
|
||||
let errorMsg: string | null = null;
|
||||
let headline = "Error on client while running Shiny app";
|
||||
|
||||
if (typeof e === "string") {
|
||||
errorMsg = e;
|
||||
} else if (e instanceof ShinyClientError) {
|
||||
errorMsg = e.message;
|
||||
headline = e.headline;
|
||||
} else if (e instanceof Error) {
|
||||
errorMsg = e.message;
|
||||
} else {
|
||||
errorMsg = "Unknown error";
|
||||
}
|
||||
|
||||
// Check to see if an Error Console Container element already exists. If it
|
||||
// doesn't we need to add it before putting an error on the screen
|
||||
let errorConsoleContainer = document.querySelector("shiny-error-console");
|
||||
if (!errorConsoleContainer) {
|
||||
errorConsoleContainer = document.createElement("shiny-error-console");
|
||||
document.body.appendChild(errorConsoleContainer);
|
||||
}
|
||||
|
||||
const errorConsole = document.createElement("shiny-error-message");
|
||||
errorConsole.setAttribute("headline", headline || "");
|
||||
errorConsole.setAttribute("message", errorMsg);
|
||||
|
||||
errorConsoleContainer.appendChild(errorConsole);
|
||||
}
|
||||
@@ -180,6 +180,7 @@ class FileUploader extends FileProcessor {
|
||||
onFile(file: File, cont: () => void): void {
|
||||
this.onProgress(file, 0);
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises */
|
||||
$.ajax(this.uploadUrl, {
|
||||
type: "POST",
|
||||
cache: false,
|
||||
|
||||
@@ -58,6 +58,7 @@ type BrushOpts = {
|
||||
type Brush = {
|
||||
reset: () => void;
|
||||
|
||||
hasOldBrush: () => boolean;
|
||||
importOldBrush: () => void;
|
||||
isInsideBrush: (offsetCss: Offset) => boolean;
|
||||
isInResizeArea: (offsetCss: Offset) => boolean;
|
||||
@@ -173,10 +174,15 @@ function createBrush(
|
||||
if ($div) $div.remove();
|
||||
}
|
||||
|
||||
function hasOldBrush(): boolean {
|
||||
const oldDiv = $el.find("#" + el.id + "_brush");
|
||||
return oldDiv.length > 0;
|
||||
}
|
||||
|
||||
// If there's an existing brush div, use that div to set the new brush's
|
||||
// settings, provided that the x, y, and panel variables have the same names,
|
||||
// and there's a panel with matching panel variable values.
|
||||
function importOldBrush() {
|
||||
function importOldBrush(): void {
|
||||
const oldDiv = $el.find("#" + el.id + "_brush");
|
||||
|
||||
if (oldDiv.length === 0) return;
|
||||
@@ -617,6 +623,7 @@ function createBrush(
|
||||
return {
|
||||
reset: reset,
|
||||
|
||||
hasOldBrush,
|
||||
importOldBrush: importOldBrush,
|
||||
isInsideBrush: isInsideBrush,
|
||||
isInResizeArea: isInResizeArea,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user