├── .gitattributes ├── CHANGE.md ├── LICENSE.md ├── README.md ├── composer.json └── src ├── Editable.php ├── EditableAsset.php ├── EditablePjaxAsset.php ├── assets ├── css │ ├── editable.css │ └── editable.min.css ├── img │ └── loading.gif └── js │ ├── editable-pjax.js │ ├── editable-pjax.min.js │ ├── editable.js │ └── editable.min.js └── messages ├── af └── kveditable.php ├── ar └── kveditable.php ├── az └── kveditable.php ├── bg └── kveditable.php ├── bs └── kveditable.php ├── ca └── kveditable.php ├── config.php ├── cs └── kveditable.php ├── da └── kveditable.php ├── de └── kveditable.php ├── el-GR └── kveditable.php ├── el └── kveditable.php ├── en └── kveditable.php ├── eo └── kveditable.php ├── es └── kveditable.php ├── et └── kveditable.php ├── eu └── kveditable.php ├── fa └── kveditable.php ├── fi └── kveditable.php ├── fo └── kveditable.php ├── fr └── kveditable.php ├── gl └── kveditable.php ├── gu └── kveditable.php ├── he └── kveditable.php ├── hi └── kveditable.php ├── hr └── kveditable.php ├── hu └── kveditable.php ├── hy └── kveditable.php ├── id └── kveditable.php ├── is └── kveditable.php ├── it └── kveditable.php ├── ja └── kveditable.php ├── ka └── kveditable.php ├── kk └── kveditable.php ├── kn └── kveditable.php ├── ko └── kveditable.php ├── ky └── kveditable.php ├── lt └── kveditable.php ├── lv └── kveditable.php ├── mi └── kveditable.php ├── mk └── kveditable.php ├── mn └── kveditable.php ├── mr └── kveditable.php ├── ms └── kveditable.php ├── mt └── kveditable.php ├── nb └── kveditable.php ├── nl └── kveditable.php ├── nn └── kveditable.php ├── pl └── kveditable.php ├── pt-BR └── kveditable.php ├── pt-PT └── kveditable.php ├── pt └── kveditable.php ├── qu └── kveditable.php ├── ro └── kveditable.php ├── ru └── kveditable.php ├── sa └── kveditable.php ├── se └── kveditable.php ├── sk └── kveditable.php ├── sl └── kveditable.php ├── sq └── kveditable.php ├── sr └── kveditable.php ├── sv └── kveditable.php ├── sw └── kveditable.php ├── ta └── kveditable.php ├── te └── kveditable.php ├── th └── kveditable.php ├── tj └── kveditable.php ├── tl └── kveditable.php ├── tn └── kveditable.php ├── tr └── kveditable.php ├── ts └── kveditable.php ├── tt └── kveditable.php ├── uk └── kveditable.php ├── ur └── kveditable.php ├── vi └── kveditable.php ├── zh-CN └── kveditable.php ├── zh-TW └── kveditable.php └── zu └── kveditable.php /.gitattributes: -------------------------------------------------------------------------------- 1 | .github/ export-ignore 2 | -------------------------------------------------------------------------------- /CHANGE.md: -------------------------------------------------------------------------------- 1 | Change Log: `yii2-editable` 2 | =========================== 3 | 4 | ## Version 1.8.0 5 | 6 | **Date:** 29-Apr-2022 7 | 8 | - (enh #217): PHP 8.1 enhancements for native functions. 9 | 10 | ## Version 1.7.9 11 | 12 | **Date:** 20-Nov-2021 13 | 14 | - (enh #214): Enhance close button CSS style for support in all Bootstrap releases. 15 | - (enh #212): Enhancements to support Bootstrap v5.x. 16 | - (enh #206): Validate undefined data returned to ajax call. 17 | - (enh #198): Initialize value for model. 18 | - (enh #184): Add gitattributes. 19 | 20 | ## Version 1.7.8 21 | 22 | **Date:** 03-Oct-2018 23 | 24 | - (enh #181, #182): Correct composer dependencies. 25 | 26 | ## Version 1.7.7 27 | 28 | **Date:** 16-Sep-2018 29 | 30 | - (enh #180): Update Persian Translations. 31 | - (bug #178, #179): Correct bugs in editable.js variable calls. 32 | - Reorganize source code in `src` directory. 33 | - (enh #174): Correct HTML Encode. 34 | - (enh #167): Correct widget options for widgets like DateControl. 35 | 36 | ## Version 1.7.6 37 | 38 | **Date:** 28-Jun-2017 39 | 40 | - Chronlogically sort issues and enhancements in CHANGE Log. 41 | - (enh #157): Add Turkish translations. 42 | - (enh #153): New property `resetDelay` to control the delay in processing callback during editable reset. 43 | - (enh #152): New property `closeOnBlur` that automatically closes the form on blur. 44 | - (enh #152): New property `animationDelay` to control fade animation delay for popover or inline element. 45 | - (enh #150): Code enhancements and optimizations. 46 | - (enh #149): New property `validationDelay` to control client validation delay for active form. 47 | - (enh #148): New property `selectAllOnEdit` that automatically selects all text in the input on edit. 48 | - (enh #147): Fix disappearing form when pressing enter. 49 | - (enh #146): Close inline form on escape. 50 | 51 | ## Version 1.7.5 52 | 53 | **Date:** 08-Jan-2017 54 | 55 | - (bug #141): Close inline editable tags correctly. 56 | - (bug #139): Better validation of value set in displayValueConfig. 57 | - (bug #136): New property `additionalData` to send additional data as key-value pairs via editable ajax form POST. 58 | - (enh #126): Fix help block display for non active forms. 59 | - (enh #125): Add Latvian translations. 60 | - (enh #123): Allow advanced form data to be sent via ajax (e.g. file inputs). 61 | - (enh #121): Add Ukranian translations. 62 | - (enh #120): Add Estonian translations. 63 | - (enh #116): New configurable property `pluginOptions['validationDelay']` to control the editable submission validation delay (in micro-seconds). 64 | - (enh #113): Allow ability to configure `valueOptions['class']` in link mode. 65 | - (enh #108): Add Dutch translations. 66 | - (enh #105): Add Indonesian translations. 67 | - Correct Editable input types. 68 | - Add github contribution and issue/PR logging templates. 69 | - Update message config to include all default standard translation files. 70 | 71 | ## Version 1.7.4 72 | 73 | **Date:** 27-Dec-2015 74 | 75 | - (enh #104): Enhance jQuery events 76 | - New event `editableBeforeSubmit` that submits before ajax request 77 | - Enable events to be aborted and prevent default behavior by `event.preventDefault()` (applicable for most critical editable events) 78 | - Incorporate event namespace `.editable` on the critical events 79 | - Code optimizations for widget and JS plugin. 80 | - (enh #103): Add Czech Translations. 81 | - (enh #100): New `initEditablePopover` method to initialize popover for AJAX replaced editables. 82 | - (enh #91): Add plugin option `encodeOutput` to encode HTML output. 83 | - (enh #88): Update Russian translations. 84 | - (enh #87): Add jQuery plugin destroy & create methods. 85 | - (enh #85): Add Greek translations. 86 | - (enh #84): Update Portugese translations. 87 | - (enh #64): Better fix for #64 in resetting errors. 88 | 89 | ## Version 1.7.3 90 | 91 | **Date:** 01-Jul-2015 92 | 93 | - (enh #78): Added Chinese translations. 94 | - (enh #76): Improved Spanish translations. 95 | - (enh #73): Added Polish translations. 96 | - (enh #70): Added default `en` translations. 97 | - (enh #69): Generate default `en` message translation file. 98 | - (enh #64): Better reset of error container help-block content. 99 | - (bug #63): Fix renderActionButtons to correctly parse submit & reset button options. 100 | - (enh #62): Enhance footer property to include tags for '{loading}' and '{buttons}'. 101 | - (enh #61): New boolean property `showButtonLabels` to control the display of action button labels (will show the label as title on hover). 102 | - (enh #60): Ability to configure action button `icon` and `label` separately. 103 | - (enh #59): New `buttonsTemplate` property for rendering editable form action buttons (reset and submit). 104 | - (enh #58, #3): Ability to render editable content INLINE as an alternative to a POPOVER. 105 | - New `asPopover` boolean property added. 106 | - Enhanced inline form styles 107 | - INLINE templates and settings to control how content should be rendered 108 | - Two built in inline templates 109 | - (enh #57): Added translation support for Lithuanian language. 110 | - (enh #56): Reset/Clear help-block error messages before next validation. 111 | - (enh #54): Auto guess input and set input options based on input type. 112 | 113 | ## Version 1.7.2 114 | 115 | **Date:** 29-Mar-2015 116 | 117 | - (enh #53): Auto initialize `kv-editable-input` CSS for various input types and widgets. 118 | - (bug #49): Throw exception when an array value is passed as key to `displayValueConfig`. 119 | - (enh #47, #48): New property `submitOnEnter` to control save on ENTER key press. 120 | - (enh #44): Revamp editable widget initialization and auto detection of input. 121 | - (enh #41): Improve validation to retrieve the right translation messages folder. 122 | - (enh #40): Enhanced styling for disabled editable button. 123 | - (enh #39): Better validation for `valueIfNull`. 124 | 125 | ## Version 1.7.1 126 | 127 | **Date:** 13-Feb-2015 128 | 129 | - Set copyright year to current. 130 | - (enh #35): Add French translations. 131 | - (enh #34): Various enhancements to plugin code. 132 | - (enh #33): New `ajaxSettings` property that can be used to merge additional ajax settings/options for editable submission. 133 | - (enh #32): Pass additional data to various editable events 134 | - `editableSubmit`: pass the editable form jquery element in addition to editable input element value 135 | - `editableSuccess`: pass ajax response data and editable form jquery element in addition to editable input element value 136 | - `editableError`: pass ajax response data editable form jquery elementin addition to editable input element value 137 | - (bug #24): More correct `displayValueConfig` validation. 138 | 139 | ## Version 1.7.0 140 | 141 | **Date:** 12-Jan-2015 142 | 143 | - Code formatting updates as per Yii2 coding style. 144 | - Revamp to use new Krajee base Module and TranslationTrait. 145 | - (enh #27): Add Spanish translations. 146 | - (bug #25): Fix options setting for PopoverX. 147 | 148 | ## Version 1.6.0 149 | 150 | **Date:** 22-Nov-2014 151 | 152 | - (enh #22): Revamp extension to work better with model validation and in EditableColumn. 153 | - (enh #21): Enhancements for rendering widgets and related styling. 154 | - (bug #20): Fix widgets for use in Editable. 155 | - (enh #18): Add Italian language translations. 156 | - (enh #16): Enhance dependency validation using common code base. 157 | - (enh #15): Add Vietnamese language translations. 158 | 159 | ## Version 1.4.0 160 | 161 | **Date:** 22-Oct-2014 162 | 163 | - New property `showAjaxErrors` included for the editable jQuery plugin. 164 | - (enh #14): Raise new `editableAjaxError` event for errors faced via ajax 165 | 166 | ## Version 1.3.0 167 | 168 | **Date:** 04-Sep-2014 169 | 170 | - PSR4 alias change 171 | - (enh #9): Included client plugin events `editableChange`, `editableSubmit`, `editableReset`, `editableSuccess`, and `editableError`. 172 | - (enh #8): Enhance `beforeInput` & `afterInput` to be passed as callback functions. 173 | 174 | ## Version 1.2.0 175 | 176 | **Date:** 26-Aug-2014 177 | 178 | - (enh #6): Added `displayValueConfig` to auto calculate display value. 179 | - (enh #4): Better fix to reinitialize form error blocks for each ajax call. 180 | 181 | 182 | ## Version 1.1.0 183 | 184 | **Date:** 21-Aug-2014 185 | 186 | - (enh #5): More correct valueIfNull and displayValue null validation check. 187 | - (enh #4): Reinitialize form error blocks for each ajax call. 188 | - (enh #2): Enhancements to the widget for rendering and processing via Pjax. 189 | 190 | ## Version 1.0.0 191 | 192 | **Date:** 27-Jul-2014 193 | 194 | ###Initial release 195 | 196 | - Set any readable markup on your view, DetailView, or GridView to be editable. (**Under Process:** The widgets `\kartik\grid\GridView` 197 | and `\kartik\detail\DetailView` widgets will be (enhanced to use this extension in a very easy way. 198 | - Provides two display formats for setting up your editable content . 199 | - **Link**): Convert the editable content as a clickable link for popover. 200 | - **Button**): Do not convert the editable content to a link, but instead display a button beside it for editing content. 201 | - Uses Yii 2.0 ActiveForm for editing content. Hence all features of Yii ActiveForm, including model validation rules are available. 202 | - For editing the content, you can configure it to use any of the HTML inputs, or widgets available from **kartik-v/yii2-widgets** or other input widgets from https://github.com/kartik-v. 203 | In addition, one can also use HTML 5 inputs or any custom input widget to edit your content. 204 | - Entirely control the way the form content is displayed in the popover. By default, the widget displays the input to be edited. In addition, one can place 205 | more form fields or markup before and after this default input. 206 | - Uses AJAX based form submission to process quick editing of data and a seamless user experience. 207 | - Uses advanced features of the [yii2-popover-x extension](http://demos.krajee.com/popover-x), to control display formats for your editable popover form. This 208 | uses the (enhanced [bootstrap-popover-x](http://plugins.krajee.com/popover-x) by Krajee. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 - 2022, Kartik Visweswaran 2 | Krajee.com 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, this 12 | list of conditions and the following disclaimer in the documentation and/or 13 | other materials provided with the distribution. 14 | 15 | * Neither the names of Kartik Visweswaran or Krajee nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 26 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Krajee Logo 4 | 5 |
6 | yii2-editable 7 |
8 | Donate 10 |       11 | kartikv 12 |

