@operato/app 9.0.0-beta.6 → 9.0.0-beta.62

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 (27) hide show
  1. package/CHANGELOG.md +292 -0
  2. package/dist/src/filters-form/ox-filter-resource-code.js +4 -0
  3. package/dist/src/filters-form/ox-filter-resource-code.js.map +1 -1
  4. package/dist/src/filters-form/ox-filter-resource-object.js +4 -0
  5. package/dist/src/filters-form/ox-filter-resource-object.js.map +1 -1
  6. package/dist/src/input/index.d.ts +0 -2
  7. package/dist/src/input/index.js +0 -2
  8. package/dist/src/input/index.js.map +1 -1
  9. package/dist/src/input/ox-input-graphql.js +4 -0
  10. package/dist/src/input/ox-input-graphql.js.map +1 -1
  11. package/dist/tsconfig.tsbuildinfo +1 -1
  12. package/package.json +15 -22
  13. package/dist/src/input/ox-input-background-pattern.d.ts +0 -34
  14. package/dist/src/input/ox-input-background-pattern.js +0 -178
  15. package/dist/src/input/ox-input-background-pattern.js.map +0 -1
  16. package/dist/src/input/ox-input-fill-style.d.ts +0 -44
  17. package/dist/src/input/ox-input-fill-style.js +0 -341
  18. package/dist/src/input/ox-input-fill-style.js.map +0 -1
  19. package/dist/stories/graphql-client.stories.d.ts +0 -26
  20. package/dist/stories/graphql-client.stories.js +0 -55
  21. package/dist/stories/graphql-client.stories.js.map +0 -1
  22. package/dist/stories/ox-input-graphql.stories.d.ts +0 -25
  23. package/dist/stories/ox-input-graphql.stories.js +0 -56
  24. package/dist/stories/ox-input-graphql.stories.js.map +0 -1
  25. package/dist/stories/ox-selector-resource-object.stories.d.ts +0 -29
  26. package/dist/stories/ox-selector-resource-object.stories.js +0 -80
  27. package/dist/stories/ox-selector-resource-object.stories.js.map +0 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/app",
3
3
  "description": "WebApplication production supporting components following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "9.0.0-beta.6",
5
+ "version": "9.0.0-beta.62",
6
6
  "type": "module",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
@@ -11,8 +11,6 @@
11
11
  "./package.json": "./package.json",
12
12
  "./input.js": "./dist/src/input/index.js",
13
13
  "./input/ox-input-graphql.js": "./dist/src/input/ox-input-graphql.js",
14
- "./input/ox-input-background-pattern.js": "./dist/src/input/ox-input-background-pattern.js",
15
- "./input/ox-input-fill-style.js": "./dist/src/input/ox-input-fill-style.js",
16
14
  "./selector/ox-selector-resource-id.js": "./dist/src/selector/ox-selector-resource-id.js",
17
15
  "./selector/ox-selector-resource-object.js": "./dist/src/selector/ox-selector-resource-object.js",
18
16
  "./property-editor.js": "./dist/src/property-editor/index.js",
@@ -43,12 +41,6 @@
43
41
  "input/ox-input-graphql.js": [
44
42
  "dist/src/input/ox-input-graphql.d.ts"
45
43
  ],
46
- "input/ox-input-background-pattern.js": [
47
- "dist/src/input/ox-input-background-pattern.d.ts"
48
- ],
49
- "input/ox-input-fill-style.js": [
50
- "dist/src/input/ox-input-fill-style.d.ts"
51
- ],
52
44
  "selector/ox-selector-resource-id.js": [
53
45
  "dist/src/selector/ox-selector-resource-id.d.ts"
54
46
  ],
@@ -148,18 +140,19 @@
148
140
  "@graphql-tools/delegate": "^10.0.1",
149
141
  "@graphql-tools/wrap": "^8.5.0",
150
142
  "@material/web": "^2.0.0",
