@things-factory/scene-form 5.0.0-alpha.7 → 5.0.0-y.0

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.
Files changed (67) hide show
  1. package/package.json +3 -3
  2. package/README.md +0 -15
  3. package/assets/button.png +0 -0
  4. package/assets/fieldset.png +0 -0
  5. package/assets/form.png +0 -0
  6. package/assets/icon-embed.png +0 -0
  7. package/assets/icon-radio-group.png +0 -0
  8. package/assets/icon-video.png +0 -0
  9. package/assets/iframe.png +0 -0
  10. package/assets/img.png +0 -0
  11. package/assets/input-checkbox.png +0 -0
  12. package/assets/input-color.png +0 -0
  13. package/assets/input-date.png +0 -0
  14. package/assets/input-email.png +0 -0
  15. package/assets/input-file.png +0 -0
  16. package/assets/input-number.png +0 -0
  17. package/assets/input-password.png +0 -0
  18. package/assets/input-radio.png +0 -0
  19. package/assets/input-range.png +0 -0
  20. package/assets/input-reset.png +0 -0
  21. package/assets/input-search.png +0 -0
  22. package/assets/input-submit.png +0 -0
  23. package/assets/input-text.png +0 -0
  24. package/assets/link.png +0 -0
  25. package/assets/select.png +0 -0
  26. package/assets/textarea.png +0 -0
  27. package/helps/scene/component/input.ko.md +0 -59
  28. package/helps/scene/component/input.md +0 -59
  29. package/helps/scene/component/input.zh.md +0 -58
  30. package/src/button.js +0 -34
  31. package/src/checkbox.js +0 -103
  32. package/src/div.js +0 -27
  33. package/src/embed.js +0 -47
  34. package/src/fieldset.js +0 -48
  35. package/src/form.js +0 -245
  36. package/src/iframe.js +0 -41
  37. package/src/img.js +0 -41
  38. package/src/index.js +0 -27
  39. package/src/input-color.js +0 -53
  40. package/src/input-date.js +0 -62
  41. package/src/input-file.js +0 -44
  42. package/src/input-number.js +0 -69
  43. package/src/input-submit.js +0 -39
  44. package/src/input.js +0 -204
  45. package/src/layout/grid-layout.js +0 -116
  46. package/src/link.js +0 -75
  47. package/src/radio-group.js +0 -70
  48. package/src/radio.js +0 -102
  49. package/src/select.js +0 -172
  50. package/src/soap-client.js +0 -213
  51. package/src/template.js +0 -99
  52. package/src/textarea.js +0 -85
  53. package/src/video.js +0 -139
  54. package/templates/index.js +0 -271
  55. package/test/basic-test.html +0 -61
  56. package/test/index.html +0 -20
  57. package/test/soap/broker.js +0 -22
  58. package/test/soap/sample.wsdl +0 -94
  59. package/test/soap/soap-client.js +0 -13
  60. package/test/soap/soap-server.js +0 -51
  61. package/test/unit/test-form.js +0 -33
  62. package/test/unit/util.js +0 -22
  63. package/things-scene.config.js +0 -5
  64. package/translations/en.json +0 -15
  65. package/translations/ko.json +0 -16
  66. package/translations/ms.json +0 -14
  67. package/translations/zh.json +0 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/scene-form",
3
- "version": "5.0.0-alpha.7",
3
+ "version": "5.0.0-y.0",
4
4
  "description": "HTML Element component for things-scene.",
5
5
  "browser": "src/index.js",
6
6
  "things-scene": true,
@@ -22,10 +22,10 @@
22
22
  "soap": "^0.34.0"
23
23
  },
24
24
  "dependencies": {
25
- "@hatiolab/things-scene": "^2.7.34",
25
+ "@hatiolab/things-scene": "^2.8.2",
26
26
  "hls.js": "^0.14.16",
27
27
  "tinycolor2": "^1.4.1",
28
28
  "xml-js": "^1.6.11"
29
29
  },
30
- "gitHead": "2c08dbd4db8d129fec03e4d6a277ea1d1e32c099"
30
+ "gitHead": "2fb8066dae72d864b0fc3a5b439a18579fa39ee6"
31
31
  }
