From 4f28d040054e354f85ef9ab38ac4c63ec3d1b60b Mon Sep 17 00:00:00 2001 From: ishibashi-t Date: Fri, 21 May 2021 18:06:27 +0900 Subject: [PATCH 1/4] Fixed to allow many inputmask type in between filter. --- resources/views/filter/between.blade.php | 4 ++-- src/Grid/Filter/Presenter/Text.php | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/resources/views/filter/between.blade.php b/resources/views/filter/between.blade.php index 0d402da73d..9c3b076c50 100644 --- a/resources/views/filter/between.blade.php +++ b/resources/views/filter/between.blade.php @@ -2,9 +2,9 @@
- + - - +
\ No newline at end of file diff --git a/src/Grid/Filter/Presenter/Text.php b/src/Grid/Filter/Presenter/Text.php index a71b9c3f2f..5f08bb02b5 100644 --- a/src/Grid/Filter/Presenter/Text.php +++ b/src/Grid/Filter/Presenter/Text.php @@ -162,7 +162,15 @@ public function inputmask($options = [], $icon = 'pencil'): self { $options = json_encode($options); - Admin::script("$('#{$this->filter->getFilterBoxId()} input.{$this->filter->getId()}').inputmask($options);"); + if (is_array($this->filter->getId())) { + $ids = $this->filter->getId(); + }else{ + $ids[] = $this->filter->getId(); + } + + foreach ($ids as $id) { + Admin::script("$('#{$this->filter->getFilterBoxId()} input.{$id}').inputmask($options);"); + } $this->icon = $icon; From 51fd5508005eb50917c74012fa807b34dd754a2c Mon Sep 17 00:00:00 2001 From: ishibashi-t Date: Fri, 21 May 2021 18:18:28 +0900 Subject: [PATCH 2/4] fix lint check --- src/Grid/Filter/Presenter/Text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Grid/Filter/Presenter/Text.php b/src/Grid/Filter/Presenter/Text.php index 5f08bb02b5..fb336cf330 100644 --- a/src/Grid/Filter/Presenter/Text.php +++ b/src/Grid/Filter/Presenter/Text.php @@ -164,7 +164,7 @@ public function inputmask($options = [], $icon = 'pencil'): self if (is_array($this->filter->getId())) { $ids = $this->filter->getId(); - }else{ + } else { $ids[] = $this->filter->getId(); } From accecb59a91ee511bbf948d7b0cfb682120cb91f Mon Sep 17 00:00:00 2001 From: ishibashi takken Date: Wed, 26 May 2021 01:10:10 +0900 Subject: [PATCH 3/4] Update src/Grid/Filter/Presenter/Text.php Co-authored-by: jxlwqq --- src/Grid/Filter/Presenter/Text.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Grid/Filter/Presenter/Text.php b/src/Grid/Filter/Presenter/Text.php index fb336cf330..62ee67d88f 100644 --- a/src/Grid/Filter/Presenter/Text.php +++ b/src/Grid/Filter/Presenter/Text.php @@ -162,11 +162,7 @@ public function inputmask($options = [], $icon = 'pencil'): self { $options = json_encode($options); - if (is_array($this->filter->getId())) { - $ids = $this->filter->getId(); - } else { - $ids[] = $this->filter->getId(); - } + $ids = (array)$this->filter->getId(); foreach ($ids as $id) { Admin::script("$('#{$this->filter->getFilterBoxId()} input.{$id}').inputmask($options);"); From b127d361c271de21d47edf1b2a69b2818a49f336 Mon Sep 17 00:00:00 2001 From: ishibashi-t Date: Wed, 26 May 2021 01:15:27 +0900 Subject: [PATCH 4/4] Changed to a better fix by jxlwqq --- src/Grid/Filter/Presenter/Text.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Grid/Filter/Presenter/Text.php b/src/Grid/Filter/Presenter/Text.php index fb336cf330..809e0d607b 100644 --- a/src/Grid/Filter/Presenter/Text.php +++ b/src/Grid/Filter/Presenter/Text.php @@ -162,11 +162,7 @@ public function inputmask($options = [], $icon = 'pencil'): self { $options = json_encode($options); - if (is_array($this->filter->getId())) { - $ids = $this->filter->getId(); - } else { - $ids[] = $this->filter->getId(); - } + $ids = (array) $this->filter->getId(); foreach ($ids as $id) { Admin::script("$('#{$this->filter->getFilterBoxId()} input.{$id}').inputmask($options);");