You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add feedback survey component
* Upgrade dependencies to get tests running
* Add unit tests for new features
* Add missing logic & tests for comment box styles
* Switch from updated to willUpdate to avoid needless cycles
* Add further unit tests for the feedback survey
* Rename some vars
* Update naming & exports
* Ensure prompts fill max width
* Update background color
* Send 'rating' instead of 'vote', improve docs
* Refactor for much greater extensibility
* Reflect extra properties
* Remove some unused types
* Add focus traps, aria roles, and labels where necessary
* Remove unneeded async from method
* Correct outdated doc comment
* Use ia-styles for button styling
* Update README with information about the new survey features
* Switch from CSS-based numbering to slotted text to satisfy Safari
* Clean up template a bit for readability
* Fix focus method to find the first focusable slotted child
* Slightly simplify focusable condition
Currently this package defines three subcomponents that can be used as survey "questions":
90
+
-`<ia-survey-vote>`: Seeks an up/down vote, optionally with a freeform text comment too -- like the single-question feature feedback widget.
91
+
Accepts the following attributes/properties:
92
+
-`prompt` (string): The question text to display beside the vote buttons. If not provided, no prompt text will be rendered.
93
+
-`vote` ("up" | "down"): Optionally allows setting the initial up/down vote state of the question if desired.
94
+
-`comment` (string): Optionally allows setting the comment response for the question if desired.
95
+
-`showComments` (boolean): If true, shows a freeform textarea beneath the vote buttons.
96
+
-`commentPlaceholder` (string): The placeholder text to render in the textarea when it is empty (see `placeholder` for `<ia-survey-comment>` below).
97
+
-`required` (boolean): If true, ensures that the survey cannot be submitted unless a vote is entered for this question.
98
+
A text comment is never required for these questions, even when shown. To require text input, use a separate `<ia-survey-comment>` question.
99
+
-`disabled` (boolean): If true, the question will not allow the vote to be changed or the comment to be edited by the user.
100
+
-`skipNumber` (boolean): If true, this question will not participate in question numbering -- it will neither display a number itself nor increment the
101
+
number used for the next question.
102
+
103
+
-`<ia-survey-comment>`: Seeks a freeform text comment alone. Accepts the following attributes/properties:
104
+
-`prompt` (string): The question text to display above the textarea. If not provided, no prompt text will be rendered.
105
+
-`value` (string): Optionally allows setting the comment response for the question if desired.
106
+
-`placeholder` (string): The placeholder text to render in the textarea when it is empty.
107
+
If not provided, a default of either `Comments` or `Comments (optional)` will be used, depending on the `required` state of this component.
108
+
-`required` (boolean): If true, ensures that the survey cannot be submitted unless a non-empty comment is entered for this question.
109
+
-`disabled` (boolean): If true, the question will not allow the user to edit the comment.
110
+
-`skipNumber` (boolean): If true, this question will not participate in question numbering -- it will neither display a number itself nor increment the
111
+
number used for the next question.
112
+
113
+
-`<ia-survey-extra>`: Does not render a question to the user, but instead defines additional info to be submitted with survey responses for context.
114
+
Accepts the following attributes/properties:
115
+
-`name` (string): A name to associate with this extra info field.
116
+
-`value` (string): The value of this field to be submitted in the survey response.
117
+
118
+
One may define additional question components that can participate in survey responses, as long as they conform to the `IASurveyQuestionInterface`.
119
+
120
+
Other arbitrary elements may also be included presentationally within the survey, to be slotted into the popup alongside any questions.
121
+
Such elements will generally not have any effect on submitted survey responses unless they conform to the interface noted above.
122
+
123
+
#### Styling
124
+
125
+
Both the `<ia-survey-vote>` and `<ia-survey-comment>` components accept optional CSS variables to adjust the height or resizability of their comment textareas:
126
+
-`--commentHeight` (defaults to `50px`)
127
+
-`--commentResize` (`none`, `horizontal`, `vertical`, or `both` -- defaults to `none`). See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/resize) for more details.
0 commit comments