🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@ophiuchus/grid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ophiuchus/grid - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+1
-1
dist/index.es.js
var t=Object.defineProperty,e=Object.defineProperties,n=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,s=(e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;
/*!
* @ophiuchus/grid v1.0.0 Tue Aug 31 2021 19:30:44 GMT+0800 (中国标准时间)
* @ophiuchus/grid v1.0.0 Sun Sep 26 2021 14:37:03 GMT+0800 (中国标准时间)
* (c) 2021 @mws_ophiuchus

@@ -5,0 +5,0 @@ * Released under the MIT License.

var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e))
/*!
* @ophiuchus/grid v1.0.0 Tue Aug 31 2021 19:30:44 GMT+0800 (中国标准时间)
* @ophiuchus/grid v1.0.0 Sun Sep 26 2021 14:37:03 GMT+0800 (中国标准时间)
* (c) 2021 @mws_ophiuchus
* Released under the MIT License.
*/;!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("@ophiuchus/info"),require("@ophiuchus/icon")):"function"==typeof define&&define.amd?define(["exports","vue","@ophiuchus/info","@ophiuchus/icon"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SFGrid={},t.Vue,t.SFInfo,t.SFIcon)}(this,(function(t,e,n,r){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=i(e),s=i(n),c=i(r);function a(t,e){return e?"string"==typeof e?` ${t}--${e}`:Array.isArray(e)?e.reduce(((e,n)=>e+a(t,n)),""):Object.keys(e).reduce(((n,r)=>n+(e[r]?a(t,r):"")),""):""}function l(t){return function(e,n){return e&&"string"!=typeof e&&(n=e,e=""),`${e=e?`${t}__${e}`:t}${a(e,n)}`}}const u=/-(\w)/g;const d={methods:{slots(t="default",e){const{$slots:n,$scopedSlots:r}=this,i=r[t];return i?i(e):n[t]}}};function p(t){const{name:e}=this;t.component(e,this),t.component(`-${e}`.replace(u,((t,e)=>e.toUpperCase())),this)}function h(t){return{functional:!0,props:t.props,model:t.model,render:(e,n)=>t(e,n.props,function(t){const e=t.scopedSlots||t.data.scopedSlots||{},n=t.slots();return Object.keys(n).forEach((t=>{e[t]||(e[t]=()=>n[t])})),e}(n),n)}}function f(t){return function(e){return"function"==typeof e&&(e=h(e)),e.functional||(e.mixins=e.mixins||[],e.mixins.push(d)),e.name=t,e.install=p,e}}function m(t){return[f(t="sf-"+t),l(t)]}function g(t){if(null!=t)return function(t){return/^\d+(\.\d+)?$/.test(t)}(t=String(t))?`${t}px`:t}o.default.prototype.$isServer;const b="sf-hairline",_=`${b}--top`;const[y,x]=m("grid");var S,v=y({mixins:[(S="sfGrid",{provide(){return{[S]:this}},data:()=>({children:[]})})],props:{square:Boolean,gutter:[Number,String],iconSize:[Number,String],direction:String,clickable:Boolean,columnNum:{type:[Number,String],default:4},center:{type:Boolean,default:!0},border:{type:Boolean,default:!0}},computed:{style(){const{gutter:t}=this;if(t)return{paddingLeft:g(t)}}},render(){return(0,arguments[0])("div",{style:this.style,class:[x(),{[_]:this.border&&!this.gutter}]},[this.slots()])}});const O={url:String,replace:Boolean,to:[String,Object]},[P,$]=m("grid-item");var w=P({mixins:[function(t,e={}){const n=e.indexKey||"index";return{inject:{[t]:{default:null}},computed:{parent(){return this.disableBindRelation?null:this[t]},[n](){return this.bindRelation(),this.parent?this.parent.children.indexOf(this):null}},watch:{disableBindRelation(t){t||this.bindRelation()}},mounted(){this.bindRelation()},beforeDestroy(){this.parent&&(this.parent.children=this.parent.children.filter((t=>t!==this)))},methods:{bindRelation(){if(!this.parent||-1!==this.parent.children.indexOf(this))return;const t=[...this.parent.children,this];!function(t,e){const{componentOptions:n}=e.$vnode;if(!n||!n.children)return;const r=function(t){const e=[];return function t(n){n.forEach((n=>{e.push(n),n.componentInstance&&t(n.componentInstance.$children.map((t=>t.$vnode))),n.children&&t(n.children)}))}(t),e}(n.children);t.sort(((t,e)=>r.indexOf(t.$vnode)-r.indexOf(e.$vnode)))}(t,this.parent),this.parent.children=t}}}}("sfGrid")],props:__spreadProps(__spreadValues({},O),{dot:Boolean,text:String,icon:String,iconPrefix:String,info:[Number,String],badge:[Number,String]}),computed:{style(){const{square:t,gutter:e,columnNum:n}=this.parent,r=100/n+"%",i={flexBasis:r};if(t)i.paddingTop=r;else if(e){const t=g(e);i.paddingRight=t,this.index>=n&&(i.marginTop=t)}return i},contentStyle(){const{square:t,gutter:e}=this.parent;if(t&&e){const t=g(e);return{right:t,bottom:t,height:"auto"}}}},methods:{onClick(t){this.$emit("click",t),function(t,e){const{to:n,url:r,replace:i}=e;if(n&&t){const e=t[i?"replace":"push"](n);e&&e.catch&&e.catch((t=>{if(t&&!function(t){return"NavigationDuplicated"===t.name||t.message&&-1!==t.message.indexOf("redundant navigation")}(t))throw t}))}else r&&(i?location.replace(r):location.href=r)}(this.$router,this)},genIcon(){var t;const e=this.$createElement,n=this.slots("icon"),r=null!=(t=this.badge)?t:this.info;return n?e("div",{class:$("icon-wrapper")},[n,e(s.default,{attrs:{dot:this.dot,info:r}})]):this.icon?e(c.default,{attrs:{name:this.icon,dot:this.dot,badge:r,size:this.parent.iconSize,classPrefix:this.iconPrefix},class:$("icon")}):void 0},getText(){const t=this.$createElement,e=this.slots("text");return e||(this.text?t("span",{class:$("text")},[this.text]):void 0)},genContent(){const t=this.slots();return t||[this.genIcon(),this.getText()]}},render(){const t=arguments[0],{center:e,border:n,square:r,gutter:i,direction:o,clickable:s}=this.parent;return t("div",{class:[$({square:r})],style:this.style},[t("div",{style:this.contentStyle,attrs:{role:s?"button":null,tabindex:s?0:null},class:[$("content",[o,{center:e,square:r,clickable:s,surround:n&&i}]),{[b]:n}],on:{click:this.onClick}},[this.genContent()])])}});var j={install:()=>{[v,w].forEach((t=>{o.default.use(t)}))}};t.Grid=v,t.GridItem=w,t.default=j,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"}));
{
"name": "@ophiuchus/grid",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/index.umd.js",

@@ -12,4 +12,4 @@ "module": "dist/index.es.js",

"dependencies": {
"@ophiuchus/icon": "^1.0.0",
"@ophiuchus/info": "^1.0.0"
"@ophiuchus/icon": "^1.0.2",
"@ophiuchus/info": "^1.0.1"
},

@@ -23,3 +23,3 @@ "scripts": {

"devDependencies": {
"@ophiuchus/style": "^1.0.0"
"@ophiuchus/style": "^1.0.1"
},

@@ -38,3 +38,4 @@ "keywords": [

"author": "songbug1024",
"license": "MIT"
"license": "MIT",
"gitHead": "5e2ba4f2a82b1292bb7aa279c905fa2b47f20ebf"
}