Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Support Nova 4 and php 8+ #20

Merged
merged 3 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/css/field.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions dist/js/field.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
5 changes: 3 additions & 2 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"/js/field.js": "/js/field.js"
}
"/js/field.js": "/js/field.js",
"/css/field.css": "/css/field.css"
}
5 changes: 1 addition & 4 deletions mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{
"/dist/js/field.js": "/dist/js/field.js",
"/dist/css/field.css": "/dist/css/field.css"
}
{}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"production": "mix --production"
},
"devDependencies": {
"cross-env": "^5.1",
"laravel-mix": "^4.0.7",
"resolve-url-loader": "^2.3.1",
"laravel-mix": "^6.0",
"resolve-url-loader": "^4.0.0",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.6.10"
"vue-loader": "^16.2.0"
},
"dependencies": {
"laravel-nova": "^1.2.0",
"vue": "^2.5.0"
"vue": "^3.0"
}
}
6 changes: 3 additions & 3 deletions resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<field-wrapper>
<FieldWrapper>
<div class="comodolab-help-field-container flex w-full">
<div :class="labelClasses" v-if="field.sideLabel">
<label class="inline-block text-80 leading-tight">
Expand Down Expand Up @@ -29,11 +29,11 @@
</div>
</div>
</div>
</field-wrapper>
</FieldWrapper>
</template>

<script>
import {FormField} from 'laravel-nova'
import { FormField } from 'laravel-nova'

export default {
mixins: [FormField],
Expand Down
10 changes: 7 additions & 3 deletions resources/js/field.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import IndexField from "./components/IndexField";
import DetailField from "./components/DetailField";
import FormField from "./components/FormField";

Nova.booting((Vue, router) => {
Vue.component('index-help', require('./components/IndexField').default);
Vue.component('detail-help', require('./components/DetailField').default);
Vue.component('form-help', require('./components/FormField').default);
Vue.component('index-help', IndexField);
Vue.component('detail-help', DetailField);
Vue.component('form-help', FormField);
})
7 changes: 3 additions & 4 deletions src/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,11 @@ public function alsoOnIndex(): self
}

/**
* Prepare the element for JSON serialization.
* Prepare the field for JSON serialization.
*
* @return array
* @throws Exception
* @return array<string, mixed>
*/
public function jsonSerialize()
public function jsonSerialize(): array
{
$this->validateCollapsible();

Expand Down
13 changes: 10 additions & 3 deletions webpack.mix.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
let mix = require('laravel-mix')

mix.setPublicPath('./')
.js('resources/js/field.js', 'dist/js')
.sass('resources/sass/field.scss', 'dist/css')
mix
.setPublicPath("dist")
.js('resources/js/field.js', 'js')
.sass('resources/sass/field.scss', 'css')
.vue({ version: 3 })
.webpackConfig({
externals: {
vue: 'Vue',
},
})
Loading