diff --git a/composer.json b/composer.json index 06be551..2908283 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,10 @@ "drupal/entity_clone": "^2.1@beta", "drupal/entity_hierarchy": "^3.3", "drupal/field_group": "^3.4", - "drupal/gin": "^4.0", + "drupal/gin": "^5.0", + "drupal/gin_lb": "^3.0@beta", "drupal/gin_login": "^2.1", + "drupal/gin_toolbar": "^3", "drupal/google_tag": "^2.0", "drupal/html_formatter": "^2.0", "drupal/jsonapi_permission_access": "1.0.1", @@ -83,6 +85,9 @@ } }, "patches": { + "drupal/core": { + "exposed filters": "patches/core/exposed-filters.patch" + }, "drupal/fpa": { "Drupal 11 compat.": "./patches/fpa/core-11.patch" }, @@ -149,5 +154,8 @@ "dmore/behat-chrome-extension": "^1.4", "drupal/core-dev": "^11.0", "drupal/drupal-extension": "^5.0" + }, + "scripts": { + "build-fe": "cd web/themes/custom/dchadwick && npm ci && npm run compile" } } diff --git a/composer.lock b/composer.lock index 87b972b..c0dda04 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ef10ebd7318f2a38105ecd9ee48d84fd", + "content-hash": "cb8e7c4fd7e517fde208a6c84d11fd64", "packages": [ { "name": "asm89/stack-cors", @@ -1962,26 +1962,27 @@ }, { "name": "drupal/better_exposed_filters", - "version": "7.0.2", + "version": "7.0.5", "source": { "type": "git", "url": "https://git.drupalcode.org/project/better_exposed_filters.git", - "reference": "7.0.2" + "reference": "7.0.5" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/better_exposed_filters-7.0.2.zip", - "reference": "7.0.2", - "shasum": "11f6b9021867690e2284325b3c21acdac8a94bb4" + "url": "https://ftp.drupal.org/files/projects/better_exposed_filters-7.0.5.zip", + "reference": "7.0.5", + "shasum": "a215444c39a6ae384710a6c707caf593f6dd1e2d" }, "require": { - "drupal/core": "^10 || ^11" + "drupal/core": "^10 || ^11", + "drupal/nouislider_js": "^15.8" }, "type": "drupal-module", "extra": { "drupal": { - "version": "7.0.2", - "datestamp": "1729001179", + "version": "7.0.5", + "datestamp": "1738353781", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -3160,27 +3161,27 @@ }, { "name": "drupal/gin", - "version": "4.0.0", + "version": "5.0.3", "source": { "type": "git", "url": "https://git.drupalcode.org/project/gin.git", - "reference": "4.0.0" + "reference": "5.0.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/gin-4.0.0.zip", - "reference": "4.0.0", - "shasum": "8607d9f225b550c9c2f0a84d0371adabc0ac42c1" + "url": "https://ftp.drupal.org/files/projects/gin-5.0.3.zip", + "reference": "5.0.3", + "shasum": "9b72e430c8be7126885243b1e78eec6e3dc20196" }, "require": { - "drupal/core": "^10 || ^11", - "drupal/gin_toolbar": "^1.0@beta" + "drupal/core": "^11.2", + "drupal/gin_toolbar": "^3.0" }, "type": "drupal-theme", "extra": { "drupal": { - "version": "4.0.0", - "datestamp": "1734696940", + "version": "5.0.3", + "datestamp": "1752238057", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -3224,6 +3225,71 @@ } ] }, + { + "name": "drupal/gin_lb", + "version": "3.0.0-beta1", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/gin_lb.git", + "reference": "3.0.0-beta1" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/gin_lb-3.0.0-beta1.zip", + "reference": "3.0.0-beta1", + "shasum": "eadb4ff259436a897c635dfa45129d4ef94e1d57" + }, + "require": { + "drupal/core": "^11.2", + "drupal/gin": "^5.0", + "drupal/gin_toolbar": "^3.0" + }, + "conflict": { + "drupal/lb_claro": "*" + }, + "require-dev": { + "drupal/field_group": "*", + "drupal/section_library": "*" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "3.0.0-beta1", + "datestamp": "1753078263", + "security-coverage": { + "status": "not-covered", + "message": "Beta releases are not covered by Drupal security advisories." + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "christian.wiedemann", + "homepage": "https://www.drupal.org/user/861002" + }, + { + "name": "duwid", + "homepage": "https://www.drupal.org/user/2693877" + }, + { + "name": "grimreaper", + "homepage": "https://www.drupal.org/user/2388214" + }, + { + "name": "sch4lly", + "homepage": "https://www.drupal.org/user/856550" + } + ], + "description": "Layout Builder in Gin style.", + "homepage": "https://www.drupal.org/project/gin_lb", + "support": { + "source": "https://git.drupalcode.org/project/gin_lb" + } + }, { "name": "drupal/gin_login", "version": "2.1.3", @@ -3285,29 +3351,29 @@ }, { "name": "drupal/gin_toolbar", - "version": "1.0.0-rc6", + "version": "3.0.2", "source": { "type": "git", "url": "https://git.drupalcode.org/project/gin_toolbar.git", - "reference": "8.x-1.0-rc6" + "reference": "3.0.2" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/gin_toolbar-8.x-1.0-rc6.zip", - "reference": "8.x-1.0-rc6", - "shasum": "542def14b9a5435efb4e021d384fa3f7b0fc6e78" + "url": "https://ftp.drupal.org/files/projects/gin_toolbar-3.0.2.zip", + "reference": "3.0.2", + "shasum": "6d041143d67440e5b68f6f927e8edb298866dd94" }, "require": { - "drupal/core": "^9 || ^10 || ^11" + "drupal/core": "^11.2" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-1.0-rc6", - "datestamp": "1718368950", + "version": "3.0.2", + "datestamp": "1752237929", "security-coverage": { - "status": "not-covered", - "message": "RC releases are not covered by Drupal security advisories." + "status": "covered", + "message": "Covered by Drupal's security advisory policy" } } }, @@ -3996,6 +4062,35 @@ "slack": "#migrate" } }, + { + "name": "drupal/nouislider_js", + "version": "15.8.1", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/nouislider_js.git", + "reference": "b5610d5842784581e4c766cd1c3852ca0b355ed5" + }, + "dist": { + "type": "zip", + "url": "https://git.drupalcode.org/api/v4/projects/project%2Fnouislider_js/repository/archive.zip?sha=b5610d5842784581e4c766cd1c3852ca0b355ed5", + "reference": "b5610d5842784581e4c766cd1c3852ca0b355ed5", + "shasum": "" + }, + "type": "drupal-library", + "extra": { + "installer-name": "nouislider" + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT License" + ], + "description": "Mirror of the noUiSlider javascript library tagged as a Drupal library.", + "homepage": "https://github.com/leongersen/noUiSlider", + "support": { + "source": "https://git.drupalcode.org/project/nouislider_js/-/tree/15.8.0" + }, + "time": "2025-01-03T10:53:20+00:00" + }, { "name": "drupal/pathauto", "version": "1.13.0", @@ -14096,16 +14191,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", "shasum": "" }, "require": { @@ -14137,9 +14232,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.2.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" }, - "time": "2025-07-13T07:04:09+00:00" + "time": "2025-08-30T15:50:23+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -17303,6 +17398,7 @@ "minimum-stability": "dev", "stability-flags": { "drupal/entity_clone": 10, + "drupal/gin_lb": 10, "drupal/webform": 10 }, "prefer-stable": true, diff --git a/config/default/block.block.dchadwick_breadcrumbs.yml b/config/default/block.block.dchadwick_breadcrumbs.yml new file mode 100644 index 0000000..57bd40d --- /dev/null +++ b/config/default/block.block.dchadwick_breadcrumbs.yml @@ -0,0 +1,20 @@ +uuid: ef64650b-45ea-4454-bd60-3d99a0949c78 +langcode: en +status: true +dependencies: + module: + - system + theme: + - dchadwick +id: dchadwick_breadcrumbs +theme: dchadwick +region: content +weight: 0 +provider: null +plugin: system_breadcrumb_block +settings: + id: system_breadcrumb_block + label: Breadcrumbs + label_display: '0' + provider: system +visibility: { } diff --git a/config/default/block.block.dchadwick_copyrightblock.yml b/config/default/block.block.dchadwick_copyrightblock.yml new file mode 100644 index 0000000..c7a0fea --- /dev/null +++ b/config/default/block.block.dchadwick_copyrightblock.yml @@ -0,0 +1,20 @@ +uuid: 6dc30fba-09b1-4b9a-bbd5-310ff47da034 +langcode: en +status: true +dependencies: + module: + - dc_core + theme: + - dchadwick +id: dchadwick_copyrightblock +theme: dchadwick +region: footer_bottom +weight: 0 +provider: null +plugin: copyright_block +settings: + id: copyright_block + label: 'Copyright Block' + label_display: '0' + provider: dc_core +visibility: { } diff --git a/config/default/block.block.dchadwick_recentfightsblock.yml b/config/default/block.block.dchadwick_recentfightsblock.yml deleted file mode 100644 index 4ee6797..0000000 --- a/config/default/block.block.dchadwick_recentfightsblock.yml +++ /dev/null @@ -1,25 +0,0 @@ -uuid: 7f8dcc6e-94eb-4f00-9366-85e929ef583e -langcode: en -status: false -dependencies: - module: - - system - - ufc - theme: - - dchadwick -id: dchadwick_recentfightsblock -theme: dchadwick -region: content -weight: 1 -provider: null -plugin: recent_fights_block -settings: - id: recent_fights_block - label: 'Recent Fights Block' - label_display: visible - provider: ufc -visibility: - request_path: - id: request_path - negate: false - pages: '' diff --git a/config/default/core.entity_form_display.node.fight.default.yml b/config/default/core.entity_form_display.node.fight.default.yml index b33f38a..81f58ba 100644 --- a/config/default/core.entity_form_display.node.fight.default.yml +++ b/config/default/core.entity_form_display.node.fight.default.yml @@ -3,6 +3,7 @@ langcode: en status: true dependencies: config: + - field.field.node.fight.body - field.field.node.fight.field_accuracy - field.field.node.fight.field_event - field.field.node.fight.field_fight_date @@ -88,6 +89,7 @@ content: placeholder: '' third_party_settings: { } hidden: + body: true created: true path: true promote: true diff --git a/config/default/core.entity_form_display.node.fighter.default.yml b/config/default/core.entity_form_display.node.fighter.default.yml index 5f00b19..b86e679 100644 --- a/config/default/core.entity_form_display.node.fighter.default.yml +++ b/config/default/core.entity_form_display.node.fighter.default.yml @@ -3,6 +3,7 @@ langcode: en status: true dependencies: config: + - field.field.node.fighter.body - field.field.node.fighter.field_absorbed_per_min - field.field.node.fighter.field_age - field.field.node.fighter.field_average_fight_time @@ -390,6 +391,7 @@ content: placeholder: '' third_party_settings: { } hidden: + body: true created: true field_decisions: true layout_builder__layout: true diff --git a/config/default/core.entity_form_display.node.snippet.default.yml b/config/default/core.entity_form_display.node.snippet.default.yml index 943f69d..11ead70 100644 --- a/config/default/core.entity_form_display.node.snippet.default.yml +++ b/config/default/core.entity_form_display.node.snippet.default.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - field.field.node.snippet.body + - field.field.node.snippet.field_snippet_type - node.type.snippet module: - path @@ -15,7 +16,7 @@ mode: default content: body: type: text_textarea_with_summary - weight: 121 + weight: 8 region: content settings: rows: 9 @@ -25,40 +26,46 @@ content: third_party_settings: { } created: type: datetime_timestamp - weight: 10 + weight: 2 + region: content + settings: { } + third_party_settings: { } + field_snippet_type: + type: options_select + weight: 7 region: content settings: { } third_party_settings: { } path: type: path - weight: 30 + weight: 5 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 15 + weight: 3 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 120 + weight: 6 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 16 + weight: 4 region: content settings: display_label: true third_party_settings: { } title: type: string_textfield - weight: -5 + weight: 0 region: content settings: size: 60 @@ -66,7 +73,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 5 + weight: 1 region: content settings: match_operator: CONTAINS diff --git a/config/default/core.entity_view_display.node.fight.default.yml b/config/default/core.entity_view_display.node.fight.default.yml index 4447921..f385b83 100644 --- a/config/default/core.entity_view_display.node.fight.default.yml +++ b/config/default/core.entity_view_display.node.fight.default.yml @@ -3,6 +3,7 @@ langcode: en status: true dependencies: config: + - field.field.node.fight.body - field.field.node.fight.field_accuracy - field.field.node.fight.field_event - field.field.node.fight.field_fight_date @@ -97,4 +98,5 @@ content: third_party_settings: { } weight: 0 region: content -hidden: { } +hidden: + body: true diff --git a/config/default/core.entity_view_display.node.fight.teaser.yml b/config/default/core.entity_view_display.node.fight.teaser.yml index eb83a9b..8b3f69d 100644 --- a/config/default/core.entity_view_display.node.fight.teaser.yml +++ b/config/default/core.entity_view_display.node.fight.teaser.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - core.entity_view_mode.node.teaser + - field.field.node.fight.body - field.field.node.fight.field_accuracy - field.field.node.fight.field_event - field.field.node.fight.field_fight_date @@ -27,6 +28,7 @@ content: weight: 100 region: content hidden: + body: true field_accuracy: true field_event: true field_fight_date: true diff --git a/config/default/core.entity_view_display.node.fighter.default.yml b/config/default/core.entity_view_display.node.fighter.default.yml index 8003849..b939163 100644 --- a/config/default/core.entity_view_display.node.fighter.default.yml +++ b/config/default/core.entity_view_display.node.fighter.default.yml @@ -3,6 +3,7 @@ langcode: en status: true dependencies: config: + - field.field.node.fighter.body - field.field.node.fighter.field_absorbed_per_min - field.field.node.fighter.field_age - field.field.node.fighter.field_average_fight_time @@ -1008,5 +1009,6 @@ content: weight: 20 region: content hidden: + body: true layout_builder__layout: true links: true diff --git a/config/default/core.entity_view_display.node.fighter.teaser.yml b/config/default/core.entity_view_display.node.fighter.teaser.yml index 4bc9911..5fcd886 100644 --- a/config/default/core.entity_view_display.node.fighter.teaser.yml +++ b/config/default/core.entity_view_display.node.fighter.teaser.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - core.entity_view_mode.node.teaser + - field.field.node.fighter.body - field.field.node.fighter.field_absorbed_per_min - field.field.node.fighter.field_age - field.field.node.fighter.field_average_fight_time @@ -48,6 +49,7 @@ bundle: fighter mode: teaser content: { } hidden: + body: true field_absorbed_per_min: true field_age: true field_average_fight_time: true diff --git a/config/default/core.entity_view_display.node.snippet.default.yml b/config/default/core.entity_view_display.node.snippet.default.yml index ec15788..faca732 100644 --- a/config/default/core.entity_view_display.node.snippet.default.yml +++ b/config/default/core.entity_view_display.node.snippet.default.yml @@ -4,6 +4,7 @@ status: true dependencies: config: - field.field.node.snippet.body + - field.field.node.snippet.field_snippet_type - node.type.snippet module: - layout_builder @@ -18,12 +19,35 @@ third_party_settings: - layout_id: layout_onecol layout_settings: - label: '' + label: 'Banner Section' context_mapping: { } layout_builder_styles_style: + 0: '' + 1: '' container: container hero: 0 components: + c1ad47bd-26cf-459e-acec-db1bd9026963: + uuid: c1ad47bd-26cf-459e-acec-db1bd9026963 + region: content + configuration: + id: 'field_block:node:snippet:title' + label: Title + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: html_field_formatter + label: hidden + settings: + tag: h1 + class: '' + link: false + third_party_settings: { } + weight: 1 + additional: { } 36c2345c-4ba4-493e-8df8-21a171c4d12c: uuid: 36c2345c-4ba4-493e-8df8-21a171c4d12c region: content @@ -34,6 +58,16 @@ third_party_settings: entity: layout_builder.entity weight: 0 additional: { } + third_party_settings: { } + - + layout_id: layout_onecol + layout_settings: + label: '' + context_mapping: { } + layout_builder_styles_style: + container: container + hero: 0 + components: 431863a8-5042-43dd-9685-eb24199b12c9: uuid: 431863a8-5042-43dd-9685-eb24199b12c9 region: content @@ -47,6 +81,25 @@ third_party_settings: label: hidden settings: { } third_party_settings: { } + weight: 2 + additional: { } + b99b0ee4-f80a-4ddb-9efa-abf6809ba225: + uuid: b99b0ee4-f80a-4ddb-9efa-abf6809ba225 + region: content + configuration: + id: 'field_block:node:snippet:field_snippet_type' + label: 'Snippet Type' + label_display: '0' + provider: layout_builder + context_mapping: + entity: layout_builder.entity + view_mode: view_mode + formatter: + type: entity_reference_label + label: hidden + settings: + link: false + third_party_settings: { } weight: 1 additional: { } third_party_settings: { } @@ -62,6 +115,14 @@ content: third_party_settings: { } weight: 101 region: content + field_snippet_type: + type: entity_reference_label + label: above + settings: + link: true + third_party_settings: { } + weight: 102 + region: content links: settings: { } third_party_settings: { } diff --git a/config/default/core.entity_view_display.node.snippet.teaser.yml b/config/default/core.entity_view_display.node.snippet.teaser.yml index ae1744a..1b1c825 100644 --- a/config/default/core.entity_view_display.node.snippet.teaser.yml +++ b/config/default/core.entity_view_display.node.snippet.teaser.yml @@ -5,6 +5,7 @@ dependencies: config: - core.entity_view_mode.node.teaser - field.field.node.snippet.body + - field.field.node.snippet.field_snippet_type - node.type.snippet module: - text @@ -27,4 +28,5 @@ content: third_party_settings: { } weight: 100 region: content -hidden: { } +hidden: + field_snippet_type: true diff --git a/config/default/core.extension.yml b/config/default/core.extension.yml index f4b2951..82ff47e 100644 --- a/config/default/core.extension.yml +++ b/config/default/core.extension.yml @@ -22,6 +22,7 @@ module: field_ui: 0 file: 0 filter: 0 + gin_lb: 0 gin_login: 0 gin_toolbar: 0 google_tag: 0 diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.body.yml b/config/default/field.field.node.fight.body.yml similarity index 81% rename from web/modules/custom/ufc/config/x-nstall/field.field.node.fight.body.yml rename to config/default/field.field.node.fight.body.yml index cc8ac8c..6e1257f 100644 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.body.yml +++ b/config/default/field.field.node.fight.body.yml @@ -7,6 +7,8 @@ dependencies: - node.type.fight module: - text +_core: + default_config_hash: l5XQlmt3uEM-0N-hDWQrStxl3h8CFpzAPjqZCOmJGJI id: node.fight.body field_name: body entity_type: node @@ -20,4 +22,5 @@ default_value_callback: '' settings: display_summary: true required_summary: false + allowed_formats: { } field_type: text_with_summary diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.body.yml b/config/default/field.field.node.fighter.body.yml similarity index 81% rename from web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.body.yml rename to config/default/field.field.node.fighter.body.yml index 1d59e51..6319b87 100644 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.body.yml +++ b/config/default/field.field.node.fighter.body.yml @@ -7,6 +7,8 @@ dependencies: - node.type.fighter module: - text +_core: + default_config_hash: jdS-0ctBTHEp3ZHS3_Fdq2XMZZJbxWwzeA_Ts8RH9y4 id: node.fighter.body field_name: body entity_type: node @@ -20,4 +22,5 @@ default_value_callback: '' settings: display_summary: true required_summary: false + allowed_formats: { } field_type: text_with_summary diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_event.yml b/config/default/field.field.node.snippet.field_snippet_type.yml similarity index 51% rename from web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_event.yml rename to config/default/field.field.node.snippet.field_snippet_type.yml index 4edebfb..16ebfc6 100644 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_event.yml +++ b/config/default/field.field.node.snippet.field_snippet_type.yml @@ -1,17 +1,17 @@ -uuid: 08eeb95e-ad83-449b-b420-405c92f94888 +uuid: 800af856-54e3-4ebe-b24a-ca0710c2abe6 langcode: en status: true dependencies: config: - - field.storage.node.field_event - - node.type.fight - - taxonomy.vocabulary.ufc_events -id: node.fight.field_event -field_name: field_event + - field.storage.node.field_snippet_type + - node.type.snippet + - taxonomy.vocabulary.tags +id: node.snippet.field_snippet_type +field_name: field_snippet_type entity_type: node -bundle: fight -label: Event -description: 'The event for this fight.' +bundle: snippet +label: 'Snippet Type' +description: 'Type of snippet' required: false translatable: false default_value: { } @@ -20,10 +20,10 @@ settings: handler: 'default:taxonomy_term' handler_settings: target_bundles: - ufc_events: ufc_events + tags: tags sort: field: name direction: asc - auto_create: false + auto_create: true auto_create_bundle: '' field_type: entity_reference diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_division.yml b/config/default/field.storage.node.field_snippet_type.yml similarity index 69% rename from web/modules/custom/ufc/config/x-nstall/field.storage.node.field_division.yml rename to config/default/field.storage.node.field_snippet_type.yml index 0859a3b..787c05a 100644 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_division.yml +++ b/config/default/field.storage.node.field_snippet_type.yml @@ -1,19 +1,19 @@ -uuid: 27166575-3538-4b15-aaa0-5da43aaf609b +uuid: e53b2d86-1969-4398-a78e-71d3f69ab586 langcode: en status: true dependencies: module: - node - taxonomy -id: node.field_division -field_name: field_division +id: node.field_snippet_type +field_name: field_snippet_type entity_type: node type: entity_reference settings: target_type: taxonomy_term module: core locked: false -cardinality: 1 +cardinality: -1 translatable: true indexes: { } persist_with_no_fields: false diff --git a/config/default/gin.settings.yml b/config/default/gin.settings.yml index 6516f71..65abddf 100644 --- a/config/default/gin.settings.yml +++ b/config/default/gin.settings.yml @@ -26,4 +26,4 @@ focus_color: '' layout_density: small show_description_toggle: false show_user_theme_settings: false -sticky_action_buttons: false +sticky_action_buttons: true diff --git a/config/default/gin_lb.settings.yml b/config/default/gin_lb.settings.yml new file mode 100644 index 0000000..b3d5906 --- /dev/null +++ b/config/default/gin_lb.settings.yml @@ -0,0 +1,7 @@ +_core: + default_config_hash: Um_xSc6nOhSP5pfhCboUKWpzJ3S-t4ZdmTKOMnK_D1A +toastify_loading: cdn +enable_preview_regions: false +hide_discard_button: true +hide_revert_button: true +save_behavior: stay diff --git a/config/default/node.type.article.yml b/config/default/node.type.article.yml index 84c6077..6d3de6f 100644 --- a/config/default/node.type.article.yml +++ b/config/default/node.type.article.yml @@ -13,7 +13,7 @@ _core: default_config_hash: AeW1SEDgb1OTQACAWGhzvMknMYAJlcZu0jljfeU3oso name: Article type: article -description: 'Use articles for time-sensitive content like news, press releases or blog posts.' +description: 'Use for time-sensitive content like news, press releases or blog posts.' help: null new_revision: true preview_mode: 1 diff --git a/config/default/node.type.character.yml b/config/default/node.type.character.yml index ae020ec..8744d5e 100644 --- a/config/default/node.type.character.yml +++ b/config/default/node.type.character.yml @@ -11,7 +11,7 @@ third_party_settings: parent: 'main:' name: Character type: character -description: null +description: 'Use to create a character in Lord of the Rings' help: null new_revision: true preview_mode: 1 diff --git a/config/default/node.type.fight.yml b/config/default/node.type.fight.yml index 7b5d5da..d8a35ad 100644 --- a/config/default/node.type.fight.yml +++ b/config/default/node.type.fight.yml @@ -13,7 +13,7 @@ _core: default_config_hash: '-oNx4Ml6aAH2vsCaF2Xf1lO994OOn3LlkHRzDs-CacA' name: Fight type: fight -description: 'A fight between two fighters.' +description: 'Use to create a fight between two fighters.' help: null new_revision: true preview_mode: 1 diff --git a/config/default/node.type.fighter.yml b/config/default/node.type.fighter.yml index e58be37..5afee58 100644 --- a/config/default/node.type.fighter.yml +++ b/config/default/node.type.fighter.yml @@ -13,7 +13,7 @@ _core: default_config_hash: cnV8ZFMmV0F85P7RKCraA1vQc576ElQMYcw86QILGTs name: Fighter type: fighter -description: 'A fighter.' +description: 'Use to create a fighter.' help: null new_revision: true preview_mode: 1 diff --git a/config/default/node.type.page.yml b/config/default/node.type.page.yml index 0c7b6c6..787880e 100644 --- a/config/default/node.type.page.yml +++ b/config/default/node.type.page.yml @@ -1,12 +1,19 @@ uuid: a1065b81-d7a0-46bc-a1bf-44a0b76450ff langcode: en status: true -dependencies: { } +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' _core: default_config_hash: KuyA4NHPXcmKAjRtwa0vQc2ZcyrUJy6IlS2TAyMNRbc name: 'Basic page' type: page -description: "Use basic pages for your static content, such as an 'About us' page." +description: "Use for your general content, such as an 'About us' page." help: null new_revision: true preview_mode: 1 diff --git a/config/default/node.type.snippet.yml b/config/default/node.type.snippet.yml index e45be0f..1f34f8b 100644 --- a/config/default/node.type.snippet.yml +++ b/config/default/node.type.snippet.yml @@ -11,7 +11,7 @@ third_party_settings: parent: 'main:' name: Snippet type: snippet -description: 'A snippet of code.' +description: 'Use to create a snippet of code.' help: null new_revision: true preview_mode: 1 diff --git a/config/default/system.site.yml b/config/default/system.site.yml index 1a65569..8c56c75 100644 --- a/config/default/system.site.yml +++ b/config/default/system.site.yml @@ -8,7 +8,7 @@ slogan: '' page: 403: '' 404: '' - front: /node/4 + front: /node/1 admin_compact_mode: false weight_select_max: 100 default_langcode: en diff --git a/config/default/views.view.all_fighters.yml b/config/default/views.view.all_fighters.yml index 6fddb61..fa5dd20 100644 --- a/config/default/views.view.all_fighters.yml +++ b/config/default/views.view.all_fighters.yml @@ -610,7 +610,8 @@ display: type: normal title: Fighters description: '' - weight: -48 + weight: -47 + enabled: false expanded: false menu_name: main parent: '' diff --git a/config/default/views.view.events_list.yml b/config/default/views.view.events_list.yml index 2882958..08dfed9 100644 --- a/config/default/views.view.events_list.yml +++ b/config/default/views.view.events_list.yml @@ -368,9 +368,10 @@ display: path: events-list menu: type: normal - title: Events + title: About description: '' - weight: -49 + weight: -48 + enabled: false expanded: false menu_name: main parent: '' diff --git a/config/default/views.view.content_recent.yml b/config/default/views.view.snippets.yml similarity index 51% rename from config/default/views.view.content_recent.yml rename to config/default/views.view.snippets.yml index 2516be1..4a0e992 100644 --- a/config/default/views.view.content_recent.yml +++ b/config/default/views.view.snippets.yml @@ -1,17 +1,20 @@ -uuid: eb0a8385-f176-44cd-8b88-1fadace31a9e +uuid: d4da3085-bc05-415c-b78d-b57cc7b4498c langcode: en status: true dependencies: + config: + - node.type.snippet + - taxonomy.vocabulary.tags module: + - better_exposed_filters - node + - taxonomy - user -_core: - default_config_hash: YqZN5rc7XDQcFcInc8wkzuaHJmC5YvirhTmDcrarT6M -id: content_recent -label: 'Recent content' -module: node -description: 'Recent content.' -tag: default +id: snippets +label: Snippets +module: views +description: '' +tag: '' base_table: node_field_data base_field: nid display: @@ -21,7 +24,6 @@ display: display_plugin: default position: 0 display_options: - title: 'Recent content' fields: title: id: title @@ -56,63 +58,10 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true + click_sort_column: value type: string settings: link_to_entity: true - changed: - id: changed - table: node_field_data - field: changed - relationship: none - group_type: group - admin_label: '' - entity_type: node - entity_field: changed - plugin_id: field - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: timestamp_ago - settings: { } group_column: value group_columns: { } group_rows: true @@ -124,12 +73,26 @@ display: separator: ', ' field_api_classes: false pager: - type: some + type: mini options: offset: 0 + pagination_heading_level: h4 items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset exposed_form: - type: basic + type: bef options: submit_button: Apply reset_button: false @@ -138,6 +101,35 @@ display: expose_sort_order: true sort_asc_label: Asc sort_desc_label: Desc + text_input_required: 'Select any filter and click on Apply to see results' + text_input_required_format: basic_html + bef: + general: + autosubmit: true + autosubmit_exclude_textfield: false + autosubmit_textfield_delay: 500 + autosubmit_textfield_minimum_length: 3 + autosubmit_hide: true + input_required: false + allow_secondary: false + secondary_label: 'Advanced options' + secondary_open: false + reset_button_always_show: false + filter: + field_snippet_type_target_id: + plugin_id: bef + advanced: + sort_options: false + rewrite: + filter_rewrite_values: '' + filter_rewrite_values_key: false + collapsible: false + collapsible_disable_automatic_open: false + is_secondary: false + hide_label: true + select_all_none: false + select_all_none_nested: false + display_inline: true access: type: perm options: @@ -145,100 +137,67 @@ display: cache: type: tag options: { } - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - relationship: none - group_type: group - admin_label: '' - plugin_id: text_custom - empty: true - content: 'No content available.' - tokenize: false + empty: { } sorts: - changed: - id: changed + created: + id: created table: node_field_data - field: changed + field: created relationship: none group_type: group admin_label: '' entity_type: node - entity_field: changed + entity_field: created plugin_id: date order: DESC expose: label: '' - field_identifier: changed + field_identifier: '' exposed: false granularity: second arguments: { } filters: - status_extra: - id: status_extra + status: + id: status table: node_field_data - field: status_extra - relationship: none - group_type: group - admin_label: '' + field: status entity_type: node - plugin_id: node_status - operator: '=' - value: false + entity_field: status + plugin_id: boolean + value: '1' group: 1 - exposed: false expose: - operator_id: '' - label: '' - description: '' - use_operator: false operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - langcode: - id: langcode + type: + id: type table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' + field: type entity_type: node - entity_field: langcode - plugin_id: language - operator: in + entity_field: type + plugin_id: bundle value: - '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' + snippet: snippet + field_snippet_type_target_id: + id: field_snippet_type_target_id + table: node__field_snippet_type + field: field_snippet_type_target_id + relationship: none + group_type: group + admin_label: '' + plugin_id: taxonomy_index_tid + operator: or + value: { } group: 1 - exposed: false + exposed: true expose: - operator_id: '' - label: '' + operator_id: field_snippet_type_target_id_op + label: type description: '' use_operator: false - operator: '' + operator: field_snippet_type_target_id_op operator_limit_selection: false operator_list: { } - identifier: '' + identifier: type required: false remember: false multiple: false @@ -257,17 +216,26 @@ display: default_group: All default_group_multiple: { } group_items: { } + reduce_duplicates: false + vid: tags + type: select + hierarchy: false + limit: true + error_message: true style: - type: html_list + type: default options: grouping: { } row_class: '' default_row_class: true - type: ul - wrapper_class: item-list - class: '' + uses_fields: false row: type: fields + options: + default_field_elements: true + inline: { } + separator: '' + hide_empty: false query: type: views_query options: @@ -276,23 +244,8 @@ display: distinct: false replica: false query_tags: { } - relationships: - uid: - id: uid - table: node_field_data - field: uid - relationship: none - group_type: group - admin_label: author - entity_type: node - entity_field: uid - plugin_id: standard - required: true - use_more: false - use_more_always: false - use_more_text: More - link_display: '0' - link_url: '' + relationships: { } + use_ajax: true header: { } footer: { } display_extenders: { } @@ -301,23 +254,26 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' - - user + - url + - url.query_args - 'user.node_grants:view' - user.permissions tags: { } block_1: id: block_1 - display_title: Block + display_title: Snippets display_plugin: block position: 1 display_options: + display_description: '' display_extenders: { } cache_metadata: max-age: -1 contexts: - 'languages:language_content' - 'languages:language_interface' - - user + - url + - url.query_args - 'user.node_grants:view' - user.permissions tags: { } diff --git a/config/default/views.view.taxonomy_term.yml b/config/default/views.view.taxonomy_term.yml deleted file mode 100644 index 2b4d483..0000000 --- a/config/default/views.view.taxonomy_term.yml +++ /dev/null @@ -1,823 +0,0 @@ -uuid: a50507ca-b528-444f-ae19-86a5e10edbfd -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.storage.node.field_fighter_one - - field.storage.node.field_fighter_two - - field.storage.node.field_result - module: - - node - - taxonomy - - user -_core: - default_config_hash: z9csC6m3M65M2JczdNul_lMUrVg8ZO66pbSq8jPCBKs -id: taxonomy_term -label: 'Taxonomy term' -module: taxonomy -description: 'Content belonging to a certain taxonomy term.' -tag: default -base_table: node_field_data -base_field: nid -display: - default: - id: default - display_title: Default - display_plugin: default - position: 0 - display_options: - fields: { } - pager: - type: mini - options: - offset: 0 - pagination_heading_level: h4 - items_per_page: 10 - total_pages: 0 - id: 0 - tags: - next: ›› - previous: ‹‹ - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - empty: { } - sorts: - sticky: - id: sticky - table: taxonomy_index - field: sticky - relationship: none - group_type: group - admin_label: '' - plugin_id: standard - order: DESC - expose: - label: '' - field_identifier: sticky - exposed: false - created: - id: created - table: taxonomy_index - field: created - relationship: none - group_type: group - admin_label: '' - plugin_id: date - order: DESC - expose: - label: '' - field_identifier: created - exposed: false - granularity: second - arguments: - tid: - id: tid - table: taxonomy_index - field: tid - relationship: none - group_type: group - admin_label: '' - plugin_id: taxonomy_index_tid - default_action: 'not found' - exception: - value: '' - title_enable: false - title: All - title_enable: true - title: '{{ arguments.tid }}' - default_argument_type: fixed - default_argument_options: - argument: '' - summary_options: - base_path: '' - count: true - override: false - items_per_page: 25 - summary: - sort_order: asc - number_of_records: 0 - format: default_summary - specify_validation: true - validate: - type: 'entity:taxonomy_term' - fail: 'not found' - validate_options: - bundles: { } - access: true - operation: view - multiple: 0 - break_phrase: false - add_table: false - require_value: false - reduce_duplicates: false - filters: - langcode: - id: langcode - table: node_field_data - field: langcode - relationship: none - group_type: group - admin_label: '' - entity_type: node - entity_field: langcode - plugin_id: language - operator: in - value: - '***LANGUAGE_language_content***': '***LANGUAGE_language_content***' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - reduce: false - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - status: - id: status - table: taxonomy_index - field: status - relationship: none - group_type: group - admin_label: '' - plugin_id: boolean - operator: '=' - value: '1' - group: 1 - exposed: false - expose: - operator_id: '' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - style: - type: default - options: - grouping: { } - row_class: '' - default_row_class: true - uses_fields: false - row: - type: 'entity:node' - options: - view_mode: teaser - query: - type: views_query - options: - query_comment: '' - disable_sql_rewrite: false - distinct: false - replica: false - query_tags: { } - relationships: { } - link_display: page_1 - link_url: '' - header: - entity_taxonomy_term: - id: entity_taxonomy_term - table: views - field: entity_taxonomy_term - relationship: none - group_type: group - admin_label: '' - plugin_id: entity - empty: true - target: '{{ raw_arguments.tid }}' - view_mode: full - tokenize: true - bypass_access: false - footer: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_interface' - - url - - url.query_args - - 'user.node_grants:view' - - user.permissions - tags: { } - feed_1: - id: feed_1 - display_title: Feed - display_plugin: feed - position: 2 - display_options: - enabled: false - pager: - type: some - options: - offset: 0 - items_per_page: 10 - style: - type: rss - options: - grouping: { } - uses_fields: false - description: '' - row: - type: node_rss - options: - relationship: none - view_mode: default - query: - type: views_query - options: { } - display_extenders: { } - path: taxonomy/term/%/feed - displays: - page_1: page_1 - default: '0' - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_interface' - - url - - 'user.node_grants:view' - - user.permissions - tags: { } - page_1: - id: page_1 - display_title: Page - display_plugin: page - position: 1 - display_options: - fields: - view_node: - id: view_node - table: node - field: view_node - relationship: none - group_type: group - admin_label: '' - entity_type: node - plugin_id: entity_link - label: '' - exclude: false - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: false - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - text: 'view matchup' - output_url_as_text: false - absolute: false - nid: - id: nid - table: node_field_data - field: nid - relationship: none - group_type: group - admin_label: '' - entity_type: node - entity_field: nid - plugin_id: field - label: ID - exclude: true - alter: - alter_text: false - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: number_integer - settings: - thousand_separator: '' - prefix_suffix: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - title: - id: title - table: node_field_data - field: title - relationship: none - group_type: group - admin_label: '' - entity_type: node - entity_field: title - plugin_id: field - label: Title - exclude: true - alter: - alter_text: true - text: '{{ nid }} ' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: value - type: string - settings: - link_to_entity: true - group_column: value - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_fighter_one: - id: field_fighter_one - table: node__field_fighter_one - field: field_fighter_one - relationship: none - group_type: group - admin_label: '' - plugin_id: field - label: 'Fighter One' - exclude: false - alter: - alter_text: true - text: '
{{ field_fighter_one }}
' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_fighter_two: - id: field_fighter_two - table: node__field_fighter_two - field: field_fighter_two - relationship: none - group_type: group - admin_label: '' - plugin_id: field - label: 'Fighter Two' - exclude: false - alter: - alter_text: true - text: '
{{ field_fighter_two }}
' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - field_result: - id: field_result - table: node__field_result - field: field_result - relationship: none - group_type: group - admin_label: '' - plugin_id: field - label: Result - exclude: false - alter: - alter_text: false - text: '{{ field_result }}' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - click_sort_column: target_id - type: entity_reference_label - settings: - link: true - group_column: target_id - group_columns: { } - group_rows: true - delta_limit: 0 - delta_offset: 0 - delta_reversed: false - delta_first_last: false - multi_type: separator - separator: ', ' - field_api_classes: false - nothing: - id: nothing - table: views - field: nothing - relationship: none - group_type: group - admin_label: '' - plugin_id: custom - label: 'Prediction (Confidence)' - exclude: false - alter: - alter_text: true - text: '' - make_link: false - path: '' - absolute: false - external: false - replace_spaces: false - path_case: none - trim_whitespace: false - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: false - max_length: 0 - word_boundary: true - ellipsis: true - more_link: false - more_link_text: '' - more_link_path: '' - strip_tags: false - trim: false - preserve_tags: '' - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: false - pager: - type: none - options: - offset: 0 - sorts: - created: - id: created - table: taxonomy_index - field: created - relationship: none - group_type: group - admin_label: '' - plugin_id: date - order: DESC - expose: - label: '' - field_identifier: created - exposed: false - granularity: second - style: - type: table - options: - grouping: { } - row_class: fight - default_row_class: true - columns: - field_fighter_one: field_fighter_one - field_fighter_two: field_fighter_two - field_result: field_result - nothing: nothing - default: '-1' - info: - field_fighter_one: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - field_fighter_two: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - field_result: - sortable: false - default_sort_order: asc - align: '' - separator: '' - empty_column: false - responsive: '' - nothing: - align: '' - separator: '' - empty_column: false - responsive: '' - override: true - sticky: false - summary: '' - empty_table: false - caption: '' - description: '' - row: - type: 'entity:node' - options: - view_mode: teaser - query: - type: views_query - options: { } - defaults: - pager: false - style: false - row: false - fields: false - sorts: false - display_extenders: { } - path: taxonomy/term/% - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - url - - 'user.node_grants:view' - - user.permissions - tags: - - 'config:field.storage.node.field_fighter_one' - - 'config:field.storage.node.field_fighter_two' - - 'config:field.storage.node.field_result' diff --git a/config/default/views.view.who_s_new.yml b/config/default/views.view.who_s_new.yml deleted file mode 100644 index a8bf64e..0000000 --- a/config/default/views.view.who_s_new.yml +++ /dev/null @@ -1,197 +0,0 @@ -uuid: 8683f088-88dd-4945-8040-9768dc061ecf -langcode: en -status: true -dependencies: - module: - - user -_core: - default_config_hash: zji0_13MyVGK7Bn1lUMDeZyyOIZedWvqpYUeM_SioPI -id: who_s_new -label: "Who's new" -module: user -description: 'Shows a list of the newest user accounts on the site.' -tag: default -base_table: users_field_data -base_field: uid -display: - default: - id: default - display_title: Default - display_plugin: default - position: 0 - display_options: - title: "Who's new" - fields: - name: - id: name - table: users_field_data - field: name - relationship: none - group_type: group - admin_label: '' - entity_type: user - entity_field: name - plugin_id: field - label: '' - exclude: false - alter: - alter_text: false - make_link: false - absolute: false - word_boundary: false - ellipsis: false - strip_tags: false - trim: false - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: user_name - pager: - type: some - options: - offset: 0 - items_per_page: 5 - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - access: - type: perm - options: - perm: 'access content' - cache: - type: tag - options: { } - empty: { } - sorts: - created: - id: created - table: users_field_data - field: created - relationship: none - group_type: group - admin_label: '' - entity_type: user - entity_field: created - plugin_id: date - order: DESC - expose: - label: '' - field_identifier: created - exposed: false - granularity: second - arguments: { } - filters: - status: - id: status - table: users_field_data - field: status - entity_type: user - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '0' - operator_limit_selection: false - operator_list: { } - access: - id: access - table: users_field_data - field: access - relationship: none - group_type: group - admin_label: '' - entity_type: user - entity_field: access - plugin_id: date - operator: '>' - value: - min: '' - max: '' - value: '1970-01-01' - type: date - group: 1 - exposed: false - expose: - operator_id: '0' - label: '' - description: '' - use_operator: false - operator: '' - operator_limit_selection: false - operator_list: { } - identifier: '' - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - style: - type: html_list - row: - type: fields - query: - type: views_query - options: - query_comment: '' - disable_sql_rewrite: false - distinct: false - replica: false - query_tags: { } - relationships: { } - header: { } - footer: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - tags: { } - block_1: - id: block_1 - display_title: "Who's new" - display_plugin: block - position: 1 - display_options: - display_description: 'A list of new users' - display_extenders: { } - block_description: "Who's new" - block_category: User - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - tags: { } diff --git a/config/default/views.view.who_s_online.yml b/config/default/views.view.who_s_online.yml deleted file mode 100644 index e7a1eda..0000000 --- a/config/default/views.view.who_s_online.yml +++ /dev/null @@ -1,224 +0,0 @@ -uuid: d2a45161-7119-45ff-8584-b09932c94069 -langcode: en -status: true -dependencies: - module: - - user -_core: - default_config_hash: suDsVMgawXoQt4rfmdfpr05EVX3z3KyfDDTYgeSM898 -id: who_s_online -label: "Who's online block" -module: user -description: 'Shows the user names of the most recently active users, and the total number of active users.' -tag: default -base_table: users_field_data -base_field: uid -display: - default: - id: default - display_title: Default - display_plugin: default - position: 0 - display_options: - title: "Who's online" - fields: - name: - id: name - table: users_field_data - field: name - relationship: none - group_type: group - admin_label: '' - entity_type: user - entity_field: name - plugin_id: field - label: '' - exclude: false - alter: - alter_text: false - make_link: false - absolute: false - word_boundary: false - ellipsis: false - strip_tags: false - trim: false - html: false - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: true - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: true - empty: '' - hide_empty: false - empty_zero: false - hide_alter_empty: true - type: user_name - pager: - type: some - options: - offset: 0 - items_per_page: 10 - exposed_form: - type: basic - options: - submit_button: Apply - reset_button: false - reset_button_label: Reset - exposed_sorts_label: 'Sort by' - expose_sort_order: true - sort_asc_label: Asc - sort_desc_label: Desc - access: - type: perm - options: - perm: 'access user profiles' - cache: - type: tag - options: { } - empty: - area_text_custom: - id: area_text_custom - table: views - field: area_text_custom - relationship: none - group_type: group - admin_label: '' - plugin_id: text_custom - empty: true - content: 'There are currently 0 users online.' - tokenize: false - sorts: - access: - id: access - table: users_field_data - field: access - relationship: none - group_type: group - admin_label: '' - entity_type: user - entity_field: access - plugin_id: date - order: DESC - expose: - label: '' - field_identifier: access - exposed: false - granularity: second - arguments: { } - filters: - status: - id: status - table: users_field_data - field: status - entity_type: user - entity_field: status - plugin_id: boolean - value: '1' - group: 1 - expose: - operator: '0' - operator_limit_selection: false - operator_list: { } - access: - id: access - table: users_field_data - field: access - relationship: none - group_type: group - admin_label: '' - entity_type: user - entity_field: access - plugin_id: date - operator: '>=' - value: - min: '' - max: '' - value: '-15 minutes' - type: offset - group: 1 - exposed: false - expose: - operator_id: access_op - label: 'Last access' - description: 'A user is considered online for this long after they have last viewed a page.' - use_operator: false - operator: access_op - operator_limit_selection: false - operator_list: { } - identifier: access - required: false - remember: false - multiple: false - remember_roles: - authenticated: authenticated - is_grouped: false - group_info: - label: '' - description: '' - identifier: '' - optional: true - widget: select - multiple: false - remember: false - default_group: All - default_group_multiple: { } - group_items: { } - style: - type: html_list - options: - grouping: { } - row_class: '' - default_row_class: true - type: ul - wrapper_class: item-list - class: '' - row: - type: fields - query: - type: views_query - options: - query_comment: '' - disable_sql_rewrite: false - distinct: false - replica: false - query_tags: { } - relationships: { } - header: - result: - id: result - table: views - field: result - relationship: none - group_type: group - admin_label: '' - plugin_id: result - empty: false - content: 'There are currently @total users online.' - footer: { } - display_extenders: { } - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - tags: { } - who_s_online_block: - id: who_s_online_block - display_title: "Who's online" - display_plugin: block - position: 1 - display_options: - display_description: 'A list of users that are currently logged in.' - display_extenders: { } - block_description: "Who's online" - cache_metadata: - max-age: -1 - contexts: - - 'languages:language_content' - - 'languages:language_interface' - - user.permissions - tags: { } diff --git a/patches/core/exposed-filters.patch b/patches/core/exposed-filters.patch new file mode 100644 index 0000000..d1b10b2 --- /dev/null +++ b/patches/core/exposed-filters.patch @@ -0,0 +1,61 @@ +diff --git a/core/lib/Drupal/Core/Render/Element/Checkboxes.php b/core/lib/Drupal/Core/Render/Element/Checkboxes.php +index 234f25aa904..cdcffbddf2b 100644 +--- a/core/lib/Drupal/Core/Render/Element/Checkboxes.php ++++ b/core/lib/Drupal/Core/Render/Element/Checkboxes.php +@@ -60,7 +60,7 @@ public function getInfo() { + public static function processCheckboxes(&$element, FormStateInterface $form_state, &$complete_form) { + $value = is_array($element['#value']) ? $element['#value'] : []; + $element['#tree'] = TRUE; +- if (count($element['#options']) > 0) { ++ if (is_countable($element['#options']) && count($element['#options']) > 0) { + if (!isset($element['#default_value']) || $element['#default_value'] == 0) { + $element['#default_value'] = []; + } +diff --git a/core/lib/Drupal/Core/Render/Element/Radios.php b/core/lib/Drupal/Core/Render/Element/Radios.php +index 7dc1815b36e..0b36d27d7ba 100644 +--- a/core/lib/Drupal/Core/Render/Element/Radios.php ++++ b/core/lib/Drupal/Core/Render/Element/Radios.php +@@ -58,7 +58,7 @@ public function getInfo() { + * Expands a radios element into individual radio elements. + */ + public static function processRadios(&$element, FormStateInterface $form_state, &$complete_form) { +- if (count($element['#options']) > 0) { ++ if (is_countable($element['#options']) && count($element['#options']) > 0) { + $weight = 0; + foreach ($element['#options'] as $key => $choice) { + // Maintain order of options as defined in #options, in case the element +diff --git a/core/lib/Drupal/Core/Render/Element/Table.php b/core/lib/Drupal/Core/Render/Element/Table.php +index 85111505e9b..466d3f38a5f 100644 +--- a/core/lib/Drupal/Core/Render/Element/Table.php ++++ b/core/lib/Drupal/Core/Render/Element/Table.php +@@ -428,7 +428,7 @@ public static function preRenderTable($element) { + Element::setAttributes($element, ['id']); + + // Add sticky headers, if applicable. +- if (count($element['#header']) && $element['#sticky']) { ++ if (is_countable($element['#header']) && count($element['#header']) && $element['#sticky']) { + $element['#attached']['library'][] = 'core/drupal.tableheader'; + $element['#attributes']['class'][] = 'sticky-header'; + } +@@ -436,7 +436,7 @@ public static function preRenderTable($element) { + // hidden with the classes represented by the constants + // RESPONSIVE_PRIORITY_MEDIUM and RESPONSIVE_PRIORITY_LOW, add the + // tableresponsive behaviors. +- if (count($element['#header']) && $element['#responsive']) { ++ if (is_countable($element['#header']) && count($element['#header']) && $element['#responsive']) { + $element['#attached']['library'][] = 'core/drupal.tableresponsive'; + // Add 'responsive-enabled' class to the table to identify it for JS. + // This is needed to target tables constructed by this function. +diff --git a/core/lib/Drupal/Core/Render/Element/Tableselect.php b/core/lib/Drupal/Core/Render/Element/Tableselect.php +index cb38a0722d2..9ced098e05b 100644 +--- a/core/lib/Drupal/Core/Render/Element/Tableselect.php ++++ b/core/lib/Drupal/Core/Render/Element/Tableselect.php +@@ -231,7 +231,7 @@ public static function processTableselect(&$element, FormStateInterface $form_st + + $element['#tree'] = TRUE; + +- if (count($element['#options']) > 0) { ++ if (is_countable($element['#options']) && count($element['#options']) > 0) { + if (!isset($element['#default_value']) || $element['#default_value'] === 0) { + $element['#default_value'] = []; + } diff --git a/web/libraries/nouislider/LICENSE b/web/libraries/nouislider/LICENSE new file mode 100644 index 0000000..98f4ca2 --- /dev/null +++ b/web/libraries/nouislider/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Léon Gersen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +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. diff --git a/web/libraries/nouislider/README.md b/web/libraries/nouislider/README.md new file mode 100644 index 0000000..c75a6b1 --- /dev/null +++ b/web/libraries/nouislider/README.md @@ -0,0 +1,42 @@ +# noUiSlider + +noUiSlider is a lightweight JavaScript range slider. + +- **Accessible** with `aria` and keyboard support +- GPU animated: no reflows, so fast; even on older devices +- All modern browsers and IE > 9 are supported +- **No dependencies** +- Fully **responsive** +- **Multi-touch support** on Android, iOS and Windows devices +- Tons of [examples](https://refreshless.com/nouislider/examples) and answered [Stack Overflow questions](https://stackoverflow.com/questions/tagged/nouislider) + +License +------- +noUiSlider is licensed [MIT](https://choosealicense.com/licenses/mit/). + +It can be used **for free** and **without any attribution**, in any personal or commercial project. + +[Documentation](https://refreshless.com/nouislider/) +------- +An extensive documentation, including **examples**, **options** and **configuration details**, is available here: + +[noUiSlider documentation](https://refreshless.com/nouislider/). + +Contributing +------------ + +See [Contributing](CONTRIBUTING.md). + +Sponsorship +----------- + +noUiSlider is a stable project that still receives a lot of feature requests. A lot of these are interesting, but require a good amount of effort to implement, test and document. Sponsorship of this project will allow me to spend some more of my time on these feature requests. + +Please consider sponsoring the project by clicking the "❤ Sponsor" button above. Thanks! + +Tooling +------- + +Cross-browser testing kindly provided by BrowserStack. + +[![Tested with BrowserStack](documentation/assets/browserstack-logo-380x90.png)](http://browserstack.com/) diff --git a/web/libraries/nouislider/composer.json b/web/libraries/nouislider/composer.json new file mode 100644 index 0000000..a40f62f --- /dev/null +++ b/web/libraries/nouislider/composer.json @@ -0,0 +1,10 @@ +{ + "name": "drupal/nouislider_js", + "description": "Mirror of the noUiSlider javascript library tagged as a Drupal library.", + "type": "drupal-library", + "homepage": "https://github.com/leongersen/noUiSlider", + "license": "MIT License", + "extra": { + "installer-name": "nouislider" + } +} diff --git a/web/libraries/nouislider/nouislider.css b/web/libraries/nouislider/nouislider.css new file mode 100644 index 0000000..d452a4b --- /dev/null +++ b/web/libraries/nouislider/nouislider.css @@ -0,0 +1,304 @@ +/* Functional styling; + * These styles are required for noUiSlider to function. + * You don't need to change these rules to apply your design. + */ +.noUi-target, +.noUi-target * { + -webkit-touch-callout: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-user-select: none; + -ms-touch-action: none; + touch-action: none; + -ms-user-select: none; + -moz-user-select: none; + user-select: none; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.noUi-target { + position: relative; +} +.noUi-base, +.noUi-connects { + width: 100%; + height: 100%; + position: relative; + z-index: 1; +} +/* Wrapper for all connect elements. + */ +.noUi-connects { + overflow: hidden; + z-index: 0; +} +.noUi-connect, +.noUi-origin { + will-change: transform; + position: absolute; + z-index: 1; + top: 0; + right: 0; + height: 100%; + width: 100%; + -ms-transform-origin: 0 0; + -webkit-transform-origin: 0 0; + -webkit-transform-style: preserve-3d; + transform-origin: 0 0; + transform-style: flat; +} +/* Offset direction + */ +.noUi-txt-dir-rtl.noUi-horizontal .noUi-origin { + left: 0; + right: auto; +} +/* Give origins 0 height/width so they don't interfere with clicking the + * connect elements. + */ +.noUi-vertical .noUi-origin { + top: -100%; + width: 0; +} +.noUi-horizontal .noUi-origin { + height: 0; +} +.noUi-handle { + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + position: absolute; +} +.noUi-touch-area { + height: 100%; + width: 100%; +} +.noUi-state-tap .noUi-connect, +.noUi-state-tap .noUi-origin { + -webkit-transition: transform 0.3s; + transition: transform 0.3s; +} +.noUi-state-drag * { + cursor: inherit !important; +} +/* Slider size and handle placement; + */ +.noUi-horizontal { + height: 18px; +} +.noUi-horizontal .noUi-handle { + width: 34px; + height: 28px; + right: -17px; + top: -6px; +} +.noUi-vertical { + width: 18px; +} +.noUi-vertical .noUi-handle { + width: 28px; + height: 34px; + right: -6px; + bottom: -17px; +} +.noUi-txt-dir-rtl.noUi-horizontal .noUi-handle { + left: -17px; + right: auto; +} +/* Styling; + * Giving the connect element a border radius causes issues with using transform: scale + */ +.noUi-target { + background: #FAFAFA; + border-radius: 4px; + border: 1px solid #D3D3D3; + box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB; +} +.noUi-connects { + border-radius: 3px; +} +.noUi-connect { + background: #3FB8AF; +} +/* Handles and cursors; + */ +.noUi-draggable { + cursor: ew-resize; +} +.noUi-vertical .noUi-draggable { + cursor: ns-resize; +} +.noUi-handle { + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #FFF; + cursor: default; + box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #EBEBEB, 0 3px 6px -3px #BBB; +} +.noUi-active { + box-shadow: inset 0 0 1px #FFF, inset 0 1px 7px #DDD, 0 3px 6px -3px #BBB; +} +/* Handle stripes; + */ +.noUi-handle:before, +.noUi-handle:after { + content: ""; + display: block; + position: absolute; + height: 14px; + width: 1px; + background: #E8E7E6; + left: 14px; + top: 6px; +} +.noUi-handle:after { + left: 17px; +} +.noUi-vertical .noUi-handle:before, +.noUi-vertical .noUi-handle:after { + width: 14px; + height: 1px; + left: 6px; + top: 14px; +} +.noUi-vertical .noUi-handle:after { + top: 17px; +} +/* Disabled state; + */ +[disabled] .noUi-connect { + background: #B8B8B8; +} +[disabled].noUi-target, +[disabled].noUi-handle, +[disabled] .noUi-handle { + cursor: not-allowed; +} +/* Base; + * + */ +.noUi-pips, +.noUi-pips * { + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.noUi-pips { + position: absolute; + color: #999; +} +/* Values; + * + */ +.noUi-value { + position: absolute; + white-space: nowrap; + text-align: center; +} +.noUi-value-sub { + color: #ccc; + font-size: 10px; +} +/* Markings; + * + */ +.noUi-marker { + position: absolute; + background: #CCC; +} +.noUi-marker-sub { + background: #AAA; +} +.noUi-marker-large { + background: #AAA; +} +/* Horizontal layout; + * + */ +.noUi-pips-horizontal { + padding: 10px 0; + height: 80px; + top: 100%; + left: 0; + width: 100%; +} +.noUi-value-horizontal { + -webkit-transform: translate(-50%, 50%); + transform: translate(-50%, 50%); +} +.noUi-rtl .noUi-value-horizontal { + -webkit-transform: translate(50%, 50%); + transform: translate(50%, 50%); +} +.noUi-marker-horizontal.noUi-marker { + margin-left: -1px; + width: 2px; + height: 5px; +} +.noUi-marker-horizontal.noUi-marker-sub { + height: 10px; +} +.noUi-marker-horizontal.noUi-marker-large { + height: 15px; +} +/* Vertical layout; + * + */ +.noUi-pips-vertical { + padding: 0 10px; + height: 100%; + top: 0; + left: 100%; +} +.noUi-value-vertical { + -webkit-transform: translate(0, -50%); + transform: translate(0, -50%); + padding-left: 25px; +} +.noUi-rtl .noUi-value-vertical { + -webkit-transform: translate(0, 50%); + transform: translate(0, 50%); +} +.noUi-marker-vertical.noUi-marker { + width: 5px; + height: 2px; + margin-top: -1px; +} +.noUi-marker-vertical.noUi-marker-sub { + width: 10px; +} +.noUi-marker-vertical.noUi-marker-large { + width: 15px; +} +.noUi-tooltip { + display: block; + position: absolute; + border: 1px solid #D9D9D9; + border-radius: 3px; + background: #fff; + color: #000; + padding: 5px; + text-align: center; + white-space: nowrap; +} +.noUi-horizontal .noUi-tooltip { + -webkit-transform: translate(-50%, 0); + transform: translate(-50%, 0); + left: 50%; + bottom: 120%; +} +.noUi-vertical .noUi-tooltip { + -webkit-transform: translate(0, -50%); + transform: translate(0, -50%); + top: 50%; + right: 120%; +} +.noUi-horizontal .noUi-origin > .noUi-tooltip { + -webkit-transform: translate(50%, 0); + transform: translate(50%, 0); + left: auto; + bottom: 10px; +} +.noUi-vertical .noUi-origin > .noUi-tooltip { + -webkit-transform: translate(0, -18px); + transform: translate(0, -18px); + top: auto; + right: 28px; +} diff --git a/web/libraries/nouislider/nouislider.d.ts b/web/libraries/nouislider/nouislider.d.ts new file mode 100644 index 0000000..827908f --- /dev/null +++ b/web/libraries/nouislider/nouislider.d.ts @@ -0,0 +1,198 @@ +interface CssClasses { + target: string; + base: string; + origin: string; + handle: string; + handleLower: string; + handleUpper: string; + touchArea: string; + horizontal: string; + vertical: string; + background: string; + connect: string; + connects: string; + ltr: string; + rtl: string; + textDirectionLtr: string; + textDirectionRtl: string; + draggable: string; + drag: string; + tap: string; + active: string; + tooltip: string; + pips: string; + pipsHorizontal: string; + pipsVertical: string; + marker: string; + markerHorizontal: string; + markerVertical: string; + markerNormal: string; + markerLarge: string; + markerSub: string; + value: string; + valueHorizontal: string; + valueVertical: string; + valueNormal: string; + valueLarge: string; + valueSub: string; +} +export interface PartialFormatter { + to: (value: number) => string | number; + from?: (value: string) => number | false; +} +export interface Formatter extends PartialFormatter { + from: (value: string) => number | false; +} +export declare enum PipsMode { + Range = "range", + Steps = "steps", + Positions = "positions", + Count = "count", + Values = "values" +} +export declare enum PipsType { + None = -1, + NoValue = 0, + LargeValue = 1, + SmallValue = 2 +} +declare type WrappedSubRange = [number] | [number, number]; +declare type SubRange = number | WrappedSubRange; +interface Range { + min: SubRange; + max: SubRange; + [key: `${number}%`]: SubRange; +} +interface BasePips { + mode: PipsMode; + density?: number; + filter?: PipsFilter; + format?: PartialFormatter; +} +interface PositionsPips extends BasePips { + mode: PipsMode.Positions; + values: number[]; + stepped?: boolean; +} +interface ValuesPips extends BasePips { + mode: PipsMode.Values; + values: number[]; + stepped?: boolean; +} +interface CountPips extends BasePips { + mode: PipsMode.Count; + values: number; + stepped?: boolean; +} +interface StepsPips extends BasePips { + mode: PipsMode.Steps; +} +interface RangePips extends BasePips { + mode: PipsMode.Range; +} +declare type Pips = PositionsPips | ValuesPips | CountPips | StepsPips | RangePips; +declare type ValueArgument = number | string | null; +declare type StartValues = ValueArgument | ValueArgument[]; +declare type HandleAttributes = { + [key: string]: string; +}; +interface UpdatableOptions { + range?: Range; + start?: StartValues; + margin?: number; + limit?: number; + padding?: number | number[]; + snap?: boolean; + step?: number; + pips?: Pips; + format?: Formatter; + tooltips?: boolean | PartialFormatter | (boolean | PartialFormatter)[]; + animate?: boolean; + connect?: "lower" | "upper" | boolean | boolean[]; +} +export interface Options extends UpdatableOptions { + range: Range; + orientation?: "vertical" | "horizontal"; + direction?: "ltr" | "rtl"; + behaviour?: string; + keyboardSupport?: boolean; + keyboardPageMultiplier?: number; + keyboardMultiplier?: number; + keyboardDefaultStep?: number; + documentElement?: HTMLElement; + cssPrefix?: string; + cssClasses?: CssClasses; + ariaFormat?: PartialFormatter; + animationDuration?: number; + handleAttributes?: HandleAttributes[]; +} +export interface API { + destroy: () => void; + steps: () => NextStepsForHandle[]; + on: (eventName: string, callback: EventCallback) => void; + off: (eventName: string) => void; + get: (unencoded?: boolean) => GetResult; + set: (input: ValueArgument | ValueArgument[], fireSetEvent?: boolean, exactInput?: boolean) => void; + setHandle: (handleNumber: number, value: ValueArgument, fireSetEvent?: boolean, exactInput?: boolean) => void; + reset: (fireSetEvent?: boolean) => void; + disable: (handleNumber?: number) => void; + enable: (handleNumber?: number) => void; + options: Options; + updateOptions: (optionsToUpdate: UpdatableOptions, fireSetEvent: boolean) => void; + target: HTMLElement; + removePips: () => void; + removeTooltips: () => void; + getPositions: () => number[]; + getTooltips: () => (HTMLElement | false)[] | null; + getOrigins: () => HTMLElement[]; + pips: (grid: Pips) => HTMLElement; +} +interface TargetElement extends HTMLElement { + noUiSlider?: API; +} +interface NearByStep { + startValue: number; + step: number | false; + highestStep: number; +} +interface NearBySteps { + stepBefore: NearByStep; + thisStep: NearByStep; + stepAfter: NearByStep; +} +declare type GetResult = number | string | (string | number)[]; +declare type NextStepsForHandle = [number | false | null, number | false | null]; +declare type PipsFilter = (value: number, type: PipsType) => PipsType; +declare type EventCallback = (this: API, values: (number | string)[], handleNumber: number, unencoded: number[], tap: boolean, locations: number[], slider: API) => void; +declare class Spectrum { + xPct: number[]; + xVal: number[]; + xSteps: (number | false)[]; + xNumSteps: (number | false)[]; + protected xHighestCompleteStep: number[]; + protected snap: boolean; + constructor(entry: Range, snap: boolean, singleStep: number); + getDistance(value: number): number[]; + getAbsoluteDistance(value: number, distances: number[] | null, direction: boolean): number; + toStepping(value: number): number; + fromStepping(value: number): number; + getStep(value: number): number; + getDefaultStep(value: number, isDown: boolean, size: number): number; + getNearbySteps(value: number): NearBySteps; + countStepDecimals(): number; + hasNoSize(): boolean; + convert(value: number): number; + private handleEntryPoint; + private handleStepPoint; +} +declare const cssClasses: CssClasses; +declare function initialize(target: TargetElement, originalOptions: Options): API; +export { TargetElement as target }; +export { initialize as create }; +export { cssClasses }; +declare const _default: { + __spectrum: typeof Spectrum; + cssClasses: CssClasses; + create: typeof initialize; +}; +export default _default; diff --git a/web/libraries/nouislider/nouislider.js b/web/libraries/nouislider/nouislider.js new file mode 100644 index 0000000..2d3e054 --- /dev/null +++ b/web/libraries/nouislider/nouislider.js @@ -0,0 +1,2341 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.noUiSlider = {})); +})(this, (function (exports) { 'use strict'; + + exports.PipsMode = void 0; + (function (PipsMode) { + PipsMode["Range"] = "range"; + PipsMode["Steps"] = "steps"; + PipsMode["Positions"] = "positions"; + PipsMode["Count"] = "count"; + PipsMode["Values"] = "values"; + })(exports.PipsMode || (exports.PipsMode = {})); + exports.PipsType = void 0; + (function (PipsType) { + PipsType[PipsType["None"] = -1] = "None"; + PipsType[PipsType["NoValue"] = 0] = "NoValue"; + PipsType[PipsType["LargeValue"] = 1] = "LargeValue"; + PipsType[PipsType["SmallValue"] = 2] = "SmallValue"; + })(exports.PipsType || (exports.PipsType = {})); + //region Helper Methods + function isValidFormatter(entry) { + return isValidPartialFormatter(entry) && typeof entry.from === "function"; + } + function isValidPartialFormatter(entry) { + // partial formatters only need a to function and not a from function + return typeof entry === "object" && typeof entry.to === "function"; + } + function removeElement(el) { + el.parentElement.removeChild(el); + } + function isSet(value) { + return value !== null && value !== undefined; + } + // Bindable version + function preventDefault(e) { + e.preventDefault(); + } + // Removes duplicates from an array. + function unique(array) { + return array.filter(function (a) { + return !this[a] ? (this[a] = true) : false; + }, {}); + } + // Round a value to the closest 'to'. + function closest(value, to) { + return Math.round(value / to) * to; + } + // Current position of an element relative to the document. + function offset(elem, orientation) { + var rect = elem.getBoundingClientRect(); + var doc = elem.ownerDocument; + var docElem = doc.documentElement; + var pageOffset = getPageOffset(doc); + // getBoundingClientRect contains left scroll in Chrome on Android. + // I haven't found a feature detection that proves this. Worst case + // scenario on mis-match: the 'tap' feature on horizontal sliders breaks. + if (/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)) { + pageOffset.x = 0; + } + return orientation ? rect.top + pageOffset.y - docElem.clientTop : rect.left + pageOffset.x - docElem.clientLeft; + } + // Checks whether a value is numerical. + function isNumeric(a) { + return typeof a === "number" && !isNaN(a) && isFinite(a); + } + // Sets a class and removes it after [duration] ms. + function addClassFor(element, className, duration) { + if (duration > 0) { + addClass(element, className); + setTimeout(function () { + removeClass(element, className); + }, duration); + } + } + // Limits a value to 0 - 100 + function limit(a) { + return Math.max(Math.min(a, 100), 0); + } + // Wraps a variable as an array, if it isn't one yet. + // Note that an input array is returned by reference! + function asArray(a) { + return Array.isArray(a) ? a : [a]; + } + // Counts decimals + function countDecimals(numStr) { + numStr = String(numStr); + var pieces = numStr.split("."); + return pieces.length > 1 ? pieces[1].length : 0; + } + // http://youmightnotneedjquery.com/#add_class + function addClass(el, className) { + if (el.classList && !/\s/.test(className)) { + el.classList.add(className); + } + else { + el.className += " " + className; + } + } + // http://youmightnotneedjquery.com/#remove_class + function removeClass(el, className) { + if (el.classList && !/\s/.test(className)) { + el.classList.remove(className); + } + else { + el.className = el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " "); + } + } + // https://plainjs.com/javascript/attributes/adding-removing-and-testing-for-classes-9/ + function hasClass(el, className) { + return el.classList ? el.classList.contains(className) : new RegExp("\\b" + className + "\\b").test(el.className); + } + // https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY#Notes + function getPageOffset(doc) { + var supportPageOffset = window.pageXOffset !== undefined; + var isCSS1Compat = (doc.compatMode || "") === "CSS1Compat"; + var x = supportPageOffset + ? window.pageXOffset + : isCSS1Compat + ? doc.documentElement.scrollLeft + : doc.body.scrollLeft; + var y = supportPageOffset + ? window.pageYOffset + : isCSS1Compat + ? doc.documentElement.scrollTop + : doc.body.scrollTop; + return { + x: x, + y: y, + }; + } + // we provide a function to compute constants instead + // of accessing window.* as soon as the module needs it + // so that we do not compute anything if not needed + function getActions() { + // Determine the events to bind. IE11 implements pointerEvents without + // a prefix, which breaks compatibility with the IE10 implementation. + return window.navigator.pointerEnabled + ? { + start: "pointerdown", + move: "pointermove", + end: "pointerup", + } + : window.navigator.msPointerEnabled + ? { + start: "MSPointerDown", + move: "MSPointerMove", + end: "MSPointerUp", + } + : { + start: "mousedown touchstart", + move: "mousemove touchmove", + end: "mouseup touchend", + }; + } + // https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md + // Issue #785 + function getSupportsPassive() { + var supportsPassive = false; + /* eslint-disable */ + try { + var opts = Object.defineProperty({}, "passive", { + get: function () { + supportsPassive = true; + }, + }); + // @ts-ignore + window.addEventListener("test", null, opts); + } + catch (e) { } + /* eslint-enable */ + return supportsPassive; + } + function getSupportsTouchActionNone() { + return window.CSS && CSS.supports && CSS.supports("touch-action", "none"); + } + //endregion + //region Range Calculation + // Determine the size of a sub-range in relation to a full range. + function subRangeRatio(pa, pb) { + return 100 / (pb - pa); + } + // (percentage) How many percent is this value of this range? + function fromPercentage(range, value, startRange) { + return (value * 100) / (range[startRange + 1] - range[startRange]); + } + // (percentage) Where is this value on this range? + function toPercentage(range, value) { + return fromPercentage(range, range[0] < 0 ? value + Math.abs(range[0]) : value - range[0], 0); + } + // (value) How much is this percentage on this range? + function isPercentage(range, value) { + return (value * (range[1] - range[0])) / 100 + range[0]; + } + function getJ(value, arr) { + var j = 1; + while (value >= arr[j]) { + j += 1; + } + return j; + } + // (percentage) Input a value, find where, on a scale of 0-100, it applies. + function toStepping(xVal, xPct, value) { + if (value >= xVal.slice(-1)[0]) { + return 100; + } + var j = getJ(value, xVal); + var va = xVal[j - 1]; + var vb = xVal[j]; + var pa = xPct[j - 1]; + var pb = xPct[j]; + return pa + toPercentage([va, vb], value) / subRangeRatio(pa, pb); + } + // (value) Input a percentage, find where it is on the specified range. + function fromStepping(xVal, xPct, value) { + // There is no range group that fits 100 + if (value >= 100) { + return xVal.slice(-1)[0]; + } + var j = getJ(value, xPct); + var va = xVal[j - 1]; + var vb = xVal[j]; + var pa = xPct[j - 1]; + var pb = xPct[j]; + return isPercentage([va, vb], (value - pa) * subRangeRatio(pa, pb)); + } + // (percentage) Get the step that applies at a certain value. + function getStep(xPct, xSteps, snap, value) { + if (value === 100) { + return value; + } + var j = getJ(value, xPct); + var a = xPct[j - 1]; + var b = xPct[j]; + // If 'snap' is set, steps are used as fixed points on the slider. + if (snap) { + // Find the closest position, a or b. + if (value - a > (b - a) / 2) { + return b; + } + return a; + } + if (!xSteps[j - 1]) { + return value; + } + return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]); + } + //endregion + //region Spectrum + var Spectrum = /** @class */ (function () { + function Spectrum(entry, snap, singleStep) { + this.xPct = []; + this.xVal = []; + this.xSteps = []; + this.xNumSteps = []; + this.xHighestCompleteStep = []; + this.xSteps = [singleStep || false]; + this.xNumSteps = [false]; + this.snap = snap; + var index; + var ordered = []; + // Map the object keys to an array. + Object.keys(entry).forEach(function (index) { + ordered.push([asArray(entry[index]), index]); + }); + // Sort all entries by value (numeric sort). + ordered.sort(function (a, b) { + return a[0][0] - b[0][0]; + }); + // Convert all entries to subranges. + for (index = 0; index < ordered.length; index++) { + this.handleEntryPoint(ordered[index][1], ordered[index][0]); + } + // Store the actual step values. + // xSteps is sorted in the same order as xPct and xVal. + this.xNumSteps = this.xSteps.slice(0); + // Convert all numeric steps to the percentage of the subrange they represent. + for (index = 0; index < this.xNumSteps.length; index++) { + this.handleStepPoint(index, this.xNumSteps[index]); + } + } + Spectrum.prototype.getDistance = function (value) { + var distances = []; + for (var index = 0; index < this.xNumSteps.length - 1; index++) { + distances[index] = fromPercentage(this.xVal, value, index); + } + return distances; + }; + // Calculate the percentual distance over the whole scale of ranges. + // direction: 0 = backwards / 1 = forwards + Spectrum.prototype.getAbsoluteDistance = function (value, distances, direction) { + var xPct_index = 0; + // Calculate range where to start calculation + if (value < this.xPct[this.xPct.length - 1]) { + while (value > this.xPct[xPct_index + 1]) { + xPct_index++; + } + } + else if (value === this.xPct[this.xPct.length - 1]) { + xPct_index = this.xPct.length - 2; + } + // If looking backwards and the value is exactly at a range separator then look one range further + if (!direction && value === this.xPct[xPct_index + 1]) { + xPct_index++; + } + if (distances === null) { + distances = []; + } + var start_factor; + var rest_factor = 1; + var rest_rel_distance = distances[xPct_index]; + var range_pct = 0; + var rel_range_distance = 0; + var abs_distance_counter = 0; + var range_counter = 0; + // Calculate what part of the start range the value is + if (direction) { + start_factor = (value - this.xPct[xPct_index]) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]); + } + else { + start_factor = (this.xPct[xPct_index + 1] - value) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]); + } + // Do until the complete distance across ranges is calculated + while (rest_rel_distance > 0) { + // Calculate the percentage of total range + range_pct = this.xPct[xPct_index + 1 + range_counter] - this.xPct[xPct_index + range_counter]; + // Detect if the margin, padding or limit is larger then the current range and calculate + if (distances[xPct_index + range_counter] * rest_factor + 100 - start_factor * 100 > 100) { + // If larger then take the percentual distance of the whole range + rel_range_distance = range_pct * start_factor; + // Rest factor of relative percentual distance still to be calculated + rest_factor = (rest_rel_distance - 100 * start_factor) / distances[xPct_index + range_counter]; + // Set start factor to 1 as for next range it does not apply. + start_factor = 1; + } + else { + // If smaller or equal then take the percentual distance of the calculate percentual part of that range + rel_range_distance = ((distances[xPct_index + range_counter] * range_pct) / 100) * rest_factor; + // No rest left as the rest fits in current range + rest_factor = 0; + } + if (direction) { + abs_distance_counter = abs_distance_counter - rel_range_distance; + // Limit range to first range when distance becomes outside of minimum range + if (this.xPct.length + range_counter >= 1) { + range_counter--; + } + } + else { + abs_distance_counter = abs_distance_counter + rel_range_distance; + // Limit range to last range when distance becomes outside of maximum range + if (this.xPct.length - range_counter >= 1) { + range_counter++; + } + } + // Rest of relative percentual distance still to be calculated + rest_rel_distance = distances[xPct_index + range_counter] * rest_factor; + } + return value + abs_distance_counter; + }; + Spectrum.prototype.toStepping = function (value) { + value = toStepping(this.xVal, this.xPct, value); + return value; + }; + Spectrum.prototype.fromStepping = function (value) { + return fromStepping(this.xVal, this.xPct, value); + }; + Spectrum.prototype.getStep = function (value) { + value = getStep(this.xPct, this.xSteps, this.snap, value); + return value; + }; + Spectrum.prototype.getDefaultStep = function (value, isDown, size) { + var j = getJ(value, this.xPct); + // When at the top or stepping down, look at the previous sub-range + if (value === 100 || (isDown && value === this.xPct[j - 1])) { + j = Math.max(j - 1, 1); + } + return (this.xVal[j] - this.xVal[j - 1]) / size; + }; + Spectrum.prototype.getNearbySteps = function (value) { + var j = getJ(value, this.xPct); + return { + stepBefore: { + startValue: this.xVal[j - 2], + step: this.xNumSteps[j - 2], + highestStep: this.xHighestCompleteStep[j - 2], + }, + thisStep: { + startValue: this.xVal[j - 1], + step: this.xNumSteps[j - 1], + highestStep: this.xHighestCompleteStep[j - 1], + }, + stepAfter: { + startValue: this.xVal[j], + step: this.xNumSteps[j], + highestStep: this.xHighestCompleteStep[j], + }, + }; + }; + Spectrum.prototype.countStepDecimals = function () { + var stepDecimals = this.xNumSteps.map(countDecimals); + return Math.max.apply(null, stepDecimals); + }; + Spectrum.prototype.hasNoSize = function () { + return this.xVal[0] === this.xVal[this.xVal.length - 1]; + }; + // Outside testing + Spectrum.prototype.convert = function (value) { + return this.getStep(this.toStepping(value)); + }; + Spectrum.prototype.handleEntryPoint = function (index, value) { + var percentage; + // Covert min/max syntax to 0 and 100. + if (index === "min") { + percentage = 0; + } + else if (index === "max") { + percentage = 100; + } + else { + percentage = parseFloat(index); + } + // Check for correct input. + if (!isNumeric(percentage) || !isNumeric(value[0])) { + throw new Error("noUiSlider: 'range' value isn't numeric."); + } + // Store values. + this.xPct.push(percentage); + this.xVal.push(value[0]); + var value1 = Number(value[1]); + // NaN will evaluate to false too, but to keep + // logging clear, set step explicitly. Make sure + // not to override the 'step' setting with false. + if (!percentage) { + if (!isNaN(value1)) { + this.xSteps[0] = value1; + } + } + else { + this.xSteps.push(isNaN(value1) ? false : value1); + } + this.xHighestCompleteStep.push(0); + }; + Spectrum.prototype.handleStepPoint = function (i, n) { + // Ignore 'false' stepping. + if (!n) { + return; + } + // Step over zero-length ranges (#948); + if (this.xVal[i] === this.xVal[i + 1]) { + this.xSteps[i] = this.xHighestCompleteStep[i] = this.xVal[i]; + return; + } + // Factor to range ratio + this.xSteps[i] = + fromPercentage([this.xVal[i], this.xVal[i + 1]], n, 0) / subRangeRatio(this.xPct[i], this.xPct[i + 1]); + var totalSteps = (this.xVal[i + 1] - this.xVal[i]) / this.xNumSteps[i]; + var highestStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1); + var step = this.xVal[i] + this.xNumSteps[i] * highestStep; + this.xHighestCompleteStep[i] = step; + }; + return Spectrum; + }()); + //endregion + //region Options + /* Every input option is tested and parsed. This will prevent + endless validation in internal methods. These tests are + structured with an item for every option available. An + option can be marked as required by setting the 'r' flag. + The testing function is provided with three arguments: + - The provided value for the option; + - A reference to the options object; + - The name for the option; + + The testing function returns false when an error is detected, + or true when everything is OK. It can also modify the option + object, to make sure all values can be correctly looped elsewhere. */ + //region Defaults + var defaultFormatter = { + to: function (value) { + return value === undefined ? "" : value.toFixed(2); + }, + from: Number, + }; + var cssClasses = { + target: "target", + base: "base", + origin: "origin", + handle: "handle", + handleLower: "handle-lower", + handleUpper: "handle-upper", + touchArea: "touch-area", + horizontal: "horizontal", + vertical: "vertical", + background: "background", + connect: "connect", + connects: "connects", + ltr: "ltr", + rtl: "rtl", + textDirectionLtr: "txt-dir-ltr", + textDirectionRtl: "txt-dir-rtl", + draggable: "draggable", + drag: "state-drag", + tap: "state-tap", + active: "active", + tooltip: "tooltip", + pips: "pips", + pipsHorizontal: "pips-horizontal", + pipsVertical: "pips-vertical", + marker: "marker", + markerHorizontal: "marker-horizontal", + markerVertical: "marker-vertical", + markerNormal: "marker-normal", + markerLarge: "marker-large", + markerSub: "marker-sub", + value: "value", + valueHorizontal: "value-horizontal", + valueVertical: "value-vertical", + valueNormal: "value-normal", + valueLarge: "value-large", + valueSub: "value-sub", + }; + // Namespaces of internal event listeners + var INTERNAL_EVENT_NS = { + tooltips: ".__tooltips", + aria: ".__aria", + }; + //endregion + function testStep(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'step' is not numeric."); + } + // The step option can still be used to set stepping + // for linear sliders. Overwritten if set in 'range'. + parsed.singleStep = entry; + } + function testKeyboardPageMultiplier(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric."); + } + parsed.keyboardPageMultiplier = entry; + } + function testKeyboardMultiplier(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric."); + } + parsed.keyboardMultiplier = entry; + } + function testKeyboardDefaultStep(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric."); + } + parsed.keyboardDefaultStep = entry; + } + function testRange(parsed, entry) { + // Filter incorrect input. + if (typeof entry !== "object" || Array.isArray(entry)) { + throw new Error("noUiSlider: 'range' is not an object."); + } + // Catch missing start or end. + if (entry.min === undefined || entry.max === undefined) { + throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'."); + } + parsed.spectrum = new Spectrum(entry, parsed.snap || false, parsed.singleStep); + } + function testStart(parsed, entry) { + entry = asArray(entry); + // Validate input. Values aren't tested, as the public .val method + // will always provide a valid location. + if (!Array.isArray(entry) || !entry.length) { + throw new Error("noUiSlider: 'start' option is incorrect."); + } + // Store the number of handles. + parsed.handles = entry.length; + // When the slider is initialized, the .val method will + // be called with the start options. + parsed.start = entry; + } + function testSnap(parsed, entry) { + if (typeof entry !== "boolean") { + throw new Error("noUiSlider: 'snap' option must be a boolean."); + } + // Enforce 100% stepping within subranges. + parsed.snap = entry; + } + function testAnimate(parsed, entry) { + if (typeof entry !== "boolean") { + throw new Error("noUiSlider: 'animate' option must be a boolean."); + } + // Enforce 100% stepping within subranges. + parsed.animate = entry; + } + function testAnimationDuration(parsed, entry) { + if (typeof entry !== "number") { + throw new Error("noUiSlider: 'animationDuration' option must be a number."); + } + parsed.animationDuration = entry; + } + function testConnect(parsed, entry) { + var connect = [false]; + var i; + // Map legacy options + if (entry === "lower") { + entry = [true, false]; + } + else if (entry === "upper") { + entry = [false, true]; + } + // Handle boolean options + if (entry === true || entry === false) { + for (i = 1; i < parsed.handles; i++) { + connect.push(entry); + } + connect.push(false); + } + // Reject invalid input + else if (!Array.isArray(entry) || !entry.length || entry.length !== parsed.handles + 1) { + throw new Error("noUiSlider: 'connect' option doesn't match handle count."); + } + else { + connect = entry; + } + parsed.connect = connect; + } + function testOrientation(parsed, entry) { + // Set orientation to an a numerical value for easy + // array selection. + switch (entry) { + case "horizontal": + parsed.ort = 0; + break; + case "vertical": + parsed.ort = 1; + break; + default: + throw new Error("noUiSlider: 'orientation' option is invalid."); + } + } + function testMargin(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'margin' option must be numeric."); + } + // Issue #582 + if (entry === 0) { + return; + } + parsed.margin = parsed.spectrum.getDistance(entry); + } + function testLimit(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'limit' option must be numeric."); + } + parsed.limit = parsed.spectrum.getDistance(entry); + if (!parsed.limit || parsed.handles < 2) { + throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles."); + } + } + function testPadding(parsed, entry) { + var index; + if (!isNumeric(entry) && !Array.isArray(entry)) { + throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers."); + } + if (Array.isArray(entry) && !(entry.length === 2 || isNumeric(entry[0]) || isNumeric(entry[1]))) { + throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers."); + } + if (entry === 0) { + return; + } + if (!Array.isArray(entry)) { + entry = [entry, entry]; + } + // 'getDistance' returns false for invalid values. + parsed.padding = [parsed.spectrum.getDistance(entry[0]), parsed.spectrum.getDistance(entry[1])]; + for (index = 0; index < parsed.spectrum.xNumSteps.length - 1; index++) { + // last "range" can't contain step size as it is purely an endpoint. + if (parsed.padding[0][index] < 0 || parsed.padding[1][index] < 0) { + throw new Error("noUiSlider: 'padding' option must be a positive number(s)."); + } + } + var totalPadding = entry[0] + entry[1]; + var firstValue = parsed.spectrum.xVal[0]; + var lastValue = parsed.spectrum.xVal[parsed.spectrum.xVal.length - 1]; + if (totalPadding / (lastValue - firstValue) > 1) { + throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range."); + } + } + function testDirection(parsed, entry) { + // Set direction as a numerical value for easy parsing. + // Invert connection for RTL sliders, so that the proper + // handles get the connect/background classes. + switch (entry) { + case "ltr": + parsed.dir = 0; + break; + case "rtl": + parsed.dir = 1; + break; + default: + throw new Error("noUiSlider: 'direction' option was not recognized."); + } + } + function testBehaviour(parsed, entry) { + // Make sure the input is a string. + if (typeof entry !== "string") { + throw new Error("noUiSlider: 'behaviour' must be a string containing options."); + } + // Check if the string contains any keywords. + // None are required. + var tap = entry.indexOf("tap") >= 0; + var drag = entry.indexOf("drag") >= 0; + var fixed = entry.indexOf("fixed") >= 0; + var snap = entry.indexOf("snap") >= 0; + var hover = entry.indexOf("hover") >= 0; + var unconstrained = entry.indexOf("unconstrained") >= 0; + var invertConnects = entry.indexOf("invert-connects") >= 0; + var dragAll = entry.indexOf("drag-all") >= 0; + var smoothSteps = entry.indexOf("smooth-steps") >= 0; + if (fixed) { + if (parsed.handles !== 2) { + throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles"); + } + // Use margin to enforce fixed state + testMargin(parsed, parsed.start[1] - parsed.start[0]); + } + if (invertConnects && parsed.handles !== 2) { + throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles"); + } + if (unconstrained && (parsed.margin || parsed.limit)) { + throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit"); + } + parsed.events = { + tap: tap || snap, + drag: drag, + dragAll: dragAll, + smoothSteps: smoothSteps, + fixed: fixed, + snap: snap, + hover: hover, + unconstrained: unconstrained, + invertConnects: invertConnects, + }; + } + function testTooltips(parsed, entry) { + if (entry === false) { + return; + } + if (entry === true || isValidPartialFormatter(entry)) { + parsed.tooltips = []; + for (var i = 0; i < parsed.handles; i++) { + parsed.tooltips.push(entry); + } + } + else { + entry = asArray(entry); + if (entry.length !== parsed.handles) { + throw new Error("noUiSlider: must pass a formatter for all handles."); + } + entry.forEach(function (formatter) { + if (typeof formatter !== "boolean" && !isValidPartialFormatter(formatter)) { + throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'."); + } + }); + parsed.tooltips = entry; + } + } + function testHandleAttributes(parsed, entry) { + if (entry.length !== parsed.handles) { + throw new Error("noUiSlider: must pass a attributes for all handles."); + } + parsed.handleAttributes = entry; + } + function testAriaFormat(parsed, entry) { + if (!isValidPartialFormatter(entry)) { + throw new Error("noUiSlider: 'ariaFormat' requires 'to' method."); + } + parsed.ariaFormat = entry; + } + function testFormat(parsed, entry) { + if (!isValidFormatter(entry)) { + throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods."); + } + parsed.format = entry; + } + function testKeyboardSupport(parsed, entry) { + if (typeof entry !== "boolean") { + throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean."); + } + parsed.keyboardSupport = entry; + } + function testDocumentElement(parsed, entry) { + // This is an advanced option. Passed values are used without validation. + parsed.documentElement = entry; + } + function testCssPrefix(parsed, entry) { + if (typeof entry !== "string" && entry !== false) { + throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`."); + } + parsed.cssPrefix = entry; + } + function testCssClasses(parsed, entry) { + if (typeof entry !== "object") { + throw new Error("noUiSlider: 'cssClasses' must be an object."); + } + if (typeof parsed.cssPrefix === "string") { + parsed.cssClasses = {}; + Object.keys(entry).forEach(function (key) { + parsed.cssClasses[key] = parsed.cssPrefix + entry[key]; + }); + } + else { + parsed.cssClasses = entry; + } + } + // Test all developer settings and parse to assumption-safe values. + function testOptions(options) { + // To prove a fix for #537, freeze options here. + // If the object is modified, an error will be thrown. + // Object.freeze(options); + var parsed = { + margin: null, + limit: null, + padding: null, + animate: true, + animationDuration: 300, + ariaFormat: defaultFormatter, + format: defaultFormatter, + }; + // Tests are executed in the order they are presented here. + var tests = { + step: { r: false, t: testStep }, + keyboardPageMultiplier: { r: false, t: testKeyboardPageMultiplier }, + keyboardMultiplier: { r: false, t: testKeyboardMultiplier }, + keyboardDefaultStep: { r: false, t: testKeyboardDefaultStep }, + start: { r: true, t: testStart }, + connect: { r: true, t: testConnect }, + direction: { r: true, t: testDirection }, + snap: { r: false, t: testSnap }, + animate: { r: false, t: testAnimate }, + animationDuration: { r: false, t: testAnimationDuration }, + range: { r: true, t: testRange }, + orientation: { r: false, t: testOrientation }, + margin: { r: false, t: testMargin }, + limit: { r: false, t: testLimit }, + padding: { r: false, t: testPadding }, + behaviour: { r: true, t: testBehaviour }, + ariaFormat: { r: false, t: testAriaFormat }, + format: { r: false, t: testFormat }, + tooltips: { r: false, t: testTooltips }, + keyboardSupport: { r: true, t: testKeyboardSupport }, + documentElement: { r: false, t: testDocumentElement }, + cssPrefix: { r: true, t: testCssPrefix }, + cssClasses: { r: true, t: testCssClasses }, + handleAttributes: { r: false, t: testHandleAttributes }, + }; + var defaults = { + connect: false, + direction: "ltr", + behaviour: "tap", + orientation: "horizontal", + keyboardSupport: true, + cssPrefix: "noUi-", + cssClasses: cssClasses, + keyboardPageMultiplier: 5, + keyboardMultiplier: 1, + keyboardDefaultStep: 10, + }; + // AriaFormat defaults to regular format, if any. + if (options.format && !options.ariaFormat) { + options.ariaFormat = options.format; + } + // Run all options through a testing mechanism to ensure correct + // input. It should be noted that options might get modified to + // be handled properly. E.g. wrapping integers in arrays. + Object.keys(tests).forEach(function (name) { + // If the option isn't set, but it is required, throw an error. + if (!isSet(options[name]) && defaults[name] === undefined) { + if (tests[name].r) { + throw new Error("noUiSlider: '" + name + "' is required."); + } + return; + } + tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]); + }); + // Forward pips options + parsed.pips = options.pips; + // All recent browsers accept unprefixed transform. + // We need -ms- for IE9 and -webkit- for older Android; + // Assume use of -webkit- if unprefixed and -ms- are not supported. + // https://caniuse.com/#feat=transforms2d + var d = document.createElement("div"); + var msPrefix = d.style.msTransform !== undefined; + var noPrefix = d.style.transform !== undefined; + parsed.transformRule = noPrefix ? "transform" : msPrefix ? "msTransform" : "webkitTransform"; + // Pips don't move, so we can place them using left/top. + var styles = [ + ["left", "top"], + ["right", "bottom"], + ]; + parsed.style = styles[parsed.dir][parsed.ort]; + return parsed; + } + //endregion + function scope(target, options, originalOptions) { + var actions = getActions(); + var supportsTouchActionNone = getSupportsTouchActionNone(); + var supportsPassive = supportsTouchActionNone && getSupportsPassive(); + // All variables local to 'scope' are prefixed with 'scope_' + // Slider DOM Nodes + var scope_Target = target; + var scope_Base; + var scope_ConnectBase; + var scope_Handles; + var scope_Connects; + var scope_Pips; + var scope_Tooltips; + // Slider state values + var scope_Spectrum = options.spectrum; + var scope_Values = []; + var scope_Locations = []; + var scope_HandleNumbers = []; + var scope_ActiveHandlesCount = 0; + var scope_Events = {}; + var scope_ConnectsInverted = false; + // Document Nodes + var scope_Document = target.ownerDocument; + var scope_DocumentElement = options.documentElement || scope_Document.documentElement; + var scope_Body = scope_Document.body; + // For horizontal sliders in standard ltr documents, + // make .noUi-origin overflow to the left so the document doesn't scroll. + var scope_DirOffset = scope_Document.dir === "rtl" || options.ort === 1 ? 0 : 100; + // Creates a node, adds it to target, returns the new node. + function addNodeTo(addTarget, className) { + var div = scope_Document.createElement("div"); + if (className) { + addClass(div, className); + } + addTarget.appendChild(div); + return div; + } + // Append a origin to the base + function addOrigin(base, handleNumber) { + var origin = addNodeTo(base, options.cssClasses.origin); + var handle = addNodeTo(origin, options.cssClasses.handle); + addNodeTo(handle, options.cssClasses.touchArea); + handle.setAttribute("data-handle", String(handleNumber)); + if (options.keyboardSupport) { + // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex + // 0 = focusable and reachable + handle.setAttribute("tabindex", "0"); + handle.addEventListener("keydown", function (event) { + return eventKeydown(event, handleNumber); + }); + } + if (options.handleAttributes !== undefined) { + var attributes_1 = options.handleAttributes[handleNumber]; + Object.keys(attributes_1).forEach(function (attribute) { + handle.setAttribute(attribute, attributes_1[attribute]); + }); + } + handle.setAttribute("role", "slider"); + handle.setAttribute("aria-orientation", options.ort ? "vertical" : "horizontal"); + if (handleNumber === 0) { + addClass(handle, options.cssClasses.handleLower); + } + else if (handleNumber === options.handles - 1) { + addClass(handle, options.cssClasses.handleUpper); + } + origin.handle = handle; + return origin; + } + // Insert nodes for connect elements + function addConnect(base, add) { + if (!add) { + return false; + } + return addNodeTo(base, options.cssClasses.connect); + } + // Add handles to the slider base. + function addElements(connectOptions, base) { + scope_ConnectBase = addNodeTo(base, options.cssClasses.connects); + scope_Handles = []; + scope_Connects = []; + scope_Connects.push(addConnect(scope_ConnectBase, connectOptions[0])); + // [::::O====O====O====] + // connectOptions = [0, 1, 1, 1] + for (var i = 0; i < options.handles; i++) { + // Keep a list of all added handles. + scope_Handles.push(addOrigin(base, i)); + scope_HandleNumbers[i] = i; + scope_Connects.push(addConnect(scope_ConnectBase, connectOptions[i + 1])); + } + } + // Initialize a single slider. + function addSlider(addTarget) { + // Apply classes and data to the target. + addClass(addTarget, options.cssClasses.target); + if (options.dir === 0) { + addClass(addTarget, options.cssClasses.ltr); + } + else { + addClass(addTarget, options.cssClasses.rtl); + } + if (options.ort === 0) { + addClass(addTarget, options.cssClasses.horizontal); + } + else { + addClass(addTarget, options.cssClasses.vertical); + } + var textDirection = getComputedStyle(addTarget).direction; + if (textDirection === "rtl") { + addClass(addTarget, options.cssClasses.textDirectionRtl); + } + else { + addClass(addTarget, options.cssClasses.textDirectionLtr); + } + return addNodeTo(addTarget, options.cssClasses.base); + } + function addTooltip(handle, handleNumber) { + if (!options.tooltips || !options.tooltips[handleNumber]) { + return false; + } + return addNodeTo(handle.firstChild, options.cssClasses.tooltip); + } + function isSliderDisabled() { + return scope_Target.hasAttribute("disabled"); + } + // Disable the slider dragging if any handle is disabled + function isHandleDisabled(handleNumber) { + var handleOrigin = scope_Handles[handleNumber]; + return handleOrigin.hasAttribute("disabled"); + } + function disable(handleNumber) { + if (handleNumber !== null && handleNumber !== undefined) { + scope_Handles[handleNumber].setAttribute("disabled", ""); + scope_Handles[handleNumber].handle.removeAttribute("tabindex"); + } + else { + scope_Target.setAttribute("disabled", ""); + scope_Handles.forEach(function (handle) { + handle.handle.removeAttribute("tabindex"); + }); + } + } + function enable(handleNumber) { + if (handleNumber !== null && handleNumber !== undefined) { + scope_Handles[handleNumber].removeAttribute("disabled"); + scope_Handles[handleNumber].handle.setAttribute("tabindex", "0"); + } + else { + scope_Target.removeAttribute("disabled"); + scope_Handles.forEach(function (handle) { + handle.removeAttribute("disabled"); + handle.handle.setAttribute("tabindex", "0"); + }); + } + } + function removeTooltips() { + if (scope_Tooltips) { + removeEvent("update" + INTERNAL_EVENT_NS.tooltips); + scope_Tooltips.forEach(function (tooltip) { + if (tooltip) { + removeElement(tooltip); + } + }); + scope_Tooltips = null; + } + } + // The tooltips option is a shorthand for using the 'update' event. + function tooltips() { + removeTooltips(); + // Tooltips are added with options.tooltips in original order. + scope_Tooltips = scope_Handles.map(addTooltip); + bindEvent("update" + INTERNAL_EVENT_NS.tooltips, function (values, handleNumber, unencoded) { + if (!scope_Tooltips || !options.tooltips) { + return; + } + if (scope_Tooltips[handleNumber] === false) { + return; + } + var formattedValue = values[handleNumber]; + if (options.tooltips[handleNumber] !== true) { + formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]); + } + scope_Tooltips[handleNumber].innerHTML = formattedValue; + }); + } + function aria() { + removeEvent("update" + INTERNAL_EVENT_NS.aria); + bindEvent("update" + INTERNAL_EVENT_NS.aria, function (values, handleNumber, unencoded, tap, positions) { + // Update Aria Values for all handles, as a change in one changes min and max values for the next. + scope_HandleNumbers.forEach(function (index) { + var handle = scope_Handles[index]; + var min = checkHandlePosition(scope_Locations, index, 0, true, true, true); + var max = checkHandlePosition(scope_Locations, index, 100, true, true, true); + var now = positions[index]; + // Formatted value for display + var text = String(options.ariaFormat.to(unencoded[index])); + // Map to slider range values + min = scope_Spectrum.fromStepping(min).toFixed(1); + max = scope_Spectrum.fromStepping(max).toFixed(1); + now = scope_Spectrum.fromStepping(now).toFixed(1); + handle.children[0].setAttribute("aria-valuemin", min); + handle.children[0].setAttribute("aria-valuemax", max); + handle.children[0].setAttribute("aria-valuenow", now); + handle.children[0].setAttribute("aria-valuetext", text); + }); + }); + } + function getGroup(pips) { + // Use the range. + if (pips.mode === exports.PipsMode.Range || pips.mode === exports.PipsMode.Steps) { + return scope_Spectrum.xVal; + } + if (pips.mode === exports.PipsMode.Count) { + if (pips.values < 2) { + throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'."); + } + // Divide 0 - 100 in 'count' parts. + var interval = pips.values - 1; + var spread = 100 / interval; + var values = []; + // List these parts and have them handled as 'positions'. + while (interval--) { + values[interval] = interval * spread; + } + values.push(100); + return mapToRange(values, pips.stepped); + } + if (pips.mode === exports.PipsMode.Positions) { + // Map all percentages to on-range values. + return mapToRange(pips.values, pips.stepped); + } + if (pips.mode === exports.PipsMode.Values) { + // If the value must be stepped, it needs to be converted to a percentage first. + if (pips.stepped) { + return pips.values.map(function (value) { + // Convert to percentage, apply step, return to value. + return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value))); + }); + } + // Otherwise, we can simply use the values. + return pips.values; + } + return []; // pips.mode = never + } + function mapToRange(values, stepped) { + return values.map(function (value) { + return scope_Spectrum.fromStepping(stepped ? scope_Spectrum.getStep(value) : value); + }); + } + function generateSpread(pips) { + function safeIncrement(value, increment) { + // Avoid floating point variance by dropping the smallest decimal places. + return Number((value + increment).toFixed(7)); + } + var group = getGroup(pips); + var indexes = {}; + var firstInRange = scope_Spectrum.xVal[0]; + var lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length - 1]; + var ignoreFirst = false; + var ignoreLast = false; + var prevPct = 0; + // Create a copy of the group, sort it and filter away all duplicates. + group = unique(group.slice().sort(function (a, b) { + return a - b; + })); + // Make sure the range starts with the first element. + if (group[0] !== firstInRange) { + group.unshift(firstInRange); + ignoreFirst = true; + } + // Likewise for the last one. + if (group[group.length - 1] !== lastInRange) { + group.push(lastInRange); + ignoreLast = true; + } + group.forEach(function (current, index) { + // Get the current step and the lower + upper positions. + var step; + var i; + var q; + var low = current; + var high = group[index + 1]; + var newPct; + var pctDifference; + var pctPos; + var type; + var steps; + var realSteps; + var stepSize; + var isSteps = pips.mode === exports.PipsMode.Steps; + // When using 'steps' mode, use the provided steps. + // Otherwise, we'll step on to the next subrange. + if (isSteps) { + step = scope_Spectrum.xNumSteps[index]; + } + // Default to a 'full' step. + if (!step) { + step = high - low; + } + // If high is undefined we are at the last subrange. Make sure it iterates once (#1088) + if (high === undefined) { + high = low; + } + // Make sure step isn't 0, which would cause an infinite loop (#654) + step = Math.max(step, 0.0000001); + // Find all steps in the subrange. + for (i = low; i <= high; i = safeIncrement(i, step)) { + // Get the percentage value for the current step, + // calculate the size for the subrange. + newPct = scope_Spectrum.toStepping(i); + pctDifference = newPct - prevPct; + steps = pctDifference / (pips.density || 1); + realSteps = Math.round(steps); + // This ratio represents the amount of percentage-space a point indicates. + // For a density 1 the points/percentage = 1. For density 2, that percentage needs to be re-divided. + // Round the percentage offset to an even number, then divide by two + // to spread the offset on both sides of the range. + stepSize = pctDifference / realSteps; + // Divide all points evenly, adding the correct number to this subrange. + // Run up to <= so that 100% gets a point, event if ignoreLast is set. + for (q = 1; q <= realSteps; q += 1) { + // The ratio between the rounded value and the actual size might be ~1% off. + // Correct the percentage offset by the number of points + // per subrange. density = 1 will result in 100 points on the + // full range, 2 for 50, 4 for 25, etc. + pctPos = prevPct + q * stepSize; + indexes[pctPos.toFixed(5)] = [scope_Spectrum.fromStepping(pctPos), 0]; + } + // Determine the point type. + type = group.indexOf(i) > -1 ? exports.PipsType.LargeValue : isSteps ? exports.PipsType.SmallValue : exports.PipsType.NoValue; + // Enforce the 'ignoreFirst' option by overwriting the type for 0. + if (!index && ignoreFirst && i !== high) { + type = 0; + } + if (!(i === high && ignoreLast)) { + // Mark the 'type' of this point. 0 = plain, 1 = real value, 2 = step value. + indexes[newPct.toFixed(5)] = [i, type]; + } + // Update the percentage count. + prevPct = newPct; + } + }); + return indexes; + } + function addMarking(spread, filterFunc, formatter) { + var _a, _b; + var element = scope_Document.createElement("div"); + var valueSizeClasses = (_a = {}, + _a[exports.PipsType.None] = "", + _a[exports.PipsType.NoValue] = options.cssClasses.valueNormal, + _a[exports.PipsType.LargeValue] = options.cssClasses.valueLarge, + _a[exports.PipsType.SmallValue] = options.cssClasses.valueSub, + _a); + var markerSizeClasses = (_b = {}, + _b[exports.PipsType.None] = "", + _b[exports.PipsType.NoValue] = options.cssClasses.markerNormal, + _b[exports.PipsType.LargeValue] = options.cssClasses.markerLarge, + _b[exports.PipsType.SmallValue] = options.cssClasses.markerSub, + _b); + var valueOrientationClasses = [options.cssClasses.valueHorizontal, options.cssClasses.valueVertical]; + var markerOrientationClasses = [options.cssClasses.markerHorizontal, options.cssClasses.markerVertical]; + addClass(element, options.cssClasses.pips); + addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical); + function getClasses(type, source) { + var a = source === options.cssClasses.value; + var orientationClasses = a ? valueOrientationClasses : markerOrientationClasses; + var sizeClasses = a ? valueSizeClasses : markerSizeClasses; + return source + " " + orientationClasses[options.ort] + " " + sizeClasses[type]; + } + function addSpread(offset, value, type) { + // Apply the filter function, if it is set. + type = filterFunc ? filterFunc(value, type) : type; + if (type === exports.PipsType.None) { + return; + } + // Add a marker for every point + var node = addNodeTo(element, false); + node.className = getClasses(type, options.cssClasses.marker); + node.style[options.style] = offset + "%"; + // Values are only appended for points marked '1' or '2'. + if (type > exports.PipsType.NoValue) { + node = addNodeTo(element, false); + node.className = getClasses(type, options.cssClasses.value); + node.setAttribute("data-value", String(value)); + node.style[options.style] = offset + "%"; + node.innerHTML = String(formatter.to(value)); + } + } + // Append all points. + Object.keys(spread).forEach(function (offset) { + addSpread(offset, spread[offset][0], spread[offset][1]); + }); + return element; + } + function removePips() { + if (scope_Pips) { + removeElement(scope_Pips); + scope_Pips = null; + } + } + function pips(pips) { + // Fix #669 + removePips(); + var spread = generateSpread(pips); + var filter = pips.filter; + var format = pips.format || { + to: function (value) { + return String(Math.round(value)); + }, + }; + scope_Pips = scope_Target.appendChild(addMarking(spread, filter, format)); + return scope_Pips; + } + // Shorthand for base dimensions. + function baseSize() { + var rect = scope_Base.getBoundingClientRect(); + var alt = ("offset" + ["Width", "Height"][options.ort]); + return options.ort === 0 ? rect.width || scope_Base[alt] : rect.height || scope_Base[alt]; + } + // Handler for attaching events trough a proxy. + function attachEvent(events, element, callback, data) { + // This function can be used to 'filter' events to the slider. + // element is a node, not a nodeList + var method = function (event) { + var e = fixEvent(event, data.pageOffset, data.target || element); + // fixEvent returns false if this event has a different target + // when handling (multi-) touch events; + if (!e) { + return false; + } + // doNotReject is passed by all end events to make sure released touches + // are not rejected, leaving the slider "stuck" to the cursor; + if (isSliderDisabled() && !data.doNotReject) { + return false; + } + // Stop if an active 'tap' transition is taking place. + if (hasClass(scope_Target, options.cssClasses.tap) && !data.doNotReject) { + return false; + } + // Ignore right or middle clicks on start #454 + if (events === actions.start && e.buttons !== undefined && e.buttons > 1) { + return false; + } + // Ignore right or middle clicks on start #454 + if (data.hover && e.buttons) { + return false; + } + // 'supportsPassive' is only true if a browser also supports touch-action: none in CSS. + // iOS safari does not, so it doesn't get to benefit from passive scrolling. iOS does support + // touch-action: manipulation, but that allows panning, which breaks + // sliders after zooming/on non-responsive pages. + // See: https://bugs.webkit.org/show_bug.cgi?id=133112 + if (!supportsPassive) { + e.preventDefault(); + } + e.calcPoint = e.points[options.ort]; + // Call the event handler with the event [ and additional data ]. + callback(e, data); + return; + }; + var methods = []; + // Bind a closure on the target for every event type. + events.split(" ").forEach(function (eventName) { + element.addEventListener(eventName, method, supportsPassive ? { passive: true } : false); + methods.push([eventName, method]); + }); + return methods; + } + // Provide a clean event with standardized offset values. + function fixEvent(e, pageOffset, eventTarget) { + // Filter the event to register the type, which can be + // touch, mouse or pointer. Offset changes need to be + // made on an event specific basis. + var touch = e.type.indexOf("touch") === 0; + var mouse = e.type.indexOf("mouse") === 0; + var pointer = e.type.indexOf("pointer") === 0; + var x = 0; + var y = 0; + // IE10 implemented pointer events with a prefix; + if (e.type.indexOf("MSPointer") === 0) { + pointer = true; + } + // Erroneous events seem to be passed in occasionally on iOS/iPadOS after user finishes interacting with + // the slider. They appear to be of type MouseEvent, yet they don't have usual properties set. Ignore + // events that have no touches or buttons associated with them. (#1057, #1079, #1095) + if (e.type === "mousedown" && !e.buttons && !e.touches) { + return false; + } + // The only thing one handle should be concerned about is the touches that originated on top of it. + if (touch) { + // Returns true if a touch originated on the target. + var isTouchOnTarget = function (checkTouch) { + var target = checkTouch.target; + return (target === eventTarget || + eventTarget.contains(target) || + (e.composed && e.composedPath().shift() === eventTarget)); + }; + // In the case of touchstart events, we need to make sure there is still no more than one + // touch on the target so we look amongst all touches. + if (e.type === "touchstart") { + var targetTouches = Array.prototype.filter.call(e.touches, isTouchOnTarget); + // Do not support more than one touch per handle. + if (targetTouches.length > 1) { + return false; + } + x = targetTouches[0].pageX; + y = targetTouches[0].pageY; + } + else { + // In the other cases, find on changedTouches is enough. + var targetTouch = Array.prototype.find.call(e.changedTouches, isTouchOnTarget); + // Cancel if the target touch has not moved. + if (!targetTouch) { + return false; + } + x = targetTouch.pageX; + y = targetTouch.pageY; + } + } + pageOffset = pageOffset || getPageOffset(scope_Document); + if (mouse || pointer) { + x = e.clientX + pageOffset.x; + y = e.clientY + pageOffset.y; + } + e.pageOffset = pageOffset; + e.points = [x, y]; + e.cursor = mouse || pointer; // Fix #435 + return e; + } + // Translate a coordinate in the document to a percentage on the slider + function calcPointToPercentage(calcPoint) { + var location = calcPoint - offset(scope_Base, options.ort); + var proposal = (location * 100) / baseSize(); + // Clamp proposal between 0% and 100% + // Out-of-bound coordinates may occur when .noUi-base pseudo-elements + // are used (e.g. contained handles feature) + proposal = limit(proposal); + return options.dir ? 100 - proposal : proposal; + } + // Find handle closest to a certain percentage on the slider + function getClosestHandle(clickedPosition) { + var smallestDifference = 100; + var handleNumber = false; + scope_Handles.forEach(function (handle, index) { + // Disabled handles are ignored + if (isHandleDisabled(index)) { + return; + } + var handlePosition = scope_Locations[index]; + var differenceWithThisHandle = Math.abs(handlePosition - clickedPosition); + // Initial state + var clickAtEdge = differenceWithThisHandle === 100 && smallestDifference === 100; + // Difference with this handle is smaller than the previously checked handle + var isCloser = differenceWithThisHandle < smallestDifference; + var isCloserAfter = differenceWithThisHandle <= smallestDifference && clickedPosition > handlePosition; + if (isCloser || isCloserAfter || clickAtEdge) { + handleNumber = index; + smallestDifference = differenceWithThisHandle; + } + }); + return handleNumber; + } + // Fire 'end' when a mouse or pen leaves the document. + function documentLeave(event, data) { + if (event.type === "mouseout" && + event.target.nodeName === "HTML" && + event.relatedTarget === null) { + eventEnd(event, data); + } + } + // Handle movement on document for handle and range drag. + function eventMove(event, data) { + // Fix #498 + // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty). + // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero + // IE9 has .buttons and .which zero on mousemove. + // Firefox breaks the spec MDN defines. + if (navigator.appVersion.indexOf("MSIE 9") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) { + return eventEnd(event, data); + } + // Check if we are moving up or down + var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint); + // Convert the movement into a percentage of the slider width/height + var proposal = (movement * 100) / data.baseSize; + moveHandles(movement > 0, proposal, data.locations, data.handleNumbers, data.connect); + } + // Unbind move events on document, call callbacks. + function eventEnd(event, data) { + // The handle is no longer active, so remove the class. + if (data.handle) { + removeClass(data.handle, options.cssClasses.active); + scope_ActiveHandlesCount -= 1; + } + // Unbind the move and end events, which are added on 'start'. + data.listeners.forEach(function (c) { + scope_DocumentElement.removeEventListener(c[0], c[1]); + }); + if (scope_ActiveHandlesCount === 0) { + // Remove dragging class. + removeClass(scope_Target, options.cssClasses.drag); + setZindex(); + // Remove cursor styles and text-selection events bound to the body. + if (event.cursor) { + scope_Body.style.cursor = ""; + scope_Body.removeEventListener("selectstart", preventDefault); + } + } + if (options.events.smoothSteps) { + data.handleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, scope_Locations[handleNumber], true, true, false, false); + }); + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + }); + } + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("change", handleNumber); + fireEvent("set", handleNumber); + fireEvent("end", handleNumber); + }); + } + // Bind move events on document. + function eventStart(event, data) { + // Ignore event if any handle is disabled + if (data.handleNumbers.some(isHandleDisabled)) { + return; + } + var handle; + if (data.handleNumbers.length === 1) { + var handleOrigin = scope_Handles[data.handleNumbers[0]]; + handle = handleOrigin.children[0]; + scope_ActiveHandlesCount += 1; + // Mark the handle as 'active' so it can be styled. + addClass(handle, options.cssClasses.active); + } + // A drag should never propagate up to the 'tap' event. + event.stopPropagation(); + // Record the event listeners. + var listeners = []; + // Attach the move and end events. + var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, { + // The event target has changed so we need to propagate the original one so that we keep + // relying on it to extract target touches. + target: event.target, + handle: handle, + connect: data.connect, + listeners: listeners, + startCalcPoint: event.calcPoint, + baseSize: baseSize(), + pageOffset: event.pageOffset, + handleNumbers: data.handleNumbers, + buttonsProperty: event.buttons, + locations: scope_Locations.slice(), + }); + var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, { + target: event.target, + handle: handle, + listeners: listeners, + doNotReject: true, + handleNumbers: data.handleNumbers, + }); + var outEvent = attachEvent("mouseout", scope_DocumentElement, documentLeave, { + target: event.target, + handle: handle, + listeners: listeners, + doNotReject: true, + handleNumbers: data.handleNumbers, + }); + // We want to make sure we pushed the listeners in the listener list rather than creating + // a new one as it has already been passed to the event handlers. + listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent)); + // Text selection isn't an issue on touch devices, + // so adding cursor styles can be skipped. + if (event.cursor) { + // Prevent the 'I' cursor and extend the range-drag cursor. + scope_Body.style.cursor = getComputedStyle(event.target).cursor; + // Mark the target with a dragging state. + if (scope_Handles.length > 1) { + addClass(scope_Target, options.cssClasses.drag); + } + // Prevent text selection when dragging the handles. + // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move, + // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52, + // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there. + // The 'cursor' flag is false. + // See: http://caniuse.com/#search=selectstart + scope_Body.addEventListener("selectstart", preventDefault, false); + } + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("start", handleNumber); + }); + } + // Move closest handle to tapped location. + function eventTap(event) { + // The tap event shouldn't propagate up + event.stopPropagation(); + var proposal = calcPointToPercentage(event.calcPoint); + var handleNumber = getClosestHandle(proposal); + // Tackle the case that all handles are 'disabled'. + if (handleNumber === false) { + return; + } + // Flag the slider as it is now in a transitional state. + // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that. + if (!options.events.snap) { + addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration); + } + setHandle(handleNumber, proposal, true, true); + setZindex(); + fireEvent("slide", handleNumber, true); + fireEvent("update", handleNumber, true); + if (!options.events.snap) { + fireEvent("change", handleNumber, true); + fireEvent("set", handleNumber, true); + } + else { + eventStart(event, { handleNumbers: [handleNumber] }); + } + } + // Fires a 'hover' event for a hovered mouse/pen position. + function eventHover(event) { + var proposal = calcPointToPercentage(event.calcPoint); + var to = scope_Spectrum.getStep(proposal); + var value = scope_Spectrum.fromStepping(to); + Object.keys(scope_Events).forEach(function (targetEvent) { + if ("hover" === targetEvent.split(".")[0]) { + scope_Events[targetEvent].forEach(function (callback) { + callback.call(scope_Self, value); + }); + } + }); + } + // Handles keydown on focused handles + // Don't move the document when pressing arrow keys on focused handles + function eventKeydown(event, handleNumber) { + if (isSliderDisabled() || isHandleDisabled(handleNumber)) { + return false; + } + var horizontalKeys = ["Left", "Right"]; + var verticalKeys = ["Down", "Up"]; + var largeStepKeys = ["PageDown", "PageUp"]; + var edgeKeys = ["Home", "End"]; + if (options.dir && !options.ort) { + // On an right-to-left slider, the left and right keys act inverted + horizontalKeys.reverse(); + } + else if (options.ort && !options.dir) { + // On a top-to-bottom slider, the up and down keys act inverted + verticalKeys.reverse(); + largeStepKeys.reverse(); + } + // Strip "Arrow" for IE compatibility. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key + var key = event.key.replace("Arrow", ""); + var isLargeDown = key === largeStepKeys[0]; + var isLargeUp = key === largeStepKeys[1]; + var isDown = key === verticalKeys[0] || key === horizontalKeys[0] || isLargeDown; + var isUp = key === verticalKeys[1] || key === horizontalKeys[1] || isLargeUp; + var isMin = key === edgeKeys[0]; + var isMax = key === edgeKeys[1]; + if (!isDown && !isUp && !isMin && !isMax) { + return true; + } + event.preventDefault(); + var to; + if (isUp || isDown) { + var direction = isDown ? 0 : 1; + var steps = getNextStepsForHandle(handleNumber); + var step = steps[direction]; + // At the edge of a slider, do nothing + if (step === null) { + return false; + } + // No step set, use the default of 10% of the sub-range + if (step === false) { + step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, options.keyboardDefaultStep); + } + if (isLargeUp || isLargeDown) { + step *= options.keyboardPageMultiplier; + } + else { + step *= options.keyboardMultiplier; + } + // Step over zero-length ranges (#948); + step = Math.max(step, 0.0000001); + // Decrement for down steps + step = (isDown ? -1 : 1) * step; + to = scope_Values[handleNumber] + step; + } + else if (isMax) { + // End key + to = options.spectrum.xVal[options.spectrum.xVal.length - 1]; + } + else { + // Home key + to = options.spectrum.xVal[0]; + } + setHandle(handleNumber, scope_Spectrum.toStepping(to), true, true); + fireEvent("slide", handleNumber); + fireEvent("update", handleNumber); + fireEvent("change", handleNumber); + fireEvent("set", handleNumber); + return false; + } + // Attach events to several slider parts. + function bindSliderEvents(behaviour) { + // Attach the standard drag event to the handles. + if (!behaviour.fixed) { + scope_Handles.forEach(function (handle, index) { + // These events are only bound to the visual handle + // element, not the 'real' origin element. + attachEvent(actions.start, handle.children[0], eventStart, { + handleNumbers: [index], + }); + }); + } + // Attach the tap event to the slider base. + if (behaviour.tap) { + attachEvent(actions.start, scope_Base, eventTap, {}); + } + // Fire hover events + if (behaviour.hover) { + attachEvent(actions.move, scope_Base, eventHover, { + hover: true, + }); + } + // Make the range draggable. + if (behaviour.drag) { + scope_Connects.forEach(function (connect, index) { + if (connect === false || index === 0 || index === scope_Connects.length - 1) { + return; + } + var handleBefore = scope_Handles[index - 1]; + var handleAfter = scope_Handles[index]; + var eventHolders = [connect]; + var handlesToDrag = [handleBefore, handleAfter]; + var handleNumbersToDrag = [index - 1, index]; + addClass(connect, options.cssClasses.draggable); + // When the range is fixed, the entire range can + // be dragged by the handles. The handle in the first + // origin will propagate the start event upward, + // but it needs to be bound manually on the other. + if (behaviour.fixed) { + eventHolders.push(handleBefore.children[0]); + eventHolders.push(handleAfter.children[0]); + } + if (behaviour.dragAll) { + handlesToDrag = scope_Handles; + handleNumbersToDrag = scope_HandleNumbers; + } + eventHolders.forEach(function (eventHolder) { + attachEvent(actions.start, eventHolder, eventStart, { + handles: handlesToDrag, + handleNumbers: handleNumbersToDrag, + connect: connect, + }); + }); + }); + } + } + // Attach an event to this slider, possibly including a namespace + function bindEvent(namespacedEvent, callback) { + scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || []; + scope_Events[namespacedEvent].push(callback); + // If the event bound is 'update,' fire it immediately for all handles. + if (namespacedEvent.split(".")[0] === "update") { + scope_Handles.forEach(function (a, index) { + fireEvent("update", index); + }); + } + } + function isInternalNamespace(namespace) { + return namespace === INTERNAL_EVENT_NS.aria || namespace === INTERNAL_EVENT_NS.tooltips; + } + // Undo attachment of event + function removeEvent(namespacedEvent) { + var event = namespacedEvent && namespacedEvent.split(".")[0]; + var namespace = event ? namespacedEvent.substring(event.length) : namespacedEvent; + Object.keys(scope_Events).forEach(function (bind) { + var tEvent = bind.split(".")[0]; + var tNamespace = bind.substring(tEvent.length); + if ((!event || event === tEvent) && (!namespace || namespace === tNamespace)) { + // only delete protected internal event if intentional + if (!isInternalNamespace(tNamespace) || namespace === tNamespace) { + delete scope_Events[bind]; + } + } + }); + } + // External event handling + function fireEvent(eventName, handleNumber, tap) { + Object.keys(scope_Events).forEach(function (targetEvent) { + var eventType = targetEvent.split(".")[0]; + if (eventName === eventType) { + scope_Events[targetEvent].forEach(function (callback) { + callback.call( + // Use the slider public API as the scope ('this') + scope_Self, + // Return values as array, so arg_1[arg_2] is always valid. + scope_Values.map(options.format.to), + // Handle index, 0 or 1 + handleNumber, + // Un-formatted slider values + scope_Values.slice(), + // Event is fired by tap, true or false + tap || false, + // Left offset of the handle, in relation to the slider + scope_Locations.slice(), + // add the slider public API to an accessible parameter when this is unavailable + scope_Self); + }); + } + }); + } + // Split out the handle positioning logic so the Move event can use it, too + function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue, smoothSteps) { + var distance; + // For sliders with multiple handles, limit movement to the other handle. + // Apply the margin option by adding it to the handle positions. + if (scope_Handles.length > 1 && !options.events.unconstrained) { + if (lookBackward && handleNumber > 0) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.margin, false); + to = Math.max(to, distance); + } + if (lookForward && handleNumber < scope_Handles.length - 1) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.margin, true); + to = Math.min(to, distance); + } + } + // The limit option has the opposite effect, limiting handles to a + // maximum distance from another. Limit must be > 0, as otherwise + // handles would be unmovable. + if (scope_Handles.length > 1 && options.limit) { + if (lookBackward && handleNumber > 0) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.limit, false); + to = Math.min(to, distance); + } + if (lookForward && handleNumber < scope_Handles.length - 1) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.limit, true); + to = Math.max(to, distance); + } + } + // The padding option keeps the handles a certain distance from the + // edges of the slider. Padding must be > 0. + if (options.padding) { + if (handleNumber === 0) { + distance = scope_Spectrum.getAbsoluteDistance(0, options.padding[0], false); + to = Math.max(to, distance); + } + if (handleNumber === scope_Handles.length - 1) { + distance = scope_Spectrum.getAbsoluteDistance(100, options.padding[1], true); + to = Math.min(to, distance); + } + } + if (!smoothSteps) { + to = scope_Spectrum.getStep(to); + } + // Limit percentage to the 0 - 100 range + to = limit(to); + // Return false if handle can't move + if (to === reference[handleNumber] && !getValue) { + return false; + } + return to; + } + // Uses slider orientation to create CSS rules. a = base value; + function inRuleOrder(v, a) { + var o = options.ort; + return (o ? a : v) + ", " + (o ? v : a); + } + // Moves handle(s) by a percentage + // (bool, % to move, [% where handle started, ...], [index in scope_Handles, ...]) + function moveHandles(upward, proposal, locations, handleNumbers, connect) { + var proposals = locations.slice(); + // Store first handle now, so we still have it in case handleNumbers is reversed + var firstHandle = handleNumbers[0]; + var smoothSteps = options.events.smoothSteps; + var b = [!upward, upward]; + var f = [upward, !upward]; + // Copy handleNumbers so we don't change the dataset + handleNumbers = handleNumbers.slice(); + // Check to see which handle is 'leading'. + // If that one can't move the second can't either. + if (upward) { + handleNumbers.reverse(); + } + // Step 1: get the maximum percentage that any of the handles can move + if (handleNumbers.length > 1) { + handleNumbers.forEach(function (handleNumber, o) { + var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false, smoothSteps); + // Stop if one of the handles can't move. + if (to === false) { + proposal = 0; + } + else { + proposal = to - proposals[handleNumber]; + proposals[handleNumber] = to; + } + }); + } + // If using one handle, check backward AND forward + else { + b = f = [true]; + } + var state = false; + // Step 2: Try to set the handles with the found percentage + handleNumbers.forEach(function (handleNumber, o) { + state = + setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o], false, smoothSteps) || state; + }); + // Step 3: If a handle moved, fire events + if (state) { + handleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + fireEvent("slide", handleNumber); + }); + // If target is a connect, then fire drag event + if (connect != undefined) { + fireEvent("drag", firstHandle); + } + } + } + // Takes a base value and an offset. This offset is used for the connect bar size. + // In the initial design for this feature, the origin element was 1% wide. + // Unfortunately, a rounding bug in Chrome makes it impossible to implement this feature + // in this manner: https://bugs.chromium.org/p/chromium/issues/detail?id=798223 + function transformDirection(a, b) { + return options.dir ? 100 - a - b : a; + } + // Updates scope_Locations and scope_Values, updates visual state + function updateHandlePosition(handleNumber, to) { + // Update locations. + scope_Locations[handleNumber] = to; + // Convert the value to the slider stepping/range. + scope_Values[handleNumber] = scope_Spectrum.fromStepping(to); + var translation = transformDirection(to, 0) - scope_DirOffset; + var translateRule = "translate(" + inRuleOrder(translation + "%", "0") + ")"; + scope_Handles[handleNumber].style[options.transformRule] = translateRule; + // sanity check for at least 2 handles (e.g. during setup) + if (options.events.invertConnects && scope_Locations.length > 1) { + // check if handles passed each other, but don't match the ConnectsInverted state + var handlesAreInOrder = scope_Locations.every(function (position, index, locations) { + return index === 0 || position >= locations[index - 1]; + }); + if (scope_ConnectsInverted !== !handlesAreInOrder) { + // invert connects when handles pass each other + invertConnects(); + // invertConnects already updates all connect elements + return; + } + } + updateConnect(handleNumber); + updateConnect(handleNumber + 1); + if (scope_ConnectsInverted) { + // When connects are inverted, we also have to update adjacent connects + updateConnect(handleNumber - 1); + updateConnect(handleNumber + 2); + } + } + // Handles before the slider middle are stacked later = higher, + // Handles after the middle later is lower + // [[7] [8] .......... | .......... [5] [4] + function setZindex() { + scope_HandleNumbers.forEach(function (handleNumber) { + var dir = scope_Locations[handleNumber] > 50 ? -1 : 1; + var zIndex = 3 + (scope_Handles.length + dir * handleNumber); + scope_Handles[handleNumber].style.zIndex = String(zIndex); + }); + } + // Test suggested values and apply margin, step. + // if exactInput is true, don't run checkHandlePosition, then the handle can be placed in between steps (#436) + function setHandle(handleNumber, to, lookBackward, lookForward, exactInput, smoothSteps) { + if (!exactInput) { + to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false, smoothSteps); + } + if (to === false) { + return false; + } + updateHandlePosition(handleNumber, to); + return true; + } + // Updates style attribute for connect nodes + function updateConnect(index) { + // Skip connects set to false + if (!scope_Connects[index]) { + return; + } + // Create a copy of locations, so we can sort them for the local scope logic + var locations = scope_Locations.slice(); + if (scope_ConnectsInverted) { + locations.sort(function (a, b) { + return a - b; + }); + } + var l = 0; + var h = 100; + if (index !== 0) { + l = locations[index - 1]; + } + if (index !== scope_Connects.length - 1) { + h = locations[index]; + } + // We use two rules: + // 'translate' to change the left/top offset; + // 'scale' to change the width of the element; + // As the element has a width of 100%, a translation of 100% is equal to 100% of the parent (.noUi-base) + var connectWidth = h - l; + var translateRule = "translate(" + inRuleOrder(transformDirection(l, connectWidth) + "%", "0") + ")"; + var scaleRule = "scale(" + inRuleOrder(connectWidth / 100, "1") + ")"; + scope_Connects[index].style[options.transformRule] = + translateRule + " " + scaleRule; + } + // Parses value passed to .set method. Returns current value if not parse-able. + function resolveToValue(to, handleNumber) { + // Setting with null indicates an 'ignore'. + // Inputting 'false' is invalid. + if (to === null || to === false || to === undefined) { + return scope_Locations[handleNumber]; + } + // If a formatted number was passed, attempt to decode it. + if (typeof to === "number") { + to = String(to); + } + to = options.format.from(to); + if (to !== false) { + to = scope_Spectrum.toStepping(to); + } + // If parsing the number failed, use the current value. + if (to === false || isNaN(to)) { + return scope_Locations[handleNumber]; + } + return to; + } + // Set the slider value. + function valueSet(input, fireSetEvent, exactInput) { + var values = asArray(input); + var isInit = scope_Locations[0] === undefined; + // Event fires by default + fireSetEvent = fireSetEvent === undefined ? true : fireSetEvent; + // Animation is optional. + // Make sure the initial values were set before using animated placement. + if (options.animate && !isInit) { + addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration); + } + // First pass, without lookAhead but with lookBackward. Values are set from left to right. + scope_HandleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, resolveToValue(values[handleNumber], handleNumber), true, false, exactInput); + }); + var i = scope_HandleNumbers.length === 1 ? 0 : 1; + // Spread handles evenly across the slider if the range has no size (min=max) + if (isInit && scope_Spectrum.hasNoSize()) { + exactInput = true; + scope_Locations[0] = 0; + if (scope_HandleNumbers.length > 1) { + var space_1 = 100 / (scope_HandleNumbers.length - 1); + scope_HandleNumbers.forEach(function (handleNumber) { + scope_Locations[handleNumber] = handleNumber * space_1; + }); + } + } + // Secondary passes. Now that all base values are set, apply constraints. + // Iterate all handles to ensure constraints are applied for the entire slider (Issue #1009) + for (; i < scope_HandleNumbers.length; ++i) { + scope_HandleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, scope_Locations[handleNumber], true, true, exactInput); + }); + } + setZindex(); + scope_HandleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + // Fire the event only for handles that received a new value, as per #579 + if (values[handleNumber] !== null && fireSetEvent) { + fireEvent("set", handleNumber); + } + }); + } + // Reset slider to initial values + function valueReset(fireSetEvent) { + valueSet(options.start, fireSetEvent); + } + // Set value for a single handle + function valueSetHandle(handleNumber, value, fireSetEvent, exactInput) { + // Ensure numeric input + handleNumber = Number(handleNumber); + if (!(handleNumber >= 0 && handleNumber < scope_HandleNumbers.length)) { + throw new Error("noUiSlider: invalid handle number, got: " + handleNumber); + } + // Look both backward and forward, since we don't want this handle to "push" other handles (#960); + // The exactInput argument can be used to ignore slider stepping (#436) + setHandle(handleNumber, resolveToValue(value, handleNumber), true, true, exactInput); + fireEvent("update", handleNumber); + if (fireSetEvent) { + fireEvent("set", handleNumber); + } + } + // Get the slider value. + function valueGet(unencoded) { + if (unencoded === void 0) { unencoded = false; } + if (unencoded) { + // return a copy of the raw values + return scope_Values.length === 1 ? scope_Values[0] : scope_Values.slice(0); + } + var values = scope_Values.map(options.format.to); + // If only one handle is used, return a single value. + if (values.length === 1) { + return values[0]; + } + return values; + } + // Removes classes from the root and empties it. + function destroy() { + // remove protected internal listeners + removeEvent(INTERNAL_EVENT_NS.aria); + removeEvent(INTERNAL_EVENT_NS.tooltips); + Object.keys(options.cssClasses).forEach(function (key) { + removeClass(scope_Target, options.cssClasses[key]); + }); + while (scope_Target.firstChild) { + scope_Target.removeChild(scope_Target.firstChild); + } + delete scope_Target.noUiSlider; + } + function getNextStepsForHandle(handleNumber) { + var location = scope_Locations[handleNumber]; + var nearbySteps = scope_Spectrum.getNearbySteps(location); + var value = scope_Values[handleNumber]; + var increment = nearbySteps.thisStep.step; + var decrement = null; + // If snapped, directly use defined step value + if (options.snap) { + return [ + value - nearbySteps.stepBefore.startValue || null, + nearbySteps.stepAfter.startValue - value || null, + ]; + } + // If the next value in this step moves into the next step, + // the increment is the start of the next step - the current value + if (increment !== false) { + if (value + increment > nearbySteps.stepAfter.startValue) { + increment = nearbySteps.stepAfter.startValue - value; + } + } + // If the value is beyond the starting point + if (value > nearbySteps.thisStep.startValue) { + decrement = nearbySteps.thisStep.step; + } + else if (nearbySteps.stepBefore.step === false) { + decrement = false; + } + // If a handle is at the start of a step, it always steps back into the previous step first + else { + decrement = value - nearbySteps.stepBefore.highestStep; + } + // Now, if at the slider edges, there is no in/decrement + if (location === 100) { + increment = null; + } + else if (location === 0) { + decrement = null; + } + // As per #391, the comparison for the decrement step can have some rounding issues. + var stepDecimals = scope_Spectrum.countStepDecimals(); + // Round per #391 + if (increment !== null && increment !== false) { + increment = Number(increment.toFixed(stepDecimals)); + } + if (decrement !== null && decrement !== false) { + decrement = Number(decrement.toFixed(stepDecimals)); + } + return [decrement, increment]; + } + // Get the current step size for the slider. + function getNextSteps() { + return scope_HandleNumbers.map(getNextStepsForHandle); + } + // Updatable: margin, limit, padding, step, range, animate, snap + function updateOptions(optionsToUpdate, fireSetEvent) { + // Spectrum is created using the range, snap, direction and step options. + // 'snap' and 'step' can be updated. + // If 'snap' and 'step' are not passed, they should remain unchanged. + var v = valueGet(); + var updateAble = [ + "margin", + "limit", + "padding", + "range", + "animate", + "snap", + "step", + "format", + "pips", + "tooltips", + "connect", + ]; + // Only change options that we're actually passed to update. + updateAble.forEach(function (name) { + // Check for undefined. null removes the value. + if (optionsToUpdate[name] !== undefined) { + originalOptions[name] = optionsToUpdate[name]; + } + }); + var newOptions = testOptions(originalOptions); + // Load new options into the slider state + updateAble.forEach(function (name) { + if (optionsToUpdate[name] !== undefined) { + options[name] = newOptions[name]; + } + }); + scope_Spectrum = newOptions.spectrum; + // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677) + options.margin = newOptions.margin; + options.limit = newOptions.limit; + options.padding = newOptions.padding; + // Update pips, removes existing. + if (options.pips) { + pips(options.pips); + } + else { + removePips(); + } + // Update tooltips, removes existing. + if (options.tooltips) { + tooltips(); + } + else { + removeTooltips(); + } + // Invalidate the current positioning so valueSet forces an update. + scope_Locations = []; + valueSet(isSet(optionsToUpdate.start) ? optionsToUpdate.start : v, fireSetEvent); + // Update connects only if it was set + if (optionsToUpdate.connect) { + updateConnectOption(); + } + } + function updateConnectOption() { + // IE supported way of removing children including event handlers + while (scope_ConnectBase.firstChild) { + scope_ConnectBase.removeChild(scope_ConnectBase.firstChild); + } + // Adding new connects according to the new connect options + for (var i = 0; i <= options.handles; i++) { + scope_Connects[i] = addConnect(scope_ConnectBase, options.connect[i]); + updateConnect(i); + } + // re-adding drag events for the new connect elements + // to ignore the other events we have to negate the 'if (!behaviour.fixed)' check + bindSliderEvents({ drag: options.events.drag, fixed: true }); + } + // Invert options for connect handles + function invertConnects() { + scope_ConnectsInverted = !scope_ConnectsInverted; + testConnect(options, + // inverse the connect boolean array + options.connect.map(function (b) { return !b; })); + updateConnectOption(); + } + // Initialization steps + function setupSlider() { + // Create the base element, initialize HTML and set classes. + // Add handles and connect elements. + scope_Base = addSlider(scope_Target); + addElements(options.connect, scope_Base); + // Attach user events. + bindSliderEvents(options.events); + // Use the public value method to set the start values. + valueSet(options.start); + if (options.pips) { + pips(options.pips); + } + if (options.tooltips) { + tooltips(); + } + aria(); + } + setupSlider(); + var scope_Self = { + destroy: destroy, + steps: getNextSteps, + on: bindEvent, + off: removeEvent, + get: valueGet, + set: valueSet, + setHandle: valueSetHandle, + reset: valueReset, + disable: disable, + enable: enable, + // Exposed for unit testing, don't use this in your application. + __moveHandles: function (upward, proposal, handleNumbers) { + moveHandles(upward, proposal, scope_Locations, handleNumbers); + }, + options: originalOptions, + updateOptions: updateOptions, + target: scope_Target, + removePips: removePips, + removeTooltips: removeTooltips, + getPositions: function () { + return scope_Locations.slice(); + }, + getTooltips: function () { + return scope_Tooltips; + }, + getOrigins: function () { + return scope_Handles; + }, + pips: pips, // Issue #594 + }; + return scope_Self; + } + // Run the standard initializer + function initialize(target, originalOptions) { + if (!target || !target.nodeName) { + throw new Error("noUiSlider: create requires a single element, got: " + target); + } + // Throw an error if the slider was already initialized. + if (target.noUiSlider) { + throw new Error("noUiSlider: Slider was already initialized."); + } + // Test the options and create the slider environment; + var options = testOptions(originalOptions); + var api = scope(target, options, originalOptions); + target.noUiSlider = api; + return api; + } + var nouislider = { + // Exposed for unit testing, don't use this in your application. + __spectrum: Spectrum, + // A reference to the default classes, allows global changes. + // Use the cssClasses option for changes to one slider. + cssClasses: cssClasses, + create: initialize, + }; + + exports.create = initialize; + exports.cssClasses = cssClasses; + exports["default"] = nouislider; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/web/libraries/nouislider/nouislider.min.css b/web/libraries/nouislider/nouislider.min.css new file mode 100644 index 0000000..60f217c --- /dev/null +++ b/web/libraries/nouislider/nouislider.min.css @@ -0,0 +1 @@ +.noUi-target,.noUi-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-ms-touch-action:none;touch-action:none;-ms-user-select:none;-moz-user-select:none;user-select:none;-moz-box-sizing:border-box;box-sizing:border-box}.noUi-target{position:relative}.noUi-base,.noUi-connects{width:100%;height:100%;position:relative;z-index:1}.noUi-connects{overflow:hidden;z-index:0}.noUi-connect,.noUi-origin{will-change:transform;position:absolute;z-index:1;top:0;right:0;height:100%;width:100%;-ms-transform-origin:0 0;-webkit-transform-origin:0 0;-webkit-transform-style:preserve-3d;transform-origin:0 0;transform-style:flat}.noUi-txt-dir-rtl.noUi-horizontal .noUi-origin{left:0;right:auto}.noUi-vertical .noUi-origin{top:-100%;width:0}.noUi-horizontal .noUi-origin{height:0}.noUi-handle{-webkit-backface-visibility:hidden;backface-visibility:hidden;position:absolute}.noUi-touch-area{height:100%;width:100%}.noUi-state-tap .noUi-connect,.noUi-state-tap .noUi-origin{-webkit-transition:transform .3s;transition:transform .3s}.noUi-state-drag *{cursor:inherit!important}.noUi-horizontal{height:18px}.noUi-horizontal .noUi-handle{width:34px;height:28px;right:-17px;top:-6px}.noUi-vertical{width:18px}.noUi-vertical .noUi-handle{width:28px;height:34px;right:-6px;bottom:-17px}.noUi-txt-dir-rtl.noUi-horizontal .noUi-handle{left:-17px;right:auto}.noUi-target{background:#FAFAFA;border-radius:4px;border:1px solid #D3D3D3;box-shadow:inset 0 1px 1px #F0F0F0,0 3px 6px -5px #BBB}.noUi-connects{border-radius:3px}.noUi-connect{background:#3FB8AF}.noUi-draggable{cursor:ew-resize}.noUi-vertical .noUi-draggable{cursor:ns-resize}.noUi-handle{border:1px solid #D9D9D9;border-radius:3px;background:#FFF;cursor:default;box-shadow:inset 0 0 1px #FFF,inset 0 1px 7px #EBEBEB,0 3px 6px -3px #BBB}.noUi-active{box-shadow:inset 0 0 1px #FFF,inset 0 1px 7px #DDD,0 3px 6px -3px #BBB}.noUi-handle:after,.noUi-handle:before{content:"";display:block;position:absolute;height:14px;width:1px;background:#E8E7E6;left:14px;top:6px}.noUi-handle:after{left:17px}.noUi-vertical .noUi-handle:after,.noUi-vertical .noUi-handle:before{width:14px;height:1px;left:6px;top:14px}.noUi-vertical .noUi-handle:after{top:17px}[disabled] .noUi-connect{background:#B8B8B8}[disabled] .noUi-handle,[disabled].noUi-handle,[disabled].noUi-target{cursor:not-allowed}.noUi-pips,.noUi-pips *{-moz-box-sizing:border-box;box-sizing:border-box}.noUi-pips{position:absolute;color:#999}.noUi-value{position:absolute;white-space:nowrap;text-align:center}.noUi-value-sub{color:#ccc;font-size:10px}.noUi-marker{position:absolute;background:#CCC}.noUi-marker-sub{background:#AAA}.noUi-marker-large{background:#AAA}.noUi-pips-horizontal{padding:10px 0;height:80px;top:100%;left:0;width:100%}.noUi-value-horizontal{-webkit-transform:translate(-50%,50%);transform:translate(-50%,50%)}.noUi-rtl .noUi-value-horizontal{-webkit-transform:translate(50%,50%);transform:translate(50%,50%)}.noUi-marker-horizontal.noUi-marker{margin-left:-1px;width:2px;height:5px}.noUi-marker-horizontal.noUi-marker-sub{height:10px}.noUi-marker-horizontal.noUi-marker-large{height:15px}.noUi-pips-vertical{padding:0 10px;height:100%;top:0;left:100%}.noUi-value-vertical{-webkit-transform:translate(0,-50%);transform:translate(0,-50%);padding-left:25px}.noUi-rtl .noUi-value-vertical{-webkit-transform:translate(0,50%);transform:translate(0,50%)}.noUi-marker-vertical.noUi-marker{width:5px;height:2px;margin-top:-1px}.noUi-marker-vertical.noUi-marker-sub{width:10px}.noUi-marker-vertical.noUi-marker-large{width:15px}.noUi-tooltip{display:block;position:absolute;border:1px solid #D9D9D9;border-radius:3px;background:#fff;color:#000;padding:5px;text-align:center;white-space:nowrap}.noUi-horizontal .noUi-tooltip{-webkit-transform:translate(-50%,0);transform:translate(-50%,0);left:50%;bottom:120%}.noUi-vertical .noUi-tooltip{-webkit-transform:translate(0,-50%);transform:translate(0,-50%);top:50%;right:120%}.noUi-horizontal .noUi-origin>.noUi-tooltip{-webkit-transform:translate(50%,0);transform:translate(50%,0);left:auto;bottom:10px}.noUi-vertical .noUi-origin>.noUi-tooltip{-webkit-transform:translate(0,-18px);transform:translate(0,-18px);top:auto;right:28px} \ No newline at end of file diff --git a/web/libraries/nouislider/nouislider.min.js b/web/libraries/nouislider/nouislider.min.js new file mode 100644 index 0000000..978a4a3 --- /dev/null +++ b/web/libraries/nouislider/nouislider.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).noUiSlider={})}(this,function(ut){"use strict";function n(t){return"object"==typeof t&&"function"==typeof t.to}function ct(t){t.parentElement.removeChild(t)}function pt(t){return null!=t}function ft(t){t.preventDefault()}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function dt(t,e,r){0=e[r];)r+=1;return r}function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=l(r,t),i=t[n-1],o=t[n],t=e[n-1],n=e[n];return t+(r=r,a(o=[i,o],o[0]<0?r+Math.abs(o[0]):r-o[0],0)/s(t,n))}function o(t,e,r,n){if(100===n)return n;var i=l(n,t),o=t[i-1],s=t[i];return r?(s-o)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,o=1,s=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),U(n,t.stepped)}(d),m={},t=S.xVal[0],e=S.xVal[S.xVal.length-1],g=!1,v=!1,b=0;return(h=h.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,o,s,a,l,u,t=t,c=h[e+1],p=d.mode===ut.PipsMode.Steps,f=(f=p?S.xNumSteps[e]:f)||c-t;for(void 0===c&&(c=t),f=Math.max(f,1e-7),r=t;r<=c;r=Number((r+f).toFixed(7))){for(a=(o=(i=S.toStepping(r))-b)/(d.density||1),u=o/(l=Math.round(a)),n=1;n<=l;n+=1)m[(s=b+n*u).toFixed(5)]=[S.fromStepping(s),0];a=-1ut.PipsType.NoValue&&((t=P(a,!1)).className=p(n,f.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[f.style]=e+"%",t.innerHTML=String(s.to(r))))}),a}function L(){s&&(ct(s),s=null)}function T(t){L();var e=D(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return s=d.appendChild(O(e,r,t))}function j(){var t=i.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||i[e]:t.height||i[e]}function z(n,i,o,s){function e(t){var e,r=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),s=0,a=0;0===e.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1=r[e-1]});if(x!==!e)return x=!x,xt(f,f.connect.map(function(t){return!t})),void at()}rt(t),rt(t+1),x&&(rt(t-1),rt(t+2))}function tt(){g.forEach(function(t){var e=50r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}function at(){for(;n.firstChild;)n.removeChild(n.firstChild);for(var t=0;t<=f.handles;t++)u[t]=N(n,f.connect[t]),rt(t);Y({drag:f.events.drag,fixed:!0})}gt(t=d,f.cssClasses.target),0===f.dir?gt(t,f.cssClasses.ltr):gt(t,f.cssClasses.rtl),0===f.ort?gt(t,f.cssClasses.horizontal):gt(t,f.cssClasses.vertical),gt(t,"rtl"===getComputedStyle(t).direction?f.cssClasses.textDirectionRtl:f.cssClasses.textDirectionLtr),i=P(t,f.cssClasses.base),function(t,e){n=P(e,f.cssClasses.connects),l=[],(u=[]).push(N(n,t[0]));for(var r=0;r=e[r];)r+=1;return r}function toStepping(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=getJ(r,t),i=t[n-1],s=t[n],t=e[n-1],n=e[n];return t+toPercentage([i,s],r)/subRangeRatio(t,n)}function fromStepping(t,e,r){if(100<=r)return t.slice(-1)[0];var n=getJ(r,e),i=t[n-1],s=t[n],t=e[n-1];return isPercentage([i,s],(r-t)*subRangeRatio(t,e[n]))}function getStep(t,e,r,n){if(100===n)return n;var i=getJ(n,t),s=t[i-1],o=t[i];return r?(o-s)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,s=1,o=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),D(n,t.stepped)}(f),m={},t=S.xVal[0],e=S.xVal[S.xVal.length-1],g=!1,v=!1,b=0;return(h=unique(h.slice().sort(function(t,e){return t-e})))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,s,o,a,l,u,t=t,c=h[e+1],p=f.mode===PipsMode.Steps,d=(d=p?S.xNumSteps[e]:d)||c-t;for(void 0===c&&(c=t),d=Math.max(d,1e-7),r=t;r<=c;r=Number((r+d).toFixed(7))){for(a=(s=(i=S.toStepping(r))-b)/(f.density||1),u=s/(l=Math.round(a)),n=1;n<=l;n+=1)m[(o=b+n*u).toFixed(5)]=[S.fromStepping(o),0];a=-1PipsType.NoValue&&((t=C(a,!1)).className=p(n,d.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[d.style]=e+"%",t.innerHTML=String(o.to(r))))}),a}function L(){i&&(removeElement(i),i=null)}function O(t){L();var e=T(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return i=p.appendChild(U(e,r,t))}function F(){var t=r.getBoundingClientRect(),e="offset"+["Width","Height"][d.ort];return 0===d.ort?t.width||r[e]:t.height||r[e]}function R(e,r,n,i){function s(t){return!!(t=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),s=0===e.type.indexOf("pointer"),o=0,a=0;0===e.type.indexOf("MSPointer")&&(s=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1=r[e-1]});if(b!==!e)return b=!b,testConnect(d,d.connect.map(function(t){return!t})),void at()}rt(t),rt(t+1),b&&(rt(t-1),rt(t+2))}function tt(){m.forEach(function(t){var e=50r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}function at(){for(;n.firstChild;)n.removeChild(n.firstChild);for(var t=0;t<=d.handles;t++)u[t]=P(n,d.connect[t]),rt(t);q({drag:d.events.drag,fixed:!0})}addClass(t=p,d.cssClasses.target),0===d.dir?addClass(t,d.cssClasses.ltr):addClass(t,d.cssClasses.rtl),0===d.ort?addClass(t,d.cssClasses.horizontal):addClass(t,d.cssClasses.vertical),addClass(t,"rtl"===getComputedStyle(t).direction?d.cssClasses.textDirectionRtl:d.cssClasses.textDirectionLtr),r=C(t,d.cssClasses.base),function(t,e){n=C(e,d.cssClasses.connects),l=[],(u=[]).push(P(n,t[0]));for(var r=0;r 0) { + addClass(element, className); + setTimeout(function () { + removeClass(element, className); + }, duration); + } +} +// Limits a value to 0 - 100 +function limit(a) { + return Math.max(Math.min(a, 100), 0); +} +// Wraps a variable as an array, if it isn't one yet. +// Note that an input array is returned by reference! +function asArray(a) { + return Array.isArray(a) ? a : [a]; +} +// Counts decimals +function countDecimals(numStr) { + numStr = String(numStr); + var pieces = numStr.split("."); + return pieces.length > 1 ? pieces[1].length : 0; +} +// http://youmightnotneedjquery.com/#add_class +function addClass(el, className) { + if (el.classList && !/\s/.test(className)) { + el.classList.add(className); + } + else { + el.className += " " + className; + } +} +// http://youmightnotneedjquery.com/#remove_class +function removeClass(el, className) { + if (el.classList && !/\s/.test(className)) { + el.classList.remove(className); + } + else { + el.className = el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " "); + } +} +// https://plainjs.com/javascript/attributes/adding-removing-and-testing-for-classes-9/ +function hasClass(el, className) { + return el.classList ? el.classList.contains(className) : new RegExp("\\b" + className + "\\b").test(el.className); +} +// https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY#Notes +function getPageOffset(doc) { + var supportPageOffset = window.pageXOffset !== undefined; + var isCSS1Compat = (doc.compatMode || "") === "CSS1Compat"; + var x = supportPageOffset + ? window.pageXOffset + : isCSS1Compat + ? doc.documentElement.scrollLeft + : doc.body.scrollLeft; + var y = supportPageOffset + ? window.pageYOffset + : isCSS1Compat + ? doc.documentElement.scrollTop + : doc.body.scrollTop; + return { + x: x, + y: y, + }; +} +// we provide a function to compute constants instead +// of accessing window.* as soon as the module needs it +// so that we do not compute anything if not needed +function getActions() { + // Determine the events to bind. IE11 implements pointerEvents without + // a prefix, which breaks compatibility with the IE10 implementation. + return window.navigator.pointerEnabled + ? { + start: "pointerdown", + move: "pointermove", + end: "pointerup", + } + : window.navigator.msPointerEnabled + ? { + start: "MSPointerDown", + move: "MSPointerMove", + end: "MSPointerUp", + } + : { + start: "mousedown touchstart", + move: "mousemove touchmove", + end: "mouseup touchend", + }; +} +// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md +// Issue #785 +function getSupportsPassive() { + var supportsPassive = false; + /* eslint-disable */ + try { + var opts = Object.defineProperty({}, "passive", { + get: function () { + supportsPassive = true; + }, + }); + // @ts-ignore + window.addEventListener("test", null, opts); + } + catch (e) { } + /* eslint-enable */ + return supportsPassive; +} +function getSupportsTouchActionNone() { + return window.CSS && CSS.supports && CSS.supports("touch-action", "none"); +} +//endregion +//region Range Calculation +// Determine the size of a sub-range in relation to a full range. +function subRangeRatio(pa, pb) { + return 100 / (pb - pa); +} +// (percentage) How many percent is this value of this range? +function fromPercentage(range, value, startRange) { + return (value * 100) / (range[startRange + 1] - range[startRange]); +} +// (percentage) Where is this value on this range? +function toPercentage(range, value) { + return fromPercentage(range, range[0] < 0 ? value + Math.abs(range[0]) : value - range[0], 0); +} +// (value) How much is this percentage on this range? +function isPercentage(range, value) { + return (value * (range[1] - range[0])) / 100 + range[0]; +} +function getJ(value, arr) { + var j = 1; + while (value >= arr[j]) { + j += 1; + } + return j; +} +// (percentage) Input a value, find where, on a scale of 0-100, it applies. +function toStepping(xVal, xPct, value) { + if (value >= xVal.slice(-1)[0]) { + return 100; + } + var j = getJ(value, xVal); + var va = xVal[j - 1]; + var vb = xVal[j]; + var pa = xPct[j - 1]; + var pb = xPct[j]; + return pa + toPercentage([va, vb], value) / subRangeRatio(pa, pb); +} +// (value) Input a percentage, find where it is on the specified range. +function fromStepping(xVal, xPct, value) { + // There is no range group that fits 100 + if (value >= 100) { + return xVal.slice(-1)[0]; + } + var j = getJ(value, xPct); + var va = xVal[j - 1]; + var vb = xVal[j]; + var pa = xPct[j - 1]; + var pb = xPct[j]; + return isPercentage([va, vb], (value - pa) * subRangeRatio(pa, pb)); +} +// (percentage) Get the step that applies at a certain value. +function getStep(xPct, xSteps, snap, value) { + if (value === 100) { + return value; + } + var j = getJ(value, xPct); + var a = xPct[j - 1]; + var b = xPct[j]; + // If 'snap' is set, steps are used as fixed points on the slider. + if (snap) { + // Find the closest position, a or b. + if (value - a > (b - a) / 2) { + return b; + } + return a; + } + if (!xSteps[j - 1]) { + return value; + } + return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]); +} +//endregion +//region Spectrum +var Spectrum = /** @class */ (function () { + function Spectrum(entry, snap, singleStep) { + this.xPct = []; + this.xVal = []; + this.xSteps = []; + this.xNumSteps = []; + this.xHighestCompleteStep = []; + this.xSteps = [singleStep || false]; + this.xNumSteps = [false]; + this.snap = snap; + var index; + var ordered = []; + // Map the object keys to an array. + Object.keys(entry).forEach(function (index) { + ordered.push([asArray(entry[index]), index]); + }); + // Sort all entries by value (numeric sort). + ordered.sort(function (a, b) { + return a[0][0] - b[0][0]; + }); + // Convert all entries to subranges. + for (index = 0; index < ordered.length; index++) { + this.handleEntryPoint(ordered[index][1], ordered[index][0]); + } + // Store the actual step values. + // xSteps is sorted in the same order as xPct and xVal. + this.xNumSteps = this.xSteps.slice(0); + // Convert all numeric steps to the percentage of the subrange they represent. + for (index = 0; index < this.xNumSteps.length; index++) { + this.handleStepPoint(index, this.xNumSteps[index]); + } + } + Spectrum.prototype.getDistance = function (value) { + var distances = []; + for (var index = 0; index < this.xNumSteps.length - 1; index++) { + distances[index] = fromPercentage(this.xVal, value, index); + } + return distances; + }; + // Calculate the percentual distance over the whole scale of ranges. + // direction: 0 = backwards / 1 = forwards + Spectrum.prototype.getAbsoluteDistance = function (value, distances, direction) { + var xPct_index = 0; + // Calculate range where to start calculation + if (value < this.xPct[this.xPct.length - 1]) { + while (value > this.xPct[xPct_index + 1]) { + xPct_index++; + } + } + else if (value === this.xPct[this.xPct.length - 1]) { + xPct_index = this.xPct.length - 2; + } + // If looking backwards and the value is exactly at a range separator then look one range further + if (!direction && value === this.xPct[xPct_index + 1]) { + xPct_index++; + } + if (distances === null) { + distances = []; + } + var start_factor; + var rest_factor = 1; + var rest_rel_distance = distances[xPct_index]; + var range_pct = 0; + var rel_range_distance = 0; + var abs_distance_counter = 0; + var range_counter = 0; + // Calculate what part of the start range the value is + if (direction) { + start_factor = (value - this.xPct[xPct_index]) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]); + } + else { + start_factor = (this.xPct[xPct_index + 1] - value) / (this.xPct[xPct_index + 1] - this.xPct[xPct_index]); + } + // Do until the complete distance across ranges is calculated + while (rest_rel_distance > 0) { + // Calculate the percentage of total range + range_pct = this.xPct[xPct_index + 1 + range_counter] - this.xPct[xPct_index + range_counter]; + // Detect if the margin, padding or limit is larger then the current range and calculate + if (distances[xPct_index + range_counter] * rest_factor + 100 - start_factor * 100 > 100) { + // If larger then take the percentual distance of the whole range + rel_range_distance = range_pct * start_factor; + // Rest factor of relative percentual distance still to be calculated + rest_factor = (rest_rel_distance - 100 * start_factor) / distances[xPct_index + range_counter]; + // Set start factor to 1 as for next range it does not apply. + start_factor = 1; + } + else { + // If smaller or equal then take the percentual distance of the calculate percentual part of that range + rel_range_distance = ((distances[xPct_index + range_counter] * range_pct) / 100) * rest_factor; + // No rest left as the rest fits in current range + rest_factor = 0; + } + if (direction) { + abs_distance_counter = abs_distance_counter - rel_range_distance; + // Limit range to first range when distance becomes outside of minimum range + if (this.xPct.length + range_counter >= 1) { + range_counter--; + } + } + else { + abs_distance_counter = abs_distance_counter + rel_range_distance; + // Limit range to last range when distance becomes outside of maximum range + if (this.xPct.length - range_counter >= 1) { + range_counter++; + } + } + // Rest of relative percentual distance still to be calculated + rest_rel_distance = distances[xPct_index + range_counter] * rest_factor; + } + return value + abs_distance_counter; + }; + Spectrum.prototype.toStepping = function (value) { + value = toStepping(this.xVal, this.xPct, value); + return value; + }; + Spectrum.prototype.fromStepping = function (value) { + return fromStepping(this.xVal, this.xPct, value); + }; + Spectrum.prototype.getStep = function (value) { + value = getStep(this.xPct, this.xSteps, this.snap, value); + return value; + }; + Spectrum.prototype.getDefaultStep = function (value, isDown, size) { + var j = getJ(value, this.xPct); + // When at the top or stepping down, look at the previous sub-range + if (value === 100 || (isDown && value === this.xPct[j - 1])) { + j = Math.max(j - 1, 1); + } + return (this.xVal[j] - this.xVal[j - 1]) / size; + }; + Spectrum.prototype.getNearbySteps = function (value) { + var j = getJ(value, this.xPct); + return { + stepBefore: { + startValue: this.xVal[j - 2], + step: this.xNumSteps[j - 2], + highestStep: this.xHighestCompleteStep[j - 2], + }, + thisStep: { + startValue: this.xVal[j - 1], + step: this.xNumSteps[j - 1], + highestStep: this.xHighestCompleteStep[j - 1], + }, + stepAfter: { + startValue: this.xVal[j], + step: this.xNumSteps[j], + highestStep: this.xHighestCompleteStep[j], + }, + }; + }; + Spectrum.prototype.countStepDecimals = function () { + var stepDecimals = this.xNumSteps.map(countDecimals); + return Math.max.apply(null, stepDecimals); + }; + Spectrum.prototype.hasNoSize = function () { + return this.xVal[0] === this.xVal[this.xVal.length - 1]; + }; + // Outside testing + Spectrum.prototype.convert = function (value) { + return this.getStep(this.toStepping(value)); + }; + Spectrum.prototype.handleEntryPoint = function (index, value) { + var percentage; + // Covert min/max syntax to 0 and 100. + if (index === "min") { + percentage = 0; + } + else if (index === "max") { + percentage = 100; + } + else { + percentage = parseFloat(index); + } + // Check for correct input. + if (!isNumeric(percentage) || !isNumeric(value[0])) { + throw new Error("noUiSlider: 'range' value isn't numeric."); + } + // Store values. + this.xPct.push(percentage); + this.xVal.push(value[0]); + var value1 = Number(value[1]); + // NaN will evaluate to false too, but to keep + // logging clear, set step explicitly. Make sure + // not to override the 'step' setting with false. + if (!percentage) { + if (!isNaN(value1)) { + this.xSteps[0] = value1; + } + } + else { + this.xSteps.push(isNaN(value1) ? false : value1); + } + this.xHighestCompleteStep.push(0); + }; + Spectrum.prototype.handleStepPoint = function (i, n) { + // Ignore 'false' stepping. + if (!n) { + return; + } + // Step over zero-length ranges (#948); + if (this.xVal[i] === this.xVal[i + 1]) { + this.xSteps[i] = this.xHighestCompleteStep[i] = this.xVal[i]; + return; + } + // Factor to range ratio + this.xSteps[i] = + fromPercentage([this.xVal[i], this.xVal[i + 1]], n, 0) / subRangeRatio(this.xPct[i], this.xPct[i + 1]); + var totalSteps = (this.xVal[i + 1] - this.xVal[i]) / this.xNumSteps[i]; + var highestStep = Math.ceil(Number(totalSteps.toFixed(3)) - 1); + var step = this.xVal[i] + this.xNumSteps[i] * highestStep; + this.xHighestCompleteStep[i] = step; + }; + return Spectrum; +}()); +//endregion +//region Options +/* Every input option is tested and parsed. This will prevent + endless validation in internal methods. These tests are + structured with an item for every option available. An + option can be marked as required by setting the 'r' flag. + The testing function is provided with three arguments: + - The provided value for the option; + - A reference to the options object; + - The name for the option; + + The testing function returns false when an error is detected, + or true when everything is OK. It can also modify the option + object, to make sure all values can be correctly looped elsewhere. */ +//region Defaults +var defaultFormatter = { + to: function (value) { + return value === undefined ? "" : value.toFixed(2); + }, + from: Number, +}; +var cssClasses = { + target: "target", + base: "base", + origin: "origin", + handle: "handle", + handleLower: "handle-lower", + handleUpper: "handle-upper", + touchArea: "touch-area", + horizontal: "horizontal", + vertical: "vertical", + background: "background", + connect: "connect", + connects: "connects", + ltr: "ltr", + rtl: "rtl", + textDirectionLtr: "txt-dir-ltr", + textDirectionRtl: "txt-dir-rtl", + draggable: "draggable", + drag: "state-drag", + tap: "state-tap", + active: "active", + tooltip: "tooltip", + pips: "pips", + pipsHorizontal: "pips-horizontal", + pipsVertical: "pips-vertical", + marker: "marker", + markerHorizontal: "marker-horizontal", + markerVertical: "marker-vertical", + markerNormal: "marker-normal", + markerLarge: "marker-large", + markerSub: "marker-sub", + value: "value", + valueHorizontal: "value-horizontal", + valueVertical: "value-vertical", + valueNormal: "value-normal", + valueLarge: "value-large", + valueSub: "value-sub", +}; +// Namespaces of internal event listeners +var INTERNAL_EVENT_NS = { + tooltips: ".__tooltips", + aria: ".__aria", +}; +//endregion +function testStep(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'step' is not numeric."); + } + // The step option can still be used to set stepping + // for linear sliders. Overwritten if set in 'range'. + parsed.singleStep = entry; +} +function testKeyboardPageMultiplier(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric."); + } + parsed.keyboardPageMultiplier = entry; +} +function testKeyboardMultiplier(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric."); + } + parsed.keyboardMultiplier = entry; +} +function testKeyboardDefaultStep(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric."); + } + parsed.keyboardDefaultStep = entry; +} +function testRange(parsed, entry) { + // Filter incorrect input. + if (typeof entry !== "object" || Array.isArray(entry)) { + throw new Error("noUiSlider: 'range' is not an object."); + } + // Catch missing start or end. + if (entry.min === undefined || entry.max === undefined) { + throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'."); + } + parsed.spectrum = new Spectrum(entry, parsed.snap || false, parsed.singleStep); +} +function testStart(parsed, entry) { + entry = asArray(entry); + // Validate input. Values aren't tested, as the public .val method + // will always provide a valid location. + if (!Array.isArray(entry) || !entry.length) { + throw new Error("noUiSlider: 'start' option is incorrect."); + } + // Store the number of handles. + parsed.handles = entry.length; + // When the slider is initialized, the .val method will + // be called with the start options. + parsed.start = entry; +} +function testSnap(parsed, entry) { + if (typeof entry !== "boolean") { + throw new Error("noUiSlider: 'snap' option must be a boolean."); + } + // Enforce 100% stepping within subranges. + parsed.snap = entry; +} +function testAnimate(parsed, entry) { + if (typeof entry !== "boolean") { + throw new Error("noUiSlider: 'animate' option must be a boolean."); + } + // Enforce 100% stepping within subranges. + parsed.animate = entry; +} +function testAnimationDuration(parsed, entry) { + if (typeof entry !== "number") { + throw new Error("noUiSlider: 'animationDuration' option must be a number."); + } + parsed.animationDuration = entry; +} +function testConnect(parsed, entry) { + var connect = [false]; + var i; + // Map legacy options + if (entry === "lower") { + entry = [true, false]; + } + else if (entry === "upper") { + entry = [false, true]; + } + // Handle boolean options + if (entry === true || entry === false) { + for (i = 1; i < parsed.handles; i++) { + connect.push(entry); + } + connect.push(false); + } + // Reject invalid input + else if (!Array.isArray(entry) || !entry.length || entry.length !== parsed.handles + 1) { + throw new Error("noUiSlider: 'connect' option doesn't match handle count."); + } + else { + connect = entry; + } + parsed.connect = connect; +} +function testOrientation(parsed, entry) { + // Set orientation to an a numerical value for easy + // array selection. + switch (entry) { + case "horizontal": + parsed.ort = 0; + break; + case "vertical": + parsed.ort = 1; + break; + default: + throw new Error("noUiSlider: 'orientation' option is invalid."); + } +} +function testMargin(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'margin' option must be numeric."); + } + // Issue #582 + if (entry === 0) { + return; + } + parsed.margin = parsed.spectrum.getDistance(entry); +} +function testLimit(parsed, entry) { + if (!isNumeric(entry)) { + throw new Error("noUiSlider: 'limit' option must be numeric."); + } + parsed.limit = parsed.spectrum.getDistance(entry); + if (!parsed.limit || parsed.handles < 2) { + throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles."); + } +} +function testPadding(parsed, entry) { + var index; + if (!isNumeric(entry) && !Array.isArray(entry)) { + throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers."); + } + if (Array.isArray(entry) && !(entry.length === 2 || isNumeric(entry[0]) || isNumeric(entry[1]))) { + throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers."); + } + if (entry === 0) { + return; + } + if (!Array.isArray(entry)) { + entry = [entry, entry]; + } + // 'getDistance' returns false for invalid values. + parsed.padding = [parsed.spectrum.getDistance(entry[0]), parsed.spectrum.getDistance(entry[1])]; + for (index = 0; index < parsed.spectrum.xNumSteps.length - 1; index++) { + // last "range" can't contain step size as it is purely an endpoint. + if (parsed.padding[0][index] < 0 || parsed.padding[1][index] < 0) { + throw new Error("noUiSlider: 'padding' option must be a positive number(s)."); + } + } + var totalPadding = entry[0] + entry[1]; + var firstValue = parsed.spectrum.xVal[0]; + var lastValue = parsed.spectrum.xVal[parsed.spectrum.xVal.length - 1]; + if (totalPadding / (lastValue - firstValue) > 1) { + throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range."); + } +} +function testDirection(parsed, entry) { + // Set direction as a numerical value for easy parsing. + // Invert connection for RTL sliders, so that the proper + // handles get the connect/background classes. + switch (entry) { + case "ltr": + parsed.dir = 0; + break; + case "rtl": + parsed.dir = 1; + break; + default: + throw new Error("noUiSlider: 'direction' option was not recognized."); + } +} +function testBehaviour(parsed, entry) { + // Make sure the input is a string. + if (typeof entry !== "string") { + throw new Error("noUiSlider: 'behaviour' must be a string containing options."); + } + // Check if the string contains any keywords. + // None are required. + var tap = entry.indexOf("tap") >= 0; + var drag = entry.indexOf("drag") >= 0; + var fixed = entry.indexOf("fixed") >= 0; + var snap = entry.indexOf("snap") >= 0; + var hover = entry.indexOf("hover") >= 0; + var unconstrained = entry.indexOf("unconstrained") >= 0; + var invertConnects = entry.indexOf("invert-connects") >= 0; + var dragAll = entry.indexOf("drag-all") >= 0; + var smoothSteps = entry.indexOf("smooth-steps") >= 0; + if (fixed) { + if (parsed.handles !== 2) { + throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles"); + } + // Use margin to enforce fixed state + testMargin(parsed, parsed.start[1] - parsed.start[0]); + } + if (invertConnects && parsed.handles !== 2) { + throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles"); + } + if (unconstrained && (parsed.margin || parsed.limit)) { + throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit"); + } + parsed.events = { + tap: tap || snap, + drag: drag, + dragAll: dragAll, + smoothSteps: smoothSteps, + fixed: fixed, + snap: snap, + hover: hover, + unconstrained: unconstrained, + invertConnects: invertConnects, + }; +} +function testTooltips(parsed, entry) { + if (entry === false) { + return; + } + if (entry === true || isValidPartialFormatter(entry)) { + parsed.tooltips = []; + for (var i = 0; i < parsed.handles; i++) { + parsed.tooltips.push(entry); + } + } + else { + entry = asArray(entry); + if (entry.length !== parsed.handles) { + throw new Error("noUiSlider: must pass a formatter for all handles."); + } + entry.forEach(function (formatter) { + if (typeof formatter !== "boolean" && !isValidPartialFormatter(formatter)) { + throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'."); + } + }); + parsed.tooltips = entry; + } +} +function testHandleAttributes(parsed, entry) { + if (entry.length !== parsed.handles) { + throw new Error("noUiSlider: must pass a attributes for all handles."); + } + parsed.handleAttributes = entry; +} +function testAriaFormat(parsed, entry) { + if (!isValidPartialFormatter(entry)) { + throw new Error("noUiSlider: 'ariaFormat' requires 'to' method."); + } + parsed.ariaFormat = entry; +} +function testFormat(parsed, entry) { + if (!isValidFormatter(entry)) { + throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods."); + } + parsed.format = entry; +} +function testKeyboardSupport(parsed, entry) { + if (typeof entry !== "boolean") { + throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean."); + } + parsed.keyboardSupport = entry; +} +function testDocumentElement(parsed, entry) { + // This is an advanced option. Passed values are used without validation. + parsed.documentElement = entry; +} +function testCssPrefix(parsed, entry) { + if (typeof entry !== "string" && entry !== false) { + throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`."); + } + parsed.cssPrefix = entry; +} +function testCssClasses(parsed, entry) { + if (typeof entry !== "object") { + throw new Error("noUiSlider: 'cssClasses' must be an object."); + } + if (typeof parsed.cssPrefix === "string") { + parsed.cssClasses = {}; + Object.keys(entry).forEach(function (key) { + parsed.cssClasses[key] = parsed.cssPrefix + entry[key]; + }); + } + else { + parsed.cssClasses = entry; + } +} +// Test all developer settings and parse to assumption-safe values. +function testOptions(options) { + // To prove a fix for #537, freeze options here. + // If the object is modified, an error will be thrown. + // Object.freeze(options); + var parsed = { + margin: null, + limit: null, + padding: null, + animate: true, + animationDuration: 300, + ariaFormat: defaultFormatter, + format: defaultFormatter, + }; + // Tests are executed in the order they are presented here. + var tests = { + step: { r: false, t: testStep }, + keyboardPageMultiplier: { r: false, t: testKeyboardPageMultiplier }, + keyboardMultiplier: { r: false, t: testKeyboardMultiplier }, + keyboardDefaultStep: { r: false, t: testKeyboardDefaultStep }, + start: { r: true, t: testStart }, + connect: { r: true, t: testConnect }, + direction: { r: true, t: testDirection }, + snap: { r: false, t: testSnap }, + animate: { r: false, t: testAnimate }, + animationDuration: { r: false, t: testAnimationDuration }, + range: { r: true, t: testRange }, + orientation: { r: false, t: testOrientation }, + margin: { r: false, t: testMargin }, + limit: { r: false, t: testLimit }, + padding: { r: false, t: testPadding }, + behaviour: { r: true, t: testBehaviour }, + ariaFormat: { r: false, t: testAriaFormat }, + format: { r: false, t: testFormat }, + tooltips: { r: false, t: testTooltips }, + keyboardSupport: { r: true, t: testKeyboardSupport }, + documentElement: { r: false, t: testDocumentElement }, + cssPrefix: { r: true, t: testCssPrefix }, + cssClasses: { r: true, t: testCssClasses }, + handleAttributes: { r: false, t: testHandleAttributes }, + }; + var defaults = { + connect: false, + direction: "ltr", + behaviour: "tap", + orientation: "horizontal", + keyboardSupport: true, + cssPrefix: "noUi-", + cssClasses: cssClasses, + keyboardPageMultiplier: 5, + keyboardMultiplier: 1, + keyboardDefaultStep: 10, + }; + // AriaFormat defaults to regular format, if any. + if (options.format && !options.ariaFormat) { + options.ariaFormat = options.format; + } + // Run all options through a testing mechanism to ensure correct + // input. It should be noted that options might get modified to + // be handled properly. E.g. wrapping integers in arrays. + Object.keys(tests).forEach(function (name) { + // If the option isn't set, but it is required, throw an error. + if (!isSet(options[name]) && defaults[name] === undefined) { + if (tests[name].r) { + throw new Error("noUiSlider: '" + name + "' is required."); + } + return; + } + tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]); + }); + // Forward pips options + parsed.pips = options.pips; + // All recent browsers accept unprefixed transform. + // We need -ms- for IE9 and -webkit- for older Android; + // Assume use of -webkit- if unprefixed and -ms- are not supported. + // https://caniuse.com/#feat=transforms2d + var d = document.createElement("div"); + var msPrefix = d.style.msTransform !== undefined; + var noPrefix = d.style.transform !== undefined; + parsed.transformRule = noPrefix ? "transform" : msPrefix ? "msTransform" : "webkitTransform"; + // Pips don't move, so we can place them using left/top. + var styles = [ + ["left", "top"], + ["right", "bottom"], + ]; + parsed.style = styles[parsed.dir][parsed.ort]; + return parsed; +} +//endregion +function scope(target, options, originalOptions) { + var actions = getActions(); + var supportsTouchActionNone = getSupportsTouchActionNone(); + var supportsPassive = supportsTouchActionNone && getSupportsPassive(); + // All variables local to 'scope' are prefixed with 'scope_' + // Slider DOM Nodes + var scope_Target = target; + var scope_Base; + var scope_ConnectBase; + var scope_Handles; + var scope_Connects; + var scope_Pips; + var scope_Tooltips; + // Slider state values + var scope_Spectrum = options.spectrum; + var scope_Values = []; + var scope_Locations = []; + var scope_HandleNumbers = []; + var scope_ActiveHandlesCount = 0; + var scope_Events = {}; + var scope_ConnectsInverted = false; + // Document Nodes + var scope_Document = target.ownerDocument; + var scope_DocumentElement = options.documentElement || scope_Document.documentElement; + var scope_Body = scope_Document.body; + // For horizontal sliders in standard ltr documents, + // make .noUi-origin overflow to the left so the document doesn't scroll. + var scope_DirOffset = scope_Document.dir === "rtl" || options.ort === 1 ? 0 : 100; + // Creates a node, adds it to target, returns the new node. + function addNodeTo(addTarget, className) { + var div = scope_Document.createElement("div"); + if (className) { + addClass(div, className); + } + addTarget.appendChild(div); + return div; + } + // Append a origin to the base + function addOrigin(base, handleNumber) { + var origin = addNodeTo(base, options.cssClasses.origin); + var handle = addNodeTo(origin, options.cssClasses.handle); + addNodeTo(handle, options.cssClasses.touchArea); + handle.setAttribute("data-handle", String(handleNumber)); + if (options.keyboardSupport) { + // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex + // 0 = focusable and reachable + handle.setAttribute("tabindex", "0"); + handle.addEventListener("keydown", function (event) { + return eventKeydown(event, handleNumber); + }); + } + if (options.handleAttributes !== undefined) { + var attributes_1 = options.handleAttributes[handleNumber]; + Object.keys(attributes_1).forEach(function (attribute) { + handle.setAttribute(attribute, attributes_1[attribute]); + }); + } + handle.setAttribute("role", "slider"); + handle.setAttribute("aria-orientation", options.ort ? "vertical" : "horizontal"); + if (handleNumber === 0) { + addClass(handle, options.cssClasses.handleLower); + } + else if (handleNumber === options.handles - 1) { + addClass(handle, options.cssClasses.handleUpper); + } + origin.handle = handle; + return origin; + } + // Insert nodes for connect elements + function addConnect(base, add) { + if (!add) { + return false; + } + return addNodeTo(base, options.cssClasses.connect); + } + // Add handles to the slider base. + function addElements(connectOptions, base) { + scope_ConnectBase = addNodeTo(base, options.cssClasses.connects); + scope_Handles = []; + scope_Connects = []; + scope_Connects.push(addConnect(scope_ConnectBase, connectOptions[0])); + // [::::O====O====O====] + // connectOptions = [0, 1, 1, 1] + for (var i = 0; i < options.handles; i++) { + // Keep a list of all added handles. + scope_Handles.push(addOrigin(base, i)); + scope_HandleNumbers[i] = i; + scope_Connects.push(addConnect(scope_ConnectBase, connectOptions[i + 1])); + } + } + // Initialize a single slider. + function addSlider(addTarget) { + // Apply classes and data to the target. + addClass(addTarget, options.cssClasses.target); + if (options.dir === 0) { + addClass(addTarget, options.cssClasses.ltr); + } + else { + addClass(addTarget, options.cssClasses.rtl); + } + if (options.ort === 0) { + addClass(addTarget, options.cssClasses.horizontal); + } + else { + addClass(addTarget, options.cssClasses.vertical); + } + var textDirection = getComputedStyle(addTarget).direction; + if (textDirection === "rtl") { + addClass(addTarget, options.cssClasses.textDirectionRtl); + } + else { + addClass(addTarget, options.cssClasses.textDirectionLtr); + } + return addNodeTo(addTarget, options.cssClasses.base); + } + function addTooltip(handle, handleNumber) { + if (!options.tooltips || !options.tooltips[handleNumber]) { + return false; + } + return addNodeTo(handle.firstChild, options.cssClasses.tooltip); + } + function isSliderDisabled() { + return scope_Target.hasAttribute("disabled"); + } + // Disable the slider dragging if any handle is disabled + function isHandleDisabled(handleNumber) { + var handleOrigin = scope_Handles[handleNumber]; + return handleOrigin.hasAttribute("disabled"); + } + function disable(handleNumber) { + if (handleNumber !== null && handleNumber !== undefined) { + scope_Handles[handleNumber].setAttribute("disabled", ""); + scope_Handles[handleNumber].handle.removeAttribute("tabindex"); + } + else { + scope_Target.setAttribute("disabled", ""); + scope_Handles.forEach(function (handle) { + handle.handle.removeAttribute("tabindex"); + }); + } + } + function enable(handleNumber) { + if (handleNumber !== null && handleNumber !== undefined) { + scope_Handles[handleNumber].removeAttribute("disabled"); + scope_Handles[handleNumber].handle.setAttribute("tabindex", "0"); + } + else { + scope_Target.removeAttribute("disabled"); + scope_Handles.forEach(function (handle) { + handle.removeAttribute("disabled"); + handle.handle.setAttribute("tabindex", "0"); + }); + } + } + function removeTooltips() { + if (scope_Tooltips) { + removeEvent("update" + INTERNAL_EVENT_NS.tooltips); + scope_Tooltips.forEach(function (tooltip) { + if (tooltip) { + removeElement(tooltip); + } + }); + scope_Tooltips = null; + } + } + // The tooltips option is a shorthand for using the 'update' event. + function tooltips() { + removeTooltips(); + // Tooltips are added with options.tooltips in original order. + scope_Tooltips = scope_Handles.map(addTooltip); + bindEvent("update" + INTERNAL_EVENT_NS.tooltips, function (values, handleNumber, unencoded) { + if (!scope_Tooltips || !options.tooltips) { + return; + } + if (scope_Tooltips[handleNumber] === false) { + return; + } + var formattedValue = values[handleNumber]; + if (options.tooltips[handleNumber] !== true) { + formattedValue = options.tooltips[handleNumber].to(unencoded[handleNumber]); + } + scope_Tooltips[handleNumber].innerHTML = formattedValue; + }); + } + function aria() { + removeEvent("update" + INTERNAL_EVENT_NS.aria); + bindEvent("update" + INTERNAL_EVENT_NS.aria, function (values, handleNumber, unencoded, tap, positions) { + // Update Aria Values for all handles, as a change in one changes min and max values for the next. + scope_HandleNumbers.forEach(function (index) { + var handle = scope_Handles[index]; + var min = checkHandlePosition(scope_Locations, index, 0, true, true, true); + var max = checkHandlePosition(scope_Locations, index, 100, true, true, true); + var now = positions[index]; + // Formatted value for display + var text = String(options.ariaFormat.to(unencoded[index])); + // Map to slider range values + min = scope_Spectrum.fromStepping(min).toFixed(1); + max = scope_Spectrum.fromStepping(max).toFixed(1); + now = scope_Spectrum.fromStepping(now).toFixed(1); + handle.children[0].setAttribute("aria-valuemin", min); + handle.children[0].setAttribute("aria-valuemax", max); + handle.children[0].setAttribute("aria-valuenow", now); + handle.children[0].setAttribute("aria-valuetext", text); + }); + }); + } + function getGroup(pips) { + // Use the range. + if (pips.mode === PipsMode.Range || pips.mode === PipsMode.Steps) { + return scope_Spectrum.xVal; + } + if (pips.mode === PipsMode.Count) { + if (pips.values < 2) { + throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'."); + } + // Divide 0 - 100 in 'count' parts. + var interval = pips.values - 1; + var spread = 100 / interval; + var values = []; + // List these parts and have them handled as 'positions'. + while (interval--) { + values[interval] = interval * spread; + } + values.push(100); + return mapToRange(values, pips.stepped); + } + if (pips.mode === PipsMode.Positions) { + // Map all percentages to on-range values. + return mapToRange(pips.values, pips.stepped); + } + if (pips.mode === PipsMode.Values) { + // If the value must be stepped, it needs to be converted to a percentage first. + if (pips.stepped) { + return pips.values.map(function (value) { + // Convert to percentage, apply step, return to value. + return scope_Spectrum.fromStepping(scope_Spectrum.getStep(scope_Spectrum.toStepping(value))); + }); + } + // Otherwise, we can simply use the values. + return pips.values; + } + return []; // pips.mode = never + } + function mapToRange(values, stepped) { + return values.map(function (value) { + return scope_Spectrum.fromStepping(stepped ? scope_Spectrum.getStep(value) : value); + }); + } + function generateSpread(pips) { + function safeIncrement(value, increment) { + // Avoid floating point variance by dropping the smallest decimal places. + return Number((value + increment).toFixed(7)); + } + var group = getGroup(pips); + var indexes = {}; + var firstInRange = scope_Spectrum.xVal[0]; + var lastInRange = scope_Spectrum.xVal[scope_Spectrum.xVal.length - 1]; + var ignoreFirst = false; + var ignoreLast = false; + var prevPct = 0; + // Create a copy of the group, sort it and filter away all duplicates. + group = unique(group.slice().sort(function (a, b) { + return a - b; + })); + // Make sure the range starts with the first element. + if (group[0] !== firstInRange) { + group.unshift(firstInRange); + ignoreFirst = true; + } + // Likewise for the last one. + if (group[group.length - 1] !== lastInRange) { + group.push(lastInRange); + ignoreLast = true; + } + group.forEach(function (current, index) { + // Get the current step and the lower + upper positions. + var step; + var i; + var q; + var low = current; + var high = group[index + 1]; + var newPct; + var pctDifference; + var pctPos; + var type; + var steps; + var realSteps; + var stepSize; + var isSteps = pips.mode === PipsMode.Steps; + // When using 'steps' mode, use the provided steps. + // Otherwise, we'll step on to the next subrange. + if (isSteps) { + step = scope_Spectrum.xNumSteps[index]; + } + // Default to a 'full' step. + if (!step) { + step = high - low; + } + // If high is undefined we are at the last subrange. Make sure it iterates once (#1088) + if (high === undefined) { + high = low; + } + // Make sure step isn't 0, which would cause an infinite loop (#654) + step = Math.max(step, 0.0000001); + // Find all steps in the subrange. + for (i = low; i <= high; i = safeIncrement(i, step)) { + // Get the percentage value for the current step, + // calculate the size for the subrange. + newPct = scope_Spectrum.toStepping(i); + pctDifference = newPct - prevPct; + steps = pctDifference / (pips.density || 1); + realSteps = Math.round(steps); + // This ratio represents the amount of percentage-space a point indicates. + // For a density 1 the points/percentage = 1. For density 2, that percentage needs to be re-divided. + // Round the percentage offset to an even number, then divide by two + // to spread the offset on both sides of the range. + stepSize = pctDifference / realSteps; + // Divide all points evenly, adding the correct number to this subrange. + // Run up to <= so that 100% gets a point, event if ignoreLast is set. + for (q = 1; q <= realSteps; q += 1) { + // The ratio between the rounded value and the actual size might be ~1% off. + // Correct the percentage offset by the number of points + // per subrange. density = 1 will result in 100 points on the + // full range, 2 for 50, 4 for 25, etc. + pctPos = prevPct + q * stepSize; + indexes[pctPos.toFixed(5)] = [scope_Spectrum.fromStepping(pctPos), 0]; + } + // Determine the point type. + type = group.indexOf(i) > -1 ? PipsType.LargeValue : isSteps ? PipsType.SmallValue : PipsType.NoValue; + // Enforce the 'ignoreFirst' option by overwriting the type for 0. + if (!index && ignoreFirst && i !== high) { + type = 0; + } + if (!(i === high && ignoreLast)) { + // Mark the 'type' of this point. 0 = plain, 1 = real value, 2 = step value. + indexes[newPct.toFixed(5)] = [i, type]; + } + // Update the percentage count. + prevPct = newPct; + } + }); + return indexes; + } + function addMarking(spread, filterFunc, formatter) { + var _a, _b; + var element = scope_Document.createElement("div"); + var valueSizeClasses = (_a = {}, + _a[PipsType.None] = "", + _a[PipsType.NoValue] = options.cssClasses.valueNormal, + _a[PipsType.LargeValue] = options.cssClasses.valueLarge, + _a[PipsType.SmallValue] = options.cssClasses.valueSub, + _a); + var markerSizeClasses = (_b = {}, + _b[PipsType.None] = "", + _b[PipsType.NoValue] = options.cssClasses.markerNormal, + _b[PipsType.LargeValue] = options.cssClasses.markerLarge, + _b[PipsType.SmallValue] = options.cssClasses.markerSub, + _b); + var valueOrientationClasses = [options.cssClasses.valueHorizontal, options.cssClasses.valueVertical]; + var markerOrientationClasses = [options.cssClasses.markerHorizontal, options.cssClasses.markerVertical]; + addClass(element, options.cssClasses.pips); + addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical); + function getClasses(type, source) { + var a = source === options.cssClasses.value; + var orientationClasses = a ? valueOrientationClasses : markerOrientationClasses; + var sizeClasses = a ? valueSizeClasses : markerSizeClasses; + return source + " " + orientationClasses[options.ort] + " " + sizeClasses[type]; + } + function addSpread(offset, value, type) { + // Apply the filter function, if it is set. + type = filterFunc ? filterFunc(value, type) : type; + if (type === PipsType.None) { + return; + } + // Add a marker for every point + var node = addNodeTo(element, false); + node.className = getClasses(type, options.cssClasses.marker); + node.style[options.style] = offset + "%"; + // Values are only appended for points marked '1' or '2'. + if (type > PipsType.NoValue) { + node = addNodeTo(element, false); + node.className = getClasses(type, options.cssClasses.value); + node.setAttribute("data-value", String(value)); + node.style[options.style] = offset + "%"; + node.innerHTML = String(formatter.to(value)); + } + } + // Append all points. + Object.keys(spread).forEach(function (offset) { + addSpread(offset, spread[offset][0], spread[offset][1]); + }); + return element; + } + function removePips() { + if (scope_Pips) { + removeElement(scope_Pips); + scope_Pips = null; + } + } + function pips(pips) { + // Fix #669 + removePips(); + var spread = generateSpread(pips); + var filter = pips.filter; + var format = pips.format || { + to: function (value) { + return String(Math.round(value)); + }, + }; + scope_Pips = scope_Target.appendChild(addMarking(spread, filter, format)); + return scope_Pips; + } + // Shorthand for base dimensions. + function baseSize() { + var rect = scope_Base.getBoundingClientRect(); + var alt = ("offset" + ["Width", "Height"][options.ort]); + return options.ort === 0 ? rect.width || scope_Base[alt] : rect.height || scope_Base[alt]; + } + // Handler for attaching events trough a proxy. + function attachEvent(events, element, callback, data) { + // This function can be used to 'filter' events to the slider. + // element is a node, not a nodeList + var method = function (event) { + var e = fixEvent(event, data.pageOffset, data.target || element); + // fixEvent returns false if this event has a different target + // when handling (multi-) touch events; + if (!e) { + return false; + } + // doNotReject is passed by all end events to make sure released touches + // are not rejected, leaving the slider "stuck" to the cursor; + if (isSliderDisabled() && !data.doNotReject) { + return false; + } + // Stop if an active 'tap' transition is taking place. + if (hasClass(scope_Target, options.cssClasses.tap) && !data.doNotReject) { + return false; + } + // Ignore right or middle clicks on start #454 + if (events === actions.start && e.buttons !== undefined && e.buttons > 1) { + return false; + } + // Ignore right or middle clicks on start #454 + if (data.hover && e.buttons) { + return false; + } + // 'supportsPassive' is only true if a browser also supports touch-action: none in CSS. + // iOS safari does not, so it doesn't get to benefit from passive scrolling. iOS does support + // touch-action: manipulation, but that allows panning, which breaks + // sliders after zooming/on non-responsive pages. + // See: https://bugs.webkit.org/show_bug.cgi?id=133112 + if (!supportsPassive) { + e.preventDefault(); + } + e.calcPoint = e.points[options.ort]; + // Call the event handler with the event [ and additional data ]. + callback(e, data); + return; + }; + var methods = []; + // Bind a closure on the target for every event type. + events.split(" ").forEach(function (eventName) { + element.addEventListener(eventName, method, supportsPassive ? { passive: true } : false); + methods.push([eventName, method]); + }); + return methods; + } + // Provide a clean event with standardized offset values. + function fixEvent(e, pageOffset, eventTarget) { + // Filter the event to register the type, which can be + // touch, mouse or pointer. Offset changes need to be + // made on an event specific basis. + var touch = e.type.indexOf("touch") === 0; + var mouse = e.type.indexOf("mouse") === 0; + var pointer = e.type.indexOf("pointer") === 0; + var x = 0; + var y = 0; + // IE10 implemented pointer events with a prefix; + if (e.type.indexOf("MSPointer") === 0) { + pointer = true; + } + // Erroneous events seem to be passed in occasionally on iOS/iPadOS after user finishes interacting with + // the slider. They appear to be of type MouseEvent, yet they don't have usual properties set. Ignore + // events that have no touches or buttons associated with them. (#1057, #1079, #1095) + if (e.type === "mousedown" && !e.buttons && !e.touches) { + return false; + } + // The only thing one handle should be concerned about is the touches that originated on top of it. + if (touch) { + // Returns true if a touch originated on the target. + var isTouchOnTarget = function (checkTouch) { + var target = checkTouch.target; + return (target === eventTarget || + eventTarget.contains(target) || + (e.composed && e.composedPath().shift() === eventTarget)); + }; + // In the case of touchstart events, we need to make sure there is still no more than one + // touch on the target so we look amongst all touches. + if (e.type === "touchstart") { + var targetTouches = Array.prototype.filter.call(e.touches, isTouchOnTarget); + // Do not support more than one touch per handle. + if (targetTouches.length > 1) { + return false; + } + x = targetTouches[0].pageX; + y = targetTouches[0].pageY; + } + else { + // In the other cases, find on changedTouches is enough. + var targetTouch = Array.prototype.find.call(e.changedTouches, isTouchOnTarget); + // Cancel if the target touch has not moved. + if (!targetTouch) { + return false; + } + x = targetTouch.pageX; + y = targetTouch.pageY; + } + } + pageOffset = pageOffset || getPageOffset(scope_Document); + if (mouse || pointer) { + x = e.clientX + pageOffset.x; + y = e.clientY + pageOffset.y; + } + e.pageOffset = pageOffset; + e.points = [x, y]; + e.cursor = mouse || pointer; // Fix #435 + return e; + } + // Translate a coordinate in the document to a percentage on the slider + function calcPointToPercentage(calcPoint) { + var location = calcPoint - offset(scope_Base, options.ort); + var proposal = (location * 100) / baseSize(); + // Clamp proposal between 0% and 100% + // Out-of-bound coordinates may occur when .noUi-base pseudo-elements + // are used (e.g. contained handles feature) + proposal = limit(proposal); + return options.dir ? 100 - proposal : proposal; + } + // Find handle closest to a certain percentage on the slider + function getClosestHandle(clickedPosition) { + var smallestDifference = 100; + var handleNumber = false; + scope_Handles.forEach(function (handle, index) { + // Disabled handles are ignored + if (isHandleDisabled(index)) { + return; + } + var handlePosition = scope_Locations[index]; + var differenceWithThisHandle = Math.abs(handlePosition - clickedPosition); + // Initial state + var clickAtEdge = differenceWithThisHandle === 100 && smallestDifference === 100; + // Difference with this handle is smaller than the previously checked handle + var isCloser = differenceWithThisHandle < smallestDifference; + var isCloserAfter = differenceWithThisHandle <= smallestDifference && clickedPosition > handlePosition; + if (isCloser || isCloserAfter || clickAtEdge) { + handleNumber = index; + smallestDifference = differenceWithThisHandle; + } + }); + return handleNumber; + } + // Fire 'end' when a mouse or pen leaves the document. + function documentLeave(event, data) { + if (event.type === "mouseout" && + event.target.nodeName === "HTML" && + event.relatedTarget === null) { + eventEnd(event, data); + } + } + // Handle movement on document for handle and range drag. + function eventMove(event, data) { + // Fix #498 + // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty). + // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero + // IE9 has .buttons and .which zero on mousemove. + // Firefox breaks the spec MDN defines. + if (navigator.appVersion.indexOf("MSIE 9") === -1 && event.buttons === 0 && data.buttonsProperty !== 0) { + return eventEnd(event, data); + } + // Check if we are moving up or down + var movement = (options.dir ? -1 : 1) * (event.calcPoint - data.startCalcPoint); + // Convert the movement into a percentage of the slider width/height + var proposal = (movement * 100) / data.baseSize; + moveHandles(movement > 0, proposal, data.locations, data.handleNumbers, data.connect); + } + // Unbind move events on document, call callbacks. + function eventEnd(event, data) { + // The handle is no longer active, so remove the class. + if (data.handle) { + removeClass(data.handle, options.cssClasses.active); + scope_ActiveHandlesCount -= 1; + } + // Unbind the move and end events, which are added on 'start'. + data.listeners.forEach(function (c) { + scope_DocumentElement.removeEventListener(c[0], c[1]); + }); + if (scope_ActiveHandlesCount === 0) { + // Remove dragging class. + removeClass(scope_Target, options.cssClasses.drag); + setZindex(); + // Remove cursor styles and text-selection events bound to the body. + if (event.cursor) { + scope_Body.style.cursor = ""; + scope_Body.removeEventListener("selectstart", preventDefault); + } + } + if (options.events.smoothSteps) { + data.handleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, scope_Locations[handleNumber], true, true, false, false); + }); + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + }); + } + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("change", handleNumber); + fireEvent("set", handleNumber); + fireEvent("end", handleNumber); + }); + } + // Bind move events on document. + function eventStart(event, data) { + // Ignore event if any handle is disabled + if (data.handleNumbers.some(isHandleDisabled)) { + return; + } + var handle; + if (data.handleNumbers.length === 1) { + var handleOrigin = scope_Handles[data.handleNumbers[0]]; + handle = handleOrigin.children[0]; + scope_ActiveHandlesCount += 1; + // Mark the handle as 'active' so it can be styled. + addClass(handle, options.cssClasses.active); + } + // A drag should never propagate up to the 'tap' event. + event.stopPropagation(); + // Record the event listeners. + var listeners = []; + // Attach the move and end events. + var moveEvent = attachEvent(actions.move, scope_DocumentElement, eventMove, { + // The event target has changed so we need to propagate the original one so that we keep + // relying on it to extract target touches. + target: event.target, + handle: handle, + connect: data.connect, + listeners: listeners, + startCalcPoint: event.calcPoint, + baseSize: baseSize(), + pageOffset: event.pageOffset, + handleNumbers: data.handleNumbers, + buttonsProperty: event.buttons, + locations: scope_Locations.slice(), + }); + var endEvent = attachEvent(actions.end, scope_DocumentElement, eventEnd, { + target: event.target, + handle: handle, + listeners: listeners, + doNotReject: true, + handleNumbers: data.handleNumbers, + }); + var outEvent = attachEvent("mouseout", scope_DocumentElement, documentLeave, { + target: event.target, + handle: handle, + listeners: listeners, + doNotReject: true, + handleNumbers: data.handleNumbers, + }); + // We want to make sure we pushed the listeners in the listener list rather than creating + // a new one as it has already been passed to the event handlers. + listeners.push.apply(listeners, moveEvent.concat(endEvent, outEvent)); + // Text selection isn't an issue on touch devices, + // so adding cursor styles can be skipped. + if (event.cursor) { + // Prevent the 'I' cursor and extend the range-drag cursor. + scope_Body.style.cursor = getComputedStyle(event.target).cursor; + // Mark the target with a dragging state. + if (scope_Handles.length > 1) { + addClass(scope_Target, options.cssClasses.drag); + } + // Prevent text selection when dragging the handles. + // In noUiSlider <= 9.2.0, this was handled by calling preventDefault on mouse/touch start/move, + // which is scroll blocking. The selectstart event is supported by FireFox starting from version 52, + // meaning the only holdout is iOS Safari. This doesn't matter: text selection isn't triggered there. + // The 'cursor' flag is false. + // See: http://caniuse.com/#search=selectstart + scope_Body.addEventListener("selectstart", preventDefault, false); + } + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("start", handleNumber); + }); + } + // Move closest handle to tapped location. + function eventTap(event) { + // The tap event shouldn't propagate up + event.stopPropagation(); + var proposal = calcPointToPercentage(event.calcPoint); + var handleNumber = getClosestHandle(proposal); + // Tackle the case that all handles are 'disabled'. + if (handleNumber === false) { + return; + } + // Flag the slider as it is now in a transitional state. + // Transition takes a configurable amount of ms (default 300). Re-enable the slider after that. + if (!options.events.snap) { + addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration); + } + setHandle(handleNumber, proposal, true, true); + setZindex(); + fireEvent("slide", handleNumber, true); + fireEvent("update", handleNumber, true); + if (!options.events.snap) { + fireEvent("change", handleNumber, true); + fireEvent("set", handleNumber, true); + } + else { + eventStart(event, { handleNumbers: [handleNumber] }); + } + } + // Fires a 'hover' event for a hovered mouse/pen position. + function eventHover(event) { + var proposal = calcPointToPercentage(event.calcPoint); + var to = scope_Spectrum.getStep(proposal); + var value = scope_Spectrum.fromStepping(to); + Object.keys(scope_Events).forEach(function (targetEvent) { + if ("hover" === targetEvent.split(".")[0]) { + scope_Events[targetEvent].forEach(function (callback) { + callback.call(scope_Self, value); + }); + } + }); + } + // Handles keydown on focused handles + // Don't move the document when pressing arrow keys on focused handles + function eventKeydown(event, handleNumber) { + if (isSliderDisabled() || isHandleDisabled(handleNumber)) { + return false; + } + var horizontalKeys = ["Left", "Right"]; + var verticalKeys = ["Down", "Up"]; + var largeStepKeys = ["PageDown", "PageUp"]; + var edgeKeys = ["Home", "End"]; + if (options.dir && !options.ort) { + // On an right-to-left slider, the left and right keys act inverted + horizontalKeys.reverse(); + } + else if (options.ort && !options.dir) { + // On a top-to-bottom slider, the up and down keys act inverted + verticalKeys.reverse(); + largeStepKeys.reverse(); + } + // Strip "Arrow" for IE compatibility. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key + var key = event.key.replace("Arrow", ""); + var isLargeDown = key === largeStepKeys[0]; + var isLargeUp = key === largeStepKeys[1]; + var isDown = key === verticalKeys[0] || key === horizontalKeys[0] || isLargeDown; + var isUp = key === verticalKeys[1] || key === horizontalKeys[1] || isLargeUp; + var isMin = key === edgeKeys[0]; + var isMax = key === edgeKeys[1]; + if (!isDown && !isUp && !isMin && !isMax) { + return true; + } + event.preventDefault(); + var to; + if (isUp || isDown) { + var direction = isDown ? 0 : 1; + var steps = getNextStepsForHandle(handleNumber); + var step = steps[direction]; + // At the edge of a slider, do nothing + if (step === null) { + return false; + } + // No step set, use the default of 10% of the sub-range + if (step === false) { + step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, options.keyboardDefaultStep); + } + if (isLargeUp || isLargeDown) { + step *= options.keyboardPageMultiplier; + } + else { + step *= options.keyboardMultiplier; + } + // Step over zero-length ranges (#948); + step = Math.max(step, 0.0000001); + // Decrement for down steps + step = (isDown ? -1 : 1) * step; + to = scope_Values[handleNumber] + step; + } + else if (isMax) { + // End key + to = options.spectrum.xVal[options.spectrum.xVal.length - 1]; + } + else { + // Home key + to = options.spectrum.xVal[0]; + } + setHandle(handleNumber, scope_Spectrum.toStepping(to), true, true); + fireEvent("slide", handleNumber); + fireEvent("update", handleNumber); + fireEvent("change", handleNumber); + fireEvent("set", handleNumber); + return false; + } + // Attach events to several slider parts. + function bindSliderEvents(behaviour) { + // Attach the standard drag event to the handles. + if (!behaviour.fixed) { + scope_Handles.forEach(function (handle, index) { + // These events are only bound to the visual handle + // element, not the 'real' origin element. + attachEvent(actions.start, handle.children[0], eventStart, { + handleNumbers: [index], + }); + }); + } + // Attach the tap event to the slider base. + if (behaviour.tap) { + attachEvent(actions.start, scope_Base, eventTap, {}); + } + // Fire hover events + if (behaviour.hover) { + attachEvent(actions.move, scope_Base, eventHover, { + hover: true, + }); + } + // Make the range draggable. + if (behaviour.drag) { + scope_Connects.forEach(function (connect, index) { + if (connect === false || index === 0 || index === scope_Connects.length - 1) { + return; + } + var handleBefore = scope_Handles[index - 1]; + var handleAfter = scope_Handles[index]; + var eventHolders = [connect]; + var handlesToDrag = [handleBefore, handleAfter]; + var handleNumbersToDrag = [index - 1, index]; + addClass(connect, options.cssClasses.draggable); + // When the range is fixed, the entire range can + // be dragged by the handles. The handle in the first + // origin will propagate the start event upward, + // but it needs to be bound manually on the other. + if (behaviour.fixed) { + eventHolders.push(handleBefore.children[0]); + eventHolders.push(handleAfter.children[0]); + } + if (behaviour.dragAll) { + handlesToDrag = scope_Handles; + handleNumbersToDrag = scope_HandleNumbers; + } + eventHolders.forEach(function (eventHolder) { + attachEvent(actions.start, eventHolder, eventStart, { + handles: handlesToDrag, + handleNumbers: handleNumbersToDrag, + connect: connect, + }); + }); + }); + } + } + // Attach an event to this slider, possibly including a namespace + function bindEvent(namespacedEvent, callback) { + scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || []; + scope_Events[namespacedEvent].push(callback); + // If the event bound is 'update,' fire it immediately for all handles. + if (namespacedEvent.split(".")[0] === "update") { + scope_Handles.forEach(function (a, index) { + fireEvent("update", index); + }); + } + } + function isInternalNamespace(namespace) { + return namespace === INTERNAL_EVENT_NS.aria || namespace === INTERNAL_EVENT_NS.tooltips; + } + // Undo attachment of event + function removeEvent(namespacedEvent) { + var event = namespacedEvent && namespacedEvent.split(".")[0]; + var namespace = event ? namespacedEvent.substring(event.length) : namespacedEvent; + Object.keys(scope_Events).forEach(function (bind) { + var tEvent = bind.split(".")[0]; + var tNamespace = bind.substring(tEvent.length); + if ((!event || event === tEvent) && (!namespace || namespace === tNamespace)) { + // only delete protected internal event if intentional + if (!isInternalNamespace(tNamespace) || namespace === tNamespace) { + delete scope_Events[bind]; + } + } + }); + } + // External event handling + function fireEvent(eventName, handleNumber, tap) { + Object.keys(scope_Events).forEach(function (targetEvent) { + var eventType = targetEvent.split(".")[0]; + if (eventName === eventType) { + scope_Events[targetEvent].forEach(function (callback) { + callback.call( + // Use the slider public API as the scope ('this') + scope_Self, + // Return values as array, so arg_1[arg_2] is always valid. + scope_Values.map(options.format.to), + // Handle index, 0 or 1 + handleNumber, + // Un-formatted slider values + scope_Values.slice(), + // Event is fired by tap, true or false + tap || false, + // Left offset of the handle, in relation to the slider + scope_Locations.slice(), + // add the slider public API to an accessible parameter when this is unavailable + scope_Self); + }); + } + }); + } + // Split out the handle positioning logic so the Move event can use it, too + function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue, smoothSteps) { + var distance; + // For sliders with multiple handles, limit movement to the other handle. + // Apply the margin option by adding it to the handle positions. + if (scope_Handles.length > 1 && !options.events.unconstrained) { + if (lookBackward && handleNumber > 0) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.margin, false); + to = Math.max(to, distance); + } + if (lookForward && handleNumber < scope_Handles.length - 1) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.margin, true); + to = Math.min(to, distance); + } + } + // The limit option has the opposite effect, limiting handles to a + // maximum distance from another. Limit must be > 0, as otherwise + // handles would be unmovable. + if (scope_Handles.length > 1 && options.limit) { + if (lookBackward && handleNumber > 0) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber - 1], options.limit, false); + to = Math.min(to, distance); + } + if (lookForward && handleNumber < scope_Handles.length - 1) { + distance = scope_Spectrum.getAbsoluteDistance(reference[handleNumber + 1], options.limit, true); + to = Math.max(to, distance); + } + } + // The padding option keeps the handles a certain distance from the + // edges of the slider. Padding must be > 0. + if (options.padding) { + if (handleNumber === 0) { + distance = scope_Spectrum.getAbsoluteDistance(0, options.padding[0], false); + to = Math.max(to, distance); + } + if (handleNumber === scope_Handles.length - 1) { + distance = scope_Spectrum.getAbsoluteDistance(100, options.padding[1], true); + to = Math.min(to, distance); + } + } + if (!smoothSteps) { + to = scope_Spectrum.getStep(to); + } + // Limit percentage to the 0 - 100 range + to = limit(to); + // Return false if handle can't move + if (to === reference[handleNumber] && !getValue) { + return false; + } + return to; + } + // Uses slider orientation to create CSS rules. a = base value; + function inRuleOrder(v, a) { + var o = options.ort; + return (o ? a : v) + ", " + (o ? v : a); + } + // Moves handle(s) by a percentage + // (bool, % to move, [% where handle started, ...], [index in scope_Handles, ...]) + function moveHandles(upward, proposal, locations, handleNumbers, connect) { + var proposals = locations.slice(); + // Store first handle now, so we still have it in case handleNumbers is reversed + var firstHandle = handleNumbers[0]; + var smoothSteps = options.events.smoothSteps; + var b = [!upward, upward]; + var f = [upward, !upward]; + // Copy handleNumbers so we don't change the dataset + handleNumbers = handleNumbers.slice(); + // Check to see which handle is 'leading'. + // If that one can't move the second can't either. + if (upward) { + handleNumbers.reverse(); + } + // Step 1: get the maximum percentage that any of the handles can move + if (handleNumbers.length > 1) { + handleNumbers.forEach(function (handleNumber, o) { + var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false, smoothSteps); + // Stop if one of the handles can't move. + if (to === false) { + proposal = 0; + } + else { + proposal = to - proposals[handleNumber]; + proposals[handleNumber] = to; + } + }); + } + // If using one handle, check backward AND forward + else { + b = f = [true]; + } + var state = false; + // Step 2: Try to set the handles with the found percentage + handleNumbers.forEach(function (handleNumber, o) { + state = + setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o], false, smoothSteps) || state; + }); + // Step 3: If a handle moved, fire events + if (state) { + handleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + fireEvent("slide", handleNumber); + }); + // If target is a connect, then fire drag event + if (connect != undefined) { + fireEvent("drag", firstHandle); + } + } + } + // Takes a base value and an offset. This offset is used for the connect bar size. + // In the initial design for this feature, the origin element was 1% wide. + // Unfortunately, a rounding bug in Chrome makes it impossible to implement this feature + // in this manner: https://bugs.chromium.org/p/chromium/issues/detail?id=798223 + function transformDirection(a, b) { + return options.dir ? 100 - a - b : a; + } + // Updates scope_Locations and scope_Values, updates visual state + function updateHandlePosition(handleNumber, to) { + // Update locations. + scope_Locations[handleNumber] = to; + // Convert the value to the slider stepping/range. + scope_Values[handleNumber] = scope_Spectrum.fromStepping(to); + var translation = transformDirection(to, 0) - scope_DirOffset; + var translateRule = "translate(" + inRuleOrder(translation + "%", "0") + ")"; + scope_Handles[handleNumber].style[options.transformRule] = translateRule; + // sanity check for at least 2 handles (e.g. during setup) + if (options.events.invertConnects && scope_Locations.length > 1) { + // check if handles passed each other, but don't match the ConnectsInverted state + var handlesAreInOrder = scope_Locations.every(function (position, index, locations) { + return index === 0 || position >= locations[index - 1]; + }); + if (scope_ConnectsInverted !== !handlesAreInOrder) { + // invert connects when handles pass each other + invertConnects(); + // invertConnects already updates all connect elements + return; + } + } + updateConnect(handleNumber); + updateConnect(handleNumber + 1); + if (scope_ConnectsInverted) { + // When connects are inverted, we also have to update adjacent connects + updateConnect(handleNumber - 1); + updateConnect(handleNumber + 2); + } + } + // Handles before the slider middle are stacked later = higher, + // Handles after the middle later is lower + // [[7] [8] .......... | .......... [5] [4] + function setZindex() { + scope_HandleNumbers.forEach(function (handleNumber) { + var dir = scope_Locations[handleNumber] > 50 ? -1 : 1; + var zIndex = 3 + (scope_Handles.length + dir * handleNumber); + scope_Handles[handleNumber].style.zIndex = String(zIndex); + }); + } + // Test suggested values and apply margin, step. + // if exactInput is true, don't run checkHandlePosition, then the handle can be placed in between steps (#436) + function setHandle(handleNumber, to, lookBackward, lookForward, exactInput, smoothSteps) { + if (!exactInput) { + to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false, smoothSteps); + } + if (to === false) { + return false; + } + updateHandlePosition(handleNumber, to); + return true; + } + // Updates style attribute for connect nodes + function updateConnect(index) { + // Skip connects set to false + if (!scope_Connects[index]) { + return; + } + // Create a copy of locations, so we can sort them for the local scope logic + var locations = scope_Locations.slice(); + if (scope_ConnectsInverted) { + locations.sort(function (a, b) { + return a - b; + }); + } + var l = 0; + var h = 100; + if (index !== 0) { + l = locations[index - 1]; + } + if (index !== scope_Connects.length - 1) { + h = locations[index]; + } + // We use two rules: + // 'translate' to change the left/top offset; + // 'scale' to change the width of the element; + // As the element has a width of 100%, a translation of 100% is equal to 100% of the parent (.noUi-base) + var connectWidth = h - l; + var translateRule = "translate(" + inRuleOrder(transformDirection(l, connectWidth) + "%", "0") + ")"; + var scaleRule = "scale(" + inRuleOrder(connectWidth / 100, "1") + ")"; + scope_Connects[index].style[options.transformRule] = + translateRule + " " + scaleRule; + } + // Parses value passed to .set method. Returns current value if not parse-able. + function resolveToValue(to, handleNumber) { + // Setting with null indicates an 'ignore'. + // Inputting 'false' is invalid. + if (to === null || to === false || to === undefined) { + return scope_Locations[handleNumber]; + } + // If a formatted number was passed, attempt to decode it. + if (typeof to === "number") { + to = String(to); + } + to = options.format.from(to); + if (to !== false) { + to = scope_Spectrum.toStepping(to); + } + // If parsing the number failed, use the current value. + if (to === false || isNaN(to)) { + return scope_Locations[handleNumber]; + } + return to; + } + // Set the slider value. + function valueSet(input, fireSetEvent, exactInput) { + var values = asArray(input); + var isInit = scope_Locations[0] === undefined; + // Event fires by default + fireSetEvent = fireSetEvent === undefined ? true : fireSetEvent; + // Animation is optional. + // Make sure the initial values were set before using animated placement. + if (options.animate && !isInit) { + addClassFor(scope_Target, options.cssClasses.tap, options.animationDuration); + } + // First pass, without lookAhead but with lookBackward. Values are set from left to right. + scope_HandleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, resolveToValue(values[handleNumber], handleNumber), true, false, exactInput); + }); + var i = scope_HandleNumbers.length === 1 ? 0 : 1; + // Spread handles evenly across the slider if the range has no size (min=max) + if (isInit && scope_Spectrum.hasNoSize()) { + exactInput = true; + scope_Locations[0] = 0; + if (scope_HandleNumbers.length > 1) { + var space_1 = 100 / (scope_HandleNumbers.length - 1); + scope_HandleNumbers.forEach(function (handleNumber) { + scope_Locations[handleNumber] = handleNumber * space_1; + }); + } + } + // Secondary passes. Now that all base values are set, apply constraints. + // Iterate all handles to ensure constraints are applied for the entire slider (Issue #1009) + for (; i < scope_HandleNumbers.length; ++i) { + scope_HandleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, scope_Locations[handleNumber], true, true, exactInput); + }); + } + setZindex(); + scope_HandleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + // Fire the event only for handles that received a new value, as per #579 + if (values[handleNumber] !== null && fireSetEvent) { + fireEvent("set", handleNumber); + } + }); + } + // Reset slider to initial values + function valueReset(fireSetEvent) { + valueSet(options.start, fireSetEvent); + } + // Set value for a single handle + function valueSetHandle(handleNumber, value, fireSetEvent, exactInput) { + // Ensure numeric input + handleNumber = Number(handleNumber); + if (!(handleNumber >= 0 && handleNumber < scope_HandleNumbers.length)) { + throw new Error("noUiSlider: invalid handle number, got: " + handleNumber); + } + // Look both backward and forward, since we don't want this handle to "push" other handles (#960); + // The exactInput argument can be used to ignore slider stepping (#436) + setHandle(handleNumber, resolveToValue(value, handleNumber), true, true, exactInput); + fireEvent("update", handleNumber); + if (fireSetEvent) { + fireEvent("set", handleNumber); + } + } + // Get the slider value. + function valueGet(unencoded) { + if (unencoded === void 0) { unencoded = false; } + if (unencoded) { + // return a copy of the raw values + return scope_Values.length === 1 ? scope_Values[0] : scope_Values.slice(0); + } + var values = scope_Values.map(options.format.to); + // If only one handle is used, return a single value. + if (values.length === 1) { + return values[0]; + } + return values; + } + // Removes classes from the root and empties it. + function destroy() { + // remove protected internal listeners + removeEvent(INTERNAL_EVENT_NS.aria); + removeEvent(INTERNAL_EVENT_NS.tooltips); + Object.keys(options.cssClasses).forEach(function (key) { + removeClass(scope_Target, options.cssClasses[key]); + }); + while (scope_Target.firstChild) { + scope_Target.removeChild(scope_Target.firstChild); + } + delete scope_Target.noUiSlider; + } + function getNextStepsForHandle(handleNumber) { + var location = scope_Locations[handleNumber]; + var nearbySteps = scope_Spectrum.getNearbySteps(location); + var value = scope_Values[handleNumber]; + var increment = nearbySteps.thisStep.step; + var decrement = null; + // If snapped, directly use defined step value + if (options.snap) { + return [ + value - nearbySteps.stepBefore.startValue || null, + nearbySteps.stepAfter.startValue - value || null, + ]; + } + // If the next value in this step moves into the next step, + // the increment is the start of the next step - the current value + if (increment !== false) { + if (value + increment > nearbySteps.stepAfter.startValue) { + increment = nearbySteps.stepAfter.startValue - value; + } + } + // If the value is beyond the starting point + if (value > nearbySteps.thisStep.startValue) { + decrement = nearbySteps.thisStep.step; + } + else if (nearbySteps.stepBefore.step === false) { + decrement = false; + } + // If a handle is at the start of a step, it always steps back into the previous step first + else { + decrement = value - nearbySteps.stepBefore.highestStep; + } + // Now, if at the slider edges, there is no in/decrement + if (location === 100) { + increment = null; + } + else if (location === 0) { + decrement = null; + } + // As per #391, the comparison for the decrement step can have some rounding issues. + var stepDecimals = scope_Spectrum.countStepDecimals(); + // Round per #391 + if (increment !== null && increment !== false) { + increment = Number(increment.toFixed(stepDecimals)); + } + if (decrement !== null && decrement !== false) { + decrement = Number(decrement.toFixed(stepDecimals)); + } + return [decrement, increment]; + } + // Get the current step size for the slider. + function getNextSteps() { + return scope_HandleNumbers.map(getNextStepsForHandle); + } + // Updatable: margin, limit, padding, step, range, animate, snap + function updateOptions(optionsToUpdate, fireSetEvent) { + // Spectrum is created using the range, snap, direction and step options. + // 'snap' and 'step' can be updated. + // If 'snap' and 'step' are not passed, they should remain unchanged. + var v = valueGet(); + var updateAble = [ + "margin", + "limit", + "padding", + "range", + "animate", + "snap", + "step", + "format", + "pips", + "tooltips", + "connect", + ]; + // Only change options that we're actually passed to update. + updateAble.forEach(function (name) { + // Check for undefined. null removes the value. + if (optionsToUpdate[name] !== undefined) { + originalOptions[name] = optionsToUpdate[name]; + } + }); + var newOptions = testOptions(originalOptions); + // Load new options into the slider state + updateAble.forEach(function (name) { + if (optionsToUpdate[name] !== undefined) { + options[name] = newOptions[name]; + } + }); + scope_Spectrum = newOptions.spectrum; + // Limit, margin and padding depend on the spectrum but are stored outside of it. (#677) + options.margin = newOptions.margin; + options.limit = newOptions.limit; + options.padding = newOptions.padding; + // Update pips, removes existing. + if (options.pips) { + pips(options.pips); + } + else { + removePips(); + } + // Update tooltips, removes existing. + if (options.tooltips) { + tooltips(); + } + else { + removeTooltips(); + } + // Invalidate the current positioning so valueSet forces an update. + scope_Locations = []; + valueSet(isSet(optionsToUpdate.start) ? optionsToUpdate.start : v, fireSetEvent); + // Update connects only if it was set + if (optionsToUpdate.connect) { + updateConnectOption(); + } + } + function updateConnectOption() { + // IE supported way of removing children including event handlers + while (scope_ConnectBase.firstChild) { + scope_ConnectBase.removeChild(scope_ConnectBase.firstChild); + } + // Adding new connects according to the new connect options + for (var i = 0; i <= options.handles; i++) { + scope_Connects[i] = addConnect(scope_ConnectBase, options.connect[i]); + updateConnect(i); + } + // re-adding drag events for the new connect elements + // to ignore the other events we have to negate the 'if (!behaviour.fixed)' check + bindSliderEvents({ drag: options.events.drag, fixed: true }); + } + // Invert options for connect handles + function invertConnects() { + scope_ConnectsInverted = !scope_ConnectsInverted; + testConnect(options, + // inverse the connect boolean array + options.connect.map(function (b) { return !b; })); + updateConnectOption(); + } + // Initialization steps + function setupSlider() { + // Create the base element, initialize HTML and set classes. + // Add handles and connect elements. + scope_Base = addSlider(scope_Target); + addElements(options.connect, scope_Base); + // Attach user events. + bindSliderEvents(options.events); + // Use the public value method to set the start values. + valueSet(options.start); + if (options.pips) { + pips(options.pips); + } + if (options.tooltips) { + tooltips(); + } + aria(); + } + setupSlider(); + var scope_Self = { + destroy: destroy, + steps: getNextSteps, + on: bindEvent, + off: removeEvent, + get: valueGet, + set: valueSet, + setHandle: valueSetHandle, + reset: valueReset, + disable: disable, + enable: enable, + // Exposed for unit testing, don't use this in your application. + __moveHandles: function (upward, proposal, handleNumbers) { + moveHandles(upward, proposal, scope_Locations, handleNumbers); + }, + options: originalOptions, + updateOptions: updateOptions, + target: scope_Target, + removePips: removePips, + removeTooltips: removeTooltips, + getPositions: function () { + return scope_Locations.slice(); + }, + getTooltips: function () { + return scope_Tooltips; + }, + getOrigins: function () { + return scope_Handles; + }, + pips: pips, // Issue #594 + }; + return scope_Self; +} +// Run the standard initializer +function initialize(target, originalOptions) { + if (!target || !target.nodeName) { + throw new Error("noUiSlider: create requires a single element, got: " + target); + } + // Throw an error if the slider was already initialized. + if (target.noUiSlider) { + throw new Error("noUiSlider: Slider was already initialized."); + } + // Test the options and create the slider environment; + var options = testOptions(originalOptions); + var api = scope(target, options, originalOptions); + target.noUiSlider = api; + return api; +} +export { initialize as create }; +export { cssClasses }; +export default { + // Exposed for unit testing, don't use this in your application. + __spectrum: Spectrum, + // A reference to the default classes, allows global changes. + // Use the cssClasses option for changes to one slider. + cssClasses: cssClasses, + create: initialize, +}; diff --git a/web/modules/custom/ufc/.babelrc b/web/modules/custom/ufc/.babelrc deleted file mode 100644 index 6da9b01..0000000 --- a/web/modules/custom/ufc/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": [ - "@babel/preset-env", - "@babel/preset-react" - ] -} diff --git a/web/modules/custom/ufc/config/x-nstall/core.base_field_override.node.fight.promote.yml b/web/modules/custom/ufc/config/x-nstall/core.base_field_override.node.fight.promote.yml deleted file mode 100644 index 61b2c60..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.base_field_override.node.fight.promote.yml +++ /dev/null @@ -1,22 +0,0 @@ -uuid: 9020d6b1-7067-4178-884e-a36f2e24c865 -langcode: en -status: true -dependencies: - config: - - node.type.fight -id: node.fight.promote -field_name: promote -entity_type: node -bundle: fight -label: 'Promoted to front page' -description: '' -required: false -translatable: true -default_value: - - - value: 0 -default_value_callback: '' -settings: - on_label: 'On' - off_label: 'Off' -field_type: boolean diff --git a/web/modules/custom/ufc/config/x-nstall/core.base_field_override.node.fighter.promote.yml b/web/modules/custom/ufc/config/x-nstall/core.base_field_override.node.fighter.promote.yml deleted file mode 100644 index 3e61e9f..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.base_field_override.node.fighter.promote.yml +++ /dev/null @@ -1,22 +0,0 @@ -uuid: 62516a1a-8798-4b75-b598-8ddfe1e957ab -langcode: en -status: true -dependencies: - config: - - node.type.fighter -id: node.fighter.promote -field_name: promote -entity_type: node -bundle: fighter -label: 'Promoted to front page' -description: '' -required: false -translatable: true -default_value: - - - value: 0 -default_value_callback: '' -settings: - on_label: 'On' - off_label: 'Off' -field_type: boolean diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_form_display.node.fight.default.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_form_display.node.fight.default.yml deleted file mode 100644 index c753d88..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_form_display.node.fight.default.yml +++ /dev/null @@ -1,85 +0,0 @@ -uuid: 46386617-61d1-4ef1-bcd0-762c7d39139d -langcode: en -status: true -dependencies: - config: - - field.field.node.fight.body - - field.field.node.fight.field_accuracy - - field.field.node.fight.field_event - - field.field.node.fight.field_fighter_one - - field.field.node.fight.field_fighter_two - - field.field.node.fight.field_prediction - - field.field.node.fight.field_result - - node.type.fight -id: node.fight.default -targetEntityType: node -bundle: fight -mode: default -content: - field_accuracy: - weight: 28 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_event: - weight: 1 - settings: { } - third_party_settings: { } - type: options_buttons - region: content - field_fighter_one: - weight: 2 - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete_tags - region: content - field_fighter_two: - weight: 3 - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete_tags - region: content - field_prediction: - weight: 26 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - field_result: - weight: 5 - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - region: content - title: - type: string_textfield - weight: 0 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: - body: true - created: true - path: true - promote: true - status: true - sticky: true - uid: true diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_form_display.node.fighter.default.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_form_display.node.fighter.default.yml deleted file mode 100644 index a2ee6e2..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_form_display.node.fighter.default.yml +++ /dev/null @@ -1,271 +0,0 @@ -uuid: efcb011e-c7f3-4101-b5d7-3ab6aa471ab5 -langcode: en -status: true -dependencies: - config: - - field.field.node.fighter.body - - field.field.node.fighter.field_absorbed_per_min - - field.field.node.fighter.field_age - - field.field.node.fighter.field_decisions - - field.field.node.fighter.field_division - - field.field.node.fighter.field_first_name - - field.field.node.fighter.field_grappling_accuracy - - field.field.node.fighter.field_height - - field.field.node.fighter.field_knockdown_ratio - - field.field.node.fighter.field_knockouts - - field.field.node.fighter.field_last_name - - field.field.node.fighter.field_leg_reach - - field.field.node.fighter.field_losses - - field.field.node.fighter.field_player_photo - - field.field.node.fighter.field_reach - - field.field.node.fighter.field_strikes_per_minute - - field.field.node.fighter.field_striking_accuracy - - field.field.node.fighter.field_submissions - - field.field.node.fighter.field_takedowns_per_15 - - field.field.node.fighter.field_ties - - field.field.node.fighter.field_weight - - field.field.node.fighter.field_wins - - node.type.fighter - module: - - field_group - - media_library -third_party_settings: - field_group: - group_information: - children: - - title - - field_first_name - - field_last_name - - field_player_photo - - field_height - - field_weight - - field_age - - field_reach - - field_leg_reach - - field_division - parent_name: '' - weight: 1 - format_type: tab - region: content - format_settings: - description: 'The player information' - formatter: open - required_fields: true - id: '' - classes: '' - direction: vertical - effect: none - open: false - weight: 0 - label: Information - group_statistics: - children: - - field_wins - - field_losses - - field_ties - - field_decisions - - field_knockouts - - field_submissions - - field_grappling_accuracy - - field_striking_accuracy - - field_strikes_per_minute - - field_absorbed_per_min - - field_takedowns_per_15 - - field_knockdown_ratio - parent_name: '' - weight: 2 - format_type: tab - region: content - format_settings: - description: 'The statistics for this fighter.' - formatter: open - required_fields: true - id: '' - classes: '' - effect: none - open: false - weight: 0 - direction: vertical - element: div - show_label: false - label_element: h3 - label_element_classes: '' - speed: fast - attributes: '' - label: Statistics -id: node.fighter.default -targetEntityType: node -bundle: fighter -mode: default -content: - field_absorbed_per_min: - weight: 21 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_age: - weight: 6 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_decisions: - weight: 15 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_division: - weight: 9 - settings: - match_operator: CONTAINS - match_limit: 10 - size: 60 - placeholder: '' - third_party_settings: { } - type: entity_reference_autocomplete - region: content - field_first_name: - weight: 1 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - field_grappling_accuracy: - weight: 18 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_height: - weight: 4 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_knockdown_ratio: - weight: 23 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_knockouts: - weight: 16 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_last_name: - weight: 2 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - field_leg_reach: - weight: 8 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_losses: - weight: 13 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - field_player_photo: - type: media_library_widget - weight: 3 - settings: - media_types: { } - third_party_settings: { } - region: content - field_reach: - weight: 7 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_strikes_per_minute: - weight: 20 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_striking_accuracy: - weight: 19 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_submissions: - weight: 17 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_takedowns_per_15: - weight: 22 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_ties: - weight: 14 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - field_weight: - weight: 5 - settings: - placeholder: '' - third_party_settings: { } - type: number - region: content - field_wins: - weight: 12 - settings: - size: 60 - placeholder: '' - third_party_settings: { } - type: string_textfield - region: content - title: - type: string_textfield - weight: 0 - region: content - settings: - size: 60 - placeholder: '' - third_party_settings: { } -hidden: - body: true - created: true - path: true - promote: true - status: true - sticky: true - uid: true diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fight.default.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fight.default.yml deleted file mode 100644 index 402bf6c..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fight.default.yml +++ /dev/null @@ -1,80 +0,0 @@ -uuid: d879dd9e-73c7-4562-98c5-45f6e0505d0c -langcode: en -status: true -dependencies: - config: - - field.field.node.fight.body - - field.field.node.fight.field_accuracy - - field.field.node.fight.field_event - - field.field.node.fight.field_fighter_one - - field.field.node.fight.field_fighter_two - - field.field.node.fight.field_prediction - - field.field.node.fight.field_result - - node.type.fight - module: - - user -id: node.fight.default -targetEntityType: node -bundle: fight -mode: default -content: - field_accuracy: - weight: 8 - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - region: content - field_event: - weight: 1 - label: hidden - settings: - link: true - third_party_settings: { } - type: entity_reference_label - region: content - field_fighter_one: - weight: 2 - label: hidden - settings: - view_mode: teaser - link: false - third_party_settings: { } - type: entity_reference_entity_view - region: content - field_fighter_two: - weight: 3 - label: hidden - settings: - view_mode: teaser - link: false - third_party_settings: { } - type: entity_reference_entity_view - region: content - field_prediction: - weight: 6 - label: above - settings: - link_to_entity: false - third_party_settings: { } - type: string - region: content - field_result: - weight: 5 - label: hidden - settings: - link: true - third_party_settings: { } - type: entity_reference_label - region: content - links: - weight: 0 - region: content - settings: { } - third_party_settings: { } -hidden: - body: true diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fight.teaser.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fight.teaser.yml deleted file mode 100644 index 65085a1..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fight.teaser.yml +++ /dev/null @@ -1,42 +0,0 @@ -uuid: 2d1d0d94-7623-4d5b-a4d7-749720857860 -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.fight.body - - field.field.node.fight.field_accuracy - - field.field.node.fight.field_event - - field.field.node.fight.field_fighter_one - - field.field.node.fight.field_fighter_two - - field.field.node.fight.field_prediction - - field.field.node.fight.field_result - - node.type.fight - module: - - text - - user -id: node.fight.teaser -targetEntityType: node -bundle: fight -mode: teaser -content: - body: - label: hidden - type: text_summary_or_trimmed - weight: 101 - settings: - trim_length: 600 - third_party_settings: { } - region: content - links: - weight: 100 - settings: { } - third_party_settings: { } - region: content -hidden: - field_accuracy: true - field_event: true - field_fighter_one: true - field_fighter_two: true - field_prediction: true - field_result: true diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.default.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.default.yml deleted file mode 100644 index 9e93db0..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.default.yml +++ /dev/null @@ -1,237 +0,0 @@ -uuid: 62338666-d3ab-4b76-a45d-20e2ca85d41f -langcode: en -status: true -dependencies: - config: - - field.field.node.fighter.body - - field.field.node.fighter.field_absorbed_per_min - - field.field.node.fighter.field_age - - field.field.node.fighter.field_decisions - - field.field.node.fighter.field_division - - field.field.node.fighter.field_first_name - - field.field.node.fighter.field_grappling_accuracy - - field.field.node.fighter.field_height - - field.field.node.fighter.field_knockdown_ratio - - field.field.node.fighter.field_knockouts - - field.field.node.fighter.field_last_name - - field.field.node.fighter.field_leg_reach - - field.field.node.fighter.field_losses - - field.field.node.fighter.field_player_photo - - field.field.node.fighter.field_reach - - field.field.node.fighter.field_strikes_per_minute - - field.field.node.fighter.field_striking_accuracy - - field.field.node.fighter.field_submissions - - field.field.node.fighter.field_takedowns_per_15 - - field.field.node.fighter.field_ties - - field.field.node.fighter.field_weight - - field.field.node.fighter.field_wins - - image.style.thumbnail - - node.type.fighter - module: - - media - - user -id: node.fighter.default -targetEntityType: node -bundle: fighter -mode: default -content: - field_absorbed_per_min: - type: number_decimal - weight: 6 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_age: - weight: 3 - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - region: content - field_decisions: - type: number_decimal - weight: 7 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_division: - type: entity_reference_label - weight: 8 - region: content - label: above - settings: - link: true - third_party_settings: { } - field_grappling_accuracy: - type: number_decimal - weight: 9 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_height: - weight: 1 - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - region: content - field_knockdown_ratio: - type: number_decimal - weight: 10 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_knockouts: - type: number_decimal - weight: 17 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_leg_reach: - weight: 5 - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - region: content - field_losses: - type: string - weight: 16 - region: content - label: above - settings: - link_to_entity: false - third_party_settings: { } - field_player_photo: - type: media_thumbnail - weight: 0 - label: hidden - settings: - image_style: thumbnail - image_link: '' - third_party_settings: { } - region: content - field_reach: - weight: 4 - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - region: content - field_strikes_per_minute: - type: number_decimal - weight: 15 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_striking_accuracy: - type: number_decimal - weight: 14 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_submissions: - type: number_decimal - weight: 11 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_takedowns_per_15: - type: number_decimal - weight: 12 - region: content - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - field_ties: - type: string - weight: 18 - region: content - label: above - settings: - link_to_entity: false - third_party_settings: { } - field_weight: - weight: 2 - label: above - settings: - thousand_separator: '' - decimal_separator: . - scale: 2 - prefix_suffix: true - third_party_settings: { } - type: number_decimal - region: content - field_wins: - type: string - weight: 13 - region: content - label: above - settings: - link_to_entity: false - third_party_settings: { } -hidden: - body: true - field_first_name: true - field_last_name: true - links: true diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.rss.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.rss.yml deleted file mode 100644 index b5a71a9..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.rss.yml +++ /dev/null @@ -1,77 +0,0 @@ -uuid: be9b697f-c86f-4de3-9a8e-13bbd743a872 -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.rss - - field.field.node.fighter.body - - field.field.node.fighter.field_absorbed_per_min - - field.field.node.fighter.field_age - - field.field.node.fighter.field_decisions - - field.field.node.fighter.field_division - - field.field.node.fighter.field_first_name - - field.field.node.fighter.field_grappling_accuracy - - field.field.node.fighter.field_height - - field.field.node.fighter.field_knockdown_ratio - - field.field.node.fighter.field_knockouts - - field.field.node.fighter.field_last_name - - field.field.node.fighter.field_leg_reach - - field.field.node.fighter.field_losses - - field.field.node.fighter.field_player_photo - - field.field.node.fighter.field_reach - - field.field.node.fighter.field_strikes_per_minute - - field.field.node.fighter.field_striking_accuracy - - field.field.node.fighter.field_submissions - - field.field.node.fighter.field_takedowns_per_15 - - field.field.node.fighter.field_ties - - field.field.node.fighter.field_weight - - field.field.node.fighter.field_wins - - image.style.thumbnail - - node.type.fighter - module: - - media - - user -id: node.fighter.rss -targetEntityType: node -bundle: fighter -mode: rss -content: - field_last_name: - weight: 1 - label: hidden - settings: - link_to_entity: false - third_party_settings: { } - type: string - region: content - field_player_photo: - type: media_thumbnail - weight: 0 - label: hidden - settings: - image_style: thumbnail - image_link: '' - third_party_settings: { } - region: content -hidden: - body: true - field_absorbed_per_min: true - field_age: true - field_decisions: true - field_division: true - field_first_name: true - field_grappling_accuracy: true - field_height: true - field_knockdown_ratio: true - field_knockouts: true - field_leg_reach: true - field_losses: true - field_reach: true - field_strikes_per_minute: true - field_striking_accuracy: true - field_submissions: true - field_takedowns_per_15: true - field_ties: true - field_weight: true - field_wins: true - links: true diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.teaser.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.teaser.yml deleted file mode 100644 index 7c53990..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.node.fighter.teaser.yml +++ /dev/null @@ -1,70 +0,0 @@ -uuid: ed1e0abd-67ac-4ae9-ad96-28cafd354403 -langcode: en -status: true -dependencies: - config: - - core.entity_view_mode.node.teaser - - field.field.node.fighter.body - - field.field.node.fighter.field_absorbed_per_min - - field.field.node.fighter.field_age - - field.field.node.fighter.field_decisions - - field.field.node.fighter.field_division - - field.field.node.fighter.field_first_name - - field.field.node.fighter.field_grappling_accuracy - - field.field.node.fighter.field_height - - field.field.node.fighter.field_knockdown_ratio - - field.field.node.fighter.field_knockouts - - field.field.node.fighter.field_last_name - - field.field.node.fighter.field_leg_reach - - field.field.node.fighter.field_losses - - field.field.node.fighter.field_player_photo - - field.field.node.fighter.field_reach - - field.field.node.fighter.field_strikes_per_minute - - field.field.node.fighter.field_striking_accuracy - - field.field.node.fighter.field_submissions - - field.field.node.fighter.field_takedowns_per_15 - - field.field.node.fighter.field_ties - - field.field.node.fighter.field_weight - - field.field.node.fighter.field_wins - - image.style.medium - - node.type.fighter - module: - - media - - user -id: node.fighter.teaser -targetEntityType: node -bundle: fighter -mode: teaser -content: - field_player_photo: - type: media_thumbnail - weight: 0 - region: content - label: hidden - settings: - image_style: medium - image_link: '' - third_party_settings: { } -hidden: - body: true - field_absorbed_per_min: true - field_age: true - field_decisions: true - field_division: true - field_first_name: true - field_grappling_accuracy: true - field_height: true - field_knockdown_ratio: true - field_knockouts: true - field_last_name: true - field_leg_reach: true - field_losses: true - field_reach: true - field_strikes_per_minute: true - field_striking_accuracy: true - field_submissions: true - field_takedowns_per_15: true - field_ties: true - field_weight: true - field_wins: true - links: true diff --git a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.taxonomy_term.ufc_events.default.yml b/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.taxonomy_term.ufc_events.default.yml deleted file mode 100644 index ece1771..0000000 --- a/web/modules/custom/ufc/config/x-nstall/core.entity_view_display.taxonomy_term.ufc_events.default.yml +++ /dev/null @@ -1,32 +0,0 @@ -uuid: c2fa694b-d3bb-43ed-b9a8-cfe2c6aa61ac -langcode: en -status: true -dependencies: - config: - - field.field.taxonomy_term.ufc_events.field_event_date - - taxonomy.vocabulary.ufc_events - module: - - datetime - - text -id: taxonomy_term.ufc_events.default -targetEntityType: taxonomy_term -bundle: ufc_events -mode: default -content: - description: - label: hidden - type: text_default - weight: 0 - region: content - settings: { } - third_party_settings: { } - field_event_date: - weight: 1 - label: above - settings: - format_type: medium - timezone_override: '' - third_party_settings: { } - type: datetime_default - region: content -hidden: { } diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_accuracy.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_accuracy.yml deleted file mode 100644 index e675f87..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_accuracy.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 0675782a-5e6b-47e6-b248-48cf7ee44144 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_accuracy - - node.type.fight -id: node.fight.field_accuracy -field_name: field_accuracy -entity_type: node -bundle: fight -label: Accuracy -description: 'Accuracy of this prediction.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '%' -field_type: float diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_fighter_one.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_fighter_one.yml deleted file mode 100644 index bef7ff6..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_fighter_one.yml +++ /dev/null @@ -1,28 +0,0 @@ -uuid: c0e2a418-fa1b-450e-9496-31915af72a6c -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_fighter_one - - node.type.fight - - node.type.fighter -id: node.fight.field_fighter_one -field_name: field_fighter_one -entity_type: node -bundle: fight -label: 'Fighter One' -description: 'The first fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:node' - handler_settings: - target_bundles: - fighter: fighter - sort: - field: _none - auto_create: false - auto_create_bundle: '' -field_type: entity_reference diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_fighter_two.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_fighter_two.yml deleted file mode 100644 index 4f7c46e..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_fighter_two.yml +++ /dev/null @@ -1,28 +0,0 @@ -uuid: 1cfef8e4-a358-402e-a6b9-6377abf8b12d -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_fighter_two - - node.type.fight - - node.type.fighter -id: node.fight.field_fighter_two -field_name: field_fighter_two -entity_type: node -bundle: fight -label: 'Fighter Two' -description: 'The second fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:node' - handler_settings: - target_bundles: - fighter: fighter - sort: - field: _none - auto_create: false - auto_create_bundle: '' -field_type: entity_reference diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_prediction.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_prediction.yml deleted file mode 100644 index 08af8af..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_prediction.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: 840cdb42-015b-4c66-b49b-420da49b42ae -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_prediction - - node.type.fight -id: node.fight.field_prediction -field_name: field_prediction -entity_type: node -bundle: fight -label: Prediction -description: 'The prediction for this fight.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_result.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_result.yml deleted file mode 100644 index f94a3f5..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fight.field_result.yml +++ /dev/null @@ -1,28 +0,0 @@ -uuid: f80f6e92-7f80-4706-9649-19cde2e63f97 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_result - - node.type.fight - - node.type.fighter -id: node.fight.field_result -field_name: field_result -entity_type: node -bundle: fight -label: Result -description: 'The real result of the fight, aka WINNER.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:node' - handler_settings: - target_bundles: - fighter: fighter - sort: - field: _none - auto_create: false - auto_create_bundle: '' -field_type: entity_reference diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_absorbed_per_min.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_absorbed_per_min.yml deleted file mode 100644 index 9801876..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_absorbed_per_min.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: bd26455b-a207-481f-9aac-2b2f61d118a0 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_absorbed_per_min - - node.type.fighter -id: node.fighter.field_absorbed_per_min -field_name: field_absorbed_per_min -entity_type: node -bundle: fighter -label: 'Absorbed Per Min' -description: 'The strikes absorbed per minute for this fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_age.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_age.yml deleted file mode 100644 index 6e4c874..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_age.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 71fa4227-27da-4319-a823-aa0acde92145 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_age - - node.type.fighter -id: node.fighter.field_age -field_name: field_age -entity_type: node -bundle: fighter -label: Age -description: 'The age of the fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_decisions.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_decisions.yml deleted file mode 100644 index a2fda43..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_decisions.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 2c9e212b-4e0e-41c2-a924-ad1bc51a82de -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_decisions - - node.type.fighter -id: node.fighter.field_decisions -field_name: field_decisions -entity_type: node -bundle: fighter -label: Decisions -description: 'The amount of decision wins this fighter has.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_division.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_division.yml deleted file mode 100644 index 5f59533..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_division.yml +++ /dev/null @@ -1,29 +0,0 @@ -uuid: 7cfd4a75-6ba7-4878-a391-f555f05d3beb -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_division - - node.type.fighter - - taxonomy.vocabulary.ufc_divisions -id: node.fighter.field_division -field_name: field_division -entity_type: node -bundle: fighter -label: Division -description: 'The division this fighter is in.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:taxonomy_term' - handler_settings: - target_bundles: - ufc_divisions: ufc_divisions - sort: - field: name - direction: asc - auto_create: false - auto_create_bundle: '' -field_type: entity_reference diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_first_name.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_first_name.yml deleted file mode 100644 index 06e5a7a..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_first_name.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: 49c5a5bc-5e65-46ba-a4c8-c42b951a4ecc -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_first_name - - node.type.fighter -id: node.fighter.field_first_name -field_name: field_first_name -entity_type: node -bundle: fighter -label: 'First Name' -description: 'First name.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_grappling_accuracy.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_grappling_accuracy.yml deleted file mode 100644 index 0548be4..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_grappling_accuracy.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: ca060196-5d4d-4acc-9e6b-a7daf7af7003 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_grappling_accuracy - - node.type.fighter -id: node.fighter.field_grappling_accuracy -field_name: field_grappling_accuracy -entity_type: node -bundle: fighter -label: 'Grappling Accuracy' -description: 'The grappling accuracy for this fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '%' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_height.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_height.yml deleted file mode 100644 index 5e5f039..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_height.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 3a4c580f-fb39-4674-8533-a986ad57a7a4 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_height - - node.type.fighter -id: node.fighter.field_height -field_name: field_height -entity_type: node -bundle: fighter -label: Height -description: 'The height of the fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_knockdown_ratio.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_knockdown_ratio.yml deleted file mode 100644 index 1fb9b1c..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_knockdown_ratio.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: bc39ff4d-12ca-47ff-9d0d-74a941148cf9 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_knockdown_ratio - - node.type.fighter -id: node.fighter.field_knockdown_ratio -field_name: field_knockdown_ratio -entity_type: node -bundle: fighter -label: 'Knockdown Ratio' -description: 'The knockdown ratio for this fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_knockouts.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_knockouts.yml deleted file mode 100644 index 328f4ef..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_knockouts.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: d1f83a79-f899-49da-bd99-1a3e9ed7b34b -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_knockouts - - node.type.fighter -id: node.fighter.field_knockouts -field_name: field_knockouts -entity_type: node -bundle: fighter -label: Knockouts -description: 'The amount of knockouts this fighter has.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_last_name.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_last_name.yml deleted file mode 100644 index ff07dfb..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_last_name.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: 493c9d57-a11f-4358-b618-8b3252da3d87 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_last_name - - node.type.fighter -id: node.fighter.field_last_name -field_name: field_last_name -entity_type: node -bundle: fighter -label: 'Last Name' -description: 'Last name of the player.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_leg_reach.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_leg_reach.yml deleted file mode 100644 index e898242..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_leg_reach.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: dcc0c063-f28b-4bc6-ba61-6fbdc70a8b70 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_leg_reach - - node.type.fighter -id: node.fighter.field_leg_reach -field_name: field_leg_reach -entity_type: node -bundle: fighter -label: 'Leg Reach' -description: 'The leg reach of the fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_losses.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_losses.yml deleted file mode 100644 index cda584e..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_losses.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: 1c7f58ba-b19d-4016-b7bf-53e8c0c24e23 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_losses - - node.type.fighter -id: node.fighter.field_losses -field_name: field_losses -entity_type: node -bundle: fighter -label: Losses -description: 'The amount of losses' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_player_photo.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_player_photo.yml deleted file mode 100644 index 44adf5e..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_player_photo.yml +++ /dev/null @@ -1,28 +0,0 @@ -uuid: be611949-61fe-454a-9b5a-754ef77ff5f9 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_player_photo - - media.type.image - - node.type.fighter -id: node.fighter.field_player_photo -field_name: field_player_photo -entity_type: node -bundle: fighter -label: 'Player Photo' -description: 'The player photos.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - handler: 'default:media' - handler_settings: - target_bundles: - image: image - sort: - field: _none - auto_create: false - auto_create_bundle: '' -field_type: entity_reference diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_reach.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_reach.yml deleted file mode 100644 index 6e468fe..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_reach.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: e5c16d91-eb10-4d95-837f-279ccfb469d1 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_reach - - node.type.fighter -id: node.fighter.field_reach -field_name: field_reach -entity_type: node -bundle: fighter -label: Reach -description: 'The reach of the fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_strikes_per_minute.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_strikes_per_minute.yml deleted file mode 100644 index c987543..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_strikes_per_minute.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 05529d7b-2702-4d98-953e-c38294bf1386 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_strikes_per_minute - - node.type.fighter -id: node.fighter.field_strikes_per_minute -field_name: field_strikes_per_minute -entity_type: node -bundle: fighter -label: 'Strikes Per Minute' -description: 'The strikes per minute for this fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_striking_accuracy.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_striking_accuracy.yml deleted file mode 100644 index 1fbdbd1..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_striking_accuracy.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: b32a72cf-325f-4abd-8234-6eb1b2d04628 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_striking_accuracy - - node.type.fighter -id: node.fighter.field_striking_accuracy -field_name: field_striking_accuracy -entity_type: node -bundle: fighter -label: 'Striking Accuracy' -description: 'The striking accuracy for this fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '%' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_submissions.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_submissions.yml deleted file mode 100644 index 0b23bb5..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_submissions.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: e1130f2d-f575-442f-8fbc-2dc11e45582b -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_submissions - - node.type.fighter -id: node.fighter.field_submissions -field_name: field_submissions -entity_type: node -bundle: fighter -label: Submissions -description: 'The amount of submissions wins this fighter has.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_takedowns_per_15.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_takedowns_per_15.yml deleted file mode 100644 index d92dad1..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_takedowns_per_15.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 2564e00a-2001-4dac-bf0f-b5a850ec78cc -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_takedowns_per_15 - - node.type.fighter -id: node.fighter.field_takedowns_per_15 -field_name: field_takedowns_per_15 -entity_type: node -bundle: fighter -label: 'Takedowns Per 15' -description: 'The takedowns per 15 minutes for this fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_ties.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_ties.yml deleted file mode 100644 index 2582efe..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_ties.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: 7c6981ab-23b9-4407-8ef7-2f61d6561c4b -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_ties - - node.type.fighter -id: node.fighter.field_ties -field_name: field_ties -entity_type: node -bundle: fighter -label: Ties -description: 'The amount of ties.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_weight.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_weight.yml deleted file mode 100644 index 745265b..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_weight.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 56f9ae5d-1ff2-40eb-9085-7657176f60cc -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_weight - - node.type.fighter -id: node.fighter.field_weight -field_name: field_weight -entity_type: node -bundle: fighter -label: Weight -description: 'The weight of the fighter.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: - min: null - max: null - prefix: '' - suffix: '' -field_type: decimal diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_wins.yml b/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_wins.yml deleted file mode 100644 index e49cd44..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.node.fighter.field_wins.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: ffde2285-42ba-4db5-9bc6-3ebe2124f2c6 -langcode: en -status: true -dependencies: - config: - - field.storage.node.field_wins - - node.type.fighter -id: node.fighter.field_wins -field_name: field_wins -entity_type: node -bundle: fighter -label: Wins -description: 'The amount of wins.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: string diff --git a/web/modules/custom/ufc/config/x-nstall/field.field.taxonomy_term.ufc_events.field_event_date.yml b/web/modules/custom/ufc/config/x-nstall/field.field.taxonomy_term.ufc_events.field_event_date.yml deleted file mode 100644 index 80755ed..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.field.taxonomy_term.ufc_events.field_event_date.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: eac5bd54-7691-421e-8f2a-ce579c6d3032 -langcode: en -status: true -dependencies: - config: - - field.storage.taxonomy_term.field_event_date - - taxonomy.vocabulary.ufc_events - module: - - datetime -id: taxonomy_term.ufc_events.field_event_date -field_name: field_event_date -entity_type: taxonomy_term -bundle: ufc_events -label: 'Event Date' -description: 'The date for this event.' -required: false -translatable: false -default_value: { } -default_value_callback: '' -settings: { } -field_type: datetime diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_absorbed_per_min.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_absorbed_per_min.yml deleted file mode 100644 index 1cc7caa..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_absorbed_per_min.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 9d6bf3c4-a280-4e14-a46e-2f0df3208242 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_absorbed_per_min -field_name: field_absorbed_per_min -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_accuracy.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_accuracy.yml deleted file mode 100644 index 6a5c937..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_accuracy.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 9302d680-0a5f-4846-bec7-72952ff45727 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_accuracy -field_name: field_accuracy -entity_type: node -type: float -settings: { } -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_age.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_age.yml deleted file mode 100644 index 4b6f290..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_age.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 6691c996-791a-4b93-9dca-5504091188a8 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_age -field_name: field_age -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_decisions.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_decisions.yml deleted file mode 100644 index df819f7..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_decisions.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 88f41317-7b99-4916-9b62-2fc9574b4cb2 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_decisions -field_name: field_decisions -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_event.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_event.yml deleted file mode 100644 index a77e4dc..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_event.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: f85fe501-9759-424f-ae4c-9c7120715c08 -langcode: en -status: true -dependencies: - module: - - node - - taxonomy -id: node.field_event -field_name: field_event -entity_type: node -type: entity_reference -settings: - target_type: taxonomy_term -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_fighter_one.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_fighter_one.yml deleted file mode 100644 index 2a66069..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_fighter_one.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: a065856c-0d5f-4c0f-b744-338ad233aa23 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_fighter_one -field_name: field_fighter_one -entity_type: node -type: entity_reference -settings: - target_type: node -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_fighter_two.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_fighter_two.yml deleted file mode 100644 index 90be8df..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_fighter_two.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: 75c486ae-91c5-4672-818e-0f8a6e286b20 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_fighter_two -field_name: field_fighter_two -entity_type: node -type: entity_reference -settings: - target_type: node -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_first_name.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_first_name.yml deleted file mode 100644 index 252c019..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_first_name.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: 28585605-54e4-49ca-9d74-468ceba7fafe -langcode: en -status: true -dependencies: - module: - - node -id: node.field_first_name -field_name: field_first_name -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_grappling_accuracy.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_grappling_accuracy.yml deleted file mode 100644 index 7d61cb8..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_grappling_accuracy.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 519a3558-3dcd-4f40-a4e6-2bbc1d08be6b -langcode: en -status: true -dependencies: - module: - - node -id: node.field_grappling_accuracy -field_name: field_grappling_accuracy -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_height.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_height.yml deleted file mode 100644 index ff1484b..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_height.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 2c211457-b9ec-461f-86d6-a6c6f01eeef5 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_height -field_name: field_height -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_knockdown_ratio.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_knockdown_ratio.yml deleted file mode 100644 index 1338e6b..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_knockdown_ratio.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 7241aad9-0095-4b94-b056-0c0de56f5e8e -langcode: en -status: true -dependencies: - module: - - node -id: node.field_knockdown_ratio -field_name: field_knockdown_ratio -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_knockouts.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_knockouts.yml deleted file mode 100644 index 4588925..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_knockouts.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 5d0cc244-2044-4b3b-96be-8cd5ead4e1e4 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_knockouts -field_name: field_knockouts -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_last_name.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_last_name.yml deleted file mode 100644 index 1d1c2fc..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_last_name.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: 0c81c2da-1979-4b37-a29b-e0cdb78e8995 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_last_name -field_name: field_last_name -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_leg_reach.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_leg_reach.yml deleted file mode 100644 index 5da89e1..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_leg_reach.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: dc50d6bf-0642-480e-988e-e37390f192a4 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_leg_reach -field_name: field_leg_reach -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_losses.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_losses.yml deleted file mode 100644 index 8bd859e..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_losses.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: 288335f6-1fff-4f29-a2af-70616c13c9ba -langcode: en -status: true -dependencies: - module: - - node -id: node.field_losses -field_name: field_losses -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_player_photo.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_player_photo.yml deleted file mode 100644 index 128c0b7..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_player_photo.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: d35ea863-cf26-469d-bdaf-468b617483e2 -langcode: en -status: true -dependencies: - module: - - media - - node -id: node.field_player_photo -field_name: field_player_photo -entity_type: node -type: entity_reference -settings: - target_type: media -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_prediction.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_prediction.yml deleted file mode 100644 index f6769fe..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_prediction.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: d6738d5c-af34-4bcb-b217-ff61904886d4 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_prediction -field_name: field_prediction -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_reach.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_reach.yml deleted file mode 100644 index e72c5c5..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_reach.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 712bd9dc-58d0-4bcc-b981-731b3a725220 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_reach -field_name: field_reach -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_result.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_result.yml deleted file mode 100644 index 59351e5..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_result.yml +++ /dev/null @@ -1,19 +0,0 @@ -uuid: f20d5d9f-d9a4-4644-b06a-e2d7c02ef5f3 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_result -field_name: field_result -entity_type: node -type: entity_reference -settings: - target_type: node -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_strikes_per_minute.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_strikes_per_minute.yml deleted file mode 100644 index 98b5e95..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_strikes_per_minute.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 18a251e1-8568-4a45-960b-83b009d94a3b -langcode: en -status: true -dependencies: - module: - - node -id: node.field_strikes_per_minute -field_name: field_strikes_per_minute -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_striking_accuracy.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_striking_accuracy.yml deleted file mode 100644 index 3dd7079..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_striking_accuracy.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 0f6e4cbd-8d76-4c5f-8c92-e6401f148a1d -langcode: en -status: true -dependencies: - module: - - node -id: node.field_striking_accuracy -field_name: field_striking_accuracy -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_submissions.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_submissions.yml deleted file mode 100644 index c8a2c56..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_submissions.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 42853083-7298-43df-807c-607b7941505c -langcode: en -status: true -dependencies: - module: - - node -id: node.field_submissions -field_name: field_submissions -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_takedowns_per_15.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_takedowns_per_15.yml deleted file mode 100644 index 6ebe6af..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_takedowns_per_15.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 970131d2-174b-4e75-a873-937abab255e7 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_takedowns_per_15 -field_name: field_takedowns_per_15 -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_ties.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_ties.yml deleted file mode 100644 index 07ee34d..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_ties.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: 73d01cd2-072a-4cc9-b96c-3fa3164124bc -langcode: en -status: true -dependencies: - module: - - node -id: node.field_ties -field_name: field_ties -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_weight.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_weight.yml deleted file mode 100644 index e8233a5..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_weight.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: 2cff8ca8-3632-4104-ba8f-caf2f3d91394 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_weight -field_name: field_weight -entity_type: node -type: decimal -settings: - precision: 10 - scale: 2 -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_wins.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_wins.yml deleted file mode 100644 index 8a946ef..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.node.field_wins.yml +++ /dev/null @@ -1,21 +0,0 @@ -uuid: 82eb82a9-7025-4857-bcd2-efa273514971 -langcode: en -status: true -dependencies: - module: - - node -id: node.field_wins -field_name: field_wins -entity_type: node -type: string -settings: - max_length: 255 - is_ascii: false - case_sensitive: false -module: core -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/field.storage.taxonomy_term.field_event_date.yml b/web/modules/custom/ufc/config/x-nstall/field.storage.taxonomy_term.field_event_date.yml deleted file mode 100644 index 8c2dcb3..0000000 --- a/web/modules/custom/ufc/config/x-nstall/field.storage.taxonomy_term.field_event_date.yml +++ /dev/null @@ -1,20 +0,0 @@ -uuid: b46f481d-6eda-4bba-ae10-03c0af640edf -langcode: en -status: true -dependencies: - module: - - datetime - - taxonomy -id: taxonomy_term.field_event_date -field_name: field_event_date -entity_type: taxonomy_term -type: datetime -settings: - datetime_type: date -module: datetime -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/web/modules/custom/ufc/config/x-nstall/node.type.fight.yml b/web/modules/custom/ufc/config/x-nstall/node.type.fight.yml deleted file mode 100644 index 5189a61..0000000 --- a/web/modules/custom/ufc/config/x-nstall/node.type.fight.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 58dd5a4f-c2b6-490c-8d82-109621022e9a -langcode: en -status: true -dependencies: - module: - - menu_ui -third_party_settings: - menu_ui: - available_menus: - - main - parent: 'main:' -name: Fight -type: fight -description: 'A fight between two fighters.' -help: '' -new_revision: true -preview_mode: 1 -display_submitted: false diff --git a/web/modules/custom/ufc/config/x-nstall/node.type.fighter.yml b/web/modules/custom/ufc/config/x-nstall/node.type.fighter.yml deleted file mode 100644 index 7f4ff2e..0000000 --- a/web/modules/custom/ufc/config/x-nstall/node.type.fighter.yml +++ /dev/null @@ -1,18 +0,0 @@ -uuid: 8af5329d-7e64-4606-b474-e623bdc143d3 -langcode: en -status: true -dependencies: - module: - - menu_ui -third_party_settings: - menu_ui: - available_menus: - - main - parent: 'main:' -name: Fighter -type: fighter -description: 'A fighter.' -help: '' -new_revision: true -preview_mode: 1 -display_submitted: false diff --git a/web/modules/custom/ufc/config/x-nstall/pathauto.pattern.fights.yml b/web/modules/custom/ufc/config/x-nstall/pathauto.pattern.fights.yml deleted file mode 100644 index af08fae..0000000 --- a/web/modules/custom/ufc/config/x-nstall/pathauto.pattern.fights.yml +++ /dev/null @@ -1,23 +0,0 @@ -uuid: 4ab9533e-d5c9-4583-8d1a-ee3b74c91eef -langcode: en -status: true -dependencies: - module: - - node -id: fights -label: Fights -type: 'canonical_entities:node' -pattern: '/fight/[node:title]' -selection_criteria: - 9022da84-04b3-4e0c-9d1a-0c8d1d17e6fc: - id: 'entity_bundle:node' - negate: false - uuid: 9022da84-04b3-4e0c-9d1a-0c8d1d17e6fc - context_mapping: - node: node - bundles: - fight: fight -selection_logic: and -weight: -5 -relationships: { } - diff --git a/web/modules/custom/ufc/config/x-nstall/taxonomy.vocabulary.ufc_divisions.yml b/web/modules/custom/ufc/config/x-nstall/taxonomy.vocabulary.ufc_divisions.yml deleted file mode 100644 index 7f17607..0000000 --- a/web/modules/custom/ufc/config/x-nstall/taxonomy.vocabulary.ufc_divisions.yml +++ /dev/null @@ -1,8 +0,0 @@ -uuid: 651c73cc-63b1-462a-8286-b292e4badaab -langcode: en -status: true -dependencies: { } -name: 'UFC Divisions' -vid: ufc_divisions -description: 'The different divisions in the UFC' -weight: 0 diff --git a/web/modules/custom/ufc/config/x-nstall/taxonomy.vocabulary.ufc_events.yml b/web/modules/custom/ufc/config/x-nstall/taxonomy.vocabulary.ufc_events.yml deleted file mode 100644 index 9e536aa..0000000 --- a/web/modules/custom/ufc/config/x-nstall/taxonomy.vocabulary.ufc_events.yml +++ /dev/null @@ -1,8 +0,0 @@ -uuid: 06ce81ea-6364-4844-a8a0-4fec95ada9a0 -langcode: en -status: true -dependencies: { } -name: 'UFC Events' -vid: ufc_events -description: 'List of events.' -weight: 0 diff --git a/web/modules/custom/ufc/config/x-nstall/ufc.weights.yml b/web/modules/custom/ufc/config/x-nstall/ufc.weights.yml deleted file mode 100644 index 48e8579..0000000 --- a/web/modules/custom/ufc/config/x-nstall/ufc.weights.yml +++ /dev/null @@ -1,18 +0,0 @@ -fight_weights: - wins: 1 - losses: 1 - age: 1 - height: 1 - weight: 1 - reach: 1 - leg_reach: 1 - knockouts: 1 - decisions: 1 - submissions: 1 - striking_accuracy: 1 - grappling_accuracy: 1 - strikes_per_min: 1 - absorbed_per_min: 1 - takedowns_per_15: 1 - knockout_ratio: 1 - knockout_pct: 1 diff --git a/web/modules/custom/ufc/js/dist/main.min.js b/web/modules/custom/ufc/js/dist/main.min.js deleted file mode 100644 index c564f33..0000000 --- a/web/modules/custom/ufc/js/dist/main.min.js +++ /dev/null @@ -1,33595 +0,0 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./js/src/components/Button.js": -/*!*************************************!*\ - !*** ./js/src/components/Button.js ***! - \*************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); - -function Button(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { - className: "btn btn-" + props.classes - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", { - href: props.link - }, "View Fight")); -} -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Button); - -/***/ }), - -/***/ "./js/src/components/FightCard.js": -/*!****************************************!*\ - !*** ./js/src/components/FightCard.js ***! - \****************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Button */ "./js/src/components/Button.js"); -/* harmony import */ var _Image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Image */ "./js/src/components/Image.js"); -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - - - - -var FightCard = function FightCard() { - var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]), - _useState2 = _slicedToArray(_useState, 2), - fights = _useState2[0], - setFights = _useState2[1]; - (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () { - fetch('/api/v1/recent-fights').then(function (res) { - return res.json(); - }).then(function (data) { - setFights(data); - }); - }, []); - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "d-flex flex-row flex-wrap" - }, fights.map(function (fight, index) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - key: index, - className: "card col-md-3" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "card-header" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Image__WEBPACK_IMPORTED_MODULE_2__["default"], { - alt: "headshot for ufc fighter", - uri: fight.fighter_one_image - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { - id: "versus" - }, "vs."), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Image__WEBPACK_IMPORTED_MODULE_2__["default"], { - alt: "headshot for ufc fighter", - uri: fight.fighter_two_image - })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "card-body" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h4", null, fight.fighter_one), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h4", null, fight.fighter_two)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { - className: "card-footer" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Button__WEBPACK_IMPORTED_MODULE_1__["default"], { - link: fight.url, - classes: "primary" - }))); - })); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FightCard); - -/***/ }), - -/***/ "./js/src/components/Image.js": -/*!************************************!*\ - !*** ./js/src/components/Image.js ***! - \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); - -function Image(props) { - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("img", { - src: props.uri, - className: "img-fluid fightcard-img", - alt: props.alt - }); -} -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Image); - -/***/ }), - -/***/ "./node_modules/react-dom/cjs/react-dom.development.js": -/*!*************************************************************!*\ - !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! - \*************************************************************/ -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -/** - * @license React - * react-dom.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -if (true) { - (function() { - - 'use strict'; - -/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ -if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === - 'function' -) { - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); -} - var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); -var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js"); - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -var suppressWarning = false; -function setSuppressWarning(newSuppressWarning) { - { - suppressWarning = newSuppressWarning; - } -} // In DEV, calls to console.warn and console.error get replaced -// by calls to these methods by a Babel plugin. -// -// In PROD (or in packages without access to React internals), -// they are left as they are instead. - -function warn(format) { - { - if (!suppressWarning) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - printWarning('warn', format, args); - } - } -} -function error(format) { - { - if (!suppressWarning) { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -var FunctionComponent = 0; -var ClassComponent = 1; -var IndeterminateComponent = 2; // Before we know whether it is function or class - -var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - -var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - -var HostComponent = 5; -var HostText = 6; -var Fragment = 7; -var Mode = 8; -var ContextConsumer = 9; -var ContextProvider = 10; -var ForwardRef = 11; -var Profiler = 12; -var SuspenseComponent = 13; -var MemoComponent = 14; -var SimpleMemoComponent = 15; -var LazyComponent = 16; -var IncompleteClassComponent = 17; -var DehydratedFragment = 18; -var SuspenseListComponent = 19; -var ScopeComponent = 21; -var OffscreenComponent = 22; -var LegacyHiddenComponent = 23; -var CacheComponent = 24; -var TracingMarkerComponent = 25; - -// ----------------------------------------------------------------------------- - -var enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing -// the react-reconciler package. - -var enableNewReconciler = false; // Support legacy Primer support on internal FB www - -var enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics. - -var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber - -var enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz -// React DOM Chopping Block -// -// Similar to main Chopping Block but only flags related to React DOM. These are -// grouped because we will likely batch all of them into a single major release. -// ----------------------------------------------------------------------------- -// Disable support for comment nodes as React DOM containers. Already disabled -// in open source, but www codebase still relies on it. Need to remove. - -var disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection. -// and client rendering, mostly to allow JSX attributes to apply to the custom -// element's object properties instead of only HTML attributes. -// https://github.com/facebook/react/issues/11347 - -var enableCustomElementPropertySupport = false; // Disables children for