eco-vue-js 0.26.4 → 0.26.6
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/components/Auth/utils/utils.d.ts +8 -7
- package/dist/components/Auth/utils/utils.d.ts.map +1 -1
- package/dist/components/Auth/utils/utils.js +28 -25
- package/dist/components/Button/WButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Button/WButtonInput.vue.d.ts +2 -0
- package/dist/components/Button/WButtonInput.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonInput.vue_vue_type_script_setup_true_lang.js +5 -3
- package/dist/components/Button/WButtonMore.vue.d.ts +11 -0
- package/dist/components/Button/WButtonMore.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonMore.vue_vue_type_script_setup_true_lang.js +12 -5
- package/dist/components/Checkbox/WCheckbox.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/WCheckbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/utils/ApiClient.d.ts +3 -0
- package/dist/utils/ApiClient.d.ts.map +1 -1
- package/dist/utils/ApiClient.js +10 -7
- package/docs/components/button.md +1 -0
- package/docs/components/dropdown-menu.md +26 -1
- package/docs/llms.txt +1 -1
- package/package.json +1 -1
- package/tailwind-base/css/internal-variables.css +9 -0
- package/tailwind-base/plugins/w-ripple.ts +1 -4
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
1
|
+
export declare const EXPIRATION_DATE_KEY = "exp";
|
|
2
|
+
export declare function checkExpirationDate(key?: string): boolean | null;
|
|
3
|
+
export declare function updateExpirationDate(date: Date, key?: string): void;
|
|
4
|
+
export declare function setExpirationDate(key?: string): void;
|
|
5
|
+
export declare function removeExpirationDate(key?: string): void;
|
|
6
|
+
export declare function setRefreshTimestamp(key?: string): void;
|
|
7
|
+
export declare function removeRefreshTimestamp(key?: string): void;
|
|
8
|
+
export declare function getLastRefreshPromise(key?: string): Promise<void> | null;
|
|
8
9
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/Auth/utils/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/Auth/utils/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,QAAQ,CAAA;AA8BxC,wBAAgB,mBAAmB,CAAC,GAAG,SAAsB,GAAG,OAAO,GAAG,IAAI,CAM7E;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,SAAsB,QAIzE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,SAAsB,QAM1D;AAED,wBAAgB,oBAAoB,CAAC,GAAG,SAAsB,QAG7D;AAID,wBAAgB,mBAAmB,CAAC,GAAG,SAAsB,QAW5D;AAED,wBAAgB,sBAAsB,CAAC,GAAG,SAAsB,GAAG,IAAI,CAEtE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,SAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAwBrF"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
//#region src/components/Auth/utils/utils.ts
|
|
2
|
-
var EXPIRATION_DATE_KEY = "exp";
|
|
3
1
|
var REFRESH_TIMESTAMP_KEY = "refresh-ts";
|
|
4
2
|
var REFRESH_BUFFER_TIMEOUT = 3e3;
|
|
5
3
|
var REFRESH_BUFFER_TICK = 1e3;
|
|
@@ -15,38 +13,43 @@ function deleteCookie(name) {
|
|
|
15
13
|
document.cookie = name + "=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
|
|
16
14
|
}
|
|
17
15
|
var EXP_FACTOR = 1e3;
|
|
18
|
-
function
|
|
19
|
-
|
|
16
|
+
function getRefreshTimestampKey(key) {
|
|
17
|
+
return key === "exp" ? REFRESH_TIMESTAMP_KEY : key + "-refresh-ts";
|
|
18
|
+
}
|
|
19
|
+
function checkExpirationDate(key = "exp") {
|
|
20
|
+
const exp = Number.parseFloat(getCookie(key));
|
|
20
21
|
if (!exp || !Number.isFinite(exp)) return null;
|
|
21
22
|
return exp > Date.now() / EXP_FACTOR;
|
|
22
23
|
}
|
|
23
|
-
function updateExpirationDate(date) {
|
|
24
|
+
function updateExpirationDate(date, key = "exp") {
|
|
24
25
|
const exp = (date.getTime() / EXP_FACTOR).toString();
|
|
25
|
-
setCookie(
|
|
26
|
-
localStorage.setItem(
|
|
26
|
+
setCookie(key, exp, date);
|
|
27
|
+
localStorage.setItem(key, exp);
|
|
27
28
|
}
|
|
28
|
-
function setExpirationDate() {
|
|
29
|
-
const exp = Number.parseFloat(getCookie(
|
|
29
|
+
function setExpirationDate(key = "exp") {
|
|
30
|
+
const exp = Number.parseFloat(getCookie(key));
|
|
30
31
|
if (!exp || !Number.isFinite(exp)) return;
|
|
31
|
-
localStorage.setItem(
|
|
32
|
+
localStorage.setItem(key, exp.toString());
|
|
32
33
|
}
|
|
33
|
-
function removeExpirationDate() {
|
|
34
|
-
localStorage.removeItem(
|
|
35
|
-
deleteCookie(
|
|
34
|
+
function removeExpirationDate(key = "exp") {
|
|
35
|
+
localStorage.removeItem(key);
|
|
36
|
+
deleteCookie(key);
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
-
function setRefreshTimestamp() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
var refreshTimestampTimeouts = /* @__PURE__ */ new Map();
|
|
39
|
+
function setRefreshTimestamp(key = "exp") {
|
|
40
|
+
const refreshKey = getRefreshTimestampKey(key);
|
|
41
|
+
localStorage.setItem(refreshKey, (/* @__PURE__ */ new Date()).getTime().toString());
|
|
42
|
+
clearTimeout(refreshTimestampTimeouts.get(refreshKey));
|
|
43
|
+
refreshTimestampTimeouts.set(refreshKey, setTimeout(() => {
|
|
44
|
+
refreshTimestampTimeouts.delete(refreshKey);
|
|
45
|
+
localStorage.removeItem(refreshKey);
|
|
46
|
+
}, REFRESH_BUFFER_TIMEOUT));
|
|
44
47
|
}
|
|
45
|
-
function removeRefreshTimestamp() {
|
|
46
|
-
localStorage.removeItem(
|
|
48
|
+
function removeRefreshTimestamp(key = "exp") {
|
|
49
|
+
localStorage.removeItem(getRefreshTimestampKey(key));
|
|
47
50
|
}
|
|
48
|
-
function getLastRefreshPromise() {
|
|
49
|
-
const lastRefreshTimeStamp = Number.parseInt(localStorage.getItem(
|
|
51
|
+
function getLastRefreshPromise(key = "exp") {
|
|
52
|
+
const lastRefreshTimeStamp = Number.parseInt(localStorage.getItem(getRefreshTimestampKey(key)) ?? "");
|
|
50
53
|
if (!Number.isInteger(lastRefreshTimeStamp) || lastRefreshTimeStamp <= 0) return null;
|
|
51
54
|
const diff = (/* @__PURE__ */ new Date()).getTime() - lastRefreshTimeStamp;
|
|
52
55
|
if (diff <= 0 || diff > REFRESH_BUFFER_TIMEOUT) return null;
|
|
@@ -56,7 +59,7 @@ function getLastRefreshPromise() {
|
|
|
56
59
|
if (count < 1) {
|
|
57
60
|
clearInterval(interval);
|
|
58
61
|
reject(/* @__PURE__ */ new Error("Timed out"));
|
|
59
|
-
} else if (checkExpirationDate()) {
|
|
62
|
+
} else if (checkExpirationDate(key)) {
|
|
60
63
|
clearInterval(interval);
|
|
61
64
|
resolve();
|
|
62
65
|
} else count--;
|
|
@@ -104,7 +104,7 @@ var WButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
104
104
|
} : {}
|
|
105
105
|
}, {
|
|
106
106
|
ref: "container",
|
|
107
|
-
class: ["relative isolate flex min-h---button-height items-center justify-center rounded-(--w-button-rounded,1rem) [border-width:var(--w-button-border,1px)] px-(--w-button-padding) font-medium whitespace-nowrap select-none w-ripple-
|
|
107
|
+
class: ["relative isolate flex min-h---button-height items-center justify-center rounded-(--w-button-rounded,1rem) [border-width:var(--w-button-border,1px)] px-(--w-button-padding) font-medium whitespace-nowrap select-none w-ripple-border-(--w-button-border,1px)", {
|
|
108
108
|
[unref(semanticTypeButtonBackgroundMap)[__props.semanticType] ?? unref(semanticTypeBackgroundMap)[__props.semanticType]]: !__props.outline,
|
|
109
109
|
"before:text-tone-fill": __props.outline,
|
|
110
110
|
[unref(semanticTypeBorderMap)[__props.semanticType]]: true,
|
|
@@ -12,6 +12,8 @@ type __VLS_Props = {
|
|
|
12
12
|
skeleton?: boolean;
|
|
13
13
|
/** Grays the button out and ignores clicks. */
|
|
14
14
|
disabled?: boolean;
|
|
15
|
+
/** Highlights the button, such as while the menu it opens is shown. */
|
|
16
|
+
active?: boolean;
|
|
15
17
|
};
|
|
16
18
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
17
19
|
click: (value: MouseEvent) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WButtonInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WButtonInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonInput.vue"],"names":[],"mappings":"AA2CA;AA2EA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAO5C,KAAK,WAAW,GAAG;IACjB,0BAA0B;IAC1B,IAAI,EAAE,YAAY,CAAA;IAClB,sFAAsF;IACtF,EAAE,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;IACpB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAuKF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -12,7 +12,8 @@ var WButtonInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
12
12
|
tooltipText: {},
|
|
13
13
|
loading: { type: Boolean },
|
|
14
14
|
skeleton: { type: Boolean },
|
|
15
|
-
disabled: { type: Boolean }
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
active: { type: Boolean }
|
|
16
17
|
},
|
|
17
18
|
emits: ["click"],
|
|
18
19
|
setup(__props) {
|
|
@@ -21,10 +22,11 @@ var WButtonInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
21
22
|
key: 0,
|
|
22
23
|
class: "square---w-input-height w-skeleton-rounded-(--w-input-rounded,0.75rem)"
|
|
23
24
|
})) : (openBlock(), createBlock(resolveDynamicComponent(__props.to ? WRouterLink_default : "button"), mergeProps({ key: 1 }, __props.to ? { to: __props.to } : void 0, {
|
|
24
|
-
class: ["square---w-input-height bg-surface relative flex select-none items-center justify-center rounded-(--w-input-rounded,0.75rem) border border-solid border-line-subtle", {
|
|
25
|
+
class: ["square---w-input-height bg-surface relative flex select-none items-center justify-center rounded-(--w-input-rounded,0.75rem) border border-solid border-line-subtle w-ripple-border", {
|
|
25
26
|
"cursor-not-allowed opacity-50": __props.disabled,
|
|
26
27
|
"w-ripple w-ripple-hover cursor-pointer": !__props.disabled,
|
|
27
|
-
"cursor-progress": __props.loading
|
|
28
|
+
"cursor-progress": __props.loading,
|
|
29
|
+
"tone-primary text-tone border-tone-line": __props.active
|
|
28
30
|
}],
|
|
29
31
|
disabled: __props.disabled,
|
|
30
32
|
"aria-label": __props.tooltipText,
|
|
@@ -13,6 +13,17 @@ type __VLS_Slots = {
|
|
|
13
13
|
* A confirm opened from an item with `useOverlay` takes the menu's place at the same anchor.
|
|
14
14
|
*/
|
|
15
15
|
default?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Replaces the three-dots button, such as with WButtonInput: call `toggle` on click, bind `attrs` to the button
|
|
18
|
+
* and `active` to its highlight — `active` stays off while the menu is open at a custom anchor.
|
|
19
|
+
*/
|
|
20
|
+
toggle?: (props: {
|
|
21
|
+
toggle: () => void;
|
|
22
|
+
active: boolean;
|
|
23
|
+
attrs: {
|
|
24
|
+
'aria-expanded': boolean;
|
|
25
|
+
};
|
|
26
|
+
}) => void;
|
|
16
27
|
};
|
|
17
28
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
18
29
|
open: (anchor?: OverlayAnchor) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WButtonMore.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonMore.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WButtonMore.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButtonMore.vue"],"names":[],"mappings":"AA6CA;AA6JA,OAAO,EAAC,KAAK,aAAa,EAAa,MAAM,iBAAiB,CAAA;AAE9D,KAAK,WAAW,GAAG;IACjB,kDAAkD;IAClD,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sIAAsI;IACtI,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB,CAAC;AASF,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAC,MAAM,EAAE,MAAM,IAAI,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE;YAAC,eAAe,EAAE,OAAO,CAAA;SAAC,CAAA;KAAC,KAAK,IAAI,CAAA;CACnG,CAAC;AA+JF,QAAA,MAAM,UAAU;oBAxIO,aAAa,KAAG,IAAI;iBA8BzB,IAAI;;IAepB,wDAAwD;;;;;;kFA+FxD,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hasAnchorLayer } from "../Modal/models/overlayRegistry.js";
|
|
2
2
|
import { useOverlay } from "../../utils/Overlay.js";
|
|
3
3
|
import IconMore_default from "../../assets/icons/IconMore.js";
|
|
4
|
-
import { computed, createBlock, createElementBlock, createElementVNode, defineComponent, markRaw, mergeProps, normalizeClass, openBlock, ref, resolveDynamicComponent, shallowRef, unref, useSlots, useTemplateRef } from "vue";
|
|
4
|
+
import { computed, createBlock, createElementBlock, createElementVNode, defineComponent, markRaw, mergeProps, normalizeClass, openBlock, ref, renderSlot, resolveDynamicComponent, shallowRef, unref, useSlots, useTemplateRef } from "vue";
|
|
5
5
|
//#region src/components/Button/WButtonMore.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = [
|
|
7
7
|
"disabled",
|
|
@@ -20,7 +20,7 @@ var WButtonMore_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
20
20
|
const props = __props;
|
|
21
21
|
const emit = __emit;
|
|
22
22
|
const slots = useSlots();
|
|
23
|
-
const renderSlot = markRaw(() => slots.default?.());
|
|
23
|
+
const renderSlot$1 = markRaw(() => slots.default?.());
|
|
24
24
|
const buttonRef = useTemplateRef("button");
|
|
25
25
|
const overlay = useOverlay();
|
|
26
26
|
let closeMenu = null;
|
|
@@ -36,7 +36,7 @@ var WButtonMore_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
36
36
|
const value = overlay.open({
|
|
37
37
|
present: "dropdown",
|
|
38
38
|
anchor: opened,
|
|
39
|
-
content: renderSlot,
|
|
39
|
+
content: renderSlot$1,
|
|
40
40
|
dropdown: {
|
|
41
41
|
cornered: target !== void 0,
|
|
42
42
|
closeOnClick: true
|
|
@@ -69,7 +69,14 @@ var WButtonMore_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
69
69
|
isActive
|
|
70
70
|
});
|
|
71
71
|
return (_ctx, _cache) => {
|
|
72
|
-
return openBlock(), createElementBlock("
|
|
72
|
+
return _ctx.$slots.toggle ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
73
|
+
ref: "button",
|
|
74
|
+
class: "inline-flex"
|
|
75
|
+
}), [renderSlot(_ctx.$slots, "toggle", {
|
|
76
|
+
toggle,
|
|
77
|
+
active: isOpen.value && !isCustomAnchor.value,
|
|
78
|
+
attrs: { "aria-expanded": isOpen.value }
|
|
79
|
+
})], 16)) : (openBlock(), createElementBlock("button", mergeProps({ key: 1 }, _ctx.$attrs, {
|
|
73
80
|
ref: "button",
|
|
74
81
|
disabled: __props.disabled,
|
|
75
82
|
class: [{
|
|
@@ -84,7 +91,7 @@ var WButtonMore_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
84
91
|
"w-hover-circle": !__props.disabled,
|
|
85
92
|
"text-description": !isOpen.value || isCustomAnchor.value,
|
|
86
93
|
"tone-primary text-tone": isOpen.value && !isCustomAnchor.value
|
|
87
|
-
}]) }, [(openBlock(), createBlock(resolveDynamicComponent(__props.icon ?? unref(IconMore_default)), { class: "square-[1.125em]" }))], 2)], 16, _hoisted_1);
|
|
94
|
+
}]) }, [(openBlock(), createBlock(resolveDynamicComponent(__props.icon ?? unref(IconMore_default)), { class: "square-[1.125em]" }))], 2)], 16, _hoisted_1));
|
|
88
95
|
};
|
|
89
96
|
}
|
|
90
97
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Checkbox/WCheckbox.vue"],"names":[],"mappings":"AAkGA;AAkJA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAA;AAiC1C,KAAK,WAAW,GAAG;IACjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"WCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Checkbox/WCheckbox.vue"],"names":[],"mappings":"AAkGA;AAkJA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAA;AAiC1C,KAAK,WAAW,GAAG;IACjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAC;AAyPF,QAAA,MAAM,UAAU;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -80,7 +80,7 @@ var WCheckbox_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
80
80
|
"text-tone-on": __props.modelValue && !unref(isDisabled) && !unref(isSkeleton),
|
|
81
81
|
"tone-primary text-tone": !__props.modelValue && !unref(isDisabled) && !unref(isSkeleton),
|
|
82
82
|
"text-subtle": !__props.modelValue && unref(isDisabled) && !unref(isSkeleton),
|
|
83
|
-
"w-ripple w-hover-circle before:text-accent after:text-accent": !unref(isDisabled) && !unref(isReadonly) && !unref(isSkeleton),
|
|
83
|
+
"w-ripple w-ripple-border w-hover-circle before:text-accent after:text-accent": !unref(isDisabled) && !unref(isReadonly) && !unref(isSkeleton),
|
|
84
84
|
"rounded-full": __props.radio,
|
|
85
85
|
"rounded-md": !__props.radio,
|
|
86
86
|
"border-line": unref(isDisabled) || unref(isSkeleton),
|
|
@@ -28,7 +28,10 @@ export declare class ApiClientInstance implements ApiClient {
|
|
|
28
28
|
credentials?: RequestCredentials;
|
|
29
29
|
baseUrl?: BaseUrl;
|
|
30
30
|
noRecheck?: boolean;
|
|
31
|
+
/** Cookie holding when to refresh the session, in epoch seconds. Defaults to `exp` */
|
|
32
|
+
expirationCookie?: string;
|
|
31
33
|
});
|
|
34
|
+
private get expirationCookie();
|
|
32
35
|
setOnFailure(value: (response: Response) => void): void;
|
|
33
36
|
logout(): void;
|
|
34
37
|
private retry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClient.d.ts","sourceRoot":"","sources":["../../../src/utils/ApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,YAAY,CAAA;AAE7C,OAAO,EAAC,KAAK,GAAG,EAAM,MAAM,KAAK,CAAA;AAMjC,OAAO,EAAC,oBAAoB,EAAC,MAAM,+BAA+B,CAAA;AAElE,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,CAAC,QAAQ,CAAC,GAAG,aAAa,KAAG,MAE9E,CAAA;AAYD,MAAM,WAAW,MAAM;CAAG;AAE1B,KAAK,MAAM,GAAG,MAAM,SAAS;IAAC,MAAM,EAAE,MAAM,KAAK,CAAA;CAAC,GAAG,KAAK,GAAG,IAAK,MAAO,GAAG,CAAA;AAC5E,KAAK,OAAO,GAAG,IAAK,MAAO,EAAE,GAAG,UAAW,MAAO,EAAE,GAAG,WAAY,MAAO,EAAE,CAAA;AAE5E,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAA;IAEf,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,E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;QACjB,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,sFAAsF;QACtF,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAC1B;IAYD,OAAO,KAAK,gBAAgB,GAE3B;IAED,YAAY,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI;IAIhD,MAAM;YAMQ,KAAK;YAcL,OAAO;IAqDrB,SAAS;IAYT,OAAO,CAAC,KAAK;IAmGb,IAAW,OAAO,iBAEjB;IAED,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;IAIjD,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAI5I,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IAI7I,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;IAIpD,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS;CAqBzC"}
|
package/dist/utils/ApiClient.js
CHANGED
|
@@ -26,11 +26,14 @@ var ApiClientInstance = class {
|
|
|
26
26
|
return this.auth;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
+
get expirationCookie() {
|
|
30
|
+
return this.config.expirationCookie ?? "exp";
|
|
31
|
+
}
|
|
29
32
|
setOnFailure(value) {
|
|
30
33
|
this.config.onFailure = value;
|
|
31
34
|
}
|
|
32
35
|
logout() {
|
|
33
|
-
removeExpirationDate();
|
|
36
|
+
removeExpirationDate(this.expirationCookie);
|
|
34
37
|
this.auth.value = false;
|
|
35
38
|
}
|
|
36
39
|
async retry(request) {
|
|
@@ -45,7 +48,7 @@ var ApiClientInstance = class {
|
|
|
45
48
|
}
|
|
46
49
|
async refresh() {
|
|
47
50
|
if (!this.refreshPromise) {
|
|
48
|
-
const refreshTimeoutPromise = getLastRefreshPromise();
|
|
51
|
+
const refreshTimeoutPromise = getLastRefreshPromise(this.expirationCookie);
|
|
49
52
|
if (refreshTimeoutPromise) this.refreshPromise = refreshTimeoutPromise.then(() => {
|
|
50
53
|
this.refreshPromise = null;
|
|
51
54
|
this.auth.value = true;
|
|
@@ -62,7 +65,7 @@ var ApiClientInstance = class {
|
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
67
|
else {
|
|
65
|
-
setRefreshTimestamp();
|
|
68
|
+
setRefreshTimestamp(this.expirationCookie);
|
|
66
69
|
const promise = this.config.tokenRefresh ? this.config.tokenRefresh() : this.fetch("GET", this.config.refreshUrl, { updateToken: true });
|
|
67
70
|
this.refreshPromise = promise.then(() => {
|
|
68
71
|
this.refreshPromise = null;
|
|
@@ -71,7 +74,7 @@ var ApiClientInstance = class {
|
|
|
71
74
|
this.refreshPromise = null;
|
|
72
75
|
this.auth.value = false;
|
|
73
76
|
return Promise.reject(error);
|
|
74
|
-
}).finally(removeRefreshTimestamp);
|
|
77
|
+
}).finally(() => removeRefreshTimestamp(this.expirationCookie));
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
80
|
return this.refreshPromise;
|
|
@@ -79,9 +82,9 @@ var ApiClientInstance = class {
|
|
|
79
82
|
checkAuth() {
|
|
80
83
|
let result;
|
|
81
84
|
if (this.config.tokenGetter) result = !!this.config.tokenGetter?.();
|
|
82
|
-
else result = checkExpirationDate();
|
|
85
|
+
else result = checkExpirationDate(this.expirationCookie);
|
|
83
86
|
if (result !== false) this.auth.value = result !== null;
|
|
84
|
-
if (result === null) removeExpirationDate();
|
|
87
|
+
if (result === null) removeExpirationDate(this.expirationCookie);
|
|
85
88
|
return result;
|
|
86
89
|
}
|
|
87
90
|
fetch(method, url, config, baseUrl) {
|
|
@@ -151,7 +154,7 @@ var ApiClientInstance = class {
|
|
|
151
154
|
}));
|
|
152
155
|
else reject(error);
|
|
153
156
|
}).finally(() => {
|
|
154
|
-
if (config?.updateToken) setExpirationDate();
|
|
157
|
+
if (config?.updateToken) setExpirationDate(this.expirationCookie);
|
|
155
158
|
});
|
|
156
159
|
});
|
|
157
160
|
}
|
|
@@ -224,6 +224,7 @@ import WButtonInput from 'eco-vue-js/dist/components/Button/WButtonInput.vue'
|
|
|
224
224
|
| `loading` | `boolean` | — | Shows a spinner instead of the icon and ignores clicks. |
|
|
225
225
|
| `skeleton` | `boolean` | — | Shows a placeholder instead of the button. |
|
|
226
226
|
| `disabled` | `boolean` | — | Grays the button out and ignores clicks. |
|
|
227
|
+
| `active` | `boolean` | — | Highlights the button, such as while the menu it opens is shown. |
|
|
227
228
|
|
|
228
229
|
#### Events
|
|
229
230
|
|
|
@@ -4,7 +4,7 @@ For a menu of actions, use a ready-made button. For anything else anchored to an
|
|
|
4
4
|
|
|
5
5
|
## Action menus
|
|
6
6
|
|
|
7
|
-
- `WButtonMore` is the "⋯" button: its default slot is the menu, and any click closes it. Only one menu is open at a time, and on phones it opens as a bottom sheet. The menu is rendered by `WModal` at the app root, with the slot keeping its context, and a confirm opened from an item with `useOverlay` takes its place — see [Anchored confirm](./modal.md#anchored-confirm).
|
|
7
|
+
- `WButtonMore` is the "⋯" button: its default slot is the menu, and any click closes it. Only one menu is open at a time, and on phones it opens as a bottom sheet. The menu is rendered by `WModal` at the app root, with the slot keeping its context, and a confirm opened from an item with `useOverlay` takes its place — see [Anchored confirm](./modal.md#anchored-confirm). The `toggle` slot swaps the "⋯" for another button, such as a `WButtonInput`: it gets `toggle` for the click, `attrs` for the button and `active` for its highlight.
|
|
8
8
|
- `WButtonDropdown` is a button with an arrow next to it: the `button` slot holds the main action and the `content` slot the others. The `content` slot gets `close`.
|
|
9
9
|
|
|
10
10
|
Menu items are `WButtonMoreItem`s: a `text` (or the default slot), an `icon`, and `to` or `href` to make the item a link. A disabled item can explain itself with `tooltipText`. `semanticType` colors an item, like the red Delete below.
|
|
@@ -61,6 +61,28 @@ Menu items are `WButtonMoreItem`s: a `text` (or the default slot), an `icon`, an
|
|
|
61
61
|
/>
|
|
62
62
|
</template>
|
|
63
63
|
</WButtonDropdown>
|
|
64
|
+
|
|
65
|
+
<WButtonMore>
|
|
66
|
+
<template #toggle="{toggle, active, attrs}">
|
|
67
|
+
<WButtonInput
|
|
68
|
+
:icon="markRaw(IconSort)"
|
|
69
|
+
tooltip-text="Sort beds"
|
|
70
|
+
:active="active"
|
|
71
|
+
v-bind="attrs"
|
|
72
|
+
@click="toggle"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<WButtonMoreItem
|
|
77
|
+
text="Sort by name"
|
|
78
|
+
@click="action = 'Sort by name'"
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
<WButtonMoreItem
|
|
82
|
+
text="Sort by planting date"
|
|
83
|
+
@click="action = 'Sort by planting date'"
|
|
84
|
+
/>
|
|
85
|
+
</WButtonMore>
|
|
64
86
|
</div>
|
|
65
87
|
|
|
66
88
|
<p class="text-description mt-4 text-sm">
|
|
@@ -75,12 +97,14 @@ import {SemanticType} from 'eco-vue-js/dist/utils/SemanticType'
|
|
|
75
97
|
|
|
76
98
|
import WButton from 'eco-vue-js/dist/components/Button/WButton.vue'
|
|
77
99
|
import WButtonDropdown from 'eco-vue-js/dist/components/Button/WButtonDropdown.vue'
|
|
100
|
+
import WButtonInput from 'eco-vue-js/dist/components/Button/WButtonInput.vue'
|
|
78
101
|
import WButtonMore from 'eco-vue-js/dist/components/Button/WButtonMore.vue'
|
|
79
102
|
import WButtonMoreItem from 'eco-vue-js/dist/components/Button/WButtonMoreItem.vue'
|
|
80
103
|
|
|
81
104
|
import IconArchiveBook from 'eco-vue-js/dist/assets/icons/IconArchiveBook'
|
|
82
105
|
import IconCopy from 'eco-vue-js/dist/assets/icons/IconCopy'
|
|
83
106
|
import IconEdit from 'eco-vue-js/dist/assets/icons/IconEdit'
|
|
107
|
+
import IconSort from 'eco-vue-js/dist/assets/icons/IconSort'
|
|
84
108
|
import IconTrash from 'eco-vue-js/dist/assets/icons/IconTrash'
|
|
85
109
|
|
|
86
110
|
const action = ref<string>()
|
|
@@ -250,6 +274,7 @@ import WButtonMore from 'eco-vue-js/dist/components/Button/WButtonMore.vue'
|
|
|
250
274
|
| Slot | Props | Description |
|
|
251
275
|
| --- | --- | --- |
|
|
252
276
|
| `default` | — | Menu items, usually WButtonMoreItem. A click inside closes the menu. Only one menu is open at a time, and on phones it is a bottom sheet. A confirm opened from an item with `useOverlay` takes the menu's place at the same anchor. |
|
|
277
|
+
| `toggle` | `{ toggle: () => void; active: boolean; attrs: { 'aria-expanded': boolean; }; }` | Replaces the three-dots button, such as with WButtonInput: call `toggle` on click, bind `attrs` to the button and `active` to its highlight — `active` stays off while the menu is open at a custom anchor. |
|
|
253
278
|
|
|
254
279
|
### WButtonDropdown
|
|
255
280
|
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# eco-vue-js
|
|
2
2
|
|
|
3
|
-
> Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.26.
|
|
3
|
+
> Vue 3 UI kit with Tailwind v4 — components, utilities, icons and recipes. These are the docs of version 0.26.6, the one installed next to them. Start with Getting started and Conventions; each component page lists its props, events and slots with examples.
|
|
4
4
|
|
|
5
5
|
Release notes, for what changed between versions: https://github.com/rsmple/eco-vue-js/releases. The docs site, with live demos: https://rsmple.github.io/eco-vue-js/
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -231,6 +231,15 @@
|
|
|
231
231
|
--w-ripple-rounded: --value(--radius-*, --w-radius-*, [*]);
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
@utility w-ripple-border {
|
|
235
|
+
--w-ripple-border: 1px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@utility w-ripple-border-* {
|
|
239
|
+
--w-ripple-border: calc(--value(integer) * 1px);
|
|
240
|
+
--w-ripple-border: --value([length], [*]);
|
|
241
|
+
}
|
|
242
|
+
|
|
234
243
|
@utility w-list-rounded-* {
|
|
235
244
|
--w-list-rounded: --value(--radius-*, --w-radius-*, [*]);
|
|
236
245
|
}
|
|
@@ -6,10 +6,7 @@ const pluginRipple = plugin(function ({matchUtilities, addUtilities, addBase}) {
|
|
|
6
6
|
'&::before': {
|
|
7
7
|
content: '""',
|
|
8
8
|
position: 'absolute',
|
|
9
|
-
|
|
10
|
-
left: '0',
|
|
11
|
-
height: '100%',
|
|
12
|
-
width: '100%',
|
|
9
|
+
inset: 'calc(var(--w-ripple-border, 0px) * -1)',
|
|
13
10
|
'border-radius': 'var(--w-ripple-rounded,inherit)',
|
|
14
11
|
'background-color': 'currentColor',
|
|
15
12
|
'pointer-events': 'none',
|