From 6c05cf26cb628cb7a22c6f246b431eaad640d2a8 Mon Sep 17 00:00:00 2001 From: BcRikko Date: Sat, 16 Feb 2019 21:23:04 +0900 Subject: [PATCH 01/28] docs(storybook): rename docs to story i'd like to use docs as demo site directory --- .storybook/config.js | 2 +- package.json | 14 +++++++------- {docs => story}/avatars.stories.js | 0 {docs => story}/badge.stories.js | 0 {docs => story}/balloons.stories.js | 0 {docs => story}/buttons.stories.js | 0 {docs => story}/containers.stories.js | 0 {docs => story}/dialogs.stories.js | 0 {docs => story}/icons.stories.js | 0 {docs => story}/inputs.stories.js | 0 {docs => story}/lists.stories.js | 0 {docs => story}/progress.stories.js | 0 {docs => story}/select.stories.js | 0 {docs => story}/table.stories.js | 0 {docs => story}/text.stories.js | 0 {docs => story}/textarea.stories.js | 0 16 files changed, 8 insertions(+), 8 deletions(-) rename {docs => story}/avatars.stories.js (100%) rename {docs => story}/badge.stories.js (100%) rename {docs => story}/balloons.stories.js (100%) rename {docs => story}/buttons.stories.js (100%) rename {docs => story}/containers.stories.js (100%) rename {docs => story}/dialogs.stories.js (100%) rename {docs => story}/icons.stories.js (100%) rename {docs => story}/inputs.stories.js (100%) rename {docs => story}/lists.stories.js (100%) rename {docs => story}/progress.stories.js (100%) rename {docs => story}/select.stories.js (100%) rename {docs => story}/table.stories.js (100%) rename {docs => story}/text.stories.js (100%) rename {docs => story}/textarea.stories.js (100%) diff --git a/.storybook/config.js b/.storybook/config.js index 8abe709..1cfb2cf 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -9,7 +9,7 @@ import { withBackgrounds } from '@storybook/addon-backgrounds'; import '../scss/nes.scss'; // eslint-disable-line import/no-unresolved // automatically import all files ending in *.stories.js -const req = require.context('../docs', true, /.stories.js$/); +const req = require.context('../story', true, /.stories.js$/); function loadStories() { req.keys().forEach(filename => req(filename)); } diff --git a/package.json b/package.json index 2fd0d00..bc29a19 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "NES.css is NES-style CSS Framework.", "scripts": { "watch": "npm run build:sass -- --watch", - "//": "Build task", + "// Build task": "", "build": "run-p build:core build:main", "build:core": "npm run build:sass-core && npm run build:autoprefix-core && npm run build:cleancss-core", "build:main": "npm run build:sass && npm run build:autoprefix && npm run build:cleancss", @@ -11,15 +11,15 @@ "prebuild:stylelint": "npm run stylelint -- --fix", "prebuild:clean": "rimraf css", "postbuild": "npm run build:storybook", - "//": "For nes.css", + "// For nes.css": "", "build:sass": "node-sass --output-style expanded --source-map true --functions scripts/scssFunctions.js scss/nes.scss css/nes.css", "build:autoprefix": "postcss --use autoprefixer --map false --output css/nes.css css/nes.css", "build:cleancss": "cleancss -o css/nes.min.css css/nes.css", - "//": "For nes-core.css", + "// For nes-core.css": "", "build:sass-core": "node-sass --output-style expanded --source-map true --functions scripts/scssFunctions.js scss/nes-core.scss css/nes-core.css", "build:autoprefix-core": "postcss --use autoprefixer --map false --output css/nes-core.css css/nes-core.css", "build:cleancss-core": "cleancss -o css/nes-core.min.css css/nes-core.css", - "//": "Misc", + "// Misc": "", "stylelint": "stylelint scss/**/*.scss", "storybook": "start-storybook -p 6006", "build:storybook": "build-storybook", @@ -111,7 +111,7 @@ "npm run postbuild" ], "*.js": [ - "eslint '.storybook/**/*.js' 'docs/**/*.js'" + "eslint '.storybook/**/*.js' 'story/**/*.js'" ] }, "prettier": { @@ -148,14 +148,14 @@ "scss/at-rule-no-unknown": true }, "ignoreFiles": [ - "demo/lib/*" + "docs/*" ] }, "eslintConfig": { "extends": "airbnb-base" }, "eslintIgnore": [ - "demo/lib/*" + "docs/*" ], "config": { "commitizen": { diff --git a/docs/avatars.stories.js b/story/avatars.stories.js similarity index 100% rename from docs/avatars.stories.js rename to story/avatars.stories.js diff --git a/docs/badge.stories.js b/story/badge.stories.js similarity index 100% rename from docs/badge.stories.js rename to story/badge.stories.js diff --git a/docs/balloons.stories.js b/story/balloons.stories.js similarity index 100% rename from docs/balloons.stories.js rename to story/balloons.stories.js diff --git a/docs/buttons.stories.js b/story/buttons.stories.js similarity index 100% rename from docs/buttons.stories.js rename to story/buttons.stories.js diff --git a/docs/containers.stories.js b/story/containers.stories.js similarity index 100% rename from docs/containers.stories.js rename to story/containers.stories.js diff --git a/docs/dialogs.stories.js b/story/dialogs.stories.js similarity index 100% rename from docs/dialogs.stories.js rename to story/dialogs.stories.js diff --git a/docs/icons.stories.js b/story/icons.stories.js similarity index 100% rename from docs/icons.stories.js rename to story/icons.stories.js diff --git a/docs/inputs.stories.js b/story/inputs.stories.js similarity index 100% rename from docs/inputs.stories.js rename to story/inputs.stories.js diff --git a/docs/lists.stories.js b/story/lists.stories.js similarity index 100% rename from docs/lists.stories.js rename to story/lists.stories.js diff --git a/docs/progress.stories.js b/story/progress.stories.js similarity index 100% rename from docs/progress.stories.js rename to story/progress.stories.js diff --git a/docs/select.stories.js b/story/select.stories.js similarity index 100% rename from docs/select.stories.js rename to story/select.stories.js diff --git a/docs/table.stories.js b/story/table.stories.js similarity index 100% rename from docs/table.stories.js rename to story/table.stories.js diff --git a/docs/text.stories.js b/story/text.stories.js similarity index 100% rename from docs/text.stories.js rename to story/text.stories.js diff --git a/docs/textarea.stories.js b/story/textarea.stories.js similarity index 100% rename from docs/textarea.stories.js rename to story/textarea.stories.js From 2ed67b908990ce720f166b4e33e468c5984056ae Mon Sep 17 00:00:00 2001 From: BcRikko Date: Wed, 20 Feb 2019 20:32:33 +0900 Subject: [PATCH 02/28] docs: update demo page --- docs/index.html | 164 +++++ docs/lib/dialog-polyfill.css | 2 + docs/lib/dialog-polyfill.js | 4 + docs/lib/highlight-theme.css | 5 + docs/lib/highlight.js | 2 + docs/lib/vue.min.js | 6 + docs/script.js | 217 +++++++ docs/style.css | 153 +++++ index.html | 1085 ---------------------------------- 9 files changed, 553 insertions(+), 1085 deletions(-) create mode 100644 docs/index.html create mode 100644 docs/lib/dialog-polyfill.css create mode 100644 docs/lib/dialog-polyfill.js create mode 100644 docs/lib/highlight-theme.css create mode 100644 docs/lib/highlight.js create mode 100644 docs/lib/vue.min.js create mode 100644 docs/script.js create mode 100644 docs/style.css delete mode 100644 index.html diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..7d1d2da --- /dev/null +++ b/docs/index.html @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + NES.css - NES-style CSS Framework + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

NES.css

+

NES-style CSS Framework.

+
+
+ +

Fork me
on GitHub

+ +
+ + +
+

#About

+

NES.css is NES-style (8bit-like) CSS Framework.

+
+ + + +
+

#Installation

+

NES.css is available via either npm (preferred) or Yarn, or a CDN.

+

Please read README.md.

+
+ + +
+

#Usage

+

NES.css only provides components. You will need to define your own layout.

+ +
+
+

{{ sample.title | capitalize }}

+
+
+ +
+
+ +
{{ sample.code }}
+
+
+
+ +
+

#Members

+
+

Core Team Members

+

Here is core team members developing NES.css.

+ +
+ +
+
+
+

Core Team Emeriti

+

Here we honor some no-longer-active core team members.

+ +
+ +
+
+
+

Contributors

+ +
+
+ +
+

#Articles

