-
Notifications
You must be signed in to change notification settings - Fork 0
Introduce a customizable loading stagger animation on hypertableV2 #275
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
Changes from all commits
ff59352
2809ede
d6db292
6d2c2fa
05868d4
efdd85d
b0b3a31
50571e6
f0128fe
ac8d8c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -192,6 +192,97 @@ HyperTableV2 supports several named blocks that allow you to customize specific | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| </HyperTableV2> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #### HyperTableV2 options | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| `@options` lets you configure optional component behaviors. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ##### selectionIntlKeyPath | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Type: `string` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Required: no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Custom base i18n key path used by `HyperTableV2::Selection` for: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `<path>.all_records_selected` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `<path>.records_selected` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `<path>.select_all` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Default path: `hypertable.selection`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Note: the clear action label currently uses `hypertable.selection.clear` directly. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```ts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| selectionIntlKeyPath: 'my.table.selection' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ##### delegatedFiltering | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Type: `boolean` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Required: no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Disables built-in column filter UI and ordering indicators in `HyperTableV2::Column`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Use this when filtering and sorting are handled by external controls. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```ts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| delegatedFiltering: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ##### initialLoadAnimation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Type: `boolean | object` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Required: no | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Enables a one-time animation sequence on the first successful non-empty rows load. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Accepted values: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `undefined` or `false`: no animation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `true`: enables animation with defaults. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - object: enables animation and overrides defaults. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Behavior: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Base behavior: rows are revealed with a staggered sequence across all non-loading cells. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Extra class behavior: when `extraColumnEffect.class` is set, that class is added on top of the base sequence on each cell that matches the columns specified in `extraColumnEffect.columns`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Selection column behavior: by default, the extra class does not apply on selection checkbox cells. Set `includeSelectionColumnInExtraEffect` to `true` to include them. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Extra class delay behavior: `extraColumnEffect.delayMs` adds an extra delay before the extra class effect starts. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - If `extraColumnEffect.columns` is omitted or empty, `extraColumnEffect.class` is applied to cells from all columns. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```ts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| initialLoadAnimation: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| delayMs: 300, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| staggerMs: 40, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maxAnimationDurationMs: 1500, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| extraColumnEffect: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| class: 'smart-rotating-gradient', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| delayMs: 120, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| columns: ['foo', 'bar'] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| includeSelectionColumnInExtraEffect: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+255
to
+269
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: are these example options or the default options? Maybe something like this?
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or maybe just the interface? Idk
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are example options (though some match the defaults), the object is there just to show how a user can use it ; I did the same for the other "options" before this section. Concerning adding typing in comments next to it, that's not useful IMO as the types are described just below 🙏 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Fields: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `delayMs` (number): Delay before the sequence starts. Default: `300`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `staggerMs` (number): Extra delay applied per row (`rowIndex * staggerMs`). Default: `40`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `maxAnimationDurationMs` (number): Extra duration added after stagger starts to keep the animation state active. Default: `5000`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `extraColumnEffect` (object): Optional extra effect options. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `extraColumnEffect.class` (string): Optional extra CSS class added to targeted cells while animation is active. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `extraColumnEffect.delayMs` (number): Extra delay applied before the `extraColumnEffect.class` effect starts. Default: `0`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `extraColumnEffect.columns` (string[]): Column keys that receive `extraColumnEffect.class`. If omitted or empty, the extra class is applied to all columns. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - `includeSelectionColumnInExtraEffect` (boolean): Whether the extra class should also be applied on selection checkbox cells when selection is enabled. Default: `false`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Notes: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - The sequence runs once per component lifecycle. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Core Concepts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Column Definitions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
question: I'm not sure I understand the need for this.
To me it looks like a possible foot-gun in certain edge cases (large screen size with lots of rows... or long
staggerMsanddelayMssettings)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.
This is exactly for that scenario (large screen with lots of rows) where you don't necessarily want the animation running for 3minutes because you have 500 loaded rows :P
It gives us the opportunity to cancel it after a certain amount of time