@operato/input 1.0.0-alpha.9 → 1.0.0-beta.10
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/CHANGELOG.md +709 -0
- package/assets/images/icon-properties-line-type.png +0 -0
- package/assets/images/icon-properties-table.png +0 -0
- package/demo/index-crontab.html +37 -0
- package/demo/index-partition-keys.html +71 -0
- package/demo/index-select.html +22 -15
- package/demo/index-table.html +39 -0
- package/demo/index-value-map.html +80 -0
- package/demo/index-value-ranges.html +80 -0
- package/demo/index-work-shift.html +59 -0
- package/demo/index.html +10 -0
- package/dist/src/index.d.ts +9 -3
- package/dist/src/index.js +9 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-checkbox.d.ts +1 -1
- package/dist/src/ox-checkbox.js +1 -1
- package/dist/src/ox-checkbox.js.map +1 -1
- package/dist/src/ox-form-field.d.ts +2 -2
- package/dist/src/ox-form-field.js.map +1 -1
- package/dist/src/ox-input-barcode.d.ts +1 -1
- package/dist/src/ox-input-barcode.js +1 -1
- package/dist/src/ox-input-barcode.js.map +1 -1
- package/dist/src/ox-input-code.d.ts +1 -1
- package/dist/src/ox-input-code.js +12 -7
- package/dist/src/ox-input-code.js.map +1 -1
- package/dist/src/ox-input-color-gradient.d.ts +4 -4
- package/dist/src/ox-input-color-gradient.js +3 -3
- package/dist/src/ox-input-color-gradient.js.map +1 -1
- package/dist/src/ox-input-color-stops.js +1 -1
- package/dist/src/ox-input-color-stops.js.map +1 -1
- package/dist/src/ox-input-crontab.d.ts +23 -0
- package/dist/src/ox-input-crontab.js +560 -0
- package/dist/src/ox-input-crontab.js.map +1 -0
- package/dist/src/ox-input-layout/ox-input-card-layout.d.ts +4 -0
- package/dist/src/ox-input-layout/ox-input-card-layout.js +57 -0
- package/dist/src/ox-input-layout/ox-input-card-layout.js.map +1 -0
- package/dist/src/ox-input-layout/ox-input-grid-layout.d.ts +4 -0
- package/dist/src/ox-input-layout/ox-input-grid-layout.js +63 -0
- package/dist/src/ox-input-layout/ox-input-grid-layout.js.map +1 -0
- package/dist/src/ox-input-layout/ox-input-layout.d.ts +5 -0
- package/dist/src/ox-input-layout/ox-input-layout.js +73 -0
- package/dist/src/ox-input-layout/ox-input-layout.js.map +1 -0
- package/dist/src/ox-input-multiple-colors.d.ts +2 -2
- package/dist/src/ox-input-multiple-colors.js +2 -2
- package/dist/src/ox-input-multiple-colors.js.map +1 -1
- package/dist/src/ox-input-options.js.map +1 -1
- package/dist/src/ox-input-partition-keys.d.ts +36 -0
- package/dist/src/ox-input-partition-keys.js +204 -0
- package/dist/src/ox-input-partition-keys.js.map +1 -0
- package/dist/src/ox-input-search.d.ts +1 -0
- package/dist/src/ox-input-search.js +7 -3
- package/dist/src/ox-input-search.js.map +1 -1
- package/dist/src/ox-input-table.d.ts +8 -0
- package/dist/src/ox-input-table.js +379 -0
- package/dist/src/ox-input-table.js.map +1 -0
- package/dist/src/ox-input-value-map.d.ts +41 -0
- package/dist/src/ox-input-value-map.js +279 -0
- package/dist/src/ox-input-value-map.js.map +1 -0
- package/dist/src/ox-input-value-ranges.d.ts +41 -0
- package/dist/src/ox-input-value-ranges.js +298 -0
- package/dist/src/ox-input-value-ranges.js.map +1 -0
- package/dist/src/ox-input-work-shift.d.ts +33 -0
- package/dist/src/ox-input-work-shift.js +229 -0
- package/dist/src/ox-input-work-shift.js.map +1 -0
- package/dist/src/ox-select.d.ts +3 -0
- package/dist/src/ox-select.js +28 -3
- package/dist/src/ox-select.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -8
- package/src/index.ts +9 -3
- package/src/ox-checkbox.ts +2 -2
- package/src/ox-form-field.ts +2 -2
- package/src/ox-input-barcode.ts +2 -3
- package/src/ox-input-code.ts +14 -8
- package/src/{ox-input-color-gradient.ts.xxx → ox-input-color-gradient.ts} +4 -4
- package/src/ox-input-color-stops.ts +1 -1
- package/src/ox-input-crontab.ts +561 -0
- package/src/ox-input-layout/ox-input-card-layout.ts +58 -0
- package/src/ox-input-layout/ox-input-grid-layout.ts +64 -0
- package/src/ox-input-layout/ox-input-layout.ts +77 -0
- package/src/ox-input-multiple-colors.ts +2 -2
- package/src/ox-input-options.ts +1 -1
- package/src/ox-input-partition-keys.ts +243 -0
- package/src/ox-input-search.ts +9 -3
- package/src/ox-input-table.ts +404 -0
- package/src/{ox-input-keyvalues.ts.ing → ox-input-value-map.ts} +120 -89
- package/src/ox-input-value-ranges.ts +325 -0
- package/src/ox-input-work-shift.ts +251 -0
- package/src/ox-select.ts +31 -5
- package/dist/src/ox-input-background-pattern.d.ts +0 -31
- package/dist/src/ox-input-background-pattern.js +0 -147
- package/dist/src/ox-input-background-pattern.js.map +0 -1
- package/dist/src/ox-input-fill-style.d.ts +0 -42
- package/dist/src/ox-input-fill-style.js +0 -323
- package/dist/src/ox-input-fill-style.js.map +0 -1
- package/dist/src/ox-input-id.d.ts +0 -11
- package/dist/src/ox-input-id.js +0 -68
- package/dist/src/ox-input-id.js.map +0 -1
- package/src/ox-input-background-pattern.ts.xxx +0 -163
- package/src/ox-input-fill-style.ts.xxx +0 -361
- package/src/ox-input-ranges.ts.ing +0 -292
@@ -1,323 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
|
-
*/
|
4
|
-
import { __decorate } from "tslib";
|
5
|
-
import '@operato/i18n/ox-i18n.js';
|
6
|
-
import './ox-input-color';
|
7
|
-
import './ox-input-color-gradient';
|
8
|
-
import './ox-input-background-pattern';
|
9
|
-
import { css, html } from 'lit';
|
10
|
-
import { customElement, property } from 'lit/decorators.js';
|
11
|
-
import { OxFormField } from './ox-form-field';
|
12
|
-
let OxInputColorStyle = class OxInputColorStyle extends OxFormField {
|
13
|
-
constructor() {
|
14
|
-
super(...arguments);
|
15
|
-
this._block_reset = false;
|
16
|
-
}
|
17
|
-
static { this.styles = css `
|
18
|
-
:host {
|
19
|
-
display: flex;
|
20
|
-
flex-direction: column;
|
21
|
-
}
|
22
|
-
|
23
|
-
[fill-type] {
|
24
|
-
display: flex;
|
25
|
-
margin: 0 0 14px 0;
|
26
|
-
}
|
27
|
-
|
28
|
-
[fill-type] * {
|
29
|
-
flex: auto;
|
30
|
-
margin: 0;
|
31
|
-
text-align: left;
|
32
|
-
align-self: center;
|
33
|
-
}
|
34
|
-
|
35
|
-
.grid-10 {
|
36
|
-
display: grid;
|
37
|
-
|
38
|
-
grid-template-columns: repeat(10, 1fr);
|
39
|
-
grid-gap: 5px;
|
40
|
-
grid-auto-rows: minmax(24px, auto);
|
41
|
-
}
|
42
|
-
|
43
|
-
.grid-10 > ox-input-color {
|
44
|
-
grid-column: span 4;
|
45
|
-
}
|
46
|
-
|
47
|
-
.grid-10 > .icon-only-label {
|
48
|
-
grid-column: span 1;
|
49
|
-
|
50
|
-
background: url(/assets/images/icon-properties-label.png) no-repeat;
|
51
|
-
float: left;
|
52
|
-
margin: 0;
|
53
|
-
}
|
54
|
-
|
55
|
-
.icon-only-label.color {
|
56
|
-
background-position: 70% -498px;
|
57
|
-
}
|
58
|
-
|
59
|
-
[editors] > :not([active]) {
|
60
|
-
display: none;
|
61
|
-
}
|
62
|
-
`; }
|
63
|
-
updated(changes) {
|
64
|
-
changes.has('value') && this._onChangedValue(this.value || {});
|
65
|
-
}
|
66
|
-
render() {
|
67
|
-
return html `
|
68
|
-
<div @change=${(e) => this._onChangedFillType(e)} fill-type>
|
69
|
-
<input
|
70
|
-
type="radio"
|
71
|
-
id="fill-type-no"
|
72
|
-
name="fill-type"
|
73
|
-
value="no"
|
74
|
-
.checked=${!this.fillType || this.fillType == 'no'}
|
75
|
-
/>
|
76
|
-
<label for="fill-type-no"><ox-i18n msgid="label.no-fill">no fill</ox-i18n></label>
|
77
|
-
<input type="radio" id="fill-type-solid" name="fill-type" value="solid" .checked=${this.fillType == 'solid'} />
|
78
|
-
<label for="fill-type-solid"><ox-i18n msgid="label.solid">solid</ox-i18n></label>
|
79
|
-
<input
|
80
|
-
type="radio"
|
81
|
-
id="fill-type-gradient"
|
82
|
-
name="fill-type"
|
83
|
-
value="gradient"
|
84
|
-
.checked=${this.fillType == 'gradient'}
|
85
|
-
/>
|
86
|
-
<label for="fill-type-gradient"><ox-i18n msgid="label.gradient">gradient</ox-i18n></label>
|
87
|
-
<input
|
88
|
-
type="radio"
|
89
|
-
id="fill-type-pattern"
|
90
|
-
name="fill-type"
|
91
|
-
value="pattern"
|
92
|
-
.checked=${this.fillType == 'pattern'}
|
93
|
-
/>
|
94
|
-
<label for="fill-type-pattern"><ox-i18n msgid="label.pattern">pattern</ox-i18n></label>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
<div editors>
|
98
|
-
<div ?active=${this.fillType == 'no'}></div>
|
99
|
-
|
100
|
-
<div class="grid-10" ?active=${this.fillType == 'solid'}>
|
101
|
-
<label class="icon-only-label color"></label>
|
102
|
-
<ox-input-color @change=${(e) => this._onChangedSolid(e)} .value=${this.solid}> </ox-input-color>
|
103
|
-
</div>
|
104
|
-
|
105
|
-
<div ?active=${this.fillType == 'gradient'}>
|
106
|
-
<ox-input-color-gradient @change=${(e) => this._onChandedGradient(e)} .value=${this.gradient}>
|
107
|
-
</ox-input-color-gradient>
|
108
|
-
</div>
|
109
|
-
|
110
|
-
<div ?active=${this.fillType == 'pattern'}>
|
111
|
-
<ox-input-background-pattern @change=${(e) => this._onChangedPattern(e)} .value=${this.pattern}>
|
112
|
-
</ox-input-background-pattern>
|
113
|
-
</div>
|
114
|
-
</div>
|
115
|
-
`;
|
116
|
-
}
|
117
|
-
async _onChangedValue(value) {
|
118
|
-
/*
|
119
|
-
* this._block_reset의 역할은 내부 사용자 인터렉션에 의한 value의 변경시에는 각 type별 이전값을 유지하기 위함이다.
|
120
|
-
*/
|
121
|
-
await this.requestUpdate();
|
122
|
-
/* 설정 값에 따라서, 멤버 속성을 설정한다. */
|
123
|
-
if (!value) {
|
124
|
-
this.fillType = 'no';
|
125
|
-
if (!this._block_reset) {
|
126
|
-
this.solid = undefined;
|
127
|
-
this.gradient = undefined;
|
128
|
-
this.pattern = undefined;
|
129
|
-
}
|
130
|
-
this._block_reset = false;
|
131
|
-
return;
|
132
|
-
}
|
133
|
-
switch (typeof value) {
|
134
|
-
case 'string':
|
135
|
-
this.fillType = 'solid';
|
136
|
-
this.solid = value;
|
137
|
-
if (!this._block_reset) {
|
138
|
-
this.gradient = undefined;
|
139
|
-
this.pattern = undefined;
|
140
|
-
}
|
141
|
-
break;
|
142
|
-
case 'object':
|
143
|
-
this.fillType = value.type;
|
144
|
-
if (value.type === 'gradient') {
|
145
|
-
this.gradient = {
|
146
|
-
type: value.gradientType || 'linear',
|
147
|
-
colorStops: value.colorStops || [
|
148
|
-
{
|
149
|
-
position: 0,
|
150
|
-
color: this.solid || '#000000'
|
151
|
-
},
|
152
|
-
{
|
153
|
-
position: 1,
|
154
|
-
color: this.solid || '#FFFFFF'
|
155
|
-
}
|
156
|
-
],
|
157
|
-
rotation: Number(value.rotation) || 0,
|
158
|
-
center: value.center
|
159
|
-
};
|
160
|
-
if (!this._block_reset) {
|
161
|
-
this.pattern = undefined;
|
162
|
-
this.solid = undefined;
|
163
|
-
}
|
164
|
-
}
|
165
|
-
else if (value.type === 'pattern') {
|
166
|
-
this.pattern = {
|
167
|
-
image: value.image,
|
168
|
-
offsetX: Number(value.offsetX) || 0,
|
169
|
-
offsetY: Number(value.offsetY) || 0,
|
170
|
-
width: Number(value.width),
|
171
|
-
height: Number(value.height),
|
172
|
-
align: value.align,
|
173
|
-
fitPattern: value.fitPattern
|
174
|
-
};
|
175
|
-
if (!this._block_reset) {
|
176
|
-
this.gradient = undefined;
|
177
|
-
this.solid = undefined;
|
178
|
-
}
|
179
|
-
}
|
180
|
-
break;
|
181
|
-
default:
|
182
|
-
}
|
183
|
-
this._block_reset = false;
|
184
|
-
}
|
185
|
-
_onChangedFillType(e) {
|
186
|
-
const element = e.target;
|
187
|
-
this.fillType = element.value;
|
188
|
-
switch (this.fillType) {
|
189
|
-
case 'gradient':
|
190
|
-
if (!this.gradient) {
|
191
|
-
this.gradient = {
|
192
|
-
type: 'linear',
|
193
|
-
colorStops: [
|
194
|
-
{
|
195
|
-
position: 0,
|
196
|
-
color: this.solid || '#000000'
|
197
|
-
},
|
198
|
-
{
|
199
|
-
position: 1,
|
200
|
-
color: this.solid || '#FFFFFF'
|
201
|
-
}
|
202
|
-
],
|
203
|
-
rotation: 0,
|
204
|
-
center: 'center'
|
205
|
-
};
|
206
|
-
}
|
207
|
-
this.value = {
|
208
|
-
type: 'gradient',
|
209
|
-
gradientType: this.gradient.type || 'linear',
|
210
|
-
colorStops: this.gradient.colorStops || [
|
211
|
-
{
|
212
|
-
position: 0,
|
213
|
-
color: this.solid || '#000000'
|
214
|
-
},
|
215
|
-
{
|
216
|
-
position: 1,
|
217
|
-
color: this.solid || '#FFFFFF'
|
218
|
-
}
|
219
|
-
],
|
220
|
-
rotation: Number(this.gradient.rotation) || 0,
|
221
|
-
center: this.gradient.center
|
222
|
-
};
|
223
|
-
break;
|
224
|
-
case 'pattern':
|
225
|
-
if (!this.pattern)
|
226
|
-
this.pattern = {};
|
227
|
-
this.value = {
|
228
|
-
type: 'pattern',
|
229
|
-
image: this.pattern.image,
|
230
|
-
offsetX: Number(this.pattern.offsetX) || 0,
|
231
|
-
offsetY: Number(this.pattern.offsetY) || 0,
|
232
|
-
width: Number(this.pattern.width),
|
233
|
-
height: Number(this.pattern.height),
|
234
|
-
align: this.pattern.align,
|
235
|
-
fitPattern: this.pattern.fitPattern
|
236
|
-
};
|
237
|
-
break;
|
238
|
-
case 'solid':
|
239
|
-
if (!this.solid)
|
240
|
-
this.solid = '#fff';
|
241
|
-
this.value = this.solid;
|
242
|
-
break;
|
243
|
-
case 'no':
|
244
|
-
this.value = '';
|
245
|
-
break;
|
246
|
-
}
|
247
|
-
this._block_reset = true;
|
248
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
249
|
-
}
|
250
|
-
_onChangedSolid(e) {
|
251
|
-
if (this.fillType !== 'solid')
|
252
|
-
return;
|
253
|
-
this.solid = e.target.value;
|
254
|
-
this.value = this.solid;
|
255
|
-
this._block_reset = true;
|
256
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
257
|
-
}
|
258
|
-
_onChandedGradient(e) {
|
259
|
-
/*
|
260
|
-
* TODO Gradient의 rotation은 symmetry 기능 등으로 외부에서 변경될 수도 있다.
|
261
|
-
* 이 점을 감안해서, 외부 변경에 대한 대응을 해야 한다.
|
262
|
-
*/
|
263
|
-
if (this.fillType !== 'gradient') {
|
264
|
-
return;
|
265
|
-
}
|
266
|
-
this.gradient = e.target.value;
|
267
|
-
this.value = {
|
268
|
-
type: 'gradient',
|
269
|
-
gradientType: this.gradient.type || 'linear',
|
270
|
-
colorStops: this.gradient.colorStops || [
|
271
|
-
{
|
272
|
-
position: 0,
|
273
|
-
color: this.solid || '#000000'
|
274
|
-
},
|
275
|
-
{
|
276
|
-
position: 1,
|
277
|
-
color: this.solid || '#FFFFFF'
|
278
|
-
}
|
279
|
-
],
|
280
|
-
rotation: Number(this.gradient.rotation) || 0,
|
281
|
-
center: this.gradient.center
|
282
|
-
};
|
283
|
-
this._block_reset = true;
|
284
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
285
|
-
}
|
286
|
-
_onChangedPattern(e) {
|
287
|
-
if (this.fillType !== 'pattern')
|
288
|
-
return;
|
289
|
-
this.pattern = e.target.value;
|
290
|
-
this.value = {
|
291
|
-
type: 'pattern',
|
292
|
-
image: this.pattern?.image,
|
293
|
-
offsetX: Number(this.pattern?.offsetX) || 0,
|
294
|
-
offsetY: Number(this.pattern?.offsetY) || 0,
|
295
|
-
width: Number(this.pattern?.width),
|
296
|
-
height: Number(this.pattern?.height),
|
297
|
-
align: this.pattern?.align,
|
298
|
-
fitPattern: this.pattern?.fitPattern
|
299
|
-
};
|
300
|
-
this._block_reset = true;
|
301
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
302
|
-
}
|
303
|
-
};
|
304
|
-
__decorate([
|
305
|
-
property({ type: Object })
|
306
|
-
], OxInputColorStyle.prototype, "value", void 0);
|
307
|
-
__decorate([
|
308
|
-
property({ type: String })
|
309
|
-
], OxInputColorStyle.prototype, "fillType", void 0);
|
310
|
-
__decorate([
|
311
|
-
property({ type: String })
|
312
|
-
], OxInputColorStyle.prototype, "solid", void 0);
|
313
|
-
__decorate([
|
314
|
-
property({ type: Object })
|
315
|
-
], OxInputColorStyle.prototype, "gradient", void 0);
|
316
|
-
__decorate([
|
317
|
-
property({ type: Object })
|
318
|
-
], OxInputColorStyle.prototype, "pattern", void 0);
|
319
|
-
OxInputColorStyle = __decorate([
|
320
|
-
customElement('ox-input-color-style')
|
321
|
-
], OxInputColorStyle);
|
322
|
-
export { OxInputColorStyle };
|
323
|
-
//# sourceMappingURL=ox-input-fill-style.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ox-input-fill-style.js","sourceRoot":"","sources":["../../src/ox-input-fill-style.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,0BAA0B,CAAA;AACjC,OAAO,kBAAkB,CAAA;AACzB,OAAO,2BAA2B,CAAA;AAClC,OAAO,+BAA+B,CAAA;AAItC,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AAGlE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAqB7C,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,WAAW;IAAlD;;QAsDU,iBAAY,GAAY,KAAK,CAAA;IA8QvC,CAAC;aAnUQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6ClB,CAAA;IAUD,OAAO,CAAC,OAA6B;QACnC,OAAO,CAAC,GAAG,CAAC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3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAkC;AApDlD,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAoU7B;SApUY,iBAAiB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/i18n/ox-i18n.js'\nimport './ox-input-color'\nimport './ox-input-color-gradient'\nimport './ox-input-background-pattern'\n\nimport { BackgroundPatternOption, OxInputBackgroundPattern } from './ox-input-background-pattern'\nimport { GradientOption, OxInputColorGradient } from './ox-input-color-gradient'\nimport { PropertyValues, css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { ColorStop } from './ox-input-color-stops'\nimport { OxFormField } from './ox-form-field'\n\nexport type FillStyle =\n | {\n type?: 'no' | 'solid' | 'gradient' | 'pattern'\n gradientType?: 'linear' | 'radial'\n colorStops?: ColorStop[]\n rotation?: number\n center?: 'center' | 'left-top' | 'right-top' | 'right-bottom' | 'left-bottom'\n image?: HTMLImageElement | string\n offsetX?: number\n offsetY?: number\n width?: number\n height?: number\n align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'\n fitPattern?: boolean\n }\n | 'no'\n | string\n\n@customElement('ox-input-color-style')\nexport class OxInputColorStyle extends OxFormField {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n }\n\n [fill-type] {\n display: flex;\n margin: 0 0 14px 0;\n }\n\n [fill-type] * {\n flex: auto;\n margin: 0;\n text-align: left;\n align-self: center;\n }\n\n .grid-10 {\n display: grid;\n\n grid-template-columns: repeat(10, 1fr);\n grid-gap: 5px;\n grid-auto-rows: minmax(24px, auto);\n }\n\n .grid-10 > ox-input-color {\n grid-column: span 4;\n }\n\n .grid-10 > .icon-only-label {\n grid-column: span 1;\n\n background: url(/assets/images/icon-properties-label.png) no-repeat;\n float: left;\n margin: 0;\n }\n\n .icon-only-label.color {\n background-position: 70% -498px;\n }\n\n [editors] > :not([active]) {\n display: none;\n }\n `\n\n @property({ type: Object }) value?: FillStyle\n @property({ type: String }) fillType?: string\n @property({ type: String }) solid?: string\n @property({ type: Object }) gradient?: GradientOption\n @property({ type: Object }) pattern?: BackgroundPatternOption\n\n private _block_reset: boolean = false\n\n updated(changes: PropertyValues<this>) {\n changes.has('value') && this._onChangedValue(this.value || {})\n }\n\n render() {\n return html`\n <div @change=${(e: Event) => this._onChangedFillType(e)} fill-type>\n <input\n type=\"radio\"\n id=\"fill-type-no\"\n name=\"fill-type\"\n value=\"no\"\n .checked=${!this.fillType || this.fillType == 'no'}\n />\n <label for=\"fill-type-no\"><ox-i18n msgid=\"label.no-fill\">no fill</ox-i18n></label>\n <input type=\"radio\" id=\"fill-type-solid\" name=\"fill-type\" value=\"solid\" .checked=${this.fillType == 'solid'} />\n <label for=\"fill-type-solid\"><ox-i18n msgid=\"label.solid\">solid</ox-i18n></label>\n <input\n type=\"radio\"\n id=\"fill-type-gradient\"\n name=\"fill-type\"\n value=\"gradient\"\n .checked=${this.fillType == 'gradient'}\n />\n <label for=\"fill-type-gradient\"><ox-i18n msgid=\"label.gradient\">gradient</ox-i18n></label>\n <input\n type=\"radio\"\n id=\"fill-type-pattern\"\n name=\"fill-type\"\n value=\"pattern\"\n .checked=${this.fillType == 'pattern'}\n />\n <label for=\"fill-type-pattern\"><ox-i18n msgid=\"label.pattern\">pattern</ox-i18n></label>\n </div>\n\n <div editors>\n <div ?active=${this.fillType == 'no'}></div>\n\n <div class=\"grid-10\" ?active=${this.fillType == 'solid'}>\n <label class=\"icon-only-label color\"></label>\n <ox-input-color @change=${(e: Event) => this._onChangedSolid(e)} .value=${this.solid}> </ox-input-color>\n </div>\n\n <div ?active=${this.fillType == 'gradient'}>\n <ox-input-color-gradient @change=${(e: Event) => this._onChandedGradient(e)} .value=${this.gradient}>\n </ox-input-color-gradient>\n </div>\n\n <div ?active=${this.fillType == 'pattern'}>\n <ox-input-background-pattern @change=${(e: Event) => this._onChangedPattern(e)} .value=${this.pattern}>\n </ox-input-background-pattern>\n </div>\n </div>\n `\n }\n\n async _onChangedValue(value: FillStyle) {\n /*\n * this._block_reset의 역할은 내부 사용자 인터렉션에 의한 value의 변경시에는 각 type별 이전값을 유지하기 위함이다.\n */\n await this.requestUpdate()\n\n /* 설정 값에 따라서, 멤버 속성을 설정한다. */\n if (!value) {\n this.fillType = 'no'\n\n if (!this._block_reset) {\n this.solid = undefined\n this.gradient = undefined\n this.pattern = undefined\n }\n\n this._block_reset = false\n return\n }\n\n switch (typeof value) {\n case 'string':\n this.fillType = 'solid'\n this.solid = value\n\n if (!this._block_reset) {\n this.gradient = undefined\n this.pattern = undefined\n }\n break\n case 'object':\n this.fillType = value.type\n\n if (value.type === 'gradient') {\n this.gradient = {\n type: value.gradientType || 'linear',\n colorStops: value.colorStops || [\n {\n position: 0,\n color: this.solid || '#000000'\n },\n {\n position: 1,\n color: this.solid || '#FFFFFF'\n }\n ],\n rotation: Number(value.rotation) || 0,\n center: value.center\n }\n\n if (!this._block_reset) {\n this.pattern = undefined\n this.solid = undefined\n }\n } else if (value.type === 'pattern') {\n this.pattern = {\n image: value.image,\n offsetX: Number(value.offsetX) || 0,\n offsetY: Number(value.offsetY) || 0,\n width: Number(value.width),\n height: Number(value.height),\n align: value.align,\n fitPattern: value.fitPattern\n }\n\n if (!this._block_reset) {\n this.gradient = undefined\n this.solid = undefined\n }\n }\n\n break\n default:\n }\n\n this._block_reset = false\n }\n\n _onChangedFillType(e: Event) {\n const element = e.target as HTMLInputElement\n this.fillType = element.value\n\n switch (this.fillType) {\n case 'gradient':\n if (!this.gradient) {\n this.gradient = {\n type: 'linear',\n colorStops: [\n {\n position: 0,\n color: this.solid || '#000000'\n },\n {\n position: 1,\n color: this.solid || '#FFFFFF'\n }\n ],\n rotation: 0,\n center: 'center'\n }\n }\n\n this.value = {\n type: 'gradient',\n gradientType: this.gradient.type || 'linear',\n colorStops: this.gradient.colorStops || [\n {\n position: 0,\n color: this.solid || '#000000'\n },\n {\n position: 1,\n color: this.solid || '#FFFFFF'\n }\n ],\n rotation: Number(this.gradient.rotation) || 0,\n center: this.gradient.center\n }\n break\n\n case 'pattern':\n if (!this.pattern) this.pattern = {}\n\n this.value = {\n type: 'pattern',\n image: this.pattern.image,\n offsetX: Number(this.pattern.offsetX) || 0,\n offsetY: Number(this.pattern.offsetY) || 0,\n width: Number(this.pattern.width),\n height: Number(this.pattern.height),\n align: this.pattern.align,\n fitPattern: this.pattern.fitPattern\n }\n break\n\n case 'solid':\n if (!this.solid) this.solid = '#fff'\n this.value = this.solid\n break\n\n case 'no':\n this.value = ''\n break\n }\n\n this._block_reset = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n _onChangedSolid(e: Event) {\n if (this.fillType !== 'solid') return\n\n this.solid = (e.target as HTMLInputElement).value\n\n this.value = this.solid\n\n this._block_reset = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n _onChandedGradient(e: Event) {\n /*\n * TODO Gradient의 rotation은 symmetry 기능 등으로 외부에서 변경될 수도 있다.\n * 이 점을 감안해서, 외부 변경에 대한 대응을 해야 한다.\n */\n\n if (this.fillType !== 'gradient') {\n return\n }\n\n this.gradient = (e.target as OxInputColorGradient).value\n\n this.value = {\n type: 'gradient',\n gradientType: this.gradient.type || 'linear',\n colorStops: this.gradient.colorStops || [\n {\n position: 0,\n color: this.solid || '#000000'\n },\n {\n position: 1,\n color: this.solid || '#FFFFFF'\n }\n ],\n rotation: Number(this.gradient.rotation) || 0,\n center: this.gradient.center\n }\n\n this._block_reset = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n _onChangedPattern(e: Event) {\n if (this.fillType !== 'pattern') return\n\n this.pattern = (e.target as OxInputBackgroundPattern).value\n\n this.value = {\n type: 'pattern',\n image: this.pattern?.image,\n offsetX: Number(this.pattern?.offsetX) || 0,\n offsetY: Number(this.pattern?.offsetY) || 0,\n width: Number(this.pattern?.width),\n height: Number(this.pattern?.height),\n align: this.pattern?.align,\n fitPattern: this.pattern?.fitPattern\n }\n\n this._block_reset = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { OxFormField } from './ox-form-field';
|
2
|
-
export declare class OxInputId extends OxFormField {
|
3
|
-
static styles: import("lit").CSSResult;
|
4
|
-
property: {
|
5
|
-
component?: string;
|
6
|
-
} | null | undefined;
|
7
|
-
_ids: Array<string>;
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
9
|
-
_onInputFocused(e: FocusEvent): void;
|
10
|
-
_onInputChanged(e: InputEvent): void;
|
11
|
-
}
|
package/dist/src/ox-input-id.js
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { css, html } from 'lit';
|
3
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
4
|
-
import { OxFormField } from './ox-form-field';
|
5
|
-
let OxInputId = class OxInputId extends OxFormField {
|
6
|
-
constructor() {
|
7
|
-
super(...arguments);
|
8
|
-
this._ids = [];
|
9
|
-
}
|
10
|
-
static { this.styles = css `
|
11
|
-
:host {
|
12
|
-
position: relative;
|
13
|
-
display: inline-flex;
|
14
|
-
align-items: center;
|
15
|
-
justify-content: flex-end;
|
16
|
-
}
|
17
|
-
|
18
|
-
input {
|
19
|
-
width: 100%;
|
20
|
-
height: 100%;
|
21
|
-
box-sizing: border-box;
|
22
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
23
|
-
}
|
24
|
-
`; }
|
25
|
-
render() {
|
26
|
-
const ids = this._ids || [];
|
27
|
-
return html `
|
28
|
-
<input
|
29
|
-
id="text"
|
30
|
-
type="text"
|
31
|
-
.value=${this.value || ''}
|
32
|
-
@focusin=${(e) => this._onInputFocused(e)}
|
33
|
-
@change=${(e) => this._onInputChanged(e)}
|
34
|
-
.placeholder=${this.getAttribute('placeholder') || ''}
|
35
|
-
list="ids"
|
36
|
-
/>
|
37
|
-
|
38
|
-
<datalist id="ids">${ids.map(id => html ` <option value=${id}></option> `)}</datalist>
|
39
|
-
`;
|
40
|
-
}
|
41
|
-
_onInputFocused(e) {
|
42
|
-
var { component } = this.property || {};
|
43
|
-
document.dispatchEvent(new CustomEvent('get-all-scene-component-ids', {
|
44
|
-
detail: {
|
45
|
-
component,
|
46
|
-
callback: (ids) => {
|
47
|
-
this._ids = ids;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
}));
|
51
|
-
}
|
52
|
-
_onInputChanged(e) {
|
53
|
-
e.stopPropagation();
|
54
|
-
this.value = e.target.value;
|
55
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
56
|
-
}
|
57
|
-
};
|
58
|
-
__decorate([
|
59
|
-
property({ type: Object })
|
60
|
-
], OxInputId.prototype, "property", void 0);
|
61
|
-
__decorate([
|
62
|
-
state()
|
63
|
-
], OxInputId.prototype, "_ids", void 0);
|
64
|
-
OxInputId = __decorate([
|
65
|
-
customElement('ox-input-id')
|
66
|
-
], OxInputId);
|
67
|
-
export { OxInputId };
|
68
|
-
//# sourceMappingURL=ox-input-id.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ox-input-id.js","sourceRoot":"","sources":["../../src/ox-input-id.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG7C,IAAa,SAAS,GAAtB,MAAa,SAAU,SAAQ,WAAW;I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IAAI,EAAE,MAAM,EAAE,CAAC;2CAAoD;AAEtE;IAAR,KAAK,EAAE;uCAAyB;AAnBtB,SAAS;IADrB,aAAa,CAAC,aAAa,CAAC;GAChB,SAAS,CA6DrB;SA7DY,SAAS","sourcesContent":["import { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { OxFormField } from './ox-form-field'\n\n@customElement('ox-input-id')\nexport class OxInputId extends OxFormField {\n static styles = css`\n :host {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: flex-end;\n }\n\n input {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n `\n\n @property({ type: Object }) property: { component?: string } | null | undefined\n\n @state() _ids: Array<string> = []\n\n render() {\n const ids = this._ids || []\n\n return html`\n <input\n id=\"text\"\n type=\"text\"\n .value=${this.value || ''}\n @focusin=${(e: FocusEvent) => this._onInputFocused(e)}\n @change=${(e: InputEvent) => this._onInputChanged(e)}\n .placeholder=${this.getAttribute('placeholder') || ''}\n list=\"ids\"\n />\n\n <datalist id=\"ids\">${ids.map(id => html` <option value=${id}></option> `)}</datalist>\n `\n }\n\n _onInputFocused(e: FocusEvent) {\n var { component } = this.property || {}\n\n document.dispatchEvent(\n new CustomEvent('get-all-scene-component-ids', {\n detail: {\n component,\n callback: (ids: string[]) => {\n this._ids = ids\n }\n }\n })\n )\n }\n\n _onInputChanged(e: InputEvent) {\n e.stopPropagation()\n\n this.value = (e.target as HTMLInputElement).value\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
@@ -1,163 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
|
-
*/
|
4
|
-
|
5
|
-
import '@operato/i18n/ox-i18n.js'
|
6
|
-
import './things-editor-attachment-selector'
|
7
|
-
|
8
|
-
import { css, html } from 'lit'
|
9
|
-
import { customElement, property } from 'lit/decorators.js'
|
10
|
-
|
11
|
-
import { OxFormField } from './ox-form-field'
|
12
|
-
|
13
|
-
export type BackgroundPatternOption = {
|
14
|
-
image?: HTMLImageElement | string
|
15
|
-
align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'
|
16
|
-
offsetX?: number
|
17
|
-
offsetY?: number
|
18
|
-
width?: number
|
19
|
-
height?: number
|
20
|
-
fitPattern?: boolean
|
21
|
-
}
|
22
|
-
|
23
|
-
/**
|
24
|
-
* 컴포넌트의 fill pattern을 편집하는 element
|
25
|
-
*
|
26
|
-
* Example:
|
27
|
-
* <ox-input-background-pattern
|
28
|
-
* @change="${e => { this.pattern = e.target.value }}"
|
29
|
-
* .value=${this.pattern}"
|
30
|
-
* ></ox-input-background-pattern>
|
31
|
-
*/
|
32
|
-
|
33
|
-
@customElement('ox-input-background-pattern')
|
34
|
-
export class OxInputBackgroundPattern extends OxFormField {
|
35
|
-
static styles = css`
|
36
|
-
:host,
|
37
|
-
.grid-10 {
|
38
|
-
display: grid;
|
39
|
-
grid-template-columns: repeat(10, 1fr);
|
40
|
-
grid-gap: 5px;
|
41
|
-
grid-auto-rows: minmax(24px, auto);
|
42
|
-
|
43
|
-
align-items: center;
|
44
|
-
}
|
45
|
-
|
46
|
-
* {
|
47
|
-
align-self: stretch;
|
48
|
-
}
|
49
|
-
|
50
|
-
label {
|
51
|
-
grid-column: span 2;
|
52
|
-
text-align: right;
|
53
|
-
text-transform: capitalize;
|
54
|
-
|
55
|
-
align-self: center;
|
56
|
-
}
|
57
|
-
|
58
|
-
.grid-10 {
|
59
|
-
grid-column: span 10;
|
60
|
-
}
|
61
|
-
|
62
|
-
select,
|
63
|
-
input,
|
64
|
-
[custom-editor] {
|
65
|
-
grid-column: span 8;
|
66
|
-
}
|
67
|
-
|
68
|
-
select {
|
69
|
-
height: 100%;
|
70
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
71
|
-
}
|
72
|
-
|
73
|
-
input[type='checkbox'] {
|
74
|
-
grid-column: 3 / 4;
|
75
|
-
align-self: center;
|
76
|
-
}
|
77
|
-
|
78
|
-
input[type='checkbox'] ~ label {
|
79
|
-
grid-column: span 7;
|
80
|
-
text-align: left;
|
81
|
-
}
|
82
|
-
|
83
|
-
.grid-10 > input[type='number'] {
|
84
|
-
grid-column: span 3;
|
85
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
86
|
-
}
|
87
|
-
|
88
|
-
.grid-10 > label {
|
89
|
-
grid-column: span 2;
|
90
|
-
text-align: right;
|
91
|
-
}
|
92
|
-
`
|
93
|
-
|
94
|
-
@property({ type: Object }) value?: BackgroundPatternOption
|
95
|
-
|
96
|
-
render() {
|
97
|
-
const value = this.value || ({} as BackgroundPatternOption)
|
98
|
-
|
99
|
-
return html`
|
100
|
-
<label> <ox-i18n msgid="label.image" auto="">image</ox-i18n> </label>
|
101
|
-
|
102
|
-
<things-editor-attachment-selector
|
103
|
-
value-key="image"
|
104
|
-
.value=${value.image || ''}
|
105
|
-
custom-editor
|
106
|
-
></things-editor-attachment-selector>
|
107
|
-
|
108
|
-
<label> <ox-i18n msgid="label.align" auto="">align</ox-i18n> </label>
|
109
|
-
|
110
|
-
<select value-key="align" class="select-content" .value=${value.align}>
|
111
|
-
<option value="left-top">Left Top</option>
|
112
|
-
<option value="top">Top</option>
|
113
|
-
<option value="right-top">Right Top</option>
|
114
|
-
<option value="left">Left</option>
|
115
|
-
<option value="center">Center</option>
|
116
|
-
<option value="right">Right</option>
|
117
|
-
<option value="left-bottom">Left Bottom</option>
|
118
|
-
<option value="bottom">Bottom</option>
|
119
|
-
<option value="right-bottom">Right Bottom</option>
|
120
|
-
</select>
|
121
|
-
|
122
|
-
<div class="grid-10">
|
123
|
-
<label> <ox-i18n msgid="label.offset-x" auto="">offsetX</ox-i18n> </label>
|
124
|
-
<input type="number" value-key="offsetX" .value=${value.offsetX} />
|
125
|
-
|
126
|
-
<label> <ox-i18n msgid="label.offset-y" auto="">offsetY</ox-i18n> </label>
|
127
|
-
<input type="number" value-key="offsetY" .value=${value.offsetY} />
|
128
|
-
|
129
|
-
<label> <ox-i18n msgid="label.width" auto="">width</ox-i18n> </label>
|
130
|
-
<input type="number" value-key="width" .value=${value.width} />
|
131
|
-
|
132
|
-
<label> <ox-i18n msgid="label.height" auto="">height</ox-i18n> </label>
|
133
|
-
<input type="number" value-key="height" .value=${value.height} />
|
134
|
-
</div>
|
135
|
-
|
136
|
-
<div class="grid-10">
|
137
|
-
<input value-key="fitPattern" type="checkbox" .checked=${value.fitPattern} required />
|
138
|
-
<label> <ox-i18n msgid="label.fit" auto="">Fit</ox-i18n> </label>
|
139
|
-
</div>
|
140
|
-
`
|
141
|
-
}
|
142
|
-
|
143
|
-
firstUpdated() {
|
144
|
-
this.renderRoot.addEventListener('change', this._onChange.bind(this))
|
145
|
-
}
|
146
|
-
|
147
|
-
_onChange(e: Event) {
|
148
|
-
var element = e.target as HTMLInputElement
|
149
|
-
var key = element.getAttribute('value-key')
|
150
|
-
var value: any = element.value
|
151
|
-
|
152
|
-
if (key == 'fitPattern') {
|
153
|
-
value = element.checked
|
154
|
-
}
|
155
|
-
|
156
|
-
this.value = {
|
157
|
-
...this.value,
|
158
|
-
[key!]: value
|
159
|
-
}
|
160
|
-
|
161
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))
|
162
|
-
}
|
163
|
-
}
|