Git Product home page Git Product logo

ember-collapsible-panel's People

Contributors

alonski avatar billbrower avatar ef4 avatar el1t avatar ember-tomster avatar jbailey4 avatar mansona avatar mnoble01 avatar renovate-bot avatar renovate[bot] avatar rwjblue avatar ryanto avatar samselikoff avatar shicholas avatar thoov avatar vlascik avatar willviles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-collapsible-panel's Issues

Allow transition on initial rendering

At the moment the first click to toggle does not animate the body. I stopped using this addon and wrote a custom component for this reason.

You should use a transition instead of the use option like this:

export default function() {
  this.transition(
    this.includingInitialRender(),
    this.hasClass('some-body'),
    this.use('crossFade')
  );
}

[Infra] Rethink addon primitives as contextual and not UI components

Currently this addon makes some opinionated choices about how the UI of the collapsible panels is rendered.

A better fit for this addon might be to provide contextual components that don't render anything but instead provide the primitives needed for collapsible panels without the UI.

exposing ``isOpen`` to the template

thanks for the great addon!

I'd love to do something like this:

{{#cp-panel as |p|}}
  {{#p.toggle}}
    <h3>
      Cool title
    </h3>
    {{#if p.isOpen}}
      <i class="fa fa-angle-up"></i>
    {{else}}
      <i class="fa fa-angle-down"></i>
    {{/if}}
  {{/p.toggle}}

  {{#p.body}}
    <p>Something cool to show</p>
  {{/p.body}}
{{/cp-panel}}

is there a design reason why the isOpen isn't exposed like above? or am I doing something really dumb at it is anyway?

thanks for the help

Enable Missing CI Scenarios

CI was brought back over in #88 (with the migration from Travis to GitHub Actions), but some CI jobs were disabled there (in order to keep the PR a bit more focused).

This issue is tracking "bringing back" the following CI scenarios:

  • Ember 3.20
  • Ember 3.24
  • Ember 3.28
  • Ember Classic
  • Ember Release
  • Ember Beta
  • Ember Canary
  • Embroider Safe
  • Embroider Optimized

override tagname for all elements

I want to override all the tagNames for creating an expandable table, so I need to override the panel body, the root element's tagname too, etc. Is it possible?

Assertion Failed: A helper named 'panels.panel' could not be found

I was trying to embed collapsible display using version ember-collapsible-panel-1.0.

After installing also, I am getting assertion fail issue.

"Error: Assertion Failed: A helper named 'p.toggle' could not be found
at EmberError (http://localhost:4200/assets/vendor.js:25125:21)
at Object._emberMetalCore.default.assert (http://localhost:4200/assets/vendor.js:14755:13)
at Object.lookupHelper [as default] (http://localhost:4200/assets/vendor.js:20038:32)
at Object.lookupHelperHook [as lookupHelper] (http://localhost:4200/assets/vendor.js:17778:55)
at http://localhost:4200/assets/vendor.js:60155:30
at Object.renderAndCleanup (http://localhost:4200/assets/vendor.js:61625:18)
at hostBlock (http://localhost:4200/assets/vendor.js:60162:32)
at continueBlock (http://localhost:4200/assets/vendor.js:60154:5)
at Object.block (http://localhost:4200/assets/vendor.js:60150:5)
at Object.block (http://localhost:4200/assets/vendor.js:59377:17)"

My hbs code is as sample provided in page.

{{#cp-panel open=true as |p|}}
{{#p.toggle}}

Click me!


{{/p.toggle}}
{{#p.body}}

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nemo repellendus nisi asperiores esse aperiam aliquid nulla ad dolor autem neque, nihil inventore temporibus delectus earum facere corporis, quam ipsum maxime.


Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloribus neque magnam, hic quis beatae repellendus harum modi pariatur minus quidem alias! Eius incidunt impedit eaque, est, illo officiis expedita molestiae.



{{/p.body}}

{{/cp-panel}}

Test cleanup for panel-actions state

Need to add this in a test's afterEach for proper cleanup:

Ember.run(() => {
  application.__container__.lookup('service:panel-actions').get('state').reset();
});

Need a better solution

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • pnpm/action-setup v3
  • actions/setup-node v4
  • actions/checkout v4
  • pnpm/action-setup v3
  • actions/setup-node v4
  • actions/checkout v4
  • pnpm/action-setup v3
  • actions/setup-node v4
.github/workflows/plan-release.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-node v4
  • pnpm/action-setup v2
  • peter-evans/create-pull-request v6
.github/workflows/publish.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/setup-node v4
  • pnpm/action-setup v2
npm
package.json
  • @babel/core ^7.23.2
  • @embroider/macros ^1.10.0
  • @embroider/util ^1.10.0
  • @babel/eslint-parser ^7.22.15
  • @babel/plugin-proposal-decorators ^7.23.2
  • @ember/string ^3.1.1
  • @ember/test-helpers ^3.2.0
  • @embroider/test-setup ^3.0.2
  • @glimmer/component ^1.1.2
  • @glimmer/tracking ^1.1.2
  • bootstrap ^3.3.7
  • concurrently ^8.2.2
  • ember-auto-import ^2.6.3
  • ember-cli-clean-css ^3.0.0
  • ember-cli-terser ^4.0.2
  • ember-code-snippet ^3.0.0
  • ember-page-title ^8.0.0
  • ember-source-channel-url ^3.0.0
  • ember-template-lint ^5.11.2
  • ember-try ^3.0.0
  • eslint ^8.52.0
  • eslint-config-prettier ^9.0.0
  • eslint-plugin-n ^15.7.0
  • eslint-plugin-prettier ^5.0.1
  • eslint-plugin-qunit ^8.0.1
  • lint-to-the-future ^2.0.0
  • lint-to-the-future-ember-template ^1.2.0
  • lint-to-the-future-eslint ^2.0.1
  • lint-to-the-future-stylelint ^1.0.0
  • prettier ^3.0.3
  • qunit ^2.20.0
  • release-plan ^0.8.0
  • stylelint ^15.11.0
  • stylelint-config-standard ^34.0.0
  • stylelint-prettier ^4.0.2
  • webpack ^5.89.0
  • liquid-fire >= 0.32.0
  • node 14.* || 16.* || 18.* || >= 20

  • Check this box to trigger a request for Renovate to run again on this repository

ios cordova issue

When I use this addon with ios on cordova, I have to tap the panels twice to open initially, after which they can be toggled with one tap. I have ember-hammertime and added the touch-action: manipulation; cursor: pointer; to the cp-Panel class. What can I do to fix this?

dependency-checker can't find dependencies when cp-panel installed via addon

I'll try to explain as best as I can but essentially our app is composed like this:

  • consuming app
    • component library add-on
      • ember-collapsible-panel
      • a bunch of other components

The dependency-checker service appears to be looking at the consuming applications environment for the add-on ENV['ember-collapsible-panel'], and not the add-on with which it was bootstrapped.

Currently, I've been able to get around this simply by installing the add-on at the consuming application.

@samselikoff Great add-on. Some very cool patterns in here.

Add deploy preview

Is there a way to add a deploy preview to the CI checks? If so, that would make it easier to review some PRs.

Public API for panel state

use case: detecting if any panels in a group have been opened (for conditionally displaying a "collapse all" button)

options:

  1. isAnyOpen(groupName) - boolean flag specific to this use case
  2. getPanelStates(groupName) - expose an array of state data (probably just panel name and isOpen) and let consumer compute a flag. This could accommodate additional use cases, but also exposes more data publicly.
    cc @ryanto @samselikoff

Rename `panelActions` to something else

Currently panelActions exposes actions to mutate the state. #7 adds methods that let users query the state of panelActions, so we should rename this. Perhaps to cpPanels.

Checkbox inside the panel header not working

The checkbox inside the panel header is not working.
I know that the panel header wraps any element in an tag thus making the whole panel header a link.
Is there a way to include checkbox or any other element inside the header?

Error using component in FastBoot

Im seeing an error when trying to use this addon in an app running FastBoot. It explodes pretty spectacularly and FastBoot ends up returning a 502 bad gateway.

There was an error running your app in fastboot. More info about the error: 
 ReferenceError: name is not defined
    at Module.callback (/dist/fastboot/vendor.js:82789:11)
    at Module.exports (/dist/fastboot/vendor.js:132:32)
    at Module.reify (dist/fastboot/vendor.js:153:59)
    at Module.exports (dist/fastboot/vendor.js:130:10)
    at requireModule (dist/fastboot/vendor.js:32:18)
    at _extractDefaultExport (dist/fastboot/vendor.js:112943:20)
    at resolveOther (dist/fastboot/vendor.js:112656:32)
    at superWrapper (dist/fastboot/vendor.js:26374
          throw new Error('infinite rendering invalidation detected');
          ^
Error: infinite rendering invalidation detected
    at Array.loopEnd

It seems to be https://github.com/tedconf/ember-collapsible-panel/blob/master/addon/services/panel-actions.js#L4 that is throwing the error. Im assuming its because name is undefined at that point.

Changing it to name: null seems to fix the FastBoot error.

Uncaught Error: unreachable

Not really sure what's going on, but in a fresh ember app, I'm getting the following error:
image

my project is simply:

$ ember -v
ember-cli: 3.3.0
node: 8.11.3
os: darwin x64

$ ember new scratch
...

$ cd scratch
$ ember install ember-collapsible-panel
...
[replace application.hbs with "basic usage" example from the docs site]

I can give you a repo if you like. I have a hunch it has to do with the module unification/pod component structure.

Latest version 3.2.1 is not on npm

It appears the latest tagged version, 3.2.1, is not on npm. I tried install it but it said the latest version is 3.2.0. The npm UI says similar.

image

ember-collapsible-panel may need an ember-cli-version-checker major version bump

With Ember-CLI 2.18.2, I'm getting the following deprecation message at the start of an ember serve:

DEPRECATION: An addon is trying to access project.nodeModulesPath. This is not a reliable way to discover npm modules. Instead, consider doing: require("resolve").sync(something, { basedir: project.root }). Accessed from:   new NPMDependencyVersionChecker (C:\Users\rmack\Code\TFS\filterwizard\trunk\source\FilterWizardClient\node_modules\ember-collapsible-panel\node_modules\ember-cli-version-checker\src\npm-dependency-version-checker.js:11:33)

The root of the problem is:

ember-collapsible-panel@^2.1.1:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/ember-collapsible-panel/-/ember-collapsible-panel-2.1.1.tgz#2ab8b564f221a284079bd2a049a5f8f29b3fef44"
  dependencies:
    ember-cli-babel "^5.1.6"
    ember-cli-htmlbars "^1.0.3"
    ember-cli-version-checker "^1.1.6" 

The latest ember-cli-version-checker is 2.1.0, a major version bump above 1.1.6 (or 1.3.0 or ...), a bit further than I wanted to tweak up in the yarn.lock, since semver promises the possibility of breaking changes.

aria-expanded issue

Recently, PR #43 added the aria-expanded attr to the cp-panel-toggle component when it becomes open. This works in that the attr is added to the DOM, but screen readers do not annouce that state. It turns out ARIA attrs need to have an actual value assigned to it, e.g. aria-expaned="true" or aria-expanded="false".

Something like the following could be done:

attributeBindings: [ 'ariaExpanded:aria-expaned' ]

ariaExpanded: computed('isOpen', function() {
  return this.isOpen ? "true" : "false" ;
})

disable click option

I have a use case where I want to disable the on-click listener on the panel-toggle component. I can overwrite the on-click property in the dom to equal false but then the console throws an error since the action attempts to treat it as a function.

I'm currently passing in a empty function (instead of a boolean) to avoid the error. Could add a "disableClick" property.

this.attrs.disableClick ? null : this.get("on-click")();

Willing to open up a PR if interested.

Support for a min-height

I was wondering if you'd be interested in supporting a min-height setting? Instead of completely closed and completely open, it would not collapse further than the min-height if that property's been set.

So for example:

{{#cp-panel is-open=true min-height=50px}}

Transfer repo?

Hello former colleagues!

I've been half-maintaining this repo since leaving TED, and was thinking it'd be much easier to keep up-to-date with our modern best practices/Travis setups/etc. if we were to transfer it to our EmberMap Github org, where I would have full access to it.

What do you think? We'll take it off of your hands, and of course make sure it still serves all the original use cases if it happens to still be in use at TED!

If this sounds good let's chat next steps :)

/cc @VinSpee

Expose toggleIsOpen to parent component for ddau flow

What I would like to do:

  • pass an action "toggleIsOpen" to the panel
  • that action gets called
  • I check if opening is allowed based on application state
  • If ok, i set open=true

Is this possible? For now i hack something, but support for ddau pattern would be great!

Thanks for this add-on!

first item open=true

I have a code that generate a new panels.panel inside a #each helper and i want to make only first panel with open=true. There's a way to do this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.