golden-logic-ui 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DeleteConfirmationModal-CpcanNi1.js +52 -0
- package/dist/TailwindPagination-CiCE_Fwm.js +260 -0
- package/dist/golden-logic-ui.js +21 -2271
- package/dist/golden-logic-ui.umd.cjs +7 -3
- package/dist/main-2vuS0XER.js +3721 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { openBlock as n, createElementBlock as l, createElementVNode as e, createCommentVNode as r, createStaticVNode as m } from "vue";
|
|
2
|
+
import { _ as d } from "./main-2vuS0XER.js";
|
|
3
|
+
const a = {
|
|
4
|
+
props: ["isOpen"],
|
|
5
|
+
methods: {
|
|
6
|
+
confirmDeletion() {
|
|
7
|
+
this.$emit("confirm-delete");
|
|
8
|
+
},
|
|
9
|
+
cancelDeletion() {
|
|
10
|
+
this.$emit("cancel-delete");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}, c = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "fixed inset-0 z-50 overflow-y-auto",
|
|
16
|
+
"aria-labelledby": "modal-title",
|
|
17
|
+
role: "dialog",
|
|
18
|
+
"aria-modal": "true"
|
|
19
|
+
}, f = { class: "flex items-end justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0" }, u = /* @__PURE__ */ e("div", {
|
|
20
|
+
class: "fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}, null, -1), x = /* @__PURE__ */ e("span", {
|
|
23
|
+
class: "hidden sm:inline-block sm:align-middle sm:h-screen",
|
|
24
|
+
"aria-hidden": "true"
|
|
25
|
+
}, "", -1), g = { class: "inline-block overflow-hidden text-left align-bottom transition-all transform bg-white rounded-lg shadow-xl sm:my-8 sm:align-middle sm:max-w-lg sm:w-full" }, p = /* @__PURE__ */ m('<div class="px-4 pt-5 pb-4 bg-white sm:p-6 sm:pb-4"><div class="sm:flex sm:items-start"><div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"><h3 class="text-lg font-medium leading-6 text-gray-900" id="modal-title"> Confirm Deletion </h3><div class="mt-2"><p class="text-sm text-gray-500"> Are you sure you want to delete this item? This action cannot be undone. </p></div></div></div></div>', 1), b = { class: "px-4 py-3 bg-gray-50 sm:px-6 sm:flex sm:flex-row-reverse" };
|
|
26
|
+
function h(y, t, o, _, v, s) {
|
|
27
|
+
return o.isOpen ? (n(), l("div", c, [
|
|
28
|
+
e("div", f, [
|
|
29
|
+
u,
|
|
30
|
+
x,
|
|
31
|
+
e("div", g, [
|
|
32
|
+
p,
|
|
33
|
+
e("div", b, [
|
|
34
|
+
e("button", {
|
|
35
|
+
onClick: t[0] || (t[0] = (...i) => s.confirmDeletion && s.confirmDeletion(...i)),
|
|
36
|
+
type: "button",
|
|
37
|
+
class: "inline-flex justify-center w-full px-4 py-2 text-base font-medium text-white bg-red-600 border border-transparent rounded-md shadow-sm hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"
|
|
38
|
+
}, " Delete "),
|
|
39
|
+
e("button", {
|
|
40
|
+
onClick: t[1] || (t[1] = (...i) => s.cancelDeletion && s.cancelDeletion(...i)),
|
|
41
|
+
type: "button",
|
|
42
|
+
class: "inline-flex justify-center w-full px-4 py-2 mt-3 text-base font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
|
|
43
|
+
}, " Cancel ")
|
|
44
|
+
])
|
|
45
|
+
])
|
|
46
|
+
])
|
|
47
|
+
])) : r("", !0);
|
|
48
|
+
}
|
|
49
|
+
const k = /* @__PURE__ */ d(a, [["render", h]]);
|
|
50
|
+
export {
|
|
51
|
+
k as default
|
|
52
|
+
};
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { resolveComponent as b, openBlock as s, createBlock as k, withCtx as _, createElementVNode as r, createElementBlock as l, createTextVNode as h, toDisplayString as u, createCommentVNode as c, mergeProps as p, normalizeClass as m, toHandlers as f, renderSlot as y, Fragment as P, renderList as w } from "vue";
|
|
2
|
+
import { _ as R } from "./main-2vuS0XER.js";
|
|
3
|
+
const U = {
|
|
4
|
+
emits: ["pagination-change-page"],
|
|
5
|
+
props: {
|
|
6
|
+
data: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => {
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
limit: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 0
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
isApiResource() {
|
|
18
|
+
return !!this.data.meta;
|
|
19
|
+
},
|
|
20
|
+
currentPage() {
|
|
21
|
+
return this.isApiResource ? this.data.meta.current_page : this.data.current_page;
|
|
22
|
+
},
|
|
23
|
+
firstPageUrl() {
|
|
24
|
+
return this.isApiResource ? this.data.links.first : null;
|
|
25
|
+
},
|
|
26
|
+
from() {
|
|
27
|
+
return this.isApiResource ? this.data.meta.from : this.data.from;
|
|
28
|
+
},
|
|
29
|
+
lastPage() {
|
|
30
|
+
return this.isApiResource ? this.data.meta.last_page : this.data.last_page;
|
|
31
|
+
},
|
|
32
|
+
lastPageUrl() {
|
|
33
|
+
return this.isApiResource ? this.data.links.last : null;
|
|
34
|
+
},
|
|
35
|
+
nextPageUrl() {
|
|
36
|
+
return this.isApiResource ? this.data.links.next : this.data.next_page_url;
|
|
37
|
+
},
|
|
38
|
+
perPage() {
|
|
39
|
+
return this.isApiResource ? this.data.meta.per_page : this.data.per_page;
|
|
40
|
+
},
|
|
41
|
+
prevPageUrl() {
|
|
42
|
+
return this.isApiResource ? this.data.links.prev : this.data.prev_page_url;
|
|
43
|
+
},
|
|
44
|
+
to() {
|
|
45
|
+
return this.isApiResource ? this.data.meta.to : this.data.to;
|
|
46
|
+
},
|
|
47
|
+
total() {
|
|
48
|
+
return this.isApiResource ? this.data.meta.total : this.data.total;
|
|
49
|
+
},
|
|
50
|
+
pageRange() {
|
|
51
|
+
if (this.limit === -1)
|
|
52
|
+
return 0;
|
|
53
|
+
if (this.limit === 0)
|
|
54
|
+
return this.lastPage;
|
|
55
|
+
for (var t = this.currentPage, g = this.lastPage, i = this.limit, x = t - i, v = t + i + 1, d = [], n = [], e, a = 1; a <= g; a++)
|
|
56
|
+
(a === 1 || a === g || a >= x && a < v) && d.push(a);
|
|
57
|
+
return d.forEach(function(o) {
|
|
58
|
+
e && (o - e === 2 ? n.push(e + 1) : o - e !== 1 && n.push("...")), n.push(o), e = o;
|
|
59
|
+
}), n;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
methods: {
|
|
63
|
+
previousPage() {
|
|
64
|
+
this.selectPage(this.currentPage - 1);
|
|
65
|
+
},
|
|
66
|
+
nextPage() {
|
|
67
|
+
this.selectPage(this.currentPage + 1);
|
|
68
|
+
},
|
|
69
|
+
selectPage(t) {
|
|
70
|
+
t !== "..." && this.$emit("pagination-change-page", t);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
render() {
|
|
74
|
+
return this.$slots.default({
|
|
75
|
+
data: this.data,
|
|
76
|
+
limit: this.limit,
|
|
77
|
+
computed: {
|
|
78
|
+
isApiResource: this.isApiResource,
|
|
79
|
+
currentPage: this.currentPage,
|
|
80
|
+
firstPageUrl: this.firstPageUrl,
|
|
81
|
+
from: this.from,
|
|
82
|
+
lastPage: this.lastPage,
|
|
83
|
+
lastPageUrl: this.lastPageUrl,
|
|
84
|
+
nextPageUrl: this.nextPageUrl,
|
|
85
|
+
perPage: this.perPage,
|
|
86
|
+
prevPageUrl: this.prevPageUrl,
|
|
87
|
+
to: this.to,
|
|
88
|
+
total: this.total,
|
|
89
|
+
pageRange: this.pageRange
|
|
90
|
+
},
|
|
91
|
+
prevButtonEvents: {
|
|
92
|
+
click: (t) => {
|
|
93
|
+
t.preventDefault(), this.previousPage();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
nextButtonEvents: {
|
|
97
|
+
click: (t) => {
|
|
98
|
+
t.preventDefault(), this.nextPage();
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
pageButtonEvents: (t) => ({
|
|
102
|
+
click: (g) => {
|
|
103
|
+
g.preventDefault(), this.selectPage(t);
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}, A = {
|
|
109
|
+
compatConfig: {
|
|
110
|
+
MODE: 3
|
|
111
|
+
},
|
|
112
|
+
inheritAttrs: !1,
|
|
113
|
+
emits: ["pagination-change-page"],
|
|
114
|
+
components: {
|
|
115
|
+
RenderlessPagination: U
|
|
116
|
+
},
|
|
117
|
+
props: {
|
|
118
|
+
data: {
|
|
119
|
+
type: Object,
|
|
120
|
+
default: () => {
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
limit: {
|
|
124
|
+
type: Number,
|
|
125
|
+
default: 0
|
|
126
|
+
},
|
|
127
|
+
showDisabled: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: !1
|
|
130
|
+
},
|
|
131
|
+
size: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: "default",
|
|
134
|
+
validator: (t) => ["small", "default", "large"].indexOf(t) !== -1
|
|
135
|
+
},
|
|
136
|
+
align: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: "left",
|
|
139
|
+
validator: (t) => ["left", "center", "right"].indexOf(t) !== -1
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
methods: {
|
|
143
|
+
onPaginationChangePage(t) {
|
|
144
|
+
this.$emit("pagination-change-page", t);
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
mounted() {
|
|
148
|
+
}
|
|
149
|
+
}, B = { class: "flex flex-col items-center" }, C = {
|
|
150
|
+
key: 0,
|
|
151
|
+
class: "text-sm text-gray-700 dark:text-gray-400"
|
|
152
|
+
}, E = { class: "font-semibold text-gray-900 dark:text-white" }, j = { class: "font-semibold text-gray-900 dark:text-white" }, D = { class: "font-semibold text-gray-900 dark:text-white" }, N = ["tabindex"], z = /* @__PURE__ */ r("span", { class: "sr-only" }, "Previous", -1), O = /* @__PURE__ */ r("svg", {
|
|
153
|
+
class: "w-2.5 h-2.5 rtl:rotate-180",
|
|
154
|
+
"aria-hidden": "true",
|
|
155
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
156
|
+
fill: "none",
|
|
157
|
+
viewBox: "0 0 6 10"
|
|
158
|
+
}, [
|
|
159
|
+
/* @__PURE__ */ r("path", {
|
|
160
|
+
stroke: "currentColor",
|
|
161
|
+
"stroke-linecap": "round",
|
|
162
|
+
"stroke-linejoin": "round",
|
|
163
|
+
"stroke-width": "2",
|
|
164
|
+
d: "M5 1 1 5l4 4"
|
|
165
|
+
})
|
|
166
|
+
], -1), S = ["aria-current"], V = ["tabindex"], M = /* @__PURE__ */ r("span", { class: "sr-only" }, "Next", -1), T = /* @__PURE__ */ r("svg", {
|
|
167
|
+
class: "w-2.5 h-2.5 rtl:rotate-180",
|
|
168
|
+
"aria-hidden": "true",
|
|
169
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
170
|
+
fill: "none",
|
|
171
|
+
viewBox: "0 0 6 10"
|
|
172
|
+
}, [
|
|
173
|
+
/* @__PURE__ */ r("path", {
|
|
174
|
+
stroke: "currentColor",
|
|
175
|
+
"stroke-linecap": "round",
|
|
176
|
+
"stroke-linejoin": "round",
|
|
177
|
+
"stroke-width": "2",
|
|
178
|
+
d: "m1 9 4-4-4-4"
|
|
179
|
+
})
|
|
180
|
+
], -1);
|
|
181
|
+
function $(t, g, i, x, v, d) {
|
|
182
|
+
const n = b("RenderlessPagination");
|
|
183
|
+
return s(), k(n, {
|
|
184
|
+
data: i.data,
|
|
185
|
+
limit: i.limit,
|
|
186
|
+
onPaginationChangePage: d.onPaginationChangePage
|
|
187
|
+
}, {
|
|
188
|
+
default: _((e) => [
|
|
189
|
+
r("div", B, [
|
|
190
|
+
e.computed.total > e.computed.perPage ? (s(), l("span", C, [
|
|
191
|
+
h(" Showing "),
|
|
192
|
+
r("span", E, u(e.computed.from), 1),
|
|
193
|
+
h(" to "),
|
|
194
|
+
r("span", j, u(e.computed.to), 1),
|
|
195
|
+
h(" of "),
|
|
196
|
+
r("span", D, u(e.computed.total), 1),
|
|
197
|
+
h(" Entries ")
|
|
198
|
+
])) : c("", !0),
|
|
199
|
+
e.computed.total > e.computed.perPage ? (s(), l("ul", p({ key: 1 }, t.$attrs, {
|
|
200
|
+
class: ["flex items-center h-8 -space-x-px text-sm", {
|
|
201
|
+
"pagination-sm": i.size == "small",
|
|
202
|
+
"pagination-lg": i.size == "large",
|
|
203
|
+
"justify-content-center": i.align == "center",
|
|
204
|
+
"justify-content-end": i.align == "right"
|
|
205
|
+
}]
|
|
206
|
+
}), [
|
|
207
|
+
e.computed.prevPageUrl || i.showDisabled ? (s(), l("li", {
|
|
208
|
+
key: 0,
|
|
209
|
+
class: m(["flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white", { disabled: !e.computed.prevPageUrl }])
|
|
210
|
+
}, [
|
|
211
|
+
r("a", p({
|
|
212
|
+
class: "page-link",
|
|
213
|
+
href: "#",
|
|
214
|
+
"aria-label": "Previous",
|
|
215
|
+
tabindex: !e.computed.prevPageUrl && -1
|
|
216
|
+
}, f(e.prevButtonEvents, !0)), [
|
|
217
|
+
y(t.$slots, "prev-nav", {}, () => [
|
|
218
|
+
z,
|
|
219
|
+
O
|
|
220
|
+
])
|
|
221
|
+
], 16, N)
|
|
222
|
+
], 2)) : c("", !0),
|
|
223
|
+
(s(!0), l(P, null, w(e.computed.pageRange, (a, o) => (s(), l("li", {
|
|
224
|
+
class: m(["", { active: a == e.computed.currentPage }]),
|
|
225
|
+
key: o
|
|
226
|
+
}, [
|
|
227
|
+
r("a", p({
|
|
228
|
+
class: "",
|
|
229
|
+
href: "#"
|
|
230
|
+
}, f(e.pageButtonEvents(a), !0), {
|
|
231
|
+
"aria-current": a == e.computed.currentPage ? "page" : null,
|
|
232
|
+
class: a == e.computed.currentPage ? "z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white" : "flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
233
|
+
}), u(a), 17, S)
|
|
234
|
+
], 2))), 128)),
|
|
235
|
+
e.computed.nextPageUrl || i.showDisabled ? (s(), l("li", {
|
|
236
|
+
key: 1,
|
|
237
|
+
class: m(["flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white", { disabled: !e.computed.nextPageUrl }])
|
|
238
|
+
}, [
|
|
239
|
+
r("a", p({
|
|
240
|
+
class: "",
|
|
241
|
+
href: "#",
|
|
242
|
+
"aria-label": "Next",
|
|
243
|
+
tabindex: !e.computed.nextPageUrl && -1
|
|
244
|
+
}, f(e.nextButtonEvents, !0)), [
|
|
245
|
+
y(t.$slots, "next-nav", {}, () => [
|
|
246
|
+
M,
|
|
247
|
+
T
|
|
248
|
+
])
|
|
249
|
+
], 16, V)
|
|
250
|
+
], 2)) : c("", !0)
|
|
251
|
+
], 16)) : c("", !0)
|
|
252
|
+
])
|
|
253
|
+
]),
|
|
254
|
+
_: 3
|
|
255
|
+
}, 8, ["data", "limit", "onPaginationChangePage"]);
|
|
256
|
+
}
|
|
257
|
+
const L = /* @__PURE__ */ R(A, [["render", $]]);
|
|
258
|
+
export {
|
|
259
|
+
L as default
|
|
260
|
+
};
|