@varlet/cli 1.22.3 → 1.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/generators/sfc/.varlet/mobile.routes.ts +6 -0
  3. package/generators/sfc/.varlet/pc.routes.ts +12 -0
  4. package/generators/sfc/.varlet/site.config.json +80 -0
  5. package/generators/sfc/es/button/Button.js +36 -0
  6. package/generators/sfc/es/button/ButtonSfc.css +0 -0
  7. package/generators/sfc/es/button/ButtonSfc.less +0 -0
  8. package/generators/sfc/es/button/button.css +1 -0
  9. package/generators/sfc/es/button/button.less +14 -0
  10. package/generators/sfc/es/button/index.js +8 -0
  11. package/generators/sfc/es/button/style/index.js +2 -0
  12. package/generators/sfc/es/button/style/less.js +2 -0
  13. package/generators/sfc/es/index.js +18 -0
  14. package/generators/sfc/es/less.js +1 -0
  15. package/generators/sfc/es/style.js +1 -0
  16. package/generators/sfc/es/umdIndex.js +18 -0
  17. package/generators/sfc/highlight/attributes.json +6 -0
  18. package/generators/sfc/highlight/tags.json +7 -0
  19. package/generators/sfc/highlight/web-types.json +39 -0
  20. package/generators/sfc/umd/basic.js +1 -0
  21. package/generators/tsx/.idea/.gitignore +5 -0
  22. package/generators/tsx/.idea/inspectionProfiles/Project_Default.xml +7 -0
  23. package/generators/tsx/.idea/modules.xml +8 -0
  24. package/generators/tsx/.idea/tsx.iml +12 -0
  25. package/generators/tsx/.idea/vcs.xml +6 -0
  26. package/generators/tsx/.idea/workspace.xml +54 -0
  27. package/generators/tsx/.varlet/mobile.routes.ts +6 -0
  28. package/generators/tsx/.varlet/pc.routes.ts +12 -0
  29. package/generators/tsx/.varlet/site.config.json +80 -0
  30. package/generators/tsx/es/button/Button.js +34 -0
  31. package/generators/tsx/es/button/button.css +1 -0
  32. package/generators/tsx/es/button/button.less +14 -0
  33. package/generators/tsx/es/button/index.js +9 -0
  34. package/generators/tsx/es/button/style/index.js +1 -0
  35. package/generators/tsx/es/button/style/less.js +1 -0
  36. package/generators/tsx/es/index.js +18 -0
  37. package/generators/tsx/es/less.js +1 -0
  38. package/generators/tsx/es/style.js +1 -0
  39. package/generators/tsx/es/umdIndex.js +18 -0
  40. package/generators/tsx/highlight/attributes.json +6 -0
  41. package/generators/tsx/highlight/tags.json +7 -0
  42. package/generators/tsx/highlight/web-types.json +39 -0
  43. package/generators/tsx/umd/basic.js +1 -0
  44. package/package.json +2 -2
  45. package/site/components/app-bar/AppBar.vue +17 -10
  46. package/site/components/app-bar/appBar.less +12 -23
  47. package/site/mobile/App.vue +17 -4
  48. package/site/pc/components/AppMobile.vue +3 -2
  49. package/LICENCE +0 -21
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.22.4](https://github.com/haoziqaq/varlet/compare/v1.22.3...v1.22.4) (2021-10-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui/app-bar:** fix app-bar style ([9da67b6](https://github.com/haoziqaq/varlet/commit/9da67b6fa0e07a644cba6118f4a90cb8293df8be))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.22.3](https://github.com/haoziqaq/varlet/compare/v1.22.2...v1.22.3) (2021-10-10)
7
18
 
8
19
 
@@ -0,0 +1,6 @@
1
+ export default [
2
+ {
3
+ path: '/button',
4
+ component: () => import('/Users/qihao/varlet/packages/varlet-cli/generators/sfc/src/button/example/index.vue')
5
+ }
6
+ ]
@@ -0,0 +1,12 @@
1
+ export default [
2
+ {
3
+ path: '/zh-CN/button',
4
+ // @ts-ignore
5
+ component: () => import('/Users/qihao/varlet/packages/varlet-cli/generators/sfc/src/button/docs/zh-CN.md')
6
+ },
7
+ {
8
+ path: '/zh-CN/home',
9
+ // @ts-ignore
10
+ component: () => import('/Users/qihao/varlet/packages/varlet-cli/generators/sfc/docs/home.zh-CN.md')
11
+ }
12
+ ]
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "Basic",
3
+ "namespace": "b",
4
+ "host": "localhost",
5
+ "port": 8080,
6
+ "title": "Basic UI",
7
+ "logo": "./logo.svg",
8
+ "defaultLanguage": "zh-CN",
9
+ "highlight": {
10
+ "style": "./highlight.css"
11
+ },
12
+ "analysis": {
13
+ "baidu": ""
14
+ },
15
+ "useMobile": true,
16
+ "pc": {
17
+ "menu": [
18
+ {
19
+ "text": {
20
+ "zh-CN": "开发指南"
21
+ },
22
+ "type": 1
23
+ },
24
+ {
25
+ "text": {
26
+ "zh-CN": "基本介绍"
27
+ },
28
+ "doc": "home",
29
+ "type": 3
30
+ },
31
+ {
32
+ "text": {
33
+ "zh-CN": "基础组件"
34
+ },
35
+ "type": 1
36
+ },
37
+ {
38
+ "text": {
39
+ "zh-CN": "Button 按钮"
40
+ },
41
+ "doc": "button",
42
+ "type": 2
43
+ }
44
+ ],
45
+ "redirect": "/home",
46
+ "title": {
47
+ "zh-CN": "一个组件库",
48
+ "en-US": "Material design mobile components built for Vue3"
49
+ },
50
+ "header": {
51
+ "i18n": null,
52
+ "github": "https://github.com/haoziqaq/varlet"
53
+ }
54
+ },
55
+ "mobile": {
56
+ "redirect": "/home",
57
+ "title": {
58
+ "zh-CN": "一个组件库",
59
+ "en-US": "Material design mobile components built for Vue3"
60
+ },
61
+ "header": {
62
+ "i18n": null
63
+ }
64
+ },
65
+ "themes": {
66
+ "color-primary": "#009688",
67
+ "color-link": "#009688",
68
+ "color-type": "#009688",
69
+ "color-progress": "#009688",
70
+ "color-pc-language-active": "#3a7afe",
71
+ "color-pc-language-active-background": "#edf5ff",
72
+ "color-side-bar": "#009688",
73
+ "color-side-bar-active-background": "#00968821",
74
+ "color-app-bar": "#009688",
75
+ "color-mobile-cell-hover": "#009688",
76
+ "color-mobile-cell-hover-background": "#00968821",
77
+ "color-mobile-language-active": "#3a7afe",
78
+ "color-mobile-language-active-background": "#edf5ff"
79
+ }
80
+ }
@@ -0,0 +1,36 @@
1
+ import { defineComponent } from 'vue';
2
+ import { renderSlot as _renderSlot, openBlock as _openBlock, createBlock as _createBlock, withScopeId as _withScopeId } from "vue";
3
+
4
+ var _withId = /*#__PURE__*/_withScopeId("");
5
+
6
+ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
7
+ return _openBlock(), _createBlock("button", {
8
+ class: "basic-button",
9
+ style: {
10
+ background: _ctx.color
11
+ }
12
+ }, [_renderSlot(_ctx.$slots, "default")], 4
13
+ /* STYLE */
14
+ );
15
+ });
16
+ export default defineComponent({
17
+ render,
18
+ name: 'BButton',
19
+ props: {
20
+ color: {
21
+ type: String
22
+ },
23
+ onClick: {
24
+ type: Function
25
+ }
26
+ },
27
+
28
+ setup(props) {
29
+ var handleClick = e => props.onClick == null ? void 0 : props.onClick(e);
30
+
31
+ return {
32
+ handleClick
33
+ };
34
+ }
35
+
36
+ });
File without changes
File without changes
@@ -0,0 +1 @@
1
+ .basic-button { display: flex; padding: 10px; background: #009688; color: #fff; outline: none; border: none; border-radius: 2px; cursor: pointer;}.basic-button:active { opacity: 0.9;}
@@ -0,0 +1,14 @@
1
+ .basic-button {
2
+ display: flex;
3
+ padding: 10px;
4
+ background: #009688;
5
+ color: #fff;
6
+ outline: none;
7
+ border: none;
8
+ border-radius: 2px;
9
+ cursor: pointer;
10
+
11
+ &:active {
12
+ opacity: 0.9
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import SfcButton from './Button.js'
2
+
3
+ SfcButton.install = function (app) {
4
+ app.component(SfcButton.name, SfcButton);
5
+ };
6
+
7
+ export var _SfcButtonComponent = SfcButton;
8
+ export default SfcButton;
@@ -0,0 +1,2 @@
1
+ import '../button.css'
2
+ import '../ButtonSfc.css'
@@ -0,0 +1,2 @@
1
+ import '../button.less'
2
+ import '../ButtonSfc.less'
@@ -0,0 +1,18 @@
1
+ import Button, * as ButtonModule from './button'
2
+
3
+ export const _ButtonComponent = ButtonModule._ButtonComponent || {}
4
+
5
+
6
+ function install(app) {
7
+ Button.install && app.use(Button)
8
+ }
9
+
10
+ export {
11
+ install,
12
+ Button
13
+ }
14
+
15
+ export default {
16
+ install,
17
+ Button
18
+ }
@@ -0,0 +1 @@
1
+ import './button/style/less'
@@ -0,0 +1 @@
1
+ import './button/style'
@@ -0,0 +1,18 @@
1
+ import Button, * as ButtonModule from './button'
2
+
3
+ import './button/style'
4
+
5
+
6
+ function install(app) {
7
+ Button.install && app.use(Button)
8
+ }
9
+
10
+ export {
11
+ install,
12
+ Button
13
+ }
14
+
15
+ export default {
16
+ install,
17
+ Button
18
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "b-button/color": {
3
+ "type": "string",
4
+ "description": "按钮颜色 默认值:default"
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "b-button": {
3
+ "attributes": [
4
+ "color"
5
+ ]
6
+ }
7
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
+ "framework": "vue",
4
+ "version": "1.0.0",
5
+ "name": "Basic UI",
6
+ "contributions": {
7
+ "html": {
8
+ "tags": [
9
+ {
10
+ "name": "b-button",
11
+ "attributes": [
12
+ {
13
+ "name": "color",
14
+ "description": "按钮颜色",
15
+ "default": "default",
16
+ "value": {
17
+ "type": "string",
18
+ "kind": "expression"
19
+ }
20
+ }
21
+ ],
22
+ "events": [
23
+ {
24
+ "name": "click",
25
+ "description": "点击按钮时触发"
26
+ }
27
+ ],
28
+ "slots": [
29
+ {
30
+ "name": "default",
31
+ "description": "按钮内容"
32
+ }
33
+ ]
34
+ }
35
+ ],
36
+ "types-syntax": "typescript"
37
+ }
38
+ }
39
+ }
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define("Basic",["vue"],t):"object"==typeof exports?exports.Basic=t(require("vue")):e.Basic=t(e.Vue)}(self,(function(e){return(()=>{"use strict";var t={583:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,"",""]);const i=o},804:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".basic-button { display: flex; padding: 10px; background: #009688; color: #fff; outline: none; border: none; border-radius: 2px; cursor: pointer;}.basic-button:active { opacity: 0.9;}",""]);const i=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var c=0;c<e.length;c++){var s=[].concat(e[c]);r&&o[s[0]]||(n&&(s[2]?s[2]="".concat(n," and ").concat(s[2]):s[2]=n),t.push(s))}},t}},379:(e,t,n)=>{var r,o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var c=e[o],s=t.base?c[0]+t.base:c[0],u=n[s]||0,l="".concat(s," ").concat(u);n[s]=u+1;var d=a(l),f={css:c[1],media:c[2],sourceMap:c[3]};-1!==d?(i[d].references++,i[d].updater(f)):i.push({identifier:l,updater:b(f,t),references:1}),r.push(l)}return r}function s(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,l=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function d(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,v=0;function b(e,t){var n,r,o;if(t.singleton){var i=v++;n=p||(p=s(t)),r=d.bind(null,n,i,!1),o=d.bind(null,n,i,!0)}else n=s(t),r=f.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var s=c(e,t),u=0;u<n.length;u++){var l=a(n[u]);0===i[l].references&&(i[l].updater(),i.splice(l,1))}n=s}}}},895:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={id:e,exports:{}};return t[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{r.r(o),r.d(o,{Button:()=>i,default:()=>d,install:()=>l});var e=r(895),t=(0,e.withScopeId)("")(((t,n)=>((0,e.openBlock)(),(0,e.createBlock)("button",{class:"basic-button",style:{background:t.color}},[(0,e.renderSlot)(t.$slots,"default")],4))));const n=(0,e.defineComponent)({render:t,name:"BButton",props:{color:{type:String},onClick:{type:Function}},setup:e=>({handleClick:t=>null==e.onClick?void 0:e.onClick(t)})});n.install=function(e){e.component(n.name,n)};const i=n;var a=r(379),c=r.n(a),s=r(804);c()(s.Z,{insert:"head",singleton:!1}),s.Z.locals;var u=r(583);function l(e){i.install&&e.use(i)}c()(u.Z,{insert:"head",singleton:!1}),u.Z.locals;const d={install:l,Button:i}})(),o})()}));
@@ -0,0 +1,5 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
@@ -0,0 +1,7 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ <inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
6
+ </profile>
7
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/tsx.iml" filepath="$PROJECT_DIR$/.idea/tsx.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/../../../.." vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,54 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ChangeListManager">
4
+ <list default="true" id="1ed9d454-cc19-4261-bbea-0d96bba7ab43" name="Changes" comment="">
5
+ <change beforePath="$PROJECT_DIR$/../sfc/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/../sfc/package.json" afterDir="false" />
6
+ <change beforePath="$PROJECT_DIR$/../sfc/yarn.lock" beforeDir="false" afterPath="$PROJECT_DIR$/../sfc/yarn.lock" afterDir="false" />
7
+ <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
8
+ <change beforePath="$PROJECT_DIR$/src/button/Button.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/button/Button.tsx" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/yarn.lock" beforeDir="false" afterPath="$PROJECT_DIR$/yarn.lock" afterDir="false" />
10
+ <change beforePath="$PROJECT_DIR$/../../tsconfig.json" beforeDir="false" afterPath="$PROJECT_DIR$/../../tsconfig.json" afterDir="false" />
11
+ </list>
12
+ <option name="SHOW_DIALOG" value="false" />
13
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
14
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
15
+ <option name="LAST_RESOLUTION" value="IGNORE" />
16
+ </component>
17
+ <component name="Git.Settings">
18
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../../.." />
19
+ </component>
20
+ <component name="ProjectId" id="1xuKCYRmyD1HrODBFDOoBe2gDQr" />
21
+ <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
22
+ <component name="ProjectViewState">
23
+ <option name="hideEmptyMiddlePackages" value="true" />
24
+ <option name="showLibraryContents" value="true" />
25
+ </component>
26
+ <component name="PropertiesComponent">
27
+ <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
28
+ <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
29
+ <property name="WebServerToolWindowFactoryState" value="true" />
30
+ <property name="node.js.detected.package.eslint" value="true" />
31
+ <property name="node.js.detected.package.stylelint" value="true" />
32
+ <property name="node.js.selected.package.eslint" value="(autodetect)" />
33
+ <property name="node.js.selected.package.stylelint" value="$PROJECT_DIR$/node_modules/stylelint" />
34
+ <property name="nodejs_package_manager_path" value="yarn" />
35
+ <property name="settings.editor.selected.configurable" value="AtomConfig" />
36
+ <property name="ts.external.directory.path" value="$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/jsLanguageServicesImpl/external" />
37
+ <property name="vue.rearranger.settings.migration" value="true" />
38
+ </component>
39
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
40
+ <component name="TaskManager">
41
+ <task active="true" id="Default" summary="Default task">
42
+ <changelist id="1ed9d454-cc19-4261-bbea-0d96bba7ab43" name="Changes" comment="" />
43
+ <created>1631199405551</created>
44
+ <option name="number" value="Default" />
45
+ <option name="presentableId" value="Default" />
46
+ <updated>1631199405551</updated>
47
+ <workItem from="1631199406816" duration="70000" />
48
+ </task>
49
+ <servers />
50
+ </component>
51
+ <component name="TypeScriptGeneratedFilesManager">
52
+ <option name="version" value="3" />
53
+ </component>
54
+ </project>
@@ -0,0 +1,6 @@
1
+ export default [
2
+ {
3
+ path: '/button',
4
+ component: () => import('/Users/qihao/varlet/packages/varlet-cli/generators/tsx/src/button/example/index.vue')
5
+ }
6
+ ]
@@ -0,0 +1,12 @@
1
+ export default [
2
+ {
3
+ path: '/zh-CN/button',
4
+ // @ts-ignore
5
+ component: () => import('/Users/qihao/varlet/packages/varlet-cli/generators/tsx/src/button/docs/zh-CN.md')
6
+ },
7
+ {
8
+ path: '/zh-CN/home',
9
+ // @ts-ignore
10
+ component: () => import('/Users/qihao/varlet/packages/varlet-cli/generators/tsx/docs/home.zh-CN.md')
11
+ }
12
+ ]
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "Basic",
3
+ "namespace": "b",
4
+ "host": "localhost",
5
+ "port": 8080,
6
+ "title": "Basic UI",
7
+ "logo": "./logo.svg",
8
+ "defaultLanguage": "zh-CN",
9
+ "highlight": {
10
+ "style": "./highlight.css"
11
+ },
12
+ "analysis": {
13
+ "baidu": ""
14
+ },
15
+ "useMobile": true,
16
+ "pc": {
17
+ "menu": [
18
+ {
19
+ "text": {
20
+ "zh-CN": "开发指南"
21
+ },
22
+ "type": 1
23
+ },
24
+ {
25
+ "text": {
26
+ "zh-CN": "基本介绍"
27
+ },
28
+ "doc": "home",
29
+ "type": 3
30
+ },
31
+ {
32
+ "text": {
33
+ "zh-CN": "基础组件"
34
+ },
35
+ "type": 1
36
+ },
37
+ {
38
+ "text": {
39
+ "zh-CN": "Button 按钮"
40
+ },
41
+ "doc": "button",
42
+ "type": 2
43
+ }
44
+ ],
45
+ "redirect": "/home",
46
+ "title": {
47
+ "zh-CN": "一个组件库",
48
+ "en-US": "Material design mobile components built for Vue3"
49
+ },
50
+ "header": {
51
+ "i18n": null,
52
+ "github": "https://github.com/haoziqaq/varlet"
53
+ }
54
+ },
55
+ "mobile": {
56
+ "redirect": "/home",
57
+ "title": {
58
+ "zh-CN": "一个组件库",
59
+ "en-US": "Material design mobile components built for Vue3"
60
+ },
61
+ "header": {
62
+ "i18n": null
63
+ }
64
+ },
65
+ "themes": {
66
+ "color-primary": "#009688",
67
+ "color-link": "#009688",
68
+ "color-type": "#009688",
69
+ "color-progress": "#009688",
70
+ "color-pc-language-active": "#3a7afe",
71
+ "color-pc-language-active-background": "#edf5ff",
72
+ "color-side-bar": "#009688",
73
+ "color-side-bar-active-background": "#00968821",
74
+ "color-app-bar": "#009688",
75
+ "color-mobile-cell-hover": "#009688",
76
+ "color-mobile-cell-hover-background": "#00968821",
77
+ "color-mobile-language-active": "#3a7afe",
78
+ "color-mobile-language-active-background": "#edf5ff"
79
+ }
80
+ }
@@ -0,0 +1,34 @@
1
+ import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
+ import { defineComponent } from 'vue';
3
+
4
+ export default defineComponent({
5
+ name: 'BButton',
6
+ props: {
7
+ color: {
8
+ type: String
9
+ },
10
+ onClick: {
11
+ type: Function
12
+ }
13
+ },
14
+
15
+ setup(props, {
16
+ slots
17
+ }) {
18
+ var handleClick = e => props.onClick == null ? void 0 : props.onClick(e);
19
+
20
+ return () => {
21
+ var {
22
+ color
23
+ } = props;
24
+ return _createVNode(_Fragment, null, [_createVNode("button", {
25
+ "class": "basic-button",
26
+ "style": {
27
+ background: color
28
+ },
29
+ "onClick": handleClick
30
+ }, [slots.default == null ? void 0 : slots.default()])]);
31
+ };
32
+ }
33
+
34
+ });
@@ -0,0 +1 @@
1
+ .basic-button { display: flex; padding: 10px; background: #009688; color: #fff; outline: none; border: none; border-radius: 2px; cursor: pointer;}.basic-button:active { opacity: 0.9;}
@@ -0,0 +1,14 @@
1
+ .basic-button {
2
+ display: flex;
3
+ padding: 10px;
4
+ background: #009688;
5
+ color: #fff;
6
+ outline: none;
7
+ border: none;
8
+ border-radius: 2px;
9
+ cursor: pointer;
10
+
11
+ &:active {
12
+ opacity: 0.9
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ // import type { App } from 'vue'
2
+ import Button from './Button';
3
+
4
+ Button.install = function (app) {
5
+ app.component(Button.name, Button);
6
+ };
7
+
8
+ export var _ButtonComponent = Button;
9
+ export default Button;
@@ -0,0 +1 @@
1
+ import '../button.css'
@@ -0,0 +1 @@
1
+ import '../button.less'
@@ -0,0 +1,18 @@
1
+ import Button, * as ButtonModule from './button'
2
+
3
+ export const _ButtonComponent = ButtonModule._ButtonComponent || {}
4
+
5
+
6
+ function install(app) {
7
+ Button.install && app.use(Button)
8
+ }
9
+
10
+ export {
11
+ install,
12
+ Button
13
+ }
14
+
15
+ export default {
16
+ install,
17
+ Button
18
+ }
@@ -0,0 +1 @@
1
+ import './button/style/less'
@@ -0,0 +1 @@
1
+ import './button/style'
@@ -0,0 +1,18 @@
1
+ import Button, * as ButtonModule from './button'
2
+
3
+ import './button/style'
4
+
5
+
6
+ function install(app) {
7
+ Button.install && app.use(Button)
8
+ }
9
+
10
+ export {
11
+ install,
12
+ Button
13
+ }
14
+
15
+ export default {
16
+ install,
17
+ Button
18
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "b-button/color": {
3
+ "type": "string",
4
+ "description": "按钮颜色 默认值:default"
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "b-button": {
3
+ "attributes": [
4
+ "color"
5
+ ]
6
+ }
7
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
+ "framework": "vue",
4
+ "version": "1.0.0",
5
+ "name": "Basic UI",
6
+ "contributions": {
7
+ "html": {
8
+ "tags": [
9
+ {
10
+ "name": "b-button",
11
+ "attributes": [
12
+ {
13
+ "name": "color",
14
+ "description": "按钮颜色",
15
+ "default": "default",
16
+ "value": {
17
+ "type": "string",
18
+ "kind": "expression"
19
+ }
20
+ }
21
+ ],
22
+ "events": [
23
+ {
24
+ "name": "click",
25
+ "description": "点击按钮时触发"
26
+ }
27
+ ],
28
+ "slots": [
29
+ {
30
+ "name": "default",
31
+ "description": "按钮内容"
32
+ }
33
+ ]
34
+ }
35
+ ],
36
+ "types-syntax": "typescript"
37
+ }
38
+ }
39
+ }
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define("Basic",["vue"],t):"object"==typeof exports?exports.Basic=t(require("vue")):e.Basic=t(e.Vue)}(self,(function(e){return(()=>{"use strict";var t={804:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".basic-button { display: flex; padding: 10px; background: #009688; color: #fff; outline: none; border: none; border-radius: 2px; cursor: pointer;}.basic-button:active { opacity: 0.9;}",""]);const i=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&o[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),t.push(u))}},t}},379:(e,t,n)=>{var r,o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function a(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var c=e[o],u=t.base?c[0]+t.base:c[0],s=n[u]||0,l="".concat(u," ").concat(s);n[u]=s+1;var d=a(l),f={css:c[1],media:c[2],sourceMap:c[3]};-1!==d?(i[d].references++,i[d].updater(f)):i.push({identifier:l,updater:b(f,t),references:1}),r.push(l)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var s,l=(s=[],function(e,t){return s[e]=t,s.filter(Boolean).join("\n")});function d(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=l(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,v=0;function b(e,t){var n,r,o;if(t.singleton){var i=v++;n=p||(p=u(t)),r=d.bind(null,n,i,!1),o=d.bind(null,n,i,!0)}else n=u(t),r=f.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r));var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=a(n[r]);i[o].references--}for(var u=c(e,t),s=0;s<n.length;s++){var l=a(n[s]);0===i[l].references&&(i[l].updater(),i.splice(l,1))}n=u}}}},895:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={id:e,exports:{}};return t[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{r.r(o),r.d(o,{Button:()=>n,default:()=>s,install:()=>u});var e=r(895);const t=(0,e.defineComponent)({name:"BButton",props:{color:{type:String},onClick:{type:Function}},setup(t,{slots:n}){var r=e=>null==t.onClick?void 0:t.onClick(e);return()=>{var{color:o}=t;return(0,e.createVNode)(e.Fragment,null,[(0,e.createVNode)("button",{class:"basic-button",style:{background:o},onClick:r},[null==n.default?void 0:n.default()])])}}});t.install=function(e){e.component(t.name,t)};const n=t;var i=r(379),a=r.n(i),c=r(804);function u(e){n.install&&e.use(n)}a()(c.Z,{insert:"head",singleton:!1}),c.Z.locals;const s={install:u,Button:n}})(),o})()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "1.22.3",
3
+ "version": "1.22.4",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/index.js"
@@ -31,7 +31,7 @@
31
31
  "dev": "tsc --watch",
