chore: fix code style

This commit is contained in:
danharrin
2023-02-16 14:18:40 +00:00
committed by github-actions[bot]
parent 1c594ff534
commit 2ab3806bbf
20 changed files with 114602 additions and 181 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1,52 @@
function keyValueFormComponent({state}){return{state,rows:[],shouldUpdateRows:!0,init:function(){this.updateRows(),this.rows.length<=0&&this.addRow(),this.shouldUpdateRows=!0,this.$watch("state",()=>{if(!this.shouldUpdateRows){this.shouldUpdateRows=!0;return}this.updateRows()})},addRow:function(){this.rows.push({key:"",value:""}),this.updateState()},deleteRow:function(index){this.rows.splice(index,1),this.rows.length<=0&&this.addRow(),this.updateState(),this.shouldUpdateRows=!0},reorderRows:function(event){let rows=Alpine.raw(this.rows),reorderedRow=rows.splice(event.oldIndex,1)[0];rows.splice(event.newIndex,0,reorderedRow),this.rows=rows,this.updateState()},updateRows:function(){let rows=[];for(let[key,value]of Object.entries(this.state??{}))rows.push({key,value});this.rows=rows},updateState:function(){let state2={};this.rows.forEach(row=>{row.key===""||row.key===null||(state2[row.key]=row.value)}),this.shouldUpdateRows=!1,this.state=state2}}}export{keyValueFormComponent as default};
function keyValueFormComponent({ state }) {
return {
state,
rows: [],
shouldUpdateRows: !0,
init: function () {
this.updateRows(),
this.rows.length <= 0 && this.addRow(),
(this.shouldUpdateRows = !0),
this.$watch('state', () => {
if (!this.shouldUpdateRows) {
this.shouldUpdateRows = !0
return
}
this.updateRows()
})
},
addRow: function () {
this.rows.push({ key: '', value: '' }), this.updateState()
},
deleteRow: function (index) {
this.rows.splice(index, 1),
this.rows.length <= 0 && this.addRow(),
this.updateState(),
(this.shouldUpdateRows = !0)
},
reorderRows: function (event) {
let rows = Alpine.raw(this.rows),
reorderedRow = rows.splice(event.oldIndex, 1)[0]
rows.splice(event.newIndex, 0, reorderedRow),
(this.rows = rows),
this.updateState()
},
updateRows: function () {
let rows = []
for (let [key, value] of Object.entries(this.state ?? {}))
rows.push({ key, value })
this.rows = rows
},
updateState: function () {
let state2 = {}
this.rows.forEach((row) => {
row.key === '' ||
row.key === null ||
(state2[row.key] = row.value)
}),
(this.shouldUpdateRows = !1),
(this.state = state2)
},
}
}
export { keyValueFormComponent as default }
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1,19 @@
function tagsInputFormComponent({state}){return{newTag:"",state,createTag:function(){if(this.newTag=this.newTag.trim(),this.newTag!==""){if(this.state.includes(this.newTag)){this.newTag="";return}this.state.push(this.newTag),this.newTag=""}},deleteTag:function(tagToDelete){this.state=this.state.filter(tag=>tag!==tagToDelete)}}}export{tagsInputFormComponent as default};
function tagsInputFormComponent({ state }) {
return {
newTag: '',
state,
createTag: function () {
if (((this.newTag = this.newTag.trim()), this.newTag !== '')) {
if (this.state.includes(this.newTag)) {
this.newTag = ''
return
}
this.state.push(this.newTag), (this.newTag = '')
}
},
deleteTag: function (tagToDelete) {
this.state = this.state.filter((tag) => tag !== tagToDelete)
},
}
}
export { tagsInputFormComponent as default }
File diff suppressed because one or more lines are too long
@@ -1 +1,15 @@
function textareaFormComponent(){return{init:function(){this.$nextTick(()=>{this.render()})},render:function(){this.$el.scrollHeight>0&&(this.$el.style.height="150px",this.$el.style.height=this.$el.scrollHeight+2+"px")}}}export{textareaFormComponent as default};
function textareaFormComponent() {
return {
init: function () {
this.$nextTick(() => {
this.render()
})
},
render: function () {
this.$el.scrollHeight > 0 &&
((this.$el.style.height = '150px'),
(this.$el.style.height = this.$el.scrollHeight + 2 + 'px'))
},
}
}
export { textareaFormComponent as default }
File diff suppressed because one or more lines are too long
@@ -1 +1,209 @@
var u=t=>new Promise(e=>{window.addEventListener("async-alpine:load",s=>{s.detail.id===t.id&&e()})}),a=u,_=()=>new Promise(t=>{"requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t,200)}),l=_,c=t=>new Promise(e=>{let s=t.indexOf("("),i=t.slice(s),n=window.matchMedia(i);n.matches?e():n.addEventListener("change",e,{once:!0})}),d=c,f=(t,e)=>new Promise(s=>{let i="0px 0px 0px 0px";if(e.indexOf("(")!==-1){let o=e.indexOf("(")+1;i=e.slice(o,-1)}let n=new IntersectionObserver(o=>{o[0].isIntersecting&&(n.disconnect(),s())},{rootMargin:i});n.observe(t.el)}),p=f,h="__internal_",r={Alpine:null,_options:{prefix:"ax-",alpinePrefix:"x-",root:"load",inline:"load-src",defaultStrategy:"immediate"},_alias:!1,_data:{},_realIndex:0,get _index(){return this._realIndex++},init(t,e={}){return this.Alpine=t,this._options={...this._options,...e},this},start(){return this._processInline(),this._setupComponents(),this._mutations(),this},data(t,e=!1){return this._data[t]={loaded:!1,download:e},this},url(t,e){!t||!e||(this._data[t]||this.data(t),this._data[t].download=()=>import(this._parseUrl(e)))},alias(t){this._alias=t},_processInline(){let t=document.querySelectorAll(`[${this._options.prefix}${this._options.inline}]`);for(let e of t)this._inlineElement(e)},_inlineElement(t){let e=t.getAttribute(`${this._options.alpinePrefix}data`),s=t.getAttribute(`${this._options.prefix}${this._options.inline}`);if(!e||!s)return;let i=this._parseName(e);this.url(i,s)},_setupComponents(){let t=document.querySelectorAll(`[${this._options.prefix}${this._options.root}]`);for(let e of t)this._setupComponent(e)},_setupComponent(t){let e=t.getAttribute(`${this._options.alpinePrefix}data`);t.setAttribute(`${this._options.alpinePrefix}ignore`,"");let s=this._parseName(e),i=t.getAttribute(`${this._options.prefix}${this._options.root}`)||this._options.defaultStrategy;this._componentStrategy({name:s,strategy:i,el:t,id:t.id||this._index})},async _componentStrategy(t){let e=t.strategy.split("|").map(i=>i.trim()).filter(i=>i!=="immediate").filter(i=>i!=="eager");if(!e.length){await this._download(t.name),this._activate(t);return}let s=[];for(let i of e){if(i==="idle"){s.push(l());continue}if(i.startsWith("visible")){s.push(p(t,i));continue}if(i.startsWith("media")){s.push(d(i));continue}i==="event"&&s.push(a(t))}Promise.all(s).then(async()=>{await this._download(t.name),this._activate(t)})},async _download(t){if(t.startsWith(h)||(this._handleAlias(t),!this._data[t]||this._data[t].loaded))return;let e=await this._getModule(t);this.Alpine.data(t,e),this._data[t].loaded=!0},async _getModule(t){if(!this._data[t])return;let e=await this._data[t].download();return typeof e=="function"?e:e[t]||e.default||Object.values(e)[0]||!1},_activate(t){t.el.removeAttribute(`${this._options.alpinePrefix}ignore`),t.el._x_ignore=!1,this.Alpine.initTree(t.el)},_mutations(){new MutationObserver(e=>{for(let s of e)if(s.addedNodes)for(let i of s.addedNodes)i.nodeType===1&&(i.hasAttribute(`${this._options.prefix}${this._options.root}`)&&this._mutationEl(i),i.querySelectorAll(`[${this._options.prefix}${this._options.root}]`).forEach(o=>this._mutationEl(o)))}).observe(document,{attributes:!0,childList:!0,subtree:!0})},_mutationEl(t){t.hasAttribute(`${this._options.prefix}${this._options.inline}`)&&this._inlineElement(t),this._setupComponent(t)},_handleAlias(t){!this._alias||this._data[t]||this.url(t,this._alias.replace("[name]",t))},_parseName(t){return(t||"").split(/[({]/g)[0]||`${h}${this._index}`},_parseUrl(t){return new RegExp("^(?:[a-z+]+:)?//","i").test(t)?t:new URL(t,document.baseURI).href}};document.addEventListener("alpine:init",()=>{window.AsyncAlpine=r,r.init(Alpine,window.AsyncAlpineOptions||{}),document.dispatchEvent(new CustomEvent("async-alpine:init")),r.start()});
var u = (t) =>
new Promise((e) => {
window.addEventListener('async-alpine:load', (s) => {
s.detail.id === t.id && e()
})
}),
a = u,
_ = () =>
new Promise((t) => {
'requestIdleCallback' in window
? window.requestIdleCallback(t)
: setTimeout(t, 200)
}),
l = _,
c = (t) =>
new Promise((e) => {
let s = t.indexOf('('),
i = t.slice(s),
n = window.matchMedia(i)
n.matches ? e() : n.addEventListener('change', e, { once: !0 })
}),
d = c,
f = (t, e) =>
new Promise((s) => {
let i = '0px 0px 0px 0px'
if (e.indexOf('(') !== -1) {
let o = e.indexOf('(') + 1
i = e.slice(o, -1)
}
let n = new IntersectionObserver(
(o) => {
o[0].isIntersecting && (n.disconnect(), s())
},
{ rootMargin: i },
)
n.observe(t.el)
}),
p = f,
h = '__internal_',
r = {
Alpine: null,
_options: {
prefix: 'ax-',
alpinePrefix: 'x-',
root: 'load',
inline: 'load-src',
defaultStrategy: 'immediate',
},
_alias: !1,
_data: {},
_realIndex: 0,
get _index() {
return this._realIndex++
},
init(t, e = {}) {
return (
(this.Alpine = t),
(this._options = { ...this._options, ...e }),
this
)
},
start() {
return (
this._processInline(),
this._setupComponents(),
this._mutations(),
this
)
},
data(t, e = !1) {
return (this._data[t] = { loaded: !1, download: e }), this
},
url(t, e) {
!t ||
!e ||
(this._data[t] || this.data(t),
(this._data[t].download = () => import(this._parseUrl(e))))
},
alias(t) {
this._alias = t
},
_processInline() {
let t = document.querySelectorAll(
`[${this._options.prefix}${this._options.inline}]`,
)
for (let e of t) this._inlineElement(e)
},
_inlineElement(t) {
let e = t.getAttribute(`${this._options.alpinePrefix}data`),
s = t.getAttribute(
`${this._options.prefix}${this._options.inline}`,
)
if (!e || !s) return
let i = this._parseName(e)
this.url(i, s)
},
_setupComponents() {
let t = document.querySelectorAll(
`[${this._options.prefix}${this._options.root}]`,
)
for (let e of t) this._setupComponent(e)
},
_setupComponent(t) {
let e = t.getAttribute(`${this._options.alpinePrefix}data`)
t.setAttribute(`${this._options.alpinePrefix}ignore`, '')
let s = this._parseName(e),
i =
t.getAttribute(
`${this._options.prefix}${this._options.root}`,
) || this._options.defaultStrategy
this._componentStrategy({
name: s,
strategy: i,
el: t,
id: t.id || this._index,
})
},
async _componentStrategy(t) {
let e = t.strategy
.split('|')
.map((i) => i.trim())
.filter((i) => i !== 'immediate')
.filter((i) => i !== 'eager')
if (!e.length) {
await this._download(t.name), this._activate(t)
return
}
let s = []
for (let i of e) {
if (i === 'idle') {
s.push(l())
continue
}
if (i.startsWith('visible')) {
s.push(p(t, i))
continue
}
if (i.startsWith('media')) {
s.push(d(i))
continue
}
i === 'event' && s.push(a(t))
}
Promise.all(s).then(async () => {
await this._download(t.name), this._activate(t)
})
},
async _download(t) {
if (
t.startsWith(h) ||
(this._handleAlias(t), !this._data[t] || this._data[t].loaded)
)
return
let e = await this._getModule(t)
this.Alpine.data(t, e), (this._data[t].loaded = !0)
},
async _getModule(t) {
if (!this._data[t]) return
let e = await this._data[t].download()
return typeof e == 'function'
? e
: e[t] || e.default || Object.values(e)[0] || !1
},
_activate(t) {
t.el.removeAttribute(`${this._options.alpinePrefix}ignore`),
(t.el._x_ignore = !1),
this.Alpine.initTree(t.el)
},
_mutations() {
new MutationObserver((e) => {
for (let s of e)
if (s.addedNodes)
for (let i of s.addedNodes)
i.nodeType === 1 &&
(i.hasAttribute(
`${this._options.prefix}${this._options.root}`,
) && this._mutationEl(i),
i
.querySelectorAll(
`[${this._options.prefix}${this._options.root}]`,
)
.forEach((o) => this._mutationEl(o)))
}).observe(document, { attributes: !0, childList: !0, subtree: !0 })
},
_mutationEl(t) {
t.hasAttribute(`${this._options.prefix}${this._options.inline}`) &&
this._inlineElement(t),
this._setupComponent(t)
},
_handleAlias(t) {
!this._alias ||
this._data[t] ||
this.url(t, this._alias.replace('[name]', t))
},
_parseName(t) {
return (t || '').split(/[({]/g)[0] || `${h}${this._index}`
},
_parseUrl(t) {
return new RegExp('^(?:[a-z+]+:)?//', 'i').test(t)
? t
: new URL(t, document.baseURI).href
},
}
document.addEventListener('alpine:init', () => {
;(window.AsyncAlpine = r),
r.init(Alpine, window.AsyncAlpineOptions || {}),
document.dispatchEvent(new CustomEvent('async-alpine:init')),
r.start()
})
File diff suppressed because one or more lines are too long
@@ -1 +1,88 @@
(()=>{function src_default(Alpine){Alpine.directive("collapse",collapse),collapse.inline=(el,{modifiers})=>{!modifiers.includes("min")||(el._x_doShow=()=>{},el._x_doHide=()=>{})};function collapse(el,{modifiers}){let duration=modifierValue(modifiers,"duration",250)/1e3,floor=modifierValue(modifiers,"min",0),fullyHide=!modifiers.includes("min");el._x_isShown||(el.style.height=`${floor}px`),!el._x_isShown&&fullyHide&&(el.hidden=!0),el._x_isShown||(el.style.overflow="hidden");let setFunction=(el2,styles)=>{let revertFunction=Alpine.setStyles(el2,styles);return styles.height?()=>{}:revertFunction},transitionStyles={transitionProperty:"height",transitionDuration:`${duration}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};el._x_transition={in(before=()=>{},after=()=>{}){fullyHide&&(el.hidden=!1),fullyHide&&(el.style.display=null);let current=el.getBoundingClientRect().height;el.style.height="auto";let full=el.getBoundingClientRect().height;current===full&&(current=floor),Alpine.transition(el,Alpine.setStyles,{during:transitionStyles,start:{height:current+"px"},end:{height:full+"px"}},()=>el._x_isShown=!0,()=>{el.getBoundingClientRect().height==full&&(el.style.overflow=null)})},out(before=()=>{},after=()=>{}){let full=el.getBoundingClientRect().height;Alpine.transition(el,setFunction,{during:transitionStyles,start:{height:full+"px"},end:{height:floor+"px"}},()=>el.style.overflow="hidden",()=>{el._x_isShown=!1,el.style.height==`${floor}px`&&fullyHide&&(el.style.display="none",el.hidden=!0)})}}}}function modifierValue(modifiers,key,fallback){if(modifiers.indexOf(key)===-1)return fallback;let rawValue=modifiers[modifiers.indexOf(key)+1];if(!rawValue)return fallback;if(key==="duration"){let match=rawValue.match(/([0-9]+)ms/);if(match)return match[1]}if(key==="min"){let match=rawValue.match(/([0-9]+)px/);if(match)return match[1]}return rawValue}var module_default=src_default;document.addEventListener("alpine:init",()=>{window.Alpine.plugin(module_default)});})();
;(() => {
function src_default(Alpine) {
Alpine.directive('collapse', collapse),
(collapse.inline = (el, { modifiers }) => {
!modifiers.includes('min') ||
((el._x_doShow = () => {}), (el._x_doHide = () => {}))
})
function collapse(el, { modifiers }) {
let duration = modifierValue(modifiers, 'duration', 250) / 1e3,
floor = modifierValue(modifiers, 'min', 0),
fullyHide = !modifiers.includes('min')
el._x_isShown || (el.style.height = `${floor}px`),
!el._x_isShown && fullyHide && (el.hidden = !0),
el._x_isShown || (el.style.overflow = 'hidden')
let setFunction = (el2, styles) => {
let revertFunction = Alpine.setStyles(el2, styles)
return styles.height ? () => {} : revertFunction
},
transitionStyles = {
transitionProperty: 'height',
transitionDuration: `${duration}s`,
transitionTimingFunction: 'cubic-bezier(0.4, 0.0, 0.2, 1)',
}
el._x_transition = {
in(before = () => {}, after = () => {}) {
fullyHide && (el.hidden = !1),
fullyHide && (el.style.display = null)
let current = el.getBoundingClientRect().height
el.style.height = 'auto'
let full = el.getBoundingClientRect().height
current === full && (current = floor),
Alpine.transition(
el,
Alpine.setStyles,
{
during: transitionStyles,
start: { height: current + 'px' },
end: { height: full + 'px' },
},
() => (el._x_isShown = !0),
() => {
el.getBoundingClientRect().height == full &&
(el.style.overflow = null)
},
)
},
out(before = () => {}, after = () => {}) {
let full = el.getBoundingClientRect().height
Alpine.transition(
el,
setFunction,
{
during: transitionStyles,
start: { height: full + 'px' },
end: { height: floor + 'px' },
},
() => (el.style.overflow = 'hidden'),
() => {
;(el._x_isShown = !1),
el.style.height == `${floor}px` &&
fullyHide &&
((el.style.display = 'none'),
(el.hidden = !0))
},
)
},
}
}
}
function modifierValue(modifiers, key, fallback) {
if (modifiers.indexOf(key) === -1) return fallback
let rawValue = modifiers[modifiers.indexOf(key) + 1]
if (!rawValue) return fallback
if (key === 'duration') {
let match = rawValue.match(/([0-9]+)ms/)
if (match) return match[1]
}
if (key === 'min') {
let match = rawValue.match(/([0-9]+)px/)
if (match) return match[1]
}
return rawValue
}
var module_default = src_default
document.addEventListener('alpine:init', () => {
window.Alpine.plugin(module_default)
})
})()
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5 -2
View File
@@ -38,12 +38,15 @@ for (const [file, options] of Object.entries(schema)) {
configure()
function configure(php = null) {
fs.writeFileSync('../app/app/Providers/Filament/configure.php', `<?php
fs.writeFileSync(
'../app/app/Providers/Filament/configure.php',
`<?php
use Filament\\Context;
return function (Context $context) {
${php ?? '//'}
};
`)
`,
)
}