├── .eslintignore ├── screenshot.png ├── postcss.config.js ├── .gitignore ├── .babelrc ├── dist ├── css │ ├── field.css │ └── form-select-auto-complete.css ├── js │ ├── 989.js.LICENSE.txt │ ├── index-select-auto-complete.js │ ├── detail-select-auto-complete.js │ ├── form-select-auto-complete.js │ ├── field.js │ └── 989.js └── mix-manifest.json ├── resources ├── js │ ├── components │ │ ├── Detail │ │ │ └── index.vue │ │ ├── Index │ │ │ └── index.vue │ │ ├── SelectedPanelItem.vue │ │ └── Form │ │ │ └── index.vue │ └── field.js └── sass │ └── field.scss ├── routes └── api.php ├── src ├── SelectAutoCompleteController.php ├── FieldServiceProvider.php └── SelectAutoComplete.php ├── LICENSE ├── composer.json ├── package.json ├── .eslintrc.js ├── webpack.config.js └── README.md /.eslintignore: -------------------------------------------------------------------------------- 1 | /webpack*.js 2 | /postcss*.js 3 | /.babelrc 4 | /dist/js/*.js -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techouse/select-auto-complete/HEAD/screenshot.png -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require("autoprefixer") 4 | ] 5 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /vendor 3 | /node_modules 4 | composer.phar 5 | composer.lock 6 | phpunit.xml 7 | .phpunit.result.cache 8 | .DS_Store 9 | Thumbs.db 10 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "modules": false 7 | } 8 | ] 9 | ], 10 | "plugins": [ 11 | "@babel/plugin-syntax-dynamic-import" 12 | ] 13 | } -------------------------------------------------------------------------------- /dist/css/field.css: -------------------------------------------------------------------------------- 1 | .select-auto-complete.form-select{padding-left:0;padding-right:0}.select-auto-complete.form-select.active,.select-auto-complete.form-select:active,.select-auto-complete.form-select:focus{box-shadow:0 0 8px var(--primary);outline:none}.select-auto-complete .single-select-wrapper .search-input{border-color:transparent;border-radius:.5em;border-width:0;padding:.32em .75em} -------------------------------------------------------------------------------- /resources/js/components/Detail/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 16 | -------------------------------------------------------------------------------- /resources/js/field.js: -------------------------------------------------------------------------------- 1 | Nova.booting((Vue) => { 2 | Vue.component("IndexSelectAutoComplete", () => import(/* webpackChunkName: "index-select-auto-complete" */ "./components/Index")) 3 | Vue.component("DetailSelectAutoComplete", () => import(/* webpackChunkName: "detail-select-auto-complete" */ "./components/Detail")) 4 | Vue.component("FormSelectAutoComplete", () => import(/* webpackChunkName: "form-select-auto-complete" */ "./components/Form")) 5 | }) 6 | -------------------------------------------------------------------------------- /resources/sass/field.scss: -------------------------------------------------------------------------------- 1 | .select-auto-complete { 2 | &.form-select { 3 | padding-left: 0; 4 | padding-right: 0; 5 | 6 | &:focus, 7 | &:active, 8 | &.active { 9 | outline: none; 10 | -webkit-box-shadow: 0 0 8px var(--primary); 11 | box-shadow: 0 0 8px var(--primary); 12 | } 13 | } 14 | 15 | .single-select-wrapper { 16 | .search-input { 17 | border-width: 0; 18 | border-color: transparent; 19 | border-radius: .5em; 20 | padding: .32em .75em; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /dist/js/989.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * Determine if an object is a Buffer 3 | * 4 | * @author Feross Aboukhadijeh 5 | * @license MIT 6 | */ 7 | 8 | /** 9 | * @license 10 | * Lodash 11 | * Copyright OpenJS Foundation and other contributors 12 | * Released under MIT license 13 | * Based on Underscore.js 1.8.3 14 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 15 | */ 16 | -------------------------------------------------------------------------------- /dist/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "field.css": "/nova-vendor/select-auto-complete/css/field.css", 3 | "field.js": "/nova-vendor/select-auto-complete/js/field.js", 4 | "index-select-auto-complete.js": "/nova-vendor/select-auto-complete/js/index-select-auto-complete.js", 5 | "detail-select-auto-complete.js": "/nova-vendor/select-auto-complete/js/detail-select-auto-complete.js", 6 | "form-select-auto-complete.css": "/nova-vendor/select-auto-complete/css/form-select-auto-complete.css", 7 | "form-select-auto-complete.js": "/nova-vendor/select-auto-complete/js/form-select-auto-complete.js", 8 | "js/989.js": "/nova-vendor/select-auto-complete/js/989.js" 9 | } -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | name('select_auto_complete_js_asset'); 19 | Route::get('/css/{asset}.css', SelectAutoCompleteController::class . '@cssAsset') 20 | ->name('select_auto_complete_css_asset'); -------------------------------------------------------------------------------- /resources/js/components/Index/index.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 26 | -------------------------------------------------------------------------------- /src/SelectAutoCompleteController.php: -------------------------------------------------------------------------------- 1 | header('Content-Type', 'application/javascript'); 19 | } 20 | abort(404); 21 | } 22 | 23 | public function cssAsset(NovaRequest $request, $asset) 24 | { 25 | if (File::exists(__DIR__ . "/../dist/css/{$asset}.css")) { 26 | return response(File::get(__DIR__ . "/../dist/css/{$asset}.css")) 27 | ->header('Content-Type', 'text/css'); 28 | } 29 | abort(404); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Klemen Tušar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "techouse/select-auto-complete", 3 | "description": "An auto-completing Laravel Nova search field.", 4 | "keywords": [ 5 | "laravel", 6 | "nova", 7 | "select", 8 | "search", 9 | "auto complete", 10 | "autocomplete", 11 | "suggest", 12 | "drop down", 13 | "dropdown" 14 | ], 15 | "authors": [ 16 | { 17 | "name": "Klemen Tušar", 18 | "email": "techouse@gmail.com" 19 | } 20 | ], 21 | "license": "MIT", 22 | "require": { 23 | "php": ">=7.1.0", 24 | "illuminate/support": "^5.6 || ^6.0 || ^7.0 || ^8.0 || ^9.0", 25 | "laravel/nova": "*" 26 | }, 27 | "autoload": { 28 | "psr-4": { 29 | "Techouse\\SelectAutoComplete\\": "src/" 30 | } 31 | }, 32 | "extra": { 33 | "laravel": { 34 | "providers": [ 35 | "Techouse\\SelectAutoComplete\\FieldServiceProvider" 36 | ] 37 | } 38 | }, 39 | "config": { 40 | "sort-packages": true 41 | }, 42 | "minimum-stability": "dev", 43 | "prefer-stable": true 44 | } 45 | -------------------------------------------------------------------------------- /src/FieldServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->booted(function () { 20 | $this->routes(); 21 | }); 22 | 23 | Nova::serving(function (ServingNova $event) { 24 | Nova::script('select-auto-complete', __DIR__.'/../dist/js/field.js'); 25 | Nova::style('select-auto-complete', __DIR__.'/../dist/css/field.css'); 26 | }); 27 | } 28 | 29 | public function routes() 30 | { 31 | if ($this->app->routesAreCached()) { 32 | return; 33 | } 34 | Route::middleware(['nova']) 35 | ->prefix('nova-vendor/select-auto-complete') 36 | ->group(__DIR__ . '/../routes/api.php'); 37 | } 38 | 39 | /** 40 | * Register any application services. 41 | * 42 | * @return void 43 | */ 44 | public function register() 45 | { 46 | // 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /dist/js/index-select-auto-complete.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[592],{953:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});const s={props:["resourceName","field"],computed:{selectedValue:function(){var e=this;if(void 0!==this.field.displayUsingLabels&&!0===this.field.displayUsingLabels){var t=this.field.options.find((function(t){return Number(t.value)===Number(e.field.value)}));return t?String(t.label):""}return String(this.field.value)}}};const i=(0,n(900).Z)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.field.asHtml?n("div",{domProps:{innerHTML:e._s(e.selectedValue)}}):n("span",{staticClass:"whitespace-no-wrap"},[e._v(e._s(e.selectedValue))])}),[],!1,null,null,null).exports},900:(e,t,n)=>{function s(e,t,n,s,i,r,o,l){var a,d="function"==typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),s&&(d.functional=!0),r&&(d._scopeId="data-v-"+r),o?(a=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},d._ssrRegister=a):i&&(a=l?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(d.functional){d._injectStyles=a;var u=d.render;d.render=function(e,t){return a.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,a):[a]}return{exports:e,options:d}}n.d(t,{Z:()=>s})}}]); -------------------------------------------------------------------------------- /resources/js/components/SelectedPanelItem.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 64 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --config=webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --config=webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "@babel/core": "^7.11.6", 14 | "@babel/plugin-syntax-dynamic-import": "^7.8.3", 15 | "@babel/preset-env": "^7.11.5", 16 | "@babel/eslint-parser": "^7.17.0", 17 | "autoprefixer": "^10.0.1", 18 | "babel-loader": "^8.1.0", 19 | "clean-webpack-plugin": "^4.0.0", 20 | "cross-env": "^7.0.2", 21 | "css-loader": "^6.6.0", 22 | "css-minimizer-webpack-plugin": "^3.4.1", 23 | "eslint": "^8.9.0", 24 | "eslint-config-airbnb-base": "^15.0.0", 25 | "eslint-plugin-import": "^2.25.4", 26 | "eslint-plugin-vue": "^8.4.1", 27 | "mini-css-extract-plugin": "^2.5.3", 28 | "node-sass-magic-importer": "^5.3.2", 29 | "path": "^0.12.7", 30 | "postcss-loader": "^6.2.1", 31 | "resolve-url-loader": "^5.0.0", 32 | "sass": "^1.26.10", 33 | "sass-loader": "^12.4.0", 34 | "style-loader": "^3.3.1", 35 | "terser-webpack-plugin": "^5.3.1", 36 | "vue-loader": "^15.9.8", 37 | "vue-template-compiler": "^2.6.12", 38 | "webpack": "^5.68.0", 39 | "webpack-bundle-tracker": "^1.4.0", 40 | "webpack-cli": "^4.9.2", 41 | "webpack-manifest-plugin": "^4.1.1" 42 | }, 43 | "dependencies": { 44 | "laravel-nova": "^1.4.1", 45 | "vue": "^2.6.12", 46 | "vue-single-select": "^1.1.0" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /dist/js/detail-select-auto-complete.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[172],{339:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});const l={name:"SelectedPanelItem",props:{field:{type:Object,required:!0},fieldName:{type:String,default:""}},computed:{label:function(){return this.fieldName||this.field.name},fieldValue:function(){var e=this;if(""===this.field.value||null===this.field.value||void 0===this.field.value)return!1;if(void 0!==this.field.displayUsingLabels&&!0===this.field.displayUsingLabels){var t=this.field.options.find((function(t){return Number(t.value)===Number(e.field.value)}));return t?String(t.label):""}return String(this.field.value)},shouldDisplayAsHtml:function(){return this.field.asHtml}}};var s=n(900);const i={components:{SelectedPanelItem:(0,s.Z)(l,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"flex border-b border-40"},[n("div",{staticClass:"w-1/4 py-4"},[n("h4",{staticClass:"font-normal text-80"},[e._v("\n "+e._s(e.label)+"\n ")])]),e._v(" "),n("div",{staticClass:"w-3/4 py-4"},[e.fieldValue&&!e.shouldDisplayAsHtml?n("p",{staticClass:"text-90"},[e._v("\n "+e._s(e.fieldValue)+"\n ")]):e.fieldValue&&e.shouldDisplayAsHtml?n("div",{domProps:{innerHTML:e._s(e.field.value)}}):n("p",[e._v("\n —\n ")])])])}),[],!1,null,null,null).exports},props:["resource","resourceName","resourceId","field"]};const r=(0,s.Z)(i,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("selected-panel-item",{attrs:{field:e.field}})}),[],!1,null,null,null).exports},900:(e,t,n)=>{function l(e,t,n,l,s,i,r,a){var o,d="function"==typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),l&&(d.functional=!0),i&&(d._scopeId="data-v-"+i),r?(o=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},d._ssrRegister=o):s&&(o=a?function(){s.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:s),o)if(d.functional){d._injectStyles=o;var u=d.render;d.render=function(e,t){return o.call(t),u(e,t)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,o):[o]}return{exports:e,options:d}}n.d(t,{Z:()=>l})}}]); -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parserOptions: { 3 | ecmaVersion: 8, 4 | requireConfigFile: false, 5 | parser: "@babel/eslint-parser", 6 | sourceType: "module", 7 | }, 8 | extends: [ 9 | "airbnb-base", 10 | "eslint:recommended", 11 | "plugin:vue/recommended", 12 | ], 13 | globals: { 14 | process: true, 15 | require: true, 16 | moment: true, 17 | Nova: true, 18 | Vue: true, 19 | }, 20 | env: { 21 | browser: true, 22 | es6: true, 23 | node: true, 24 | }, 25 | settings: { 26 | "import/resolver": { 27 | node: { 28 | extensions: [".mjs", ".js", ".json", ".vue"], 29 | }, 30 | }, 31 | "import/extensions": [ 32 | ".js", 33 | ".mjs", 34 | ".jsx", 35 | ".vue", 36 | ], 37 | "import/core-modules": [], 38 | "import/ignore": [ 39 | "node_modules", 40 | "\\.(coffee|scss|css|less|hbs|svg|json)$", 41 | ], 42 | }, 43 | rules: { 44 | "no-multi-spaces": 0, 45 | "no-debugger": process.env.NODE_ENV === "production" ? 2 : 0, 46 | "no-console": 0, 47 | camelcase: "off", 48 | indent: "off", 49 | "linebreak-style": ["error", "unix"], 50 | quotes: ["error", "double"], 51 | semi: ["error", "never"], 52 | "max-len": ["error", 120, 2, { 53 | ignoreUrls: true, 54 | ignoreComments: false, 55 | ignoreRegExpLiterals: true, 56 | ignoreStrings: true, 57 | ignoreTemplateLiterals: true, 58 | }], 59 | "no-param-reassign": ["error", { props: false }], 60 | "no-shadow": ["error", { allow: ["state"] }], 61 | "object-curly-newline": "off", 62 | "vue/html-indent": ["error", 4], 63 | "vue/max-attributes-per-line": 0, 64 | "import/extensions": ["error", "always", { 65 | js: "never", 66 | mjs: "never", 67 | jsx: "never", 68 | ts: "never", 69 | tsx: "never", 70 | vue: "never", 71 | }], 72 | "no-new": "off", 73 | }, 74 | plugins: [ 75 | "import", 76 | "vue", 77 | ], 78 | } 79 | -------------------------------------------------------------------------------- /dist/js/form-select-auto-complete.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[475],{616:(e,t,i)=>{i.r(t),i.d(t,{default:()=>s});var o=i(492),l=i(706);const n={components:{VueSingleSelect:o.Z},mixins:[l.HandlesValidationErrors,l.FormField],data:function(){return{refName:"select_auto_complete",item:null,optionKey:"value",optionLabel:"label"}},computed:{placeholder:function(){return this.field.placeholder||this.__("Choose an option")}},watch:{item:function(e,t){e!==t&&this.$set(this,"value",null!==e&&"value"in e?e.value:"")}},created:function(){var e=this;this.field.value?(this.$set(this,"item",this.field.options.find((function(t){return String(t.value)===String(e.field.value)}))),this.$set(this,"value",this.field.value)):this.field.default&&(this.$set(this,"item",this.field.options.find((function(t){return String(t.value)===String(e.field.default)}))),this.$set(this,"value",this.field.defaultValue))},mounted:function(){this.removeOverflowHiddenFromContainer()},methods:{fill:function(e){e.append(this.field.attribute,this.value)},removeOverflowHiddenFromContainer:function(){var e=this;["form",".modal",".card"].forEach((function(t){var i=e.$refs[e.refName].$el.closest(t);i&&(i.classList.contains("overflow-hidden")&&i.classList.remove("overflow-hidden"),i.classList.contains("overflow-x-hidden")&&i.classList.remove("overflow-x-hidden"),i.classList.contains("overflow-y-hidden")&&i.classList.remove("overflow-y-hidden"))}))},getOptionDescription:function(e){return this.field.displayUsingLabels&&this.optionLabel?e[this.optionLabel]:this.optionKey&&this.optionLabel?"".concat(e[this.optionKey]," ").concat(e[this.optionLabel]):this.optionLabel?e[this.optionLabel]:this.optionKey?e[this.optionKey]:e}}};const s=(0,i(900).Z)(n,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("default-field",{ref:e.refName,attrs:{field:e.field,errors:e.errors}},[i("template",{slot:"field"},[i("vue-single-select",{staticClass:"select-auto-complete w-full form-control form-select",class:e.errorClasses,attrs:{id:e.field.attribute,options:e.field.options,placeholder:e.placeholder,required:e.field.required,"max-results":e.field.maxResults,"max-height":e.field.maxHeight,"get-option-description":e.getOptionDescription,"option-key":e.optionKey,"option-label":e.optionLabel},scopedSlots:e._u([{key:"option",fn:function(t){var i=t.option;return[e._v("\n "+e._s(e.getOptionDescription(i))+"\n ")]}}]),model:{value:e.item,callback:function(t){e.item=t},expression:"item"}})],1)],2)}),[],!1,null,null,null).exports}}]); -------------------------------------------------------------------------------- /src/SelectAutoComplete.php: -------------------------------------------------------------------------------- 1 | withMeta(['maxResults' => (int)$this->maxResults ?: 30, 39 | 'maxHeight' => $this->maxHeight]); 40 | } 41 | 42 | /** 43 | * @param null $default 44 | * @return mixed 45 | */ 46 | public function default($default = null) 47 | { 48 | if ($default !== null) { 49 | return $this->withMeta([__FUNCTION__ => $default]); 50 | } 51 | } 52 | 53 | /** 54 | * @param int $maxResults 55 | * @return mixed 56 | * @throws \Exception 57 | */ 58 | public function maxResults(int $maxResults) 59 | { 60 | if ($maxResults > 0) { 61 | $this->maxResults = $maxResults; 62 | 63 | return $this->withMeta([__FUNCTION__ => $this->maxResults]); 64 | } 65 | throw new Exception('Max results value has to be a positive interge!'); 66 | } 67 | 68 | /** 69 | * @param string $maxHeight 70 | * @return mixed 71 | */ 72 | public function maxHeight(string $maxHeight) 73 | { 74 | if ($maxHeight) { 75 | $this->maxHeight = trim($maxHeight); 76 | 77 | return $this->withMeta([__FUNCTION__ => $this->maxHeight]); 78 | } 79 | } 80 | 81 | /** 82 | * Display values using their corresponding specified labels. 83 | * 84 | * @return $this 85 | */ 86 | public function displayUsingLabels() 87 | { 88 | $this->displayUsingLabels = true; 89 | 90 | return $this->withMeta([__FUNCTION__ => $this->displayUsingLabels]); 91 | } 92 | 93 | public function placeholder($placeholer) 94 | { 95 | if ($placeholer) { 96 | $this->placeholder = trim($placeholer); 97 | 98 | return $this->withMeta([__FUNCTION__ => $this->placeholder]); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /dist/css/form-select-auto-complete.css: -------------------------------------------------------------------------------- 1 | .inline-block[data-v-b3635f2e]{display:inline-block}.block[data-v-b3635f2e]{display:block}.flex[data-v-b3635f2e]{display:flex}.border[data-v-b3635f2e]{border-style:solid;border-width:thin}.rounded[data-v-b3635f2e]{border-radius:.25em}.text-black[data-v-b3635f2e]{color:#22292f}.border-grey-lighter[data-v-b3635f2e]{border-color:#ced4da}.bg-grey-lighter[data-v-b3635f2e]{background-color:#606f7b}.bg-grey-light[data-v-b3635f2e]{background-color:#dae1e7}.bg-grey-dark[data-v-b3635f2e]{background-color:#8795a1}.bg-white[data-v-b3635f2e]{background-color:#fff}.pin-r[data-v-b3635f2e]{right:0}.pin-y[data-v-b3635f2e]{bottom:0;top:0}.absolute[data-v-b3635f2e]{position:absolute}.relative[data-v-b3635f2e]{position:relative}.items-center[data-v-b3635f2e]{align-items:center}.p-0[data-v-b3635f2e]{padding:0}.p-1[data-v-b3635f2e]{padding:.25em}.px-1[data-v-b3635f2e]{padding-left:.25em;padding-right:.25em}.py-2[data-v-b3635f2e]{padding-bottom:.5em;padding-top:.5em}.px-2[data-v-b3635f2e]{padding-left:.5em;padding-right:.5em}.mt-px[data-v-b3635f2e]{margin-top:1px}.leading-tight[data-v-b3635f2e]{line-height:1.25}.leading-normal[data-v-b3635f2e]{line-height:1.5}.text-left[data-v-b3635f2e]{text-align:left}.w-full[data-v-b3635f2e]{width:100%}.shadow[data-v-b3635f2e]{box-shadow:0 2px 4px 0 rgba(0,0,0,.1)}.list-reset[data-v-b3635f2e]{list-style:none;padding:0}.overflow-auto[data-v-b3635f2e]{overflow:auto}.appearance-none[data-v-b3635f2e]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.w-1[data-v-b3635f2e]{width:.25em}.w-2[data-v-b3635f2e]{width:.5em}.w-3[data-v-b3635f2e]{width:.75em}.w-4[data-v-b3635f2e]{width:1em}.h-4[data-v-b3635f2e]{height:1em}.h-1[data-v-b3635f2e]{height:.25em}.h-2[data-v-b3635f2e]{height:.5em}.h-3[data-v-b3635f2e]{height:.75em}.fill-current[data-v-b3635f2e]{fill:currentColor}.hover\:no-underline[data-v-b3635f2e]:hover,.no-underline[data-v-b3635f2e]{text-decoration:none}.hover\:outline-none[data-v-b3635f2e],.outline-none[data-v-b3635f2e]{outline:0}.hover\:bg-grey-light[data-v-b3635f2e]:hover{background-color:#dae1e7}.shadow-md[data-v-b3635f2e]{box-shadow:0 4px 8px 0 rgba(0,0,0,.12),0 2px 4px 0 rgba(0,0,0,.08)}.search-input[data-v-b3635f2e]{background-clip:padding-box;background-color:#fff;border:1px solid #ced4da;border-radius:.25em;box-sizing:border-box;color:#495057;display:block;font-size:1em;line-height:1.5;padding:.375em .75em;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:100%}.icons[data-v-b3635f2e]{fill:#606f7b;bottom:0;padding:0 1em;right:0;top:0}.icons svg[data-v-b3635f2e]{height:.75em;width:.75em}.single-select-wrapper[data-v-b3635f2e]{margin-bottom:.5em;position:relative}.required[data-v-b3635f2e]{_background-color:#f8d7da;border-color:#f5c6cb;_color:#721c24}.cursor-pointer[data-v-b3635f2e]{cursor:pointer}.dropdown[data-v-b3635f2e]{background-color:#fff;border-radius:.25em;box-shadow:0 4px 8px 0 rgba(0,0,0,.12),0 2px 4px 0 rgba(0,0,0,.08);color:#606f7b;line-height:1.25;text-align:left}.dropdown>li[data-v-b3635f2e]{padding:.5em .75em}.active[data-v-b3635f2e]{background:#dae1e7} -------------------------------------------------------------------------------- /dist/js/field.js: -------------------------------------------------------------------------------- 1 | (()=>{var e,t,r,o={},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e].call(r.exports,r,r.exports,a),r.exports}a.m=o,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>"js/"+({172:"detail-select-auto-complete",475:"form-select-auto-complete",592:"index-select-auto-complete"}[e]||e)+".js",a.miniCssF=e=>"css/form-select-auto-complete.css",a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},a.l=(t,r,o,n)=>{if(e[t])e[t].push(r);else{var l,i;if(void 0!==o)for(var u=document.getElementsByTagName("script"),s=0;s{l.onerror=l.onload=null,clearTimeout(m);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},m=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),i&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.p="/nova-vendor/select-auto-complete/",t=e=>new Promise(((t,r)=>{var o=a.miniCssF(e),n=a.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),o=0;o{var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.onerror=n.onload=a=>{if(n.onerror=n.onload=null,"load"===a.type)r();else{var l=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.href||t,u=new Error("Loading CSS chunk "+e+" failed.\n("+i+")");u.code="CSS_CHUNK_LOAD_FAILED",u.type=l,u.request=i,n.parentNode.removeChild(n),o(u)}},n.href=t,document.head.appendChild(n)})(e,n,t,r)})),r={708:0},a.f.miniCss=(e,o)=>{r[e]?o.push(r[e]):0!==r[e]&&{475:1}[e]&&o.push(r[e]=t(e).then((()=>{r[e]=0}),(t=>{throw delete r[e],t})))},(()=>{var e={708:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var l=a.p+a.u(t),i=new Error;a.l(l,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),l=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+n+": "+l+")",i.name="ChunkLoadError",i.type=n,i.request=l,o[1](i)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,[l,i,u]=r,s=0;if(l.some((t=>0!==e[t]))){for(o in i)a.o(i,o)&&(a.m[o]=i[o]);if(u)u(a)}for(t&&t(r);ssend(); 67 | } 68 | } 69 | 70 | /** 71 | * Get the fields available on the action. 72 | * 73 | * @return array 74 | */ 75 | public function fields() 76 | { 77 | return [ 78 | Select::make(__('Person'), 'person') 79 | ->options(\App\Person::all()->mapWithKeys(function ($person) { 80 | return [$person->id => $person->name]; 81 | })) 82 | ->displayUsingLabels(), 83 | 84 | Select::make(__('Partner'), 'partner') 85 | ->options(\App\User::all()->pluck('name', 'id')) 86 | ->placeholder('Pick a name') // use a custom placeholder 87 | ->displayUsingLabels() // display only the labels od the options list 88 | ->default(7) // set the default to the User with the ID 7 89 | ->maxResults(5) // limit the dropdown select to a max of 5 hits 90 | ->maxHeight('100px') // limit the dropdown to a max height of 100px 91 | ->required() // make the field required 92 | ]; 93 | } 94 | } 95 | ``` 96 | -------------------------------------------------------------------------------- /resources/js/components/Form/index.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 134 | -------------------------------------------------------------------------------- /dist/js/989.js: -------------------------------------------------------------------------------- 1 | /*! For license information please see 989.js.LICENSE.txt */ 2 | (self.webpackChunk=self.webpackChunk||[]).push([[989],{706:function(t){var e;e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=41)}([function(t,e,n){"use strict";var r=n(40),i=n(152),o=Object.prototype.toString;function u(t){return"[object Array]"===o.call(t)}function a(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===o.call(t)}function s(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){c.headers[t]=r.merge(o)})),t.exports=c}).call(e,n(70))},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(109),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t,e,n){return e in t?(0,o.default)(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(9),i=n(1).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=!0},function(t,e,n){"use strict";var r=n(14);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},function(t,e,n){var r=n(11).f,i=n(17),o=n(2)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(54)("keys"),i=n(59);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(48),i=n(21);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(18).Symbol;t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mapProps=void 0;var r,i=n(194),o=(r=i)&&r.__esModule?r:{default:r},u={showHelpText:{type:Boolean,default:!1},shownViaNewRelationModal:{type:Boolean,default:!1},resourceId:{type:[Number,String]},resourceName:{type:String},field:{type:Object,required:!0},viaResource:{type:String,required:!1},viaResourceId:{type:[String,Number],required:!1},viaRelationship:{type:String,required:!1},shouldOverrideMeta:{type:Boolean,default:!1}};e.mapProps=function(t){return o.default.pick(u,t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=["1/2","1/3","2/3","1/4","3/4","1/5","2/5","3/5","4/5","1/6","5/6"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(150);Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o(r).default}}),Object.defineProperty(e,"Form",{enumerable:!0,get:function(){return o(r).default}});var i=n(60);function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"Errors",{enumerable:!0,get:function(){return o(i).default}})},function(t,e,n){"use strict";(function(e){var r=n(0),i=n(97),o=n(100),u=n(106),a=n(104),c=n(39),s="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(99);t.exports=function(t){return new Promise((function(f,l){var p=t.data,h=t.headers;r.isFormData(p)&&delete h["Content-Type"];var d=new XMLHttpRequest,v="onreadystatechange",g=!1;if("test"===e.env.NODE_ENV||"undefined"==typeof window||!window.XDomainRequest||"withCredentials"in d||a(t.url)||(d=new window.XDomainRequest,v="onload",g=!0,d.onprogress=function(){},d.ontimeout=function(){}),t.auth){var y=t.auth.username||"",_=t.auth.password||"";h.Authorization="Basic "+s(y+":"+_)}if(d.open(t.method.toUpperCase(),o(t.url,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d[v]=function(){if(d&&(4===d.readyState||g)&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var e="getAllResponseHeaders"in d?u(d.getAllResponseHeaders()):null,n={data:t.responseType&&"text"!==t.responseType?d.response:d.responseText,status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:e,config:t,request:d};i(f,l,n),d=null}},d.onerror=function(){l(c("Network Error",t,null,d)),d=null},d.ontimeout=function(){l(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var m=n(102),w=(t.withCredentials||a(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;w&&(h[t.xsrfHeaderName]=w)}if("setRequestHeader"in d&&r.forEach(h,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete h[e]:d.setRequestHeader(e,t)})),t.withCredentials&&(d.withCredentials=!0),t.responseType)try{d.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){d&&(d.abort(),l(t),d=null)})),void 0===p&&(p=null),d.send(p)}))}}).call(e,n(70))},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";var r=n(96);t.exports=function(t,e,n,i,o){var u=new Error(t);return r(u,e,n,i,o)}},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;rn;)e.push(arguments[n++]);return y[++g]=function(){a("function"==typeof t?t:Function(t),e)},r(g),g},h=function(t){delete y[t]},"process"==n(15)(l)?r=function(t){l.nextTick(u(m,t,1))}:v&&v.now?r=function(t){v.now(u(m,t,1))}:d?(o=(i=new d).port2,i.port1.onmessage=w,r=u(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",w,!1)):r=_ in s("script")?function(t){c.appendChild(s("script")).onreadystatechange=function(){c.removeChild(this),m.call(t)}}:function(t){setTimeout(u(m,t,1),0)}),t.exports={set:p,clear:h}},function(t,e,n){var r=n(28),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(21);t.exports=function(t){return Object(r(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this.record(e)}return r(t,[{key:"all",value:function(){return this.errors}},{key:"has",value:function(t){var e=this.errors.hasOwnProperty(t);return e||(e=Object.keys(this.errors).filter((function(e){return e.startsWith(t+".")||e.startsWith(t+"[")})).length>0),e}},{key:"first",value:function(t){return this.get(t)[0]}},{key:"get",value:function(t){return this.errors[t]||[]}},{key:"any",value:function(){return Object.keys(this.errors).length>0}},{key:"record",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.errors=t}},{key:"clear",value:function(t){if(t){var e=Object.assign({},this.errors);Object.keys(e).filter((function(e){return e===t||e.startsWith(t+".")||e.startsWith(t+"[")})).forEach((function(t){return delete e[t]})),this.errors=e}else this.errors={}}}]),t}();e.default=o},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,n(71))},function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(12),i=n(13);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(t){r=u}}();var c,s=[],f=!1,l=-1;function p(){f&&c&&(f=!1,c.length?s=c.concat(s):l=-1,s.length&&h())}function h(){if(!f){var t=a(p);f=!0;for(var e=s.length;e;){for(c=s,s=[];++l1)for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:null;return this.viaManyToMany?this.detachResources(t):Nova.request({url:"/nova-api/"+this.resourceName,method:"delete",params:(0,o.default)({},this.queryString,{resources:u(t)})}).then(n||function(){e.deleteModalOpen=!1,e.getResources()}).then((function(){Nova.$emit("resources-deleted")}))},deleteSelectedResources:function(){this.deleteResources(this.selectedResources)},deleteAllMatchingResources:function(){var t=this;return this.viaManyToMany?this.detachAllMatchingResources():Nova.request({url:this.deleteAllMatchingResourcesEndpoint,method:"delete",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){t.deleteModalOpen=!1,t.getResources()})).then((function(){Nova.$emit("resources-deleted")}))},detachResources:function(t){var e=this;return Nova.request({url:"/nova-api/"+this.resourceName+"/detach",method:"delete",params:(0,o.default)({},this.queryString,{resources:u(t)},{pivots:a(t)})}).then((function(){e.deleteModalOpen=!1,e.getResources()})).then((function(){Nova.$emit("resources-detached")}))},detachAllMatchingResources:function(){var t=this;return Nova.request({url:"/nova-api/"+this.resourceName+"/detach",method:"delete",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){t.deleteModalOpen=!1,t.getResources()})).then((function(){Nova.$emit("resources-detached")}))},forceDeleteResources:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Nova.request({url:"/nova-api/"+this.resourceName+"/force",method:"delete",params:(0,o.default)({},this.queryString,{resources:u(t)})}).then(n||function(){e.deleteModalOpen=!1,e.getResources()}).then((function(){Nova.$emit("resources-deleted")}))},forceDeleteSelectedResources:function(){this.forceDeleteResources(this.selectedResources)},forceDeleteAllMatchingResources:function(){var t=this;return Nova.request({url:this.forceDeleteSelectedResourcesEndpoint,method:"delete",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){t.deleteModalOpen=!1,t.getResources()})).then((function(){Nova.$emit("resources-deleted")}))},restoreResources:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Nova.request({url:"/nova-api/"+this.resourceName+"/restore",method:"put",params:(0,o.default)({},this.queryString,{resources:u(t)})}).then(n||function(){e.restoreModalOpen=!1,e.getResources()}).then((function(){Nova.$emit("resources-restored")}))},restoreSelectedResources:function(){this.restoreResources(this.selectedResources)},restoreAllMatchingResources:function(){var t=this;return Nova.request({url:this.restoreAllMatchingResourcesEndpoint,method:"put",params:(0,o.default)({},this.queryString,{resources:"all"})}).then((function(){t.restoreModalOpen=!1,t.getResources()})).then((function(){Nova.$emit("resources-restored")}))}},computed:{deleteAllMatchingResourcesEndpoint:function(){return this.lens?"/nova-api/"+this.resourceName+"/lens/"+this.lens:"/nova-api/"+this.resourceName},forceDeleteSelectedResourcesEndpoint:function(){return this.lens?"/nova-api/"+this.resourceName+"/lens/"+this.lens+"/force":"/nova-api/"+this.resourceName+"/force"},restoreAllMatchingResourcesEndpoint:function(){return this.lens?"/nova-api/"+this.resourceName+"/lens/"+this.lens+"/restore":"/nova-api/"+this.resourceName+"/restore"},queryString:function(){return{search:this.currentSearch,filters:this.encodedFilters,trashed:this.currentTrashed,viaResource:this.viaResource,viaResourceId:this.viaResourceId,viaRelationship:this.viaRelationship}}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i,o,u=s(n(44)),a=s(n(20)),c=s(n(43));function s(t){return t&&t.__esModule?t:{default:t}}e.default={methods:{clearSelectedFilters:(o=(0,c.default)(u.default.mark((function t(e){var n;return u.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=5;break}return t.next=3,this.$store.dispatch(this.resourceName+"/resetFilterState",{resourceName:this.resourceName,lens:e});case 3:t.next=7;break;case 5:return t.next=7,this.$store.dispatch(this.resourceName+"/resetFilterState",{resourceName:this.resourceName});case 7:this.updateQueryString((n={},(0,a.default)(n,this.pageParameter,1),(0,a.default)(n,this.filterParameter,""),n));case 8:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)}),filterChanged:function(){var t;this.updateQueryString((t={},(0,a.default)(t,this.pageParameter,1),(0,a.default)(t,this.filterParameter,this.$store.getters[this.resourceName+"/currentEncodedFilters"]),t))},initializeFilters:(i=(0,c.default)(u.default.mark((function t(e){return u.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.$store.commit(this.resourceName+"/clearFilters"),t.next=3,this.$store.dispatch(this.resourceName+"/fetchFilters",{resourceName:this.resourceName,viaResource:this.viaResource,viaResourceId:this.viaResourceId,viaRelationship:this.viaRelationship,lens:e});case 3:return t.next=5,this.initializeState(e);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)}),initializeState:(r=(0,c.default)(u.default.mark((function t(e){return u.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.initialEncodedFilters){t.next=5;break}return t.next=3,this.$store.dispatch(this.resourceName+"/initializeCurrentFilterValuesFromQueryString",this.initialEncodedFilters);case 3:t.next=7;break;case 5:return t.next=7,this.$store.dispatch(this.resourceName+"/resetFilterState",{resourceName:this.resourceName,lens:e});case 7:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},computed:{filterParameter:function(){return this.resourceName+"_filter"}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(33);e.default={props:(0,r.mapProps)(["shownViaNewRelationModal","field","viaResource","viaResourceId","viaRelationship","resourceName","showHelpText"]),data:function(){return{value:""}},mounted:function(){var t=this;this.setInitialValue(),this.field.fill=this.fill,Nova.$on(this.field.attribute+"-value",(function(e){t.value=e}))},destroyed:function(){Nova.$off(this.field.attribute+"-value")},methods:{setInitialValue:function(){this.value=void 0!==this.field.value&&null!==this.field.value?this.field.value:""},fill:function(t){t.append(this.field.attribute,String(this.value))},handleChange:function(t){this.value=t.target.value,this.field&&Nova.$emit(this.field.attribute+"-change",this.value)}},computed:{isReadonly:function(){return this.field.readonly||_.get(this.field,"extraAttributes.readonly")}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(35);e.default={props:{errors:{default:function(){return new r.Errors}}},data:function(){return{errorClass:"border-danger"}},computed:{errorClasses:function(){return this.hasError?[this.errorClass]:[]},fieldAttribute:function(){return this.field.attribute},validationKey:function(){return this.field.validationKey},hasError:function(){return this.errors.has(this.validationKey)},firstError:function(){if(this.hasError)return this.errors.first(this.validationKey)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=a(n(44)),o=a(n(43)),u=a(n(34));function a(t){return t&&t.__esModule?t:{default:t}}e.default={props:{loadCards:{type:Boolean,default:!0}},data:function(){return{cards:[]}},created:function(){this.fetchCards()},watch:{cardsEndpoint:function(){this.fetchCards()}},methods:{fetchCards:(r=(0,o.default)(i.default.mark((function t(){var e,n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.loadCards){t.next=6;break}return t.next=3,Nova.request().get(this.cardsEndpoint,{params:this.extraCardParams});case 3:e=t.sent,n=e.data,this.cards=n;case 6:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},computed:{shouldShowCards:function(){return this.cards.length>0},smallCards:function(){return _.filter(this.cards,(function(t){return-1!==u.default.indexOf(t.width)}))},largeCards:function(){return _.filter(this.cards,(function(t){return"full"==t.width}))},extraCardParams:function(){return null}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={methods:{toAppTimezone:function(t){return t?moment.tz(t,this.userTimezone).clone().tz(Nova.config.timezone).format("YYYY-MM-DD HH:mm:ss"):t},fromAppTimezone:function(t){return t?moment.tz(t,Nova.config.timezone).clone().tz(this.userTimezone).format("YYYY-MM-DD HH:mm:ss"):t},localizeDateTimeField:function(t){if(!t.value)return t.value;var e=moment.tz(t.value,Nova.config.timezone).clone().tz(this.userTimezone);return t.format?e.format(t.format):this.usesTwelveHourTime?e.format("YYYY-MM-DD h:mm:ss A"):e.format("YYYY-MM-DD HH:mm:ss")},localizeDateField:function(t){if(!t.value)return t.value;var e=moment.tz(t.value,Nova.config.timezone).clone().tz(this.userTimezone);return t.format?e.format(t.format):e.format("YYYY-MM-DD")}},computed:{userTimezone:function(){return Nova.config.userTimezone?Nova.config.userTimezone:moment.tz.guess()},usesTwelveHourTime:function(){return _.endsWith((new Date).toLocaleString(),"AM")||_.endsWith((new Date).toLocaleString(),"PM")}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(188),o=(r=i)&&r.__esModule?r:{default:r};e.default={methods:{updateQueryString:function(t){this.$router.push({query:(0,o.default)(t,this.$route.query)}).catch((function(t){if("NavigationDuplicated"!=t.name)throw t}))}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={computed:{resourceInformation:function(){var t=this;return _.find(Nova.config.resources,(function(e){return e.uriKey==t.resourceName}))},viaResourceInformation:function(){var t=this;if(this.viaResource)return _.find(Nova.config.resources,(function(e){return e.uriKey==t.viaResource}))},authorizedToCreate:function(){return this.resourceInformation.authorizedToCreate}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(20),o=(r=i)&&r.__esModule?r:{default:r};e.default={methods:{selectPreviousPage:function(){this.updateQueryString((0,o.default)({},this.pageParameter,this.currentPage-1))},selectNextPage:function(){this.updateQueryString((0,o.default)({},this.pageParameter,this.currentPage+1))}},computed:{currentPage:function(){return parseInt(this.$route.query[this.pageParameter]||1)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(20),o=(r=i)&&r.__esModule?r:{default:r};e.default={data:function(){return{perPage:25}},methods:{initializePerPageFromQueryString:function(){this.perPage=this.currentPerPage},perPageChanged:function(){this.updateQueryString((0,o.default)({},this.perPageParameter,this.perPage))}},computed:{currentPerPage:function(){return this.$route.query[this.perPageParameter]||25}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(187),o=(r=i)&&r.__esModule?r:{default:r};e.default={data:function(){return{search:"",selectedResource:"",availableResources:[]}},methods:{selectResource:function(t){this.selectedResource=t,this.field&&Nova.$emit(this.field.attribute+"-change",this.selectedResource.value)},handleSearchCleared:function(){this.availableResources=[]},clearSelection:function(){this.selectedResource="",this.availableResources=[],this.field&&Nova.$emit(this.field.attribute+"-change",null)},performSearch:function(t){var e=this;this.search=t;var n=t.trim();""!=n&&this.debouncer((function(){e.getAvailableResources(n)}),500)},debouncer:(0,o.default)((function(t){return t()}),500)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={beforeRouteLeave:function(t,e,n){this.canLeave||window.confirm(this.__("Do you really want to leave? You have unsaved changes."))?n():n(!1)},data:function(){return{canLeave:!0}},methods:{updateFormStatus:function(){this.canLeave=!1}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={data:function(){return{withTrashed:!1}},methods:{toggleWithTrashed:function(){this.withTrashed=!this.withTrashed},enableWithTrashed:function(){this.withTrashed=!0},disableWithTrashed:function(){this.withTrashed=!1}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,o.default)(t)};var r,i=n(199),o=(r=i)&&r.__esModule?r:{default:r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(42),o=(r=i)&&r.__esModule?r:{default:r};e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return o.default.all([t,new o.default((function(t){setTimeout((function(){return t()}),e)}))]).then((function(t){return t[0]}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return(0,u.default)(e)&&null==e.match(/^(.*)[A-Za-zÀ-ÖØ-öø-ÿ]$/)?e:t>1||0==t?i.Inflector.pluralize(e):i.Inflector.singularize(e)};var r,i=n(41),o=n(191),u=(r=o)&&r.__esModule?r:{default:r}},function(t,e,n){"use strict";var r={uncountableWords:["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"],pluralRules:[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]],singularRules:[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]],nonTitlecasedWords:["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"],idSuffix:new RegExp("(_ids|_id)$","g"),underbar:new RegExp("_","g"),spaceOrUnderbar:new RegExp("[ _]","g"),uppercase:new RegExp("([A-Z])","g"),underbarPrefix:new RegExp("^_"),applyRules:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i>8-u%1*8)){if((n=i.charCodeAt(u+=3/4))>255)throw new r;e=e<<8|n}return o}},function(t,e,n){"use strict";var r=n(0);function i(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var u=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),u.push(i(e)+"="+i(t))})))})),o=u.join("&")}return o&&(t+=(-1===t.indexOf("?")?"?":"&")+o),t}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,u){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===u&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},function(t,e,n){"use strict";var r=n(0),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,u={};return t?(r.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(u[e]&&i.indexOf(e)>=0)return;u[e]="set-cookie"===e?(u[e]?u[e]:[]).concat([n]):u[e]?u[e]+", "+n:n}})),u):u}},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){t.exports={default:n(111),__esModule:!0}},function(t,e,n){t.exports={default:n(112),__esModule:!0}},function(t,e,n){"use strict";e.__esModule=!0;var r,i=n(108),o=(r=i)&&r.__esModule?r:{default:r};e.default=o.default||function(t){for(var e=1;ef;)if((a=c[f++])!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,e,n){var r=n(16),i=n(121),o=n(120),u=n(4),a=n(57),c=n(140),s={},f={};(e=t.exports=function(t,e,n,l,p){var h,d,v,g,y=p?function(){return t}:c(t),_=r(n,l,e?2:1),m=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(h=a(t.length);h>m;m++)if((g=e?_(u(d=t[m])[0],d[1]):_(t[m]))===s||g===f)return g}else for(v=y.call(t);!(d=v.next()).done;)if((g=i(v,_,d.value,e))===s||g===f)return g}).BREAK=s,e.RETURN=f},function(t,e,n){t.exports=!n(5)&&!n(23)((function(){return 7!=Object.defineProperty(n(22)("div"),"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(10),i=n(2)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(4);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){"use strict";var r=n(127),i=n(53),o=n(26),u={};n(7)(u,n(2)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(u,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(2)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],u=o[r]();u.next=function(){return{done:n=!0}},o[r]=function(){return u},t(o)}catch(t){}return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var r=n(1),i=n(56).set,o=r.MutationObserver||r.WebKitMutationObserver,u=r.process,a=r.Promise,c="process"==n(15)(u);t.exports=function(){var t,e,n,s=function(){var r,i;for(c&&(r=u.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){u.nextTick(s)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var f=a.resolve(void 0);n=function(){f.then(s)}}else n=function(){i.call(r,s)};else{var l=!0,p=document.createTextNode("");new o(s).observe(p,{characterData:!0}),n=function(){p.data=l=!l}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e,n){"use strict";var r=n(50),i=n(129),o=n(132),u=n(58),a=n(48),c=Object.assign;t.exports=!c||n(23)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=u(t),c=arguments.length,s=1,f=i.f,l=o.f;c>s;)for(var p,h=a(arguments[s++]),d=f?r(h).concat(f(h)):r(h),v=d.length,g=0;v>g;)l.call(h,p=d[g++])&&(n[p]=h[p]);return n}:c},function(t,e,n){var r=n(4),i=n(128),o=n(46),u=n(27)("IE_PROTO"),a=function(){},c=function(){var t,e=n(22)("iframe"),r=o.length;for(e.style.display="none",n(47).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("