Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timepicker - update error message design #1781

Merged
merged 3 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions site/content/docs/standard/forms/timepicker/a.html
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,20 @@ <h4 class="mb-5 text-lg font-bold">Via JavaScript</h4>
Sets styles of Timepicker toggle button.
</td>
</tr>
<tr
class="border-b bg-white dark:border-neutral-500 dark:bg-neutral-600">
<td
class="border-r px-6 py-4 font-medium dark:border-neutral-500 max-lg:whitespace-nowrap">
<code>invalidFeedback</code>
</td>
<td
class="border-r px-6 py-4 dark:border-neutral-500 max-lg:whitespace-nowrap">
block absolute text-sm text-red-500 dark:text-red-300
</td>
<td class="px-6 py-4 max-lg:whitespace-nowrap">
Sets styles of Timepicker invalid feedback.
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/js/forms/timepicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ const DefaultClasses = {
"hover:bg-[#00000014] focus:bg-[#00000014] focus:outline-none text-[0.8rem] box-border font-medium leading-[40px] tracking-[.1rem] uppercase border-none bg-transparent [transition:background-color_250ms_cubic-bezier(0.4,0,0.2,1)_0ms,box-shadow_250ms_cubic-bezier(0.4,0,0.2,1)_0ms,border_250ms_cubic-bezier(0.4,0,0.2,1)_0ms] outline-none rounded-[100%] h-[48px] min-w-[48px] inline-block ml-[30px] text-white py-1 px-2 mb-0",
timepickerToggleButton:
"h-4 w-4 ml-auto absolute outline-none border-none bg-transparent right-1.5 top-1/2 -translate-x-1/2 -translate-y-1/2 transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)] cursor-pointer hover:text-[#3b71ca] focus:text-[#3b71ca] dark:hover:text-[#3b71ca] dark:focus:text-[#3b71ca] dark:text-white",
invalidFeedback: "block absolute text-sm text-red-500 dark:text-red-300",
};

const DefaultClassesType = {
Expand Down Expand Up @@ -310,6 +311,7 @@ const DefaultClassesType = {
timepickerInlineModePm: "string",
timepickerInlineSubmitButton: "string",
timepickerToggleButton: "string",
invalidFeedback: "string",
};

/*
Expand Down Expand Up @@ -2676,6 +2678,7 @@ class Timepicker {
if (appendValidationInfo) {
inValidDiv = element("div");
inValidDiv.setAttribute(ATTR_TIMEPICKER_INVALID_FEEDBACK, "");
Manipulator.addClass(inValidDiv, this._classes.invalidFeedback);
inValidDiv.innerHTML = invalidLabel;
}

Expand Down