@@ -8,71 +8,71 @@ |
||
| 8 | 8 | |
| 9 | 9 | abstract class NodeComponent extends Component\AbstractComponent |
| 10 | 10 | { |
| 11 | - use Component\HelperTrait; |
|
| 12 | - use Component\NodeResponseTrait; |
|
| 13 | - use Component\AjaxResponseTrait; |
|
| 14 | - use Component\ComponentTrait; |
|
| 11 | +use Component\HelperTrait; |
|
| 12 | +use Component\NodeResponseTrait; |
|
| 13 | +use Component\AjaxResponseTrait; |
|
| 14 | +use Component\ComponentTrait; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 16 | +/** |
|
| 17 | 17 | * @inheritDoc |
| 18 | 18 | */ |
| 19 | - final protected function initComponent(Container $di, ComponentHelper $xHelper): void |
|
| 20 | - { |
|
| 21 | - $this->setHelper($xHelper); |
|
| 22 | - $this->setNodeResponse($di); |
|
| 23 | - $this->setAjaxResponse($di); |
|
| 24 | - } |
|
| 19 | +final protected function initComponent(Container $di, ComponentHelper $xHelper): void |
|
| 20 | +{ |
|
| 21 | +$this->setHelper($xHelper); |
|
| 22 | +$this->setNodeResponse($di); |
|
| 23 | +$this->setAjaxResponse($di); |
|
| 24 | +} |
|
| 25 | 25 | |
| 26 | - /** |
|
| 26 | +/** |
|
| 27 | 27 | * @return string|Stringable |
| 28 | 28 | */ |
| 29 | - abstract public function html(): string|Stringable; |
|
| 29 | +abstract public function html(): string|Stringable; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 31 | +/** |
|
| 32 | 32 | * Called before rendering the component. |
| 33 | 33 | * |
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | - protected function before(): void |
|
| 37 | - {} |
|
| 36 | +protected function before(): void |
|
| 37 | +{} |
|
| 38 | 38 | |
| 39 | - /** |
|
| 39 | +/** |
|
| 40 | 40 | * Called after rendering the component. |
| 41 | 41 | * |
| 42 | 42 | * @return void |
| 43 | 43 | */ |
| 44 | - protected function after(): void |
|
| 45 | - {} |
|
| 44 | +protected function after(): void |
|
| 45 | +{} |
|
| 46 | 46 | |
| 47 | - /** |
|
| 47 | +/** |
|
| 48 | 48 | * Set the attached DOM node content with the component HTML code. |
| 49 | 49 | * |
| 50 | 50 | * @return void |
| 51 | 51 | */ |
| 52 | - final public function render(): void |
|
| 53 | - { |
|
| 54 | - $this->before(); |
|
| 55 | - $this->node()->html((string)$this->html()); |
|
| 56 | - $this->after(); |
|
| 57 | - } |
|
| 52 | +final public function render(): void |
|
| 53 | +{ |
|
| 54 | +$this->before(); |
|
| 55 | +$this->node()->html((string)$this->html()); |
|
| 56 | +$this->after(); |
|
| 57 | +} |
|
| 58 | 58 | |
| 59 | - /** |
|
| 59 | +/** |
|
| 60 | 60 | * Clear the attached DOM node content. |
| 61 | 61 | * |
| 62 | 62 | * @return void |
| 63 | 63 | */ |
| 64 | - final public function clear(): void |
|
| 65 | - { |
|
| 66 | - $this->node()->clear(); |
|
| 67 | - } |
|
| 64 | +final public function clear(): void |
|
| 65 | +{ |
|
| 66 | +$this->node()->clear(); |
|
| 67 | +} |
|
| 68 | 68 | |
| 69 | - /** |
|
| 69 | +/** |
|
| 70 | 70 | * Show/hide the attached DOM node. |
| 71 | 71 | * |
| 72 | 72 | * @return void |
| 73 | 73 | */ |
| 74 | - final public function visible(bool $bVisible): void |
|
| 75 | - { |
|
| 76 | - $bVisible ? $this->node()->jq()->show() : $this->node()->jq()->hide(); |
|
| 77 | - } |
|
| 74 | +final public function visible(bool $bVisible): void |
|
| 75 | +{ |
|
| 76 | +$bVisible ? $this->node()->jq()->show() : $this->node()->jq()->hide(); |
|
| 77 | +} |
|
| 78 | 78 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | interface ModalInterface |
| 18 | 18 | { |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * Show a modal dialog. |
| 21 | 21 | * |
| 22 | 22 | * @param string $sTitle The title of the dialog |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @return void |
| 28 | 28 | */ |
| 29 | - public function show(string $sTitle, string $sContent, array $aButtons = [], array $aOptions = []): void; |
|
| 29 | +public function show(string $sTitle, string $sContent, array $aButtons = [], array $aOptions = []): void; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 31 | +/** |
|
| 32 | 32 | * Hide the modal dialog. |
| 33 | 33 | * |
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | - public function hide(): void; |
|
| 36 | +public function hide(): void; |
|
| 37 | 37 | } |
@@ -6,24 +6,24 @@ |
||
| 6 | 6 | |
| 7 | 7 | trait DialogTrait |
| 8 | 8 | { |
| 9 | - /** |
|
| 9 | +/** |
|
| 10 | 10 | * @return AjaxResponse |
| 11 | 11 | */ |
| 12 | - abstract protected function response(): AjaxResponse; |
|
| 12 | +abstract protected function response(): AjaxResponse; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 14 | +/** |
|
| 15 | 15 | * @return AlertInterface |
| 16 | 16 | */ |
| 17 | - protected function alert(): AlertInterface |
|
| 18 | - { |
|
| 19 | - return $this->response()->dialog; |
|
| 20 | - } |
|
| 17 | +protected function alert(): AlertInterface |
|
| 18 | +{ |
|
| 19 | +return $this->response()->dialog; |
|
| 20 | +} |
|
| 21 | 21 | |
| 22 | - /** |
|
| 22 | +/** |
|
| 23 | 23 | * @return ModalInterface |
| 24 | 24 | */ |
| 25 | - protected function modal(): ModalInterface |
|
| 26 | - { |
|
| 27 | - return $this->response()->dialog; |
|
| 28 | - } |
|
| 25 | +protected function modal(): ModalInterface |
|
| 26 | +{ |
|
| 27 | +return $this->response()->dialog; |
|
| 28 | +} |
|
| 29 | 29 | } |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | interface AlertInterface |
| 18 | 18 | { |
| 19 | - /** |
|
| 19 | +/** |
|
| 20 | 20 | * Set the title of the next message. |
| 21 | 21 | * |
| 22 | 22 | * @param string $sTitle The title of the message |
| 23 | 23 | * |
| 24 | 24 | * @return AlertInterface |
| 25 | 25 | */ |
| 26 | - public function title(string $sTitle): AlertInterface; |
|
| 26 | +public function title(string $sTitle): AlertInterface; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 28 | +/** |
|
| 29 | 29 | * Show a success message. |
| 30 | 30 | * |
| 31 | 31 | * @param string $sMessage The text of the message |
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | - public function success(string $sMessage, ...$aArgs): void; |
|
| 36 | +public function success(string $sMessage, ...$aArgs): void; |
|
| 37 | 37 | |
| 38 | - /** |
|
| 38 | +/** |
|
| 39 | 39 | * Show an information message. |
| 40 | 40 | * |
| 41 | 41 | * @param string $sMessage The text of the message |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @return void |
| 45 | 45 | */ |
| 46 | - public function info(string $sMessage, ...$aArgs): void; |
|
| 46 | +public function info(string $sMessage, ...$aArgs): void; |
|
| 47 | 47 | |
| 48 | - /** |
|
| 48 | +/** |
|
| 49 | 49 | * Show a warning message. |
| 50 | 50 | * |
| 51 | 51 | * @param string $sMessage The text of the message |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return void |
| 55 | 55 | */ |
| 56 | - public function warning(string $sMessage, ...$aArgs): void; |
|
| 56 | +public function warning(string $sMessage, ...$aArgs): void; |
|
| 57 | 57 | |
| 58 | - /** |
|
| 58 | +/** |
|
| 59 | 59 | * Show an error message. |
| 60 | 60 | * |
| 61 | 61 | * @param string $sMessage The text of the message |
@@ -63,5 +63,5 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return void |
| 65 | 65 | */ |
| 66 | - public function error(string $sMessage, ...$aArgs): void; |
|
| 66 | +public function error(string $sMessage, ...$aArgs): void; |
|
| 67 | 67 | } |