├── .gitignore
├── README.md
├── composer.json
├── dist
├── css
│ └── field.css
├── js
│ ├── field.js
│ └── field.js.LICENSE.txt
└── mix-manifest.json
├── mix.js
├── package.json
├── resources
├── js
│ ├── components
│ │ ├── DetailField.vue
│ │ ├── FormField.vue
│ │ └── IndexField.vue
│ └── field.js
└── sass
│ └── field.scss
├── src
├── FieldServiceProvider.php
└── Tags.php
└── webpack.mix.js
/.gitignore:
--------------------------------------------------------------------------------
1 | /.idea
2 | /vendor
3 | /node_modules
4 | package-lock.json
5 | composer.phar
6 | composer.lock
7 | phpunit.xml
8 | .phpunit.result.cache
9 | .DS_Store
10 | Thumbs.db
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nova Tag Input Field
2 |
3 | This plugin incorporate the [Vue Tags Input](https://github.com/JohMun/vue-tags-input) plugin by Johannes Munari into Laravel Nova by creating a new field type.
4 |
5 | 
6 |
7 | ## Nova 4
8 | This release must be used with Nova version 4 and above. Thanks to @dmason30 for the PR. To install a Nova 3 compatible version please see at the end.
9 |
10 | ## Installing
11 |
12 | Using Composer:
13 | ```
14 | composer require superlatif/nova-tag-input
15 | ```
16 |
17 | ## Example
18 |
19 | ### Basic
20 | ```
21 | Tags::make(__("Tags"), 'tags')
22 | ->help("Press ENTER to add tag")
23 | ->placeholder("Add a new tag")
24 | ->allowEditTags(true)
25 | ->addOnKeys([13, ':', ';', ',']) // 13 = Enter key
26 | ->autocompleteItems([
27 | 'Arizona',
28 | 'California',
29 | 'Colorado',
30 | 'Michigan',
31 | 'New York',
32 | 'Texas',
33 | ]),
34 | ```
35 |
36 | ### Autocomplete items from Eloquent
37 | ```
38 | $tags = Tag::pluck('title')->get();
39 | Tags::make(__("Tags"), 'tags')
40 | // ...
41 | ->autocompleteItems($tags)
42 | // ...
43 | ```
44 |
45 | ### Parameters
46 | | Parameter | Description | Type | Default |
47 | | ---------------------------- | ------------------------------------------------------------------------ | ------- | ---------- |
48 | | autocompleteItems | Array of strings used for autocompletion | Array | - |
49 | | addOnKeys | Set of characters triggering tag insertion | Array | [13] |
50 | | separators | Defines characters which split text into tags (useful when copy-pasting) | Array | [';'] |
51 | | placeholder | Hint displayed when the field is empty or after a list of existing tags | String | - |
52 | | addFromPaste | Tags can be created from pasted text | Boolean | true |
53 | | addOnBlur | Tag is created when field loses focus | Boolean | true |
54 | | addOnlyFromAutocomplete | Only allow tag creation from the autocompleteItems array | Boolean | false |
55 | | allowEditTags | Allow inline tag edition | Boolean | false |
56 | | autocompleteAlwaysOpen | Autocomplete list remains open | Boolean | false |
57 | | autocompleteFilterDuplicates | Removes duplicates from autocomplete list | Boolean | true |
58 | | autocompleteMinLength | The minimum text that must be entered before autocomplete | Boolean | 1 |
59 | | avoidAddingDuplicates | Prevent duplicated tags | Boolean | true |
60 | | deleteOnBackspace | Delete tags using backspace | Boolean | true |
61 | | disabled | Disable the field | Boolean | false |
62 | | maxTags | Max number of tags | Boolean | - |
63 |
64 | ## Installing
65 | To use a Nova 3 compatible version please use the following command:
66 | ```
67 | composer require superlatif/nova-tag-input:3.0
68 | ```
69 |
70 | ## Support us!
71 |
72 | If you think we saved you some time on your development, please consider showing your appreciation 😁
73 |
74 |
75 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "superlatif/nova-tag-input",
3 | "description": "Tag input field for Laravel Nova.",
4 | "authors": [
5 | {
6 | "name": "Simon Rapin",
7 | "email": "simon@superlatif.io",
8 | "homepage": "https://superlatif.io",
9 | "role": "Developer"
10 | }
11 | ],
12 | "keywords": [
13 | "laravel",
14 | "nova"
15 | ],
16 | "license": "MIT",
17 | "require": {
18 | "php": ">=7.1.0",
19 | "laravel/nova": "^5.0"
20 | },
21 | "repositories": [
22 | {
23 | "type": "composer",
24 | "url": "https://nova.laravel.com"
25 | }
26 | ],
27 | "autoload": {
28 | "psr-4": {
29 | "Superlatif\\NovaTagInput\\": "src/"
30 | }
31 | },
32 | "extra": {
33 | "laravel": {
34 | "providers": [
35 | "Superlatif\\NovaTagInput\\FieldServiceProvider"
36 | ]
37 | }
38 | },
39 | "config": {
40 | "sort-packages": true
41 | },
42 | "minimum-stability": "dev",
43 | "prefer-stable": true
44 | }
45 |
--------------------------------------------------------------------------------
/dist/css/field.css:
--------------------------------------------------------------------------------
1 | .nti-tags-wrapper-index{display:flex;flex-wrap:wrap}.nti-tags-wrapper{margin-bottom:-5px}.nti-tags-wrapper .nti-tag{background-color:rgba(var(--colors-primary-500),var(--tw-bg-opacity))!important;border-radius:.2rem!important;color:rgba(var(--colors-white))!important;display:inline-block;font-size:.875rem!important;font-weight:700!important;line-height:1.25rem!important;margin:2px;padding:3px 4px!important}.dark .nti-tags-wrapper .nti-tag{color:rgba(var(--colors-slate-900))!important}.vue-tags-input{background-color:transparent!important;max-width:none!important}.ti-input{--tw-ring-color:rgba(var(--colors-primary-100))!important;--tw-border-opacity:1!important;--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(var(--colors-white),var(--tw-bg-opacity))!important;border-color:rgba(var(--colors-slate-300),var(--tw-border-opacity));border-radius:.25rem!important;border-width:1px!important;box-sizing:border-box!important;color:rgba(var(--colors-slate-600))!important;font-size:.875rem!important;line-height:normal!important;padding-left:.75rem!important;padding-right:.75rem!important}.dark .ti-input,.dark .ti-new-tag-input{--tw-ring-color:rgba(var(--colors-slate-700),var(--tw-ring-opacity))!important;background-color:rgba(var(--colors-slate-900),var(--tw-bg-opacity))!important;border-color:rgba(var(--colors-slate-700),var(--tw-border-opacity))!important;color:rgba(var(--colors-slate-400))!important}.ti-tag{border-radius:.2rem!important;font-size:.875rem!important;font-weight:700!important;line-height:1.25rem!important;padding:3px 4px 3px 7px!important}.ti-tag.ti-valid{background-color:rgba(var(--colors-primary-500),var(--tw-bg-opacity))!important;color:rgba(var(--colors-white))!important}.ti-tag.ti-deletion-mark{background-color:rgba(var(--colors-red-500),var(--tw-bg-opacity))!important}.ti-autocomplete .ti-item.ti-selected-item{background-color:var(--colors-primary-500)!important;color:rgba(var(--colors-white))!important}.dark .ti-autocomplete .ti-item.ti-selected-item,.dark .ti-tag.ti-valid{color:rgba(var(--colors-slate-900))!important}
2 |
--------------------------------------------------------------------------------
/dist/js/field.js:
--------------------------------------------------------------------------------
1 | /*! For license information please see field.js.LICENSE.txt */
2 | (()=>{var t,e={4226:(t,e,r)=>{var n;window,t.exports=(n=r(311),function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist/",r(r.s=7)}([function(t,e){t.exports=n},function(t,e,r){var n=r(9);n.__esModule&&(n=n.default),"string"==typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals),(0,r(5).default)("2847aebd",n,!1,{})},function(t,e,r){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=function(t,e){var r,n=t[1]||"",o=t[3];if(!o)return n;if(e&&"function"==typeof btoa){var i=(r=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),a=o.sources.map((function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"}));return[n].concat(a).concat([i]).join("\n")}return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r})).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},o=0;or.parts.length&&(n.parts.length=r.parts.length)}else{var a=[];for(o=0;odiv[data-v-2fbda277]{cursor:pointer;padding:3px 6px;width:100%}.ti-selected-item[data-v-2fbda277]{background-color:#5C6BC0;color:#fff}\n',"",{version:3,sources:["C:/Users/abcsi/Documents/repos/vue-tags-input/vue-tags-input/vue-tags-input.scss"],names:[],mappings:"AAAA,WAAW,qBAAqB,CAAC,iCAA4C,CAAC,2JAAmM,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,2EAAyC,gCAAgC,CAAC,UAAU,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,aAAa,CAAC,kCAAkC,CAAC,iCAAiC,CAAC,uCAAsB,eAAe,CAAC,uCAAsB,eAAe,CAAC,sCAAqB,eAAe,CAAC,oBAAG,UAAU,CAAC,WAAW,CAAC,oBAAoB,CAAC,sEAAmB,qBAAqB,CAAC,6BAAY,YAAY,CAAC,iCAAgB,4BAA4B,CAAC,iCAAgB,eAAe,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,6CAA4B,WAAW,CAAC,+CAA8B,cAAc,CAAC,2BAAU,qBAAqB,CAAC,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,0BAAS,YAAY,CAAC,cAAc,CAAC,UAAU,CAAC,eAAe,CAAC,yBAAQ,wBAAwB,CAAC,UAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,+BAAc,YAAY,CAAC,qCAAoB,YAAY,CAAC,kBAAkB,CAAC,wCAAuB,iBAAiB,CAAC,8BAAa,iBAAiB,CAAC,wCAAuB,iBAAiB,CAAC,iBAAiB,CAAC,UAAU,CAAC,eAAe,CAAC,qCAAoB,eAAe,CAAC,YAAY,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,uCAAsB,cAAc,CAAC,oCAAmB,gBAAgB,CAAC,qFAAmD,wBAAwB,CAAC,2CAA0B,YAAY,CAAC,aAAa,CAAC,eAAe,CAAC,UAAU,CAAC,eAAe,CAAC,iDAAgC,aAAa,CAAC,eAAe,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,mCAAkB,mBAAmB,CAAC,kCAAiB,qBAAqB,CAAC,eAAe,CAAC,iBAAiB,CAAC,UAAU,CAAC,qBAAqB,CAAC,UAAU,CAAC,8BAAa,cAAc,CAAC,eAAe,CAAC,UAAU,CAAC,mCAAkB,wBAAwB,CAAC,UAAU",file:"vue-tags-input.scss?vue&type=style&index=0&id=2fbda277&lang=scss&scoped=true",sourcesContent:['@font-face{font-family:\'icomoon\';src:url("./assets/fonts/icomoon.eot?7grlse");src:url("./assets/fonts/icomoon.eot?7grlse#iefix") format("embedded-opentype"),url("./assets/fonts/icomoon.ttf?7grlse") format("truetype"),url("./assets/fonts/icomoon.woff?7grlse") format("woff");font-weight:normal;font-style:normal}[class^="ti-icon-"],[class*=" ti-icon-"]{font-family:\'icomoon\' !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ti-icon-check:before{content:"\\e902"}.ti-icon-close:before{content:"\\e901"}.ti-icon-undo:before{content:"\\e900"}ul{margin:0px;padding:0px;list-style-type:none}*,*:before,*:after{box-sizing:border-box}input:focus{outline:none}input[disabled]{background-color:transparent}.vue-tags-input{max-width:450px;position:relative;background-color:#fff}div.vue-tags-input.disabled{opacity:0.5}div.vue-tags-input.disabled *{cursor:default}.ti-input{border:1px solid #ccc;display:flex;padding:4px;flex-wrap:wrap}.ti-tags{display:flex;flex-wrap:wrap;width:100%;line-height:1em}.ti-tag{background-color:#5C6BC0;color:#fff;border-radius:2px;display:flex;padding:3px 5px;margin:2px;font-size:.85em}.ti-tag:focus{outline:none}.ti-tag .ti-content{display:flex;align-items:center}.ti-tag .ti-tag-center{position:relative}.ti-tag span{line-height:.85em}.ti-tag span.ti-hidden{padding-left:14px;visibility:hidden;height:0px;white-space:pre}.ti-tag .ti-actions{margin-left:2px;display:flex;align-items:center;font-size:1.15em}.ti-tag .ti-actions i{cursor:pointer}.ti-tag:last-child{margin-right:4px}.ti-tag.ti-invalid,.ti-tag.ti-tag.ti-deletion-mark{background-color:#e54d42}.ti-new-tag-input-wrapper{display:flex;flex:1 0 auto;padding:3px 5px;margin:2px;font-size:.85em}.ti-new-tag-input-wrapper input{flex:1 0 auto;min-width:100px;border:none;padding:0px;margin:0px}.ti-new-tag-input{line-height:initial}.ti-autocomplete{border:1px solid #ccc;border-top:none;position:absolute;width:100%;background-color:#fff;z-index:20}.ti-item>div{cursor:pointer;padding:3px 6px;width:100%}.ti-selected-item{background-color:#5C6BC0;color:#fff}\n']}])},function(t,e,r){"use strict";t.exports=function(t,e){return"string"!=typeof t?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),/["'() \t\n]/.test(t)||e?'"'+t.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':t)}},function(t,e){t.exports="data:font/ttf;base64,AAEAAAALAIAAAwAwT1MvMg8SBawAAAC8AAAAYGNtYXAXVtKJAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZqWfozAAAAF4AAAA/GhlYWQPxZgIAAACdAAAADZoaGVhB4ADyAAAAqwAAAAkaG10eBIAAb4AAALQAAAAHGxvY2EAkgDiAAAC7AAAABBtYXhwAAkAHwAAAvwAAAAgbmFtZZlKCfsAAAMcAAABhnBvc3QAAwAAAAAEpAAAACAAAwOAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpAgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6QL//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAFYBAQO+AoEAHAAAATIXHgEXFhcHJicuAScmIyIGBxchERc2Nz4BNzYCFkpDQ28pKRdkECAfVTM0OT9wLZz+gJgdIiJLKSgCVRcYUjg5QiAzKys+ERIrJZoBgJoZFRQcCAgAAQDWAIEDKgLVAAsAAAEHFwcnByc3JzcXNwMq7u487u487u487u4Cme7uPO7uPO7uPO7uAAEAkgCBA4ACvQAFAAAlARcBJzcBgAHEPP4A7jz5AcQ8/gDuPAAAAAABAAAAAAAAH8nTUV8PPPUACwQAAAAAANZ1KhsAAAAA1nUqGwAAAAADvgLVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAO+AAEAAAAAAAAAAAAAAAAAAAAHBAAAAAAAAAAAAAAAAgAAAAQAAFYEAADWBAAAkgAAAAAACgAUAB4AUABqAH4AAQAAAAcAHQABAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="},function(t,e){t.exports="data:font/woff;base64,d09GRgABAAAAAAUQAAsAAAAABMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIFrGNtYXAAAAFoAAAAVAAAAFQXVtKJZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAPwAAAD8pZ+jMGhlYWQAAALAAAAANgAAADYPxZgIaGhlYQAAAvgAAAAkAAAAJAeAA8hobXR4AAADHAAAABwAAAAcEgABvmxvY2EAAAM4AAAAEAAAABAAkgDibWF4cAAAA0gAAAAgAAAAIAAJAB9uYW1lAAADaAAAAYYAAAGGmUoJ+3Bvc3QAAATwAAAAIAAAACAAAwAAAAMDgAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QIDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkC//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQBWAQEDvgKBABwAAAEyFx4BFxYXByYnLgEnJiMiBgcXIREXNjc+ATc2AhZKQ0NvKSkXZBAgH1UzNDk/cC2c/oCYHSIiSykoAlUXGFI4OUIgMysrPhESKyWaAYCaGRUUHAgIAAEA1gCBAyoC1QALAAABBxcHJwcnNyc3FzcDKu7uPO7uPO7uPO7uApnu7jzu7jzu7jzu7gABAJIAgQOAAr0ABQAAJQEXASc3AYABxDz+AO48+QHEPP4A7jwAAAAAAQAAAAAAAB/J01FfDzz1AAsEAAAAAADWdSobAAAAANZ1KhsAAAAAA74C1QAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADvgABAAAAAAAAAAAAAAAAAAAABwQAAAAAAAAAAAAAAAIAAAAEAABWBAAA1gQAAJIAAAAAAAoAFAAeAFAAagB+AAEAAAAHAB0AAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAHAAAAAQAAAAAAAgAHAGAAAQAAAAAAAwAHADYAAQAAAAAABAAHAHUAAQAAAAAABQALABUAAQAAAAAABgAHAEsAAQAAAAAACgAaAIoAAwABBAkAAQAOAAcAAwABBAkAAgAOAGcAAwABBAkAAwAOAD0AAwABBAkABAAOAHwAAwABBAkABQAWACAAAwABBAkABgAOAFIAAwABBAkACgA0AKRpY29tb29uAGkAYwBvAG0AbwBvAG5WZXJzaW9uIDEuMABWAGUAcgBzAGkAbwBuACAAMQAuADBpY29tb29uAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG5SZWd1bGFyAFIAZQBnAHUAbABhAHJpY29tb29uAGkAYwBvAG0AbwBvAG5Gb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},function(t,e,r){"use strict";r.r(e),r.d(e,"VueTagsInput",(function(){return k})),r.d(e,"createClasses",(function(){return v})),r.d(e,"createTag",(function(){return m})),r.d(e,"createTags",(function(){return b})),r.d(e,"TagInput",(function(){return O}));var n=r(0),o=Object(n.withScopeId)("data-v-2fbda277");Object(n.pushScopeId)("data-v-2fbda277");var i={class:"ti-input"},a={key:0,class:"ti-tags"},s={class:"ti-content"},c={key:0,class:"ti-tag-left"},u={key:1,class:"ti-tag-right"},l={class:"ti-actions"},A={class:"ti-new-tag-input-wrapper"};Object(n.popScopeId)();var f=o((function(t,e,r,o,f,p){var d=Object(n.resolveComponent)("tag-input");return Object(n.openBlock)(),Object(n.createBlock)("div",{class:["vue-tags-input",[{"ti-disabled":t.disabled},{"ti-focus":t.focused},t.$attrs.class]],style:t.$attrs.style},[Object(n.createVNode)("div",i,[t.tagsCopy?(Object(n.openBlock)(),Object(n.createBlock)("ul",a,[(Object(n.openBlock)(!0),Object(n.createBlock)(n.Fragment,null,Object(n.renderList)(t.tagsCopy,(function(e,r){return Object(n.openBlock)(),Object(n.createBlock)("li",{key:r,style:e.style,class:[[{"ti-editing":t.tagsEditStatus[r]},e.tiClasses,e.classes,{"ti-deletion-mark":t.isMarked(r)}],"ti-tag"],tabindex:"0",onClick:function(n){return t.$emit("tag-clicked",{tag:e,index:r})}},[Object(n.createVNode)("div",s,[t.$slots["tag-left"]?(Object(n.openBlock)(),Object(n.createBlock)("div",c,[Object(n.renderSlot)(t.$slots,"tag-left",{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)},void 0,!0)])):Object(n.createCommentVNode)("v-if",!0),Object(n.createVNode)("div",{ref:t.setTagCenter,class:"ti-tag-center"},[t.$slots["tag-center"]?Object(n.createCommentVNode)("v-if",!0):(Object(n.openBlock)(),Object(n.createBlock)("span",{key:0,class:{"ti-hidden":t.tagsEditStatus[r]},onClick:function(e){return t.performEditTag(r)}},Object(n.toDisplayString)(e.text),11,["onClick"])),t.$slots["tag-center"]?Object(n.createCommentVNode)("v-if",!0):(Object(n.openBlock)(),Object(n.createBlock)(d,{key:1,scope:{edit:t.tagsEditStatus[r],maxlength:t.maxlength,tag:e,index:r,validateTag:t.createChangedTag,performCancelEdit:t.cancelEdit,performSaveEdit:t.performSaveTag}},null,8,["scope"])),Object(n.renderSlot)(t.$slots,"tag-center",{tag:e,index:r,maxlength:t.maxlength,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,validateTag:t.createChangedTag,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)},void 0,!0)],512),t.$slots["tag-right"]?(Object(n.openBlock)(),Object(n.createBlock)("div",u,[Object(n.renderSlot)(t.$slots,"tag-right",{tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)},void 0,!0)])):Object(n.createCommentVNode)("v-if",!0)]),Object(n.createVNode)("div",l,[Object(n.createCommentVNode)(" dont use v-if and v-else here -> different event calling on click?! "),t.$slots["tag-actions"]?Object(n.createCommentVNode)("v-if",!0):Object(n.withDirectives)((Object(n.openBlock)(),Object(n.createBlock)("i",{key:0,class:"ti-icon-undo",onClick:function(e){return t.cancelEdit(r)}},null,8,["onClick"])),[[n.vShow,t.tagsEditStatus[r]]]),t.$slots["tag-actions"]?Object(n.createCommentVNode)("v-if",!0):Object(n.withDirectives)((Object(n.openBlock)(),Object(n.createBlock)("i",{key:1,class:"ti-icon-close",onClick:function(e){return t.performDeleteTag(r)}},null,8,["onClick"])),[[n.vShow,!t.tagsEditStatus[r]]]),t.$slots["tag-actions"]?Object(n.renderSlot)(t.$slots,"tag-actions",{key:2,tag:e,index:r,edit:t.tagsEditStatus[r],performSaveEdit:t.performSaveTag,performDelete:t.performDeleteTag,performCancelEdit:t.cancelEdit,performOpenEdit:t.performEditTag,deletionMark:t.isMarked(r)},void 0,!0):Object(n.createCommentVNode)("v-if",!0)])],14,["onClick"])})),128)),Object(n.createVNode)("li",A,[Object(n.createVNode)("input",Object(n.mergeProps)({ref:"newTagInput"},t.$attrs,{class:[[t.createClasses(t.newTag,t.tags,t.validation,t.isDuplicate)],"ti-new-tag-input"],placeholder:t.placeholder,value:t.newTag,maxlength:t.maxlength,disabled:t.disabled,type:"text",size:"1",onKeydown:[e[1]||(e[1]=function(e){return t.performAddTags(t.filteredAutocompleteItems[t.selectedItem]||t.newTag,e)}),e[3]||(e[3]=Object(n.withKeys)((function(){return t.invokeDelete&&t.invokeDelete.apply(t,arguments)}),["delete"])),e[4]||(e[4]=Object(n.withKeys)((function(){return t.performBlur&&t.performBlur.apply(t,arguments)}),["tab"])),e[5]||(e[5]=Object(n.withKeys)((function(e){return t.selectItem(e,"before")}),["up"])),e[6]||(e[6]=Object(n.withKeys)((function(e){return t.selectItem(e,"after")}),["down"]))],onPaste:e[2]||(e[2]=function(){return t.addTagsFromPaste&&t.addTagsFromPaste.apply(t,arguments)}),onInput:e[7]||(e[7]=function(){return t.updateNewTag&&t.updateNewTag.apply(t,arguments)}),onFocus:e[8]||(e[8]=function(e){return t.focused=!0}),onClick:e[9]||(e[9]=function(e){return!t.addOnlyFromAutocomplete&&(t.selectedItem=null)})}),null,16,["placeholder","value","maxlength","disabled"])])])):Object(n.createCommentVNode)("v-if",!0)]),Object(n.renderSlot)(t.$slots,"between-elements",{},void 0,!0),t.autocompleteOpen?(Object(n.openBlock)(),Object(n.createBlock)("div",{key:0,class:"ti-autocomplete",onMouseout:e[10]||(e[10]=function(e){return t.selectedItem=null})},[Object(n.renderSlot)(t.$slots,"autocomplete-header",{},void 0,!0),Object(n.createVNode)("ul",null,[(Object(n.openBlock)(!0),Object(n.createBlock)(n.Fragment,null,Object(n.renderList)(t.filteredAutocompleteItems,(function(e,r){return Object(n.openBlock)(),Object(n.createBlock)("li",{key:r,style:e.style,class:[[e.tiClasses,e.classes,{"ti-selected-item":t.isSelected(r)}],"ti-item"],onMouseover:function(e){return!t.disabled&&(t.selectedItem=r)}},[t.$slots["autocomplete-item"]?Object(n.renderSlot)(t.$slots,"autocomplete-item",{key:1,item:e,index:r,performAdd:function(e){return t.performAddTags(e,void 0,"autocomplete")},selected:t.isSelected(r)},void 0,!0):(Object(n.openBlock)(),Object(n.createBlock)("div",{key:0,onClick:function(r){return t.performAddTags(e,void 0,"autocomplete")}},Object(n.toDisplayString)(e.text),9,["onClick"]))],46,["onMouseover"])})),128))]),Object(n.renderSlot)(t.$slots,"autocomplete-footer",{},void 0,!0)],32)):Object(n.createCommentVNode)("v-if",!0)],6)})),p=r(6),d=r.n(p),h=function(t,e){return e.filter((function(e){var r=t.text;return"string"==typeof e.rule?!new RegExp(e.rule).test(r):e.rule instanceof RegExp?!e.rule.test(r):"[object Function]"==={}.toString.call(e.rule)?e.rule(t):void 0})).map((function(t){return t.classes}))},y=function(t){return JSON.parse(JSON.stringify(t))},g=function(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0;void 0===t.text&&(t={text:t});var o=h(t,r),i=g(e,(function(e){return e===t})),a=y(e),s=-1!==i?a.splice(i,1)[0]:y(t),c=n?n(a,s):-1!==a.map((function(t){return t.text})).indexOf(s.text);return c&&o.push("ti-duplicate"),0===o.length?o.push("ti-valid"):o.push("ti-invalid"),o},m=function(t){void 0===t.text&&(t={text:t});for(var e=y(t),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o1?e-1:0),n=1;n=this.autocompleteMinLength&&this.filteredAutocompleteItems.length>0&&this.focused},filteredAutocompleteItems:function(){var t=this,e=this.autocompleteItems.map((function(e){return m(e,t.tags,t.validation,t.isDuplicate)}));return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:v,getSelectedIndex:function(t){var e=this.filteredAutocompleteItems,r=this.selectedItem,n=e.length-1;if(0!==e.length)return null===r?0:"before"===t&&0===r?n:"after"===t&&r===n?0:"after"===t?r+1:r-1},selectDefaultItem:function(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem:function(t,e){t.preventDefault(),this.selectedItem=this.getSelectedIndex(e)},isSelected:function(t){return this.selectedItem===t},isMarked:function(t){return this.deletionMark===t},setTagCenter:function(t){t&&this.tagCenter.push(t)},invokeDelete:function(){var t=this;if(this.deleteOnBackspace&&!(this.newTag.length>0)){var e=this.tagsCopy.length-1;null===this.deletionMark?(this.deletionMarkTime=setTimeout((function(){return t.deletionMark=null}),1e3),this.deletionMark=e):this.performDeleteTag(e)}},addTagsFromPaste:function(){var t=this;this.addFromPaste&&setTimeout((function(){return t.performAddTags(t.newTag)}),10)},performEditTag:function(t){var e=this;this.allowEditTags&&(this.onBeforeAddingTag||this.editTag(t),this.$emit("before-editing-tag",{index:t,tag:this.tagsCopy[t],editTag:function(){return e.editTag(t)}}))},editTag:function(t){this.allowEditTags&&(this.toggleEditMode(t),this.focus(t))},toggleEditMode:function(t){this.allowEditTags&&!this.disabled&&(this.tagsEditStatus[t]=!this.tagsEditStatus[t])},createChangedTag:function(t,e){var r=this.tagsCopy[t];r.text=e?e.target.value:this.tagsCopy[t].text,this.tagsCopy[t]=m(r,this.tagsCopy,this.validation,this.isDuplicate)},focus:function(t){var e=this;this.$nextTick((function(){var r=e.tagCenter[t].querySelector("input.ti-tag-input");r&&r.focus()}))},quote:function(t){return t.replace(/([()[{*+.$^\\|?])/g,"\\$1")},cancelEdit:function(t){this.tags[t]&&(this.tagsCopy[t]=y(m(this.tags[t],this.tags,this.validation,this.isDuplicate)),this.tagsEditStatus[t]=!1)},hasForbiddingAddRule:function(t){var e=this;return t.some((function(t){var r=e.validation.find((function(e){return t===e.classes}));return!!r&&r.disableAdd}))},createTagTexts:function(t){var e=this,r=new RegExp(this.separators.map((function(t){return e.quote(t)})).join("|"));return t.split(r).map((function(t){return{text:t}}))},performDeleteTag:function(t){var e=this;this.onBeforeDeletingTag||this.deleteTag(t),this.$emit("before-deleting-tag",{index:t,tag:this.tagsCopy[t],deleteTag:function(){return e.deleteTag(t)}})},deleteTag:function(t){this.disabled||(this.deletionMark=null,clearTimeout(this.deletionMarkTime),this.tagsCopy.splice(t,1),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},noTriggerKey:function(t,e){var r=-1!==this[e].indexOf(t.keyCode)||-1!==this[e].indexOf(t.key);return r&&t.preventDefault(),!r},performAddTags:function(t,e,r){var n=this;if(!(this.disabled||e&&this.noTriggerKey(e,"addOnKey"))){var o=[];"object"===E(t)&&(o=[t]),"string"==typeof t&&(o=this.createTagTexts(t)),(o=o.filter((function(t){return t.text.trim().length>0}))).forEach((function(t){t=m(t,n.tags,n.validation,n.isDuplicate),n.onBeforeAddingTag||n.addTag(t,r),n.$emit("before-adding-tag",{tag:t,addTag:function(){return n.addTag(t,r)}})}))}},duplicateFilter:function(t){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,t):!this.tagsCopy.find((function(e){return e.text===t.text}))},addTag:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"new-tag-input",n=this.filteredAutocompleteItems.map((function(t){return t.text}));this.addOnlyFromAutocomplete&&-1===n.indexOf(t.text)||this.$nextTick((function(){return e.maxTags&&e.maxTags<=e.tagsCopy.length?e.$emit("max-tags-reached",t):e.avoidAddingDuplicates&&!e.duplicateFilter(t)?e.$emit("adding-duplicate",t):void(e.hasForbiddingAddRule(t.tiClasses)||(e.newTag="",e.tagsCopy.push(t),e.$emit("update:tags",e.tagsCopy),"autocomplete"===r&&e.$refs.newTagInput.focus(),e.$emit("tags-changed",e.tagsCopy)))}))},performSaveTag:function(t,e){var r=this,n=this.tagsCopy[t];this.disabled||e&&this.noTriggerKey(e,"addOnKey")||0!==n.text.trim().length&&(this["on-before-saving-tag"]||this.saveTag(t,n),this.$emit("before-saving-tag",{index:t,tag:n,saveTag:function(){return r.saveTag(t,n)}}))},saveTag:function(t,e){if(this.avoidAddingDuplicates){var r=y(this.tagsCopy),n=r.splice(t,1)[0];if(this.isDuplicate?this.isDuplicate(r,n):-1!==r.map((function(t){return t.text})).indexOf(n.text))return this.$emit("saving-duplicate",e)}this.hasForbiddingAddRule(e.tiClasses)||(this.tagsCopy[t]=e,this.toggleEditMode(t),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual:function(){var t=this;return!this.tagsCopy.some((function(e,r){return!d()(e,t.tags[r])}))},updateNewTag:function(t){var e=t.target.value;this.newTag=e,this.$emit("update:modelValue",e)},initTags:function(){this.tagsCopy=b(this.tags,this.validation,this.isDuplicate),this.tagsEditStatus=y(this.tags).map((function(){return!1})),this.tagsEqual()||this.$emit("update:tags",this.tagsCopy)},blurredOnClick:function(t){this.$el.contains(t.target)||this.$el.contains(document.activeElement)||this.performBlur(t)},performBlur:function(){this.addOnBlur&&this.focused&&this.performAddTags(this.newTag),this.focused=!1}},watch:{modelValue:function(t){this.addOnlyFromAutocomplete||(this.selectedItem=null),this.newTag=t},tags:{handler:function(){this.initTags()},deep:!0},autocompleteOpen:"selectDefaultItem"},created:function(){this.newTag=this.modelValue,this.initTags()},mounted:function(){this.selectDefaultItem(),document.addEventListener("click",this.blurredOnClick)},beforeUpdate:function(){this.tagCenter=[]},unmounted:function(){document.removeEventListener("click",this.blurredOnClick)}};r(10),B.render=f,B.__scopeId="data-v-2fbda277";var k=B;k.install=function(t){return t.component(k.name,k)},"undefined"!=typeof window&&window.Vue&&window.Vue.use(k),e.default=k}]))},5757:(t,e,r)=>{Nova.booting((function(t){window.Vue.use=t.use,t.component("index-nova-tag-input",r(9712).Z),t.component("detail-nova-tag-input",r(4525).Z),t.component("form-nova-tag-input",r(1174).Z)}))},9129:()=>{},3744:(t,e)=>{"use strict";e.Z=(t,e)=>{const r=t.__vccOpts||t;for(const[t,n]of e)r[t]=n;return r}},4525:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n,o=r(311);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const c={data:function(){return{tags:"",fieldLabel:{},tagsWrapperClass:"nti-tags-wrapper",tagClass:"nti-tag"}},props:["index","resource","resourceName","resourceId","field"],mounted:function(){n=this,this.fieldLabel=function(t){for(var e=1;e'+r+""})),this.fieldLabel.value=''+this.tags+"
",this.fieldLabel.asHtml=!0):this.fieldLabel.value="—"}};const u=(0,r(3744).Z)(c,[["render",function(t,e,r,n,i,a){var s=(0,o.resolveComponent)("panel-item");return(0,o.openBlock)(),(0,o.createBlock)(s,{index:r.index,field:i.fieldLabel},null,8,["index","field"])}]])},1174:(t,e,r)=>{"use strict";r.d(e,{Z:()=>yt});var n=r(311);var o=r(2608),i=r.n(o),a={preventInitialLoading:{type:Boolean,default:!1},showHelpText:{type:Boolean,default:!1},shownViaNewRelationModal:{type:Boolean,default:!1},resourceId:{type:[Number,String]},resourceName:{type:String},relatedResourceId:{type:[Number,String]},relatedResourceName:{type:String},field:{type:Object,required:!0},viaResource:{type:String,required:!1},viaResourceId:{type:[String,Number],required:!1},viaRelationship:{type:String,required:!1},relationshipType:{type:String,default:""},shouldOverrideMeta:{type:Boolean,default:!1},disablePagination:{type:Boolean,default:!1},clickAction:{type:String,default:"view",validator:function(t){return["edit","select","ignore","detail"].includes(t)}},mode:{type:String,default:"form",validator:function(t){return["form","modal"].includes(t)}}};function s(t){return i()(a,t)}function c(){return"undefined"!=typeof navigator&&"undefined"!=typeof window?window:void 0!==r.g?r.g:{}}const u="function"==typeof Proxy;let l,A;function f(){return void 0!==l||("undefined"!=typeof window&&window.performance?(l=!0,A=window.performance):void 0!==r.g&&(null===(t=r.g.perf_hooks)||void 0===t?void 0:t.performance)?(l=!0,A=r.g.perf_hooks.performance):l=!1),l?A.now():Date.now();var t}class p{constructor(t,e){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=e;const r={};if(t.settings)for(const e in t.settings){const n=t.settings[e];r[e]=n.defaultValue}const n=`__vue-devtools-plugin-settings__${t.id}`;let o=Object.assign({},r);try{const t=localStorage.getItem(n),e=JSON.parse(t);Object.assign(o,e)}catch(t){}this.fallbacks={getSettings:()=>o,setSettings(t){try{localStorage.setItem(n,JSON.stringify(t))}catch(t){}o=t},now:()=>f()},e&&e.on("plugin:settings:set",((t,e)=>{t===this.plugin.id&&this.fallbacks.setSettings(e)})),this.proxiedOn=new Proxy({},{get:(t,e)=>this.target?this.target.on[e]:(...t)=>{this.onQueue.push({method:e,args:t})}}),this.proxiedTarget=new Proxy({},{get:(t,e)=>this.target?this.target[e]:"on"===e?this.proxiedOn:Object.keys(this.fallbacks).includes(e)?(...t)=>(this.targetQueue.push({method:e,args:t,resolve:()=>{}}),this.fallbacks[e](...t)):(...t)=>new Promise((r=>{this.targetQueue.push({method:e,args:t,resolve:r})}))})}async setRealTarget(t){this.target=t;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function d(t,e){const r=t,n=c(),o=c().__VUE_DEVTOOLS_GLOBAL_HOOK__,i=u&&r.enableEarlyProxy;if(!o||!n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__&&i){const t=i?new p(r,o):null;(n.__VUE_DEVTOOLS_PLUGINS__=n.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r,setupFn:e,proxy:t}),t&&e(t.proxiedTarget)}else o.emit("devtools-plugin:setup",t,e)}var h="store";function y(t,e){Object.keys(t).forEach((function(r){return e(t[r],r)}))}function g(t){return null!==t&&"object"==typeof t}function v(t,e,r){return e.indexOf(t)<0&&(r&&r.prepend?e.unshift(t):e.push(t)),function(){var r=e.indexOf(t);r>-1&&e.splice(r,1)}}function m(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var r=t.state;w(t,r,[],t._modules.root,!0),b(t,r,e)}function b(t,e,r){var o=t._state;t.getters={},t._makeLocalGettersCache=Object.create(null);var i=t._wrappedGetters,a={};y(i,(function(e,r){a[r]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,r,{get:function(){return a[r]()},enumerable:!0})})),t._state=(0,n.reactive)({data:e}),t.strict&&function(t){(0,n.watch)((function(){return t._state.data}),(function(){0}),{deep:!0,flush:"sync"})}(t),o&&r&&t._withCommit((function(){o.data=null}))}function w(t,e,r,n,o){var i=!r.length,a=t._modules.getNamespace(r);if(n.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=n),!i&&!o){var s=O(e,r.slice(0,-1)),c=r[r.length-1];t._withCommit((function(){s[c]=n.state}))}var u=n.context=function(t,e,r){var n=""===e,o={dispatch:n?t.dispatch:function(r,n,o){var i=j(r,n,o),a=i.payload,s=i.options,c=i.type;return s&&s.root||(c=e+c),t.dispatch(c,a)},commit:n?t.commit:function(r,n,o){var i=j(r,n,o),a=i.payload,s=i.options,c=i.type;s&&s.root||(c=e+c),t.commit(c,a,s)}};return Object.defineProperties(o,{getters:{get:n?function(){return t.getters}:function(){return x(t,e)}},state:{get:function(){return O(t.state,r)}}}),o}(t,a,r);n.forEachMutation((function(e,r){!function(t,e,r,n){(t._mutations[e]||(t._mutations[e]=[])).push((function(e){r.call(t,n.state,e)}))}(t,a+r,e,u)})),n.forEachAction((function(e,r){var n=e.root?r:a+r,o=e.handler||e;!function(t,e,r,n){(t._actions[e]||(t._actions[e]=[])).push((function(e){var o,i=r.call(t,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:t.getters,rootState:t.state},e);return(o=i)&&"function"==typeof o.then||(i=Promise.resolve(i)),t._devtoolHook?i.catch((function(e){throw t._devtoolHook.emit("vuex:error",e),e})):i}))}(t,n,o,u)})),n.forEachGetter((function(e,r){!function(t,e,r,n){if(t._wrappedGetters[e])return void 0;t._wrappedGetters[e]=function(t){return r(n.state,n.getters,t.state,t.getters)}}(t,a+r,e,u)})),n.forEachChild((function(n,i){w(t,e,r.concat(i),n,o)}))}function x(t,e){if(!t._makeLocalGettersCache[e]){var r={},n=e.length;Object.keys(t.getters).forEach((function(o){if(o.slice(0,n)===e){var i=o.slice(n);Object.defineProperty(r,i,{get:function(){return t.getters[o]},enumerable:!0})}})),t._makeLocalGettersCache[e]=r}return t._makeLocalGettersCache[e]}function O(t,e){return e.reduce((function(t,e){return t[e]}),t)}function j(t,e,r){return g(t)&&t.type&&(r=e,e=t,t=t.type),{type:t,payload:e,options:r}}var C="vuex:mutations",S="vuex:actions",E="vuex",B=0;function k(t,e){d({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:["vuex bindings"]},(function(r){r.addTimelineLayer({id:C,label:"Vuex Mutations",color:_}),r.addTimelineLayer({id:S,label:"Vuex Actions",color:_}),r.addInspector({id:E,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),r.on.getInspectorTree((function(r){if(r.app===t&&r.inspectorId===E)if(r.filter){var n=[];D(n,e._modules.root,r.filter,""),r.rootNodes=n}else r.rootNodes=[I(e._modules.root,"")]})),r.on.getInspectorState((function(r){if(r.app===t&&r.inspectorId===E){var n=r.nodeId;x(e,n),r.state=function(t,e,r){e="root"===r?e:e[r];var n=Object.keys(e),o={state:Object.keys(t.state).map((function(e){return{key:e,editable:!0,value:t.state[e]}}))};if(n.length){var i=function(t){var e={};return Object.keys(t).forEach((function(r){var n=r.split("/");if(n.length>1){var o=e,i=n.pop();n.forEach((function(t){o[t]||(o[t]={_custom:{value:{},display:t,tooltip:"Module",abstract:!0}}),o=o[t]._custom.value})),o[i]=F((function(){return t[r]}))}else e[r]=F((function(){return t[r]}))})),e}(e);o.getters=Object.keys(i).map((function(t){return{key:t.endsWith("/")?T(t):t,editable:!1,value:F((function(){return i[t]}))}}))}return o}((o=e._modules,(a=(i=n).split("/").filter((function(t){return t}))).reduce((function(t,e,r){var n=t[e];if(!n)throw new Error('Missing module "'+e+'" for path "'+i+'".');return r===a.length-1?n:n._children}),"root"===i?o:o.root._children)),"root"===n?e.getters:e._makeLocalGettersCache,n)}var o,i,a})),r.on.editInspectorState((function(r){if(r.app===t&&r.inspectorId===E){var n=r.nodeId,o=r.path;"root"!==n&&(o=n.split("/").filter(Boolean).concat(o)),e._withCommit((function(){r.set(e._state.data,o,r.state.value)}))}})),e.subscribe((function(t,e){var n={};t.payload&&(n.payload=t.payload),n.state=e,r.notifyComponentUpdate(),r.sendInspectorTree(E),r.sendInspectorState(E),r.addTimelineEvent({layerId:C,event:{time:Date.now(),title:t.type,data:n}})})),e.subscribeAction({before:function(t,e){var n={};t.payload&&(n.payload=t.payload),t._id=B++,t._time=Date.now(),n.state=e,r.addTimelineEvent({layerId:S,event:{time:t._time,title:t.type,groupId:t._id,subtitle:"start",data:n}})},after:function(t,e){var n={},o=Date.now()-t._time;n.duration={_custom:{type:"duration",display:o+"ms",tooltip:"Action duration",value:o}},t.payload&&(n.payload=t.payload),n.state=e,r.addTimelineEvent({layerId:S,event:{time:Date.now(),title:t.type,groupId:t._id,subtitle:"end",data:n}})}})}))}var _=8702998,P={label:"namespaced",textColor:16777215,backgroundColor:6710886};function T(t){return t&&"root"!==t?t.split("/").slice(-2,-1)[0]:"Root"}function I(t,e){return{id:e||"root",label:T(e),tags:t.namespaced?[P]:[],children:Object.keys(t._children).map((function(r){return I(t._children[r],e+r+"/")}))}}function D(t,e,r,n){n.includes(r)&&t.push({id:n||"root",label:n.endsWith("/")?n.slice(0,n.length-1):n||"Root",tags:e.namespaced?[P]:[]}),Object.keys(e._children).forEach((function(o){D(t,e._children[o],r,n+o+"/")}))}function F(t){try{return t()}catch(t){return t}}var N=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=("function"==typeof r?r():r)||{}},M={namespaced:{configurable:!0}};M.namespaced.get=function(){return!!this._rawModule.namespaced},N.prototype.addChild=function(t,e){this._children[t]=e},N.prototype.removeChild=function(t){delete this._children[t]},N.prototype.getChild=function(t){return this._children[t]},N.prototype.hasChild=function(t){return t in this._children},N.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},N.prototype.forEachChild=function(t){y(this._children,t)},N.prototype.forEachGetter=function(t){this._rawModule.getters&&y(this._rawModule.getters,t)},N.prototype.forEachAction=function(t){this._rawModule.actions&&y(this._rawModule.actions,t)},N.prototype.forEachMutation=function(t){this._rawModule.mutations&&y(this._rawModule.mutations,t)},Object.defineProperties(N.prototype,M);var R=function(t){this.register([],t,!1)};function U(t,e,r){if(e.update(r),r.modules)for(var n in r.modules){if(!e.getChild(n))return void 0;U(t.concat(n),e.getChild(n),r.modules[n])}}R.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},R.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,r){return t+((e=e.getChild(r)).namespaced?r+"/":"")}),"")},R.prototype.update=function(t){U([],this.root,t)},R.prototype.register=function(t,e,r){var n=this;void 0===r&&(r=!0);var o=new N(e,r);0===t.length?this.root=o:this.get(t.slice(0,-1)).addChild(t[t.length-1],o);e.modules&&y(e.modules,(function(e,o){n.register(t.concat(o),e,r)}))},R.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),r=t[t.length-1],n=e.getChild(r);n&&n.runtime&&e.removeChild(r)},R.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),r=t[t.length-1];return!!e&&e.hasChild(r)};var L=function(t){var e=this;void 0===t&&(t={});var r=t.plugins;void 0===r&&(r=[]);var n=t.strict;void 0===n&&(n=!1);var o=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new R(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._devtools=o;var i=this,a=this.dispatch,s=this.commit;this.dispatch=function(t,e){return a.call(i,t,e)},this.commit=function(t,e,r){return s.call(i,t,e,r)},this.strict=n;var c=this._modules.root.state;w(this,c,[],this._modules.root),b(this,c),r.forEach((function(t){return t(e)}))},Q={state:{configurable:!0}};L.prototype.install=function(t,e){t.provide(e||h,this),t.config.globalProperties.$store=this,void 0!==this._devtools&&this._devtools&&k(t,this)},Q.state.get=function(){return this._state.data},Q.state.set=function(t){0},L.prototype.commit=function(t,e,r){var n=this,o=j(t,e,r),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),c=this._mutations[i];c&&(this._withCommit((function(){c.forEach((function(t){t(a)}))})),this._subscribers.slice().forEach((function(t){return t(s,n.state)})))},L.prototype.dispatch=function(t,e){var r=this,n=j(t,e),o=n.type,i=n.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.slice().filter((function(t){return t.before})).forEach((function(t){return t.before(a,r.state)}))}catch(t){0}var c=s.length>1?Promise.all(s.map((function(t){return t(i)}))):s[0](i);return new Promise((function(t,e){c.then((function(e){try{r._actionSubscribers.filter((function(t){return t.after})).forEach((function(t){return t.after(a,r.state)}))}catch(t){0}t(e)}),(function(t){try{r._actionSubscribers.filter((function(t){return t.error})).forEach((function(e){return e.error(a,r.state,t)}))}catch(t){0}e(t)}))}))}},L.prototype.subscribe=function(t,e){return v(t,this._subscribers,e)},L.prototype.subscribeAction=function(t,e){return v("function"==typeof t?{before:t}:t,this._actionSubscribers,e)},L.prototype.watch=function(t,e,r){var o=this;return(0,n.watch)((function(){return t(o.state,o.getters)}),e,Object.assign({},r))},L.prototype.replaceState=function(t){var e=this;this._withCommit((function(){e._state.data=t}))},L.prototype.registerModule=function(t,e,r){void 0===r&&(r={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),w(this,this.state,t,this._modules.get(t),r.preserveState),b(this,this.state)},L.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit((function(){delete O(e.state,t.slice(0,-1))[t[t.length-1]]})),m(this)},L.prototype.hasModule=function(t){return"string"==typeof t&&(t=[t]),this._modules.isRegistered(t)},L.prototype.hotUpdate=function(t){this._modules.update(t),m(this,!0)},L.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(L.prototype,Q);$((function(t,e){var r={};return W(e).forEach((function(e){var n=e.key,o=e.val;r[n]=function(){var e=this.$store.state,r=this.$store.getters;if(t){var n=z(this.$store,"mapState",t);if(!n)return;e=n.context.state,r=n.context.getters}return"function"==typeof o?o.call(this,e,r):e[o]},r[n].vuex=!0})),r}));var V=$((function(t,e){var r={};return W(e).forEach((function(e){var n=e.key,o=e.val;r[n]=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=this.$store.commit;if(t){var i=z(this.$store,"mapMutations",t);if(!i)return;n=i.context.commit}return"function"==typeof o?o.apply(this,[n].concat(e)):n.apply(this.$store,[o].concat(e))}})),r})),G=$((function(t,e){var r={};return W(e).forEach((function(e){var n=e.key,o=e.val;o=t+o,r[n]=function(){if(!t||z(this.$store,"mapGetters",t))return this.$store.getters[o]},r[n].vuex=!0})),r}));$((function(t,e){var r={};return W(e).forEach((function(e){var n=e.key,o=e.val;r[n]=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=this.$store.dispatch;if(t){var i=z(this.$store,"mapActions",t);if(!i)return;n=i.context.dispatch}return"function"==typeof o?o.apply(this,[n].concat(e)):n.apply(this.$store,[o].concat(e))}})),r}));function W(t){return function(t){return Array.isArray(t)||g(t)}(t)?Array.isArray(t)?t.map((function(t){return{key:t,val:t}})):Object.keys(t).map((function(e){return{key:e,val:t[e]}})):[]}function $(t){return function(e,r){return"string"!=typeof e?(r=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,r)}}function z(t,e,r){return t._modulesNamespaceMap[r]}var H=r(763);function q(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Y(t){for(var e=1;e{"use strict";r.d(e,{Z:()=>c});var n,o=r(311),i=["innerHTML"];function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}const s={data:function(){return{tags:"",fieldLabel:this.field.value||this.field.displayedAs||"—",tagsWrapperClass:"nti-tags-wrapper nti-tags-wrapper-index",tagClass:"nti-tag"}},props:["resourceName","field"],mounted:function(){n=this;var t=this.fieldLabel;t instanceof Array&&t.length&&(t.forEach((function(t,e){var r="object"===a(t)&&t.hasOwnProperty("text")?t.text:t;n.tags+=''+r+""})),this.fieldLabel=''+n.tags+"
")}};const c=(0,r(3744).Z)(s,[["render",function(t,e,r,n,a,s){return(0,o.openBlock)(),(0,o.createElementBlock)("div",{innerHTML:a.fieldLabel},null,8,i)}]])},763:(t,e,r)=>{function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var o=n(r(274)),i=r(4315),a=n(r(7910));function s(){return(s=Object.assign||function(t){for(var e=1;e"+JSON.stringify(t));var r=document.createElement("html");r.innerHTML=t,r.querySelectorAll("a").forEach((function(t){return t.setAttribute("target","_top")})),this.modal=document.createElement("div"),this.modal.style.position="fixed",this.modal.style.width="100vw",this.modal.style.height="100vh",this.modal.style.padding="50px",this.modal.style.boxSizing="border-box",this.modal.style.backgroundColor="rgba(0, 0, 0, .6)",this.modal.style.zIndex=2e5,this.modal.addEventListener("click",(function(){return e.hide()}));var n=document.createElement("iframe");if(n.style.backgroundColor="white",n.style.borderRadius="5px",n.style.width="100%",n.style.height="100%",this.modal.appendChild(n),document.body.prepend(this.modal),document.body.style.overflow="hidden",!n.contentWindow)throw new Error("iframe not yet ready.");n.contentWindow.document.open(),n.contentWindow.document.write(r.outerHTML),n.contentWindow.document.close(),this.listener=this.hideOnEscape.bind(this),document.addEventListener("keydown",this.listener)},hide:function(){this.modal.outerHTML="",this.modal=null,document.body.style.overflow="visible",document.removeEventListener("keydown",this.listener)},hideOnEscape:function(t){27===t.keyCode&&this.hide()}};function l(t,e){var r;return function(){var n=arguments,o=this;clearTimeout(r),r=setTimeout((function(){return t.apply(o,[].slice.call(n))}),e)}}function A(t,e,r){for(var n in void 0===e&&(e=new FormData),void 0===r&&(r=null),t=t||{})Object.prototype.hasOwnProperty.call(t,n)&&p(e,f(r,n),t[n]);return e}function f(t,e){return t?t+"["+e+"]":e}function p(t,e,r){return Array.isArray(r)?Array.from(r.keys()).forEach((function(n){return p(t,f(e,n.toString()),r[n])})):r instanceof Date?t.append(e,r.toISOString()):r instanceof File?t.append(e,r,r.name):r instanceof Blob?t.append(e,r):"boolean"==typeof r?t.append(e,r?"1":"0"):"string"==typeof r?t.append(e,r):"number"==typeof r?t.append(e,""+r):null==r?t.append(e,""):void A(r,t,e)}function d(t){return new URL(t.toString(),window.location.toString())}function h(t,r,n,o){void 0===o&&(o="brackets");var s=/^https?:\/\//.test(r.toString()),c=s||r.toString().startsWith("/"),u=!c&&!r.toString().startsWith("#")&&!r.toString().startsWith("?"),l=r.toString().includes("?")||t===e.n$.GET&&Object.keys(n).length,A=r.toString().includes("#"),f=new URL(r.toString(),"http://localhost");return t===e.n$.GET&&Object.keys(n).length&&(f.search=i.stringify(a(i.parse(f.search,{ignoreQueryPrefix:!0}),n),{encodeValuesOnly:!0,arrayFormat:o}),n={}),[[s?f.protocol+"//"+f.host:"",c?f.pathname:"",u?f.pathname.substring(1):"",l?f.search:"",A?f.hash:""].join(""),n]}function y(t){return(t=new URL(t.href)).hash="",t}function g(t,e){return document.dispatchEvent(new CustomEvent("inertia:"+t,e))}(c=e.n$||(e.n$={})).GET="get",c.POST="post",c.PUT="put",c.PATCH="patch",c.DELETE="delete";var v=function(t){return g("finish",{detail:{visit:t}})},m=function(t){return g("navigate",{detail:{page:t}})},b="undefined"==typeof window,w=function(){function t(){this.visitId=null}var r=t.prototype;return r.init=function(t){var e=t.resolveComponent,r=t.swapComponent;this.page=t.initialPage,this.resolveComponent=e,this.swapComponent=r,this.isBackForwardVisit()?this.handleBackForwardVisit(this.page):this.isLocationVisit()?this.handleLocationVisit(this.page):this.handleInitialPageVisit(this.page),this.setupEventListeners()},r.handleInitialPageVisit=function(t){this.page.url+=window.location.hash,this.setPage(t,{preserveState:!0}).then((function(){return m(t)}))},r.setupEventListeners=function(){window.addEventListener("popstate",this.handlePopstateEvent.bind(this)),document.addEventListener("scroll",l(this.handleScrollEvent.bind(this),100),!0)},r.scrollRegions=function(){return document.querySelectorAll("[scroll-region]")},r.handleScrollEvent=function(t){"function"==typeof t.target.hasAttribute&&t.target.hasAttribute("scroll-region")&&this.saveScrollPositions()},r.saveScrollPositions=function(){this.replaceState(s({},this.page,{scrollRegions:Array.from(this.scrollRegions()).map((function(t){return{top:t.scrollTop,left:t.scrollLeft}}))}))},r.resetScrollPositions=function(){var t;document.documentElement.scrollTop=0,document.documentElement.scrollLeft=0,this.scrollRegions().forEach((function(t){t.scrollTop=0,t.scrollLeft=0})),this.saveScrollPositions(),window.location.hash&&(null==(t=document.getElementById(window.location.hash.slice(1)))||t.scrollIntoView())},r.restoreScrollPositions=function(){var t=this;this.page.scrollRegions&&this.scrollRegions().forEach((function(e,r){var n=t.page.scrollRegions[r];n&&(e.scrollTop=n.top,e.scrollLeft=n.left)}))},r.isBackForwardVisit=function(){return window.history.state&&window.performance&&window.performance.getEntriesByType("navigation").length>0&&"back_forward"===window.performance.getEntriesByType("navigation")[0].type},r.handleBackForwardVisit=function(t){var e=this;window.history.state.version=t.version,this.setPage(window.history.state,{preserveScroll:!0,preserveState:!0}).then((function(){e.restoreScrollPositions(),m(t)}))},r.locationVisit=function(t,e){try{window.sessionStorage.setItem("inertiaLocationVisit",JSON.stringify({preserveScroll:e})),window.location.href=t.href,y(window.location).href===y(t).href&&window.location.reload()}catch(t){return!1}},r.isLocationVisit=function(){try{return null!==window.sessionStorage.getItem("inertiaLocationVisit")}catch(t){return!1}},r.handleLocationVisit=function(t){var e,r,n,o,i=this,a=JSON.parse(window.sessionStorage.getItem("inertiaLocationVisit")||"");window.sessionStorage.removeItem("inertiaLocationVisit"),t.url+=window.location.hash,t.rememberedState=null!=(e=null==(r=window.history.state)?void 0:r.rememberedState)?e:{},t.scrollRegions=null!=(n=null==(o=window.history.state)?void 0:o.scrollRegions)?n:[],this.setPage(t,{preserveScroll:a.preserveScroll,preserveState:!0}).then((function(){a.preserveScroll&&i.restoreScrollPositions(),m(t)}))},r.isLocationVisitResponse=function(t){return t&&409===t.status&&t.headers["x-inertia-location"]},r.isInertiaResponse=function(t){return null==t?void 0:t.headers["x-inertia"]},r.createVisitId=function(){return this.visitId={},this.visitId},r.cancelVisit=function(t,e){var r=e.cancelled,n=void 0!==r&&r,o=e.interrupted,i=void 0!==o&&o;!t||t.completed||t.cancelled||t.interrupted||(t.cancelToken.cancel(),t.onCancel(),t.completed=!1,t.cancelled=n,t.interrupted=i,v(t),t.onFinish(t))},r.finishVisit=function(t){t.cancelled||t.interrupted||(t.completed=!0,t.cancelled=!1,t.interrupted=!1,v(t),t.onFinish(t))},r.resolvePreserveOption=function(t,e){return"function"==typeof t?t(e):"errors"===t?Object.keys(e.props.errors||{}).length>0:t},r.visit=function(t,r){var n=this,i=void 0===r?{}:r,a=i.method,c=void 0===a?e.n$.GET:a,l=i.data,f=void 0===l?{}:l,p=i.replace,v=void 0!==p&&p,m=i.preserveScroll,b=void 0!==m&&m,w=i.preserveState,x=void 0!==w&&w,O=i.only,j=void 0===O?[]:O,C=i.headers,S=void 0===C?{}:C,E=i.errorBag,B=void 0===E?"":E,k=i.forceFormData,_=void 0!==k&&k,P=i.onCancelToken,T=void 0===P?function(){}:P,I=i.onBefore,D=void 0===I?function(){}:I,F=i.onStart,N=void 0===F?function(){}:F,M=i.onProgress,R=void 0===M?function(){}:M,U=i.onFinish,L=void 0===U?function(){}:U,Q=i.onCancel,V=void 0===Q?function(){}:Q,G=i.onSuccess,W=void 0===G?function(){}:G,$=i.onError,z=void 0===$?function(){}:$,H=i.queryStringArrayFormat,q=void 0===H?"brackets":H,Y="string"==typeof t?d(t):t;if(!function t(e){return e instanceof File||e instanceof Blob||e instanceof FileList&&e.length>0||e instanceof FormData&&Array.from(e.values()).some((function(e){return t(e)}))||"object"==typeof e&&null!==e&&Object.values(e).some((function(e){return t(e)}))}(f)&&!_||f instanceof FormData||(f=A(f)),!(f instanceof FormData)){var J=h(c,Y,f,q),Z=J[1];Y=d(J[0]),f=Z}var K={url:Y,method:c,data:f,replace:v,preserveScroll:b,preserveState:x,only:j,headers:S,errorBag:B,forceFormData:_,queryStringArrayFormat:q,cancelled:!1,completed:!1,interrupted:!1};if(!1!==D(K)&&function(t){return g("before",{cancelable:!0,detail:{visit:t}})}(K)){this.activeVisit&&this.cancelVisit(this.activeVisit,{interrupted:!0}),this.saveScrollPositions();var X=this.createVisitId();this.activeVisit=s({},K,{onCancelToken:T,onBefore:D,onStart:N,onProgress:R,onFinish:L,onCancel:V,onSuccess:W,onError:z,queryStringArrayFormat:q,cancelToken:o.CancelToken.source()}),T({cancel:function(){n.activeVisit&&n.cancelVisit(n.activeVisit,{cancelled:!0})}}),function(t){g("start",{detail:{visit:t}})}(K),N(K),o({method:c,url:y(Y).href,data:c===e.n$.GET?{}:f,params:c===e.n$.GET?f:{},cancelToken:this.activeVisit.cancelToken.token,headers:s({},S,{Accept:"text/html, application/xhtml+xml","X-Requested-With":"XMLHttpRequest","X-Inertia":!0},j.length?{"X-Inertia-Partial-Component":this.page.component,"X-Inertia-Partial-Data":j.join(",")}:{},B&&B.length?{"X-Inertia-Error-Bag":B}:{},this.page.version?{"X-Inertia-Version":this.page.version}:{}),onUploadProgress:function(t){f instanceof FormData&&(t.percentage=Math.round(t.loaded/t.total*100),function(t){g("progress",{detail:{progress:t}})}(t),R(t))}}).then((function(t){var e;if(!n.isInertiaResponse(t))return Promise.reject({response:t});var r=t.data;j.length&&r.component===n.page.component&&(r.props=s({},n.page.props,r.props)),b=n.resolvePreserveOption(b,r),(x=n.resolvePreserveOption(x,r))&&null!=(e=window.history.state)&&e.rememberedState&&r.component===n.page.component&&(r.rememberedState=window.history.state.rememberedState);var o=Y,i=d(r.url);return o.hash&&!i.hash&&y(o).href===i.href&&(i.hash=o.hash,r.url=i.href),n.setPage(r,{visitId:X,replace:v,preserveScroll:b,preserveState:x})})).then((function(){var t=n.page.props.errors||{};if(Object.keys(t).length>0){var e=B?t[B]?t[B]:{}:t;return function(t){g("error",{detail:{errors:t}})}(e),z(e)}return g("success",{detail:{page:n.page}}),W(n.page)})).catch((function(t){if(n.isInertiaResponse(t.response))return n.setPage(t.response.data,{visitId:X});if(n.isLocationVisitResponse(t.response)){var e=d(t.response.headers["x-inertia-location"]),r=Y;r.hash&&!e.hash&&y(r).href===e.href&&(e.hash=r.hash),n.locationVisit(e,!0===b)}else{if(!t.response)return Promise.reject(t);g("invalid",{cancelable:!0,detail:{response:t.response}})&&u.show(t.response.data)}})).then((function(){n.activeVisit&&n.finishVisit(n.activeVisit)})).catch((function(t){if(!o.isCancel(t)){var e=g("exception",{cancelable:!0,detail:{exception:t}});if(n.activeVisit&&n.finishVisit(n.activeVisit),e)return Promise.reject(t)}}))}},r.setPage=function(t,e){var r=this,n=void 0===e?{}:e,o=n.visitId,i=void 0===o?this.createVisitId():o,a=n.replace,s=void 0!==a&&a,c=n.preserveScroll,u=void 0!==c&&c,l=n.preserveState,A=void 0!==l&&l;return Promise.resolve(this.resolveComponent(t.component)).then((function(e){i===r.visitId&&(t.scrollRegions=t.scrollRegions||[],t.rememberedState=t.rememberedState||{},(s=s||d(t.url).href===window.location.href)?r.replaceState(t):r.pushState(t),r.swapComponent({component:e,page:t,preserveState:A}).then((function(){u||r.resetScrollPositions(),s||m(t)})))}))},r.pushState=function(t){this.page=t,window.history.pushState(t,"",t.url)},r.replaceState=function(t){this.page=t,window.history.replaceState(t,"",t.url)},r.handlePopstateEvent=function(t){var e=this;if(null!==t.state){var r=t.state,n=this.createVisitId();Promise.resolve(this.resolveComponent(r.component)).then((function(t){n===e.visitId&&(e.page=r,e.swapComponent({component:t,page:r,preserveState:!1}).then((function(){e.restoreScrollPositions(),m(r)})))}))}else{var o=d(this.page.url);o.hash=window.location.hash,this.replaceState(s({},this.page,{url:o.href})),this.resetScrollPositions()}},r.get=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({},n,{method:e.n$.GET,data:r}))},r.reload=function(t){return void 0===t&&(t={}),this.visit(window.location.href,s({},t,{preserveScroll:!0,preserveState:!0}))},r.replace=function(t,e){var r;return void 0===e&&(e={}),console.warn("Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia."+(null!=(r=e.method)?r:"get")+"() instead."),this.visit(t,s({preserveState:!0},e,{replace:!0}))},r.post=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({preserveState:!0},n,{method:e.n$.POST,data:r}))},r.put=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({preserveState:!0},n,{method:e.n$.PUT,data:r}))},r.patch=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),this.visit(t,s({preserveState:!0},n,{method:e.n$.PATCH,data:r}))},r.delete=function(t,r){return void 0===r&&(r={}),this.visit(t,s({preserveState:!0},r,{method:e.n$.DELETE}))},r.remember=function(t,e){var r,n;void 0===e&&(e="default"),b||this.replaceState(s({},this.page,{rememberedState:s({},null==(r=this.page)?void 0:r.rememberedState,(n={},n[e]=t,n))}))},r.restore=function(t){var e,r;if(void 0===t&&(t="default"),!b)return null==(e=window.history.state)||null==(r=e.rememberedState)?void 0:r[t]},r.on=function(t,e){var r=function(t){var r=e(t);t.cancelable&&!t.defaultPrevented&&!1===r&&t.preventDefault()};return document.addEventListener("inertia:"+t,r),function(){return document.removeEventListener("inertia:"+t,r)}},t}(),x={buildDOMElement:function(t){var e=document.createElement("template");e.innerHTML=t;var r=e.content.firstChild;if(!t.startsWith("
44 |
--------------------------------------------------------------------------------
/resources/js/components/FormField.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
24 |
25 |
26 |
27 |
28 |
101 |
--------------------------------------------------------------------------------
/resources/js/components/IndexField.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
34 |
--------------------------------------------------------------------------------
/resources/js/field.js:
--------------------------------------------------------------------------------
1 | Nova.booting((Vue) => {
2 | window.Vue.use = Vue.use;
3 | Vue.component('index-nova-tag-input', require('./components/IndexField').default)
4 | Vue.component('detail-nova-tag-input', require('./components/DetailField').default)
5 | Vue.component('form-nova-tag-input', require('./components/FormField').default)
6 | })
7 |
--------------------------------------------------------------------------------
/resources/sass/field.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Nova Field styles
3 | */
4 | .nti-tags-wrapper-index {
5 | display: flex;
6 | flex-wrap: wrap;
7 | }
8 |
9 | .nti-tags-wrapper {
10 | margin-bottom: -5px;
11 |
12 | .nti-tag {
13 | display: inline-block;
14 | margin: 2px;
15 | color: rgba(var(--colors-white)) !important;
16 | background-color: rgba(var(--colors-primary-500), var(--tw-bg-opacity)) !important;
17 | padding: 3px 4px !important;
18 | border-radius: 0.2rem !important;
19 | font-size: .875rem !important;
20 | line-height: 1.25rem !important;
21 | font-weight: 700 !important;
22 | }
23 | }
24 |
25 | // Dark variant
26 | .dark {
27 | .nti-tags-wrapper {
28 | .nti-tag {
29 | color: rgba(var(--colors-slate-900)) !important;
30 | }
31 | }
32 | }
33 |
34 |
35 | /**
36 | * Plugin styles
37 | */
38 | .vue-tags-input {
39 | max-width: none !important;
40 | background-color: transparent !important;
41 | }
42 |
43 | .ti-input {
44 | --tw-ring-color: rgba(var(--colors-primary-100)) !important;
45 | --tw-border-opacity: 1 !important;
46 | --tw-bg-opacity: 1 !important;
47 | --tw-text-opacity: 1 !important;
48 | font-size: .875rem !important;
49 | background-color: rgba(var(--colors-white), var(--tw-bg-opacity)) !important;
50 | border-color: rgba(var(--colors-slate-300), var(--tw-border-opacity));
51 | border-radius: 0.25rem !important;
52 | border-width: 1px !important;
53 | color: rgba(var(--colors-slate-600)) !important;
54 | padding-left: 0.75rem !important;
55 | padding-right: 0.75rem !important;
56 | box-sizing: border-box !important;
57 | line-height: normal !important;
58 | }
59 |
60 | .dark .ti-input, .dark .ti-new-tag-input {
61 | --tw-ring-color: rgba(var(--colors-slate-700), var(--tw-ring-opacity)) !important;
62 | background-color: rgba(var(--colors-slate-900), var(--tw-bg-opacity)) !important;
63 | color: rgba(var(--colors-slate-400)) !important;
64 | border-color: rgba(var(--colors-slate-700), var(--tw-border-opacity)) !important;
65 | }
66 |
67 | .ti-tag {
68 | font-size: .875rem !important;
69 | line-height: 1.25rem !important;
70 | font-weight: 700 !important;
71 | padding: 3px 4px 3px 7px !important;
72 | border-radius: 0.2rem !important;
73 |
74 | &.ti-valid {
75 | color: rgba(var(--colors-white)) !important;
76 | background-color: rgba(var(--colors-primary-500), var(--tw-bg-opacity)) !important;
77 | }
78 |
79 | &.ti-deletion-mark {
80 | background-color: rgba(var(--colors-red-500), var(--tw-bg-opacity)) !important;
81 | }
82 | }
83 |
84 | .ti-autocomplete {
85 | .ti-item {
86 | &.ti-selected-item {
87 | background-color: var(--colors-primary-500) !important;
88 | color: rgba(var(--colors-white)) !important;
89 | }
90 | }
91 | }
92 |
93 | // Dark variant
94 | .dark {
95 | .ti-tag {
96 | &.ti-valid {
97 | color: rgba(var(--colors-slate-900)) !important;
98 | }
99 | }
100 |
101 | .ti-autocomplete {
102 | .ti-item {
103 | &.ti-selected-item {
104 | color: rgba(var(--colors-slate-900)) !important;
105 | }
106 | }
107 | }
108 | }
109 |
110 |
--------------------------------------------------------------------------------
/src/FieldServiceProvider.php:
--------------------------------------------------------------------------------
1 | exists($requestAttribute)) {
21 | // Data to be stored
22 | $attributes = json_decode($request[$requestAttribute]);
23 | // Only get the value of the text key if it exists
24 | $tags = Arr::pluck($attributes, 'text');
25 | // Store the data
26 | $model->{$attribute} = $tags;
27 | }
28 | }
29 |
30 | public function placeholder($text)
31 | {
32 | return $this->withMeta(['placeholder' => $text]);
33 | }
34 |
35 | // Used to generate tags while typing
36 | public function addOnKeys(array $keys)
37 | {
38 | return $this->withMeta(['addOnKeys' => $keys]);
39 | }
40 |
41 | // Defines the characters which splits a text into different pieces, to generate tags out of this pieces.
42 | public function separators(array $separators)
43 | {
44 | return $this->withMeta(['separators' => $separators]);
45 | }
46 |
47 | // If it's true, the user can paste into the input element and vue-tags-input will create tags out of the incoming text.
48 | public function addFromPaste(bool $enable = true)
49 | {
50 | return $this->withMeta(['addFromPaste' => $enable]);
51 | }
52 |
53 | // If the input holds a value and loses the focus, a tag will be generated out of this value, if possible.
54 | public function addOnBlur(bool $enable = true)
55 | {
56 | return $this->withMeta(['addOnBlur' => $enable]);
57 | }
58 |
59 | // If it's true, the user can add tags only via the autocomplete layer.
60 | public function addOnlyFromAutocomplete(bool $enable = true)
61 | {
62 | return $this->withMeta(['addOnlyFromAutocomplete' => $enable]);
63 | }
64 |
65 | // Defines whether a tag is editable after creation or not.
66 | public function allowEditTags(bool $allow = true)
67 | {
68 | return $this->withMeta(['allowEditTags' => $allow]);
69 | }
70 |
71 | // If it's true, the autocomplete layer is always shown, regardless if an input or an autocomplete items exists.
72 | public function autocompleteAlwaysOpen(bool $open = true)
73 | {
74 | return $this->withMeta(['autocompleteAlwaysOpen' => $open]);
75 | }
76 |
77 | // Defines if duplicate autocomplete items are filtered out from the view or not.
78 | public function autocompleteFilterDuplicates(bool $filter = true)
79 | {
80 | return $this->withMeta(['autocompleteFilterDuplicates' => $filter]);
81 | }
82 |
83 | // The minimum character length which is required until the autocomplete layer is shown. If set to 0, then it'll be shown on focus.
84 | public function autocompleteMinLength(int $minLength = 1)
85 | {
86 | return $this->withMeta(['autocompleteMinLength' => $minLength]);
87 | }
88 |
89 | // If it's true, the user can't add or save a tag, if another exists, with the same text value.
90 | public function avoidAddingDuplicates(bool $avoidDuplicates = true)
91 | {
92 | return $this->withMeta(['avoidAddingDuplicates' => $avoidDuplicates]);
93 | }
94 |
95 | // Defines if it's possible to delete tags by pressing backspace.
96 | public function deleteOnBackspace(bool $enable = true)
97 | {
98 | return $this->withMeta(['deleteOnBackspace' => $enable]);
99 | }
100 |
101 | // Property to disable vue-tags-input.
102 | public function disabled(bool $disabled = true)
103 | {
104 | return $this->withMeta(['disabled' => $disabled]);
105 | }
106 |
107 | // The maximum amount the tags array is allowed to hold.
108 | public function maxTags(int $max)
109 | {
110 | return $this->withMeta(['maxTags' => $max]);
111 | }
112 |
113 | public function autocompleteItems(array $items)
114 | {
115 | /*
116 | * Convert the user's items to the required syntax
117 | */
118 | $entries = [];
119 | foreach ($items as $item) {
120 | $entries[] = ['text' => $item];
121 | }
122 |
123 | return $this->withMeta(['autocompleteItems' => $entries]);
124 | }
125 |
126 | }
127 |
--------------------------------------------------------------------------------
/webpack.mix.js:
--------------------------------------------------------------------------------
1 | let mix = require('laravel-mix')
2 | require('./mix.js');
3 |
4 | mix.setPublicPath('dist')
5 | .js('resources/js/field.js', 'js')
6 | .sass('resources/sass/field.scss', 'css')
7 | .vue({ version: 3 })
8 | .nova('superlatif/nova-tag-input')
9 |
--------------------------------------------------------------------------------