-
-
Notifications
You must be signed in to change notification settings - Fork 822
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
sl-datepicker component #474
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/shoelace/shoelace/8JGFHnzo6BEXfqYf5mBGn5oNtVp2 |
Great!
|
All good points, especially this one. Shoelace is still at an early stage and there are some areas that need to thought about more in depth before jumping in too deep. That said, I don't want things like this to stifle new components, especially contributions. For the time being, I'd suggest using a single prop for i18n as a stopgap: myElement.i18n = {
someTerm: 'Some Term',
...
}; This isn't intended to be a longterm i18n strategy and it won't handle pluralization, numerals, etc. but it will let contributors move forward with great ideas in a way that won't be hard to upgrade their work once we do solve i18n. |
Not really sure whether this is interesting, but just for information, here's how this is done in Vaadin web components: |
Another example which works in a similar way: https://github.com/duetds/date-picker/blob/master/src/components/duet-date-picker/date-localization.ts |
|
Thanks for posting the docs so it's easier to play with. This is looking really good :) A couple things I've noticed:
This is one of the nicest looking calendar views I've seen — well done on the UI! 🤩 |
From this comment:
Is this all original code? If we're using code from another project, we'll need to attribute them and include the necessary license(s). |
Browsing between months with Page Up, Page Down. Does not work?
If you jump to a day of the month before/next the calendar switch month automatically. Do you mean this? This behavior can be changed.
It is not possible to select a year at the moment. Would you like to integrate a dropdown?
Ok, i will change the default values for the cell sizes. Is the calendar header also too big?
I tried with Brave in linux but I can't reproduce this issue 😢 .
I will update the syntax with the new version |
No I only took a couple of functions, but with the new commit |
[Edit] I've just noticed there's already an issue regarding this topic: #191 @hanc2006 @claviska The support for RTL (right-to-left) is not proper for some shoelace components. The date picker also does not support RTL at the moment. For the date picker, RTL support might be a bit more challenging than for less complex components (for example that left-to-right arrow icon must be replaced with a right-to-left arrow icon, I guess), so maybe it would be an idea to start "fully RTL support" with the date picker to gain some experiences that might help to make the other SL components also fully RTL capable. What do you think? |
Here are GIFs of the arrow keys in Chrome/macOS. I'm pressing down twice, then up twice. Now I'm pressing left twice (skips a day), right twice (doesn't move). UPDATE: the same behavior occurs on Safari and Firefox on macOS. |
RTL will come after the theme updates. I've seen helper functions that make it a lot easier to do, and those will be much easier to implement in CSS-in-JS (i.e. Lit's template literal syntax) than in Sass. |
@claviska For keyboard accessibility? What shortcut could I use?? |
I would look at Duet: https://duetds.github.io/date-picker/ In fact, my original plan was to fork this one for Shoelace. They've ran it through an accessibility audit so it's pretty bulletproof from an a11y standpoint. They don't support date range, but they do support disabling individual days. |
The last commit
The ability to disable days is in work progress, but this will only be possible when
I will work on this version also, by now I finished the first above. |
…ated calendar facade, improved component style
This commit d7910e8 adds some new features:
simplescreenrecorder-2021-07-10_20.38.15.mp4 |
…ated calendar facade, improved component style
…dated doc component
Closed in favor of this new PR #486. |
Added the
sl-datepicker
component to shoelace library.This pull request don't include the component doc. Fixed timezone issue with date #467 (comment)Other relevant commits: