@operato/input 9.0.0-beta.52 → 9.0.0-beta.54

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 CHANGED
@@ -3,6 +3,24 @@
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
+ ## [9.0.0-beta.54](https://github.com/hatiolab/operato/compare/v9.0.0-beta.53...v9.0.0-beta.54) (2025-03-04)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * add guide-only option for scene fillstyle ([b9c2544](https://github.com/hatiolab/operato/commit/b9c2544c0c7e9fb44d6f84f366a590587cfbc066))
12
+
13
+
14
+
15
+ ## [9.0.0-beta.53](https://github.com/hatiolab/operato/compare/v9.0.0-beta.52...v9.0.0-beta.53) (2025-03-04)
16
+
17
+
18
+ ### :bug: Bug Fix
19
+
20
+ * add guide-only option for scene fillstyle ([48baf4e](https://github.com/hatiolab/operato/commit/48baf4e5f4e22c5ad6ffb1cf2530dc97a4b00d94))
21
+
22
+
23
+
6
24
  ## [9.0.0-beta.52](https://github.com/hatiolab/operato/compare/v9.0.0-beta.51...v9.0.0-beta.52) (2025-03-04)
7
25
 
8
26
  **Note:** Version bump only for package @operato/input
@@ -16,6 +16,7 @@ export type BackgroundPatternOption = {
16
16
  height?: number;
17
17
  fitPattern?: boolean;
18
18
  noRepeat?: boolean;
19
+ guideOnly?: boolean;
19
20
  };
20
21
  /**
21
22
  * 컴포넌트의 fill pattern을 편집하는 element
@@ -49,7 +49,7 @@ let OxInputBackgroundPattern = class OxInputBackgroundPattern extends OxFormFiel
49
49
 
50
50
  <label> <ox-i18n msgid="label.align">align</ox-i18n> </label>
51
51
 
52
- <select value-key="align" .value=${value.align}>
52
+ <select value-key="align" .value=${value.align || 'left-top'}>
53
53
  <option value="left-top">Left Top</option>
54
54
  <option value="top">Center Top</option>
55
55
  <option value="right-top">Right Top</option>
@@ -62,16 +62,16 @@ let OxInputBackgroundPattern = class OxInputBackgroundPattern extends OxFormFiel
62
62
  </select>
63
63
 
64
64
  <label> <ox-i18n msgid="label.offset-x">offsetX</ox-i18n> </label>
65
- <input type="number" value-key="offsetX" .value=${value.offsetX} />
65
+ <input type="number" value-key="offsetX" .value=${String(value.offsetX || 0)} />
66
66
 
67
67
  <label> <ox-i18n msgid="label.offset-y">offsetY</ox-i18n> </label>
68
- <input type="number" value-key="offsetY" .value=${value.offsetY} />
68
+ <input type="number" value-key="offsetY" .value=${String(value.offsetY || 0)} />
69
69
 
70
70
  <label> <ox-i18n msgid="label.width">width</ox-i18n> </label>
71
- <input type="number" value-key="width" .value=${value.width} />
71
+ <input type="number" value-key="width" .value=${String(value.width || 0)} />
72
72
 
73
73
  <label> <ox-i18n msgid="label.height">height</ox-i18n> </label>
74
- <input type="number" value-key="height" .value=${value.height} />
74
+ <input type="number" value-key="height" .value=${String(value.height || 0)} />
75
75
 
76
76
  <label><md-icon>format_color_fill</md-icon></label>
77
77
  <ox-input-color class="custom-editor" value-key="color" .value=${value.color}> </ox-input-color>
@@ -81,6 +81,9 @@ let OxInputBackgroundPattern = class OxInputBackgroundPattern extends OxFormFiel
81
81
 
82
82
  <input id="noRepeat" value-key="noRepeat" type="checkbox" ?checked=${value.noRepeat} required />
83
83
  <label for="noRepeat"> <ox-i18n msgid="label.no-repeat">no repeat</ox-i18n> </label>
84
+
85
+ <input id="guideOnly" value-key="guideOnly" type="checkbox" ?checked=${value.guideOnly} required />
86
+ <label for="guideOnly"> <ox-i18n msgid="label.guide-only">guide only</ox-i18n> </label>
84
87
  </div>
85
88
  `;
86
89
  }
@@ -91,7 +94,7 @@ let OxInputBackgroundPattern = class OxInputBackgroundPattern extends OxFormFiel
91
94
  var element = e.target;
92
95
  var key = element.getAttribute('value-key');
93
96
  var value = element.value;
94
- if (key === 'fitPattern' || key === 'noRepeat') {
97
+ if (key === 'fitPattern' || key === 'noRepeat' || key === 'guideOnly') {
95
98
  value = element.checked;
96
99
  }
97
100
  this.value = {
@@ -1 +1 @@
1
- {"version":3,"file":"ox-input-background-pattern.js","sourceRoot":"","sources":["../../src/ox-input-background-pattern.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,+CAA+C,CAAA;AACtD,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAchD;;;;;;;;GAQG;AAGI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,WAAW;IAAlD;;QAUuB,UAAK,GAA6B,SAAS,CAAA;IA4EzE,CAAC;aArFQ,WAAM,GAAG;QACd,kBAAkB;QAClB,GAAG,CAAA;;;;KAIF;KACF,AAPY,CAOZ;IAID,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAK,EAA8B,CAAA;QAE3D,OAAO,IAAI,CAAA;;;;;;mBAMI,KAAK,CAAC,KAAK,IAAI,EAAE;wBACZ;YACZ,QAAQ,EAAE,OAAO;SAClB;;;;;;2CAMgC,KAAK,CAAC,KAAK;;;;;;;;;;;;;0DAaI,KAAK,CAAC,OAAO;;;0DAGb,KAAK,CAAC,OAAO;;;wDAGf,KAAK,CAAC,KAAK;;;yDAGV,KAAK,CAAC,MAAM;;;yEAGI,KAAK,CAAC,KAAK;;iFAEH,KAAK,CAAC,UAAU;;;6EAGpB,KAAK,CAAC,QAAQ;;;KAGtF,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACvE,CAAC;IAED,SAAS,CAAC,CAAQ;QAChB,IAAI,OAAO,GAAG,CAAC,CAAC,MAA0B,CAAA;QAC1C,IAAI,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAA;QAC3C,IAAI,KAAK,GAAQ,OAAO,CAAC,KAAK,CAAA;QAE9B,IAAI,GAAG,KAAK,YAAY,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YAC/C,KAAK,GAAG,OAAO,CAAC,OAAO,CAAA;QACzB,CAAC;QAED,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,IAAI,CAAC,KAAK;YACb,CAAC,GAAI,CAAC,EAAE,KAAK;SACd,CAAA;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AA3E2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAA4C;AAV5D,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAsFpC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/attachment/ox-attachment-selector.js'\nimport './ox-input-color.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { OxFormField } from './ox-form-field.js'\n\nexport type BackgroundPatternOption = {\n image?: HTMLImageElement | string\n color?: string\n align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'\n offsetX?: number\n offsetY?: number\n width?: number\n height?: number\n fitPattern?: boolean\n noRepeat?: boolean\n}\n\n/**\n * 컴포넌트의 fill pattern을 편집하는 element\n *\n * Example:\n * <ox-input-background-pattern\n * @change=\"${e => { this.pattern = e.target.value }}\"\n * .value=${this.pattern}\"\n * ></ox-input-background-pattern>\n */\n\n@customElement('ox-input-background-pattern')\nexport class OxInputBackgroundPattern extends OxFormField {\n static styles = [\n PropertyGridStyles,\n css`\n :host {\n display: flex;\n }\n `\n ]\n\n @property({ type: Object }) value?: BackgroundPatternOption = undefined\n\n render() {\n const value = this.value || ({} as BackgroundPatternOption)\n\n return html`\n <div class=\"property-grid\">\n <label> <ox-i18n msgid=\"label.image\">image</ox-i18n> </label>\n\n <ox-attachment-selector\n value-key=\"image\"\n .value=${value.image || ''}\n .properties=${{\n category: 'image'\n }}\n class=\"custom-editor\"\n ></ox-attachment-selector>\n\n <label> <ox-i18n msgid=\"label.align\">align</ox-i18n> </label>\n\n <select value-key=\"align\" .value=${value.align}>\n <option value=\"left-top\">Left Top</option>\n <option value=\"top\">Center Top</option>\n <option value=\"right-top\">Right Top</option>\n <option value=\"left\">Left Center</option>\n <option value=\"center\">Center Center</option>\n <option value=\"right\">Right Center</option>\n <option value=\"left-bottom\">Left Bottom</option>\n <option value=\"bottom\">Center Bottom</option>\n <option value=\"right-bottom\">Right Bottom</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.offset-x\">offsetX</ox-i18n> </label>\n <input type=\"number\" value-key=\"offsetX\" .value=${value.offsetX} />\n\n <label> <ox-i18n msgid=\"label.offset-y\">offsetY</ox-i18n> </label>\n <input type=\"number\" value-key=\"offsetY\" .value=${value.offsetY} />\n\n <label> <ox-i18n msgid=\"label.width\">width</ox-i18n> </label>\n <input type=\"number\" value-key=\"width\" .value=${value.width} />\n\n <label> <ox-i18n msgid=\"label.height\">height</ox-i18n> </label>\n <input type=\"number\" value-key=\"height\" .value=${value.height} />\n\n <label><md-icon>format_color_fill</md-icon></label>\n <ox-input-color class=\"custom-editor\" value-key=\"color\" .value=${value.color}> </ox-input-color>\n\n <input id=\"fitPattern\" value-key=\"fitPattern\" type=\"checkbox\" ?checked=${value.fitPattern} required />\n <label for=\"fitPattern\"> <ox-i18n msgid=\"label.fit\">fit</ox-i18n> </label>\n\n <input id=\"noRepeat\" value-key=\"noRepeat\" type=\"checkbox\" ?checked=${value.noRepeat} required />\n <label for=\"noRepeat\"> <ox-i18n msgid=\"label.no-repeat\">no repeat</ox-i18n> </label>\n </div>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onChange.bind(this))\n }\n\n _onChange(e: Event) {\n var element = e.target as HTMLInputElement\n var key = element.getAttribute('value-key')\n var value: any = element.value\n\n if (key === 'fitPattern' || key === 'noRepeat') {\n value = element.checked\n }\n\n this.value = {\n ...this.value,\n [key!]: value\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
1
+ {"version":3,"file":"ox-input-background-pattern.js","sourceRoot":"","sources":["../../src/ox-input-background-pattern.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,+CAA+C,CAAA;AACtD,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAehD;;;;;;;;GAQG;AAGI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,WAAW;IAAlD;;QAUuB,UAAK,GAA6B,SAAS,CAAA;IA+EzE,CAAC;aAxFQ,WAAM,GAAG;QACd,kBAAkB;QAClB,GAAG,CAAA;;;;KAIF;KACF,AAPY,CAOZ;IAID,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAK,EAA8B,CAAA;QAE3D,OAAO,I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AAA;IAClF,CAAC;;AA9E2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAA4C;AAV5D,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAyFpC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport '@operato/attachment/ox-attachment-selector.js'\nimport './ox-input-color.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { OxFormField } from './ox-form-field.js'\n\nexport type BackgroundPatternOption = {\n image?: HTMLImageElement | string\n color?: string\n align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'\n offsetX?: number\n offsetY?: number\n width?: number\n height?: number\n fitPattern?: boolean\n noRepeat?: boolean\n guideOnly?: boolean\n}\n\n/**\n * 컴포넌트의 fill pattern을 편집하는 element\n *\n * Example:\n * <ox-input-background-pattern\n * @change=\"${e => { this.pattern = e.target.value }}\"\n * .value=${this.pattern}\"\n * ></ox-input-background-pattern>\n */\n\n@customElement('ox-input-background-pattern')\nexport class OxInputBackgroundPattern extends OxFormField {\n static styles = [\n PropertyGridStyles,\n css`\n :host {\n display: flex;\n }\n `\n ]\n\n @property({ type: Object }) value?: BackgroundPatternOption = undefined\n\n render() {\n const value = this.value || ({} as BackgroundPatternOption)\n\n return html`\n <div class=\"property-grid\">\n <label> <ox-i18n msgid=\"label.image\">image</ox-i18n> </label>\n\n <ox-attachment-selector\n value-key=\"image\"\n .value=${value.image || ''}\n .properties=${{\n category: 'image'\n }}\n class=\"custom-editor\"\n ></ox-attachment-selector>\n\n <label> <ox-i18n msgid=\"label.align\">align</ox-i18n> </label>\n\n <select value-key=\"align\" .value=${value.align || 'left-top'}>\n <option value=\"left-top\">Left Top</option>\n <option value=\"top\">Center Top</option>\n <option value=\"right-top\">Right Top</option>\n <option value=\"left\">Left Center</option>\n <option value=\"center\">Center Center</option>\n <option value=\"right\">Right Center</option>\n <option value=\"left-bottom\">Left Bottom</option>\n <option value=\"bottom\">Center Bottom</option>\n <option value=\"right-bottom\">Right Bottom</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.offset-x\">offsetX</ox-i18n> </label>\n <input type=\"number\" value-key=\"offsetX\" .value=${String(value.offsetX || 0)} />\n\n <label> <ox-i18n msgid=\"label.offset-y\">offsetY</ox-i18n> </label>\n <input type=\"number\" value-key=\"offsetY\" .value=${String(value.offsetY || 0)} />\n\n <label> <ox-i18n msgid=\"label.width\">width</ox-i18n> </label>\n <input type=\"number\" value-key=\"width\" .value=${String(value.width || 0)} />\n\n <label> <ox-i18n msgid=\"label.height\">height</ox-i18n> </label>\n <input type=\"number\" value-key=\"height\" .value=${String(value.height || 0)} />\n\n <label><md-icon>format_color_fill</md-icon></label>\n <ox-input-color class=\"custom-editor\" value-key=\"color\" .value=${value.color}> </ox-input-color>\n\n <input id=\"fitPattern\" value-key=\"fitPattern\" type=\"checkbox\" ?checked=${value.fitPattern} required />\n <label for=\"fitPattern\"> <ox-i18n msgid=\"label.fit\">fit</ox-i18n> </label>\n\n <input id=\"noRepeat\" value-key=\"noRepeat\" type=\"checkbox\" ?checked=${value.noRepeat} required />\n <label for=\"noRepeat\"> <ox-i18n msgid=\"label.no-repeat\">no repeat</ox-i18n> </label>\n\n <input id=\"guideOnly\" value-key=\"guideOnly\" type=\"checkbox\" ?checked=${value.guideOnly} required />\n <label for=\"guideOnly\"> <ox-i18n msgid=\"label.guide-only\">guide only</ox-i18n> </label>\n </div>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onChange.bind(this))\n }\n\n _onChange(e: Event) {\n var element = e.target as HTMLInputElement\n var key = element.getAttribute('value-key')\n var value: any = element.value\n\n if (key === 'fitPattern' || key === 'noRepeat' || key === 'guideOnly') {\n value = element.checked\n }\n\n this.value = {\n ...this.value,\n [key!]: value\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
@@ -26,6 +26,7 @@ export type FillStyle = {
26
26
  align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom';
27
27
  fitPattern?: boolean;
28
28
  noRepeat?: boolean;
29
+ guideOnly?: boolean;
29
30
  color?: string;
30
31
  } | 'no' | string;
31
32
  export declare class OxInputColorStyle extends OxFormField {
@@ -167,6 +167,7 @@ let OxInputColorStyle = class OxInputColorStyle extends OxFormField {
167
167
  align: value.align,
168
168
  fitPattern: value.fitPattern,
169
169
  noRepeat: value.noRepeat,
170
+ guideOnly: value.guideOnly,
170
171
  color: value.color
171
172
  };
172
173
  if (!this._block_reset) {
@@ -231,6 +232,7 @@ let OxInputColorStyle = class OxInputColorStyle extends OxFormField {
231
232
  align: this.pattern.align,
232
233
  fitPattern: this.pattern.fitPattern,
233
234
  noRepeat: this.pattern.noRepeat,
235
+ guideOnly: this.pattern.guideOnly,
234
236
  color: this.pattern.color
235
237
  };
236
238
  break;
@@ -296,6 +298,7 @@ let OxInputColorStyle = class OxInputColorStyle extends OxFormField {
296
298
  align: this.pattern?.align,
297
299
  fitPattern: this.pattern?.fitPattern,
298
300
  noRepeat: this.pattern?.noRepeat,
301
+ guideOnly: this.pattern?.guideOnly,
299
302
  color: this.pattern?.color
300
303
  };
301
304
  this._block_reset = true;
@@ -1 +1 @@
1
- {"version":3,"file":"ox-input-fill-style.js","sourceRoot":"","sources":["../../src/ox-input-fill-style.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,2BAA2B,CAAA;AAClC,OAAO,8BAA8B,CAAA;AACrC,OAAO,kCAAkC,CAAA;AAEzC,OAAO,EAAE,GAAG,EAAE,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E,CAAC;kDAAkC;AAEP;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAA2B;AAjCrE,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAkU7B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport './ox-input-color.js'\nimport './ox-input-color-stops.js'\nimport './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 { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { OxFormField } from './ox-form-field.js'\nimport { ColorStop } from './ox-input-color-stops.js'\nimport { GradientOption, OxInputColorGradient } from './ox-input-color-gradient.js'\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 = [\n PropertyGridStyles,\n 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 [editors] > :not([active]) {\n display: none;\n }\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=\"property-grid\" ?active=${this.fillType == 'solid'}>\n <label><md-icon>format_color_fill</md-icon></label>\n <ox-input-color class=\"custom-editor\" @change=${(e: Event) => this._onChangedSolid(e)} .value=${this.solid}>\n </ox-input-color>\n </div>\n\n <ox-input-color-gradient\n ?active=${this.fillType == 'gradient'}\n @change=${(e: Event) => this._onChandedGradient(e)}\n .value=${this.gradient}\n >\n </ox-input-color-gradient>\n\n <ox-input-background-pattern\n ?active=${this.fillType == 'pattern'}\n @change=${(e: Event) => this._onChangedPattern(e)}\n .value=${this.pattern}\n >\n </ox-input-background-pattern>\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"]}
1
+ {"version":3,"file":"ox-input-fill-style.js","sourceRoot":"","sources":["../../src/ox-input-fill-style.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AACjC,OAAO,qBAAqB,CAAA;AAC5B,OAAO,2BAA2B,CAAA;AAClC,OAAO,8BAA8B,CAAA;AACrC,OAAO,kCAAkC,CAAA;AAEzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AA2BzC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,WAAW;IAA3C;;QA2BuB,UAAK,GAAe,SAAS,CAAA;QAMH,cAAS,GAAY,KAAK,CAAA;QAExE,iBAAY,GAAY,KAAK,CAAA;IAkSvC,CAAC;aApUQ,WAAM,GAAG;QACd,kBAAkB;QAClB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;KACF,AAxBY,CAwBZ;IAYD,OAAO,CAAC,OAA6B;QACnC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IAChE,CAAC;IAED,MAAM;QACJ,OAAO,I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AC,OAAO,EAAE,UAAU;YACpC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ;YAChC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS;YAClC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK;SAC3B,CAAA;QAED,IAAI,CAAC,YAAY,GAAG,IAAI,CAAA;QACxB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAClF,CAAC;;AAzS2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA8B;AAC7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAkB;AACjB;IAA3B,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;AAEP;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;oDAA2B;AAjCrE,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAqU7B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\nimport './ox-input-color.js'\nimport './ox-input-color-stops.js'\nimport './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 { PropertyGridStyles } from '@operato/styles/property-grid-styles.js'\n\nimport { OxFormField } from './ox-form-field.js'\nimport { ColorStop } from './ox-input-color-stops.js'\nimport { GradientOption, OxInputColorGradient } from './ox-input-color-gradient.js'\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 guideOnly?: boolean\n color?: string\n }\n | 'no'\n | string\n\n@customElement('ox-input-fill-style')\nexport class OxInputColorStyle extends OxFormField {\n static styles = [\n PropertyGridStyles,\n 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 [editors] > :not([active]) {\n display: none;\n }\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=\"property-grid\" ?active=${this.fillType == 'solid'}>\n <label><md-icon>format_color_fill</md-icon></label>\n <ox-input-color class=\"custom-editor\" @change=${(e: Event) => this._onChangedSolid(e)} .value=${this.solid}>\n </ox-input-color>\n </div>\n\n <ox-input-color-gradient\n ?active=${this.fillType == 'gradient'}\n @change=${(e: Event) => this._onChandedGradient(e)}\n .value=${this.gradient!}\n >\n </ox-input-color-gradient>\n\n <ox-input-background-pattern\n ?active=${this.fillType == 'pattern'}\n @change=${(e: Event) => this._onChangedPattern(e)}\n .value=${this.pattern}\n >\n </ox-input-background-pattern>\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 guideOnly: value.guideOnly,\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 guideOnly: this.pattern.guideOnly,\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 guideOnly: this.pattern?.guideOnly,\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"]}