package/README.md DELETED
@@ -1,15 +0,0 @@
1
- ## things-scene-form
2
-
3
- ## build
4
-
5
- `$ yarn build`
6
-
7
- | type | filename | for | tested |
8
- | ---- | ----------------------- | -------------- | ------ |
9
- | UMD | things-scene-form.js | modern browser | O |
10
- | UMD | things-scene-form-ie.js | ie 11 | O |
11
- | ESM | things-scene-form.mjs | modern browser | O |
12
-
13
- ## publish
14
-
15
- `$ yarn publish`
package/assets/button.png DELETED
Binary file
Binary file
package/assets/form.png DELETED
Binary file
Binary file
Binary file
Binary file
package/assets/iframe.png DELETED
Binary file
package/assets/img.png DELETED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/assets/link.png DELETED
Binary file
package/assets/select.png DELETED
Binary file
Binary file
@@ -1,59 +0,0 @@
1
- # Input
2
-
3
- 키보드나 마우스를 사용해서 사용자로부터 입력을 받아서 처리하는 컴포넌트이다.
4
- Form Container안에 배치되면, 일반적인 HTML Form에서 사용되는 다양한 종류의 HTML Input Element와 동일하게 동작한다.
5
-
6
- [The Input (Form Input) element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)
7
-
8
- ## 종류
9
-
10
- - input
11
- - input-text
12
- - input-password
13
- - input-email
14
- - input-search
15
- - input-time
16
- - input-datetime-local
17
- - input-month
18
- - input-week
19
-
20
- ## Properties
21
-
22
- - name
23
- - type: string
24
- - form 안의 엘리먼트 이름
25
- - value
26
- - type: string
27
- - input element의 값
28
- - placeholder
29
- - type: string
30
- - input element의 플레이스홀더
31
- - readonly
32
- - type: checkbox
33
- - 읽기 전용 여부
34
- - disabled
35
- - type: checkbox
36
- - form 안에서의 동작 불가
37
- - max-length
38
- - type: number
39
- - 최대 입력 글자 수
40
- - submit-on-change
41
- - type: checkbox
42
- - 엔터키나 포커스 아웃 등으로 값 변경이 확정되면, 자동으로 폼 전송
43
- - spread-on-init
44
- - type: checkbox
45
- - 초기값부터 데이타 스프레드되도록 할 것인지를 설정
46
- - true로 설정하면, 초기값이 input 컴포넌트의 data로 set되어 설정된 데이타 스프레드가 동작한다.
47
- - false로 설정하면, 초기값은 data로 set되지 않는다.
48
- - next-input
49
- - type: string
50
- - 엔터키가 입력되었을 때 자동으로 포커스가 특정 컴포넌트로 이동되도록 설정
51
- - autofocus
52
- - type: checkbox
53
- - 보드가 로드될 때, 자동으로 입력 포커스를 갖도록 할 것인지를 설정
54
- - alltime-focus
55
- - type: checkbox
56
- - 이 컴포넌트가 포커스를 잃었을 때, alltime-focus-pending에 설정된 시간 후에 자동으로 다시 포커스를 획득하도록 하는 설정
57
- - alltime-focus-pending
58
- - type: number
59
- - 이 컴포넌트가 포커스를 잃었을 때, alltime-focus가 설정되면, alltime-focus-pending에 설정된 시간(milli-seconds) 후에 자동으로 다시 포커스를 획득하도록 하는 설정
@@ -1,59 +0,0 @@
1
- # Input
2
-
3
- It is a component that receives and processes input from the user using a keyboard or mouse.
4
- When placed in a form container, it operates in the same way as various types of HTML input elements used in general HTML forms.
5
-
6
- [The Input (Form Input) element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)
7
-
8
- ## 종류
9
-
10
- - input
11
- - input-text
12
- - input-password
13
- - input-email
14
- - input-search
15
- - input-time
16
- - input-datetime-local
17
- - input-month
18
- - input-week
19
-
20
- ## Properties
21
-
22
- - name
23
- - type: string
24
- - the name of the element in the form
25
- - value
26
- - type: string
27
- - input element value
28
- - placeholder
29
- - type: string
30
- - placeholder for input element
31
- - readonly
32
- - type: checkbox
33
- - Whether read-only
34
- - disabled
35
- - type: checkbox
36
- - Operation in the form is disabled
37
- - max-length
38
- - type: number
39
- - Maximum number of characters to be entered
40
- - submit-on-change
41
- - type: checkbox
42
- - When the value change is confirmed by Enter key or focus out, etc., the form is automatically sent.
43
- - spread-on-init
44
- - type: checkbox
45
- - Set whether to spread the data from the initial value
46
- - If set to true, the initial value is set as the data of the input component, and the set data spread operates.
47
- - If set to false, the initial value is not set to data.
48
- - next-input
49
- - type: string
50
- - Set the focus to automatically move to a specific component when the enter key is pressed
51
- - autofocus
52
- - type: checkbox
53
- - Set whether to have input focus automatically when the board is loaded
54
- - alltime-focus
55
- - type: checkbox
56
- - When this component loses focus, it is set to automatically regain focus after the time set in alltime-focus-pending.
57
- - alltime-focus-pending
58
- - type: number
59
- - When this component loses focus, if alltime-focus is set, it automatically acquires focus again after the time (milli-seconds) set in alltime-focus-pending.
@@ -1,58 +0,0 @@
1
- # Input
2
-
3
- 它是使用键盘或鼠标接收和处理来自用户的输入的组件。
4
- 当放置在表单容器中时,其操作与常规HTML表单中使用的各种类型的HTML输入元素相同。
5
- [The Input (Form Input) element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)
6
-
7
- ## 种类
8
-
9
- - input
10
- - input-text
11
- - input-password
12
- - input-email
13
- - input-search
14
- - input-time
15
- - input-datetime-local
16
- - input-month
17
- - input-week
18
-
19
- ## Properties
20
-
21
- - name
22
- - type: string
23
- - 表单中元素的名称
24
- - value
25
- - type: string
26
- - 输入元素值
27
- - placeholder
28
- - type: string
29
- - 输入元素的占位符
30
- - readonly
31
- - type: checkbox
32
- - 是否只读
33
- - disabled
34
- - type: checkbox
35
- - 表格中的操作被禁用
36
- - max-length
37
- - type: number
38
- - 输入的最大字符数
39
- - submit-on-change
40
- - type: checkbox
41
- - 当按Enter键确认值更改或聚焦后,将自动发送表格。
42
- - spread-on-init
43
- - type: checkbox
44
- - 设置是否从初始值传播数据
45
- - 如果设置为true,则将初始值设置为输入组件的数据,并且设置的数据扩展操作。
46
- - 如果设置为false,则初始值不设置为data。
47
- - next-input
48
- - type: string
49
- - 将焦点设置为在按下回车键时自动移动到特定组件
50
- - autofocus
51
- - type: checkbox
52
- - 设置加载电路板时是否自动具有输入焦点
53
- - alltime-focus
54
- - type: checkbox
55
- - 当此组件失去焦点时,它将设置为在alltime-focus-pending中设置的时间后自动重新获得焦点。
56
- - alltime-focus-pending
57
- - type: number
58
- - 当此组件失去焦点时,如果设置了alltime-focus,则在alltime-focus-pending中设置的时间(毫秒)后,它将自动再次获取焦点。
package/src/button.js DELETED
@@ -1,34 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import { Component, HTMLOverlayElement } from '@hatiolab/things-scene'
5
-
6
- const NATURE = {
7
- mutable: false,
8
- resizable: true,
9
- rotatable: true,
10
- properties: [
11
- {
12
- type: 'string',
13
- label: 'value',
14
- name: 'text'
15
- }
16
- ],
17
- 'value-property': 'text'
18
- }
19
-
20
- export default class Button extends HTMLOverlayElement {
21
- get tagName() {
22
- return 'button'
23
- }
24
-
25
- get nature() {
26
- return NATURE
27
- }
28
-
29
- setElementProperties(button) {
30
- this.element.textContent = this.value
31
- }
32
- }
33
-
34
- Component.register('button', Button)
package/src/checkbox.js DELETED
@@ -1,103 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- const NATURE = {
6
- mutable: false,
7
- resizable: true,
8
- rotatable: true,
9
- properties: [
10
- {
11
- type: 'string',
12
- label: 'value',
13
- name: 'value'
14
- },
15
- {
16
- type: 'number',
17
- label: 'size',
18
- name: 'size'
19
- },
20
- {
21
- type: 'string',
22
- label: 'name',
23
- name: 'name'
24
- },
25
- {
26
- type: 'checkbox',
27
- label: 'checked',
28
- name: 'checked'
29
- },
30
- {
31
- type: 'checkbox',
32
- label: 'submit-on-change',
33
- name: 'submitOnChange'
34
- },
35
- {
36
- type: 'checkbox',
37
- label: 'spread-on-init',
38
- name: 'spreadOnInit'
39
- }
40
- ],
41
- 'value-property': 'value'
42
- }
43
-
44
- import Input from './input'
45
- import { Component } from '@hatiolab/things-scene'
46
-
47
- export default class CheckBox extends Input {
48
- get nature() {
49
- return NATURE
50
- }
51
-
52
- get tagName() {
53
- return 'input'
54
- }
55
-
56
- get inputType() {
57
- return 'checkbox'
58
- }
59
-
60
- get hasTextProperty() {
61
- return true
62
- }
63
-
64
- createElement() {
65
- this.element = document.createElement('label')
66
- if (!this.element) return
67
-
68
- var input = document.createElement('input')
69
- this.element.appendChild(input)
70
-
71
- var text = document.createTextNode(this.get('text'))
72
- this.element.appendChild(text)
73
-
74
- this.setElementProperties(this.element)
75
-
76
- if (this.parent.isHTMLElement && this.parent.isHTMLElement()) this.parent.element.appendChild(this.element)
77
- else this.root.model_layer.overlay.appendChild(this.element)
78
-
79
- Component.reposition(this)
80
-
81
- this.oncreate_element && this.oncreate_element(this.element)
82
- }
83
-
84
- setElementProperties(element) {
85
- var eText = this.element.querySelector('text')
86
- var eInput = this.element.querySelector('input')
87
-
88
- var { text, checked, value } = this.state
89
-
90
- if (eText) {
91
- eText.textContent = text
92
- }
93
-
94
- if (eInput) {
95
- eInput.checked = checked
96
- eInput.value = value
97
- }
98
-
99
- super.setElementProperties(eInput)
100
- }
101
- }
102
-
103
- Component.register('input-checkbox', CheckBox)
package/src/div.js DELETED
@@ -1,27 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- const NATURE = {
6
- mutable: false,
7
- resizable: true,
8
- rotatable: true
9
- }
10
-
11
- import { Component, HTMLOverlayContainer } from '@hatiolab/things-scene'
12
-
13
- export default class Div extends HTMLOverlayContainer {
14
- setElementProperties(div) {
15
- div.textContent = this.text
16
- }
17
-
18
- get tagName() {
19
- return 'div'
20
- }
21
-
22
- get nature() {
23
- return NATURE
24
- }
25
- }
26
-
27
- Component.register('div', Div)
package/src/embed.js DELETED
@@ -1,47 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- const NATURE = {
6
- mutable: false,
7
- resizable: true,
8
- rotatable: true,
9
- properties: [
10
- {
11
- type: 'string',
12
- label: 'src',
13
- name: 'src',
14
- },
15
- {
16
- type: 'string',
17
- label: 'mime-type',
18
- name: 'mimetype',
19
- },
20
- ],
21
- 'value-property': 'src',
22
- }
23
-
24
- import { Component, HTMLOverlayElement } from '@hatiolab/things-scene'
25
-
26
- export default class Embed extends HTMLOverlayElement {
27
- get src() {
28
- return this.getState('src')
29
- }
30
-
31
- set src(src) {
32
- this.setState('src', src)
33
- }
34
-
35
- setElementProperties(embed) {
36
- var { src = '', mimetype = '' } = this.state
37
-
38
- if (embed.src != src) embed.src = src
39
- if (embed.type != mimetype) embed.type = mimetype
40
- }
41
-
42
- get nature() {
43
- return NATURE
44
- }
45
- }
46
-
47
- Component.register('embed', Embed)
package/src/fieldset.js DELETED
@@ -1,48 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- const NATURE = {
6
- mutable: false,
7
- resizable: true,
8
- rotatable: true,
9
- properties: [
10
- {
11
- type: 'string',
12
- label: 'legend',
13
- name: 'legend'
14
- }
15
- ]
16
- }
17
-
18
- import { Component, HTMLOverlayContainer } from '@hatiolab/things-scene'
19
-
20
- export default class FieldSet extends HTMLOverlayContainer {
21
- setElementProperties(fieldset) {
22
- var { legend = '' } = this.state
23
-
24
- if (legend) {
25
- this.legendElement.textContent = legend
26
- } else {
27
- this._legendElement && this.element.removeChild(this._legendElement)
28
- delete this._legendElement
29
- }
30
- }
31
-
32
- get legendElement() {
33
- if (!this._legendElement) {
34
- var legend = document.createElement('legend')
35
- this.element.appendChild(legend)
36
-
37
- this._legendElement = legend
38
- }
39
-
40
- return this._legendElement
41
- }
42
-
43
- get nature() {
44
- return NATURE
45
- }
46
- }
47
-
48
- Component.register('fieldset', FieldSet)