saby-customizer 0.0.0-pre.21 → 0.0.0-pre.22

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.
@@ -181,7 +181,8 @@ class GitBranchCard extends oom.extends(HTMLElement) {
181
181
  placeholder: this.data.branchSubName,
182
182
  pattern: '^\\w+[\\w()-]*$',
183
183
  validationmessage: 'Латинские буквы, цифры и _()-',
184
- onblur: event => this.saveBranchSubName(event)
184
+ oninput: () => this.oninputBranchSubName(),
185
+ onblur: () => this.onblurBranchSubName()
185
186
  }).dom,
186
187
  /** @type {import('@material/mwc-icon-button').IconButton} */// @ts-ignore
187
188
  copyBranchButton: oom.mwcIconButton({
@@ -244,9 +245,10 @@ class GitBranchCard extends oom.extends(HTMLElement) {
244
245
  */
245
246
  set branchSubName(value) {
246
247
  this.data.branchSubName = value || this.data.number
247
- this.elements.branchSubName.textContent = this.data.branchSubName
248
- this.elements.branchSubName.title = this.data.branchSubName
249
- this.elements.branchSubNameTextfield.value = this.data.branchSubName
248
+ oom(this.elements.branchSubName, { innerHTML: '', title: this.data.branchSubName }, this.data.branchSubName)
249
+ if (this.elements.branchSubNameTextfield.value !== this.data.branchSubName) {
250
+ this.elements.branchSubNameTextfield.value = this.data.branchSubName
251
+ }
250
252
  }
251
253
 
252
254
  /** @returns {string} Краткое описание задачи */
@@ -327,14 +329,16 @@ class GitBranchCard extends oom.extends(HTMLElement) {
327
329
  this.elements.branchSubNameTextfield.select()
328
330
  }
329
331
 
330
- /**
331
- * Сохранение данных о доп. имени ветки при потере фокуса с поля ввода
332
- *
333
- * @param {{target:import('@material/mwc-textfield').TextField}} event Данные о событи onblur
334
- */
335
- saveBranchSubName({ target }) {
336
- if (target.checkValidity()) {
337
- this.branchSubName = target.value
332
+ /** Сохранение данных о доп. имени ветки при вводе */
333
+ oninputBranchSubName() {
334
+ if (this.elements.branchSubNameTextfield.checkValidity()) {
335
+ this.branchSubName = this.elements.branchSubNameTextfield.value
336
+ }
337
+ }
338
+
339
+ /** Скрывает поле ввода доп. имени ветки при потере фокуса */
340
+ onblurBranchSubName() {
341
+ if (this.elements.branchSubNameTextfield.checkValidity()) {
338
342
  this.elements.branchSubName.classList.toggle('hide')
339
343
  this.elements.branchSubNameTextfield.classList.toggle('hide')
340
344
  }
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "repository": "github:saby-customizer/saby-customizer.github.io",
11
11
  "license": "Unlicense",
12
- "version": "0.0.0-pre.21",
12
+ "version": "0.0.0-pre.22",
13
13
  "type": "module",
14
14
  "main": "./userscript.js",
15
15
  "exports": {