forked from n-air-app/n-air-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v0.9.8-preview.0' into merge-upstream
- Loading branch information
Showing
55 changed files
with
1,484 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ electron.VC.db | |
plugins/ | ||
AGREEMENT.sjis | ||
patch-note.txt | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,6 @@ | |
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
.semibold; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ | |
@import "../../styles/_colors"; | ||
.studio-page { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import Vue from 'vue'; | ||
import { cloneDeep } from 'lodash'; | ||
import { Prop } from 'vue-property-decorator'; | ||
import uuid from 'uuid/v4'; | ||
import { IInputMetadata } from './index'; | ||
|
||
export abstract class BaseInput<TValueType, TMetadataType extends IInputMetadata> extends Vue { | ||
|
||
@Prop() | ||
value: TValueType; | ||
|
||
@Prop() | ||
title: string; | ||
|
||
@Prop() | ||
metadata: TMetadataType; | ||
|
||
uuid = uuid(); // uuid serves to link input field and validator message | ||
|
||
emitInput(eventData: TValueType) { | ||
this.$emit('input', eventData); | ||
} | ||
|
||
getValidations() { | ||
return { required: this.options.required }; | ||
} | ||
|
||
/** | ||
* object for vee validate plugin | ||
*/ | ||
get validate() { | ||
const validations = this.getValidations(); | ||
Object.keys(validations).forEach(key => { | ||
// VeeValidate recognizes undefined values as valid constraints | ||
// so just remove it | ||
if (validations[key] === void 0) delete validations[key]; | ||
}); | ||
return validations; | ||
} | ||
|
||
getOptions(): TMetadataType { | ||
// merge props and metadata to the 'options' object | ||
// override this method if you need add more props to the 'option' object | ||
const metadata = this.metadata || {} as TMetadataType; | ||
const options = cloneDeep(metadata); | ||
options.title = this.title || metadata.title; | ||
return options; | ||
} | ||
|
||
get options(): TMetadataType { | ||
return this.getOptions(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<template> | ||
<div class="input-container"> | ||
<div class="input-wrapper"> | ||
<div class="checkbox" @click="handleClick"> | ||
<input | ||
type="checkbox" | ||
:checked="value" | ||
/> | ||
<label>{{ options.title }}</label> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" src="./BoolInput.vue.ts"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component, Prop } from 'vue-property-decorator'; | ||
import { BaseInput } from './BaseInput'; | ||
|
||
@Component({}) | ||
export default class BoolInput extends BaseInput<boolean, {}> { | ||
|
||
|
||
@Prop() | ||
value: boolean; | ||
|
||
@Prop() | ||
title: string; | ||
|
||
handleClick() { | ||
this.emitInput(!this.value); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<div> | ||
<codemirror | ||
:value="value" | ||
:options="editorOptions[metadata.type]" | ||
@input="value => emitInput(value)" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" src="./CodeInput.vue.ts"></script> | ||
|
||
<style lang="less"> | ||
@import '~codemirror/theme/material.css'; | ||
@import '~codemirror/lib/codemirror.css'; | ||
.CodeMirror { | ||
font-size: 10pt; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { Component, Prop } from 'vue-property-decorator'; | ||
import { codemirror } from 'vue-codemirror'; | ||
import { BaseInput } from './BaseInput'; | ||
import 'codemirror/mode/javascript/javascript.js'; | ||
import 'codemirror/mode/css/css.js'; | ||
import 'codemirror/mode/htmlmixed/htmlmixed.js'; | ||
import 'codemirror/keymap/sublime'; | ||
import { IInputMetadata } from './index'; | ||
|
||
|
||
@Component({ | ||
components: { codemirror } | ||
}) | ||
export default class CodeInput extends BaseInput<string, IInputMetadata> { | ||
|
||
@Prop({ default: '' }) | ||
value: string; | ||
|
||
@Prop({ default: () => ({ type: 'html' }) }) | ||
metadata: IInputMetadata; | ||
|
||
// codemirror options | ||
editorOptions = { | ||
html: { | ||
mode: 'htmlmixed', | ||
keyMap: 'sublime', | ||
lineNumbers: true, | ||
autofocus: true, | ||
tabSize: 2, | ||
theme: 'material', | ||
autoRefresh: true, | ||
autoCloseBrackets: true, | ||
matchBrackets: true, | ||
autoCloseTags: true, | ||
extraKeys: { | ||
Tab: 'emmetExpandAbbreviation', | ||
Enter: 'emmetInsertLineBreak' | ||
} | ||
}, | ||
|
||
css: { | ||
mode: 'text/css', | ||
keyMap: 'sublime', | ||
lineNumbers: true, | ||
autofocus: true, | ||
tabSize: 2, | ||
theme: 'material', | ||
autoRefresh: true, | ||
autoCloseBrackets: true, | ||
matchBrackets: true, | ||
autoCloseTags: true, | ||
extraKeys: { | ||
Tab: 'emmetExpandAbbreviation', | ||
Enter: 'emmetInsertLineBreak' | ||
} | ||
}, | ||
|
||
js: { | ||
// codemirror options | ||
mode: 'javascript', | ||
keyMap: 'sublime', | ||
lineNumbers: true, | ||
autofocus: true, | ||
tabSize: 2, | ||
theme: 'material', | ||
autoRefresh: true, | ||
autoCloseBrackets: true, | ||
matchBrackets: true, | ||
autoCloseTags: true, | ||
} | ||
|
||
}; | ||
|
||
} |
Oops, something went wrong.