Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] e67f891a2e
Bump bl from 1.2.2 to 1.2.3 in /docs
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-29 09:45:20 +00:00
12 changed files with 6261 additions and 9603 deletions

View File

@ -10,7 +10,7 @@
# 文档 # 文档
[文档及Demo](https://dllcnx.github.io/svelma-pro/) [文档及Demo](https://keiferju.github.io/svelma-pro/)
# 快速开始 # 快速开始
@ -29,13 +29,73 @@
$ npm install --save bulma svelma-pro $ npm install --save bulma svelma-pro
### 3. scss支持 #### scss
因为组件库使用了sass样式扩展所以需要项目可以编译sass语法。如果没有集成可以参考此文档。 $ npm install --save-dev svelte-preprocess autoprefixer node-sass sass
### 3. config
在你的rollup或者webpack配置文件中添加scss支持:
[svelte-sass-template](https://github.com/KeiferJu/svelte-sass-template) ```js
// rollup配置 rollup.config.js
import sveltePreprocess from 'svelte-preprocess';
// ...
const preprocess = sveltePreprocess({
scss: {
includePaths: ['src'],
},
postcss: {
plugins: [require('autoprefixer')],
},
});
export default {
// ...
plugins: [
svelte({
// ...
preprocess: preprocess,
})
]
}
```
```js
// webpack配置 webpack.config.js
import sveltePreprocess from 'svelte-preprocess';
// ...
const preprocess = sveltePreprocess({
scss: {
includePaths: ['src'],
},
postcss: {
plugins: [require('autoprefixer')],
},
});
module.export = {
// ...
module: {
rules: [
{
test: /.(svelte|html)$/,
use: {
loader: 'svelte-loader',
options: {
preprocess,
// ...
}
}
},
]
},
]
}
```
### 4. 引入Bulma的CSS样式和svelma-pro组件 ### 4. 引入Bulma的CSS样式和svelma-pro组件
@ -56,4 +116,14 @@
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"></link> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"></link>
``` ```
...或者下载`fontawesome-free`包,引入到静态资产目录通过html引入. ...或者通过npm包:
$ npm install --save @fortawesome/fontawesome-free
```html
<!-- main.js or client.js(sapper) -->
<script>
import 'bulma/css/bulma.css'
import '@fortawesome/fontawesome-free/css/all.css'
</script>
```

12162
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@
"chokidar": "^3.0.1", "chokidar": "^3.0.1",
"codesandbox": "^2.1.6", "codesandbox": "^2.1.6",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"rollup": "^2.3.4", "rollup": "^1.0.0",
"rollup-plugin-babel": "^4.0.2", "rollup-plugin-babel": "^4.0.2",
"rollup-plugin-commonjs": "^9.1.6", "rollup-plugin-commonjs": "^9.1.6",
"rollup-plugin-includepaths": "^0.2.3", "rollup-plugin-includepaths": "^0.2.3",
@ -35,8 +35,8 @@
"rollup-plugin-node-resolve": "^4.0.0", "rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-replace": "^2.0.0", "rollup-plugin-replace": "^2.0.0",
"rollup-plugin-scss": "^1.0.1", "rollup-plugin-scss": "^1.0.1",
"rollup-plugin-svelte": "^7.0.0", "rollup-plugin-svelte": "^5.0.1",
"rollup-plugin-terser": "^7.0.0", "rollup-plugin-terser": "^4.0.4",
"sapper": "^0.27.4" "sapper": "^0.27.4"
} }
} }

View File

@ -36,14 +36,9 @@ export default {
}), }),
// scss(), // scss(),
svelte({ svelte({
compilerOptions:{
// enable run-time checks when not in production
dev, dev,
// generate: production ? 'dom' : 'ssr',
hydratable: true, hydratable: true,
emitCss: true, emitCss: true,
},
preprocess: autoPreprocess({ preprocess: autoPreprocess({
postcss: { postcss: {
plugins: [require('autoprefixer')()], plugins: [require('autoprefixer')()],

View File

@ -2640,24 +2640,6 @@
"name": "slot", "name": "slot",
"values": "default,left,right" "values": "default,left,right"
}, },
{
"description": "显示气泡",
"type": [
"Boolean"
],
"defaultvalue": "false",
"name": "tip",
"values": "default,true,false"
},
{
"description": "气泡显示值进行处理,例如:(e)=> e+1",
"type": [
"Function"
],
"defaultvalue": "value",
"name": "tipRender",
"values": "value"
},
{ {
"isEvent": true, "isEvent": true,
"description": "选择改变事件", "description": "选择改变事件",

View File

@ -26,9 +26,9 @@
}) })
let thead = ['ID', '名称', '日期', '负责人', '描述']; let thead = ['ID', '名称', '日期', '负责人', '描述'];
let tbody = [ let tbody = [
{id: 1, name: 'xxx', date: '2017/10/01 - 2019/11/30', admin: 'xxx', desc: 'xxx'}, {id: 1, name: 'Sm@rtMapX', date: '2017/10/01 - 2019/11/30', admin: '王勤', desc: '敏捷GIS开发平台'},
{id: 2, name: 'xxx', date: '2020/03/19 - 2020/10/15', admin: 'xxx', desc: 'xxx'}, {id: 2, name: 'Sm@rtEarthX', date: '2020/03/19 - 2020/10/15', admin: '宋伟', desc: '三维地图'},
{id: 3, name: 'xxx', date: '2019/07/15 - 2020/01/15', admin: 'xxx', desc: 'xxx'}, {id: 3, name: 'Sm@rtNaviX', date: '2019/07/15 - 2020/01/15', admin: '宋伟', desc: '区域导航'},
]; ];
let thead5 = ['address', 'wkb_geometry', 'ogc_fid', 'name']; let thead5 = ['address', 'wkb_geometry', 'ogc_fid', 'name'];
@ -88,9 +88,9 @@
import { Table } from 'svelma-pro' import { Table } from 'svelma-pro'
let thead = ['ID', '名称', '日期', '负责人', '描述'] let thead = ['ID', '名称', '日期', '负责人', '描述']
let tbody = [ let tbody = [
{id: 1, name: 'xxx', date: '2017/10/01 - 2019/11/30', admin: 'xxx', desc: 'xxx'}, {id: 1, name: 'Sm@rtMapX', date: '2017/10/01 - 2019/11/30', admin: '王勤', desc: '敏捷GIS开发平台'},
{id: 2, name: 'xxx', date: '2020/03/19 - 2020/10/15', admin: 'xxx', desc: 'xxx'}, {id: 2, name: 'Sm@rtEarthX', date: '2020/03/19 - 2020/10/15', admin: '宋伟', desc: '三维地图'},
{id: 3, name: 'xxx', date: '2019/07/15 - 2020/01/15', admin: 'xxx', desc: 'xxx'}, {id: 3, name: 'Sm@rtNaviX', date: '2019/07/15 - 2020/01/15', admin: '宋伟', desc: '区域导航'},
] ]
</script> </script>
<Table <Table
@ -119,9 +119,9 @@
import { Table, Datepicker } from 'svelma-pro' import { Table, Datepicker } from 'svelma-pro'
let thead = ['ID', '名称', '日期', '负责人', '描述'] let thead = ['ID', '名称', '日期', '负责人', '描述']
let tbody = [ let tbody = [
{id: 1, name: 'xxx', date: '2017/10/01 - 2019/11/30', admin: 'xxx', desc: 'xxx'}, {id: 1, name: 'Sm@rtMapX', date: '2017/10/01 - 2019/11/30', admin: '王勤', desc: '敏捷GIS开发平台'},
{id: 2, name: 'xxx', date: '2020/03/19 - 2020/10/15', admin: 'xxx', desc: 'xxx'}, {id: 2, name: 'Sm@rtEarthX', date: '2020/03/19 - 2020/10/15', admin: '宋伟', desc: '三维地图'},
{id: 3, name: 'xxx', date: '2019/07/15 - 2020/01/15', admin: 'xxx', desc: 'xxx'}, {id: 3, name: 'Sm@rtNaviX', date: '2019/07/15 - 2020/01/15', admin: '宋伟', desc: '区域导航'},
] ]
</script> </script>
<!-- 自定义表格的表格基础样式都属于自定义范畴 --> <!-- 自定义表格的表格基础样式都属于自定义范畴 -->
@ -183,9 +183,9 @@
import { Table } from 'svelma-pro' import { Table } from 'svelma-pro'
let thead = ['ID', '名称', '日期', '负责人', '描述'] let thead = ['ID', '名称', '日期', '负责人', '描述']
let tbody = [ let tbody = [
{id: 1, name: 'xxx', date: '2017/10/01 - 2019/11/30', admin: 'xxx', desc: 'xxx'}, {id: 1, name: 'Sm@rtMapX', date: '2017/10/01 - 2019/11/30', admin: '王勤', desc: '敏捷GIS开发平台'},
{id: 2, name: 'xxx', date: '2020/03/19 - 2020/10/15', admin: 'xxx', desc: 'xxx'}, {id: 2, name: 'Sm@rtEarthX', date: '2020/03/19 - 2020/10/15', admin: '宋伟', desc: '三维地图'},
{id: 3, name: 'xxx', date: '2019/07/15 - 2020/01/15', admin: 'xxx', desc: 'xxx'}, {id: 3, name: 'Sm@rtNaviX', date: '2019/07/15 - 2020/01/15', admin: '宋伟', desc: '区域导航'},
] ]
function getChecked(res) { function getChecked(res) {
console.log(res.detail) console.log(res.detail)

View File

@ -2,7 +2,7 @@
"name": "svelma-pro", "name": "svelma-pro",
"svelte": "src/index.js", "svelte": "src/index.js",
"description": "Based on svelma project extension and modification", "description": "Based on svelma project extension and modification",
"version": "2.0.1", "version": "2.0.0",
"author": "DLLCN", "author": "DLLCN",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [
@ -44,7 +44,7 @@
"postcss": "^7.0.17", "postcss": "^7.0.17",
"prettier": "^1.17.1", "prettier": "^1.17.1",
"prettier-plugin-svelte": "^0.5.1", "prettier-plugin-svelte": "^0.5.1",
"rollup": "^2.3.4", "rollup": "^1.2.2",
"rollup-plugin-alias": "^1.5.1", "rollup-plugin-alias": "^1.5.1",
"rollup-plugin-analyzer": "^3.0.1", "rollup-plugin-analyzer": "^3.0.1",
"rollup-plugin-bundle-size": "^1.0.3", "rollup-plugin-bundle-size": "^1.0.3",
@ -53,8 +53,8 @@
"rollup-plugin-livereload": "^1.0.4", "rollup-plugin-livereload": "^1.0.4",
"rollup-plugin-node-resolve": "^4.0.1", "rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-scss": "^1.0.1", "rollup-plugin-scss": "^1.0.1",
"rollup-plugin-svelte": "^7.0.0", "rollup-plugin-svelte": "^5.0.3",
"rollup-plugin-terser": "^7.0.0", "rollup-plugin-terser": "^4.0.4",
"sirv-cli": "^0.3.1", "sirv-cli": "^0.3.1",
"standard-version": "^6.0.1", "standard-version": "^6.0.1",
"svelte": "^3.9.2", "svelte": "^3.9.2",

View File

@ -29,13 +29,10 @@ export default {
], ],
plugins: [ plugins: [
svelte({ svelte({
compilerOptions:{
// enable run-time checks when not in production // enable run-time checks when not in production
dev: !production, dev: !production,
// generate: production ? 'dom' : 'ssr', // generate: production ? 'dom' : 'ssr',
hydratable: true, hydratable: true,
},
preprocess: autoPreprocess({ preprocess: autoPreprocess({
postcss: { postcss: {

View File

@ -3,7 +3,6 @@
import { omit } from '../utils' import { omit } from '../utils'
import Icon from './Icon.svelte' import Icon from './Icon.svelte'
export let customClass = '';
/** Binding value /** Binding value
* @svelte-prop {String|Number} [value] * @svelte-prop {String|Number} [value]
* */ * */
@ -155,7 +154,7 @@
{...props} {...props}
type={newType} type={newType}
{value} {value}
class="input {statusType} {customClass} class="input {statusType}
{size} {size}
{$$props.class || ''}" {$$props.class || ''}"
bind:this={input} bind:this={input}
@ -169,7 +168,7 @@
<textarea <textarea
{...props} {...props}
{value} {value}
class="textarea {statusType} {customClass} class="textarea {statusType}
{size}" {size}"
bind:this={input} bind:this={input}
on:input={onInput} on:input={onInput}

View File

@ -14,7 +14,6 @@
export let active = false; export let active = false;
export let order = false; export let order = false;
export let tip = false; export let tip = false;
export let tipRender;
$: if (active) setValue(pos); $: if (active) setValue(pos);
$: if (!active) setPos(value); $: if (!active) setPos(value);
@ -120,7 +119,7 @@
<div <div
class="progress-sli" class="progress-sli"
style={progress}/> style={progress}/>
<Thumb bind:pos={pos[0]} on:active={({ detail: v }) => active = v} on:dragEnd value={value[0]} {tip} {tipRender}> <Thumb bind:pos={pos[0]} on:active={({ detail: v }) => active = v} on:dragEnd value={value[0]} {tip}>
<slot name="left"> <slot name="left">
<slot> <slot>
<div class="thumb"/> <div class="thumb"/>
@ -128,7 +127,7 @@
</slot> </slot>
</Thumb> </Thumb>
{#if range} {#if range}
<Thumb bind:pos={pos[1]} on:active={({ detail: v }) => active = v} on:dragEnd value={value[1]} {tip} {tipRender}> <Thumb bind:pos={pos[1]} on:active={({ detail: v }) => active = v} on:dragEnd value={value[1]} {tip}>
<slot name="right"> <slot name="right">
<slot> <slot>
<div class="thumb"/> <div class="thumb"/>

View File

@ -7,7 +7,6 @@
export let pos; export let pos;
export let value; export let value;
export let tip; export let tip;
export let tipRender = (e)=> e;
function dragstart() { function dragstart() {
active = true; active = true;
@ -56,7 +55,6 @@
width: fit-content; width: fit-content;
height: fit-content; height: fit-content;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
cursor: pointer;
} }
.thumb-content::before { .thumb-content::before {
@ -83,7 +81,7 @@
on:dragend={dragend} on:dragend={dragend}
on:drag={({ detail: v }) => (pos = v)}> on:drag={({ detail: v }) => (pos = v)}>
{#if tip} {#if tip}
<div class="sli-tip">{tipRender(value)}</div> <div class="sli-tip">{value}</div>
{/if} {/if}
<div class="thumb-content" class:active> <div class="thumb-content" class:active>
<slot/> <slot/>

3532
yarn.lock Normal file

File diff suppressed because it is too large Load Diff