@oneb/ui-vue 0.3.13 → 0.3.15

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.
Files changed (75) hide show
  1. package/dist/CheckIcon-09b84cf5.cjs +1 -0
  2. package/dist/CheckIcon-f1c94824.js +20 -0
  3. package/dist/ChevronDownIcon-6805ce6c.js +20 -0
  4. package/dist/ChevronDownIcon-6889ac87.cjs +1 -0
  5. package/dist/{ChevronRightIcon-8df1af46.js → ChevronRightIcon-4549a26b.js} +4 -21
  6. package/dist/ChevronRightIcon-7a2f0c20.cjs +1 -0
  7. package/dist/NoSymbolIcon-5d326416.cjs +1 -0
  8. package/dist/NoSymbolIcon-e58a9aee.js +71 -0
  9. package/dist/OneHelpMenu-66a2d4c2.cjs +1 -0
  10. package/dist/OneHelpMenu-d7a39a69.js +856 -0
  11. package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +1 -0
  12. package/dist/OneMarkdown.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
  13. package/dist/{SpinnerIcon-516264ba.js → SpinnerIcon-74648c98.js} +6 -5
  14. package/dist/SpinnerIcon-ccb6f3fc.cjs +1 -0
  15. package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-0ea8fbf8.cjs +1 -0
  16. package/dist/SpinnerIcon.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
  17. package/dist/button/index.cjs +1 -1
  18. package/dist/button/index.js +17 -16
  19. package/dist/buttonGroup/index.cjs +1 -0
  20. package/dist/buttonGroup/index.js +31 -0
  21. package/dist/checkbox/index.cjs +1 -0
  22. package/dist/checkbox/index.js +124 -0
  23. package/dist/collapse/index.cjs +1 -0
  24. package/dist/collapse/index.js +58 -0
  25. package/dist/common/index.cjs +1 -16
  26. package/dist/common/index.js +14 -3120
  27. package/dist/dataTable/index.cjs +1 -1
  28. package/dist/dataTable/index.js +846 -9
  29. package/dist/dropdown/index.cjs +1 -1
  30. package/dist/dropdown/index.js +792 -17
  31. package/dist/entityPicker/index.cjs +1 -0
  32. package/dist/entityPicker/index.js +584 -0
  33. package/dist/errorsPage/index.cjs +1 -0
  34. package/dist/errorsPage/index.js +63 -0
  35. package/dist/floating-ui.dom-2121a4fd.cjs +1 -0
  36. package/dist/floating-ui.dom-4509432e.js +941 -0
  37. package/dist/i18n/index.cjs +1 -0
  38. package/dist/{useI18n-2103b39e.js → i18n/index.js} +4 -4
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.js +114 -10295
  41. package/dist/indicators/index.cjs +1 -0
  42. package/dist/indicators/index.js +84 -0
  43. package/dist/infobox/index.cjs +1 -0
  44. package/dist/infobox/index.js +111 -0
  45. package/dist/label/index.cjs +1 -0
  46. package/dist/label/index.js +47 -0
  47. package/dist/layout/index.cjs +1 -1
  48. package/dist/layout/index.js +115 -109
  49. package/dist/modal/index.cjs +1 -0
  50. package/dist/modal/index.js +41 -0
  51. package/dist/periodPicker/index.cjs +1 -0
  52. package/dist/periodPicker/index.js +1323 -0
  53. package/dist/radio/index.cjs +1 -0
  54. package/dist/radio/index.js +73 -0
  55. package/dist/skeleton/index.cjs +1 -0
  56. package/dist/skeleton/index.js +46 -0
  57. package/dist/style.css +1 -1
  58. package/dist/switch/index.cjs +1 -0
  59. package/dist/switch/index.js +142 -0
  60. package/dist/toast/index.cjs +1 -0
  61. package/dist/toast/index.js +140 -0
  62. package/dist/tooltip/index.cjs +1 -0
  63. package/dist/tooltip/index.js +20 -0
  64. package/dist/useModal-85f57682.js +177 -0
  65. package/dist/useModal-98810f6a.cjs +1 -0
  66. package/package.json +4 -4
  67. package/dist/ChevronRightIcon-6aa413c4.cjs +0 -1
  68. package/dist/OneHelpMenu-8e315cb3.js +0 -1791
  69. package/dist/OneHelpMenu-95ae3d5a.cjs +0 -1
  70. package/dist/SpinnerIcon-01be39fe.cjs +0 -1
  71. package/dist/index-19e93dfb.js +0 -954
  72. package/dist/index-85e729ab.cjs +0 -1
  73. package/dist/index-8b41a099.cjs +0 -1
  74. package/dist/index-98daa7ed.js +0 -862
  75. package/dist/useI18n-bcf9c640.cjs +0 -1