32
32
  "build": "tsc"
33
33
  },
34
- "gitHead": "73fcb83a6d6fa18d7a3f72551a03f4fffe6885f7",
34
+ "gitHead": "ee9c3866bedad96c86365b0f9888a3a6bb781b1f",
35
35
  "dependencies": {
36
36
  "@babel/core": "^7.14.8",
37
37
  "@babel/preset-env": "^7.14.8",
@@ -7,22 +7,29 @@
7
7
  color: textColor,
8
8
  }"
9
9
  >
10
- <div class="var-site-app-bar__left" v-if="$slots.left">
10
+ <div class="var-site-app-bar__left">
11
11
  <slot name="left" />
12
+ <div
13
+ class="var-site-app-bar__title"
14
+ :style="{ paddingLeft: $slots.left ? 0 : undefined }"
15
+ v-if="titlePosition === 'left'"
16
+ >
17
+ <slot>{{ title }}</slot>
18
+ </div>
12
19
  </div>
13
20
 
14
- <div
15
- class="var-site-app-bar__title"
16
- :class="`var-site-app-bar__title-${titlePosition}`"
17
- :style="{
18
- paddingLeft: $slots.left && titlePosition !== 'center' ? '30px' : '10px',
19
- paddingRight: $slots.right && titlePosition !== 'center' ? '30px' : '10px',
20
- }"
21
- >
21
+ <div class="var-site-app-bar__title" v-if="titlePosition === 'center'">
22
22
  <slot>{{ title }}</slot>
