Git Product home page Git Product logo

nova-global-filter's People

Contributors

ali-raza-saleem avatar chrisvasey avatar cord avatar davide-granello avatar muzafferdede 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

Watchers

 avatar  avatar

nova-global-filter's Issues

Layout global filter

currently, the global filter card consumes a lot of space.
Would be great to have a slim version

1 2020-05-01 14-02-44
or even some options to style like this:
71813573-429dc280-307a-11ea-9238-a128968b8847

wonder if this could be achieved with allow the user to add some CSS classes or define a custom view?

Add empty value for filters

Hi,

When including a filter, it comes with a default value I don't know if it is applied, nor how it choose it.

To compare with Nova behaviour, Nova always include an empty value. This allows to add / remove filter easily.

Here, when I choose a filter, I cannot remove it. Even with 'reset', it reset to the first value of the list.

There should have a -- first entry.

Dependency Filter

Hi,

Would it be possible to make the filters dependent on other filters?
So e.g. if the first filter has countries and the second has cities it will refresh the options in the city filter when changing the country?

Custom filter with key() doesn't work

If i define key() method in my custom filter, for example if i want two instances of date filter: from & to, then check !in_array($filter, $filters) in globalFiltered method will always return false, because $filter will be equal defined key() and in $filters array will be simple class name of my filter.

Implementing on custom cards

Hi,

Nice plugin, very useful.

I'm trying to use it on a custom card, based on Nova-charts

If I can send the filter into calculate() method for trends, how should I send it to a custom card.

Here is my Card definition:

class BarChart extends Card
{
    use GlobalFilterable;
    /**
     * The width of the card (1/3, 1/2, or full).
     *
     * @var string
     */
    public $width = 'full';

    public function __construct($component = null)
    {
        parent::__construct($component);
    }

    /**
     * Get the component name for the element.
     *
     * @return string
     */
    public function component()
    {
        return 'bar-chart';
    }

    public function series(array $series): self
    {
        return $this->withMeta([ 'series' => $series]);
    }

    public function type(string $type): self
    {
        return $this->withMeta([ 'type' => $type ]);
    }

    public function options(array $options): self
    {
        return $this->withMeta([ 'options' => (object) $options ]);
    }

    public function animations(array $animations): self
    {
        return $this->withMeta([ 'animations' => $animations ]);
    }

    public function title(string $title): self
    {
        return $this->withMeta([ 'title' => $title ]);
    }

    public function model(string $model): self
    {
        return $this->withMeta([ 'model' => $model ]);
    }

    public function join(string $joinTable, string $joinColumnFirst, string $joinEqual, string $joinColumnSecond): self
    {
        return $this->withMeta([ 'join' => ['joinTable' => $joinTable, 'joinColumnFirst' => $joinColumnFirst, 'joinEqual' => $joinEqual, 'joinColumnSecond' => $joinColumnSecond] ]);
    }
}

can this also be used to apply a global filter to all resources themselves?

I went looking for a global filter that would be applicable to all resources. All my resources belong to a "season" and I want to filter them all so it only ever shows data from one season at a time. Can your global filter be used this way? To be clear I'm not interested in using cards on any of my resources.

Thanks!

Clearing filters

Firstly - well done on a really well designed and useful package.
One question from my side - is there a way to "clear" the filters?
It would be great to have clear option on each dropdown or maybe even on the containing card?

DateFilter

I'm having some issues with this package, first the default in my DateFilter is not showing, while is showing if I add that to a resource. Second when I select a date is always showing the time as well, always 00:00:00, while inside the resource it only shows the date without the time.

Question: how to set filter?

Idea:
when clicking on a partition segment a filter is set to the clicked value.

That would allow "drilling down" into the data by clicking on charts.

How can we set a filter in the global filter programmatically?

Get initial global-filters into a custom component

Hi, thanks for your work in this component

I am trying to make a custom component that wraps nova-chartjs in order to allow filtering from your component. I am able to capture the emmit Event with the changes to the Global Filters and react to them, however, I would need to access the original values from the filters at load. Is there any way I can hook into this data?

New installation: caching issues

when installing I need to do a hard reload a couple of times (?) before the filter widget was shown. The cards-request returned the filter card, but it was not visible. I guess due to the overloading of js resources?

other nova package do not show

When i insert nova package (ampeco/nova-date-range-filter) into the NovaGlobalFilter, the date range filter do not show.

Maybe you should be compatible with other nova packages.

Translated by Google. Sry, My English is poor.

Can't use custom filter with arguments in constructor

If my custom filter requires some arguments in constructor, for example i want to pass column name, operator for query etc. then i cant use this filter because of $currentFilter = new $filter; line in globalFiltered. Maybe it will be useful to check type of $filter and if it is already object just use it instead of trying to create new instance.
My current workaround - set all required properties in separated methods instead of passing them to constructor.

Positioning of filter card

Currently, the global filter card is always at the bottom regardless of the code order in the cards() method - would be great if we can control this? (I know there have been some issues with the way nova handles the order)

global-filter-changed event is fired onChange and OnBlur

When i use global date filter and pick my date from the datepicker. it fires same event onBlur and OnChange that creates two requests. How can i disable the event onBlur?

new NovaGlobalFilter([
                new DateFilter(), // Date Filter
            ]),

Feature Request: Primary and Secondary Filters

To organise the global filter card it would be great if we can group filters into primary and secondary:

Primary Filters: always visible
Secondary Filter: accessible with click on filter icon (like on resources)

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.