sm-click-library-ui 0.0.17 → 0.0.19
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,15 +1,15 @@
|
|
|
1
|
-
import { getCurrentScope as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { getCurrentScope as V, onScopeDispose as j, unref as L, watch as F, ref as S, computed as b, openBlock as v, createElementBlock as g, createElementVNode as f, toDisplayString as A, normalizeClass as C, renderSlot as W, createCommentVNode as w, pushScopeId as B, popScopeId as H } from "vue";
|
|
2
|
+
function M(e) {
|
|
3
|
+
return V() ? (j(e), !0) : !1;
|
|
4
4
|
}
|
|
5
5
|
function O(e) {
|
|
6
|
-
return typeof e == "function" ? e() :
|
|
6
|
+
return typeof e == "function" ? e() : L(e);
|
|
7
7
|
}
|
|
8
8
|
const I = typeof window < "u" && typeof document < "u";
|
|
9
9
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
10
|
-
const
|
|
11
|
-
},
|
|
12
|
-
function
|
|
10
|
+
const D = Object.prototype.toString, N = (e) => D.call(e) === "[object Object]", y = () => {
|
|
11
|
+
}, T = /* @__PURE__ */ G();
|
|
12
|
+
function G() {
|
|
13
13
|
var e, l;
|
|
14
14
|
return I && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((l = window == null ? void 0 : window.navigator) == null ? void 0 : l.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
15
15
|
}
|
|
@@ -26,12 +26,12 @@ function k(...e) {
|
|
|
26
26
|
Array.isArray(s) || (s = [s]), Array.isArray(n) || (n = [n]);
|
|
27
27
|
const a = [], p = () => {
|
|
28
28
|
a.forEach((c) => c()), a.length = 0;
|
|
29
|
-
}, d = (c, u, o, t) => (c.addEventListener(u, o, t), () => c.removeEventListener(u, o, t)), m =
|
|
29
|
+
}, d = (c, u, o, t) => (c.addEventListener(u, o, t), () => c.removeEventListener(u, o, t)), m = F(
|
|
30
30
|
() => [_(l), O(r)],
|
|
31
31
|
([c, u]) => {
|
|
32
32
|
if (p(), !c)
|
|
33
33
|
return;
|
|
34
|
-
const o =
|
|
34
|
+
const o = N(u) ? { ...u } : u;
|
|
35
35
|
a.push(
|
|
36
36
|
...s.flatMap((t) => n.map((i) => d(c, t, i, o)))
|
|
37
37
|
);
|
|
@@ -40,14 +40,14 @@ function k(...e) {
|
|
|
40
40
|
), h = () => {
|
|
41
41
|
m(), p();
|
|
42
42
|
};
|
|
43
|
-
return
|
|
43
|
+
return M(h), h;
|
|
44
44
|
}
|
|
45
45
|
let E = !1;
|
|
46
|
-
function
|
|
46
|
+
function $(e, l, s = {}) {
|
|
47
47
|
const { window: n = z, ignore: r = [], capture: a = !0, detectIframe: p = !1 } = s;
|
|
48
48
|
if (!n)
|
|
49
49
|
return y;
|
|
50
|
-
|
|
50
|
+
T && !E && (E = !0, Array.from(n.document.body.children).forEach((o) => o.addEventListener("click", y)), n.document.documentElement.addEventListener("click", y));
|
|
51
51
|
let d = !0;
|
|
52
52
|
const m = (o) => r.some((t) => {
|
|
53
53
|
if (typeof t == "string")
|
|
@@ -81,34 +81,34 @@ function G(e, l, s = {}) {
|
|
|
81
81
|
].filter(Boolean);
|
|
82
82
|
return () => c.forEach((o) => o());
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const q = (e, l) => {
|
|
85
85
|
const s = e.__vccOpts || e;
|
|
86
86
|
for (const [n, r] of l)
|
|
87
87
|
s[n] = r;
|
|
88
88
|
return s;
|
|
89
|
-
}, x = (e) => (
|
|
89
|
+
}, x = (e) => (B("data-v-a8f8c201"), e = e(), H(), e), R = {
|
|
90
90
|
key: 0,
|
|
91
91
|
class: "line-clamp-2 uppercase text-xs truncate text-white"
|
|
92
|
-
},
|
|
92
|
+
}, Z = {
|
|
93
93
|
key: 1,
|
|
94
94
|
class: "line-clamp-2 uppercase text-xs truncate text-white"
|
|
95
|
-
},
|
|
95
|
+
}, J = /* @__PURE__ */ x(() => /* @__PURE__ */ f("path", {
|
|
96
96
|
"fill-rule": "evenodd",
|
|
97
97
|
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",
|
|
98
98
|
"clip-rule": "evenodd"
|
|
99
|
-
}, null, -1)),
|
|
100
|
-
|
|
101
|
-
],
|
|
99
|
+
}, null, -1)), K = [
|
|
100
|
+
J
|
|
101
|
+
], Q = {
|
|
102
102
|
key: 0,
|
|
103
103
|
class: "select_widget_lib"
|
|
104
|
-
},
|
|
104
|
+
}, U = { key: 0 }, X = {
|
|
105
105
|
key: 1,
|
|
106
106
|
class: "space-y-2"
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
],
|
|
110
|
-
|
|
111
|
-
],
|
|
107
|
+
}, Y = /* @__PURE__ */ x(() => /* @__PURE__ */ f("p", { class: "line-clamp-2 uppercase text-xs truncate" }, "Vertical", -1)), ee = [
|
|
108
|
+
Y
|
|
109
|
+
], te = /* @__PURE__ */ x(() => /* @__PURE__ */ f("p", { class: "line-clamp-2 uppercase text-xs truncate" }, "Horizontal", -1)), oe = [
|
|
110
|
+
te
|
|
111
|
+
], ne = {
|
|
112
112
|
__name: "primary_select",
|
|
113
113
|
props: {
|
|
114
114
|
titleFreeSlot: {
|
|
@@ -134,7 +134,7 @@ const $ = (e, l) => {
|
|
|
134
134
|
}, u = (t) => {
|
|
135
135
|
r.value = !1, a.value = t === "horizontal" ? "Vertical" : "Horizontal", n("closeSelect", t);
|
|
136
136
|
};
|
|
137
|
-
return
|
|
137
|
+
return $(p, () => {
|
|
138
138
|
r.value && (r.value = !1);
|
|
139
139
|
}), (t, i) => d.value ? (v(), g("div", {
|
|
140
140
|
key: 0,
|
|
@@ -144,10 +144,10 @@ const $ = (e, l) => {
|
|
|
144
144
|
}, [
|
|
145
145
|
f("button", {
|
|
146
146
|
onClick: c,
|
|
147
|
-
class: "bg-base-
|
|
147
|
+
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"
|
|
148
148
|
}, [
|
|
149
149
|
f("div", null, [
|
|
150
|
-
m.value ? (v(), g("p",
|
|
150
|
+
m.value ? (v(), g("p", R, A(a.value), 1)) : (v(), g("p", Z, A(e.titleFreeSlot), 1))
|
|
151
151
|
]),
|
|
152
152
|
f("div", null, [
|
|
153
153
|
(v(), g("svg", {
|
|
@@ -155,32 +155,34 @@ const $ = (e, l) => {
|
|
|
155
155
|
xmlns: "http://www.w3.org/2000/svg",
|
|
156
156
|
fill: "currentColor",
|
|
157
157
|
viewBox: "0 0 24 24"
|
|
158
|
-
},
|
|
158
|
+
}, K, 2))
|
|
159
159
|
])
|
|
160
160
|
]),
|
|
161
|
-
r.value ? (v(), g("section",
|
|
162
|
-
h.value ? (v(), g("div",
|
|
163
|
-
|
|
161
|
+
r.value ? (v(), g("section", Q, [
|
|
162
|
+
h.value ? (v(), g("div", U, [
|
|
163
|
+
W(t.$slots, "free-slot", {}, void 0, !0)
|
|
164
164
|
])) : w("", !0),
|
|
165
|
-
m.value ? (v(), g("div",
|
|
165
|
+
m.value ? (v(), g("div", X, [
|
|
166
166
|
f("button", {
|
|
167
167
|
class: C([a.value === "Vertical" ? "bg-green-500" : "", "btn_select_widget_lib"]),
|
|
168
168
|
onClick: i[0] || (i[0] = () => u("horizontal"))
|
|
169
|
-
},
|
|
169
|
+
}, ee, 2),
|
|
170
170
|
f("button", {
|
|
171
171
|
class: C([a.value !== "Vertical" ? "bg-green-500" : "", "btn_select_widget_lib"]),
|
|
172
172
|
onClick: i[1] || (i[1] = () => u("vertical"))
|
|
173
|
-
},
|
|
173
|
+
}, oe, 2)
|
|
174
174
|
])) : w("", !0)
|
|
175
175
|
])) : w("", !0)
|
|
176
176
|
], 512)) : w("", !0);
|
|
177
177
|
}
|
|
178
|
-
},
|
|
178
|
+
}, P = /* @__PURE__ */ q(ne, [["__scopeId", "data-v-a8f8c201"]]);
|
|
179
179
|
function se(e) {
|
|
180
|
-
e.component("primarySelect",
|
|
180
|
+
e.component("primarySelect", P);
|
|
181
181
|
}
|
|
182
|
-
const ie = {
|
|
182
|
+
const ie = {
|
|
183
|
+
install: se,
|
|
184
|
+
primarySelect: P
|
|
185
|
+
};
|
|
183
186
|
export {
|
|
184
|
-
ie as default
|
|
185
|
-
ne as primarySelect
|
|
187
|
+
ie as default
|
|
186
188
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,h){typeof exports=="object"&&typeof module<"u"?module.exports=h(require("vue")):typeof define=="function"&&define.amd?define(["vue"],h):(e=typeof globalThis<"u"?globalThis:e||self,e["sm-click-library-ui"]=h(e.Vue))})(this,function(e){"use strict";function h(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function S(t){return typeof t=="function"?t():e.unref(t)}const E=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const V=Object.prototype.toString,B=t=>V.call(t)==="[object Object]",w=()=>{},A=N();function N(){var t,c;return E&&((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 _(t){var c;const s=S(t);return(c=s==null?void 0:s.$el)!=null?c:s}const b=E?window:void 0;function y(...t){let c,s,l,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([s,l,i]=t,c=b):[c,s,l,i]=t,!c)return w;Array.isArray(s)||(s=[s]),Array.isArray(l)||(l=[l]);const d=[],p=()=>{d.forEach(a=>a()),d.length=0},f=(a,u,n,o)=>(a.addEventListener(u,n,o),()=>a.removeEventListener(u,n,o)),m=e.watch(()=>[_(c),S(i)],([a,u])=>{if(p(),!a)return;const n=B(u)?{...u}:u;d.push(...s.flatMap(o=>l.map(r=>f(a,o,r,n))))},{immediate:!0,flush:"post"}),g=()=>{m(),p()};return h(g),g}let C=!1;function O(t,c,s={}){const{window:l=b,ignore:i=[],capture:d=!0,detectIframe:p=!1}=s;if(!l)return w;A&&!C&&(C=!0,Array.from(l.document.body.children).forEach(n=>n.addEventListener("click",w)),l.document.documentElement.addEventListener("click",w));let f=!0;const m=n=>i.some(o=>{if(typeof o=="string")return Array.from(l.document.querySelectorAll(o)).some(r=>r===n.target||n.composedPath().includes(r));{const r=_(o);return r&&(n.target===r||n.composedPath().includes(r))}}),a=[y(l,"click",n=>{const o=_(t);if(!(!o||o===n.target||n.composedPath().includes(o))){if(n.detail===0&&(f=!m(n)),!f){f=!0;return}c(n)}},{passive:!0,capture:d}),y(l,"pointerdown",n=>{const o=_(t);f=!m(n)&&!!(o&&!n.composedPath().includes(o))},{passive:!0}),p&&y(l,"blur",n=>{setTimeout(()=>{var o;const r=_(t);((o=l.document.activeElement)==null?void 0:o.tagName)==="IFRAME"&&!(r!=null&&r.contains(l.document.activeElement))&&c(n)},0)})].filter(Boolean);return()=>a.forEach(n=>n())}const v=(t,c)=>{const s=t.__vccOpts||t;for(const[l,i]of c)s[l]=i;return s},k=t=>(e.pushScopeId("data-v-a8f8c201"),t=t(),e.popScopeId(),t),I={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=[k(()=>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_lib"},L={key:0},F={key:1,class:"space-y-2"},T=[k(()=>e.createElementVNode("p",{class:"line-clamp-2 uppercase text-xs truncate"},"Vertical",-1))],W=[k(()=>e.createElementVNode("p",{class:"line-clamp-2 uppercase text-xs truncate"},"Horizontal",-1))],x=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,i=e.ref(!1),d=e.ref("Horizontal"),p=e.ref(null),f=e.computed(()=>s.selectConfig.length>0),m=e.computed(()=>s.selectConfig.some(o=>o.chartsConfig)),g=e.computed(()=>s.selectConfig.some(o=>o.freeSlot)),a=()=>{i.value=!i.value},u=o=>{i.value=!1,d.value=o==="horizontal"?"Vertical":"Horizontal",l("closeSelect",o)};return O(p,()=>{i.value&&(i.value=!1)}),(o,r)=>f.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"target",ref:p,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,[m.value?(e.openBlock(),e.createElementBlock("p",I,e.toDisplayString(d.value),1)):(e.openBlock(),e.createElementBlock("p",z,e.toDisplayString(t.titleFreeSlot),1))]),e.createElementVNode("div",null,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([i.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))])]),i.value?(e.openBlock(),e.createElementBlock("section",P,[g.value?(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(o.$slots,"free-slot",{},void 0,!0)])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("button",{class:e.normalizeClass([d.value==="Vertical"?"bg-green-500":"","btn_select_widget_lib"]),onClick:r[0]||(r[0]=()=>u("horizontal"))},T,2),e.createElementVNode("button",{class:e.normalizeClass([d.value!=="Vertical"?"bg-green-500":"","btn_select_widget_lib"]),onClick:r[1]||(r[1]=()=>u("vertical"))},W,2)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)):e.createCommentVNode("",!0)}},[["__scopeId","data-v-a8f8c201"]]);function D(t){t.component("primarySelect",x)}return{install:D,primarySelect:x}});
|
package/dist/styleSmClick.css
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sm-click-library-ui",
|
|
3
|
-
"
|
|
4
|
-
"main": "dist/sm-click-library-ui.es.js",
|
|
5
|
-
"module": "dist/sm-click-library-ui.umd.js",
|
|
6
|
-
"private": false,
|
|
3
|
+
"type": "module",
|
|
7
4
|
"files": [
|
|
8
5
|
"dist"
|
|
9
6
|
],
|
|
10
|
-
"
|
|
7
|
+
"version": "0.0.19",
|
|
8
|
+
"main": "dist/sm-click-library-ui.es.js",
|
|
9
|
+
"module": "dist/sm-click-library-ui.umd.js",
|
|
10
|
+
"private": false,
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@tailwindcss/typography": "^0.5.13",
|
|
13
13
|
"@vueuse/core": "^10.11.0",
|