23
23
  </div>
24
24
 
25
- <div class="var-site-app-bar__right" v-if="$slots.right">
25
+ <div class="var-site-app-bar__right">
26
+ <div
27
+ class="var-site-app-bar__title"
28
+ :style="{ paddingRight: $slots.right ? 0 : undefined }"
29
+ v-if="titlePosition === 'right'"
30
+ >
31
+ <slot>{{ title }}</slot>
32
+ </div>
26
33
  <slot name="right" />
27
34
  </div>
28
35
  </div>
@@ -1,15 +1,17 @@
1
1
  @site-app-bar-color: var(--site-color-primary);
2
+ @site-app-bar-height: 54px;
2
3
  @site-app-bar-text-color: #fff;
3
- @site-app-bar-height: 50px;
4
- @site-app-bar-padding: 0 10px;
5
- @site-app-bar-title-line-height: 50px;
4
+ @site-app-bar-title-padding: 0 12px;
5
+ @site-app-bar-left-gap: 6px;
6
+ @site-app-bar-right-gap: 6px;
6
7
 
7
8
  :root {
8
9
  --site-app-bar-color: @site-app-bar-color;
10
+ --site-app-bar-title-padding: @site-app-bar-title-padding;
9
11
  --site-app-bar-text-color: #fff;
10
12
  --site-app-bar-height: @site-app-bar-height;
11
- --site-app-bar-padding: @site-app-bar-padding;
12
- --site-app-bar-title-line-height: @site-app-bar-title-line-height;
13
+ --site-app-bar-left-gap: @site-app-bar-left-gap;
14
+ --site-app-bar-right-gap: @site-app-bar-right-gap;
13
15
  }
