@operato/app 9.0.0-beta.13 → 9.0.0-beta.14

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.
@@ -1,342 +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 '@operato/input/ox-input-color.js';
7
- import '@operato/input/ox-input-color-stops.js';
8
- import '@operato/input/ox-input-color-gradient.js';
9
- import './ox-input-background-pattern.js';
10
- import { css, html } from 'lit';
11
- import { customElement, property } from 'lit/decorators.js';
12
- import { OxFormField } from '@operato/input';
13
- let OxInputColorStyle = class OxInputColorStyle extends OxFormField {
14
- constructor() {
15
- super(...arguments);
16
- this.value = undefined;
17
- this.colorOnly = false;
18
- this._block_reset = false;
19
- }
20
- updated(changes) {
21
- changes.has('value') && this._onChangedValue(this.value || {});
22
- }
23
- render() {
24
- return html `
25
- <div @change=${(e) => this._onChangedFillType(e)} fill-type>
26
- <input
27
- type="radio"
28
- id="fill-type-no"
29
- name="fill-type"
30
- value="no"
31
- .checked=${!this.fillType || this.fillType == 'no'}
32
- />
33
- <label for="fill-type-no"><ox-i18n msgid="label.no-fill">no fill</ox-i18n></label>
34
- <input type="radio" id="fill-type-solid" name="fill-type" value="solid" .checked=${this.fillType == 'solid'} />
35
- <label for="fill-type-solid"><ox-i18n msgid="label.solid">solid</ox-i18n></label>
36
- <input
37
- type="radio"
38
- id="fill-type-gradient"
39
- name="fill-type"
40
- value="gradient"
41
- .checked=${this.fillType == 'gradient'}
42
- />
43
-
44
- <label for="fill-type-gradient"><ox-i18n msgid="label.gradient">gradient</ox-i18n></label>
45
-
46
- ${this.colorOnly
47
- ? html ``
48
- : html `
49
- <input
50
- type="radio"
51
- id="fill-type-pattern"
52
- name="fill-type"
53
- value="pattern"
54
- .checked=${this.fillType == 'pattern'}
55
- />
56
- <label for="fill-type-pattern"><ox-i18n msgid="label.pattern">pattern</ox-i18n></label>
57
- `}
58
- </div>
59
-
60
- <div editors>
61
- <div ?active=${this.fillType == 'no'}></div>
62
-
63
- <div class="grid-10" ?active=${this.fillType == 'solid'}>
64
- <label class="icon-only-label color"></label>
65
- <ox-input-color @change=${(e) => this._onChangedSolid(e)} .value=${this.solid}> </ox-input-color>
66
- </div>
67
-
68
- <div ?active=${this.fillType == 'gradient'}>
69
- <ox-input-color-gradient @change=${(e) => this._onChandedGradient(e)} .value=${this.gradient}>
70
- </ox-input-color-gradient>
71
- </div>
72
-
73
- <div ?active=${this.fillType == 'pattern'}>
74
- <ox-input-background-pattern @change=${(e) => this._onChangedPattern(e)} .value=${this.pattern}>
75
- </ox-input-background-pattern>
76
- </div>
77
- </div>
78
- `;
79
- }
80
- async _onChangedValue(value) {
81
- /*
82
- * this._block_reset의 역할은 내부 사용자 인터렉션에 의한 value의 변경시에는 각 type별 이전값을 유지하기 위함이다.
83
- */
84
- await this.requestUpdate();
85
- /* 설정 값에 따라서, 멤버 속성을 설정한다. */
86
- if (!value) {
87
- this.fillType = 'no';
88
- if (!this._block_reset) {
89
- this.solid = undefined;
90
- this.gradient = undefined;
91
- this.pattern = undefined;
92
- }
93
- this._block_reset = false;
94
- return;
95
- }
96
- switch (typeof value) {
97
- case 'string':
98
- this.fillType = 'solid';
99
- this.solid = value;
100
- if (!this._block_reset) {
101
- this.gradient = undefined;
102
- this.pattern = undefined;
103
- }
104
- break;
105
- case 'object':
106
- this.fillType = value.type;
107
- if (value.type === 'gradient') {
108
- this.gradient = {
109
- type: value.gradientType || 'linear',
110
- colorStops: value.colorStops || [
111
- {
112
- position: 0,
113
- color: this.solid || '#000000'
114
- },
115
- {
116
- position: 1,
117
- color: this.solid || '#FFFFFF'
118
- }
119
- ],
120
- rotation: Number(value.rotation) || 0,
121
- center: value.center
122
- };
123
- if (!this._block_reset) {
124
- this.pattern = undefined;
125
- this.solid = undefined;
126
- }
127
- }
128
- else if (value.type === 'pattern') {
129
- this.pattern = {
130
- image: value.image,
131
- offsetX: Number(value.offsetX) || 0,
132
- offsetY: Number(value.offsetY) || 0,
133
- width: Number(value.width),
134
- height: Number(value.height),
135
- align: value.align,
136
- fitPattern: value.fitPattern,
137
- noRepeat: value.noRepeat,
138
- color: value.color
139
- };
140
- if (!this._block_reset) {
141
- this.gradient = undefined;
142
- this.solid = undefined;
143
- }
144
- }
145
- break;
146
- default:
147
- }
148
- this._block_reset = false;
149
- }
150
- _onChangedFillType(e) {
151
- const element = e.target;
152
- this.fillType = element.value;
153
- switch (this.fillType) {
154
- case 'gradient':
155
- if (!this.gradient) {
156
- this.gradient = {
157
- type: 'linear',
158
- colorStops: [
159
- {
160
- position: 0,
161
- color: this.solid || '#000000'
162
- },
163
- {
164
- position: 1,
165
- color: this.solid || '#FFFFFF'
166
- }
167
- ],
168
- rotation: 0,
169
- center: 'center'
170
- };
171
- }
172
- this.value = {
173
- type: 'gradient',
174
- gradientType: this.gradient.type || 'linear',
175
- colorStops: this.gradient.colorStops || [
176
- {
177
- position: 0,
178
- color: this.solid || '#000000'
179
- },
180
- {
181
- position: 1,
182
- color: this.solid || '#FFFFFF'
183
- }
184
- ],
185
- rotation: Number(this.gradient.rotation) || 0,
186
- center: this.gradient.center
187
- };
188
- break;
189
- case 'pattern':
190
- if (!this.pattern)
191
- this.pattern = {};
192
- this.value = {
193
- type: 'pattern',
194
- image: this.pattern.image,
195
- offsetX: Number(this.pattern.offsetX) || 0,
196
- offsetY: Number(this.pattern.offsetY) || 0,
197
- width: Number(this.pattern.width),
198
- height: Number(this.pattern.height),
199
- align: this.pattern.align,
200
- fitPattern: this.pattern.fitPattern,
201
- noRepeat: this.pattern.noRepeat,
202
- color: this.pattern.color
203
- };
204
- break;
205
- case 'solid':
206
- if (!this.solid)
207
- this.solid = '#fff';
208
- this.value = this.solid;
209
- break;
210
- case 'no':
211
- this.value = '';
212
- break;
213
- }
214
- this._block_reset = true;
215
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
216
- }
217
- _onChangedSolid(e) {
218
- if (this.fillType !== 'solid')
219
- return;
220
- this.solid = e.target.value;
221
- this.value = this.solid;
222
- this._block_reset = true;
223
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
224
- }
225
- _onChandedGradient(e) {
226
- /*
227
- * TODO Gradient의 rotation은 symmetry 기능 등으로 외부에서 변경될 수도 있다.
228
- * 이 점을 감안해서, 외부 변경에 대한 대응을 해야 한다.
229
- */
230
- if (this.fillType !== 'gradient') {
231
- return;
232
- }
233
- this.gradient = e.target.value;
234
- this.value = {
235
- type: 'gradient',
236
- gradientType: this.gradient.type || 'linear',
237
- colorStops: this.gradient.colorStops || [
238
- {
239
- position: 0,
240
- color: this.solid || '#000000'
241
- },
242
- {
243
- position: 1,
244
- color: this.solid || '#FFFFFF'
245
- }
246
- ],
247
- rotation: Number(this.gradient.rotation) || 0,
248
- center: this.gradient.center
249
- };
250
- this._block_reset = true;
251
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
252
- }
253
- _onChangedPattern(e) {
254
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
255
- if (this.fillType !== 'pattern')
256
- return;
257
- this.pattern = e.target.value;
258
- this.value = {
259
- type: 'pattern',
260
- image: (_a = this.pattern) === null || _a === void 0 ? void 0 : _a.image,
261
- offsetX: Number((_b = this.pattern) === null || _b === void 0 ? void 0 : _b.offsetX) || 0,
262
- offsetY: Number((_c = this.pattern) === null || _c === void 0 ? void 0 : _c.offsetY) || 0,
263
- width: Number((_d = this.pattern) === null || _d === void 0 ? void 0 : _d.width),
264
- height: Number((_e = this.pattern) === null || _e === void 0 ? void 0 : _e.height),
265
- align: (_f = this.pattern) === null || _f === void 0 ? void 0 : _f.align,
266
- fitPattern: (_g = this.pattern) === null || _g === void 0 ? void 0 : _g.fitPattern,
267
- noRepeat: (_h = this.pattern) === null || _h === void 0 ? void 0 : _h.noRepeat,
268
- color: (_j = this.pattern) === null || _j === void 0 ? void 0 : _j.color
269
- };
270
- this._block_reset = true;
271
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
272
- }
273
- };
274
- OxInputColorStyle.styles = css `
275
- :host {
276
- display: flex;
277
- flex-direction: column;
278
- }
279
-
280
- [fill-type] {
281
- display: flex;
282
- margin: 0 0 14px 0;
283
- }
284
-
285
- [fill-type] * {
286
- flex: auto;
287
- margin: 0;
288
- text-align: left;
289
- align-self: center;
290
- }
291
-
292
- .grid-10 {
293
- display: grid;
294
-
295
- grid-template-columns: repeat(10, 1fr);
296
- grid-gap: 5px;
297
- grid-auto-rows: minmax(24px, auto);
298
- }
299
-
300
- .grid-10 > ox-input-color {
301
- grid-column: span 4;
302
- }
303
-
304
- .grid-10 > .icon-only-label {
305
- grid-column: span 1;
306
-
307
- background: var(--url-icon-properties-label) no-repeat;
308
- float: left;
309
- margin: 0;
310
- }
311
-
312
- .icon-only-label.color {
313
- background-position: 100% -500px;
314
- }
315
-
316
- [editors] > :not([active]) {
317
- display: none;
318
- }
319
- `;
320
- __decorate([
321
- property({ type: Object })
322
- ], OxInputColorStyle.prototype, "value", void 0);
323
- __decorate([
324
- property({ type: String })
325
- ], OxInputColorStyle.prototype, "fillType", void 0);
326
- __decorate([
327
- property({ type: String })
328
- ], OxInputColorStyle.prototype, "solid", void 0);
329
- __decorate([
330
- property({ type: Object })
331
- ], OxInputColorStyle.prototype, "gradient", void 0);
332
- __decorate([
333
- property({ type: Object })
334
- ], OxInputColorStyle.prototype, "pattern", void 0);
335
- __decorate([
336
- property({ type: Boolean, attribute: 'color-only' })
337
- ], OxInputColorStyle.prototype, "colorOnly", void 0);
338
- OxInputColorStyle = __decorate([
339
- customElement('ox-input-fill-style')
340
- ], OxInputColorStyle);
341
- export { OxInputColorStyle };
342
- //# sourceMappingURL=ox-input-fill-style.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-input-fill-style.js","sourceRoot":"","sources":["../../../src/input/ox-input-fill-style.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,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,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;AAEP;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAA2B;AAtDrE,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAkV7B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/input/ox-input-color.js'\nimport '@operato/input/ox-input-color-stops.js'\nimport '@operato/input/ox-input-color-gradient.js'\nimport './ox-input-background-pattern.js'\n\nimport { css, html, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ColorStop, GradientOption, OxFormField, OxInputColorGradient } from '@operato/input'\n\nimport { BackgroundPatternOption, OxInputBackgroundPattern } from './ox-input-background-pattern.js'\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 noRepeat?: boolean\n color?: string\n }\n | 'no'\n | string\n\n@customElement('ox-input-fill-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: var(--url-icon-properties-label) no-repeat;\n float: left;\n margin: 0;\n }\n\n .icon-only-label.color {\n background-position: 100% -500px;\n }\n\n [editors] > :not([active]) {\n display: none;\n }\n `\n\n @property({ type: Object }) value?: FillStyle = undefined\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 @property({ type: Boolean, attribute: 'color-only' }) colorOnly: boolean = false\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\n <label for=\"fill-type-gradient\"><ox-i18n msgid=\"label.gradient\">gradient</ox-i18n></label>\n\n ${this.colorOnly\n ? html``\n : html`\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 `}\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 noRepeat: value.noRepeat,\n color: value.color\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 noRepeat: this.pattern.noRepeat,\n color: this.pattern.color\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 noRepeat: this.pattern?.noRepeat,\n color: this.pattern?.color\n }\n\n this._block_reset = true\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}