Merge remote-tracking branch 'origin/master' into feature/merge-code

This commit is contained in:
Fuyao Zhao 2018-12-19 22:31:19 -08:00
commit 57ab68cda6
2370 changed files with 104216 additions and 57419 deletions

View file

@ -1,5 +1,5 @@
{
"upstream": "elastic/kibana",
"branches": [{ "name": "6.x", "checked": true }, "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
"branches": [{ "name": "6.x", "checked": true }, "6.6", "6.5", "6.4", "6.3", "6.2", "6.1", "6.0", "5.6"],
"labels": ["backport"]
}

View file

@ -25,6 +25,7 @@ bower_components
/packages/kbn-ui-framework/dist
/packages/kbn-ui-framework/doc_site/build
/packages/kbn-ui-framework/generator-kui/*/templates/
/x-pack/plugins/gis/public/vendor/**
/x-pack/coverage
/x-pack/build
/x-pack/plugins/**/__tests__/fixtures/**

View file

@ -72,6 +72,7 @@ module.exports = {
'packages/kbn-test/**/*',
'packages/kbn-eslint-import-resolver-kibana/**/*',
'x-pack/plugins/apm/**/*',
'x-pack/plugins/canvas/**/*',
],
plugins: ['prettier'],
rules: Object.assign(
@ -298,6 +299,16 @@ module.exports = {
},
},
/**
* GIS overrides
*/
{
files: ['x-pack/plugins/gis/**/*'],
rules: {
'react/prefer-stateless-function': [0, { ignorePureComponents: false }],
},
},
/**
* Graph overrides
*/
@ -341,6 +352,7 @@ module.exports = {
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/anchor-has-content': 'off',
'jsx-a11y/tabindex-no-positive': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/aria-role': 'off',
},
},
@ -367,43 +379,30 @@ module.exports = {
*/
{
files: ['x-pack/plugins/canvas/**/*'],
plugins: ['prettier'],
rules: {
// preferences
'comma-dangle': [2, 'always-multiline'],
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
'no-multi-spaces': 2,
radix: 2,
curly: [2, 'multi-or-nest', 'consistent'],
// annoying rules that conflict with prettier
'space-before-function-paren': 0,
indent: 0,
'wrap-iife': 0,
'max-len': 0,
radix: 'error',
curly: ['error', 'all'],
// module importing
'import/order': [
2,
{ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'] },
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
},
],
'import/extensions': [2, 'never', { json: 'always', less: 'always', svg: 'always' }],
// prettier
'prettier/prettier': 2,
'import/extensions': ['error', 'never', { json: 'always', less: 'always', svg: 'always' }],
// react
'jsx-quotes': 2,
'react/no-did-mount-set-state': 2,
'react/no-did-update-set-state': 2,
'react/no-multi-comp': [2, { ignoreStateless: true }],
'react/self-closing-comp': 2,
'react/sort-comp': 2,
'react/jsx-boolean-value': 2,
'react/jsx-wrap-multilines': 2,
'react/no-unescaped-entities': [2, { forbid: ['>', '}'] }],
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-multi-comp': ['error', { ignoreStateless: true }],
'react/self-closing-comp': 'error',
'react/sort-comp': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-wrap-multilines': 'error',
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
'react/forbid-elements': [
2,
'error',
{
forbid: [
{

1
.github/CODEOWNERS vendored
View file

@ -4,7 +4,6 @@
/x-pack/plugins/apm/ @elastic/apm-ui
/x-pack/plugins/beats_management/ @elastic/beats
/x-pack/plugins/canvas/ @elastic/kibana-canvas
/x-pack/plugins/monitoring/ @elastic/stack-monitoring
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/plugins/spaces/ @elastic/kibana-security
**/*.scss @elastic/kibana-design

25
.github/ISSUE_TEMPLATE/Accessibility.md vendored Normal file
View file

@ -0,0 +1,25 @@
---
name: Accessibility Issue
about: Issues to help Elastic meet WCAG / Section 508 compliance
---
**Steps to reproduce (assumes [ChromeVox](https://chrome.google.com/webstore/detail/chromevox/kgejglhpjiefppelpmljglcjbhoiplfn) or similar)**
1.
2.
3.
4.
[Screenshot here]
**Actual Result**
5.
**Expected Result**
5.
[Link to meta issues here]
**Kibana Version:**
**Relevant WCAG Criteria:** (link to https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0)

View file

@ -16,7 +16,9 @@
"timelion": "src/legacy/core_plugins/timelion",
"tagCloud": "src/legacy/core_plugins/tagcloud",
"tsvb": "src/legacy/core_plugins/metrics",
"xpack.apm": "x-pack/plugins/apm",
"xpack.beatsManagement": "x-pack/plugins/beats_management",
"xpack.crossClusterReplication": "x-pack/plugins/cross_cluster_replication",
"xpack.graph": "x-pack/plugins/graph",
"xpack.grokDebugger": "x-pack/plugins/grokdebugger",
"xpack.idxMgmt": "x-pack/plugins/index_management",
@ -25,16 +27,21 @@
"xpack.ml": "x-pack/plugins/ml",
"xpack.logstash": "x-pack/plugins/logstash",
"xpack.monitoring": "x-pack/plugins/monitoring",
"xpack.remoteClusters": "x-pack/plugins/remote_clusters",
"xpack.reporting": "x-pack/plugins/reporting",
"xpack.rollupJobs": "x-pack/plugins/rollup",
"xpack.searchProfiler": "x-pack/plugins/searchprofiler",
"xpack.security": "x-pack/plugins/security",
"xpack.spaces": "x-pack/plugins/spaces",
"xpack.upgradeAssistant": "x-pack/plugins/upgrade_assistant",
"xpack.watcher": "x-pack/plugins/watcher"
},
"exclude": [
"src/ui/ui_render/bootstrap/app_bootstrap.js",
"src/ui/ui_render/ui_render_mixin.js",
"x-pack/plugins/infra/public/graphql/types.ts",
"x-pack/plugins/infra/public/utils/loading_state/loading_result.ts",
"x-pack/plugins/infra/server/graphql/types.ts",
"x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts"
]
}

View file

@ -133,10 +133,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---
This product bundles geohash.js which is available under a
"MIT" license. For details, see src/ui/public/utils/decode_geo_hash.js.
---
This product includes code that is based on flot-charts, which was available
under a "MIT" license.

View file

@ -6,8 +6,7 @@ recommended for the development of all Kibana plugins.
- [JavaScript](style_guides/js_style_guide.md)
- [Angular](style_guides/angular_style_guide.md)
- [React](style_guides/react_style_guide.md)
- [CSS](style_guides/css_style_guide.md)
- [SCSS](style_guides/scss_style_guide.md)
- [SASS](https://elastic.github.io/eui/#/guidelines/sass)
- [HTML](style_guides/html_style_guide.md)
- [API](style_guides/api_style_guide.md)
- [Architecture](style_guides/architecture_style_guide.md)

View file

@ -24,8 +24,8 @@
# The Kibana server's name. This is used for display purposes.
#server.name: "your-hostname"
# The URL of the Elasticsearch instance to use for all your queries.
#elasticsearch.url: "http://localhost:9200"
# The URLs of the Elasticsearch instances to use for all your queries.
#elasticsearch.hosts: ["http://localhost:9200"]
# When this setting's value is true Kibana uses the hostname specified in the server.host
# setting. When the value of this setting is false, Kibana uses the hostname of the host

View file

@ -13,37 +13,208 @@
This section summarizes the changes in each release.
* <<release-notes-7.0.0-alpha2>>
* <<release-notes-7.0.0-alpha1>>
--
[[release-notes-7.0.0]]
== {kib} 7.0.0
//[float]
//[[breaking-7.0.0]]
//=== Breaking Changes
[[release-notes-7.0.0-alpha2]]
== {kib} 7.0.0-alpha2
//[float]
//=== Breaking Java Changes
coming[7.0.0-alpha2]
//[float]
//=== Deprecations
[float]
[[breaking-7.0.0-alpha2]]
=== Breaking changes
For more details about breaking changes in this release, see
<<breaking-changes-7.0, Breaking changes in 7.0>>.
[float]
[[highlight-7.0.0-alpha2]]
=== Highlights
Canvas::
* Canvas now has a template tab in the workpad manager where users can find workpad templates,
demos, and tutorials to help them get started. See {pull}23966[#23966] for more information.
Kibana App::
* Visualizations in Kibana will use a new data pipeline introduced as part of Canvas.
The change does not yet apply to Vega, Timelion, or Time Series Visual Builder (TSVB).
See {pull}25711[#25711] for more information.
Index Lifecyle Management::
* Implements a user interface to create, update, edit, or delete index lifecyle policies.
See {pull}25553[#25553] for more information.
[float]
[[enhancement-7.0.0-alpha2]]
=== Enhancements
Canvas::
* Implements a clipboard and stores the copied elements in `localStorage` {pull}25890[#25890]
* Adds the ability to reuse assets without editing an element's expression {pull}25764[#25764]
* Adds the `clear` function {pull}26397[#26397]
* Adds workpad-level CSS {pull}24143[#24143]
Dashboard::
* Adds `href` option in addition to `onClick` for navigational links {pull}25233[#25233]
Design::
* Updates logos for marketing {pull}25489[#25489]
* Adds Kibana 7.0 breadcrumbs to home screen {pull}26605[#26605]
* Moves elastic/eui typings to single file {pull}23950[#23950]
Kibana App::
* Maps inspector requests by id so single requests can be reset at a time {pull}26770[#26770]
* Adds ODBC to blurb for start trail {pull}27223[#27223]
Management::
* Adds `Request timestamp` to request inspector stats {pull}25667[#25667]
* Adds "Reload indices" button to Index Management {pull}27033[#27033]
Machine Learning::
* Adds the configuration files for two new auditbeat data recognizer modules for
detecting unusual processes on hosts and Docker containers {pull}25716[#25716]
* Adds support for saved searches created using Kuery to the job wizards {pull}26094[#26094]
* Allows users to enter their own query in the Discover page; stops passing the query
from the job datafeed config in custom URLs {pull}26957[#26957]
* Rewrites Calendar to React/EUI {pull}26741[#26741]
* Converts Setting page to React/EUI {pull}27144[#27144]
* Ensures loading indicator is present on initial jobs load {pull}27151[#27151]
* Prevents a new calendar save if a calendar with that id already exists {pull}27104[#27104]
Observability::
* Adds a new plugin for Uptime Monitoring {pull}25480[#25480]
Platform::
* Adds `rest_total_hits_as_int` to all requests in platform code that eventually
look up `hits.total` {pull}26432[#26432]
* Adds `dist` flag to the configuration context {pull}26545[#26545]
* Prepares `@kbn/datemath` to be republished as `@elastic/datemath` {pull}26559[#26559]
* Wraps `remote` methods in `browser` service {pull}26394[#26394]
* Uses `stream.pipeline` to manage error handling {pull}27246[#27246]
Querying & Filtering::
* Moves the `buildESQuery` module (including filters and Kuery) into a separate package {pull}23345[#23345]
* Adds comment explaining why `getComputedFields` adds a `docvalue` to `docvalue_fields`
for each date field in an index pattern. {pull}25725[#25725]
* Moves filtering functions out of `vis.API.events` {pull}25280[#25280]
Reporting::
* Adds browser type to the reporting side panel {pull}26307[#26307]
* Adds better logging for `waitForSelector` failure {pull}25762[#25762]
* Enhances error messaging and handling {pull}26299[#26299]
* Adds "Info" button in the Reporting listing {pull}25421[#25421]
Rollups::
* Adds support for rolling up metrics of date fields {pull}26450[#26450]
Security::
* Updates the GET `/api/security/role` endpoint to return the list of roles sorted
by name, rather than creation date {pull}26491[#26491]
* Updates the Account Settings screen to show the change password form only when
a password change is possible for the authentication realm {pull}26779[#26779]
* Makes space selector a `button` {pull}26889[#26889]
Visualizations::
* Removes experimental flag from Visual Builder (TSVB) {pull}25634[#25634]
* Implements new visualization type selection {pull}23833[#23833]
* Removes `lab` stage for visualizations, making `experimental` the only non-production
stage available {pull}25702[#25702]
[float]
[[bug-7.0.0-alpha2]]
=== Bug fixes
Canvas::
* Fixes page preview size issue {pull}26795[#26795]
* Fixes visual bug when opening the workpad loader {pull}26647[#26647]
* Fixes page thumbnail sizes {pull}26573[#26573]
* Decreases size of tray toggle {pull}25470[#25470]
* Makes selection border 1px {pull}26739[#26739]
* Fixes interpreter socket error {pull}26870[#26870]
Geo::
* Resolves URL dynamically when requesting EMS data {pull}25685[#25685]
* Fixes EMS hotlink {pull}26868[#26868]
Infrastructure UI::
* Fixes potential color bugs {pull}26292[#26292]
* Fixes auto refresh button on node detail page {pull}26426[#26426]
* Changes the time range from the last hour to the last 5 minutes for the Waffle Map {pull}26278[#26278]
* Passes flag in request to force BWC hit count {pull}26517[#26517]
* Replaces redux source slice with constate container {pull}26121[#26121]
* Changes node detail link to set time range to 1 hour {pull}26977[#26977]
* Stops showing sidenav while loading. {pull}27119[#27119]
* Fixes styling after breaking EUI changes {pull}27021[#27021]
* Fixes graphql type generation after package upgrades {pull}26991[#26991]
* Removes usage of `ts-optchain` in the browser {pull}27148[#27148]
Kibana App::
* Fixes support for React 16.4+ by only resetting state if adaptors are updated {pull}26138[#26138]
* Fixes scrolling list on Firefox {pull}26246[#26246]
* Guards against empty and undefined index pattern arrays passed to QueryBar {pull}24607[#24607]
* Removes unused indexPattern from vega/tsvb/timelion request handler {pull}26007[#26007]
* Passes global filters from editor down to visualize {pull}26009[#26009]
* Stops using schemas in aggconfigs to output DSL {pull}26010[#26010]
* Fixes `kbn-interpreter` package to not import from UI {pull}26161[#26161]
* Fixes OSS dynamic plugin loading by reverting to Canvas way of loading plugins {pull}26463[#26463]
* Fixes other bucket option to correctly apply without having to change other settings {pull}26874[#26874]
* Adds `en` as a valid numeral locale setting {pull}25948[#25948]
* Adds `rest_total_hits_as_int` into Kibana App {pull}26404[#26404]
* Uses Canvas pipeline to fetch data inside Visualize {pull}25996[#25996]
Management::
* Fixes index pattern wizard when there are remote clusters but no local indices {pull}24339[#24339]
* Uses new `_graph` endpoints {pull}26956[#26956]
* Adjusts spacing of Management navigation items {pull}25666[#25666]
* Updates "Disenroll" text to be consistent with menu option "Unenroll" {pull}26816[#26816]
* Fixes broken breadcrumb link for index management {pull}27164[#27164]
* Fixes issue with multiple execution in Console {pull}26933[#26933]
* Reloads full index list when reload hits missing index {pull}27197[#27197]
Machine Learning::
* Allows user to add/edit/delete annotations in the Single Series Viewer {pull}26034[#26034]
* Does not pass datafeed query to Discover in custom URL {pull}26957[#26957]
* Fixes word break in Anomalies and Jobs tables {pull}26978[#26978]
* Fixes alignment of filter icons in the Anomalies table {pull}26253[#26253]
Monitoring::
* Fixes error handling for local stats collection/permissions {pull}26560[#26560]
* Removes initial delay to check and send Telemetry data {pull}26575[#26575]
* Pulls local Kibana usage stats {pull}26496[#26496]
* Converts the Elasticsearch monitoring UIs to using EUI tables and page layout {pull}26217[#26217]
Platform & Operations::
* Decreases start limit and interval {pull}25474[#25474]
* Adds `--download` flag to snapshot command to warm the cache {pull}25830[#25830]
* Implements `--prefer-offline` flag {pull}25840[#25840]
* Fixes watcher routes broken by Hapi upgrade {pull}26713[#26713]
* Fixes non-conforming licenses on devDependencies and adds the ability to whitelist devOnly licenses {pull}23859[#23859]
* Watches optimizer cache invalidation {pull}24172[#24172]
* Adds `normalizePath` in order to fix watch optimizer when running on Windows {pull}26486[#26486]
* Creates vendor dll for the client modules {pull}22618[#22618]
* Upgrades to NodeJS 10 {pull}25157[#25157]
* Improves plugin version mismatch error message {pull}25774[#25774]
* Improves build/packaging {pull}26096[#26096]
* Swaps `jstimezonedetect` with `moment.tz.guess` {pull}21800[#21800]
* Upgrades resize-observer-polyfill version {pull}26990[#26990]
* Fixes saved objects client `_processBatchQueue` function to handle errors {pull}26763[#26763]
* Changes kbn pm webpack config to generate dist files in mode=none {pull}26847[#26847]
* Hides logs from deleteAll on task: clean client modules into dll {pull}26884[#26884]
* Upgrades `resize-observer-polyfill` version {pull}26990[#26990]
* Uses `single-node` discovery type for the test ES node/cluster {pull}27125[#27125]
* Moves moment to peerDependency in elastic-datemath {pull}27264[#27264]
Reporting::
* Deletes `sortOrder` once items have been sorted and does not pass to `EuiContextMenuItem`
in the share context menu {pull}26890[#26890]
* Fixes a regression bug in detection of Error and Warning toast notifications {pull}25482[#25482]
* Stops passing an empty `formatConfig` to the fieldFormats helper {pull}27168[#27168]
Rollups::
* Shows loading state in Rollup Job detail panel. {pull}25752[#25752]
* Specifies Rollup Jobs breadcrumbs in header. {pull}26590[#26590]
* Requires histogram interval in Rollup Job wizard to be a whole number. {pull}26596[#26596]
Security::
* Moves the server-side `SavedObjectClient` types from the `spaces` plugin to the
same location as the corresponding JavaScript source files {pull}26448[#26448]
* Respects the `basePath` for the link to the user profile in the k7 header {pull}26417[#26417]
* Fixes `prettier` throw rule error {pull}26071[#26071]
* Fixes authentication logic to fail out of auth flow on first provider failure {pull}26648[#26648]
* Fixes issues with the `url.search` being null in Node 10 {pull}26992[#26992]
* Fixes DLS query toggle on the role management page {pull}27213[#27213]
Visualizations::
* Fixes filter function on pie chart segment {pull}26321[#26321]
* Rewrites URL when closing vis type selection modal {pull}26327[#26327]
* Changes unbind calls from `.on` to `.off` {pull}24575[#24575]
* Fixes date field in controls visualization by generating labels with the field
formatter {pull}25654[#25654]
* Replaces LESS files with Sass in `ui/public/vis`, `visLib`, and `visualize` {pull}25333[#25333]
* Replaces LESS files with Sass for the visualization types in `core_plugin/metrics` {pull}24250[#24250]
* Moves `timeout` to `_msearch` body to fix time series visual builder requests {pull}26510[#26510]
* Adds description for all visualization types {pull}26243[#26243]
//[float]
//=== New Features
//[float]
//=== Enhancements
//[float]
//=== Bug Fixes
//[float]
//=== Regressions
//[float]
//=== Known Issues
[[release-notes-7.0.0-alpha1]]
== {kib} 7.0.0-alpha1

View file

@ -69,4 +69,4 @@ a row, the Search Profiler displays additional information about the query compo
image::dev-tools/searchprofiler/images/gs6.png["Profile details for the first shard"]
+
This panel shows the timing breakdown of low-level Lucene methods. For more information,
see the reference docs for {ref}/_profiling_queries.html#_timing_breakdown[Timing Breakdown].
see the reference docs for timing breakdowns in {ref}/search-profile-queries.html[Profiling queries].

View file

@ -119,5 +119,5 @@ Click a shard's Expand button to view the aggregation details. Hover over an
aggregation row to view the timing breakdown.
For more information about how the Search Profiler works, how timings are calculated, and
how to interpret various results, see the
{ref}/_profiling_queries.html[Profile Reference Documentation]
how to interpret various results, see
{ref}/search-profile-queries.html[Profiling queries].

View file

@ -39,6 +39,8 @@ document.
`discover:sort:defaultOrder`:: Controls the default sort direction for time based index patterns in the Discover app.
`doc_table:highlight`:: Highlight results in Discover and Saved Searches Dashboard. Highlighting makes request slow when
working on big documents. Set this property to `false` to disable highlighting.
`search:includeFrozen`:: Will include {ref}/frozen-indices.html[frozen indices] in results if enabled. Searching through frozen indices
might increase the search time.
`courier:maxSegmentCount`:: Kibana splits requests in the Discover app into segments to limit the size of requests sent to
the Elasticsearch cluster. This setting constrains the length of the segment list. Long segment lists can significantly
increase request processing time.

View file

@ -72,3 +72,10 @@ considered unique based on its persistent UUID, which is written to the path.dat
The port is now protocol dependent: https ports will use 443, and http ports will use 80.
*Impact:* If your `elasticsearch.url` was dependent on an unspecified port set to 9200, `:9200` will have to be appended to the url.
[float]
=== kibana.yml setting `server.ssl.supportedProtocols` excludes TLSv1 by default
*Details:* TLSv1 support has been removed by default, it's still possible to opt-in to TLSv1 support by explicitly setting
`server.ssl.supportedProtocols`
*Impact:* Users relying upon TLSv1 will be unable to use Kibana unless `server.ssl.supportedProtocols` is explicitly set.

View file

@ -67,7 +67,7 @@ and {ref}/cluster-update-settings.html[Cluster update settings].
more information, see <<monitoring-settings-kb,Monitoring settings in {kib}>>.
. Identify where to send monitoring data. {kib} automatically
sends metrics to the {es} cluster specified in the `elasticsearch.url` setting
sends metrics to the {es} cluster specified in the `elasticsearch.hosts` setting
in the `kibana.yml` file. This property has a default value of
`http://localhost:9200`. +
+

View file

@ -34,8 +34,8 @@ The *Monitoring* page in {kib} is empty.
. Confirm that {kib} is seeking monitoring data from the appropriate {es} URL.
By default, data is retrieved from the cluster specified in the
`elasticsearch.url` setting in the `kibana.yml` file. If you want to retrieve it
from a different monitoring cluster, set `xpack.monitoring.elasticsearch.url`.
`elasticsearch.hosts` setting in the `kibana.yml` file. If you want to retrieve it
from a different monitoring cluster, set `xpack.monitoring.elasticsearch.hosts`.
See <<monitoring-settings-kb>>.
. Confirm that there is monitoring data available at that URL. It is stored in

View file

@ -25,8 +25,8 @@ a gold license, you can send data from multiple clusters to the same monitoring
cluster and view them all through the same instance of {kib}.
By default, data is retrieved from the cluster specified in the
`elasticsearch.url` value in the `kibana.yml` file. If you want to retrieve it
from a different cluster, set `xpack.monitoring.elasticsearch.url`.
`elasticsearch.hosts` value in the `kibana.yml` file. If you want to retrieve it
from a different cluster, set `xpack.monitoring.elasticsearch.hosts`.
To learn more about typical monitoring architectures,
see {stack-ov}/how-monitoring-works.html[How monitoring works] and

View file

@ -5,11 +5,13 @@
--
This section summarizes the changes in each release.
* <<release-notes-7.0.0-alpha2>>
* <<release-notes-7.0.0-alpha1>>
* <<release-notes-6.0.0-alpha2>>
* <<release-notes-6.0.0-alpha1>>
--
include::release-notes/7.0.0-alpha2.asciidoc[]
include::release-notes/7.0.0-alpha1.asciidoc[]
include::release-notes/6.0.0-alpha2.asciidoc[]
include::release-notes/6.0.0-alpha1.asciidoc[]

View file

@ -6,4 +6,4 @@
coming[7.0.0]
See also <<breaking-changes-7.0>> and <<release-notes-7.0.0>>.
See also <<breaking-changes-7.0>> and <<release-notes>>.

View file

@ -63,13 +63,13 @@ must have a proxy that provides an HTTPS endpoint for {es}.
--
.. Specify the HTTPS protocol in the `elasticsearch.url` setting in the {kib}
.. Specify the HTTPS protocol in the `elasticsearch.hosts` setting in the {kib}
configuration file, `kibana.yml`:
+
--
[source,yaml]
--------------------------------------------------------------------------------
elasticsearch.url: "https://<your_elasticsearch_host>.com:9200"
elasticsearch.hosts: ["https://<your_elasticsearch_host>.com:9200"]
--------------------------------------------------------------------------------
--
@ -100,13 +100,13 @@ must have a proxy that provides an HTTPS endpoint for {es}.
--
.. Specify the HTTPS URL in the `xpack.monitoring.elasticsearch.url` setting in
.. Specify the HTTPS URL in the `xpack.monitoring.elasticsearch.hosts` setting in
the {kib} configuration file, `kibana.yml`
+
--
[source,yaml]
--------------------------------------------------------------------------------
xpack.monitoring.elasticsearch.url: "https://<your_monitoring_cluster>:9200"
xpack.monitoring.elasticsearch.hosts: ["https://<your_monitoring_cluster>:9200"]
--------------------------------------------------------------------------------
--

View file

@ -6,6 +6,8 @@
++++
You do not need to configure any settings to use APM. It is enabled by default.
If you'd like to change any of the default values,
copy and paste the relevant settings below into your `kibana.yml` configuration file.
[float]
[[general-apm-settings-kb]]

View file

@ -37,9 +37,9 @@ Set to `true` (default) to enable {monitoring} in {kib}. Unlike the
monitoring back-end does not run and {kib} stats are not sent to the monitoring
cluster.
`xpack.monitoring.elasticsearch.url`::
`xpack.monitoring.elasticsearch.hosts`::
Specifies the location of the {es} cluster where your monitoring data is stored.
By default, this is the same as the `elasticsearch.url`. This setting enables
By default, this is the same as `elasticsearch.hosts`. This setting enables
you to use a single {kib} instance to search and visualize data in your
production cluster as well as monitor data sent to a dedicated monitoring
cluster.

View file

@ -102,7 +102,7 @@ services:
image: {docker-image}
environment:
SERVER_NAME: kibana.example.org
ELASTICSEARCH_URL: http://elasticsearch.example.org
ELASTICSEARCH_HOSTS: http://elasticsearch.example.org
----------------------------------------------------------
Since environment variables are translated to CLI arguments, they take
@ -117,7 +117,7 @@ images:
[horizontal]
`server.name`:: `kibana`
`server.host`:: `"0"`
`elasticsearch.url`:: `http://elasticsearch:9200`
`elasticsearch.hosts`:: `http://elasticsearch:9200`
`xpack.monitoring.ui.container.elasticsearch.enabled`:: `true`
NOTE: The setting `xpack.monitoring.ui.container.elasticsearch.enabled` is not

View file

@ -82,10 +82,10 @@ http.port: 9200
transport.host: <external ip>
transport.tcp.port: 9300 - 9400
--------
. Make sure Kibana is configured to point to your local client node. In `kibana.yml`, the `elasticsearch.url` should be set to
`localhost:9200`.
. Make sure Kibana is configured to point to your local client node. In `kibana.yml`, the `elasticsearch.hosts` setting should be set to
`["localhost:9200"]`.
+
--------
# The Elasticsearch instance to use for all your queries.
elasticsearch.url: "http://localhost:9200"
elasticsearch.hosts: ["http://localhost:9200"]
--------

View file

@ -39,6 +39,12 @@ Elasticsearch. This value must be a positive integer.
`elasticsearch.shardTimeout:`:: *Default: 30000* Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
`elasticsearch.sniffInterval:`:: *Default: false* Time in milliseconds between requests to check Elasticsearch for an updated list of nodes.
`elasticsearch.sniffOnStart:`:: *Default: false* Attempt to find other Elasticsearch nodes on startup.
`elasticsearch.sniffOnConectionFault:`:: *Default: false* Update the list of Elasticsearch nodes immediately following a connection fault.
`elasticsearch.ssl.certificate:` and `elasticsearch.ssl.key:`:: Optional settings that provide the paths to the PEM-format SSL
certificate and key files. These files are used to verify the identity of Kibana to Elasticsearch and are required when `xpack.ssl.verification_mode` in Elasticsearch is set to either `certificate` or `full`.
@ -57,8 +63,8 @@ requests for end-users being executed as the identity tied to the configured cer
`elasticsearch.startupTimeout:`:: *Default: 5000* Time in milliseconds to wait for Elasticsearch at Kibana startup before
retrying.
`elasticsearch.url:`:: *Default: "http://localhost:9200"* The URL of the Elasticsearch instance to use for all your
queries.
`elasticsearch.hosts:`:: *Default: "http://localhost:9200"* The URLs of the Elasticsearch instances to use for all your
queries. All nodes listed here must be on the same cluster.
`elasticsearch.username:` and `elasticsearch.password:`:: If your Elasticsearch is protected with basic authentication,
these settings provide the username and password that the Kibana server uses to perform maintenance on the Kibana index at
@ -162,7 +168,7 @@ The minimum value is 100.
`server.ssl.redirectHttpFromPort:`:: Kibana will bind to this port and redirect all http requests to https over the port configured as `server.port`.
`server.ssl.supportedProtocols:`:: *Default: TLSv1, TLSv1.1, TLSv1.2* An array of supported protocols with versions. Valid protocols: `TLSv1`, `TLSv1.1`, `TLSv1.2`
`server.ssl.supportedProtocols:`:: *Default: TLSv1.1, TLSv1.2* An array of supported protocols with versions. Valid protocols: `TLSv1`, `TLSv1.1`, `TLSv1.2`
`status.allowAnonymous:`:: *Default: false* If authentication is enabled, setting this to `true` allows
unauthenticated users to access the Kibana server status API and status page.

48
kibana.d.ts vendored Normal file
View file

@ -0,0 +1,48 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
/**
* All exports from TS source files (where the implementation is actually done in TS).
*/
export * from './target/types/type_exports';
/**
* All exports from TS ambient definitions (where types are added for JS source in a .d.ts file).
*/
import * as LegacyElasticsearch from './src/legacy/core_plugins/elasticsearch';
import * as LegacyKibanaServer from './src/server/kbn_server';
/**
* Re-export legacy types under a namespace.
*/
// tslint:disable:no-namespace
export namespace Legacy {
export type KibanaConfig = LegacyKibanaServer.KibanaConfig;
export type Request = LegacyKibanaServer.Request;
export type ResponseToolkit = LegacyKibanaServer.ResponseToolkit;
export type Server = LegacyKibanaServer.Server;
export namespace Plugins {
export namespace elasticsearch {
export type Plugin = LegacyElasticsearch.ElasticsearchPlugin;
export type Cluster = LegacyElasticsearch.Cluster;
export type ClusterConfig = LegacyElasticsearch.ClusterConfig;
export type CallClusterOptions = LegacyElasticsearch.CallClusterOptions;
}
}
}

View file

@ -13,7 +13,7 @@
"private": true,
"version": "7.0.0",
"branch": "master",
"types": "./target/types/type_exports.d.ts",
"types": "./kibana.d.ts",
"build": {
"number": 8467,
"sha": "6cb7fec4e154faa0a4a3fee4b33dfef91b9870d9"
@ -92,8 +92,8 @@
]
},
"dependencies": {
"@elastic/datemath": "5.0.1",
"@elastic/eui": "5.3.0",
"@elastic/datemath": "5.0.2",
"@elastic/eui": "5.8.1",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.2",
@ -113,7 +113,7 @@
"angular-elastic": "2.5.0",
"angular-recursion": "^1.0.5",
"angular-route": "1.4.7",
"angular-sanitize": "1.5.7",
"angular-sanitize": "1.6.5",
"angular-sortable-view": "0.0.15",
"autoprefixer": "^9.1.0",
"babel-core": "6.26.3",
@ -144,6 +144,7 @@
"getos": "^3.1.0",
"glob": "^7.1.2",
"glob-all": "^3.1.0",
"globby": "^8.0.1",
"good-squeeze": "2.1.0",
"h2o2": "^8.1.2",
"handlebars": "4.0.5",
@ -205,7 +206,7 @@
"regression": "2.0.0",
"request": "^2.88.0",
"reselect": "^3.0.1",
"resize-observer-polyfill": "1.2.1",
"resize-observer-polyfill": "^1.5.0",
"rimraf": "2.4.3",
"rison-node": "1.0.0",
"rxjs": "^6.2.1",
@ -215,15 +216,16 @@
"stream-stream": "^1.2.6",
"style-loader": "0.23.1",
"tar": "2.2.0",
"terser-webpack-plugin": "^1.1.0",
"thread-loader": "^1.2.0",
"tinygradient": "0.3.0",
"tinymath": "1.1.0",
"tinymath": "1.1.1",
"topojson-client": "3.0.0",
"trunc-html": "1.0.2",
"trunc-text": "1.0.2",
"ts-optchain": "^0.1.1",
"tslib": "^1.9.3",
"type-detect": "^4.0.8",
"uglifyjs-webpack-plugin": "^1.2.7",
"ui-select": "0.19.6",
"url-loader": "1.1.2",
"uuid": "3.0.1",
@ -263,7 +265,7 @@
"@types/dedent": "^0.7.0",
"@types/del": "^3.0.1",
"@types/delete-empty": "^2.0.0",
"@types/elasticsearch": "^5.0.26",
"@types/elasticsearch": "^5.0.30",
"@types/enzyme": "^3.1.12",
"@types/eslint": "^4.16.2",
"@types/execa": "^0.9.0",
@ -337,7 +339,6 @@
"fetch-mock": "^5.13.1",
"geckodriver": "1.12.2",
"getopts": "2.0.0",
"globby": "^8.0.1",
"grunt": "1.0.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-watch": "^1.1.0",
@ -392,6 +393,7 @@
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"tslint-plugin-prettier": "^2.0.0",
"tslint-microsoft-contrib": "^6.0.0",
"typescript": "^3.0.3",
"vinyl-fs": "^3.0.2",
"xml2js": "^0.4.19",

View file

@ -1,6 +1,6 @@
{
"name": "@elastic/datemath",
"version": "5.0.1",
"version": "5.0.2",
"description": "elasticsearch datemath parser, used in kibana",
"license": "Apache-2.0",
"main": "target/index.js",
@ -13,10 +13,13 @@
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-env": "^1.7.0"
"babel-preset-env": "^1.7.0",
"moment": "^2.13.0"
},
"dependencies": {
"moment": "^2.13.0",
"tslib": "^1.9.3"
},
"peerDependencies": {
"moment": "^2.13.0"
}
}

View file

@ -32,11 +32,16 @@ declare const datemath: {
unitsAsc: Unit[];
unitsDesc: Unit[];
/**
* Parses a string into a moment object. The string can be something like "now - 15m".
* @param options.forceNow If this optional parameter is supplied, "now" will be treated as this
* date, rather than the real "now".
*/
parse(
input: string,
options?: {
roundUp?: boolean;
forceNow?: boolean;
forceNow?: Date;
momentInstance?: typeof moment;
}
): moment.Moment | undefined;

View file

@ -150,6 +150,7 @@ module.exports = {
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/scope': 'error',
'jsx-a11y/tabindex-no-positive': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-indent': ['error', 2],
'react/no-will-update-set-state': 'error',

View file

@ -40,6 +40,8 @@ import {
NumberType,
ObjectType,
Props,
RecordOfOptions,
RecordOfType,
StringOptions,
StringType,
Type,
@ -105,6 +107,14 @@ function mapOf<K, V>(
return new MapOfType(keyType, valueType, options);
}
function recordOf<K extends string, V>(
keyType: Type<K>,
valueType: Type<V>,
options?: RecordOfOptions<K, V>
): Type<Record<K, V>> {
return new RecordOfType(keyType, valueType, options);
}
function oneOf<A, B, C, D, E, F, G, H, I, J>(
types: [Type<A>, Type<B>, Type<C>, Type<D>, Type<E>, Type<F>, Type<G>, Type<H>, Type<I>, Type<J>],
options?: TypeOptions<A | B | C | D | E | F | G | H | I | J>
@ -175,6 +185,7 @@ export const schema = {
number,
object,
oneOf,
recordOf,
siblingRef,
string,
};

View file

@ -274,6 +274,54 @@ export const internals = Joi.extend([
},
],
},
{
name: 'record',
pre(value: any, state: State, options: ValidationOptions) {
if (!isPlainObject(value)) {
return this.createError('record.base', { value }, state, options);
}
return value as any;
},
rules: [
anyCustomRule,
{
name: 'entries',
params: { key: Joi.object().schema(), value: Joi.object().schema() },
validate(params, value, state, options) {
const result = {} as Record<string, any>;
for (const [entryKey, entryValue] of Object.entries(value)) {
const { value: validatedEntryKey, error: keyError } = Joi.validate(
entryKey,
params.key
);
if (keyError) {
return this.createError('record.key', { entryKey, reason: keyError }, state, options);
}
const { value: validatedEntryValue, error: valueError } = Joi.validate(
entryValue,
params.value
);
if (valueError) {
return this.createError(
'record.value',
{ entryKey, reason: valueError },
state,
options
);
}
result[validatedEntryKey] = validatedEntryValue;
}
return result as any;
},
},
],
},
{
name: 'array',

View file

@ -1,10 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`fails when not receiving expected key type 1`] = `"[name]: expected value of type [number] but got [string]"`;
exports[`fails when not receiving expected key type 1`] = `"[key(\\"name\\")]: expected value of type [number] but got [string]"`;
exports[`fails when not receiving expected value type 1`] = `"[name]: expected value of type [string] but got [number]"`;
exports[`includes namespace in failure when wrong key type 1`] = `"[foo-namespace.name]: expected value of type [number] but got [string]"`;
exports[`includes namespace in failure when wrong key type 1`] = `"[foo-namespace.key(\\"name\\")]: expected value of type [number] but got [string]"`;
exports[`includes namespace in failure when wrong top-level type 1`] = `"[foo-namespace]: expected value of type [Map] or [object] but got [Array]"`;

View file

@ -29,5 +29,6 @@ export { MaybeType } from './maybe_type';
export { MapOfOptions, MapOfType } from './map_type';
export { NumberOptions, NumberType } from './number_type';
export { ObjectType, Props, TypeOf } from './object_type';
export { RecordOfOptions, RecordOfType } from './record_type';
export { StringOptions, StringType } from './string_type';
export { UnionType } from './union_type';

View file

@ -22,16 +22,14 @@ import { Type } from './type';
export class LiteralType<T> extends Type<T> {
constructor(value: T) {
super(internals.any(), {
// Before v13.3.0 Joi.any().value() didn't provide raw value if validation
// fails, so to display this value in error message we should provide
// custom validation function. Once we upgrade Joi, we'll be able to use
// `value()` with custom `any.allowOnly` error handler instead.
validate(valueToValidate) {
if (valueToValidate !== value) {
return `expected value to equal [${value}] but got [${valueToValidate}]`;
}
},
});
super(internals.any().valid(value));
}
protected handleError(type: string, { value, valids: [expectedValue] }: Record<string, any>) {
switch (type) {
case 'any.required':
case 'any.allowOnly':
return `expected value to equal [${expectedValue}] but got [${value}]`;
}
}
}

View file

@ -18,7 +18,7 @@
*/
import typeDetect from 'type-detect';
import { SchemaTypeError } from '../errors';
import { SchemaTypeError, SchemaTypesError } from '../errors';
import { internals } from '../internals';
import { Type, TypeOptions } from './type';
@ -51,9 +51,16 @@ export class MapOfType<K, V> extends Type<Map<K, V>> {
case 'map.key':
case 'map.value':
const childPathWithIndex = reason.path.slice();
childPathWithIndex.splice(path.length, 0, entryKey.toString());
childPathWithIndex.splice(
path.length,
0,
// If `key` validation failed, let's stress that to make error more obvious.
type === 'map.key' ? `key("${entryKey}")` : entryKey.toString()
);
return new SchemaTypeError(reason.message, childPathWithIndex);
return reason instanceof SchemaTypesError
? new SchemaTypesError(reason, childPathWithIndex, reason.errors)
: new SchemaTypeError(reason, childPathWithIndex);
}
}
}

View file

@ -0,0 +1,122 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import { schema } from '..';
test('handles object as input', () => {
const type = schema.recordOf(schema.string(), schema.string());
const value = {
name: 'foo',
};
expect(type.validate(value)).toEqual({ name: 'foo' });
});
test('fails when not receiving expected value type', () => {
const type = schema.recordOf(schema.string(), schema.string());
const value = {
name: 123,
};
expect(() => type.validate(value)).toThrowErrorMatchingInlineSnapshot(
`"[name]: expected value of type [string] but got [number]"`
);
});
test('fails when not receiving expected key type', () => {
const type = schema.recordOf(
schema.oneOf([schema.literal('nickName'), schema.literal('lastName')]),
schema.string()
);
const value = {
name: 'foo',
};
expect(() => type.validate(value)).toThrowErrorMatchingInlineSnapshot(`
"[key(\\"name\\")]: types that failed validation:
- [0]: expected value to equal [nickName] but got [name]
- [1]: expected value to equal [lastName] but got [name]"
`);
});
test('includes namespace in failure when wrong top-level type', () => {
const type = schema.recordOf(schema.string(), schema.string());
expect(() => type.validate([], {}, 'foo-namespace')).toThrowErrorMatchingInlineSnapshot(
`"[foo-namespace]: expected value of type [object] but got [Array]"`
);
});
test('includes namespace in failure when wrong value type', () => {
const type = schema.recordOf(schema.string(), schema.string());
const value = {
name: 123,
};
expect(() => type.validate(value, {}, 'foo-namespace')).toThrowErrorMatchingInlineSnapshot(
`"[foo-namespace.name]: expected value of type [string] but got [number]"`
);
});
test('includes namespace in failure when wrong key type', () => {
const type = schema.recordOf(schema.string({ minLength: 10 }), schema.string());
const value = {
name: 'foo',
};
expect(() => type.validate(value, {}, 'foo-namespace')).toThrowErrorMatchingInlineSnapshot(
`"[foo-namespace.key(\\"name\\")]: value is [name] but it must have a minimum length of [10]."`
);
});
test('returns default value if undefined', () => {
const obj = { foo: 'bar' };
const type = schema.recordOf(schema.string(), schema.string(), {
defaultValue: obj,
});
expect(type.validate(undefined)).toEqual(obj);
});
test('recordOf within recordOf', () => {
const type = schema.recordOf(schema.string(), schema.recordOf(schema.string(), schema.number()));
const value = {
foo: {
bar: 123,
},
};
expect(type.validate(value)).toEqual({ foo: { bar: 123 } });
});
test('object within recordOf', () => {
const type = schema.recordOf(
schema.string(),
schema.object({
bar: schema.number(),
})
);
const value = {
foo: {
bar: 123,
},
};
expect(type.validate(value)).toEqual({ foo: { bar: 123 } });
});

View file

@ -0,0 +1,58 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import typeDetect from 'type-detect';
import { SchemaTypeError, SchemaTypesError } from '../errors';
import { internals } from '../internals';
import { Type, TypeOptions } from './type';
export type RecordOfOptions<K extends string, V> = TypeOptions<Record<K, V>>;
export class RecordOfType<K extends string, V> extends Type<Record<K, V>> {
constructor(keyType: Type<K>, valueType: Type<V>, options: RecordOfOptions<K, V> = {}) {
const schema = internals.record().entries(keyType.getSchema(), valueType.getSchema());
super(schema, options);
}
protected handleError(
type: string,
{ entryKey, reason, value }: Record<string, any>,
path: string[]
) {
switch (type) {
case 'any.required':
case 'record.base':
return `expected value of type [object] but got [${typeDetect(value)}]`;
case 'record.key':
case 'record.value':
const childPathWithIndex = reason.path.slice();
childPathWithIndex.splice(
path.length,
0,
// If `key` validation failed, let's stress that to make error more obvious.
type === 'record.key' ? `key("${entryKey}")` : entryKey.toString()
);
return reason instanceof SchemaTypesError
? new SchemaTypesError(reason, childPathWithIndex, reason.errors)
: new SchemaTypeError(reason, childPathWithIndex);
}
}
}

View file

@ -38,7 +38,7 @@ export abstract class Type<V> {
*/
protected readonly internalSchema: AnySchema;
constructor(schema: AnySchema, options: TypeOptions<V> = {}) {
protected constructor(schema: AnySchema, options: TypeOptions<V> = {}) {
if (options.defaultValue !== undefined) {
schema = schema.optional();
@ -62,7 +62,7 @@ export abstract class Type<V> {
// only the last error handler is counted.
const schemaFlags = (schema.describe().flags as Record<string, any>) || {};
if (schemaFlags.error === undefined) {
schema = schema.error!(([error]) => this.onError(error));
schema = schema.error(([error]) => this.onError(error));
}
this.internalSchema = schema;

View file

@ -29,11 +29,15 @@ declare module 'joi' {
entries(key: AnySchema, value: AnySchema): this;
}
// In more recent Joi types we can use `Root` type instead of `typeof Joi`.
export type JoiRoot = typeof Joi & {
interface RecordSchema extends AnySchema {
entries(key: AnySchema, value: AnySchema): this;
}
export type JoiRoot = Joi.Root & {
bytes: () => BytesSchema;
duration: () => AnySchema;
map: () => MapSchema;
record: () => RecordSchema;
};
interface AnySchema {
@ -44,8 +48,4 @@ declare module 'joi' {
interface ObjectSchema {
schema(): this;
}
// Joi types define only signature with single extension, but Joi supports
// an array form as well. It's fixed in more recent Joi types.
function extend(extension: Joi.Extension | Joi.Extension[]): any;
}

View file

@ -33,21 +33,7 @@ For example:
src/legacy/core_plugins/kibana/translations/fr.json
```
When a new translation file is added, you have to register this file into
`uiExports.translations` array of plugin constructor parameters. For example:
```js
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
translations: [
resolve(__dirname, './translations/fr.json'),
],
...
},
...
});
}
```
The engine scans `x-pack/plugins/*/translations`, `src/core_plugins/*/translations`, `plugins/*/translations` and `src/ui/translations` folders on initialization, so there is no need to register translation files.
The engine uses a `config/kibana.yml` file for locale resolution process. If locale is
defined via `i18n.locale` option in `config/kibana.yml` then it will be used as a base
@ -223,7 +209,7 @@ ReactDOM.render(
```
After that we can use `FormattedMessage` components inside `RootComponent`:
```js
```jsx
import React, { Component } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
@ -247,10 +233,10 @@ class RootComponent extends Component {
<p>
<FormattedMessage
id="welcome"
defaultMessage={`Hello {name}, you have {unreadCount, number} {unreadCount, plural,
defaultMessage="Hello {name}, you have {unreadCount, number} {unreadCount, plural,
one {message}
other {messages}
}`}
}"
values={{name: <b>{name}</b>, unreadCount}}
/>
...
@ -273,11 +259,35 @@ import { Header } from './components/header';
module.directive('headerGlobalNav', (reactDirective) => {
return reactDirective(injectI18nProvider(Header));
});
```
**NOTE:** To minimize the chance of having multiple `I18nProvider` components in the React tree, try to use `injectI18nProvider` or `I18nProvider` only to wrap the topmost component that you render, e.g. the one that's passed to `reactDirective` or `ReactDOM.render`.
### FormattedRelative
`FormattedRelative` expects several attributes (read more [here](https://github.com/yahoo/react-intl/wiki/Components#formattedrelative)), including
- `value` that can be parsed as a date,
- `formats` that should be one of `'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds'` (this options are configured in [`formats.ts`](./src/core/formats.ts))
- etc.
If `formats` is not provided then it will be chosen automatically:\
`x seconds ago` for `x < 60`, `1 minute ago` for `60 <= x < 120`, etc.
```jsx
<FormattedRelative
value={Date.now() - 90000}
format="seconds"
/>
```
Initial result: `90 seconds ago`
```jsx
<FormattedRelative
value={Date.now() - 90000}
/>
```
Initial result: `1 minute ago`
### Attributes translation in React
React wrapper provides an ability to inject the imperative formatting API into a React component via its props using `injectI18n` Higher-Order Component. This should be used when your React component needs to format data to a string value where a React element is not suitable; e.g., a `title` or `aria` attribute. In order to use it you should wrap your component with `injectI18n` Higher-Order Component. The formatting API will be provided to the wrapped component via `props.intl`.

View file

@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`translateUsingPseudoLocale() should translate @I18N@ placeholders with wrong reference name 1`] = `"Ṁéšššàĝĝé ŵîîţĥ àà @Î18Ñ@ññôñ-ššîñĝĝļé-ŵŵôŕðð@Î18Ñ@ þþļàççéĥôôļðééŕ."`;
exports[`translateUsingPseudoLocale() shouldn't translate @I18N@ placeholders 1`] = `"Ṁéšššàĝĝé ŵîîţĥ àà @I18N@value@I18N@ þļààçéĥĥôļððéŕ."`;
exports[`translateUsingPseudoLocale() shouldn't translate @I18N@ placeholders with underscore 1`] = `"Ṁéšššàĝĝé ŵîîţĥ àà @I18N@snake_case_value@I18N@ þļààçéĥĥôļððéŕ."`;

View file

@ -83,6 +83,26 @@ export const formats: Formats = {
timeZoneName: 'short',
},
},
relative: {
years: {
units: 'year',
},
months: {
units: 'month',
},
days: {
units: 'day',
},
hours: {
units: 'hour',
},
minutes: {
units: 'minute',
},
seconds: {
units: 'second',
},
},
};
interface NumberFormatOptions<TStyle extends string> extends Intl.NumberFormatOptions {
@ -111,6 +131,12 @@ export interface Formats {
long: DateTimeFormatOptions;
full: DateTimeFormatOptions;
}>;
relative?: Partial<{
[key: string]: {
style?: 'numeric' | 'best fit';
units: 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second';
};
}>;
}
interface DateTimeFormatOptions extends Intl.DateTimeFormatOptions {

View file

@ -1,7 +1,6 @@
/* eslint-disable */
// TODO: Get rid of this file once https://github.com/elastic/kibana/pull/20105
// is merged and use dynamic import for asynchronous loading of specific locale data
// Copied from https://github.com/yahoo/intl-relativeformat/tree/master/dist/locale-data
import IntlMessageFormat from 'intl-messageformat';
import IntlRelativeFormat from 'intl-relativeformat';
@ -11,556 +10,18 @@ function addLocaleData(localeData) {
IntlRelativeFormat.__addLocaleData(localeData);
}
addLocaleData({"locale":"af","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"af-NA","parentLocale":"af"});
addLocaleData({"locale":"agq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ak","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"am","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"ar","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return n==0?"zero":n==1?"one":n==2?"two":n100>=3&&n100<=10?"few":n100>=11&&n100<=99?"many":"other"}});
addLocaleData({"locale":"ar-AE","parentLocale":"ar"});
addLocaleData({"locale":"ar-BH","parentLocale":"ar"});
addLocaleData({"locale":"ar-DJ","parentLocale":"ar"});
addLocaleData({"locale":"ar-DZ","parentLocale":"ar"});
addLocaleData({"locale":"ar-EG","parentLocale":"ar"});
addLocaleData({"locale":"ar-EH","parentLocale":"ar"});
addLocaleData({"locale":"ar-ER","parentLocale":"ar"});
addLocaleData({"locale":"ar-IL","parentLocale":"ar"});
addLocaleData({"locale":"ar-IQ","parentLocale":"ar"});
addLocaleData({"locale":"ar-JO","parentLocale":"ar"});
addLocaleData({"locale":"ar-KM","parentLocale":"ar"});
addLocaleData({"locale":"ar-KW","parentLocale":"ar"});
addLocaleData({"locale":"ar-LB","parentLocale":"ar"});
addLocaleData({"locale":"ar-LY","parentLocale":"ar"});
addLocaleData({"locale":"ar-MA","parentLocale":"ar"});
addLocaleData({"locale":"ar-MR","parentLocale":"ar"});
addLocaleData({"locale":"ar-OM","parentLocale":"ar"});
addLocaleData({"locale":"ar-PS","parentLocale":"ar"});
addLocaleData({"locale":"ar-QA","parentLocale":"ar"});
addLocaleData({"locale":"ar-SA","parentLocale":"ar"});
addLocaleData({"locale":"ar-SD","parentLocale":"ar"});
addLocaleData({"locale":"ar-SO","parentLocale":"ar"});
addLocaleData({"locale":"ar-SS","parentLocale":"ar"});
addLocaleData({"locale":"ar-SY","parentLocale":"ar"});
addLocaleData({"locale":"ar-TD","parentLocale":"ar"});
addLocaleData({"locale":"ar-TN","parentLocale":"ar"});
addLocaleData({"locale":"ar-YE","parentLocale":"ar"});
addLocaleData({"locale":"as","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5||n==7||n==8||n==9||n==10?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"asa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ast","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"az","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],i10=i.slice(-1),i100=i.slice(-2),i1000=i.slice(-3);if(ord)return i10==1||i10==2||i10==5||i10==7||i10==8||(i100==20||i100==50||i100==70||i100==80)?"one":i10==3||i10==4||(i1000==100||i1000==200||i1000==300||i1000==400||i1000==500||i1000==600||i1000==700||i1000==800||i1000==900)?"few":i==0||i10==6||(i100==40||i100==60||i100==90)?"many":"other";return n==1?"one":"other"}});
addLocaleData({"locale":"az-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"az-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"az-Latn","parentLocale":"az"});
addLocaleData({"locale":"bas","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"be","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(n10==2||n10==3)&&n100!=12&&n100!=13?"few":"other";return n10==1&&n100!=11?"one":n10>=2&&n10<=4&&(n100<12||n100>14)?"few":t0&&n10==0||n10>=5&&n10<=9||n100>=11&&n100<=14?"many":"other"}});
addLocaleData({"locale":"bem","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"bez","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"bg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"bh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"bm","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"bm-Nkoo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"bn","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5||n==7||n==8||n==9||n==10?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"bn-IN","parentLocale":"bn"});
addLocaleData({"locale":"bo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"bo-IN","parentLocale":"bo"});
addLocaleData({"locale":"br","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),n1000000=t0&&s[0].slice(-6);if(ord)return"other";return n10==1&&n100!=11&&n100!=71&&n100!=91?"one":n10==2&&n100!=12&&n100!=72&&n100!=92?"two":(n10==3||n10==4||n10==9)&&(n100<10||n100>19)&&(n100<70||n100>79)&&(n100<90||n100>99)?"few":n!=0&&t0&&n1000000==0?"many":"other"}});
addLocaleData({"locale":"brx","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"bs","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}});
addLocaleData({"locale":"bs-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"bs-Latn","parentLocale":"bs"});
addLocaleData({"locale":"ca","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return n==1||n==3?"one":n==2?"two":n==4?"few":"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"ca-AD","parentLocale":"ca"});
addLocaleData({"locale":"ca-ES-VALENCIA","parentLocale":"ca-ES"});
addLocaleData({"locale":"ca-ES","parentLocale":"ca"});
addLocaleData({"locale":"ca-FR","parentLocale":"ca"});
addLocaleData({"locale":"ca-IT","parentLocale":"ca"});
addLocaleData({"locale":"ce","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"cgg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"chr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ckb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ckb-IR","parentLocale":"ckb"});
addLocaleData({"locale":"cs","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1];if(ord)return"other";return n==1&&v0?"one":i>=2&&i<=4&&v0?"few":!v0?"many":"other"}});
addLocaleData({"locale":"cu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"cy","pluralRuleFunction":function (n,ord){if(ord)return n==0||n==7||n==8||n==9?"zero":n==1?"one":n==2?"two":n==3||n==4?"few":n==5||n==6?"many":"other";return n==0?"zero":n==1?"one":n==2?"two":n==3?"few":n==6?"many":"other"}});
addLocaleData({"locale":"da","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n;if(ord)return"other";return n==1||!t0&&(i==0||i==1)?"one":"other"}});
addLocaleData({"locale":"da-GL","parentLocale":"da"});
addLocaleData({"locale":"dav","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"de","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"de-AT","parentLocale":"de"});
addLocaleData({"locale":"de-BE","parentLocale":"de"});
addLocaleData({"locale":"de-CH","parentLocale":"de"});
addLocaleData({"locale":"de-LI","parentLocale":"de"});
addLocaleData({"locale":"de-LU","parentLocale":"de"});
addLocaleData({"locale":"dje","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"dsb","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&i100==1||f100==1?"one":v0&&i100==2||f100==2?"two":v0&&(i100==3||i100==4)||(f100==3||f100==4)?"few":"other"}});
addLocaleData({"locale":"dua","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"dv","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"dyo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"dz","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ebu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ee","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ee-TG","parentLocale":"ee"});
addLocaleData({"locale":"el","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"el-CY","parentLocale":"el"});
addLocaleData({"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"en-001","parentLocale":"en"});
addLocaleData({"locale":"en-150","parentLocale":"en-001"});
addLocaleData({"locale":"en-AG","parentLocale":"en-001"});
addLocaleData({"locale":"en-AI","parentLocale":"en-001"});
addLocaleData({"locale":"en-AS","parentLocale":"en"});
addLocaleData({"locale":"en-AT","parentLocale":"en-150"});
addLocaleData({"locale":"en-AU","parentLocale":"en-001"});
addLocaleData({"locale":"en-BB","parentLocale":"en-001"});
addLocaleData({"locale":"en-BE","parentLocale":"en-001"});
addLocaleData({"locale":"en-BI","parentLocale":"en"});
addLocaleData({"locale":"en-BM","parentLocale":"en-001"});
addLocaleData({"locale":"en-BS","parentLocale":"en-001"});
addLocaleData({"locale":"en-BW","parentLocale":"en-001"});
addLocaleData({"locale":"en-BZ","parentLocale":"en-001"});
addLocaleData({"locale":"en-CA","parentLocale":"en-001"});
addLocaleData({"locale":"en-CC","parentLocale":"en-001"});
addLocaleData({"locale":"en-CH","parentLocale":"en-150"});
addLocaleData({"locale":"en-CK","parentLocale":"en-001"});
addLocaleData({"locale":"en-CM","parentLocale":"en-001"});
addLocaleData({"locale":"en-CX","parentLocale":"en-001"});
addLocaleData({"locale":"en-CY","parentLocale":"en-001"});
addLocaleData({"locale":"en-DE","parentLocale":"en-150"});
addLocaleData({"locale":"en-DG","parentLocale":"en-001"});
addLocaleData({"locale":"en-DK","parentLocale":"en-150"});
addLocaleData({"locale":"en-DM","parentLocale":"en-001"});
addLocaleData({"locale":"en-Dsrt","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"en-ER","parentLocale":"en-001"});
addLocaleData({"locale":"en-FI","parentLocale":"en-150"});
addLocaleData({"locale":"en-FJ","parentLocale":"en-001"});
addLocaleData({"locale":"en-FK","parentLocale":"en-001"});
addLocaleData({"locale":"en-FM","parentLocale":"en-001"});
addLocaleData({"locale":"en-GB","parentLocale":"en-001"});
addLocaleData({"locale":"en-GD","parentLocale":"en-001"});
addLocaleData({"locale":"en-GG","parentLocale":"en-001"});
addLocaleData({"locale":"en-GH","parentLocale":"en-001"});
addLocaleData({"locale":"en-GI","parentLocale":"en-001"});
addLocaleData({"locale":"en-GM","parentLocale":"en-001"});
addLocaleData({"locale":"en-GU","parentLocale":"en"});
addLocaleData({"locale":"en-GY","parentLocale":"en-001"});
addLocaleData({"locale":"en-HK","parentLocale":"en-001"});
addLocaleData({"locale":"en-IE","parentLocale":"en-001"});
addLocaleData({"locale":"en-IL","parentLocale":"en-001"});
addLocaleData({"locale":"en-IM","parentLocale":"en-001"});
addLocaleData({"locale":"en-IN","parentLocale":"en-001"});
addLocaleData({"locale":"en-IO","parentLocale":"en-001"});
addLocaleData({"locale":"en-JE","parentLocale":"en-001"});
addLocaleData({"locale":"en-JM","parentLocale":"en-001"});
addLocaleData({"locale":"en-KE","parentLocale":"en-001"});
addLocaleData({"locale":"en-KI","parentLocale":"en-001"});
addLocaleData({"locale":"en-KN","parentLocale":"en-001"});
addLocaleData({"locale":"en-KY","parentLocale":"en-001"});
addLocaleData({"locale":"en-LC","parentLocale":"en-001"});
addLocaleData({"locale":"en-LR","parentLocale":"en-001"});
addLocaleData({"locale":"en-LS","parentLocale":"en-001"});
addLocaleData({"locale":"en-MG","parentLocale":"en-001"});
addLocaleData({"locale":"en-MH","parentLocale":"en"});
addLocaleData({"locale":"en-MO","parentLocale":"en-001"});
addLocaleData({"locale":"en-MP","parentLocale":"en"});
addLocaleData({"locale":"en-MS","parentLocale":"en-001"});
addLocaleData({"locale":"en-MT","parentLocale":"en-001"});
addLocaleData({"locale":"en-MU","parentLocale":"en-001"});
addLocaleData({"locale":"en-MW","parentLocale":"en-001"});
addLocaleData({"locale":"en-MY","parentLocale":"en-001"});
addLocaleData({"locale":"en-NA","parentLocale":"en-001"});
addLocaleData({"locale":"en-NF","parentLocale":"en-001"});
addLocaleData({"locale":"en-NG","parentLocale":"en-001"});
addLocaleData({"locale":"en-NL","parentLocale":"en-150"});
addLocaleData({"locale":"en-NR","parentLocale":"en-001"});
addLocaleData({"locale":"en-NU","parentLocale":"en-001"});
addLocaleData({"locale":"en-NZ","parentLocale":"en-001"});
addLocaleData({"locale":"en-PG","parentLocale":"en-001"});
addLocaleData({"locale":"en-PH","parentLocale":"en-001"});
addLocaleData({"locale":"en-PK","parentLocale":"en-001"});
addLocaleData({"locale":"en-PN","parentLocale":"en-001"});
addLocaleData({"locale":"en-PR","parentLocale":"en"});
addLocaleData({"locale":"en-PW","parentLocale":"en-001"});
addLocaleData({"locale":"en-RW","parentLocale":"en-001"});
addLocaleData({"locale":"en-SB","parentLocale":"en-001"});
addLocaleData({"locale":"en-SC","parentLocale":"en-001"});
addLocaleData({"locale":"en-SD","parentLocale":"en-001"});
addLocaleData({"locale":"en-SE","parentLocale":"en-150"});
addLocaleData({"locale":"en-SG","parentLocale":"en-001"});
addLocaleData({"locale":"en-SH","parentLocale":"en-001"});
addLocaleData({"locale":"en-SI","parentLocale":"en-150"});
addLocaleData({"locale":"en-SL","parentLocale":"en-001"});
addLocaleData({"locale":"en-SS","parentLocale":"en-001"});
addLocaleData({"locale":"en-SX","parentLocale":"en-001"});
addLocaleData({"locale":"en-SZ","parentLocale":"en-001"});
addLocaleData({"locale":"en-Shaw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"en-TC","parentLocale":"en-001"});
addLocaleData({"locale":"en-TK","parentLocale":"en-001"});
addLocaleData({"locale":"en-TO","parentLocale":"en-001"});
addLocaleData({"locale":"en-TT","parentLocale":"en-001"});
addLocaleData({"locale":"en-TV","parentLocale":"en-001"});
addLocaleData({"locale":"en-TZ","parentLocale":"en-001"});
addLocaleData({"locale":"en-UG","parentLocale":"en-001"});
addLocaleData({"locale":"en-UM","parentLocale":"en"});
addLocaleData({"locale":"en-US","parentLocale":"en"});
addLocaleData({"locale":"en-VC","parentLocale":"en-001"});
addLocaleData({"locale":"en-VG","parentLocale":"en-001"});
addLocaleData({"locale":"en-VI","parentLocale":"en"});
addLocaleData({"locale":"en-VU","parentLocale":"en-001"});
addLocaleData({"locale":"en-WS","parentLocale":"en-001"});
addLocaleData({"locale":"en-ZA","parentLocale":"en-001"});
addLocaleData({"locale":"en-ZM","parentLocale":"en-001"});
addLocaleData({"locale":"en-ZW","parentLocale":"en-001"});
addLocaleData({"locale":"eo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"es","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"es-419","parentLocale":"es"});
addLocaleData({"locale":"es-AR","parentLocale":"es-419"});
addLocaleData({"locale":"es-BO","parentLocale":"es-419"});
addLocaleData({"locale":"es-CL","parentLocale":"es-419"});
addLocaleData({"locale":"es-CO","parentLocale":"es-419"});
addLocaleData({"locale":"es-CR","parentLocale":"es-419"});
addLocaleData({"locale":"es-CU","parentLocale":"es-419"});
addLocaleData({"locale":"es-DO","parentLocale":"es-419"});
addLocaleData({"locale":"es-EA","parentLocale":"es"});
addLocaleData({"locale":"es-EC","parentLocale":"es-419"});
addLocaleData({"locale":"es-GQ","parentLocale":"es"});
addLocaleData({"locale":"es-GT","parentLocale":"es-419"});
addLocaleData({"locale":"es-HN","parentLocale":"es-419"});
addLocaleData({"locale":"es-IC","parentLocale":"es"});
addLocaleData({"locale":"es-MX","parentLocale":"es-419"});
addLocaleData({"locale":"es-NI","parentLocale":"es-419"});
addLocaleData({"locale":"es-PA","parentLocale":"es-419"});
addLocaleData({"locale":"es-PE","parentLocale":"es-419"});
addLocaleData({"locale":"es-PH","parentLocale":"es"});
addLocaleData({"locale":"es-PR","parentLocale":"es-419"});
addLocaleData({"locale":"es-PY","parentLocale":"es-419"});
addLocaleData({"locale":"es-SV","parentLocale":"es-419"});
addLocaleData({"locale":"es-US","parentLocale":"es-419"});
addLocaleData({"locale":"es-UY","parentLocale":"es-419"});
addLocaleData({"locale":"es-VE","parentLocale":"es-419"});
addLocaleData({"locale":"et","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"eu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ewo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"fa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"fa-AF","parentLocale":"fa"});
addLocaleData({"locale":"ff","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<2?"one":"other"}});
addLocaleData({"locale":"ff-CM","parentLocale":"ff"});
addLocaleData({"locale":"ff-GN","parentLocale":"ff"});
addLocaleData({"locale":"ff-MR","parentLocale":"ff"});
addLocaleData({"locale":"fi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"fil","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return n==1?"one":"other";return v0&&(i==1||i==2||i==3)||v0&&i10!=4&&i10!=6&&i10!=9||!v0&&f10!=4&&f10!=6&&f10!=9?"one":"other"}});
addLocaleData({"locale":"fo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"fo-DK","parentLocale":"fo"});
addLocaleData({"locale":"fr","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"}});
addLocaleData({"locale":"fr-BE","parentLocale":"fr"});
addLocaleData({"locale":"fr-BF","parentLocale":"fr"});
addLocaleData({"locale":"fr-BI","parentLocale":"fr"});
addLocaleData({"locale":"fr-BJ","parentLocale":"fr"});
addLocaleData({"locale":"fr-BL","parentLocale":"fr"});
addLocaleData({"locale":"fr-CA","parentLocale":"fr"});
addLocaleData({"locale":"fr-CD","parentLocale":"fr"});
addLocaleData({"locale":"fr-CF","parentLocale":"fr"});
addLocaleData({"locale":"fr-CG","parentLocale":"fr"});
addLocaleData({"locale":"fr-CH","parentLocale":"fr"});
addLocaleData({"locale":"fr-CI","parentLocale":"fr"});
addLocaleData({"locale":"fr-CM","parentLocale":"fr"});
addLocaleData({"locale":"fr-DJ","parentLocale":"fr"});
addLocaleData({"locale":"fr-DZ","parentLocale":"fr"});
addLocaleData({"locale":"fr-GA","parentLocale":"fr"});
addLocaleData({"locale":"fr-GF","parentLocale":"fr"});
addLocaleData({"locale":"fr-GN","parentLocale":"fr"});
addLocaleData({"locale":"fr-GP","parentLocale":"fr"});
addLocaleData({"locale":"fr-GQ","parentLocale":"fr"});
addLocaleData({"locale":"fr-HT","parentLocale":"fr"});
addLocaleData({"locale":"fr-KM","parentLocale":"fr"});
addLocaleData({"locale":"fr-LU","parentLocale":"fr"});
addLocaleData({"locale":"fr-MA","parentLocale":"fr"});
addLocaleData({"locale":"fr-MC","parentLocale":"fr"});
addLocaleData({"locale":"fr-MF","parentLocale":"fr"});
addLocaleData({"locale":"fr-MG","parentLocale":"fr"});
addLocaleData({"locale":"fr-ML","parentLocale":"fr"});
addLocaleData({"locale":"fr-MQ","parentLocale":"fr"});
addLocaleData({"locale":"fr-MR","parentLocale":"fr"});
addLocaleData({"locale":"fr-MU","parentLocale":"fr"});
addLocaleData({"locale":"fr-NC","parentLocale":"fr"});
addLocaleData({"locale":"fr-NE","parentLocale":"fr"});
addLocaleData({"locale":"fr-PF","parentLocale":"fr"});
addLocaleData({"locale":"fr-PM","parentLocale":"fr"});
addLocaleData({"locale":"fr-RE","parentLocale":"fr"});
addLocaleData({"locale":"fr-RW","parentLocale":"fr"});
addLocaleData({"locale":"fr-SC","parentLocale":"fr"});
addLocaleData({"locale":"fr-SN","parentLocale":"fr"});
addLocaleData({"locale":"fr-SY","parentLocale":"fr"});
addLocaleData({"locale":"fr-TD","parentLocale":"fr"});
addLocaleData({"locale":"fr-TG","parentLocale":"fr"});
addLocaleData({"locale":"fr-TN","parentLocale":"fr"});
addLocaleData({"locale":"fr-VU","parentLocale":"fr"});
addLocaleData({"locale":"fr-WF","parentLocale":"fr"});
addLocaleData({"locale":"fr-YT","parentLocale":"fr"});
addLocaleData({"locale":"fur","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"fy","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"ga","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return n==1?"one":"other";return n==1?"one":n==2?"two":t0&&n>=3&&n<=6?"few":t0&&n>=7&&n<=10?"many":"other"}});
addLocaleData({"locale":"gd","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n==1||n==11?"one":n==2||n==12?"two":t0&&n>=3&&n<=10||t0&&n>=13&&n<=19?"few":"other"}});
addLocaleData({"locale":"gl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"gsw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"gsw-FR","parentLocale":"gsw"});
addLocaleData({"locale":"gsw-LI","parentLocale":"gsw"});
addLocaleData({"locale":"gu","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"guw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"guz","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"gv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&i10==1?"one":v0&&i10==2?"two":v0&&(i100==0||i100==20||i100==40||i100==60||i100==80)?"few":!v0?"many":"other"}});
addLocaleData({"locale":"ha","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ha-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ha-GH","parentLocale":"ha"});
addLocaleData({"locale":"ha-NE","parentLocale":"ha"});
addLocaleData({"locale":"haw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"he","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return n==1&&v0?"one":i==2&&v0?"two":v0&&(n<0||n>10)&&t0&&n10==0?"many":"other"}});
addLocaleData({"locale":"hi","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":n==6?"many":"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"hr","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}});
addLocaleData({"locale":"hr-BA","parentLocale":"hr"});
addLocaleData({"locale":"hsb","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i100=i.slice(-2),f100=f.slice(-2);if(ord)return"other";return v0&&i100==1||f100==1?"one":v0&&i100==2||f100==2?"two":v0&&(i100==3||i100==4)||(f100==3||f100==4)?"few":"other"}});
addLocaleData({"locale":"hu","pluralRuleFunction":function (n,ord){if(ord)return n==1||n==5?"one":"other";return n==1?"one":"other"}});
addLocaleData({"locale":"hy","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"}});
addLocaleData({"locale":"id","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ig","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ii","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"in","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"is","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],t0=Number(s[0])==n,i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return t0&&i10==1&&i100!=11||!t0?"one":"other"}});
addLocaleData({"locale":"it","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return n==11||n==8||n==80||n==800?"many":"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"it-CH","parentLocale":"it"});
addLocaleData({"locale":"it-SM","parentLocale":"it"});
addLocaleData({"locale":"iu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"iu-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"iw","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return"other";return n==1&&v0?"one":i==2&&v0?"two":v0&&(n<0||n>10)&&t0&&n10==0?"many":"other"}});
addLocaleData({"locale":"ja","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"jbo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"jgo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ji","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"jmc","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"jv","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"jw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ka","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],i100=i.slice(-2);if(ord)return i==1?"one":i==0||(i100>=2&&i100<=20||i100==40||i100==60||i100==80)?"many":"other";return n==1?"one":"other"}});
addLocaleData({"locale":"kab","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<2?"one":"other"}});
addLocaleData({"locale":"kaj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"kam","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"kcg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"kde","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"kea","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"khq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ki","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"kk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1);if(ord)return n10==6||n10==9||t0&&n10==0&&n!=0?"many":"other";return n==1?"one":"other"}});
addLocaleData({"locale":"kkj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"kl","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"kln","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"km","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"kn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"ko","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ko-KP","parentLocale":"ko"});
addLocaleData({"locale":"kok","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ks","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ksb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ksf","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ksh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0?"zero":n==1?"one":"other"}});
addLocaleData({"locale":"ku","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"kw","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"ky","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"lag","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0];if(ord)return"other";return n==0?"zero":(i==0||i==1)&&n!=0?"one":"other"}});
addLocaleData({"locale":"lb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"lg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"lkt","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ln","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"ln-AO","parentLocale":"ln"});
addLocaleData({"locale":"ln-CF","parentLocale":"ln"});
addLocaleData({"locale":"ln-CG","parentLocale":"ln"});
addLocaleData({"locale":"lo","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}});
addLocaleData({"locale":"lrc","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"lrc-IQ","parentLocale":"lrc"});
addLocaleData({"locale":"lt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return"other";return n10==1&&(n100<11||n100>19)?"one":n10>=2&&n10<=9&&(n100<11||n100>19)?"few":f!=0?"many":"other"}});
addLocaleData({"locale":"lu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"luo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"luy","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"lv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",v=f.length,t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&n10==0||n100>=11&&n100<=19||v==2&&(f100>=11&&f100<=19)?"zero":n10==1&&n100!=11||v==2&&f10==1&&f100!=11||v!=2&&f10==1?"one":"other"}});
addLocaleData({"locale":"mas","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"mas-TZ","parentLocale":"mas"});
addLocaleData({"locale":"mer","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"mfe","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"mg","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"mgh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"mgo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"mk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1);if(ord)return i10==1&&i100!=11?"one":i10==2&&i100!=12?"two":(i10==7||i10==8)&&i100!=17&&i100!=18?"many":"other";return v0&&i10==1||f10==1?"one":"other"}});
addLocaleData({"locale":"ml","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"mn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"mn-Mong","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"mo","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":"other";return n==1&&v0?"one":!v0||n==0||n!=1&&(n100>=1&&n100<=19)?"few":"other"}});
addLocaleData({"locale":"mr","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":n==2||n==3?"two":n==4?"few":"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({"locale":"ms","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}});
addLocaleData({"locale":"ms-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ms-BN","parentLocale":"ms"});
addLocaleData({"locale":"ms-SG","parentLocale":"ms"});
addLocaleData({"locale":"mt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return"other";return n==1?"one":n==0||n100>=2&&n100<=10?"few":n100>=11&&n100<=19?"many":"other"}});
addLocaleData({"locale":"mua","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"my","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"mzn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"nah","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"naq","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"nb","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"nb-SJ","parentLocale":"nb"});
addLocaleData({"locale":"nd","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ne","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return t0&&n>=1&&n<=4?"one":"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ne-IN","parentLocale":"ne"});
addLocaleData({"locale":"nl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"nl-AW","parentLocale":"nl"});
addLocaleData({"locale":"nl-BE","parentLocale":"nl"});
addLocaleData({"locale":"nl-BQ","parentLocale":"nl"});
addLocaleData({"locale":"nl-CW","parentLocale":"nl"});
addLocaleData({"locale":"nl-SR","parentLocale":"nl"});
addLocaleData({"locale":"nl-SX","parentLocale":"nl"});
addLocaleData({"locale":"nmg","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"nn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"nnh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"no","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"nqo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"nr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"nso","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"nus","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ny","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"nyn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"om","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"om-KE","parentLocale":"om"});
addLocaleData({"locale":"or","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"os","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"os-RU","parentLocale":"os"});
addLocaleData({"locale":"pa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"pa-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"pa-Guru","parentLocale":"pa"});
addLocaleData({"locale":"pap","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"pl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return n==1&&v0?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i!=1&&(i10==0||i10==1)||v0&&(i10>=5&&i10<=9)||v0&&(i100>=12&&i100<=14)?"many":"other"}});
addLocaleData({"locale":"prg","pluralRuleFunction":function (n,ord){var s=String(n).split("."),f=s[1]||"",v=f.length,t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),f100=f.slice(-2),f10=f.slice(-1);if(ord)return"other";return t0&&n10==0||n100>=11&&n100<=19||v==2&&(f100>=11&&f100<=19)?"zero":n10==1&&n100!=11||v==2&&f10==1&&f100!=11||v!=2&&f10==1?"one":"other"}});
addLocaleData({"locale":"ps","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"pt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return t0&&n>=0&&n<=2&&n!=2?"one":"other"}});
addLocaleData({"locale":"pt-AO","parentLocale":"pt-PT"});
addLocaleData({"locale":"pt-PT","parentLocale":"pt","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"pt-CV","parentLocale":"pt-PT"});
addLocaleData({"locale":"pt-GW","parentLocale":"pt-PT"});
addLocaleData({"locale":"pt-MO","parentLocale":"pt-PT"});
addLocaleData({"locale":"pt-MZ","parentLocale":"pt-PT"});
addLocaleData({"locale":"pt-ST","parentLocale":"pt-PT"});
addLocaleData({"locale":"pt-TL","parentLocale":"pt-PT"});
addLocaleData({"locale":"qu","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"qu-BO","parentLocale":"qu"});
addLocaleData({"locale":"qu-EC","parentLocale":"qu"});
addLocaleData({"locale":"rm","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"rn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ro","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":"other";return n==1&&v0?"one":!v0||n==0||n!=1&&(n100>=1&&n100<=19)?"few":"other"}});
addLocaleData({"locale":"ro-MD","parentLocale":"ro"});
addLocaleData({"locale":"rof","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ru","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i10=i.slice(-1),i100=i.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i10==0||v0&&(i10>=5&&i10<=9)||v0&&(i100>=11&&i100<=14)?"many":"other"}});
addLocaleData({"locale":"ru-BY","parentLocale":"ru"});
addLocaleData({"locale":"ru-KG","parentLocale":"ru"});
addLocaleData({"locale":"ru-KZ","parentLocale":"ru"});
addLocaleData({"locale":"ru-MD","parentLocale":"ru"});
addLocaleData({"locale":"ru-UA","parentLocale":"ru"});
addLocaleData({"locale":"rw","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"rwk","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"sah","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"saq","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"sbp","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"sdh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"se","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"se-FI","parentLocale":"se"});
addLocaleData({"locale":"se-SE","parentLocale":"se"});
addLocaleData({"locale":"seh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ses","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"sg","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"sh","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}});
addLocaleData({"locale":"shi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n>=0&&n<=1?"one":t0&&n>=2&&n<=10?"few":"other"}});
addLocaleData({"locale":"shi-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"shi-Tfng","parentLocale":"shi"});
addLocaleData({"locale":"si","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"";if(ord)return"other";return n==0||n==1||i==0&&f==1?"one":"other"}});
addLocaleData({"locale":"sk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1];if(ord)return"other";return n==1&&v0?"one":i>=2&&i<=4&&v0?"few":!v0?"many":"other"}});
addLocaleData({"locale":"sl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],i100=i.slice(-2);if(ord)return"other";return v0&&i100==1?"one":v0&&i100==2?"two":v0&&(i100==3||i100==4)||!v0?"few":"other"}});
addLocaleData({"locale":"sma","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"smi","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"smj","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"smn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"sms","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":n==2?"two":"other"}});
addLocaleData({"locale":"sn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"so","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"so-DJ","parentLocale":"so"});
addLocaleData({"locale":"so-ET","parentLocale":"so"});
addLocaleData({"locale":"so-KE","parentLocale":"so"});
addLocaleData({"locale":"sq","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n==1?"one":n10==4&&n100!=14?"many":"other";return n==1?"one":"other"}});
addLocaleData({"locale":"sq-MK","parentLocale":"sq"});
addLocaleData({"locale":"sq-XK","parentLocale":"sq"});
addLocaleData({"locale":"sr","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),i100=i.slice(-2),f10=f.slice(-1),f100=f.slice(-2);if(ord)return"other";return v0&&i10==1&&i100!=11||f10==1&&f100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)||f10>=2&&f10<=4&&(f100<12||f100>14)?"few":"other"}});
addLocaleData({"locale":"sr-Cyrl","parentLocale":"sr"});
addLocaleData({"locale":"sr-Cyrl-BA","parentLocale":"sr-Cyrl"});
addLocaleData({"locale":"sr-Cyrl-ME","parentLocale":"sr-Cyrl"});
addLocaleData({"locale":"sr-Cyrl-XK","parentLocale":"sr-Cyrl"});
addLocaleData({"locale":"sr-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"sr-Latn-BA","parentLocale":"sr-Latn"});
addLocaleData({"locale":"sr-Latn-ME","parentLocale":"sr-Latn"});
addLocaleData({"locale":"sr-Latn-XK","parentLocale":"sr-Latn"});
addLocaleData({"locale":"ss","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ssy","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"st","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"sv","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return(n10==1||n10==2)&&n100!=11&&n100!=12?"one":"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"sv-AX","parentLocale":"sv"});
addLocaleData({"locale":"sv-FI","parentLocale":"sv"});
addLocaleData({"locale":"sw","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"sw-CD","parentLocale":"sw"});
addLocaleData({"locale":"sw-KE","parentLocale":"sw"});
addLocaleData({"locale":"sw-UG","parentLocale":"sw"});
addLocaleData({"locale":"syr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ta","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"ta-LK","parentLocale":"ta"});
addLocaleData({"locale":"ta-MY","parentLocale":"ta"});
addLocaleData({"locale":"ta-SG","parentLocale":"ta"});
addLocaleData({"locale":"te","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"teo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"teo-KE","parentLocale":"teo"});
addLocaleData({"locale":"th","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"ti","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"ti-ER","parentLocale":"ti"});
addLocaleData({"locale":"tig","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"tk","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"tl","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],f=s[1]||"",v0=!s[1],i10=i.slice(-1),f10=f.slice(-1);if(ord)return n==1?"one":"other";return v0&&(i==1||i==2||i==3)||v0&&i10!=4&&i10!=6&&i10!=9||!v0&&f10!=4&&f10!=6&&f10!=9?"one":"other"}});
addLocaleData({"locale":"tn","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"to","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"tr","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"tr-CY","parentLocale":"tr"});
addLocaleData({"locale":"ts","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"twq","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"tzm","pluralRuleFunction":function (n,ord){var s=String(n).split("."),t0=Number(s[0])==n;if(ord)return"other";return n==0||n==1||t0&&n>=11&&n<=99?"one":"other"}});
addLocaleData({"locale":"ug","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"uk","pluralRuleFunction":function (n,ord){var s=String(n).split("."),i=s[0],v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2),i10=i.slice(-1),i100=i.slice(-2);if(ord)return n10==3&&n100!=13?"few":"other";return v0&&i10==1&&i100!=11?"one":v0&&(i10>=2&&i10<=4)&&(i100<12||i100>14)?"few":v0&&i10==0||v0&&(i10>=5&&i10<=9)||v0&&(i100>=11&&i100<=14)?"many":"other"}});
addLocaleData({"locale":"ur","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"ur-IN","parentLocale":"ur"});
addLocaleData({"locale":"uz","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"uz-Arab","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"uz-Cyrl","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"uz-Latn","parentLocale":"uz"});
addLocaleData({"locale":"vai","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"vai-Latn","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"vai-Vaii","parentLocale":"vai"});
addLocaleData({"locale":"ve","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"vi","pluralRuleFunction":function (n,ord){if(ord)return n==1?"one":"other";return"other"}});
addLocaleData({"locale":"vo","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"vun","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"wa","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==0||n==1?"one":"other"}});
addLocaleData({"locale":"wae","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"wo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"xh","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"xog","pluralRuleFunction":function (n,ord){if(ord)return"other";return n==1?"one":"other"}});
addLocaleData({"locale":"yav","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"yi","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"}});
addLocaleData({"locale":"yo","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"yo-BJ","parentLocale":"yo"});
addLocaleData({"locale":"zgh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"zh","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"zh-Hans","parentLocale":"zh"});
addLocaleData({"locale":"zh-Hans-HK","parentLocale":"zh-Hans"});
addLocaleData({"locale":"zh-Hans-MO","parentLocale":"zh-Hans"});
addLocaleData({"locale":"zh-Hans-SG","parentLocale":"zh-Hans"});
addLocaleData({"locale":"zh-Hant","pluralRuleFunction":function (n,ord){if(ord)return"other";return"other"}});
addLocaleData({"locale":"zh-Hant-HK","parentLocale":"zh-Hant"});
addLocaleData({"locale":"zh-Hant-MO","parentLocale":"zh-Hant-HK"});
addLocaleData({"locale":"zu","pluralRuleFunction":function (n,ord){if(ord)return"other";return n>=0&&n<=1?"one":"other"}});
addLocaleData({ locale: "en", pluralRuleFunction: function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"year","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"one":"in {0} year","other":"in {0} years"},"past":{"one":"{0} year ago","other":"{0} years ago"}}},"year-short":{"displayName":"yr.","relative":{"0":"this yr.","1":"next yr.","-1":"last yr."},"relativeTime":{"future":{"one":"in {0} yr.","other":"in {0} yr."},"past":{"one":"{0} yr. ago","other":"{0} yr. ago"}}},"month":{"displayName":"month","relative":{"0":"this month","1":"next month","-1":"last month"},"relativeTime":{"future":{"one":"in {0} month","other":"in {0} months"},"past":{"one":"{0} month ago","other":"{0} months ago"}}},"month-short":{"displayName":"mo.","relative":{"0":"this mo.","1":"next mo.","-1":"last mo."},"relativeTime":{"future":{"one":"in {0} mo.","other":"in {0} mo."},"past":{"one":"{0} mo. ago","other":"{0} mo. ago"}}},"day":{"displayName":"day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"day-short":{"displayName":"day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"hour":{"displayName":"hour","relative":{"0":"this hour"},"relativeTime":{"future":{"one":"in {0} hour","other":"in {0} hours"},"past":{"one":"{0} hour ago","other":"{0} hours ago"}}},"hour-short":{"displayName":"hr.","relative":{"0":"this hour"},"relativeTime":{"future":{"one":"in {0} hr.","other":"in {0} hr."},"past":{"one":"{0} hr. ago","other":"{0} hr. ago"}}},"minute":{"displayName":"minute","relative":{"0":"this minute"},"relativeTime":{"future":{"one":"in {0} minute","other":"in {0} minutes"},"past":{"one":"{0} minute ago","other":"{0} minutes ago"}}},"minute-short":{"displayName":"min.","relative":{"0":"this minute"},"relativeTime":{"future":{"one":"in {0} min.","other":"in {0} min."},"past":{"one":"{0} min. ago","other":"{0} min. ago"}}},"second":{"displayName":"second","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} second","other":"in {0} seconds"},"past":{"one":"{0} second ago","other":"{0} seconds ago"}}},"second-short":{"displayName":"sec.","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} sec.","other":"in {0} sec."},"past":{"one":"{0} sec. ago","other":"{0} sec. ago"}}}} });
addLocaleData({ locale: "en-US", parentLocale: "en" });
addLocaleData({ locale: "en-xa", pluralRuleFunction: function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}, "fields":{"year":{"displayName":"ýéààŕ","relative":{"0":"ţĥîîš ýééàŕ","1":"ñéẋẋţ ýééàŕ","-1":"ļàššţ ýééàŕ"},"relativeTime":{"future":{"one":"îñ {0} ýýéàŕŕ","other":"îñ {0} ýýéàŕŕš"},"past":{"one":"{0} ýéààŕ àĝĝô","other":"{0} ýéààŕš ààĝô"}}},"year-short":{"displayName":"ýŕ.","relative":{"0":"ţĥîîš ýŕŕ.","1":"ñéẋẋţ ýŕŕ.","-1":"ļàššţ ýŕŕ."},"relativeTime":{"future":{"one":"îñ {0} ýýŕ.","other":"îñ {0} ýýŕ."},"past":{"one":"{0} ýŕ. ààĝô","other":"{0} ýŕ. ààĝô"}}},"month":{"displayName":"ɱôññţĥ","relative":{"0":"ţĥîîš ɱôôñţĥĥ","1":"ñéẋẋţ ɱôôñţĥĥ","-1":"ļàššţ ɱôôñţĥĥ"},"relativeTime":{"future":{"one":"îñ {0} ɱɱôñţţĥ","other":"îñ {0} ɱɱôñţţĥš"},"past":{"one":"{0} ɱôññţĥ ààĝô","other":"{0} ɱôññţĥšš àĝôô"}}},"month-short":{"displayName":"ɱô.","relative":{"0":"ţĥîîš ɱôô.","1":"ñéẋẋţ ɱôô.","-1":"ļàššţ ɱôô."},"relativeTime":{"future":{"one":"îñ {0} ɱɱô.","other":"îñ {0} ɱɱô."},"past":{"one":"{0} ɱô. ààĝô","other":"{0} ɱô. ààĝô"}}},"day":{"displayName":"ðàýý","relative":{"0":"ţôððàý","1":"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},"relativeTime":{"future":{"one":"îñ {0} ððàý","other":"îñ {0} ððàýšš"},"past":{"one":"{0} ðàýý àĝôô","other":"{0} ðàýýš àĝĝô"}}},"day-short":{"displayName":"ðàýý","relative":{"0":"ţôððàý","1":"ţôɱɱôŕŕŕôŵ","-1":"ýéššţéŕŕðàýý"},"relativeTime":{"future":{"one":"îñ {0} ððàý","other":"îñ {0} ððàýšš"},"past":{"one":"{0} ðàýý àĝôô","other":"{0} ðàýýš àĝĝô"}}},"hour":{"displayName":"ĥôûûŕ","relative":{"0":"ţĥîîš ĥôôûŕ"},"relativeTime":{"future":{"one":"îñ {0} ĥĥôûŕŕ","other":"îñ {0} ĥĥôûŕŕš"},"past":{"one":"{0} ĥôûûŕ àĝĝô","other":"{0} ĥôûûŕš ààĝô"}}},"hour-short":{"displayName":"ĥŕ.","relative":{"0":"ţĥîîš ĥôôûŕ"},"relativeTime":{"future":{"one":"îñ {0} ĥĥŕ.","other":"îñ {0} ĥĥŕ."},"past":{"one":"{0} ĥŕ. ààĝô","other":"{0} ĥŕ. ààĝô"}}},"minute":{"displayName":"ɱîññûţéé","relative":{"0":"ţĥîîš ɱîîñûţţé"},"relativeTime":{"future":{"one":"îñ {0} ɱɱîñûûţé","other":"îñ {0} ɱɱîñûûţéšš"},"past":{"one":"{0} ɱîññûţéé àĝôô","other":"{0} ɱîññûţééš àĝĝô"}}},"minute-short":{"displayName":"ɱîññ.","relative":{"0":"ţĥîîš ɱîîñûţţé"},"relativeTime":{"future":{"one":"îñ {0} ɱɱîñ.","other":"îñ {0} ɱɱîñ."},"past":{"one":"{0} ɱîññ. àĝôô","other":"{0} ɱîññ. àĝôô"}}},"second":{"displayName":"šéççôñðð","relative":{"0":"ñôŵŵ"},"relativeTime":{"future":{"one":"îñ {0} ššéçôôñð","other":"îñ {0} ššéçôôñðšš"},"past":{"one":"{0} šéççôñðð àĝôô","other":"{0} šéççôñððš àĝĝô"}}},"second-short":{"displayName":"šéçç.","relative":{"0":"ñôŵŵ"},"relativeTime":{"future":{"one":"îñ {0} ššéç.","other":"îñ {0} ššéç."},"past":{"one":"{0} šéçç. àĝôô","other":"{0} šéçç. àĝôô"}}}} });
addLocaleData({ locale: "es", pluralRuleFunction: function (n,ord){if(ord)return"other";return n==1?"one":"other"},"fields":{"year":{"displayName":"año","relative":{"0":"este año","1":"el próximo año","-1":"el año pasado"},"relativeTime":{"future":{"one":"dentro de {0} año","other":"dentro de {0} años"},"past":{"one":"hace {0} año","other":"hace {0} años"}}},"year-short":{"displayName":"a","relative":{"0":"este año","1":"el próximo año","-1":"el año pasado"},"relativeTime":{"future":{"one":"dentro de {0} a","other":"dentro de {0} a"},"past":{"one":"hace {0} a","other":"hace {0} a"}}},"month":{"displayName":"mes","relative":{"0":"este mes","1":"el próximo mes","-1":"el mes pasado"},"relativeTime":{"future":{"one":"dentro de {0} mes","other":"dentro de {0} meses"},"past":{"one":"hace {0} mes","other":"hace {0} meses"}}},"month-short":{"displayName":"m","relative":{"0":"este mes","1":"el próximo mes","-1":"el mes pasado"},"relativeTime":{"future":{"one":"dentro de {0} m","other":"dentro de {0} m"},"past":{"one":"hace {0} m","other":"hace {0} m"}}},"day":{"displayName":"día","relative":{"0":"hoy","1":"mañana","2":"pasado mañana","-2":"anteayer","-1":"ayer"},"relativeTime":{"future":{"one":"dentro de {0} día","other":"dentro de {0} días"},"past":{"one":"hace {0} día","other":"hace {0} días"}}},"day-short":{"displayName":"d","relative":{"0":"hoy","1":"mañana","2":"pasado mañana","-2":"anteayer","-1":"ayer"},"relativeTime":{"future":{"one":"dentro de {0} día","other":"dentro de {0} días"},"past":{"one":"hace {0} día","other":"hace {0} días"}}},"hour":{"displayName":"hora","relative":{"0":"esta hora"},"relativeTime":{"future":{"one":"dentro de {0} hora","other":"dentro de {0} horas"},"past":{"one":"hace {0} hora","other":"hace {0} horas"}}},"hour-short":{"displayName":"h","relative":{"0":"esta hora"},"relativeTime":{"future":{"one":"dentro de {0} h","other":"dentro de {0} h"},"past":{"one":"hace {0} h","other":"hace {0} h"}}},"minute":{"displayName":"minuto","relative":{"0":"este minuto"},"relativeTime":{"future":{"one":"dentro de {0} minuto","other":"dentro de {0} minutos"},"past":{"one":"hace {0} minuto","other":"hace {0} minutos"}}},"minute-short":{"displayName":"min","relative":{"0":"este minuto"},"relativeTime":{"future":{"one":"dentro de {0} min","other":"dentro de {0} min"},"past":{"one":"hace {0} min","other":"hace {0} min"}}},"second":{"displayName":"segundo","relative":{"0":"ahora"},"relativeTime":{"future":{"one":"dentro de {0} segundo","other":"dentro de {0} segundos"},"past":{"one":"hace {0} segundo","other":"hace {0} segundos"}}},"second-short":{"displayName":"s","relative":{"0":"ahora"},"relativeTime":{"future":{"one":"dentro de {0} s","other":"dentro de {0} s"},"past":{"one":"hace {0} s","other":"hace {0} s"}}}} });
addLocaleData({ locale: "es-LA", parentLocale: "es" });
addLocaleData({ locale: "fr", pluralRuleFunction: function (n,ord){if(ord)return n==1?"one":"other";return n>=0&&n<2?"one":"other"},"fields":{"year":{"displayName":"année","relative":{"0":"cette année","1":"lannée prochaine","-1":"lannée dernière"},"relativeTime":{"future":{"one":"dans {0} an","other":"dans {0} ans"},"past":{"one":"il y a {0} an","other":"il y a {0} ans"}}},"year-short":{"displayName":"an","relative":{"0":"cette année","1":"lannée prochaine","-1":"lannée dernière"},"relativeTime":{"future":{"one":"dans {0} a","other":"dans {0} a"},"past":{"one":"il y a {0} a","other":"il y a {0} a"}}},"month":{"displayName":"mois","relative":{"0":"ce mois-ci","1":"le mois prochain","-1":"le mois dernier"},"relativeTime":{"future":{"one":"dans {0} mois","other":"dans {0} mois"},"past":{"one":"il y a {0} mois","other":"il y a {0} mois"}}},"month-short":{"displayName":"m.","relative":{"0":"ce mois-ci","1":"le mois prochain","-1":"le mois dernier"},"relativeTime":{"future":{"one":"dans {0} m.","other":"dans {0} m."},"past":{"one":"il y a {0} m.","other":"il y a {0} m."}}},"day":{"displayName":"jour","relative":{"0":"aujourdhui","1":"demain","2":"après-demain","-2":"avant-hier","-1":"hier"},"relativeTime":{"future":{"one":"dans {0} jour","other":"dans {0} jours"},"past":{"one":"il y a {0} jour","other":"il y a {0} jours"}}},"day-short":{"displayName":"j","relative":{"0":"aujourdhui","1":"demain","2":"après-demain","-2":"avant-hier","-1":"hier"},"relativeTime":{"future":{"one":"dans {0} j","other":"dans {0} j"},"past":{"one":"il y a {0} j","other":"il y a {0} j"}}},"hour":{"displayName":"heure","relative":{"0":"cette heure-ci"},"relativeTime":{"future":{"one":"dans {0} heure","other":"dans {0} heures"},"past":{"one":"il y a {0} heure","other":"il y a {0} heures"}}},"hour-short":{"displayName":"h","relative":{"0":"cette heure-ci"},"relativeTime":{"future":{"one":"dans {0} h","other":"dans {0} h"},"past":{"one":"il y a {0} h","other":"il y a {0} h"}}},"minute":{"displayName":"minute","relative":{"0":"cette minute-ci"},"relativeTime":{"future":{"one":"dans {0} minute","other":"dans {0} minutes"},"past":{"one":"il y a {0} minute","other":"il y a {0} minutes"}}},"minute-short":{"displayName":"min","relative":{"0":"cette minute-ci"},"relativeTime":{"future":{"one":"dans {0} min","other":"dans {0} min"},"past":{"one":"il y a {0} min","other":"il y a {0} min"}}},"second":{"displayName":"seconde","relative":{"0":"maintenant"},"relativeTime":{"future":{"one":"dans {0} seconde","other":"dans {0} secondes"},"past":{"one":"il y a {0} seconde","other":"il y a {0} secondes"}}},"second-short":{"displayName":"s","relative":{"0":"maintenant"},"relativeTime":{"future":{"one":"dans {0} s","other":"dans {0} s"},"past":{"one":"il y a {0} s","other":"il y a {0} s"}}}} });
addLocaleData({ locale: "fr-FR", parentLocale: "fr" });
addLocaleData({ locale: "de", pluralRuleFunction: function (n,ord){var s=String(n).split("."),v0=!s[1];if(ord)return"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"Jahr","relative":{"0":"dieses Jahr","1":"nächstes Jahr","-1":"letztes Jahr"},"relativeTime":{"future":{"one":"in {0} Jahr","other":"in {0} Jahren"},"past":{"one":"vor {0} Jahr","other":"vor {0} Jahren"}}},"year-short":{"displayName":"Jahr","relative":{"0":"dieses Jahr","1":"nächstes Jahr","-1":"letztes Jahr"},"relativeTime":{"future":{"one":"in {0} Jahr","other":"in {0} Jahren"},"past":{"one":"vor {0} Jahr","other":"vor {0} Jahren"}}},"month":{"displayName":"Monat","relative":{"0":"diesen Monat","1":"nächsten Monat","-1":"letzten Monat"},"relativeTime":{"future":{"one":"in {0} Monat","other":"in {0} Monaten"},"past":{"one":"vor {0} Monat","other":"vor {0} Monaten"}}},"month-short":{"displayName":"Monat","relative":{"0":"diesen Monat","1":"nächsten Monat","-1":"letzten Monat"},"relativeTime":{"future":{"one":"in {0} Monat","other":"in {0} Monaten"},"past":{"one":"vor {0} Monat","other":"vor {0} Monaten"}}},"day":{"displayName":"Tag","relative":{"0":"heute","1":"morgen","2":"übermorgen","-2":"vorgestern","-1":"gestern"},"relativeTime":{"future":{"one":"in {0} Tag","other":"in {0} Tagen"},"past":{"one":"vor {0} Tag","other":"vor {0} Tagen"}}},"day-short":{"displayName":"Tag","relative":{"0":"heute","1":"morgen","2":"übermorgen","-2":"vorgestern","-1":"gestern"},"relativeTime":{"future":{"one":"in {0} Tag","other":"in {0} Tagen"},"past":{"one":"vor {0} Tag","other":"vor {0} Tagen"}}},"hour":{"displayName":"Stunde","relative":{"0":"in dieser Stunde"},"relativeTime":{"future":{"one":"in {0} Stunde","other":"in {0} Stunden"},"past":{"one":"vor {0} Stunde","other":"vor {0} Stunden"}}},"hour-short":{"displayName":"Std.","relative":{"0":"in dieser Stunde"},"relativeTime":{"future":{"one":"in {0} Std.","other":"in {0} Std."},"past":{"one":"vor {0} Std.","other":"vor {0} Std."}}},"minute":{"displayName":"Minute","relative":{"0":"in dieser Minute"},"relativeTime":{"future":{"one":"in {0} Minute","other":"in {0} Minuten"},"past":{"one":"vor {0} Minute","other":"vor {0} Minuten"}}},"minute-short":{"displayName":"Min.","relative":{"0":"in dieser Minute"},"relativeTime":{"future":{"one":"in {0} Min.","other":"in {0} Min."},"past":{"one":"vor {0} Min.","other":"vor {0} Min."}}},"second":{"displayName":"Sekunde","relative":{"0":"jetzt"},"relativeTime":{"future":{"one":"in {0} Sekunde","other":"in {0} Sekunden"},"past":{"one":"vor {0} Sekunde","other":"vor {0} Sekunden"}}},"second-short":{"displayName":"Sek.","relative":{"0":"jetzt"},"relativeTime":{"future":{"one":"in {0} Sek.","other":"in {0} Sek."},"past":{"one":"vor {0} Sek.","other":"vor {0} Sek."}}}} });
addLocaleData({ locale: "de-DE", parentLocale: "de" });
addLocaleData({ locale: "ja", pluralRuleFunction: function (n,ord){if(ord)return"other";return"other"},"fields":{"year":{"displayName":"年","relative":{"0":"今年","1":"翌年","-1":"昨年"},"relativeTime":{"future":{"other":"{0} 年後"},"past":{"other":"{0} 年前"}}},"year-short":{"displayName":"年","relative":{"0":"今年","1":"翌年","-1":"昨年"},"relativeTime":{"future":{"other":"{0} 年後"},"past":{"other":"{0} 年前"}}},"month":{"displayName":"月","relative":{"0":"今月","1":"翌月","-1":"先月"},"relativeTime":{"future":{"other":"{0} か月後"},"past":{"other":"{0} か月前"}}},"month-short":{"displayName":"月","relative":{"0":"今月","1":"翌月","-1":"先月"},"relativeTime":{"future":{"other":"{0} か月後"},"past":{"other":"{0} か月前"}}},"day":{"displayName":"日","relative":{"0":"今日","1":"明日","2":"明後日","-2":"一昨日","-1":"昨日"},"relativeTime":{"future":{"other":"{0} 日後"},"past":{"other":"{0} 日前"}}},"day-short":{"displayName":"日","relative":{"0":"今日","1":"明日","2":"明後日","-2":"一昨日","-1":"昨日"},"relativeTime":{"future":{"other":"{0} 日後"},"past":{"other":"{0} 日前"}}},"hour":{"displayName":"時","relative":{"0":"1 時間以内"},"relativeTime":{"future":{"other":"{0} 時間後"},"past":{"other":"{0} 時間前"}}},"hour-short":{"displayName":"時","relative":{"0":"1 時間以内"},"relativeTime":{"future":{"other":"{0} 時間後"},"past":{"other":"{0} 時間前"}}},"minute":{"displayName":"分","relative":{"0":"1 分以内"},"relativeTime":{"future":{"other":"{0} 分後"},"past":{"other":"{0} 分前"}}},"minute-short":{"displayName":"分","relative":{"0":"1 分以内"},"relativeTime":{"future":{"other":"{0} 分後"},"past":{"other":"{0} 分前"}}},"second":{"displayName":"秒","relative":{"0":"今"},"relativeTime":{"future":{"other":"{0} 秒後"},"past":{"other":"{0} 秒前"}}},"second-short":{"displayName":"秒","relative":{"0":"今"},"relativeTime":{"future":{"other":"{0} 秒後"},"past":{"other":"{0} 秒前"}}}} });
addLocaleData({ locale: "ja-JP", parentLocale: "ja" });
addLocaleData({ locale: "ko", pluralRuleFunction: function (n,ord){if(ord)return"other";return"other"},"fields":{"year":{"displayName":"년","relative":{"0":"올해","1":"내년","-1":"작년"},"relativeTime":{"future":{"other":"{0}년 후"},"past":{"other":"{0}년 전"}}},"year-short":{"displayName":"년","relative":{"0":"올해","1":"내년","-1":"작년"},"relativeTime":{"future":{"other":"{0}년 후"},"past":{"other":"{0}년 전"}}},"month":{"displayName":"월","relative":{"0":"이번 달","1":"다음 달","-1":"지난달"},"relativeTime":{"future":{"other":"{0}개월 후"},"past":{"other":"{0}개월 전"}}},"month-short":{"displayName":"월","relative":{"0":"이번 달","1":"다음 달","-1":"지난달"},"relativeTime":{"future":{"other":"{0}개월 후"},"past":{"other":"{0}개월 전"}}},"day":{"displayName":"일","relative":{"0":"오늘","1":"내일","2":"모레","-2":"그저께","-1":"어제"},"relativeTime":{"future":{"other":"{0}일 후"},"past":{"other":"{0}일 전"}}},"day-short":{"displayName":"일","relative":{"0":"오늘","1":"내일","2":"모레","-2":"그저께","-1":"어제"},"relativeTime":{"future":{"other":"{0}일 후"},"past":{"other":"{0}일 전"}}},"hour":{"displayName":"시","relative":{"0":"현재 시간"},"relativeTime":{"future":{"other":"{0}시간 후"},"past":{"other":"{0}시간 전"}}},"hour-short":{"displayName":"시","relative":{"0":"현재 시간"},"relativeTime":{"future":{"other":"{0}시간 후"},"past":{"other":"{0}시간 전"}}},"minute":{"displayName":"분","relative":{"0":"현재 분"},"relativeTime":{"future":{"other":"{0}분 후"},"past":{"other":"{0}분 전"}}},"minute-short":{"displayName":"분","relative":{"0":"현재 분"},"relativeTime":{"future":{"other":"{0}분 후"},"past":{"other":"{0}분 전"}}},"second":{"displayName":"초","relative":{"0":"지금"},"relativeTime":{"future":{"other":"{0}초 후"},"past":{"other":"{0}초 전"}}},"second-short":{"displayName":"초","relative":{"0":"지금"},"relativeTime":{"future":{"other":"{0}초 후"},"past":{"other":"{0}초 전"}}}} });
addLocaleData({ locale: "ko-KR", parentLocale: "ko" });
addLocaleData({ locale: "zh", pluralRuleFunction: function (n,ord){if(ord)return"other";return"other"},"fields":{"year":{"displayName":"年","relative":{"0":"今年","1":"明年","-1":"去年"},"relativeTime":{"future":{"other":"{0}年后"},"past":{"other":"{0}年前"}}},"year-short":{"displayName":"年","relative":{"0":"今年","1":"明年","-1":"去年"},"relativeTime":{"future":{"other":"{0}年后"},"past":{"other":"{0}年前"}}},"month":{"displayName":"月","relative":{"0":"本月","1":"下个月","-1":"上个月"},"relativeTime":{"future":{"other":"{0}个月后"},"past":{"other":"{0}个月前"}}},"month-short":{"displayName":"月","relative":{"0":"本月","1":"下个月","-1":"上个月"},"relativeTime":{"future":{"other":"{0}个月后"},"past":{"other":"{0}个月前"}}},"day":{"displayName":"日","relative":{"0":"今天","1":"明天","2":"后天","-2":"前天","-1":"昨天"},"relativeTime":{"future":{"other":"{0}天后"},"past":{"other":"{0}天前"}}},"day-short":{"displayName":"日","relative":{"0":"今天","1":"明天","2":"后天","-2":"前天","-1":"昨天"},"relativeTime":{"future":{"other":"{0}天后"},"past":{"other":"{0}天前"}}},"hour":{"displayName":"小时","relative":{"0":"这一时间 \u002F 此时"},"relativeTime":{"future":{"other":"{0}小时后"},"past":{"other":"{0}小时前"}}},"hour-short":{"displayName":"小时","relative":{"0":"这一时间 \u002F 此时"},"relativeTime":{"future":{"other":"{0}小时后"},"past":{"other":"{0}小时前"}}},"minute":{"displayName":"分钟","relative":{"0":"此刻"},"relativeTime":{"future":{"other":"{0}分钟后"},"past":{"other":"{0}分钟前"}}},"minute-short":{"displayName":"分","relative":{"0":"此刻"},"relativeTime":{"future":{"other":"{0}分钟后"},"past":{"other":"{0}分钟前"}}},"second":{"displayName":"秒","relative":{"0":"现在"},"relativeTime":{"future":{"other":"{0}秒钟后"},"past":{"other":"{0}秒钟前"}}},"second-short":{"displayName":"秒","relative":{"0":"现在"},"relativeTime":{"future":{"other":"{0}秒后"},"past":{"other":"{0}秒前"}}}} });
addLocaleData({ locale: "zh-CN", parentLocale: "zh" });

View file

@ -17,15 +17,24 @@
* under the License.
*/
import React from 'react';
import { render } from 'enzyme';
import { requiredProps } from '../../test/required_props';
import { translateUsingPseudoLocale } from './pseudo_locale';
import {
KuiEventSymbol,
} from './event_symbol';
describe('translateUsingPseudoLocale()', () => {
it(`shouldn't translate @I18N@ placeholders`, () => {
const message = 'Message with a @I18N@value@I18N@ placeholder.';
test('renders KuiEventSymbol', () => {
const component = <KuiEventSymbol {...requiredProps}>children</KuiEventSymbol>;
expect(render(component)).toMatchSnapshot();
expect(translateUsingPseudoLocale(message)).toMatchSnapshot();
});
it(`shouldn't translate @I18N@ placeholders with underscore`, () => {
const message = 'Message with a @I18N@snake_case_value@I18N@ placeholder.';
expect(translateUsingPseudoLocale(message)).toMatchSnapshot();
});
it(`should translate @I18N@ placeholders with wrong reference name`, () => {
const message = 'Message with a @I18N@non-single-word@I18N@ placeholder.';
expect(translateUsingPseudoLocale(message)).toMatchSnapshot();
});
});

View file

@ -18,9 +18,9 @@
*/
/**
* Matches every single [A-Za-z] character, `<tag attr="any > text">` and `](markdown-link-address)`
* Matches every single [A-Za-z] character, `<tag attr="any > text">`, `](markdown-link-address)` and `@I18N@valid_variable_name@I18N@`
*/
const CHARS_FOR_PSEUDO_LOCALIZATION_REGEX = /[A-Za-z]|(\]\([\s\S]*?\))|(<([^"<>]|("[^"]*?"))*?>)/g;
const CHARS_FOR_PSEUDO_LOCALIZATION_REGEX = /[A-Za-z]|(\]\([\s\S]*?\))|(<([^"<>]|("[^"]*?"))*?>)|(@I18N@\w*?@I18N@)/g;
const PSEUDO_ACCENTS_LOCALE = 'en-xa';
export function isPseudoLocale(locale: string) {

View file

@ -2,7 +2,16 @@
exports[`injectI18nProvider provides with context 1`] = `
Object {
"defaultFormats": Object {
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {
"date": Object {
"full": Object {
"day": "numeric",
@ -34,6 +43,26 @@ Object {
"style": "percent",
},
},
"relative": Object {
"days": Object {
"units": "day",
},
"hours": Object {
"units": "hour",
},
"minutes": Object {
"units": "minute",
},
"months": Object {
"units": "month",
},
"seconds": Object {
"units": "second",
},
"years": Object {
"units": "year",
},
},
"time": Object {
"full": Object {
"hour": "numeric",
@ -58,15 +87,6 @@ Object {
},
},
},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],

View file

@ -2,7 +2,16 @@
exports[`I18nProvider provides with context 1`] = `
Object {
"defaultFormats": Object {
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {
"date": Object {
"full": Object {
"day": "numeric",
@ -34,6 +43,26 @@ Object {
"style": "percent",
},
},
"relative": Object {
"days": Object {
"units": "day",
},
"hours": Object {
"units": "hour",
},
"minutes": Object {
"units": "minute",
},
"months": Object {
"units": "month",
},
"seconds": Object {
"units": "second",
},
"years": Object {
"units": "year",
},
},
"time": Object {
"full": Object {
"hour": "numeric",
@ -58,15 +87,6 @@ Object {
},
},
},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],

View file

@ -78,8 +78,7 @@ export class I18nProvider extends React.PureComponent {
locale={i18n.getLocale()}
messages={i18n.getTranslation().messages}
defaultLocale={i18n.getDefaultLocale()}
formats={i18n.getTranslation().formats}
defaultFormats={i18n.getFormats()}
formats={i18n.getFormats()}
textComponent={React.Fragment}
>
{isPseudoLocale(i18n.getLocale())

View file

@ -55,6 +55,9 @@ export async function createSocket(basePath) {
socket.on('connect', () => {
resolve();
socket.off('connectionFailed', errorHandler);
socket.off('connect_error', errorHandler);
socket.off('connect_timeout', errorHandler);
});
function errorHandler(err) {

View file

@ -30,4 +30,6 @@ export const pluginPaths = {
modelUIs: ['uis', 'models'],
viewUIs: ['uis', 'views'],
argumentUIs: ['uis', 'arguments'],
templates: ['templates'],
tagUIs: ['uis', 'tags'],
};

View file

@ -64,7 +64,7 @@ Generated plugins receive a handful of scripts that can be used during developme
Start kibana and have it include this plugin. You can pass any arguments that you would normally send to `bin/kibana`
```
yarn start --elasticsearch.url http://localhost:9220
yarn start --elasticsearch.hosts http://localhost:9220
```
- `yarn build`

View file

@ -21,7 +21,7 @@ See the [kibana contributing guide](https://github.com/elastic/kibana/blob/maste
Start kibana and have it include this plugin. You can pass any arguments that you would normally send to `bin/kibana`
```
yarn start --elasticsearch.url http://localhost:9220
yarn start --elasticsearch.hosts http://localhost:9220
```
- `yarn build`

File diff suppressed because one or more lines are too long

View file

@ -59,7 +59,7 @@
"spawn-sync": "^1.0.15",
"string-replace-loader": "^2.1.1",
"strip-ansi": "^4.0.0",
"strong-log-transformer": "^2.0.0",
"strong-log-transformer": "^2.1.0",
"tempy": "^0.2.1",
"ts-loader": "^5.2.2",
"typescript": "^3.0.3",

View file

@ -20,7 +20,7 @@
const path = require('path');
module.exports = {
mode: 'production',
mode: 'none',
entry: {
index: './src/index.ts',
},
@ -99,8 +99,4 @@ module.exports = {
watchOptions: {
ignored: [/node_modules/, /vendor/],
},
optimization: {
minimize: false,
},
};

View file

@ -78,7 +78,7 @@ export function createEsTestCluster(options = {}) {
esArgs: [
`cluster.name=${clusterName}`,
`http.port=${port}`,
`discovery.zen.ping.unicast.hosts=localhost:${port}`,
'discovery.type=single-node',
...esArgs,
],
});

View file

@ -34,7 +34,7 @@ async function updateCredentials(port, auth, username, password, retries = 10) {
auth,
hostname: 'localhost',
port,
pathname: `/_xpack/security/user/${username}/_password`,
pathname: `/_security/user/${username}/_password`,
}),
json: true,
body: { password },

View file

@ -149,11 +149,6 @@ Button and ButtonGroup), or you just want to group some related components toget
TextArea, and CheckBox), then they belong in the same logical grouping. In this case, you can create
additional SCSS files for these components in the same component directory.
### Writing CSS
Check out our [CSS style guide](https://github.com/elastic/kibana/blob/master/style_guides/css_style_guide.md)
and [SCSS style guide](https://github.com/elastic/kibana/blob/master/style_guides/scss_style_guide.md).
## Benefits
### Dynamic, interactive documentation

File diff suppressed because it is too large Load diff

View file

@ -19,72 +19,26 @@
import Slugify from '../string/slugify';
import AccessibilityExample
from '../../views/accessibility/accessibility_example';
import ActionItemExample
from '../../views/action_item/action_item_example';
import BadgeExample
from '../../views/badge/badge_example';
import BarExample
from '../../views/bar/bar_example';
import ButtonExample
from '../../views/button/button_example';
import CardExample
from '../../views/card/card_example';
import CodeEditor
from '../../views/code_editor/code_editor_example';
import CollapseButtonExample
from '../../views/collapse_button/collapse_button_example';
import ColorPickerExample
from '../../views/color_picker/color_picker_example';
import ColumnExample
from '../../views/column/column_example';
import ContextMenuExample
from '../../views/context_menu/context_menu_example';
import EventExample
from '../../views/event/event_example';
import EventsSandbox
from '../../views/event/events_sandbox';
import ExpressionExample
from '../../views/expression/expression_example';
import FlexExample
from '../../views/flex/flex_example';
import FormExample
from '../../views/form/form_example';
import FormLayoutExample
from '../../views/form_layout/form_layout_example';
import GalleryExample
from '../../views/gallery/gallery_example';
import HeaderBarExample
from '../../views/header_bar/header_bar_example';
import HeaderBarSandbox
from '../../views/header_bar/header_bar_sandbox';
import IconExample
from '../../views/icon/icon_example';
import InfoButtonExample
from '../../views/info_button/info_button_example';
import InfoPanelExample
from '../../views/info_panel/info_panel_example';
@ -100,15 +54,9 @@ import MenuExample
import MenuButtonExample
from '../../views/menu_button/menu_button_example';
import MicroButtonExample
from '../../views/micro_button/micro_button_example';
import ModalExample
from '../../views/modal/modal_example';
import NoticeSandbox
from '../../views/notice/notice_sandbox';
import PagerExample
from '../../views/pager/pager_example';
@ -150,17 +98,6 @@ import ViewSandbox
// Component route names should match the component name exactly.
const components = [{
name: 'Accessibility',
component: AccessibilityExample,
hasReact: true,
}, {
name: 'ActionItem',
component: ActionItemExample,
hasReact: true,
}, {
name: 'Badge',
component: BadgeExample,
}, {
name: 'Bar',
component: BarExample,
hasReact: true,
@ -168,48 +105,22 @@ const components = [{
name: 'Button',
component: ButtonExample,
hasReact: true,
}, {
name: 'Card',
component: CardExample,
hasReact: true,
}, {
name: 'CodeEditor',
component: CodeEditor,
hasReact: true,
}, {
name: 'CollapseButton',
component: CollapseButtonExample,
hasReact: true,
}, {
name: 'ColorPicker',
component: ColorPickerExample,
hasReact: true,
}, {
name: 'Column',
component: ColumnExample,
}, {
name: 'CollapseButton',
component: CollapseButtonExample,
hasReact: true,
}, {
name: 'ContextMenu',
component: ContextMenuExample,
hasReact: true,
}, {
name: 'EmptyTablePrompt',
component: EmptyTablePromptExample,
hasReact: true,
}, {
name: 'Event',
component: EventExample,
hasReact: true,
}, {
name: 'Expression',
component: ExpressionExample,
hasReact: true,
}, {
name: 'Flex',
component: FlexExample,
}, {
name: 'Form',
component: FormExample,
@ -217,21 +128,9 @@ const components = [{
name: 'FormLayout',
component: FormLayoutExample,
hasReact: true,
}, {
name: 'Gallery',
component: GalleryExample,
hasReact: true,
}, {
name: 'HeaderBar',
component: HeaderBarExample,
hasReact: true,
}, {
name: 'Icon',
component: IconExample,
}, {
name: 'InfoButton',
component: InfoButtonExample,
hasReact: true,
}, {
name: 'InfoPanel',
component: InfoPanelExample,
@ -249,9 +148,6 @@ const components = [{
}, {
name: 'MenuButton',
component: MenuButtonExample,
}, {
name: 'MicroButton',
component: MicroButtonExample,
}, {
name: 'Modal',
component: ModalExample,
@ -298,15 +194,6 @@ const components = [{
}];
const sandboxes = [{
name: 'Events',
component: EventsSandbox,
}, {
name: 'HeaderBar with Table',
component: HeaderBarSandbox,
}, {
name: 'Notice',
component: NoticeSandbox,
}, {
name: 'View',
component: ViewSandbox,
}];

View file

@ -1,96 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideCode,
GuideDemo,
GuideLink,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
import KeyboardAccessible from './keyboard_accessible';
import ScreenReaderOnly from './screen_reader';
const keyboardAccessibleSource = require('!!raw-loader!./keyboard_accessible');
const keyboardAccessibleHtml = renderToHtml(KeyboardAccessible);
const screenReaderOnlyHtml = renderToHtml(ScreenReaderOnly);
const screenReaderOnlySource = require('!!raw-loader!./screen_reader');
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="KeyboardAccessible"
source={[{
type: GuideSectionTypes.JS,
code: keyboardAccessibleSource,
}, {
type: GuideSectionTypes.HTML,
code: keyboardAccessibleHtml,
}]}
>
<GuideText>
You can make interactive elements keyboard-accessible with this component. This is necessary
for non-button elements and <GuideCode>a</GuideCode> tags without
<GuideCode>href</GuideCode> attributes.
</GuideText>
<GuideDemo>
<KeyboardAccessible />
</GuideDemo>
</GuideSection>
<GuideSection
title="ScreenReaderOnly"
source={[{
type: GuideSectionTypes.JS,
code: screenReaderOnlySource,
}, {
type: GuideSectionTypes.HTML,
code: screenReaderOnlyHtml,
}]}
>
<GuideText>
This class can be useful to add accessibility to older designs that are
still in use, but it shouldn&rsquo;t be a permanent solution. See {(
<GuideLink
href="http://webaim.org/techniques/css/invisiblecontent/"
>
http://webaim.org/techniques/css/invisiblecontent/
</GuideLink>
)} for more information.
</GuideText>
<GuideText>
Use a screenreader to verify that there is a second paragraph in this example:
</GuideText>
<GuideDemo>
<ScreenReaderOnly />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,75 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiKeyboardAccessible,
} from '../../../../components';
// For custom components, we just need to make sure they delegate props to their rendered root
// element, e.g. onClick, tabIndex, and role.
const CustomComponent = ({
children,
...rest
}) => (
<div {...rest}>
{children}
</div>
);
export default () => (
<div>
<KuiKeyboardAccessible>
<div onClick={() => window.alert('Div clicked')}>
Click this div
</div>
</KuiKeyboardAccessible>
<KuiKeyboardAccessible>
<a
className="kuiLink"
onClick={() => window.alert('Anchor tag clicked')}
>
Click this anchor tag
</a>
</KuiKeyboardAccessible>
<KuiKeyboardAccessible>
<CustomComponent onClick={() => window.alert('Custom component clicked')}>
Click this custom component
</CustomComponent>
</KuiKeyboardAccessible>
<KuiKeyboardAccessible>
<div onClick={() => window.alert('Outer KuiKeyboardAccessible clicked')}>
This KuiKeyboardAccessible contains another KuiKeyboardAccessible&nbsp;
<KuiKeyboardAccessible>
<a
className="kuiLink"
onClick={() => window.alert('Inner KuiKeyboardAccessible clicked')}
>
Clicking this inner one should call both onClick handlers
</a>
</KuiKeyboardAccessible>
</div>
</KuiKeyboardAccessible>
</div>
);

View file

@ -1,42 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiScreenReaderOnly,
} from '../../../../components';
export default () => (
<div>
<p>
This is the first paragraph. It is visible to all.
</p>
<KuiScreenReaderOnly>
<p>
This is the second paragraph. It is hidden for sighted users but visible to screen readers.
</p>
</KuiScreenReaderOnly>
<p>
This is the third paragraph. It is visible to all.
</p>
</div>
);

View file

@ -1,41 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiActionItem
} from '../../../../components';
export default () => (
<KuiActionItem>
<p className="kuiText">Item</p>
<div className="kuiMenuButtonGroup">
<button className="kuiMenuButton kuiMenuButton--basic">
Acknowledge
</button>
<button className="kuiMenuButton kuiMenuButton--basic">
Silence
</button>
<button className="kuiMenuButton kuiMenuButton--danger">
Delete
</button>
</div>
</KuiActionItem>
);

View file

@ -1,80 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
import ActionItem from './action_item';
const actionItemSource = require('!!raw-loader!./action_item');
const actionItemHtml = renderToHtml(ActionItem);
import ActionItemInMenu from './action_items_in_menu';
const actionItemInMenuSource = require('!!raw-loader!./action_items_in_menu');
const actionItemInMenuHtml = renderToHtml(ActionItemInMenu);
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="ActionItem"
source={[{
type: GuideSectionTypes.JS,
code: actionItemSource,
}, {
type: GuideSectionTypes.HTML,
code: actionItemHtml,
}]}
>
<GuideText>
Events can represent updates, logs, notifications, and status changes.
</GuideText>
<GuideDemo>
<ActionItem />
</GuideDemo>
</GuideSection>
<GuideSection
title="ActionItems in Menu"
source={[{
type: GuideSectionTypes.JS,
code: actionItemInMenuSource,
}, {
type: GuideSectionTypes.HTML,
code: actionItemInMenuHtml,
}]}
>
<GuideText>
You&rsquo;ll typically want to present them within a Menu.
</GuideText>
<GuideDemo>
<ActionItemInMenu />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,81 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiActionItem,
KuiMenu,
KuiMenuItem
} from '../../../../components';
export default () => (
<KuiMenu contained>
<KuiMenuItem>
<KuiActionItem>
<p className="kuiText">Item A</p>
<div className="kuiMenuButtonGroup">
<button className="kuiMenuButton kuiMenuButton--basic">
Acknowledge
</button>
<button className="kuiMenuButton kuiMenuButton--basic">
Silence
</button>
<button className="kuiMenuButton kuiMenuButton--danger">
Delete
</button>
</div>
</KuiActionItem>
</KuiMenuItem>
<KuiMenuItem>
<KuiActionItem>
<p className="kuiText">Item B</p>
<div className="kuiMenuButtonGroup">
<button className="kuiMenuButton kuiMenuButton--basic">
Acknowledge
</button>
<button className="kuiMenuButton kuiMenuButton--basic">
Silence
</button>
<button className="kuiMenuButton kuiMenuButton--danger">
Delete
</button>
</div>
</KuiActionItem>
</KuiMenuItem>
<KuiMenuItem>
<KuiActionItem>
<p className="kuiText">Item C</p>
<div className="kuiMenuButtonGroup">
<button className="kuiMenuButton kuiMenuButton--basic">
Acknowledge
</button>
<button className="kuiMenuButton kuiMenuButton--basic">
Silence
</button>
<button className="kuiMenuButton kuiMenuButton--danger">
Delete
</button>
</div>
</KuiActionItem>
</KuiMenuItem>
</KuiMenu>
);

View file

@ -1,50 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
const defaultHtml = require('./default_badge.html');
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Default Badge"
source={[{
type: GuideSectionTypes.HTML,
code: defaultHtml,
}]}
>
<GuideText>
Use the Default Badge to signify a neutral status of a document or object.
</GuideText>
<GuideDemo
html={defaultHtml}
/>
</GuideSection>
</GuidePage>
);

View file

@ -1,9 +0,0 @@
<div class="kuiBadge kuiBadge--default">
<span class="kuiIcon fa-lock"></span>
Reserved
</div>
<div class="kuiBadge kuiBadge--default">
<span class="kuiIcon fa-warning"></span>
Disabled
</div>

View file

@ -1,54 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiCard,
KuiCardDescription,
KuiCardDescriptionTitle,
KuiCardDescriptionText,
KuiCardFooter,
KuiLinkButton
} from '../../../../components';
export default () => {
return (
<KuiCard>
<KuiCardDescription>
<KuiCardDescriptionTitle>
Get a banana
</KuiCardDescriptionTitle>
<KuiCardDescriptionText>
Bananas are yellow, fit easily in the hand, and have a lot of potassium or something.
</KuiCardDescriptionText>
</KuiCardDescription>
<KuiCardFooter>
<KuiLinkButton
buttonType="basic"
href="#"
>
Banana!
</KuiLinkButton>
</KuiCardFooter>
</KuiCard>
);
};

View file

@ -1,77 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
import Card from './card';
const cardSource = require('!!raw-loader!./card');
const cardHtml = renderToHtml(Card);
import CardGroup from './card_group';
const cardGroupSource = require('!!raw-loader!./card_group');
const cardGroupHtml = renderToHtml(CardGroup);
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Card"
source={[{
type: GuideSectionTypes.JS,
code: cardSource,
}, {
type: GuideSectionTypes.HTML,
code: cardHtml,
}]}
>
<GuideText>
Cards expand to fill their container. To restrict a card&rsquo;s width, define the width of its
container.
</GuideText>
<GuideDemo>
<Card />
</GuideDemo>
</GuideSection>
<GuideSection
title="CardGroup"
source={[{
type: GuideSectionTypes.JS,
code: cardGroupSource,
}, {
type: GuideSectionTypes.HTML,
code: cardGroupHtml,
}]}
>
<GuideDemo>
<CardGroup />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,180 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiCardGroup,
KuiCard,
KuiCardDescription,
KuiCardDescriptionTitle,
KuiCardDescriptionText,
KuiCardFooter,
KuiLinkButton
} from '../../../../components';
export default () => {
/**
* These styles are just for demonstration purposes. It is recommended to use
* properly named classes to set the width in production code.
*/
const cardStyle = {
width: '400px'
};
return (
<div>
<KuiCardGroup>
<KuiCard style={cardStyle}>
<KuiCardDescription>
<KuiCardDescriptionTitle>
Get a banana
</KuiCardDescriptionTitle>
<KuiCardDescriptionText>
Bananas are yellow, fit easily in the hand, and have a lot of potassium or something.
</KuiCardDescriptionText>
</KuiCardDescription>
<KuiCardFooter>
<KuiLinkButton
buttonType="basic"
href="#"
>
Banana!
</KuiLinkButton>
</KuiCardFooter>
</KuiCard>
<KuiCard style={cardStyle}>
<KuiCardDescription>
<KuiCardDescriptionTitle>
Get a pteradactyl
</KuiCardDescriptionTitle>
<KuiCardDescriptionText>
Pteradactyls can fly, like to squawk all the time, and are difficult to spell correctly.
</KuiCardDescriptionText>
</KuiCardDescription>
<KuiCardFooter>
<KuiLinkButton
buttonType="primary"
href="https://www.elastic.co/subscriptions/xpack"
target="_blank"
>
Pteradactyl!
</KuiLinkButton>
</KuiCardFooter>
</KuiCard>
<KuiCard style={cardStyle}>
<KuiCardDescription>
<KuiCardDescriptionTitle>
Get a magnolia tree
</KuiCardDescriptionTitle>
<KuiCardDescriptionText>
Magnolia trees have broad, waxy leaves which they shed year-round.
</KuiCardDescriptionText>
</KuiCardDescription>
<KuiCardFooter>
<KuiLinkButton
buttonType="basic"
href="https://www.elastic.co/subscriptions/xpack"
target="_blank"
>
Magnolia!
</KuiLinkButton>
</KuiCardFooter>
</KuiCard>
</KuiCardGroup>
<br className="guideBreak"/>
<KuiCardGroup isUnited>
<KuiCard>
<KuiCardDescription>
<KuiCardDescriptionTitle>
Get a banana
</KuiCardDescriptionTitle>
<KuiCardDescriptionText>
Bananas are yellow, fit easily in the hand, and have a lot of potassium or something.
</KuiCardDescriptionText>
</KuiCardDescription>
<KuiCardFooter>
<KuiLinkButton
buttonType="basic"
href="#"
>
Banana!
</KuiLinkButton>
</KuiCardFooter>
</KuiCard>
<KuiCard>
<KuiCardDescription>
<KuiCardDescriptionTitle>
Get a pteradactyl
</KuiCardDescriptionTitle>
<KuiCardDescriptionText>
Pteradactyls can fly, like to squawk all the time, and are difficult to spell correctly.
</KuiCardDescriptionText>
</KuiCardDescription>
<KuiCardFooter>
<KuiLinkButton
buttonType="primary"
href="https://www.elastic.co/subscriptions/xpack"
target="_blank"
>
Pteradactyl!
</KuiLinkButton>
</KuiCardFooter>
</KuiCard>
<KuiCard style={cardStyle}>
<KuiCardDescription>
<KuiCardDescriptionTitle>
Get a magnolia tree
</KuiCardDescriptionTitle>
<KuiCardDescriptionText>
Magnolia trees have broad, waxy leaves which they shed year-round.
</KuiCardDescriptionText>
</KuiCardDescription>
<KuiCardFooter>
<KuiLinkButton
buttonType="basic"
href="https://www.elastic.co/subscriptions/xpack"
target="_blank"
>
Magnolia!
</KuiLinkButton>
</KuiCardFooter>
</KuiCard>
</KuiCardGroup>
</div>
);
};

View file

@ -1,74 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
import CodeEditor from './code_editor';
const codeEditorSource = require('!!raw-loader!./code_editor');
import ReadOnly from './read_only';
const readOnlySource = require('!!raw-loader!./read_only');
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Code Editor"
source={[{
type: GuideSectionTypes.JS,
code: codeEditorSource,
}]}
>
<GuideText>
<p>
The KuiCodeEditor component is a wrapper around <code>react-ace</code> (which
itself wraps the ACE code editor), that adds an accessible keyboard mode
to it. You should always use this component instead of <code>AceReact</code>.
</p>
<p>
All parameters, that you specify are passed down to the
underlying <code>AceReact</code> component.
</p>
</GuideText>
<GuideDemo>
<CodeEditor />
</GuideDemo>
</GuideSection>
<GuideSection
title="Read-only"
source={[{
type: GuideSectionTypes.JS,
code: readOnlySource,
}]}
>
<GuideDemo>
<ReadOnly />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,73 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiColorPicker,
KuiFieldGroup,
KuiFieldGroupSection,
KuiKeyboardAccessible,
} from '../../../../components';
export class ColorPickerLabelAndClear extends React.Component {
constructor(props) {
super(props);
this.state = {
color: null
};
}
handleChange = (value) => {
this.setState({ color: value });
};
resetColor = () => {
this.setState({ color: null });
};
render() {
return (
<KuiFieldGroup>
<KuiFieldGroupSection>
<label className="kuiLabel">
Background color
</label>
</KuiFieldGroupSection>
<KuiFieldGroupSection>
<KuiColorPicker
onChange={this.handleChange}
color={this.state.color}
/>
</KuiFieldGroupSection>
<KuiFieldGroupSection>
<p className="kuiText">
<KuiKeyboardAccessible>
<a className="kuiLink" onClick={this.resetColor}>
Reset
</a>
</KuiKeyboardAccessible>
</p>
</KuiFieldGroupSection>
</KuiFieldGroup>
);
}
}

View file

@ -1,88 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
} from '../../components';
import { renderToHtml } from '../../services';
import { ColorPicker } from './color_picker';
const colorPickerSource = require('!!raw-loader!./color_picker');
const colorPickerHtml = renderToHtml(ColorPicker);
import { ColorPickerLabelAndClear } from './color_picker_clear';
const colorPickerClearSource = require('!!raw-loader!./color_picker_clear');
const colorPickerClearHtml = renderToHtml(ColorPickerLabelAndClear);
import { ColorPickerNoColorLabel } from './color_picker_no_color_label';
const colorPickerNoColorLabelSource = require('!!raw-loader!./color_picker_no_color_label');
const colorPickerNoColorLabelHtml = renderToHtml(ColorPickerNoColorLabel);
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Color Picker"
source={[{
type: GuideSectionTypes.JS,
code: colorPickerSource,
}, {
type: GuideSectionTypes.HTML,
code: colorPickerHtml,
}]}
>
<GuideDemo>
<ColorPicker />
</GuideDemo>
</GuideSection>
<GuideSection
title="Color Picker with label and reset link"
source={[{
type: GuideSectionTypes.JS,
code: colorPickerClearSource,
}, {
type: GuideSectionTypes.HTML,
code: colorPickerClearHtml,
}]}
>
<GuideDemo>
<ColorPickerLabelAndClear />
</GuideDemo>
</GuideSection>
<GuideSection
title="Color Picker without a color label"
source={[{
type: GuideSectionTypes.JS,
code: colorPickerNoColorLabelSource,
}, {
type: GuideSectionTypes.HTML,
code: colorPickerNoColorLabelHtml,
}]}
>
<GuideDemo>
<ColorPickerNoColorLabel />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,59 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiColorPicker,
KuiFieldGroup,
KuiFieldGroupSection,
} from '../../../../components';
export class ColorPickerNoColorLabel extends React.Component {
constructor(props) {
super(props);
this.state = {
color: '#00FFFF'
};
}
handleChange = (value) => {
this.setState({ color: value });
};
render() {
return (
<KuiFieldGroup>
<KuiFieldGroupSection>
<label className="kuiLabel">
Foreground color
</label>
</KuiFieldGroupSection>
<KuiFieldGroupSection>
<KuiColorPicker
onChange={this.handleChange}
color={this.state.color}
showColorLabel={false}
/>
</KuiFieldGroupSection>
</KuiFieldGroup>
);
}
}

View file

@ -1,56 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
GuideCode,
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
const columnsHtml = require('./columns.html');
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Columns"
source={[{
type: GuideSectionTypes.HTML,
code: columnsHtml,
}]}
>
<GuideText>
<strong>Note:</strong> Don&rsquo;t use this. It&rsquo;s subject to change as we evolve our grid system.
</GuideText>
<GuideText>
This is a substitute grid system. It uses <GuideCode>display: inline-block</GuideCode>, so
you need to structure your markup to leave no whitespace between each column.
</GuideText>
<GuideDemo
html={columnsHtml}
/>
</GuideSection>
</GuidePage>
);

View file

@ -1,47 +0,0 @@
<div>
<div class="kuiColumn kuiColumn--1">
<div style="background-color: lightgray; height: 20px"></div>
</div><div class="kuiColumn kuiColumn--11">
<div style="background-color: lightgray; height: 20px"></div>
</div>
</div>
<div>
<div class="kuiColumn kuiColumn--2">
<div style="background-color: lightgray; height: 20px"></div>
</div><div class="kuiColumn kuiColumn--10">
<div style="background-color: lightgray; height: 20px"></div>
</div>
</div>
<div>
<div class="kuiColumn kuiColumn--3">
<div style="background-color: lightgray; height: 20px"></div>
</div><div class="kuiColumn kuiColumn--9">
<div style="background-color: lightgray; height: 20px"></div>
</div>
</div>
<div>
<div class="kuiColumn kuiColumn--4">
<div style="background-color: lightgray; height: 20px"></div>
</div><div class="kuiColumn kuiColumn--8">
<div style="background-color: lightgray; height: 20px"></div>
</div>
</div>
<div>
<div class="kuiColumn kuiColumn--5">
<div style="background-color: lightgray; height: 20px"></div>
</div><div class="kuiColumn kuiColumn--7">
<div style="background-color: lightgray; height: 20px"></div>
</div>
</div>
<div>
<div class="kuiColumn kuiColumn--6">
<div style="background-color: lightgray; height: 20px"></div>
</div><div class="kuiColumn kuiColumn--6">
<div style="background-color: lightgray; height: 20px"></div>
</div>
</div>

View file

@ -1,174 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React, {
Component,
} from 'react';
import {
KuiButton,
KuiContextMenu,
KuiFieldGroup,
KuiFieldGroupSection,
KuiPopover,
} from '../../../../components';
function flattenPanelTree(tree, array = []) {
array.push(tree);
if (tree.items) {
tree.items.forEach(item => {
if (item.panel) {
flattenPanelTree(item.panel, array);
item.panel = item.panel.id;
}
});
}
return array;
}
export default class extends Component {
constructor(props) {
super(props);
this.state = {
isPopoverOpen: false,
};
const panelTree = {
id: 0,
title: 'View options',
items: [{
name: 'Show fullscreen',
icon: (
<span className="kuiIcon fa-search" />
),
onClick: () => { this.closePopover(); window.alert('Show fullscreen'); },
}, {
name: 'Share this dashboard',
icon: <span className="kuiIcon fa-user" />,
panel: {
id: 1,
title: 'Share this dashboard',
items: [{
name: 'PDF reports',
icon: <span className="kuiIcon fa-user" />,
onClick: () => { this.closePopover(); window.alert('PDF reports'); },
}, {
name: 'CSV reports',
icon: <span className="kuiIcon fa-user" />,
onClick: () => { this.closePopover(); window.alert('CSV reports'); },
}, {
name: 'Embed code',
icon: <span className="kuiIcon fa-user" />,
panel: {
id: 2,
title: 'Embed code',
content: (
<div style={{ padding: 16 }}>
<div className="kuiVerticalRhythmSmall">
<KuiFieldGroup>
<KuiFieldGroupSection isWide>
<div className="kuiSearchInput">
<div className="kuiSearchInput__icon kuiIcon fa-search" />
<input
className="kuiSearchInput__input"
type="text"
/>
</div>
</KuiFieldGroupSection>
<KuiFieldGroupSection>
<select className="kuiSelect">
<option>Animal</option>
<option>Mineral</option>
<option>Vegetable</option>
</select>
</KuiFieldGroupSection>
</KuiFieldGroup>
</div>
<div className="kuiVerticalRhythmSmall">
<KuiButton buttonType="primary">Save</KuiButton>
</div>
</div>
),
},
}, {
name: 'Permalinks',
icon: <span className="kuiIcon fa-user" />,
onClick: () => { this.closePopover(); window.alert('Permalinks'); },
}],
},
}, {
name: 'Edit / add panels',
icon: <span className="kuiIcon fa-user" />,
onClick: () => { this.closePopover(); window.alert('Edit / add panels'); },
}, {
name: 'Display options',
icon: <span className="kuiIcon fa-user" />,
onClick: () => { this.closePopover(); window.alert('Display options'); },
}, {
name: 'Disabled option',
icon: <span className="kuiIcon fa-user" />,
disabled: true,
onClick: () => { this.closePopover(); window.alert('Disabled option'); },
}],
};
this.panels = flattenPanelTree(panelTree);
}
onButtonClick = () => {
this.setState(prevState => ({
isPopoverOpen: !prevState.isPopoverOpen,
}));
};
closePopover = () => {
this.setState({
isPopoverOpen: false,
});
};
render() {
const button = (
<KuiButton buttonType="basic" onClick={this.onButtonClick}>
Click me to load a context menu
</KuiButton>
);
return (
<KuiPopover
button={button}
isOpen={this.state.isPopoverOpen}
closePopover={this.closePopover}
panelPaddingSize="none"
withTitle
anchorPosition="left"
>
<KuiContextMenu
initialPanelId={0}
panels={this.panels}
/>
</KuiPopover>
);
}
}

View file

@ -1,88 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideCode,
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
import ContextMenu from './context_menu';
const contextMenuSource = require('!!raw-loader!./context_menu');
const contextMenuHtml = renderToHtml(ContextMenu);
import SinglePanel from './single_panel';
const singlePanelSource = require('!!raw-loader!./single_panel');
const singlePanelHtml = renderToHtml(SinglePanel);
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Context Menu"
source={[{
type: GuideSectionTypes.JS,
code: contextMenuSource,
}, {
type: GuideSectionTypes.HTML,
code: contextMenuHtml,
}]}
>
<GuideText>
<GuideCode>KuiContextMenu</GuideCode> is a nested menu system useful
for navigating complicated trees. It lives within a <GuideCode>KuiPopover</GuideCode>
which itself can be wrapped around any component (like a button in this example).
</GuideText>
<GuideDemo style={{ height: 280 }}>
<ContextMenu />
</GuideDemo>
<GuideDemo isDarkTheme={true} style={{ height: 280 }}>
<ContextMenu />
</GuideDemo>
</GuideSection>
<GuideSection
title="Single panel"
source={[{
type: GuideSectionTypes.JS,
code: singlePanelSource,
}, {
type: GuideSectionTypes.HTML,
code: singlePanelHtml,
}]}
>
<GuideText>
You can put a single panel inside of the menu using the
<GuideCode>KuiContextMenuPanel</GuideCode> component directly.
</GuideText>
<GuideDemo style={{ height: 280 }}>
<SinglePanel />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,103 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React, {
Component,
} from 'react';
import {
KuiButton,
KuiContextMenuPanel,
KuiContextMenuItem,
KuiPopover,
} from '../../../../components';
export default class extends Component {
constructor(props) {
super(props);
this.state = {
isPopoverOpen: false,
};
}
onButtonClick = () => {
this.setState(prevState => ({
isPopoverOpen: !prevState.isPopoverOpen,
}));
};
closePopover = () => {
this.setState({
isPopoverOpen: false,
});
};
render() {
const button = (
<KuiButton buttonType="basic" onClick={this.onButtonClick}>
Click me to load a context menu
</KuiButton>
);
const items = [
(
<KuiContextMenuItem
key="A"
icon={<span className="kuiIcon fa-user" />}
onClick={() => { this.closePopover(); window.alert('A'); }}
>
Option A
</KuiContextMenuItem>
), (
<KuiContextMenuItem
key="B"
icon={<span className="kuiIcon fa-user" />}
onClick={() => { this.closePopover(); window.alert('B'); }}
>
Option B
</KuiContextMenuItem>
), (
<KuiContextMenuItem
key="C"
icon={<span className="kuiIcon fa-user" />}
onClick={() => { this.closePopover(); window.alert('C'); }}
>
Option C
</KuiContextMenuItem>
)
];
return (
<KuiPopover
button={button}
isOpen={this.state.isPopoverOpen}
closePopover={this.closePopover}
panelPaddingSize="none"
withTitle
anchorPosition="left"
>
<KuiContextMenuPanel
title="Options"
items={items}
/>
</KuiPopover>
);
}
}

View file

@ -1,46 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiEvent,
KuiEventSymbol,
KuiEventBody,
KuiEventBodyMessage,
KuiEventBodyMetadata,
} from '../../../../components';
export default () => (
<KuiEvent>
<KuiEventSymbol>
<span className="kuiIcon kuiIcon--error fa-warning" aria-label="Error" role="img"/>
</KuiEventSymbol>
<KuiEventBody>
<KuiEventBodyMessage>
minimum_master_nodes setting of 1 is less than quorum of 2
</KuiEventBodyMessage>
<KuiEventBodyMetadata>
August 4, 2021
</KuiEventBodyMetadata>
</KuiEventBody>
</KuiEvent>
);

View file

@ -1,79 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
import Event from './event';
const eventSource = require('!!raw-loader!./event');
const eventHtml = renderToHtml(Event);
import EventMenu from './event_menu';
const eventMenuSource = require('!!raw-loader!./event_menu');
const eventMenuHtml = renderToHtml(EventMenu);
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Event"
source={[{
type: GuideSectionTypes.JS,
code: eventSource,
}, {
type: GuideSectionTypes.HTML,
code: eventHtml,
}]}
>
<GuideText>
Events can represent updates, logs, notifications, and status changes.
</GuideText>
<GuideDemo>
<Event />
</GuideDemo>
</GuideSection>
<GuideSection
title="Event Menu"
source={[{
type: GuideSectionTypes.JS,
code: eventMenuSource,
}, {
type: GuideSectionTypes.HTML,
code: eventMenuHtml,
}]}
>
<GuideText>
You&rsquo;ll typically want to present them within a Menu.
</GuideText>
<GuideDemo>
<EventMenu />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,88 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiEvent,
KuiEventSymbol,
KuiEventBody,
KuiEventBodyMessage,
KuiEventBodyMetadata,
KuiMenu,
KuiMenuItem,
} from '../../../../components';
export default () => (
<KuiMenu>
<KuiMenuItem>
<KuiEvent>
<KuiEventSymbol>
<span className="kuiIcon kuiIcon--error fa-warning" aria-label="Error" role="img"/>
</KuiEventSymbol>
<KuiEventBody>
<KuiEventBodyMessage>
minimum_master_nodes setting of 1 is less than quorum of 2
</KuiEventBodyMessage>
<KuiEventBodyMetadata>
August 4, 2021 02:23:28
</KuiEventBodyMetadata>
</KuiEventBody>
</KuiEvent>
</KuiMenuItem>
<KuiMenuItem>
<KuiEvent>
<KuiEventSymbol>
<span className="kuiIcon kuiIcon--error fa-warning" aria-label="Error" role="img"/>
</KuiEventSymbol>
<KuiEventBody>
<KuiEventBodyMessage>
Cluster state is red because 17 primary shards are unassigned
</KuiEventBodyMessage>
<KuiEventBodyMetadata>
August 3, 2021 12:00:54
</KuiEventBodyMetadata>
</KuiEventBody>
</KuiEvent>
</KuiMenuItem>
<KuiMenuItem>
<KuiEvent>
<KuiEventSymbol>
<span className="kuiIcon kuiIcon--warning fa-bolt" aria-label="Warning" role="img"/>
</KuiEventSymbol>
<KuiEventBody>
<KuiEventBodyMessage>
Elasticsearch node version mismatches detected: 5.1.0
</KuiEventBodyMessage>
<KuiEventBodyMetadata>
July 27, 2021 11:20:09
</KuiEventBodyMetadata>
</KuiEventBody>
</KuiEvent>
</KuiMenuItem>
</KuiMenu>
);

View file

@ -1,52 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideDemo,
GuideSandbox,
GuideSandboxCodeToggle,
GuideSectionTypes,
} from '../../components';
import EventsSandboxContent from './events_sandbox_content';
const eventsSandboxContentSource = require('!!raw-loader!./events_sandbox_content');
const eventsSandboxContentHtml = renderToHtml(EventsSandboxContent);
export default props => (
<GuideSandbox>
<GuideDemo
isFullScreen={true}
html={eventsSandboxContentHtml}
/>
<GuideSandboxCodeToggle
source={[{
type: GuideSectionTypes.JS,
code: eventsSandboxContentSource,
}, {
type: GuideSectionTypes.HTML,
code: eventsSandboxContentHtml,
}]}
title={props.route.name}
/>
</GuideSandbox>
);

View file

@ -1,112 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiEvent,
KuiEventSymbol,
KuiEventBody,
KuiEventBodyMessage,
KuiEventBodyMetadata,
KuiMenu,
KuiMenuItem,
KuiHeaderBar,
KuiHeaderBarSection
} from '../../../../components';
export default () => (
<div className="kuiView">
{/* Constrained width, centered content */}
<div className="kuiViewContent kuiViewContent--constrainedWidth">
<div className="kuiViewContentItem">
<KuiHeaderBar>
<KuiHeaderBarSection>
<h2 className="kuiSubTitle">
Cluster of Almonds
</h2>
</KuiHeaderBarSection>
<KuiHeaderBarSection>
<div className="kuiText">
<a className="kuiLink" href="#">View all 21 almonds</a>
</div>
</KuiHeaderBarSection>
</KuiHeaderBar>
<KuiMenu className="kuiVerticalRhythm">
<KuiMenuItem>
<KuiEvent>
<KuiEventSymbol>
<span className="kuiIcon kuiIcon--info fa-info" aria-label="Info" role="img"/>
</KuiEventSymbol>
<KuiEventBody>
<KuiEventBodyMessage>
margarine_masher_toad sitting of 1 is less than opossum of 2
</KuiEventBodyMessage>
<KuiEventBodyMetadata>
August 4, 2021 02:23:28
</KuiEventBodyMetadata>
</KuiEventBody>
</KuiEvent>
</KuiMenuItem>
<KuiMenuItem>
<KuiEvent>
<KuiEventSymbol>
<span className="kuiIcon kuiIcon--error fa-warning" aria-label="Error" role="img"/>
</KuiEventSymbol>
<KuiEventBody>
<KuiEventBodyMessage>
Cluster stork is red because 17 pillory stars are unenamored
</KuiEventBodyMessage>
<KuiEventBodyMetadata>
August 3, 2021 12:00:54
</KuiEventBodyMetadata>
</KuiEventBody>
</KuiEvent>
</KuiMenuItem>
<KuiMenuItem>
<KuiEvent>
<KuiEventSymbol>
<span className="kuiIcon kuiIcon--warning fa-bolt" aria-label="Warning" role="img"/>
</KuiEventSymbol>
<KuiEventBody>
<KuiEventBodyMessage>
Elastic band nematode vision marshmallow directed: 50,100
</KuiEventBodyMessage>
<KuiEventBodyMetadata>
July 27, 2021 11:20:09
</KuiEventBodyMetadata>
</KuiEventBody>
</KuiEvent>
</KuiMenuItem>
</KuiMenu>
</div>
</div>
</div>
);

View file

@ -1,263 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideCode,
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText,
} from '../../components';
import FlexGroup from './flex_group';
const flexGroupSource = require('!!raw-loader!./flex_group');
const flexGroupHtml = renderToHtml(FlexGroup);
import FlexGroupWrap from './flex_group_wrap';
const flexGroupWrapSource = require('!!raw-loader!./flex_group_wrap');
const flexGroupWrapHtml = renderToHtml(FlexGroupWrap);
import FlexItems from './flex_items';
const flexItemsSource = require('!!raw-loader!./flex_items');
const flexItemsHtml = renderToHtml(FlexItems);
import FlexGutter from './flex_gutter';
const flexGutterSource = require('!!raw-loader!./flex_gutter');
const flexGutterHtml = renderToHtml(FlexGutter);
import FlexGrowZero from './flex_grow_zero';
const flexGrowZeroSource = require('!!raw-loader!./flex_grow_zero');
const flexGrowZeroHtml = renderToHtml(FlexGrowZero);
import FlexGrowNumeric from './flex_grow_numeric';
const flexGrowNumericSource = require('!!raw-loader!./flex_grow_numeric');
const flexGrowNumericHtml = renderToHtml(FlexGrowNumeric);
import FlexJustify from './flex_justify';
const flexJustifySource = require('!!raw-loader!./flex_justify');
const flexJustifyHtml = renderToHtml(FlexJustify);
import FlexGrid from './flex_grid';
const flexGridSource = require('!!raw-loader!./flex_grid');
const flexGridHtml = renderToHtml(FlexGrid);
import FlexGridColumns from './flex_grid_columns';
const flexGridColumnsSource = require('!!raw-loader!./flex_grid_columns');
const flexGridColumnsHtml = renderToHtml(FlexGridColumns);
import FlexNest from './flex_nest';
const flexNestSource = require('!!raw-loader!./flex_nest');
const flexNestHtml = renderToHtml(FlexNest);
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="FlexGroup is for a single row layout"
source={[{
type: GuideSectionTypes.JS,
code: flexGroupSource,
}, {
type: GuideSectionTypes.HTML,
code: flexGroupHtml,
}]}
>
<GuideText>
<GuideCode>FlexGroup</GuideCode> is useful for setting up layouts for a <strong>single row</strong> of
content. By default any <GuideCode>FlexItem</GuideCode> within <GuideCode>FlexGroup</GuideCode> will
stretch and grow to match their siblings.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexGroup /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexGroup can wrap its items"
source={[{
type: GuideSectionTypes.JS,
code: flexGroupWrapSource,
}, {
type: GuideSectionTypes.HTML,
code: flexGroupWrapHtml,
}]}
>
<GuideText>
You can set <GuideCode>wrap</GuideCode> on <GuideCode>FlexGroup</GuideCode> if it
contains <GuideCode>FlexItem</GuideCode>s with minimum widths, which you want to wrap as
the container becomes narrower.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexGroupWrap /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexGroup accepts infinite items"
source={[{
type: GuideSectionTypes.JS,
code: flexItemsSource,
}, {
type: GuideSectionTypes.HTML,
code: flexItemsHtml,
}]}
>
<GuideText>
Same code as above. Notice that <GuideCode>FlexItem</GuideCode> creates equal width items
no matter the number of siblings. <GuideCode>FlexGroup</GuideCode> never wraps.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexItems /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexItem can individually turn off stretching"
source={[{
type: GuideSectionTypes.JS,
code: flexGrowZeroSource,
}, {
type: GuideSectionTypes.HTML,
code: flexGrowZeroHtml,
}]}
>
<GuideText>
Sometimes you do not want a <GuideCode>FlexItem</GuideCode> to grow. It
can be turned off on each item individually.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexGrowZero /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexItem can specify a proportional width"
source={[{
type: GuideSectionTypes.JS,
code: flexGrowNumericSource,
}, {
type: GuideSectionTypes.HTML,
code: flexGrowNumericHtml,
}]}
>
<GuideText>
You can specify a number between 1 and 10 for a <GuideCode>FlexItem</GuideCode> to
try to take up a proportional part of the flex box it is in.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexGrowNumeric /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexGroup can justify and align"
source={[{
type: GuideSectionTypes.JS,
code: flexJustifySource,
}, {
type: GuideSectionTypes.HTML,
code: flexJustifyHtml,
}]}
>
<GuideText>
<GuideCode>FlexGroup</GuideCode>s can also
use <GuideCode>justifyContent</GuideCode> and <GuideCode>alignItems</GuideCode>props
that accept normal flex-box paramenters. Below are some common scenarios,
where you need to separate two items, center justify a single one, or
center an item vertically. Note the usage
of <GuideCode>FlexItem</GuideCode>s with <GuideCode>grow=false</GuideCode> so that they do not stretch.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexJustify /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexGrids are for repeatable grids"
source={[{
type: GuideSectionTypes.JS,
code: flexGridSource,
}, {
type: GuideSectionTypes.HTML,
code: flexGridHtml,
}]}
>
<GuideText>
<GuideCode>FlexGrid</GuideCode> is a more rigid component that sets multiple, wrapping
rows of same width items.
</GuideText>
<GuideDemo className="guideDemo__highlightGridWrap"><FlexGrid /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexGrids can have set column widths"
source={[{
type: GuideSectionTypes.JS,
code: flexGridColumnsSource,
}, {
type: GuideSectionTypes.HTML,
code: flexGridColumnsHtml,
}]}
>
<GuideText>
You can set a <GuideCode>columns</GuideCode> prop to specify
anywhere between 2-4 columns. Any more would likely break on laptop screens.
</GuideText>
<GuideDemo className="guideDemo__highlightGridWrap"><FlexGridColumns /></GuideDemo>
</GuideSection>
<GuideSection
title="FlexGrids and FlexGroups can nest"
source={[{
type: GuideSectionTypes.JS,
code: flexNestSource,
}, {
type: GuideSectionTypes.HTML,
code: flexNestHtml,
}]}
>
<GuideText>
<GuideCode>FlexGroup</GuideCode> and <GuideCode>FlexGrid</GuideCode> can nest
within themselves indefinitely. For example, here we turn off the growth on a
<GuideCode>FlexGroup</GuideCode>, then nest a grid inside of it.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexNest /></GuideDemo>
</GuideSection>
<GuideSection
title="Gutter sizing can be used on either FlexGroups or FlexGrids"
source={[{
type: GuideSectionTypes.JS,
code: flexGutterSource,
}, {
type: GuideSectionTypes.HTML,
code: flexGutterHtml,
}]}
>
<GuideText>
The <GuideCode>gutterSize</GuideCode> prop can be applied to either a
<GuideCode>FlexGroup</GuideCode> or a <GuideCode>FlexGrid</GuideCode> to adjust the
spacing between <GuideCode>FlexItem</GuideCode>s.
</GuideText>
<GuideDemo className="guideDemo__highlightGrid"><FlexGutter /></GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,41 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGrid,
KuiFlexItem,
} from '../../../../components';
const ITEM_STYLE = { width: '300px' };
export default () => (
<div>
<KuiFlexGrid>
<KuiFlexItem style={ITEM_STYLE}><div>One</div></KuiFlexItem>
<KuiFlexItem style={ITEM_STYLE}><div>Two</div></KuiFlexItem>
<KuiFlexItem style={ITEM_STYLE}><div>Three</div></KuiFlexItem>
<KuiFlexItem style={ITEM_STYLE}><div>Four</div></KuiFlexItem>
<KuiFlexItem style={ITEM_STYLE}><div>Five</div></KuiFlexItem>
<KuiFlexItem style={ITEM_STYLE}><div>Six</div></KuiFlexItem>
<KuiFlexItem style={ITEM_STYLE}><div>Seven</div></KuiFlexItem>
</KuiFlexGrid>
</div>
);

View file

@ -1,39 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGrid,
KuiFlexItem,
} from '../../../../components';
export default () => (
<div>
<KuiFlexGrid columns={3}>
<KuiFlexItem><div>One</div></KuiFlexItem>
<KuiFlexItem><div>Two</div></KuiFlexItem>
<KuiFlexItem><div>Three</div></KuiFlexItem>
<KuiFlexItem><div>Four</div></KuiFlexItem>
<KuiFlexItem><div>Five</div></KuiFlexItem>
<KuiFlexItem><div>Six</div></KuiFlexItem>
<KuiFlexItem><div>Seven</div></KuiFlexItem>
</KuiFlexGrid>
</div>
);

View file

@ -1,37 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
} from '../../../../components';
export default () => (
<KuiFlexGroup>
<KuiFlexItem>Content grid item</KuiFlexItem>
<KuiFlexItem>
<p>Another content grid item</p>
<br/>
<br/>
<p>Note how both of these are the same width and height despite having different content?</p>
</KuiFlexItem>
</KuiFlexGroup>
);

View file

@ -1,41 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
} from '../../../../components';
export default () => (
<KuiFlexGroup wrap>
<KuiFlexItem style={{ minWidth: 300 }}>
Min-width 300px
</KuiFlexItem>
<KuiFlexItem style={{ minWidth: 300 }}>
Min-width 300px
</KuiFlexItem>
<KuiFlexItem style={{ minWidth: 300 }}>
Min-width 300px
</KuiFlexItem>
</KuiFlexGroup>
);

View file

@ -1,46 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
} from '../../../../components';
export default () => (
<div>
<KuiFlexGroup>
<KuiFlexItem grow={1}>1</KuiFlexItem>
<KuiFlexItem grow={2}>2<br />wraps content if necessary</KuiFlexItem>
<KuiFlexItem grow={3}>3<br />expands_to_fit_if_content_cannot_wrap</KuiFlexItem>
<KuiFlexItem grow={4}>4</KuiFlexItem>
</KuiFlexGroup>
<br /><br />
<KuiFlexGroup>
<KuiFlexItem grow={6}>6</KuiFlexItem>
<KuiFlexItem grow={3}>3</KuiFlexItem>
<KuiFlexItem grow={1}>1</KuiFlexItem>
<KuiFlexItem grow={3}>3</KuiFlexItem>
<KuiFlexItem grow={6}>6</KuiFlexItem>
</KuiFlexGroup>
</div>
);

View file

@ -1,34 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
} from '../../../../components';
export default () => (
<div>
<KuiFlexGroup>
<KuiFlexItem grow={false}>This item wont grow</KuiFlexItem>
<KuiFlexItem>But this item will.</KuiFlexItem>
</KuiFlexGroup>
</div>
);

View file

@ -1,76 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
} from '../../../../components';
export default () => (
<div>
<KuiFlexGroup gutterSize="none">
<KuiFlexItem>None</KuiFlexItem>
<KuiFlexItem>None</KuiFlexItem>
<KuiFlexItem>None</KuiFlexItem>
<KuiFlexItem>None</KuiFlexItem>
</KuiFlexGroup>
<br/>
<br/>
<KuiFlexGroup gutterSize="small">
<KuiFlexItem>Small</KuiFlexItem>
<KuiFlexItem>Small</KuiFlexItem>
<KuiFlexItem>Small</KuiFlexItem>
<KuiFlexItem>Small</KuiFlexItem>
</KuiFlexGroup>
<br/>
<br/>
<KuiFlexGroup gutterSize="medium">
<KuiFlexItem>Medium</KuiFlexItem>
<KuiFlexItem>Medium</KuiFlexItem>
<KuiFlexItem>Medium</KuiFlexItem>
<KuiFlexItem>Medium</KuiFlexItem>
</KuiFlexGroup>
<br/>
<br/>
<KuiFlexGroup gutterSize="large">
<KuiFlexItem>Large (default)</KuiFlexItem>
<KuiFlexItem>Large (default)</KuiFlexItem>
<KuiFlexItem>Large (default)</KuiFlexItem>
<KuiFlexItem>Large (default)</KuiFlexItem>
</KuiFlexGroup>
<br/>
<br/>
<KuiFlexGroup gutterSize="extraLarge">
<KuiFlexItem>Extra Large</KuiFlexItem>
<KuiFlexItem>Extra Large</KuiFlexItem>
<KuiFlexItem>Extra Large</KuiFlexItem>
<KuiFlexItem>Extra Large</KuiFlexItem>
</KuiFlexGroup>
</div>
);

View file

@ -1,35 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
} from '../../../../components';
export default () => (
<KuiFlexGroup>
<KuiFlexItem>One</KuiFlexItem>
<KuiFlexItem>Two</KuiFlexItem>
<KuiFlexItem>Three</KuiFlexItem>
<KuiFlexItem>Four</KuiFlexItem>
<KuiFlexItem>Five</KuiFlexItem>
</KuiFlexGroup>
);

View file

@ -1,54 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
} from '../../../../components';
export default () => (
<div>
<KuiFlexGroup justifyContent="spaceBetween">
<KuiFlexItem grow={false}>One here on the left</KuiFlexItem>
<KuiFlexItem grow={false}>The other over here on the right.</KuiFlexItem>
</KuiFlexGroup>
<br/><br/>
<KuiFlexGroup justifyContent="spaceAround">
<KuiFlexItem grow={false}>I&rsquo;m a single centered item!</KuiFlexItem>
</KuiFlexGroup>
<br/><br/>
<KuiFlexGroup alignItems="center">
<KuiFlexItem grow={false}>
<div>
<p>I</p>
<p>am</p>
<p>really</p>
<p>tall</p>
</div>
</KuiFlexItem>
<KuiFlexItem>I am vertically centered!</KuiFlexItem>
</KuiFlexGroup>
</div>
);

View file

@ -1,44 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiFlexGroup,
KuiFlexItem,
KuiFlexGrid,
} from '../../../../components';
export default () => (
<div>
<KuiFlexGroup>
<KuiFlexItem grow={false}>Group One</KuiFlexItem>
<KuiFlexItem grow={false}>
<div>Group Two</div>
<br/><br/>
<KuiFlexGrid columns={3}>
<KuiFlexItem>Nested Grid One</KuiFlexItem>
<KuiFlexItem>Nested Grid Two</KuiFlexItem>
<KuiFlexItem>Nested Grid Three</KuiFlexItem>
<KuiFlexItem>Nested Grid Four</KuiFlexItem>
</KuiFlexGrid>
</KuiFlexItem>
</KuiFlexGroup>
</div>
);

View file

@ -1,116 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiGallery,
KuiGalleryItem,
KuiGalleryItemIcon,
KuiGalleryItemImage,
KuiGalleryItemLabel
} from '../../../../components';
export default () => {
/**
* These styles are just for demonstration purposes. It is recommended to use
* properly named classes instead of CSS properties in production code.
*/
const imageStyle = {
backgroundColor: 'lightgray'
};
return (
<div>
<div className="kuiVerticalRhythm">
<h2 className="kuiSubTitle kuiVerticalRhythmSmall">
Some items
</h2>
<KuiGallery className="kuiVerticalRhythmSmall">
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>
<KuiGalleryItemLabel>
Item A
</KuiGalleryItemLabel>
<KuiGalleryItemIcon className="fa-flask"/>
</KuiGalleryItem>
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>
<KuiGalleryItemLabel>
Item B
</KuiGalleryItemLabel>
</KuiGalleryItem>
<KuiGalleryItem onClick={() => window.alert('Clicked an item')}>
<KuiGalleryItemImage style={imageStyle}/>
<KuiGalleryItemLabel>
Item C
</KuiGalleryItemLabel>
</KuiGalleryItem>
<KuiGalleryItem>
<KuiGalleryItemImage style={imageStyle}/>
<KuiGalleryItemLabel>
Item D
</KuiGalleryItemLabel>
</KuiGalleryItem>
<KuiGalleryItem>
<KuiGalleryItemImage style={imageStyle}/>
<KuiGalleryItemLabel>
Item E
</KuiGalleryItemLabel>
</KuiGalleryItem>
</KuiGallery>
</div>
<div className="kuiVerticalRhythm">
<div className="kuiSubTitle kuiVerticalRhythmSmall">
Some more items
</div>
<KuiGallery className="kuiVerticalRhythmSmall">
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>
<KuiGalleryItemLabel>
Item F
</KuiGalleryItemLabel>
</KuiGalleryItem>
<KuiGalleryItem href="#">
<KuiGalleryItemImage style={imageStyle}/>
<KuiGalleryItemLabel>
Item G with a long label with ellipsis
</KuiGalleryItemLabel>
</KuiGalleryItem>
</KuiGallery>
</div>
</div>
);
};

View file

@ -1,66 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideCode,
GuideDemo,
GuidePage,
GuideSection,
GuideSectionTypes,
GuideText
} from '../../components';
import Gallery from './gallery';
const gallerySource = require('!!raw-loader!./gallery');
const galleryHtml = renderToHtml(Gallery);
export default props => (
<GuidePage title={props.route.name}>
<GuideSection
title="Gallery"
source={[{
type: GuideSectionTypes.JS,
code: gallerySource,
}, {
type: GuideSectionTypes.HTML,
code: galleryHtml,
}]}
>
<GuideText>
Use GalleryItem to show a gallery item.
If you specify an <GuideCode>href</GuideCode> property the item will render
as an HTML <GuideCode>a</GuideCode> element. If not, it will be rendered
as a <GuideCode>button</GuideCode> and you can attach an
<GuideCode>onClick</GuideCode> listener to it.
</GuideText>
<GuideText>
<strong>Note:</strong> You are not allowed to specify the <GuideCode>href</GuideCode> property
and the <GuideCode>onClick</GuideCode> property at the same time.
</GuideText>
<GuideDemo>
<Gallery />
</GuideDemo>
</GuideSection>
</GuidePage>
);

View file

@ -1,37 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you 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.
*/
import React from 'react';
import {
KuiHeaderBar,
KuiHeaderBarSection
} from '../../../../components';
export default () => {
return (
<KuiHeaderBar>
<KuiHeaderBarSection>
<h2 className="kuiSubTitle">
Section 1
</h2>
</KuiHeaderBarSection>
</KuiHeaderBar>
);
};

Some files were not shown because too many files have changed in this diff Show more