14
16
 
15
17
  .var-site-app-bar {
@@ -18,35 +20,22 @@
18
20
  justify-content: center;
19
21
  align-items: center;
20
22
  height: var(--site-app-bar-height);
21
- padding: var(--site-app-bar-padding);
22
23
  background: var(--site-app-bar-color);
23
24
  color: var(--site-app-bar-text-color);
24
25
 
25
26
  &__title {
26
27
  flex: 1;
28
+ display: flex;
29
+ justify-content: center;
27
30
  white-space: nowrap;
28
31
  text-overflow: ellipsis;
29
32
  overflow: hidden;
30
- line-height: var(--site-app-bar-title-line-height);
31
- display: flex;
32
- }
33
-
34
- &__title-center {
35
- justify-content: center;
36
- }
37
-
38
- &__title-left {
39
- justify-content: flex-start;
40
- }
41
-
42
- &__title-right {
43
- justify-content: flex-end;
33
+ padding: var(--site-app-bar-title-padding);
44
34
  }
45
35
 
46
36
  &__left,
47
37
  &__right {
48
38
  display: flex;
49
- justify-content: flex-start;
50
39
  align-items: center;
51
40
  height: 100%;
52
41
  z-index: 2;
@@ -55,12 +44,12 @@
55
44
  &__left {
56
45
  position: absolute;
57
46
  top: 0;
58
- left: 0;
47
+ left: var(--site-app-bar-left-gap);
59
48
  }
60
49
 
61
50
  &__right {
62
51
  position: absolute;
63
52
  top: 0;
64
- right: 0;
53
+ right: var(--site-app-bar-right-gap);
65
54
  }
66
55
  }
@@ -7,18 +7,31 @@
7
7
  title-position="center"
8
8
  >
9
9
  <template #left v-if="showBackIcon">
10
- <var-site-button round @click="back" color="transparent" text-color="#fff" text>
11
- <var-site-icon name="chevron-left" :size="28" />
10
+ <var-site-button
11
+ text
12
+ round
13
+ @click="back"
14
+ color="transparent"
15
+ text-color="#fff"
16
+ >
17
+ <var-site-icon name="chevron-left" :size="28" style="margin-top: 1px;" />
12
18
  </var-site-button>
13
19
  </template>
14
20
  <template #right>
15
21
  <var-site-menu
16
22
  style="background: transparent"
23
+ :offset-x="1"
17
24
  :offset-y="38"
18
25
  v-model:show="showMenu"
19
26
  v-if="languages"
20
27
  >
21
- <var-site-button text color="transparent" text-color="#fff" @click="showMenu = true">
28
+ <var-site-button
29
+ style="padding-right: 6px"
30
+ text
31
+ color="transparent"
32
+ text-color="#fff"
33
+ @click="showMenu = true"
34
+ >
22
35
  <var-site-icon name="translate" :size="24" />
23
36
  <var-site-icon name="chevron-down" :size="24" />
24
37
  </var-site-button>
@@ -136,7 +149,7 @@ header {
136
149
  }
137
150
 
138
151
  .router-view__block {
139
- padding: 50px 12px 15px;
152
+ padding: 54px 12px 15px;
140
153
  }
141
154
 
142
155
  * {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="varlet-site-mobile var-site-elevation--3">
2
+ <div class="varlet-site-mobile">
3
3
  <div class="varlet-site-mobile-content">
4
4
  <iframe :src="`./mobile.html#/${componentName}?language=${language}&platform=pc&replace=${replace}`"></iframe>
5
5
  </div>
@@ -31,7 +31,8 @@ export default {
31
31
  height: calc(100vh - 100px);
32
32
  margin-right: 38px;
33
33
  overflow: hidden;
34
- border-radius: 8px;
34
+ box-shadow: 0 0 14px 6px #eee;
35
+ border-radius: 2px;
35
36
 
36
37
  &-content {
37
38
  width: 100%;
package/LICENCE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 varlet
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.