Преглед изворни кода

Merge branch '2.0' into gitee2.0

jqh пре 5 година
родитељ
комит
875b4cc97d
31 измењених фајлова са 295 додато и 155 уклоњено
  1. 0 0
      resources/dist/adminlte/adminlte.js.map
  2. 0 0
      resources/dist/dcat/css/dcat-app-blue-light.css
  3. 0 0
      resources/dist/dcat/css/dcat-app-blue.css
  4. 0 0
      resources/dist/dcat/css/dcat-app-green.css
  5. 0 0
      resources/dist/dcat/css/dcat-app.css
  6. 0 0
      resources/dist/dcat/extra/action.js.map
  7. 0 0
      resources/dist/dcat/extra/grid-extend.js
  8. 0 0
      resources/dist/dcat/extra/grid-extend.js.map
  9. 0 0
      resources/dist/dcat/extra/select-table.js.map
  10. 0 0
      resources/dist/dcat/js/dcat-app.js
  11. 0 0
      resources/dist/dcat/js/dcat-app.js.map
  12. 22 0
      resources/dist/dcat/plugins/jquery.initialize/LICENSE
  13. 157 0
      resources/dist/dcat/plugins/jquery.initialize/jquery.initialize.js
  14. 0 0
      resources/dist/dcat/plugins/jquery.initialize/jquery.initialize.min.js
  15. 1 1
      resources/views/widgets/dialogtable.blade.php
  16. 6 2
      src/Form/Field.php
  17. 3 3
      src/Form/Field/CanCascadeFields.php
  18. 1 1
      src/Form/Field/HasMany.php
  19. 30 103
      src/Form/NestedForm.php
  20. 17 2
      src/Grid.php
  21. 6 1
      src/Grid/Actions/QuickEdit.php
  22. 4 2
      src/Grid/Column.php
  23. 1 1
      src/Grid/Concerns/HasSelector.php
  24. 4 2
      src/Grid/Filter/AbstractFilter.php
  25. 11 10
      src/Grid/Filter/Presenter/MultipleSelectTable.php
  26. 12 2
      src/Grid/Tools/RowSelector.php
  27. 0 1
      src/Http/Controllers/UserController.php
  28. 4 2
      src/Show/Field.php
  29. 13 13
      src/Support/helpers.php
  30. 2 8
      src/Widgets/Form.php
  31. 1 1
      src/Widgets/Widget.php

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/adminlte/adminlte.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/css/dcat-app-blue-light.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/css/dcat-app-blue.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/css/dcat-app-green.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/css/dcat-app.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/extra/action.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/extra/grid-extend.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/extra/grid-extend.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/extra/select-table.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/js/dcat-app.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


+ 22 - 0
resources/dist/dcat/plugins/jquery.initialize/LICENSE

@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015-2016 Adam Pietrasiak
+
+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.
+

+ 157 - 0
resources/dist/dcat/plugins/jquery.initialize/jquery.initialize.js

