迭代版本号

This commit is contained in:
KeiferJu 2020-03-23 14:23:43 +08:00
parent 638b5e8d32
commit 63bb497eb0
4 changed files with 92 additions and 48 deletions

View File

@ -76,10 +76,10 @@
{ {
"description": "当前日期", "description": "当前日期",
"type": [ "type": [
"DateObject" "timestamp"
], ],
"defaultvalue": "", "defaultvalue": "",
"name": "nowDate", "name": "date",
"values": "" "values": ""
}, },
{ {
@ -176,6 +176,22 @@
"defaultvalue": "left", "defaultvalue": "left",
"name": "align", "name": "align",
"values": "'left'、'center'、'right'" "values": "'left'、'center'、'right'"
},{
"description": "图标",
"type": [
"Boolean"
],
"defaultvalue": "true",
"name": "icon",
"values": ""
},{
"description": "输入框样式类",
"type": [
"String"
],
"defaultvalue": "",
"name": "inputClass",
"values": ""
} }
], ],
"Timepicker": [ "Timepicker": [
@ -207,6 +223,7 @@
"values": "" "values": ""
}, },
{ {
"isEvent": true,
"description": "选定事件", "description": "选定事件",
"name": "timeChecked", "name": "timeChecked",
"values": "" "values": ""
@ -228,6 +245,22 @@
"defaultvalue": "left", "defaultvalue": "left",
"name": "align", "name": "align",
"values": "'left'、'center'、'right'" "values": "'left'、'center'、'right'"
},{
"description": "图标",
"type": [
"Boolean"
],
"defaultvalue": "true",
"name": "icon",
"values": ""
},{
"description": "输入框样式类",
"type": [
"String"
],
"defaultvalue": "",
"name": "inputClass",
"values": ""
} }
], ],
"Dialog": [ "Dialog": [

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": "1.0.1", "version": "1.0.2",
"author": "KeiferJu", "author": "KeiferJu",
"license": "MIT", "license": "MIT",
"keywords": [ "keywords": [

View File

@ -9,11 +9,12 @@
import { obtainWeeks } from './main.js' import { obtainWeeks } from './main.js'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import Input from '../Input.svelte'
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
export let width = '100%' export let width = '100%'
export let nowDate = new Date() let nowDate = new Date()
export let i18n = 'ZH' export let i18n = 'ZH'
export let markDate = [] export let markDate = []
@ -26,20 +27,27 @@
export let pickerRule = 'singleChoice' export let pickerRule = 'singleChoice'
export let align = "left"; export let align = 'left'
let left; export let icon = true;
export let inputClass = '';
let left
$: { $: {
if(align === 'center'){ if (align === 'center') {
left = 'calc(50% - 150px)'; left = 'calc(50% - 150px)'
}else if(align === 'right'){ } else if (align === 'right') {
left = 'calc(100% - 300px)' left = 'calc(100% - 300px)'
}else{ } else {
left = 0; left = 0
} }
} }
let pickerResult = [] let pickerResult = []
let rangePickerResult = '';
$: {
if (pickerRule === 'rangeChoice') {
rangePickerResult = pickerResult[0].start+ ' ~ ' + pickerResult[1].end
}
}
if (pickerRule === 'singleChoice') { if (pickerRule === 'singleChoice') {
const dt = new Date(Number(date)) const dt = new Date(Number(date))
@ -173,49 +181,46 @@
.range-input { .range-input {
width: 50%; width: 50%;
display: inline-block;
} }
.range-input.left, /* .input.left,
.range-input.left:focus, .input.left:focus,
.range-input.left:active { .input.left:hover
.input.left:active {
border-right: 0; border-right: 0;
border-color: #dbdbdb !important;
box-shadow: none !important; box-shadow: none !important;
/* float: left; */
} }
.range-input.right, .input.right,
.range-input.right:focus, .input.right:focus,
.range-input.right:active { .input.right:hover,
.input.right:active {
border-left: 0; border-left: 0;
border-color: #dbdbdb !important;
box-shadow: none !important; box-shadow: none !important;
float: right; } */
}
</style> </style>
<div style="width: {width};position: relative"> <div style="width: {width};position: relative">
{#if !calendar} {#if !calendar}
{#if pickerRule === 'rangeChoice'} {#if pickerRule === 'rangeChoice'}
<div <div
style="position: relative;" style="position: relative;margin: 5px 0 0 0;"
on:click={() => { on:click={() => {
visible = !visible visible = !visible
}}> }}>
<input class="dp-input input is-primary range-input left" type="text" value={pickerResult[0].start} readonly /> <Input type="text" class={inputClass} bind:value={rangePickerResult} readonly iconPack="fa" icon="{icon? 'calendar': ''}" />
<span class="fa fa-calendar date-icon" />
<input class="dp-input input is-primary range-input right" type="text" value={pickerResult[1].end} readonly />
<span class="fa fa-chevron-right date-icon" style="left: calc(50% - 5px);" />
</div> </div>
{:else} {:else}
<div style="position: relative;"> <div
<input style="position: relative;margin: 5px 0 0 0;"
class="dp-input input is-primary" on:click={() => {
type="text" visible = !visible
value={pickerResult} }}>
readonly <Input type="text" class={inputClass} bind:value={pickerResult} readonly iconPack="fa" icon="{icon? 'calendar': ''}" />
on:click={() => { <!-- <span class="fa fa-calendar date-icon" /> -->
visible = !visible
}} />
<span class="fa fa-calendar date-icon" />
</div> </div>
{/if} {/if}
{/if} {/if}

View File

@ -1,12 +1,15 @@
<script> <script>
import Switcher from './Switcher.svelte' import Switcher from './Switcher.svelte'
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from 'svelte'
import Input from '../Input.svelte'
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
export let width = '100%' export let width = '100%'
export let hour12 = false // 是否12进制 export let hour12 = false // 是否12进制
export let align = "left"; export let align = "left";
export let icon = true;
export let inputClass = '';
let left; let left;
$: { $: {
if(align === 'center'){ if(align === 'center'){
@ -156,7 +159,7 @@
overflow: hidden; overflow: hidden;
} }
.touch-time-reset > button { /* .touch-time-reset > button {
width: 100px; width: 100px;
height: 30px; height: 30px;
border-radius: 15px; border-radius: 15px;
@ -170,7 +173,7 @@
.touch-time-reset button:nth-child(1):active { .touch-time-reset button:nth-child(1):active {
-webkit-transform: scale(0.95); -webkit-transform: scale(0.95);
transform: scale(0.95); transform: scale(0.95);
} } */
.touch-time { .touch-time {
/* font-size: 30px; /* font-size: 30px;
@ -178,15 +181,15 @@
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
} }
.dp-input { /* .dp-input {
margin: 5px 0 0 0; margin: 5px 0 0 0;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
display: inline-block; display: inline-block;
padding-left: 30px; padding-left: 30px;
} } */
.date-icon { /* .date-icon {
height: 40px; height: 40px;
display: inline-block; display: inline-block;
width: 40px; width: 40px;
@ -194,12 +197,14 @@
bottom: 0; bottom: 0;
left: 10px; left: 10px;
line-height: 40px; line-height: 40px;
} } */
</style> </style>
<div style="width: {width}"> <div style="width: {width};position: relative">
<div style="position: relative"> <div style="position: relative" on:click={() => {
<input visible = !visible
}} >
<!-- <input
class="dp-input input is-primary" class="dp-input input is-primary"
type="text" type="text"
readonly readonly
@ -207,8 +212,10 @@
on:click={() => { on:click={() => {
visible = !visible visible = !visible
}} /> }} />
<span class="fa fa-clock date-icon" /> <span class="fa fa-clock date-icon" /> -->
{#if visible} <Input type="text" class={inputClass} bind:value={_time} readonly iconPack="fa" icon="{icon? 'clock': ''}" />
</div>
{#if visible}
<div class="touch-time-wrapper" style="left: {left}"> <div class="touch-time-wrapper" style="left: {left}">
<div class="touch-time">{_time}</div> <div class="touch-time">{_time}</div>
<div class="touch-time-picker"> <div class="touch-time-picker">
@ -235,5 +242,4 @@
</div> --> </div> -->
</div> </div>
{/if} {/if}
</div>
</div> </div>