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

feat(core): PrimitiveCalendar add ability to change the color of the days #2904

Merged
merged 5 commits into from
Oct 20, 2022

Conversation

vladimirpotekhin
Copy link
Member

@vladimirpotekhin vladimirpotekhin commented Oct 14, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows Conventional Commits
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Code style update
  • Build or CI related changes
  • Documentation content changes

What is the current behavior?

Closes #2606

What is the new behavior?

Снимок экрана 2022-10-14 в 17 40 31

Does this PR introduce a breaking change?

  • Yes
  • No

@lumberjack-bot
Copy link

lumberjack-bot bot commented Oct 14, 2022

Pull request was closed ✔️

All saved screenshots (for current PR) were deleted 🗑️

@bundlemon
Copy link

bundlemon bot commented Oct 14, 2022

BundleMon

Files updated (2)
Status Path Size Limits
demo/browser/main.(hash).js
318.22KB (+159B +0.05%) +10%
demo/browser/runtime.(hash).js
33.89KB (+53B +0.15%) +10%
Unchanged files (3)
Status Path Size Limits
demo/browser/vendor.(hash).js
205.38KB +10%
demo/browser/polyfills.(hash).js
19.92KB +10%
demo/browser/scripts.(hash).js
14.92KB +10%

Total files change +212B +0.03%

Groups updated (1)
Status Path Size Limits
demo/browser/*..js
2.17MB (+1.32KB +0.06%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@github-actions
Copy link
Contributor

github-actions bot commented Oct 14, 2022

Visit the preview URL for this PR (updated for commit a82758d):

https://taiga-ui--pr2904-calendar-days-color-krc3gv5e.web.app

(expires Thu, 20 Oct 2022 10:18:42 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4b5ece1e114386f6a105425ef799091475b249eb

@codecov
Copy link

codecov bot commented Oct 14, 2022

Codecov Report

Base: 67.26% // Head: 61.75% // Decreases project coverage by -5.50% ⚠️

Coverage data is based on head (a82758d) compared to base (36af99e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2904      +/-   ##
==========================================
- Coverage   67.26%   61.75%   -5.51%     
==========================================
  Files         748     1465     +717     
  Lines        9427    17333    +7906     
  Branches     1316     2351    +1035     
==========================================
+ Hits         6341    10704    +4363     
- Misses       2862     6191    +3329     
- Partials      224      438     +214     
Flag Coverage Δ
addon-charts 72.48% <ø> (-14.29%) ⬇️
addon-doc 48.38% <ø> (ø)
addon-editor 53.20% <ø> (ø)
addon-mobile 61.68% <100.00%> (ø)
addon-table 64.06% <ø> (ø)
addon-tablebars 98.07% <ø> (∅)
cdk 40.29% <ø> (∅)
core 76.30% <100.00%> (∅)
kit 73.57% <ø> (-0.06%) ⬇️
summary 61.75% <100.00%> (-5.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ndar-mobile/primitive-calendar-mobile.component.ts 100.00% <100.00%> (ø)
...primitive-calendar/primitive-calendar.component.ts 86.56% <100.00%> (ø)
projects/core/tokens/day-type-handler.ts 100.00% <100.00%> (ø)
projects/core/tokens/index.ts 100.00% <100.00%> (ø)
.../components/multi-select/multi-select.component.ts 77.02% <0.00%> (-2.50%) ⬇️
projects/kit/constants/index.ts 100.00% <0.00%> (ø)
projects/kit/components/push/push.service.ts 60.00% <0.00%> (ø)
...ojects/kit/components/push/push-alert.directive.ts 53.84% <0.00%> (ø)
...ts/addon-table/components/table/tr/tr.component.ts 41.66% <0.00%> (ø)
...table/components/table/directives/row.directive.ts 50.00% <0.00%> (ø)
... and 719 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@evantrimboli
Copy link
Contributor

I think it would be good to leave the weekend markers in here and allow locales to determine what the weekends are. Consider switching from a locale where the workweek goes from Mon -> Fri, to a locale where it's Mon -> Sat.

@waterplea
Copy link
Collaborator

I think it would be good to leave the weekend markers in here and allow locales to determine what the weekends are. Consider switching from a locale where the workweek goes from Mon -> Fri, to a locale where it's Mon -> Sat.

I'm not sure, what if somebody wants to color Saturdays and Sundays differently? I'm not sure there's a real use case for that, but more freedom in this case could be good.

@evantrimboli
Copy link
Contributor

evantrimboli commented Oct 17, 2022

I would say keeping the distinction between weekdays/weekends is good because it's fairly common to want to know that for business apps. It's a pretty reasonable default to at least mark those cells as such.

On top of that, is it possible to allow users to decorate cells with data attributes? For example, if I could pass some function:

const decorate = (d: Date) => {
  const attrs = [];
  if (isWeekendDay(d)) {
    attrs.push('weekend');
  }
  if (isPublicHoliday(d)) {
    attrs.push('holiday');
  }
  if (isSomeonesBirthday(d)) {
    attrs.push('birthday');
  }
  return attrs;
}

The underlying cell would then have <div class="cell" data-weekend="true" data-holiday="true"> and you could target specific cells, but the core wouldn't need to bake anything in, just the ability to add the attributes.

@vladimirpotekhin vladimirpotekhin merged commit 3a14454 into main Oct 20, 2022
@vladimirpotekhin vladimirpotekhin deleted the calendar-days-color branch October 20, 2022 09:49
@well-done-bot
Copy link

well-done-bot bot commented Oct 20, 2022

'Well done'

@tinkoff-bot tinkoff-bot mentioned this pull request Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

🚀 - Calendar should provide way to customize weekends
4 participants