first commit

This commit is contained in:
kicap1992 committed 2022-08-22 00:09:23 +08:00
commit 71dc1bcca3
364 files changed
+148396

No files matched your search

+1
View File
@@ -0,0 +1 @@
.popover-select,.popover-select-tags{font-size:14px;line-height:1.42857143}.popover-select-wrapper{position:relative}.popover-select{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:366px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;line-break:auto}.popover-select.top{margin-top:-10px}.popover-select.right{margin-left:10px}.popover-select.bottom{margin-top:10px}.popover-select.left{margin-left:-10px}.popover-select-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-select-content{padding:9px 14px}.popover-select>.arrow,.popover-select>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover-select>.arrow{border-width:11px}.popover-select>.arrow:after{content:"";border-width:10px}.popover-select.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:transparent;border-bottom-width:0}.popover-select.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover-select.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover-select.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover-select.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover-select.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover-select.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover-select.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.popover-select-tags{cursor:pointer;list-style-type:none;display:block;width:100%;height:37px;padding:0;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.popover-select-tags.focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.popover-select-tags .tag{display:block;float:left;margin-left:10px;background-color:#e74c3c;color:#fff;padding:5px 10px 5px 5px;margin-top:3px;border-color:#d43f3a;vertical-align:middle;-webkit-transition:.25s linear;transition:.25s linear;height:30px}.popover-select-tags .tag:hover{background-color:#ec7063;border-color:#ec7063}.popover-select-tags .tag .popSelect-close{display:none}.popover-select-tags .tag:hover .popSelect-close{display:block}.popSelect-close,.popSelect-close:active,.popSelect-close:hover{float:right;font-size:21px;font-weight:700;line-height:1;padding-left:3px;color:#fff;opacity:.8}.popSelect-close:active,.popSelect-close:hover{cursor:pointer;opacity:1}textarea.popover-select-textarea{width:100%;height:29px;padding:.3em .5em;position:absolute;left:-99999px}.popover-select-tags .placeholder{display:block;float:left;margin-left:10px}.placeholder input{vertical-align:inherit;border:0;outline:0;padding:0;margin:3px 0 0;cursor:text;font-family:inherit;font-weight:inherit;font-size:inherit;font-style:inherit;box-shadow:none;background:0 0;width:5px;height:30px}.popover-select-list{list-style-type:none;overflow:hidden;padding:10px;margin-bottom:0}.popover-select-list li{cursor:pointer;text-align:center;float:left;padding:10px;background-color:#e74c3c;border-color:#d43f3a;margin:5px;-webkit-transition:.5s all}.popover-select-list li:hover{color:#fff;background-color:#ec7063;border-color:#ec7063}.popover-select-list li.disabled{pointer-events:none;opacity:.5}.placeholder-text{position:absolute;top:9px;left:15px;color:#d3d3d3}
+9
View File
@@ -0,0 +1,9 @@
/*
* popselect - v0.1.14
* Replaces traditional <select> with a options from popover
* http://jquer.in/popselect
*
* Made by Jay Kanakiya
* Under MIT License
*/
!function(a,b,c){"use strict";function d(b,c){this.element=b,this.settings=a.extend({},o,c),this._defaults=o,this._name=n,this.init()}function e(a,b){for(var c in b)a=a.replace(new RegExp("{"+c+"}","g"),b[c]);return a}function f(a){return"."+a}function g(a){return a?'<div class="{'+a+'}"></div>':'<div class="{wrapper}"></div>'}function h(a){for(var b="",c=0;c<a.length;c++)a[c].selected&&(b+=j(a[c].val,a[c].text));return b}function i(a,b){return e('<div class="{tagWrapper}"><textarea class="{selectTextarea}"></textarea><ul class="{selectTags}">{tags}</ul><div class="{placeholderText}">{text}</div></div>',{tags:h(b),text:a,placeholderText:p.placeholderText,tagWrapper:p.tagWrapper,selectTextarea:p.selectTextarea,selectTags:p.selectTags})}function j(a,b){return e('<li class="{tag}" data-value="{val}" data-text="{text}"><span class="{popoverClose}">&times;</span>{text}</li>',{text:b,val:a,tag:p.tag,popoverClose:p.popoverClose})}function k(a,b){return e('<li data-value="{val}" data-text="{text}">{text}</li>',{val:a,text:b})}function l(){return e('<li class="{placeholder}"><div><input type="text" readonly="true"></div></li>',{placeholder:p.placeholder})}function m(a,b){return e('<div class="{popoverSelect} {top}">'+(b.showTitle?'<h3 class="{selectTitle}">{title}</h3>':"")+'<div class="{popoverBody}"><ul class="{selectList}">{list}</ul></div><div class="{arrow}"></div></div>',{title:b.title,list:a,arrow:p.arrow,popoverSelect:p.popoverSelect,popoverBody:p.popoverBody,selectList:p.selectList,top:b.position,selectTitle:p.selectTitle})}var n="popSelect",o={position:"top",showTitle:!0,autoIncrease:!0,title:"Select Multiple Options",debug:!1,maxAllowed:0,placeholderText:"Click to Add Values",autofocus:!1},p={tag:"tag",arrow:"arrow",selectWrapper:"popover-select-wrapper",tagWrapper:"popover-tag-wrapper",popoverSelect:"popover-select",popoverBody:"popover-select-body",selectTextarea:"popover-select-textarea",selectTags:"popover-select-tags",popoverClose:"popSelect-close",selectList:"popover-select-list",popoverDisabled:"disabled",placeholder:"placeholder",placeholderInput:"placeholder input",placeholderText:"placeholder-text",selectTitle:"popover-select-title",top:"top"},q={popoverGenerated:"PopSelect Code Generated",closeClicked:"Close button clicked",noElem:"No element to be removed",unSupported:"Not Supported",posChanged:"Position changed"},r={option:"option",blur:"blur",click:"click",mousedown:"mousedown",li:"li",attrVal:"data-value",attrText:"data-text",body:"BODY"};a.extend(d.prototype,{init:function(){var b=this;this.$elem=a(this.element),this.$options=this.$elem.children(r.option).map(function(b,c){return{val:a(c).val(),text:a(c).text(),selected:a(c).attr("selected")}}),this.$elem.wrap(e(g(),{wrapper:p.selectWrapper}));var c=this.getPosition(this.$elem);this.elemPos=c,this.$elem.parent(f(p.selectWrapper)).css({width:this.settings.width||c.width,height:c.height});var d=this.generatePopover(this.$options);b.log(q.popoverGenerated,d),this.$elem.after(d),this.$popover=this.$elem.next(f(p.popoverSelect)),this.$popover.css({top:0,left:0}),this.$elem.after(i(this.settings.placeholderText,this.$options)),this.$tagWrapper=this.$elem.next(f(p.tagWrapper)),this.baseHeight=this.$tagWrapper.height(),this.$inputTagField=this.$tagWrapper.find(f(p.selectTextarea)),this.$inputTagField.on(r.blur,function(){b.$popover.hide()}),this.$tags=this.$tagWrapper.find(f(p.selectTags)),this.$tags.on(r.click,this.initializePopover.bind(this)),this.$tags.next(f(p.placeholderText)).on(r.click,this.initializePopover.bind(this)),this.$tags.on(r.click,f(p.popoverClose),function(){b.inputToPopover(a(this))}),this.$popover.find(f(p.selectList)).on(r.mousedown,function(a){a.preventDefault()}).on(r.click,r.li,function(){b.popoverToInput(a(this))}),this.$elem.hide(),this.checkNumberOfTags(),this.changeSize(),this.$elem.trigger("popselect:init"),this.settings.autofocus&&this.initializePopover()},inputToPopover:function(a){var b=a.parent();this.log(q.closeClicked,b);var c=b.attr(r.attrVal),d=b.attr(r.attrText);this.appendToPopup(c,d),b.remove(),this.setPlaceholder(),this.focus(),this.changeSize(),this.checkNumberOfTags(),this.$elem.trigger("popselect:remove",[c,d])},enablePopover:function(){this.$popover.find(f(p.selectList)+" li").removeClass(p.popoverDisabled)},disablePopover:function(){this.$popover.find(f(p.selectList)+" li").addClass(p.popoverDisabled)},checkNumberOfTags:function(){var a=this.$tags.find(f(p.tag)).length;0===a?this.enablePlaceHolderText():this.disablePlaceHolderText(),0!==this.settings.maxAllowed&&(this.settings.maxAllowed>a?this.enablePopover():this.disablePopover()),this.syncWithSelect()},popoverToInput:function(a){var b=a.attr(r.attrVal),c=a.text(),d=j(b,c);this.$tags.append(d),a.remove(),this.setPlaceholder(),this.focus(),this.popoverShow(),this.changePosition(),this.changeSize(),this.checkNumberOfTags(),this.$elem.trigger("popselect:add",[b,c])},popoverShow:function(){this.$popover.find(f(p.selectList)+" li").length?this.$popoverLine truncated