@operato/property-editor 0.2.5 → 0.2.34
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.
- package/.storybook/main.js +2 -2
- package/.storybook/server.mjs +4 -4
- package/CHANGELOG.md +15 -17
- package/LICENSE +2 -2
- package/README.md +26 -7
- package/custom-elements.json +317 -0
- package/demo/index.html +16 -39
- package/dist/src/index.d.ts +1 -5
- package/dist/src/index.js +1 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-property-editor.d.ts +28 -0
- package/dist/src/ox-property-editor.js +161 -0
- package/dist/src/ox-property-editor.js.map +1 -0
- package/dist/stories/index.stories.d.ts +1 -1
- package/dist/stories/index.stories.js +11 -15
- package/dist/stories/index.stories.js.map +1 -1
- package/dist/test/property-editor.test.d.ts +1 -0
- package/dist/test/property-editor.test.js +24 -0
- package/dist/test/property-editor.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -33
- package/src/index.ts +1 -5
- package/src/ox-property-editor.ts +158 -0
- package/stories/index.stories.ts +30 -38
- package/test/property-editor.test.ts +34 -0
- package/tsconfig.json +2 -2
- package/web-dev-server.config.mjs +9 -8
- package/web-test-runner.config.mjs +7 -19
- package/.editorconfig +0 -29
- package/demo/index-3dish.html +0 -22
- package/demo/index-angle.html +0 -31
- package/demo/index-button-radio.html +0 -30
- package/demo/index-checkbox.html +0 -54
- package/demo/index-stack.html +0 -21
- package/dist/src/ox-buttons-radio.d.ts +0 -28
- package/dist/src/ox-buttons-radio.js +0 -90
- package/dist/src/ox-buttons-radio.js.map +0 -1
- package/dist/src/ox-checkbox.d.ts +0 -16
- package/dist/src/ox-checkbox.js +0 -146
- package/dist/src/ox-checkbox.js.map +0 -1
- package/dist/src/ox-input-3dish.d.ts +0 -30
- package/dist/src/ox-input-3dish.js +0 -140
- package/dist/src/ox-input-3dish.js.map +0 -1
- package/dist/src/ox-input-angle.d.ts +0 -14
- package/dist/src/ox-input-angle.js +0 -56
- package/dist/src/ox-input-angle.js.map +0 -1
- package/dist/src/ox-input-stack.d.ts +0 -21
- package/dist/src/ox-input-stack.js +0 -108
- package/dist/src/ox-input-stack.js.map +0 -1
- package/dist/test/property-angle.test.d.ts +0 -1
- package/dist/test/property-angle.test.js +0 -23
- package/dist/test/property-angle.test.js.map +0 -1
- package/src/ox-buttons-radio.ts +0 -87
- package/src/ox-checkbox.ts +0 -141
- package/src/ox-input-3dish.ts +0 -150
- package/src/ox-input-angle.ts +0 -56
- package/src/ox-input-stack.ts +0 -109
- package/test/property-angle.test.ts +0 -33
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/property-editor",
|
|
3
|
-
"
|
|
3
|
+
"version": "0.2.34",
|
|
4
|
+
"description": "Webcomponent for property-editor following open-wc recommendations",
|
|
5
|
+
"author": "heartyoh",
|
|
4
6
|
"license": "MIT",
|
|
5
|
-
"author": "property-editor",
|
|
6
|
-
"version": "0.2.5",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
9
9
|
"publishConfig": {
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
"url": "git+https://github.com/hatiolab/operato.git",
|
|
16
16
|
"directory": "webcomponents/property-editor"
|
|
17
17
|
},
|
|
18
|
-
"exports": {
|
|
19
|
-
".": "./dist/src/index.js"
|
|
20
|
-
},
|
|
18
|
+
"exports": {},
|
|
21
19
|
"scripts": {
|
|
22
20
|
"analyze": "cem analyze --litelement",
|
|
23
21
|
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
|
|
@@ -31,13 +29,20 @@
|
|
|
31
29
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
32
30
|
},
|
|
33
31
|
"dependencies": {
|
|
34
|
-
"lit": "^2.0.2"
|
|
32
|
+
"lit": "^2.0.2",
|
|
33
|
+
"lodash-es": "^4.17.21"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
38
37
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
38
|
+
"@hatiolab/things-scene": "^2.7.17",
|
|
39
|
+
"@material/mwc-fab": "^0.25.3",
|
|
40
|
+
"@material/mwc-icon": "^0.25.3",
|
|
39
41
|
"@open-wc/eslint-config": "^4.3.0",
|
|
40
42
|
"@open-wc/testing": "next",
|
|
43
|
+
"@types/bwip-js": "^2.1.1",
|
|
44
|
+
"@types/lodash-es": "^4.17.5",
|
|
45
|
+
"@types/w3c-web-usb": "^1.0.5",
|
|
41
46
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
42
47
|
"@typescript-eslint/parser": "^4.33.0",
|
|
43
48
|
"@web/dev-server": "^0.1.25",
|
|
@@ -50,33 +55,9 @@
|
|
|
50
55
|
"lint-staged": "^10.5.4",
|
|
51
56
|
"prettier": "^2.4.1",
|
|
52
57
|
"tslib": "^2.3.1",
|
|
53
|
-
"typescript": "^4.
|
|
58
|
+
"typescript": "^4.5.2"
|
|
54
59
|
},
|
|
55
60
|
"customElements": "custom-elements.json",
|
|
56
|
-
"eslintConfig": {
|
|
57
|
-
"parser": "@typescript-eslint/parser",
|
|
58
|
-
"extends": [
|
|
59
|
-
"@open-wc",
|
|
60
|
-
"prettier"
|
|
61
|
-
],
|
|
62
|
-
"plugins": [
|
|
63
|
-
"@typescript-eslint"
|
|
64
|
-
],
|
|
65
|
-
"rules": {
|
|
66
|
-
"no-unused-vars": "off",
|
|
67
|
-
"@typescript-eslint/no-unused-vars": [
|
|
68
|
-
"error"
|
|
69
|
-
],
|
|
70
|
-
"import/no-unresolved": "off",
|
|
71
|
-
"import/extensions": [
|
|
72
|
-
"error",
|
|
73
|
-
"always",
|
|
74
|
-
{
|
|
75
|
-
"ignorePackages": true
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
61
|
"prettier": "@hatiolab/prettier-config",
|
|
81
62
|
"husky": {
|
|
82
63
|
"hooks": {
|
|
@@ -89,5 +70,5 @@
|
|
|
89
70
|
"prettier --write"
|
|
90
71
|
]
|
|
91
72
|
},
|
|
92
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "4c796ad43d29f6881657831d1344e50a7a67ba06"
|
|
93
74
|
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { LitElement, css, html } from 'lit'
|
|
2
|
+
import { property, state } from 'lit/decorators.js'
|
|
3
|
+
|
|
4
|
+
import deepClone from 'lodash/cloneDeep'
|
|
5
|
+
|
|
6
|
+
export class OxPropertyEditor extends LitElement {
|
|
7
|
+
static registry: { [type: string]: string } = {}
|
|
8
|
+
|
|
9
|
+
public static register(types: { [type: string]: string }) {
|
|
10
|
+
Object.keys(types).forEach(type => {
|
|
11
|
+
OxPropertyEditor.registry[type] = types[type]
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public static getEditor(type: string): string {
|
|
16
|
+
return OxPropertyEditor.registry[type]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static styles = [
|
|
20
|
+
css`
|
|
21
|
+
:host {
|
|
22
|
+
margin: 5px;
|
|
23
|
+
|
|
24
|
+
display: grid;
|
|
25
|
+
grid-template-columns: repeat(10, 1fr);
|
|
26
|
+
grid-gap: 5px;
|
|
27
|
+
|
|
28
|
+
align-items: center;
|
|
29
|
+
|
|
30
|
+
color: var(--property-sidebar-fieldset-legend-color);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host > * {
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
|
|
36
|
+
grid-column: span 7;
|
|
37
|
+
order: 2;
|
|
38
|
+
|
|
39
|
+
align-self: stretch;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host > label {
|
|
43
|
+
grid-column: span 3;
|
|
44
|
+
order: 1;
|
|
45
|
+
|
|
46
|
+
text-align: right;
|
|
47
|
+
|
|
48
|
+
font-size: 0.8em;
|
|
49
|
+
line-height: 2;
|
|
50
|
+
text-transform: capitalize;
|
|
51
|
+
|
|
52
|
+
align-self: center;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host > input[type='checkbox'] ~ label {
|
|
56
|
+
grid-column: span 6;
|
|
57
|
+
order: 2;
|
|
58
|
+
|
|
59
|
+
text-align: left;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host > select,
|
|
63
|
+
:host > input[type='text'],
|
|
64
|
+
:host > input[type='number'] {
|
|
65
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host > legend {
|
|
69
|
+
grid-column: 1 / -1;
|
|
70
|
+
|
|
71
|
+
display: inline-block;
|
|
72
|
+
|
|
73
|
+
text-align: left;
|
|
74
|
+
text-transform: capitalize;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host > [fullwidth] {
|
|
78
|
+
grid-column: 1 / -1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host > input[type='checkbox'] {
|
|
82
|
+
grid-column: span 4;
|
|
83
|
+
order: 1;
|
|
84
|
+
|
|
85
|
+
justify-self: end;
|
|
86
|
+
align-self: center;
|
|
87
|
+
}
|
|
88
|
+
`
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
@property({ type: Object }) value: any
|
|
92
|
+
@property({ type: String }) type!: string
|
|
93
|
+
@property({ type: String }) label!: string
|
|
94
|
+
@property({ type: String }) placeholder?: string
|
|
95
|
+
@property({ type: Object }) property: any
|
|
96
|
+
@property({ type: Object }) host: any
|
|
97
|
+
@property({ type: Object }) observe?: (value: any) => void
|
|
98
|
+
|
|
99
|
+
connectedCallback() {
|
|
100
|
+
super.connectedCallback()
|
|
101
|
+
|
|
102
|
+
this.renderRoot.addEventListener('change', this._valueChanged.bind(this))
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
editorTemplate(props: { [key: string]: any }) {
|
|
106
|
+
return html``
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
render() {
|
|
110
|
+
return html`
|
|
111
|
+
${this.editorTemplate(this)}
|
|
112
|
+
${this.label
|
|
113
|
+
? html`
|
|
114
|
+
<label for="editor">
|
|
115
|
+
<i18n-msg msgid=${this._computeLabelId(this.label)}>${this.label}</i18n-msg>
|
|
116
|
+
</label>
|
|
117
|
+
`
|
|
118
|
+
: html``}
|
|
119
|
+
`
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@state() __by_me = false
|
|
123
|
+
|
|
124
|
+
shouldUpdate(changedProperties: any) {
|
|
125
|
+
if (this.__by_me) {
|
|
126
|
+
return false
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (changedProperties.has('value')) {
|
|
130
|
+
this.__by_me = true
|
|
131
|
+
this.value = deepClone(this.value)
|
|
132
|
+
this.__by_me = false
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return true
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
get valueProperty() {
|
|
139
|
+
return 'value'
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_computeLabelId(label: string) {
|
|
143
|
+
if (label.indexOf('label.') >= 0) return label
|
|
144
|
+
|
|
145
|
+
return 'label.' + label
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
_valueChanged(e: Event) {
|
|
149
|
+
e.stopPropagation()
|
|
150
|
+
|
|
151
|
+
this.value = deepClone((e.target as any)[this.valueProperty])
|
|
152
|
+
|
|
153
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
|
154
|
+
|
|
155
|
+
if (!this.observe) return
|
|
156
|
+
this.observe.call(this, this.value)
|
|
157
|
+
}
|
|
158
|
+
}
|
package/stories/index.stories.ts
CHANGED
|
@@ -1,60 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import '../index.js'
|
|
2
|
+
|
|
3
|
+
import { TemplateResult, html } from 'lit'
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: 'PropertyEditor',
|
|
6
|
-
component: 'property-editor',
|
|
7
|
+
component: 'ox-property-editor',
|
|
7
8
|
argTypes: {
|
|
8
9
|
title: { control: 'text' },
|
|
9
10
|
counter: { control: 'number' },
|
|
10
|
-
textColor: { control: 'color' }
|
|
11
|
-
}
|
|
12
|
-
}
|
|
11
|
+
textColor: { control: 'color' }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
13
14
|
|
|
14
15
|
interface Story<T> {
|
|
15
|
-
(args: T): TemplateResult
|
|
16
|
-
args?: Partial<T
|
|
17
|
-
argTypes?: Record<string, unknown
|
|
16
|
+
(args: T): TemplateResult
|
|
17
|
+
args?: Partial<T>
|
|
18
|
+
argTypes?: Record<string, unknown>
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
interface ArgTypes {
|
|
21
|
-
title?: string
|
|
22
|
-
counter?: number
|
|
23
|
-
textColor?: string
|
|
24
|
-
slot?: TemplateResult
|
|
22
|
+
title?: string
|
|
23
|
+
counter?: number
|
|
24
|
+
textColor?: string
|
|
25
|
+
slot?: TemplateResult
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
const Template: Story<ArgTypes> = ({
|
|
28
|
-
|
|
29
|
-
counter = 5,
|
|
30
|
-
textColor,
|
|
31
|
-
slot,
|
|
32
|
-
}: ArgTypes) => html`
|
|
33
|
-
<property-editor
|
|
34
|
-
style="--property-editor-text-color: ${textColor || 'black'}"
|
|
35
|
-
.title=${title}
|
|
36
|
-
.counter=${counter}
|
|
37
|
-
>
|
|
28
|
+
const Template: Story<ArgTypes> = ({ title = 'Hello world', counter = 5, textColor, slot }: ArgTypes) => html`
|
|
29
|
+
<ox-board-viewer style="--board-viewer-text-color: ${textColor || 'black'}" .title=${title} .counter=${counter}>
|
|
38
30
|
${slot}
|
|
39
|
-
</
|
|
40
|
-
|
|
31
|
+
</ox-board-viewer>
|
|
32
|
+
`
|
|
41
33
|
|
|
42
|
-
export const Regular = Template.bind({})
|
|
34
|
+
export const Regular = Template.bind({})
|
|
43
35
|
|
|
44
|
-
export const CustomTitle = Template.bind({})
|
|
36
|
+
export const CustomTitle = Template.bind({})
|
|
45
37
|
CustomTitle.args = {
|
|
46
|
-
title: 'My title'
|
|
47
|
-
}
|
|
38
|
+
title: 'My title'
|
|
39
|
+
}
|
|
48
40
|
|
|
49
|
-
export const CustomCounter = Template.bind({})
|
|
41
|
+
export const CustomCounter = Template.bind({})
|
|
50
42
|
CustomCounter.args = {
|
|
51
|
-
counter: 123456
|
|
52
|
-
}
|
|
43
|
+
counter: 123456
|
|
44
|
+
}
|
|
53
45
|
|
|
54
|
-
export const SlottedContent = Template.bind({})
|
|
46
|
+
export const SlottedContent = Template.bind({})
|
|
55
47
|
SlottedContent.args = {
|
|
56
|
-
slot: html`<p>Slotted content</p
|
|
57
|
-
}
|
|
48
|
+
slot: html`<p>Slotted content</p>`
|
|
49
|
+
}
|
|
58
50
|
SlottedContent.argTypes = {
|
|
59
|
-
slot: { table: { disable: true } }
|
|
60
|
-
}
|
|
51
|
+
slot: { table: { disable: true } }
|
|
52
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import '../src/ox-property-editor'
|
|
2
|
+
|
|
3
|
+
import { expect, fixture } from '@open-wc/testing'
|
|
4
|
+
|
|
5
|
+
import { OxPropertyEditor } from '../src/ox-property-editor'
|
|
6
|
+
import { html } from 'lit'
|
|
7
|
+
|
|
8
|
+
describe('OxPropertyEditor', () => {
|
|
9
|
+
it('has a default title "Hey there" and counter 5', async () => {
|
|
10
|
+
const el = await fixture<OxPropertyEditor>(html` <ox-property-editor></ox-property-editor> `)
|
|
11
|
+
|
|
12
|
+
// expect(el.title).to.equal('Hey there')
|
|
13
|
+
// expect(el.counter).to.equal(5)
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('increases the counter on button click', async () => {
|
|
17
|
+
const el = await fixture<OxPropertyEditor>(html` <ox-property-editor></ox-property-editor> `)
|
|
18
|
+
el.renderRoot!.querySelector('button')!.click()
|
|
19
|
+
|
|
20
|
+
// expect(el.counter).to.equal(6)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('can override the title via attribute', async () => {
|
|
24
|
+
const el = await fixture<OxPropertyEditor>(html` <property-editor title="attribute title"></ox-property-editor> `)
|
|
25
|
+
|
|
26
|
+
expect(el.title).to.equal('attribute title')
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
it('passes the a11y audit', async () => {
|
|
30
|
+
const el = await fixture<OxPropertyEditor>(html` <ox-property-editor></ox-property-editor> `)
|
|
31
|
+
|
|
32
|
+
await expect(el).shadowDom.to.be.accessible()
|
|
33
|
+
})
|
|
34
|
+
})
|
package/tsconfig.json
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
2
|
|
|
3
3
|
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
-
const hmr = process.argv.includes('--hmr')
|
|
4
|
+
const hmr = process.argv.includes('--hmr')
|
|
5
5
|
|
|
6
6
|
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
+
nodeResolve: true,
|
|
7
8
|
open: '/demo/',
|
|
8
|
-
/** Use regular watch mode if HMR is not enabled. */
|
|
9
9
|
watch: !hmr,
|
|
10
|
-
/** Resolve bare module imports */
|
|
11
|
-
nodeResolve: {
|
|
12
|
-
exportConditions: ['browser', 'development'],
|
|
13
|
-
},
|
|
14
10
|
|
|
15
11
|
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
12
|
// esbuildTarget: 'auto'
|
|
@@ -18,10 +14,15 @@ export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
|
18
14
|
/** Set appIndex to enable SPA routing */
|
|
19
15
|
// appIndex: 'demo/index.html',
|
|
20
16
|
|
|
17
|
+
/** Confgure bare import resolve plugin */
|
|
18
|
+
// nodeResolve: {
|
|
19
|
+
// exportConditions: ['browser', 'development']
|
|
20
|
+
// },
|
|
21
|
+
|
|
21
22
|
plugins: [
|
|
22
23
|
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
23
24
|
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
24
|
-
]
|
|
25
|
+
]
|
|
25
26
|
|
|
26
27
|
// See documentation for all available options
|
|
27
|
-
})
|
|
28
|
+
})
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
2
|
|
|
3
|
-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
-
|
|
5
3
|
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
-
/** Test files to run */
|
|
7
4
|
files: 'dist/test/**/*.test.js',
|
|
8
|
-
|
|
9
|
-
/** Resolve bare module imports */
|
|
10
|
-
nodeResolve: {
|
|
11
|
-
exportConditions: ['browser', 'development'],
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
/** Filter out lit dev mode logs */
|
|
15
|
-
filterBrowserLogs(log) {
|
|
16
|
-
for (const arg of log.args) {
|
|
17
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
},
|
|
5
|
+
nodeResolve: true
|
|
23
6
|
|
|
24
7
|
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
8
|
// esbuildTarget: 'auto',
|
|
26
9
|
|
|
10
|
+
/** Confgure bare import resolve plugin */
|
|
11
|
+
// nodeResolve: {
|
|
12
|
+
// exportConditions: ['browser', 'development']
|
|
13
|
+
// },
|
|
14
|
+
|
|
27
15
|
/** Amount of browsers to run concurrently */
|
|
28
16
|
// concurrentBrowsers: 2,
|
|
29
17
|
|
|
@@ -38,4 +26,4 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
|
38
26
|
// ],
|
|
39
27
|
|
|
40
28
|
// See documentation for all available options
|
|
41
|
-
})
|
|
29
|
+
})
|
package/.editorconfig
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
[*]
|
|
9
|
-
|
|
10
|
-
# Change these settings to your own preference
|
|
11
|
-
indent_style = space
|
|
12
|
-
indent_size = 2
|
|
13
|
-
|
|
14
|
-
# We recommend you to keep these unchanged
|
|
15
|
-
end_of_line = lf
|
|
16
|
-
charset = utf-8
|
|
17
|
-
trim_trailing_whitespace = true
|
|
18
|
-
insert_final_newline = true
|
|
19
|
-
|
|
20
|
-
[*.md]
|
|
21
|
-
trim_trailing_whitespace = false
|
|
22
|
-
|
|
23
|
-
[*.json]
|
|
24
|
-
indent_size = 2
|
|
25
|
-
|
|
26
|
-
[*.{html,js,md}]
|
|
27
|
-
block_comment_start = /**
|
|
28
|
-
block_comment = *
|
|
29
|
-
block_comment_end = */
|
package/demo/index-3dish.html
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="demo"></div>
|
|
13
|
-
|
|
14
|
-
<script type="module">
|
|
15
|
-
import { html, render } from 'lit'
|
|
16
|
-
import '../dist/src/ox-input-angle.js'
|
|
17
|
-
import '../dist/src/ox-input-3dish.js'
|
|
18
|
-
|
|
19
|
-
render(html` <ox-input-3dish></ox-input-3dish> `, document.querySelector('#demo'))
|
|
20
|
-
</script>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|
package/demo/index-angle.html
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="demo"></div>
|
|
13
|
-
|
|
14
|
-
<script type="module">
|
|
15
|
-
import { html, render } from 'lit'
|
|
16
|
-
import '../dist/src/ox-input-angle.js'
|
|
17
|
-
|
|
18
|
-
const placeholder = 'enter a angle in degree'
|
|
19
|
-
render(
|
|
20
|
-
html`
|
|
21
|
-
<ox-input-angle
|
|
22
|
-
radian="1"
|
|
23
|
-
placeholder=${placeholder}
|
|
24
|
-
@change=${e => console.log(e.target.radian)}
|
|
25
|
-
></ox-input-angle>
|
|
26
|
-
`,
|
|
27
|
-
document.querySelector('#demo')
|
|
28
|
-
)
|
|
29
|
-
</script>
|
|
30
|
-
</body>
|
|
31
|
-
</html>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="demo"></div>
|
|
13
|
-
|
|
14
|
-
<script type="module">
|
|
15
|
-
import { html, render } from 'lit'
|
|
16
|
-
import '../dist/src/ox-buttons-radio.js'
|
|
17
|
-
|
|
18
|
-
render(
|
|
19
|
-
html`
|
|
20
|
-
<ox-buttons-radio @change=${e => console.log(e.target.value)}>
|
|
21
|
-
<div data-value="top">TOP</div>
|
|
22
|
-
<div data-value="middle">MID</div>
|
|
23
|
-
<div data-value="bottom">BOT</div>
|
|
24
|
-
</ox-buttons-radio>
|
|
25
|
-
`,
|
|
26
|
-
document.querySelector('#demo')
|
|
27
|
-
)
|
|
28
|
-
</script>
|
|
29
|
-
</body>
|
|
30
|
-
</html>
|
package/demo/index-checkbox.html
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
* {
|
|
10
|
-
margin-bottom: 5px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.customized {
|
|
14
|
-
/* checkbox default */
|
|
15
|
-
--ox-checkbox-fill-color: rgba(0, 0, 0, 0.1);
|
|
16
|
-
--ox-checkbox-border: 1px solid rgba(0, 0, 0, 0.3);
|
|
17
|
-
--ox-checkbox-border-radius: var(--border-radius, 4px);
|
|
18
|
-
--ox-checkbox-size: 18px;
|
|
19
|
-
--ox-checkbox-background-color: var(--theme-white-color, #fff);
|
|
20
|
-
--ox-checkbox-label-color: var(--primary-text-color, #3a5877);
|
|
21
|
-
--ox-checkbox-label-margin: 0 0 0 7px;
|
|
22
|
-
|
|
23
|
-
/* checkbox checked */
|
|
24
|
-
--ox-checkbox-checked-background-color: var(--ox-checkbox-background-color);
|
|
25
|
-
--ox-checkbox-checked-color: var(--primary-color, #38a25b);
|
|
26
|
-
--ox-checkbox-checked-border: 1px solid var(--ox-checkbox-checked-color);
|
|
27
|
-
--ox-checkbox-checked-font-weight: bold;
|
|
28
|
-
|
|
29
|
-
/* checkbox unchecked */
|
|
30
|
-
--ox-checkbox-unchecked-background-color: var(--ox-checkbox-background-color);
|
|
31
|
-
--ox-checkbox-unchecked-border: var(--ox-checkbox-border);
|
|
32
|
-
--ox-checkbox-unchecked-color: var(--ox-checkbox-fill-color);
|
|
33
|
-
|
|
34
|
-
/* checkbox disabled */
|
|
35
|
-
--ox-checkbox-disabled-opacity: 0.5;
|
|
36
|
-
|
|
37
|
-
font-size: 1.1em;
|
|
38
|
-
}
|
|
39
|
-
</style>
|
|
40
|
-
</head>
|
|
41
|
-
<body>
|
|
42
|
-
<div id="demo"></div>
|
|
43
|
-
|
|
44
|
-
<script type="module">
|
|
45
|
-
import { html, render } from 'lit'
|
|
46
|
-
import '../dist/src/ox-checkbox.js'
|
|
47
|
-
|
|
48
|
-
render(
|
|
49
|
-
html` <ox-checkbox @change=${e => console.log(e.target.checked)} class="customized">Custom</ox-checkbox> `,
|
|
50
|
-
document.querySelector('#demo')
|
|
51
|
-
)
|
|
52
|
-
</script>
|
|
53
|
-
</body>
|
|
54
|
-
</html>
|
package/demo/index-stack.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-GB">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<style>
|
|
6
|
-
body {
|
|
7
|
-
background: #fafafa;
|
|
8
|
-
}
|
|
9
|
-
</style>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="demo"></div>
|
|
13
|
-
|
|
14
|
-
<script type="module">
|
|
15
|
-
import { html, render } from 'lit'
|
|
16
|
-
import '../dist/src/ox-stack.js'
|
|
17
|
-
|
|
18
|
-
render(html` <ox-stack> </ox-stack> `, document.querySelector('#demo'))
|
|
19
|
-
</script>
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
5
|
-
/**
|
|
6
|
-
여러 버튼 중에서 하나만 눌리거나, 모두 눌리지 않은 상태만을 갖는 라디오 형태의 버튼이다.
|
|
7
|
-
|
|
8
|
-
Example:
|
|
9
|
-
|
|
10
|
-
<ox-buttons-radio @change=${e => this._onChange(e)} value=${value}>
|
|
11
|
-
<div data-value="top"></div>
|
|
12
|
-
<div data-value="middle"></div>
|
|
13
|
-
<div data-value="bottom"></div>
|
|
14
|
-
</ox-buttons-radio>
|
|
15
|
-
*/
|
|
16
|
-
export declare class PropertyButtonsRadio extends LitElement {
|
|
17
|
-
static styles: import("lit").CSSResult[];
|
|
18
|
-
/**
|
|
19
|
-
* `value`는 버튼의 눌린 상태를 값으로 갖는 속성이다.
|
|
20
|
-
*/
|
|
21
|
-
value: Object | null;
|
|
22
|
-
mandatory: boolean;
|
|
23
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
24
|
-
updated(changes: PropertyValues<this>): void;
|
|
25
|
-
get buttons(): Element[];
|
|
26
|
-
_onValueChanged(value: Object | null): void;
|
|
27
|
-
_onTapButton(e: Event): void;
|
|
28
|
-
}
|