@operato/property-editor 1.0.0-alpha.2 → 1.0.0-alpha.5

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 (85) hide show
  1. package/@types/global/index.d.ts +2 -0
  2. package/CHANGELOG.md +31 -0
  3. package/demo/index.html +121 -2
  4. package/dist/src/index.d.ts +2 -1
  5. package/dist/src/index.js +2 -1
  6. package/dist/src/index.js.map +1 -1
  7. package/dist/src/ox-properties-dynamic-view.d.ts +4 -0
  8. package/dist/src/ox-properties-dynamic-view.js +118 -0
  9. package/dist/src/ox-properties-dynamic-view.js.map +1 -0
  10. package/dist/src/ox-property-editor-angle.d.ts +5 -0
  11. package/dist/src/ox-property-editor-angle.js +17 -0
  12. package/dist/src/ox-property-editor-angle.js.map +1 -0
  13. package/dist/src/ox-property-editor-checkbox.d.ts +6 -0
  14. package/dist/src/ox-property-editor-checkbox.js +18 -0
  15. package/dist/src/ox-property-editor-checkbox.js.map +1 -0
  16. package/dist/src/ox-property-editor-data.d.ts +5 -0
  17. package/dist/src/ox-property-editor-data.js +15 -0
  18. package/dist/src/ox-property-editor-data.js.map +1 -0
  19. package/dist/src/ox-property-editor-date.d.ts +4 -0
  20. package/dist/src/ox-property-editor-date.js +14 -0
  21. package/dist/src/ox-property-editor-date.js.map +1 -0
  22. package/dist/src/ox-property-editor-file copy.d.ts +5 -0
  23. package/dist/src/ox-property-editor-file copy.js +15 -0
  24. package/dist/src/ox-property-editor-file copy.js.map +1 -0
  25. package/dist/src/ox-property-editor-file.d.ts +5 -0
  26. package/dist/src/ox-property-editor-file.js +17 -0
  27. package/dist/src/ox-property-editor-file.js.map +1 -0
  28. package/dist/src/ox-property-editor-image.d.ts +5 -0
  29. package/dist/src/ox-property-editor-image.js +16 -0
  30. package/dist/src/ox-property-editor-image.js.map +1 -0
  31. package/dist/src/ox-property-editor-legend.d.ts +4 -0
  32. package/dist/src/ox-property-editor-legend.js +14 -0
  33. package/dist/src/ox-property-editor-legend.js.map +1 -0
  34. package/dist/src/ox-property-editor-number.d.ts +5 -0
  35. package/dist/src/ox-property-editor-number.js +28 -0
  36. package/dist/src/ox-property-editor-number.js.map +1 -0
  37. package/dist/src/ox-property-editor-options.d.ts +5 -0
  38. package/dist/src/ox-property-editor-options.js +15 -0
  39. package/dist/src/ox-property-editor-options.js.map +1 -0
  40. package/dist/src/ox-property-editor-password.d.ts +4 -0
  41. package/dist/src/ox-property-editor-password.js +14 -0
  42. package/dist/src/ox-property-editor-password.js.map +1 -0
  43. package/dist/src/ox-property-editor-range.d.ts +5 -0
  44. package/dist/src/ox-property-editor-range.js +18 -0
  45. package/dist/src/ox-property-editor-range.js.map +1 -0
  46. package/dist/src/ox-property-editor-select.d.ts +16 -0
  47. package/dist/src/ox-property-editor-select.js +66 -0
  48. package/dist/src/ox-property-editor-select.js.map +1 -0
  49. package/dist/src/ox-property-editor-string.d.ts +4 -0
  50. package/dist/src/ox-property-editor-string.js +14 -0
  51. package/dist/src/ox-property-editor-string.js.map +1 -0
  52. package/dist/src/ox-property-editor-textarea.d.ts +5 -0
  53. package/dist/src/ox-property-editor-textarea.js +26 -0
  54. package/dist/src/ox-property-editor-textarea.js.map +1 -0
  55. package/dist/src/ox-property-editor.d.ts +1 -0
  56. package/dist/src/ox-property-editor.js +41 -5
  57. package/dist/src/ox-property-editor.js.map +1 -1
  58. package/dist/src/types.d.ts +8 -0
  59. package/dist/src/types.js +2 -0
  60. package/dist/src/types.js.map +1 -0
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +23 -4
  63. package/src/index.ts +2 -1
  64. package/src/ox-properties-dynamic-view.ts +130 -0
  65. package/src/ox-property-editor-angle.ts +14 -0
  66. package/src/ox-property-editor-checkbox.ts +16 -0
  67. package/src/ox-property-editor-data.ts +12 -0
  68. package/src/ox-property-editor-date.ts +10 -0
  69. package/src/ox-property-editor-file.ts +14 -0
  70. package/src/ox-property-editor-image.ts +13 -0
  71. package/src/ox-property-editor-legend.ts +10 -0
  72. package/src/ox-property-editor-number.ts +26 -0
  73. package/src/ox-property-editor-options.ts +12 -0
  74. package/src/ox-property-editor-password.ts +10 -0
  75. package/src/ox-property-editor-range.ts +16 -0
  76. package/src/ox-property-editor-select.ts +73 -0
  77. package/src/ox-property-editor-string.ts +10 -0
  78. package/src/ox-property-editor-textarea.ts +22 -0
  79. package/src/ox-property-editor.ts +43 -5
  80. package/src/types.ts +8 -0
  81. package/translations/en.json +3 -0
  82. package/translations/ko.json +3 -0
  83. package/translations/ms.json +3 -0
  84. package/translations/zh.json +3 -0
  85. package/tsconfig.json +1 -1
