@things-factory/barcode-ui 3.7.5 → 3.7.6

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.
@@ -108,7 +108,7 @@ export class BarcodeScanableInput extends LitElement {
108
108
  this.style.setProperty('--barcodescan-input-button-icon', `url(${barcodeIcon})`)
109
109
 
110
110
  return html`
111
- <input type="text" .value=${this.value || ''} maxlength="50" />
111
+ <input type="text" .value=${this.value || ''} maxlength="50" @change=${this.onchange.bind(this)} />
112
112
  <button
113
113
  ?hidden=${!this.scannable}
114
114
  id="scan-button"
@@ -119,6 +119,17 @@ export class BarcodeScanableInput extends LitElement {
119
119
  `
120
120
  }
121
121
 
122
+ onchange(e) {
123
+ this.value = e.target.value
124
+ this.dispatchEvent(
125
+ new CustomEvent('change', {
126
+ bubbles: true,
127
+ composed: true,
128
+ detail: this
129
+ })
130
+ )
131
+ }
132
+
122
133
  get input() {
123
134
  return this.shadowRoot.querySelector('input')
124
135
  }
@@ -147,10 +158,20 @@ export class BarcodeScanableInput extends LitElement {
147
158
  if (!popup.closed && this.stream) {
148
159
  var result = await this.reader.decodeOnceFromStream(this.stream, template.video)
149
160
 
150
- this.input.value = result
161
+ // this.input.value = result
162
+ this.value = result.text || ''
163
+
151
164
  if (!this.withoutEnter) {
152
165
  this.dispatchEvent(new KeyboardEvent('keypress', { keyCode: 0x0d }))
153
166
  }
167
+
168
+ this.dispatchEvent(
169
+ new CustomEvent('change', {
170
+ bubbles: true,
171
+ composed: true,
172
+ detail: this
173
+ })
174
+ )
154
175
  } else {
155
176
  /* popup이 비동기 진행 중에 close된 경우라면, stopScan()을 처리하지 못하게 되므로, 다시한번 clear해준다. */
156
177
  this.stopScan()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/barcode-ui",
3
- "version": "3.7.5",
3
+ "version": "3.7.6",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -27,5 +27,5 @@
27
27
  "@things-factory/layout-base": "^3.7.5",
28
28
  "bwip-js": "^2.0.11"
29
29
  },
30
- "gitHead": "43e77ed980b3e999d9d17aa75cf50a547f87f4e7"
30
+ "gitHead": "d9d72c07fc3b01af2ede46808ec0aced3241ed51"
31
31
  }