@operato/input 7.0.60 → 7.0.78

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/input",
3
3
  "description": "Webcomponents for input following open-wc recommendations",
4
4
  "author": "heartyoh@hatiolab.com",
5
- "version": "7.0.60",
5
+ "version": "7.0.78",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "license": "MIT",
@@ -254,5 +254,5 @@
254
254
  "prettier --write"
255
255
  ]
256
256
  },
257
- "gitHead": "4485b81c64fd911a0fa9be050419cfa20b734527"
257
+ "gitHead": "9af3cbef88890a8eb088bcc730b69c426a8b4fe0"
258
258
  }
@@ -1,7 +1,3 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
1
  import './ox-input-code'
6
2
 
7
3
  import { css, html } from 'lit'
@@ -11,6 +7,7 @@ import { live } from 'lit/directives/live.js'
11
7
  import { OxFormField } from './ox-form-field.js'
12
8
  import { OxInputCode } from './ox-input-code.js'
13
9
  import { isEqual } from 'lodash-es'
10
+ import 'ses'
14
11
 
15
12
  /**
16
13
  WEB Component for code-mirror based data editor.
@@ -138,10 +135,13 @@ export class OxInputData extends OxFormField {
138
135
  }
139
136
  break
140
137
  case 'object':
141
- value = eval('(' + value + ')')
138
+ const compartment = new Compartment()
139
+ value = compartment.evaluate(`(${value})`)
142
140
  break
143
141
  }
144
- } catch (e) {}
142
+ } catch (e) {
143
+ console.error('Error parsing value:', e)
144
+ }
145
145
 
146
146
  if (isEqual(this.value, value)) {
147
147
  return
@@ -171,11 +171,12 @@ export class OxInputData extends OxFormField {
171
171
  }
172
172
  break
173
173
  case 'object':
174
- value = eval('(' + value + ')')
174
+ const compartment = new Compartment()
175
+ value = compartment.evaluate(`(${value})`)
175
176
  break
176
177
  }
177
178
  } catch (e) {
178
- console.log(e)
179
+ console.error('Error setting data type:', e)
179
180
  }
180
181
 
181
182
  if (isEqual(this.value, value)) {
@@ -15,47 +15,38 @@ import { OxFormField } from './ox-form-field.js'
15
15
  export class OxInputHashtags extends OxFormField {
16
16
  static styles = css`
17
17
  #editor {
18
- display: block;
19
- box-sizing: border-box;
20
- --hashtag-padding: 2px 4px;
21
- --hashtag-background: var(--md-sys-color-container);
22
- --hashtag-background-hover: var(--md-sys-color-on-container);
23
- --hashtag-closer-padding: 0 2px 0 4px;
24
- --hashtag-input-padding: 2px;
18
+ display: flex;
19
+ gap: var(--spacing-medium);
20
+ align-items: center;
25
21
  }
26
22
 
27
23
  .tags {
28
- display: inline-block;
24
+ display: flex;
25
+ gap: var(--spacing-medium);
26
+ align-items: center;
29
27
  }
30
28
 
31
29
  .tag {
32
- border-radius: var(--border-radius);
33
- background-color: var(--hashtag-background);
34
- padding: var(--hashtag-padding);
30
+ display: flex;
31
+ gap: var(--spacing-small);
32
+
35
33
  font: var(--input-font);
36
- color: var(--md-sys-color-on-primary-container);
37
34
  cursor: pointer;
38
35
  }
39
36
 
40
37
  .tag:hover {
41
- background-color: var(--hashtag-background-hover);
42
- color: var(--md-sys-color-primary-container) !important;
38
+ font-weight: bold;
43
39
  }
44
40
 
45
41
  .closer {
46
42
  opacity: 0.3;
47
- padding: var(--hashtag-closer-padding);
48
- text-transform: uppercase;
49
- color: var(--md-sys-color-on-primary-container);
50
43
  }
51
44
  .tag:hover .closer {
52
- opacity: 0.9;
53
- color: var(--md-sys-color-primary-container);
45
+ opacity: 0.3;
54
46
  }
55
47
 
56
48
  .input {
57
49
  display: inline-block;
58
- color: var(--md-sys-color-on-primary-container);
59
50
  }
60
51
 
61
52
  .input::before {
@@ -71,7 +62,6 @@ export class OxInputHashtags extends OxFormField {
71
62
  vertical-align: middle;
72
63
  -webkit-appearance: none;
73
64
  -webkit-text-size-adjust: none;
74
- padding: var(--hashtag-input-padding);
75
65
  border: 0;
76
66
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
77
67
  outline: none;
@@ -80,7 +70,7 @@ export class OxInputHashtags extends OxFormField {
80
70
 
81
71
  input:focus {
82
72
  outline: none;
83
- border-bottom: 1px solid var(--md-sys-color-on-primary-container);
73
+ border-bottom: 1px solid var(--md-sys-color-primary);
84
74
  }
85
75
 
86
76
  .error {
@@ -113,7 +103,13 @@ export class OxInputHashtags extends OxFormField {
113
103
  </div>
114
104
 
115
105
  <div class="input">
116
- <input type="text" @keyup=${this.onInputKeyup} placeholder="태그입력" ?disabled=${this.disabled} />
106
+ <input
107
+ type="text"
108
+ @keyup=${this.onInputKeyup}
109
+ @blur=${this.onBlur}
110
+ placeholder="태그입력"
111
+ ?disabled=${this.disabled}
112
+ />
117
113
  </div>
118
114
  </div>
119
115
 
@@ -136,6 +132,11 @@ export class OxInputHashtags extends OxFormField {
136
132
  }
137
133
  }
138
134
 
135
+ private onBlur() {
136
+ const tag = this.input.value.trim()
137
+ this.addHashtag(tag)
138
+ }
139
+
139
140
  async setHashtags() {
140
141
  this.input.focus()
141
142
  }