sm-click-library-ui 0.0.3 → 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.
@@ -1,108 +1,108 @@
1
- import { getCurrentScope as P, onScopeDispose as V, unref as j, watch as I, ref as S, computed as b, openBlock as v, createElementBlock as g, createElementVNode as f, toDisplayString as x, normalizeClass as C, renderSlot as L, createCommentVNode as y } from "vue";
2
- function F(t) {
3
- return P() ? (V(t), !0) : !1;
1
+ import { getCurrentScope as z, onScopeDispose as M, unref as j, watch as P, ref as S, computed as k, openBlock as m, createElementBlock as _, createElementVNode as s, toDisplayString as O, normalizeClass as C, renderSlot as y, createCommentVNode as g } from "vue";
2
+ function B(e) {
3
+ return z() ? (M(e), !0) : !1;
4
4
  }
5
- function E(t) {
6
- return typeof t == "function" ? t() : j(t);
5
+ function A(e) {
6
+ return typeof e == "function" ? e() : j(e);
7
7
  }
8
- const O = typeof window < "u" && typeof document < "u";
8
+ const E = typeof window < "u" && typeof document < "u";
9
9
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
10
- const W = Object.prototype.toString, B = (t) => W.call(t) === "[object Object]", _ = () => {
11
- }, H = /* @__PURE__ */ M();
12
- function M() {
13
- var t, i;
14
- return O && ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((i = window == null ? void 0 : window.navigator) == null ? void 0 : i.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
10
+ const I = Object.prototype.toString, V = (e) => I.call(e) === "[object Object]", b = () => {
11
+ }, F = /* @__PURE__ */ W();
12
+ function W() {
13
+ var e, i;
14
+ return E && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((i = window == null ? void 0 : window.navigator) == null ? void 0 : i.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
15
15
  }
16
- function w(t) {
16
+ function w(e) {
17
17
  var i;
18
- const s = E(t);
19
- return (i = s == null ? void 0 : s.$el) != null ? i : s;
18
+ const l = A(e);
19
+ return (i = l == null ? void 0 : l.$el) != null ? i : l;
20
20
  }
21
- const z = O ? window : void 0;
22
- function k(...t) {
23
- let i, s, n, r;
24
- if (typeof t[0] == "string" || Array.isArray(t[0]) ? ([s, n, r] = t, i = z) : [i, s, n, r] = t, !i)
25
- return _;
26
- Array.isArray(s) || (s = [s]), Array.isArray(n) || (n = [n]);
27
- const a = [], p = () => {
28
- a.forEach((c) => c()), a.length = 0;
29
- }, d = (c, u, o, e) => (c.addEventListener(u, o, e), () => c.removeEventListener(u, o, e)), m = I(
30
- () => [w(i), E(r)],
31
- ([c, u]) => {
32
- if (p(), !c)
21
+ const L = E ? window : void 0;
22
+ function x(...e) {
23
+ let i, l, n, c;
24
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([l, n, c] = e, i = L) : [i, l, n, c] = e, !i)
25
+ return b;
26
+ Array.isArray(l) || (l = [l]), Array.isArray(n) || (n = [n]);
27
+ const r = [], p = () => {
28
+ r.forEach((d) => d()), r.length = 0;
29
+ }, f = (d, u, o, t) => (d.addEventListener(u, o, t), () => d.removeEventListener(u, o, t)), h = P(
30
+ () => [w(i), A(c)],
31
+ ([d, u]) => {
32
+ if (p(), !d)
33
33
  return;
34
- const o = B(u) ? { ...u } : u;
35
- a.push(
36
- ...s.flatMap((e) => n.map((l) => d(c, e, l, o)))
34
+ const o = V(u) ? { ...u } : u;
35
+ r.push(
36
+ ...l.flatMap((t) => n.map((a) => f(d, t, a, o)))
37
37
  );
38
38
  },
39
39
  { immediate: !0, flush: "post" }
40
- ), h = () => {
41
- m(), p();
40
+ ), v = () => {
41
+ h(), p();
42
42
  };
43
- return F(h), h;
43
+ return B(v), v;
44
44
  }
45
- let A = !1;
46
- function D(t, i, s = {}) {
47
- const { window: n = z, ignore: r = [], capture: a = !0, detectIframe: p = !1 } = s;
45
+ let $ = !1;
46
+ function H(e, i, l = {}) {
47
+ const { window: n = L, ignore: c = [], capture: r = !0, detectIframe: p = !1 } = l;
48
48
  if (!n)
49
- return _;
50
- H && !A && (A = !0, Array.from(n.document.body.children).forEach((o) => o.addEventListener("click", _)), n.document.documentElement.addEventListener("click", _));
51
- let d = !0;
52
- const m = (o) => r.some((e) => {
53
- if (typeof e == "string")
54
- return Array.from(n.document.querySelectorAll(e)).some((l) => l === o.target || o.composedPath().includes(l));
49
+ return b;
50
+ F && !$ && ($ = !0, Array.from(n.document.body.children).forEach((o) => o.addEventListener("click", b)), n.document.documentElement.addEventListener("click", b));
51
+ let f = !0;
52
+ const h = (o) => c.some((t) => {
53
+ if (typeof t == "string")
54
+ return Array.from(n.document.querySelectorAll(t)).some((a) => a === o.target || o.composedPath().includes(a));
55
55
  {
56
- const l = w(e);
57
- return l && (o.target === l || o.composedPath().includes(l));
56
+ const a = w(t);
57
+ return a && (o.target === a || o.composedPath().includes(a));
58
58
  }
59
- }), c = [
60
- k(n, "click", (o) => {
61
- const e = w(t);
62
- if (!(!e || e === o.target || o.composedPath().includes(e))) {
63
- if (o.detail === 0 && (d = !m(o)), !d) {
64
- d = !0;
59
+ }), d = [
60
+ x(n, "click", (o) => {
61
+ const t = w(e);
62
+ if (!(!t || t === o.target || o.composedPath().includes(t))) {
63
+ if (o.detail === 0 && (f = !h(o)), !f) {
64
+ f = !0;
65
65
  return;
66
66
  }
67
67
  i(o);
68
68
  }
69
- }, { passive: !0, capture: a }),
70
- k(n, "pointerdown", (o) => {
71
- const e = w(t);
72
- d = !m(o) && !!(e && !o.composedPath().includes(e));
69
+ }, { passive: !0, capture: r }),
70
+ x(n, "pointerdown", (o) => {
71
+ const t = w(e);
72
+ f = !h(o) && !!(t && !o.composedPath().includes(t));
73
73
  }, { passive: !0 }),
74
- p && k(n, "blur", (o) => {
74
+ p && x(n, "blur", (o) => {
75
75
  setTimeout(() => {
76
- var e;
77
- const l = w(t);
78
- ((e = n.document.activeElement) == null ? void 0 : e.tagName) === "IFRAME" && !(l != null && l.contains(n.document.activeElement)) && i(o);
76
+ var t;
77
+ const a = w(e);
78
+ ((t = n.document.activeElement) == null ? void 0 : t.tagName) === "IFRAME" && !(a != null && a.contains(n.document.activeElement)) && i(o);
79
79
  }, 0);
80
80
  })
81
81
  ].filter(Boolean);
82
- return () => c.forEach((o) => o());
82
+ return () => d.forEach((o) => o());
83
83
  }
84
- const N = {
84
+ const D = {
85
85
  key: 0,
86
86
  class: "line-clamp-2 uppercase text-xs truncate text-white"
87
- }, T = {
87
+ }, N = {
88
88
  key: 1,
89
89
  class: "line-clamp-2 uppercase text-xs truncate text-white"
90
- }, G = /* @__PURE__ */ f("path", {
90
+ }, T = /* @__PURE__ */ s("path", {
91
91
  "fill-rule": "evenodd",
92
92
  d: "M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z",
93
93
  "clip-rule": "evenodd"
94
- }, null, -1), $ = [
95
- G
94
+ }, null, -1), G = [
95
+ T
96
96
  ], q = {
97
97
  key: 0,
98
98
  class: "select_widget"
99
- }, R = { key: 0 }, Z = {
99
+ }, R = { key: 0 }, U = {
100
100
  key: 1,
101
101
  class: "space-y-2"
102
- }, J = /* @__PURE__ */ f("p", { class: "line-clamp-2 uppercase text-xs truncate" }, "Vertical", -1), K = [
103
- J
104
- ], Q = /* @__PURE__ */ f("p", { class: "line-clamp-2 uppercase text-xs truncate" }, "Horizontal", -1), U = [
105
- Q
102
+ }, Z = /* @__PURE__ */ s("p", { class: "line-clamp-2 uppercase text-xs truncate" }, "Vertical", -1), J = [
103
+ Z
104
+ ], K = /* @__PURE__ */ s("p", { class: "line-clamp-2 uppercase text-xs truncate" }, "Horizontal", -1), Q = [
105
+ K
106
106
  ], X = {
107
107
  __name: "primary_select",
108
108
  props: {
@@ -119,63 +119,121 @@ const N = {
119
119
  }
120
120
  },
121
121
  emits: ["closeSelect"],
122
- setup(t, { emit: i }) {
123
- const s = t, n = i, r = S(!1), a = S("Horizontal"), p = S(null), d = b(() => s.selectConfig.length > 0), m = b(
124
- () => s.selectConfig.some((e) => e.chartsConfig)
125
- ), h = b(
126
- () => s.selectConfig.some((e) => e.freeSlot)
127
- ), c = () => {
128
- r.value = !r.value;
129
- }, u = (e) => {
130
- r.value = !1, a.value = e === "horizontal" ? "Vertical" : "Horizontal", n("closeSelect", e);
122
+ setup(e, { emit: i }) {
123
+ const l = e, n = i, c = S(!1), r = S("Horizontal"), p = S(null), f = k(() => l.selectConfig.length > 0), h = k(
124
+ () => l.selectConfig.some((t) => t.chartsConfig)
125
+ ), v = k(
126
+ () => l.selectConfig.some((t) => t.freeSlot)
127
+ ), d = () => {
128
+ c.value = !c.value;
129
+ }, u = (t) => {
130
+ c.value = !1, r.value = t === "horizontal" ? "Vertical" : "Horizontal", n("closeSelect", t);
131
131
  };
132
- return D(p, () => {
133
- r.value && (r.value = !1);
134
- }), (e, l) => d.value ? (v(), g("div", {
132
+ return H(p, () => {
133
+ c.value && (c.value = !1);
134
+ }), (t, a) => f.value ? (m(), _("div", {
135
135
  key: 0,
136
136
  ref_key: "target",
137
137
  ref: p,
138
138
  class: "relative w-full"
139
139
  }, [
140
- f("button", {
141
- onClick: c,
140
+ s("button", {
141
+ onClick: d,
142
142
  class: "bg-base-100 z-10 truncate flex items-center justify-between gap-6 p-2 rounded-md lg:mt-0 w-full shadow-md shadow-base-300"
143
143
  }, [
144
- f("div", null, [
145
- m.value ? (v(), g("p", N, x(a.value), 1)) : (v(), g("p", T, x(t.titleFreeSlot), 1))
144
+ s("div", null, [
145
+ h.value ? (m(), _("p", D, O(r.value), 1)) : (m(), _("p", N, O(e.titleFreeSlot), 1))
146
146
  ]),
147
- f("div", null, [
148
- (v(), g("svg", {
149
- class: C([r.value ? "rotate-180 transition-transform ease-in-out" : "", "w-3 h-3 text-white"]),
147
+ s("div", null, [
148
+ (m(), _("svg", {
149
+ class: C([c.value ? "rotate-180 transition-transform ease-in-out" : "", "w-3 h-3 text-white"]),
150
150
  xmlns: "http://www.w3.org/2000/svg",
151
151
  fill: "currentColor",
152
152
  viewBox: "0 0 24 24"
153
- }, $, 2))
153
+ }, G, 2))
154
154
  ])
155
155
  ]),
156
- r.value ? (v(), g("section", q, [
157
- h.value ? (v(), g("div", R, [
158
- L(e.$slots, "free-slot")
159
- ])) : y("", !0),
160
- m.value ? (v(), g("div", Z, [
161
- f("button", {
162
- class: C([a.value === "Vertical" ? "bg-green-500" : "", "btn_select_widget"]),
163
- onClick: l[0] || (l[0] = () => u("horizontal"))
164
- }, K, 2),
165
- f("button", {
166
- class: C([a.value !== "Vertical" ? "bg-green-500" : "", "btn_select_widget"]),
167
- onClick: l[1] || (l[1] = () => u("vertical"))
168
- }, U, 2)
169
- ])) : y("", !0)
170
- ])) : y("", !0)
171
- ], 512)) : y("", !0);
156
+ c.value ? (m(), _("section", q, [
157
+ v.value ? (m(), _("div", R, [
158
+ y(t.$slots, "free-slot")
159
+ ])) : g("", !0),
160
+ h.value ? (m(), _("div", U, [
161
+ s("button", {
162
+ class: C([r.value === "Vertical" ? "bg-green-500" : "", "btn_select_widget"]),
163
+ onClick: a[0] || (a[0] = () => u("horizontal"))
164
+ }, J, 2),
165
+ s("button", {
166
+ class: C([r.value !== "Vertical" ? "bg-green-500" : "", "btn_select_widget"]),
167
+ onClick: a[1] || (a[1] = () => u("vertical"))
168
+ }, Q, 2)
169
+ ])) : g("", !0)
170
+ ])) : g("", !0)
171
+ ], 512)) : g("", !0);
172
+ }
173
+ }, Y = {
174
+ key: 0,
175
+ class: "modal_head"
176
+ }, ee = /* @__PURE__ */ s("div", { class: "modal-overlay absolute h-full bg-gray-600 w-full opacity-70" }, null, -1), te = { class: "modal_responsive" }, oe = { class: "flex min-h-full items-center justify-center text-center sm:p-0" }, se = { class: "modal_size lg:w-2/6" }, ne = { class: "modal_background" }, le = { class: "modal_tittle text-current" }, ie = /* @__PURE__ */ s("svg", {
177
+ class: "h-5 w-5",
178
+ fill: "currentColor",
179
+ viewBox: "0 0 20 20",
180
+ xmlns: "http://www.w3.org/2000/svg"
181
+ }, [
182
+ /* @__PURE__ */ s("path", {
183
+ "fill-rule": "evenodd",
184
+ d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
185
+ "clip-rule": "evenodd"
186
+ })
187
+ ], -1), ae = [
188
+ ie
189
+ ], ce = { class: "p-4" }, re = { class: "w-full" }, de = { class: "block" }, ue = { class: "modal_end_button" }, pe = {
190
+ __name: "simple_modal",
191
+ props: {
192
+ isOpen: Boolean,
193
+ default: !1
194
+ },
195
+ emits: ["update:isOpen"],
196
+ setup(e, { emit: i }) {
197
+ const l = e, n = i, c = () => {
198
+ n("update:isOpen", !l.isOpen);
199
+ };
200
+ return (r, p) => e.isOpen ? (m(), _("div", Y, [
201
+ ee,
202
+ s("div", te, [
203
+ s("div", oe, [
204
+ s("div", se, [
205
+ s("div", ne, [
206
+ s("div", le, [
207
+ y(r.$slots, "header"),
208
+ s("button", {
209
+ onClick: c,
210
+ class: "modal_close_button",
211
+ "data-modal-toggle": "editUserModal"
212
+ }, ae)
213
+ ]),
214
+ s("div", ce, [
215
+ s("div", re, [
216
+ s("label", de, [
217
+ y(r.$slots, "body")
218
+ ])
219
+ ])
220
+ ]),
221
+ s("div", ue, [
222
+ y(r.$slots, "footer")
223
+ ])
224
+ ])
225
+ ])
226
+ ])
227
+ ])
228
+ ])) : g("", !0);
172
229
  }
173
230
  };
174
- function Y(t) {
175
- t.component("primarySelect", X);
231
+ function fe(e) {
232
+ e.component("primarySelect", X), e.component("simpleModal", pe);
176
233
  }
177
- const te = { install: Y };
234
+ const _e = { install: fe };
178
235
  export {
179
- te as default,
180
- X as primarySelect
236
+ _e as default,
237
+ X as primarySelect,
238
+ pe as simpleModal
181
239
  };
@@ -1 +1 @@
1
- (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f["sm-click-library-ui"]={},f.Vue))})(this,function(f,e){"use strict";function V(o){return e.getCurrentScope()?(e.onScopeDispose(o),!0):!1}function k(o){return typeof o=="function"?o():e.unref(o)}const S=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const x=Object.prototype.toString,B=o=>x.call(o)==="[object Object]",w=()=>{},A=N();function N(){var o,r;return S&&((o=window==null?void 0:window.navigator)==null?void 0:o.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((r=window==null?void 0:window.navigator)==null?void 0:r.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function g(o){var r;const s=k(o);return(r=s==null?void 0:s.$el)!=null?r:s}const E=S?window:void 0;function y(...o){let r,s,l,c;if(typeof o[0]=="string"||Array.isArray(o[0])?([s,l,c]=o,r=E):[r,s,l,c]=o,!r)return w;Array.isArray(s)||(s=[s]),Array.isArray(l)||(l=[l]);const d=[],m=()=>{d.forEach(a=>a()),d.length=0},p=(a,u,n,t)=>(a.addEventListener(u,n,t),()=>a.removeEventListener(u,n,t)),h=e.watch(()=>[g(r),k(c)],([a,u])=>{if(m(),!a)return;const n=B(u)?{...u}:u;d.push(...s.flatMap(t=>l.map(i=>p(a,t,i,n))))},{immediate:!0,flush:"post"}),_=()=>{h(),m()};return V(_),_}let b=!1;function O(o,r,s={}){const{window:l=E,ignore:c=[],capture:d=!0,detectIframe:m=!1}=s;if(!l)return w;A&&!b&&(b=!0,Array.from(l.document.body.children).forEach(n=>n.addEventListener("click",w)),l.document.documentElement.addEventListener("click",w));let p=!0;const h=n=>c.some(t=>{if(typeof t=="string")return Array.from(l.document.querySelectorAll(t)).some(i=>i===n.target||n.composedPath().includes(i));{const i=g(t);return i&&(n.target===i||n.composedPath().includes(i))}}),a=[y(l,"click",n=>{const t=g(o);if(!(!t||t===n.target||n.composedPath().includes(t))){if(n.detail===0&&(p=!h(n)),!p){p=!0;return}r(n)}},{passive:!0,capture:d}),y(l,"pointerdown",n=>{const t=g(o);p=!h(n)&&!!(t&&!n.composedPath().includes(t))},{passive:!0}),m&&y(l,"blur",n=>{setTimeout(()=>{var t;const i=g(o);((t=l.document.activeElement)==null?void 0:t.tagName)==="IFRAME"&&!(i!=null&&i.contains(l.document.activeElement))&&r(n)},0)})].filter(Boolean);return()=>a.forEach(n=>n())}const v={key:0,class:"line-clamp-2 uppercase text-xs truncate text-white"},z={key:1,class:"line-clamp-2 uppercase text-xs truncate text-white"},j=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z","clip-rule":"evenodd"},null,-1)],P={key:0,class:"select_widget"},I={key:0},L={key:1,class:"space-y-2"},M=[e.createElementVNode("p",{class:"line-clamp-2 uppercase text-xs truncate"},"Vertical",-1)],T=[e.createElementVNode("p",{class:"line-clamp-2 uppercase text-xs truncate"},"Horizontal",-1)],C={__name:"primary_select",props:{titleFreeSlot:{type:String,default:"Free Slot"},selectConfig:{type:Object,default:()=>({chartsConfig:!1,freeSlot:!1})}},emits:["closeSelect"],setup(o,{emit:r}){const s=o,l=r,c=e.ref(!1),d=e.ref("Horizontal"),m=e.ref(null),p=e.computed(()=>s.selectConfig.length>0),h=e.computed(()=>s.selectConfig.some(t=>t.chartsConfig)),_=e.computed(()=>s.selectConfig.some(t=>t.freeSlot)),a=()=>{c.value=!c.value},u=t=>{c.value=!1,d.value=t==="horizontal"?"Vertical":"Horizontal",l("closeSelect",t)};return O(m,()=>{c.value&&(c.value=!1)}),(t,i)=>p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"target",ref:m,class:"relative w-full"},[e.createElementVNode("button",{onClick:a,class:"bg-base-100 z-10 truncate flex items-center justify-between gap-6 p-2 rounded-md lg:mt-0 w-full shadow-md shadow-base-300"},[e.createElementVNode("div",null,[h.value?(e.openBlock(),e.createElementBlock("p",v,e.toDisplayString(d.value),1)):(e.openBlock(),e.createElementBlock("p",z,e.toDisplayString(o.titleFreeSlot),1))]),e.createElementVNode("div",null,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([c.value?"rotate-180 transition-transform ease-in-out":"","w-3 h-3 text-white"]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},j,2))])]),c.value?(e.openBlock(),e.createElementBlock("section",P,[_.value?(e.openBlock(),e.createElementBlock("div",I,[e.renderSlot(t.$slots,"free-slot")])):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("button",{class:e.normalizeClass([d.value==="Vertical"?"bg-green-500":"","btn_select_widget"]),onClick:i[0]||(i[0]=()=>u("horizontal"))},M,2),e.createElementVNode("button",{class:e.normalizeClass([d.value!=="Vertical"?"bg-green-500":"","btn_select_widget"]),onClick:i[1]||(i[1]=()=>u("vertical"))},T,2)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}};function F(o){o.component("primarySelect",C)}const W={install:F};f.default=W,f.primarySelect=C,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u["sm-click-library-ui"]={},u.Vue))})(this,function(u,e){"use strict";function N(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function E(t){return typeof t=="function"?t():e.unref(t)}const k=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const B=Object.prototype.toString,$=t=>B.call(t)==="[object Object]",w=()=>{},x=O();function O(){var t,c;return k&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((c=window==null?void 0:window.navigator)==null?void 0:c.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function h(t){var c;const s=E(t);return(c=s==null?void 0:s.$el)!=null?c:s}const b=k?window:void 0;function y(...t){let c,s,l,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([s,l,r]=t,c=b):[c,s,l,r]=t,!c)return w;Array.isArray(s)||(s=[s]),Array.isArray(l)||(l=[l]);const a=[],p=()=>{a.forEach(d=>d()),a.length=0},f=(d,m,n,o)=>(d.addEventListener(m,n,o),()=>d.removeEventListener(m,n,o)),_=e.watch(()=>[h(c),E(r)],([d,m])=>{if(p(),!d)return;const n=$(m)?{...m}:m;a.push(...s.flatMap(o=>l.map(i=>f(d,o,i,n))))},{immediate:!0,flush:"post"}),g=()=>{_(),p()};return N(g),g}let S=!1;function A(t,c,s={}){const{window:l=b,ignore:r=[],capture:a=!0,detectIframe:p=!1}=s;if(!l)return w;x&&!S&&(S=!0,Array.from(l.document.body.children).forEach(n=>n.addEventListener("click",w)),l.document.documentElement.addEventListener("click",w));let f=!0;const _=n=>r.some(o=>{if(typeof o=="string")return Array.from(l.document.querySelectorAll(o)).some(i=>i===n.target||n.composedPath().includes(i));{const i=h(o);return i&&(n.target===i||n.composedPath().includes(i))}}),d=[y(l,"click",n=>{const o=h(t);if(!(!o||o===n.target||n.composedPath().includes(o))){if(n.detail===0&&(f=!_(n)),!f){f=!0;return}c(n)}},{passive:!0,capture:a}),y(l,"pointerdown",n=>{const o=h(t);f=!_(n)&&!!(o&&!n.composedPath().includes(o))},{passive:!0}),p&&y(l,"blur",n=>{setTimeout(()=>{var o;const i=h(t);((o=l.document.activeElement)==null?void 0:o.tagName)==="IFRAME"&&!(i!=null&&i.contains(l.document.activeElement))&&c(n)},0)})].filter(Boolean);return()=>d.forEach(n=>n())}const z={key:0,class:"line-clamp-2 uppercase text-xs truncate text-white"},M={key:1,class:"line-clamp-2 uppercase text-xs truncate text-white"},L=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M18.4 10.3A2 2 0 0 0 17 7H7a2 2 0 0 0-1.5 3.3l4.9 5.9a2 2 0 0 0 3 0l5-6Z","clip-rule":"evenodd"},null,-1)],j={key:0,class:"select_widget"},v={key:0},P={key:1,class:"space-y-2"},I=[e.createElementVNode("p",{class:"line-clamp-2 uppercase text-xs truncate"},"Vertical",-1)],T=[e.createElementVNode("p",{class:"line-clamp-2 uppercase text-xs truncate"},"Horizontal",-1)],V={__name:"primary_select",props:{titleFreeSlot:{type:String,default:"Free Slot"},selectConfig:{type:Object,default:()=>({chartsConfig:!1,freeSlot:!1})}},emits:["closeSelect"],setup(t,{emit:c}){const s=t,l=c,r=e.ref(!1),a=e.ref("Horizontal"),p=e.ref(null),f=e.computed(()=>s.selectConfig.length>0),_=e.computed(()=>s.selectConfig.some(o=>o.chartsConfig)),g=e.computed(()=>s.selectConfig.some(o=>o.freeSlot)),d=()=>{r.value=!r.value},m=o=>{r.value=!1,a.value=o==="horizontal"?"Vertical":"Horizontal",l("closeSelect",o)};return A(p,()=>{r.value&&(r.value=!1)}),(o,i)=>f.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"target",ref:p,class:"relative w-full"},[e.createElementVNode("button",{onClick:d,class:"bg-base-100 z-10 truncate flex items-center justify-between gap-6 p-2 rounded-md lg:mt-0 w-full shadow-md shadow-base-300"},[e.createElementVNode("div",null,[_.value?(e.openBlock(),e.createElementBlock("p",z,e.toDisplayString(a.value),1)):(e.openBlock(),e.createElementBlock("p",M,e.toDisplayString(t.titleFreeSlot),1))]),e.createElementVNode("div",null,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([r.value?"rotate-180 transition-transform ease-in-out":"","w-3 h-3 text-white"]),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},L,2))])]),r.value?(e.openBlock(),e.createElementBlock("section",j,[g.value?(e.openBlock(),e.createElementBlock("div",v,[e.renderSlot(o.$slots,"free-slot")])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("button",{class:e.normalizeClass([a.value==="Vertical"?"bg-green-500":"","btn_select_widget"]),onClick:i[0]||(i[0]=()=>m("horizontal"))},I,2),e.createElementVNode("button",{class:e.normalizeClass([a.value!=="Vertical"?"bg-green-500":"","btn_select_widget"]),onClick:i[1]||(i[1]=()=>m("vertical"))},T,2)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}},F={key:0,class:"modal_head"},W=e.createElementVNode("div",{class:"modal-overlay absolute h-full bg-gray-600 w-full opacity-70"},null,-1),D={class:"modal_responsive"},H={class:"flex min-h-full items-center justify-center text-center sm:p-0"},q={class:"modal_size lg:w-2/6"},G={class:"modal_background"},R={class:"modal_tittle text-current"},U=[e.createElementVNode("svg",{class:"h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)],Z={class:"p-4"},J={class:"w-full"},K={class:"block"},Q={class:"modal_end_button"},C={__name:"simple_modal",props:{isOpen:Boolean,default:!1},emits:["update:isOpen"],setup(t,{emit:c}){const s=t,l=c,r=()=>{l("update:isOpen",!s.isOpen)};return(a,p)=>t.isOpen?(e.openBlock(),e.createElementBlock("div",F,[W,e.createElementVNode("div",D,[e.createElementVNode("div",H,[e.createElementVNode("div",q,[e.createElementVNode("div",G,[e.createElementVNode("div",R,[e.renderSlot(a.$slots,"header"),e.createElementVNode("button",{onClick:r,class:"modal_close_button","data-modal-toggle":"editUserModal"},U)]),e.createElementVNode("div",Z,[e.createElementVNode("div",J,[e.createElementVNode("label",K,[e.renderSlot(a.$slots,"body")])])]),e.createElementVNode("div",Q,[e.renderSlot(a.$slots,"footer")])])])])])])):e.createCommentVNode("",!0)}};function X(t){t.component("primarySelect",V),t.component("simpleModal",C)}const Y={install:X};u.default=Y,u.primarySelect=V,u.simpleModal=C,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sm-click-library-ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "main": "dist/sm-click-library-ui.es.js",
5
5
  "module": "dist/sm-click-library-ui.umd.js",
6
6
  "private": false,