Skip to content

feat(layout): Form add default options #11016

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Stivin
Copy link

@Stivin Stivin commented May 27, 2025

Added default values ​​and a provider to override directive tuiForm parameters at a global or more local level. This way we can define the required size once and not specify it every time in the templates.

Fixes #11010

@Stivin Stivin requested a review from a team as a code owner May 27, 2025 13:26
@Stivin Stivin requested review from MarsiBarsi, waterplea, nsbarsukov, vladimirpotekhin and mdlufy and removed request for a team May 27, 2025 13:26
Copy link

lumberjack-bot bot commented May 27, 2025

Tests completed successfully ✅

Good job 🔥

Copy link

nx-cloud bot commented May 27, 2025

View your CI Pipeline Execution ↗ for commit b7e5809.

Command Status Duration Result
nx run-many --target test --all --output-style=... ✅ Succeeded 25s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-28 12:15:58 UTC

Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.44%. Comparing base (a36a982) to head (b7e5809).
Report is 18 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11016      +/-   ##
==========================================
- Coverage   64.70%   64.44%   -0.27%     
==========================================
  Files        1299     1310      +11     
  Lines       17253    17467     +214     
  Branches     2476     2571      +95     
==========================================
+ Hits        11163    11256      +93     
- Misses       5945     5954       +9     
- Partials      145      257     +112     
Flag Coverage Δ
summary 64.44% <ø> (-0.27%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

bundlemon bot commented May 27, 2025

BundleMon

Unchanged files (5)
Status Path Size Limits
demo/browser/main.(hash).js
328.39KB +10%
demo/browser/vendor.(hash).js
260.99KB +10%
demo/browser/runtime.(hash).js
50.55KB +10%
demo/browser/styles.(hash).css
21.16KB +10%
demo/browser/polyfills.(hash).js
11.18KB +10%

Total files change -10B 0%

Groups updated (1)
Status Path Size Limits
demo/browser/*..js
8.9MB (-493B -0.01%) -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

protected readonly nothing = tuiWithStyles(TuiFormStyles);

public size: TuiFormOptions['size'] = this.options.size;

@Input('tuiForm')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for an alias

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alias was removed

tuiButtonOptionsProvider(TuiForm),
tuiNotificationOptionsProvider(TuiForm),
projectSize(TUI_BUTTON_OPTIONS, (size) => size),
projectSize(TUI_NOTIFICATION_OPTIONS, (size) => size),
projectSize(TUI_HEADER_OPTIONS, (size) => HEADER_SIZE[size]!),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we drop type of HEADER_SIZE and add as const? We can then change type in projectSize to TuiHandler<TuiFormOptions['size'], string> and get rid of !?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Did you want something like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

🚀 - tuiForm has no default value
2 participants