-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
7,624 additions
and
22,973 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
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,29 @@ | ||
import Button from '~widgets/button/widget.vue'; | ||
import registerWidget from '~core/registerWidget'; | ||
|
||
registerWidget('ui-button', Button); | ||
|
||
|
||
export const Component = { | ||
render: (args) => ({ | ||
setup() { | ||
return { args }; | ||
}, | ||
template: `<ui-button disabled v-bind="args"></ui-button>`, | ||
}), | ||
|
||
args: { | ||
text: 'Text', | ||
}, | ||
}; | ||
|
||
export default { | ||
title: 'Components/Button', | ||
component: Button, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
argTypes: { | ||
text: 'text', | ||
}, | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,34 @@ | ||
import { mount } from '@vue/test-utils' | ||
import Button from './widget'; | ||
|
||
|
||
describe('Button widget', () => { | ||
let result; | ||
|
||
describe('computed', () => { | ||
describe('#style', () => { | ||
it('returns the styles', () => { | ||
const wrapper = mount(Button) | ||
|
||
result = wrapper.vm.style; | ||
|
||
expect(result).toEqual(` | ||
background-color: #2C98F0; | ||
color: #FFF; | ||
`); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('methods', () => { | ||
describe('#onClick', () => { | ||
it('emits clicked event if it is not disabled', async () => { | ||
const wrapper = mount(Button) | ||
|
||
result = wrapper.vm.onClick(); | ||
|
||
expect(wrapper.emitted('clicked')).toBeTruthy() | ||
}); | ||
}); | ||
}); | ||
}); |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,92 @@ | ||
const { VueLoaderPlugin } = require('vue-loader'); | ||
const ESLintPlugin = require('eslint-webpack-plugin'); | ||
|
||
const { resolve } = require("path"); | ||
|
||
module.exports = { | ||
mode: process.env.NODE_ENV, | ||
|
||
experiments: { | ||
outputModule: true, | ||
}, | ||
|
||
entry: resolve(__dirname, 'src/index.js'), | ||
|
||
output: { | ||
path: resolve(__dirname, '..', 'dist'), | ||
filename: 'index.js', | ||
library: { | ||
type: 'module', | ||
}, | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
use: { | ||
loader: 'vue-loader', | ||
options: { | ||
customElement: true, | ||
compilerOptions: { | ||
isCustomElement: tag => tag.startsWith('ui-'), | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
include: [resolve('app'), resolve('test')], | ||
exclude: /node_modules/, | ||
}, | ||
{ | ||
test: /\.styl(us)?$/, | ||
use: [ | ||
'vue-style-loader', | ||
'css-loader', | ||
'stylus-loader', | ||
], | ||
}, | ||
{ | ||
test: /\.svg/, | ||
type: 'asset/source', | ||
loader: 'svgo-loader', | ||
options: { | ||
configFile: resolve(__dirname, 'svgo.config.js'), | ||
}, | ||
}, | ||
], | ||
}, | ||
|
||
resolve: { | ||
alias: { | ||
'~core': resolve(__dirname, './src/core'), | ||
'~widgets': resolve(__dirname, './src/widgets'), | ||
'~constants': resolve(__dirname, './src/constants'), | ||
}, | ||
}, | ||
|
||
plugins: [ | ||
new VueLoaderPlugin(), | ||
|
||
new ESLintPlugin({ | ||
extensions: ['js', 'vue'], | ||
}), | ||
], | ||
devServer: { | ||
hot: true, | ||
|
||
allowedHosts: 'all', | ||
|
||
headers: { | ||
"Access-Control-Allow-Origin": "*", | ||
}, | ||
|
||
static: ['dist'], | ||
|
||
historyApiFallback: { | ||
rewrites: [{ from: /./, to: '/index.js' }], | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.