@@ -0,0 +1,157 @@
+/*!
+ * https://github.com/adampietrasiak/jquery.initialize
+ *
+ * Copyright (c) 2015-2016 Adam Pietrasiak
+ * Released under the MIT license
+ * https://github.com/timpler/jquery.initialize/blob/master/LICENSE
+ *
+ * This is based on MutationObserver
+ * https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
+ */
+;(function ($) {
+
+    "use strict";
+
+    var combinators = [' ', '>', '+', '~']; // https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors#Combinators
+    var fraternisers = ['+', '~']; // These combinators involve siblings.
+    var complexTypes = ['ATTR', 'PSEUDO', 'ID', 'CLASS']; // These selectors are based upon attributes.
+
+    //Check if browser supports "matches" function
+    if (!Element.prototype.matches) {
+        Element.prototype.matches = Element.prototype.matchesSelector ||
+            Element.prototype.webkitMatchesSelector ||
+            Element.prototype.mozMatchesSelector ||
+            Element.prototype.msMatchesSelector;
+    }
+
+    // Understand what kind of selector the initializer is based upon.
+    function grok(msobserver) {
+        if (!$.find.tokenize) {
+            // This is an old version of jQuery, so cannot parse the selector.
+            // Therefore we must assume the worst case scenario. That is, that
+            // this is a complicated selector. This feature was available in:
+            // https://github.com/jquery/sizzle/issues/242
+            msobserver.isCombinatorial = true;
+            msobserver.isFraternal = true;
+            msobserver.isComplex = true;
+            return;
+        }
+
+        // Parse the selector.
+        msobserver.isCombinatorial = false;
+        msobserver.isFraternal = false;
+        msobserver.isComplex = false;
+        var token = $.find.tokenize(msobserver.selector);
+        for (var i = 0; i < token.length; i++) {
+            for (var j = 0; j < token[i].length; j++) {
+                if (combinators.indexOf(token[i][j].type) != -1)
+                    msobserver.isCombinatorial = true; // This selector uses combinators.
+
+                if (fraternisers.indexOf(token[i][j].type) != -1)
+                    msobserver.isFraternal = true; // This selector uses sibling combinators.
+
+                if (complexTypes.indexOf(token[i][j].type) != -1)
+                    msobserver.isComplex = true; // This selector is based on attributes.
+            }
+        }
+    }
+
+    // MutationSelectorObserver represents a selector and it's associated initialization callback.
+    var MutationSelectorObserver = function (selector, callback, options) {
+        this.selector = selector.trim();
+        this.callback = callback;
+        this.options = options;
+
+        grok(this);
+    };
+
+    // List of MutationSelectorObservers.
+    var msobservers = [];
+    msobservers.initialize = function (selector, callback, options) {
+
+        // Wrap the callback so that we can ensure that it is only
+        // called once per element.
+        var seen = [];
+        var callbackOnce = function () {
+            if (seen.indexOf(this) == -1) {
+                seen.push(this);
+                $(this).each(callback);
+            }
+        };
+
+        // See if the selector matches any elements already on the page.
+        $(options.target).find(selector).each(callbackOnce);
+
+        // Then, add it to the list of selector observers.
+        var msobserver = new MutationSelectorObserver(selector, callbackOnce, options)
+        this.push(msobserver);
+
+        // The MutationObserver watches for when new elements are added to the DOM.
+        var observer = new MutationObserver(function (mutations) {
+            var matches = [];
+
+            // For each mutation.
+            for (var m = 0; m < mutations.length; m++) {
+
+                // If this is an attributes mutation, then the target is the node upon which the mutation occurred.
+                if (mutations[m].type == 'attributes') {
+                    // Check if the mutated node matchs.
+                    if (mutations[m].target.matches(msobserver.selector))
+                        matches.push(mutations[m].target);
+
+                    // If the selector is fraternal, query siblings of the mutated node for matches.
+                    if (msobserver.isFraternal)
+                        matches.push.apply(matches, mutations[m].target.parentElement.querySelectorAll(msobserver.selector));
+                    else
+                        matches.push.apply(matches, mutations[m].target.querySelectorAll(msobserver.selector));
+                }
+
+                // If this is an childList mutation, then inspect added nodes.
+                if (mutations[m].type == 'childList') {
+                    // Search added nodes for matching selectors.
+                    for (var n = 0; n < mutations[m].addedNodes.length; n++) {
+                        if (!(mutations[m].addedNodes[n] instanceof Element)) continue;
+
+                        // Check if the added node matches the selector
+                        if (mutations[m].addedNodes[n].matches(msobserver.selector))
+                            matches.push(mutations[m].addedNodes[n]);
+
+                        // If the selector is fraternal, query siblings for matches.
+                        if (msobserver.isFraternal)
+                            matches.push.apply(matches, mutations[m].addedNodes[n].parentElement.querySelectorAll(msobserver.selector));
+                        else
+                            matches.push.apply(matches, mutations[m].addedNodes[n].querySelectorAll(msobserver.selector));
+                    }
+                }
+            }
+
+            // For each match, call the callback using jQuery.each() to initialize the element (once only.)
+            for (var i = 0; i < matches.length; i++) {
+                $(matches[i]).each(msobserver.callback);
+            }
+        });
+
+        // Observe the target element.
+        var defaultObeserverOpts = { childList: true, subtree: true, attributes: msobserver.isComplex };
+        observer.observe(options.target, options.observer || defaultObeserverOpts );
+
+        return observer;
+    };
+
+    // Deprecated API (does not work with jQuery >= 3.1.1):
+    $.fn.initialize = function (callback, options) {
+        return msobservers.initialize(this.selector, callback, $.extend({}, $.initialize.defaults, options));
+    };
+
+    // Supported API
+    $.initialize = function (selector, callback, options) {
+        return msobservers.initialize(selector, callback, $.extend({}, $.initialize.defaults, options));
+    };
+
+    // Options
+    $.initialize.defaults = {
+        target: document.documentElement, // Defaults to observe the entire document.
+        observer: null // MutationObserverInit: Defaults to internal configuration if not provided.
+    }
+
+})(jQuery);

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
resources/dist/dcat/plugins/jquery.initialize/jquery.initialize.min.js