+ +
+ +
+ + +
+ + + diff --git a/docs/lib/dialog-polyfill.css b/docs/lib/dialog-polyfill.css new file mode 100644 index 0000000..93b8f70 --- /dev/null +++ b/docs/lib/dialog-polyfill.css @@ -0,0 +1,2 @@ +/* Copyright (c) 2013 The Chromium Authors. All rights reserved. */ +._dialog_overlay,dialog+.backdrop{right:0;bottom:0;left:0;position:fixed}dialog{position:absolute;right:0;left:0;display:block;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;padding:1em;margin:auto;color:#000;background:#fff;border:solid}dialog:not([open]){display:none}dialog+.backdrop{top:0;background:rgba(0,0,0,.1)}._dialog_overlay{top:0}dialog.fixed{position:fixed;top:50%;transform:translate(0,-50%)} diff --git a/docs/lib/dialog-polyfill.js b/docs/lib/dialog-polyfill.js new file mode 100644 index 0000000..641563c --- /dev/null +++ b/docs/lib/dialog-polyfill.js @@ -0,0 +1,4 @@ +/** + * Copyright (c) 2013 The Chromium Authors. All rights reserved. + */ +!function(){var e=window.CustomEvent;function t(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement}return null}function o(e){e&&e.blur&&e!==document.body&&e.blur()}function i(e,t){for(var o=0;o=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"].map(function(e){return e+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(t.join(", "))}o(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new a(e)},r.registerDialog=function(e){e.showModal||r.forceRegisterDialog(e)},r.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(e){for(var t,i=0;t=e.removedNodes[i];++i)t instanceof Element&&("dialog"===t.localName&&o.push(t),o=o.concat(t.querySelectorAll("dialog")))}),o.length&&e(o)}))},r.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},r.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},r.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,o=0;e=this.pendingDialogStack[o];++o)e.updateZIndex(--t,--t),0===o&&(this.overlay.style.zIndex=--t);var i=this.pendingDialogStack[0];i?(i.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},r.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=t(e);){for(var o,i=0;o=this.pendingDialogStack[i];++i)if(o.dialog===e)return 0===i;e=e.parentElement}return!1},r.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),o(e.target),void 0!==this.forwardTab_)){var t=this.pendingDialogStack[0];return t.dialog.compareDocumentPosition(e.target)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e.target!==document.documentElement&&document.documentElement.focus()),!1}},r.DialogManager.prototype.handleKey_=function(t){if(this.forwardTab_=void 0,27===t.keyCode){t.preventDefault(),t.stopPropagation();var o=new e("cancel",{bubbles:!1,cancelable:!0}),i=this.pendingDialogStack[0];i&&i.dialog.dispatchEvent(o)&&i.dialog.close()}else 9===t.keyCode&&(this.forwardTab_=!t.shiftKey)},r.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()})},r.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},r.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!==t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},r.dm=new r.DialogManager,r.formSubmitter=null,r.useValue=null,void 0===window.HTMLDialogElement){var l=document.createElement("form");if(l.setAttribute("method","dialog"),"dialog"!==l.method){var s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(s){var d=s.get;s.get=function(){return n(this)?"dialog":d.call(this)};var c=s.set;s.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):c.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",s)}}document.addEventListener("click",function(e){if(r.formSubmitter=null,r.useValue=null,!e.defaultPrevented){var o=e.target;if(o&&n(o.form)){if(!("submit"===o.type&&["button","input"].indexOf(o.localName)>-1)){if("input"!==o.localName||"image"!==o.type)return;r.useValue=e.offsetX+","+e.offsetY}t(o)&&(r.formSubmitter=o)}}},!1);var u=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(!n(this))return u.call(this);var e=t(this);e&&e.close()},document.addEventListener("submit",function(e){var o=e.target;if(n(o)){e.preventDefault();var i=t(o);if(i){var a=r.formSubmitter;a&&a.form===o?i.close(r.useValue||a.value):i.close(),r.formSubmitter=null}}},!0)}r.forceRegisterDialog=r.forceRegisterDialog,r.registerDialog=r.registerDialog,"function"==typeof define&&"amd"in define?define(function(){return r}):"object"==typeof module&&"object"==typeof module.exports?module.exports=r:window.dialogPolyfill=r}(); diff --git a/docs/lib/highlight-theme.css b/docs/lib/highlight-theme.css new file mode 100644 index 0000000..1eab4f0 --- /dev/null +++ b/docs/lib/highlight-theme.css @@ -0,0 +1,5 @@ +/* + * Visual Studio 2015 dark style + * Author: Nicolas LLOBERA + */ + .hljs{display:block;overflow-x:auto;padding:.5em;background:#1E1E1E;color:#DCDCDC}.hljs-addition,.hljs-deletion{display:inline-block;width:100%}.hljs-keyword,.hljs-link,.hljs-literal,.hljs-name,.hljs-symbol{color:#569CD6}.hljs-link{text-decoration:underline}.hljs-built_in,.hljs-type{color:#4EC9B0}.hljs-class,.hljs-number{color:#B8D7A3}.hljs-meta-string,.hljs-string{color:#D69D85}.hljs-regexp,.hljs-template-tag{color:#9A5334}.hljs-formula,.hljs-function,.hljs-params,.hljs-subst,.hljs-title{color:#DCDCDC}.hljs-comment,.hljs-quote{color:#57A64A;font-style:italic}.hljs-doctag{color:#608B4E}.hljs-meta,.hljs-meta-keyword,.hljs-tag{color:#9B9B9B}.hljs-template-variable,.hljs-variable{color:#BD63C5}.hljs-attr,.hljs-attribute,.hljs-builtin-name{color:#9CDCFE}.hljs-section{color:gold}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-bullet,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag{color:#D7BA7D}.hljs-addition{background-color:#144212}.hljs-deletion{background-color:#600} diff --git a/docs/lib/highlight.js b/docs/lib/highlight.js new file mode 100644 index 0000000..6831153 --- /dev/null +++ b/docs/lib/highlight.js @@ -0,0 +1,2 @@ +/*! highlight.js v9.14.2 | BSD3 License | git.io/hljslicense */ +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=M.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function c(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function u(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function c(e){l+=""}function u(e){("start"===e.event?o:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=i();if(l+=n(a.substring(s,g[0].offset)),s=g[0].offset,g===e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function s(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function l(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):B(a.k).forEach(function(e){c(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.endSameAsBegin&&(a.e=a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return s("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var u=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=u.length?t(u.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e){return new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function c(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t].endSameAsBegin&&(n.c[t].eR=o(n.c[t].bR.exec(e)[0])),n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function s(e,n){return!a&&r(n.iR,e)}function p(e,n){var t=R.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function d(e,n,t,r){var a=r?"":j.classPrefix,i='',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=p(E,r),e?(M+=e[1],a+=d(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function b(){var e="string"==typeof E.sL;if(e&&!L[E.sL])return n(k);var t=e?f(E.sL,k,!0,B[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(B[E.sL]=t.top),d(t.language,t.value,!1,!0)}function v(){y+=null!=E.sL?b():h(),k=""}function m(e){y+=e.cN?d(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function N(e,n){if(k+=e,null==n)return v(),0;var t=c(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),v(),t.rB||t.eB||(k=n)),m(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),v(),a.eE&&(k=n));do E.cN&&(y+=I),E.skip||E.sL||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.eR=r.eR),m(r.starts,"")),a.rE?0:n.length}if(s(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return k+=n,n.length||1}var R=w(e);if(!R)throw new Error('Unknown language: "'+e+'"');l(R);var x,E=i||R,B={},y="";for(x=E;x!==R;x=x.parent)x.cN&&(y=d(x.cN,"",!0)+y);var k="",M=0;try{for(var C,A,S=0;;){if(E.t.lastIndex=S,C=E.t.exec(t),!C)break;A=N(t.substring(S,C.index),C[0]),S=C.index+A}for(N(t.substr(S)),x=E;x.parent;x=x.parent)x.cN&&(y+=I);return{r:M,value:y,language:e,top:E}}catch(O){if(O.message&&-1!==O.message.indexOf("Illegal"))return{r:0,value:n(t)};throw O}}function g(e,t){t=t||j.languages||B(L);var r={r:0,value:n(e)},a=r;return t.filter(w).filter(x).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return j.tabReplace||j.useBR?e.replace(C,function(e,n){return j.useBR&&"\n"===e?"
":j.tabReplace?n.replace(/\t/g,j.tabReplace):""}):e}function d(e,n,t){var r=n?y[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function h(e){var n,t,r,o,s,l=i(e);a(l)||(j.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):n=e,s=n.textContent,r=l?f(l,s,!0):g(s),t=c(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=u(t,c(o),s)),r.value=p(r.value),e.innerHTML=r.value,e.className=d(e.className,l,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){j=o(j,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,h)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=L[n]=t(e);r.aliases&&r.aliases.forEach(function(e){y[e]=n})}function R(){return B(L)}function w(e){return e=(e||"").toLowerCase(),L[e]||L[y[e]]}function x(e){var n=w(e);return n&&!n.disableAutodetect}var E=[],B=Object.keys,L={},y={},k=/^(no-?highlight|plain|text)$/i,M=/\blang(?:uage)?-([\w-]+)\b/i,C=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,I="
",j={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=h,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.autoDetection=x,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",t={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:c,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"meta",b:/<\?xml/,e:/\?>/,r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0},{b:'b"',e:'"',skip:!0},{b:"b'",e:"'",skip:!0},s.inherit(s.ASM,{i:null,cN:null,c:null,skip:!0}),s.inherit(s.QSM,{i:null,cN:null,c:null,skip:!0})]},{cN:"tag",b:"|$)",e:">",k:{name:"style"},c:[t],starts:{e:"",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"|$)",e:">",k:{name:"script"},c:[t],starts:{e:"",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"tag",b:"",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b://,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor get set",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("scss",function(e){var t="[a-zA-Z-][a-zA-Z0-9_-]*",i={cN:"variable",b:"(\\$"+t+")\\b"},r={cN:"number",b:"#[0-9A-Fa-f]+"};({cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{eW:!0,eE:!0,c:[r,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"meta",b:"!important"}]}});return{cI:!0,i:"[=/|']",c:[e.CLCM,e.CBCM,{cN:"selector-id",b:"\\#[A-Za-z0-9_-]+",r:0},{cN:"selector-class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"selector-attr",b:"\\[",e:"\\]",i:"$"},{cN:"selector-tag",b:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",r:0},{b:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{b:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},i,{cN:"attribute",b:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",i:"[^\\s]"},{b:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{b:":",e:";",c:[i,r,e.CSSNM,e.QSM,e.ASM,{cN:"meta",b:"!important"}]},{b:"@",e:"[{;]",k:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",c:[i,e.QSM,e.ASM,r,e.CSSNM,{b:"\\s[A-Za-z0-9_.-]+",r:0}]}]}}); \ No newline at end of file diff --git a/docs/lib/vue.min.js b/docs/lib/vue.min.js new file mode 100644 index 0000000..21799a0 --- /dev/null +++ b/docs/lib/vue.min.js @@ -0,0 +1,6 @@ +/*! + * Vue.js v2.6.2 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function A(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function k(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,W=K&&K.indexOf("edge/")>0,Z=(K&&K.indexOf("android"),K&&/iphone|ipad|ipod|ios/.test(K)||"ios"===V),G=(K&&/chrome\/\d+/.test(K),K&&/phantomjs/.test(K),{}.watch),X=!1;if(U)try{var Y={};Object.defineProperty(Y,"passive",{get:function(){X=!0}}),window.addEventListener("test-passive",null,Y)}catch(e){}var Q=function(){return void 0===H&&(H=!U&&!z&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),H},ee=U&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function te(e){return"function"==typeof e&&/native code/.test(e.toString())}var ne,re="undefined"!=typeof Symbol&&te(Symbol)&&"undefined"!=typeof Reflect&&te(Reflect.ownKeys);ne="undefined"!=typeof Set&&te(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ie=S,oe=0,ae=function(){this.id=oe++,this.subs=[]};ae.prototype.addSub=function(e){this.subs.push(e)},ae.prototype.removeSub=function(e){h(this.subs,e)},ae.prototype.depend=function(){ae.target&&ae.target.addDep(this)},ae.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=De(String,i.type);(c<0||s0&&(at((u=e(u,(a||"")+"_"+c))[0])&&at(f)&&(s[l]=de(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?at(f)?s[l]=de(f.text+u):""!==u&&s.push(de(u)):at(u)&&at(f)?s[l]=de(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function at(e){return n(e)&&n(e.text)&&!1===e.isComment}function st(e,t){return(e.__esModule||re&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function ct(e){return e.isComment&&e.asyncFactory}function ut(e){if(Array.isArray(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(Tt=function(){return performance.now()});var jt=0,Nt=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++jt,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ne,this.newDepIds=new ne,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!F.test(e)){var t=e.split(".");return function(e){for(var n=0;nOt&&wt[n].id>e.id;)n--;wt.splice(n+1,0,e)}else wt.push(e);At||(At=!0,Ge(Et))}}(this)},Nt.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Pe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Nt.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Nt.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},Nt.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Lt={enumerable:!0,configurable:!0,get:S,set:S};function Mt(e,t,n){Lt.get=function(){return this[t][n]},Lt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Lt)}function It(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&_e(!1);var o=function(o){i.push(o);var a=Le(o,t,n,e);we(r,o,a),o in e||Mt(e,"_props",o)};for(var a in t)o(a);_e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){ce();try{return e.call(t,t)}catch(e){return Pe(e,t,"data()"),{}}finally{ue()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Mt(e,"_data",o))}var a;$e(t,!0)}(e):$e(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Q();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new Nt(e,a||S,S,Dt)),i in e||Pt(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function wn(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=bn(a.componentOptions);s&&!t(s)&&Cn(n,o,r,i)}}}function Cn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=mn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=je(yn(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&dt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=vt(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return hn(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return hn(t,e,n,r,i,!0)};var o=r&&r.data;we(t,"$attrs",o&&o.attrs||e,null,!0),we(t,"$listeners",n._parentListeners||e,null,!0)}(n),$t(n,"beforeCreate"),function(e){var t=Bt(e.$options.inject,e);t&&(_e(!1),Object.keys(t).forEach(function(n){we(e,n,t[n])}),_e(!0))}(n),It(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),$t(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(gn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ce,e.prototype.$delete=xe,e.prototype.$watch=function(e,t,n){if(s(t))return Ht(this,e,t,n);(n=n||{}).user=!0;var r=new Nt(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Pe(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(gn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?A(t):t;for(var n=A(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;iparseInt(this.max)&&Cn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return P}};Object.defineProperty(e,"config",t),e.util={warn:ie,extend:k,mergeOptions:je,defineReactive:we},e.set=Ce,e.delete=xe,e.nextTick=Ge,e.observable=function(e){return $e(e),e},e.options=Object.create(null),I.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,k(e.options.components,An),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=A(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=je(this.options,e),this}}(e),_n(e),function(e){I.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(gn),Object.defineProperty(gn.prototype,"$isServer",{get:Q}),Object.defineProperty(gn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(gn,"FunctionalRenderContext",{value:an}),gn.version="2.6.2";var kn=p("style,class"),On=p("input,textarea,option,select,progress"),Sn=function(e,t,n){return"value"===n&&On(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Tn=p("contenteditable,draggable,spellcheck"),En=p("events,caret,typing,plaintext-only"),jn=function(e,t){return Dn(t)||"false"===t?"false":"contenteditable"===e&&En(t)?t:"true"},Nn=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ln="http://www.w3.org/1999/xlink",Mn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},In=function(e){return Mn(e)?e.slice(6,e.length):""},Dn=function(e){return null==e||!1===e};function Pn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Rn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Rn(t,r.data));return function(e,t){if(n(e)||n(t))return Fn(e,Hn(t));return""}(t.staticClass,t.class)}function Rn(e,t){return{staticClass:Fn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Fn(e,t){return e?t?e+" "+t:e:t||""}function Hn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?fr(e,t,n):Nn(t)?Dn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Tn(t)?e.setAttribute(t,jn(t,n)):Mn(t)?Dn(n)?e.removeAttributeNS(Ln,In(t)):e.setAttributeNS(Ln,t,n):fr(e,t,n)}function fr(e,t,n){if(Dn(n))e.removeAttribute(t);else{if(J&&!q&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var pr={create:ur,update:ur};function dr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Pn(r),c=i._transitionClasses;n(c)&&(s=Fn(s,Hn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var vr,hr,mr,yr,gr,_r,br={create:dr,update:dr},$r=/[\w).+\-_$\]]/;function wr(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r=0&&" "===(h=e.charAt(v));v--);h&&$r.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r-1?{exp:e.slice(0,yr),key:'"'+e.slice(yr+1)+'"'}:{exp:e,key:null};hr=e,yr=gr=_r=0;for(;!Fr();)Hr(mr=Rr())?Ur(mr):91===mr&&Br(mr);return{exp:e.slice(0,gr),key:e.slice(gr+1,_r)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Rr(){return hr.charCodeAt(++yr)}function Fr(){return yr>=vr}function Hr(e){return 34===e||39===e}function Br(e){var t=1;for(gr=yr;!Fr();)if(Hr(e=Rr()))Ur(e);else if(91===e&&t++,93===e&&t--,0===t){_r=yr;break}}function Ur(e){for(var t=e;!Fr()&&(e=Rr())!==t;);}var zr,Vr="__r",Kr="__c";function Jr(e,t,n){var r=zr;return function i(){null!==t.apply(null,arguments)&&Wr(e,i,n,r)}}function qr(e,t,n,r){if(Ue){var i=St,o=t;t=o._wrapper=function(e){if(e.timeStamp>=i)return o.apply(this,arguments)}}zr.addEventListener(e,t,X?{capture:n,passive:r}:n)}function Wr(e,t,n,r){(r||zr).removeEventListener(e,t._wrapper||t,n)}function Zr(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};zr=r.elm,function(e){if(n(e[Vr])){var t=J?"change":"input";e[t]=[].concat(e[Vr],e[t]||[]),delete e[Vr]}n(e[Kr])&&(e.change=[].concat(e[Kr],e.change||[]),delete e[Kr])}(i),nt(i,o,qr,Wr,Jr,r.context),zr=void 0}}var Gr,Xr={create:Zr,update:Zr};function Yr(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=k({},c)),s)t(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i||o!==s[i])if("value"===i){a._value=o;var u=t(o)?"":String(o);Qr(a,u)&&(a.value=u)}else if("innerHTML"===i&&zn(a.tagName)&&t(a.innerHTML)){(Gr=Gr||document.createElement("div")).innerHTML=""+o+"";for(var l=Gr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else a[i]=o}}}function Qr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var ei={create:Yr,update:Yr},ti=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function ni(e){var t=ri(e.style);return e.staticStyle?k(e.staticStyle,t):t}function ri(e){return Array.isArray(e)?O(e):"string"==typeof e?ti(e):e}var ii,oi=/^--/,ai=/\s*!important$/,si=function(e,t,n){if(oi.test(t))e.style.setProperty(t,n);else if(ai.test(n))e.style.setProperty(C(t),n.replace(ai,""),"important");else{var r=ui(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(pi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function vi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(pi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function hi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&k(t,mi(e.name||"v")),k(t,e),t}return"string"==typeof e?mi(e):void 0}}var mi=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),yi=U&&!q,gi="transition",_i="animation",bi="transition",$i="transitionend",wi="animation",Ci="animationend";yi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(bi="WebkitTransition",$i="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(wi="WebkitAnimation",Ci="webkitAnimationEnd"));var xi=U?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ai(e){xi(function(){xi(e)})}function ki(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),di(e,t))}function Oi(e,t){e._transitionClasses&&h(e._transitionClasses,t),vi(e,t)}function Si(e,t,n){var r=Ei(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===gi?$i:Ci,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c0&&(n=gi,l=a,f=o.length):t===_i?u>0&&(n=_i,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?gi:_i:null)?n===gi?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===gi&&Ti.test(r[bi+"Property"])}}function ji(e,t){for(;e.length1}function Pi(e,t){!0!==t.data.show&&Li(t)}var Ri=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;ov?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(0,r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(0,h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function A(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,a.selected!==o&&(a.selected=o);else if(j(zi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Ui(e,t){return t.every(function(t){return!j(t,e)})}function zi(e){return"_value"in e?e._value:e.value}function Vi(e){e.target.composing=!0}function Ki(e){e.target.composing&&(e.target.composing=!1,Ji(e.target,"input"))}function Ji(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function qi(e){return!e.componentInstance||e.data&&e.data.transition?e:qi(e.componentInstance._vnode)}var Wi={model:Fi,show:{bind:function(e,t,n){var r=t.value,i=(n=qi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Li(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=qi(n)).data&&n.data.transition?(n.data.show=!0,r?Li(n,function(){e.style.display=e.__vOriginalDisplay}):Mi(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Zi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Gi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Gi(ut(t.children)):e}function Xi(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function Yi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Qi=function(e){return e.tag||ct(e)},eo=function(e){return"show"===e.name},to={name:"transition",props:Zi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Qi)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=Gi(o);if(!a)return o;if(this._leaving)return Yi(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=Xi(this),u=this._vnode,l=Gi(u);if(a.data.directives&&a.data.directives.some(eo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!ct(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===r)return this._leaving=!0,rt(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Yi(e,o);if("in-out"===r){if(ct(a))return u;var p,d=function(){p()};rt(c,"afterEnter",d),rt(c,"enterCancelled",d),rt(f,"delayLeave",function(e){p=e})}}return o}}},no=k({tag:String,moveClass:String},Zi);function ro(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function io(e){e.data.newPos=e.elm.getBoundingClientRect()}function oo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete no.mode;var ao={Transition:to,TransitionGroup:{props:no,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=gt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Xi(this),s=0;s-1?Jn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Jn[e]=/HTMLUnknownElement/.test(t.toString())},k(gn.options.directives,Wi),k(gn.options.components,ao),gn.prototype.__patch__=U?Ri:S,gn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=pe),$t(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Nt(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&$t(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,$t(e,"mounted")),e}(this,e=e&&U?Wn(e):void 0,t)},U&&setTimeout(function(){P.devtools&&ee&&ee.emit("init",gn)},0);var so=/\{\{((?:.|\r?\n)+?)\}\}/g,co=/[-.*+?^${}()|[\]\/\\]/g,uo=g(function(e){var t=e[0].replace(co,"\\$&"),n=e[1].replace(co,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var lo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Lr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Nr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var fo,po={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Lr(e,"style");n&&(e.staticStyle=JSON.stringify(ti(n)));var r=Nr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},vo=function(e){return(fo=fo||document.createElement("div")).innerHTML=e,fo.textContent},ho=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),mo=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),yo=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),go=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,_o=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,bo="[a-zA-Z_][\\-\\.0-9_a-zA-Za-zA-Z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]*",$o="((?:"+bo+"\\:)?"+bo+")",wo=new RegExp("^<"+$o),Co=/^\s*(\/?)>/,xo=new RegExp("^<\\/"+$o+"[^>]*>"),Ao=/^]+>/i,ko=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},jo=/&(?:lt|gt|quot|amp|#39);/g,No=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Lo=p("pre,textarea",!0),Mo=function(e,t){return e&&Lo(e)&&"\n"===t[0]};function Io(e,t){var n=t?No:jo;return e.replace(n,function(e){return Eo[e]})}var Do,Po,Ro,Fo,Ho,Bo,Uo,zo,Vo=/^@|^v-on:/,Ko=/^v-|^@|^:/,Jo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,qo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Wo=/^\(|\)$/g,Zo=/^\[.*\]$/,Go=/:(.*)$/,Xo=/^:|^\.|^v-bind:/,Yo=/\.[^.]+/g,Qo=/^v-slot(:|$)|^#/,ea=/[\r\n]/,ta=/\s+/g,na=g(vo);function ra(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:la(t),rawAttrsMap:{},parent:n,children:[]}}function ia(e,t){Do=t.warn||xr,Bo=t.isPreTag||T,Uo=t.mustUseProp||T,zo=t.getTagNamespace||T;t.isReservedTag;Ro=Ar(t.modules,"transformNode"),Fo=Ar(t.modules,"preTransformNode"),Ho=Ar(t.modules,"postTransformNode"),Po=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=oa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&sa(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&sa(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Bo(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,So(l)||"noscript"===l||(n=n.replace(//g,"$1").replace(//g,"$1")),Mo(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,k(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(ko.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(Oo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Ao);if(m){C(m[0].length);continue}var y=e.match(xo);if(y){var g=c;C(y[0].length),k(y[1],g,c);continue}var _=x();if(_){A(_),Mo(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(xo.test($)||wo.test($)||ko.test($)||Oo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(wo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(Co))&&(r=e.match(_o)||e.match(go));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function A(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&yo(n)&&k(r),s(n)&&r===n&&k(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}k()}(e,{warn:Do,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l){var f=r&&r.ns||zo(e);J&&"svg"===f&&(o=function(e){for(var t=[],n=0;nc&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=wr(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),jr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Pr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Pr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Pr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Nr(e,"value")||"null";kr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),jr(e,"change",Pr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Vr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Pr(t,l);c&&(f="if($event.target.composing)return;"+f),kr(e,"value","("+t+")"),jr(e,u,f,null,!0),(s||a)&&jr(e,"blur","$forceUpdate()")}(e,r,i);else if(!P.isReservedTag(o))return Dr(e,r,i),!1;return!0},text:function(e,t){t.value&&kr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&kr(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:ho,mustUseProp:Sn,canBeLeftOpenTag:mo,isReservedTag:Vn,getTagNamespace:Kn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(va)},ga=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function _a(e,t){e&&(ha=ga(t.staticKeys||""),ma=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!ma(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(ha)))}(t);if(1===t.type){if(!ma(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,$a=/\([^)]*?\);*$/,wa=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ca={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},xa={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Aa=function(e){return"if("+e+")return null;"},ka={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Aa("$event.target !== $event.currentTarget"),ctrl:Aa("!$event.ctrlKey"),shift:Aa("!$event.shiftKey"),alt:Aa("!$event.altKey"),meta:Aa("!$event.metaKey"),left:Aa("'button' in $event && $event.button !== 0"),middle:Aa("'button' in $event && $event.button !== 1"),right:Aa("'button' in $event && $event.button !== 2")};function Oa(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=Sa(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function Sa(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return Sa(e)}).join(",")+"]";var t=wa.test(e.value),n=ba.test(e.value),r=wa.test(e.value.replace($a,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(ka[s])o+=ka[s],Ca[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=Aa(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(('keyCode' in $event)&&"+e.map(Ta).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ta(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ca[e],r=xa[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ea={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},ja=function(e){this.options=e,this.warn=e.warn||xr,this.transforms=Ar(e.modules,"transformCode"),this.dataGenFns=Ar(e.modules,"genData"),this.directives=k(k({},Ea),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Na(e,t){var n=new ja(t);return{render:"with(this){return "+(e?La(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function La(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ma(e,t);if(e.once&&!e.onceProcessed)return Ia(e,t);if(e.for&&!e.forProcessed)return Pa(e,t);if(e.if&&!e.ifProcessed)return Da(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Ha(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return b(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Ha(t,n,!0);return"_c("+e+","+Ra(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Ra(e,t));var i=e.inlineTemplate?null:Ha(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
',Wa.innerHTML.indexOf(" ")>0}var Ya=!!U&&Xa(!1),Qa=!!U&&Xa(!0),es=g(function(e){var t=Wn(e);return t&&t.innerHTML}),ts=gn.prototype.$mount;return gn.prototype.$mount=function(e,t){if((e=e&&Wn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=es(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=Ga(r,{outputSourceRange:!1,shouldDecodeNewlines:Ya,shouldDecodeNewlinesForHref:Qa,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return ts.call(this,e,t)},gn.compile=Ga,gn}); diff --git a/docs/script.js b/docs/script.js new file mode 100644 index 0000000..225263e --- /dev/null +++ b/docs/script.js @@ -0,0 +1,217 @@ +const sampleCollection = [ + { + title: "buttons", + showCode: false, + code: `Normal + + + + + +` + }, + { + title: "radios", + showCode: false, + code: ` + +` + }, + { + title: "checkboxes", + showCode: false, + code: ` + +
+ +
` + }, + { + title: "Inputs", + showCode: false, + code: `
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
` + }, + { + title: "Textarea", + showCode: false, + code: ` +` + }, + { + title: "Selects", + showCode: false, + code: `
+ +
+ +
+ +
+ +
+ +
+ +
+ +
` + }, + { + title: "containers", + showCode: false, + code: `
+

Container.is-centered

+

Good morning. Thou hast had a good night's sleep, I hope.

+
+ +
+

Container.is-dark

+

Good morning. Thou hast had a good night's sleep, I hope.

+
+ +
+

Good morning. Thou hast had a good night's sleep, I hope.

+
+ +
+

Good morning. Thou hast had a good night's sleep, I hope.

+
` + } +]; + +const coreteam = [ + { + name: "B.C.Rikko", + feat: "Creator of NES.css", + github: "BcRikko", + twitter: "bc_rikko" + }, + { + name: "Igor Guastalla", + feat: "Create icons", + github: "guastallaigor", + twitter: "guastallaigor" + } +]; + +const emeriti = [ + { + name: "Trezy", + feat: "Setup DevOps", + github: "trezy", + twitter: "TrezyCodes" + }, + { + name: "Abdullah Samman", + feat: "Setup test suite", + github: "evexoio", + twitter: "evexoio" + } +]; + +// curl https://api.github.com/repos/nostalgic-css/NES.css/contributors | jq '.[].login' +const contributors = [ "4k1k0", "sombreroEnPuntas", "Divoolej", "soph-iest", "montezume", "sazzadsazib", "KeevanDance", "jdvivar", "IngwiePhoenix", "jjspace", "Baldomo", "DanSnow", "ernestomancebo", "Ilyeo", "Kartones", "rrj-dev", "vicainelli", "stewartrule", "kenshinji", "youngkaneda", "Takumi0901", "loo41", "alexgleason", "agarzola", "fleeting", "JamesIves"]; + +const articles = [ + { + icon: 'medium', + title: 'Why I created and released NES.css', + url: 'https://medium.com/@bc_rikko/why-i-created-and-released-nes-css-ee8966bacd09' + }, + { + icon: 'github', + title: 'Release Radar · December 2018 | The GitHub Blog', + url: 'https://github.blog/2019-01-20-release-radar-december-2018/#nes-css-1-0' + } +] + +new Vue({ + el: "#nescss", + data: function() { + return { + collection: sampleCollection, + coreteam: coreteam, + emeriti: emeriti, + contributors: contributors, + articles: articles, + animateOctocat: false + }; + }, + filters: { + capitalize: function(val) { + if (!val) return ""; + val = val.toString(); + return val.charAt(0).toUpperCase() + val.slice(1); + } + }, + mounted() { + hljs.initHighlightingOnLoad(); + }, + methods: { + copy(id) { + const fake = document.createElement("textarea"); + fake.value = this.collection.find(a => a.title === id).code; + fake.setAttribute("readonly", ""); + Object.assign(fake.style, { + position: "absolute", + left: "-9999px" + }); + this.$el.appendChild(fake); + fake.select(); + document.execCommand("copy"); + this.$el.removeChild(fake); + }, + startAnimate() { + this.animateOctocat = true; + }, + stopAnimate() { + this.animateOctocat = false + } + } +}); diff --git a/docs/style.css b/docs/style.css new file mode 100644 index 0000000..61294ae --- /dev/null +++ b/docs/style.css @@ -0,0 +1,153 @@ +body { + padding: 0 2rem; + margin: 2rem; +} + +.wrapper { + max-width: 980px; + margin: 0 auto; +} + +header i.brand { + margin-right: 1rem; +} + +footer { + margin-top: 3rem; + text-align: center; +} +footer a { + color: #333; + text-decoration: none; +} + +h2 > a { + margin-right: 1rem; +} + +.topic { + margin-bottom: 3rem; +} + +/* github link */ +.github-link { + position: fixed; + top: 10px; + right: 10px; + z-index: 999; + display: flex; + height: 100px; + color: #333; + text-decoration: none; +} +.github-link:hover { + text-decoration: none; +} +.github-link > p.nes-balloon { + align-self: flex-start; + padding: 0.2rem 0.5rem; + font-size: 0.8rem; + color: #333; +} +.github-link > i.nes-octocat { + align-self: flex-end; +} + +/* Showcase */ +section.showcase { + margin-bottom: 2.5rem; +} +section.showcase > section.nes-container { + padding-bottom: 2.5rem; +} +section.showcase > section.nes-container, +section.showcase > section.samplecode { + position: relative; +} +.nes-btn.showcode { + position: absolute; + font-size: 12px; + bottom: 0px; + right: -4px; +} +.nes-btn.copycode { + position: absolute; + font-size: 12px; + top: 0; + right: 0px; +} + +section.showcase > section.samplecode > pre code { + font-size: 13px; + line-height: 1.5; + padding: 1rem; +} + +.item { + margin-bottom: -1rem; +} +.item > * { + margin-bottom: 1.5rem !important; +} + +/* Containers */ +.item.containers > .nes-container { + display: inline-block; + max-width: 400px; +} + +/* Topic */ +h3.topic-title { + display: flex; + align-items: center; +} + +h3.topic-title > i { + margin-right: 1.5rem; +} + +/* coreteam */ +.coreteam-members { + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.nes-container.member-card { + display: flex; + padding: 1rem 1.5rem; + width: 470px; + margin-bottom: 2rem; +} + +.member-card .avatar > img { + width: 80px; + height: 80px; + border-radius: 50%; +} +.member-card > .profile { + margin-left: 1.5rem; +} +.member-card > .profile > .name { + font-size: 20px; +} + +/* Contributors */ +.contributor { + display: inline-block; + margin: 1rem; + text-align: center; +} +.contributor > p { + margin: .5rem; + font-size: 12px; +} +.contributor img.nes-avatar { + transition: all .4s; +} +.contributor:hover { + text-decoration: none; + opacity: 0.7; +} + +/* Articles */ + diff --git a/index.html b/index.html deleted file mode 100644 index 3e9ec81..0000000 --- a/index.html +++ /dev/null @@ -1,1085 +0,0 @@ - - - - - - - - - - - - - - NES.css - NES-style CSS Framework - - - - - - - - - - - - - - - - - - - - - - - - - -
-

NES.css

-

NES-style CSS Framework.

-
- - -

Fork me
on GitHub

- -
- -
-

Buttons

-
- - - - - - -
- - Copied! -
-
-
<button type="button" class="nes-btn">Normal</button>
-<button type="button" class="nes-btn is-primary">Primary</button>
-<button type="button" class="nes-btn is-success">Success</button>
-<button type="button" class="nes-btn is-warning">Warning</button>
-<button type="button" class="nes-btn is-error">Error</button>
-<button type="button" class="nes-btn is-disabled">Disabled</button>
- -
- -
-

Containers

-
-
-

Container.is-centered

-

Good morning. Thou hast had a good night's sleep, I hope.

-
-
-

Container.is-dark

-

Good morning. Thou hast had a good night's sleep, I hope.

-
-
-

Good morning. Thou hast had a good night's sleep, I hope.

-
-
-

Good morning. Thou hast had a good night's sleep, I hope.

-
-
- - Copied! -
-
-
<div class="nes-container with-title is-centered">
-  <p class="title">Container.is-centered</p>
-  <p>Good morning. Thou hast had a good night's sleep, I hope.</p>
-</div>
-<div class="nes-container is-dark with-title">
-  <p class="title">Container.is-dark</p>
-  <p>Good morning. Thou hast had a good night's sleep, I hope.</p>
-</div>
-<div class="nes-container is-rounded">
-  <p>Good morning. Thou hast had a good night's sleep, I hope.</p>
-</div>
-<div class="nes-container is-rounded is-dark">
-  <p>Good morning. Thou hast had a good night's sleep, I hope.</p>
-</div>
- -
- -
-

Dialogs

-
-
- - -
-

Dialog

-

Alert: this is a dialog.

- - - - -
-
-
-
- - -
-

Dark dialog

-

Alert: this is a dialog.

- - - - -
-
-
-
- - -
-

Rounded dialog

-

Alert: this is a dialog.

- - - - -
-
-
-
- - -
-

Dark and Rounded dialog

-

Alert: this is a dialog.

- - - - -
-
-
-
- -

NES.css does not include any JavaScript. If you want to use dialog element other than Chrome, you need polyfill.

- - - Copied! -
- -
-
<section>
-  <button type="button" class="nes-btn is-primary" onclick="document.getElementById('dialog-default').showModal();">Open dialog</button>
-  <dialog class="nes-dialog" id="dialog-default">
-    <form method="dialog">
-      <p class="title">Dialog</p>
-      <p>Alert: this is a dialog.</p>
-      <menu class="dialog-menu">
-        <button class="nes-btn">Cancel</button>
-        <button class="nes-btn is-primary">Confirm</button>
-      </menu>
-    </form>
-  </dialog>
-</section>
-
-<section>
-  <button type="button" class="nes-btn is-primary" onclick="document.getElementById('dialog-dark').showModal();">Open dark dialog</button>
-  <dialog class="nes-dialog is-dark" id="dialog-dark">
-    <form method="dialog">
-      <p class="title">Dark dialog</p>
-      <p>Alert: this is a dialog.</p>
-      <menu class="dialog-menu">
-        <button class="nes-btn">Cancel</button>
-        <button class="nes-btn is-primary">Confirm</button>
-      </menu>
-    </form>
-  </dialog>
-</section>
-
-<section>
-  <button type="button" class="nes-btn is-primary" onclick="document.getElementById('dialog-rounded').showModal();">Open rounded dialog</button>
-  <dialog class="nes-dialog is-rounded" id="dialog-rounded">
-    <form method="dialog">
-      <p class="title">Rounded dialog</p>
-      <p>Alert: this is a dialog.</p>
-      <menu class="dialog-menu">
-        <button class="nes-btn">Cancel</button>
-        <button class="nes-btn is-primary">Confirm</button>
-      </menu>
-    </form>
-  </dialog>
-</section>
-
-<section>
-  <button type="button" class="nes-btn is-primary" onclick="document.getElementById('dialog-dark-rounded').showModal();">Open dark and rounded dialog</button>
-  <dialog class="nes-dialog is-dark is-rounded" id="dialog-dark-rounded">
-    <form method="dialog">
-      <p class="title">Dark and Rounded dialog</p>
-      <p>Alert: this is a dialog.</p>
-      <menu class="dialog-menu">
-        <button class="nes-btn">Cancel</button>
-        <button class="nes-btn is-primary">Confirm</button>
-      </menu>
-    </form>
-  </dialog>
-</section>
- -
- -
-

Radios

-
- - -
- - Copied! -
-
-
<label>
-  <input type="radio" class="nes-radio" name="answer" checked />
-  <span>Yes</span>
-</label>
-<label>
-  <input type="radio" class="nes-radio" name="answer" />
-  <span>No</span>
-</label>
- -
- -
-

Checkboxes

-
- - -
- - Copied! -
-
-
<label>
-  <input type="checkbox" class="nes-checkbox" checked />
-  <span>Enable</span>
-</label>
-<label>
-  <input type="checkbox" class="nes-checkbox is-dark" checked />
-  <span>Dark</span>
-</label>
- -
- -
-

Avatars

-
- Gravatar Image Example - Gravatar Image Example - Gravatar Image Example - Gravatar Image Example - Gravatar Image Example - Gravatar Image Example - Gravatar Image Example - Gravatar Image Example -
- - Copied! -
-
-
<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar is-small" alt="Gravatar Image Example" style="image-rendering: pixelated;">
-<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar" alt="Gravatar Image Example" style="image-rendering: pixelated;">
-<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar is-medium" alt="Gravatar Image Example" style="image-rendering: pixelated;">
-<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar is-large" alt="Gravatar Image Example" style="image-rendering: pixelated;">
-<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar is-rounded" alt="Gravatar Image Example" style="image-rendering: pixelated;">
-<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar is-small is-rounded" alt="Gravatar Image Example" style="image-rendering: pixelated;">
-<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar is-medium is-rounded" alt="Gravatar Image Example" style="image-rendering: pixelated;">
-<img src="https://www.gravatar.com/avatar?s=15" class="nes-avatar is-large is-rounded" alt="Gravatar Image Example" style="image-rendering: pixelated;">
- -
- -
-

Form

-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- - Copied! -
-
-
<div class="nes-field">
-  <label for="name_field">Your name</label>
-  <input type="text" id="name_field" class="nes-input">
-</div>
-<div class="nes-field is-inline">
-  <label for="inline_field">.input.is-success</label>
-  <input type="text" id="inline_field" class="nes-input is-success" placeholder="NES.css">
-</div>
-<div class="nes-field is-inline">
-  <label for="warning_field">.input.is-warning</label>
-  <input type="text" id="warning_field" class="nes-input is-warning" placeholder="8bit.css">
-</div>
-<div class="nes-field is-inline">
-  <label for="error_field">.input.is-error</label>
-  <input type="text" id="error_field" class="nes-input is-error" placeholder="awesome.css">
-</div>
-<div class="field">
-  <label for="textarea_field">Textarea</label>
-  <textarea id="textarea_field" class="nes-textarea"></textarea>
-</div>
-
-<div id="selects" class="selects">
-  <div class="nes-select">
-    <select required>
-      <option value="" disabled selected hidden>Select...</option>
-      <option value="0">To be</option>
-      <option value="1">Not to be</option>
-    </select>
-  </div>
-  <div class="nes-select is-success">
-    <select required>
-      <option value="" disabled selected hidden>Select...</option>
-      <option value="0">To be</option>
-      <option value="1">Not to be</option>
-    </select>
-  </div>
-  <div class="nes-select is-warning">
-    <select required>
-      <option value="" disabled selected hidden>Select...</option>
-      <option value="0">To be</option>
-      <option value="1">Not to be</option>
-    </select>
-  </div>
-  <div class="nes-select is-error">
-    <select required>
-      <option value="" disabled selected hidden>Select...</option>
-      <option value="0">To be</option>
-      <option value="1">Not to be</option>
-    </select>
-  </div>
-</div>
- -
- -
-

Balloons

-
-
- -
-

Hello NES.css

-
-
-
-
-

Good morning. Thou hast had a good night's sleep, I hope.

-
- -
-
- - Copied! -
-
-
<div class="message -left">
-  <i class="nes-bcrikko"></i>
-  <div class="nes-balloon from-left">
-    <p>Hello NES.css</p>
-  </div>
-</div>
-<div class="message -right">
-  <div class="nes-balloon from-right">
-    <p>Good morning. Thou hast had a good night's sleep, I hope.</p>
-  </div>
-  <i class="nes-bcrikko"></i>
-</div>
- -
- -
-

Lists

-
-
-
    -
  • Good morning.
  • -
  • Thou hast had a good night's sleep, I hope.
  • -
  • Thou hast had a good afternoon
  • -
  • Good night.
  • -
-
- -
-
    -
  • Good morning.
  • -
  • Thou hast had a good night's sleep, I hope.
  • -
  • Thou hast had a good afternoon
  • -
  • Good night.
  • -
-
-
- - Copied! -
-
-
<div class="lists">
-  <ul class="nes-list is-disc">
-    <li>Good morning.</li>
-    <li>Thou hast had a good night's sleep, I hope.</li>
-    <li>Thou hast had a good afternoon</li>
-    <li>Good night.</li>
-  </ul>
-</div>
-
-<div class="lists">
-  <ul class="nes-list is-circle">
-    <li>Good morning.</li>
-    <li>Thou hast had a good night's sleep, I hope.</li>
-    <li>Thou hast had a good afternoon</li>
-    <li>Good night.</li>
-  </ul>
-</div>
- -
- -
-

Texts

-
- Normal - Primary - Success - Warning - Error - Disabled -
- - Copied! -
-
-
<span class="nes-text">Normal</span>
-<span class="nes-text is-primary">Primary</span>
-<span class="nes-text is-success">Success</span>
-<span class="nes-text is-warning">Warning</span>
-<span class="nes-text is-error">Error</span>
-<span class="nes-text is-disabled">Disabled</span>
- -
- -
-

Tables

-
- - - - - - - - - - - - - - - - - - - - - - - -
Table.is-borderedTable.is-centeredTable.is-centeredTable.is-centered
Thou hast had a good morningThou hast had a good afternoonThou hast had a good eveningThou hast had a good night
Thou hast had a good morningThou hast had a good afternoonThou hast had a good eveningThou hast had a good night
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
Table.is-darkTable.is-borderedTable.is-borderedTable.is-bordered
Thou hast had a good morningThou hast had a good afternonThou hast had a good eveningThou hast had a good night
Thou hast had a good morningThou hast had a good afternoonThou hast had a good afternoonThou hast had a good afternoon
-
- - Copied! -
-
-
<div class="nes-table-responsive">
-  <table class="nes-table is-bordered is-centered">
-    <thead>
-      <tr>
-        <th>Table.is-bordered</th>
-        <th>Table.is-centered</th>
-        <th>Table.is-centered</th>
-        <th>Table.is-centered</th>
-      </tr>
-    </thead>
-    <tbody>
-      <tr>
-        <td>Thou hast had a good morning</td>
-        <td>Thou hast had a good afternoon</td>
-        <td>Thou hast had a good evening</td>
-        <td>Thou hast had a good night</td>
-      </tr>
-      <tr>
-        <td>Thou hast had a good morning</td>
-        <td>Thou hast had a good afternoon</td>
-        <td>Thou hast had a good evening</td>
-        <td>Thou hast had a good night</td>
-      </tr>
-    </tbody>
-  </table>
-</div>
-<div class="nes-table-responsive">
-  <table class="nes-table is-bordered is-dark">
-    <thead>
-      <tr>
-        <th>Table.is-dark</th>
-        <th>Table.is-bordered</th>
-        <th>Table.is-bordered</th>
-        <th>Table.is-bordered</th>
-      </tr>
-    </thead>
-    <tbody>
-      <tr>
-        <td>Thou hast had a good morning</td>
-        <td>Thou hast had a good afternon</td>
-        <td>Thou hast had a good evening</td>
-        <td>Thou hast had a good night</td>
-      </tr>
-      <tr>
-        <td>Thou hast had a good morning</td>
-        <td>Thou hast had a good afternoon</td>
-        <td>Thou hast had a good afternoon</td>
-        <td>Thou hast had a good afternoon</td>
-      </tr>
-    </tbody>
-  </table>
-</div>
- -
- -
-

Progress

-
- - - - - - -
- - Copied! -
-
-
<progress class="nes-progress" value="90" max="100"></progress>
-<progress class="nes-progress is-primary" value="80" max="100"></progress>
-<progress class="nes-progress is-success" value="50" max="100"></progress>
-<progress class="nes-progress is-warning" value="30" max="100"></progress>
-<progress class="nes-progress is-error" value="10" max="100"></progress>
-<progress class="nes-progress is-pattern" value="50" max="100"></progress>
- -
- -
-

Badges

- - - Copied! -
-
-
<a href="#" class="nes-badge">
-  <span class="is-dark">NES.css</span>
-</a>
-<a href="#" class="nes-badge">
-  <span class="is-primary">is</span>
-</a>
-<a href="#" class="nes-badge">
-  <span class="is-success">a</span>
-</a>
-<a href="#" class="nes-badge">
-  <span class="is-warning">great</span>
-</a>
-<a href="#" class="nes-badge">
-  <span class="is-error">framework!</span>
-</a>
-<a href="#" class="nes-badge is-splited">
-  <span class="is-dark">npm</span>
-  <span class="is-primary">1.1.0</span>
-</a>
-<a href="#" class="nes-badge is-splited">
-  <span class="is-dark">test</span>
-  <span class="is-success">100%</span>
-</a>
-<a href="#" class="nes-badge is-icon">
-  <span class="is-warning">
-      <i class="nes-icon star is-small"></i>
-  </span>
-  <span class="is-primary">Icons</span>
-</a>
-<a href="#" class="nes-badge is-icon">
-  <span class="is-dark">hi</span>
-  <span class="is-warning">Text</span>
-</a>
- -
- -
-

Icons

-
-

Reaction

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Copied! -
-
-
<i class="nes-icon heart is-small"></i>
-<i class="nes-icon heart"></i>
-<i class="nes-icon heart is-medium"></i>
-<i class="nes-icon heart is-large"></i>
-<i class="nes-icon heart is-empty"></i>
-
-<i class="nes-icon star is-small"></i>
-<i class="nes-icon star"></i>
-<i class="nes-icon star is-medium"></i>
-<i class="nes-icon star is-large"></i>
-
-<i class="nes-icon star is-half is-small"></i>
-<i class="nes-icon star is-half"></i>
-<i class="nes-icon star is-half is-medium"></i>
-<i class="nes-icon star is-half is-large"></i>
-
-<i class="nes-icon star is-transparent is-small"></i>
-<i class="nes-icon star is-transparent"></i>
-<i class="nes-icon star is-transparent is-medium"></i>
-<i class="nes-icon star is-transparent is-large"></i>
-
-<i class="nes-icon star is-empty"></i>
-
-<i class="nes-icon like is-small"></i>
-<i class="nes-icon like"></i>
-<i class="nes-icon like is-medium"></i>
-<i class="nes-icon like is-large"></i>
-<i class="nes-icon like is-empty"></i>
- -
- -
-

SNS

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Copied! -
-
-
<i class="nes-icon twitter is-small"></i>
-<i class="nes-icon twitter"></i>
-<i class="nes-icon twitter is-medium"></i>
-<i class="nes-icon twitter is-large"></i>
-
-<i class="nes-icon facebook is-small"></i>
-<i class="nes-icon facebook"></i>
-<i class="nes-icon facebook is-medium"></i>
-<i class="nes-icon facebook is-large"></i>
-
-<i class="nes-icon github is-small"></i>
-<i class="nes-icon github"></i>
-<i class="nes-icon github is-medium"></i>
-<i class="nes-icon github is-large"></i>
-
-<i class="nes-icon youtube is-small"></i>
-<i class="nes-icon youtube"></i>
-<i class="nes-icon youtube is-medium"></i>
-<i class="nes-icon youtube is-large"></i>
-
-<i class="nes-icon google is-small"></i>
-<i class="nes-icon google"></i>
-<i class="nes-icon google is-medium"></i>
-<i class="nes-icon google is-large"></i>
-
-<i class="nes-icon medium is-small"></i>
-<i class="nes-icon medium"></i>
-<i class="nes-icon medium is-medium"></i>
-<i class="nes-icon medium is-large"></i>
-
-<i class="nes-icon twitch is-small"></i>
-<i class="nes-icon twitch"></i>
-<i class="nes-icon twitch is-medium"></i>
-<i class="nes-icon twitch is-large"></i>
-
-<i class="nes-icon reddit is-small"></i>
-<i class="nes-icon reddit"></i>
-<i class="nes-icon reddit is-medium"></i>
-<i class="nes-icon reddit is-large"></i>
-
-<i class="nes-icon whatsapp is-small"></i>
-<i class="nes-icon whatsapp"></i>
-<i class="nes-icon whatsapp is-medium"></i>
-<i class="nes-icon whatsapp is-large"></i>
-
-<i class="nes-icon gmail is-small"></i>
-<i class="nes-icon gmail"></i>
-<i class="nes-icon gmail is-medium"></i>
-<i class="nes-icon gmail is-large"></i>
-
-<i class="nes-icon linkedin is-small"></i>
-<i class="nes-icon linkedin"></i>
-<i class="nes-icon linkedin is-medium"></i>
-<i class="nes-icon linkedin is-large"></i>
-
-<i class="nes-icon instagram is-small"></i>
-<i class="nes-icon instagram"></i>
-<i class="nes-icon instagram is-medium"></i>
-<i class="nes-icon instagram is-large"></i>
-
-
- -
- -
-

Others

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Copied! -
-
-
<i class="nes-icon close is-small"></i>
-<i class="nes-icon close"></i>
-<i class="nes-icon close is-medium"></i>
-<i class="nes-icon close is-large"></i>
-
-<i class="nes-octocat animate"></i>
-
-<i class="nes-icon trophy is-small"></i>
-<i class="nes-icon trophy"></i>
-<i class="nes-icon trophy is-medium"></i>
-<i class="nes-icon trophy is-large"></i>
-
-<i class="nes-icon coin is-small"></i>
-<i class="nes-icon coin"></i>
-<i class="nes-icon coin is-medium"></i>
-<i class="nes-icon coin is-large"></i>
-
-<i class="nes-mario"></i>
-<i class="nes-ash"></i>
-<i class="nes-pokeball"></i>
-
-<i class="nes-bulbasaur"></i>
-<i class="nes-charmander"></i>
-<i class="nes-squirtle"></i>
-
-<i class="nes-smartphone"></i>
-<i class="nes-phone"></i>
-<i class="nes-kirby"></i>
- -
- -
-

Controllers

-
- - - - -
- - Copied! -
-
-
<i class="nes-logo"></i>
-<i class="nes-jp-logo"></i>
-<i class="snes-logo"></i>
-<i class="snes-jp-logo"></i>
- -
-
- - - - - From bd17c12cacde86bb57af27150218db34c805b5af Mon Sep 17 00:00:00 2001 From: BcRikko Date: Wed, 20 Feb 2019 22:34:33 +0900 Subject: [PATCH 03/28] docs: remove demo directory --- demo/lib/dialog-polyfill.js | 745 -------------------------------- demo/lib/highlight-theme.css | 115 ----- demo/lib/highlight.js | 2 - demo/style.css | 196 --------- dialog-polyfill.css | 45 -- favicon.png => docs/favicon.png | Bin docs/script.js | 139 +++--- docs/style.css | 1 + 8 files changed, 84 insertions(+), 1159 deletions(-) delete mode 100644 demo/lib/dialog-polyfill.js delete mode 100644 demo/lib/highlight-theme.css delete mode 100644 demo/lib/highlight.js delete mode 100644 demo/style.css delete mode 100644 dialog-polyfill.css rename favicon.png => docs/favicon.png (100%) diff --git a/demo/lib/dialog-polyfill.js b/demo/lib/dialog-polyfill.js deleted file mode 100644 index 2079125..0000000 --- a/demo/lib/dialog-polyfill.js +++ /dev/null @@ -1,745 +0,0 @@ -/** - * Copyright (c) 2013 The Chromium Authors. All rights reserved. - */ -(function() { - - // nb. This is for IE10 and lower _only_. - var supportCustomEvent = window.CustomEvent; - if (!supportCustomEvent || typeof supportCustomEvent === 'object') { - supportCustomEvent = function CustomEvent(event, x) { - x = x || {}; - var ev = document.createEvent('CustomEvent'); - ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null); - return ev; - }; - supportCustomEvent.prototype = window.Event.prototype; - } - - /** - * @param {Element} el to check for stacking context - * @return {boolean} whether this el or its parents creates a stacking context - */ - function createsStackingContext(el) { - while (el && el !== document.body) { - var s = window.getComputedStyle(el); - var invalid = function(k, ok) { - return !(s[k] === undefined || s[k] === ok); - } - if (s.opacity < 1 || - invalid('zIndex', 'auto') || - invalid('transform', 'none') || - invalid('mixBlendMode', 'normal') || - invalid('filter', 'none') || - invalid('perspective', 'none') || - s['isolation'] === 'isolate' || - s.position === 'fixed' || - s.webkitOverflowScrolling === 'touch') { - return true; - } - el = el.parentElement; - } - return false; - } - - /** - * Finds the nearest from the passed element. - * - * @param {Element} el to search from - * @return {HTMLDialogElement} dialog found - */ - function findNearestDialog(el) { - while (el) { - if (el.localName === 'dialog') { - return /** @type {HTMLDialogElement} */ (el); - } - el = el.parentElement; - } - return null; - } - - /** - * Blur the specified element, as long as it's not the HTML body element. - * This works around an IE9/10 bug - blurring the body causes Windows to - * blur the whole application. - * - * @param {Element} el to blur - */ - function safeBlur(el) { - if (el && el.blur && el !== document.body) { - el.blur(); - } - } - - /** - * @param {!NodeList} nodeList to search - * @param {Node} node to find - * @return {boolean} whether node is inside nodeList - */ - function inNodeList(nodeList, node) { - for (var i = 0; i < nodeList.length; ++i) { - if (nodeList[i] === node) { - return true; - } - } - return false; - } - - /** - * @param {HTMLFormElement} el to check - * @return {boolean} whether this form has method="dialog" - */ - function isFormMethodDialog(el) { - if (!el || !el.hasAttribute('method')) { - return false; - } - return el.getAttribute('method').toLowerCase() === 'dialog'; - } - - /** - * @param {!HTMLDialogElement} dialog to upgrade - * @constructor - */ - function dialogPolyfillInfo(dialog) { - this.dialog_ = dialog; - this.replacedStyleTop_ = false; - this.openAsModal_ = false; - - // Set a11y role. Browsers that support dialog implicitly know this already. - if (!dialog.hasAttribute('role')) { - dialog.setAttribute('role', 'dialog'); - } - - dialog.show = this.show.bind(this); - dialog.showModal = this.showModal.bind(this); - dialog.close = this.close.bind(this); - - if (!('returnValue' in dialog)) { - dialog.returnValue = ''; - } - - if ('MutationObserver' in window) { - var mo = new MutationObserver(this.maybeHideModal.bind(this)); - mo.observe(dialog, {attributes: true, attributeFilter: ['open']}); - } else { - // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also - // seem to fire even if the element was removed as part of a parent removal. Use the removed - // events to force downgrade (useful if removed/immediately added). - var removed = false; - var cb = function() { - removed ? this.downgradeModal() : this.maybeHideModal(); - removed = false; - }.bind(this); - var timeout; - var delayModel = function(ev) { - if (ev.target !== dialog) { return; } // not for a child element - var cand = 'DOMNodeRemoved'; - removed |= (ev.type.substr(0, cand.length) === cand); - window.clearTimeout(timeout); - timeout = window.setTimeout(cb, 0); - }; - ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) { - dialog.addEventListener(name, delayModel); - }); - } - // Note that the DOM is observed inside DialogManager while any dialog - // is being displayed as a modal, to catch modal removal from the DOM. - - Object.defineProperty(dialog, 'open', { - set: this.setOpen.bind(this), - get: dialog.hasAttribute.bind(dialog, 'open') - }); - - this.backdrop_ = document.createElement('div'); - this.backdrop_.className = 'backdrop'; - this.backdrop_.addEventListener('click', this.backdropClick_.bind(this)); - } - - dialogPolyfillInfo.prototype = { - - get dialog() { - return this.dialog_; - }, - - /** - * Maybe remove this dialog from the modal top layer. This is called when - * a modal dialog may no longer be tenable, e.g., when the dialog is no - * longer open or is no longer part of the DOM. - */ - maybeHideModal: function() { - if (this.dialog_.hasAttribute('open') && document.body.contains(this.dialog_)) { return; } - this.downgradeModal(); - }, - - /** - * Remove this dialog from the modal top layer, leaving it as a non-modal. - */ - downgradeModal: function() { - if (!this.openAsModal_) { return; } - this.openAsModal_ = false; - this.dialog_.style.zIndex = ''; - - // This won't match the native exactly because if the user set top on a centered - // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's - // possible to polyfill this perfectly. - if (this.replacedStyleTop_) { - this.dialog_.style.top = ''; - this.replacedStyleTop_ = false; - } - - // Clear the backdrop and remove from the manager. - this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_); - dialogPolyfill.dm.removeDialog(this); - }, - - /** - * @param {boolean} value whether to open or close this dialog - */ - setOpen: function(value) { - if (value) { - this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', ''); - } else { - this.dialog_.removeAttribute('open'); - this.maybeHideModal(); // nb. redundant with MutationObserver - } - }, - - /** - * Handles clicks on the fake .backdrop element, redirecting them as if - * they were on the dialog itself. - * - * @param {!Event} e to redirect - */ - backdropClick_: function(e) { - if (!this.dialog_.hasAttribute('tabindex')) { - // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be - // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this - // would not be needed - clicks would move the implicit cursor there. - var fake = document.createElement('div'); - this.dialog_.insertBefore(fake, this.dialog_.firstChild); - fake.tabIndex = -1; - fake.focus(); - this.dialog_.removeChild(fake); - } else { - this.dialog_.focus(); - } - - var redirectedEvent = document.createEvent('MouseEvents'); - redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window, - e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, - e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget); - this.dialog_.dispatchEvent(redirectedEvent); - e.stopPropagation(); - }, - - /** - * Focuses on the first focusable element within the dialog. This will always blur the current - * focus, even if nothing within the dialog is found. - */ - focus_: function() { - // Find element with `autofocus` attribute, or fall back to the first form/tabindex control. - var target = this.dialog_.querySelector('[autofocus]:not([disabled])'); - if (!target && this.dialog_.tabIndex >= 0) { - target = this.dialog_; - } - if (!target) { - // Note that this is 'any focusable area'. This list is probably not exhaustive, but the - // alternative involves stepping through and trying to focus everything. - var opts = ['button', 'input', 'keygen', 'select', 'textarea']; - var query = opts.map(function(el) { - return el + ':not([disabled])'; - }); - // TODO(samthor): tabindex values that are not numeric are not focusable. - query.push('[tabindex]:not([disabled]):not([tabindex=""])'); // tabindex != "", not disabled - target = this.dialog_.querySelector(query.join(', ')); - } - safeBlur(document.activeElement); - target && target.focus(); - }, - - /** - * Sets the zIndex for the backdrop and dialog. - * - * @param {number} dialogZ - * @param {number} backdropZ - */ - updateZIndex: function(dialogZ, backdropZ) { - if (dialogZ < backdropZ) { - throw new Error('dialogZ should never be < backdropZ'); - } - this.dialog_.style.zIndex = dialogZ; - this.backdrop_.style.zIndex = backdropZ; - }, - - /** - * Shows the dialog. If the dialog is already open, this does nothing. - */ - show: function() { - if (!this.dialog_.open) { - this.setOpen(true); - this.focus_(); - } - }, - - /** - * Show this dialog modally. - */ - showModal: function() { - if (this.dialog_.hasAttribute('open')) { - throw new Error('Failed to execute \'showModal\' on dialog: The element is already open, and therefore cannot be opened modally.'); - } - if (!document.body.contains(this.dialog_)) { - throw new Error('Failed to execute \'showModal\' on dialog: The element is not in a Document.'); - } - if (!dialogPolyfill.dm.pushDialog(this)) { - throw new Error('Failed to execute \'showModal\' on dialog: There are too many open modal dialogs.'); - } - - if (createsStackingContext(this.dialog_.parentElement)) { - console.warn('A dialog is being shown inside a stacking context. ' + - 'This may cause it to be unusable. For more information, see this link: ' + - 'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context'); - } - - this.setOpen(true); - this.openAsModal_ = true; - - // Optionally center vertically, relative to the current viewport. - if (dialogPolyfill.needsCentering(this.dialog_)) { - dialogPolyfill.reposition(this.dialog_); - this.replacedStyleTop_ = true; - } else { - this.replacedStyleTop_ = false; - } - - // Insert backdrop. - this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling); - - // Focus on whatever inside the dialog. - this.focus_(); - }, - - /** - * Closes this HTMLDialogElement. This is optional vs clearing the open - * attribute, however this fires a 'close' event. - * - * @param {string=} opt_returnValue to use as the returnValue - */ - close: function(opt_returnValue) { - if (!this.dialog_.hasAttribute('open')) { - throw new Error('Failed to execute \'close\' on dialog: The element does not have an \'open\' attribute, and therefore cannot be closed.'); - } - this.setOpen(false); - - // Leave returnValue untouched in case it was set directly on the element - if (opt_returnValue !== undefined) { - this.dialog_.returnValue = opt_returnValue; - } - - // Triggering "close" event for any attached listeners on the . - var closeEvent = new supportCustomEvent('close', { - bubbles: false, - cancelable: false - }); - this.dialog_.dispatchEvent(closeEvent); - } - - }; - - var dialogPolyfill = {}; - - dialogPolyfill.reposition = function(element) { - var scrollTop = document.body.scrollTop || document.documentElement.scrollTop; - var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2; - element.style.top = Math.max(scrollTop, topValue) + 'px'; - }; - - dialogPolyfill.isInlinePositionSetByStylesheet = function(element) { - for (var i = 0; i < document.styleSheets.length; ++i) { - var styleSheet = document.styleSheets[i]; - var cssRules = null; - // Some browsers throw on cssRules. - try { - cssRules = styleSheet.cssRules; - } catch (e) {} - if (!cssRules) { continue; } - for (var j = 0; j < cssRules.length; ++j) { - var rule = cssRules[j]; - var selectedNodes = null; - // Ignore errors on invalid selector texts. - try { - selectedNodes = document.querySelectorAll(rule.selectorText); - } catch(e) {} - if (!selectedNodes || !inNodeList(selectedNodes, element)) { - continue; - } - var cssTop = rule.style.getPropertyValue('top'); - var cssBottom = rule.style.getPropertyValue('bottom'); - if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) { - return true; - } - } - } - return false; - }; - - dialogPolyfill.needsCentering = function(dialog) { - var computedStyle = window.getComputedStyle(dialog); - if (computedStyle.position !== 'absolute') { - return false; - } - - // We must determine whether the top/bottom specified value is non-auto. In - // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but - // Firefox returns the used value. So we do this crazy thing instead: check - // the inline style and then go through CSS rules. - if ((dialog.style.top !== 'auto' && dialog.style.top !== '') || - (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) { - return false; - } - return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog); - }; - - /** - * @param {!Element} element to force upgrade - */ - dialogPolyfill.forceRegisterDialog = function(element) { - if (window.HTMLDialogElement || element.showModal) { - console.warn('This browser already supports , the polyfill ' + - 'may not work correctly', element); - } - if (element.localName !== 'dialog') { - throw new Error('Failed to register dialog: The element is not a dialog.'); - } - new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element)); - }; - - /** - * @param {!Element} element to upgrade, if necessary - */ - dialogPolyfill.registerDialog = function(element) { - if (!element.showModal) { - dialogPolyfill.forceRegisterDialog(element); - } - }; - - /** - * @constructor - */ - dialogPolyfill.DialogManager = function() { - /** @type {!Array} */ - this.pendingDialogStack = []; - - var checkDOM = this.checkDOM_.bind(this); - - // The overlay is used to simulate how a modal dialog blocks the document. - // The blocking dialog is positioned on top of the overlay, and the rest of - // the dialogs on the pending dialog stack are positioned below it. In the - // actual implementation, the modal dialog stacking is controlled by the - // top layer, where z-index has no effect. - this.overlay = document.createElement('div'); - this.overlay.className = '_dialog_overlay'; - this.overlay.addEventListener('click', function(e) { - this.forwardTab_ = undefined; - e.stopPropagation(); - checkDOM([]); // sanity-check DOM - }.bind(this)); - - this.handleKey_ = this.handleKey_.bind(this); - this.handleFocus_ = this.handleFocus_.bind(this); - - this.zIndexLow_ = 100000; - this.zIndexHigh_ = 100000 + 150; - - this.forwardTab_ = undefined; - - if ('MutationObserver' in window) { - this.mo_ = new MutationObserver(function(records) { - var removed = []; - records.forEach(function(rec) { - for (var i = 0, c; c = rec.removedNodes[i]; ++i) { - if (!(c instanceof Element)) { - continue; - } else if (c.localName === 'dialog') { - removed.push(c); - } - removed = removed.concat(c.querySelectorAll('dialog')); - } - }); - removed.length && checkDOM(removed); - }); - } - }; - - /** - * Called on the first modal dialog being shown. Adds the overlay and related - * handlers. - */ - dialogPolyfill.DialogManager.prototype.blockDocument = function() { - document.documentElement.addEventListener('focus', this.handleFocus_, true); - document.addEventListener('keydown', this.handleKey_); - this.mo_ && this.mo_.observe(document, {childList: true, subtree: true}); - }; - - /** - * Called on the first modal dialog being removed, i.e., when no more modal - * dialogs are visible. - */ - dialogPolyfill.DialogManager.prototype.unblockDocument = function() { - document.documentElement.removeEventListener('focus', this.handleFocus_, true); - document.removeEventListener('keydown', this.handleKey_); - this.mo_ && this.mo_.disconnect(); - }; - - /** - * Updates the stacking of all known dialogs. - */ - dialogPolyfill.DialogManager.prototype.updateStacking = function() { - var zIndex = this.zIndexHigh_; - - for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) { - dpi.updateZIndex(--zIndex, --zIndex); - if (i === 0) { - this.overlay.style.zIndex = --zIndex; - } - } - - // Make the overlay a sibling of the dialog itself. - var last = this.pendingDialogStack[0]; - if (last) { - var p = last.dialog.parentNode || document.body; - p.appendChild(this.overlay); - } else if (this.overlay.parentNode) { - this.overlay.parentNode.removeChild(this.overlay); - } - }; - - /** - * @param {Element} candidate to check if contained or is the top-most modal dialog - * @return {boolean} whether candidate is contained in top dialog - */ - dialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) { - while (candidate = findNearestDialog(candidate)) { - for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) { - if (dpi.dialog === candidate) { - return i === 0; // only valid if top-most - } - } - candidate = candidate.parentElement; - } - return false; - }; - - dialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) { - if (this.containedByTopDialog_(event.target)) { return; } - - if (document.activeElement === document.documentElement) { return; } - - event.preventDefault(); - event.stopPropagation(); - safeBlur(/** @type {Element} */ (event.target)); - - if (this.forwardTab_ === undefined) { return; } // move focus only from a tab key - - var dpi = this.pendingDialogStack[0]; - var dialog = dpi.dialog; - var position = dialog.compareDocumentPosition(event.target); - if (position & Node.DOCUMENT_POSITION_PRECEDING) { - if (this.forwardTab_) { - // forward - dpi.focus_(); - } else if (event.target !== document.documentElement) { - // backwards if we're not already focused on - document.documentElement.focus(); - } - } else { - // TODO: Focus after the dialog, is ignored. - } - - return false; - }; - - dialogPolyfill.DialogManager.prototype.handleKey_ = function(event) { - this.forwardTab_ = undefined; - if (event.keyCode === 27) { - event.preventDefault(); - event.stopPropagation(); - var cancelEvent = new supportCustomEvent('cancel', { - bubbles: false, - cancelable: true - }); - var dpi = this.pendingDialogStack[0]; - if (dpi && dpi.dialog.dispatchEvent(cancelEvent)) { - dpi.dialog.close(); - } - } else if (event.keyCode === 9) { - this.forwardTab_ = !event.shiftKey; - } - }; - - /** - * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are - * removed and immediately readded don't stay modal, they become normal. - * - * @param {!Array} removed that have definitely been removed - */ - dialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) { - // This operates on a clone because it may cause it to change. Each change also calls - // updateStacking, which only actually needs to happen once. But who removes many modal dialogs - // at a time?! - var clone = this.pendingDialogStack.slice(); - clone.forEach(function(dpi) { - if (removed.indexOf(dpi.dialog) !== -1) { - dpi.downgradeModal(); - } else { - dpi.maybeHideModal(); - } - }); - }; - - /** - * @param {!dialogPolyfillInfo} dpi - * @return {boolean} whether the dialog was allowed - */ - dialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) { - var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1; - if (this.pendingDialogStack.length >= allowed) { - return false; - } - if (this.pendingDialogStack.unshift(dpi) === 1) { - this.blockDocument(); - } - this.updateStacking(); - return true; - }; - - /** - * @param {!dialogPolyfillInfo} dpi - */ - dialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) { - var index = this.pendingDialogStack.indexOf(dpi); - if (index === -1) { return; } - - this.pendingDialogStack.splice(index, 1); - if (this.pendingDialogStack.length === 0) { - this.unblockDocument(); - } - this.updateStacking(); - }; - - dialogPolyfill.dm = new dialogPolyfill.DialogManager(); - dialogPolyfill.formSubmitter = null; - dialogPolyfill.useValue = null; - - /** - * Installs global handlers, such as click listers and native method overrides. These are needed - * even if a no dialog is registered, as they deal with
. - */ - if (window.HTMLDialogElement === undefined) { - - /** - * If HTMLFormElement translates method="DIALOG" into 'get', then replace the descriptor with - * one that returns the correct value. - */ - var testForm = document.createElement('form'); - testForm.setAttribute('method', 'dialog'); - if (testForm.method !== 'dialog') { - var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method'); - if (methodDescriptor) { - // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything - // and don't bother to update the element. - var realGet = methodDescriptor.get; - methodDescriptor.get = function() { - if (isFormMethodDialog(this)) { - return 'dialog'; - } - return realGet.call(this); - }; - var realSet = methodDescriptor.set; - methodDescriptor.set = function(v) { - if (typeof v === 'string' && v.toLowerCase() === 'dialog') { - return this.setAttribute('method', v); - } - return realSet.call(this, v); - }; - Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor); - } - } - - /** - * Global 'click' handler, to capture the or -` +`, }, { - title: "radios", + title: 'radios', showCode: false, code: ``, }, { - title: "checkboxes", + title: 'checkboxes', showCode: false, code: ` -
` +`, }, { - title: "Inputs", + title: 'Inputs', showCode: false, code: `
@@ -59,16 +59,16 @@ const sampleCollection = [
-
` +
`, }, { - title: "Textarea", + title: 'Textarea', showCode: false, code: ` -` +`, }, { - title: "Selects", + title: 'Selects', showCode: false, code: `
-
` +`, }, { - title: "containers", + title: 'containers', showCode: false, code: `

Container.is-centered

@@ -121,97 +121,124 @@ const sampleCollection = [

Good morning. Thou hast had a good night's sleep, I hope.

-
` - } +
`, + }, ]; const coreteam = [ { - name: "B.C.Rikko", - feat: "Creator of NES.css", - github: "BcRikko", - twitter: "bc_rikko" + name: 'B.C.Rikko', + feat: 'Creator of NES.css', + github: 'BcRikko', + twitter: 'bc_rikko', }, { - name: "Igor Guastalla", - feat: "Create icons", - github: "guastallaigor", - twitter: "guastallaigor" - } + name: 'Igor Guastalla', + feat: 'Create icons', + github: 'guastallaigor', + twitter: 'guastallaigor', + }, ]; const emeriti = [ { - name: "Trezy", - feat: "Setup DevOps", - github: "trezy", - twitter: "TrezyCodes" + name: 'Trezy', + feat: 'Setup DevOps', + github: 'trezy', + twitter: 'TrezyCodes', }, { - name: "Abdullah Samman", - feat: "Setup test suite", - github: "evexoio", - twitter: "evexoio" - } + name: 'Abdullah Samman', + feat: 'Setup test suite', + github: 'evexoio', + twitter: 'evexoio', + }, ]; // curl https://api.github.com/repos/nostalgic-css/NES.css/contributors | jq '.[].login' -const contributors = [ "4k1k0", "sombreroEnPuntas", "Divoolej", "soph-iest", "montezume", "sazzadsazib", "KeevanDance", "jdvivar", "IngwiePhoenix", "jjspace", "Baldomo", "DanSnow", "ernestomancebo", "Ilyeo", "Kartones", "rrj-dev", "vicainelli", "stewartrule", "kenshinji", "youngkaneda", "Takumi0901", "loo41", "alexgleason", "agarzola", "fleeting", "JamesIves"]; +const contributors = [ + '4k1k0', + 'sombreroEnPuntas', + 'Divoolej', + 'soph-iest', + 'montezume', + 'sazzadsazib', + 'KeevanDance', + 'jdvivar', + 'IngwiePhoenix', + 'jjspace', + 'Baldomo', + 'DanSnow', + 'ernestomancebo', + 'Ilyeo', + 'Kartones', + 'rrj-dev', + 'vicainelli', + 'stewartrule', + 'kenshinji', + 'youngkaneda', + 'Takumi0901', + 'loo41', + 'alexgleason', + 'agarzola', + 'fleeting', + 'JamesIves', +]; const articles = [ { icon: 'medium', title: 'Why I created and released NES.css', - url: 'https://medium.com/@bc_rikko/why-i-created-and-released-nes-css-ee8966bacd09' + url: 'https://medium.com/@bc_rikko/why-i-created-and-released-nes-css-ee8966bacd09', }, { icon: 'github', title: 'Release Radar · December 2018 | The GitHub Blog', - url: 'https://github.blog/2019-01-20-release-radar-december-2018/#nes-css-1-0' - } -] + url: 'https://github.blog/2019-01-20-release-radar-december-2018/#nes-css-1-0', + }, +]; new Vue({ - el: "#nescss", - data: function() { + el: '#nescss', + data() { return { collection: sampleCollection, - coreteam: coreteam, - emeriti: emeriti, - contributors: contributors, - articles: articles, - animateOctocat: false + coreteam, + emeriti, + contributors, + articles, + animateOctocat: false, }; }, filters: { - capitalize: function(val) { - if (!val) return ""; + capitalize(val) { + if (!val) return ''; val = val.toString(); return val.charAt(0).toUpperCase() + val.slice(1); - } + }, }, mounted() { hljs.initHighlightingOnLoad(); }, methods: { copy(id) { - const fake = document.createElement("textarea"); + const fake = document.createElement('textarea'); fake.value = this.collection.find(a => a.title === id).code; - fake.setAttribute("readonly", ""); + fake.setAttribute('readonly', ''); Object.assign(fake.style, { - position: "absolute", - left: "-9999px" + position: 'absolute', + left: '-9999px', }); this.$el.appendChild(fake); fake.select(); - document.execCommand("copy"); + document.execCommand('copy'); this.$el.removeChild(fake); }, startAnimate() { this.animateOctocat = true; }, stopAnimate() { - this.animateOctocat = false - } - } + this.animateOctocat = false; + }, + }, }); diff --git a/docs/style.css b/docs/style.css index 61294ae..28b6185 100644 --- a/docs/style.css +++ b/docs/style.css @@ -136,6 +136,7 @@ h3.topic-title > i { display: inline-block; margin: 1rem; text-align: center; + width: 160px; } .contributor > p { margin: .5rem; From 2685582a908893be42177e1b5e56e7a76f5b44b3 Mon Sep 17 00:00:00 2001 From: BcRikko Date: Thu, 21 Feb 2019 18:37:24 +0900 Subject: [PATCH 04/28] docs: fix copied balloon --- docs/index.html | 13 ++++++++++--- docs/script.js | 19 ++++++++++++++++++- docs/style.css | 11 ++++++++++- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/docs/index.html b/docs/index.html index 7d1d2da..d22f869 100644 --- a/docs/index.html +++ b/docs/index.html @@ -38,12 +38,12 @@ -
+

