Socket
Socket
Sign inDemoInstall

chronocraft-scroller-vue

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chronocraft-scroller-vue - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

41

dist/cjs/index.js

@@ -1,2 +0,2 @@

'use strict';Object.defineProperty(exports,'__esModule',{value:true});var index=require('./index-d623fc49.js');require('vue');const Plugin = {
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var index=require('./index-d623fc49.js');require('vue');const Plugin$1 = {
install(vue) {

@@ -6,3 +6,3 @@ index.r(vue, index.s);

};//export { default as Scroller } from './scroller';
var components=/*#__PURE__*/Object.freeze({__proto__:null,Scroller:Plugin});const filterUtility = (payload, dataSource, filterStratergies) => {
var components=/*#__PURE__*/Object.freeze({__proto__:null,Scroller:Plugin$1});const filterUtility = (payload, dataSource, filterStratergies) => {
let tempData = [];

@@ -252,32 +252,9 @@ Object.values(payload).forEach((config) => {

S = miliseconds
*/const install = (instance) => {
for (const componentKey in components) {
instance.use(components[componentKey]);
*//* eslint-disable */
const Plugin = {
install(app) {
Object.entries(components).forEach(([componentName, component]) => {
app.component(componentName, component);
});
}
};
/* export interface ColoredTextOptions {
color: string
}
import { App as Application, Plugin } from "vue";
import { setVueInstance } from "./utils/config/index";
import * as components from './components';
const Plugin: Plugin = {
install(app: Application, options: ColoredTextOptions) {
Object.entries(components).forEach(([componentName, component]) => {
app.component(componentName, component);
});
}
}
// Default export is library as a whole, registered via Vue.use()
export default Plugin;
// Allow component use individually
export * from './components';
export * from './utilities'; */exports.Scroller=Plugin;exports.addDays=addDays;exports.checkIfWeekendDay=checkIfWeekendDay;exports.daysMatch=daysMatch;exports["default"]=install;exports.enumerateDaysBetweenDates=enumerateDaysBetweenDates;exports.enumerateStringDaysBetweenDates=enumerateStringDaysBetweenDates;exports.filterUtility=filterUtility;exports.formatDate=formatDate;exports.getDiff=getDiff;exports.sortUtility=sortUtility;exports.twoDigitPad=twoDigitPad;
};exports.Scroller=Plugin$1;exports.addDays=addDays;exports.checkIfWeekendDay=checkIfWeekendDay;exports.daysMatch=daysMatch;exports["default"]=Plugin;exports.enumerateDaysBetweenDates=enumerateDaysBetweenDates;exports.enumerateStringDaysBetweenDates=enumerateStringDaysBetweenDates;exports.filterUtility=filterUtility;exports.formatDate=formatDate;exports.getDiff=getDiff;exports.sortUtility=sortUtility;exports.twoDigitPad=twoDigitPad;
import { r as registerComponent, s as script } from './index-f8f79ada.js';
import 'vue';
const Plugin = {
const Plugin$1 = {
install(vue) {

@@ -14,3 +14,3 @@ registerComponent(vue, script);

__proto__: null,
Scroller: Plugin
Scroller: Plugin$1
});

@@ -269,34 +269,11 @@

const install = (instance) => {
for (const componentKey in components) {
instance.use(components[componentKey]);
/* eslint-disable */
const Plugin = {
install(app) {
Object.entries(components).forEach(([componentName, component]) => {
app.component(componentName, component);
});
}
};
/* export interface ColoredTextOptions {
color: string
}
import { App as Application, Plugin } from "vue";
import { setVueInstance } from "./utils/config/index";
import * as components from './components';
const Plugin: Plugin = {
install(app: Application, options: ColoredTextOptions) {
Object.entries(components).forEach(([componentName, component]) => {
app.component(componentName, component);
});
}
}
// Default export is library as a whole, registered via Vue.use()
export default Plugin;
// Allow component use individually
export * from './components';
export * from './utilities'; */
export { Plugin as Scroller, addDays, checkIfWeekendDay, daysMatch, install as default, enumerateDaysBetweenDates, enumerateStringDaysBetweenDates, filterUtility, formatDate, getDiff, sortUtility, twoDigitPad };
export { Plugin$1 as Scroller, addDays, checkIfWeekendDay, daysMatch, Plugin as default, enumerateDaysBetweenDates, enumerateStringDaysBetweenDates, filterUtility, formatDate, getDiff, sortUtility, twoDigitPad };

@@ -1,1 +0,1 @@

var vuelib=function(e,t){"use strict";function r(e,t,r,n,l,a,o){try{var i=e[a](o),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,l)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(l,a){var o=e.apply(t,n);function i(e){r(o,l,a,i,s,"next",e)}function s(e){r(o,l,a,i,s,"throw",e)}i(void 0)}))}}function l(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var o=t.defineComponent({name:"Scroller",components:{},props:{data:{type:Array,default:function(){return[]}},orientation:{type:String,default:"vertical"},numcols:{type:Number,default:4},numrows:{type:Number,default:4},gap:{type:Number,default:10},contentpadding:{type:Number,default:10},cellheight:{type:Number,default:100},cellwidth:{type:Number,default:100},cellsquared:{type:Boolean,default:!0},wheelscrollspeed:{type:Number,default:12}},setup:function(e,r){var a,o,i,s=t.ref(e.cellwidth+"px"),c=t.ref(e.cellheight+"px"),u=t.ref("100%"),f=null,d=t.ref(null),p=0,h=0,v=!1,m=!1,g=0,y=0,x=0,w=!1,b=200,M=!1,S=t.ref(e.data);function k(){"vertical"===e.orientation?f.scrollTop+=p:f.scrollLeft+=p,p*=.97,Math.abs(p)>.5&&(h=requestAnimationFrame(k))}function L(){cancelAnimationFrame(h)}function T(){L(),h=requestAnimationFrame(k)}function E(){var e,t=E.width;return void 0===t&&((e=document.createElement("div")).innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',e=e.firstChild,document.body.appendChild(e),t=E.width=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t}function D(t){S.value=[].concat(l(S.value),l(t)),S.value.splice(0,t.length);var r=document.querySelector(".scroller-cell");r.offsetHeight,e.gap;var n=r.offsetWidth+e.gap,a=0;if("vertical"===e.orientation)parseInt(t.length/e.numcols),a=y,f.scrollTop=a,i=a-(y-i);else{var o=parseInt(t.length/e.numrows);a=y-n*o,f.scrollLeft=a,i=a-(y-i)}setTimeout((function(){M=!1}),100)}function H(t){S.value=[].concat(l(t),l(S.value)),S.value.splice(S.value.length-t.length,S.value.length-1);var r=document.querySelector(".scroller-cell");r.offsetHeight,e.gap;var n=r.offsetWidth+e.gap,a=0;if("vertical"===e.orientation)parseInt(t.length/e.numcols),a=y,f.scrollTop=a,i=a-(y-i);else{var o=parseInt(t.length/e.numrows);a=y+n*o,f.scrollLeft=a,i=a-(y-i)}setTimeout((function(){M=!1}),100)}function W(e,t,r){return _.apply(this,arguments)}function _(){return(_=n(regeneratorRuntime.mark((function t(n,l,a){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:1===n&&("vertical"===e.orientation?f.scrollTop+f.offsetHeight>=f.scrollHeight-b&&(M||(M=!0,r.emit("on-update-data-next",(function(e){D(e)})))):(f.scrollLeft+f.offsetWidth>=f.scrollWidth-b||f.scrollLeft===f.scrollWidth-f.clientWidth)&&(M||(M=!0,r.emit("on-update-data-next",(function(e){setTimeout((function(){D(e)}),10)}))))),-1===n&&("vertical"===e.orientation?f.scrollTop<b&&(M||(M=!0,r.emit("on-update-data-previous",(function(e){H(e)})))):f.scrollLeft<b&&(M||(M=!0,r.emit("on-update-data-previous",(function(e){setTimeout((function(){H(e)}),10)})))));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function z(){console.log("Initialize"),f=document.querySelector(".scroller"),x=E();var t=0,n=0,l=0;if("vertical"===e.orientation)t=(e.numcols-1)*e.gap+x,f.offsetWidth,n=(f.offsetWidth-t-2*e.contentpadding)/e.numcols,s.value=String(n+"%"),u.value=String(n+"px"),e.cellsquared&&(l=(f.clientWidth-t-2*e.contentpadding)/e.numcols,c.value=l+"px");else{t=(e.numrows-1)*e.gap+x,f.offsetHeight,l=(f.offsetHeight-t-2*e.contentpadding)/e.numrows;var d=(f.offsetHeight-t-2*e.contentpadding)/e.numrows;c.value=String(l+"px"),u.value=String(d+"px"),e.cellsquared&&(n=l,s.value=n+"px")}f.addEventListener("mousedown",(function(t){v=!0,f.classList.add("active"),"vertical"===e.orientation?(a=t.pageY-f.offsetTop,o=t.pageY,i=f.scrollTop,g=t.clientY):(a=t.pageX-f.offsetLeft,o=t.pageX,i=f.scrollLeft,g=t.clientX),L()})),f.addEventListener("mouseleave",(function(){v=!1,f.classList.remove("active")})),f.addEventListener("mouseup",(function(t){v=!1,m=!1,f.classList.remove("active"),T();var n=0;n="vertical"===e.orientation?o-t.pageY:o-t.pageX,Math.abs(n)>10&&r.emit("on-scroll")})),f.addEventListener("mousemove",(function(t){if(v){t.preventDefault(),m=!0;var r=0,n=0;"vertical"===e.orientation?(r=2*(t.pageY-f.offsetTop-a),n=f.scrollTop,f.scrollTop=i-r,p=f.scrollTop-n,f.scrollTop=i-r):(r=2*(t.pageX-f.offsetLeft-a),n=f.scrollLeft,f.scrollLeft=i-r,p=f.scrollLeft-n,f.scrollLeft=i-r)}})),f.addEventListener("wheel",(function(t){if(L(),"vertical"===e.orientation){var n=Math.sign(t.deltaY)*e.wheelscrollspeed,l=f.scrollTop;f.scrollTop+=n,p=f.scrollTop-l}else{var a=Math.sign(t.deltaY)*e.wheelscrollspeed,o=f.scrollLeft;if(f.scrollLeft+=a,p=f.scrollLeft-o,f.scrollLeft===f.scrollWidth-f.clientWidth){console.log("detectScrollEdges");W(parseInt(0/Math.abs(0)),!1,t)}}r.emit("on-scroll"),T()})),f.addEventListener("scroll",(function(t){var r=0;if("vertical"===e.orientation){var n=f.scrollTop;r=n-y,W(parseInt(r/Math.abs(r)),!1,t),y=n}else{var l=f.scrollLeft;r=l-y,W(parseInt(r/Math.abs(r)),!1,t),y=l}}))}function A(e){z()}return t.onMounted((function(){window.addEventListener("resize",A),z()})),{cellW:s,cellH:c,cellFlexBasis:u,scroller:f,cellRef:d,isMouseDown:v,startPos:a,startscrollPos:o,movescrollPos:i,scrollerMoving:m,previousPos:g,scrollbarWidth:x,justLoaded:w,scrollLoadingOffset:b,cellsdata:S}}}),i={class:"cell-text"};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===r&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.scroller[data-v-0f0a8e61] {\r\n height: 500px;\r\n background: #eaeaea;\n}\n.vertical-scroller[data-v-0f0a8e61] {\r\n overflow-y: auto;\r\n overflow-x: hidden;\n}\n.horizontal-scroller[data-v-0f0a8e61] {\r\n overflow-y: hidden;\r\n overflow-x: auto;\n}\n.scroller-container[data-v-0f0a8e61] {\r\n -ms-flex-line-pack: start;\r\n -webkit-align-content: flex-start;\r\n align-content: flex-start;\r\n -webkit-flex-direction: row;\r\n -ms-flex-direction: row;\r\n flex-direction: row;\r\n -webkit-flex-wrap: wrap;\r\n -ms-flex-wrap: wrap;\r\n flex-wrap: wrap;\n}\n.vertical-container[data-v-0f0a8e61] {\r\n display: -webkit-flex;\r\n display: -ms-flexbox;\r\n display: flex;\n}\n.horizontal-container[data-v-0f0a8e61] {\r\n display: -webkit-inline-flex;\r\n display: -ms-inline-flexbox;\r\n display: inline-flex;\r\n -webkit-flex-flow: column wrap !important;\r\n -ms-flex-flow: column wrap !important;\r\n flex-flow: column wrap !important;\r\n height: inherit !important;\r\n -ms-flex-line-pack: start;\r\n -webkit-align-content: flex-start;\r\n align-content: flex-start;\r\n width: 100%;\n}\n.scroller-cell[data-v-0f0a8e61] {\r\n\r\n background: #b6b6b6;\r\n\r\n -webkit-flex: inherit;\r\n\r\n -ms-flex: inherit;\r\n\r\n flex: inherit;\r\n -webkit-flex-grow: 0;\r\n -ms-flex-positive: 0;\r\n flex-grow: 0;\r\n -ms-flex-negative: 0;\r\n -webkit-flex-shrink: 0;\r\n flex-shrink: 0;\r\n -ms-flex-preferred-size: 25%;\r\n -webkit-flex-basis: 25%;\r\n flex-basis: 25%;\r\n\r\n /* for theme */\r\n background: #ffffff;\r\n box-shadow: 2px 2px 2px 2px rgb(221 221 221 / 60%);\r\n border-radius: 5px;\n}\n.vertical-cell[data-v-0f0a8e61] {\r\n display: inline-block;\r\n height: 50px;\n}\n.horizontal-cell[data-v-0f0a8e61] {\r\n display: -webkit-inline-flex;\r\n display: -ms-inline-flexbox;\r\n display: inline-flex;\r\n height: unset !important;\r\n width: 90px;\n}\n.dummycell[data-v-0f0a8e61] {\r\n height: 20px;\n}\n.cell-text[data-v-0f0a8e61] {\r\n width: 100%;\r\n text-align: center;\r\n font-size: 18pt;\n}\r\n"),o.render=function(e,r,n,l,a,o){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["scroller","vertical"===e.orientation?"vertical-scroller":"horizontal-scroller"])},[t.createElementVNode("div",{class:t.normalizeClass(["scroller-container","vertical"===e.orientation?"vertical-container":"horizontal-container"]),style:t.normalizeStyle([{gap:e.gap+"px"},{padding:e.contentpadding+"px"}])},[t.renderSlot(e.$slots,"content",{},(function(){return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.cellsdata,(function(r){return t.openBlock(),t.createElementBlock("div",{ref_for:!0,ref:"cellRef",key:r.id,class:t.normalizeClass(["scroller-cell","vertical"===e.orientation?"vertical-cell":"horizontal-cell"]),style:t.normalizeStyle({"flex-basis":e.cellFlexBasis,height:e.cellH,width:e.cellW})},[t.renderSlot(e.$slots,"cell",{},(function(){return[t.createElementVNode("span",i,t.toDisplayString(r.id),1)]}))],6)})),128))]}))],6)],2)},o.__scopeId="data-v-0f0a8e61";const s={install(e){var t,r;t=e,(r=o)&&t.component(r.name||"",r)}};var c=Object.freeze({__proto__:null,Scroller:s});const u=(e,t)=>{var r=new Date(e);return r.setDate(r.getDate()+t),r},f=(e,t)=>e.getTime()-t.getTime(),d=e=>e<10?"0"+String(e):String(e),p=(e,t)=>{t||(t="M/d/yyyy");var r=e.getDate(),n=e.getMonth(),l=e.getFullYear(),a=e.getHours(),o=e.getMinutes(),i=e.getSeconds(),s=e.getMilliseconds(),c=a%12,u=d(c),f=d(a),p=d(o),h=d(i),v=a<12?"AM":"PM",m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()],g=m.substring(0,3),y=d(r),x=n+1,w=d(x),b=["January","February","March","April","May","June","July","August","September","October","November","December"][n],M=b.substring(0,3),S=l+"",k=S.substring(2,2);return t.indexOf("MMM")<=-1&&(t=t.replace("MM",w).replace("M",String(x))),(t=t.replace("hh",u).replace("h",String(c)).replace("HH",f).replace("H",String(a)).replace("mm",p).replace("m",String(o)).replace("ss",h).replace("s",String(i)).replace("S",String(s)).replace("dd",y).replace("d",String(r)).replace("EEEE",m).replace("EEE",g).replace("yyyy",S).replace("yy",k).replace("aaa",v)).indexOf("MMM")>-1&&(t=t.replace("MMMM",b).replace("MMM",M)),t};return e.Scroller=s,e.addDays=u,e.checkIfWeekendDay=e=>{var t=e.getDay();return 6===t||0===t},e.daysMatch=(e,t)=>e.getDate()==t.getDate()&&e.getMonth()==t.getMonth()&&e.getFullYear()==t.getFullYear(),e.default=e=>{for(const t in c)e.use(c[t])},e.enumerateDaysBetweenDates=(e,t)=>{var r,n=[];let l;l=t,(r=e).setHours(0,0,0,0),l.setHours(0,0,0,0),n.push(r);var a=r;if(f(r,l)<0)for(;f(a,l)<0;)a=u(a,1),n.push(a);return n},e.enumerateStringDaysBetweenDates=(e,t)=>{var r,n=[];let l;l=t,(r=e).setHours(0,0,0,0),l.setHours(0,0,0,0),n.push(p(r,"dd-MMM-yyyy"));var a=r;if(f(r,l)<0)for(;f(a,l)<0;)a=u(a,1),n.push(p(a,"dd-MMM-yyyy"));return n.push(p(l,"dd-MMM-yyyy")),n},e.filterUtility=(e,t,r)=>{let n=[];return Object.values(e).forEach((e=>{const{filterKey:l,type:a,matchType:o}=e;n=n||t[e.dataSource];const i=e.value||[];if("key"!==a){const e=r[i];if(!e)return;n=n.filter((t=>e(t)))}n=n.filter((t=>{if("exact"===o)return i.includes(t[l]);if("between_range"===o){const r=[],n=[];return e.options.filter((e=>i.includes(e.value))).forEach((e=>{r.push(e.startKey||0),n.push(e.endKey||0)})),t[l]>=Math.min(...r)&&t[l]<=Math.max(...n)}return"less_than"===o?t[l]<Math.max(...i):"less_than_or_equal"===o?t[l]<=Math.max(...i):"greater_than_or_equal"===o?t[l]>=Math.min(...i):"greater_than"===o?t[l]>Math.min(...i):t[l]===i}))})),n},e.formatDate=p,e.getDiff=f,e.sortUtility=(e,t,r)=>{const n=t[e.dataSource],{sortingKey:l,ordering:a,type:o}=e;if("key"===o)return n.sort(((e,t)=>{const r=l||"";return"ascending"===a?e[r]-t[r]:t[r]-e[r]}));const{sortFunction:i=""}=e;return r[i](n)},e.twoDigitPad=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
var vuelib=function(e,t){"use strict";function r(e,t,r,n,l,a,o){try{var i=e[a](o),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,l)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(l,a){var o=e.apply(t,n);function i(e){r(o,l,a,i,s,"next",e)}function s(e){r(o,l,a,i,s,"throw",e)}i(void 0)}))}}function l(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var o=t.defineComponent({name:"Scroller",components:{},props:{data:{type:Array,default:function(){return[]}},orientation:{type:String,default:"vertical"},numcols:{type:Number,default:4},numrows:{type:Number,default:4},gap:{type:Number,default:10},contentpadding:{type:Number,default:10},cellheight:{type:Number,default:100},cellwidth:{type:Number,default:100},cellsquared:{type:Boolean,default:!0},wheelscrollspeed:{type:Number,default:12}},setup:function(e,r){var a,o,i,s=t.ref(e.cellwidth+"px"),c=t.ref(e.cellheight+"px"),u=t.ref("100%"),f=null,d=t.ref(null),p=0,h=0,m=!1,v=!1,g=0,y=0,x=0,w=!1,b=200,M=!1,S=t.ref(e.data);function k(){"vertical"===e.orientation?f.scrollTop+=p:f.scrollLeft+=p,p*=.97,Math.abs(p)>.5&&(h=requestAnimationFrame(k))}function L(){cancelAnimationFrame(h)}function T(){L(),h=requestAnimationFrame(k)}function E(){var e,t=E.width;return void 0===t&&((e=document.createElement("div")).innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',e=e.firstChild,document.body.appendChild(e),t=E.width=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),t}function D(t){S.value=[].concat(l(S.value),l(t)),S.value.splice(0,t.length);var r=document.querySelector(".scroller-cell");r.offsetHeight,e.gap;var n=r.offsetWidth+e.gap,a=0;if("vertical"===e.orientation)parseInt(t.length/e.numcols),a=y,f.scrollTop=a,i=a-(y-i);else{var o=parseInt(t.length/e.numrows);a=y-n*o,f.scrollLeft=a,i=a-(y-i)}setTimeout((function(){M=!1}),100)}function H(t){S.value=[].concat(l(t),l(S.value)),S.value.splice(S.value.length-t.length,S.value.length-1);var r=document.querySelector(".scroller-cell");r.offsetHeight,e.gap;var n=r.offsetWidth+e.gap,a=0;if("vertical"===e.orientation)parseInt(t.length/e.numcols),a=y,f.scrollTop=a,i=a-(y-i);else{var o=parseInt(t.length/e.numrows);a=y+n*o,f.scrollLeft=a,i=a-(y-i)}setTimeout((function(){M=!1}),100)}function W(e,t,r){return _.apply(this,arguments)}function _(){return(_=n(regeneratorRuntime.mark((function t(n,l,a){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:1===n&&("vertical"===e.orientation?f.scrollTop+f.offsetHeight>=f.scrollHeight-b&&(M||(M=!0,r.emit("on-update-data-next",(function(e){D(e)})))):(f.scrollLeft+f.offsetWidth>=f.scrollWidth-b||f.scrollLeft===f.scrollWidth-f.clientWidth)&&(M||(M=!0,r.emit("on-update-data-next",(function(e){setTimeout((function(){D(e)}),10)}))))),-1===n&&("vertical"===e.orientation?f.scrollTop<b&&(M||(M=!0,r.emit("on-update-data-previous",(function(e){H(e)})))):f.scrollLeft<b&&(M||(M=!0,r.emit("on-update-data-previous",(function(e){setTimeout((function(){H(e)}),10)})))));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function z(){console.log("Initialize"),f=document.querySelector(".scroller"),x=E();var t=0,n=0,l=0;if("vertical"===e.orientation)t=(e.numcols-1)*e.gap+x,f.offsetWidth,n=(f.offsetWidth-t-2*e.contentpadding)/e.numcols,s.value=String(n+"%"),u.value=String(n+"px"),e.cellsquared&&(l=(f.clientWidth-t-2*e.contentpadding)/e.numcols,c.value=l+"px");else{t=(e.numrows-1)*e.gap+x,f.offsetHeight,l=(f.offsetHeight-t-2*e.contentpadding)/e.numrows;var d=(f.offsetHeight-t-2*e.contentpadding)/e.numrows;c.value=String(l+"px"),u.value=String(d+"px"),e.cellsquared&&(n=l,s.value=n+"px")}f.addEventListener("mousedown",(function(t){m=!0,f.classList.add("active"),"vertical"===e.orientation?(a=t.pageY-f.offsetTop,o=t.pageY,i=f.scrollTop,g=t.clientY):(a=t.pageX-f.offsetLeft,o=t.pageX,i=f.scrollLeft,g=t.clientX),L()})),f.addEventListener("mouseleave",(function(){m=!1,f.classList.remove("active")})),f.addEventListener("mouseup",(function(t){m=!1,v=!1,f.classList.remove("active"),T();var n=0;n="vertical"===e.orientation?o-t.pageY:o-t.pageX,Math.abs(n)>10&&r.emit("on-scroll")})),f.addEventListener("mousemove",(function(t){if(m){t.preventDefault(),v=!0;var r=0,n=0;"vertical"===e.orientation?(r=2*(t.pageY-f.offsetTop-a),n=f.scrollTop,f.scrollTop=i-r,p=f.scrollTop-n,f.scrollTop=i-r):(r=2*(t.pageX-f.offsetLeft-a),n=f.scrollLeft,f.scrollLeft=i-r,p=f.scrollLeft-n,f.scrollLeft=i-r)}})),f.addEventListener("wheel",(function(t){if(L(),"vertical"===e.orientation){var n=Math.sign(t.deltaY)*e.wheelscrollspeed,l=f.scrollTop;f.scrollTop+=n,p=f.scrollTop-l}else{var a=Math.sign(t.deltaY)*e.wheelscrollspeed,o=f.scrollLeft;if(f.scrollLeft+=a,p=f.scrollLeft-o,f.scrollLeft===f.scrollWidth-f.clientWidth){console.log("detectScrollEdges");W(parseInt(0/Math.abs(0)),!1,t)}}r.emit("on-scroll"),T()})),f.addEventListener("scroll",(function(t){var r=0;if("vertical"===e.orientation){var n=f.scrollTop;r=n-y,W(parseInt(r/Math.abs(r)),!1,t),y=n}else{var l=f.scrollLeft;r=l-y,W(parseInt(r/Math.abs(r)),!1,t),y=l}}))}function A(e){z()}return t.onMounted((function(){window.addEventListener("resize",A),z()})),{cellW:s,cellH:c,cellFlexBasis:u,scroller:f,cellRef:d,isMouseDown:m,startPos:a,startscrollPos:o,movescrollPos:i,scrollerMoving:v,previousPos:g,scrollbarWidth:x,justLoaded:w,scrollLoadingOffset:b,cellsdata:S}}}),i={class:"cell-text"};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===r&&n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.scroller[data-v-0f0a8e61] {\r\n height: 500px;\r\n background: #eaeaea;\n}\n.vertical-scroller[data-v-0f0a8e61] {\r\n overflow-y: auto;\r\n overflow-x: hidden;\n}\n.horizontal-scroller[data-v-0f0a8e61] {\r\n overflow-y: hidden;\r\n overflow-x: auto;\n}\n.scroller-container[data-v-0f0a8e61] {\r\n -ms-flex-line-pack: start;\r\n -webkit-align-content: flex-start;\r\n align-content: flex-start;\r\n -webkit-flex-direction: row;\r\n -ms-flex-direction: row;\r\n flex-direction: row;\r\n -webkit-flex-wrap: wrap;\r\n -ms-flex-wrap: wrap;\r\n flex-wrap: wrap;\n}\n.vertical-container[data-v-0f0a8e61] {\r\n display: -webkit-flex;\r\n display: -ms-flexbox;\r\n display: flex;\n}\n.horizontal-container[data-v-0f0a8e61] {\r\n display: -webkit-inline-flex;\r\n display: -ms-inline-flexbox;\r\n display: inline-flex;\r\n -webkit-flex-flow: column wrap !important;\r\n -ms-flex-flow: column wrap !important;\r\n flex-flow: column wrap !important;\r\n height: inherit !important;\r\n -ms-flex-line-pack: start;\r\n -webkit-align-content: flex-start;\r\n align-content: flex-start;\r\n width: 100%;\n}\n.scroller-cell[data-v-0f0a8e61] {\r\n\r\n background: #b6b6b6;\r\n\r\n -webkit-flex: inherit;\r\n\r\n -ms-flex: inherit;\r\n\r\n flex: inherit;\r\n -webkit-flex-grow: 0;\r\n -ms-flex-positive: 0;\r\n flex-grow: 0;\r\n -ms-flex-negative: 0;\r\n -webkit-flex-shrink: 0;\r\n flex-shrink: 0;\r\n -ms-flex-preferred-size: 25%;\r\n -webkit-flex-basis: 25%;\r\n flex-basis: 25%;\r\n\r\n /* for theme */\r\n background: #ffffff;\r\n box-shadow: 2px 2px 2px 2px rgb(221 221 221 / 60%);\r\n border-radius: 5px;\n}\n.vertical-cell[data-v-0f0a8e61] {\r\n display: inline-block;\r\n height: 50px;\n}\n.horizontal-cell[data-v-0f0a8e61] {\r\n display: -webkit-inline-flex;\r\n display: -ms-inline-flexbox;\r\n display: inline-flex;\r\n height: unset !important;\r\n width: 90px;\n}\n.dummycell[data-v-0f0a8e61] {\r\n height: 20px;\n}\n.cell-text[data-v-0f0a8e61] {\r\n width: 100%;\r\n text-align: center;\r\n font-size: 18pt;\n}\r\n"),o.render=function(e,r,n,l,a,o){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["scroller","vertical"===e.orientation?"vertical-scroller":"horizontal-scroller"])},[t.createElementVNode("div",{class:t.normalizeClass(["scroller-container","vertical"===e.orientation?"vertical-container":"horizontal-container"]),style:t.normalizeStyle([{gap:e.gap+"px"},{padding:e.contentpadding+"px"}])},[t.renderSlot(e.$slots,"content",{},(function(){return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.cellsdata,(function(r){return t.openBlock(),t.createElementBlock("div",{ref_for:!0,ref:"cellRef",key:r.id,class:t.normalizeClass(["scroller-cell","vertical"===e.orientation?"vertical-cell":"horizontal-cell"]),style:t.normalizeStyle({"flex-basis":e.cellFlexBasis,height:e.cellH,width:e.cellW})},[t.renderSlot(e.$slots,"cell",{},(function(){return[t.createElementVNode("span",i,t.toDisplayString(r.id),1)]}))],6)})),128))]}))],6)],2)},o.__scopeId="data-v-0f0a8e61";const s={install(e){var t,r;t=e,(r=o)&&t.component(r.name||"",r)}};var c=Object.freeze({__proto__:null,Scroller:s});const u=(e,t)=>{var r=new Date(e);return r.setDate(r.getDate()+t),r},f=(e,t)=>e.getTime()-t.getTime(),d=e=>e<10?"0"+String(e):String(e),p=(e,t)=>{t||(t="M/d/yyyy");var r=e.getDate(),n=e.getMonth(),l=e.getFullYear(),a=e.getHours(),o=e.getMinutes(),i=e.getSeconds(),s=e.getMilliseconds(),c=a%12,u=d(c),f=d(a),p=d(o),h=d(i),m=a<12?"AM":"PM",v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.getDay()],g=v.substring(0,3),y=d(r),x=n+1,w=d(x),b=["January","February","March","April","May","June","July","August","September","October","November","December"][n],M=b.substring(0,3),S=l+"",k=S.substring(2,2);return t.indexOf("MMM")<=-1&&(t=t.replace("MM",w).replace("M",String(x))),(t=t.replace("hh",u).replace("h",String(c)).replace("HH",f).replace("H",String(a)).replace("mm",p).replace("m",String(o)).replace("ss",h).replace("s",String(i)).replace("S",String(s)).replace("dd",y).replace("d",String(r)).replace("EEEE",v).replace("EEE",g).replace("yyyy",S).replace("yy",k).replace("aaa",m)).indexOf("MMM")>-1&&(t=t.replace("MMMM",b).replace("MMM",M)),t},h={install(e){Object.entries(c).forEach((([t,r])=>{e.component(t,r)}))}};return e.Scroller=s,e.addDays=u,e.checkIfWeekendDay=e=>{var t=e.getDay();return 6===t||0===t},e.daysMatch=(e,t)=>e.getDate()==t.getDate()&&e.getMonth()==t.getMonth()&&e.getFullYear()==t.getFullYear(),e.default=h,e.enumerateDaysBetweenDates=(e,t)=>{var r,n=[];let l;l=t,(r=e).setHours(0,0,0,0),l.setHours(0,0,0,0),n.push(r);var a=r;if(f(r,l)<0)for(;f(a,l)<0;)a=u(a,1),n.push(a);return n},e.enumerateStringDaysBetweenDates=(e,t)=>{var r,n=[];let l;l=t,(r=e).setHours(0,0,0,0),l.setHours(0,0,0,0),n.push(p(r,"dd-MMM-yyyy"));var a=r;if(f(r,l)<0)for(;f(a,l)<0;)a=u(a,1),n.push(p(a,"dd-MMM-yyyy"));return n.push(p(l,"dd-MMM-yyyy")),n},e.filterUtility=(e,t,r)=>{let n=[];return Object.values(e).forEach((e=>{const{filterKey:l,type:a,matchType:o}=e;n=n||t[e.dataSource];const i=e.value||[];if("key"!==a){const e=r[i];if(!e)return;n=n.filter((t=>e(t)))}n=n.filter((t=>{if("exact"===o)return i.includes(t[l]);if("between_range"===o){const r=[],n=[];return e.options.filter((e=>i.includes(e.value))).forEach((e=>{r.push(e.startKey||0),n.push(e.endKey||0)})),t[l]>=Math.min(...r)&&t[l]<=Math.max(...n)}return"less_than"===o?t[l]<Math.max(...i):"less_than_or_equal"===o?t[l]<=Math.max(...i):"greater_than_or_equal"===o?t[l]>=Math.min(...i):"greater_than"===o?t[l]>Math.min(...i):t[l]===i}))})),n},e.formatDate=p,e.getDiff=f,e.sortUtility=(e,t,r)=>{const n=t[e.dataSource],{sortingKey:l,ordering:a,type:o}=e;if("key"===o)return n.sort(((e,t)=>{const r=l||"";return"ascending"===a?e[r]-t[r]:t[r]-e[r]}));const{sortFunction:i=""}=e;return r[i](n)},e.twoDigitPad=d,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);

@@ -574,3 +574,3 @@ import { defineComponent, ref, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, toDisplayString } from 'vue';

const Plugin = {
const Plugin$1 = {
install(vue) {

@@ -585,3 +585,3 @@ registerComponent(vue, script);

__proto__: null,
Scroller: Plugin
Scroller: Plugin$1
});

@@ -840,34 +840,11 @@

const install = (instance) => {
for (const componentKey in components) {
instance.use(components[componentKey]);
/* eslint-disable */
const Plugin = {
install(app) {
Object.entries(components).forEach(([componentName, component]) => {
app.component(componentName, component);
});
}
};
/* export interface ColoredTextOptions {
color: string
}
import { App as Application, Plugin } from "vue";
import { setVueInstance } from "./utils/config/index";
import * as components from './components';
const Plugin: Plugin = {
install(app: Application, options: ColoredTextOptions) {
Object.entries(components).forEach(([componentName, component]) => {
app.component(componentName, component);
});
}
}
// Default export is library as a whole, registered via Vue.use()
export default Plugin;
// Allow component use individually
export * from './components';
export * from './utilities'; */
export { Plugin as Scroller, addDays, checkIfWeekendDay, daysMatch, install as default, enumerateDaysBetweenDates, enumerateStringDaysBetweenDates, filterUtility, formatDate, getDiff, sortUtility, twoDigitPad };
export { Plugin$1 as Scroller, addDays, checkIfWeekendDay, daysMatch, Plugin as default, enumerateDaysBetweenDates, enumerateStringDaysBetweenDates, filterUtility, formatDate, getDiff, sortUtility, twoDigitPad };
{
"name": "chronocraft-scroller-vue",
"version": "0.0.1",
"version": "0.0.2",
"main": "dist/cjs/index.js",

@@ -5,0 +5,0 @@ "module": "dist/esm/index.js",

/* eslint-disable */
import { App as Application, Plugin } from "vue";
/* import { App as Application, Plugin } from "vue";
import * as components from "./components/index";

@@ -18,13 +18,5 @@ import { setVueInstance } from "./utils/config/index";

export * from "./components";
export * from './utilities';
export * from './utilities'; */
/* export interface ColoredTextOptions {
color: string
}
import { App as Application, Plugin } from "vue";
import { setVueInstance } from "./utils/config/index";
import * as components from './components';

@@ -34,3 +26,3 @@

const Plugin: Plugin = {
install(app: Application, options: ColoredTextOptions) {
install(app: Application) {
Object.entries(components).forEach(([componentName, component]) => {

@@ -48,2 +40,2 @@ app.component(componentName, component);

export * from './components';
export * from './utilities'; */
export * from './utilities';
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc