-
Notifications
You must be signed in to change notification settings - Fork 180
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
feat: date-picker #570
feat: date-picker #570
Conversation
…ith a input function * add date picker story * add form/format examples
…ting * style ng-icon instead of svg
@goetzrobin @ashley-hunter do you have an idea how to support forms via When I support both, they are added to the providers array providers: [
HLM_DATE_PICKER_VALUE_ACCESSOR,
{
provide: BrnFormFieldControl,
useExisting: HlmDatePickerComponent,
},
provideIcons({ lucideCalendar }),
], But when I add
|
Unfortunately a storm here has taken out my internet connection and I only have a very limited mobile connection. It could be a few days before my connection is restored, but I'll happily look into it as soon as I am able. |
No worries! Take care first! |
Hey, just one question. Is there a option to provide a date range picker as well like in shadcn? |
Date range is not yet supported by the calendar component. That need to be added first, before adding the option to the date picker component. |
@goetzrobin @ashley-hunter date picker component is ready for review. It integrates with Forms/ReactiveForms. One thing thats missing is additional support for FormField via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Great work! Just noticed a few small things, apart from that looks really good!
|
||
public readonly userClass = input<ClassValue>('', { alias: 'class' }); | ||
protected readonly _computedClass = computed(() => | ||
hlm( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I checked the shadcn/ui styles and it looks like the calendar only receives border styles when used in line. I override the border styles for the date-picker calendar, thus only the styles from the popover content are applied.
nxCode="npx nx g @spartan-ng/cli:ui date-picker" | ||
ngCode="ng g @spartan-ng/cli:ui date-picker" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the CLI ui generator has been updated to support this component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes totally forgot about that! I added it to the generator and updated the primitive dependencies as well
* add calendarClass input to calendar component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
Awesome work! I just tried to use the library and noticed this was missing. Great to see it so close to making it in 🥇 |
PR Checklist
Please check if your PR fulfills the following requirements:
guidelines: https://github.com/goetzrobin/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
What is the current behavior?
Closes #112
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Implements
NG_VALUE_ACCESSOR
for Forms/ReactiveForms integrationImplementing
BrnFormFieldControl
to support FormField results in duplicate injection ofHlmDatePickerComponent