@unabridged/midwest 0.14.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,8 @@ import ConfirmationController from '../../../components/midwest/confirmation_com
19
19
  import AvatarGroup from '../../../components/midwest/avatar_group_component/avatar_group_component_controller.js';
20
20
  import Chart from '../../../components/midwest/chart_component/chart_component_controller.js';
21
21
  export { default as Chart } from '../../../components/midwest/chart_component/chart_component_controller.js';
22
+ import Range from '../../../components/midwest/form/range_component/range_component_controller.js';
23
+ import Rating from '../../../components/midwest/rating_component/rating_component_controller.js';
22
24
 
23
25
  function registerMidwestControllers(application) {
24
26
  application.register("midwest-card", Card);
@@ -38,6 +40,8 @@ function registerMidwestControllers(application) {
38
40
  application.register("midwest-confirmation", ConfirmationController);
39
41
  application.register("midwest-avatar-group", AvatarGroup);
40
42
  application.register("midwest-chart", Chart);
43
+ application.register("midwest-range", Range);
44
+ application.register("midwest-rating", Rating);
41
45
  }
42
46
 
43
47
  export { registerMidwestControllers };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../app/assets/javascript/midwest/index.ts"],"sourcesContent":["import Card from '../../../components/midwest/card_component/card_component_controller'\nimport Banner from '../../../components/midwest/banner_component/banner_component_controller'\nimport Input from '../../../components/midwest/form/input_component/input_component_controller'\nimport File from '../../../components/midwest/form/file_component/file_component_controller'\nimport Dropdown from '../../../components/midwest/dropdown_component/dropdown_component_controller'\nimport Prose from '../../../components/midwest/prose_component/prose_component_controller'\nimport Dialog from '../../../components/midwest/dialog_component/dialog_component_controller'\nimport Tabs from '../../../components/midwest/tabs_component/tabs_component_controller'\nimport Tooltip from '../../../components/midwest/tooltip_component/tooltip_component_controller'\nimport Carousel from '../../../components/midwest/carousel_component/carousel_component_controller'\nimport FormLiveSummary from '../../../components/midwest/form/live_summary_component/live_summary_component_controller'\nimport Form from '../../../components/midwest/form/form_controller'\nimport CountdownTimer from '../../../components/midwest/countdown_timer_component/countdown_timer_component_controller'\nimport Badge from '../../../components/midwest/badge_component/badge_component_controller'\nimport Confirmation from '../../../components/midwest/confirmation_component/confirmation_component_controller'\nimport AvatarGroup from '../../../components/midwest/avatar_group_component/avatar_group_component_controller'\nimport Chart from '../../../components/midwest/chart_component/chart_component_controller'\n/* IMPORTS */\n\nexport { Card, Banner, CountdownTimer, Chart }\n\nexport function registerMidwestControllers (application: any) {\n application.register('midwest-card', Card)\n application.register('midwest-banner', Banner)\n application.register('midwest-countdown-timer', CountdownTimer)\n application.register('midwest-input', Input)\n application.register('midwest-file', File)\n application.register('midwest-dropdown', Dropdown)\n application.register('midwest-prose', Prose)\n application.register('midwest-dialog', Dialog)\n application.register('midwest-tabs', Tabs)\n application.register('midwest-tooltip', Tooltip)\n application.register('midwest-carousel', Carousel)\n application.register('midwest-form-live-summary', FormLiveSummary)\n application.register('midwest-form', Form)\n application.register('midwest-badge', Badge)\n application.register('midwest-confirmation', Confirmation)\n application.register('midwest-avatar-group', AvatarGroup)\n application.register('midwest-chart', Chart)\n /* EXPORTS */\n}\n"],"names":["Confirmation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBO,SAAS,2BAA4B,WAAkB,EAAA;AAC5D,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,kBAAkB,MAAM,CAAA,CAAA;AAC7C,EAAY,WAAA,CAAA,QAAA,CAAS,2BAA2B,cAAc,CAAA,CAAA;AAC9D,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,oBAAoB,QAAQ,CAAA,CAAA;AACjD,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,kBAAkB,MAAM,CAAA,CAAA;AAC7C,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,mBAAmB,OAAO,CAAA,CAAA;AAC/C,EAAY,WAAA,CAAA,QAAA,CAAS,oBAAoB,QAAQ,CAAA,CAAA;AACjD,EAAY,WAAA,CAAA,QAAA,CAAS,6BAA6B,eAAe,CAAA,CAAA;AACjE,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,wBAAwBA,sBAAY,CAAA,CAAA;AACzD,EAAY,WAAA,CAAA,QAAA,CAAS,wBAAwB,WAAW,CAAA,CAAA;AACxD,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAE7C;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../app/assets/javascript/midwest/index.ts"],"sourcesContent":["import Card from '../../../components/midwest/card_component/card_component_controller'\nimport Banner from '../../../components/midwest/banner_component/banner_component_controller'\nimport Input from '../../../components/midwest/form/input_component/input_component_controller'\nimport File from '../../../components/midwest/form/file_component/file_component_controller'\nimport Dropdown from '../../../components/midwest/dropdown_component/dropdown_component_controller'\nimport Prose from '../../../components/midwest/prose_component/prose_component_controller'\nimport Dialog from '../../../components/midwest/dialog_component/dialog_component_controller'\nimport Tabs from '../../../components/midwest/tabs_component/tabs_component_controller'\nimport Tooltip from '../../../components/midwest/tooltip_component/tooltip_component_controller'\nimport Carousel from '../../../components/midwest/carousel_component/carousel_component_controller'\nimport FormLiveSummary from '../../../components/midwest/form/live_summary_component/live_summary_component_controller'\nimport Form from '../../../components/midwest/form/form_controller'\nimport CountdownTimer from '../../../components/midwest/countdown_timer_component/countdown_timer_component_controller'\nimport Badge from '../../../components/midwest/badge_component/badge_component_controller'\nimport Confirmation from '../../../components/midwest/confirmation_component/confirmation_component_controller'\nimport AvatarGroup from '../../../components/midwest/avatar_group_component/avatar_group_component_controller'\nimport Chart from '../../../components/midwest/chart_component/chart_component_controller'\nimport Range from '../../../components/midwest/form/range_component/range_component_controller'\nimport Rating from '../../../components/midwest/rating_component/rating_component_controller'\n/* IMPORTS */\n\nexport { Card, Banner, CountdownTimer, Chart }\n\nexport function registerMidwestControllers (application: any) {\n application.register('midwest-card', Card)\n application.register('midwest-banner', Banner)\n application.register('midwest-countdown-timer', CountdownTimer)\n application.register('midwest-input', Input)\n application.register('midwest-file', File)\n application.register('midwest-dropdown', Dropdown)\n application.register('midwest-prose', Prose)\n application.register('midwest-dialog', Dialog)\n application.register('midwest-tabs', Tabs)\n application.register('midwest-tooltip', Tooltip)\n application.register('midwest-carousel', Carousel)\n application.register('midwest-form-live-summary', FormLiveSummary)\n application.register('midwest-form', Form)\n application.register('midwest-badge', Badge)\n application.register('midwest-confirmation', Confirmation)\n application.register('midwest-avatar-group', AvatarGroup)\n application.register('midwest-chart', Chart)\n application.register('midwest-range', Range)\n application.register('midwest-rating', Rating)\n /* EXPORTS */\n}\n"],"names":["Confirmation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBO,SAAS,2BAA4B,WAAkB,EAAA;AAC5D,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,kBAAkB,MAAM,CAAA,CAAA;AAC7C,EAAY,WAAA,CAAA,QAAA,CAAS,2BAA2B,cAAc,CAAA,CAAA;AAC9D,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,oBAAoB,QAAQ,CAAA,CAAA;AACjD,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,kBAAkB,MAAM,CAAA,CAAA;AAC7C,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,mBAAmB,OAAO,CAAA,CAAA;AAC/C,EAAY,WAAA,CAAA,QAAA,CAAS,oBAAoB,QAAQ,CAAA,CAAA;AACjD,EAAY,WAAA,CAAA,QAAA,CAAS,6BAA6B,eAAe,CAAA,CAAA;AACjE,EAAY,WAAA,CAAA,QAAA,CAAS,gBAAgB,IAAI,CAAA,CAAA;AACzC,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,wBAAwBA,sBAAY,CAAA,CAAA;AACzD,EAAY,WAAA,CAAA,QAAA,CAAS,wBAAwB,WAAW,CAAA,CAAA;AACxD,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,iBAAiB,KAAK,CAAA,CAAA;AAC3C,EAAY,WAAA,CAAA,QAAA,CAAS,kBAAkB,MAAM,CAAA,CAAA;AAE/C;;;;"}
@@ -0,0 +1,25 @@
1
+ import { Controller } from '@hotwired/stimulus';
2
+
3
+ class Range extends Controller {
4
+ static targets = ["input", "output"];
5
+ connect() {
6
+ this.sync();
7
+ }
8
+ update() {
9
+ this.sync();
10
+ }
11
+ sync() {
12
+ const input = this.inputTarget;
13
+ const min = Number(input.min) || 0;
14
+ const max = Number(input.max) || 100;
15
+ const val = Number(input.value);
16
+ const pct = max === min ? 0 : (val - min) / (max - min) * 100;
17
+ input.style.setProperty("--pct", `${pct}%`);
18
+ if (this.hasOutputTarget) {
19
+ this.outputTarget.value = String(val);
20
+ }
21
+ }
22
+ }
23
+
24
+ export { Range as default };
25
+ //# sourceMappingURL=range_component_controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range_component_controller.js","sources":["../../../../../../../../app/components/midwest/form/range_component/range_component_controller.ts"],"sourcesContent":["import { Controller } from '@hotwired/stimulus'\n\nexport default class Range extends Controller<HTMLElement> {\n static targets = ['input', 'output']\n\n declare readonly inputTarget: HTMLInputElement\n declare readonly hasOutputTarget: boolean\n declare readonly outputTarget: HTMLOutputElement\n\n connect () {\n // The inline style already has the correct --pct from the server render, but\n // sync here in case the value was mutated before Stimulus connected (e.g.\n // browser autofill or Turbo cache restoration).\n this.sync()\n }\n\n update () {\n this.sync()\n }\n\n private sync () {\n const input = this.inputTarget\n const min = Number(input.min) || 0\n const max = Number(input.max) || 100\n const val = Number(input.value)\n const pct = max === min ? 0 : ((val - min) / (max - min)) * 100\n\n input.style.setProperty('--pct', `${pct}%`)\n\n if (this.hasOutputTarget) {\n this.outputTarget.value = String(val)\n }\n }\n}\n"],"names":[],"mappings":";;AAEA,MAAqB,cAAc,UAAwB,CAAA;AAAA,EACzD,OAAO,OAAA,GAAU,CAAC,OAAA,EAAS,QAAQ,CAAA,CAAA;AAAA,EAMnC,OAAW,GAAA;AAIT,IAAA,IAAA,CAAK,IAAK,EAAA,CAAA;AAAA,GACZ;AAAA,EAEA,MAAU,GAAA;AACR,IAAA,IAAA,CAAK,IAAK,EAAA,CAAA;AAAA,GACZ;AAAA,EAEQ,IAAQ,GAAA;AACd,IAAA,MAAM,QAAQ,IAAK,CAAA,WAAA,CAAA;AACnB,IAAA,MAAM,GAAM,GAAA,MAAA,CAAO,KAAM,CAAA,GAAG,CAAK,IAAA,CAAA,CAAA;AACjC,IAAA,MAAM,GAAM,GAAA,MAAA,CAAO,KAAM,CAAA,GAAG,CAAK,IAAA,GAAA,CAAA;AACjC,IAAM,MAAA,GAAA,GAAM,MAAO,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAC9B,IAAA,MAAM,MAAM,GAAQ,KAAA,GAAA,GAAM,KAAM,GAAM,GAAA,GAAA,KAAQ,MAAM,GAAQ,CAAA,GAAA,GAAA,CAAA;AAE5D,IAAA,KAAA,CAAM,KAAM,CAAA,WAAA,CAAY,OAAS,EAAA,CAAA,EAAG,GAAM,CAAA,CAAA,CAAA,CAAA,CAAA;AAE1C,IAAA,IAAI,KAAK,eAAiB,EAAA;AACxB,MAAK,IAAA,CAAA,YAAA,CAAa,KAAQ,GAAA,MAAA,CAAO,GAAG,CAAA,CAAA;AAAA,KACtC;AAAA,GACF;AACF;;;;"}
@@ -0,0 +1,47 @@
1
+ import { Controller } from '@hotwired/stimulus';
2
+
3
+ class Rating extends Controller {
4
+ static targets = ["star"];
5
+ connect() {
6
+ this.refreshFilledState();
7
+ }
8
+ preview(event) {
9
+ const label = event.currentTarget;
10
+ const hoverValue = Number(label.dataset.value);
11
+ this.starTargets.forEach((star) => {
12
+ const starValue = Number(star.dataset.value);
13
+ star.classList.toggle("is-previewed", starValue <= hoverValue);
14
+ });
15
+ }
16
+ resetPreview() {
17
+ this.starTargets.forEach((star) => star.classList.remove("is-previewed"));
18
+ this.refreshFilledState();
19
+ }
20
+ select(event) {
21
+ const label = event.currentTarget;
22
+ const input = this.element.querySelector(
23
+ `#${label.htmlFor}`
24
+ );
25
+ if (input) {
26
+ input.checked = true;
27
+ this.element.classList.add("has-value");
28
+ }
29
+ this.refreshFilledState();
30
+ }
31
+ refreshFilledState() {
32
+ const checked = this.element.querySelector(
33
+ 'input[type="radio"]:checked'
34
+ );
35
+ const selectedValue = checked ? Number(checked.value) : 0;
36
+ this.starTargets.forEach((star) => {
37
+ const starValue = Number(star.dataset.value);
38
+ star.classList.toggle("is-filled", starValue <= selectedValue);
39
+ });
40
+ if (selectedValue > 0) {
41
+ this.element.classList.add("has-value");
42
+ }
43
+ }
44
+ }
45
+
46
+ export { Rating as default };
47
+ //# sourceMappingURL=rating_component_controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rating_component_controller.js","sources":["../../../../../../../app/components/midwest/rating_component/rating_component_controller.ts"],"sourcesContent":["import { Controller } from '@hotwired/stimulus'\n\nexport default class Rating extends Controller<HTMLElement> {\n static targets = ['star']\n\n declare readonly starTargets: HTMLLabelElement[]\n\n connect () {\n this.refreshFilledState()\n }\n\n preview (event: MouseEvent) {\n const label = event.currentTarget as HTMLLabelElement\n const hoverValue = Number(label.dataset.value)\n\n this.starTargets.forEach(star => {\n const starValue = Number(star.dataset.value)\n star.classList.toggle('is-previewed', starValue <= hoverValue)\n })\n }\n\n resetPreview () {\n this.starTargets.forEach(star => star.classList.remove('is-previewed'))\n this.refreshFilledState()\n }\n\n select (event: MouseEvent) {\n const label = event.currentTarget as HTMLLabelElement\n const input = this.element.querySelector<HTMLInputElement>(\n `#${label.htmlFor}`\n )\n if (input) {\n input.checked = true\n this.element.classList.add('has-value')\n }\n this.refreshFilledState()\n }\n\n private refreshFilledState () {\n const checked = this.element.querySelector<HTMLInputElement>(\n 'input[type=\"radio\"]:checked'\n )\n const selectedValue = checked ? Number(checked.value) : 0\n\n this.starTargets.forEach(star => {\n const starValue = Number(star.dataset.value)\n star.classList.toggle('is-filled', starValue <= selectedValue)\n })\n\n if (selectedValue > 0) {\n this.element.classList.add('has-value')\n }\n }\n}\n"],"names":[],"mappings":";;AAEA,MAAqB,eAAe,UAAwB,CAAA;AAAA,EAC1D,OAAO,OAAU,GAAA,CAAC,MAAM,CAAA,CAAA;AAAA,EAIxB,OAAW,GAAA;AACT,IAAA,IAAA,CAAK,kBAAmB,EAAA,CAAA;AAAA,GAC1B;AAAA,EAEA,QAAS,KAAmB,EAAA;AAC1B,IAAA,MAAM,QAAQ,KAAM,CAAA,aAAA,CAAA;AACpB,IAAA,MAAM,UAAa,GAAA,MAAA,CAAO,KAAM,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAA;AAE7C,IAAK,IAAA,CAAA,WAAA,CAAY,QAAQ,CAAQ,IAAA,KAAA;AAC/B,MAAA,MAAM,SAAY,GAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAA;AAC3C,MAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAO,cAAgB,EAAA,SAAA,IAAa,UAAU,CAAA,CAAA;AAAA,KAC9D,CAAA,CAAA;AAAA,GACH;AAAA,EAEA,YAAgB,GAAA;AACd,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,CAAA,IAAA,KAAQ,KAAK,SAAU,CAAA,MAAA,CAAO,cAAc,CAAC,CAAA,CAAA;AACtE,IAAA,IAAA,CAAK,kBAAmB,EAAA,CAAA;AAAA,GAC1B;AAAA,EAEA,OAAQ,KAAmB,EAAA;AACzB,IAAA,MAAM,QAAQ,KAAM,CAAA,aAAA,CAAA;AACpB,IAAM,MAAA,KAAA,GAAQ,KAAK,OAAQ,CAAA,aAAA;AAAA,MACzB,IAAI,KAAM,CAAA,OAAA,CAAA,CAAA;AAAA,KACZ,CAAA;AACA,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,KAAA,CAAM,OAAU,GAAA,IAAA,CAAA;AAChB,MAAK,IAAA,CAAA,OAAA,CAAQ,SAAU,CAAA,GAAA,CAAI,WAAW,CAAA,CAAA;AAAA,KACxC;AACA,IAAA,IAAA,CAAK,kBAAmB,EAAA,CAAA;AAAA,GAC1B;AAAA,EAEQ,kBAAsB,GAAA;AAC5B,IAAM,MAAA,OAAA,GAAU,KAAK,OAAQ,CAAA,aAAA;AAAA,MAC3B,6BAAA;AAAA,KACF,CAAA;AACA,IAAA,MAAM,aAAgB,GAAA,OAAA,GAAU,MAAO,CAAA,OAAA,CAAQ,KAAK,CAAI,GAAA,CAAA,CAAA;AAExD,IAAK,IAAA,CAAA,WAAA,CAAY,QAAQ,CAAQ,IAAA,KAAA;AAC/B,MAAA,MAAM,SAAY,GAAA,MAAA,CAAO,IAAK,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAA;AAC3C,MAAA,IAAA,CAAK,SAAU,CAAA,MAAA,CAAO,WAAa,EAAA,SAAA,IAAa,aAAa,CAAA,CAAA;AAAA,KAC9D,CAAA,CAAA;AAED,IAAA,IAAI,gBAAgB,CAAG,EAAA;AACrB,MAAK,IAAA,CAAA,OAAA,CAAQ,SAAU,CAAA,GAAA,CAAI,WAAW,CAAA,CAAA;AAAA,KACxC;AAAA,GACF;AACF;;;;"}
@@ -3740,6 +3740,70 @@ class Chart extends Controller {
3740
3740
  }
3741
3741
  }
