Skip to content

Commit

Permalink
Replace props with type declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Oct 9, 2024
1 parent 43b4441 commit ad6476a
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 104 deletions.
51 changes: 20 additions & 31 deletions dist/components-BkCzgJtI.js → dist/components-4EnOdLwu.js
Original file line number Diff line number Diff line change
Expand Up @@ -12114,49 +12114,38 @@ const Yw = /* @__PURE__ */ si(Gw, [["render", Xw]]), Qw = {
}), ly = { class: "uk-table uk-table-striped uk-table-small" }, cy = /* @__PURE__ */ pt({
__name: "SprunjeTable",
props: {
dataUrl: {
type: String,
required: !0
},
hidePagination: {
type: Boolean,
default: !1
},
// TODO : Add type AssociativeArray
defaultSorts: {
default: {}
},
defaultFilters: {
default: {}
},
defaultSize: Number,
defaultPage: Number
dataUrl: {},
hidePagination: { type: Boolean, default: !1 },
defaultSorts: { default: () => ({}) },
defaultFilters: { default: () => ({}) },
defaultSize: { default: 10 },
defaultPage: { default: 0 }
},
setup(i) {
const s = i, a = op(
s.dataUrl,
s.defaultSorts,
s.defaultFilters,
s.defaultSize,
s.defaultPage
), { rows: r, sorts: u } = a;
return console.log("SprunjeTable", s, u), sp("sprunjer", a), (h, f) => (I(), j(Zi, null, [
et(h.$slots, "actions"),
const s = op(
i.dataUrl,
i.defaultSorts,
i.defaultFilters,
i.defaultSize,
i.defaultPage
), { rows: a, sorts: r } = s;
return console.log("SprunjeTable", i.defaultSorts, r), sp("sprunjer", s), (u, h) => (I(), j(Zi, null, [
et(u.$slots, "actions"),
x("table", ly, [
x("thead", null, [
x("tr", null, [
et(h.$slots, "header")
et(u.$slots, "header")
])
]),
x("tbody", null, [
(I(!0), j(Zi, null, Uo(M(r), (g) => (I(), j("tr", {
key: g.id
(I(!0), j(Zi, null, Uo(M(a), (f) => (I(), j("tr", {
key: f.id
}, [
et(h.$slots, "body", { item: g })
et(u.$slots, "body", { item: f })
]))), 128))
])
]),
i.hidePagination ? ht("", !0) : et(h.$slots, "paginator", { key: 0 }, () => [
u.hidePagination ? ht("", !0) : et(u.$slots, "paginator", { key: 0 }, () => [
Ut(qc)
])
], 64));
Expand Down

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-C0qTTOA6.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-DQ4h0dfn.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-BkCzgJtI.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-4EnOdLwu.js";
export {
s as AlertContainer,
e as AppLink,
Expand Down
62 changes: 23 additions & 39 deletions dist/components/Sprunjer/SprunjeTable.vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,29 @@ declare function __VLS_template(): {
attrs: Partial<{}>;
};
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
dataUrl: {
type: StringConstructor;
required: true;
};
hidePagination: {
type: BooleanConstructor;
default: boolean;
};
defaultSorts: {
default: {};
};
defaultFilters: {
default: {};
};
defaultSize: NumberConstructor;
defaultPage: NumberConstructor;
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
dataUrl: {
type: StringConstructor;
required: true;
};
hidePagination: {
type: BooleanConstructor;
default: boolean;
};
defaultSorts: {
default: {};
};
defaultFilters: {
default: {};
};
defaultSize: NumberConstructor;
defaultPage: NumberConstructor;
}>> & Readonly<{}>, {
hidePagination: boolean;
defaultSorts: {};
defaultFilters: {};
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
declare const __VLS_component: import('vue').DefineComponent<{
dataUrl: string;
hidePagination?: boolean;
defaultSorts?: {
[key: string]: string;
};
defaultFilters?: {
[key: string]: string;
};
defaultSize?: number;
defaultPage?: number;
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
dataUrl: string;
hidePagination?: boolean;
defaultSorts?: {
[key: string]: string;
};
defaultFilters?: {
[key: string]: string;
};
defaultSize?: number;
defaultPage?: number;
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
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-BkCzgJtI.js";
import { c as is, g as fs, U as ts, P as rs } from "./components-4EnOdLwu.js";
import { defineComponent as t2, computed as y, watch as zs, h as W3 } from "vue";
const x3 = () => {
};
Expand Down
50 changes: 21 additions & 29 deletions src/components/Sprunjer/SprunjeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,31 @@ import { provide } from 'vue'
import { useSprunjer } from '@userfrosting/sprinkle-core/sprunjer'
import SprunjePaginator from './SprunjePaginator.vue'
// interface AssociativeArray {
// [key: string]: string;
// }
const props = defineProps({
dataUrl: {
type: String,
required: true
},
hidePagination: {
type: Boolean,
default: false
},
// TODO : Add type AssociativeArray
defaultSorts: {
default: {}
},
defaultFilters: {
default: {}
},
defaultSize: Number,
defaultPage: Number
})
const {
dataUrl,
hidePagination = false,
defaultSorts = {},
defaultFilters = {},
defaultSize = 10,
defaultPage = 0
} = defineProps<{
dataUrl: string
hidePagination?: boolean
defaultSorts?: { [key: string]: string }
defaultFilters?: { [key: string]: string }
defaultSize?: number
defaultPage?: number
}>()
const sprunjer = useSprunjer(
props.dataUrl,
props.defaultSorts,
props.defaultFilters,
props.defaultSize,
props.defaultPage
dataUrl,
defaultSorts,
defaultFilters,
defaultSize,
defaultPage
)
const { rows, sorts } = sprunjer
console.log("SprunjeTable", props, sorts)
console.log("SprunjeTable", defaultSorts, sorts)
provide('sprunjer', sprunjer)
</script>
Expand Down

0 comments on commit ad6476a

Please sign in to comment.