| @@ 20-33 (lines=14) @@ | ||
| 17 | 'mask' => '99999999999', |
|
| 18 | ]; |
|
| 19 | ||
| 20 | public function render() |
|
| 21 | { |
|
| 22 | $options = $this->json_encode_options($this->options); |
|
| 23 | ||
| 24 | $this->script = <<<EOT |
|
| 25 | ||
| 26 | $('{$this->getElementClassSelector()}').inputmask($options); |
|
| 27 | EOT; |
|
| 28 | ||
| 29 | $this->prepend('<i class="fa fa-phone fa-fw"></i>') |
|
| 30 | ->defaultAttribute('style', 'width: 150px'); |
|
| 31 | ||
| 32 | return parent::render(); |
|
| 33 | } |
|
| 34 | ||
| 35 | protected function json_encode_options($options) |
|
| 36 | { |
|
| @@ 11-30 (lines=20) @@ | ||
| 8 | '/vendor/laravel-admin/number-input/bootstrap-number-input.js', |
|
| 9 | ]; |
|
| 10 | ||
| 11 | public function render() |
|
| 12 | { |
|
| 13 | $this->default((int) $this->default); |
|
| 14 | ||
| 15 | $this->script = <<<EOT |
|
| 16 | ||
| 17 | $('{$this->getElementClassSelector()}:not(.initialized)') |
|
| 18 | .addClass('initialized') |
|
| 19 | .bootstrapNumber({ |
|
| 20 | upClass: 'success', |
|
| 21 | downClass: 'primary', |
|
| 22 | center: true |
|
| 23 | }); |
|
| 24 | ||
| 25 | EOT; |
|
| 26 | ||
| 27 | $this->prepend('')->defaultAttribute('style', 'width: 100px'); |
|
| 28 | ||
| 29 | return parent::render(); |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * Set min value of number field. |
|
| @@ 66-78 (lines=13) @@ | ||
| 63 | /** |
|
| 64 | * {@inheritdoc} |
|
| 65 | */ |
|
| 66 | public function render() |
|
| 67 | { |
|
| 68 | $options = json_encode($this->options); |
|
| 69 | ||
| 70 | $this->script = <<<EOT |
|
| 71 | $('{$this->getElementClassSelector()}').inputmask($options); |
|
| 72 | EOT; |
|
| 73 | ||
| 74 | $this->prepend($this->symbol) |
|
| 75 | ->defaultAttribute('style', 'width: 120px'); |
|
| 76 | ||
| 77 | return parent::render(); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||