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

Expose default localization hash #101

Open
romaricpascal opened this issue Jan 27, 2022 · 0 comments
Open

Expose default localization hash #101

romaricpascal opened this issue Jan 27, 2022 · 0 comments

Comments

@romaricpascal
Copy link

Is your feature request related to a problem? Please describe.
I needed to provided the date picker with a custom localisation hash that only had a few keys
different from the default one. Having to provide all the localisation keys required me to hunt for
these default values in the repository.

Describe the solution you'd like
It'd be great if the Hash with the default keys was made accessible somehow (both when using a bundler or not).
I did manage to sort myself with the following import, but that'd only work when getting the package from NPM and using a bundler:

import DUET_DEFAULT_LOCALIZATION from '@duetds/date-picker/dist/collection/components/duet-date-picker/date-localization';

Describe alternatives you've considered
I did try to access the localization property on the element after creation:

const picker = document.createElement('duet-date-picker');
picker.localization // undefined :(

// Some code that adds the picker to the page

requestAnimationFrame(() => { // For lack of a better way to check that the picker is hydrated
  console.log(picker.localization); // same
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant