@aotearoan/neon 22.3.0 → 22.4.0
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/layout/swiper/NeonSwiper.cjs.js +1 -1
- package/dist/components/layout/swiper/NeonSwiper.cjs.js.map +1 -1
- package/dist/components/layout/swiper/NeonSwiper.es.js +27 -14
- package/dist/components/layout/swiper/NeonSwiper.es.js.map +1 -1
- package/dist/components/layout/swiper/NeonSwiper.vue.cjs.js +1 -1
- package/dist/components/layout/swiper/NeonSwiper.vue.cjs.js.map +1 -1
- package/dist/components/layout/swiper/NeonSwiper.vue.es.js +21 -16
- package/dist/components/layout/swiper/NeonSwiper.vue.es.js.map +1 -1
- package/dist/src/components/layout/swiper/NeonSwiper.d.ts +46 -0
- package/package.json +1 -1
- package/src/sass/components/_swiper.scss +91 -27
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const l=require("vue"),
|
|
1
|
+
"use strict";const l=require("vue"),s=require("../../../common/enums/NeonOrientation.cjs.js"),v=l.defineComponent({name:"NeonSwiper",props:{fade:{type:Boolean,default:!0},orientation:{type:String,default:s.NeonOrientation.Horizontal},hideFadeStart:{type:Boolean,default:!1},hideFadeEnd:{type:Boolean,default:!1}},setup(u){const e=l.ref(null),n=l.ref(!1),a=l.ref(!1),o=l.ref(!1),i=()=>{e.value?u.orientation===s.NeonOrientation.Horizontal?(a.value=e.value.scrollLeft<=0,o.value=e.value.scrollLeft+e.value.clientWidth>e.value.scrollWidth-1):(a.value=e.value.scrollTop<=0,o.value=e.value.scrollTop+e.value.clientHeight>e.value.scrollHeight-1):(a.value=!1,o.value=!1)},r=()=>{e.value?u.orientation===s.NeonOrientation.Horizontal?n.value=e.value.scrollWidth>e.value.clientWidth:n.value=e.value.scrollHeight>e.value.clientHeight:n.value=!1,i()};return l.onMounted(()=>{var t;window.addEventListener("resize",r,{passive:!0}),(t=e.value)==null||t.addEventListener("scroll",i,{passive:!0}),r()}),l.onUnmounted(()=>{var t;window.removeEventListener("resize",r),(t=e.value)==null||t.removeEventListener("scroll",i)}),{isOverflowing:n,isScrollStart:a,isScrollEnd:o,scrollable:e}}});module.exports=v;
|
|
2
2
|
//# sourceMappingURL=NeonSwiper.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n },\n setup() {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n /**\n * Swiper orientation, i.e. whether to manage overflow horizontally or vertically.\n */\n orientation: { type: String as () => NeonOrientation, default: NeonOrientation.Horizontal },\n /**\n * Hide the starting fade (left or top depending on the orientation).\n */\n hideFadeStart: { type: Boolean, default: false },\n /**\n * Hide the ending fade (right or bottom depending on the orientation).\n */\n hideFadeEnd: { type: Boolean, default: false },\n },\n setup(props) {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n isScrollEnd.value =\n scrollable.value.scrollLeft + scrollable.value.clientWidth > scrollable.value.scrollWidth - 1;\n } else {\n isScrollStart.value = scrollable.value.scrollTop <= 0;\n isScrollEnd.value =\n scrollable.value.scrollTop + scrollable.value.clientHeight > scrollable.value.scrollHeight - 1;\n }\n } else {\n isScrollStart.value = false;\n isScrollEnd.value = false;\n }\n };\n\n const handleResize = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isOverflowing.value = scrollable.value.scrollWidth > scrollable.value.clientWidth;\n } else {\n isOverflowing.value = scrollable.value.scrollHeight > scrollable.value.clientHeight;\n }\n } else {\n isOverflowing.value = false;\n }\n\n handleScroll();\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n scrollable.value?.addEventListener('scroll', handleScroll, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n scrollable.value?.removeEventListener('scroll', handleScroll);\n });\n\n return {\n isOverflowing,\n isScrollStart,\n isScrollEnd,\n scrollable,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonOrientation","props","scrollable","ref","isOverflowing","isScrollStart","isScrollEnd","handleScroll","handleResize","onMounted","_a","onUnmounted"],"mappings":"8FAOAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,MAAO,CAIL,KAAM,CAAE,KAAM,QAAS,QAAS,EAAA,EAIhC,YAAa,CAAE,KAAM,OAAiC,QAASC,EAAAA,gBAAgB,UAAA,EAI/E,cAAe,CAAE,KAAM,QAAS,QAAS,EAAA,EAIzC,YAAa,CAAE,KAAM,QAAS,QAAS,EAAA,CAAM,EAE/C,MAAMC,EAAO,CACX,MAAMC,EAAaC,EAAAA,IAAwB,IAAI,EACzCC,EAAgBD,EAAAA,IAAa,EAAK,EAClCE,EAAgBF,EAAAA,IAAa,EAAK,EAClCG,EAAcH,EAAAA,IAAa,EAAK,EAEhCI,EAAe,IAAM,CACrBL,EAAW,MACTD,EAAM,cAAgBD,EAAAA,gBAAgB,YACxCK,EAAc,MAAQH,EAAW,MAAM,YAAc,EACrDI,EAAY,MACVJ,EAAW,MAAM,WAAaA,EAAW,MAAM,YAAcA,EAAW,MAAM,YAAc,IAE9FG,EAAc,MAAQH,EAAW,MAAM,WAAa,EACpDI,EAAY,MACVJ,EAAW,MAAM,UAAYA,EAAW,MAAM,aAAeA,EAAW,MAAM,aAAe,IAGjGG,EAAc,MAAQ,GACtBC,EAAY,MAAQ,GAExB,EAEME,EAAe,IAAM,CACrBN,EAAW,MACTD,EAAM,cAAgBD,EAAAA,gBAAgB,WACxCI,EAAc,MAAQF,EAAW,MAAM,YAAcA,EAAW,MAAM,YAEtEE,EAAc,MAAQF,EAAW,MAAM,aAAeA,EAAW,MAAM,aAGzEE,EAAc,MAAQ,GAGxBG,EAAA,CACF,EAEAE,OAAAA,EAAAA,UAAU,IAAM,OACd,OAAO,iBAAiB,SAAUD,EAAc,CAAE,QAAS,GAAM,GACjEE,EAAAR,EAAW,QAAX,MAAAQ,EAAkB,iBAAiB,SAAUH,EAAc,CAAE,QAAS,KACtEC,EAAA,CACF,CAAC,EAEDG,EAAAA,YAAY,IAAM,OAChB,OAAO,oBAAoB,SAAUH,CAAY,GACjDE,EAAAR,EAAW,QAAX,MAAAQ,EAAkB,oBAAoB,SAAUH,EAClD,CAAC,EAEM,CACL,cAAAH,EACA,cAAAC,EACA,YAAAC,EACA,WAAAJ,CAAA,CAEJ,CACF,CAAC"}
|
|
@@ -1,33 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as v, ref as n, onMounted as d, onUnmounted as c } from "vue";
|
|
2
|
+
import { NeonOrientation as r } from "../../../common/enums/NeonOrientation.es.js";
|
|
3
|
+
const h = v({
|
|
3
4
|
name: "NeonSwiper",
|
|
4
5
|
props: {
|
|
5
6
|
/**
|
|
6
7
|
* Display fade in / fade out styling when there is an overflow.
|
|
7
8
|
*/
|
|
8
|
-
fade: { type: Boolean, default: !0 }
|
|
9
|
+
fade: { type: Boolean, default: !0 },
|
|
10
|
+
/**
|
|
11
|
+
* Swiper orientation, i.e. whether to manage overflow horizontally or vertically.
|
|
12
|
+
*/
|
|
13
|
+
orientation: { type: String, default: r.Horizontal },
|
|
14
|
+
/**
|
|
15
|
+
* Hide the starting fade (left or top depending on the orientation).
|
|
16
|
+
*/
|
|
17
|
+
hideFadeStart: { type: Boolean, default: !1 },
|
|
18
|
+
/**
|
|
19
|
+
* Hide the ending fade (right or bottom depending on the orientation).
|
|
20
|
+
*/
|
|
21
|
+
hideFadeEnd: { type: Boolean, default: !1 }
|
|
9
22
|
},
|
|
10
|
-
setup() {
|
|
11
|
-
const e =
|
|
12
|
-
e.value ? (a.value = e.value.scrollLeft <= 0,
|
|
13
|
-
},
|
|
14
|
-
e.value ? t.value = e.value.scrollWidth > e.value.clientWidth : t.value = !1,
|
|
23
|
+
setup(u) {
|
|
24
|
+
const e = n(null), t = n(!1), a = n(!1), o = n(!1), i = () => {
|
|
25
|
+
e.value ? u.orientation === r.Horizontal ? (a.value = e.value.scrollLeft <= 0, o.value = e.value.scrollLeft + e.value.clientWidth > e.value.scrollWidth - 1) : (a.value = e.value.scrollTop <= 0, o.value = e.value.scrollTop + e.value.clientHeight > e.value.scrollHeight - 1) : (a.value = !1, o.value = !1);
|
|
26
|
+
}, s = () => {
|
|
27
|
+
e.value ? u.orientation === r.Horizontal ? t.value = e.value.scrollWidth > e.value.clientWidth : t.value = e.value.scrollHeight > e.value.clientHeight : t.value = !1, i();
|
|
15
28
|
};
|
|
16
|
-
return
|
|
29
|
+
return d(() => {
|
|
17
30
|
var l;
|
|
18
|
-
window.addEventListener("resize",
|
|
19
|
-
}),
|
|
31
|
+
window.addEventListener("resize", s, { passive: !0 }), (l = e.value) == null || l.addEventListener("scroll", i, { passive: !0 }), s();
|
|
32
|
+
}), c(() => {
|
|
20
33
|
var l;
|
|
21
|
-
window.removeEventListener("resize",
|
|
34
|
+
window.removeEventListener("resize", s), (l = e.value) == null || l.removeEventListener("scroll", i);
|
|
22
35
|
}), {
|
|
23
36
|
isOverflowing: t,
|
|
24
37
|
isScrollStart: a,
|
|
25
|
-
isScrollEnd:
|
|
38
|
+
isScrollEnd: o,
|
|
26
39
|
scrollable: e
|
|
27
40
|
};
|
|
28
41
|
}
|
|
29
42
|
});
|
|
30
43
|
export {
|
|
31
|
-
|
|
44
|
+
h as default
|
|
32
45
|
};
|
|
33
46
|
//# sourceMappingURL=NeonSwiper.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n },\n setup() {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\nimport { NeonOrientation } from '@/common/enums/NeonOrientation';\n\n/**\n * Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth\n * horizontal scrolling with all input devices.\n */\nexport default defineComponent({\n name: 'NeonSwiper',\n props: {\n /**\n * Display fade in / fade out styling when there is an overflow.\n */\n fade: { type: Boolean, default: true },\n /**\n * Swiper orientation, i.e. whether to manage overflow horizontally or vertically.\n */\n orientation: { type: String as () => NeonOrientation, default: NeonOrientation.Horizontal },\n /**\n * Hide the starting fade (left or top depending on the orientation).\n */\n hideFadeStart: { type: Boolean, default: false },\n /**\n * Hide the ending fade (right or bottom depending on the orientation).\n */\n hideFadeEnd: { type: Boolean, default: false },\n },\n setup(props) {\n const scrollable = ref<HTMLElement | null>(null);\n const isOverflowing = ref<boolean>(false);\n const isScrollStart = ref<boolean>(false);\n const isScrollEnd = ref<boolean>(false);\n\n const handleScroll = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isScrollStart.value = scrollable.value.scrollLeft <= 0;\n isScrollEnd.value =\n scrollable.value.scrollLeft + scrollable.value.clientWidth > scrollable.value.scrollWidth - 1;\n } else {\n isScrollStart.value = scrollable.value.scrollTop <= 0;\n isScrollEnd.value =\n scrollable.value.scrollTop + scrollable.value.clientHeight > scrollable.value.scrollHeight - 1;\n }\n } else {\n isScrollStart.value = false;\n isScrollEnd.value = false;\n }\n };\n\n const handleResize = () => {\n if (scrollable.value) {\n if (props.orientation === NeonOrientation.Horizontal) {\n isOverflowing.value = scrollable.value.scrollWidth > scrollable.value.clientWidth;\n } else {\n isOverflowing.value = scrollable.value.scrollHeight > scrollable.value.clientHeight;\n }\n } else {\n isOverflowing.value = false;\n }\n\n handleScroll();\n };\n\n onMounted(() => {\n window.addEventListener('resize', handleResize, { passive: true });\n scrollable.value?.addEventListener('scroll', handleScroll, { passive: true });\n handleResize();\n });\n\n onUnmounted(() => {\n window.removeEventListener('resize', handleResize);\n scrollable.value?.removeEventListener('scroll', handleScroll);\n });\n\n return {\n isOverflowing,\n isScrollStart,\n isScrollEnd,\n scrollable,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonOrientation","props","scrollable","ref","isOverflowing","isScrollStart","isScrollEnd","handleScroll","handleResize","onMounted","_a","onUnmounted"],"mappings":";;AAOA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,MAAM,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIhC,aAAa,EAAE,MAAM,QAAiC,SAASC,EAAgB,WAAA;AAAA;AAAA;AAAA;AAAA,IAI/E,eAAe,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA;AAAA;AAAA;AAAA,IAIzC,aAAa,EAAE,MAAM,SAAS,SAAS,GAAA;AAAA,EAAM;AAAA,EAE/C,MAAMC,GAAO;AACX,UAAMC,IAAaC,EAAwB,IAAI,GACzCC,IAAgBD,EAAa,EAAK,GAClCE,IAAgBF,EAAa,EAAK,GAClCG,IAAcH,EAAa,EAAK,GAEhCI,IAAe,MAAM;AACzB,MAAIL,EAAW,QACTD,EAAM,gBAAgBD,EAAgB,cACxCK,EAAc,QAAQH,EAAW,MAAM,cAAc,GACrDI,EAAY,QACVJ,EAAW,MAAM,aAAaA,EAAW,MAAM,cAAcA,EAAW,MAAM,cAAc,MAE9FG,EAAc,QAAQH,EAAW,MAAM,aAAa,GACpDI,EAAY,QACVJ,EAAW,MAAM,YAAYA,EAAW,MAAM,eAAeA,EAAW,MAAM,eAAe,MAGjGG,EAAc,QAAQ,IACtBC,EAAY,QAAQ;AAAA,IAExB,GAEME,IAAe,MAAM;AACzB,MAAIN,EAAW,QACTD,EAAM,gBAAgBD,EAAgB,aACxCI,EAAc,QAAQF,EAAW,MAAM,cAAcA,EAAW,MAAM,cAEtEE,EAAc,QAAQF,EAAW,MAAM,eAAeA,EAAW,MAAM,eAGzEE,EAAc,QAAQ,IAGxBG,EAAA;AAAA,IACF;AAEA,WAAAE,EAAU,MAAM;;AACd,aAAO,iBAAiB,UAAUD,GAAc,EAAE,SAAS,IAAM,IACjEE,IAAAR,EAAW,UAAX,QAAAQ,EAAkB,iBAAiB,UAAUH,GAAc,EAAE,SAAS,OACtEC,EAAA;AAAA,IACF,CAAC,GAEDG,EAAY,MAAM;;AAChB,aAAO,oBAAoB,UAAUH,CAAY,IACjDE,IAAAR,EAAW,UAAX,QAAAQ,EAAkB,oBAAoB,UAAUH;AAAA,IAClD,CAAC,GAEM;AAAA,MACL,eAAAH;AAAA,MACA,eAAAC;AAAA,MACA,aAAAC;AAAA,MACA,YAAAJ;AAAA,IAAA;AAAA,EAEJ;AACF,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("./NeonSwiper.cjs.js"),n=require("vue"),s=require("../../../_virtual/_plugin-vue_export-helper.cjs.js"),i={ref:"scrollable",class:"neon-swiper__container"};function t(e,r,d,a,p,u){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass([[`neon-swiper--${e.orientation}`,{"neon-swiper--fade":e.fade,"neon-swiper--overflowing":e.isOverflowing,"neon-swiper--start":e.isScrollStart,"neon-swiper--end":e.isScrollEnd,"neon-swiper--hide-fade-start":e.hideFadeStart,"neon-swiper--hide-fade-end":e.hideFadeEnd}],"neon-swiper"])},[n.createElementVNode("div",i,[n.renderSlot(e.$slots,"default")],512),r[0]||(r[0]=n.createElementVNode("div",{class:"neon-swiper__fade-out"},null,-1))],2)}const l=s(o,[["render",t]]);module.exports=l;
|
|
2
2
|
//# sourceMappingURL=NeonSwiper.vue.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.vue.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"{\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.vue.cjs.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-swiper--${orientation}`,\n {\n 'neon-swiper--fade': fade,\n 'neon-swiper--overflowing': isOverflowing,\n 'neon-swiper--start': isScrollStart,\n 'neon-swiper--end': isScrollEnd,\n 'neon-swiper--hide-fade-start': hideFadeStart,\n 'neon-swiper--hide-fade-end': hideFadeEnd,\n },\n ]\"\n class=\"neon-swiper\"\n >\n <div ref=\"scrollable\" class=\"neon-swiper__container\">\n <!-- @slot contents of swiper with which to apply overflow scrolling. -->\n <slot></slot>\n </div>\n <div class=\"neon-swiper__fade-out\"></div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSwiper.ts\"></script>\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_createElementVNode","_hoisted_1","_renderSlot"],"mappings":"wIAeS,IAAI,aAAa,MAAM,uEAd9BA,EAAAA,mBAmBM,MAAA,CAlBH,MAAKC,EAAAA,eAAA,CAAA,iBAA0BC,EAAA,WAAW,wBAAyCA,EAAA,gCAA0CA,EAAA,mCAA6CA,EAAA,iCAA2CA,EAAA,2CAAqDA,EAAA,2CAAqDA,EAAA,cAW1T,aAAa,CAAA,IAEnBC,EAAAA,mBAGM,MAHNC,EAGM,CADJC,aAAaH,EAAA,OAAA,SAAA,oBAEfC,EAAAA,mBAAyC,MAAA,CAApC,MAAM,yBAAuB,KAAA,EAAA"}
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as s, createElementBlock as i, normalizeClass as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import r from "./NeonSwiper.es.js";
|
|
2
|
+
import { openBlock as s, createElementBlock as i, normalizeClass as a, createElementVNode as o, renderSlot as d } from "vue";
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.es.js";
|
|
4
|
+
const l = {
|
|
5
5
|
ref: "scrollable",
|
|
6
6
|
class: "neon-swiper__container"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function p(e, n, f, w, m, c) {
|
|
9
9
|
return s(), i("div", {
|
|
10
|
-
class:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
class: a([[
|
|
11
|
+
`neon-swiper--${e.orientation}`,
|
|
12
|
+
{
|
|
13
|
+
"neon-swiper--fade": e.fade,
|
|
14
|
+
"neon-swiper--overflowing": e.isOverflowing,
|
|
15
|
+
"neon-swiper--start": e.isScrollStart,
|
|
16
|
+
"neon-swiper--end": e.isScrollEnd,
|
|
17
|
+
"neon-swiper--hide-fade-start": e.hideFadeStart,
|
|
18
|
+
"neon-swiper--hide-fade-end": e.hideFadeEnd
|
|
19
|
+
}
|
|
20
|
+
], "neon-swiper"])
|
|
16
21
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
o("div", l, [
|
|
23
|
+
d(e.$slots, "default")
|
|
19
24
|
], 512),
|
|
20
|
-
|
|
25
|
+
n[0] || (n[0] = o("div", { class: "neon-swiper__fade-out" }, null, -1))
|
|
21
26
|
], 2);
|
|
22
27
|
}
|
|
23
|
-
const
|
|
28
|
+
const v = /* @__PURE__ */ t(r, [["render", p]]);
|
|
24
29
|
export {
|
|
25
|
-
|
|
30
|
+
v as default
|
|
26
31
|
};
|
|
27
32
|
//# sourceMappingURL=NeonSwiper.vue.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonSwiper.vue.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"{\n
|
|
1
|
+
{"version":3,"file":"NeonSwiper.vue.es.js","sources":["../../../../src/components/layout/swiper/NeonSwiper.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n `neon-swiper--${orientation}`,\n {\n 'neon-swiper--fade': fade,\n 'neon-swiper--overflowing': isOverflowing,\n 'neon-swiper--start': isScrollStart,\n 'neon-swiper--end': isScrollEnd,\n 'neon-swiper--hide-fade-start': hideFadeStart,\n 'neon-swiper--hide-fade-end': hideFadeEnd,\n },\n ]\"\n class=\"neon-swiper\"\n >\n <div ref=\"scrollable\" class=\"neon-swiper__container\">\n <!-- @slot contents of swiper with which to apply overflow scrolling. -->\n <slot></slot>\n </div>\n <div class=\"neon-swiper__fade-out\"></div>\n </div>\n</template>\n\n<script lang=\"ts\" src=\"./NeonSwiper.ts\"></script>\n"],"names":["_createElementBlock","_normalizeClass","_ctx","_createElementVNode","_hoisted_1","_renderSlot"],"mappings":";;;;EAeS,KAAI;AAAA,EAAa,OAAM;;;cAd9BA,EAmBM,OAAA;AAAA,IAlBH,OAAKC,EAAA,CAAA;AAAA,sBAA0BC,EAAA,WAAW;AAAA;6BAAyCA,EAAA;AAAA,oCAA0CA,EAAA;AAAA,8BAA6CA,EAAA;AAAA,4BAA2CA,EAAA;AAAA,wCAAqDA,EAAA;AAAA,sCAAqDA,EAAA;AAAA;OAW1T,aAAa,CAAA;AAAA;IAEnBC,EAGM,OAHNC,GAGM;AAAA,MADJC,EAAaH,EAAA,QAAA,SAAA;AAAA;oBAEfC,EAAyC,OAAA,EAApC,OAAM,2BAAuB,MAAA,EAAA;AAAA;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NeonOrientation } from '@/common/enums/NeonOrientation';
|
|
1
2
|
/**
|
|
2
3
|
* Automatically handle horizontally overflowing content by placing it in a NeonSwiper component allowing for smooth
|
|
3
4
|
* horizontal scrolling with all input devices.
|
|
@@ -10,6 +11,27 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
10
11
|
type: BooleanConstructor;
|
|
11
12
|
default: boolean;
|
|
12
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Swiper orientation, i.e. whether to manage overflow horizontally or vertically.
|
|
16
|
+
*/
|
|
17
|
+
orientation: {
|
|
18
|
+
type: () => NeonOrientation;
|
|
19
|
+
default: NeonOrientation;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Hide the starting fade (left or top depending on the orientation).
|
|
23
|
+
*/
|
|
24
|
+
hideFadeStart: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Hide the ending fade (right or bottom depending on the orientation).
|
|
30
|
+
*/
|
|
31
|
+
hideFadeEnd: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
13
35
|
}>, {
|
|
14
36
|
isOverflowing: import("vue").Ref<boolean, boolean>;
|
|
15
37
|
isScrollStart: import("vue").Ref<boolean, boolean>;
|
|
@@ -23,7 +45,31 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
23
45
|
type: BooleanConstructor;
|
|
24
46
|
default: boolean;
|
|
25
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Swiper orientation, i.e. whether to manage overflow horizontally or vertically.
|
|
50
|
+
*/
|
|
51
|
+
orientation: {
|
|
52
|
+
type: () => NeonOrientation;
|
|
53
|
+
default: NeonOrientation;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Hide the starting fade (left or top depending on the orientation).
|
|
57
|
+
*/
|
|
58
|
+
hideFadeStart: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Hide the ending fade (right or bottom depending on the orientation).
|
|
64
|
+
*/
|
|
65
|
+
hideFadeEnd: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
26
69
|
}>> & Readonly<{}>, {
|
|
70
|
+
orientation: NeonOrientation;
|
|
27
71
|
fade: boolean;
|
|
72
|
+
hideFadeStart: boolean;
|
|
73
|
+
hideFadeEnd: boolean;
|
|
28
74
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
29
75
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aotearoan/neon",
|
|
3
3
|
"description": "Neon is a lightweight design library of Vue 3 components with minimal dependencies.",
|
|
4
|
-
"version": "22.
|
|
4
|
+
"version": "22.4.0",
|
|
5
5
|
"main": "./dist/neon.cjs.js",
|
|
6
6
|
"module": "./dist/neon.es.js",
|
|
7
7
|
"types": "./dist/src/neon.d.ts",
|
|
@@ -6,18 +6,14 @@
|
|
|
6
6
|
flex-direction: row;
|
|
7
7
|
max-width: 100%;
|
|
8
8
|
width: 100%;
|
|
9
|
-
overflow-x: hidden;
|
|
10
9
|
|
|
11
10
|
.neon-swiper__container {
|
|
12
11
|
position: relative;
|
|
13
12
|
top: 0;
|
|
14
13
|
left: 0;
|
|
15
|
-
overflow-x: auto;
|
|
16
14
|
overscroll-behavior: contain;
|
|
17
15
|
width: 100%;
|
|
18
16
|
height: 100%;
|
|
19
|
-
|
|
20
|
-
@include scrollbars.hide-scrollbars();
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
.neon-swiper__fade-out {
|
|
@@ -29,40 +25,108 @@
|
|
|
29
25
|
z-index: var(--neon-z-index-above);
|
|
30
26
|
width: 100%;
|
|
31
27
|
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--horizontal {
|
|
31
|
+
overflow-x: hidden;
|
|
32
|
+
|
|
33
|
+
.neon-swiper__container {
|
|
34
|
+
overflow-x: auto;
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
@include scrollbars.hide-scrollbars();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.neon-swiper__fade-out {
|
|
40
|
+
&:before {
|
|
41
|
+
content: '';
|
|
42
|
+
position: absolute;
|
|
43
|
+
left: 0;
|
|
44
|
+
background: linear-gradient(to left, transparent, var(--neon-background-color-swiper));
|
|
45
|
+
height: 100%;
|
|
46
|
+
width: 0;
|
|
47
|
+
transition: width ease-in-out var(--neon-animation-speed-fast);
|
|
48
|
+
}
|
|
32
49
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
&:after {
|
|
51
|
+
content: '';
|
|
52
|
+
position: absolute;
|
|
53
|
+
right: 0;
|
|
54
|
+
background: linear-gradient(to right, transparent, var(--neon-background-color-swiper));
|
|
55
|
+
height: 100%;
|
|
56
|
+
width: 0;
|
|
57
|
+
transition: width ease-in-out var(--neon-animation-speed-fastest);
|
|
58
|
+
}
|
|
41
59
|
}
|
|
42
60
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
&.neon-swiper--overflowing.neon-swiper--fade {
|
|
62
|
+
&:not(.neon-swiper--start) {
|
|
63
|
+
.neon-swiper__fade-out:before {
|
|
64
|
+
width: var(--neon-space-24);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:not(.neon-swiper--end) {
|
|
69
|
+
.neon-swiper__fade-out:after {
|
|
70
|
+
width: var(--neon-space-24);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
51
73
|
}
|
|
52
74
|
}
|
|
53
75
|
|
|
54
|
-
&--
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
&--vertical {
|
|
77
|
+
overflow-y: hidden;
|
|
78
|
+
|
|
79
|
+
.neon-swiper__container {
|
|
80
|
+
overflow-y: auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.neon-swiper__fade-out {
|
|
84
|
+
&:before {
|
|
85
|
+
content: '';
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: 0;
|
|
88
|
+
background: linear-gradient(to top, transparent, var(--neon-background-color-swiper));
|
|
89
|
+
width: 100%;
|
|
90
|
+
height: 0;
|
|
91
|
+
transition: width ease-in-out var(--neon-animation-speed-fastest);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:after {
|
|
95
|
+
content: '';
|
|
96
|
+
position: absolute;
|
|
97
|
+
bottom: 0;
|
|
98
|
+
background: linear-gradient(to bottom, transparent, var(--neon-background-color-swiper));
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 0;
|
|
101
|
+
transition: width ease-in-out var(--neon-animation-speed-fastest);
|
|
58
102
|
}
|
|
59
103
|
}
|
|
60
104
|
|
|
61
|
-
|
|
62
|
-
.neon-
|
|
63
|
-
|
|
105
|
+
&.neon-swiper--overflowing.neon-swiper--fade {
|
|
106
|
+
&:not(.neon-swiper--start) {
|
|
107
|
+
.neon-swiper__fade-out:before {
|
|
108
|
+
height: var(--neon-space-24);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:not(.neon-swiper--end) {
|
|
113
|
+
.neon-swiper__fade-out:after {
|
|
114
|
+
height: var(--neon-space-24);
|
|
115
|
+
}
|
|
64
116
|
}
|
|
65
117
|
}
|
|
66
118
|
}
|
|
119
|
+
|
|
120
|
+
&.neon-swiper--hide-fade-start {
|
|
121
|
+
.neon-swiper__fade-out:before {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.neon-swiper--hide-fade-end {
|
|
127
|
+
.neon-swiper__fade-out:after {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
67
131
|
}
|
|
68
132
|
}
|