Skip to content

Commit

Permalink
Add searchColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Oct 12, 2024
1 parent e2a0de3 commit de5f978
Show file tree
Hide file tree
Showing 10 changed files with 988 additions and 917 deletions.
1,841 changes: 932 additions & 909 deletions dist/components-BxdKuVWZ.js → dist/components-639tEumM.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/components.cjs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./components-DH_oX1BP.cjs");exports.AlertContainer=a._sfc_main;exports.AppLink=a._sfc_main$1;exports.CardBox=a._sfc_main$3;exports.CardBoxBig=a._sfc_main$4;exports.FooterContent=a.FooterContent;exports.FormForgotPassword=a._sfc_main$8;exports.FormLogin=a._sfc_main$6;exports.FormRegister=a._sfc_main$7;exports.HeaderPage=a._sfc_main$5;exports.InfoBox=a._sfc_main$2;exports.MainContent=a.MainContent;exports.NavBar=a._sfc_main$9;exports.NavBarDropdown=a._sfc_main$10;exports.NavBarDropdownSeparator=a.NavBarDropdownSeparator;exports.NavBarItem=a._sfc_main$11;exports.NavBarLogin=a._sfc_main$12;exports.NavBarUserCard=a._sfc_main$13;exports.NavBarUserCardButton=a._sfc_main$14;exports.PageForgotPassword=a._sfc_main$17;exports.PageLogin=a._sfc_main$15;exports.PageRegister=a._sfc_main$16;exports.PageResendVerification=a._sfc_main$18;exports.SideBar=a.SideBar;exports.SideBarDropdown=a._sfc_main$19;exports.SideBarItem=a._sfc_main$20;exports.SideBarLabel=a._sfc_main$21;exports.SprunjeColumn=a.SprunjeColumn;exports.SprunjeHeader=a._sfc_main$22;exports.SprunjePaginator=a._sfc_main$23;exports.SprunjeTable=a._sfc_main$24;exports.default=a.PinkCupcakeComponents;
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./components-DCMRm6aV.cjs");exports.AlertContainer=a._sfc_main;exports.AppLink=a._sfc_main$1;exports.CardBox=a._sfc_main$3;exports.CardBoxBig=a._sfc_main$4;exports.FooterContent=a.FooterContent;exports.FormForgotPassword=a._sfc_main$8;exports.FormLogin=a._sfc_main$6;exports.FormRegister=a._sfc_main$7;exports.HeaderPage=a._sfc_main$5;exports.InfoBox=a._sfc_main$2;exports.MainContent=a.MainContent;exports.NavBar=a._sfc_main$9;exports.NavBarDropdown=a._sfc_main$10;exports.NavBarDropdownSeparator=a.NavBarDropdownSeparator;exports.NavBarItem=a._sfc_main$11;exports.NavBarLogin=a._sfc_main$12;exports.NavBarUserCard=a._sfc_main$13;exports.NavBarUserCardButton=a._sfc_main$14;exports.PageForgotPassword=a._sfc_main$17;exports.PageLogin=a._sfc_main$15;exports.PageRegister=a._sfc_main$16;exports.PageResendVerification=a._sfc_main$18;exports.SideBar=a.SideBar;exports.SideBarDropdown=a._sfc_main$19;exports.SideBarItem=a._sfc_main$20;exports.SideBarLabel=a._sfc_main$21;exports.SprunjeColumn=a.SprunjeColumn;exports.SprunjeHeader=a._sfc_main$22;exports.SprunjePaginator=a._sfc_main$23;exports.SprunjeTable=a._sfc_main$24;exports.default=a.PinkCupcakeComponents;
2 changes: 1 addition & 1 deletion dist/components.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _ as s, a as e, d as o, e as n, F as t, j as d, h as i, i as B, f as g, b as p, M as S, k as P, l as m, N as u, m as v, n as C, o as N, p as F, s as l, q as w, r as f, t as j, S as x, u as L, v as b, w as A, x as D, y as I, z as R, A as k, P as H } from "./components-BxdKuVWZ.js";
import { _ as s, a as e, d as o, e as n, F as t, j as d, h as i, i as B, f as g, b as p, M as S, k as P, l as m, N as u, m as v, n as C, o as N, p as F, s as l, q as w, r as f, t as j, S as x, u as L, v as b, w as A, x as D, y as I, z as R, A as k, P as H } from "./components-639tEumM.js";
export {
s as AlertContainer,
e as AppLink,
Expand Down
3 changes: 3 additions & 0 deletions dist/components/Sprunjer/SprunjeTable.vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
declare function __VLS_template(): {
slots: {
actions?(_: {}): any;
filters?(_: {}): any;
header?(_: {}): any;
body?(_: {
item: any;
Expand All @@ -22,6 +23,7 @@ declare const __VLS_component: import('vue').DefineComponent<{
};
defaultSize?: number;
defaultPage?: number;
searchColumn?: string;
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
dataUrl: string;
hidePagination?: boolean;
Expand All @@ -33,6 +35,7 @@ declare const __VLS_component: import('vue').DefineComponent<{
};
defaultSize?: number;
defaultPage?: number;
searchColumn?: string;
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/plugins.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { c as is, g as fs, U as ts, P as rs } from "./components-BxdKuVWZ.js";
import { c as is, g as fs, U as ts, P as rs } from "./components-639tEumM.js";
import { defineComponent as t2, computed as y, watch as zs, h as W3 } from "vue";
const x3 = () => {
};
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

31 changes: 31 additions & 0 deletions src/components/Sprunjer/SprunjeSearch.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script setup lang="ts">
import type { Sprunjer } from '@userfrosting/sprinkle-core/sprunjer'
import { inject, ref, watch } from 'vue'
const props = defineProps({
column: {
type: String,
required: true
}
})
const filterValue = ref('')
const sprunjer = inject('sprunjer') as Sprunjer
const { filters } = sprunjer
watch(filterValue, () => {
filters.value[props.column] = filterValue.value
})
</script>

<template>
<div class="uk-search uk-search-default" v-if="column">
<input
class="uk-search-input uk-form-small"
type="search"
:placeholder="'Search ' + column + '...'"
aria-label="Search"
v-model="filterValue" />
<span class="uk-search-icon-flip" uk-search-icon></span>
</div>
</template>
18 changes: 16 additions & 2 deletions src/components/Sprunjer/SprunjeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,45 @@
import { provide } from 'vue'
import { useSprunjer } from '@userfrosting/sprinkle-core/sprunjer'
import SprunjePaginator from './SprunjePaginator.vue'
import { useSlots } from 'vue'
const {
dataUrl,
hidePagination = false,
defaultSorts = {},
defaultFilters = {},
defaultSize = 10,
defaultPage = 0
defaultPage = 0,
searchColumn = null
} = defineProps<{
dataUrl: string
hidePagination?: boolean
defaultSorts?: { [key: string]: string }
defaultFilters?: { [key: string]: string }
defaultSize?: number
defaultPage?: number
searchColumn?: string
}>()
const sprunjer = useSprunjer(() => dataUrl, defaultSorts, defaultFilters, defaultSize, defaultPage)
const { rows } = sprunjer
const slots = useSlots()
provide('sprunjer', sprunjer)
</script>

<template>
<slot name="actions"></slot>
<div uk-grid class="uk-child-width-1-2" v-if="slots.actions || slots.filters">
<div class="uk-text-left" v-if="slots.actions">
<slot name="actions"></slot>
</div>
<div class="uk-text-right" v-if="slots.filters">
<slot name="filters">
<SprunjeSearch :column="searchColumn" />
<!-- <SprunjeFilter /> -->
</slot>
</div>
</div>
<table class="uk-table uk-table-striped uk-table-small">
<thead>
<tr>
Expand Down

0 comments on commit de5f978

Please sign in to comment.