@shoper/phoenix_design_system 1.15.9-1 → 1.15.9-3

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.
@@ -12,16 +12,17 @@ var input_constants = require('./input_constants.js');
12
12
 
13
13
  exports.HInputCopyButton = class HInputCopyButton extends phoenix_light_lit_element.PhoenixLightLitElement {
14
14
  constructor() {
15
- super(...arguments);
15
+ super();
16
16
  this.hasBeenCopied = false;
17
17
  this.copyValue = '';
18
18
  this._$inputToCopy = null;
19
- this._handleCopyToClipboard = async () => {
19
+ this._handleCopyToClipboard = async (ev) => {
20
+ console.log('copy! on click/keydown');
20
21
  if (!this._$inputToCopy || this.hasBeenCopied)
21
22
  return;
23
+ ev.stopPropagation();
22
24
  this._$inputToCopy.select();
23
25
  this.copyValue = this._$inputToCopy.value;
24
- console.log(this._$inputToCopy);
25
26
  await this._copyToClipboard();
26
27
  };
27
28
  this._resetCopyStateAfterTimeout = () => {
@@ -30,18 +31,19 @@ exports.HInputCopyButton = class HInputCopyButton extends phoenix_light_lit_elem
30
31
  }, 2000);
31
32
  };
32
33
  this._resetCopyState = () => {
34
+ console.log('reset', this._$inputToCopy, this.copyValue);
33
35
  if (this._$inputToCopy)
34
36
  this._$inputToCopy.value = this.copyValue;
35
37
  this.copyValue = '';
36
38
  this.hasBeenCopied = false;
37
39
  };
40
+ this._btnController = new btn_controller.BtnController(this, this._handleCopyToClipboard);
38
41
  }
39
42
  connectedCallback() {
40
43
  super.connectedCallback();
41
44
  this._$inputToCopy = document.querySelector(`#${this.inputId}`);
42
45
  if (!this._$inputToCopy)
43
46
  return;
44
- this._btnController = new btn_controller.BtnController(this, this._handleCopyToClipboard);
45
47
  this.addEventListener('click', this._handleCopyToClipboard);
46
48
  }
47
49
  async _copyToClipboard() {
@@ -96,6 +98,7 @@ tslib_es6.__decorate([
96
98
  tslib_es6.__metadata("design:type", Object)
97
99
  ], exports.HInputCopyButton.prototype, "copyValue", void 0);
98
100
  exports.HInputCopyButton = tslib_es6.__decorate([
99
- phoenix_custom_element.phoenixCustomElement('h-input-copy-button')
101
+ phoenix_custom_element.phoenixCustomElement('h-input-copy-button'),
102
+ tslib_es6.__metadata("design:paramtypes", [])
100
103
  ], exports.HInputCopyButton);
101
104
  //# sourceMappingURL=input_copy_button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -7,6 +7,7 @@ export declare class HInputCopyButton extends PhoenixLightLitElement {
7
7
  copyValue: string;
8
8
  private _$inputToCopy;
9
9
  private _btnController;
10
+ constructor();
10
11
  connectedCallback(): void;
11
12
  private _handleCopyToClipboard;
12
13
  private _copyToClipboard;
@@ -8,16 +8,17 @@ import { INPUT_CONTROL_EVENTS } from './input_constants.js';
8
8
 
9
9
  let HInputCopyButton = class HInputCopyButton extends PhoenixLightLitElement {
10
10
  constructor() {
11
- super(...arguments);
11
+ super();
12
12
  this.hasBeenCopied = false;
13
13
  this.copyValue = '';
14
14
  this._$inputToCopy = null;
15
- this._handleCopyToClipboard = async () => {
15
+ this._handleCopyToClipboard = async (ev) => {
16
+ console.log('copy! on click/keydown');
16
17
  if (!this._$inputToCopy || this.hasBeenCopied)
17
18
  return;
19
+ ev.stopPropagation();
18
20
  this._$inputToCopy.select();
19
21
  this.copyValue = this._$inputToCopy.value;
20
- console.log(this._$inputToCopy);
21
22
  await this._copyToClipboard();
22
23
  };
23
24
  this._resetCopyStateAfterTimeout = () => {
@@ -26,18 +27,19 @@ let HInputCopyButton = class HInputCopyButton extends PhoenixLightLitElement {
26
27
  }, 2000);
27
28
  };
28
29
  this._resetCopyState = () => {
30
+ console.log('reset', this._$inputToCopy, this.copyValue);
29
31
  if (this._$inputToCopy)
30
32
  this._$inputToCopy.value = this.copyValue;
31
33
  this.copyValue = '';
32
34
  this.hasBeenCopied = false;
33
35
  };
36
+ this._btnController = new BtnController(this, this._handleCopyToClipboard);
34
37
  }
35
38
  connectedCallback() {
36
39
  super.connectedCallback();
37
40
  this._$inputToCopy = document.querySelector(`#${this.inputId}`);
38
41
  if (!this._$inputToCopy)
39
42
  return;
40
- this._btnController = new BtnController(this, this._handleCopyToClipboard);
41
43
  this.addEventListener('click', this._handleCopyToClipboard);
42
44
  }
43
45
  async _copyToClipboard() {
@@ -92,7 +94,8 @@ __decorate([
92
94
  __metadata("design:type", Object)
93
95
  ], HInputCopyButton.prototype, "copyValue", void 0);
94
96
  HInputCopyButton = __decorate([
95
- phoenixCustomElement('h-input-copy-button')
97
+ phoenixCustomElement('h-input-copy-button'),
98
+ __metadata("design:paramtypes", [])
96
99
  ], HInputCopyButton);
97
100
 
98
101
  export { HInputCopyButton };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.15.9-1",
5
+ "version": "1.15.9-3",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",