151
- "@operato/attachment": "^9.0.0-beta.6",
152
- "@operato/data-grist": "^9.0.0-beta.6",
153
- "@operato/font": "^9.0.0-beta.6",
154
- "@operato/form": "^9.0.0-beta.6",
155
- "@operato/graphql": "^9.0.0-beta.6",
156
- "@operato/i18n": "^9.0.0-beta.5",
157
- "@operato/input": "^9.0.0-beta.6",
158
- "@operato/layout": "^9.0.0-beta.6",
159
- "@operato/property-editor": "^9.0.0-beta.6",
160
- "@operato/shell": "^9.0.0-beta.6",
161
- "@operato/styles": "^9.0.0-beta.6",
162
- "@operato/utils": "^9.0.0-beta.6",
143
+ "@operato/attachment": "^9.0.0-beta.62",
144
+ "@operato/data-grist": "^9.0.0-beta.62",
145
+ "@operato/font": "^9.0.0-beta.62",
146
+ "@operato/form": "^9.0.0-beta.61",
147
+ "@operato/graphql": "^9.0.0-beta.38",
148
+ "@operato/i18n": "^9.0.0-beta.37",
149
+ "@operato/input": "^9.0.0-beta.61",
150
+ "@operato/layout": "^9.0.0-beta.52",
151
+ "@operato/property-editor": "^9.0.0-beta.62",
152
+ "@operato/property-panel": "^9.0.0-beta.62",
153
+ "@operato/shell": "^9.0.0-beta.52",
154
+ "@operato/styles": "^9.0.0-beta.47",
155
+ "@operato/utils": "^9.0.0-beta.38",
163
156
  "cm6-graphql": "^0.0.14",
164
157
  "codemirror": "^6.0.1",
165
158
  "cronstrue": "^2.2.0",
@@ -200,5 +193,5 @@
200
193
  "prettier --write"
201
194
  ]
202
195
  },
203
- "gitHead": "7e4dd57049f0a3dd0cbd194f7998e81f3b2c7559"
196
+ "gitHead": "ce8ef98553e40dbf150cfac5f1ebe574dc22d426"
204
197
  }
