Data Grid Complete, looking for issues and bugs now
This commit is contained in:
parent
a7081205f8
commit
6da3b5bc83
|
|
@ -29,7 +29,8 @@
|
|||
"webkul/laravel-admin": "self.version",
|
||||
"webkul/laravel-ui": "self.version",
|
||||
"webkul/laravel-core": "self.version",
|
||||
"webkul/laravel-attribute": "self.version"
|
||||
"webkul/laravel-attribute": "self.version",
|
||||
"webkul/laravel-customer": "self.version"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
|
|
@ -43,7 +44,8 @@
|
|||
"Webkul\\Ui\\": "packages/Webkul/Ui/src",
|
||||
"Webkul\\Attribute\\": "packages/Webkul/Attribute/src",
|
||||
"Webkul\\Shop\\": "packages/Webkul/Shop/src",
|
||||
"Webkul\\Core\\": "packages/Webkul/Core/src"
|
||||
"Webkul\\Core\\": "packages/Webkul/Core/src",
|
||||
"Webkul\\Customer\\": "packages/Webkul/Customer/src"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
|
|
|
|||
|
|
@ -170,13 +170,14 @@ return [
|
|||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
|
||||
|
||||
//Webkul packages
|
||||
Webkul\User\Providers\UserServiceProvider::class,
|
||||
Webkul\Admin\Providers\AdminServiceProvider::class,
|
||||
Webkul\Ui\Providers\UiServiceProvider::class,
|
||||
Webkul\Attribute\Providers\AttributeServiceProvider::class,
|
||||
Webkul\Core\Providers\CoreServiceProvider::class,
|
||||
Webkul\Shop\Providers\ShopServiceProvider::class
|
||||
Webkul\Shop\Providers\ShopServiceProvider::class,
|
||||
Webkul\Customer\Providers\CustomerServiceProvider::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -22,114 +22,47 @@ class DataGridController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
// DataGrid::make([
|
||||
// 'name' => 'admin',
|
||||
// 'select' => 'a.id',
|
||||
// 'table' => 'admins as a',
|
||||
// 'join' => [
|
||||
// [
|
||||
// 'join' => 'leftjoin',
|
||||
// 'table' => 'roles as r',
|
||||
// 'primaryKey' => 'a.role_id',
|
||||
// 'condition' => '=',
|
||||
// 'secondaryKey' => 'r.id',
|
||||
// ]
|
||||
// ],
|
||||
// 'columns' => [
|
||||
// [
|
||||
// 'name' => 'a.id',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Id',
|
||||
// 'sortable' => true,
|
||||
// 'filterable' => false,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'a.name',
|
||||
// 'type' => 'string',
|
||||
// 'label' => 'Name',
|
||||
// 'sortable' => true,
|
||||
// 'filterable' => true,
|
||||
// // will create on run time query
|
||||
// 'filter' => [
|
||||
// 'function' => 'where', // andwhere
|
||||
// 'condition' => ['a.name', '=', 'Admin'] // multiarray
|
||||
// ],
|
||||
// 'attributes' => [
|
||||
// 'class' => 'class-a class-b',
|
||||
// 'data-attr' => 'whatever you want',
|
||||
// 'onclick' => "window.alert('alert from datagrid column')"
|
||||
// ],
|
||||
// 'wrapper' => function ($value, $object) {
|
||||
// return '<a href="'.$value.'">' . $object->name . '</a>';
|
||||
// },
|
||||
// ]
|
||||
// ],
|
||||
// // 'css' => []
|
||||
|
||||
// ]);
|
||||
|
||||
//Make case without any aliasing or joins
|
||||
/*
|
||||
operations list <,>,<=,>=,!=,=,like, IN.
|
||||
|
||||
contains will get resolved by like after where and ranges can be resolved
|
||||
by using IN or where in (1,2,3)
|
||||
|
||||
verbs => [
|
||||
'eq' => '=',
|
||||
'lt' => '<',
|
||||
'gt' => '>',
|
||||
'lte' => '<=',
|
||||
'gte' => '>=',
|
||||
'neq' => '!=',
|
||||
'inc_range' => '>x AND <y',
|
||||
'exc_range' => '>=x AND <=y',
|
||||
'not_inc_range' => '!>x AND <y',
|
||||
'not_exc_range' => '!>=x AND <=y',
|
||||
]
|
||||
*/
|
||||
|
||||
$select_verbs = [
|
||||
0 => "aggregate",
|
||||
1 => "columns",
|
||||
2 => "from",
|
||||
3 => "joins",
|
||||
4 => "wheres",
|
||||
5 => "groups",
|
||||
6 => "havings",
|
||||
7 => "orders",
|
||||
8 => "limit",
|
||||
9 => "offset",
|
||||
10 => "lock"
|
||||
];
|
||||
$bindings = [
|
||||
"select" => [],
|
||||
"from" => [],
|
||||
"join" => [],
|
||||
"where" => [],
|
||||
"having" => [],
|
||||
"order" => [],
|
||||
"union" => [],
|
||||
];
|
||||
$operators = [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
'ceq' => "<=>",
|
||||
'like' => "like",
|
||||
'likebin' => "like binary",
|
||||
'ntlike' => "not like",
|
||||
'ilike' => "ilike",
|
||||
'regex' => "regexp",
|
||||
'notregex' => "not regexp",
|
||||
'simto' => "similar to",
|
||||
'nsimto' => "not similar to",
|
||||
'nilike' => "not ilike",
|
||||
];
|
||||
// $select_verbs = [
|
||||
// 0 => "aggregate",
|
||||
// 1 => "columns",
|
||||
// 2 => "from",
|
||||
// 3 => "joins",
|
||||
// 4 => "wheres",
|
||||
// 5 => "groups",
|
||||
// 6 => "havings",
|
||||
// 7 => "orders",
|
||||
// 8 => "limit",
|
||||
// 9 => "offset",
|
||||
// 10 => "lock"
|
||||
// ];
|
||||
// $bindings = [
|
||||
// "select" => [],
|
||||
// "from" => [],
|
||||
// "join" => [],
|
||||
// "where" => [],
|
||||
// "having" => [],
|
||||
// "order" => [],
|
||||
// "union" => [],
|
||||
// ];
|
||||
// $operators = [
|
||||
// 'eq' => "=",
|
||||
// 'lt' => "<",
|
||||
// 'gt' => ">",
|
||||
// 'lte' => "<=",
|
||||
// 'gte' => ">=",
|
||||
// 'neqs' => "<>",
|
||||
// 'neqn' => "!=",
|
||||
// 'ceq' => "<=>",
|
||||
// 'like' => "like",
|
||||
// 'likebin' => "like binary",
|
||||
// 'ntlike' => "not like",
|
||||
// 'ilike' => "ilike",
|
||||
// 'regex' => "regexp",
|
||||
// 'notregex' => "not regexp",
|
||||
// 'simto' => "similar to",
|
||||
// 'nsimto' => "not similar to",
|
||||
// 'nilike' => "not ilike",
|
||||
// ];
|
||||
DataGrid::make([
|
||||
'name' => 'authors',
|
||||
'table' => 'authors as a',
|
||||
|
|
@ -215,44 +148,75 @@ class DataGridController extends Controller
|
|||
],
|
||||
|
||||
],
|
||||
'select_verbs' => [
|
||||
0 => "aggregate",
|
||||
1 => "columns",
|
||||
2 => "from",
|
||||
3 => "joins",
|
||||
4 => "wheres",
|
||||
5 => "groups",
|
||||
6 => "havings",
|
||||
7 => "orders",
|
||||
8 => "limit",
|
||||
9 => "offset",
|
||||
10 => "lock"
|
||||
],
|
||||
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
'gt' => ">",
|
||||
'lte' => "<=",
|
||||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
'ceq' => "<=>",
|
||||
'like' => "like",
|
||||
'likebin' => "like binary",
|
||||
'ntlike' => "not like",
|
||||
'ilike' => "ilike",
|
||||
'regex' => "regexp",
|
||||
'notregex' => "not regexp",
|
||||
'simto' => "similar to",
|
||||
'nsimto' => "not similar to",
|
||||
'nilike' => "not ilike",
|
||||
],
|
||||
'mass_operations' =>[
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button',
|
||||
|
||||
]
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
]);
|
||||
|
||||
$result = DataGrid::render();
|
||||
|
||||
return $result;
|
||||
// $prepareMassAction = DataGrid::massAction();
|
||||
// if ($prepareMassAction) {
|
||||
// $result = DataGrid::render();
|
||||
// return $result;
|
||||
// } else {
|
||||
// throw new \Exception('Mass Actions Attributes Have Some Unknown Problems');
|
||||
// }
|
||||
}
|
||||
|
||||
//for performing mass actions
|
||||
public function massAction()
|
||||
{
|
||||
$make = [
|
||||
'operations' =>[
|
||||
// [
|
||||
// 'route' => 'datagrid/update',
|
||||
// 'method' => 'post',
|
||||
// 'label' => 'Update',
|
||||
// 'type' => 'select',
|
||||
// 'name' => 'status',
|
||||
// 'values' => [
|
||||
// [
|
||||
// 'label' => 'Enable',
|
||||
// 'value' => 1
|
||||
// ], [
|
||||
// 'label' => 'Disable',
|
||||
// 'value' => 0
|
||||
// ]
|
||||
// ],
|
||||
// ],
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button'
|
||||
]
|
||||
]
|
||||
];
|
||||
$result = DataGrid::makeMassAction($make);
|
||||
// return $result;
|
||||
}
|
||||
|
||||
public function massDelete(Request $r)
|
||||
{
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,10 +50,6 @@ class UserComposer
|
|||
'column' => 'u.name',
|
||||
'type' => 'string',
|
||||
'label' => 'Admin Name'
|
||||
], [
|
||||
'column' => 'u.id',
|
||||
'type' => 'number',
|
||||
'label' => 'Admin ID'
|
||||
]
|
||||
],
|
||||
'searchable' => [
|
||||
|
|
@ -67,6 +63,25 @@ class UserComposer
|
|||
'label' => 'Admin Name'
|
||||
]
|
||||
],
|
||||
'massoperations' =>[
|
||||
[
|
||||
'route' => route('admin.datagrid.delete'),
|
||||
'method' => 'DELETE',
|
||||
'label' => 'Delete',
|
||||
'type' => 'button',
|
||||
],
|
||||
// [
|
||||
// 'route' => route('admin.datagrid.index'),
|
||||
// 'method' => 'POST',
|
||||
// 'label' => 'View Grid',
|
||||
// 'type' => 'select',
|
||||
// 'options' =>[
|
||||
// 1 => 'Edit',
|
||||
// 2 => 'Set',
|
||||
// 3 => 'Change Status'
|
||||
// ]
|
||||
// ],
|
||||
],
|
||||
'join' => [
|
||||
[
|
||||
'join' => 'leftjoin',
|
||||
|
|
@ -123,19 +138,6 @@ class UserComposer
|
|||
// ],
|
||||
|
||||
],
|
||||
'select_verbs' => [
|
||||
0 => "aggregate",
|
||||
1 => "columns",
|
||||
2 => "from",
|
||||
3 => "joins",
|
||||
4 => "wheres",
|
||||
5 => "groups",
|
||||
6 => "havings",
|
||||
7 => "orders",
|
||||
8 => "limit",
|
||||
9 => "offset",
|
||||
10 => "lock"
|
||||
],
|
||||
'operators' => [
|
||||
'eq' => "=",
|
||||
'lt' => "<",
|
||||
|
|
@ -144,16 +146,7 @@ class UserComposer
|
|||
'gte' => ">=",
|
||||
'neqs' => "<>",
|
||||
'neqn' => "!=",
|
||||
// 'ceq' => "<=>",
|
||||
'like' => "like",
|
||||
// 'likebin' => "like binary",
|
||||
// 'ntlike' => "not like",
|
||||
// 'ilike' => "ilike",
|
||||
// 'regex' => "regexp",
|
||||
// 'notregex' => "not regexp",
|
||||
// 'simto' => "similar to",
|
||||
// 'nsimto' => "not similar to",
|
||||
// 'nilike' => "not ilike",
|
||||
],
|
||||
// 'css' => []
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
Route::group(['middleware' => ['web']], function () {
|
||||
|
||||
Route::prefix('admin')->group(function () {
|
||||
// Login Routes
|
||||
Route::get('/login', 'Webkul\User\Http\Controllers\SessionController@create')->defaults('_config', [
|
||||
|
|
@ -58,8 +57,11 @@ Route::group(['middleware' => ['web']], function () {
|
|||
});
|
||||
|
||||
// Datagrid Routes
|
||||
Route::get('/datagrid', 'Webkul\Admin\Http\Controllers\DataGridController@index')->name('admin.datagrid.index');
|
||||
|
||||
//for datagrid and its loading, filtering, sorting and queries
|
||||
Route::get('datagrid', 'Webkul\Admin\Http\Controllers\DataGridController@index')->name('admin.datagrid.index');
|
||||
|
||||
Route::any('datagrid/massaction/delete', 'Webkul\Admin\Http\Controllers\DataGridController@massDelete')->name('admin.datagrid.delete');
|
||||
|
||||
// User Routes
|
||||
Route::get('/users', 'Webkul\User\Http\Controllers\UserController@index')->defaults('_config', [
|
||||
'view' => 'admin::users.users.index'
|
||||
|
|
@ -86,7 +88,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
Route::get('/roles', 'Webkul\User\Http\Controllers\RoleController@index')->defaults('_config', [
|
||||
'view' => 'admin::users.roles.index'
|
||||
])->name('admin.roles.index');
|
||||
|
||||
|
||||
Route::get('/roles/create', 'Webkul\User\Http\Controllers\RoleController@create')->defaults('_config', [
|
||||
'view' => 'admin::users.roles.create'
|
||||
])->name('admin.roles.create');
|
||||
|
|
@ -108,7 +110,7 @@ Route::group(['middleware' => ['web']], function () {
|
|||
Route::get('/locales', 'Webkul\Core\Http\Controllers\LocaleController@index')->defaults('_config', [
|
||||
'view' => 'admin::locales.index'
|
||||
])->name('admin.locales.index');
|
||||
|
||||
|
||||
Route::get('/locales/create', 'Webkul\Core\Http\Controllers\LocaleController@create')->defaults('_config', [
|
||||
'view' => 'admin::locales.create'
|
||||
])->name('admin.locales.create');
|
||||
|
|
@ -122,8 +124,8 @@ Route::group(['middleware' => ['web']], function () {
|
|||
Route::get('/account', 'Webkul\User\Http\Controllers\AccountController@edit')->defaults('_config', [
|
||||
'view' => 'admin::account.edit'
|
||||
])->name('admin.account.edit');
|
||||
|
||||
|
||||
Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
/node_modules
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "webkul/laravel-customer",
|
||||
"description": "Customers Package for themeing and various features for customers",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "prashant-webkul",
|
||||
"email": "prashant.singh852@webkul.com"
|
||||
}
|
||||
],
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Webkul\\Customer\\": "src/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Webkul\\Customer\\Providers\\CustomerServiceProvider"
|
||||
],
|
||||
"aliases": {}
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run development",
|
||||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch-poll": "npm run watch -- --watch-poll",
|
||||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"prod": "npm run production",
|
||||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^0.18",
|
||||
"cross-env": "^5.1.4",
|
||||
"laravel-mix": "^2.1",
|
||||
"laravel-mix-merge-manifest": "^0.1.1",
|
||||
"jquery": "^3.2",
|
||||
"vue": "^2.1.10"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
Route::get('/customer/profile', function () {
|
||||
return "hello from customers package";
|
||||
});
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\Customer\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class CustomerServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function boot()
|
||||
{
|
||||
include __DIR__ . '/../Http/routes.php';
|
||||
|
||||
$this->publishes([
|
||||
__DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/customer/assets'),
|
||||
], 'public');
|
||||
|
||||
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'customer');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// $this->app->bind('datagrid', 'Webkul\Ui\DataGrid\DataGrid');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559::getLoader();
|
||||
|
|
@ -0,0 +1,445 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
/**
|
||||
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
||||
*
|
||||
* $loader = new \Composer\Autoload\ClassLoader();
|
||||
*
|
||||
* // register classes with namespaces
|
||||
* $loader->add('Symfony\Component', __DIR__.'/component');
|
||||
* $loader->add('Symfony', __DIR__.'/framework');
|
||||
*
|
||||
* // activate the autoloader
|
||||
* $loader->register();
|
||||
*
|
||||
* // to enable searching the include path (eg. for PEAR packages)
|
||||
* $loader->setUseIncludePath(true);
|
||||
*
|
||||
* In this example, if you try to use a class in the Symfony\Component
|
||||
* namespace or one of its children (Symfony\Component\Console for instance),
|
||||
* the autoloader will first look for the class under the component/
|
||||
* directory, and it will then fallback to the framework/ directory if not
|
||||
* found before giving up.
|
||||
*
|
||||
* This class is loosely based on the Symfony UniversalClassLoader.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
// PSR-4
|
||||
private $prefixLengthsPsr4 = array();
|
||||
private $prefixDirsPsr4 = array();
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
private $prefixesPsr0 = array();
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
private $useIncludePath = false;
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
if ($this->classMap) {
|
||||
$this->classMap = array_merge($this->classMap, $classMap);
|
||||
} else {
|
||||
$this->classMap = $classMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
// Register directories for a new namespace.
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr0 = (array) $paths;
|
||||
} else {
|
||||
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
if (!$prefix) {
|
||||
$this->fallbackDirsPsr4 = (array) $paths;
|
||||
} else {
|
||||
$length = strlen($prefix);
|
||||
if ('\\' !== $prefix[$length - 1]) {
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
$this->useIncludePath = $useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can be used to check if the autoloader uses the include path to check
|
||||
* for classes.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseIncludePath()
|
||||
{
|
||||
return $this->useIncludePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns off searching the prefix and fallback directories for classes
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
$this->classMapAuthoritative = $classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should class lookup fail if not found in the current class map?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isClassMapAuthoritative()
|
||||
{
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the path to the file where the class is defined.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
*
|
||||
* @return string|false The path if found, false otherwise
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
}
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
// Search for Hack files if we are running on HHVM
|
||||
if (false === $file && defined('HHVM_VERSION')) {
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
||||
|
||||
$first = $class[0];
|
||||
if (isset($this->prefixLengthsPsr4[$first])) {
|
||||
$subPath = $class;
|
||||
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
||||
$subPath = substr($subPath, 0, $lastPos);
|
||||
$search = $subPath.'\\';
|
||||
if (isset($this->prefixDirsPsr4[$search])) {
|
||||
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
||||
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
||||
if (file_exists($file = $dir . $pathEnd)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-4 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr4 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 lookup
|
||||
if (false !== $pos = strrpos($class, '\\')) {
|
||||
// namespaced class name
|
||||
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
||||
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
||||
} else {
|
||||
// PEAR-like class name
|
||||
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
||||
}
|
||||
|
||||
if (isset($this->prefixesPsr0[$first])) {
|
||||
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
||||
if (0 === strpos($class, $prefix)) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 fallback dirs
|
||||
foreach ($this->fallbackDirsPsr0 as $dir) {
|
||||
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
// PSR-0 include paths.
|
||||
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
Copyright (c) Nils Adermann, Jordi Boggiano
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Webkul\\Customer\\' => array($baseDir . '/src'),
|
||||
);
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
public static function loadClassLoader($class)
|
||||
{
|
||||
if ('Composer\Autoload\ClassLoader' === $class) {
|
||||
require __DIR__ . '/ClassLoader.php';
|
||||
}
|
||||
}
|
||||
|
||||
public static function getLoader()
|
||||
{
|
||||
if (null !== self::$loader) {
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitc5f0302124cc20345d62f1a255758559', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitc5f0302124cc20345d62f1a255758559::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->set($namespace, $path);
|
||||
}
|
||||
|
||||
$map = require __DIR__ . '/autoload_psr4.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
$loader->setPsr4($namespace, $path);
|
||||
}
|
||||
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
$loader->addClassMap($classMap);
|
||||
}
|
||||
}
|
||||
|
||||
$loader->register(true);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitc5f0302124cc20345d62f1a255758559
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'W' =>
|
||||
array (
|
||||
'Webkul\\Customer\\' => 16,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Webkul\\Customer\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src',
|
||||
),
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitc5f0302124cc20345d62f1a255758559::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitc5f0302124cc20345d62f1a255758559::$prefixDirsPsr4;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
const { mix } = require("laravel-mix");
|
||||
require("laravel-mix-merge-manifest");
|
||||
|
||||
// var publicPath = 'publishable/assets';
|
||||
var publicPath = "../../../public/vendor/webkul/customer/assets";
|
||||
|
||||
mix.setPublicPath(publicPath).mergeManifest();
|
||||
mix.disableNotifications();
|
||||
mix.js(
|
||||
[
|
||||
__dirname + "/src/Resources/assets/js/app.js"
|
||||
// __dirname + "/src/Resources/assets/js/dropdown.js"
|
||||
],
|
||||
"js/ui.js"
|
||||
)
|
||||
// .copy(__dirname + "/src/Resources/assets/images", publicPath + "/images")
|
||||
.sass(__dirname + "/src/Resources/assets/sass/app.scss", "css/customer.css")
|
||||
.options({
|
||||
processCssUrls: false
|
||||
});
|
||||
|
||||
if (mix.inProduction()) {
|
||||
mix.version();
|
||||
}
|
||||
|
|
@ -25,11 +25,19 @@ class DataGrid
|
|||
* @var string
|
||||
*/
|
||||
protected $select;
|
||||
|
||||
/**
|
||||
* Table
|
||||
* @var Boolean for aliasing
|
||||
*/
|
||||
protected $aliased;
|
||||
|
||||
/**
|
||||
* Table
|
||||
*
|
||||
* @var String Classs name $table
|
||||
*/
|
||||
|
||||
protected $table;
|
||||
/**
|
||||
* Join
|
||||
|
|
@ -52,6 +60,29 @@ class DataGrid
|
|||
* @var Collection
|
||||
*/
|
||||
protected $columns;
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be filtered
|
||||
* @var Array
|
||||
*/
|
||||
protected $filterable;
|
||||
|
||||
/**
|
||||
* array of columns
|
||||
* to be searched
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $searchable;
|
||||
|
||||
/**
|
||||
* mass operations
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
protected $massoperations;
|
||||
|
||||
/**
|
||||
* Pagination $pagination
|
||||
*
|
||||
|
|
@ -95,9 +126,10 @@ class DataGrid
|
|||
{
|
||||
// list($name, $select, $table, $join, $columns) = array_values($args);
|
||||
$name = $select = $aliased = $table = false;
|
||||
$join = $columns = $filterable = $searchable = $css = $operators = [];
|
||||
$join = $columns = $filterable = $searchable =
|
||||
$massoperations = $css = $operators = [];
|
||||
extract($args);
|
||||
return $this->build($name, $select, $filterable, $searchable, $aliased, $table, $join, $columns, $css, $operators);
|
||||
return $this->build($name, $select, $filterable, $searchable, $massoperations, $aliased, $table, $join, $columns, $css, $operators);
|
||||
}
|
||||
|
||||
//starts buikding the queries on the basis of selects, joins and filter with
|
||||
|
|
@ -108,6 +140,7 @@ class DataGrid
|
|||
$select = false,
|
||||
array $filterable = [],
|
||||
array $searchable = [],
|
||||
array $massoperations = [],
|
||||
bool $aliased = false,
|
||||
$table = null,
|
||||
array $join = [],
|
||||
|
|
@ -121,6 +154,7 @@ class DataGrid
|
|||
$this->setSelect($select);
|
||||
$this->setFilterable($filterable);
|
||||
$this->setSearchable($filterable);
|
||||
$this->setMassOperations($massoperations);
|
||||
$this->setAlias($aliased);
|
||||
$this->setTable($table);
|
||||
$this->setJoin($join);
|
||||
|
|
@ -131,21 +165,6 @@ class DataGrid
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make Mass Action
|
||||
*
|
||||
*/
|
||||
public function makeMassAction($attributes)
|
||||
{
|
||||
$result = new MassAction();
|
||||
|
||||
if ($result->validateSchemaMassAction($attributes)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Name.
|
||||
*
|
||||
|
|
@ -192,6 +211,17 @@ class DataGrid
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mass operations
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
public function setMassOperations($massops)
|
||||
{
|
||||
$this->massoperations = $massops ?: [];
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set alias parameter
|
||||
* to know whether
|
||||
|
|
@ -653,12 +683,12 @@ class DataGrid
|
|||
* @return view
|
||||
*/
|
||||
|
||||
private function renderMassAction(array $attributes)
|
||||
{
|
||||
// private function renderMassAction(array $attributes)
|
||||
// {
|
||||
|
||||
//probably render some view when mass action is needed
|
||||
//the rendered view will have the needed javascript also.
|
||||
}
|
||||
// //probably render some view when mass action is needed
|
||||
// //the rendered view will have the needed javascript also.
|
||||
// }
|
||||
|
||||
/**
|
||||
* @return view
|
||||
|
|
@ -667,13 +697,13 @@ class DataGrid
|
|||
public function render()
|
||||
{
|
||||
$this->getDbQueryResults();
|
||||
// dump($this->columns);
|
||||
return view('ui::datagrid.index', [
|
||||
'css' => $this->css,
|
||||
'results' => $this->results,
|
||||
'columns' => $this->columns,
|
||||
'filterable' =>$this->filterable,
|
||||
'operators' => $this->operators,
|
||||
'massoperations' => $this->massoperations,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -745,59 +745,16 @@ h2 {
|
|||
}
|
||||
}
|
||||
.table {
|
||||
.mass-action {
|
||||
display: none;
|
||||
.xyz {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
// visibility: hidden;
|
||||
padding-left: 10px;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.mass-action-block {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
|
||||
.mass-action-remove {
|
||||
margin-right: 15px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.mass-action-dropdown {
|
||||
height: 36px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
min-width: 160px;
|
||||
max-width: 250px;
|
||||
|
||||
.dropdown-toggle {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "montserrat", sans-serif;
|
||||
padding-left: 5px;
|
||||
height: 36px;
|
||||
width: 150px;
|
||||
border: 2px solid $control-border-color;
|
||||
background-color: white;
|
||||
color: #8e8e8e;
|
||||
font-size: 14px;
|
||||
|
||||
.dropdown-header {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.arrow-down-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-list {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
.selected-items {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,13 +9,6 @@
|
|||
</div>
|
||||
<div class="dropdown-filters">
|
||||
<div class="column-filter">
|
||||
{{--
|
||||
<div class="dropdown-toggle">
|
||||
<div style="display: inline-block; vertical-align: middle;">
|
||||
<span class="name">Columns</span>
|
||||
</div>
|
||||
<i class="icon arrow-down-icon active"></i>
|
||||
</div> --}}
|
||||
<div class="dropdown-list bottom-right" style="display: none;">
|
||||
<div class="dropdown-container">
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -154,7 +154,33 @@
|
|||
//Enable Mass Action Subsequency
|
||||
var id=[]; //for getting the id of the selected fields
|
||||
var y = parseInt(0);
|
||||
$("input[type=checkbox]").change(function() {
|
||||
|
||||
// master checkbox for selecting all entries
|
||||
$("input[id=mastercheckbox]").change(function() {
|
||||
if($("input[id=mastercheckbox]").prop('checked') == true){
|
||||
$('.indexers').each(function(){
|
||||
this.checked = true;
|
||||
if(this.checked){
|
||||
y = parseInt($(this).attr('id')); id.push(y);
|
||||
}
|
||||
});
|
||||
$('.mass-action').css('display','');
|
||||
$('.table-grid-header').css('display','none');
|
||||
$('.selected-items').html(id.toString());
|
||||
$('#indexes').val(id);
|
||||
console.log(id);
|
||||
}
|
||||
else if($("input[id=mastercheckbox]").prop('checked') == false){
|
||||
$('.indexers').each(function(){ this.checked = false; });
|
||||
id = [];
|
||||
$('.mass-action').css('display','none');
|
||||
$('.table-grid-header').css('display','');
|
||||
$('#indexes').val('');
|
||||
console.log(id);
|
||||
}
|
||||
});
|
||||
|
||||
$("input[class=indexers]").change(function() {
|
||||
if(this.checked){
|
||||
y = parseInt($(this).attr('id'));
|
||||
id.push(y);
|
||||
|
|
@ -166,11 +192,14 @@
|
|||
id.splice(index,1);
|
||||
}
|
||||
if(id.length>0){
|
||||
$('.mass-action').css('display','inherit');
|
||||
$('.mass-action').css('display','');
|
||||
$('.table-grid-header').css('display','none');
|
||||
$('.selected-items').html(id.toString());
|
||||
$('#indexes').val(id);
|
||||
}else if(id.length == 0){
|
||||
$('.mass-action').css('display','none');
|
||||
$('.table-grid-header').css('display','table-header-group');
|
||||
$('.table-grid-header').css('display','');
|
||||
$('#indexes').val('');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -178,16 +207,34 @@
|
|||
$('.mass-action-remove').on('click', function(){
|
||||
$("input[type=checkbox]").prop('checked',false);
|
||||
id = [];
|
||||
$('.mass-action').css('display','none'); $('.table-grid-header').css('display','table-header-group');
|
||||
$('#indexes').val('');
|
||||
$('.mass-action').css('display','none');
|
||||
$('.table-grid-header').css('display','');
|
||||
});
|
||||
// $('.mass-delete').on('click',function(){
|
||||
// if(id.length>0){
|
||||
// url = 'datagrid/delete';
|
||||
// $.ajax({ type: "POST", url: url, data: id, success: function(result){
|
||||
// console.log(result);
|
||||
// } });
|
||||
// }
|
||||
|
||||
// $('.b-res').css('visibility','hidden');
|
||||
// $('.t-res').css('visibility','hidden');
|
||||
// $('.ma-action').css('visibility','hidden');
|
||||
// var ma_selected_col;
|
||||
// var ma_selected_type;
|
||||
// var ma_selected_action;
|
||||
// $('select.ma-col').change(function() {
|
||||
// ma_selected_col = $('select.ma-col').find(':selected').val();
|
||||
// ma_selected_type = $('select.ma-col').find(':selected').data('type');
|
||||
// $('.ma-action').css('visibility','visible');
|
||||
// console.log(ma_selected_col,ma_selected_type);
|
||||
// });
|
||||
// $('.ma-action').change(function(){
|
||||
// ma_selected_action = $('select.ma-action').find(':selected').val();
|
||||
// });
|
||||
// if(ma_selected_action == "update") {
|
||||
// if(ma_selected_type="boolean") {
|
||||
// $('.b-res').css('visibility','visible');
|
||||
// }
|
||||
// } else if(ma_selected_action == "delete"){
|
||||
// $('.b-res').css('visibility','visible');
|
||||
// }
|
||||
|
||||
});
|
||||
//this function is only to barrayFromUrle used when there is search param and the allFilter is empty in order to repopulate
|
||||
// and make the filter or sort tags again
|
||||
|
|
|
|||
|
|
@ -1,67 +1,67 @@
|
|||
<div class="table">
|
||||
<table class="{{ $css->table }}">
|
||||
<thead class="{{-- $css->thead --}} table-grid-header">
|
||||
<tr>
|
||||
<th class="{{-- $css->thead_td --}}">Mass Action</th>
|
||||
@foreach ($columns as $column) {{-- {{ dd($column->sortable) }} --}} @if($column->sortable == "true")
|
||||
<th class="$css->thead_td grid_head" data-column-name={{ $column->name }} data-column-sort="asc">{!! $column->sorting() !!}<span class="icon sort-down-icon"></span></th>
|
||||
@else
|
||||
<th class="$css->thead_td grid_head">{!! $column->sorting() !!}</th>
|
||||
@endif @endforeach
|
||||
<thead>
|
||||
<tr class="mass-action" style="display: none;">
|
||||
<th colspan="{{ count($columns)+1 }}">
|
||||
<div class="xyz">
|
||||
<div class="selected-items"></div>
|
||||
@foreach($massoperations as $massoperation) {{--
|
||||
<h3>{{ $massoperation['label'] }}</h3> --}} @if($massoperation['type'] == "button")
|
||||
<form @if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" ) method="{{ strtoupper($massoperation['method']) }}"
|
||||
@else method="POST" @endif action="{{ $massoperation['route'] }}">
|
||||
{{ csrf_field() }} @if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST") @method($massoperation['method'])
|
||||
@endif
|
||||
<input type="hidden" id="indexes" name="indexes" value="">
|
||||
<input class="btn btn-primary btn-sm" type="submit" value="Delete">
|
||||
</form>
|
||||
@elseif($massoperation['type'] == "select")
|
||||
<form @if(strtoupper($massoperation[ 'method'])=="GET" || strtoupper($massoperation[ 'method'])=="POST" ) method="{{ strtoupper($massoperation['method']) }}"
|
||||
@else method="POST" @endif action="{{ $massoperation['route'] }}">
|
||||
{{ csrf_field() }} @if(strtoupper($massoperation['method'])!= "GET" && strtoupper($massoperation['method'])!= "POST") @method($massoperation['method'])
|
||||
@endif
|
||||
<input type="hidden" id="indexes" name="indexes" value="">
|
||||
<select name="choices">
|
||||
@foreach($massoperation['options'] as $option)
|
||||
<option>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<input class="btn btn-primary btn-sm" type="submit" value="Submit">
|
||||
</form>
|
||||
@endif @endforeach
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="table-grid-header">
|
||||
<th>
|
||||
<span class="checkbox">
|
||||
<input type="checkbox" id="mastercheckbox">
|
||||
<label class="checkbox-view" for="checkbox"></label>
|
||||
</span>
|
||||
</th>
|
||||
@foreach ($columns as $column)
|
||||
@if($column->sortable == "true")
|
||||
<th class="" data-column-name={{ $column->name }} data-column-sort="asc"> {!! $column->sorting() !!}<span class="icon sort-down-icon"></span>
|
||||
</th>
|
||||
@else
|
||||
<th class="">{!! $column->sorting() !!}</th>
|
||||
@endif
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<div class="mass-action">
|
||||
<div class="mass-action-block">
|
||||
<span class="icon checkbox-dash-icon mass-action-remove"></span>
|
||||
<div class="mass-action-dropdown">
|
||||
{{-- <select class="control">
|
||||
<option value="x">A</option>
|
||||
<option value="y">B</option>
|
||||
<option value="z">C</option>
|
||||
</select> --}}
|
||||
<div class="dropdown-toggle">
|
||||
<div class="dropdown-header">
|
||||
<span class="name">Actions</span> {{-- <span class="role">Filter</span> --}}
|
||||
<i class="icon arrow-down-icon active"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-list bottom-left" style="display: none;">
|
||||
<div class="dropdown-container">
|
||||
<ul>
|
||||
{{-- <li class="mass-delete">Delete  <span class="btn btn-primary btn-sm">Apply</span></li> --}}
|
||||
<li>
|
||||
<form action="{{ route('admin.datagrid.delete') }}" method="post">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" id="indexes" value="">
|
||||
<input type="Submit" class="btn btn-primary btn-sm">
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<tbody class="{{ $css->tbody }}">
|
||||
|
||||
@foreach ($results as $result)
|
||||
<tr>
|
||||
<td class="{{-- $css->tbody_td --}}">
|
||||
<td class="">
|
||||
<span class="checkbox">
|
||||
<input type="checkbox" id="{{ $result->id }}" name="checkbox[]">
|
||||
<input type="checkbox" class="indexers" id="{{ $result->id }}" name="checkbox[]">
|
||||
<label class="checkbox-view" for="checkbox1"></label>
|
||||
</span>
|
||||
</td>
|
||||
|
||||
@foreach ($columns as $column)
|
||||
<td class="{{-- $css->tbody_td --}}">{!! $column->render($result) !!}</td>
|
||||
<td class="">{!! $column->render($result) !!}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{--
|
||||
@include('ui::partials.pagination') --}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -117,6 +117,12 @@
|
|||
height: 24px;
|
||||
}
|
||||
|
||||
.checkbox-dash-icon {
|
||||
background-image: url("../images/Checkbox-Dash.svg");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.active .dashboard-icon {
|
||||
background-image: url("../images/Icon-Dashboard-Active.svg");
|
||||
}
|
||||
|
|
@ -836,18 +842,98 @@ h2 {
|
|||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .control {
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
justify-content: center;
|
||||
font-family: "montserrat", sans-serif;
|
||||
padding-left: 5px;
|
||||
height: 36px;
|
||||
width: 150px;
|
||||
border: 2px solid #C7C7C7;
|
||||
border-radius: 3px;
|
||||
background-color: white;
|
||||
color: #8e8e8e;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header {
|
||||
width: 100%;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
-webkit-box-pack: justify;
|
||||
-ms-flex-pack: justify;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-toggle .dropdown-header .arrow-down-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li.filter-column-dropdown .filter-column-select {
|
||||
background: #fff;
|
||||
border: 2px solid #c7c7c7;
|
||||
border-radius: 3px;
|
||||
height: 36px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
padding: 0px 5px;
|
||||
font-family: "montserrat", sans-serif;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li select {
|
||||
background: #fff;
|
||||
border: 2px solid #c7c7c7;
|
||||
border-radius: 3px;
|
||||
height: 36px;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
padding: 0px 5px;
|
||||
font-family: "montserrat", sans-serif;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul li input {
|
||||
background: #fff;
|
||||
border: 2px solid #c7c7c7;
|
||||
border-radius: 3px;
|
||||
height: 36px;
|
||||
max-width: 100%;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
padding: 0px 5px;
|
||||
font-family: "montserrat", sans-serif;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-one .dropdown-filters .more-filters .dropdown-list .dropdown-container ul .filter-condition-dropdown-string {
|
||||
display: none;
|
||||
}
|
||||
|
|
@ -886,8 +972,8 @@ h2 {
|
|||
flex-direction: row;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.grid-container .filter-wrapper .filter-row-two .filter-one {
|
||||
|
|
@ -917,4 +1003,25 @@ h2 {
|
|||
width: 18px !important;
|
||||
}
|
||||
|
||||
.grid-container .table .xyz {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-box-direction: normal;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
padding-left: 10px;
|
||||
-webkit-box-pack: start;
|
||||
-ms-flex-pack: start;
|
||||
justify-content: flex-start;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.grid-container .table .xyz .selected-items {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
/* DataGrid css ends in here */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51 (57462) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Checkbox-Dash</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Checkbox-Dash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Base" stroke="#0041FF" stroke-width="2" fill="#FFFFFF" x="1" y="1" width="22" height="22" rx="2"></rect>
|
||||
<path d="M6,12 L17.215332,12" id="Path-8" stroke="#0041FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 721 B |
Loading…
Reference in New Issue