+ 1 - 1
resources/views/widgets/dialogtable.blade.php

@@ -112,7 +112,7 @@
     }
 
     function setMaxHeight(index) {
-        var maxHeight = ($(window).height() - 250);
+        var maxHeight = ($(window).height() - 220);
         if (maxHeight < 250) {
             maxHeight = maxHeight + 120;
         }

+ 6 - 2
src/Form/Field.php

@@ -249,11 +249,15 @@ class Field implements Renderable
      */
     protected function formatLabel($arguments = [])
     {
+        if(isset($arguments[0])) {
+            return $arguments[0];
+        }
+
         $column = is_array($this->column) ? current($this->column) : $this->column;
 
-        $label = isset($arguments[0]) ? $arguments[0] : admin_trans_field($column);
+        $label = admin_trans_field($column);
 
-        return str_replace(['.', '_'], ' ', $label);
+        return str_replace('_', ' ', $label);
     }
 
     /**

+ 3 - 3
src/Form/Field/CanCascadeFields.php

@@ -132,7 +132,7 @@ trait CanCascadeFields
         })->toJson();
 
         $script = <<<JS
-(function () {
+Dcat.init('{$this->getElementClassSelector()}', function (\$this) {
     var compare = function (a, b, o) {
         if (! $.isArray(b)) {
             return operator_table[o](a, b)
@@ -182,7 +182,7 @@ trait CanCascadeFields
     };
     var cascade_groups = {$cascadeGroups}, event = '{$this->cascadeEvent}';
 
-    $('{$this->getElementClassSelector()}').on(event, function (e) {
+    \$this.on(event, function (e) {
         {$this->getFormFrontValue()}
 
         cascade_groups.forEach(function (event) {
@@ -194,7 +194,7 @@ trait CanCascadeFields
             }
         });
     }).trigger(event);
-})();
+});
 JS;
 
         Admin::script($script);

+ 1 - 1
src/Form/Field/HasMany.php

@@ -497,7 +497,7 @@ class HasMany extends Field
 
         $this->addVariables([
             'forms'          => $this->buildRelatedForms(),
-            'template'       => $this->buildNestedForm()->getTemplate(),
+            'template'       => $this->buildNestedForm()->render(),
             'relationName'   => $this->relationName,
             'options'        => $this->options,
             'count'          => count($this->value()),

+ 30 - 103
src/Form/NestedForm.php

@@ -8,70 +8,8 @@ use Dcat\Admin\Widgets\Form as WidgetForm;
 use Illuminate\Support\Arr;
 use Illuminate\Support\Collection;
 
-/**
- * Class Form.
- *
- * @method Field\Text                   text($column, $label = '')
- * @method Field\Checkbox               checkbox($column, $label = '')
- * @method Field\Radio                  radio($column, $label = '')
- * @method Field\Select                 select($column, $label = '')
- * @method Field\MultipleSelect         multipleSelect($column, $label = '')
- * @method Field\Textarea               textarea($column, $label = '')
- * @method Field\Hidden                 hidden($column, $label = '')
- * @method Field\Id                     id($column, $label = '')
- * @method Field\Ip                     ip($column, $label = '')
- * @method Field\Url                    url($column, $label = '')
- * @method Field\Email                  email($column, $label = '')
- * @method Field\Mobile                 mobile($column, $label = '')
- * @method Field\Slider                 slider($column, $label = '')
- * @method Field\Map                    map($latitude, $longitude, $label = '')
- * @method Field\Editor                 editor($column, $label = '')
- * @method Field\Date                   date($column, $label = '')
- * @method Field\Datetime               datetime($column, $label = '')
- * @method Field\Time                   time($column, $label = '')
- * @method Field\Year                   year($column, $label = '')
- * @method Field\Month                  month($column, $label = '')
- * @method Field\DateRange              dateRange($start, $end, $label = '')
- * @method Field\DateTimeRange          datetimeRange($start, $end, $label = '')
- * @method Field\TimeRange              timeRange($start, $end, $label = '')
- * @method Field\Number                 number($column, $label = '')
- * @method Field\Currency               currency($column, $label = '')
- * @method Field\SwitchField            switch($column, $label = '')
- * @method Field\Display                display($column, $label = '')
- * @method Field\Rate                   rate($column, $label = '')
- * @method Field\Divide                 divider()
- * @method Field\Password               password($column, $label = '')
- * @method Field\Decimal                decimal($column, $label = '')
- * @method Field\Html                   html($html, $label = '')
- * @method Field\Tags                   tags($column, $label = '')
- * @method Field\Icon                   icon($column, $label = '')
- * @method Field\Embeds                 embeds($column, $label = '')
- * @method Field\Captcha                captcha()
- * @method Field\Listbox                listbox($column, $label = '')
- * @method Field\File                   file($column, $label = '')
- * @method Field\Image                  image($column, $label = '')
- * @method Field\MultipleFile           multipleFile($column, $label = '')
- * @method Field\MultipleImage          multipleImage($column, $label = '')
- * @method Field\HasMany                hasMany($column, $labelOrCallback, $callback = null)
- * @method Field\Tree                   tree($column, $label = '')
- * @method Field\Table                  table($column, $labelOrCallback, $callback = null)
- * @method Field\ListField              list($column, $label = '')
- * @method Field\Timezone               timezone($column, $label = '')
- * @method Field\KeyValue               keyValue($column, $label = '')
- * @method Field\Tel                    tel($column, $label = '')
- * @method Field\Markdown               markdown($column, $label = '')
- * @method Field\Range                  range($start, $end, $label = '')
- * @method Field\Color                  color($column, $label = '')
- * @method Field\SelectTable            selectTable($column, $label = '')
- * @method Field\MultipleSelectTable    multipleSelectTable($column, $label = '')
- */
-class NestedForm
+class NestedForm extends WidgetForm
 {
-    use Form\Concerns\HandleCascadeFields;
-    use Form\Concerns\HasRows;
-    use Form\Concerns\HasTabs;
-    use Form\Concerns\HasLayout;
-
     const DEFAULT_KEY_NAME = '__LA_KEY__';
 
     const REMOVE_FLAG_NAME = '_remove_';
@@ -117,13 +55,18 @@ class NestedForm
      * @param string $relation
      * @param null   $key
      */
-    public function __construct($relation, $key = null)
+    public function __construct($relation = null, $key = null)
     {
         $this->relationName = $relation;
 
         $this->key = $key;
 
-        $this->fields = new Collection();
+        $this->disableResetButton();
+        $this->disableSubmitButton();
+        $this->ajax(false);
+        $this->useFormTag(false);
+
+        parent::__construct();
     }
 
     /**
@@ -326,14 +269,18 @@ class NestedForm
     }
 
     /**
-     * @param Field $field
-     *
-     * @return $this
+     * {@inheritDoc}
      */
     public function pushField(Field $field)
     {
         $this->fields->push($field);
 
+        $field->setForm($this->form);
+
+        if ($this->layout()->hasColumns()) {
+            $this->layout()->addField($field);
+        }
+
         if (method_exists($this->form, 'builder')) {
             $this->form->builder()->fields()->push($field);
             $field->attribute(Builder::BUILD_IGNORE, true);
@@ -346,9 +293,23 @@ class NestedForm
 
         $field::requireAssets();
 
+        $field->width($this->width['field'], $this->width['label']);
+
         return $this;
     }
 
+    protected function resolveField($method, $arguments)
+    {
+        if ($className = Form::findFieldClass($method)) {
+            $column = Arr::get($arguments, 0, '');
+
+            /* @var Field $field */
+            $field = new $className($column, array_slice($arguments, 1));
+
+            return $this->formatField($field);
+        }
+    }
+
     /**
      * Get fields of this form.
      *
@@ -366,7 +327,7 @@ class NestedForm
      *
      * @return $this
      */
-    public function fill(array $data)
+    public function fill($data)
     {
         /* @var Field $field */
         foreach ($this->fields() as $field) {
@@ -376,24 +337,6 @@ class NestedForm
         return $this;
     }
 
-    /**
-     * Get the html and script of template.
-     *
-     * @return string
-     */
-    public function getTemplate()
-    {
-        $html = '';
-
-        /* @var Field $field */
-        foreach ($this->fields() as $field) {
-            //when field render, will push $script to Admin
-            $html .= $field->render();
-        }
-
-        return $html;
-    }
-
     /**
      * Set `errorKey` `elementName` `elementClass` for fields inside hasmany fields.
      *
@@ -436,22 +379,6 @@ class NestedForm
         return Helper::formatElementName($name ?: $this->relationName);
     }
 
-    protected function resolveField($method, $arguments)
-    {
-        if ($className = Form::findFieldClass($method)) {
-            $column = Arr::get($arguments, 0, '');
-
-            /* @var Field $field */
-            $field = new $className($column, array_slice($arguments, 1));
-
-            $field->setForm($this->form);
-
-            $field = $this->formatField($field);
-
-            return $field;
-        }
-    }
-
     /**
      * Add nested-form fields dynamically.
      *

+ 17 - 2
src/Grid.php

@@ -71,6 +71,11 @@ class Grid
      */
     protected $rows;
 
+    /**
+     * @var array
+     */
+    protected $rowsCallbacks = [];
+
     /**
      * All column names of the grid.
      *
@@ -448,15 +453,25 @@ class Grid
         $this->rows = collect($data)->map(function ($model) {
             return new Row($this, $model);
         });
+
+        foreach ($this->rowsCallbacks as $callback) {
+            $callback($this->rows);
+        }
     }
 
     /**
      * Set grid row callback function.
      *
-     * @return Collection
+     * @return Collection|$this
      */
-    public function rows()
+    public function rows(\Closure $callback = null)
     {
+        if ($callback) {
+            $this->rowsCallbacks[] = $callback;
+
+            return $this;
+        }
+
         return $this->rows;
     }
 

+ 6 - 1
src/Grid/Actions/QuickEdit.php

@@ -37,6 +37,11 @@ class QuickEdit extends RowAction
             'data-url' => "{$this->resource()}/{$this->getKey()}/edit",
         ]);
 
