Giter Site home page Giter Site logo

craniums's Introduction

@craniums/vue

Headless Laravel Vue components and mixins

Install

Within your resources/js/app.js file:

import Cranium from '@craniums/vue';
createApp({
    ...
})
    .mixin({ methods: { route } })
    .use(InertiaPlugin)
    .use(Cranium) <---
    .mount(el);

add the following to your tailwind config content array:

'./node_modules/@craniums/vue/src/**/*.vue',

craniums's People

Contributors

dillingham avatar

Stargazers

 avatar

Forkers

m-app

craniums's Issues

Table: sort option

<Table :fields="['title', 'body']" :sort="['title']"/>

Makes the header cell clickable and toggles sort=title and sort-desc=title

Pagination: load more mode

Currently Items/Table.vue and items/List.vue etc use pagination with page numbers. Lets add a pagination parameter to their mixin Items.js that allows paginate="more" which would pass to the Pagination.vue component and instead of showing page numbers.. it just axios requests the next link and appends the current result set instead of changing navigating.

Items: output prop

You can pass a template slot to override an output..

Would be cool to pass an object of functions to format outputs

:cells="['display']"
:output="{ 'display': formatFitment }"

Im thinking it probably should be in :cells or :fields also

[
    {
        key: 'display',
        output: this.functionName
    }
]

Same results structure

Make autocomplete and seeker and any other result set from official apis default to display and value item displays so search results can be autocomplete also

filters with modifiers

already made just documenting

<component
    :is="field.component"
    v-bind="vModelProps"
/>
vModelProps = {
min: values.min,
'onUpdate:min': (value) => values.min = value,
max: values.max,
'onUpdate:max': (value) => values.max = value
}

Here vModelProps would be a computed created dynamically from the keys.

Pagination: simple mode

The default pagination is page number links.

Would be nice to just have [ < ] [ > ] buttos :paginate="simple"

Repeater: make fields slots

Default should be Field 1 label and html inputs etc

<repeater
    name="things"
    :errors="errors"
    :fields="['field_1', 'field_2']"
    v-model="values.things"
/>

Then you can override a single field

<repeater
    name="things"
    :errors="errors"
    :fields="['field_1', 'field_2']"
    v-model="values.things"
>
    <template #field.field_1="{ value, error }">
        <input v-model="value" id="custom" />
    </template>

    <template #field.field_2.all="{ value, error }">
        <label>adding .all overrides the label and error message</label>
        <input v-model="value" id="custom" />
    </template>
</repeater>

or you can override the entire row

<repeater
    name="things"
    :errors="errors"
    :fields="['field_1', 'field_2']"
    v-model="values.things"
>
    <template #row="{ row, errors }">
        <input v-model="row.field_1"  />
        <input v-model="row.field_2"  />
    </template>
</repeater>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.