3742
3742
 
3743
+ class Range extends Controller {
3744
+ static targets = ["input", "output"];
3745
+ connect() {
3746
+ this.sync();
3747
+ }
3748
+ update() {
3749
+ this.sync();
3750
+ }
3751
+ sync() {
3752
+ const input = this.inputTarget;
3753
+ const min = Number(input.min) || 0;
3754
+ const max = Number(input.max) || 100;
3755
+ const val = Number(input.value);
3756
+ const pct = max === min ? 0 : (val - min) / (max - min) * 100;
3757
+ input.style.setProperty("--pct", `${pct}%`);
3758
+ if (this.hasOutputTarget) {
3759
+ this.outputTarget.value = String(val);
3760
+ }
3761
+ }
3762
+ }
3763
+
3764
+ class Rating extends Controller {
3765
+ static targets = ["star"];
3766
+ connect() {
3767
+ this.refreshFilledState();
3768
+ }
3769
+ preview(event) {
3770
+ const label = event.currentTarget;
3771
+ const hoverValue = Number(label.dataset.value);
3772
+ this.starTargets.forEach((star) => {
3773
+ const starValue = Number(star.dataset.value);
3774
+ star.classList.toggle("is-previewed", starValue <= hoverValue);
3775
+ });
3776
+ }
3777
+ resetPreview() {
3778
+ this.starTargets.forEach((star) => star.classList.remove("is-previewed"));
3779
+ this.refreshFilledState();
3780
+ }
3781
+ select(event) {
3782
+ const label = event.currentTarget;
3783
+ const input = this.element.querySelector(
3784
+ `#${label.htmlFor}`
3785
+ );
3786
+ if (input) {
3787
+ input.checked = true;
3788
+ this.element.classList.add("has-value");
3789
+ }
3790
+ this.refreshFilledState();
3791
+ }
3792
+ refreshFilledState() {
3793
+ const checked = this.element.querySelector(
3794
+ 'input[type="radio"]:checked'
3795
+ );
3796
+ const selectedValue = checked ? Number(checked.value) : 0;
3797
+ this.starTargets.forEach((star) => {
3798
+ const starValue = Number(star.dataset.value);
3799
+ star.classList.toggle("is-filled", starValue <= selectedValue);
3800
+ });
3801
+ if (selectedValue > 0) {
3802
+ this.element.classList.add("has-value");
3803
+ }
3804
+ }
3805
+ }
3806
+
3743
3807
  function registerMidwestControllers(application) {
3744
3808
  application.register("midwest-card", Card);
3745
3809
  application.register("midwest-banner", Banner);
@@ -3758,6 +3822,8 @@ function registerMidwestControllers(application) {
3758
3822
  application.register("midwest-confirmation", ConfirmationController);
3759
3823
  application.register("midwest-avatar-group", AvatarGroup);
3760
3824
  application.register("midwest-chart", Chart);
3825
+ application.register("midwest-range", Range);
3826
+ application.register("midwest-rating", Rating);
3761
3827
  }
3762
3828
 
3763
3829
  export { Banner, Card, Chart, CountdownTimer, registerMidwestControllers };