13 | 14 |
15 | 16 | [![Latest Stable Version](https://poser.pugx.org/kartik-v/yii2-editable/v/stable)](https://packagist.org/packages/kartik-v/yii2-editable) 17 | [![Unstable Version](https://poser.pugx.org/kartik-v/yii2-krajee-base/v/unstable)](https://packagist.org/packages/kartik-v/yii2-editable) 18 | [![License](https://poser.pugx.org/kartik-v/yii2-editable/license)](https://packagist.org/packages/kartik-v/yii2-editable) 19 | [![Total Downloads](https://poser.pugx.org/kartik-v/yii2-editable/downloads)](https://packagist.org/packages/kartik-v/yii2-editable) 20 | [![Monthly Downloads](https://poser.pugx.org/kartik-v/yii2-editable/d/monthly)](https://packagist.org/packages/kartik-v/yii2-editable) 21 | [![Daily Downloads](https://poser.pugx.org/kartik-v/yii2-editable/d/daily)](https://packagist.org/packages/kartik-v/yii2-editable) 22 | 23 |
24 | 25 | Easily set any displayed content as editable in Yii Framework 2.0. This is an enhanced editable widget for Yii 2.0 that allows easy editing of displayed data, using inputs, widgets and more with numerous configuration possibilities. The extension uses the enhanced [yii2-popover-x](http://demos.krajee.com/popover-x) extension as a popover modal for editing. With release v1.7.3, this extension also allows you to render the editable content inline and offers advanced inline templates for configuration. This extension does not use any external jQuery plugin like X-Editable, instead it uses its own lean and extensible 26 | jQuery editable plugin - that elaborately reuses functionality available within Yii Framework 2.0. 27 | 28 | > Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-editable/blob/master/CHANGE.md) for latest release details. 29 | 30 | ## Features 31 | 32 | 1. Set any readable markup on your view, DetailView, or GridView to be editable. Refer the [EditableColumn](http://demos.krajee.com/grid#editable-column) details in kartik\grid\GridView for using an editable column in your grid. 33 | 2. Provides two display formats for setting up your editable content . 34 | - **Link**: Convert the editable content as a clickable link for popover. 35 | - **Button**: Do not convert the editable content to a link, but rather display a button beside it for editing content. 36 | 3. Ability to render the content as a POPOVER or INLINE. 37 | 4. Advanced configurable inline templates for rendering complex content. 38 | 5. Uses Yii 2.0 ActiveForm for editing content. Hence all features of Yii ActiveForm, including model validation rules are available. 39 | 6. For editing the content, you can configure it to use any of the HTML inputs, or widgets available from **kartik-v/yii2-widgets** or other input widgets from https://github.com/kartik-v. 40 | In addition, you can also use HTML 5 inputs or any custom input widget to edit your content. 41 | 7. Entirely control the way the form content is displayed in the popover. By default, the widget displays the input to be edited. In addition, you can place 42 | more form fields or markup before and after this default input. 43 | 8. Uses AJAX based form submission to process quick editing of data and provide a seamless user experience. 44 | 9. Uses advanced features of the [yii2-popover-x extension](http://demos.krajee.com/popover-x), to control display formats for your editable popover form. This 45 | uses the enhanced [bootstrap-popover-x](http://plugins.krajee.com/popover-x) jQuery plugin by Krajee. 46 | 10. Easily extend the default editable field by adding more form fields for editing before or after the generated editable input. 47 | 11. Configure your own display value irrespective of the value stored internally. 48 | 12. Configurable css styles and labels for rendering editable content according to your application or theme. 49 | 13. Ability to render and reinitialize automatically the widget via Pjax. 50 | 51 | > Note: Check the [composer.json](https://github.com/kartik-v/yii2-money/blob/master/composer.json) for this extension's requirements and dependencies. 52 | Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json. 53 | 54 | ## Demo 55 | 56 | You can see detailed [documentation and examples](http://demos.krajee.com/editable) on usage of the extension. 57 | 58 | ## Installation 59 | 60 | The preferred way to install this extension is through [composer](http://getcomposer.org/download/). 61 | 62 | 63 | > Note: Check the [composer.json](https://github.com/kartik-v/yii2-editable/blob/master/composer.json) for this extension's requirements and dependencies. 64 | Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json. 65 | 66 | Either run 67 | 68 | ``` 69 | $ php composer.phar require kartik-v/yii2-editable "@dev" 70 | ``` 71 | 72 | or add 73 | 74 | ``` 75 | "kartik-v/yii2-editable": "@dev" 76 | ``` 77 | 78 | to the ```require``` section of your `composer.json` file. 79 | 80 | ## Usage 81 | 82 | ### Editable 83 | 84 | ```php 85 | use kartik\editable\Editable; 86 | echo Editable::widget([ 87 | 'model' => $model, 88 | 'attribute' => 'rating', 89 | 'type' => 'primary', 90 | 'size'=> 'lg', 91 | 'inputType' => Editable::INPUT_RATING, 92 | 'editableValueOptions' => ['class' => 'text-success h3'] 93 | ]); 94 | ``` 95 | 96 | ## License 97 | 98 | **yii2-editable** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details. -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kartik-v/yii2-editable", 3 | "description": "An enhanced editable widget for Yii 2.0 that allows easy editing of displayed data with numerous configuration possibilities.", 4 | "keywords": [ 5 | "bootstrap", 6 | "editable", 7 | "input", 8 | "widget", 9 | "popover-x", 10 | "popover", 11 | "jquery" 12 | ], 13 | "homepage": "https://github.com/kartik-v/yii2-editable", 14 | "type": "yii2-extension", 15 | "license": "BSD-3-Clause", 16 | "authors": [ 17 | { 18 | "name": "Kartik Visweswaran", 19 | "email": "kartikv2@gmail.com", 20 | "homepage": "http://www.krajee.com/" 21 | } 22 | ], 23 | "require": { 24 | "kartik-v/yii2-widget-activeform": ">=1.6.2", 25 | "kartik-v/yii2-popover-x": "~1.3" 26 | }, 27 | "autoload": { 28 | "psr-4": { 29 | "kartik\\editable\\": "src" 30 | } 31 | }, 32 | "extra": { 33 | "branch-alias": { 34 | "dev-master": "1.8.x-dev" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Editable.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 6 | * @version 1.8.0 7 | */ 8 | 9 | namespace kartik\editable; 10 | 11 | use Closure; 12 | use Exception; 13 | use kartik\base\Config; 14 | use kartik\base\InputWidget; 15 | use kartik\base\Lib; 16 | use kartik\popover\PopoverX; 17 | use Yii; 18 | use yii\base\InvalidConfigException; 19 | use yii\helpers\ArrayHelper; 20 | use yii\helpers\Html; 21 | use yii\web\View; 22 | use yii\widgets\ActiveField; 23 | use yii\widgets\ActiveForm; 24 | 25 | /** 26 | * An extended editable widget for Yii Framework 2. 27 | * 28 | * @see http://github.com/kartik-v/yii2-editable 29 | * @author Kartik Visweswaran 30 | * @since 1.0 31 | */ 32 | class Editable extends InputWidget 33 | { 34 | /** 35 | * Editable LINK display format (default) 36 | */ 37 | const FORMAT_LINK = 'link'; 38 | /** 39 | * Editable BUTTON display format 40 | */ 41 | const FORMAT_BUTTON = 'button'; 42 | /** 43 | * @var string editable prebuilt inline template number 1 for content before 44 | */ 45 | const INLINE_BEFORE_1 = <<< HTML 46 |
47 |
48 | {loading} 49 |
50 | HTML; 51 | /** 52 | * Editable prebuilt inline template number 1 for content after 53 | */ 54 | const INLINE_AFTER_1 = <<< HTML 55 |
56 | {buttons}{close} 57 |
58 |
59 | HTML; 60 | /** 61 | * Editable prebuilt inline template number 2 for content before 62 | */ 63 | const INLINE_BEFORE_2 = <<< HTML 64 |
65 | {close} 66 | {header} 67 |
68 |
69 | HTML; 70 | /** 71 | * Editable prebuilt inline template number 2 for content after 72 | */ 73 | const INLINE_AFTER_2 = <<< HTML 74 |
75 | 78 | HTML; 79 | 80 | /** 81 | * Hidden input 82 | */ 83 | const INPUT_HIDDEN = 'hiddenInput'; 84 | /** 85 | * Text input 86 | */ 87 | const INPUT_TEXT = 'textInput'; 88 | /** 89 | * Text area 90 | */ 91 | const INPUT_TEXTAREA = 'textArea'; 92 | /** 93 | * Password input 94 | */ 95 | const INPUT_PASSWORD = 'passwordInput'; 96 | /** 97 | * Dropdown list allowing single select 98 | */ 99 | const INPUT_DROPDOWN_LIST = 'dropDownList'; 100 | /** 101 | * List box allowing multiple select 102 | */ 103 | const INPUT_LIST_BOX = 'listBox'; 104 | /** 105 | * Checkbox input 106 | */ 107 | const INPUT_CHECKBOX = 'checkbox'; 108 | /** 109 | * Radio input 110 | */ 111 | const INPUT_RADIO = 'radio'; 112 | /** 113 | * Checkbox inputs as a list allowing multiple selection 114 | */ 115 | const INPUT_CHECKBOX_LIST = 'checkboxList'; 116 | /** 117 | * Radio inputs as a list 118 | */ 119 | const INPUT_RADIO_LIST = 'radioList'; 120 | /** 121 | * Bootstrap styled checkbox button group 122 | */ 123 | const INPUT_CHECKBOX_BUTTON_GROUP = 'checkboxButtonGroup'; 124 | /** 125 | * Bootstrap styled radio button group 126 | */ 127 | const INPUT_RADIO_BUTTON_GROUP = 'radioButtonGroup'; 128 | /** 129 | * Krajee styled multiselect input that allows formatted checkbox list and radio list 130 | */ 131 | const INPUT_MULTISELECT = 'multiselect'; 132 | /** 133 | * File input 134 | */ 135 | const INPUT_FILE = 'fileInput'; 136 | /** 137 | * Other HTML5 input (e.g. color, range, email etc.) 138 | */ 139 | const INPUT_HTML5 = 'input'; 140 | /** 141 | * Input widget 142 | */ 143 | const INPUT_WIDGET = 'widget'; 144 | /** 145 | * Krajee dependent dropdown input widget [[\kartik\depdrop\DepDrop]] 146 | */ 147 | const INPUT_DEPDROP = '\kartik\depdrop\DepDrop'; 148 | /** 149 | * Krajee select2 input widget [[\kartik\select2\Select2]] 150 | */ 151 | const INPUT_SELECT2 = '\kartik\select2\Select2'; 152 | /** 153 | * Krajee typeahead input widget [[\kartik\typeahead\Typeahead]] 154 | */ 155 | const INPUT_TYPEAHEAD = '\kartik\typeahead\Typeahead'; 156 | /** 157 | * Krajee switch input widget [[\kartik\switchinput\SwitchInput]] 158 | */ 159 | const INPUT_SWITCH = '\kartik\switchinput\SwitchInput'; 160 | /** 161 | * Krajee touch spin input widget [[\kartik\touchspin\TouchSpin]] 162 | */ 163 | const INPUT_SPIN = '\kartik\touchspin\TouchSpin'; 164 | /** 165 | * Krajee star rating input widget [[\kartik\rating\StarRating]] 166 | */ 167 | const INPUT_RATING = '\kartik\rating\StarRating'; 168 | /** 169 | * Krajee range input widget [[\kartik\range\RangeInput]] 170 | */ 171 | const INPUT_RANGE = '\kartik\range\RangeInput'; 172 | /** 173 | * Krajee color input widget [[\kartik\color\ColorInput]] 174 | */ 175 | const INPUT_COLOR = '\kartik\color\ColorInput'; 176 | /** 177 | * Krajee file input widget [[\kartik\file\FileInput]] 178 | */ 179 | const INPUT_FILEINPUT = '\kartik\file\FileInput'; 180 | /** 181 | * Krajee date picker input widget [[\kartik\date\DatePicker]] 182 | */ 183 | const INPUT_DATE = '\kartik\date\DatePicker'; 184 | /** 185 | * Krajee Time picker input widget [[\kartik\time\TimePicker]] 186 | */ 187 | const INPUT_TIME = '\kartik\time\TimePicker'; 188 | /** 189 | * Krajee date time Picker input widget [[\kartik\datetime\DateTimePicker]] 190 | */ 191 | const INPUT_DATETIME = '\kartik\datetime\DateTimePicker'; 192 | /** 193 | * Krajee date range picker input widget [[\kartik\daterange\DateRangePicker]] 194 | */ 195 | const INPUT_DATE_RANGE = '\kartik\daterange\DateRangePicker'; 196 | /** 197 | * Krajee sortable input widget [[\kartik\sortinput\SortableInput]] 198 | */ 199 | const INPUT_SORTABLE = '\kartik\sortinput\SortableInput'; 200 | /** 201 | * Krajee slider input widget [[\kartik\slider\Slider]] 202 | */ 203 | const INPUT_SLIDER = '\kartik\slider\Slider'; 204 | /** 205 | * Krajee mask money input widget [[\kartik\money\MaskMoney]] 206 | */ 207 | const INPUT_MONEY = '\kartik\money\MaskMoney'; 208 | /** 209 | * Krajee checkbox extended input widget [[\kartik\checkbox\CheckboxX]] 210 | */ 211 | const INPUT_CHECKBOX_X = '\kartik\checkbox\CheckboxX'; 212 | /** 213 | * Loading indicator markup for the editable 214 | */ 215 | const LOAD_INDICATOR = ''; 216 | /** 217 | * CSS setting for the editable parent 218 | */ 219 | const CSS_PARENT = "kv-editable-parent form-group"; 220 | 221 | /** 222 | * @var string the identifier for the PJAX widget container if the editable widget is to be rendered inside a PJAX 223 | * container. This will ensure the PopoverX plugin is initialized correctly after a PJAX request is completed. 224 | * If this is not set, no re-initialization will be done for pjax. 225 | */ 226 | public $pjaxContainerId; 227 | 228 | /** 229 | * @var string the display format for the editable. Accepts one of the following values. 230 | * - `'link' or [[Editable::FORMAT_LINK]]: will convert the text to a clickable editable link. 231 | * - `'button' or [[Editable::FORMAT_BUTTON]]: will display a separate button beside the text. 232 | * Defaults to [[Editable::FORMAT_LINK]] if you do not set it as [[Editable::FORMAT_BUTTON]]. 233 | */ 234 | public $format = self::FORMAT_LINK; 235 | 236 | /** 237 | * @var boolean whether to show the editable input as a popover. Defaults to `true`. If set to `false`, it will be 238 | * rendered inline. 239 | */ 240 | public $asPopover = true; 241 | 242 | /** 243 | * @var array the settings for the inline editable when [[asPopover]] is `false`. The following properties are 244 | * recognized: 245 | * - `options`: _array_, the HTML attributes for the `div` panel container that will enclose the inline content. By 246 | * default the options will be set to `['class' => 'card panel panel-default']`. 247 | * - `closeButton`: _string_, the markup for rendering the close button to close the inline panel. Note the markup must 248 | * have the CSS class `kv-editable-close` to trigger the closure of the inline panel. The `closeButton` 249 | * defaults to ``. 250 | * - `templateBefore`: _string_, the template for inline content rendered before the input. Defaults to 251 | * [[INLINE_BEFORE_1]]. 252 | * - `templateAfter`: _string_, he template for inline content rendered after the input. Defaults to 253 | * [[INLINE_AFTER_1]]. The following tokens in the templates above will be automatically replaced: 254 | * - '{header}': the header generated via `preHeader` and `header` properties. 255 | * - '{inputs}': the main form input content (combining `beforeInput`, the input/widget generated based on 256 | * `inputType`, and `afterInput`) 257 | * - '{buttons}': the form action buttons (submit and reset). 258 | * - '{loading}': the loading indicator. 259 | * - '{close}': the close button to close the inline content as set in `inlineSettings['closeButton']`. 260 | */ 261 | public $inlineSettings = []; 262 | 263 | /** 264 | * @var array the HTML attributes for the editable button to be displayed when the format has been set to 'button': 265 | * - `label`: _string_, the editable button label. This is not HTML encoded. Defaults to [[defaultEditableBtnIcon]]. 266 | */ 267 | public $editableButtonOptions = []; 268 | 269 | /** 270 | * @var array the HTML attributes for the editable value displayed 271 | */ 272 | public $editableValueOptions = []; 273 | 274 | /** 275 | * @var array the HTML attributes for the editable container 276 | */ 277 | public $containerOptions = []; 278 | 279 | /** 280 | * @var array the HTML attributes for the input container applicable only when not using with ActiveForm 281 | */ 282 | public $inputContainerOptions = []; 283 | 284 | /** 285 | * @var string the popover contextual type. Must be one of the [[PopoverX::TYPE]] constants Defaults to 286 | * [[PopoverX::TYPE_DEFAULT]] or `default`. This will be applied only if [[asPopover]] is `true`. 287 | */ 288 | public $type = PopoverX::TYPE_DEFAULT; 289 | 290 | /** 291 | * @var string the size of the popover window. One of the `PopoverX::SIZE` constants. This will be applied only 292 | * if [[asPopover]] is `true`. 293 | */ 294 | public $size; 295 | 296 | /** 297 | * @var string the popover placement. Must be one of the `PopoverX::ALIGN` constants Defaults to 298 | * [[PopoverX::ALIGN_RIGHT]] or `right`. This will be applied only if [[asPopover]] is `true`. 299 | */ 300 | public $placement = PopoverX::ALIGN_RIGHT; 301 | 302 | /** 303 | * @var string the header content placed before the header text in the popover dialog or inline panel. This 304 | * defaults to: '{icon} Edit' - where {icon} is the [[defaultPreHeaderIcon]] markup. 305 | */ 306 | public $preHeader; 307 | 308 | /** 309 | * @var string the header content in the popover dialog or inline panel. If not set, this will be auto generated 310 | * based on the attribute label or set to null. 311 | */ 312 | public $header; 313 | 314 | /** 315 | * @var string the footer content in the popover dialog or inline panel. The following special tags/variables will 316 | * be parsed and replaced in the footer: 317 | * - `{loading}`: _string_, will be replaced with the loading indicator. 318 | * - `{buttons}`: _string_, will be replaced with the submit and reset button. If this is set to null or an empty 319 | * string, it will not be displayed. 320 | */ 321 | public $footer = '{loading}{buttons}'; 322 | 323 | /** 324 | * @var string the value to be displayed. If not set, this will default to the attribute value. If the attribute 325 | * value is null, then this will display the value as set in [[valueIfNull]]. 326 | */ 327 | public $displayValue; 328 | 329 | /** 330 | * @var array the configuration to auto-calculate display value, based on the value of the editable input. This 331 | * should be a single dimensional array whose keys must match the input value, and the array values must be the 332 | * description to be displayed. For example, to display user friendly bool values, you could configure this as 333 | * `[0 => 'Inactive', 1 => 'Active']`. If this is set, it will override any value set in `displayValue`. 334 | */ 335 | public $displayValueConfig = []; 336 | 337 | /** 338 | * @var string the value to display if the displayValue is null. Defaults to '(not set)'. 339 | */ 340 | public $valueIfNull; 341 | 342 | /** 343 | * @var array the HTML attributes for the container enclosing the main content in the popover dialog. 344 | */ 345 | public $contentOptions = []; 346 | 347 | /** 348 | * @var array the class for the ActiveForm widget to be used. The class must extend from `\yii\widgets\ActiveForm`. 349 | * This defaults to `\kartik\form\ActiveForm`. 350 | */ 351 | public $formClass = '\kartik\form\ActiveForm'; 352 | 353 | /** 354 | * @var array the options for the ActiveForm widget class selected in `formClass`. 355 | */ 356 | public $formOptions = []; 357 | 358 | /** 359 | * @var array the input type to render for the editing the input in the editable form. This must be one of the 360 | * `Editable::TYPE` constants. 361 | */ 362 | public $inputType = self::INPUT_TEXT; 363 | 364 | /** 365 | * @var string any custom widget class to use. Will only be used if the `inputType` is set to 366 | * [[INPUT_WIDGET]] 367 | */ 368 | public $widgetClass; 369 | 370 | /** 371 | * @var boolean additional ajax settings to pass to the plugin. 372 | * @see http://api.jquery.com/jquery 373 | */ 374 | public $ajaxSettings = []; 375 | 376 | /** 377 | * @var boolean whether to display any ajax processing errors. Defaults to `true`. 378 | */ 379 | public $showAjaxErrors = true; 380 | 381 | /** 382 | * @var boolean whether to auto submit/save the form on pressing ENTER key. 383 | */ 384 | public $submitOnEnter = true; 385 | 386 | /** 387 | * @var boolean whether to select all text in the input when editable is opened. 388 | */ 389 | public $selectAllOnEdit = true; 390 | 391 | /** 392 | * @var boolean whether to HTML encode the output via javascript after editable update. Defaults to `true`. Note that 393 | * this is only applied, if you do not return an output value via your AJAX response action. If you return an 394 | * output value via AJAX it will not be HTML encoded. 395 | */ 396 | public $encodeOutput = true; 397 | 398 | /** 399 | * @var boolean whether to close the editable form when it loses focus. 400 | */ 401 | public $closeOnBlur = false; 402 | 403 | /** 404 | * @var integer editable submission validation delay (in micro-seconds). 405 | */ 406 | public $validationDelay = 500; 407 | 408 | /** 409 | * @var integer editable reset delay (in micro-seconds). 410 | */ 411 | public $resetDelay = 200; 412 | 413 | /** 414 | * @var integer|string editable fade animation delay (in micro-seconds). If entered as a string, it can be one of 415 | * `'slow'` or `'fast'`. 416 | * @see http://api.jquery.com/fadein/ 417 | */ 418 | public $animationDelay = 300; 419 | 420 | /** 421 | * @var array the options for the input. If the inputType is one of the HTML inputs, this will capture the HTML 422 | * attributes. If the `inputType` is set to [[INPUT_WIDGET]] or set to an input widget from the `\kartik\` 423 | * namespace, then this will capture the widget options. 424 | */ 425 | public $options = []; 426 | 427 | /** 428 | * @var array the ActiveField configuration, if you are using with `model`. 429 | */ 430 | public $inputFieldConfig = []; 431 | 432 | /** 433 | * @var string|Closure the content to be placed before the rendered input. If not set as a string, this can be 434 | * passed as a callback function of the following signature: 435 | * 436 | * ``` 437 | * function ($form, $widget) { 438 | * // echo $form->field($widget->model, 'attrib'); 439 | * } 440 | * ``` 441 | * 442 | * where: 443 | * 444 | * - `$form`: _ActiveForm_, is the active form instance for the editable form 445 | * - `$widget`: _Editable_, is the current editable widget instance 446 | */ 447 | public $beforeInput; 448 | 449 | /** 450 | * @var string|Closure the content to be placed after the rendered input. If not set as a string, this can be 451 | * passed as a callback function of the following signature: 452 | * ` 453 | * function ($form, $widget) { 454 | * // echo $form->field($widget->model, 'attrib'); 455 | * } 456 | * ` 457 | * 458 | * where: 459 | * 460 | * - `$form`: _ActiveForm_, is the active form instance for the editable form 461 | * - `$widget`: _Editable_, is the current editable widget instance 462 | */ 463 | public $afterInput; 464 | 465 | /** 466 | * @var boolean whether you wish to automatically display the form submit and reset buttons. Defaults to `true`. 467 | */ 468 | public $showButtons = true; 469 | 470 | /** 471 | * @var boolean whether you want to show the button labels. Defaults to `false`. 472 | */ 473 | public $showButtonLabels = false; 474 | 475 | /** 476 | * @var string the template for rendering the buttons 477 | */ 478 | public $buttonsTemplate = "{reset}{submit}"; 479 | 480 | /** 481 | * @var string the default icon for editable button set as the label in [[editableButtonOptions]]. Defaults to 482 | * ` for [[bsVersion]] = '3.x' and 483 | * ` for [[bsVersion]] = '4.x' 484 | */ 485 | public $defaultEditableBtnIcon; 486 | 487 | /** 488 | * @var string the default icon for editable button used in the [[preHeader]]. Defaults to: 489 | * ` ` for [[bsVersion]] = '3.x' and 490 | * ` ` for [[bsVersion]] = '4.x' 491 | */ 492 | public $defaultSubmitBtnIcon; 493 | 494 | /** 495 | * @var string the default icon for editable button used in the [[preHeader]]. Defaults to: 496 | * ` ` for [[bsVersion]] = '3.x' and 497 | * ` ` for [[bsVersion]] = '4.x' 498 | */ 499 | public $defaultResetBtnIcon; 500 | 501 | /** 502 | * @var string the default icon for editable button used in the [[preHeader]]. Defaults to: 503 | * ` ` for [[bsVersion]] = '3.x' and 504 | * ` Edit` for [[bsVersion]] = '4.x' 505 | */ 506 | public $defaultPreHeaderIcon; 507 | 508 | /** 509 | * @var array the HTML attributes for the form submit button. The following special properties are additionally 510 | * recognized: 511 | * - `icon`: _string_, the icon for the button. Defaults to [[defaultSubmitBtnIcon]]. 512 | * - `label`: _string_, the label of the button. This is HTML encoded. Defaults to `Apply` and is translated via yii 513 | * i18n message files. 514 | */ 515 | public $submitButton = ['class' => 'btn btn-sm btn-primary']; 516 | 517 | /** 518 | * @var array the HTML attributes for the form reset button. The following special properties are additionally 519 | * recognized: 520 | * - `icon`: _string_, the icon for the button. Defaults to [[defaultResetBtnIcon]] 521 | * - `label`: _string_, the label of the button. This is HTML encoded. Defaults to `Reset` and is translated via yii 522 | * i18n message files. 523 | */ 524 | public $resetButton = []; 525 | 526 | /** 527 | * @var array additional data to be passed when editable is submitted via ajax request as `$key => $value` pairs. 528 | * This will generate hidden inputs in the editable form with input name as `$key` and input value as `$value`. 529 | */ 530 | public $additionalData = []; 531 | 532 | /** 533 | * @var array the generated configuration for the [[PopoverX]] widget. 534 | */ 535 | protected $_popoverOptions = []; 536 | 537 | /** 538 | * @var array the HTML attributes or options for the input/widget 539 | */ 540 | protected $_inputOptions = []; 541 | 542 | /** 543 | * @var ActiveForm active form instance 544 | */ 545 | protected $_form; 546 | 547 | /** 548 | * @var string the i18n message category 549 | */ 550 | protected $_msgCat = 'kveditable'; 551 | 552 | /** 553 | * @var array configuration of icons for BS3 and BS4 554 | */ 555 | protected static $_icons = [ 556 | 'defaultEditableBtnIcon' => ['pencil', 'pencil-alt'], 557 | 'defaultSubmitBtnIcon' => ['ok', 'check'], 558 | 'defaultResetBtnIcon' => ['ban-circle', 'ban'], 559 | 'defaultPreHeaderIcon' => ['edit', 'edit'], 560 | ]; 561 | 562 | /** 563 | * @inheritdoc 564 | */ 565 | public function init() 566 | { 567 | parent::init(); 568 | $this->initEditable(); 569 | } 570 | 571 | /** 572 | * @inheritdoc 573 | */ 574 | public function run() 575 | { 576 | $this->runEditable(); 577 | } 578 | 579 | /** 580 | * Registers the client assets for [[Editable]] widget. 581 | */ 582 | public function registerAssets() 583 | { 584 | $view = $this->getView(); 585 | EditableAsset::register($view); 586 | $this->pluginOptions = [ 587 | 'valueIfNull' => $this->valueIfNull, 588 | 'asPopover' => $this->asPopover, 589 | 'placement' => $this->placement, 590 | 'target' => $this->format === self::FORMAT_BUTTON ? '.kv-editable-button' : '.kv-editable-link', 591 | 'displayValueConfig' => $this->displayValueConfig, 592 | 'ajaxSettings' => $this->ajaxSettings, 593 | 'showAjaxErrors' => $this->showAjaxErrors, 594 | 'submitOnEnter' => $this->submitOnEnter, 595 | 'selectAllOnEdit' => $this->selectAllOnEdit, 596 | 'encodeOutput' => $this->encodeOutput, 597 | 'closeOnBlur' => $this->closeOnBlur, 598 | 'validationDelay' => $this->validationDelay, 599 | 'resetDelay' => $this->resetDelay, 600 | 'animationDelay' => $this->animationDelay, 601 | ]; 602 | $this->registerPlugin('editable', 'jQuery("#' . $this->containerOptions['id'] . '")'); 603 | if (!empty($this->pjaxContainerId)) { 604 | EditablePjaxAsset::register($view); 605 | $toggleButton = $this->_popoverOptions['toggleButton']['id']; 606 | $initPjaxVar = 'kvEdPjax_' . Lib::str_replace('-', '_', $this->_popoverOptions['options']['id']); 607 | $view->registerJs("var {$initPjaxVar} = false;", View::POS_HEAD); 608 | if ($this->asPopover) { 609 | $js = "initEditablePjax('{$this->pjaxContainerId}', '{$toggleButton}', '{$initPjaxVar}');"; 610 | $view->registerJs($js); 611 | } 612 | } 613 | if ($this->inputType === Editable::INPUT_TIME) { 614 | $this->_popoverOptions['toggleButton']['data-show'] = true; 615 | } 616 | } 617 | 618 | /** 619 | * Gets the form instance for use at runtime 620 | * 621 | * @return ActiveForm 622 | */ 623 | public function getForm() 624 | { 625 | return $this->_form; 626 | } 627 | 628 | /** 629 | * Initialize default icons 630 | * @throws InvalidConfigException|Exception 631 | */ 632 | protected function initIcons() 633 | { 634 | $notBs3 = !$this->isBs(3); 635 | $prefix = $this->getDefaultIconPrefix(); 636 | foreach (static::$_icons as $icon => $setting) { 637 | if (!isset($this->$icon)) { 638 | $css = $notBs3 ? $setting[1] : $setting[0]; 639 | $this->$icon = Html::tag('i', '', ['class' => $prefix . $css]); 640 | } 641 | } 642 | } 643 | 644 | /** 645 | * Initializes the widget 646 | */ 647 | protected function initEditable() 648 | { 649 | if (empty($this->inputType)) { 650 | throw new InvalidConfigException("The 'type' of editable input must be set."); 651 | } 652 | if (!Config::isValidInput($this->inputType)) { 653 | throw new InvalidConfigException("Invalid input type '{$this->inputType}'."); 654 | } 655 | if ($this->inputType === self::INPUT_WIDGET && empty($this->widgetClass)) { 656 | throw new InvalidConfigException("The 'widgetClass' must be set when the 'inputType' is set to 'widget'."); 657 | } 658 | if (Config::isDropdownInput($this->inputType) && !isset($this->data)) { 659 | throw new InvalidConfigException("You must set the 'data' property for '{$this->inputType}'."); 660 | } 661 | if (!empty($this->formClass) && !class_exists($this->formClass)) { 662 | throw new InvalidConfigException("The form class '{$this->formClass}' does not exist."); 663 | } 664 | Config::validateInputWidget($this->inputType); 665 | $this->initI18N(__DIR__); 666 | $this->initIcons(); 667 | $this->initOptions(); 668 | $this->_popoverOptions['options']['id'] = $this->options['id'] . '-popover'; 669 | $this->_popoverOptions['toggleButton']['id'] = $this->options['id'] . '-targ'; 670 | if (!$this->isBs(3)) { 671 | $this->_popoverOptions['bsVersion'] = $this->bsVersion; 672 | } 673 | $this->registerAssets(); 674 | echo Html::beginTag('div', $this->containerOptions); 675 | if ($this->format == self::FORMAT_BUTTON) { 676 | echo Html::tag('div', $this->displayValue, $this->editableValueOptions); 677 | } 678 | if ($this->asPopover === true) { 679 | PopoverX::begin($this->_popoverOptions); 680 | } elseif ($this->format !== self::FORMAT_BUTTON) { 681 | echo $this->renderToggleButton(); 682 | } 683 | echo Html::beginTag('div', $this->contentOptions); 684 | /** 685 | * @var string|ActiveForm $class 686 | */ 687 | $class = $this->formClass; 688 | if (!class_exists($class)) { 689 | throw new InvalidConfigException("The form class '{$class}' set via 'Editable::formClass' does not exist."); 690 | } 691 | $this->_form = $class::begin($this->formOptions); 692 | if (!$this->_form instanceof ActiveForm) { 693 | throw new InvalidConfigException("The form class '{$class}' MUST extend from '\yii\widgets\ActiveForm'."); 694 | } 695 | } 696 | 697 | /** 698 | * Runs the editable widget 699 | */ 700 | protected function runEditable() 701 | { 702 | if (!$this->asPopover) { 703 | echo Html::beginTag('div', $this->inlineSettings['options']); 704 | } 705 | $this->renderFormFields(); 706 | if (!$this->asPopover) { 707 | echo "\n"; // inline options 708 | } 709 | /** 710 | * @var ActiveForm $class 711 | */ 712 | $class = $this->formClass; 713 | $class::end(); 714 | echo "\n"; // content options 715 | if ($this->asPopover === true) { 716 | PopoverX::end(); 717 | } elseif ($this->format == self::FORMAT_BUTTON) { 718 | echo $this->renderToggleButton(); 719 | } 720 | echo "\n"; // options 721 | } 722 | 723 | /** 724 | * Renders the toggle button 725 | * 726 | * @return string 727 | */ 728 | protected function renderToggleButton() 729 | { 730 | $options = $this->_popoverOptions['toggleButton']; 731 | $label = ArrayHelper::remove($options, 'label', ''); 732 | return Html::button($label, $options); 733 | } 734 | 735 | /** 736 | * Initializes the inline settings & options. 737 | */ 738 | protected function initInlineOptions() 739 | { 740 | $title = Yii::t('kveditable', 'Close'); 741 | $defaultSettings = [ 742 | 'templateBefore' => self::INLINE_BEFORE_1, 743 | 'templateAfter' => self::INLINE_AFTER_1, 744 | 'options' => ['class' => 'card panel panel-default'], 745 | 'closeButton' => Html::button('×', ['class' => 'kv-editable-close kv-btn-close', 'title' => $title]), 746 | ]; 747 | $this->inlineSettings = array_replace_recursive($defaultSettings, $this->inlineSettings); 748 | Html::addCssClass($this->contentOptions, 'kv-editable-inline'); 749 | Html::addCssStyle($this->contentOptions, 'display:none'); 750 | } 751 | 752 | /** 753 | * Initializes the widget options. This method sets the default values for various widget options. 754 | * 755 | * @throws InvalidConfigException 756 | */ 757 | protected function initOptions() 758 | { 759 | $defaultBtnCss = $this->getDefaultBtnCss(); 760 | if (!isset($this->resetButton['class'])) { 761 | $this->resetButton['class'] = 'btn btn-sm ' . $defaultBtnCss; 762 | } 763 | if (!isset($this->editableButtonOptions['class'])) { 764 | $this->editableButtonOptions['class'] = 'btn btn-sm ' . $defaultBtnCss; 765 | } 766 | Html::addCssClass($this->inputContainerOptions, self::CSS_PARENT); 767 | if ($this->asPopover !== true) { 768 | $this->initInlineOptions(); 769 | } 770 | if ($this->hasModel()) { 771 | $options = ArrayHelper::getValue($this->inputFieldConfig, 'options', []); 772 | Html::addCssClass($options, self::CSS_PARENT); 773 | $this->inputFieldConfig['options'] = $options; 774 | } 775 | if (!Config::isHtmlInput($this->inputType)) { 776 | if ($this->widgetClass === 'kartik\datecontrol\DateControl') { 777 | $options = ArrayHelper::getValue($this->options, 'options.options', []); 778 | Html::addCssClass($options, 'kv-editable-input'); 779 | $this->options['options']['options'] = $options; 780 | $this->options['widgetOptions']['options'] = $options; 781 | } elseif ($this->inputType !== self::INPUT_WIDGET) { 782 | $options = ArrayHelper::getValue($this->options, 'options', []); 783 | Html::addCssClass($options, 'kv-editable-input'); 784 | $this->options['options'] = $options; 785 | } 786 | } else { 787 | $css = empty($this->options['class']) ? ' form-control' : ''; 788 | Html::addCssClass($this->options, 'kv-editable-input' . $css); 789 | } 790 | $this->_inputOptions = $this->options; 791 | $this->containerOptions['id'] = $this->options['id'] . '-cont'; 792 | $value = ($this->hasModel() && !isset($this->value)) ? Html::getAttributeValue($this->model, $this->attribute) : $this->value; 793 | if ($value === null && !empty($this->valueIfNull)) { 794 | $value = $this->valueIfNull; 795 | } 796 | if (!isset($this->displayValue)) { 797 | $this->displayValue = $value; 798 | } 799 | if ($this->valueIfNull === null || $this->valueIfNull === '') { 800 | $this->valueIfNull = '' . Yii::t('kveditable', '(not set)') . ''; 801 | } 802 | if ($this->displayValue === null || $this->displayValue === '') { 803 | $this->displayValue = $this->valueIfNull; 804 | } 805 | $hasDisplayConfig = is_array($this->displayValueConfig) && !empty($this->displayValueConfig); 806 | if ($hasDisplayConfig && (is_array($this->value) || is_object($this->value))) { 807 | throw new InvalidConfigException( 808 | "Your editable value cannot be an array or object for parsing with 'displayValueConfig'. The array keys in 'displayValueConfig' must be a simple string or number. For advanced display value calculations, you must use your controller AJAX action to return 'output' as a JSON encoded response which will be used as a display value." 809 | ); 810 | } 811 | if ($hasDisplayConfig && isset($this->displayValueConfig[$value])) { 812 | $this->displayValue = $this->displayValueConfig[$value]; 813 | } 814 | Html::addCssClass($this->containerOptions, 'kv-editable'); 815 | Html::addCssClass($this->contentOptions, 'kv-editable-content'); 816 | Html::addCssClass($this->formOptions['options'], 'kv-editable-form'); 817 | $class = 'kv-editable-value'; 818 | if ($this->format == self::FORMAT_BUTTON) { 819 | if (!$this->asPopover) { 820 | $before = ArrayHelper::getValue($this->inlineSettings, 'templateBefore', ''); 821 | if ($before === self::INLINE_BEFORE_1) { 822 | Html::addCssClass($this->containerOptions, 'kv-editable-inline-1'); 823 | } elseif ($before === self::INLINE_BEFORE_2) { 824 | Html::addCssClass($this->containerOptions, 'kv-editable-inline-2'); 825 | } 826 | } 827 | Html::addCssClass($this->editableButtonOptions, 'kv-editable-button'); 828 | } elseif (empty($this->editableValueOptions['class'])) { 829 | $class = ['kv-editable-value', 'kv-editable-link']; 830 | } 831 | Html::addCssClass($this->editableValueOptions, $class); 832 | $this->_popoverOptions['type'] = $this->type; 833 | $this->_popoverOptions['placement'] = $this->placement; 834 | $this->_popoverOptions['size'] = $this->size; 835 | if (!isset($this->preHeader)) { 836 | $this->preHeader = $this->defaultPreHeaderIcon . ' ' . Yii::t('kveditable', 'Edit') . ' '; 837 | } 838 | if ($this->header == null) { 839 | $attribute = $this->attribute; 840 | if (Lib::strpos($attribute, ']') > 0) { 841 | $tags = Lib::explode(']', $attribute); 842 | $attribute = array_pop($tags); 843 | } 844 | $this->_popoverOptions['header'] = $this->preHeader . 845 | ($this->hasModel() ? $this->model->getAttributeLabel($attribute) : ''); 846 | } else { 847 | $this->_popoverOptions['header'] = $this->preHeader . $this->header; 848 | } 849 | $this->_popoverOptions['footer'] = $this->renderFooter(); 850 | $this->_popoverOptions['options']['class'] = 'kv-editable-popover skip-export'; 851 | if ($this->format == self::FORMAT_BUTTON) { 852 | if (empty($this->editableButtonOptions['label'])) { 853 | $this->editableButtonOptions['label'] = $this->defaultEditableBtnIcon; 854 | } 855 | Html::addCssClass($this->editableButtonOptions, 'kv-editable-toggle'); 856 | $this->_popoverOptions['toggleButton'] = $this->editableButtonOptions; 857 | } else { 858 | $this->_popoverOptions['toggleButton'] = $this->editableValueOptions; 859 | $this->_popoverOptions['toggleButton']['label'] = $this->displayValue; 860 | } 861 | if (!empty($this->footer)) { 862 | Html::addCssClass($this->_popoverOptions['options'], 'has-footer'); 863 | } 864 | } 865 | 866 | /** 867 | * Generates the editable action buttons 868 | * 869 | * @return string 870 | */ 871 | protected function renderActionButtons() 872 | { 873 | $submitOpts = $this->submitButton; 874 | $resetOpts = $this->resetButton; 875 | $submitIcon = ArrayHelper::remove($submitOpts, 'icon', $this->defaultSubmitBtnIcon); 876 | $resetIcon = ArrayHelper::remove($resetOpts, 'icon', $this->defaultResetBtnIcon); 877 | $submitLabel = ArrayHelper::remove($submitOpts, 'label', Yii::t('kveditable', 'Apply')); 878 | $resetLabel = ArrayHelper::remove($resetOpts, 'label', Yii::t('kveditable', 'Reset')); 879 | if ($this->showButtonLabels === false) { 880 | if (empty($submitOpts['title'])) { 881 | $submitOpts['title'] = $submitLabel; 882 | } 883 | if (empty($resetOpts['title'])) { 884 | $resetOpts['title'] = $resetLabel; 885 | } 886 | $submitLabel = $submitIcon; 887 | $resetLabel = $resetIcon; 888 | } else { 889 | $submitLabel = $submitIcon . ' ' . Html::encode($submitLabel); 890 | $resetLabel = $resetIcon . ' ' . Html::encode($resetLabel); 891 | } 892 | $submitOpts['type'] = 'button'; 893 | $resetOpts['type'] = 'button'; 894 | Html::addCssClass($submitOpts, 'kv-editable-submit'); 895 | Html::addCssClass($resetOpts, 'kv-editable-reset'); 896 | $params = [ 897 | '{reset}' => Html::button($resetLabel, $resetOpts), 898 | '{submit}' => Html::button($submitLabel, $submitOpts), 899 | ]; 900 | return Lib::strtr($this->buttonsTemplate, $params); 901 | } 902 | 903 | /** 904 | * Generates the popover footer 905 | * 906 | * @return string 907 | */ 908 | protected function renderFooter() 909 | { 910 | return Lib::strtr($this->footer, ['{loading}' => self::LOAD_INDICATOR, '{buttons}' => $this->renderActionButtons()]); 911 | } 912 | 913 | /** 914 | * Parses the inline template and returns the generated content 915 | * 916 | * @param string $template the template setting 917 | * 918 | * @return string 919 | */ 920 | protected function parseTemplate($template) 921 | { 922 | if ($this->asPopover) { 923 | return ''; 924 | } 925 | $params = [ 926 | '{header}' => $this->_popoverOptions['header'], 927 | '{close}' => $this->inlineSettings['closeButton'], 928 | '{loading}' => self::LOAD_INDICATOR, 929 | ]; 930 | $out = Lib::strtr($this->inlineSettings[$template], $params); 931 | if (Lib::strpos($out, '{buttons}') === false) { 932 | return $out; 933 | } 934 | return Lib::strtr($out, ['{buttons}' => $this->renderActionButtons()]); 935 | } 936 | 937 | /** 938 | * Renders the editable form fields 939 | */ 940 | protected function renderFormFields() 941 | { 942 | echo $this->parseTemplate('templateBefore'); 943 | echo Html::hiddenInput('hasEditable', 0) . "\n"; 944 | foreach ($this->additionalData as $name => $value) { 945 | echo Html::hiddenInput($name, $value) . "\n"; 946 | } 947 | $before = $this->beforeInput; 948 | $after = $this->afterInput; 949 | if ($before !== null && is_string($before) || is_callable($before)) { 950 | echo (is_callable($before) ? call_user_func($before, $this->_form, $this) : $before) . "\n"; 951 | } 952 | if ($this->inputType === self::INPUT_HTML5) { 953 | echo $this->renderHtml5Input() . "\n"; 954 | } elseif ($this->inputType === self::INPUT_WIDGET) { 955 | echo $this->renderWidget($this->widgetClass) . "\n"; 956 | } elseif (Config::isHtmlInput($this->inputType)) { 957 | echo $this->renderInput() . "\n"; 958 | } elseif (Config::isInputWidget($this->inputType)) { 959 | echo $this->renderWidget($this->inputType) . "\n"; 960 | } 961 | if ($after !== null && is_string($after) || is_callable($after)) { 962 | echo (is_callable($after) ? call_user_func($after, $this->_form, $this) : $after) . "\n"; 963 | } 964 | echo $this->parseTemplate('templateAfter'); 965 | } 966 | 967 | /** 968 | * Gets the active field instance for the configured editable input 969 | * 970 | * @param boolean|string $label the label for the field 971 | * 972 | * @return ActiveField 973 | */ 974 | protected function getField($label = false) 975 | { 976 | return $this->_form->field($this->model, $this->attribute, $this->inputFieldConfig)->label($label); 977 | } 978 | 979 | /** 980 | * Generates the widget output markup 981 | * 982 | * @param string $content the content to render 983 | * 984 | * @return string 985 | */ 986 | protected function getOutput($content) 987 | { 988 | return Html::tag('div', $content, $this->inputContainerOptions); 989 | } 990 | 991 | /** 992 | * Renders the HTML 5 input 993 | * 994 | * @return string 995 | */ 996 | protected function renderHtml5Input() 997 | { 998 | $type = ArrayHelper::remove($this->_inputOptions, 'type', 'text'); 999 | $out = Html::input($type, $this->name, $this->value, $this->_inputOptions); 1000 | if ($this->hasModel()) { 1001 | if (isset($this->_form)) { 1002 | return $this->getField()->input($type, $this->_inputOptions); 1003 | } 1004 | $out = Html::activeInput($this->type, $this->model, $this->attribute, $this->_inputOptions); 1005 | } 1006 | return $this->getOutput($out); 1007 | } 1008 | 1009 | /** 1010 | * Renders a widget 1011 | * 1012 | * @param string $class the input widget class name 1013 | * 1014 | * @return string 1015 | * @throws Exception 1016 | */ 1017 | protected function renderWidget($class) 1018 | { 1019 | if ($this->hasModel()) { 1020 | if (isset($this->_form)) { 1021 | return $this->getField()->widget($class, $this->_inputOptions); 1022 | } 1023 | $defaults = ['model' => $this->model, 'attribute' => $this->attribute]; 1024 | 1025 | } else { 1026 | $defaults = ['name' => $this->name, 'value' => $this->value]; 1027 | } 1028 | $options = ArrayHelper::merge($this->_inputOptions, $defaults); 1029 | /** 1030 | * @var InputWidget $class 1031 | */ 1032 | $field = $class::widget($options); 1033 | return $this->getOutput($field); 1034 | } 1035 | 1036 | /** 1037 | * Renders all native HTML inputs (except [[INPUT_HTML5]]) 1038 | * 1039 | * @return string 1040 | */ 1041 | protected function renderInput() 1042 | { 1043 | $list = Config::isDropdownInput($this->inputType); 1044 | $input = $this->inputType; 1045 | if ($this->hasModel()) { 1046 | if (isset($this->_form)) { 1047 | $field = $this->getField(); 1048 | return $list ? $field->$input($this->data, $this->_inputOptions) : $field->$input($this->_inputOptions); 1049 | } 1050 | $input = 'active' . ucfirst($this->inputType); 1051 | } 1052 | $value = $this->value; 1053 | if ($input === 'radio' || $input === 'checkbox') { 1054 | $this->options['value'] = $value; 1055 | $value = ArrayHelper::remove($this->_inputOptions, 'checked', false); 1056 | } 1057 | if ($list) { 1058 | $field = Html::$input($this->name, $value, $this->data, $this->_inputOptions); 1059 | } else { 1060 | $field = Html::$input($this->name, $value, $this->_inputOptions); 1061 | } 1062 | return $this->getOutput($field); 1063 | } 1064 | } 1065 | -------------------------------------------------------------------------------- /src/EditableAsset.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 6 | * @version 1.8.0 7 | */ 8 | 9 | namespace kartik\editable; 10 | 11 | use kartik\base\AssetBundle; 12 | 13 | /** 14 | * Asset bundle for the [[Editable]] widget. 15 | * 16 | * @see http://github.com/kartik-v/yii2-editable 17 | * @author Kartik Visweswaran 18 | * @since 1.0 19 | */ 20 | class EditableAsset extends AssetBundle 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function init() 26 | { 27 | $this->depends = array_merge($this->depends, ['kartik\popover\PopoverXAsset']); 28 | $this->setSourcePath(__DIR__ . '/assets'); 29 | $this->setupAssets('css', ['css/editable']); 30 | $this->setupAssets('js', ['js/editable']); 31 | parent::init(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/EditablePjaxAsset.php: -------------------------------------------------------------------------------- 1 | 5 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 6 | * @version 1.8.0 7 | */ 8 | 9 | namespace kartik\editable; 10 | 11 | use kartik\base\AssetBundle; 12 | 13 | /** 14 | * Asset bundle for Pjax processing of the [[Editable]] widget to reinitialize bootstrap-popover-x on pjax completion 15 | * 16 | * @see http://plugins.krajee.com/popover-x 17 | * @see http://github.com/kartik-v/bootstrap-popover-x 18 | * @see http://github.com/kartik-v/yii2-editable 19 | * @author Kartik Visweswaran 20 | * @since 1.0 21 | */ 22 | class EditablePjaxAsset extends AssetBundle 23 | { 24 | /** 25 | * @inheritdoc 26 | */ 27 | public function init() 28 | { 29 | $this->depends = array_merge($this->depends, ['kartik\editable\EditableAsset']); 30 | $this->setSourcePath(__DIR__ . '/assets'); 31 | $this->setupAssets('js', ['js/editable-pjax']); 32 | parent::init(); 33 | } 34 | } -------------------------------------------------------------------------------- /src/assets/css/editable.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-editable 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 5 | * @version 1.8.0 6 | * 7 | * Styling for the Editable widget 8 | * Built for Yii Framework 2.0 9 | * Author: Kartik Visweswaran 10 | * Year: 2015 11 | * For more Yii related demos visit http://demos.krajee.com 12 | */ 13 | .kv-editable, .kv-editable-value { 14 | display: inline-block; 15 | } 16 | 17 | .kv-btn-close { 18 | float: right; 19 | font-size: 1.5rem; 20 | font-weight: 700; 21 | line-height: 1; 22 | color: #000; 23 | text-shadow: 0 1px 0 #fff; 24 | opacity: .5; 25 | } 26 | 27 | .kv-btn-close:hover { 28 | color: #000; 29 | text-decoration: none; 30 | } 31 | 32 | .kv-btn-close:not(:disabled):not(.disabled):hover, .kv-editable-close:not(:disabled):not(.disabled):focus { 33 | opacity: .75; 34 | } 35 | 36 | button.kv-btn-close { 37 | padding: 0; 38 | background-color: transparent; 39 | border: 0; 40 | } 41 | 42 | a.kv-btn-close.disabled { 43 | pointer-events: none; 44 | } 45 | 46 | .kv-editable-link { 47 | color: #428bca; 48 | background: none; 49 | border: none; 50 | margin: 0; 51 | padding: 2px 1px; 52 | text-decoration: none; 53 | cursor: pointer; 54 | border-bottom: 1px dashed; 55 | } 56 | 57 | .kv-editable-value { 58 | margin-right: 5px; 59 | } 60 | 61 | .kv-editable-button.btn-sm, 62 | button[disabled].kv-editable-button { 63 | border-radius: 15px; 64 | width: 30px; 65 | padding: 5px; 66 | } 67 | 68 | button[disabled].kv-editable-button { 69 | opacity: 0.65; 70 | filter: alpha(opacity=65); 71 | pointer-events: none; 72 | cursor: not-allowed; 73 | -webkit-box-shadow: none; 74 | box-shadow: none; 75 | border: 1px solid #ddd; 76 | } 77 | 78 | .kv-editable-link:hover, .kv-editable:focus { 79 | color: #2a6496; 80 | } 81 | 82 | .kv-editable-link:focus { 83 | outline: thin dotted; 84 | outline: 5px auto -webkit-focus-ring-color; 85 | outline-offset: -2px; 86 | } 87 | 88 | .kv-editable-link.text-primary:hover { 89 | color: #3071a9; 90 | } 91 | 92 | .kv-editable-link.text-success { 93 | color: #3c763d; 94 | } 95 | 96 | .kv-editable-link.text-success:hover { 97 | color: #2b542c; 98 | } 99 | 100 | .kv-editable-link.text-info { 101 | color: #31708f; 102 | } 103 | 104 | .kv-editable-link.text-info:hover { 105 | color: #245269; 106 | } 107 | 108 | .kv-editable-link.text-warning { 109 | color: #8a6d3b; 110 | } 111 | 112 | .kv-editable-link.text-warning:hover { 113 | color: #66512c; 114 | } 115 | 116 | .kv-editable-link.text-danger { 117 | color: #a94442; 118 | } 119 | 120 | .kv-editable-link.text-danger:hover { 121 | color: #843534; 122 | } 123 | 124 | .kv-editable-link.bg-primary { 125 | color: #fff; 126 | background-color: #428bca; 127 | } 128 | 129 | .kv-editable-link.bg-primary:hover { 130 | background-color: #3071a9; 131 | } 132 | 133 | .kv-editable-link.bg-success { 134 | background-color: #dff0d8; 135 | } 136 | 137 | .kv-editable-link.bg-success:hover { 138 | background-color: #c1e2b3; 139 | } 140 | 141 | .kv-editable-link.bg-info { 142 | background-color: #d9edf7; 143 | } 144 | 145 | .kv-editable-link.bg-info:hover { 146 | background-color: #afd9ee; 147 | } 148 | 149 | .kv-editable-link.bg-warning { 150 | background-color: #fcf8e3; 151 | } 152 | 153 | .kv-editable-link.bg-warning:hover { 154 | background-color: #f7ecb5; 155 | } 156 | 157 | .kv-editable-link.bg-danger { 158 | background-color: #f2dede; 159 | } 160 | 161 | .kv-editable-link.bg-danger:hover { 162 | background-color: #e4b9b9; 163 | } 164 | 165 | .kv-editable-content .form-group { 166 | margin: 5px 0; 167 | } 168 | 169 | .kv-editable-content .help-block { 170 | margin: 0; 171 | } 172 | 173 | .kv-editable-loading { 174 | float: left; 175 | width: 30px; 176 | background: transparent url('../img/loading.gif') 8px 8px no-repeat; 177 | } 178 | 179 | .kv-editable-processing { 180 | opacity: 0.5; 181 | cursor: wait; 182 | } 183 | 184 | .kv-editable-inline .panel-footer { 185 | text-align: right; 186 | padding: 5px; 187 | } 188 | 189 | .kv-editable-inline .panel-footer .btn { 190 | margin-left: 4px; 191 | } 192 | 193 | @media (min-width: 768px) { 194 | .kv-editable-form-inline .form-group { 195 | display: inline-block; 196 | margin-bottom: 0; 197 | vertical-align: top; 198 | } 199 | 200 | .kv-editable-form-inline .form-control { 201 | display: inline-block; 202 | width: auto; 203 | vertical-align: top; 204 | } 205 | 206 | .kv-editable-form-inline .form-control-static { 207 | display: inline-block; 208 | } 209 | 210 | .kv-editable-form-inline .input-group { 211 | display: inline-table; 212 | vertical-align: top; 213 | } 214 | 215 | .kv-editable-form-inline .input-group .input-group-addon, 216 | .kv-editable-form-inline .input-group .input-group-btn, 217 | .kv-editable-form-inline .input-group .form-control { 218 | width: auto; 219 | } 220 | 221 | .kv-editable-form-inline .input-group > .form-control { 222 | width: 100%; 223 | } 224 | 225 | .kv-editable-form-inline .control-label { 226 | margin-bottom: 0; 227 | vertical-align: middle; 228 | } 229 | 230 | .kv-editable-form-inline .radio, 231 | .kv-editable-form-inline .checkbox { 232 | display: inline-block; 233 | margin-top: 0; 234 | margin-bottom: 0; 235 | vertical-align: middle; 236 | } 237 | 238 | .kv-editable-form-inline .radio label, 239 | .kv-editable-form-inline .checkbox label { 240 | padding-left: 0; 241 | } 242 | 243 | .kv-editable-form-inline .radio input[type="radio"], 244 | .kv-editable-form-inline .checkbox input[type="checkbox"] { 245 | position: relative; 246 | margin-left: 0; 247 | } 248 | 249 | .kv-editable-form-inline .has-feedback .form-control-feedback { 250 | top: 0; 251 | } 252 | } 253 | 254 | .kv-editable-inline-1 .kv-editable-inline, 255 | .kv-editable-inline-2 .kv-editable-inline, 256 | .kv-editable-inline-button .kv-editable-button { 257 | display: inline-block; 258 | } 259 | 260 | .kv-editable-inline-1 { 261 | margin-top: -10px; 262 | } 263 | 264 | .kv-editable-inline-1 .kv-inline-open { 265 | margin-top: 20px; 266 | } 267 | 268 | .panel .kv-editable-form-inline { 269 | padding: 0 5px 5px 0; 270 | } 271 | 272 | .kv-editable-form-inline .btn-sm { 273 | margin: 2px 4px 0 0; 274 | } 275 | 276 | .kv-editable-form-inline .kv-btn-close { 277 | margin-top: 6px; 278 | } -------------------------------------------------------------------------------- /src/assets/css/editable.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-editable 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 5 | * @version 1.8.0 6 | * 7 | * Styling for the Editable widget 8 | * Built for Yii Framework 2.0 9 | * Author: Kartik Visweswaran 10 | * Year: 2015 11 | * For more Yii related demos visit http://demos.krajee.com 12 | */.kv-editable,.kv-editable-value{display:inline-block}.kv-btn-close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.kv-btn-close:hover{color:#000;text-decoration:none}.kv-btn-close:not(:disabled):not(.disabled):hover,.kv-editable-close:not(:disabled):not(.disabled):focus{opacity:.75}button.kv-btn-close{padding:0;background-color:transparent;border:0}a.kv-btn-close.disabled{pointer-events:none}.kv-editable-link{color:#428bca;background:0 0;border:none;margin:0;padding:2px 1px;text-decoration:none;cursor:pointer;border-bottom:1px dashed}.kv-editable-value{margin-right:5px}.kv-editable-button.btn-sm,button[disabled].kv-editable-button{border-radius:15px;width:30px;padding:5px}button[disabled].kv-editable-button{opacity:.65;filter:alpha(opacity=65);pointer-events:none;cursor:not-allowed;-webkit-box-shadow:none;box-shadow:none;border:1px solid #ddd}.kv-editable-link:hover,.kv-editable:focus{color:#2a6496}.kv-editable-link:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.kv-editable-link.text-primary:hover{color:#3071a9}.kv-editable-link.text-success{color:#3c763d}.kv-editable-link.text-success:hover{color:#2b542c}.kv-editable-link.text-info{color:#31708f}.kv-editable-link.text-info:hover{color:#245269}.kv-editable-link.text-warning{color:#8a6d3b}.kv-editable-link.text-warning:hover{color:#66512c}.kv-editable-link.text-danger{color:#a94442}.kv-editable-link.text-danger:hover{color:#843534}.kv-editable-link.bg-primary{color:#fff;background-color:#428bca}.kv-editable-link.bg-primary:hover{background-color:#3071a9}.kv-editable-link.bg-success{background-color:#dff0d8}.kv-editable-link.bg-success:hover{background-color:#c1e2b3}.kv-editable-link.bg-info{background-color:#d9edf7}.kv-editable-link.bg-info:hover{background-color:#afd9ee}.kv-editable-link.bg-warning{background-color:#fcf8e3}.kv-editable-link.bg-warning:hover{background-color:#f7ecb5}.kv-editable-link.bg-danger{background-color:#f2dede}.kv-editable-link.bg-danger:hover{background-color:#e4b9b9}.kv-editable-content .form-group{margin:5px 0}.kv-editable-content .help-block{margin:0}.kv-editable-loading{float:left;width:30px;background:url(../img/loading.gif) 8px 8px no-repeat}.kv-editable-processing{opacity:.5;cursor:wait}.kv-editable-inline .panel-footer{text-align:right;padding:5px}.kv-editable-inline .panel-footer .btn{margin-left:4px}@media (min-width:768px){.kv-editable-form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:top}.kv-editable-form-inline .form-control{display:inline-block;width:auto;vertical-align:top}.kv-editable-form-inline .form-control-static{display:inline-block}.kv-editable-form-inline .input-group{display:inline-table;vertical-align:top}.kv-editable-form-inline .input-group .form-control,.kv-editable-form-inline .input-group .input-group-addon,.kv-editable-form-inline .input-group .input-group-btn{width:auto}.kv-editable-form-inline .input-group>.form-control{width:100%}.kv-editable-form-inline .control-label{margin-bottom:0;vertical-align:middle}.kv-editable-form-inline .checkbox,.kv-editable-form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.kv-editable-form-inline .checkbox label,.kv-editable-form-inline .radio label{padding-left:0}.kv-editable-form-inline .checkbox input[type=checkbox],.kv-editable-form-inline .radio input[type=radio]{position:relative;margin-left:0}.kv-editable-form-inline .has-feedback .form-control-feedback{top:0}}.kv-editable-inline-1 .kv-editable-inline,.kv-editable-inline-2 .kv-editable-inline,.kv-editable-inline-button .kv-editable-button{display:inline-block}.kv-editable-inline-1{margin-top:-10px}.kv-editable-inline-1 .kv-inline-open{margin-top:20px}.panel .kv-editable-form-inline{padding:0 5px 5px 0}.kv-editable-form-inline .btn-sm{margin:2px 4px 0 0}.kv-editable-form-inline .kv-btn-close{margin-top:6px} -------------------------------------------------------------------------------- /src/assets/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kartik-v/yii2-editable/ae4cc2384e667ba9dfe8bfb0098716caeb2500a8/src/assets/img/loading.gif -------------------------------------------------------------------------------- /src/assets/js/editable-pjax.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-editable 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 5 | * @version 1.8.0 6 | * 7 | * Editable Extension - PJAX processing script for popover-x 8 | * 9 | * Built for Yii Framework 2.0 10 | * Author: Kartik Visweswaran 11 | * Year: 2015 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */ 14 | var initEditablePjax = function () { 15 | }, initEditablePopover = function () { 16 | }; 17 | (function ($) { 18 | "use strict"; 19 | initEditablePjax = function (pjaxContainer, toggleButton, initPjaxVar) { 20 | $('#' + pjaxContainer).on("pjax:complete", function () { 21 | if (window[initPjaxVar] !== true) { 22 | initEditablePopover(toggleButton); 23 | window[initPjaxVar] = true; 24 | } 25 | }); 26 | }; 27 | initEditablePopover = function (toggleButton) { 28 | var $btn = $('#' + toggleButton), target = $btn.data('target'), $dialog; 29 | if (!target) { 30 | return; 31 | } 32 | $dialog = $(target); 33 | $btn.off('.editable').on('click.editable', function (e) { 34 | e.preventDefault(); 35 | var option = $dialog.data('popover-x') && $dialog.hasClass('in') ? 'toggle' : $btn.data(); 36 | if (option !== 'toggle') { 37 | //noinspection JSPrimitiveTypeWrapperUsage 38 | option.$target = $btn; 39 | $dialog.popoverX(option).popoverX('show').on('hide', function () { 40 | $btn.focus(); 41 | }); 42 | } else { 43 | $dialog.popoverX(option).on('hide', function () { 44 | $btn.focus(); 45 | }); 46 | } 47 | }); 48 | }; 49 | })(window.jQuery); -------------------------------------------------------------------------------- /src/assets/js/editable-pjax.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-editable 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 5 | * @version 1.8.0 6 | * 7 | * Editable Extension - PJAX processing script for popover-x 8 | * 9 | * Built for Yii Framework 2.0 10 | * Author: Kartik Visweswaran 11 | * Year: 2015 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */var initEditablePjax=function(){},initEditablePopover=function(){};!function(o){"use strict";initEditablePjax=function(t,i,n){o("#"+t).on("pjax:complete",function(){window[n]!==!0&&(initEditablePopover(i),window[n]=!0)})},initEditablePopover=function(t){var i,n=o("#"+t),e=n.data("target");e&&(i=o(e),n.off(".editable").on("click.editable",function(o){o.preventDefault();var t=i.data("popover-x")&&i.hasClass("in")?"toggle":n.data();"toggle"!==t?(t.$target=n,i.popoverX(t).popoverX("show").on("hide",function(){n.focus()})):i.popoverX(t).on("hide",function(){n.focus()})}))}}(window.jQuery); -------------------------------------------------------------------------------- /src/assets/js/editable.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-editable 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 5 | * @version 1.8.0 6 | * 7 | * Editable Extension jQuery plugin 8 | * 9 | * Built for Yii Framework 2.0 10 | * Author: Kartik Visweswaran 11 | * Year: 2015 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */ 14 | (function ($) { 15 | "use strict"; 16 | 17 | var $h, Editable; 18 | 19 | $h = { 20 | NAMESPACE: '.editable', 21 | isEmpty: function (value, trim) { 22 | return value === null || value === undefined || value.length === 0 || (trim && $.trim(value) === ''); 23 | }, 24 | addCss: function ($el, css) { 25 | $el.removeClass(css).addClass(css); 26 | }, 27 | handler: function ($element, event, callback) { 28 | var ev = event + $h.NAMESPACE; 29 | $element.off(ev).on(ev, callback); 30 | }, 31 | raise: function ($el, event, params) { 32 | var e = $.Event(event); 33 | if (params !== undefined) { 34 | $el.trigger(e, params); 35 | } else { 36 | $el.trigger(e); 37 | } 38 | return !e.isDefaultPrevented(); 39 | } 40 | }; 41 | 42 | Editable = function (element, options) { 43 | var self = this; 44 | self.$container = $(element); 45 | self.init(options); 46 | self.destroy(); 47 | self.create(); 48 | }; 49 | 50 | Editable.prototype = { 51 | constructor: Editable, 52 | init: function (options) { 53 | var self = this, $el = self.$container; 54 | self.$input = $el.find('.kv-editable-input'); 55 | self.$form = $el.find('.kv-editable-form'); 56 | self.$value = $el.find('.kv-editable-value'); 57 | self.$close = $el.find('.kv-editable-close'); 58 | self.$popover = $el.find('.kv-editable-popover'); 59 | self.$inline = $el.find('.kv-editable-inline'); 60 | self.$btnSubmit = $el.find('button.kv-editable-submit'); 61 | self.$btnReset = $el.find('button.kv-editable-reset'); 62 | self.$loading = $el.find('.kv-editable-loading'); 63 | self.$target = $el.find(options.target); 64 | $.each(options, function (key, value) { 65 | self[key] = value; 66 | }); 67 | self.$targetEl = self.target === '.kv-editable-button' ? self.$target : self.$value; 68 | self.initActions(); 69 | }, 70 | initActions: function () { 71 | var self = this, $form = self.$form, $cont = $form.parent(), $el = self.$container, $inline = self.$inline, 72 | $loading = self.$loading, $input = self.$input, showError, chkError = '', out = '', 73 | objActiveForm = $form.data('yiiActiveForm'), $parent = $input.closest('.field-' + $input.attr('id')), 74 | $message = $parent.find('.help-block'), $parent2 = $input.closest('.kv-editable-parent'), 75 | displayValueConfig = self.displayValueConfig, $hasEditable = $form.find('input[name="hasEditable"]'), 76 | notActiveForm = $h.isEmpty($parent.attr('class')) || $h.isEmpty($message.attr('class')), 77 | $msgBlock = $parent2.find('.kv-help-block'); 78 | showError = function (message) { 79 | if (notActiveForm) { 80 | if (!$msgBlock.length) { 81 | $msgBlock = $(document.createElement("div")).attr({class: 'help-block kv-help-block'}) 82 | .appendTo($parent2); 83 | } 84 | $msgBlock.html(message).show(); 85 | } else { 86 | $h.addCss($message, 'kv-help-block'); 87 | $message.html(message).show(); 88 | } 89 | $h.addCss($parent2, 'has-error'); 90 | $loading.hide(); 91 | $cont.removeClass('kv-editable-processing'); 92 | }; 93 | self.actions = { 94 | formReset: function () { 95 | setTimeout(function () { 96 | $form.data('kvEditableSubmit', false); 97 | if (notActiveForm) { 98 | $parent2.find('.help-block').remove(); 99 | $parent2.removeClass('has-error'); 100 | } else { 101 | $parent.removeClass('has-error'); 102 | $message.html(' '); 103 | } 104 | self.refreshPopover(); 105 | }, self.resetDelay); 106 | }, 107 | formSubmit: function (ev) { 108 | ev.preventDefault(); 109 | }, 110 | formChange: function () { 111 | if ($h.raise($el, 'editableChange', [$input.val()])) { 112 | self.refreshPopover(); 113 | } 114 | }, 115 | formKeyup: function (ev) { 116 | if (ev.which === 13 && self.submitOnEnter) { // enter key pressed 117 | self.submitFlag = true; 118 | self.actions.submitClick(); 119 | } 120 | }, 121 | formBlur: function (ev) { 122 | var delegateTarget = ev.delegateTarget; 123 | setTimeout(function () { 124 | if (!delegateTarget.contains(document.activeElement) && !self.submitFlag && self.closeOnBlur) { 125 | self.toggle(false); 126 | } 127 | }, 0); 128 | }, 129 | inlineKeyup: function (ev) { 130 | if (ev.which === 27) { // escape key pressed 131 | self.actions.closeClick(); 132 | } 133 | }, 134 | closeClick: function () { 135 | self.toggle(false); 136 | }, 137 | targetClick: function () { 138 | var status; 139 | self.submitFlag = false; 140 | if (self.asPopover) { 141 | self.toggle(true); 142 | return; 143 | } 144 | status = !$inline.is(':visible'); 145 | self.toggle(status); 146 | }, 147 | resetClick: function () { 148 | if ($h.raise($el, 'editableReset')) { 149 | $hasEditable.val(0); 150 | setTimeout(function () { 151 | $form[0].reset(); 152 | }, self.resetDelay); 153 | } 154 | }, 155 | submitClick: function () { 156 | var $wrapper = self.asPopover ? $cont : $inline, hasFiles = false, settings; 157 | $h.addCss($wrapper, 'kv-editable-processing'); 158 | $loading.show(); 159 | $hasEditable.val(1); 160 | $form.find('.help-block').each(function () { 161 | $(this).html(''); 162 | }); 163 | $form.find('.has-error').removeClass('has-error'); 164 | $form.find('input, select').each(function () { 165 | var $el = $(this), v = $el.val(), v1 = v, isFile = $el.attr('type') === 'file'; 166 | if (!hasFiles) { 167 | hasFiles = isFile; 168 | } 169 | if (!$el.attr('disabled')) { 170 | if (isFile) { 171 | $h.raise($el, 'blur'); 172 | } else { 173 | if ($.isArray(v)) { 174 | v1.push('-'); 175 | } else { 176 | v1 = v1 + '-'; 177 | } 178 | $el.val(v1); 179 | $h.raise($el, 'blur'); 180 | $el.val(v); 181 | $h.raise($el, 'blur'); 182 | } 183 | } 184 | }); 185 | settings = { 186 | type: $form.attr('method'), 187 | url: $form.attr('action'), 188 | dataType: 'json', 189 | beforeSend: function (jqXHR) { 190 | if (!$h.raise($el, 'editableBeforeSubmit', [jqXHR])) { 191 | jqXHR.abort(); 192 | } 193 | }, 194 | error: function (jqXHR, status, message) { 195 | if ($h.raise($el, 'editableAjaxError', [jqXHR, status, message]) && self.showAjaxErrors) { 196 | showError(message); 197 | } 198 | }, 199 | success: function (data, status, jqXHR) { 200 | chkError = ''; 201 | out = !$h.isEmpty(data.output) ? data.output : self.htmlEncode($input.val()); 202 | self.refreshPopover(); 203 | if (!$h.isEmpty(data.message)) { 204 | if ($h.raise($el, 'editableError', [$input.val(), $form, data])) { 205 | showError(data.message); 206 | } 207 | return; 208 | } else { 209 | if (!$h.isEmpty($msgBlock.attr('class'))) { 210 | $parent.removeClass('has-error'); 211 | $msgBlock.html('').hide(); 212 | $message.html(''); 213 | } 214 | } 215 | $form.find('.help-block').each(function () { 216 | var str = $(this).text(); 217 | chkError += str ? str.trim() : ''; 218 | if (!$h.isEmpty(chkError)) { 219 | $loading.hide(); 220 | } 221 | }); 222 | if ($h.isEmpty(chkError)) { 223 | if ($h.raise($el, 'editableSuccess', [$input.val(), $form, data, status, jqXHR])) { 224 | $loading.hide(); 225 | if ($h.isEmpty(out)) { 226 | out = self.valueIfNull; 227 | } else { 228 | if (displayValueConfig[out] !== undefined) { 229 | out = displayValueConfig[out]; 230 | } 231 | } 232 | if (notActiveForm) { 233 | $parent2.find('.help-block').remove(); 234 | $parent2.removeClass('has-error'); 235 | $message.html(''); 236 | self.toggle(false); 237 | self.$value.html(out); 238 | } else { 239 | $parent.removeClass('has-error'); 240 | $message.html(''); 241 | self.toggle(false); 242 | self.$value.html(out); 243 | if (objActiveForm) { 244 | $form.yiiActiveForm('destroy'); 245 | $form.yiiActiveForm(objActiveForm.attributes, objActiveForm.settings); 246 | } 247 | } 248 | } 249 | } else { 250 | $h.raise($el, 'editableError', [$input.val(), $form, data]); 251 | } 252 | $wrapper.removeClass('kv-editable-processing'); 253 | } 254 | }; 255 | if (hasFiles && window.FormData) { 256 | $form.attr('enctype', 'multipart/form-data'); 257 | settings.data = new FormData($form[0]); 258 | settings.contentType = false; 259 | settings.processData = false; 260 | settings.cache = false; 261 | } else { 262 | settings.data = $form.serialize(); 263 | } 264 | setTimeout(function () { 265 | if ($h.raise($el, 'editableSubmit', [$input.val(), $form])) { 266 | $.ajax($.extend(true, settings, self.ajaxSettings)); 267 | } 268 | }, self.validationDelay); 269 | } 270 | }; 271 | }, 272 | htmlEncode: function (data) { 273 | var self = this; 274 | if (!self.encodeOutput || !data) { 275 | return data; 276 | } 277 | if (typeof data === 'object') { 278 | $.each(data, function (key, value) { 279 | data[key] = self.htmlEncode(value); 280 | }); 281 | return data; 282 | } 283 | return data.replace(/&/g, '&') 284 | .replace(//g, '>') 286 | .replace(/"/g, '"') 287 | .replace(/'/g, '''); 288 | }, 289 | toggle: function (show) { 290 | var self = this, $value = self.$value, $inline = self.$inline, delay = self.animationDelay, 291 | selectInput = function () { 292 | self.$btnSubmit.focus(); 293 | if (self.selectAllOnEdit) { 294 | self.$input.select(); 295 | } 296 | }; 297 | if (show) { 298 | if (!self.asPopover) { 299 | $value.fadeOut(delay, function () { 300 | $inline.fadeIn(delay, function () { 301 | selectInput(); 302 | }); 303 | if (self.target === '.kv-editable-button') { 304 | $h.addCss(self.$target, 'kv-inline-open'); 305 | } 306 | }); 307 | return; 308 | } 309 | selectInput(); 310 | return; 311 | } 312 | if (self.asPopover) { 313 | self.$popover.popoverX('hide'); 314 | } else { 315 | $inline.fadeOut(delay, function () { 316 | $value.fadeIn(delay); 317 | self.$target.removeClass('kv-inline-open'); 318 | }); 319 | } 320 | }, 321 | refreshPopover: function () { 322 | var self = this; 323 | if (self.asPopover) { 324 | self.$popover.popoverX('refreshPosition'); 325 | } 326 | }, 327 | destroy: function () { 328 | var self = this; 329 | self.$form.off($h.NAMESPACE); 330 | self.$form.find('input, select').off($h.NAMESPACE); 331 | self.$close.off($h.NAMESPACE); 332 | self.$inline.off($h.NAMESPACE); 333 | self.$popover.off($h.NAMESPACE); 334 | self.$btnSubmit.off($h.NAMESPACE); 335 | self.$btnReset.off($h.NAMESPACE); 336 | self.$targetEl.off($h.NAMESPACE); 337 | }, 338 | create: function () { 339 | var self = this, actions = self.actions, $form = self.$form, $inline = self.$inline; 340 | $h.handler($form, 'reset', $.proxy(actions.formReset, self)); 341 | $h.handler($form, 'submit', $.proxy(actions.formSubmit, self)); 342 | $h.handler($form.find('input, select'), 'change', $.proxy(actions.formChange, self)); 343 | $h.handler($form, 'keyup', $.proxy(actions.formKeyup, self)); 344 | if (self.asPopover) { 345 | $h.handler(self.$popover, 'focusout', $.proxy(actions.formBlur, self)); 346 | } else { 347 | $h.handler($inline, 'keyup', $.proxy(actions.inlineKeyup, self)); 348 | $h.handler($inline, 'focusout', $.proxy(actions.formBlur, self)); 349 | } 350 | $h.handler(self.$btnReset, 'click', $.proxy(actions.resetClick, self)); 351 | $h.handler(self.$btnSubmit, 'click', $.proxy(actions.submitClick, self)); 352 | $h.handler(self.$close, 'click', $.proxy(actions.closeClick, self)); 353 | $h.handler(self.$targetEl, 'click', $.proxy(actions.targetClick, self)); 354 | } 355 | }; 356 | 357 | $.fn.editable = function (option) { 358 | var args = Array.apply(null, arguments); 359 | args.shift(); 360 | return this.each(function () { 361 | var $this = $(this), data = $this.data('editable'), options = typeof option === 'object' && option; 362 | if (!data) { 363 | data = new Editable(this, $.extend({}, $.fn.editable.defaults, options, $(this).data())); 364 | $this.data('editable', data); 365 | } 366 | if (typeof option === 'string') { 367 | data[option].apply(data, args); 368 | } 369 | }); 370 | }; 371 | 372 | $.fn.editable.defaults = { 373 | valueIfNull: '(not set)', 374 | placement: 'right', 375 | displayValueConfig: {}, 376 | ajaxSettings: {}, 377 | showAjaxErrors: true, 378 | submitOnEnter: true, 379 | selectAllOnEdit: true, 380 | asPopover: true, 381 | encodeOutput: true, 382 | closeOnBlur: true, 383 | validationDelay: 500, 384 | resetDelay: 200, 385 | animationDelay: 300 386 | }; 387 | 388 | $.fn.editable.Constructor = Editable; 389 | 390 | })(window.jQuery); 391 | -------------------------------------------------------------------------------- /src/assets/js/editable.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @package yii2-editable 3 | * @author Kartik Visweswaran 4 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2022 5 | * @version 1.8.0 6 | * 7 | * Editable Extension jQuery plugin 8 | * 9 | * Built for Yii Framework 2.0 10 | * Author: Kartik Visweswaran 11 | * Year: 2015 12 | * For more Yii related demos visit http://demos.krajee.com 13 | */ 14 | !function(e){"use strict";var t,i;t={NAMESPACE:".editable",isEmpty:function(t,i){return null==t||0===t.length||i&&""===e.trim(t)},addCss:function(e,t){e.removeClass(t).addClass(t)},handler:function(e,i,a){var o=i+t.NAMESPACE;e.off(o).on(o,a)},raise:function(t,i,a){var o=e.Event(i);return void 0!==a?t.trigger(o,a):t.trigger(o),!o.isDefaultPrevented()}},(i=function(t,i){this.$container=e(t),this.init(i),this.destroy(),this.create()}).prototype={constructor:i,init:function(t){var i=this,a=i.$container;i.$input=a.find(".kv-editable-input"),i.$form=a.find(".kv-editable-form"),i.$value=a.find(".kv-editable-value"),i.$close=a.find(".kv-editable-close"),i.$popover=a.find(".kv-editable-popover"),i.$inline=a.find(".kv-editable-inline"),i.$btnSubmit=a.find("button.kv-editable-submit"),i.$btnReset=a.find("button.kv-editable-reset"),i.$loading=a.find(".kv-editable-loading"),i.$target=a.find(t.target),e.each(t,function(e,t){i[e]=t}),i.$targetEl=".kv-editable-button"===i.target?i.$target:i.$value,i.initActions()},initActions:function(){var i,a=this,o=a.$form,n=o.parent(),r=a.$container,s=a.$inline,l=a.$loading,c=a.$input,u="",d="",f=o.data("yiiActiveForm"),h=c.closest(".field-"+c.attr("id")),p=h.find(".help-block"),v=c.closest(".kv-editable-parent"),m=a.displayValueConfig,b=o.find('input[name="hasEditable"]'),g=t.isEmpty(h.attr("class"))||t.isEmpty(p.attr("class")),y=v.find(".kv-help-block");i=function(i){g?(y.length||(y=e(document.createElement("div")).attr({class:"help-block kv-help-block"}).appendTo(v)),y.html(i).show()):(t.addCss(p,"kv-help-block"),p.html(i).show()),t.addCss(v,"has-error"),l.hide(),n.removeClass("kv-editable-processing")},a.actions={formReset:function(){setTimeout(function(){o.data("kvEditableSubmit",!1),g?(v.find(".help-block").remove(),v.removeClass("has-error")):(h.removeClass("has-error"),p.html(" ")),a.refreshPopover()},a.resetDelay)},formSubmit:function(e){e.preventDefault()},formChange:function(){t.raise(r,"editableChange",[c.val()])&&a.refreshPopover()},formKeyup:function(e){13===e.which&&a.submitOnEnter&&(a.submitFlag=!0,a.actions.submitClick())},formBlur:function(e){var t=e.delegateTarget;setTimeout(function(){t.contains(document.activeElement)||a.submitFlag||!a.closeOnBlur||a.toggle(!1)},0)},inlineKeyup:function(e){27===e.which&&a.actions.closeClick()},closeClick:function(){a.toggle(!1)},targetClick:function(){var e;a.submitFlag=!1,a.asPopover?a.toggle(!0):(e=!s.is(":visible"),a.toggle(e))},resetClick:function(){t.raise(r,"editableReset")&&(b.val(0),setTimeout(function(){o[0].reset()},a.resetDelay))},submitClick:function(){var E,k=a.asPopover?n:s,$=!1;t.addCss(k,"kv-editable-processing"),l.show(),b.val(1),o.find(".help-block").each(function(){e(this).html("")}),o.find(".has-error").removeClass("has-error"),o.find("input, select").each(function(){var i=e(this),a=i.val(),o=a,n="file"===i.attr("type");$||($=n),i.attr("disabled")||(n?t.raise(i,"blur"):(e.isArray(a)?o.push("-"):o+="-",i.val(o),t.raise(i,"blur"),i.val(a),t.raise(i,"blur")))}),E={type:o.attr("method"),url:o.attr("action"),dataType:"json",beforeSend:function(e){t.raise(r,"editableBeforeSubmit",[e])||e.abort()},error:function(e,o,n){t.raise(r,"editableAjaxError",[e,o,n])&&a.showAjaxErrors&&i(n)},success:function(n,s,b){u="",d=t.isEmpty(n.output)?a.htmlEncode(c.val()):n.output,a.refreshPopover(),t.isEmpty(n.message)?(t.isEmpty(y.attr("class"))||(h.removeClass("has-error"),y.html("").hide(),p.html("")),o.find(".help-block").each(function(){var i=e(this).text();u+=i?i.trim():"",t.isEmpty(u)||l.hide()}),t.isEmpty(u)?t.raise(r,"editableSuccess",[c.val(),o,n,s,b])&&(l.hide(),t.isEmpty(d)?d=a.valueIfNull:void 0!==m[d]&&(d=m[d]),g?(v.find(".help-block").remove(),v.removeClass("has-error"),p.html(""),a.toggle(!1),a.$value.html(d)):(h.removeClass("has-error"),p.html(""),a.toggle(!1),a.$value.html(d),f&&(o.yiiActiveForm("destroy"),o.yiiActiveForm(f.attributes,f.settings)))):t.raise(r,"editableError",[c.val(),o,n]),k.removeClass("kv-editable-processing")):t.raise(r,"editableError",[c.val(),o,n])&&i(n.message)}},$&&window.FormData?(o.attr("enctype","multipart/form-data"),E.data=new FormData(o[0]),E.contentType=!1,E.processData=!1,E.cache=!1):E.data=o.serialize(),setTimeout(function(){t.raise(r,"editableSubmit",[c.val(),o])&&e.ajax(e.extend(!0,E,a.ajaxSettings))},a.validationDelay)}}},htmlEncode:function(t){var i=this;return i.encodeOutput?"object"==typeof t?(e.each(t,function(e,a){t[e]=i.htmlEncode(a)}),t):t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):t},toggle:function(e){var i=this,a=i.$value,o=i.$inline,n=i.animationDelay,r=function(){i.$btnSubmit.focus(),i.selectAllOnEdit&&i.$input.select()};if(e)return i.asPopover?void r():void a.fadeOut(n,function(){o.fadeIn(n,function(){r()}),".kv-editable-button"===i.target&&t.addCss(i.$target,"kv-inline-open")});i.asPopover?i.$popover.popoverX("hide"):o.fadeOut(n,function(){a.fadeIn(n),i.$target.removeClass("kv-inline-open")})},refreshPopover:function(){this.asPopover&&this.$popover.popoverX("refreshPosition")},destroy:function(){this.$form.off(t.NAMESPACE),this.$form.find("input, select").off(t.NAMESPACE),this.$close.off(t.NAMESPACE),this.$inline.off(t.NAMESPACE),this.$popover.off(t.NAMESPACE),this.$btnSubmit.off(t.NAMESPACE),this.$btnReset.off(t.NAMESPACE),this.$targetEl.off(t.NAMESPACE)},create:function(){var i=this.actions,a=this.$form,o=this.$inline;t.handler(a,"reset",e.proxy(i.formReset,this)),t.handler(a,"submit",e.proxy(i.formSubmit,this)),t.handler(a.find("input, select"),"change",e.proxy(i.formChange,this)),t.handler(a,"keyup",e.proxy(i.formKeyup,this)),this.asPopover?t.handler(this.$popover,"focusout",e.proxy(i.formBlur,this)):(t.handler(o,"keyup",e.proxy(i.inlineKeyup,this)),t.handler(o,"focusout",e.proxy(i.formBlur,this))),t.handler(this.$btnReset,"click",e.proxy(i.resetClick,this)),t.handler(this.$btnSubmit,"click",e.proxy(i.submitClick,this)),t.handler(this.$close,"click",e.proxy(i.closeClick,this)),t.handler(this.$targetEl,"click",e.proxy(i.targetClick,this))}},e.fn.editable=function(t){var a=Array.apply(null,arguments);return a.shift(),this.each(function(){var o=e(this),n=o.data("editable"),r="object"==typeof t&&t;n||(n=new i(this,e.extend({},e.fn.editable.defaults,r,e(this).data())),o.data("editable",n)),"string"==typeof t&&n[t].apply(n,a)})},e.fn.editable.defaults={valueIfNull:"(not set)",placement:"right",displayValueConfig:{},ajaxSettings:{},showAjaxErrors:!0,submitOnEnter:!0,selectAllOnEdit:!0,asPopover:!0,encodeOutput:!0,closeOnBlur:!0,validationDelay:500,resetDelay:200,animationDelay:300},e.fn.editable.Constructor=i}(window.jQuery); -------------------------------------------------------------------------------- /src/messages/af/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ar/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/az/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/bg/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/bs/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ca/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/config.php: -------------------------------------------------------------------------------- 1 | __DIR__ . DIRECTORY_SEPARATOR . '..', 5 | // string, required, root directory containing message translations. 6 | 'messagePath' => __DIR__, 7 | // array, required, list of language codes that the extracted messages 8 | // should be translated to. For example, ['zh-CN', 'de']. 9 | 'languages' => ['af', 'ar', 'az', 'bg', 'bs', 'ca', 'cs', 'da', 'de', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'gl', 'gu', 'he', 'hi', 'hr', 'hu', 'hy', 'id', 'is', 'it', 'ja', 'ka', 'kk', 'kn', 'ko', 'ky', 'lt', 'lv', 'mi', 'mk', 'mn', 'mr', 'ms', 'mt', 'nb', 'nl', 'nn', 'pl', 'pt', 'pt-BR', 'qu', 'ro', 'ru', 'sa', 'se', 'sk', 'sl', 'sq', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tj', 'tl', 'tn', 'tr', 'ts', 'tt', 'uk', 'ur', 'vi', 'zh-CN', 'zh-TW', 'zu'], 10 | // string, the name of the function for translating messages. 11 | // Defaults to 'Yii::t'. This is used as a mark to find the messages to be 12 | // translated. You may use a string for single function name or an array for 13 | // multiple function names. 14 | 'translator' => 'Yii::t', 15 | // boolean, whether to sort messages by keys when merging new messages 16 | // with the existing ones. Defaults to false, which means the new (untranslated) 17 | // messages will be separated from the old (translated) ones. 18 | 'sort' => false, 19 | // boolean, whether the message file should be overwritten with the merged messages 20 | 'overwrite' => true, 21 | // boolean, whether to remove messages that no longer appear in the source code. 22 | // Defaults to false, which means each of these messages will be enclosed with a pair of '' marks. 23 | 'removeUnused' => false, 24 | // array, list of patterns that specify which files/directories should NOT be processed. 25 | // If empty or not set, all files/directories will be processed. 26 | // A path matches a pattern if it contains the pattern string at its end. For example, 27 | // '/a/b' will match all files and directories ending with '/a/b'; 28 | // the '*.svn' will match all files and directories whose name ends with '.svn'. 29 | // and the '.svn' will match all files and directories named exactly '.svn'. 30 | // Note, the '/' characters in a pattern matches both '/' and '\'. 31 | // See helpers/FileHelper::findFiles() description for more details on pattern matching rules. 32 | 'only' => ['*.php'], 33 | // array, list of patterns that specify which files (not directories) should be processed. 34 | // If empty or not set, all files will be processed. 35 | // Please refer to "except" for details about the patterns. 36 | // If a file/directory matches both a pattern in "only" and "except", it will NOT be processed. 37 | 'except' => [ 38 | '.svn', 39 | '.git', 40 | '.gitignore', 41 | '.gitkeep', 42 | '.hgignore', 43 | '.hgkeep', 44 | '/messages', 45 | ], 46 | // Generated file format. Can be either "php", "po" or "db". 47 | 'format' => 'php', 48 | // When format is "db", you may specify the following two options 49 | //'db' => 'db', 50 | //'sourceMessageTable' => '{{%source_message}}', 51 | ]; -------------------------------------------------------------------------------- /src/messages/cs/kveditable.php: -------------------------------------------------------------------------------- 1 | '(nenastaveno)', 21 | 'Apply' => 'Použít', 22 | 'Close' => 'Zavřít', 23 | 'Edit' => 'Upravit', 24 | 'Reset' => 'Resetovat', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/da/kveditable.php: -------------------------------------------------------------------------------- 1 | '(ikke defineret)', 21 | 'Apply' => 'Anvend', 22 | 'Close' => '', 23 | 'Edit' => 'Redigere', 24 | 'Reset' => 'Nulstil', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/de/kveditable.php: -------------------------------------------------------------------------------- 1 | '(nicht gesetzt)', 21 | 'Apply' => 'Übernehmen', 22 | 'Close' => '', 23 | 'Edit' => 'Bearbeiten', 24 | 'Reset' => 'Zurücksetzen', 25 | ]; -------------------------------------------------------------------------------- /src/messages/el-GR/kveditable.php: -------------------------------------------------------------------------------- 1 | '(Μη καθορισμένο)', 21 | 'Apply' => 'Καταχώρηση', 22 | 'Close' => 'Κλείσιμο', 23 | 'Edit' => 'Αλλαγή', 24 | 'Reset' => 'Αρχικοποίηση', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/el/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/en/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/eo/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/es/kveditable.php: -------------------------------------------------------------------------------- 1 | '(vacío)', 21 | 'Apply' => 'Aplicar', 22 | 'Close' => 'Cerrar', 23 | 'Edit' => 'Editar', 24 | 'Reset' => 'Reiniciar', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/et/kveditable.php: -------------------------------------------------------------------------------- 1 | '(puudu)', 21 | 'Apply' => 'Rakenda', 22 | 'Close' => 'Sulge', 23 | 'Edit' => 'Muuda', 24 | 'Reset' => 'Lähtesta', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/eu/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/fa/kveditable.php: -------------------------------------------------------------------------------- 1 | '(تنظیم نشده)', 21 | 'Apply' => 'اعمال', 22 | 'Close' => 'بستن', 23 | 'Edit' => 'ویرایش', 24 | 'Reset' => 'بازنشانی', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/fi/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/fo/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/fr/kveditable.php: -------------------------------------------------------------------------------- 1 | '(non défini)', 21 | 'Apply' => 'Appliquer', 22 | 'Close' => '', 23 | 'Edit' => 'Modifier', 24 | 'Reset' => 'Réinitialiser', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/gl/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/gu/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/he/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/hi/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/hr/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/hu/kveditable.php: -------------------------------------------------------------------------------- 1 | '(nincs beállítva)', 21 | 'Apply' => 'Alkalmaz', 22 | 'Close' => '', 23 | 'Edit' => 'Szerkesztés', 24 | 'Reset' => 'Alaphelyzet', 25 | ]; -------------------------------------------------------------------------------- /src/messages/hy/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/id/kveditable.php: -------------------------------------------------------------------------------- 1 | '(tidak diatur)', 21 | 'Apply' => 'Terapkan', 22 | 'Close' => 'Tutup', 23 | 'Edit' => 'Ubah', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/is/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/it/kveditable.php: -------------------------------------------------------------------------------- 1 | '(non impostato)', 21 | 'Apply' => 'Applica', 22 | 'Close' => '', 23 | 'Edit' => 'Modifica', 24 | 'Reset' => 'Resetta', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ja/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ka/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/kk/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/kn/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ko/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ky/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/lt/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | '(not set)' => 'Nenustatyta', 22 | 'Apply' => 'Išsaugoti', 23 | 'Edit' => 'Redaguoti', 24 | 'Reset' => 'Atstatyti', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/lv/kveditable.php: -------------------------------------------------------------------------------- 1 | '(nav uzdots)', 21 | 'Apply' => 'Saglabāt', 22 | 'Close' => 'Aizvērt', 23 | 'Edit' => 'Labot', 24 | 'Reset' => 'Atstatīt', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/mi/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/mk/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/mn/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/mr/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ms/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/mt/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/nb/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/nl/kveditable.php: -------------------------------------------------------------------------------- 1 | '(niet ingesteld)', 21 | 'Apply' => 'Toepassen', 22 | 'Close' => 'Afsluiten', 23 | 'Edit' => 'Bewerken', 24 | 'Reset' => 'Reset', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/nn/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/pl/kveditable.php: -------------------------------------------------------------------------------- 1 | '(brak)', 21 | 'Apply' => 'Zastosuj', 22 | 'Close' => 'Zamknij', 23 | 'Edit' => 'Edytuj', 24 | 'Reset' => 'Resetuj', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/pt-BR/kveditable.php: -------------------------------------------------------------------------------- 1 | '(não definido)', 21 | 'Apply' => 'Aplicar', 22 | 'Close' => '', 23 | 'Edit' => 'Editar', 24 | 'Reset' => 'Resetar', 25 | ]; -------------------------------------------------------------------------------- /src/messages/pt-PT/kveditable.php: -------------------------------------------------------------------------------- 1 | '(não definido)', 21 | 'Apply' => 'Aplicar', 22 | 'Close' => 'Fechar', 23 | 'Edit' => 'Editar', 24 | 'Reset' => 'Anular', 25 | ]; -------------------------------------------------------------------------------- /src/messages/pt/kveditable.php: -------------------------------------------------------------------------------- 1 | '(não definido)', 21 | 'Apply' => 'Aplicar', 22 | 'Close' => '', 23 | 'Edit' => 'Editar', 24 | 'Reset' => 'Resetar', 25 | ]; -------------------------------------------------------------------------------- /src/messages/qu/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ro/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ru/kveditable.php: -------------------------------------------------------------------------------- 1 | '(не задано)', 21 | 'Apply' => 'Применить', 22 | 'Close' => 'Закрыть', 23 | 'Edit' => 'Редактировать', 24 | 'Reset' => 'Сбросить', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/sa/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/se/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/sk/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/sl/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/sq/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/sr/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/sv/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/sw/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ta/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/te/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/th/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/tj/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/tl/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/tn/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/tr/kveditable.php: -------------------------------------------------------------------------------- 1 | '(boş)', 21 | 'Apply' => 'Uygula', 22 | 'Close' => 'Kapat', 23 | 'Edit' => 'Düzenle', 24 | 'Reset' => 'Sıfırla', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ts/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/tt/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/uk/kveditable.php: -------------------------------------------------------------------------------- 1 | '(не задано)', 21 | 'Apply' => 'Застосувати', 22 | 'Close' => 'Закрити', 23 | 'Edit' => 'Редагувати', 24 | 'Reset' => 'Скинути', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/ur/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/vi/kveditable.php: -------------------------------------------------------------------------------- 1 | 2 | '(chưa thiết lập)', 22 | 'Apply' => 'Thiết lập', 23 | 'Close' => '', 24 | 'Edit' => 'Sửa', 25 | 'Reset' => 'Gán giá trị mặc định', 26 | ]; 27 | -------------------------------------------------------------------------------- /src/messages/zh-CN/kveditable.php: -------------------------------------------------------------------------------- 1 | '(未设置)', 21 | 'Apply' => '应用', 22 | 'Close' => '关闭', 23 | 'Edit' => '编辑', 24 | 'Reset' => '重置', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/zh-TW/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | -------------------------------------------------------------------------------- /src/messages/zu/kveditable.php: -------------------------------------------------------------------------------- 1 | '', 21 | 'Apply' => '', 22 | 'Close' => '', 23 | 'Edit' => '', 24 | 'Reset' => '', 25 | ]; 26 | --------------------------------------------------------------------------------