eco-vue-js 0.10.99 → 0.10.100
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 +1 -0
- package/dist/components/Auth/utils/utils.d.ts.map +1 -1
- package/dist/components/Auth/utils/utils.js +11 -2
- package/dist/components/Dropdown/WDropdown.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/WDropdown.vue.js +57 -32
- package/dist/components/Dropdown/types.d.ts +5 -4
- package/dist/components/Dropdown/types.d.ts.map +1 -1
- package/dist/components/Dropdown/utils/DropdownStyle.d.ts +36 -35
- package/dist/components/Dropdown/utils/DropdownStyle.d.ts.map +1 -1
- package/dist/components/Dropdown/utils/DropdownStyle.js +51 -37
- package/dist/components/Modal/WModal.vue.d.ts +3 -1
- package/dist/components/Modal/WModal.vue.d.ts.map +1 -1
- package/dist/components/Modal/WModal.vue.js +16 -15
- package/dist/components/Modal/modals/Confirm/ConfirmModal.vue.d.ts +9 -15
- package/dist/components/Modal/modals/Confirm/ConfirmModal.vue.d.ts.map +1 -1
- package/dist/components/Modal/modals/Confirm/ConfirmModal.vue2.js +27 -15
- package/dist/components/Modal/types.d.ts +6 -5
- package/dist/components/Modal/types.d.ts.map +1 -1
- package/dist/components/Tooltip/WTooltipContainer.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/WTooltipContainer.vue.js +2 -6
- package/dist/components/Tooltip/components/TooltipContainer.vue.d.ts +0 -4
- package/dist/components/Tooltip/components/TooltipContainer.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/components/TooltipContainer.vue.js +3 -66
- package/dist/main.js +1 -0
- package/dist/utils/ApiClient.d.ts +4 -3
- package/dist/utils/ApiClient.d.ts.map +1 -1
- package/dist/utils/ApiClient.js +10 -7
- package/dist/utils/Modal.d.ts +5 -1
- package/dist/utils/Modal.d.ts.map +1 -1
- package/eslint/configs/configTypescript.js +0 -1
- package/package.json +1 -1
- package/tailwind-base/plugins/default.ts +9 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
export declare function checkExpirationDate(): boolean | null;
|
2
|
+
export declare function updateExpirationDate(date: Date): void;
|
2
3
|
export declare function setExpirationDate(): void;
|
3
4
|
export declare function removeExpirationDate(): void;
|
4
5
|
export declare function setRefreshTimestamp(): void;
|
@@ -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":"AAyBA,wBAAgB,mBAAmB,IAAI,OAAO,GAAG,IAAI,CAMpD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,QAI9C;AAED,wBAAgB,iBAAiB,SAMhC;AAED,wBAAgB,oBAAoB,SAGnC;AAID,wBAAgB,mBAAmB,SAQlC;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAwB5D"}
|
@@ -9,13 +9,22 @@ function getCookie(name) {
|
|
9
9
|
}
|
10
10
|
return "";
|
11
11
|
}
|
12
|
+
function setCookie(name, value, expires) {
|
13
|
+
document.cookie = name + "=" + encodeURIComponent(value) + "; Path=/;" + (expires ? " Expires=" + expires.toUTCString() + ";" : "");
|
14
|
+
}
|
12
15
|
function deleteCookie(name) {
|
13
16
|
document.cookie = name + "=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
|
14
17
|
}
|
18
|
+
const EXP_FACTOR = 1e3;
|
15
19
|
function checkExpirationDate() {
|
16
20
|
const exp = Number.parseFloat(getCookie(EXPIRATION_DATE_KEY));
|
17
21
|
if (!exp || !Number.isFinite(exp)) return null;
|
18
|
-
return exp > Date.now() /
|
22
|
+
return exp > Date.now() / EXP_FACTOR;
|
23
|
+
}
|
24
|
+
function updateExpirationDate(date) {
|
25
|
+
const exp = (date.getTime() / EXP_FACTOR).toString();
|
26
|
+
setCookie(EXPIRATION_DATE_KEY, exp, date);
|
27
|
+
localStorage.setItem(EXPIRATION_DATE_KEY, exp);
|
19
28
|
}
|
20
29
|
function setExpirationDate() {
|
21
30
|
const exp = Number.parseFloat(getCookie(EXPIRATION_DATE_KEY));
|
@@ -58,4 +67,4 @@ function getLastRefreshPromise() {
|
|
58
67
|
});
|
59
68
|
}
|
60
69
|
|
61
|
-
export { checkExpirationDate, getLastRefreshPromise, removeExpirationDate, removeRefreshTimestamp, setExpirationDate, setRefreshTimestamp };
|
70
|
+
export { checkExpirationDate, getLastRefreshPromise, removeExpirationDate, removeRefreshTimestamp, setExpirationDate, setRefreshTimestamp, updateExpirationDate };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/WDropdown.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/WDropdown.vue"],"names":[],"mappings":"AAoCA;AAuKA,OAAO,KAAK,EAAC,wBAAwB,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAEpE,OAAO,EAAC,KAAK,KAAK,EAAyF,MAAM,KAAK,CAAA;AAsItH,iBAAS,cAAc;WA8CT,OAAO,IAA6B;;iBA9DvC,CAAC,KAAK,EAAE,wBAAwB,KAAK,KAAK,EAAE;;iBAA5C,CAAC,KAAK,EAAE,wBAAwB,KAAK,KAAK,EAAE;;;;;;EAmEtD;AAmBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;kBAUnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1,8 +1,30 @@
|
|
1
|
-
import { defineComponent, useTemplateRef, ref, computed, onBeforeMount, onMounted, onBeforeUnmount, watch, toRef, createElementBlock, openBlock, normalizeClass, normalizeStyle, unref, renderSlot,
|
1
|
+
import { defineComponent, useTemplateRef, ref, computed, onBeforeMount, onMounted, onBeforeUnmount, watch, toRef, createElementBlock, openBlock, normalizeClass, normalizeStyle, createElementVNode, unref, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
2
|
+
import '../Button/WButtonAction.vue.js';
|
3
|
+
import '../../utils/SemanticType.js';
|
4
|
+
import { isClientSide, getAllScrollParents } from '../../utils/utils.js';
|
5
|
+
import '../ActionsBar/use/useActionsBarFilter.js';
|
6
|
+
import 'vue-router';
|
7
|
+
import '@tanstack/vue-query';
|
8
|
+
import '../Button/WButton.vue.js';
|
9
|
+
import '../../utils/mobile.js';
|
10
|
+
import '../Tooltip/models/tooltipMeta.js';
|
11
|
+
import '../Button/WButtonDropdown.vue.js';
|
2
12
|
import DOMListenerContainer from '../../utils/DOMListenerContainer.js';
|
13
|
+
import { OriginX, OriginY, horizontalGetterOrderMap, searchStyleGetter, LeftCenter, LeftOuter, LeftInner, RightOuter, RightInner } from './utils/DropdownStyle.js';
|
3
14
|
import { HorizontalAlign } from '../../utils/HorizontalAlign.js';
|
4
|
-
import
|
5
|
-
import
|
15
|
+
import '../Chip/WChip.vue.js';
|
16
|
+
import '../DragContainer/use/useDragContainer.js';
|
17
|
+
import '../../utils/Modal.js';
|
18
|
+
import '../Input/WInputSuggest.vue.js';
|
19
|
+
import '../HeaderBar/use/useHeader.js';
|
20
|
+
import '../HeaderBar/use/useHeaderSearch.js';
|
21
|
+
import '../HeaderBar/use/useHeaderSearchVisible.js';
|
22
|
+
import '../InfoCard/models/utils.js';
|
23
|
+
import '../Input/WInputDate.vue.js';
|
24
|
+
import '../Link/WLink.vue.js';
|
25
|
+
import '../List/WList.vue.js';
|
26
|
+
import '../Modal/use/useIsBackdrop.js';
|
27
|
+
import '../Page/use/usePageBreadcrumbs.js';
|
6
28
|
|
7
29
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
8
30
|
__name: "WDropdown",
|
@@ -28,37 +50,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
50
|
const isLeftCenter = ref(false);
|
29
51
|
const isLeft = ref(false);
|
30
52
|
const isRight = ref(false);
|
31
|
-
const
|
32
|
-
const
|
33
|
-
const
|
34
|
-
const
|
53
|
+
const x = ref(0);
|
54
|
+
const y = ref(0);
|
55
|
+
const width = ref(0);
|
56
|
+
const height = ref(0);
|
57
|
+
const originX = ref(OriginX.LEFT);
|
58
|
+
const originY = ref(OriginY.TOP);
|
35
59
|
const order = computed(() => horizontalGetterOrderMap[props.horizontalAlign]);
|
36
|
-
const styles = computed(() => {
|
37
|
-
return {
|
38
|
-
...widthStyle.value,
|
39
|
-
...heightStyle.value,
|
40
|
-
...horizontalStyle.value,
|
41
|
-
...verticalStyle.value
|
42
|
-
};
|
43
|
-
});
|
44
60
|
const setParentRect = (updateSize = false, updateAlign = false) => {
|
45
61
|
const newRect = props.parentElement.getBoundingClientRect();
|
46
62
|
const isLeftChanged = newRect.left !== parentRect?.left;
|
47
63
|
const isTopChanged = newRect.top !== parentRect?.top || newRect.bottom !== parentRect?.bottom;
|
48
64
|
if (!horizontalGetter || isLeftChanged && (props.updateAlign || updateAlign)) {
|
49
65
|
horizontalGetter = searchStyleGetter(order.value, newRect, props.maxWidth);
|
66
|
+
originX.value = horizontalGetter.origin;
|
50
67
|
isLeftCenter.value = horizontalGetter instanceof LeftCenter;
|
51
68
|
isLeft.value = horizontalGetter instanceof LeftOuter || horizontalGetter instanceof LeftInner;
|
52
69
|
isRight.value = horizontalGetter instanceof RightOuter || horizontalGetter instanceof RightInner;
|
53
|
-
if (updateSize)
|
70
|
+
if (updateSize) width.value = horizontalGetter.widthStyleGetter(newRect, props.maxWidth);
|
54
71
|
}
|
55
72
|
if (!verticalGetter || isTopChanged && (props.updateAlign || updateAlign)) {
|
56
73
|
verticalGetter = props.top ? horizontalGetter.verticalGetterOrder[1] : props.bottom ? horizontalGetter.verticalGetterOrder[0] : searchStyleGetter(horizontalGetter.verticalGetterOrder, newRect, props.maxHeight);
|
74
|
+
originY.value = verticalGetter.origin;
|
57
75
|
isTop.value = verticalGetter.isTop;
|
58
|
-
if (updateSize)
|
76
|
+
if (updateSize) height.value = verticalGetter.heightStyleGetter(newRect, props.maxHeight);
|
59
77
|
}
|
60
|
-
if (isLeftChanged)
|
61
|
-
if (isTopChanged)
|
78
|
+
if (isLeftChanged) x.value = horizontalGetter.styleGetter(newRect);
|
79
|
+
if (isTopChanged) y.value = verticalGetter.styleGetter(newRect);
|
62
80
|
if (isLeftChanged || isTopChanged) parentRect = newRect;
|
63
81
|
};
|
64
82
|
onBeforeMount(() => {
|
@@ -98,20 +116,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
98
116
|
return (_ctx, _cache) => {
|
99
117
|
return openBlock(), createElementBlock("div", {
|
100
118
|
ref: "dropdown",
|
101
|
-
style: normalizeStyle(
|
102
|
-
|
103
|
-
"dropdown-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
119
|
+
style: normalizeStyle([{
|
120
|
+
"--dropdown-x": x.value + "px",
|
121
|
+
"--dropdown-y": y.value + "px"
|
122
|
+
}, { "transform": "translate(var(--dropdown-x, 0px), var(--dropdown-y, 0px))" }]),
|
123
|
+
class: normalizeClass(["group/dropdown width-0 height-0 fixed left-0 top-0 grid will-change-transform", [
|
124
|
+
{
|
125
|
+
"dropdown-top": isTop.value
|
126
|
+
},
|
127
|
+
originX.value,
|
128
|
+
originY.value
|
129
|
+
]])
|
108
130
|
}, [
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
131
|
+
createElementVNode("div", {
|
132
|
+
style: normalizeStyle([{
|
133
|
+
"--dropdown-width": width.value !== void 0 ? width.value + "px" : void 0,
|
134
|
+
"--dropdown-height": height.value !== void 0 ? height.value + "px" : void 0,
|
135
|
+
width: props.horizontalAlign === unref(HorizontalAlign).FILL ? "var(--dropdown-width)" : "max-content"
|
136
|
+
}, { "max-width": "var(--dropdown-width)", "max-height": "var(--dropdown-height)" }])
|
137
|
+
}, [
|
138
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ isTop: isTop.value, isLeft: isLeft.value, isRight: isRight.value, x: x.value, y: y.value, originX: originX.value, originY: originY.value })))
|
139
|
+
], 4)
|
115
140
|
], 6);
|
116
141
|
};
|
117
142
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { OriginX, OriginY } from './utils/DropdownStyle';
|
1
2
|
import { HorizontalAlign } from '../../utils/HorizontalAlign';
|
2
3
|
export interface DropdownProps {
|
3
4
|
maxHeight: number;
|
@@ -10,10 +11,10 @@ export interface DropdownProps {
|
|
10
11
|
emitUpdate?: boolean;
|
11
12
|
}
|
12
13
|
export type DropdownDefaultSlotScope = {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
x: number;
|
15
|
+
y: number;
|
16
|
+
originX: OriginX;
|
17
|
+
originY: OriginY;
|
17
18
|
isTop: boolean;
|
18
19
|
isLeft: boolean;
|
19
20
|
isRight: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAE5D,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,eAAe,CAAA;IAChC,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAA;IACrD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,uBAAuB,CAAA;AAC3D,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAE5D,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,eAAe,CAAA;IAChC,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,IAAI,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAA;IACrD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA"}
|
@@ -1,84 +1,85 @@
|
|
1
1
|
import { HorizontalAlign } from '../../../utils/HorizontalAlign';
|
2
2
|
interface StyleGetter {
|
3
|
-
styleGetter(parentRect: DOMRect):
|
3
|
+
styleGetter(parentRect: DOMRect): number;
|
4
4
|
marginGetter(parentRect: DOMRect, maxHeightOrWidth: number): number;
|
5
5
|
}
|
6
|
+
export declare enum OriginY {
|
7
|
+
TOP = "content-start",
|
8
|
+
BOTTOM = "content-end",
|
9
|
+
CENTER = "content-center"
|
10
|
+
}
|
6
11
|
export declare abstract class VerticalGetter implements StyleGetter {
|
7
12
|
abstract isTop: boolean;
|
8
|
-
abstract
|
13
|
+
abstract origin: OriginY;
|
14
|
+
abstract styleGetter(parentRect: DOMRect): number;
|
9
15
|
abstract marginGetter(parentRect: DOMRect, maxHeight: number): number;
|
10
|
-
heightStyleGetter(parentRect: DOMRect, maxHeight: number):
|
16
|
+
heightStyleGetter(parentRect: DOMRect, maxHeight: number): number | undefined;
|
11
17
|
}
|
12
18
|
declare class BottomInner extends VerticalGetter {
|
13
19
|
isTop: boolean;
|
14
|
-
|
15
|
-
|
16
|
-
};
|
20
|
+
origin: OriginY;
|
21
|
+
styleGetter(parentRect: DOMRect): number;
|
17
22
|
marginGetter(parentRect: DOMRect, maxHeight: number): number;
|
18
23
|
}
|
19
24
|
declare class BottomOuter extends VerticalGetter {
|
20
25
|
isTop: boolean;
|
21
|
-
|
22
|
-
|
23
|
-
};
|
26
|
+
origin: OriginY;
|
27
|
+
styleGetter(parentRect: DOMRect): number;
|
24
28
|
marginGetter(parentRect: DOMRect, maxHeight: number): number;
|
25
29
|
}
|
26
30
|
declare class VerticalCenter extends VerticalGetter {
|
27
31
|
isTop: boolean;
|
28
|
-
|
29
|
-
|
30
|
-
};
|
32
|
+
origin: OriginY;
|
33
|
+
styleGetter(parentRect: DOMRect): number;
|
31
34
|
marginGetter(): number;
|
32
|
-
heightStyleGetter():
|
33
|
-
height: string;
|
34
|
-
};
|
35
|
+
heightStyleGetter(): undefined;
|
35
36
|
}
|
36
37
|
declare class TopOuter extends VerticalGetter {
|
37
38
|
isTop: boolean;
|
38
|
-
|
39
|
-
|
40
|
-
};
|
39
|
+
origin: OriginY;
|
40
|
+
styleGetter(parentRect: DOMRect): number;
|
41
41
|
marginGetter(parentRect: DOMRect, maxHeight: number): number;
|
42
42
|
}
|
43
43
|
declare class TopInner extends VerticalGetter {
|
44
44
|
isTop: boolean;
|
45
|
-
|
46
|
-
|
47
|
-
};
|
45
|
+
origin: OriginY;
|
46
|
+
styleGetter(parentRect: DOMRect): number;
|
48
47
|
marginGetter(parentRect: DOMRect, maxHeight: number): number;
|
49
48
|
}
|
49
|
+
export declare enum OriginX {
|
50
|
+
LEFT = "justify-start",
|
51
|
+
RIGHT = "justify-end",
|
52
|
+
CENTER = "justify-center"
|
53
|
+
}
|
50
54
|
export declare abstract class HorizontalGetter implements StyleGetter {
|
55
|
+
abstract origin: OriginX;
|
51
56
|
abstract verticalGetterOrder: Array<VerticalGetter>;
|
52
|
-
abstract styleGetter(parentRect: DOMRect):
|
57
|
+
abstract styleGetter(parentRect: DOMRect): number;
|
53
58
|
abstract marginGetter(parentRect: DOMRect, maxWidth: number): number;
|
54
|
-
widthStyleGetter(parentRect: DOMRect, maxWidth: number):
|
59
|
+
widthStyleGetter(parentRect: DOMRect, maxWidth: number): number | undefined;
|
55
60
|
}
|
56
61
|
export declare class RightOuter extends HorizontalGetter {
|
57
62
|
verticalGetterOrder: (BottomInner | TopInner)[];
|
58
|
-
|
59
|
-
|
60
|
-
};
|
63
|
+
origin: OriginX;
|
64
|
+
styleGetter(parentRect: DOMRect): number;
|
61
65
|
marginGetter(parentRect: DOMRect, maxWidth: number): number;
|
62
66
|
}
|
63
67
|
export declare class RightInner extends HorizontalGetter {
|
64
68
|
verticalGetterOrder: (BottomOuter | TopOuter)[];
|
65
|
-
|
66
|
-
|
67
|
-
};
|
69
|
+
origin: OriginX;
|
70
|
+
styleGetter(parentRect: DOMRect): number;
|
68
71
|
marginGetter(parentRect: DOMRect, maxWidth: number): number;
|
69
72
|
}
|
70
73
|
export declare class LeftInner extends HorizontalGetter {
|
71
74
|
verticalGetterOrder: (BottomOuter | TopOuter)[];
|
72
|
-
|
73
|
-
|
74
|
-
};
|
75
|
+
origin: OriginX;
|
76
|
+
styleGetter(parentRect: DOMRect): number;
|
75
77
|
marginGetter(parentRect: DOMRect, maxWidth: number): number;
|
76
78
|
}
|
77
79
|
export declare class LeftOuter extends HorizontalGetter {
|
78
80
|
verticalGetterOrder: (BottomInner | TopInner)[];
|
79
|
-
|
80
|
-
|
81
|
-
};
|
81
|
+
origin: OriginX;
|
82
|
+
styleGetter(parentRect: DOMRect): number;
|
82
83
|
marginGetter(parentRect: DOMRect, maxWidth: number): number;
|
83
84
|
}
|
84
85
|
export declare class LeftCenter extends LeftOuter {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownStyle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/utils/DropdownStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAIvD,UAAU,WAAW;IACnB,WAAW,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,
|
1
|
+
{"version":3,"file":"DropdownStyle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/utils/DropdownStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAIvD,UAAU,WAAW;IACnB,WAAW,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IACxC,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAA;CACpE;AAED,oBAAY,OAAO;IACjB,GAAG,kBAAkB;IACrB,MAAM,gBAAgB;IACtB,MAAM,mBAAmB;CAC1B;AAED,8BAAsB,cAAe,YAAW,WAAW;IACzD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IAExB,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM;IAEjD,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAErE,iBAAiB,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;C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riginY = /* @__PURE__ */ ((OriginY2) => {
|
5
|
+
OriginY2["TOP"] = "content-start";
|
6
|
+
OriginY2["BOTTOM"] = "content-end";
|
7
|
+
OriginY2["CENTER"] = "content-center";
|
8
|
+
return OriginY2;
|
9
|
+
})(OriginY || {});
|
4
10
|
class VerticalGetter {
|
5
11
|
heightStyleGetter(parentRect, maxHeight) {
|
6
|
-
return
|
12
|
+
return _maxHeightOrWidthGetter(this, parentRect, maxHeight);
|
7
13
|
}
|
8
14
|
}
|
9
15
|
class BottomInner extends VerticalGetter {
|
10
16
|
isTop = false;
|
17
|
+
origin = "content-start" /* TOP */;
|
11
18
|
styleGetter(parentRect) {
|
12
|
-
return
|
19
|
+
return Math.round(parentRect.top);
|
13
20
|
}
|
14
21
|
marginGetter(parentRect, maxHeight) {
|
15
|
-
return window.innerHeight - parentRect.top - maxHeight - EDGE;
|
22
|
+
return Math.round(window.innerHeight - parentRect.top - maxHeight - EDGE);
|
16
23
|
}
|
17
24
|
}
|
18
25
|
class BottomOuter extends VerticalGetter {
|
19
26
|
isTop = false;
|
27
|
+
origin = "content-start" /* TOP */;
|
20
28
|
styleGetter(parentRect) {
|
21
|
-
return
|
29
|
+
return Math.round(parentRect.bottom);
|
22
30
|
}
|
23
31
|
marginGetter(parentRect, maxHeight) {
|
24
|
-
return window.innerHeight - parentRect.bottom - maxHeight - EDGE;
|
32
|
+
return Math.round(window.innerHeight - parentRect.bottom - maxHeight - EDGE);
|
25
33
|
}
|
26
34
|
}
|
27
35
|
class VerticalCenter extends VerticalGetter {
|
28
36
|
isTop = false;
|
37
|
+
origin = "content-center" /* CENTER */;
|
29
38
|
styleGetter(parentRect) {
|
30
|
-
return
|
39
|
+
return Math.round(parentRect.top + parentRect.height / 2);
|
31
40
|
}
|
32
41
|
marginGetter() {
|
33
42
|
return 0;
|
34
43
|
}
|
35
44
|
heightStyleGetter() {
|
36
|
-
return
|
37
|
-
height: "0px"
|
38
|
-
};
|
45
|
+
return void 0;
|
39
46
|
}
|
40
47
|
}
|
41
48
|
class TopOuter extends VerticalGetter {
|
42
49
|
isTop = true;
|
50
|
+
origin = "content-end" /* BOTTOM */;
|
43
51
|
styleGetter(parentRect) {
|
44
|
-
return
|
52
|
+
return Math.round(parentRect.top);
|
45
53
|
}
|
46
54
|
marginGetter(parentRect, maxHeight) {
|
47
|
-
return parentRect.top - maxHeight - EDGE;
|
55
|
+
return Math.round(parentRect.top - maxHeight - EDGE);
|
48
56
|
}
|
49
57
|
}
|
50
58
|
class TopInner extends VerticalGetter {
|
51
59
|
isTop = true;
|
60
|
+
origin = "content-end" /* BOTTOM */;
|
52
61
|
styleGetter(parentRect) {
|
53
|
-
return
|
62
|
+
return Math.round(parentRect.bottom);
|
54
63
|
}
|
55
64
|
marginGetter(parentRect, maxHeight) {
|
56
|
-
return parentRect.bottom - maxHeight - EDGE;
|
65
|
+
return Math.round(parentRect.bottom - maxHeight - EDGE);
|
57
66
|
}
|
58
67
|
}
|
68
|
+
var OriginX = /* @__PURE__ */ ((OriginX2) => {
|
69
|
+
OriginX2["LEFT"] = "justify-start";
|
70
|
+
OriginX2["RIGHT"] = "justify-end";
|
71
|
+
OriginX2["CENTER"] = "justify-center";
|
72
|
+
return OriginX2;
|
73
|
+
})(OriginX || {});
|
59
74
|
class HorizontalGetter {
|
60
75
|
widthStyleGetter(parentRect, maxWidth) {
|
61
|
-
return
|
76
|
+
return _maxHeightOrWidthGetter(this, parentRect, maxWidth);
|
62
77
|
}
|
63
78
|
}
|
64
79
|
class RightOuter extends HorizontalGetter {
|
65
80
|
verticalGetterOrder = [new BottomInner(), new TopInner()];
|
81
|
+
origin = "justify-start" /* LEFT */;
|
66
82
|
styleGetter(parentRect) {
|
67
|
-
return
|
83
|
+
return Math.round(parentRect.right);
|
68
84
|
}
|
69
85
|
marginGetter(parentRect, maxWidth) {
|
70
|
-
return document.documentElement.clientWidth - parentRect.right - maxWidth - EDGE;
|
86
|
+
return Math.round(document.documentElement.clientWidth - parentRect.right - maxWidth - EDGE);
|
71
87
|
}
|
72
88
|
}
|
73
89
|
class RightInner extends HorizontalGetter {
|
74
90
|
verticalGetterOrder = [new BottomOuter(), new TopOuter()];
|
91
|
+
origin = "justify-start" /* LEFT */;
|
75
92
|
styleGetter(parentRect) {
|
76
|
-
return
|
93
|
+
return Math.round(parentRect.left);
|
77
94
|
}
|
78
95
|
marginGetter(parentRect, maxWidth) {
|
79
|
-
return document.documentElement.clientWidth - parentRect.left - maxWidth - EDGE;
|
96
|
+
return Math.round(document.documentElement.clientWidth - parentRect.left - maxWidth - EDGE);
|
80
97
|
}
|
81
98
|
}
|
82
99
|
class RightCenter extends RightOuter {
|
@@ -84,51 +101,48 @@ class RightCenter extends RightOuter {
|
|
84
101
|
}
|
85
102
|
class Fill extends HorizontalGetter {
|
86
103
|
verticalGetterOrder = [new BottomOuter(), new TopOuter()];
|
104
|
+
origin = "justify-start" /* LEFT */;
|
87
105
|
styleGetter(parentRect) {
|
88
|
-
return
|
89
|
-
left: parentRect.left + "px",
|
90
|
-
right: document.documentElement.clientWidth - parentRect.right + "px"
|
91
|
-
};
|
106
|
+
return Math.round(parentRect.left);
|
92
107
|
}
|
93
108
|
marginGetter() {
|
94
109
|
return 0;
|
95
110
|
}
|
96
|
-
widthStyleGetter() {
|
97
|
-
return
|
111
|
+
widthStyleGetter(parentRect) {
|
112
|
+
return Math.round(parentRect.right - parentRect.left);
|
98
113
|
}
|
99
114
|
}
|
100
115
|
class Center extends HorizontalGetter {
|
101
116
|
verticalGetterOrder = [new BottomOuter(), new TopOuter()];
|
117
|
+
origin = "justify-center" /* CENTER */;
|
102
118
|
styleGetter(parentRect) {
|
103
|
-
return
|
104
|
-
left: parentRect.left + parentRect.width / 2 + "px"
|
105
|
-
};
|
119
|
+
return Math.round(parentRect.left + parentRect.width / 2);
|
106
120
|
}
|
107
121
|
marginGetter() {
|
108
122
|
return 0;
|
109
123
|
}
|
110
124
|
widthStyleGetter() {
|
111
|
-
return
|
112
|
-
width: "0px"
|
113
|
-
};
|
125
|
+
return void 0;
|
114
126
|
}
|
115
127
|
}
|
116
128
|
class LeftInner extends HorizontalGetter {
|
117
129
|
verticalGetterOrder = [new BottomOuter(), new TopOuter()];
|
130
|
+
origin = "justify-end" /* RIGHT */;
|
118
131
|
styleGetter(parentRect) {
|
119
|
-
return
|
132
|
+
return Math.round(parentRect.right);
|
120
133
|
}
|
121
134
|
marginGetter(parentRect, maxWidth) {
|
122
|
-
return parentRect.right - maxWidth - EDGE;
|
135
|
+
return Math.round(parentRect.right - maxWidth - EDGE);
|
123
136
|
}
|
124
137
|
}
|
125
138
|
class LeftOuter extends HorizontalGetter {
|
126
139
|
verticalGetterOrder = [new BottomInner(), new TopInner()];
|
140
|
+
origin = "justify-end" /* RIGHT */;
|
127
141
|
styleGetter(parentRect) {
|
128
|
-
return
|
142
|
+
return Math.round(parentRect.left);
|
129
143
|
}
|
130
144
|
marginGetter(parentRect, maxWidth) {
|
131
|
-
return parentRect.left - maxWidth - EDGE;
|
145
|
+
return Math.round(parentRect.left - maxWidth - EDGE);
|
132
146
|
}
|
133
147
|
}
|
134
148
|
class LeftCenter extends LeftOuter {
|
@@ -154,8 +168,8 @@ function searchStyleGetter(order, parentRect, maxHeightOrWidth) {
|
|
154
168
|
}
|
155
169
|
function _maxHeightOrWidthGetter(getter, parentRect, maxHeightOrWidth) {
|
156
170
|
const margin = getter.marginGetter(parentRect, maxHeightOrWidth);
|
157
|
-
if (margin > 0) return maxHeightOrWidth;
|
158
|
-
else return maxHeightOrWidth + margin;
|
171
|
+
if (margin > 0) return Math.round(maxHeightOrWidth);
|
172
|
+
else return Math.round(maxHeightOrWidth + margin);
|
159
173
|
}
|
160
174
|
|
161
|
-
export { HorizontalGetter, LeftCenter, LeftInner, LeftOuter, RightInner, RightOuter, VerticalGetter, horizontalGetterOrderMap, searchStyleGetter };
|
175
|
+
export { HorizontalGetter, LeftCenter, LeftInner, LeftOuter, OriginX, OriginY, RightInner, RightOuter, VerticalGetter, horizontalGetterOrderMap, searchStyleGetter };
|
@@ -1,3 +1,5 @@
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
2
|
+
modalComponent: unknown;
|
3
|
+
}, HTMLDivElement>;
|
2
4
|
export default _default;
|
3
5
|
//# sourceMappingURL=WModal.vue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Modal/WModal.vue"],"names":[],"mappings":"AAyCA
|
1
|
+
{"version":3,"file":"WModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Modal/WModal.vue"],"names":[],"mappings":"AAyCA;;;;AAsYA,wBAOG"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, provide, ref, reactive, watch, onBeforeMount, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, unref, createVNode, Transition, withCtx, createCommentVNode, TransitionGroup, Fragment, renderList, createElementVNode, createBlock, withModifiers, resolveDynamicComponent, mergeProps } from 'vue';
|
1
|
+
import { defineComponent, provide, ref, useTemplateRef, reactive, watch, onBeforeMount, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, unref, createVNode, Transition, withCtx, createCommentVNode, TransitionGroup, Fragment, renderList, createElementVNode, createBlock, withModifiers, resolveDynamicComponent, mergeProps } from 'vue';
|
2
2
|
import { Modal, initModal } from '../../utils/Modal.js';
|
3
3
|
import { SemanticType } from '../../utils/SemanticType.js';
|
4
4
|
import { wBaseZIndex, BASE_ZINDEX_MODAL } from '../../utils/utils.js';
|
@@ -11,14 +11,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
11
|
setup(__props) {
|
12
12
|
provide(wBaseZIndex, BASE_ZINDEX_MODAL);
|
13
13
|
provide(wIsModal, true);
|
14
|
-
|
14
|
+
let key = 0;
|
15
15
|
const modalMetaList = ref([]);
|
16
16
|
const isBackdrop = useIsBackdrop();
|
17
|
+
const modalComponentRef = useTemplateRef("modalComponent");
|
17
18
|
const hasChangesMap = reactive({});
|
18
19
|
const addModal = (component, props, cb, autoclose = false) => {
|
19
20
|
const modalMeta = {
|
20
21
|
component,
|
21
|
-
key: key
|
22
|
+
key: `w-modal-${key++}`,
|
22
23
|
props,
|
23
24
|
cb,
|
24
25
|
autoclose
|
@@ -33,14 +34,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
33
34
|
modalMetaListNew.splice(index, 1);
|
34
35
|
modalMetaList.value = modalMetaListNew;
|
35
36
|
delete hasChangesMap[modalMeta.key];
|
36
|
-
if (
|
37
|
-
key.value = 0;
|
38
|
-
}
|
37
|
+
if (modalMetaListNew.length === 0) key = 0;
|
39
38
|
modalMeta.cb?.();
|
40
39
|
};
|
41
40
|
let closeConfirm = null;
|
42
|
-
const closeModalWithConfirm = (modalMeta) => {
|
43
|
-
if (modalMeta.autoclose || !hasChangesMap[modalMeta.key]) {
|
41
|
+
const closeModalWithConfirm = (modalMeta, index) => {
|
42
|
+
if (modalMeta.autoclose || !hasChangesMap[modalMeta.key] && !modalComponentRef.value?.[index]?.formRef?.hasChanges) {
|
44
43
|
closeModal(modalMeta);
|
45
44
|
return;
|
46
45
|
}
|
@@ -86,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
86
85
|
default: withCtx(() => [
|
87
86
|
unref(isBackdrop) ? (openBlock(), createElementBlock("div", {
|
88
87
|
key: 0,
|
89
|
-
style: normalizeStyle({ zIndex:
|
88
|
+
style: normalizeStyle({ zIndex: 99 + modalMetaList.value.length + modalMetaList.value.length }),
|
90
89
|
class: "bg-primary-light dark:bg-primary-darkest fixed left-0 top-0 size-full bg-opacity-40 backdrop-blur dark:bg-opacity-40"
|
91
90
|
}, null, 4)) : createCommentVNode("", true)
|
92
91
|
]),
|
@@ -102,17 +101,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
102
101
|
(openBlock(true), createElementBlock(Fragment, null, renderList(modalMetaList.value, (modalMeta, index) => {
|
103
102
|
return openBlock(), createElementBlock("div", {
|
104
103
|
key: modalMeta.key,
|
105
|
-
style: normalizeStyle({ zIndex:
|
104
|
+
style: normalizeStyle({ zIndex: 102 + index }),
|
106
105
|
class: "no-scrollbar fixed inset-0 isolate flex items-center justify-center overflow-y-auto overscroll-none"
|
107
106
|
}, [
|
108
107
|
_cache[0] || (_cache[0] = createElementVNode("div", { class: "h-[calc(100%+1px)]" }, null, -1)),
|
109
108
|
createVNode(_sfc_main$1, {
|
110
|
-
onClick: withModifiers(($event) => closeModalWithConfirm(modalMeta), ["stop", "prevent"])
|
109
|
+
onClick: withModifiers(($event) => closeModalWithConfirm(modalMeta, index), ["stop", "prevent"])
|
111
110
|
}, null, 8, ["onClick"]),
|
112
|
-
(openBlock(), createBlock(resolveDynamicComponent(modalMeta.component), mergeProps({
|
113
|
-
|
114
|
-
|
115
|
-
}
|
111
|
+
(openBlock(), createBlock(resolveDynamicComponent(modalMeta.component), mergeProps({
|
112
|
+
ref_for: true,
|
113
|
+
ref: "modalComponent"
|
114
|
+
}, modalMeta.props, {
|
115
|
+
"onClose:modal": ($event) => closeModal(modalMeta)
|
116
|
+
}), null, 16, ["onClose:modal"]))
|
116
117
|
], 4);
|
117
118
|
}), 128))
|
118
119
|
]),
|
@@ -1,20 +1,14 @@
|
|
1
|
+
import { ConfirmModalProps } from '../../types';
|
1
2
|
import { SemanticType } from '../../../../utils/SemanticType';
|
2
|
-
|
3
|
-
title: string;
|
4
|
-
description: string;
|
5
|
-
acceptText?: string;
|
6
|
-
acceptSemanticType?: SemanticType;
|
7
|
-
intermediateText?: string;
|
8
|
-
intermediateSemanticType?: SemanticType;
|
9
|
-
cancelText?: string;
|
10
|
-
onAccept: () => void | Promise<void>;
|
11
|
-
onIntermediate?: () => void | Promise<void>;
|
12
|
-
onCancel?: () => void;
|
13
|
-
};
|
14
|
-
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
3
|
+
declare const _default: import('vue').DefineComponent<ConfirmModalProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
15
4
|
"close:modal": () => any;
|
16
|
-
}, string, import('vue').PublicProps, Readonly<
|
5
|
+
}, string, import('vue').PublicProps, Readonly<ConfirmModalProps> & Readonly<{
|
17
6
|
"onClose:modal"?: (() => any) | undefined;
|
18
|
-
}>, {
|
7
|
+
}>, {
|
8
|
+
acceptText: string | import('vue').VNode | import('vue').Component;
|
9
|
+
acceptSemanticType: SemanticType;
|
10
|
+
intermediateSemanticType: SemanticType;
|
11
|
+
cancelText: string | import('vue').VNode | import('vue').Component;
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
19
13
|
export default _default;
|
20
14
|
//# sourceMappingURL=ConfirmModal.vue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ConfirmModal.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Modal/modals/Confirm/ConfirmModal.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ConfirmModal.vue.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Modal/modals/Confirm/ConfirmModal.vue"],"names":[],"mappings":"AA8EA;AA0JA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAA;AAOlD,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAA;;;;;;;;;;;AA4QjD,wBASG"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, ref, createBlock, openBlock, withCtx, createElementVNode, toDisplayString, createVNode, createCommentVNode, withModifiers, unref
|
1
|
+
import { defineComponent, ref, createBlock, openBlock, withCtx, createElementVNode, createElementBlock, Fragment, createTextVNode, toDisplayString, resolveDynamicComponent, createVNode, createCommentVNode, withModifiers, unref } from 'vue';
|
2
2
|
import _sfc_main$2 from '../../../Button/WButton.vue.js';
|
3
3
|
import _sfc_main$1 from '../../WModalWrapper.vue.js';
|
4
4
|
import { SemanticType } from '../../../../utils/SemanticType.js';
|
@@ -9,14 +9,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
9
|
props: {
|
10
10
|
title: {},
|
11
11
|
description: {},
|
12
|
-
acceptText: {},
|
13
|
-
acceptSemanticType: {},
|
12
|
+
acceptText: { default: "Accept" },
|
13
|
+
acceptSemanticType: { default: SemanticType.PRIMARY },
|
14
14
|
intermediateText: {},
|
15
|
-
intermediateSemanticType: {},
|
16
|
-
cancelText: {},
|
17
|
-
onAccept: {
|
18
|
-
onIntermediate: {
|
19
|
-
onCancel: {
|
15
|
+
intermediateSemanticType: { default: SemanticType.SECONDARY },
|
16
|
+
cancelText: { default: "Cancel" },
|
17
|
+
onAccept: {},
|
18
|
+
onIntermediate: {},
|
19
|
+
onCancel: {}
|
20
20
|
},
|
21
21
|
emits: ["close:modal"],
|
22
22
|
setup(__props, { emit: __emit }) {
|
@@ -59,7 +59,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
59
59
|
return (_ctx, _cache) => {
|
60
60
|
return openBlock(), createBlock(_sfc_main$1, { class: "w-modal-wrapper-w-[--w-modal-confirm-width,40rem]" }, {
|
61
61
|
title: withCtx(() => [
|
62
|
-
|
62
|
+
typeof _ctx.title === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
63
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
64
|
+
], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.title), { key: 1 }))
|
63
65
|
]),
|
64
66
|
actions: withCtx(() => [
|
65
67
|
createVNode(_sfc_main$2, {
|
@@ -69,38 +71,48 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
69
71
|
onClick: withModifiers(cancel, ["stop", "prevent"])
|
70
72
|
}, {
|
71
73
|
default: withCtx(() => [
|
72
|
-
|
74
|
+
typeof _ctx.cancelText === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
75
|
+
createTextVNode(toDisplayString(_ctx.cancelText), 1)
|
76
|
+
], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.cancelText), { key: 1 }))
|
73
77
|
]),
|
74
78
|
_: 1
|
75
79
|
}, 8, ["semantic-type", "disabled"]),
|
76
80
|
_ctx.intermediateText ? (openBlock(), createBlock(_sfc_main$2, {
|
77
81
|
key: 0,
|
78
|
-
"semantic-type": _ctx.intermediateSemanticType
|
82
|
+
"semantic-type": _ctx.intermediateSemanticType,
|
79
83
|
loading: loadingIntermediate.value,
|
80
84
|
disabled: loadingAccept.value,
|
81
85
|
class: "w-full",
|
82
86
|
onClick: withModifiers(intermediate, ["stop", "prevent"])
|
83
87
|
}, {
|
84
88
|
default: withCtx(() => [
|
85
|
-
|
89
|
+
typeof _ctx.intermediateText === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
90
|
+
createTextVNode(toDisplayString(_ctx.intermediateText), 1)
|
91
|
+
], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.intermediateText), { key: 1 }))
|
86
92
|
]),
|
87
93
|
_: 1
|
88
94
|
}, 8, ["semantic-type", "loading", "disabled"])) : createCommentVNode("", true),
|
89
95
|
createVNode(_sfc_main$2, {
|
90
|
-
"semantic-type": _ctx.acceptSemanticType
|
96
|
+
"semantic-type": _ctx.acceptSemanticType,
|
91
97
|
loading: loadingAccept.value,
|
92
98
|
disabled: loadingIntermediate.value,
|
93
99
|
class: "w-full",
|
94
100
|
onClick: withModifiers(accept, ["stop", "prevent"])
|
95
101
|
}, {
|
96
102
|
default: withCtx(() => [
|
97
|
-
|
103
|
+
typeof _ctx.acceptText === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
104
|
+
createTextVNode(toDisplayString(_ctx.acceptText), 1)
|
105
|
+
], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.acceptText), { key: 1 }))
|
98
106
|
]),
|
99
107
|
_: 1
|
100
108
|
}, 8, ["semantic-type", "loading", "disabled"])
|
101
109
|
]),
|
102
110
|
default: withCtx(() => [
|
103
|
-
createElementVNode("div", _hoisted_1,
|
111
|
+
createElementVNode("div", _hoisted_1, [
|
112
|
+
typeof _ctx.description === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
113
|
+
createTextVNode(toDisplayString(_ctx.description), 1)
|
114
|
+
], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.description), { key: 1 }))
|
115
|
+
])
|
104
116
|
]),
|
105
117
|
_: 1
|
106
118
|
});
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { SemanticType } from '../../utils/SemanticType';
|
2
|
+
import { Component, VNode } from 'vue';
|
2
3
|
export interface ConfirmModalProps {
|
3
|
-
title: string;
|
4
|
-
description: string;
|
5
|
-
acceptText?: string;
|
4
|
+
title: string | VNode | Component;
|
5
|
+
description: string | VNode | Component;
|
6
|
+
acceptText?: string | VNode | Component;
|
6
7
|
acceptSemanticType?: SemanticType;
|
7
|
-
intermediateText?: string;
|
8
|
+
intermediateText?: string | VNode | Component;
|
8
9
|
intermediateSemanticType?: SemanticType;
|
9
|
-
cancelText?: string;
|
10
|
+
cancelText?: string | VNode | Component;
|
10
11
|
onAccept: () => void | Promise<void>;
|
11
12
|
onIntermediate?: () => void | Promise<void>;
|
12
13
|
onCancel?: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAA;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,KAAK,CAAA;AAEzC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IACjC,WAAW,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IAEvC,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IACvC,kBAAkB,CAAC,EAAE,YAAY,CAAA;IAEjC,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IAC7C,wBAAwB,CAAC,EAAE,YAAY,CAAA;IAEvC,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAAA;IAEvC,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,cAAc,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WTooltipContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/WTooltipContainer.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WTooltipContainer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/WTooltipContainer.vue"],"names":[],"mappings":"AAgDA;AAmFA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA2L6zf,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;AAT1+f,wBAOG"}
|
@@ -44,13 +44,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
44
44
|
class: "isolate z-[10000]",
|
45
45
|
"onUpdate:rect": unref(close)
|
46
46
|
}, {
|
47
|
-
default: withCtx(({
|
47
|
+
default: withCtx(({ isTop }) => [
|
48
48
|
createVNode(_sfc_main$2, {
|
49
49
|
"tooltip-meta": unref(tooltipMeta),
|
50
|
-
left,
|
51
|
-
right,
|
52
|
-
top,
|
53
|
-
bottom,
|
54
50
|
"is-top": isTop,
|
55
51
|
"is-left": unref(tooltipMeta).left,
|
56
52
|
"is-right": unref(tooltipMeta).right,
|
@@ -63,7 +59,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
63
59
|
})) : unref(tooltipMeta).text ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(unref(tooltipMeta).text), 1)) : createCommentVNode("", true)
|
64
60
|
]),
|
65
61
|
_: 2
|
66
|
-
}, 1032, ["tooltip-meta", "
|
62
|
+
}, 1032, ["tooltip-meta", "is-top", "is-left", "is-right"])
|
67
63
|
]),
|
68
64
|
_: 1
|
69
65
|
}, 8, ["parent-element", "horizontal-align", "max-height", "max-width", "top", "bottom", "onUpdate:rect"])) : createCommentVNode("", true)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TooltipContainer.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/components/TooltipContainer.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"TooltipContainer.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/components/TooltipContainer.vue"],"names":[],"mappings":"AA4DA;AAAA,OA6EO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AAEtD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;AAWF,iBAAS,cAAc;WA8ET,OAAO,IAA6B;;yBAXrB,GAAG;;;;;;EAgB/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;kBASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1,76 +1,17 @@
|
|
1
|
-
import { defineComponent,
|
2
|
-
import { isClientSide } from '../../../utils/utils.js';
|
1
|
+
import { defineComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot } from 'vue';
|
3
2
|
|
4
3
|
const _hoisted_1 = ["viewBox"];
|
5
4
|
const _hoisted_2 = ["transform"];
|
6
|
-
const MARGIN = 12;
|
7
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
8
6
|
__name: "TooltipContainer",
|
9
7
|
props: {
|
10
8
|
tooltipMeta: {},
|
11
9
|
isTop: { type: Boolean },
|
12
|
-
left: {},
|
13
|
-
right: {},
|
14
|
-
top: {},
|
15
|
-
bottom: {},
|
16
10
|
isLeft: { type: Boolean },
|
17
11
|
isRight: { type: Boolean }
|
18
12
|
},
|
19
13
|
emits: ["over", "leave"],
|
20
14
|
setup(__props) {
|
21
|
-
const props = __props;
|
22
|
-
const containerRef = useTemplateRef("container");
|
23
|
-
const transformX = ref(0);
|
24
|
-
const transformY = ref(0);
|
25
|
-
const getTransformX = () => {
|
26
|
-
if (!isClientSide || !containerRef.value) return 0;
|
27
|
-
if (props.isLeft || props.isRight) return 0;
|
28
|
-
const l = props.left ? Number.parseFloat(props.left.slice(0, -2)) : null;
|
29
|
-
if (typeof l === "number") {
|
30
|
-
const containerLeft = l - containerRef.value.offsetWidth / 2 - MARGIN;
|
31
|
-
if (containerLeft < 0) return containerLeft * -1;
|
32
|
-
const containerRight = window.innerWidth - l - containerRef.value.offsetWidth / 2 - MARGIN;
|
33
|
-
if (containerRight < 0) return containerRight;
|
34
|
-
return 0;
|
35
|
-
}
|
36
|
-
const r = props.right ? Number.parseFloat(props.right.slice(0, -2)) : null;
|
37
|
-
if (typeof r === "number") {
|
38
|
-
const containerLeft = window.innerWidth - r - containerRef.value.offsetWidth / 2 - MARGIN;
|
39
|
-
if (containerLeft < 0) return containerLeft * -1;
|
40
|
-
const containerRight = r - containerRef.value.offsetWidth / 2 - MARGIN;
|
41
|
-
if (containerRight < 0) return containerRight;
|
42
|
-
return 0;
|
43
|
-
}
|
44
|
-
return 0;
|
45
|
-
};
|
46
|
-
const getTransformY = () => {
|
47
|
-
if (!isClientSide || !containerRef.value) return 0;
|
48
|
-
if (!props.isLeft && !props.isRight) return 0;
|
49
|
-
const t = props.top ? Number.parseFloat(props.top.slice(0, -2)) : null;
|
50
|
-
if (typeof t === "number") {
|
51
|
-
const containerTop = t - containerRef.value.offsetHeight / 2 - MARGIN;
|
52
|
-
if (containerTop < 0) return containerTop * -1;
|
53
|
-
const containerBottom = window.innerHeight - t - containerRef.value.offsetHeight / 2 - MARGIN;
|
54
|
-
if (containerBottom < 0) return containerBottom;
|
55
|
-
return 0;
|
56
|
-
}
|
57
|
-
const b = props.bottom ? Number.parseFloat(props.bottom.slice(0, -2)) : null;
|
58
|
-
if (typeof b === "number") {
|
59
|
-
const containerTop = window.innerHeight - b - containerRef.value.offsetHeight / 2 - MARGIN;
|
60
|
-
if (containerTop < 0) return containerTop * -1;
|
61
|
-
const containerBottom = b - containerRef.value.offsetHeight / 2 - MARGIN;
|
62
|
-
if (containerBottom < 0) return containerBottom;
|
63
|
-
return 0;
|
64
|
-
}
|
65
|
-
return 0;
|
66
|
-
};
|
67
|
-
const setTransform = async () => {
|
68
|
-
await nextTick();
|
69
|
-
transformX.value = getTransformX();
|
70
|
-
transformY.value = getTransformY();
|
71
|
-
};
|
72
|
-
watch(toRef(props, "tooltipMeta"), setTransform);
|
73
|
-
onMounted(setTransform);
|
74
15
|
return (_ctx, _cache) => {
|
75
16
|
return openBlock(), createElementBlock("div", {
|
76
17
|
class: normalizeClass(["pointer-events-none flex items-center", {
|
@@ -114,16 +55,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
114
55
|
], 42, _hoisted_1)),
|
115
56
|
createElementVNode("div", {
|
116
57
|
ref: "container",
|
117
|
-
class: "bg-black-default text-default pointer-events-auto max-w-[calc(100vw-1.5rem)]
|
118
|
-
style: normalizeStyle({
|
119
|
-
"--t-translate-x": transformX.value + "px",
|
120
|
-
"--t-translate-y": transformY.value + "px"
|
121
|
-
}),
|
58
|
+
class: normalizeClass(["bg-black-default text-default pointer-events-auto max-w-[calc(100vw-1.5rem)] rounded-lg border border-solid border-gray-400 px-3 py-2 text-center text-xs font-medium shadow-md will-change-transform dark:border-gray-600 dark:bg-gray-800", _ctx.isLeft || _ctx.isRight ? void 0 : "w-tooltip-center-x"]),
|
122
59
|
onMouseover: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("over")),
|
123
60
|
onMouseleave: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("leave"))
|
124
61
|
}, [
|
125
62
|
renderSlot(_ctx.$slots, "default")
|
126
|
-
],
|
63
|
+
], 34)
|
127
64
|
], 2);
|
128
65
|
};
|
129
66
|
}
|
package/dist/main.js
CHANGED
@@ -124,3 +124,4 @@ export { paginatedResponseUpdater, useQueryUpdater } from './utils/useQueryUpdat
|
|
124
124
|
export { useCopy } from './utils/useCopy.js';
|
125
125
|
export { BASE_ZINDEX_ACTIONS_BAR, BASE_ZINDEX_BOTTOM_SHEET, BASE_ZINDEX_DROPDOWN, BASE_ZINDEX_HEADER_BAR, BASE_ZINDEX_LIST_HEADER, BASE_ZINDEX_MODAL, BASE_ZINDEX_NAV_BAR, ListMode, Theme, debounce, genId, get, getAllScrollParents, getDefaultFieldConfigMap, getHasScrollbar, getScrollParent, hasParent, isClientSide, isEqualArr, isEqualObj, isId, isIdArray, isIndex, isPage, numberCompactFormatter, numberFormatter, parseBoolean, parseId, parseIdList, parseIndex, parseInteger, parseIntegerList, parseJson, parseSliceIndexes, parseString, parseStringList, percentCompactFormatter, percentFormatter, set, throttle, unwrapSlots, wBaseZIndex } from './utils/utils.js';
|
126
126
|
export { validateForbiddenRegexp, validateRequired, validateRequiredSymbols } from './utils/validate.js';
|
127
|
+
export { updateExpirationDate } from './components/Auth/utils/utils.js';
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { LocationQuery } from 'vue-router';
|
2
|
+
export { updateExpirationDate } from '../components/Auth/utils/utils';
|
2
3
|
export declare const getURLParams: (params: RequestConfig["params"] | LocationQuery) => string;
|
3
4
|
type ApiUrl = `/${string}/`;
|
4
|
-
type BaseUrl = `/${string}`;
|
5
|
+
type BaseUrl = `/${string}` | `http://${string}` | `https://${string}`;
|
5
6
|
export interface ApiClient {
|
6
7
|
baseUrl: string;
|
7
8
|
get<R>(url: ApiUrl, config?: RequestConfig<never>): Promise<RequestResponse<R, NonNullable<unknown>>>;
|
@@ -15,6 +16,7 @@ export declare class ApiClientInstance implements ApiClient {
|
|
15
16
|
isAuthFailed: import('vue').Ref<boolean, boolean>;
|
16
17
|
constructor(config: {
|
17
18
|
tokenGetter?: () => string | null;
|
19
|
+
tokenRefresh?: () => Promise<void>;
|
18
20
|
refreshUrl?: ApiUrl;
|
19
21
|
onFailure?: (response: Response) => void;
|
20
22
|
credentials?: RequestCredentials;
|
@@ -30,7 +32,7 @@ export declare class ApiClientInstance implements ApiClient {
|
|
30
32
|
private refresh;
|
31
33
|
checkAuth(): boolean | null;
|
32
34
|
private fetch;
|
33
|
-
get baseUrl(): "" |
|
35
|
+
get baseUrl(): "" | BaseUrl;
|
34
36
|
get<R>(url: ApiUrl, config?: RequestConfig<never>): Promise<RequestResponse<R, {}>>;
|
35
37
|
post<R, D extends RequestData = RequestData>(url: ApiUrl, data?: Required<RequestConfig<D>>['data'], config?: Omit<RequestConfig<D>, 'data'>): Promise<RequestResponse<R, D>>;
|
36
38
|
patch<R, D extends RequestData = RequestData>(url: ApiUrl, data?: Required<RequestConfig<D>>['data'], config?: Omit<RequestConfig<D>, 'data'>): Promise<RequestResponse<R, D>>;
|
@@ -86,5 +88,4 @@ export declare class ApiClientInstance implements ApiClient {
|
|
86
88
|
};
|
87
89
|
addInstance(baseUrl: BaseUrl): ApiClient;
|
88
90
|
}
|
89
|
-
export {};
|
90
91
|
//# sourceMappingURL=ApiClient.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ApiClient.d.ts","sourceRoot":"","sources":["../../../src/utils/ApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAiB,MAAM,YAAY,CAAA;AAW7D,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,CAAC,QAAQ,CAAC,GAAG,aAAa,KAAG,MAE9E,CAAA;AAWD,KAAK,MAAM,GAAG,IAAK,MAAO,GAAG,CAAA;AAC7B,KAAK,OAAO,GAAG,IAAK,MAAO,EAAE,CAAA;
|
1
|
+
{"version":3,"file":"ApiClient.d.ts","sourceRoot":"","sources":["../../../src/utils/ApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAiB,MAAM,YAAY,CAAA;AAW7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,+BAA+B,CAAA;AAElE,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,CAAC,QAAQ,CAAC,GAAG,aAAa,KAAG,MAE9E,CAAA;AAWD,KAAK,MAAM,GAAG,IAAK,MAAO,GAAG,CAAA;AAC7B,KAAK,OAAO,GAAG,IAAK,MAAO,EAAE,GAAG,UAAW,MAAO,EAAE,GAAG,WAAY,MAAO,EAAE,CAAA;AAE5E,MAAM,WAAW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;IAIpD,YAAY,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;IAyBpC,cAAc,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuBtC,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS;CAqBzC"}
|
package/dist/utils/ApiClient.js
CHANGED
@@ -2,6 +2,7 @@ import { ref } from 'vue';
|
|
2
2
|
import _sfc_main from '../components/Auth/WRouteAuth.vue.js';
|
3
3
|
import _sfc_main$1 from '../components/Auth/WRouteAuthNo.vue.js';
|
4
4
|
import { removeExpirationDate, getLastRefreshPromise, setRefreshTimestamp, removeRefreshTimestamp, checkExpirationDate, setExpirationDate } from '../components/Auth/utils/utils.js';
|
5
|
+
export { updateExpirationDate } from '../components/Auth/utils/utils.js';
|
5
6
|
import { encodeQueryParams, ApiError, ApiErrorCancel } from './api.js';
|
6
7
|
|
7
8
|
const getURLParams = (params) => {
|
@@ -62,7 +63,8 @@ class ApiClientInstance {
|
|
62
63
|
});
|
63
64
|
} else {
|
64
65
|
setRefreshTimestamp();
|
65
|
-
this.
|
66
|
+
const promise = this.config.tokenRefresh ? this.config.tokenRefresh() : this.fetch("GET", this.config.refreshUrl, { updateToken: true });
|
67
|
+
this.refreshPromise = promise.then(() => {
|
66
68
|
this.refreshPromise = null;
|
67
69
|
}).catch((error) => {
|
68
70
|
this.refreshPromise = null;
|
@@ -75,7 +77,7 @@ class ApiClientInstance {
|
|
75
77
|
}
|
76
78
|
checkAuth() {
|
77
79
|
let result;
|
78
|
-
if (this.config.tokenGetter) result = !!this.config.tokenGetter?.();
|
80
|
+
if (this.config.tokenGetter && !this.config.tokenRefresh) result = !!this.config.tokenGetter?.();
|
79
81
|
else result = checkExpirationDate();
|
80
82
|
if (result) this.isAuthFailed.value = false;
|
81
83
|
return result;
|
@@ -87,12 +89,13 @@ class ApiClientInstance {
|
|
87
89
|
if (this.refreshPromise) await this.refreshPromise;
|
88
90
|
const check = this.checkAuth();
|
89
91
|
if (!check) {
|
90
|
-
if (check
|
92
|
+
if (check !== null && (this.config.refreshUrl || this.config.tokenRefresh)) await this.refresh();
|
93
|
+
if (!this.checkAuth()) {
|
91
94
|
this.isAuthFailed.value = true;
|
92
95
|
return Promise.reject();
|
93
96
|
}
|
94
|
-
|
95
|
-
|
97
|
+
}
|
98
|
+
if (this.config.tokenGetter) {
|
96
99
|
const token = this.config.tokenGetter();
|
97
100
|
if (token) headers.append("Authorization", "Bearer " + token);
|
98
101
|
else return Promise.reject();
|
@@ -124,7 +127,7 @@ class ApiClientInstance {
|
|
124
127
|
});
|
125
128
|
} else {
|
126
129
|
if (response.status === 401) {
|
127
|
-
if (this.config.refreshUrl) return this.refresh().then(() => this.retry(request));
|
130
|
+
if (this.config.refreshUrl || this.config.tokenRefresh) return this.refresh().then(() => this.retry(request));
|
128
131
|
this.isAuthFailed.value = true;
|
129
132
|
}
|
130
133
|
this.config.onFailure?.(response);
|
@@ -174,7 +177,7 @@ class ApiClientInstance {
|
|
174
177
|
if (to.meta.noAuth) return;
|
175
178
|
if (this.refreshPromise) await this.refreshPromise;
|
176
179
|
if (!this.checkAuth()) {
|
177
|
-
if (this.config.refreshUrl) return this.refresh().catch(() => ({
|
180
|
+
if (this.config.refreshUrl || this.config.tokenRefresh) return this.refresh().catch(() => ({
|
178
181
|
name: this.routeNameAuthNo,
|
179
182
|
query: to.fullPath !== "/" ? { hash: to.fullPath } : void 0
|
180
183
|
}));
|
package/dist/utils/Modal.d.ts
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
import { ConfirmModalProps } from '../components/Modal/types';
|
2
2
|
import { Component, ComponentOptions, MethodOptions } from 'vue';
|
3
|
-
export type ModalComponent<Props> = Component<Props,
|
3
|
+
export type ModalComponent<Props> = Component<Props, {
|
4
|
+
formRef?: {
|
5
|
+
hasChanges?: boolean;
|
6
|
+
};
|
7
|
+
}, any, ComponentOptions, MethodOptions, {
|
4
8
|
'close:modal': () => void;
|
5
9
|
}>;
|
6
10
|
export type AddModal<Props> = (component: ModalComponent<Props>, props?: Props, cb?: () => void, autoclose?: boolean) => (() => void);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/utils/Modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAA;AAE/D,OAAO,EAAC,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAgC,MAAM,KAAK,CAAA;AAI5G,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,SAAS,CAC3C,KAAK,
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/utils/Modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAA;AAE/D,OAAO,EAAC,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAgC,MAAM,KAAK,CAAA;AAI5G,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,SAAS,CAC3C,KAAK,EACL;IAAC,OAAO,CAAC,EAAE;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAC,CAAA;CAAC,EAElC,GAAG,EACH,gBAAgB,EAChB,aAAa,EACb;IACE,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CACF,CAAA;AAED,MAAM,MAAM,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,MAAM,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAA;AAKrI,eAAO,MAAM,SAAS,GAAI,KAAK,EAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,SAAS,SAElE,CAAA;AAED,eAAO,MAAM,KAAK;QACZ,KAAK,aAAa,cAAc,CAAC,KAAK,CAAC,UAAU,KAAK,OAAO,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;oBAIjF,KAAK,aAAa,cAAc,CAAC,KAAK,CAAC,UAAU,KAAK,OAAO,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;sBAI3F,iBAAiB,OAAO,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;CAQ3E,CAAA"}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import stylistic from '@stylistic/eslint-plugin'
|
2
2
|
import unusedImports from 'eslint-plugin-unused-imports'
|
3
3
|
import pluginVue from 'eslint-plugin-vue'
|
4
|
-
// eslint-disable-next-line import/no-unresolved
|
5
4
|
import {parser as tseslintParser, plugin as tseslintPlugin} from 'typescript-eslint'
|
6
5
|
|
7
6
|
export default [
|
package/package.json
CHANGED
@@ -188,6 +188,15 @@ const pluginDefault = plugin(function ({matchUtilities, addVariant, addUtilities
|
|
188
188
|
},
|
189
189
|
})
|
190
190
|
|
191
|
+
addBase({
|
192
|
+
'.w-tooltip-center-x': {
|
193
|
+
transform: 'translate(calc(min(100vw - var(--dropdown-x, 0px) - 50% - 12px, max((var(--dropdown-x, 0px) - 50% - 12px) * -1, 0px))), 0)',
|
194
|
+
},
|
195
|
+
'.w-tooltip-center-y': {
|
196
|
+
transform: 'translate(0, calc(min(100vh - var(--dropdown-y, 0px) - 50% - 12px, max((var(--dropdown-y, 0px) - 50% - 12px) * -1, 0px))))',
|
197
|
+
},
|
198
|
+
})
|
199
|
+
|
191
200
|
matchUtilities(
|
192
201
|
{
|
193
202
|
'w-scroll-bar-color': value => {
|