Download the PHP package team383/livewire-resource-time-grid without Composer

On this page you can find all versions of the php package team383/livewire-resource-time-grid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package livewire-resource-time-grid

Livewire Resource Time Grid

This package allows you to build resource/time grid to show events in a "calendar" way. You can define resources as anything that owns an event, eg. a particular day, a user, a client, etc. Events loaded with the component will be then rendered in columns according to the resource it belongs to and the starting date of the event.

This package is based on https://github.com/asantibanez/livewire-resource-time-grid, but has significantly diverged from this in order to support Laravel 11 and Livewire 3, and also provides various improvements and additional features.

Preview

preview

Installation

You can install the package via composer:

Requirements

This package uses livewire/livewire (https://laravel-livewire.com/) under the hood.

It also uses TailwindCSS (https://tailwindcss.com/) for base styling.

Please make sure you include both of this dependencies before using this component.

Usage

In order to use this component, you must create a new Livewire component that extends from LivewireResourceTimeGrid

You can use make:livewire to create a new component. For example.

In the AppointmentsGrid class, instead of extending from the base Component Livewire class, extend from LivewireResourceTimeGrid. Also, remove the render method. You'll have a class similar to this snippet.

In this class, you must override the following methods

In resources() method, return a collection holding the "resources" that own the events that are going to be listed in the grid. These "resources" must be arrays with key => value pairs and must include an id and a title. You can add any other keys to each "resource as needed"

Example

In the events() method, return a collection holding the events that belong to each of the "resources" returned in the resources() method. Events must also be keyed arrays holding at least the following keys: id, title, starts_at, ends_at, resource_id.

Also, the following conditions are expected for each returned event:

Example

Now, we can include our component in any view. You must specify 3 parameters, starting-hour, ending-hour and interval. These parameters represent the times of a day the grid will render and how many divisions per hour it will display. (interval must be in minutes and less than 60)

Example

You should include scripts with @livewireResourceTimeGrid to enable drag and drop which is turned on by default. You must include them after @livewireScripts

This will render a grid starting from 8am til 7pm inclusive with time slots of 15 minutes.

example

By default, the component uses all the available width and height. You can constrain it to use a specific set of dimensions with a wrapper element.

Advanced Usage

UI customization

You can customize the behavior of the component with the following properties when rendering on a view:

Example

[!CAUTION] UI Customisation has not been tested with the new 383 implementation; care should be taken to reproduce the necessary parts within each view to ensure your custom views preserve required functionality.

Interaction customization

You can override the following methods to add interactivity to your component

You can also override how events and resources are matched instead of using a resource_id and id respectively. To do this, you must override the following method

The base implementation for this method is

You can customize it as you need. 👍

383's Additions

As well as bringing the code up to date, we have also added a few features which may be useful.

Reactive properties

In order to facilitate live updating of key layout features on the fly, we have made the following fields reactive:

For this to work correctly, you will need to arrange a few things:

Drag-to-scroll & Drag-to-create

We have added a feature which allows you to drag the grid to scroll it. This is particularly useful when you have a large number of resources and events, and you want to be able to scroll through them quickly. This works by scrolling the grid horizontally, or the whole page vertically if you are at the top or bottom of the grid. This is achieved by holding the right mouse button and moving the mouse, or by holding the shift key while dragging.

There is also a hover-over tooltip that repeats the column header and the time slot so it's easy to see where you are when the page is scrolled.

In addition you can create new items by dragging from the top of the grid to the bottom. This will create a new event in the resource you are dragging from, with the start and end times corresponding to the time slot you are dragging to. Use the middle button, or hold control while dragging, to use this feature.

These features must be individually enabled like this:

Per-event styling

The original version of this package required a single set of styles from a single function; this was not flexible enough for our requirements at 383 as we needed to have different colours and content for different events.

Therefore you can now provide a lot more details in the event array; here is an example from our implementation:

By including this information in the event array, you can now style the header, body and footer of each event individually. This allows you to have different colours, fonts, sizes, etc. for each event, and to include additional information in the event card.

Original Information

[!WARNING] None of the following information has been explicitly updated in the 383 environment, and as such everything that follows should be considered as potentially out of date information, and may not apply.

Testing

Todo

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of livewire-resource-time-grid with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0|^8.1|^8.2|^8.3|^8.4
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
livewire/livewire Version ^1.0|^2.0|^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package team383/livewire-resource-time-grid contains the following files

Loading the files please wait ...