@@ -0,0 +1,177 @@
1
+ import { defineComponent as k, computed as y, ref as f, openBlock as g, createElementBlock as h, normalizeClass as m, createElementVNode as a, normalizeStyle as O, toDisplayString as _, createCommentVNode as M, renderSlot as p, onMounted as S, onBeforeUnmount as T } from "vue";
2
+ import { _ as z } from "./_plugin-vue_export-helper-dad06003.js";
3
+ const B = {
4
+ useModal: {
5
+ required: !0,
6
+ type: Object
7
+ },
8
+ title: {
9
+ required: !1,
10
+ type: String
11
+ },
12
+ size: {
13
+ type: String,
14
+ default: "medium"
15
+ },
16
+ onClose: {
17
+ type: Function
18
+ },
19
+ classModal: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ titleCenter: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ classTitle: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ canClose: {
32
+ type: Function,
33
+ default: () => !0
34
+ },
35
+ customWidth: {
36
+ type: String,
37
+ default: ""
38
+ }
39
+ }, E = {
40
+ "3xs": ["max-w-xs"],
41
+ xs: ["max-w-sm"],
42
+ sm: ["max-w-md"],
43
+ small: ["max-w-lg"],
44
+ md: ["max-w-xl"],
45
+ medium: ["max-w-xl"],
46
+ large: ["max-w-2xl"],
47
+ xl: ["max-w-3xl"],
48
+ "2xl": ["max-w-4xl"],
49
+ "3xl": ["max-w-4xl"],
50
+ "4xl": ["max-w-5xl"],
51
+ "5xl": ["max-w-5xl"],
52
+ "7xl": ["max-w-7xl"]
53
+ }, L = (i = "medium") => {
54
+ const s = [];
55
+ return s.push(...E[i] ?? []), s;
56
+ }, W = { class: "relative bg-white rounded-lg shadow h-full" }, D = /* @__PURE__ */ k({
57
+ __name: "OneModal",
58
+ props: B,
59
+ emits: ["isOpen", "closed"],
60
+ setup(i, { expose: s, emit: r }) {
61
+ const t = i, n = r, v = y(() => {
62
+ var l, u;
63
+ const e = t.useModal;
64
+ return ((l = e == null ? void 0 : e.isOpened) == null ? void 0 : l.value) ?? ((u = e == null ? void 0 : e.isOpen) == null ? void 0 : u.value) ?? !1;
65
+ }), x = y(() => L(t.size)), d = y(() => t.customWidth ? { width: t.customWidth } : {}), o = f(null), w = f(!1);
66
+ function b(e) {
67
+ w.value = !1, o.value && !o.value.contains(e.target) && (w.value = !0);
68
+ }
69
+ function C(e) {
70
+ w.value && o.value && !o.value.contains(e.target) && c();
71
+ }
72
+ const c = () => {
73
+ var l, u;
74
+ if (t.canClose && !t.canClose())
75
+ return;
76
+ const e = t.useModal;
77
+ (l = e == null ? void 0 : e.close) == null || l.call(e), (u = t.onClose) == null || u.call(t), n("closed"), n("isOpen");
78
+ };
79
+ return s({
80
+ open: () => {
81
+ var l;
82
+ const e = t.useModal;
83
+ (l = e == null ? void 0 : e.open) == null || l.call(e), n("isOpen");
84
+ },
85
+ close: c
86
+ }), (e, l) => v.value ? (g(), h("div", {
87
+ key: 0,
88
+ tabindex: "-1",
89
+ onMousedown: b,
90
+ onMouseup: C,
91
+ class: m(["modal backdrop !m-0", { "modal-mobile": e.classModal }])
92
+ }, [
93
+ a("div", {
94
+ class: m([
95
+ "relative w-full max-h-full",
96
+ x.value,
97
+ { "fixed bottom-0 left-0 right-0 w-full bg-white rounded-t-xl mobile-modal": e.classModal }
98
+ ]),
99
+ style: O(d.value),
100
+ ref_key: "modalContent",
101
+ ref: o
102
+ }, [
103
+ a("div", W, [
104
+ e.title ? (g(), h("div", {
105
+ key: 0,
106
+ class: m([
107
+ e.titleCenter ? "grid grid-cols-4" : "flex items-start justify-between",
108
+ "p-3 border-b rounded-t",
109
+ e.classTitle
110
+ ])
111
+ }, [
112
+ a("h3", {
113
+ class: m(["text-xl font-semibold text-gray-900 whitespace-nowrap overflow-hidden text-ellipsis", e.titleCenter ? "col-span-2 text-center col-start-2" : ""])
114
+ }, _(e.title), 3),
115
+ a("button", {
116
+ type: "button",
117
+ class: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center",
118
+ onClick: c
119
+ }, [...l[0] || (l[0] = [
120
+ a("svg", {
121
+ xmlns: "http://www.w3.org/2000/svg",
122
+ fill: "none",
123
+ viewBox: "0 0 24 24",
124
+ "stroke-width": "1.8",
125
+ stroke: "currentColor",
126
+ "aria-hidden": "true",
127
+ class: "w-5 h-5"
128
+ }, [
129
+ a("path", {
130
+ "stroke-linecap": "round",
131
+ "stroke-linejoin": "round",
132
+ d: "M6 18L18 6M6 6l12 12"
133
+ })
134
+ ], -1)
135
+ ])])
136
+ ], 2)) : M("", !0),
137
+ p(e.$slots, "header", {}, void 0, !0),
138
+ p(e.$slots, "body", {}, void 0, !0),
139
+ p(e.$slots, "default", {}, void 0, !0),
140
+ p(e.$slots, "footer", { close: c }, void 0, !0)
141
+ ])
142
+ ], 6)
143
+ ], 34)) : M("", !0);
144
+ }
145
+ });
146
+ const F = /* @__PURE__ */ z(D, [["__scopeId", "data-v-3560b61e"]]);
147
+ function N(i = !1) {
148
+ const s = f(i), r = f(void 0);
149
+ let t = null;
150
+ const n = () => {
151
+ t && (clearTimeout(t), t = null), s.value = !1, r.value = void 0;
152
+ }, v = (o) => {
153
+ r.value = o, s.value = !0;
154
+ }, x = (o) => {
155
+ t && clearTimeout(t), t = setTimeout(n, o * 1e3);
156
+ }, d = (o) => {
157
+ o.key === "Escape" && s.value && n();
158
+ };
159
+ return S(() => {
160
+ document.addEventListener("keydown", d);
161
+ }), T(() => {
162
+ document.removeEventListener("keydown", d), t && clearTimeout(t);
163
+ }), {
164
+ isOpened: s,
165
+ isOpen: s,
166
+ // alias for backward compatibility
167
+ data: r,
168
+ open: v,
169
+ close: n,
170
+ closeWithDelay: x
171
+ };
172
+ }
173
+ export {
174
+ F as O,
175
+ B as m,
176
+ N as u
177
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("vue"),g=require("./_plugin-vue_export-helper-f246444f.cjs"),v={useModal:{required:!0,type:Object},title:{required:!1,type:String},size:{type:String,default:"medium"},onClose:{type:Function},classModal:{type:Boolean,default:!1},titleCenter:{type:Boolean,default:!1},classTitle:{type:String,default:""},canClose:{type:Function,default:()=>!0},customWidth:{type:String,default:""}},y={"3xs":["max-w-xs"],xs:["max-w-sm"],sm:["max-w-md"],small:["max-w-lg"],md:["max-w-xl"],medium:["max-w-xl"],large:["max-w-2xl"],xl:["max-w-3xl"],"2xl":["max-w-4xl"],"3xl":["max-w-4xl"],"4xl":["max-w-5xl"],"5xl":["max-w-5xl"],"7xl":["max-w-7xl"]},h=(r="medium")=>{const n=[];return n.push(...y[r]??[]),n},C={class:"relative bg-white rounded-lg shadow h-full"},M=t.defineComponent({__name:"OneModal",props:v,emits:["isOpen","closed"],setup(r,{expose:n,emit:i}){const l=r,a=i,m=t.computed(()=>{var s,u;const e=l.useModal;return((s=e==null?void 0:e.isOpened)==null?void 0:s.value)??((u=e==null?void 0:e.isOpen)==null?void 0:u.value)??!1}),p=t.computed(()=>h(l.size)),d=t.computed(()=>l.customWidth?{width:l.customWidth}:{}),o=t.ref(null),f=t.ref(!1);function x(e){f.value=!1,o.value&&!o.value.contains(e.target)&&(f.value=!0)}function w(e){f.value&&o.value&&!o.value.contains(e.target)&&c()}const c=()=>{var s,u;if(l.canClose&&!l.canClose())return;const e=l.useModal;(s=e==null?void 0:e.close)==null||s.call(e),(u=l.onClose)==null||u.call(l),a("closed"),a("isOpen")};return n({open:()=>{var s;const e=l.useModal;(s=e==null?void 0:e.open)==null||s.call(e),a("isOpen")},close:c}),(e,s)=>m.value?(t.openBlock(),t.createElementBlock("div",{key:0,tabindex:"-1",onMousedown:x,onMouseup:w,class:t.normalizeClass(["modal backdrop !m-0",{"modal-mobile":e.classModal}])},[t.createElementVNode("div",{class:t.normalizeClass(["relative w-full max-h-full",p.value,{"fixed bottom-0 left-0 right-0 w-full bg-white rounded-t-xl mobile-modal":e.classModal}]),style:t.normalizeStyle(d.value),ref_key:"modalContent",ref:o},[t.createElementVNode("div",C,[e.title?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([e.titleCenter?"grid grid-cols-4":"flex items-start justify-between","p-3 border-b rounded-t",e.classTitle])},[t.createElementVNode("h3",{class:t.normalizeClass(["text-xl font-semibold text-gray-900 whitespace-nowrap overflow-hidden text-ellipsis",e.titleCenter?"col-span-2 text-center col-start-2":""])},t.toDisplayString(e.title),3),t.createElementVNode("button",{type:"button",class:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center",onClick:c},[...s[0]||(s[0]=[t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true",class:"w-5 h-5"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])])],2)):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"header",{},void 0,!0),t.renderSlot(e.$slots,"body",{},void 0,!0),t.renderSlot(e.$slots,"default",{},void 0,!0),t.renderSlot(e.$slots,"footer",{close:c},void 0,!0)])],6)],34)):t.createCommentVNode("",!0)}});const b=g._export_sfc(M,[["__scopeId","data-v-3560b61e"]]);function k(r=!1){const n=t.ref(r),i=t.ref(void 0);let l=null;const a=()=>{l&&(clearTimeout(l),l=null),n.value=!1,i.value=void 0},m=o=>{i.value=o,n.value=!0},p=o=>{l&&clearTimeout(l),l=setTimeout(a,o*1e3)},d=o=>{o.key==="Escape"&&n.value&&a()};return t.onMounted(()=>{document.addEventListener("keydown",d)}),t.onBeforeUnmount(()=>{document.removeEventListener("keydown",d),l&&clearTimeout(l)}),{isOpened:n,isOpen:n,data:i,open:m,close:a,closeWithDelay:p}}exports.OneModal=b;exports.modalProps=v;exports.useModal=k;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneb/ui-vue",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -209,7 +209,9 @@
209
209
  },
210
210
  "peerDependencies": {
211
211
  "vue": ">= 3",
212
- "vue-router": ">= 4"
212
+ "vue-router": ">= 4",
213
+ "dayjs": "^1.11.0",
214
+ "@floating-ui/vue": "^1.0.0"
213
215
  },
214
216
  "devDependencies": {
215
217
  "@types/node": "^18.16.17",
@@ -220,8 +222,6 @@
220
222
  "vue-tsc": "^1.6.5"
221
223
  },
222
224
  "dependencies": {
223
- "@floating-ui/vue": "^1.1.6",
224
- "dayjs": "^1.11.13",
225
225
  "v-calendar": "^3.1.2",
226
226
  "vue-markdown-render": "^2.2.1"
227
227
  }
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue");function t(r,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}function o(r,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})])}function l(r,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})])}exports.render=o;exports.render$1=t;exports.render$2=l;