diff --git a/app/Http/Controllers/BrandController.php b/app/Http/Controllers/BrandController.php index e0d172d..c1c626e 100644 --- a/app/Http/Controllers/BrandController.php +++ b/app/Http/Controllers/BrandController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\Brand; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Redirect; class BrandController extends Controller { @@ -31,11 +32,16 @@ class BrandController extends Controller * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response */ public function store(Request $request) { - // + $brand = Brand::create( + $request->validate([ + 'name' => ['required', 'string', 'max:255'], + ]) + )->only('id', 'name'); + + return $brand; } /** diff --git a/app/Http/Controllers/CarController.php b/app/Http/Controllers/CarController.php index fef5d4e..e34bc7d 100644 --- a/app/Http/Controllers/CarController.php +++ b/app/Http/Controllers/CarController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\Car; use Inertia\Inertia; +use App\Models\Brand; use App\Enums\InsuranceType; use Illuminate\Http\Request; use Illuminate\Validation\Rule; @@ -97,7 +98,21 @@ class CarController extends Controller */ public function create() { - return Inertia::render('Cars/Create'); + return Inertia::render('Cars/Create', [ + 'brands' => Brand::all()->map(function ($brand) { + return [ + 'id' => $brand->id, + 'name' => $brand->name, + 'models' => $brand->carModels()->get() + ->map(function ($carModel) { + return [ + 'id' => $carModel->id, + 'name' => $carModel->name, + ]; + }), + ]; + }), + ]); } /** @@ -110,17 +125,17 @@ class CarController extends Controller { $car = Car::create( $request->validate([ - 'stammnummer' => ['unique', 'max:11'], - 'vin' => ['max:17'], + 'stammnummer' => ['required', 'unique:cars', 'string', 'size:11', 'regex:/[0-9]{3}[.][0-9]{3}[.][0-9]{3}/i'], + 'vin' => ['required', 'unique:cars', 'string', 'size:17'], 'initial_date' => ['nullable', 'date'], 'last_check_date' => ['nullable', 'date'], 'colour' => ['nullable', 'max:75'], - // 'model_id' => ['nullable', 'max:150'], + 'car_model_id' => ['required', 'exists:App\Models\CarModel,id'], 'kilometers' => ['nullable', 'max:75'], ]) ); - return Redirect::route('cars.edit', $car)->with('success', 'Kontakt erstellt.'); + return Redirect::route('cars.edit', $car); } @@ -137,7 +152,8 @@ class CarController extends Controller 'id' => $car->id, 'stammnummer' => $car->stammnummer, 'vin' => $car->vin, - 'car_model' => $car->carModel->only('name'), + 'car_model' => $car->carModel, + 'brand' => $car->brand, 'name' => $car->name, 'initial_date' => $car->initial_date, 'colour' => $car->colour, diff --git a/app/Http/Controllers/CarModelController.php b/app/Http/Controllers/CarModelController.php index 66364c7..a23de7b 100644 --- a/app/Http/Controllers/CarModelController.php +++ b/app/Http/Controllers/CarModelController.php @@ -35,7 +35,14 @@ class CarModelController extends Controller */ public function store(Request $request) { - // + $model = CarModel::create( + $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'brand_id' => ['required', 'exists:App\Models\Brand,id'], + ]) + )->only('id', 'name'); + + return $model; } /** diff --git a/app/Models/CarModel.php b/app/Models/CarModel.php index da24632..f4e8fc7 100644 --- a/app/Models/CarModel.php +++ b/app/Models/CarModel.php @@ -10,7 +10,7 @@ class CarModel extends Model use HasFactory; protected $fillable = [ - 'car_model', + 'name', 'brand_id', ]; diff --git a/package-lock.json b/package-lock.json index dfe99a7..716ac8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "packages": { "": { "dependencies": { + "vue-multiselect": "^3.0.0-alpha.2", "vue-unicons": "^3.2.1", "vuex": "^4.0.0" }, @@ -15389,6 +15390,15 @@ "node": ">=8.9.0" } }, + "node_modules/vue-multiselect": { + "version": "3.0.0-alpha.2", + "resolved": "https://registry.npmjs.org/vue-multiselect/-/vue-multiselect-3.0.0-alpha.2.tgz", + "integrity": "sha512-Xp9fGJECns45v+v8jXbCIsAkCybYkEg0lNwr7Z6HDUSMyx2TEIK2giipPE+qXiShEc1Ipn+ZtttH2iq9hwXP4Q==", + "engines": { + "node": ">= 4.0.0", + "npm": ">= 3.0.0" + } + }, "node_modules/vue-style-loader": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz", @@ -28323,6 +28333,11 @@ } } }, + "vue-multiselect": { + "version": "3.0.0-alpha.2", + "resolved": "https://registry.npmjs.org/vue-multiselect/-/vue-multiselect-3.0.0-alpha.2.tgz", + "integrity": "sha512-Xp9fGJECns45v+v8jXbCIsAkCybYkEg0lNwr7Z6HDUSMyx2TEIK2giipPE+qXiShEc1Ipn+ZtttH2iq9hwXP4Q==" + }, "vue-style-loader": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.3.tgz", diff --git a/package.json b/package.json index d48a5dd..38461b2 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "vue-loader": "^16.1.2" }, "dependencies": { + "vue-multiselect": "^3.0.0-alpha.2", "vue-unicons": "^3.2.1", "vuex": "^4.0.0" } diff --git a/public/js/app.js b/public/js/app.js index fe4db1d..85dbda8 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -18133,6 +18133,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _Jetstream_ActionMessage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/Jetstream/ActionMessage */ "./resources/js/Jetstream/ActionMessage.vue"); /* harmony import */ var _Jetstream_InputError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/Jetstream/InputError */ "./resources/js/Jetstream/InputError.vue"); /* harmony import */ var _Jetstream_FormSection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/Jetstream/FormSection */ "./resources/js/Jetstream/FormSection.vue"); +/* harmony import */ var vue_multiselect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vue-multiselect */ "./node_modules/vue-multiselect/dist/vue-multiselect.esm.js"); + @@ -18148,22 +18150,70 @@ __webpack_require__.r(__webpack_exports__); Modal: _Jetstream_Modal_vue__WEBPACK_IMPORTED_MODULE_3__.default, JetInput: _Jetstream_Input_vue__WEBPACK_IMPORTED_MODULE_2__.default, JetInputError: _Jetstream_InputError__WEBPACK_IMPORTED_MODULE_5__.default, - JetActionMessage: _Jetstream_ActionMessage__WEBPACK_IMPORTED_MODULE_4__.default + JetActionMessage: _Jetstream_ActionMessage__WEBPACK_IMPORTED_MODULE_4__.default, + Multiselect: vue_multiselect__WEBPACK_IMPORTED_MODULE_7__.default }, props: { form: Object, + brands: Array, meta: Object }, data: function data() { - return {}; + return { + brand: this.form.brand, + brandSearch: null, + modelSearch: null, + carModels: [], + model: this.form.model + }; }, methods: { submitForm: function submitForm() { this.form.post(route(this.meta.link, this.form.data()), { preserveScroll: true }); + }, + updateCarModelsList: function updateCarModelsList(brand) { + var _brand$models; + + this.carModels = (_brand$models = brand.models) !== null && _brand$models !== void 0 ? _brand$models : []; + this.model = null; + }, + updateBrandSearch: function updateBrandSearch(searchQuery, id) { + this.brandSearch = searchQuery; + }, + addBrand: function addBrand() { + var _this = this; + + axios.post(this.route('brands.store'), { + name: this.brandSearch + }).then(function (response) { + var newBrand = response.data; + + _this.brands.push(newBrand); + + _this.brand = newBrand; + }); + }, + updateCarModelSearch: function updateCarModelSearch(searchQuery, id) { + this.modelSearch = searchQuery; + }, + addCarModel: function addCarModel() { + var _this2 = this; + + axios.post(this.route('models.store'), { + name: this.modelSearch, + brand_id: this.brand.id + }).then(function (response) { + var newModel = response.data; + + _this2.carModels.push(newModel); + + _this2.model = newModel; + }); } - } + }, + computed: {} }); /***/ }), @@ -18191,6 +18241,9 @@ __webpack_require__.r(__webpack_exports__); BreadCrumb: _Components_BreadCrumb_vue__WEBPACK_IMPORTED_MODULE_1__.default, CarForm: _Components_CarForm_vue__WEBPACK_IMPORTED_MODULE_2__.default }, + props: { + brands: Array + }, data: function data() { return { meta: { @@ -23576,35 +23629,36 @@ var _hoisted_1 = { var _hoisted_2 = { "class": "col-span-6 sm:col-span-4" }; -var _hoisted_3 = { - "class": "col-span-6 sm:col-span-4" -}; + +var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" als neue Marke speichern? "); + var _hoisted_4 = { - "class": "grid grid-cols-12 gap-6" + key: 0, + "class": "col-span-6 sm:col-span-4" }; var _hoisted_5 = { - "class": "col-span-12 sm:col-span-5" + "class": "col-span-6 sm:col-span-4" }; var _hoisted_6 = { - "class": "col-span-12 sm:col-span-7" -}; -var _hoisted_7 = { - "class": "col-span-6 sm:col-span-4" -}; -var _hoisted_8 = { "class": "grid grid-cols-12 gap-6" }; +var _hoisted_7 = { + "class": "col-span-12 sm:col-span-5" +}; +var _hoisted_8 = { + "class": "col-span-12 sm:col-span-7" +}; var _hoisted_9 = { - "class": "col-span-6 sm:col-span-6" + "class": "col-span-6 sm:col-span-4" }; var _hoisted_10 = { - "class": "col-span-6 sm:col-span-6" + "class": "grid grid-cols-12 gap-6" }; var _hoisted_11 = { - "class": "col-span-6 sm:col-span-4" + "class": "col-span-6 sm:col-span-6" }; var _hoisted_12 = { - "class": "col-span-6 sm:col-span-4" + "class": "col-span-6 sm:col-span-6" }; var _hoisted_13 = { "class": "col-span-6 sm:col-span-4" @@ -23612,13 +23666,21 @@ var _hoisted_13 = { var _hoisted_14 = { "class": "col-span-6 sm:col-span-4" }; +var _hoisted_15 = { + "class": "col-span-6 sm:col-span-4" +}; +var _hoisted_16 = { + "class": "col-span-6 sm:col-span-4" +}; function render(_ctx, _cache, $props, $setup, $data, $options) { var _component_jet_label = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("jet-label"); - var _component_jet_input = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("jet-input"); + var _component_multiselect = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("multiselect"); var _component_jet_input_error = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("jet-input-error"); + var _component_jet_input = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("jet-input"); + var _component_jet_action_message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("jet-action-message"); var _component_jet_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("jet-button"); @@ -23636,26 +23698,72 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }), form: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { - "for": "car_model_id", - value: "Modell" - }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input, { - id: "car_model_id", - type: "text", - "class": "mt-1 block w-full", - modelValue: $props.form.car_model_id, - "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) { - return $props.form.car_model_id = $event; + "for": "brand", + value: "Marke" + }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_multiselect, { + modelValue: $data.brand, + "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) { + return $data.brand = $event; }), - ref: "car_model_id", - autocomplete: "car_model_id" - }, null, 8 + onSearchChange: $options.updateBrandSearch, + onSelect: $options.updateCarModelsList, + label: "name", + "track-by": "id", + options: $props.brands, + "class": "mt-1 block w-full", + placeholder: "Marke auswählen" + }, { + noResult: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { + return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", { + onClick: _cache[1] || (_cache[1] = function () { + return $options.addBrand && $options.addBrand.apply($options, arguments); + }) + }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("b", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($data.brandSearch), 1 + /* TEXT */ + ), _hoisted_3])]; + }), + _: 1 + /* STABLE */ + + }, 8 /* PROPS */ - , ["modelValue"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input_error, { - message: $props.form.errors.car_model_id, + , ["modelValue", "onSearchChange", "onSelect", "options"])]), $data.brand ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + "for": "model", + value: "Modell" + }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_multiselect, { + label: "name", + "track-by": "id", + modelValue: $data.model, + "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) { + return $data.model = $event; + }), + onSearchChange: $options.updateCarModelSearch, + options: $data.carModels, + "class": "mt-1 block w-full", + placeholder: "Modell auswählen" + }, { + noResult: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { + return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", { + onClick: _cache[3] || (_cache[3] = function () { + return $options.addCarModel && $options.addCarModel.apply($options, arguments); + }) + }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("b", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($data.modelSearch), 1 + /* TEXT */ + ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" als neues " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($data.brand.name) + "-Modell speichern? ", 1 + /* TEXT */ + )])]; + }), + _: 1 + /* STABLE */ + + }, 8 + /* PROPS */ + , ["modelValue", "onSearchChange", "options"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input_error, { + message: $props.form.errors.model, "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "stammnummer", value: "Stammnummer" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input, { @@ -23663,7 +23771,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { type: "text", "class": "mt-1 block w-full", modelValue: $props.form.stammnummer, - "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) { + "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { return $props.form.stammnummer = $event; }), ref: "stammnummer", @@ -23675,7 +23783,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "vin", value: "Chassisnummer" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input, { @@ -23683,7 +23791,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { type: "text", "class": "mt-1 block w-full", modelValue: $props.form.vin, - "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) { + "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) { return $props.form.vin = $event; }), ref: "vin", @@ -23695,7 +23803,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_11, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "initial_date", value: "Inverkehrssetzung" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input, { @@ -23703,7 +23811,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { type: "text", "class": "mt-1 block w-full", modelValue: $props.form.initial_date, - "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) { + "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) { return $props.form.initial_date = $event; }), ref: "initial_date", @@ -23715,7 +23823,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_12, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "last_check_date", value: "Letzte Prüfung" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input, { @@ -23723,7 +23831,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { type: "text", "class": "mt-1 block w-full", modelValue: $props.form.last_check_date, - "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { + "onUpdate:modelValue": _cache[8] || (_cache[8] = function ($event) { return $props.form.last_check_date = $event; }), ref: "last_check_date", @@ -23735,7 +23843,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_11, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_13, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "kilometers", value: "Kilometerstand" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input, { @@ -23743,7 +23851,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { type: "text", "class": "mt-1 block w-full", modelValue: $props.form.kilometers, - "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) { + "onUpdate:modelValue": _cache[9] || (_cache[9] = function ($event) { return $props.form.kilometers = $event; }), ref: "kilometers", @@ -23755,7 +23863,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_12, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "colour", value: "Farbe" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_input, { @@ -23763,7 +23871,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { type: "text", "class": "mt-1 block w-full", modelValue: $props.form.colour, - "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) { + "onUpdate:modelValue": _cache[10] || (_cache[10] = function ($event) { return $props.form.colour = $event; }), ref: "colour", @@ -23775,12 +23883,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_13, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_15, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "known_damage", value: "Bekannter Schaden" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("textarea", { "class": "mt-1 block w-full border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm", - "onUpdate:modelValue": _cache[8] || (_cache[8] = function ($event) { + "onUpdate:modelValue": _cache[11] || (_cache[11] = function ($event) { return $props.form.known_damage = $event; }), ref: "input" @@ -23791,12 +23899,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "class": "mt-2" }, null, 8 /* PROPS */ - , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_14, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { + , ["message"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_16, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_jet_label, { "for": "notes", value: "Bemerkungen" }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("textarea", { "class": "mt-1 block w-full border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm", - "onUpdate:modelValue": _cache[9] || (_cache[9] = function ($event) { + "onUpdate:modelValue": _cache[12] || (_cache[12] = function ($event) { return $props.form.notes = $event; }), ref: "input" @@ -23894,7 +24002,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_car_form, { form: $data.form, - meta: $data.meta + meta: $data.meta, + brands: $props.brands }, { title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { return [_hoisted_3]; @@ -23907,7 +24016,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }, 8 /* PROPS */ - , ["form", "meta"])])]; + , ["form", "meta", "brands"])])]; }), _: 1 /* STABLE */ @@ -24638,21 +24747,18 @@ __webpack_require__.r(__webpack_exports__); var _hoisted_1 = { "class": "font-semibold text-xl text-gray-800 leading-tight" }; -var _hoisted_2 = { - "class": "max-w-7xl py-10 sm:px-6 lg:px-8" -}; -var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Kontaktinformationen"); +var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Kontaktinformationen"); -var _hoisted_4 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Kontaktinformationen anschauen & anpassen. "); +var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Kontaktinformationen anschauen & anpassen. "); -var _hoisted_5 = { +var _hoisted_4 = { "class": "py-12" }; -var _hoisted_6 = { +var _hoisted_5 = { "class": "max-w-7xl sm:px-6 lg:px-8" }; -var _hoisted_7 = { +var _hoisted_6 = { "class": "max-w-7xl pt-6 sm:px-6 lg:px-8" }; function render(_ctx, _cache, $props, $setup, $data, $options) { @@ -24678,15 +24784,15 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { )])]; }), "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { - return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_contact_form, { + return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_contact_form, { form: $data.form, meta: $data.meta }, { title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { - return [_hoisted_3]; + return [_hoisted_2]; }), description: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () { - return [_hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_contact_card, { + return [_hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_contact_card, { contact: $options.computedContact }, null, 8 /* PROPS */ @@ -24697,13 +24803,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }, 8 /* PROPS */ - , ["form", "meta"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_simple_table, { + , ["form", "meta"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_simple_table, { title: 'An ' + $options.title + ' verkaufte Autos', data: $props.contact.bought_cars, columns: $data.boughtCarColumns }, null, 8 /* PROPS */ - , ["title", "data", "columns"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_simple_table, { + , ["title", "data", "columns"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_simple_table, { title: 'Von ' + $options.title + ' gekaufte Autos', data: $props.contact.sold_cars, columns: $data.soldCarColumns @@ -27160,6 +27266,106 @@ if ($defineProperty) { } +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css": +/*!*********************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css ***! + \*********************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); +// Imports + +var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); +// Module +___CSS_LOADER_EXPORT___.push([module.id, "fieldset[disabled] .multiselect{pointer-events:none}.multiselect__spinner{position:absolute;right:1px;top:1px;width:48px;height:35px;background:#fff;display:block}.multiselect__spinner:after,.multiselect__spinner:before{position:absolute;content:\"\";top:50%;left:50%;margin:-8px 0 0 -8px;width:16px;height:16px;border-radius:100%;border-color:#41b883 transparent transparent;border-style:solid;border-width:2px;box-shadow:0 0 0 1px transparent}.multiselect__spinner:before{-webkit-animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect__spinner:after{-webkit-animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect__loading-enter-active,.multiselect__loading-leave-active{transition:opacity .4s ease-in-out;opacity:1}.multiselect__loading-enter,.multiselect__loading-leave-active{opacity:0}.multiselect,.multiselect__input,.multiselect__single{font-family:inherit;font-size:16px;touch-action:manipulation}.multiselect{box-sizing:content-box;display:block;position:relative;width:100%;min-height:40px;text-align:left;color:#35495e}.multiselect *{box-sizing:border-box}.multiselect:focus{outline:none}.multiselect--disabled{background:#ededed;pointer-events:none;opacity:.6}.multiselect--active{z-index:50}.multiselect--active:not(.multiselect--above) .multiselect__current,.multiselect--active:not(.multiselect--above) .multiselect__input,.multiselect--active:not(.multiselect--above) .multiselect__tags{border-bottom-left-radius:0;border-bottom-right-radius:0}.multiselect--active .multiselect__select{transform:rotate(180deg)}.multiselect--above.multiselect--active .multiselect__current,.multiselect--above.multiselect--active .multiselect__input,.multiselect--above.multiselect--active .multiselect__tags{border-top-left-radius:0;border-top-right-radius:0}.multiselect__input,.multiselect__single{position:relative;display:inline-block;min-height:20px;line-height:20px;border:none;border-radius:5px;background:#fff;padding:0 0 0 5px;width:100%;transition:border .1s ease;box-sizing:border-box;margin-bottom:8px;vertical-align:top}.multiselect__input::-moz-placeholder{color:#35495e}.multiselect__input:-ms-input-placeholder{color:#35495e}.multiselect__input::placeholder{color:#35495e}.multiselect__tag~.multiselect__input,.multiselect__tag~.multiselect__single{width:auto}.multiselect__input:hover,.multiselect__single:hover{border-color:#cfcfcf}.multiselect__input:focus,.multiselect__single:focus{border-color:#a8a8a8;outline:none}.multiselect__single{padding-left:5px;margin-bottom:8px}.multiselect__tags-wrap{display:inline}.multiselect__tags{min-height:40px;display:block;padding:8px 40px 0 8px;border-radius:5px;border:1px solid #e8e8e8;background:#fff;font-size:14px}.multiselect__tag{position:relative;display:inline-block;padding:4px 26px 4px 10px;border-radius:5px;margin-right:10px;color:#fff;line-height:1;background:#41b883;margin-bottom:5px;white-space:nowrap;overflow:hidden;max-width:100%;text-overflow:ellipsis}.multiselect__tag-icon{cursor:pointer;margin-left:7px;position:absolute;right:0;top:0;bottom:0;font-weight:700;font-style:normal;width:22px;text-align:center;line-height:22px;transition:all .2s ease;border-radius:5px}.multiselect__tag-icon:after{content:\"×\";color:#266d4d;font-size:14px}.multiselect__tag-icon:focus:after,.multiselect__tag-icon:hover:after{color:#fff}.multiselect__current{min-height:40px;overflow:hidden;padding:8px 12px 0;padding-right:30px;white-space:nowrap;border-radius:5px;border:1px solid #e8e8e8}.multiselect__current,.multiselect__select{line-height:16px;box-sizing:border-box;display:block;margin:0;text-decoration:none;cursor:pointer}.multiselect__select{position:absolute;width:40px;height:38px;right:1px;top:1px;padding:4px 8px;text-align:center;transition:transform .2s ease}.multiselect__select:before{position:relative;right:0;top:65%;color:#999;margin-top:4px;border-style:solid;border-width:5px 5px 0 5px;border-color:#999 transparent transparent transparent;content:\"\"}.multiselect__placeholder{color:#adadad;display:inline-block;margin-bottom:10px;padding-top:2px}.multiselect--active .multiselect__placeholder{display:none}.multiselect__content-wrapper{position:absolute;display:block;background:#fff;width:100%;max-height:240px;overflow:auto;border:1px solid #e8e8e8;border-top:none;border-bottom-left-radius:5px;border-bottom-right-radius:5px;z-index:50;-webkit-overflow-scrolling:touch}.multiselect__content{list-style:none;display:inline-block;padding:0;margin:0;min-width:100%;vertical-align:top}.multiselect--above .multiselect__content-wrapper{bottom:100%;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom:none;border-top:1px solid #e8e8e8}.multiselect__content::-webkit-scrollbar{display:none}.multiselect__element{display:block}.multiselect__option{display:block;padding:12px;min-height:40px;line-height:16px;text-decoration:none;text-transform:none;vertical-align:middle;position:relative;cursor:pointer;white-space:nowrap}.multiselect__option:after{top:0;right:0;position:absolute;line-height:40px;padding-right:12px;padding-left:20px;font-size:13px}.multiselect__option--highlight{background:#41b883;outline:none;color:#fff}.multiselect__option--highlight:after{content:attr(data-select);background:#41b883;color:#fff}.multiselect__option--selected{background:#f3f3f3;color:#35495e;font-weight:700}.multiselect__option--selected:after{content:attr(data-selected);color:silver}.multiselect__option--selected.multiselect__option--highlight{background:#ff6a6a;color:#fff}.multiselect__option--selected.multiselect__option--highlight:after{background:#ff6a6a;content:attr(data-deselect);color:#fff}.multiselect--disabled .multiselect__current,.multiselect--disabled .multiselect__select{background:#ededed;color:#a6a6a6}.multiselect__option--disabled{background:#ededed!important;color:#a6a6a6!important;cursor:text;pointer-events:none}.multiselect__option--group{background:#ededed;color:#35495e}.multiselect__option--group.multiselect__option--highlight{background:#35495e;color:#fff}.multiselect__option--group.multiselect__option--highlight:after{background:#35495e}.multiselect__option--disabled.multiselect__option--highlight{background:#dedede}.multiselect__option--group-selected.multiselect__option--highlight{background:#ff6a6a;color:#fff}.multiselect__option--group-selected.multiselect__option--highlight:after{background:#ff6a6a;content:attr(data-deselect);color:#fff}.multiselect-enter-active,.multiselect-leave-active{transition:all .15s ease}.multiselect-enter,.multiselect-leave-active{opacity:0}.multiselect__strong{margin-bottom:8px;line-height:20px;display:inline-block;vertical-align:top}[dir=rtl] .multiselect{text-align:right}[dir=rtl] .multiselect__select{right:auto;left:1px}[dir=rtl] .multiselect__tags{padding:8px 8px 0 40px}[dir=rtl] .multiselect__content{text-align:right}[dir=rtl] .multiselect__option:after{right:auto;left:0}[dir=rtl] .multiselect__clear{right:auto;left:12px}[dir=rtl] .multiselect__spinner{right:auto;left:1px}@-webkit-keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}}@keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}}", ""]); +// Exports +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ +/***/ ((module) => { + +"use strict"; + + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +// eslint-disable-next-line func-names +module.exports = function (cssWithMappingToString) { + var list = []; // return the list of modules as css string + + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item); + + if (item[2]) { + return "@media ".concat(item[2], " {").concat(content, "}"); + } + + return content; + }).join(""); + }; // import a list of modules into the list + // eslint-disable-next-line func-names + + + list.i = function (modules, mediaQuery, dedupe) { + if (typeof modules === "string") { + // eslint-disable-next-line no-param-reassign + modules = [[null, modules, ""]]; + } + + var alreadyImportedModules = {}; + + if (dedupe) { + for (var i = 0; i < this.length; i++) { + // eslint-disable-next-line prefer-destructuring + var id = this[i][0]; + + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + + for (var _i = 0; _i < modules.length; _i++) { + var item = [].concat(modules[_i]); + + if (dedupe && alreadyImportedModules[item[0]]) { + // eslint-disable-next-line no-continue + continue; + } + + if (mediaQuery) { + if (!item[2]) { + item[2] = mediaQuery; + } else { + item[2] = "".concat(mediaQuery, " and ").concat(item[2]); + } + } + + list.push(item); + } + }; + + return list; +}; + /***/ }), /***/ "./node_modules/deepmerge/dist/cjs.js": @@ -50084,9 +50290,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ }); /* harmony import */ var _CarForm_vue_vue_type_template_id_0ffc8c96__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CarForm.vue?vue&type=template&id=0ffc8c96 */ "./resources/js/Pages/Cars/Components/CarForm.vue?vue&type=template&id=0ffc8c96"); /* harmony import */ var _CarForm_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CarForm.vue?vue&type=script&lang=js */ "./resources/js/Pages/Cars/Components/CarForm.vue?vue&type=script&lang=js"); +/* harmony import */ var vue_multiselect_dist_vue_multiselect_css_vue_type_style_index_0_lang_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css */ "./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css"); + +; _CarForm_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__.default.render = _CarForm_vue_vue_type_template_id_0ffc8c96__WEBPACK_IMPORTED_MODULE_0__.render /* hot reload */ if (false) {} @@ -52783,6 +52992,1667 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_UpdateTeamNameForm_vue_vue_type_template_id_8302acd2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./UpdateTeamNameForm.vue?vue&type=template&id=8302acd2 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/Pages/Teams/UpdateTeamNameForm.vue?vue&type=template&id=8302acd2"); +/***/ }), + +/***/ "./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css": +/*!***********************************************************************************************!*\ + !*** ./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css ***! + \***********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _vue_style_loader_index_js_css_loader_dist_cjs_js_clonedRuleSet_9_use_1_vue_loader_dist_stylePostLoader_js_postcss_loader_dist_cjs_js_clonedRuleSet_9_use_2_vue_multiselect_css_vue_type_style_index_0_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../vue-style-loader/index.js!../../css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!../../vue-loader/dist/stylePostLoader.js!../../postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!./vue-multiselect.css?vue&type=style&index=0&lang=css */ "./node_modules/vue-style-loader/index.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css"); +/* harmony import */ var _vue_style_loader_index_js_css_loader_dist_cjs_js_clonedRuleSet_9_use_1_vue_loader_dist_stylePostLoader_js_postcss_loader_dist_cjs_js_clonedRuleSet_9_use_2_vue_multiselect_css_vue_type_style_index_0_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vue_style_loader_index_js_css_loader_dist_cjs_js_clonedRuleSet_9_use_1_vue_loader_dist_stylePostLoader_js_postcss_loader_dist_cjs_js_clonedRuleSet_9_use_2_vue_multiselect_css_vue_type_style_index_0_lang_css__WEBPACK_IMPORTED_MODULE_0__); +/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {}; +/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _vue_style_loader_index_js_css_loader_dist_cjs_js_clonedRuleSet_9_use_1_vue_loader_dist_stylePostLoader_js_postcss_loader_dist_cjs_js_clonedRuleSet_9_use_2_vue_multiselect_css_vue_type_style_index_0_lang_css__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _vue_style_loader_index_js_css_loader_dist_cjs_js_clonedRuleSet_9_use_1_vue_loader_dist_stylePostLoader_js_postcss_loader_dist_cjs_js_clonedRuleSet_9_use_2_vue_multiselect_css_vue_type_style_index_0_lang_css__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__] +/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__); + + +/***/ }), + +/***/ "./node_modules/vue-multiselect/dist/vue-multiselect.esm.js": +/*!******************************************************************!*\ + !*** ./node_modules/vue-multiselect/dist/vue-multiselect.esm.js ***! + \******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), +/* harmony export */ "Multiselect": () => (/* binding */ script), +/* harmony export */ "multiselectMixin": () => (/* binding */ multiselectMixin), +/* harmony export */ "pointerMixin": () => (/* binding */ pointerMixin) +/* harmony export */ }); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js"); + + +function isEmpty (opt) { + if (opt === 0) return false + if (Array.isArray(opt) && opt.length === 0) return true + return !opt +} + +function not (fun) { + return (...params) => !fun(...params) +} + +function includes (str, query) { + /* istanbul ignore else */ + if (str === undefined) str = 'undefined'; + if (str === null) str = 'null'; + if (str === false) str = 'false'; + const text = str.toString().toLowerCase(); + return text.indexOf(query.trim()) !== -1 +} + +function filterOptions (options, search, label, customLabel) { + return search ? options + .filter((option) => includes(customLabel(option, label), search)) + .sort((a, b) => customLabel(a, label).length - customLabel(b, label).length) : options +} + +function stripGroups (options) { + return options.filter((option) => !option.$isLabel) +} + +function flattenOptions (values, label) { + return (options) => + options.reduce((prev, curr) => { + /* istanbul ignore else */ + if (curr[values] && curr[values].length) { + prev.push({ + $groupLabel: curr[label], + $isLabel: true + }); + return prev.concat(curr[values]) + } + return prev + }, []) +} + +function filterGroups (search, label, values, groupLabel, customLabel) { + return (groups) => + groups.map((group) => { + /* istanbul ignore else */ + if (!group[values]) { + console.warn(`Options passed to vue-multiselect do not contain groups, despite the config.`); + return [] + } + const groupOptions = filterOptions(group[values], search, label, customLabel); + + return groupOptions.length + ? { + [groupLabel]: group[groupLabel], + [values]: groupOptions + } + : [] + }) +} + +const flow = (...fns) => (x) => fns.reduce((v, f) => f(v), x); + +var multiselectMixin = { + data () { + return { + search: '', + isOpen: false, + preferredOpenDirection: 'below', + optimizedHeight: this.maxHeight + } + }, + props: { + /** + * Decide whether to filter the results based on search query. + * Useful for async filtering, where we search through more complex data. + * @type {Boolean} + */ + internalSearch: { + type: Boolean, + default: true + }, + /** + * Array of available options: Objects, Strings or Integers. + * If array of objects, visible label will default to option.label. + * If `labal` prop is passed, label will equal option['label'] + * @type {Array} + */ + options: { + type: Array, + required: true + }, + /** + * Equivalent to the `multiple` attribute on a `` input. + * @default 'Select option' + * @type {String} + */ + placeholder: { + type: String, + default: 'Select option' + }, + /** + * Allow to remove all selected values + * @default true + * @type {Boolean} + */ + allowEmpty: { + type: Boolean, + default: true + }, + /** + * Reset this.internalValue, this.search after this.internalValue changes. + * Useful if want to create a stateless dropdown. + * @default false + * @type {Boolean} + */ + resetAfter: { + type: Boolean, + default: false + }, + /** + * Enable/disable closing after selecting an option + * @default true + * @type {Boolean} + */ + closeOnSelect: { + type: Boolean, + default: true + }, + /** + * Function to interpolate the custom label + * @default false + * @type {Function} + */ + customLabel: { + type: Function, + default (option, label) { + if (isEmpty(option)) return '' + return label ? option[label] : option + } + }, + /** + * Disable / Enable tagging + * @default false + * @type {Boolean} + */ + taggable: { + type: Boolean, + default: false + }, + /** + * String to show when highlighting a potential tag + * @default 'Press enter to create a tag' + * @type {String} + */ + tagPlaceholder: { + type: String, + default: 'Press enter to create a tag' + }, + /** + * By default new tags will appear above the search results. + * Changing to 'bottom' will revert this behaviour + * and will proritize the search results + * @default 'top' + * @type {String} + */ + tagPosition: { + type: String, + default: 'top' + }, + /** + * Number of allowed selected options. No limit if 0. + * @default 0 + * @type {Number} + */ + max: { + type: [Number, Boolean], + default: false + }, + /** + * Will be passed with all events as second param. + * Useful for identifying events origin. + * @default null + * @type {String|Integer} + */ + id: { + default: null + }, + /** + * Limits the options displayed in the dropdown + * to the first X options. + * @default 1000 + * @type {Integer} + */ + optionsLimit: { + type: Number, + default: 1000 + }, + /** + * Name of the property containing + * the group values + * @default 1000 + * @type {String} + */ + groupValues: { + type: String + }, + /** + * Name of the property containing + * the group label + * @default 1000 + * @type {String} + */ + groupLabel: { + type: String + }, + /** + * Allow to select all group values + * by selecting the group label + * @default false + * @type {Boolean} + */ + groupSelect: { + type: Boolean, + default: false + }, + /** + * Array of keyboard keys to block + * when selecting + * @default 1000 + * @type {String} + */ + blockKeys: { + type: Array, + default () { + return [] + } + }, + /** + * Prevent from wiping up the search value + * @default false + * @type {Boolean} + */ + preserveSearch: { + type: Boolean, + default: false + }, + /** + * Select 1st options if value is empty + * @default false + * @type {Boolean} + */ + preselectFirst: { + type: Boolean, + default: false + } + }, + mounted () { + /* istanbul ignore else */ + if (!this.multiple && this.max) { + console.warn('[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false.'); + } + if ( + this.preselectFirst && + !this.internalValue.length && + this.options.length + ) { + this.select(this.filteredOptions[0]); + } + }, + computed: { + internalValue () { + return this.modelValue || this.modelValue === 0 + ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] + : [] + }, + filteredOptions () { + const search = this.search || ''; + const normalizedSearch = search.toLowerCase().trim(); + + let options = this.options.concat(); + + /* istanbul ignore else */ + if (this.internalSearch) { + options = this.groupValues + ? this.filterAndFlat(options, normalizedSearch, this.label) + : filterOptions(options, normalizedSearch, this.label, this.customLabel); + } else { + options = this.groupValues ? flattenOptions(this.groupValues, this.groupLabel)(options) : options; + } + + options = this.hideSelected + ? options.filter(not(this.isSelected)) + : options; + + /* istanbul ignore else */ + if (this.taggable && normalizedSearch.length && !this.isExistingOption(normalizedSearch)) { + if (this.tagPosition === 'bottom') { + options.push({isTag: true, label: search}); + } else { + options.unshift({isTag: true, label: search}); + } + } + + return options.slice(0, this.optionsLimit) + }, + valueKeys () { + if (this.trackBy) { + return this.internalValue.map((element) => element[this.trackBy]) + } else { + return this.internalValue + } + }, + optionKeys () { + const options = this.groupValues ? this.flatAndStrip(this.options) : this.options; + return options.map((element) => this.customLabel(element, this.label).toString().toLowerCase()) + }, + currentOptionLabel () { + return this.multiple + ? this.searchable ? '' : this.placeholder + : this.internalValue.length + ? this.getOptionLabel(this.internalValue[0]) + : this.searchable ? '' : this.placeholder + } + }, + watch: { + internalValue () { + /* istanbul ignore else */ + if (this.resetAfter && this.internalValue.length) { + this.search = ''; + this.$emit('update:modelValue', this.multiple ? [] : null); + } + }, + search () { + this.$emit('search-change', this.search); + } + }, + emits: ['open', 'search-change', 'close', 'select', 'update:modelValue', 'remove', 'tag'], + methods: { + /** + * Returns the internalValue in a way it can be emited to the parent + * @returns {Object||Array||String||Integer} + */ + getValue () { + return this.multiple + ? this.internalValue + : this.internalValue.length === 0 + ? null + : this.internalValue[0] + }, + /** + * Filters and then flattens the options list + * @param {Array} + * @return {Array} returns a filtered and flat options list + */ + filterAndFlat (options, search, label) { + return flow( + filterGroups(search, label, this.groupValues, this.groupLabel, this.customLabel), + flattenOptions(this.groupValues, this.groupLabel) + )(options) + }, + /** + * Flattens and then strips the group labels from the options list + * @param {Array} + * @return {Array} returns a flat options list without group labels + */ + flatAndStrip (options) { + return flow( + flattenOptions(this.groupValues, this.groupLabel), + stripGroups + )(options) + }, + /** + * Updates the search value + * @param {String} + */ + updateSearch (query) { + this.search = query; + }, + /** + * Finds out if the given query is already present + * in the available options + * @param {String} + * @return {Boolean} returns true if element is available + */ + isExistingOption (query) { + return !this.options + ? false + : this.optionKeys.indexOf(query) > -1 + }, + /** + * Finds out if the given element is already present + * in the result value + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is selected + */ + isSelected (option) { + const opt = this.trackBy + ? option[this.trackBy] + : option; + return this.valueKeys.indexOf(opt) > -1 + }, + /** + * Finds out if the given option is disabled + * @param {Object||String||Integer} option passed element to check + * @returns {Boolean} returns true if element is disabled + */ + isOptionDisabled (option) { + return !!option.$isDisabled + }, + /** + * Returns empty string when options is null/undefined + * Returns tag query if option is tag. + * Returns the customLabel() results and casts it to string. + * + * @param {Object||String||Integer} Passed option + * @returns {Object||String} + */ + getOptionLabel (option) { + if (isEmpty(option)) return '' + /* istanbul ignore else */ + if (option.isTag) return option.label + /* istanbul ignore else */ + if (option.$isLabel) return option.$groupLabel + + const label = this.customLabel(option, this.label); + /* istanbul ignore else */ + if (isEmpty(label)) return '' + return label + }, + /** + * Add the given option to the list of selected options + * or sets the option as the selected option. + * If option is already selected -> remove it from the results. + * + * @param {Object||String||Integer} option to select/deselect + * @param {Boolean} block removing + */ + select (option, key) { + /* istanbul ignore else */ + if (option.$isLabel && this.groupSelect) { + this.selectGroup(option); + return + } + if (this.blockKeys.indexOf(key) !== -1 || + this.disabled || + option.$isDisabled || + option.$isLabel + ) return + /* istanbul ignore else */ + if (this.max && this.multiple && this.internalValue.length === this.max) return + /* istanbul ignore else */ + if (key === 'Tab' && !this.pointerDirty) return + if (option.isTag) { + this.$emit('tag', option.label, this.id); + this.search = ''; + if (this.closeOnSelect && !this.multiple) this.deactivate(); + } else { + const isSelected = this.isSelected(option); + + if (isSelected) { + if (key !== 'Tab') this.removeElement(option); + return + } + + this.$emit('select', option, this.id); + + if (this.multiple) { + this.$emit('update:modelValue', this.internalValue.concat([option])); + } else { + this.$emit('update:modelValue', option); + } + + /* istanbul ignore else */ + if (this.clearOnSelect) this.search = ''; + } + /* istanbul ignore else */ + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Add the given group options to the list of selected options + * If all group optiona are already selected -> remove it from the results. + * + * @param {Object||String||Integer} group to select/deselect + */ + selectGroup (selectedGroup) { + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + if (!group) return + + if (this.wholeGroupSelected(group)) { + this.$emit('remove', group[this.groupValues], this.id); + + const newValue = this.internalValue.filter( + (option) => group[this.groupValues].indexOf(option) === -1 + ); + + this.$emit('update:modelValue', newValue); + } else { + const optionsToAdd = group[this.groupValues].filter( + (option) => !(this.isOptionDisabled(option) || this.isSelected(option)) + ); + + this.$emit('select', optionsToAdd, this.id); + this.$emit( + 'update:modelValue', + this.internalValue.concat(optionsToAdd) + ); + } + + if (this.closeOnSelect) this.deactivate(); + }, + /** + * Helper to identify if all values in a group are selected + * + * @param {Object} group to validated selected values against + */ + wholeGroupSelected (group) { + return group[this.groupValues].every((option) => this.isSelected(option) || this.isOptionDisabled(option) + ) + }, + /** + * Helper to identify if all values in a group are disabled + * + * @param {Object} group to check for disabled values + */ + wholeGroupDisabled (group) { + return group[this.groupValues].every(this.isOptionDisabled) + }, + /** + * Removes the given option from the selected options. + * Additionally checks this.allowEmpty prop if option can be removed when + * it is the last selected option. + * + * @param {type} option description + * @return {type} description + */ + removeElement (option, shouldClose = true) { + /* istanbul ignore else */ + if (this.disabled) return + /* istanbul ignore else */ + if (option.$isDisabled) return + /* istanbul ignore else */ + if (!this.allowEmpty && this.internalValue.length <= 1) { + this.deactivate(); + return + } + + const index = typeof option === 'object' + ? this.valueKeys.indexOf(option[this.trackBy]) + : this.valueKeys.indexOf(option); + + this.$emit('remove', option, this.id); + if (this.multiple) { + const newValue = this.internalValue.slice(0, index).concat(this.internalValue.slice(index + 1)); + this.$emit('update:modelValue', newValue); + } else { + this.$emit('update:modelValue', null); + } + + /* istanbul ignore else */ + if (this.closeOnSelect && shouldClose) this.deactivate(); + }, + /** + * Calls this.removeElement() with the last element + * from this.internalValue (selected element Array) + * + * @fires this#removeElement + */ + removeLastElement () { + /* istanbul ignore else */ + if (this.blockKeys.indexOf('Delete') !== -1) return + /* istanbul ignore else */ + if (this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length) { + this.removeElement(this.internalValue[this.internalValue.length - 1], false); + } + }, + /** + * Opens the multiselect’s dropdown. + * Sets this.isOpen to TRUE + */ + activate () { + /* istanbul ignore else */ + if (this.isOpen || this.disabled) return + + this.adjustPosition(); + /* istanbul ignore else */ + if (this.groupValues && this.pointer === 0 && this.filteredOptions.length) { + this.pointer = 1; + } + + this.isOpen = true; + /* istanbul ignore else */ + if (this.searchable) { + if (!this.preserveSearch) this.search = ''; + this.$nextTick(() => this.$refs.search && this.$refs.search.focus()); + } else { + this.$el.focus(); + } + this.$emit('open', this.id); + }, + /** + * Closes the multiselect’s dropdown. + * Sets this.isOpen to FALSE + */ + deactivate () { + /* istanbul ignore else */ + if (!this.isOpen) return + + this.isOpen = false; + /* istanbul ignore else */ + if (this.searchable) { + this.$refs.search && this.$refs.search.blur(); + } else { + this.$el.blur(); + } + if (!this.preserveSearch) this.search = ''; + this.$emit('close', this.getValue(), this.id); + }, + /** + * Call this.activate() or this.deactivate() + * depending on this.isOpen value. + * + * @fires this#activate || this#deactivate + * @property {Boolean} isOpen indicates if dropdown is open + */ + toggle () { + this.isOpen + ? this.deactivate() + : this.activate(); + }, + /** + * Updates the hasEnoughSpace variable used for + * detecting where to expand the dropdown + */ + adjustPosition () { + if (typeof window === 'undefined') return + + const spaceAbove = this.$el.getBoundingClientRect().top; + const spaceBelow = window.innerHeight - this.$el.getBoundingClientRect().bottom; + const hasEnoughSpaceBelow = spaceBelow > this.maxHeight; + + if (hasEnoughSpaceBelow || spaceBelow > spaceAbove || this.openDirection === 'below' || this.openDirection === 'bottom') { + this.preferredOpenDirection = 'below'; + this.optimizedHeight = Math.min(spaceBelow - 40, this.maxHeight); + } else { + this.preferredOpenDirection = 'above'; + this.optimizedHeight = Math.min(spaceAbove - 40, this.maxHeight); + } + } + } +}; + +var pointerMixin = { + data () { + return { + pointer: 0, + pointerDirty: false + } + }, + props: { + /** + * Enable/disable highlighting of the pointed value. + * @type {Boolean} + * @default true + */ + showPointer: { + type: Boolean, + default: true + }, + optionHeight: { + type: Number, + default: 40 + } + }, + computed: { + pointerPosition () { + return this.pointer * this.optionHeight + }, + visibleElements () { + return this.optimizedHeight / this.optionHeight + } + }, + watch: { + filteredOptions () { + this.pointerAdjust(); + }, + isOpen () { + this.pointerDirty = false; + }, + pointer () { + this.$refs.search && this.$refs.search.setAttribute('aria-activedescendant', this.id + '-' + this.pointer.toString()); + } + }, + methods: { + optionHighlight (index, option) { + return { + 'multiselect__option--highlight': index === this.pointer && this.showPointer, + 'multiselect__option--selected': this.isSelected(option) + } + }, + groupHighlight (index, selectedGroup) { + if (!this.groupSelect) { + return [ + 'multiselect__option--disabled', + {'multiselect__option--group': selectedGroup.$isLabel} + ] + } + + const group = this.options.find((option) => { + return option[this.groupLabel] === selectedGroup.$groupLabel + }); + + return group && !this.wholeGroupDisabled(group) ? [ + 'multiselect__option--group', + {'multiselect__option--highlight': index === this.pointer && this.showPointer}, + {'multiselect__option--group-selected': this.wholeGroupSelected(group)} + ] : 'multiselect__option--disabled' + }, + addPointerElement ({key} = 'Enter') { + /* istanbul ignore else */ + if (this.filteredOptions.length > 0) { + this.select(this.filteredOptions[this.pointer], key); + } + this.pointerReset(); + }, + pointerForward () { + /* istanbul ignore else */ + if (this.pointer < this.filteredOptions.length - 1) { + this.pointer++; + /* istanbul ignore next */ + if (this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight) { + this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerBackward () { + if (this.pointer > 0) { + this.pointer--; + /* istanbul ignore else */ + if (this.$refs.list.scrollTop >= this.pointerPosition) { + this.$refs.list.scrollTop = this.pointerPosition; + } + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) this.pointerBackward(); + } else { + /* istanbul ignore else */ + if ( + this.filteredOptions[this.pointer] && + this.filteredOptions[0].$isLabel && + !this.groupSelect + ) this.pointerForward(); + } + this.pointerDirty = true; + }, + pointerReset () { + /* istanbul ignore else */ + if (!this.closeOnSelect) return + this.pointer = 0; + /* istanbul ignore else */ + if (this.$refs.list) { + this.$refs.list.scrollTop = 0; + } + }, + pointerAdjust () { + /* istanbul ignore else */ + if (this.pointer >= this.filteredOptions.length - 1) { + this.pointer = this.filteredOptions.length + ? this.filteredOptions.length - 1 + : 0; + } + + if (this.filteredOptions.length > 0 && + this.filteredOptions[this.pointer].$isLabel && + !this.groupSelect + ) { + this.pointerForward(); + } + }, + pointerSet (index) { + this.pointer = index; + this.pointerDirty = true; + } + } +}; + +var script = { + name: 'vue-multiselect', + mixins: [multiselectMixin, pointerMixin], + props: { + /** + * name attribute to match optional label element + * @default '' + * @type {String} + */ + name: { + type: String, + default: '' + }, + /** + * Presets the selected options value. + * @type {Object||Array||String||Integer} + */ + modelValue: { + type: null, + default () { + return [] + } + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectLabel: { + type: String, + default: 'Press enter to select' + }, + /** + * String to show when pointing to an option + * @default 'Press enter to select' + * @type {String} + */ + selectGroupLabel: { + type: String, + default: 'Press enter to select group' + }, + /** + * String to show next to selected option + * @default 'Selected' + * @type {String} + */ + selectedLabel: { + type: String, + default: 'Selected' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectLabel: { + type: String, + default: 'Press enter to remove' + }, + /** + * String to show when pointing to an already selected option + * @default 'Press enter to remove' + * @type {String} + */ + deselectGroupLabel: { + type: String, + default: 'Press enter to deselect group' + }, + /** + * Decide whether to show pointer labels + * @default true + * @type {Boolean} + */ + showLabels: { + type: Boolean, + default: true + }, + /** + * Limit the display of selected options. The rest will be hidden within the limitText string. + * @default 99999 + * @type {Integer} + */ + limit: { + type: Number, + default: 99999 + }, + /** + * Sets maxHeight style value of the dropdown + * @default 300 + * @type {Integer} + */ + maxHeight: { + type: Number, + default: 300 + }, + /** + * Function that process the message shown when selected + * elements pass the defined limit. + * @default 'and * more' + * @param {Int} count Number of elements more than limit + * @type {Function} + */ + limitText: { + type: Function, + default: (count) => `and ${count} more` + }, + /** + * Set true to trigger the loading spinner. + * @default False + * @type {Boolean} + */ + loading: { + type: Boolean, + default: false + }, + /** + * Disables the multiselect if true. + * @default false + * @type {Boolean} + */ + disabled: { + type: Boolean, + default: false + }, + /** + * Fixed opening direction + * @default '' + * @type {String} + */ + openDirection: { + type: String, + default: '' + }, + /** + * Shows slot with message about empty options + * @default true + * @type {Boolean} + */ + showNoOptions: { + type: Boolean, + default: true + }, + showNoResults: { + type: Boolean, + default: true + }, + tabindex: { + type: Number, + default: 0 + } + }, + computed: { + isSingleLabelVisible () { + return ( + (this.singleValue || this.singleValue === 0) && + (!this.isOpen || !this.searchable) && + !this.visibleValues.length + ) + }, + isPlaceholderVisible () { + return !this.internalValue.length && (!this.searchable || !this.isOpen) + }, + visibleValues () { + return this.multiple ? this.internalValue.slice(0, this.limit) : [] + }, + singleValue () { + return this.internalValue[0] + }, + deselectLabelText () { + return this.showLabels ? this.deselectLabel : '' + }, + deselectGroupLabelText () { + return this.showLabels ? this.deselectGroupLabel : '' + }, + selectLabelText () { + return this.showLabels ? this.selectLabel : '' + }, + selectGroupLabelText () { + return this.showLabels ? this.selectGroupLabel : '' + }, + selectedLabelText () { + return this.showLabels ? this.selectedLabel : '' + }, + inputStyle () { + if ( + this.searchable || + (this.multiple && this.modelValue && this.modelValue.length) + ) { + // Hide input by setting the width to 0 allowing it to receive focus + return this.isOpen + ? {width: '100%'} + : {width: '0', position: 'absolute', padding: '0'} + } + return '' + }, + contentStyle () { + return this.options.length + ? {display: 'inline-block'} + : {display: 'block'} + }, + isAbove () { + if (this.openDirection === 'above' || this.openDirection === 'top') { + return true + } else if ( + this.openDirection === 'below' || + this.openDirection === 'bottom' + ) { + return false + } else { + return this.preferredOpenDirection === 'above' + } + }, + showSearchInput () { + return ( + this.searchable && + (this.hasSingleSelectedSlot && + (this.visibleSingleValue || this.visibleSingleValue === 0) + ? this.isOpen + : true) + ) + } + } +}; + +const _hoisted_1 = { + ref: "tags", + class: "multiselect__tags" +}; +const _hoisted_2 = { class: "multiselect__tags-wrap" }; +const _hoisted_3 = { class: "multiselect__spinner" }; +const _hoisted_4 = { key: 0 }; +const _hoisted_5 = { class: "multiselect__option" }; +const _hoisted_6 = { class: "multiselect__option" }; +const _hoisted_7 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("No elements found. Consider changing the search query."); +const _hoisted_8 = { class: "multiselect__option" }; +const _hoisted_9 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("List is empty."); + +function render(_ctx, _cache, $props, $setup, $data, $options) { + return ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("div", { + tabindex: _ctx.searchable ? -1 : $props.tabindex, + class: [{ 'multiselect--active': _ctx.isOpen, 'multiselect--disabled': $props.disabled, 'multiselect--above': $options.isAbove }, "multiselect"], + onFocus: _cache[14] || (_cache[14] = $event => (_ctx.activate())), + onBlur: _cache[15] || (_cache[15] = $event => (_ctx.searchable ? false : _ctx.deactivate())), + onKeydown: [ + _cache[16] || (_cache[16] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.pointerForward()), ["self","prevent"]), ["down"])), + _cache[17] || (_cache[17] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.pointerBackward()), ["self","prevent"]), ["up"])) + ], + onKeypress: _cache[18] || (_cache[18] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.addPointerElement($event)), ["stop","self"]), ["enter","tab"])), + onKeyup: _cache[19] || (_cache[19] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)($event => (_ctx.deactivate()), ["esc"])), + role: "combobox", + "aria-owns": 'listbox-'+_ctx.id + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "caret", { toggle: _ctx.toggle }, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", { + onMousedown: _cache[1] || (_cache[1] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.toggle()), ["prevent","stop"])), + class: "multiselect__select" + }, null, 32 /* HYDRATE_EVENTS */) + ]), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "clear", { search: _ctx.search }), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_1, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "selection", { + search: _ctx.search, + remove: _ctx.removeElement, + values: $options.visibleValues, + isOpen: _ctx.isOpen + }, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_2, [ + ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.visibleValues, (option, index) => { + return (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "tag", { + option: option, + search: _ctx.search, + remove: _ctx.removeElement + }, () => [ + ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("span", { + class: "multiselect__tag", + key: index + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", { + textContent: (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.getOptionLabel(option)) + }, null, 8 /* PROPS */, ["textContent"]), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("i", { + tabindex: "1", + onKeypress: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.removeElement(option)), ["prevent"]), ["enter"]), + onMousedown: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.removeElement(option)), ["prevent"]), + class: "multiselect__tag-icon" + }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["onKeypress", "onMousedown"]) + ])) + ]) + }), 256 /* UNKEYED_FRAGMENT */)) + ], 512 /* NEED_PATCH */), [ + [vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $options.visibleValues.length > 0] + ]), + (_ctx.internalValue && _ctx.internalValue.length > $props.limit) + ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "limit", { key: 0 }, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("strong", { + class: "multiselect__strong", + textContent: (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.limitText(_ctx.internalValue.length - $props.limit)) + }, null, 8 /* PROPS */, ["textContent"]) + ]) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true) + ]), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, { name: "multiselect__loading" }, { + default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "loading", {}, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", _hoisted_3, null, 512 /* NEED_PATCH */), [ + [vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $props.loading] + ]) + ]) + ]), + _: 3 /* FORWARDED */ + }), + (_ctx.searchable) + ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("input", { + key: 0, + ref: "search", + name: $props.name, + id: _ctx.id, + type: "text", + autocomplete: "off", + spellcheck: "false", + placeholder: _ctx.placeholder, + style: $options.inputStyle, + value: _ctx.search, + disabled: $props.disabled, + tabindex: $props.tabindex, + onInput: _cache[2] || (_cache[2] = $event => (_ctx.updateSearch($event.target.value))), + onFocus: _cache[3] || (_cache[3] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.activate()), ["prevent"])), + onBlur: _cache[4] || (_cache[4] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.deactivate()), ["prevent"])), + onKeyup: _cache[5] || (_cache[5] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)($event => (_ctx.deactivate()), ["esc"])), + onKeydown: [ + _cache[6] || (_cache[6] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.pointerForward()), ["prevent"]), ["down"])), + _cache[7] || (_cache[7] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.pointerBackward()), ["prevent"]), ["up"])), + _cache[9] || (_cache[9] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.removeLastElement()), ["stop"]), ["delete"])) + ], + onKeypress: _cache[8] || (_cache[8] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withKeys)((0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.addPointerElement($event)), ["prevent","stop","self"]), ["enter"])), + class: "multiselect__input", + "aria-controls": 'listbox-'+_ctx.id + }, null, 44 /* STYLE, PROPS, HYDRATE_EVENTS */, ["name", "id", "placeholder", "value", "disabled", "tabindex", "aria-controls"])) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), + ($options.isSingleLabelVisible) + ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("span", { + key: 1, + class: "multiselect__single", + onMousedown: _cache[10] || (_cache[10] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "singleLabel", { option: $options.singleValue }, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.currentOptionLabel), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), + ($options.isPlaceholderVisible) + ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("span", { + key: 2, + class: "multiselect__placeholder", + onMousedown: _cache[11] || (_cache[11] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)((...args) => (_ctx.toggle && _ctx.toggle(...args)), ["prevent"])) + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "placeholder", {}, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.placeholder), 1 /* TEXT */) + ]) + ], 32 /* HYDRATE_EVENTS */)) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true) + ], 512 /* NEED_PATCH */), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, { name: "multiselect" }, { + default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("div", { + class: "multiselect__content-wrapper", + onFocus: _cache[12] || (_cache[12] = (...args) => (_ctx.activate && _ctx.activate(...args))), + tabindex: "-1", + onMousedown: _cache[13] || (_cache[13] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)(() => {}, ["prevent"])), + style: { maxHeight: _ctx.optimizedHeight + 'px' }, + ref: "list" + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("ul", { + class: "multiselect__content", + style: $options.contentStyle, + role: "listbox", + id: 'listbox-'+_ctx.id + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "beforeList"), + (_ctx.multiple && _ctx.max === _ctx.internalValue.length) + ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("li", _hoisted_4, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", _hoisted_5, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "maxElements", {}, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Maximum of " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.max) + " options selected. First remove a selected option to select another.", 1 /* TEXT */) + ]) + ]) + ])) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), + (!_ctx.max || _ctx.internalValue.length < _ctx.max) + ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, { key: 1 }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)(_ctx.filteredOptions, (option, index) => { + return ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("li", { + class: "multiselect__element", + key: index, + id: _ctx.id + '-' + index, + role: !(option && (option.$isLabel || option.$isDisabled)) ? 'option' : null + }, [ + (!(option && (option.$isLabel || option.$isDisabled))) + ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("span", { + key: 0, + class: [_ctx.optionHighlight(index, option), "multiselect__option"], + onClick: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.select(option)), ["stop"]), + onMouseenter: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.pointerSet(index)), ["self"]), + "data-select": option && option.isTag ? _ctx.tagPlaceholder : $options.selectLabelText, + "data-selected": $options.selectedLabelText, + "data-deselect": $options.deselectLabelText + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"])) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), + (option && (option.$isLabel || option.$isDisabled)) + ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)("span", { + key: 1, + "data-select": _ctx.groupSelect && $options.selectGroupLabelText, + "data-deselect": _ctx.groupSelect && $options.deselectGroupLabelText, + class: [_ctx.groupHighlight(index, option), "multiselect__option"], + onMouseenter: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.groupSelect && _ctx.pointerSet(index)), ["self"]), + onMousedown: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => (_ctx.selectGroup(option)), ["prevent"]) + }, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "option", { + option: option, + search: _ctx.search, + index: index + }, () => [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.getOptionLabel(option)), 1 /* TEXT */) + ]) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["data-select", "data-deselect", "onMouseenter", "onMousedown"])) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true) + ], 8 /* PROPS */, ["id", "role"])) + }), 128 /* KEYED_FRAGMENT */)) + : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("li", null, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", _hoisted_6, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "noResult", { search: _ctx.search }, () => [ + _hoisted_7 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $props.showNoResults && (_ctx.filteredOptions.length === 0 && _ctx.search && !$props.loading)] + ]), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("li", null, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)("span", _hoisted_8, [ + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "noOptions", {}, () => [ + _hoisted_9 + ]) + ]) + ], 512 /* NEED_PATCH */), [ + [vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $props.showNoOptions && (_ctx.options.length === 0 && !_ctx.search && !$props.loading)] + ]), + (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "afterList") + ], 12 /* STYLE, PROPS */, ["id"]) + ], 36 /* STYLE, HYDRATE_EVENTS */), [ + [vue__WEBPACK_IMPORTED_MODULE_0__.vShow, _ctx.isOpen] + ]) + ]), + _: 3 /* FORWARDED */ + }) + ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, ["tabindex", "aria-owns"])) +} + +script.render = render; + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (script); + + + +/***/ }), + +/***/ "./node_modules/vue-style-loader/index.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css": +/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-style-loader/index.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-9.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9.use[2]!./node_modules/vue-multiselect/dist/vue-multiselect.css?vue&type=style&index=0&lang=css ***! + \**************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// style-loader: Adds some css to the DOM by adding a \ No newline at end of file diff --git a/resources/js/Pages/Cars/Create.vue b/resources/js/Pages/Cars/Create.vue index 9d3a102..fdadef4 100644 --- a/resources/js/Pages/Cars/Create.vue +++ b/resources/js/Pages/Cars/Create.vue @@ -8,7 +8,7 @@
- + @@ -27,6 +27,9 @@ export default { BreadCrumb, CarForm, }, + props: { + brands: Array, + }, data() { return { meta: { diff --git a/resources/js/Pages/Contacts/Edit.vue b/resources/js/Pages/Contacts/Edit.vue index f304ad7..5cf2433 100644 --- a/resources/js/Pages/Contacts/Edit.vue +++ b/resources/js/Pages/Contacts/Edit.vue @@ -8,15 +8,13 @@
-
- - - - -
+ + + +
diff --git a/routes/web.php b/routes/web.php index b18467a..aea7a79 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,6 +3,8 @@ use Illuminate\Foundation\Application; use App\Http\Controllers\ContactController; use App\Http\Controllers\CarController; +use App\Http\Controllers\BrandController; +use App\Http\Controllers\CarModelController; use Illuminate\Support\Facades\Route; use Inertia\Inertia; @@ -92,4 +94,12 @@ Route::put('cars/{car}', [CarController::class, 'update']) Route::post('cars', [CarController::class, 'store']) ->name('cars.store') + ->middleware(['auth:sanctum', 'verified']); + +Route::post('brands', [BrandController::class, 'store']) + ->name('brands.store') + ->middleware(['auth:sanctum', 'verified']); + +Route::post('models', [CarModelController::class, 'store']) + ->name('models.store') ->middleware(['auth:sanctum', 'verified']); \ No newline at end of file