From 72a1ce4dd8d94ed092c4c24c37e7209eff67e544 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Mon, 8 Jan 2024 17:27:57 -0800 Subject: [PATCH] feat(checkbox, combobox, input-date-picker, input-time-picker, segmented-control, select): add required property (#8517) **Related Issue:** #8057 ## Summary Remove the `@internal` tag from the `required` property on form components. --------- Co-authored-by: Kitty Hurley Co-authored-by: Matt Driscoll --- .../src/components/checkbox/checkbox.tsx | 6 +----- .../src/components/combobox/combobox.tsx | 6 +----- .../components/input-date-picker/input-date-picker.tsx | 6 +----- .../components/input-time-picker/input-time-picker.tsx | 6 +----- .../calcite-components/src/components/rating/rating.tsx | 3 +-- .../components/segmented-control/segmented-control.tsx | 9 ++------- .../calcite-components/src/components/select/select.tsx | 6 +----- 7 files changed, 8 insertions(+), 34 deletions(-) diff --git a/packages/calcite-components/src/components/checkbox/checkbox.tsx b/packages/calcite-components/src/components/checkbox/checkbox.tsx index feb8265254b..4d4c96acb2d 100644 --- a/packages/calcite-components/src/components/checkbox/checkbox.tsx +++ b/packages/calcite-components/src/components/checkbox/checkbox.tsx @@ -91,11 +91,7 @@ export class Checkbox */ @Prop({ reflect: true }) name: string; - /** - * When `true`, the component must have a value in order for the form to submit. - * - * @internal - */ + /** When `true`, the component must have a value in order for the form to submit. */ @Prop({ reflect: true }) required = false; /** Specifies the size of the component. */ diff --git a/packages/calcite-components/src/components/combobox/combobox.tsx b/packages/calcite-components/src/components/combobox/combobox.tsx index 9822f832d7d..c9b8f7c46ef 100644 --- a/packages/calcite-components/src/components/combobox/combobox.tsx +++ b/packages/calcite-components/src/components/combobox/combobox.tsx @@ -210,11 +210,7 @@ export class Combobox this.reposition(true); } - /** - * When `true`, the component must have a value in order for the form to submit. - * - * @internal - */ + /** When `true`, the component must have a value in order for the form to submit. */ @Prop({ reflect: true }) required = false; /** diff --git a/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx b/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx index 9408f0d8f2a..0d2062f84af 100644 --- a/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx +++ b/packages/calcite-components/src/components/input-date-picker/input-date-picker.tsx @@ -305,11 +305,7 @@ export class InputDatePicker /** When `true`, activates a range for the component. */ @Prop({ reflect: true }) range = false; - /** - * When `true`, the component must have a value in order for the form to submit. - * - * @internal - */ + /** When `true`, the component must have a value in order for the form to submit. */ @Prop({ reflect: true }) required = false; /** diff --git a/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx b/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx index 7dfc4b6b4fe..9a8920b59f9 100644 --- a/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx +++ b/packages/calcite-components/src/components/input-time-picker/input-time-picker.tsx @@ -270,11 +270,7 @@ export class InputTimePicker ); } - /** - * When `true`, the component must have a value in order for the form to submit. - * - * @internal - */ + /** When `true`, the component must have a value in order for the form to submit. */ @Prop({ reflect: true }) required = false; /** Specifies the size of the component. */ diff --git a/packages/calcite-components/src/components/rating/rating.tsx b/packages/calcite-components/src/components/rating/rating.tsx index 5f83d21ae67..a5aa09da9b4 100644 --- a/packages/calcite-components/src/components/rating/rating.tsx +++ b/packages/calcite-components/src/components/rating/rating.tsx @@ -75,8 +75,7 @@ export class Rating * * When not set, the component will be associated with its ancestor form element, if any. */ - @Prop({ reflect: true }) - form: string; + @Prop({ reflect: true }) form: string; /** * Made into a prop for testing purposes only diff --git a/packages/calcite-components/src/components/segmented-control/segmented-control.tsx b/packages/calcite-components/src/components/segmented-control/segmented-control.tsx index 472c218fced..54031e97ad3 100644 --- a/packages/calcite-components/src/components/segmented-control/segmented-control.tsx +++ b/packages/calcite-components/src/components/segmented-control/segmented-control.tsx @@ -67,14 +67,9 @@ export class SegmentedControl * * When not set, the component will be associated with its ancestor form element, if any. */ - @Prop({ reflect: true }) - form: string; + @Prop({ reflect: true }) form: string; - /** - * When `true`, the component must have a value in order for the form to submit. - * - * @internal - */ + /** When `true`, the component must have a value in order for the form to submit. */ @Prop({ reflect: true }) required = false; /** diff --git a/packages/calcite-components/src/components/select/select.tsx b/packages/calcite-components/src/components/select/select.tsx index 8d716faae50..50fe06ea36c 100644 --- a/packages/calcite-components/src/components/select/select.tsx +++ b/packages/calcite-components/src/components/select/select.tsx @@ -100,11 +100,7 @@ export class Select */ @Prop({ reflect: true }) name: string; - /** - * When `true`, the component must have a value in order for the form to submit. - * - * @internal - */ + /** When `true`, the component must have a value in order for the form to submit. */ @Prop({ reflect: true }) required = false; /**