NES.css

NES-style CSS Framework.

-
+

Fork me
on GitHub

@@ -79,12 +79,13 @@
- +
{{ sample.code }}
+

#Members

@@ -142,6 +143,7 @@
+

#Articles

@@ -158,6 +160,11 @@ @bc_rikko

+ + +
+

copied!!

+
diff --git a/docs/script.js b/docs/script.js index 1e3834f..1ba6442 100644 --- a/docs/script.js +++ b/docs/script.js @@ -208,6 +208,11 @@ new Vue({ contributors, articles, animateOctocat: false, + copiedBalloon: { + display: 'none', + top: 0, + left: 0, + }, }; }, filters: { @@ -221,7 +226,9 @@ new Vue({ hljs.initHighlightingOnLoad(); }, methods: { - copy(id) { + copy(event, id) { + this.showCopiedBalloon(event.pageY, event.pageX); + const fake = document.createElement('textarea'); fake.value = this.collection.find(a => a.title === id).code; fake.setAttribute('readonly', ''); @@ -240,5 +247,15 @@ new Vue({ stopAnimate() { this.animateOctocat = false; }, + showCopiedBalloon(top, left) { + this.copiedBalloon = { + display: 'block', + top: `${top - 100}px`, + left: `${left - 180}px`, + }; + setTimeout(() => { + this.copiedBalloon.display = 'none'; + }, 1000); + }, }, }); diff --git a/docs/style.css b/docs/style.css index 28b6185..2d2265b 100644 --- a/docs/style.css +++ b/docs/style.css @@ -80,7 +80,7 @@ section.showcase > section.samplecode { section.showcase > section.samplecode > pre code { font-size: 13px; line-height: 1.5; - padding: 1rem; + padding: 1.5rem; } .item { @@ -96,6 +96,15 @@ section.showcase > section.samplecode > pre code { max-width: 400px; } +/* Copied balloon */ +.nes-balloon.copied-balloon { + position: absolute; + display: none; + padding: 1rem; + box-shadow: 0 5px 20px 5px rgba(0,0,0,.6); + z-index: 1; +} + /* Topic */ h3.topic-title { display: flex; From ae15940e5ed207422b75fbb5c2dd79634ab0c1ab Mon Sep 17 00:00:00 2001 From: BcRikko Date: Thu, 21 Feb 2019 18:53:01 +0900 Subject: [PATCH 05/28] docs: add dialog samples --- docs/index.html | 1 + docs/script.js | 79 +++++++++++++++++++++++++++++++++++++++++++++++-- docs/style.css | 4 +++ 3 files changed, 81 insertions(+), 3 deletions(-) diff --git a/docs/index.html b/docs/index.html index d22f869..474c24d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -76,6 +76,7 @@ class="item" v-html="sample.code">
+

{{ sample.note }}

diff --git a/docs/script.js b/docs/script.js index 1ba6442..98544f7 100644 --- a/docs/script.js +++ b/docs/script.js @@ -39,7 +39,7 @@ const sampleCollection = [ `, }, { - title: 'Inputs', + title: 'inputs', showCode: false, code: `
@@ -62,13 +62,13 @@ const sampleCollection = [
`, }, { - title: 'Textarea', + title: 'textarea', showCode: false, code: ` `, }, { - title: 'Selects', + title: 'selects', showCode: false, code: `