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

Grid Widget #185

Open
16 of 19 tasks
Tracked by #129 ...
nexushoratio opened this issue Nov 2, 2023 · 1 comment
Open
16 of 19 tasks
Tracked by #129 ...

Grid Widget #185

nexushoratio opened this issue Nov 2, 2023 · 1 comment
Labels
enhancement New feature or request library For libraries

Comments

@nexushoratio
Copy link
Owner

nexushoratio commented Nov 2, 2023

Having decided against w2ui, time to set forth some requirements for a new grid widget:

  • Widget enhancements #190
  • Use ARIA roles
  • rowClasses function that takes record and returns a list of CSS classes used to style a row
  • Columns are explicitly defined via methods
    • title human readable name of the column
    • field of the data records for this column
    • render() function that takes record and returns Widget
    • Move renderFunc out of config, like we use for Grid.rowClasses()
    • Move title to a setter, and make field a regular parameter
    • Must have field
    • CSS support
      • classList - Default should include field as a class (should end up on td, not widget)
  • Use live data, so this class does not need to worry about adding/removing records
  • Access to columns
  • build()
  • Move rows into thead/tbody elements

More features can be added as needed

@nexushoratio nexushoratio added enhancement New feature or request linkedin-tool For the LinkedIn Tool userscript labels Nov 2, 2023
@nexushoratio nexushoratio self-assigned this Nov 2, 2023
@nexushoratio
Copy link
Owner Author

Using w2ui seems to work with minimal effort. At least first demo from the site works.

// @require     https://cdn.jsdelivr.net/npm/w2ui@2.0.0/w2ui-2.0.min.js
// @resource    bob https://cdn.jsdelivr.net/npm/w2ui@2.0.0/w2ui-2.0.min.css
// @grant GM.getResourceUrl

  const link = document.createElement('link');
  link.href = await GM.getResourceUrl('bob');
  link.rel = 'stylesheet';
  link.type = 'text/css';
  document.head.append(link);

  const info = new NH.widget.Info('Popup');
  info.container.style = 'width: 65%; height: 95%;';
  document.body.prepend(info.container);

  // Widget configuration
  const config = {
... w2ui demo data ...
  };

  const layout = new w2layout(config.layout);
  const sidebar = new w2sidebar(config.sidebar);
  const grid1 = new w2grid(config.grid1);
  const grid2 = new w2grid(config.grid2);
  // Initialization
  layout.render(`#${info.container.id}`);
  layout.html('left', sidebar);
  layout.html('main', grid1);
  info.open();

nexushoratio pushed a commit that referenced this issue Nov 4, 2023
nexushoratio pushed a commit that referenced this issue Nov 5, 2023
Does not do anything yet, but it does allow me to act in developer mode with
one less local change.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Nov 5, 2023
Does not do anything yet, but it does allow me to act in developer mode with
one less local change.

Issue #185.

␄
@nexushoratio nexushoratio removed their assignment Nov 7, 2023
nexushoratio pushed a commit that referenced this issue Nov 7, 2023
Mostly this grabs new dev things, like better error messaging and test
assertions.

Issues #170, #185.

␄
@nexushoratio nexushoratio self-assigned this Nov 7, 2023
@nexushoratio nexushoratio changed the title Advanced Grid/Table Widget Grid Widget Nov 8, 2023
@nexushoratio nexushoratio removed their assignment Nov 9, 2023
@nexushoratio nexushoratio self-assigned this Jan 6, 2024
nexushoratio pushed a commit that referenced this issue Jan 9, 2024
nexushoratio pushed a commit that referenced this issue Jan 11, 2024
nexushoratio pushed a commit that referenced this issue Jan 14, 2024
If a caller needs it, they can supply it.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Jan 14, 2024
nexushoratio pushed a commit that referenced this issue Jan 17, 2024
nexushoratio pushed a commit that referenced this issue Jan 17, 2024
nexushoratio pushed a commit that referenced this issue Jan 17, 2024
nexushoratio pushed a commit that referenced this issue Jan 21, 2024
nexushoratio pushed a commit that referenced this issue Jan 24, 2024
nexushoratio pushed a commit that referenced this issue Jan 27, 2024
Like data, this will start off live and manipulated directly.  Convience
methods, if any, will come later.

Also, remove a bit of snarkiness from the data comment.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Jan 29, 2024
More consistent with other APIs.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Jan 29, 2024
nexushoratio pushed a commit that referenced this issue Jan 29, 2024
nexushoratio pushed a commit that referenced this issue Jan 29, 2024
Not complete, but will display.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Jan 31, 2024
nexushoratio pushed a commit that referenced this issue Jan 31, 2024
nexushoratio pushed a commit that referenced this issue Feb 2, 2024
nexushoratio pushed a commit that referenced this issue Feb 8, 2024
This makes it consistent with `Grid.rowClasses()`.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Feb 8, 2024
nexushoratio pushed a commit that referenced this issue Feb 12, 2024
nexushoratio pushed a commit that referenced this issue Feb 12, 2024
nexushoratio pushed a commit that referenced this issue Feb 12, 2024
More like `Grid`.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Feb 14, 2024
nexushoratio pushed a commit that referenced this issue Feb 14, 2024
A forth coming `ColClassesFunc` will have a slightly different signature, so
keep the names a bit more explicit.

Along similar lines, also rename the associated methods.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Feb 16, 2024
nexushoratio pushed a commit that referenced this issue Feb 16, 2024
This will allow for a future change to have a parallel item.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Feb 18, 2024
These are accessible as a separate method that `Grid` can use to style the
resulting `td` element, like it does for `tr`.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Feb 19, 2024
The regexp was too forgiving and did not detect that contents were duplicated.

Issue #185.

␄
nexushoratio pushed a commit that referenced this issue Feb 23, 2024
@nexushoratio nexushoratio added library For libraries and removed linkedin-tool For the LinkedIn Tool userscript labels Feb 23, 2024
@nexushoratio nexushoratio removed their assignment Feb 23, 2024
nexushoratio pushed a commit that referenced this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request library For libraries
Projects
None yet
Development

No branches or pull requests

1 participant