-        return parent::render(); // TODO: Change the autogenerated stub
+        return parent::render();
+    }
+
+    public function makeSelector()
+    {
+        return 'quick-edit';
     }
 }

+ 4 - 2
src/Grid/Column.php

@@ -410,9 +410,11 @@ class Column
      */
     protected function formatLabel($label)
     {
-        $label = $label ?: admin_trans_field($this->name);
+        if($label) return $label;
 
-        return str_replace(['.', '_'], ' ', $label);
+        $label = admin_trans_field($this->name);
+
+        return str_replace('_', ' ', $label);
     }
 
     /**

+ 1 - 1
src/Grid/Concerns/HasSelector.php

@@ -58,7 +58,7 @@ trait HasSelector
                 return;
             }
 
-            $this->fireOnce(new Grid\Events\ApplySelector($this));
+            $this->fireOnce(new Grid\Events\ApplySelector($this, [$active]));
 
             $values = $active[$key];
             if ($selector['type'] == 'one') {

+ 4 - 2
src/Grid/Filter/AbstractFilter.php

@@ -141,9 +141,11 @@ abstract class AbstractFilter
      */
     protected function formatLabel($label)
     {
-        $label = $label ?: admin_trans_field($this->column);
+        if($label) return $label;
 
-        return str_replace(['.', '_'], ' ', $label);
+        $label = admin_trans_field($this->column);
+
+        return str_replace('_', ' ', $label);
     }
 
     /**

+ 11 - 10
src/Grid/Filter/Presenter/MultipleSelectTable.php

@@ -37,16 +37,17 @@ class MultipleSelectTable extends SelectTable
 
         Admin::script(
             <<<JS
-{$this->dialog->getScript()}
-
-Dcat.grid.SelectTable({
-    dialog: '#{$this->dialog->id()}',
-    container: '#{$this->id}',
-    input: '#hidden-{$this->id}',
-    multiple: true,
-    max: {$this->max},
-    values: {$options},
-});
+Dcat.init('#{$this->id}', function (self) {
+    var dialogId = self.parent().find('{$this->dialog->getElementSelector()}').attr('id');
+    Dcat.grid.SelectTable({
+        dialog: '[data-id="' + dialogId + '"]',
+        container: '#{$this->id}',
+        input: '#hidden-{$this->id}',
+        multiple: true,
+        max: {$this->max},
+        values: {$options},
+    });
+})
 JS
         );
     }

+ 12 - 2
src/Grid/Tools/RowSelector.php

@@ -16,6 +16,8 @@ class RowSelector
 
     protected $rowClickable = false;
 
+    protected $idColumn;
+
     protected $titleColumn;
 
     public function __construct(Grid $grid)
@@ -44,6 +46,13 @@ class RowSelector
         return $this;
     }
 
+    public function idColumn(string $value)
+    {
+        $this->idColumn = $value;
+
+        return $this;
+    }
+
     public function titleColumn(string $value)
     {
         $this->titleColumn = $value;
@@ -63,9 +72,10 @@ HTML;
 
     public function renderColumn($row, $id)
     {
-        $this->setupScript();
+        $this->addScript();
         $title = $this->getTitle($row, $id);
         $title = e(is_array($title) ? json_encode($title) : $title);
+        $id = $this->idColumn ? Arr::get($row->toArray(), $this->idColumn) : $id;
 
         return <<<EOT
 <div class="vs-checkbox-con vs-checkbox-{$this->style} checkbox-grid checkbox-grid-column">
@@ -75,7 +85,7 @@ HTML;
 EOT;
     }
 
-    protected function setupScript()
+    protected function addScript()
     {
         $clickable = $this->rowClickable ? 'true' : 'false';
         $background = $this->background ?: Admin::color()->dark20();

+ 0 - 1
src/Http/Controllers/UserController.php

@@ -54,7 +54,6 @@ class UserController extends AdminController
             $grid->quickSearch(['id', 'name', 'username']);
 
             $grid->showQuickEditButton();
-            $grid->disableFilterButton();
             $grid->enableDialogCreate();
             $grid->showColumnSelector();
 

+ 4 - 2
src/Show/Field.php

@@ -158,9 +158,11 @@ class Field implements Renderable
      */
     protected function formatLabel($label)
     {
-        $label = $label ?: admin_trans_field($this->name);
+        if($label) return $label;
 
-        return str_replace(['.', '_'], ' ', $label);
+        $label = admin_trans_field($this->name);
+
+        return str_replace('_', ' ', $label);
     }
 
     /**

+ 13 - 13
src/Support/helpers.php

@@ -436,19 +436,6 @@ if (! function_exists('admin_asset')) {
     }
 }
 
-if (! function_exists('admin_assets_require')) {
-
-    /**
-     * @param $alias
-     *
-     * @return void
-     */
-    function admin_assets_require(?string $alias)
-    {
-        Admin::asset()->collect($alias);
-    }
-}
-
 if (! function_exists('admin_api_route')) {
 
     /**
@@ -494,6 +481,19 @@ if (! function_exists('admin_color')) {
     }
 }
 
+if (! function_exists('admin_view')) {
+    /**
+     * @param string $view
+     * @param array  $data
+     *
+     * @throws \Throwable
+     */
+    function admin_view($view, array $data = [])
+    {
+        Admin::view($view, $data);
+    }
+}
+
 if (! function_exists('admin_js')) {
     /**
      * @param string|array $js

+ 2 - 8
src/Widgets/Form.php

@@ -71,7 +71,6 @@ use Illuminate\Validation\Validator;
  * @method Field\Image               image($column, $label = '')
  * @method Field\MultipleFile        multipleFile($column, $label = '')
  * @method Field\MultipleImage       multipleImage($column, $label = '')
- * @method Field\HasMany             hasMany($column, \Closure $callback)
  * @method Field\Tree                tree($column, $label = '')
  * @method Field\Table               table($column, $callback)
  * @method Field\ListField           list($column, $label = '')
@@ -434,14 +433,9 @@ class Form implements Renderable
         return $this;
     }
 
-    /**
-     * Disable form tag.
-     *
-     * @return $this;
-     */
-    public function disableFormTag()
+    public function useFormTag(bool $tag = true)
     {
-        $this->useFormTag = false;
+        $this->useFormTag = $tag;
 
         return $this;
     }

+ 1 - 1
src/Widgets/Widget.php

@@ -204,7 +204,7 @@ abstract class Widget implements Renderable
 
         $result = Admin::resolveHtml(view($this->view, $this->variables()), ['runScript' => $this->runScript]);
 
-        $this->script = $result['script'];
+        $this->script .= $result['script'];
 
         return $result['html'];
     }

Неке датотеке нису приказане због велике количине промена