@leaflink/stash 51.5.1 → 51.5.2
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/Carousel.js +9 -9
- package/dist/Carousel.js.map +1 -1
- package/dist/DataViewToolbar.js +9 -9
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/ObfuscateText.js +5 -5
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/SelectStatus.js +13 -13
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Switch.js +8 -8
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +5 -5
- package/dist/Tab.js.map +1 -1
- package/dist/Toast.js +189 -184
- package/dist/Toast.js.map +1 -1
- package/dist/Toast.vue.d.ts +4 -0
- package/dist/Toasts.js +13 -12
- package/dist/Toasts.js.map +1 -1
- package/dist/Tooltip.js +8 -8
- package/dist/Tooltip.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/useToasts.d.ts +6 -0
- package/dist/useToasts.js +28 -23
- package/dist/useToasts.js.map +1 -1
- package/package.json +5 -4
package/dist/useToasts.js
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "lodash-es/merge";
|
|
2
2
|
import T from "lodash-es/uniqueId";
|
|
3
3
|
import { ref as h, reactive as y, readonly as b } from "vue";
|
|
4
4
|
const w = 5e3, n = h([]);
|
|
5
|
-
function M(
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
if (!
|
|
5
|
+
function M(s = { timeout: w }) {
|
|
6
|
+
function c(e) {
|
|
7
|
+
const o = typeof e == "string" ? e : void 0, { group: i = void 0, status: t = void 0 } = typeof e == "object" ? e : {};
|
|
8
|
+
if (!o && (!i || !t))
|
|
9
9
|
throw new Error("Must provide either a toast ID or both group and type");
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const r = i && t ? `toast-${t}-${i}` : String(o), f = n.value.findIndex(({ id: g }) => g === r);
|
|
11
|
+
f !== -1 && n.value.splice(f, 1);
|
|
12
12
|
}
|
|
13
|
-
function u(e,
|
|
14
|
-
const
|
|
15
|
-
if (!(
|
|
16
|
-
return n.value.push({
|
|
13
|
+
function u(e, o, i) {
|
|
14
|
+
const t = l({}, s, i), r = t != null && t.group ? `toast-${o}-${t.group}` : T("toast-");
|
|
15
|
+
if (!(t != null && t.group && n.value.some(({ id: f }) => f === r)))
|
|
16
|
+
return n.value.push({
|
|
17
|
+
text: e,
|
|
18
|
+
id: r,
|
|
19
|
+
status: o,
|
|
20
|
+
offsetTop: t.offsetTop
|
|
21
|
+
}), typeof t.timeout == "number" && setTimeout(() => c(r), Math.abs(t.timeout)), r;
|
|
17
22
|
}
|
|
18
|
-
function
|
|
23
|
+
function a() {
|
|
19
24
|
n.value = [];
|
|
20
25
|
}
|
|
21
|
-
function m(e,
|
|
22
|
-
return u(e, "error",
|
|
26
|
+
function m(e, o) {
|
|
27
|
+
return u(e, "error", o);
|
|
23
28
|
}
|
|
24
|
-
function v(e,
|
|
25
|
-
return u(e, "info",
|
|
29
|
+
function v(e, o) {
|
|
30
|
+
return u(e, "info", o);
|
|
26
31
|
}
|
|
27
|
-
function d(e,
|
|
28
|
-
return u(e, "success",
|
|
32
|
+
function d(e, o) {
|
|
33
|
+
return u(e, "success", o);
|
|
29
34
|
}
|
|
30
|
-
function
|
|
31
|
-
return u(e, "warning",
|
|
35
|
+
function p(e, o) {
|
|
36
|
+
return u(e, "warning", o);
|
|
32
37
|
}
|
|
33
38
|
return y({
|
|
34
39
|
/**
|
|
@@ -38,7 +43,7 @@ function M(a = { timeout: w }) {
|
|
|
38
43
|
/**
|
|
39
44
|
* Removes an active/visible toast by id or by group and type.
|
|
40
45
|
*/
|
|
41
|
-
remove:
|
|
46
|
+
remove: c,
|
|
42
47
|
/**
|
|
43
48
|
* Creates a new toast and makes it active/visible.
|
|
44
49
|
*/
|
|
@@ -46,7 +51,7 @@ function M(a = { timeout: w }) {
|
|
|
46
51
|
/**
|
|
47
52
|
* Removes all active/visible toasts.
|
|
48
53
|
*/
|
|
49
|
-
removeAll:
|
|
54
|
+
removeAll: a,
|
|
50
55
|
/**
|
|
51
56
|
* Creates a new "error" toast.
|
|
52
57
|
*/
|
|
@@ -62,7 +67,7 @@ function M(a = { timeout: w }) {
|
|
|
62
67
|
/**
|
|
63
68
|
* Creates a new "warning" toast.
|
|
64
69
|
*/
|
|
65
|
-
warning:
|
|
70
|
+
warning: p
|
|
66
71
|
});
|
|
67
72
|
}
|
|
68
73
|
export {
|
package/dist/useToasts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToasts.js","sources":["../src/composables/useToasts/useToasts.ts"],"sourcesContent":["import merge from 'lodash-es/merge';\nimport uniqueId from 'lodash-es/uniqueId';\nimport { reactive, readonly, ref, RenderFunction } from 'vue';\n\nimport { StatusSeverity } from '../../../types/statusLevels';\n\nexport const DEFAULT_TIMEOUT = 5000;\n\nexport type Toast = {\n id: string;\n text: string | RenderFunction;\n status: StatusSeverity;\n};\n\nexport interface ToastOptions {\n /**\n * The timeout in milliseconds before the toast is automatically dismissed. If set to `false`, the toast will persist until the user clicks on it.\n * @default DEFAULT_TIMEOUT\n */\n timeout?: number | boolean;\n /**\n * A group name ensures only one toast with the same group and status is visible at any given time.\n * Toasts with the same group but different statuses will be treated as separate and will display concurrently.\n */\n group?: string;\n}\n\ntype ToastIdOrUndefined<O extends ToastOptions | undefined> = O extends { id: string }\n ? Toast['id'] | undefined\n : Toast['id'];\n\nconst active = ref<Toast[]>([]);\n\nexport default function useToasts(globalOptions: Omit<ToastOptions, 'group'> = { timeout: DEFAULT_TIMEOUT }) {\n // method overloads\n function remove(toastId: Toast['id']): void;\n function remove(options: { group: string; status: StatusSeverity }): void;\n function remove(toastIdOrOptions: Toast['id'] | { group: string; status: StatusSeverity }) {\n const toastId = typeof toastIdOrOptions === 'string' ? toastIdOrOptions : undefined;\n const { group = undefined, status = undefined } = typeof toastIdOrOptions === 'object' ? toastIdOrOptions : {};\n\n if (!toastId && (!group || !status)) {\n throw new Error('Must provide either a toast ID or both group and type');\n }\n\n const idToRemove = group && status ? `toast-${status}-${group}` : String(toastId);\n const index = active.value.findIndex(({ id }) => id === idToRemove);\n if (index === -1) {\n return;\n }\n\n active.value.splice(index, 1);\n }\n\n // method overloads\n function create(text: Toast['text'], status: StatusSeverity, options?: Omit<ToastOptions, 'group'>): Toast['id'];\n function create(\n text: Toast['text'],\n status: StatusSeverity,\n options: ToastOptions & { id: string },\n ): Toast['id'] | undefined;\n function create(text: Toast['text'], status: StatusSeverity, localOptions?: ToastOptions): Toast['id'] | undefined {\n const options = merge({}, globalOptions, localOptions);\n\n const id = options?.group ? `toast-${status}-${options.group}` : uniqueId('toast-');\n if (options?.group && active.value.some(({ id: existingId }) => existingId === id)) {\n return;\n }\n\n active.value.push({
|
|
1
|
+
{"version":3,"file":"useToasts.js","sources":["../src/composables/useToasts/useToasts.ts"],"sourcesContent":["import merge from 'lodash-es/merge';\nimport uniqueId from 'lodash-es/uniqueId';\nimport { reactive, readonly, ref, RenderFunction } from 'vue';\n\nimport { StatusSeverity } from '../../../types/statusLevels';\n\nexport const DEFAULT_TIMEOUT = 5000;\n\nexport type Toast = {\n id: string;\n text: string | RenderFunction;\n status: StatusSeverity;\n offsetTop?: string;\n};\n\nexport interface ToastOptions {\n /**\n * The timeout in milliseconds before the toast is automatically dismissed. If set to `false`, the toast will persist until the user clicks on it.\n * @default DEFAULT_TIMEOUT\n */\n timeout?: number | boolean;\n /**\n * A group name ensures only one toast with the same group and status is visible at any given time.\n * Toasts with the same group but different statuses will be treated as separate and will display concurrently.\n */\n group?: string;\n /**\n * The container distance from the top of the viewport.\n */\n offsetTop?: string;\n}\n\ntype ToastIdOrUndefined<O extends ToastOptions | undefined> = O extends { id: string }\n ? Toast['id'] | undefined\n : Toast['id'];\n\nconst active = ref<Toast[]>([]);\n\nexport default function useToasts(globalOptions: Omit<ToastOptions, 'group'> = { timeout: DEFAULT_TIMEOUT }) {\n // method overloads\n function remove(toastId: Toast['id']): void;\n function remove(options: { group: string; status: StatusSeverity }): void;\n function remove(toastIdOrOptions: Toast['id'] | { group: string; status: StatusSeverity }) {\n const toastId = typeof toastIdOrOptions === 'string' ? toastIdOrOptions : undefined;\n const { group = undefined, status = undefined } = typeof toastIdOrOptions === 'object' ? toastIdOrOptions : {};\n\n if (!toastId && (!group || !status)) {\n throw new Error('Must provide either a toast ID or both group and type');\n }\n\n const idToRemove = group && status ? `toast-${status}-${group}` : String(toastId);\n const index = active.value.findIndex(({ id }) => id === idToRemove);\n if (index === -1) {\n return;\n }\n\n active.value.splice(index, 1);\n }\n\n // method overloads\n function create(text: Toast['text'], status: StatusSeverity, options?: Omit<ToastOptions, 'group'>): Toast['id'];\n function create(\n text: Toast['text'],\n status: StatusSeverity,\n options: ToastOptions & { id: string },\n ): Toast['id'] | undefined;\n function create(text: Toast['text'], status: StatusSeverity, localOptions?: ToastOptions): Toast['id'] | undefined {\n const options = merge({}, globalOptions, localOptions);\n\n const id = options?.group ? `toast-${status}-${options.group}` : uniqueId('toast-');\n if (options?.group && active.value.some(({ id: existingId }) => existingId === id)) {\n return;\n }\n\n active.value.push({\n text,\n id,\n status,\n offsetTop: options.offsetTop,\n });\n\n if (typeof options.timeout === 'number') {\n setTimeout(() => remove(id), Math.abs(options.timeout));\n }\n\n return id;\n }\n\n function removeAll() {\n active.value = [];\n }\n\n function error<O extends ToastOptions>(text: Toast['text'], options?: O): ToastIdOrUndefined<O> {\n return create(text, 'error', options);\n }\n\n function info<O extends ToastOptions>(text: Toast['text'], options?: O): ToastIdOrUndefined<O> {\n return create(text, 'info', options);\n }\n\n function success<O extends ToastOptions>(text: Toast['text'], options?: O): ToastIdOrUndefined<O> {\n return create(text, 'success', options);\n }\n\n function warning<O extends ToastOptions>(text: Toast['text'], options?: O): ToastIdOrUndefined<O> {\n return create(text, 'warning', options);\n }\n\n return reactive({\n /**\n * The list of toasts that are currently visible.\n */\n active: readonly(active),\n\n /**\n * Removes an active/visible toast by id or by group and type.\n */\n remove,\n\n /**\n * Creates a new toast and makes it active/visible.\n */\n create,\n\n /**\n * Removes all active/visible toasts.\n */\n removeAll,\n\n /**\n * Creates a new \"error\" toast.\n */\n error,\n\n /**\n * Creates a new \"info\" toast.\n */\n info,\n\n /**\n * Creates a new \"success\" toast.\n */\n success,\n\n /**\n * Creates a new \"warning\" toast.\n */\n warning,\n });\n}\n"],"names":["DEFAULT_TIMEOUT","active","ref","useToasts","globalOptions","remove","toastIdOrOptions","toastId","group","status","idToRemove","index","id","create","text","localOptions","options","merge","uniqueId","existingId","removeAll","error","info","success","warning","reactive","readonly"],"mappings":";;;AAMO,MAAMA,IAAkB,KA8BzBC,IAASC,EAAa,EAAE;AAE9B,SAAwBC,EAAUC,IAA6C,EAAE,SAASJ,KAAmB;AAI3G,WAASK,EAAOC,GAA2E;AACzF,UAAMC,IAAU,OAAOD,KAAqB,WAAWA,IAAmB,QACpE,EAAE,OAAAE,IAAQ,QAAW,QAAAC,IAAS,WAAc,OAAOH,KAAqB,WAAWA,IAAmB,CAAC;AAE7G,QAAI,CAACC,MAAY,CAACC,KAAS,CAACC;AACpB,YAAA,IAAI,MAAM,uDAAuD;AAGnE,UAAAC,IAAaF,KAASC,IAAS,SAASA,CAAM,IAAID,CAAK,KAAK,OAAOD,CAAO,GAC1EI,IAAQV,EAAO,MAAM,UAAU,CAAC,EAAE,IAAAW,EAAA,MAASA,MAAOF,CAAU;AAClE,IAAIC,MAAU,MAIPV,EAAA,MAAM,OAAOU,GAAO,CAAC;AAAA,EAAA;AAUrB,WAAAE,EAAOC,GAAqBL,GAAwBM,GAAsD;AACjH,UAAMC,IAAUC,EAAM,IAAIb,GAAeW,CAAY,GAE/CH,IAAKI,KAAA,QAAAA,EAAS,QAAQ,SAASP,CAAM,IAAIO,EAAQ,KAAK,KAAKE,EAAS,QAAQ;AAClF,QAAI,EAAAF,KAAA,QAAAA,EAAS,SAASf,EAAO,MAAM,KAAK,CAAC,EAA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
|
|
5
5
|
"homepage": "https://stash.leaflink.com",
|
|
6
6
|
"main": "./dist/index.ts",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@babel/core": "7.26.10",
|
|
119
119
|
"@babel/preset-env": "7.26.9",
|
|
120
120
|
"@babel/preset-typescript": "7.26.0",
|
|
121
|
-
"@leaflink/eslint-config": "^4.1.
|
|
121
|
+
"@leaflink/eslint-config": "^4.1.4",
|
|
122
122
|
"@rollup/pluginutils": "^5.1.1",
|
|
123
123
|
"@testing-library/jest-dom": "^6.6.3",
|
|
124
124
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -134,7 +134,8 @@
|
|
|
134
134
|
"@vue/test-utils": "^2.4.6",
|
|
135
135
|
"autoprefixer": "^10.4.20",
|
|
136
136
|
"doctoc": "^2.2.1",
|
|
137
|
-
"eslint": "^9.
|
|
137
|
+
"eslint": "^9.31.0",
|
|
138
|
+
"globals": "^16.3.0",
|
|
138
139
|
"husky": "^9.1.6",
|
|
139
140
|
"jsdom": "^25.0.1",
|
|
140
141
|
"lint-staged": "^15.2.10",
|
|
@@ -146,7 +147,7 @@
|
|
|
146
147
|
"quill": "^2.0.2",
|
|
147
148
|
"rollup-plugin-copy": "^3.5.0",
|
|
148
149
|
"stylelint": "^16.12.0",
|
|
149
|
-
"stylelint-config-standard-scss": "^
|
|
150
|
+
"stylelint-config-standard-scss": "^15.0.1",
|
|
150
151
|
"stylelint-config-standard-vue": "^1.0.0",
|
|
151
152
|
"svg-sprite": "^2.0.4",
|
|
152
153
|
"tailwindcss": "^3.4.13",
|