@wikicasa-dev/components 2.5.6-alpha.6 → 2.5.6-alpha.8
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/UIKit/Card/BaseCard.js +1 -1
- package/dist/UIKit/Card/CardRootPrimitive.js +1 -1
- package/dist/components/IntersectionObserver/v2/IntersectionObserverProvider.d.ts +1 -3
- package/dist/components/IntersectionObserver/v2/IntersectionObserverTarget.d.ts +10 -3
- package/dist/components/IntersectionObserver/v2/types.d.ts +3 -3
- package/dist/components/IntersectionObserver/v2/types.js +3 -3
- package/dist/index.js +1 -1
- package/dist/packages/components/lib/components/IntersectionObserver/v2/IntersectionObserverProvider.vue.js +28 -27
- package/dist/packages/components/lib/components/IntersectionObserver/v2/IntersectionObserverTarget.vue.js +21 -11
- package/package.json +1 -1
- /package/dist/assets/{BaseCard.css → CardRootPrimitive.css} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface IntersectionObserverProviderProps {
|
|
2
|
-
|
|
2
|
+
emitOnce?: boolean;
|
|
3
3
|
skip?: boolean;
|
|
4
4
|
threshold?: number;
|
|
5
5
|
}
|
|
@@ -10,11 +10,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<In
|
|
|
10
10
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
|
|
11
11
|
default?(_: {
|
|
12
12
|
observer: IntersectionObserver | undefined;
|
|
13
|
-
isVisible: boolean;
|
|
14
13
|
}): any;
|
|
15
14
|
default?(_: {
|
|
16
15
|
observer: IntersectionObserver | undefined;
|
|
17
|
-
isVisible: boolean;
|
|
18
16
|
}): any;
|
|
19
17
|
}>;
|
|
20
18
|
export default _default;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
observeOnce?: boolean;
|
|
3
|
+
};
|
|
1
4
|
declare function __VLS_template(): {
|
|
2
5
|
attrs: Partial<{}>;
|
|
3
6
|
slots: {
|
|
4
|
-
default?(_: {
|
|
5
|
-
|
|
7
|
+
default?(_: {
|
|
8
|
+
isVisible: boolean;
|
|
9
|
+
}): any;
|
|
10
|
+
default?(_: {
|
|
11
|
+
isVisible: true;
|
|
12
|
+
}): any;
|
|
6
13
|
};
|
|
7
14
|
refs: {
|
|
8
15
|
root: HTMLDivElement;
|
|
@@ -10,7 +17,7 @@ declare function __VLS_template(): {
|
|
|
10
17
|
rootEl: any;
|
|
11
18
|
};
|
|
12
19
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
14
21
|
root: HTMLDivElement;
|
|
15
22
|
}, any>;
|
|
16
23
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { InjectionKey, ShallowRef } from 'vue';
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
2
|
+
export declare const ObserveTargetKey: InjectionKey<(e: Element) => void>;
|
|
3
|
+
export declare const UnobserveTargetKey: InjectionKey<(e: Element) => void>;
|
|
4
|
+
export declare const VisibleTargetsKey: InjectionKey<ShallowRef<Set<string>>>;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as P } from "./packages/components/lib/UIKit/Accordion/BaseAccordion.vue.js";
|
|
2
2
|
import { default as S } from "./packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js";
|
|
3
|
-
import './assets/
|
|
3
|
+
import './assets/CardRootPrimitive.css';import './assets/SwiperSlideImagePrimitive.css';import './assets/SwiperPaginationPrimitive.css';import './assets/BaseSnackbar.css';import './assets/BaseModal.css';import './assets/BaseDropDown.css';import './assets/BaseBadge.css';import './assets/ClearableAutocomplete.css';import './assets/BaseAutocomplete.css';import './assets/BaseAlert.css';import './assets/AccessibleSelect.css';import './assets/RadioButtonItem.css';import './assets/BaseTabsIndicator.css';import './assets/BaseTabs.css';import './assets/CheckboxBtn.css';import './assets/BaseAccordionItem.css';/* empty css */
|
|
4
4
|
import { default as I } from "./packages/components/lib/UIKit/Accordion/AccordionItemPrimitive.vue.js";
|
|
5
5
|
import { default as h } from "./packages/components/lib/UIKit/Accordion/AccordionHeaderPrimitive.vue.js";
|
|
6
6
|
import { default as w } from "./packages/components/lib/UIKit/Accordion/AccordionTriggerPrimitive.vue.js";
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as b, shallowRef as i, provide as l, onBeforeMount as h, onBeforeUnmount as p, createElementBlock as g, renderSlot as c, openBlock as y, normalizeClass as O } from "vue";
|
|
2
|
+
import { VisibleTargetsKey as k, ObserveTargetKey as B, UnobserveTargetKey as w } from "../../../../../../components/IntersectionObserver/v2/types.js";
|
|
3
|
+
const I = /* @__PURE__ */ b({
|
|
4
4
|
__name: "IntersectionObserverProvider",
|
|
5
5
|
props: {
|
|
6
|
-
|
|
6
|
+
emitOnce: { type: Boolean, default: !0 },
|
|
7
7
|
skip: { type: Boolean, default: !1 },
|
|
8
8
|
threshold: { default: 0 }
|
|
9
9
|
},
|
|
10
10
|
emits: ["intersection"],
|
|
11
|
-
setup(
|
|
12
|
-
const v = u, o = i(
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
setup(r, { emit: u }) {
|
|
12
|
+
const v = u, o = i(/* @__PURE__ */ new Set()), t = i(), d = (e) => {
|
|
13
|
+
r.skip || e.forEach(({ target: a, isIntersecting: m }) => {
|
|
14
|
+
const s = a.getAttribute("target-id");
|
|
15
|
+
if (!s) return;
|
|
16
|
+
const n = new Set(o.value);
|
|
17
|
+
m ? (n.add(s), v("intersection")) : n.delete(s), o.value = n;
|
|
15
18
|
});
|
|
16
|
-
}, f = (
|
|
17
|
-
|
|
18
|
-
}, b = () => {
|
|
19
|
-
e.value && e.value.disconnect();
|
|
19
|
+
}, f = () => {
|
|
20
|
+
t.value?.disconnect();
|
|
20
21
|
};
|
|
21
|
-
return
|
|
22
|
-
|
|
22
|
+
return l(k, o), l(B, (e) => {
|
|
23
|
+
t.value?.observe(e);
|
|
24
|
+
}), l(w, (e) => {
|
|
25
|
+
t.value?.unobserve(e);
|
|
26
|
+
}), h(() => {
|
|
27
|
+
t.value = new IntersectionObserver(d, {
|
|
23
28
|
root: null,
|
|
24
29
|
//if the root is null, then we will check if the target is visible in the doc root!
|
|
25
|
-
threshold:
|
|
30
|
+
threshold: r.threshold
|
|
26
31
|
});
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
}), (
|
|
32
|
+
}), p(() => {
|
|
33
|
+
f();
|
|
34
|
+
}), (e, a) => r.emitOnce ? c(e.$slots, "default", {
|
|
30
35
|
key: 1,
|
|
31
|
-
observer:
|
|
32
|
-
|
|
33
|
-
}) : (y(), h("div", {
|
|
36
|
+
observer: t.value
|
|
37
|
+
}) : (y(), g("div", {
|
|
34
38
|
key: 0,
|
|
35
|
-
class:
|
|
39
|
+
class: O(e.$attrs["root-classes"])
|
|
36
40
|
}, [
|
|
37
|
-
|
|
38
|
-
observer: e.value,
|
|
39
|
-
isVisible: o.value
|
|
40
|
-
})
|
|
41
|
+
c(e.$slots, "default", { observer: t.value })
|
|
41
42
|
], 2));
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
I as default
|
|
46
47
|
};
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
const K = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as v, useTemplateRef as c, useId as f, inject as o, computed as d, onMounted as b, watch as m, createElementBlock as g, renderSlot as n, openBlock as p, unref as T } from "vue";
|
|
2
|
+
import { VisibleTargetsKey as y, ObserveTargetKey as k, UnobserveTargetKey as O } from "../../../../../../components/IntersectionObserver/v2/types.js";
|
|
3
|
+
const _ = ["target-id"], K = /* @__PURE__ */ v({
|
|
4
4
|
__name: "IntersectionObserverTarget",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
props: {
|
|
6
|
+
observeOnce: { type: Boolean, default: !0 }
|
|
7
|
+
},
|
|
8
|
+
setup(s) {
|
|
9
|
+
const e = c("root"), a = f(), i = o(y, void 0), l = o(k, void 0), u = o(O, void 0), t = d(
|
|
10
|
+
() => (e.value ? i?.value.has(a) : !1) || !1
|
|
11
|
+
);
|
|
12
|
+
return b(() => {
|
|
13
|
+
e.value && l?.(e.value);
|
|
14
|
+
}), m(t, (r) => {
|
|
15
|
+
s.observeOnce && r && e.value && u?.(e.value);
|
|
16
|
+
}), (r, h) => !s.observeOnce || !t.value ? (p(), g("div", {
|
|
10
17
|
key: 0,
|
|
11
18
|
ref_key: "root",
|
|
12
19
|
ref: e,
|
|
13
|
-
|
|
20
|
+
"target-id": T(a)
|
|
14
21
|
}, [
|
|
15
|
-
|
|
16
|
-
],
|
|
22
|
+
n(r.$slots, "default", { isVisible: t.value })
|
|
23
|
+
], 8, _)) : n(r.$slots, "default", {
|
|
24
|
+
key: 1,
|
|
25
|
+
isVisible: t.value
|
|
26
|
+
});
|
|
17
27
|
}
|
|
18
28
|
});
|
|
19
29
|
export {
|
package/package.json
CHANGED
|
File without changes
|