@@ -1,34 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import '@operato/i18n/ox-i18n.js';
5
- import '@operato/input/ox-input-color.js';
6
- import '@operato/attachment/ox-attachment-selector.js';
7
- import { OxFormField } from '@operato/input';
8
- export type BackgroundPatternOption = {
9
- image?: HTMLImageElement | string;
10
- color?: string;
11
- align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom';
12
- offsetX?: number;
13
- offsetY?: number;
14
- width?: number;
15
- height?: number;
16
- fitPattern?: boolean;
17
- noRepeat?: boolean;
18
- };
19
- /**
20
- * 컴포넌트의 fill pattern을 편집하는 element
21
- *
22
- * Example:
23
- * <ox-input-background-pattern
24
- * @change="${e => { this.pattern = e.target.value }}"
25
- * .value=${this.pattern}"
26
- * ></ox-input-background-pattern>
27
- */
28
- export declare class OxInputBackgroundPattern extends OxFormField {
29
- static styles: import("lit").CSSResult;
30
- value?: BackgroundPatternOption;
31
- render(): import("lit-html").TemplateResult<1>;
32
- firstUpdated(): void;
33
- _onChange(e: Event): void;
34
- }
@@ -1,178 +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/attachment/ox-attachment-selector.js';
8
- import { css, html } from 'lit';
9
- import { customElement, property } from 'lit/decorators.js';
10
- import { OxFormField } from '@operato/input';
11
- /**
12
- * 컴포넌트의 fill pattern을 편집하는 element
13
- *
14
- * Example:
15
- * <ox-input-background-pattern
16
- * @change="${e => { this.pattern = e.target.value }}"
17
- * .value=${this.pattern}"
18
- * ></ox-input-background-pattern>
19
- */
20
- let OxInputBackgroundPattern = class OxInputBackgroundPattern extends OxFormField {
21
- render() {
22
- const value = this.value || {};
23
- return html `
24
- <label> <ox-i18n msgid="label.image">image</ox-i18n> </label>
25
-
26
- <ox-attachment-selector
27
- value-key="image"
28
- .value=${value.image || ''}
29
- .properties=${{
30
- category: 'image'
31
- }}
32
- custom-editor
33
- ></ox-attachment-selector>
34
-
35
- <label> <ox-i18n msgid="label.align">align</ox-i18n> </label>
36
-
37
- <select value-key="align" class="select-content" .value=${value.align}>
38
- <option value="left-top">Left Top</option>
39
- <option value="top">Center Top</option>
40
- <option value="right-top">Right Top</option>
41
- <option value="left">Left Center</option>
42
- <option value="center">Center Center</option>
43
- <option value="right">Right Center</option>
44
- <option value="left-bottom">Left Bottom</option>
45
- <option value="bottom">Center Bottom</option>
46
- <option value="right-bottom">Right Bottom</option>
47
- </select>
48
-
49
- <div class="grid-10">
50
- <label> <ox-i18n msgid="label.offset-x">offsetX</ox-i18n> </label>
51
- <input type="number" value-key="offsetX" .value=${value.offsetX} />
52
-
53
- <label> <ox-i18n msgid="label.offset-y">offsetY</ox-i18n> </label>
54
- <input type="number" value-key="offsetY" .value=${value.offsetY} />
55
-
56
- <label> <ox-i18n msgid="label.width">width</ox-i18n> </label>
57
- <input type="number" value-key="width" .value=${value.width} />
58
-
59
- <label> <ox-i18n msgid="label.height">height</ox-i18n> </label>
60
- <input type="number" value-key="height" .value=${value.height} />
61
- </div>
62
-
63
- <div class="grid-10">
64
- <label class="icon-only-label color"></label>
65
- <ox-input-color value-key="color" .value=${value.color}> </ox-input-color>
66
- </div>
67
-
68
- <div class="grid-10">
69
- <input value-key="fitPattern" type="checkbox" .checked=${value.fitPattern} required />
70
- <label> <ox-i18n msgid="label.fit">fit</ox-i18n> </label>
71
- </div>
72
-
73
- <div class="grid-10">
74
- <input value-key="noRepeat" type="checkbox" .checked=${value.noRepeat} required />
75
- <label> <ox-i18n msgid="label.no-repeat">no repeat</ox-i18n> </label>
76
- </div>
77
- `;
78
- }
79
- firstUpdated() {
80
- this.renderRoot.addEventListener('change', this._onChange.bind(this));
81
- }
82
- _onChange(e) {
83
- var element = e.target;
84
- var key = element.getAttribute('value-key');
85
- var value = element.value;
86
- if (key === 'fitPattern' || key === 'noRepeat') {
87
- value = element.checked;
88
- }
89
- this.value = {
90
- ...this.value,
91
- [key]: value
92
- };
93
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
94
- }
95
- };
96
- OxInputBackgroundPattern.styles = css `
97
- :host,
98
- .grid-10 {
99
- display: grid;
100
- grid-template-columns: repeat(10, 1fr);
101
- grid-gap: 5px;
102
- grid-auto-rows: minmax(24px, auto);
103
-
104
- align-items: center;
105
- }
106
-
107
- * {
108
- align-self: stretch;
109
- }
110
-
111
- label {
112
- grid-column: span 2;
113
- text-align: right;
114
- text-transform: capitalize;
115
-
116
- align-self: center;
117
- }
118
-
119
- .grid-10 {
120
- grid-column: span 10;
121
- }
122
-
123
- select,
124
- input,
125
- [custom-editor] {
126
- grid-column: span 8;
127
- }
128
-
129
- select {
130
- height: 100%;
131
- border: 1px solid rgba(0, 0, 0, 0.2);
132
- }
133
-
134
- input[type='checkbox'] {
135
- grid-column: 3 / 4;
136
- align-self: center;
137
- }
138
-
139
- input[type='checkbox'] ~ label {
140
- grid-column: span 7;
141
- text-align: left;
142
- }
143
-
144
- .grid-10 > input[type='number'] {
145
- grid-column: span 3;
146
- border: 1px solid rgba(0, 0, 0, 0.2);
147
- }
148
-
149
- .grid-10 > label {
150
- grid-column: span 2;
151
- text-align: right;
152
- }
153
-
154
- .grid-10 > .icon-only-label {
155
- grid-column: span 2;
156
-
157
- background: var(--url-icon-properties-label) no-repeat;
158
- float: left;
159
- margin: 0;
160
- align-self: stretch;
161
- }
162
-
163
- .icon-only-label.color {
164
- background-position: 100% -500px;
165
- }
166
-
167
- .grid-10 > ox-input-color {
168
- grid-column: span 8;
169
- }
170
- `;
171
- __decorate([
172
- property({ type: Object })
173
- ], OxInputBackgroundPattern.prototype, "value", void 0);
174
- OxInputBackgroundPattern = __decorate([
175
- customElement('ox-input-background-pattern')
176
- ], OxInputBackgroundPattern);
177
- export { OxInputBackgroundPattern };
178
- //# sourceMappingURL=ox-input-background-pattern.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-input-background-pattern.js","sourceRoot":"","sources":["../../../src/input/ox-input-background-pattern.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,0BAA0B,CAAA;AACjC,OAAO,kCAAkC,CAAA;AACzC,OAAO,+CAA+C,CAAA;AAEtD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAc5C;;;;;;;;GAQG;AAGI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,WAAW;IA+EvD,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAK,EAA8B,CAAA;QAE3D,OAAO,IAAI,CAAA;;;;;iBAKE,KAAK,CAAC,KAAK,IAAI,EAAE;sBACZ;YACZ,QAAQ,EAAE,OAAO;SAClB;;;;;;gEAMuD,KAAK,CAAC,KAAK;;;;;;;;;;;;;;0DAcjB,KAAK,CAAC,OAAO;;;0DAGb,KAAK,CAAC,OAAO;;;wDAGf,KAAK,CAAC,KAAK;;;yDAGV,KAAK,CAAC,MAAM;;;;;mDAKlB,KAAK,CAAC,KAAK;;;;iEAIG,KAAK,CAAC,UAAU;;;;;+DAKlB,KAAK,CAAC,QAAQ;;;KAGxE,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;;AA7JM,+BAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0ElB,AA1EY,CA0EZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAgC;AA7EhD,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CA+JpC","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/attachment/ox-attachment-selector.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxFormField } from '@operato/input'\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 = css`\n :host,\n .grid-10 {\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n grid-gap: 5px;\n grid-auto-rows: minmax(24px, auto);\n\n align-items: center;\n }\n\n * {\n align-self: stretch;\n }\n\n label {\n grid-column: span 2;\n text-align: right;\n text-transform: capitalize;\n\n align-self: center;\n }\n\n .grid-10 {\n grid-column: span 10;\n }\n\n select,\n input,\n [custom-editor] {\n grid-column: span 8;\n }\n\n select {\n height: 100%;\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n\n input[type='checkbox'] {\n grid-column: 3 / 4;\n align-self: center;\n }\n\n input[type='checkbox'] ~ label {\n grid-column: span 7;\n text-align: left;\n }\n\n .grid-10 > input[type='number'] {\n grid-column: span 3;\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n\n .grid-10 > label {\n grid-column: span 2;\n text-align: right;\n }\n\n .grid-10 > .icon-only-label {\n grid-column: span 2;\n\n background: var(--url-icon-properties-label) no-repeat;\n float: left;\n margin: 0;\n align-self: stretch;\n }\n\n .icon-only-label.color {\n background-position: 100% -500px;\n }\n\n .grid-10 > ox-input-color {\n grid-column: span 8;\n }\n `\n\n @property({ type: Object }) value?: BackgroundPatternOption\n\n render() {\n const value = this.value || ({} as BackgroundPatternOption)\n\n return html`\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 custom-editor\n ></ox-attachment-selector>\n\n <label> <ox-i18n msgid=\"label.align\">align</ox-i18n> </label>\n\n <select value-key=\"align\" class=\"select-content\" .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 <div class=\"grid-10\">\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 </div>\n\n <div class=\"grid-10\">\n <label class=\"icon-only-label color\"></label>\n <ox-input-color value-key=\"color\" .value=${value.color}> </ox-input-color>\n </div>\n\n <div class=\"grid-10\">\n <input value-key=\"fitPattern\" type=\"checkbox\" .checked=${value.fitPattern} required />\n <label> <ox-i18n msgid=\"label.fit\">fit</ox-i18n> </label>\n </div>\n\n <div class=\"grid-10\">\n <input value-key=\"noRepeat\" type=\"checkbox\" .checked=${value.noRepeat} required />\n <label> <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,44 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import '@operato/i18n/ox-i18n.js';
5
- import '@operato/input/ox-input-color.js';
6
- import '@operato/input/ox-input-color-stops.js';
7
- import '@operato/input/ox-input-color-gradient.js';
8
- import './ox-input-background-pattern.js';
9
- import { PropertyValues } from 'lit';
10
- import { ColorStop, GradientOption, OxFormField } from '@operato/input';
11
- import { BackgroundPatternOption } from './ox-input-background-pattern.js';
12
- export type FillStyle = {
13
- type?: 'no' | 'solid' | 'gradient' | 'pattern';
14
- gradientType?: 'linear' | 'radial';
15
- colorStops?: ColorStop[];
16
- rotation?: number;
17
- center?: 'center' | 'left-top' | 'right-top' | 'right-bottom' | 'left-bottom';
18
- image?: HTMLImageElement | string;
19
- offsetX?: number;
20
- offsetY?: number;
21
- width?: number;
22
- height?: number;
23
- align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom';
24
- fitPattern?: boolean;
25
- noRepeat?: boolean;
26
- color?: string;
27
- } | 'no' | string;
28
- export declare class OxInputColorStyle extends OxFormField {
29
- static styles: import("lit").CSSResult;
30
- value?: FillStyle;
31
- fillType?: string;
32
- solid?: string;
33
- gradient?: GradientOption;
34
- pattern?: BackgroundPatternOption;
35
- colorOnly: boolean;
36
- private _block_reset;
37
- updated(changes: PropertyValues<this>): void;
38
- render(): import("lit-html").TemplateResult<1>;
39
- _onChangedValue(value: FillStyle): Promise<void>;
40
- _onChangedFillType(e: Event): void;
41
- _onChangedSolid(e: Event): void;
42
- _onChandedGradient(e: Event): void;
43
- _onChangedPattern(e: Event): void;
44
- }
@@ -1,341 +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.colorOnly = false;
17
- this._block_reset = false;
18
- }
19
- updated(changes) {
20
- changes.has('value') && this._onChangedValue(this.value || {});
21
- }
22
- render() {
23
- return html `
24
- <div @change=${(e) => this._onChangedFillType(e)} fill-type>
25
- <input
26
- type="radio"
27
- id="fill-type-no"
28
- name="fill-type"
29
- value="no"
30
- .checked=${!this.fillType || this.fillType == 'no'}
31
- />
32
- <label for="fill-type-no"><ox-i18n msgid="label.no-fill">no fill</ox-i18n></label>
33
- <input type="radio" id="fill-type-solid" name="fill-type" value="solid" .checked=${this.fillType == 'solid'} />
34
- <label for="fill-type-solid"><ox-i18n msgid="label.solid">solid</ox-i18n></label>
35
- <input
36
- type="radio"
37
- id="fill-type-gradient"
38
- name="fill-type"
39
- value="gradient"
40
- .checked=${this.fillType == 'gradient'}
41
- />
42
-
43
- <label for="fill-type-gradient"><ox-i18n msgid="label.gradient">gradient</ox-i18n></label>
44
-
45
- ${this.colorOnly
46
- ? html ``
47
- : html `
48
- <input
49
- type="radio"
50
- id="fill-type-pattern"
51
- name="fill-type"
52
- value="pattern"
53
- .checked=${this.fillType == 'pattern'}
54
- />
55
- <label for="fill-type-pattern"><ox-i18n msgid="label.pattern">pattern</ox-i18n></label>
56
- `}
57
- </div>
58
-
59
- <div editors>
60
- <div ?active=${this.fillType == 'no'}></div>
61
-
62
- <div class="grid-10" ?active=${this.fillType == 'solid'}>
63
- <label class="icon-only-label color"></label>
64
- <ox-input-color @change=${(e) => this._onChangedSolid(e)} .value=${this.solid}> </ox-input-color>
65
- </div>
66
-
67
- <div ?active=${this.fillType == 'gradient'}>
68
- <ox-input-color-gradient @change=${(e) => this._onChandedGradient(e)} .value=${this.gradient}>
69
- </ox-input-color-gradient>
70
- </div>
71
-
72
- <div ?active=${this.fillType == 'pattern'}>
73
- <ox-input-background-pattern @change=${(e) => this._onChangedPattern(e)} .value=${this.pattern}>
74
- </ox-input-background-pattern>
75
- </div>
76
- </div>
77
- `;
78
- }
79
- async _onChangedValue(value) {
80
- /*
81
- * this._block_reset의 역할은 내부 사용자 인터렉션에 의한 value의 변경시에는 각 type별 이전값을 유지하기 위함이다.
82
- */
83
- await this.requestUpdate();
84
- /* 설정 값에 따라서, 멤버 속성을 설정한다. */
85
- if (!value) {
86
- this.fillType = 'no';
87
- if (!this._block_reset) {
88
- this.solid = undefined;
89
- this.gradient = undefined;
90
- this.pattern = undefined;
91
- }
92
- this._block_reset = false;
93
- return;
94
- }
95
- switch (typeof value) {
96
- case 'string':
97
- this.fillType = 'solid';
98
- this.solid = value;
99
- if (!this._block_reset) {
100
- this.gradient = undefined;
101
- this.pattern = undefined;
102
- }
103
- break;
104
- case 'object':
105
- this.fillType = value.type;
106
- if (value.type === 'gradient') {
107
- this.gradient = {
108
- type: value.gradientType || 'linear',
109
- colorStops: value.colorStops || [
110
- {
111
- position: 0,
112
- color: this.solid || '#000000'
113
- },
114
- {
115
- position: 1,
116
- color: this.solid || '#FFFFFF'
117
- }
118
- ],
119
- rotation: Number(value.rotation) || 0,
120
- center: value.center
121
- };
122
- if (!this._block_reset) {
123
- this.pattern = undefined;
124
- this.solid = undefined;
125
- }
126
- }
127
- else if (value.type === 'pattern') {
128
- this.pattern = {
129
- image: value.image,
130
- offsetX: Number(value.offsetX) || 0,
131
- offsetY: Number(value.offsetY) || 0,
132
- width: Number(value.width),
133
- height: Number(value.height),
134
- align: value.align,
135
- fitPattern: value.fitPattern,
136
- noRepeat: value.noRepeat,
137
- color: value.color
138
- };
139
- if (!this._block_reset) {
140
- this.gradient = undefined;
141
- this.solid = undefined;
142
- }
143
- }
144
- break;
145
- default:
146
- }
147
- this._block_reset = false;
148
- }
149
- _onChangedFillType(e) {
150
- const element = e.target;
151
- this.fillType = element.value;
152
- switch (this.fillType) {
153
- case 'gradient':
154
- if (!this.gradient) {
155
- this.gradient = {
156
- type: 'linear',
157
- colorStops: [
158
- {
159
- position: 0,
160
- color: this.solid || '#000000'
161
- },
162
- {
163
- position: 1,
164
- color: this.solid || '#FFFFFF'
165
- }
166
- ],
167
- rotation: 0,
168
- center: 'center'
169
- };
170
- }
171
- this.value = {
172
- type: 'gradient',
173
- gradientType: this.gradient.type || 'linear',
174
- colorStops: this.gradient.colorStops || [
175
- {
176
- position: 0,
177
- color: this.solid || '#000000'
178
- },
179
- {
180
- position: 1,
181
- color: this.solid || '#FFFFFF'
182
- }
183
- ],
184
- rotation: Number(this.gradient.rotation) || 0,
185
- center: this.gradient.center
186
- };
187
- break;
188
- case 'pattern':
189
- if (!this.pattern)
190
- this.pattern = {};
191
- this.value = {
192
- type: 'pattern',
193
- image: this.pattern.image,
194
- offsetX: Number(this.pattern.offsetX) || 0,
195
- offsetY: Number(this.pattern.offsetY) || 0,
196
- width: Number(this.pattern.width),
197
- height: Number(this.pattern.height),
198
- align: this.pattern.align,
199
- fitPattern: this.pattern.fitPattern,
200
- noRepeat: this.pattern.noRepeat,
201
- color: this.pattern.color
202
- };
203
- break;
204
- case 'solid':
205
- if (!this.solid)
206
- this.solid = '#fff';
207
- this.value = this.solid;
208
- break;
209
- case 'no':
210
- this.value = '';
211
- break;
212
- }
213
- this._block_reset = true;
214
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
215
- }
216
- _onChangedSolid(e) {
217
- if (this.fillType !== 'solid')
218
- return;
219
- this.solid = e.target.value;
220
- this.value = this.solid;
221
- this._block_reset = true;
222
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
223
- }
224
- _onChandedGradient(e) {
225
- /*
226
- * TODO Gradient의 rotation은 symmetry 기능 등으로 외부에서 변경될 수도 있다.
227
- * 이 점을 감안해서, 외부 변경에 대한 대응을 해야 한다.
228
- */
229
- if (this.fillType !== 'gradient') {
230
- return;
231
- }
232
- this.gradient = e.target.value;
233
- this.value = {
234
- type: 'gradient',
235
- gradientType: this.gradient.type || 'linear',
236
- colorStops: this.gradient.colorStops || [
237
- {
238
- position: 0,
239
- color: this.solid || '#000000'
240
- },
241
- {
242
- position: 1,
243
- color: this.solid || '#FFFFFF'
244
- }
245
- ],
246
- rotation: Number(this.gradient.rotation) || 0,
247
- center: this.gradient.center
248
- };
249
- this._block_reset = true;
250
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
251
- }
252
- _onChangedPattern(e) {
253
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
254
- if (this.fillType !== 'pattern')
255
- return;
256
- this.pattern = e.target.value;
257
- this.value = {
258
- type: 'pattern',
259
- image: (_a = this.pattern) === null || _a === void 0 ? void 0 : _a.image,
260
- offsetX: Number((_b = this.pattern) === null || _b === void 0 ? void 0 : _b.offsetX) || 0,
261
- offsetY: Number((_c = this.pattern) === null || _c === void 0 ? void 0 : _c.offsetY) || 0,
262
- width: Number((_d = this.pattern) === null || _d === void 0 ? void 0 : _d.width),
263
- height: Number((_e = this.pattern) === null || _e === void 0 ? void 0 : _e.height),
264
- align: (_f = this.pattern) === null || _f === void 0 ? void 0 : _f.align,
265
- fitPattern: (_g = this.pattern) === null || _g === void 0 ? void 0 : _g.fitPattern,
266
- noRepeat: (_h = this.pattern) === null || _h === void 0 ? void 0 : _h.noRepeat,
267
- color: (_j = this.pattern) === null || _j === void 0 ? void 0 : _j.color
268
- };
269
- this._block_reset = true;
270
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
271
- }
272
- };
273
- OxInputColorStyle.styles = css `
274
- :host {
275
- display: flex;
276
- flex-direction: column;
277
- }
278
-
279
- [fill-type] {
280
- display: flex;
281
- margin: 0 0 14px 0;
282
- }
283
-
284
- [fill-type] * {
285
- flex: auto;
286
- margin: 0;
287
- text-align: left;
288
- align-self: center;
289
- }
290
-
291
- .grid-10 {
292
- display: grid;
293
-
294
- grid-template-columns: repeat(10, 1fr);
295
- grid-gap: 5px;
296
- grid-auto-rows: minmax(24px, auto);
297
- }
298
-
299
- .grid-10 > ox-input-color {
300
- grid-column: span 4;
301
- }
302
-
303
- .grid-10 > .icon-only-label {
304
- grid-column: span 1;
305
-
306
- background: var(--url-icon-properties-label) no-repeat;
307
- float: left;
308
- margin: 0;
309
- }
310
-
311
- .icon-only-label.color {
312
- background-position: 100% -500px;
313
- }
314
-
315
- [editors] > :not([active]) {
316
- display: none;
317
- }
318
- `;
319
- __decorate([
320
- property({ type: Object })
321
- ], OxInputColorStyle.prototype, "value", void 0);
322
- __decorate([
323
- property({ type: String })
324
- ], OxInputColorStyle.prototype, "fillType", void 0);
325
- __decorate([
326
- property({ type: String })
327
- ], OxInputColorStyle.prototype, "solid", void 0);
328
- __decorate([
329
- property({ type: Object })
330
- ], OxInputColorStyle.prototype, "gradient", void 0);
331
- __decorate([
332
- property({ type: Object })
333
- ], OxInputColorStyle.prototype, "pattern", void 0);
334
- __decorate([
335
- property({ type: Boolean, attribute: 'color-only' })
336
- ], OxInputColorStyle.prototype, "colorOnly", void 0);
337
- OxInputColorStyle = __decorate([
338
- customElement('ox-input-fill-style')
339
- ], OxInputColorStyle);
340
- export { OxInputColorStyle };
341
- //# sourceMappingURL=ox-input-fill-style.js.map