@@ -0,0 +1,2 @@
1
+ declare module '*.png'
2
+ declare module '*.css'
package/CHANGELOG.md CHANGED
@@ -3,6 +3,37 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2022-03-11)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * migrate parameter-editor from things-factory ([019a30d](https://github.com/hatiolab/operato/commit/019a30df6fd4c8a273d4194d13f5784ed6f8d956))
12
+
13
+
14
+ ### :rocket: New Features
15
+
16
+ * migrate property-editor from things-factory ([272cdaa](https://github.com/hatiolab/operato/commit/272cdaafd74f3c3c597403f88655cb5cf4a81313))
17
+ * migrated property-editors from things-factory ([9d0b73a](https://github.com/hatiolab/operato/commit/9d0b73a8c05187e7ca8db874ddde8c977ec52a55))
18
+
19
+
20
+
21
+ ## [1.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2022-03-11)
22
+
23
+ **Note:** Version bump only for package @operato/property-editor
24
+
25
+
26
+
27
+
28
+
29
+ ## [1.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2022-03-10)
30
+
31
+ **Note:** Version bump only for package @operato/property-editor
32
+
33
+
34
+
35
+
36
+
6
37
  ## [1.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2022-03-10)
7
38
 
8
39
  **Note:** Version bump only for package @operato/property-editor
package/demo/index.html CHANGED
@@ -25,11 +25,130 @@
25
25
  </head>
26
26
  <body>
27
27
  <div id="demo"></div>
28
+
28
29
  <script type="module">
29
30
  import { html, render } from 'lit'
30
- import '../dist/src/ox-property-editor.js'
31
+ import '@operato/i18n/ox-i18n.js'
32
+
33
+ import '../dist/src/ox-property-editor-angle.js'
34
+ import '../dist/src/ox-property-editor-checkbox.js'
35
+ import '../dist/src/ox-property-editor-date.js'
36
+ import '../dist/src/ox-property-editor-legend.js'
37
+ import '../dist/src/ox-property-editor-number.js'
38
+ import '../dist/src/ox-property-editor-password.js'
39
+ import '../dist/src/ox-property-editor-range.js'
40
+ import '../dist/src/ox-property-editor-select.js'
41
+ import '../dist/src/ox-property-editor-string.js'
42
+ import '../dist/src/ox-property-editor-image.js'
43
+ import '../dist/src/ox-property-editor-file.js'
44
+ // import '../dist/src/ox-property-editor-textarea.js'
45
+ // import '../dist/src/ox-property-editor-options.js'
46
+
47
+ import '../dist/src/ox-properties-dynamic-view.js'
48
+
49
+ const properties = [
50
+ {
51
+ type: 'string',
52
+ label: 'ABC',
53
+ name: 'ABC'
54
+ },
55
+ {
56
+ type: 'password',
57
+ label: 'PWD',
58
+ name: 'PWD'
59
+ },
60
+ {
61
+ type: 'select',
62
+ label: 'SLT',
63
+ name: 'SLT',
64
+ property: {
65
+ options: ['aaa', 'bbb']
66
+ }
67
+ },
68
+ {
69
+ type: 'number',
70
+ label: 'N#',
71
+ name: 'N#'
72
+ },
73
+ {
74
+ type: 'checkbox',
75
+ label: 'XV',
76
+ name: 'XV'
77
+ },
78
+ {
79
+ type: 'angle',
80
+ label: 'Degree',
81
+ name: 'Degree'
82
+ },
83
+ {
84
+ type: 'date',
85
+ label: 'DD',
86
+ name: 'DD'
87
+ },
88
+ {
89
+ type: 'legend',
90
+ label: '',
91
+ name: 'NEW-GROUP',
92
+ property: {
93
+ label: 'NEW-GROUP'
94
+ }
95
+ },
96
+ {
97
+ type: 'slider',
98
+ label: 'S',
99
+ name: 'S',
100
+ property: {
101
+ min: 30,
102
+ max: 300,
103
+ step: 10
104
+ }
105
+ },
106
+ {
107
+ type: 'textarea',
108
+ label: 'TA',
109
+ name: 'TA'
110
+ },
111
+ {
112
+ type: 'options',
113
+ label: 'OT',
114
+ name: 'OT'
115
+ },
116
+ {
117
+ type: 'data',
118
+ label: 'DT',
119
+ name: 'DT'
120
+ },
121
+ {
122
+ type: 'image',
123
+ label: 'IM',
124
+ name: 'IM'
125
+ },
126
+ {
127
+ type: 'file',
128
+ label: 'FL',
129
+ name: 'FL',
130
+ property: {
131
+ multiple: true
132
+ }
133
+ }
134
+ ]
135
+
136
+ const value = {
137
+ S: 290,
138
+ SLT: 'bbb',
139
+ IM: 'https://www.hatiolab.com/assets/img/arch-thingsboard.png'
140
+ }
31
141
 
32
- render(html` <ox-property-editor></ox-property-editor> `, document.querySelector('#demo'))
142
+ render(
143
+ html`
144
+ <ox-properties-dynamic-view
145
+ .props=${properties}
146
+ .value=${value}
147
+ @property-change=${e => console.log(e.currentTarget.value)}
148
+ ></ox-properties-dynamic-view>
149
+ `,
150
+ document.querySelector('#demo')
151
+ )
33
152
  </script>
34
153
  </body>
35
154
  </html>
@@ -1 +1,2 @@
1
- export * from './ox-property-editor';
1
+ export * from './types.js';
2
+ export * from './ox-property-editor.js';
package/dist/src/index.js CHANGED
@@ -1,2 +1,3 @@
1
- export * from './ox-property-editor';
1
+ export * from './types.js';
2
+ export * from './ox-property-editor.js';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA","sourcesContent":["export * from './ox-property-editor'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,yBAAyB,CAAA","sourcesContent":["export * from './types.js'\nexport * from './ox-property-editor.js'\n"]}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ export {};
@@ -0,0 +1,118 @@
1
+ /**
2
+ * @license Copyright © HatioLab Inc. All rights reserved.
3
+ */
4
+ import { __decorate } from "tslib";
5
+ import { LitElement, html } from 'lit';
6
+ import { customElement, property } from 'lit/decorators.js';
7
+ import { OxPropertyEditor } from './ox-property-editor.js';
8
+ /**
9
+ 모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.
10
+
11
+ Example:
12
+
13
+ <specific-properties-builder value="{{value}}">
14
+ <label>Center X</label>
15
+ <input type="number" .value="${value.cx}">
16
+ <label>Width</label>
17
+ <input type="number" .value="${value.width}">
18
+ </specific-properties-builder>
19
+ */
20
+ const DEFAULT_VALUE = {
21
+ legend: '',
22
+ number: 0,
23
+ angle: 0,
24
+ string: '',
25
+ password: '',
26
+ textarea: '',
27
+ checkbox: false,
28
+ select: '',
29
+ color: '#000000',
30
+ 'solidcolor-stops': null,
31
+ 'gradientcolor-stops': null,
32
+ 'gltf-selector': '',
33
+ 'image-selector': '',
34
+ multiplecolor: null,
35
+ editortable: null,
36
+ imageselector: '',
37
+ options: null,
38
+ date: null
39
+ };
40
+ let OxPropertiesDynamicView = class OxPropertiesDynamicView extends LitElement {
41
+ constructor() {
42
+ super(...arguments);
43
+ this.value = {};
44
+ }
45
+ render() {
46
+ return html `<slot></slot>`;
47
+ }
48
+ firstUpdated() {
49
+ this.addEventListener('change', this._onValueChanged.bind(this));
50
+ }
51
+ updated(changes) {
52
+ changes.has('props') && this._onPropsChanged(this.props || []);
53
+ changes.has('value') && this._setValues();
54
+ }
55
+ _onPropsChanged(props) {
56
+ const specs = this.props || [];
57
+ this.textContent = '';
58
+ specs.forEach(spec => {
59
+ let elementType = OxPropertyEditor.getEditor(spec.type);
60
+ if (!elementType) {
61
+ console.warn('Property Editor not defined', spec.type);
62
+ return;
63
+ }
64
+ let element = document.createElement(elementType);
65
+ element.label = spec.label;
66
+ element.type = spec.type;
67
+ element.placeholder = spec.placeholder;
68
+ element.setAttribute('name', spec.name);
69
+ if (spec.observe) {
70
+ element.observe = spec.observe;
71
+ }
72
+ element.property = spec.property;
73
+ element.setAttribute('property-editor', 'true');
74
+ this.appendChild(element);
75
+ });
76
+ }
77
+ _setValues() {
78
+ this.value &&
79
+ Array.from(this.querySelectorAll('[name]')).forEach(prop => {
80
+ const editor = prop;
81
+ const name = editor.getAttribute('name');
82
+ var value = this.value[name];
83
+ if (value === undefined) {
84
+ value = DEFAULT_VALUE[editor.type];
85
+ }
86
+ editor.value = value;
87
+ editor.observe && editor.observe.call(prop, editor.value);
88
+ });
89
+ }
90
+ _onValueChanged(e) {
91
+ e.stopPropagation();
92
+ var target = e.target;
93
+ const editor = target.closest('[property-editor]');
94
+ var name = editor.getAttribute('name');
95
+ if (!name) {
96
+ return;
97
+ }
98
+ this.value[name] = editor.value;
99
+ this._setValues();
100
+ this.dispatchEvent(new CustomEvent('property-change', {
101
+ bubbles: true,
102
+ composed: true,
103
+ detail: {
104
+ [name]: editor.value
105
+ }
106
+ }));
107
+ }
108
+ };
109
+ __decorate([
110
+ property({ type: Object })
111
+ ], OxPropertiesDynamicView.prototype, "value", void 0);
112
+ __decorate([
113
+ property({ type: Array })
114
+ ], OxPropertiesDynamicView.prototype, "props", void 0);
115
+ OxPropertiesDynamicView = __decorate([
116
+ customElement('ox-properties-dynamic-view')
117
+ ], OxPropertiesDynamicView);
118
+ //# sourceMappingURL=ox-properties-dynamic-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-properties-dynamic-view.js","sourceRoot":"","sources":["../../src/ox-properties-dynamic-view.ts"],"names":[],"mappings":"AAAA;;GAE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ights reserved.\n */\n\nimport { LitElement, PropertyValues, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { PropertySpec } from './types.js'\n\n/**\n모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.\n\nExample:\n\n <specific-properties-builder value=\"{{value}}\">\n <label>Center X</label>\n <input type=\"number\" .value=\"${value.cx}\">\n <label>Width</label>\n <input type=\"number\" .value=\"${value.width}\">\n </specific-properties-builder>\n*/\n\nconst DEFAULT_VALUE = {\n legend: '',\n number: 0,\n angle: 0,\n string: '',\n password: '',\n textarea: '',\n checkbox: false,\n select: '',\n color: '#000000',\n 'solidcolor-stops': null,\n 'gradientcolor-stops': null,\n 'gltf-selector': '',\n 'image-selector': '',\n multiplecolor: null,\n editortable: null,\n imageselector: '',\n options: null,\n date: null\n}\n\n@customElement('ox-properties-dynamic-view')\nclass OxPropertiesDynamicView extends LitElement {\n @property({ type: Object }) value: { [name: string]: any } = {}\n @property({ type: Array }) props?: PropertySpec[]\n\n render() {\n return html`<slot></slot>`\n }\n\n firstUpdated() {\n this.addEventListener('change', this._onValueChanged.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('props') && this._onPropsChanged(this.props || [])\n changes.has('value') && this._setValues()\n }\n\n _onPropsChanged(props: PropertySpec[]) {\n const specs = this.props || []\n\n this.textContent = ''\n specs.forEach(spec => {\n let elementType = OxPropertyEditor.getEditor(spec.type)\n if (!elementType) {\n console.warn('Property Editor not defined', spec.type)\n return\n }\n let element = document.createElement(elementType) as OxPropertyEditor\n\n element.label = spec.label\n element.type = spec.type\n element.placeholder = spec.placeholder\n element.setAttribute('name', spec.name)\n\n if (spec.observe) {\n element.observe = spec.observe\n }\n element.property = spec.property\n element.setAttribute('property-editor', 'true')\n\n this.appendChild(element)\n })\n }\n\n _setValues() {\n this.value &&\n Array.from(this.querySelectorAll('[name]')).forEach(prop => {\n const editor = prop as OxPropertyEditor\n const name = editor.getAttribute('name')\n\n var value = this.value[name!]\n if (value === undefined) {\n value = (DEFAULT_VALUE as any)[editor.type]\n }\n\n editor.value = value\n editor.observe && editor.observe.call(prop, editor.value)\n })\n }\n\n _onValueChanged(e: Event) {\n e.stopPropagation()\n var target = e.target as Element\n\n const editor = target.closest('[property-editor]') as OxPropertyEditor\n\n var name = editor.getAttribute('name')\n if (!name) {\n return\n }\n\n this.value[name] = editor.value\n this._setValues()\n\n this.dispatchEvent(\n new CustomEvent('property-change', {\n bubbles: true,\n composed: true,\n detail: {\n [name]: editor.value\n }\n })\n )\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import '@operato/input/ox-input-angle.js';
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ export declare class OxPropertyEditorAngle extends OxPropertyEditor {
4
+ editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,17 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-angle.js';
3
+ import { OxPropertyEditor } from './ox-property-editor.js';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ let OxPropertyEditorAngle = class OxPropertyEditorAngle extends OxPropertyEditor {
7
+ editorTemplate() {
8
+ return html `
9
+ <ox-input-angle id="editor" .radian=${this.value} placeholder=${this.placeholder || ''}></ox-input-angle>
10
+ `;
11
+ }
12
+ };
13
+ OxPropertyEditorAngle = __decorate([
14
+ customElement('ox-property-editor-angle')
15
+ ], OxPropertyEditorAngle);
16
+ export { OxPropertyEditorAngle };
17
+ //# sourceMappingURL=ox-property-editor-angle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-angle.js","sourceRoot":"","sources":["../../src/ox-property-editor-angle.ts"],"names":[],"mappings":";AAAA,OAAO,kCAAkC,CAAA;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,qBAAqB,GAAlC,MAAa,qBAAsB,SAAQ,gBAAgB;IACzD,cAAc;QACZ,OAAO,IAAI,CAAA;4CAC6B,IAAI,CAAC,KAAK,gBAAgB,IAAI,CAAC,WAAW,IAAI,EAAE;KACvF,CAAA;IACH,CAAC;CACF,CAAA;AANY,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CAMjC;SANY,qBAAqB","sourcesContent":["import '@operato/input/ox-input-angle.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-angle')\nexport class OxPropertyEditorAngle extends OxPropertyEditor {\n editorTemplate() {\n return html`\n <ox-input-angle id=\"editor\" .radian=${this.value} placeholder=${this.placeholder || ''}></ox-input-angle>\n `\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import '@operato/input/ox-checkbox.js';
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ export declare class OxPropertyEditorCheckbox extends OxPropertyEditor {
4
+ get valueProperty(): string;
5
+ editorTemplate(): import("lit-html").TemplateResult<1>;
6
+ }
@@ -0,0 +1,18 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-checkbox.js';
3
+ import { OxPropertyEditor } from './ox-property-editor.js';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ let OxPropertyEditorCheckbox = class OxPropertyEditorCheckbox extends OxPropertyEditor {
7
+ get valueProperty() {
8
+ return 'checked';
9
+ }
10
+ editorTemplate() {
11
+ return html ` <ox-checkbox id="editor" .value=${this.value}></ox-checkbox>`;
12
+ }
13
+ };
14
+ OxPropertyEditorCheckbox = __decorate([
15
+ customElement('ox-property-editor-checkbox')
16
+ ], OxPropertyEditorCheckbox);
17
+ export { OxPropertyEditorCheckbox };
18
+ //# sourceMappingURL=ox-property-editor-checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-checkbox.js","sourceRoot":"","sources":["../../src/ox-property-editor-checkbox.ts"],"names":[],"mappings":";AAAA,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,wBAAwB,GAArC,MAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,IAAI,aAAa;QACf,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAA,oCAAoC,IAAI,CAAC,KAAK,iBAAiB,CAAA;IAC5E,CAAC;CACF,CAAA;AARY,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAQpC;SARY,wBAAwB","sourcesContent":["import '@operato/input/ox-checkbox.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-checkbox')\nexport class OxPropertyEditorCheckbox extends OxPropertyEditor {\n get valueProperty() {\n return 'checked'\n }\n\n editorTemplate() {\n return html` <ox-checkbox id=\"editor\" .value=${this.value}></ox-checkbox>`\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import '@operato/input/ox-input-data.js';
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ export declare class OxPropertyEditorData extends OxPropertyEditor {
4
+ editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-data.js';
3
+ import { OxPropertyEditor } from './ox-property-editor.js';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ let OxPropertyEditorData = class OxPropertyEditorData extends OxPropertyEditor {
7
+ editorTemplate() {
8
+ return html ` <ox-input-data id="editor" .value=${this.value || []}></ox-input-data> `;
9
+ }
10
+ };
11
+ OxPropertyEditorData = __decorate([
12
+ customElement('ox-property-editor-data')
13
+ ], OxPropertyEditorData);
14
+ export { OxPropertyEditorData };
15
+ //# sourceMappingURL=ox-property-editor-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-data.js","sourceRoot":"","sources":["../../src/ox-property-editor-data.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,gBAAgB;IACxD,cAAc;QACZ,OAAO,IAAI,CAAA,sCAAsC,IAAI,CAAC,KAAK,IAAI,EAAE,oBAAoB,CAAA;IACvF,CAAC;CACF,CAAA;AAJY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAIhC;SAJY,oBAAoB","sourcesContent":["import '@operato/input/ox-input-data.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-data')\nexport class OxPropertyEditorData extends OxPropertyEditor {\n editorTemplate() {\n return html` <ox-input-data id=\"editor\" .value=${this.value || []}></ox-input-data> `\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { OxPropertyEditor } from './ox-property-editor.js';
2
+ export declare class OxPropertyEditorDate extends OxPropertyEditor {
3
+ editorTemplate(): import("lit-html").TemplateResult<1>;
4
+ }
@@ -0,0 +1,14 @@
1
+ import { __decorate } from "tslib";
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import { html } from 'lit';
5
+ let OxPropertyEditorDate = class OxPropertyEditorDate extends OxPropertyEditor {
6
+ editorTemplate() {
7
+ return html ` <input type="date" id="editor" .value=${this.value} /> `;
8
+ }
9
+ };
10
+ OxPropertyEditorDate = __decorate([
11
+ customElement('ox-property-editor-date')
12
+ ], OxPropertyEditorDate);
13
+ export { OxPropertyEditorDate };
14
+ //# sourceMappingURL=ox-property-editor-date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-date.js","sourceRoot":"","sources":["../../src/ox-property-editor-date.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,gBAAgB;IACxD,cAAc;QACZ,OAAO,IAAI,CAAA,0CAA0C,IAAI,CAAC,KAAK,MAAM,CAAA;IACvE,CAAC;CACF,CAAA;AAJY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAIhC;SAJY,oBAAoB","sourcesContent":["import { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-date')\nexport class OxPropertyEditorDate extends OxPropertyEditor {\n editorTemplate() {\n return html` <input type=\"date\" id=\"editor\" .value=${this.value} /> `\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import '@operato/input/ox-input-file.js';
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ export declare class OxPropertyEditorOptions extends OxPropertyEditor {
4
+ editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-file.js';
3
+ import { OxPropertyEditor } from './ox-property-editor.js';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ let OxPropertyEditorOptions = class OxPropertyEditorOptions extends OxPropertyEditor {
7
+ editorTemplate() {
8
+ return html ` <ox-input-file id="editor" .value=${this.value || []}></ox-input-file> `;
9
+ }
10
+ };
11
+ OxPropertyEditorOptions = __decorate([
12
+ customElement('ox-property-editor-file')
13
+ ], OxPropertyEditorOptions);
14
+ export { OxPropertyEditorOptions };
15
+ //# sourceMappingURL=ox-property-editor-file%20copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-file copy.js","sourceRoot":"","sources":["../../src/ox-property-editor-file copy.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,gBAAgB;IAC3D,cAAc;QACZ,OAAO,IAAI,CAAA,sCAAsC,IAAI,CAAC,KAAK,IAAI,EAAE,oBAAoB,CAAA;IACvF,CAAC;CACF,CAAA;AAJY,uBAAuB;IADnC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,uBAAuB,CAInC;SAJY,uBAAuB","sourcesContent":["import '@operato/input/ox-input-file.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-file')\nexport class OxPropertyEditorOptions extends OxPropertyEditor {\n editorTemplate() {\n return html` <ox-input-file id=\"editor\" .value=${this.value || []}></ox-input-file> `\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import '@operato/input/ox-input-file.js';
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ export declare class OxPropertyEditorFile extends OxPropertyEditor {
4
+ editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,17 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-file.js';
3
+ import { OxPropertyEditor } from './ox-property-editor.js';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ let OxPropertyEditorFile = class OxPropertyEditorFile extends OxPropertyEditor {
7
+ // TODO file change event 처리
8
+ editorTemplate() {
9
+ const { multiple = false } = this.property || {};
10
+ return html ` <ox-input-file id="editor" .value=${this.value || []} ?multiple=${multiple}></ox-input-file> `;
11
+ }
12
+ };
13
+ OxPropertyEditorFile = __decorate([
14
+ customElement('ox-property-editor-file')
15
+ ], OxPropertyEditorFile);
16
+ export { OxPropertyEditorFile };
17
+ //# sourceMappingURL=ox-property-editor-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-file.js","sourceRoot":"","sources":["../../src/ox-property-editor-file.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,gBAAgB;IACxD,4BAA4B;IAC5B,cAAc;QACZ,MAAM,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAA;QAChD,OAAO,IAAI,CAAA,sCAAsC,IAAI,CAAC,KAAK,IAAI,EAAE,cAAc,QAAQ,oBAAoB,CAAA;IAC7G,CAAC;CACF,CAAA;AANY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAMhC;SANY,oBAAoB","sourcesContent":["import '@operato/input/ox-input-file.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-file')\nexport class OxPropertyEditorFile extends OxPropertyEditor {\n // TODO file change event 처리\n editorTemplate() {\n const { multiple = false } = this.property || {}\n return html` <ox-input-file id=\"editor\" .value=${this.value || []} ?multiple=${multiple}></ox-input-file> `\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import '@operato/input/ox-input-image.js';
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ export declare class OxPropertyEditorImage extends OxPropertyEditor {
4
+ editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,16 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-image.js';
3
+ import { OxPropertyEditor } from './ox-property-editor.js';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ let OxPropertyEditorImage = class OxPropertyEditorImage extends OxPropertyEditor {
7
+ // TODO image change event 처리
8
+ editorTemplate() {
9
+ return html ` <ox-input-image id="editor" .value=${this.value}></ox-input-image> `;
10
+ }
11
+ };
12
+ OxPropertyEditorImage = __decorate([
13
+ customElement('ox-property-editor-image')
14
+ ], OxPropertyEditorImage);
15
+ export { OxPropertyEditorImage };
16
+ //# sourceMappingURL=ox-property-editor-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-image.js","sourceRoot":"","sources":["../../src/ox-property-editor-image.ts"],"names":[],"mappings":";AAAA,OAAO,kCAAkC,CAAA;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,qBAAqB,GAAlC,MAAa,qBAAsB,SAAQ,gBAAgB;IACzD,6BAA6B;IAC7B,cAAc;QACZ,OAAO,IAAI,CAAA,uCAAuC,IAAI,CAAC,KAAK,qBAAqB,CAAA;IACnF,CAAC;CACF,CAAA;AALY,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CAKjC;SALY,qBAAqB","sourcesContent":["import '@operato/input/ox-input-image.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-image')\nexport class OxPropertyEditorImage extends OxPropertyEditor {\n // TODO image change event 처리\n editorTemplate() {\n return html` <ox-input-image id=\"editor\" .value=${this.value}></ox-input-image> `\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { OxPropertyEditor } from './ox-property-editor.js';
2
+ export declare class OxPropertyEditorLegend extends OxPropertyEditor {
3
+ editorTemplate(): import("lit-html").TemplateResult<1>;
4
+ }
@@ -0,0 +1,14 @@
1
+ import { __decorate } from "tslib";
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import { html } from 'lit';
5
+ let OxPropertyEditorLegend = class OxPropertyEditorLegend extends OxPropertyEditor {
6
+ editorTemplate() {
7
+ return html ` <legend>${this.property.label}</legend> `;
8
+ }
9
+ };
10
+ OxPropertyEditorLegend = __decorate([
11
+ customElement('ox-property-editor-legend')
12
+ ], OxPropertyEditorLegend);
13
+ export { OxPropertyEditorLegend };
14
+ //# sourceMappingURL=ox-property-editor-legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-legend.js","sourceRoot":"","sources":["../../src/ox-property-editor-legend.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,gBAAgB;IAC1D,cAAc;QACZ,OAAO,IAAI,CAAA,YAAY,IAAI,CAAC,QAAQ,CAAC,KAAK,YAAY,CAAA;IACxD,CAAC;CACF,CAAA;AAJY,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CAIlC;SAJY,sBAAsB","sourcesContent":["import { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-legend')\nexport class OxPropertyEditorLegend extends OxPropertyEditor {\n editorTemplate() {\n return html` <legend>${this.property.label}</legend> `\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { OxPropertyEditor } from './ox-property-editor.js';
2
+ export declare class OxPropertyEditorNumber extends OxPropertyEditor {
3
+ makeup(v: string): number;
4
+ editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,28 @@
1
+ import { __decorate } from "tslib";
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import { html } from 'lit';
5
+ let OxPropertyEditorNumber = class OxPropertyEditorNumber extends OxPropertyEditor {
6
+ makeup(v) {
7
+ return Number(v);
8
+ }
9
+ editorTemplate() {
10
+ const { step, min, max } = this.property || {};
11
+ return html `
12
+ <input
13
+ id="editor"
14
+ type="number"
15
+ placeholder=${this.placeholder || ''}
16
+ .value=${this.value}
17
+ .step=${step}
18
+ .min=${min}
19
+ .max=${max}
20
+ />
21
+ `;
22
+ }
23
+ };
24
+ OxPropertyEditorNumber = __decorate([
25
+ customElement('ox-property-editor-number')
26
+ ], OxPropertyEditorNumber);
27
+ export { OxPropertyEditorNumber };
28
+ //# sourceMappingURL=ox-property-editor-number.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-number.js","sourceRoot":"","sources":["../../src/ox-property-editor-number.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,gBAAgB;IACjD,MAAM,CAAC,CAAS;QACvB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC;IAED,cAAc;QACZ,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAA;QAE9C,OAAO,IAAI,CAAA;;;;sBAIO,IAAI,CAAC,WAAW,IAAI,EAAE;iBAC3B,IAAI,CAAC,KAAK;gBACX,IAAI;eACL,GAAG;eACH,GAAG;;KAEb,CAAA;IACH,CAAC;CACF,CAAA;AApBY,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CAoBlC;SApBY,sBAAsB","sourcesContent":["import { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-number')\nexport class OxPropertyEditorNumber extends OxPropertyEditor {\n override makeup(v: string) {\n return Number(v)\n }\n\n editorTemplate() {\n const { step, min, max } = this.property || {}\n\n return html`\n <input\n id=\"editor\"\n type=\"number\"\n placeholder=${this.placeholder || ''}\n .value=${this.value}\n .step=${step}\n .min=${min}\n .max=${max}\n />\n `\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import '@operato/input/ox-input-options.js';
2
+ import { OxPropertyEditor } from './ox-property-editor.js';
3
+ export declare class OxPropertyEditorOptions extends OxPropertyEditor {
4
+ editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-options.js';
3
+ import { OxPropertyEditor } from './ox-property-editor.js';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ let OxPropertyEditorOptions = class OxPropertyEditorOptions extends OxPropertyEditor {
7
+ editorTemplate() {
8
+ return html ` <ox-input-options id="editor" .value=${this.value || []}></ox-input-options> `;
9
+ }
10
+ };
11
+ OxPropertyEditorOptions = __decorate([
12
+ customElement('ox-property-editor-options')
13
+ ], OxPropertyEditorOptions);
14
+ export { OxPropertyEditorOptions };
15
+ //# sourceMappingURL=ox-property-editor-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-property-editor-options.js","sourceRoot":"","sources":["../../src/ox-property-editor-options.ts"],"names":[],"mappings":";AAAA,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,gBAAgB;IAC3D,cAAc;QACZ,OAAO,IAAI,CAAA,yCAAyC,IAAI,CAAC,KAAK,IAAI,EAAE,uBAAuB,CAAA;IAC7F,CAAC;CACF,CAAA;AAJY,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAInC;SAJY,uBAAuB","sourcesContent":["import '@operato/input/ox-input-options.js'\n\nimport { OxPropertyEditor } from './ox-property-editor.js'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-options')\nexport class OxPropertyEditorOptions extends OxPropertyEditor {\n editorTemplate() {\n return html` <ox-input-options id=\"editor\" .value=${this.value || []}></ox-input-options> `\n }\n}\n"]}