@shoper/phoenix_design_system 1.5.5 → 1.6.1
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/build/cjs/packages/phoenix/src/components/form/input/input_control.js +35 -0
- package/build/cjs/packages/phoenix/src/components/form/input/input_control.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/select/select.js +2 -2
- package/build/cjs/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.js +364 -0
- package/build/cjs/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/form/input/input_control.d.ts +9 -1
- package/build/esm/packages/phoenix/src/components/form/input/input_control.js +35 -0
- package/build/esm/packages/phoenix/src/components/form/input/input_control.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/select/select.js +2 -2
- package/build/esm/packages/phoenix/src/components/search/search.d.ts +15 -0
- package/build/esm/packages/phoenix/src/components/search/search.js +94 -0
- package/build/esm/packages/phoenix/src/components/search/search.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/search/search_history.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/search/search_history.js +23 -0
- package/build/esm/packages/phoenix/src/components/search/search_history.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/search/search_input.d.ts +7 -0
- package/build/esm/packages/phoenix/src/components/search/search_input.js +39 -0
- package/build/esm/packages/phoenix/src/components/search/search_input.js.map +1 -0
- package/build/esm/packages/phoenix/src/components/search/search_results.d.ts +5 -0
- package/build/esm/packages/phoenix/src/components/search/search_results.js +24 -0
- package/build/esm/packages/phoenix/src/components/search/search_results.js.map +1 -0
- package/build/esm/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.d.ts +25 -0
- package/build/esm/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.js +360 -0
- package/build/esm/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.js.map +1 -0
- package/package.json +1 -1
|
@@ -10,11 +10,14 @@ var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_el
|
|
|
10
10
|
var input_constants = require('./input_constants.js');
|
|
11
11
|
var ifDefined_js = require('lit-html/directives/if-defined.js');
|
|
12
12
|
var control_props_sync_consumer_controller = require('../controllers/props_synchronizing/control_props_sync_consumer_controller.js');
|
|
13
|
+
var ref = require('lit/directives/ref');
|
|
14
|
+
var input_mask_controller = require('../../../controllers/input_mask_controller/input_mask_controller.js');
|
|
13
15
|
|
|
14
16
|
exports.HInputControl = class HInputControl extends phoenix_light_lit_element.PhoenixLightLitElement {
|
|
15
17
|
constructor() {
|
|
16
18
|
super();
|
|
17
19
|
this.type = input_constants.INPUT_CONTROL_TYPES.text;
|
|
20
|
+
this._inputRef = ref.createRef();
|
|
18
21
|
this._handleChangeEvent = (event) => {
|
|
19
22
|
this.dispatchEvent(new CustomEvent(input_constants.INPUT_CONTROL_EVENTS.change, {
|
|
20
23
|
detail: event,
|
|
@@ -33,12 +36,32 @@ exports.HInputControl = class HInputControl extends phoenix_light_lit_element.Ph
|
|
|
33
36
|
}
|
|
34
37
|
connectedCallback() {
|
|
35
38
|
super.connectedCallback();
|
|
39
|
+
if (this.mask) {
|
|
40
|
+
this._inputMaskController = new input_mask_controller.InputMaskController({
|
|
41
|
+
host: this,
|
|
42
|
+
input: this._inputRef,
|
|
43
|
+
mask: this.mask,
|
|
44
|
+
pattern: this.pattern,
|
|
45
|
+
validPattern: this.validPattern
|
|
46
|
+
});
|
|
47
|
+
}
|
|
36
48
|
this.classList.add(input_constants.INPUT_CONTROL_CSS_CLASSES.inputControl);
|
|
37
49
|
}
|
|
50
|
+
updated(_changedProperties) {
|
|
51
|
+
super.updated(_changedProperties);
|
|
52
|
+
this.mask ? this.enableMask() : this.disableMask();
|
|
53
|
+
}
|
|
54
|
+
enableMask() {
|
|
55
|
+
this._inputMaskController.enable();
|
|
56
|
+
}
|
|
57
|
+
disableMask() {
|
|
58
|
+
this._inputMaskController.disable();
|
|
59
|
+
}
|
|
38
60
|
render() {
|
|
39
61
|
super.render();
|
|
40
62
|
return lit.html `
|
|
41
63
|
<input
|
|
64
|
+
${ref.ref(this._inputRef)}
|
|
42
65
|
id="${ifDefined_js.ifDefined(this.controlId)}"
|
|
43
66
|
name="${ifDefined_js.ifDefined(this.controlName)}"
|
|
44
67
|
type="${ifDefined_js.ifDefined(this.type)}"
|
|
@@ -90,6 +113,18 @@ tslib_es6.__decorate([
|
|
|
90
113
|
decorators.property({ type: String }),
|
|
91
114
|
tslib_es6.__metadata("design:type", String)
|
|
92
115
|
], exports.HInputControl.prototype, "placeholder", void 0);
|
|
116
|
+
tslib_es6.__decorate([
|
|
117
|
+
decorators.property({ type: String }),
|
|
118
|
+
tslib_es6.__metadata("design:type", String)
|
|
119
|
+
], exports.HInputControl.prototype, "mask", void 0);
|
|
120
|
+
tslib_es6.__decorate([
|
|
121
|
+
decorators.property({ type: String }),
|
|
122
|
+
tslib_es6.__metadata("design:type", String)
|
|
123
|
+
], exports.HInputControl.prototype, "pattern", void 0);
|
|
124
|
+
tslib_es6.__decorate([
|
|
125
|
+
decorators.property({ type: String, attribute: 'valid-pattern' }),
|
|
126
|
+
tslib_es6.__metadata("design:type", String)
|
|
127
|
+
], exports.HInputControl.prototype, "validPattern", void 0);
|
|
93
128
|
exports.HInputControl = tslib_es6.__decorate([
|
|
94
129
|
phoenix_custom_element.phoenixCustomElement('h-input-control'),
|
|
95
130
|
tslib_es6.__metadata("design:paramtypes", [])
|
|
@@ -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;"}
|
|
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -163,8 +163,8 @@ exports.HSelect = class HSelect extends phoenix_light_lit_element.PhoenixLightLi
|
|
|
163
163
|
this._selectController = this.multiple ? new multi_select_controller.MultiSelectController({ host: this }) : new select_controller.SelectController({ host: this });
|
|
164
164
|
this._selectContext.provide(select_constants.SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
|
|
165
165
|
this._selectContext.provide(select_constants.SELECT_CONTEXTS.isMultiselect, this.multiple);
|
|
166
|
-
const $options = this.hasSlot(
|
|
167
|
-
? this.getSlot(
|
|
166
|
+
const $options = this.hasSlot(select_constants.SELECT_SLOT_NAMES.content)
|
|
167
|
+
? this.getSlot(select_constants.SELECT_SLOT_NAMES.content)
|
|
168
168
|
.map((litElement) => litElement.values[0])
|
|
169
169
|
.filter((element) => element instanceof select_option.HOption)
|
|
170
170
|
: Array.from(this.querySelectorAll(select_components_constatns.SELECT_RELATED_COMPONENTS_NAMES.option));
|
package/build/cjs/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.js
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
|
|
6
|
+
require('lit');
|
|
7
|
+
require('lit/directives/ref');
|
|
8
|
+
|
|
9
|
+
var _InputMaskController_host, _InputMaskController_input, _InputMaskController_mask, _InputMaskController_pattern, _InputMaskController_validPattern, _InputMaskController_skipCharacters, _InputMaskController_skipKeys, _InputMaskController_patternRegexp, _InputMaskController_patternCheck, _InputMaskController_keydownValue, _InputMaskController_isFirstPosition, _InputMaskController_isLastPosition, _InputMaskController_isEnabled;
|
|
10
|
+
const MASK_CHARACTER = '_';
|
|
11
|
+
class InputMaskController {
|
|
12
|
+
constructor({ host, input, mask, pattern, validPattern }) {
|
|
13
|
+
_InputMaskController_host.set(this, void 0);
|
|
14
|
+
_InputMaskController_input.set(this, void 0);
|
|
15
|
+
_InputMaskController_mask.set(this, void 0);
|
|
16
|
+
_InputMaskController_pattern.set(this, void 0);
|
|
17
|
+
_InputMaskController_validPattern.set(this, void 0);
|
|
18
|
+
_InputMaskController_skipCharacters.set(this, []);
|
|
19
|
+
_InputMaskController_skipKeys.set(this, [
|
|
20
|
+
'Backspace',
|
|
21
|
+
'Enter',
|
|
22
|
+
'Escape',
|
|
23
|
+
'ArrowLeft',
|
|
24
|
+
'ArrowUp',
|
|
25
|
+
'ArrowRight',
|
|
26
|
+
'ArrowDown',
|
|
27
|
+
'Delete',
|
|
28
|
+
'CapsLock',
|
|
29
|
+
'Shift',
|
|
30
|
+
'Control',
|
|
31
|
+
'Alt',
|
|
32
|
+
'AltGraph',
|
|
33
|
+
'Tab'
|
|
34
|
+
]);
|
|
35
|
+
_InputMaskController_patternRegexp.set(this, void 0);
|
|
36
|
+
_InputMaskController_patternCheck.set(this, false);
|
|
37
|
+
_InputMaskController_keydownValue.set(this, '');
|
|
38
|
+
_InputMaskController_isFirstPosition.set(this, false);
|
|
39
|
+
_InputMaskController_isLastPosition.set(this, false);
|
|
40
|
+
_InputMaskController_isEnabled.set(this, false);
|
|
41
|
+
this.enable = () => {
|
|
42
|
+
if (!tslib_es6.__classPrivateFieldGet(this, _InputMaskController_isEnabled, "f")) {
|
|
43
|
+
const $input = this._getInput();
|
|
44
|
+
$input.setAttribute('autocomplete', 'off');
|
|
45
|
+
$input.addEventListener('mousedown', this._setInitialMaskWhenEmpty);
|
|
46
|
+
$input.addEventListener('mouseup', this._setCursorOnStartWhenEmpty);
|
|
47
|
+
$input.addEventListener('blur', this._setEmptyValueForNoValue);
|
|
48
|
+
$input.addEventListener('focus', this._setInitialMaskWhenEmpty);
|
|
49
|
+
$input.addEventListener('keydown', this._onKeyDown);
|
|
50
|
+
$input.addEventListener('input', this._onInput);
|
|
51
|
+
$input.addEventListener('keyup', this._onKeyUp);
|
|
52
|
+
$input.addEventListener('paste', this._onPaste);
|
|
53
|
+
$input.addEventListener('change', () => { });
|
|
54
|
+
$input.value = '';
|
|
55
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_isEnabled, true, "f");
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this.disable = () => {
|
|
59
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_isEnabled, "f")) {
|
|
60
|
+
const $input = this._getInput();
|
|
61
|
+
$input.setAttribute('autocomplete', 'on');
|
|
62
|
+
$input.removeEventListener('mousedown', this._setInitialMaskWhenEmpty);
|
|
63
|
+
$input.removeEventListener('mouseup', this._setCursorOnStartWhenEmpty);
|
|
64
|
+
$input.removeEventListener('blur', this._setEmptyValueForNoValue);
|
|
65
|
+
$input.removeEventListener('focus', this._setInitialMaskWhenEmpty);
|
|
66
|
+
$input.removeEventListener('keydown', this._onKeyDown);
|
|
67
|
+
$input.removeEventListener('input', this._onInput);
|
|
68
|
+
$input.removeEventListener('keyup', this._onKeyUp);
|
|
69
|
+
$input.removeEventListener('paste', this._onPaste);
|
|
70
|
+
$input.removeEventListener('change', () => { });
|
|
71
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_isEnabled, false, "f");
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
this._setInitialMaskWhenEmpty = (ev) => {
|
|
75
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
76
|
+
const $input = ev.target;
|
|
77
|
+
if (!$input.value) {
|
|
78
|
+
$input.value = tslib_es6.__classPrivateFieldGet(this, _InputMaskController_mask, "f");
|
|
79
|
+
this._setCursorPosition();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
this._setCursorOnStartWhenEmpty = (ev) => {
|
|
84
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
85
|
+
const $input = ev.target;
|
|
86
|
+
if ($input.value === tslib_es6.__classPrivateFieldGet(this, _InputMaskController_mask, "f")) {
|
|
87
|
+
this._setCursorPosition();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
this._setEmptyValueForNoValue = (ev) => {
|
|
92
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
93
|
+
const $input = ev.target;
|
|
94
|
+
if ($input.value === tslib_es6.__classPrivateFieldGet(this, _InputMaskController_mask, "f")) {
|
|
95
|
+
$input.value = '';
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
this._onKeyDown = (ev) => {
|
|
100
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
101
|
+
const $input = ev.target;
|
|
102
|
+
const value = $input.value;
|
|
103
|
+
let currentPosition = this._getCursorPosition();
|
|
104
|
+
/**
|
|
105
|
+
*selection more than one character was made
|
|
106
|
+
*/
|
|
107
|
+
if (currentPosition[0] !== currentPosition[1]) {
|
|
108
|
+
if (ev.key === 'Backspace' || ev.key === 'Delete' || ev.keyCode === 8 || ev.keyCode === 46) {
|
|
109
|
+
const startSubstring = value.substring(0, currentPosition[0]);
|
|
110
|
+
const middleSubstring = value.substring(currentPosition[0], currentPosition[1]);
|
|
111
|
+
const endSubstring = value.substring(currentPosition[1], value.length);
|
|
112
|
+
const deleteRegexp = new RegExp('[^' + tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").join('') + ']', 'g');
|
|
113
|
+
const newValue = startSubstring + middleSubstring.replace(deleteRegexp, MASK_CHARACTER) + endSubstring;
|
|
114
|
+
$input.value = newValue;
|
|
115
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_keydownValue, newValue, "f");
|
|
116
|
+
if (ev.key === 'Backspace' || ev.keyCode === 8) {
|
|
117
|
+
this._setCursorPosition(currentPosition[0] + 2);
|
|
118
|
+
if (currentPosition[0] == 5) {
|
|
119
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_isLastPosition, true, "f");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
this._setCursorPosition(currentPosition[0]);
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
else if (!this._areKeysCombined(ev) && tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipKeys, "f").indexOf(ev.key) < 0) {
|
|
128
|
+
currentPosition = [currentPosition[0], currentPosition[0]];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Added keyCode for older browser compatibility, keyCode 8 == backspace, keyCode 46 === delete
|
|
133
|
+
*/
|
|
134
|
+
if (ev.key === 'Backspace' || ev.key === 'Delete' || ev.keyCode === 8 || ev.keyCode === 46) {
|
|
135
|
+
if (ev.key === 'Backspace' || ev.keyCode === 8) {
|
|
136
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[currentPosition[0] - 1]) >= 0) {
|
|
137
|
+
// skip special characters that are part of the mask
|
|
138
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_keydownValue, $input.value, "f");
|
|
139
|
+
this._setCursorPosition(currentPosition[0] + 1);
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
if (currentPosition[0] !== 0) {
|
|
143
|
+
// do nothing if cursor is at the start of the input
|
|
144
|
+
ev.target.value = this._insertCharAt(value, MASK_CHARACTER, currentPosition[0]);
|
|
145
|
+
this._setCursorPosition(currentPosition);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (ev.key === 'Delete' || ev.keyCode === 46) {
|
|
149
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[currentPosition[0]]) >= 0) {
|
|
150
|
+
// skip special characters that are part of the mask
|
|
151
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_keydownValue, $input.value, "f");
|
|
152
|
+
this._setCursorPosition(currentPosition[0] + 1);
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
if (currentPosition[0] !== value.length) {
|
|
156
|
+
ev.target.value = this._replaceCharAt(value, MASK_CHARACTER, currentPosition[0]);
|
|
157
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_keydownValue, $input.value, "f");
|
|
158
|
+
setTimeout(() => {
|
|
159
|
+
this._setCursorPosition(currentPosition.map(function (position) {
|
|
160
|
+
return (position += 1);
|
|
161
|
+
}));
|
|
162
|
+
});
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipKeys, "f").indexOf(ev.key) >= 0 || this._areKeysCombined(ev)) {
|
|
169
|
+
// no special behaviour for selected keys
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
currentPosition[1] += 1;
|
|
173
|
+
if (window.navigator.userAgent.indexOf('Edge/') > -1) {
|
|
174
|
+
ev.target.value = this._replaceCharAt(ev.target.value, ev.key, currentPosition[0]);
|
|
175
|
+
}
|
|
176
|
+
this._setCursorPosition(currentPosition);
|
|
177
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_keydownValue, value, "f");
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
this._onInput = (ev) => {
|
|
181
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
182
|
+
const $input = ev.target;
|
|
183
|
+
const value = $input.value;
|
|
184
|
+
const currentPosition = this._getCursorPosition();
|
|
185
|
+
const skipBy = this._skipCharactersBy.call(this, value, currentPosition[0], 0);
|
|
186
|
+
if (skipBy > 0 && value.length !== currentPosition[0] + skipBy) {
|
|
187
|
+
this._setCursorPosition(currentPosition.map((position) => {
|
|
188
|
+
return position + skipBy;
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
if (!this._isValidPattern(value)) {
|
|
192
|
+
const currentPosition = this._getCursorPosition();
|
|
193
|
+
$input.value = tslib_es6.__classPrivateFieldGet(this, _InputMaskController_keydownValue, "f");
|
|
194
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_isLastPosition, "f") || tslib_es6.__classPrivateFieldGet(this, _InputMaskController_isFirstPosition, "f")) {
|
|
195
|
+
this._setCursorPosition(currentPosition[0]);
|
|
196
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_isLastPosition, false, "f");
|
|
197
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_isFirstPosition, false, "f");
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
this._setCursorPosition(currentPosition[0] - 1);
|
|
201
|
+
}
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_mask, "f").length !== value.length) {
|
|
205
|
+
$input.value = value.slice(0, tslib_es6.__classPrivateFieldGet(this, _InputMaskController_mask, "f").length);
|
|
206
|
+
const lastMaskCharacterPos = value.indexOf(MASK_CHARACTER);
|
|
207
|
+
if (lastMaskCharacterPos >= 0) {
|
|
208
|
+
this._setCursorPosition(lastMaskCharacterPos);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
this._onKeyUp = (ev) => {
|
|
214
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
215
|
+
const $input = ev.target;
|
|
216
|
+
const value = $input.value;
|
|
217
|
+
const currentPosition = this._getCursorPosition();
|
|
218
|
+
let skipBy;
|
|
219
|
+
if (ev.key === 'Backspace' || ev.keyCode === 8) {
|
|
220
|
+
skipBy = this._skipCharactersBy(value, currentPosition[0] - 1, 0, true);
|
|
221
|
+
if (skipBy > 0) {
|
|
222
|
+
this._setCursorPosition(currentPosition.map((position) => {
|
|
223
|
+
return position - skipBy;
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
if (ev.key === 'Delete' || ev.keyCode === 46) {
|
|
229
|
+
skipBy = this._skipCharactersBy(value, currentPosition[0], 0);
|
|
230
|
+
if (skipBy > 0) {
|
|
231
|
+
this._setCursorPosition(currentPosition.map((position) => {
|
|
232
|
+
return position + skipBy;
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipKeys, "f").indexOf(ev.key) >= 0 || this._areKeysCombined(ev)) {
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
if (!value) {
|
|
241
|
+
$input.value = tslib_es6.__classPrivateFieldGet(this, _InputMaskController_mask, "f");
|
|
242
|
+
this._setCursorPosition();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
this._onPaste = (ev) => {
|
|
247
|
+
var _a;
|
|
248
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
249
|
+
const $input = ev.target;
|
|
250
|
+
const value = $input.value;
|
|
251
|
+
const valueLength = value.length;
|
|
252
|
+
const pastedValue = (_a = ev.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('Text');
|
|
253
|
+
const currentPosition = this._getCursorPosition();
|
|
254
|
+
let newValue = '';
|
|
255
|
+
ev.preventDefault();
|
|
256
|
+
for (let i = 0, j = 0; i < valueLength; i += 1) {
|
|
257
|
+
if (i >= currentPosition[0] && pastedValue[j] && tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[i]) < 0) {
|
|
258
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(pastedValue[j]) < 0) {
|
|
259
|
+
newValue = newValue + pastedValue[j];
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
i -= 1;
|
|
263
|
+
}
|
|
264
|
+
j += 1;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
newValue = newValue + value[i];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (this._isValidPattern(newValue)) {
|
|
271
|
+
ev.target.value = newValue;
|
|
272
|
+
this._setCursorPosition($input.value.indexOf(MASK_CHARACTER));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_host, host, "f");
|
|
277
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_input, input, "f");
|
|
278
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_mask, mask, "f");
|
|
279
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_pattern, pattern, "f");
|
|
280
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_validPattern, validPattern, "f");
|
|
281
|
+
if (pattern) {
|
|
282
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_patternRegexp, new RegExp(tslib_es6.__classPrivateFieldGet(this, _InputMaskController_pattern, "f"), 'g'), "f");
|
|
283
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_patternCheck, true, "f");
|
|
284
|
+
}
|
|
285
|
+
tslib_es6.__classPrivateFieldGet(this, _InputMaskController_host, "f").addController(this);
|
|
286
|
+
}
|
|
287
|
+
hostConnected() {
|
|
288
|
+
const maskRegexp = new RegExp(MASK_CHARACTER, 'g');
|
|
289
|
+
tslib_es6.__classPrivateFieldSet(this, _InputMaskController_skipCharacters, this._uniqueArr(tslib_es6.__classPrivateFieldGet(this, _InputMaskController_mask, "f").replace(maskRegexp, '').split('')), "f");
|
|
290
|
+
}
|
|
291
|
+
hostDisconnected() {
|
|
292
|
+
// this.#basePropsObservable?.unsubscribe(this.#propsObserver);
|
|
293
|
+
}
|
|
294
|
+
_setCursorPosition(positionStart = 0, positionEnd = positionStart) {
|
|
295
|
+
const $input = this._getInput();
|
|
296
|
+
if (typeof positionStart !== 'number') {
|
|
297
|
+
$input.selectionStart = positionStart[0];
|
|
298
|
+
$input.selectionEnd = positionEnd[1];
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
$input.selectionStart = positionStart;
|
|
302
|
+
if (typeof positionEnd === 'number')
|
|
303
|
+
$input.selectionEnd = positionEnd;
|
|
304
|
+
}
|
|
305
|
+
_getCursorPosition() {
|
|
306
|
+
var _a, _b;
|
|
307
|
+
const $input = this._getInput();
|
|
308
|
+
return [(_a = $input.selectionStart) !== null && _a !== void 0 ? _a : 0, (_b = $input.selectionEnd) !== null && _b !== void 0 ? _b : 0];
|
|
309
|
+
}
|
|
310
|
+
_uniqueArr(arr) {
|
|
311
|
+
const uniqueArr = [];
|
|
312
|
+
const arrLength = arr.length;
|
|
313
|
+
for (let i = 0; i < arrLength; i++) {
|
|
314
|
+
if (uniqueArr.indexOf(arr[i]) === -1 && arr[i] !== '') {
|
|
315
|
+
uniqueArr.push(arr[i]);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return uniqueArr;
|
|
319
|
+
}
|
|
320
|
+
_getInput() {
|
|
321
|
+
if (!tslib_es6.__classPrivateFieldGet(this, _InputMaskController_input, "f").value) {
|
|
322
|
+
throw new Error('Input element is not defined');
|
|
323
|
+
}
|
|
324
|
+
return tslib_es6.__classPrivateFieldGet(this, _InputMaskController_input, "f").value;
|
|
325
|
+
}
|
|
326
|
+
_areKeysCombined(ev) {
|
|
327
|
+
return ev.altKey || ev.ctrlKey || ev.metaKey;
|
|
328
|
+
}
|
|
329
|
+
_insertCharAt(string, char, position) {
|
|
330
|
+
return string.slice(0, position) + char + string.slice(position);
|
|
331
|
+
}
|
|
332
|
+
_replaceCharAt(string, char, position) {
|
|
333
|
+
return string.substr(0, position) + char + string.substr(position + 1);
|
|
334
|
+
}
|
|
335
|
+
_skipCharactersBy(value, position, skipBy, backward) {
|
|
336
|
+
backward = backward ? backward : false;
|
|
337
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[position]) >= 0) {
|
|
338
|
+
if (backward) {
|
|
339
|
+
position -= 1;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
position += 1;
|
|
343
|
+
}
|
|
344
|
+
skipBy += 1;
|
|
345
|
+
return this._skipCharactersBy.call(this, value, position, skipBy, backward);
|
|
346
|
+
}
|
|
347
|
+
return skipBy;
|
|
348
|
+
}
|
|
349
|
+
_isValidPattern(value) {
|
|
350
|
+
if (tslib_es6.__classPrivateFieldGet(this, _InputMaskController_patternCheck, "f")) {
|
|
351
|
+
const valueLength = value.length;
|
|
352
|
+
let partialValue = '';
|
|
353
|
+
for (let i = 0; i < valueLength; i += 1) {
|
|
354
|
+
partialValue += value[i] !== '_' ? value[i] : tslib_es6.__classPrivateFieldGet(this, _InputMaskController_validPattern, "f")[i];
|
|
355
|
+
}
|
|
356
|
+
return partialValue.match(tslib_es6.__classPrivateFieldGet(this, _InputMaskController_patternRegexp, "f")) !== null;
|
|
357
|
+
}
|
|
358
|
+
return true;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
_InputMaskController_host = new WeakMap(), _InputMaskController_input = new WeakMap(), _InputMaskController_mask = new WeakMap(), _InputMaskController_pattern = new WeakMap(), _InputMaskController_validPattern = new WeakMap(), _InputMaskController_skipCharacters = new WeakMap(), _InputMaskController_skipKeys = new WeakMap(), _InputMaskController_patternRegexp = new WeakMap(), _InputMaskController_patternCheck = new WeakMap(), _InputMaskController_keydownValue = new WeakMap(), _InputMaskController_isFirstPosition = new WeakMap(), _InputMaskController_isLastPosition = new WeakMap(), _InputMaskController_isEnabled = new WeakMap();
|
|
362
|
+
|
|
363
|
+
exports.InputMaskController = InputMaskController;
|
|
364
|
+
//# sourceMappingURL=input_mask_controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,5 +1,5 @@
|
|
|
1
1
|
import { PhoenixLightLitElement } from "../../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
-
import { TemplateResult } from 'lit';
|
|
2
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
3
3
|
import type { TInputControlType } from "./input_types";
|
|
4
4
|
export declare class HInputControl extends PhoenixLightLitElement {
|
|
5
5
|
controlId: string;
|
|
@@ -11,8 +11,16 @@ export declare class HInputControl extends PhoenixLightLitElement {
|
|
|
11
11
|
readonly: boolean;
|
|
12
12
|
value: string;
|
|
13
13
|
placeholder: string;
|
|
14
|
+
mask: string;
|
|
15
|
+
pattern: string;
|
|
16
|
+
validPattern: string;
|
|
17
|
+
private _inputRef;
|
|
18
|
+
private _inputMaskController;
|
|
14
19
|
constructor();
|
|
15
20
|
connectedCallback(): void;
|
|
21
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
22
|
+
enableMask(): void;
|
|
23
|
+
disableMask(): void;
|
|
16
24
|
protected render(): TemplateResult;
|
|
17
25
|
private _handleChangeEvent;
|
|
18
26
|
private _handleInputEvent;
|
|
@@ -6,11 +6,14 @@ import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_el
|
|
|
6
6
|
import { INPUT_CONTROL_TYPES, INPUT_CONTROL_EVENTS, INPUT_CONTROL_CSS_CLASSES } from './input_constants.js';
|
|
7
7
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
8
8
|
import { ControlPropsSyncConsumerController } from '../controllers/props_synchronizing/control_props_sync_consumer_controller.js';
|
|
9
|
+
import { createRef, ref } from 'lit/directives/ref';
|
|
10
|
+
import { InputMaskController } from '../../../controllers/input_mask_controller/input_mask_controller.js';
|
|
9
11
|
|
|
10
12
|
let HInputControl = class HInputControl extends PhoenixLightLitElement {
|
|
11
13
|
constructor() {
|
|
12
14
|
super();
|
|
13
15
|
this.type = INPUT_CONTROL_TYPES.text;
|
|
16
|
+
this._inputRef = createRef();
|
|
14
17
|
this._handleChangeEvent = (event) => {
|
|
15
18
|
this.dispatchEvent(new CustomEvent(INPUT_CONTROL_EVENTS.change, {
|
|
16
19
|
detail: event,
|
|
@@ -29,12 +32,32 @@ let HInputControl = class HInputControl extends PhoenixLightLitElement {
|
|
|
29
32
|
}
|
|
30
33
|
connectedCallback() {
|
|
31
34
|
super.connectedCallback();
|
|
35
|
+
if (this.mask) {
|
|
36
|
+
this._inputMaskController = new InputMaskController({
|
|
37
|
+
host: this,
|
|
38
|
+
input: this._inputRef,
|
|
39
|
+
mask: this.mask,
|
|
40
|
+
pattern: this.pattern,
|
|
41
|
+
validPattern: this.validPattern
|
|
42
|
+
});
|
|
43
|
+
}
|
|
32
44
|
this.classList.add(INPUT_CONTROL_CSS_CLASSES.inputControl);
|
|
33
45
|
}
|
|
46
|
+
updated(_changedProperties) {
|
|
47
|
+
super.updated(_changedProperties);
|
|
48
|
+
this.mask ? this.enableMask() : this.disableMask();
|
|
49
|
+
}
|
|
50
|
+
enableMask() {
|
|
51
|
+
this._inputMaskController.enable();
|
|
52
|
+
}
|
|
53
|
+
disableMask() {
|
|
54
|
+
this._inputMaskController.disable();
|
|
55
|
+
}
|
|
34
56
|
render() {
|
|
35
57
|
super.render();
|
|
36
58
|
return html `
|
|
37
59
|
<input
|
|
60
|
+
${ref(this._inputRef)}
|
|
38
61
|
id="${ifDefined(this.controlId)}"
|
|
39
62
|
name="${ifDefined(this.controlName)}"
|
|
40
63
|
type="${ifDefined(this.type)}"
|
|
@@ -86,6 +109,18 @@ __decorate([
|
|
|
86
109
|
property({ type: String }),
|
|
87
110
|
__metadata("design:type", String)
|
|
88
111
|
], HInputControl.prototype, "placeholder", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: String }),
|
|
114
|
+
__metadata("design:type", String)
|
|
115
|
+
], HInputControl.prototype, "mask", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ type: String }),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], HInputControl.prototype, "pattern", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ type: String, attribute: 'valid-pattern' }),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], HInputControl.prototype, "validPattern", void 0);
|
|
89
124
|
HInputControl = __decorate([
|
|
90
125
|
phoenixCustomElement('h-input-control'),
|
|
91
126
|
__metadata("design:paramtypes", [])
|
|
@@ -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;"}
|
|
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -159,8 +159,8 @@ let HSelect = class HSelect extends PhoenixLightLitElement {
|
|
|
159
159
|
this._selectController = this.multiple ? new MultiSelectController({ host: this }) : new SelectController({ host: this });
|
|
160
160
|
this._selectContext.provide(SELECT_CONTEXTS.selectedOptions$, this._selectController.selectedOptions$);
|
|
161
161
|
this._selectContext.provide(SELECT_CONTEXTS.isMultiselect, this.multiple);
|
|
162
|
-
const $options = this.hasSlot(
|
|
163
|
-
? this.getSlot(
|
|
162
|
+
const $options = this.hasSlot(SELECT_SLOT_NAMES.content)
|
|
163
|
+
? this.getSlot(SELECT_SLOT_NAMES.content)
|
|
164
164
|
.map((litElement) => litElement.values[0])
|
|
165
165
|
.filter((element) => element instanceof HOption)
|
|
166
166
|
: Array.from(this.querySelectorAll(SELECT_RELATED_COMPONENTS_NAMES.option));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
export declare class HSearch extends PhoenixLightLitElement {
|
|
3
|
+
private _searchContextConsumer;
|
|
4
|
+
private _searchContext$;
|
|
5
|
+
private _searchContextObserver;
|
|
6
|
+
private _shouldShowHistory;
|
|
7
|
+
private _searchResults;
|
|
8
|
+
private _searchHistory;
|
|
9
|
+
connectedCallback(): Promise<void>;
|
|
10
|
+
private _setupListeners;
|
|
11
|
+
private _displaySuggester;
|
|
12
|
+
private _displayHistorySuggestions;
|
|
13
|
+
private _displayResults;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { PhoenixLightLitElement } from '@phoenixRoot/core/phoenix_light_lit_element/phoenix_light_lit_element';
|
|
3
|
+
import { phoenixCustomElement } from '@phoenixRoot/core/decorators/phoenix_custom_element';
|
|
4
|
+
import { ContextConsumerController } from '@phoenixRoot/core/context/context_consumer_controller';
|
|
5
|
+
import '@phoenixRoot/core/classes/behavior_subject/behavior_subject';
|
|
6
|
+
import { Observer } from '@phoenixRoot/core/classes/observer/observer';
|
|
7
|
+
import { state } from 'lit/decorators';
|
|
8
|
+
import { html } from 'lit/development';
|
|
9
|
+
import './search_history';
|
|
10
|
+
import './search_results';
|
|
11
|
+
import { when } from 'lit/directives/when.js';
|
|
12
|
+
let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this._shouldShowHistory = false;
|
|
16
|
+
// przykladowe dane - to powinno przyjsc z contextu
|
|
17
|
+
this._searchResults = {
|
|
18
|
+
test: 'test'
|
|
19
|
+
};
|
|
20
|
+
// przykladowe dane to powinno przyjsc z contextu
|
|
21
|
+
this._searchHistory = ['test, dupa, dwa'];
|
|
22
|
+
}
|
|
23
|
+
async connectedCallback() {
|
|
24
|
+
super.connectedCallback();
|
|
25
|
+
try {
|
|
26
|
+
this._searchContextConsumer = new ContextConsumerController(this);
|
|
27
|
+
this._searchContext$ = await this._searchContextConsumer.consumeAsync('searchContext');
|
|
28
|
+
this._searchContextObserver = new Observer((searchData) => {
|
|
29
|
+
this._searchResults = searchData.results;
|
|
30
|
+
this._searchHistory = searchData.history;
|
|
31
|
+
});
|
|
32
|
+
this._searchContext$.subscribe(this._searchContextObserver);
|
|
33
|
+
}
|
|
34
|
+
catch (_a) {
|
|
35
|
+
console.error('Search context is not provided');
|
|
36
|
+
}
|
|
37
|
+
this._setupListeners();
|
|
38
|
+
}
|
|
39
|
+
_setupListeners() {
|
|
40
|
+
this.addEventListener('focusin', (ev) => {
|
|
41
|
+
const isSearchInput = ev.target instanceof HTMLInputElement && ev.target.type === 'search';
|
|
42
|
+
if (isSearchInput) {
|
|
43
|
+
const $searchInput = ev.target;
|
|
44
|
+
this._displaySuggester($searchInput.value);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
this.addEventListener('keyup', (ev) => {
|
|
48
|
+
const isSearchInput = ev.target instanceof HTMLInputElement && ev.target.type === 'search';
|
|
49
|
+
if (isSearchInput) {
|
|
50
|
+
const $searchInput = ev.target;
|
|
51
|
+
this._displaySuggester($searchInput.value);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
_displaySuggester(searchPhrase) {
|
|
56
|
+
if (searchPhrase === '') {
|
|
57
|
+
this._displayHistorySuggestions();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this._displayResults();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_displayHistorySuggestions() {
|
|
64
|
+
// oczywiscie ta logika moze powinna byc bardziej skomplikowana ;)
|
|
65
|
+
this._shouldShowHistory = true;
|
|
66
|
+
}
|
|
67
|
+
_displayResults() {
|
|
68
|
+
// oczywiscie ta logika moze powinna byc bardziej skomplikowana ;)
|
|
69
|
+
this._shouldShowHistory = false;
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
// tutaj tez oczywiscie ta logika jets bledna i bardzo uproszczona - chodzi o sam zamysl i poukladanie teog.
|
|
73
|
+
return html `
|
|
74
|
+
${when(this._shouldShowHistory, () => html `<h-search-history .history="${this._searchHistory}"></h-search-history>`, () => html `<h-search-results .results="${this._searchResults}"></h-search-results>`)}
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
__decorate([
|
|
79
|
+
state(),
|
|
80
|
+
__metadata("design:type", Boolean)
|
|
81
|
+
], HSearch.prototype, "_shouldShowHistory", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
state(),
|
|
84
|
+
__metadata("design:type", Object)
|
|
85
|
+
], HSearch.prototype, "_searchResults", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
state(),
|
|
88
|
+
__metadata("design:type", Array)
|
|
89
|
+
], HSearch.prototype, "_searchHistory", void 0);
|
|
90
|
+
HSearch = __decorate([
|
|
91
|
+
phoenixCustomElement('h-search')
|
|
92
|
+
], HSearch);
|
|
93
|
+
export { HSearch };
|
|
94
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../../../../src/components/search/search.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAgC,6DAA6D,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAA+B,kBAAkB,CAAC;AAClD,OAA+B,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAQ9C,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,sBAAsB;IAAnD;;QAMY,uBAAkB,GAAY,KAAK,CAAC;QAE5C,mDAAmD;QAE3C,mBAAc,GAAqB;YACvC,IAAI,EAAE,MAAM;SACf,CAAC;QAEF,iDAAiD;QAEzC,mBAAc,GAAU,CAAC,iBAAiB,CAAC,CAAC;IAsExD,CAAC;IApEU,KAAK,CAAC,iBAAiB;QAC1B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI;YACA,IAAI,CAAC,sBAAsB,GAAG,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC;YAClE,IAAI,CAAC,eAAe,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YAEvF,IAAI,CAAC,sBAAsB,GAAG,IAAI,QAAQ,CAAC,CAAC,UAAuB,EAAE,EAAE;gBACnE,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;gBACzC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;YAC7C,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;SAC/D;QAAC,WAAM;YACJ,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACnD;QAED,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAEO,eAAe;QACnB,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAS,EAAE,EAAE;YAC3C,MAAM,aAAa,GAAG,EAAE,CAAC,MAAM,YAAY,gBAAgB,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;YAE3F,IAAI,aAAa,EAAE;gBACf,MAAM,YAAY,GAAG,EAAE,CAAC,MAAM,CAAC;gBAC/B,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;aAC9C;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAS,EAAE,EAAE;YACzC,MAAM,aAAa,GAAG,EAAE,CAAC,MAAM,YAAY,gBAAgB,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC;YAE3F,IAAI,aAAa,EAAE;gBACf,MAAM,YAAY,GAAG,EAAE,CAAC,MAAM,CAAC;gBAC/B,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;aAC9C;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,iBAAiB,CAAC,YAAoB;QAC1C,IAAI,YAAY,KAAK,EAAE,EAAE;YACrB,IAAI,CAAC,0BAA0B,EAAE,CAAC;SACrC;aAAM;YACH,IAAI,CAAC,eAAe,EAAE,CAAC;SAC1B;IACL,CAAC;IAEO,0BAA0B;QAC9B,kEAAkE;QAClE,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACnC,CAAC;IAEO,eAAe;QACnB,kEAAkE;QAClE,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IACpC,CAAC;IAEM,MAAM;QACT,4GAA4G;QAC5G,OAAO,IAAI,CAAA;cACL,IAAI,CACF,IAAI,CAAC,kBAAkB,EACvB,GAAG,EAAE,CAAC,IAAI,CAAA,+BAA+B,IAAI,CAAC,cAAc,uBAAuB,EACnF,GAAG,EAAE,CAAC,IAAI,CAAA,+BAA+B,IAAI,CAAC,cAAc,uBAAuB,CACtF;SACJ,CAAC;IACN,CAAC;CACJ,CAAA;AAhFG;IADC,KAAK,EAAE;;mDACoC;AAI5C;IADC,KAAK,EAAE;;+CAGN;AAIF;IADC,KAAK,EAAE;;+CAC4C;AAhB3C,OAAO;IADnB,oBAAoB,CAAC,UAAU,CAAC;GACpB,OAAO,CAsFnB;SAtFY,OAAO"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { phoenixCustomElement } from '@phoenixRoot/core/decorators/phoenix_custom_element';
|
|
3
|
+
import { PhoenixLightLitElement } from '@phoenixRoot/core/phoenix_light_lit_element/phoenix_light_lit_element';
|
|
4
|
+
import { property } from 'lit/decorators';
|
|
5
|
+
import { html } from 'lit/development';
|
|
6
|
+
let HSearchHistory = class HSearchHistory extends PhoenixLightLitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.history = [];
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return html ` ${this.history} `;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
__decorate([
|
|
16
|
+
property({ type: Array, attribute: 'result-data' }),
|
|
17
|
+
__metadata("design:type", Array)
|
|
18
|
+
], HSearchHistory.prototype, "history", void 0);
|
|
19
|
+
HSearchHistory = __decorate([
|
|
20
|
+
phoenixCustomElement('h-search-history')
|
|
21
|
+
], HSearchHistory);
|
|
22
|
+
export { HSearchHistory };
|
|
23
|
+
//# sourceMappingURL=search_history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search_history.js","sourceRoot":"","sources":["../../../../../../../src/components/search/search_history.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,sBAAsB;IAA1D;;QAEI,YAAO,GAAa,EAAE,CAAC;IAK3B,CAAC;IAHU,MAAM;QACT,OAAO,IAAI,CAAA,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC;IACnC,CAAC;CACJ,CAAA;AALG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;;+CAC7B;AAFd,cAAc;IAD1B,oBAAoB,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CAO1B;SAPY,cAAc"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element/phoenix_light_lit_element";
|
|
2
|
+
export declare class HSearch extends PhoenixLightLitElement {
|
|
3
|
+
private _searchContextConsumer;
|
|
4
|
+
private _searchContext$;
|
|
5
|
+
private _searchContextObserver;
|
|
6
|
+
connectedCallback(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { PhoenixLightLitElement } from '@phoenixRoot/core/phoenix_light_lit_element/phoenix_light_lit_element';
|
|
3
|
+
import { phoenixCustomElement } from '@phoenixRoot/core/decorators/phoenix_custom_element';
|
|
4
|
+
import { ContextConsumerController } from '@phoenixRoot/core/context/context_consumer_controller';
|
|
5
|
+
import '@phoenixRoot/core/classes/behavior_subject/behavior_subject';
|
|
6
|
+
import { Observer } from '@phoenixRoot/core/classes/observer/observer';
|
|
7
|
+
import { state } from 'lit/decorators';
|
|
8
|
+
let HSearch = class HSearch extends PhoenixLightLitElement {
|
|
9
|
+
async connectedCallback() {
|
|
10
|
+
super.connectedCallback();
|
|
11
|
+
try {
|
|
12
|
+
this._searchContextConsumer = new ContextConsumerController(this);
|
|
13
|
+
this._searchContext$ = await this._searchContextConsumer.consumeAsync('searchContext');
|
|
14
|
+
this._searchContextObserver = new Observer((searchData) => {
|
|
15
|
+
if (searchData.searchPhrase === '') {
|
|
16
|
+
const $input = this.querySelector('input[type="search"]');
|
|
17
|
+
if ($input) {
|
|
18
|
+
$input.value = '';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
this._searchContext$.subscribe(this._searchContextObserver);
|
|
23
|
+
}
|
|
24
|
+
catch (_a) {
|
|
25
|
+
console.error('Search context is not provided');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
__decorate([
|
|
30
|
+
state(),
|
|
31
|
+
__metadata("design:type", Function),
|
|
32
|
+
__metadata("design:paramtypes", []),
|
|
33
|
+
__metadata("design:returntype", Promise)
|
|
34
|
+
], HSearch.prototype, "connectedCallback", null);
|
|
35
|
+
HSearch = __decorate([
|
|
36
|
+
phoenixCustomElement('h-search-input')
|
|
37
|
+
], HSearch);
|
|
38
|
+
export { HSearch };
|
|
39
|
+
//# sourceMappingURL=search_input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search_input.js","sourceRoot":"","sources":["../../../../../../../src/components/search/search_input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAgC,6DAA6D,CAAC;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AASvC,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,sBAAsB;IAMxC,KAAK,CAAC,iBAAiB;QAC1B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI;YACA,IAAI,CAAC,sBAAsB,GAAG,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAC;YAClE,IAAI,CAAC,eAAe,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YAEvF,IAAI,CAAC,sBAAsB,GAAG,IAAI,QAAQ,CAAC,CAAC,UAAuB,EAAE,EAAE;gBACnE,IAAI,UAAU,CAAC,YAAY,KAAK,EAAE,EAAE;oBAChC,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAmB,sBAAsB,CAAC,CAAC;oBAC5E,IAAI,MAAM,EAAE;wBACR,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;qBACrB;iBACJ;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;SAC/D;QAAC,WAAM;YACJ,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACnD;IACL,CAAC;CACJ,CAAA;AArBG;IADC,KAAK,EAAE;;;;gDAqBP;AA1BQ,OAAO;IADnB,oBAAoB,CAAC,gBAAgB,CAAC;GAC1B,OAAO,CA2BnB;SA3BY,OAAO"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { phoenixCustomElement } from '@phoenixRoot/core/decorators/phoenix_custom_element';
|
|
3
|
+
import { PhoenixLightLitElement } from '@phoenixRoot/core/phoenix_light_lit_element/phoenix_light_lit_element';
|
|
4
|
+
import { property } from 'lit/decorators';
|
|
5
|
+
import { html } from 'lit/development';
|
|
6
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
7
|
+
let HSearchResults = class HSearchResults extends PhoenixLightLitElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.results = {};
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
return html ` ${repeat(Object.keys(this.results), (key) => key, (key) => html ` ${this.results[key]} `)}`;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
property({ type: Object, attribute: 'result-data' }),
|
|
18
|
+
__metadata("design:type", Object)
|
|
19
|
+
], HSearchResults.prototype, "results", void 0);
|
|
20
|
+
HSearchResults = __decorate([
|
|
21
|
+
phoenixCustomElement('h-search-results')
|
|
22
|
+
], HSearchResults);
|
|
23
|
+
export { HSearchResults };
|
|
24
|
+
//# sourceMappingURL=search_results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search_results.js","sourceRoot":"","sources":["../../../../../../../src/components/search/search_results.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,sBAAsB;IAA1D;;QAEI,YAAO,GAAqB,EAAE,CAAC;IASnC,CAAC;IAPU,MAAM;QACT,OAAO,IAAI,CAAA,IAAI,MAAM,CACjB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EACzB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EACZ,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAA,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CACxC,EAAE,CAAC;IACR,CAAC;CACJ,CAAA;AATG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;;+CACtB;AAFtB,cAAc;IAD1B,oBAAoB,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CAW1B;SAXY,cAAc"}
|
package/build/esm/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactiveController } from 'lit';
|
|
2
|
+
export declare class InputMaskController implements ReactiveController {
|
|
3
|
+
#private;
|
|
4
|
+
constructor({ host, input, mask, pattern, validPattern }: any);
|
|
5
|
+
hostConnected(): void;
|
|
6
|
+
hostDisconnected(): void;
|
|
7
|
+
enable: () => void;
|
|
8
|
+
disable: () => void;
|
|
9
|
+
private _setCursorPosition;
|
|
10
|
+
private _getCursorPosition;
|
|
11
|
+
private _uniqueArr;
|
|
12
|
+
private _setInitialMaskWhenEmpty;
|
|
13
|
+
private _setCursorOnStartWhenEmpty;
|
|
14
|
+
private _setEmptyValueForNoValue;
|
|
15
|
+
private _onKeyDown;
|
|
16
|
+
private _onInput;
|
|
17
|
+
private _onKeyUp;
|
|
18
|
+
private _onPaste;
|
|
19
|
+
private _getInput;
|
|
20
|
+
private _areKeysCombined;
|
|
21
|
+
private _insertCharAt;
|
|
22
|
+
private _replaceCharAt;
|
|
23
|
+
private _skipCharactersBy;
|
|
24
|
+
private _isValidPattern;
|
|
25
|
+
}
|
package/build/esm/packages/phoenix/src/controllers/input_mask_controller/input_mask_controller.js
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import 'lit';
|
|
3
|
+
import 'lit/directives/ref';
|
|
4
|
+
|
|
5
|
+
var _InputMaskController_host, _InputMaskController_input, _InputMaskController_mask, _InputMaskController_pattern, _InputMaskController_validPattern, _InputMaskController_skipCharacters, _InputMaskController_skipKeys, _InputMaskController_patternRegexp, _InputMaskController_patternCheck, _InputMaskController_keydownValue, _InputMaskController_isFirstPosition, _InputMaskController_isLastPosition, _InputMaskController_isEnabled;
|
|
6
|
+
const MASK_CHARACTER = '_';
|
|
7
|
+
class InputMaskController {
|
|
8
|
+
constructor({ host, input, mask, pattern, validPattern }) {
|
|
9
|
+
_InputMaskController_host.set(this, void 0);
|
|
10
|
+
_InputMaskController_input.set(this, void 0);
|
|
11
|
+
_InputMaskController_mask.set(this, void 0);
|
|
12
|
+
_InputMaskController_pattern.set(this, void 0);
|
|
13
|
+
_InputMaskController_validPattern.set(this, void 0);
|
|
14
|
+
_InputMaskController_skipCharacters.set(this, []);
|
|
15
|
+
_InputMaskController_skipKeys.set(this, [
|
|
16
|
+
'Backspace',
|
|
17
|
+
'Enter',
|
|
18
|
+
'Escape',
|
|
19
|
+
'ArrowLeft',
|
|
20
|
+
'ArrowUp',
|
|
21
|
+
'ArrowRight',
|
|
22
|
+
'ArrowDown',
|
|
23
|
+
'Delete',
|
|
24
|
+
'CapsLock',
|
|
25
|
+
'Shift',
|
|
26
|
+
'Control',
|
|
27
|
+
'Alt',
|
|
28
|
+
'AltGraph',
|
|
29
|
+
'Tab'
|
|
30
|
+
]);
|
|
31
|
+
_InputMaskController_patternRegexp.set(this, void 0);
|
|
32
|
+
_InputMaskController_patternCheck.set(this, false);
|
|
33
|
+
_InputMaskController_keydownValue.set(this, '');
|
|
34
|
+
_InputMaskController_isFirstPosition.set(this, false);
|
|
35
|
+
_InputMaskController_isLastPosition.set(this, false);
|
|
36
|
+
_InputMaskController_isEnabled.set(this, false);
|
|
37
|
+
this.enable = () => {
|
|
38
|
+
if (!__classPrivateFieldGet(this, _InputMaskController_isEnabled, "f")) {
|
|
39
|
+
const $input = this._getInput();
|
|
40
|
+
$input.setAttribute('autocomplete', 'off');
|
|
41
|
+
$input.addEventListener('mousedown', this._setInitialMaskWhenEmpty);
|
|
42
|
+
$input.addEventListener('mouseup', this._setCursorOnStartWhenEmpty);
|
|
43
|
+
$input.addEventListener('blur', this._setEmptyValueForNoValue);
|
|
44
|
+
$input.addEventListener('focus', this._setInitialMaskWhenEmpty);
|
|
45
|
+
$input.addEventListener('keydown', this._onKeyDown);
|
|
46
|
+
$input.addEventListener('input', this._onInput);
|
|
47
|
+
$input.addEventListener('keyup', this._onKeyUp);
|
|
48
|
+
$input.addEventListener('paste', this._onPaste);
|
|
49
|
+
$input.addEventListener('change', () => { });
|
|
50
|
+
$input.value = '';
|
|
51
|
+
__classPrivateFieldSet(this, _InputMaskController_isEnabled, true, "f");
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
this.disable = () => {
|
|
55
|
+
if (__classPrivateFieldGet(this, _InputMaskController_isEnabled, "f")) {
|
|
56
|
+
const $input = this._getInput();
|
|
57
|
+
$input.setAttribute('autocomplete', 'on');
|
|
58
|
+
$input.removeEventListener('mousedown', this._setInitialMaskWhenEmpty);
|
|
59
|
+
$input.removeEventListener('mouseup', this._setCursorOnStartWhenEmpty);
|
|
60
|
+
$input.removeEventListener('blur', this._setEmptyValueForNoValue);
|
|
61
|
+
$input.removeEventListener('focus', this._setInitialMaskWhenEmpty);
|
|
62
|
+
$input.removeEventListener('keydown', this._onKeyDown);
|
|
63
|
+
$input.removeEventListener('input', this._onInput);
|
|
64
|
+
$input.removeEventListener('keyup', this._onKeyUp);
|
|
65
|
+
$input.removeEventListener('paste', this._onPaste);
|
|
66
|
+
$input.removeEventListener('change', () => { });
|
|
67
|
+
__classPrivateFieldSet(this, _InputMaskController_isEnabled, false, "f");
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
this._setInitialMaskWhenEmpty = (ev) => {
|
|
71
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
72
|
+
const $input = ev.target;
|
|
73
|
+
if (!$input.value) {
|
|
74
|
+
$input.value = __classPrivateFieldGet(this, _InputMaskController_mask, "f");
|
|
75
|
+
this._setCursorPosition();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
this._setCursorOnStartWhenEmpty = (ev) => {
|
|
80
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
81
|
+
const $input = ev.target;
|
|
82
|
+
if ($input.value === __classPrivateFieldGet(this, _InputMaskController_mask, "f")) {
|
|
83
|
+
this._setCursorPosition();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
this._setEmptyValueForNoValue = (ev) => {
|
|
88
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
89
|
+
const $input = ev.target;
|
|
90
|
+
if ($input.value === __classPrivateFieldGet(this, _InputMaskController_mask, "f")) {
|
|
91
|
+
$input.value = '';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
this._onKeyDown = (ev) => {
|
|
96
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
97
|
+
const $input = ev.target;
|
|
98
|
+
const value = $input.value;
|
|
99
|
+
let currentPosition = this._getCursorPosition();
|
|
100
|
+
/**
|
|
101
|
+
*selection more than one character was made
|
|
102
|
+
*/
|
|
103
|
+
if (currentPosition[0] !== currentPosition[1]) {
|
|
104
|
+
if (ev.key === 'Backspace' || ev.key === 'Delete' || ev.keyCode === 8 || ev.keyCode === 46) {
|
|
105
|
+
const startSubstring = value.substring(0, currentPosition[0]);
|
|
106
|
+
const middleSubstring = value.substring(currentPosition[0], currentPosition[1]);
|
|
107
|
+
const endSubstring = value.substring(currentPosition[1], value.length);
|
|
108
|
+
const deleteRegexp = new RegExp('[^' + __classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").join('') + ']', 'g');
|
|
109
|
+
const newValue = startSubstring + middleSubstring.replace(deleteRegexp, MASK_CHARACTER) + endSubstring;
|
|
110
|
+
$input.value = newValue;
|
|
111
|
+
__classPrivateFieldSet(this, _InputMaskController_keydownValue, newValue, "f");
|
|
112
|
+
if (ev.key === 'Backspace' || ev.keyCode === 8) {
|
|
113
|
+
this._setCursorPosition(currentPosition[0] + 2);
|
|
114
|
+
if (currentPosition[0] == 5) {
|
|
115
|
+
__classPrivateFieldSet(this, _InputMaskController_isLastPosition, true, "f");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this._setCursorPosition(currentPosition[0]);
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
else if (!this._areKeysCombined(ev) && __classPrivateFieldGet(this, _InputMaskController_skipKeys, "f").indexOf(ev.key) < 0) {
|
|
124
|
+
currentPosition = [currentPosition[0], currentPosition[0]];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Added keyCode for older browser compatibility, keyCode 8 == backspace, keyCode 46 === delete
|
|
129
|
+
*/
|
|
130
|
+
if (ev.key === 'Backspace' || ev.key === 'Delete' || ev.keyCode === 8 || ev.keyCode === 46) {
|
|
131
|
+
if (ev.key === 'Backspace' || ev.keyCode === 8) {
|
|
132
|
+
if (__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[currentPosition[0] - 1]) >= 0) {
|
|
133
|
+
// skip special characters that are part of the mask
|
|
134
|
+
__classPrivateFieldSet(this, _InputMaskController_keydownValue, $input.value, "f");
|
|
135
|
+
this._setCursorPosition(currentPosition[0] + 1);
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
if (currentPosition[0] !== 0) {
|
|
139
|
+
// do nothing if cursor is at the start of the input
|
|
140
|
+
ev.target.value = this._insertCharAt(value, MASK_CHARACTER, currentPosition[0]);
|
|
141
|
+
this._setCursorPosition(currentPosition);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (ev.key === 'Delete' || ev.keyCode === 46) {
|
|
145
|
+
if (__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[currentPosition[0]]) >= 0) {
|
|
146
|
+
// skip special characters that are part of the mask
|
|
147
|
+
__classPrivateFieldSet(this, _InputMaskController_keydownValue, $input.value, "f");
|
|
148
|
+
this._setCursorPosition(currentPosition[0] + 1);
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
if (currentPosition[0] !== value.length) {
|
|
152
|
+
ev.target.value = this._replaceCharAt(value, MASK_CHARACTER, currentPosition[0]);
|
|
153
|
+
__classPrivateFieldSet(this, _InputMaskController_keydownValue, $input.value, "f");
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
this._setCursorPosition(currentPosition.map(function (position) {
|
|
156
|
+
return (position += 1);
|
|
157
|
+
}));
|
|
158
|
+
});
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
if (__classPrivateFieldGet(this, _InputMaskController_skipKeys, "f").indexOf(ev.key) >= 0 || this._areKeysCombined(ev)) {
|
|
165
|
+
// no special behaviour for selected keys
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
currentPosition[1] += 1;
|
|
169
|
+
if (window.navigator.userAgent.indexOf('Edge/') > -1) {
|
|
170
|
+
ev.target.value = this._replaceCharAt(ev.target.value, ev.key, currentPosition[0]);
|
|
171
|
+
}
|
|
172
|
+
this._setCursorPosition(currentPosition);
|
|
173
|
+
__classPrivateFieldSet(this, _InputMaskController_keydownValue, value, "f");
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
this._onInput = (ev) => {
|
|
177
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
178
|
+
const $input = ev.target;
|
|
179
|
+
const value = $input.value;
|
|
180
|
+
const currentPosition = this._getCursorPosition();
|
|
181
|
+
const skipBy = this._skipCharactersBy.call(this, value, currentPosition[0], 0);
|
|
182
|
+
if (skipBy > 0 && value.length !== currentPosition[0] + skipBy) {
|
|
183
|
+
this._setCursorPosition(currentPosition.map((position) => {
|
|
184
|
+
return position + skipBy;
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
if (!this._isValidPattern(value)) {
|
|
188
|
+
const currentPosition = this._getCursorPosition();
|
|
189
|
+
$input.value = __classPrivateFieldGet(this, _InputMaskController_keydownValue, "f");
|
|
190
|
+
if (__classPrivateFieldGet(this, _InputMaskController_isLastPosition, "f") || __classPrivateFieldGet(this, _InputMaskController_isFirstPosition, "f")) {
|
|
191
|
+
this._setCursorPosition(currentPosition[0]);
|
|
192
|
+
__classPrivateFieldSet(this, _InputMaskController_isLastPosition, false, "f");
|
|
193
|
+
__classPrivateFieldSet(this, _InputMaskController_isFirstPosition, false, "f");
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this._setCursorPosition(currentPosition[0] - 1);
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
if (__classPrivateFieldGet(this, _InputMaskController_mask, "f").length !== value.length) {
|
|
201
|
+
$input.value = value.slice(0, __classPrivateFieldGet(this, _InputMaskController_mask, "f").length);
|
|
202
|
+
const lastMaskCharacterPos = value.indexOf(MASK_CHARACTER);
|
|
203
|
+
if (lastMaskCharacterPos >= 0) {
|
|
204
|
+
this._setCursorPosition(lastMaskCharacterPos);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
this._onKeyUp = (ev) => {
|
|
210
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
211
|
+
const $input = ev.target;
|
|
212
|
+
const value = $input.value;
|
|
213
|
+
const currentPosition = this._getCursorPosition();
|
|
214
|
+
let skipBy;
|
|
215
|
+
if (ev.key === 'Backspace' || ev.keyCode === 8) {
|
|
216
|
+
skipBy = this._skipCharactersBy(value, currentPosition[0] - 1, 0, true);
|
|
217
|
+
if (skipBy > 0) {
|
|
218
|
+
this._setCursorPosition(currentPosition.map((position) => {
|
|
219
|
+
return position - skipBy;
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
if (ev.key === 'Delete' || ev.keyCode === 46) {
|
|
225
|
+
skipBy = this._skipCharactersBy(value, currentPosition[0], 0);
|
|
226
|
+
if (skipBy > 0) {
|
|
227
|
+
this._setCursorPosition(currentPosition.map((position) => {
|
|
228
|
+
return position + skipBy;
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
if (__classPrivateFieldGet(this, _InputMaskController_skipKeys, "f").indexOf(ev.key) >= 0 || this._areKeysCombined(ev)) {
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
if (!value) {
|
|
237
|
+
$input.value = __classPrivateFieldGet(this, _InputMaskController_mask, "f");
|
|
238
|
+
this._setCursorPosition();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
this._onPaste = (ev) => {
|
|
243
|
+
var _a;
|
|
244
|
+
if (ev.target instanceof HTMLInputElement) {
|
|
245
|
+
const $input = ev.target;
|
|
246
|
+
const value = $input.value;
|
|
247
|
+
const valueLength = value.length;
|
|
248
|
+
const pastedValue = (_a = ev.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('Text');
|
|
249
|
+
const currentPosition = this._getCursorPosition();
|
|
250
|
+
let newValue = '';
|
|
251
|
+
ev.preventDefault();
|
|
252
|
+
for (let i = 0, j = 0; i < valueLength; i += 1) {
|
|
253
|
+
if (i >= currentPosition[0] && pastedValue[j] && __classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[i]) < 0) {
|
|
254
|
+
if (__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(pastedValue[j]) < 0) {
|
|
255
|
+
newValue = newValue + pastedValue[j];
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
i -= 1;
|
|
259
|
+
}
|
|
260
|
+
j += 1;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
newValue = newValue + value[i];
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (this._isValidPattern(newValue)) {
|
|
267
|
+
ev.target.value = newValue;
|
|
268
|
+
this._setCursorPosition($input.value.indexOf(MASK_CHARACTER));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
__classPrivateFieldSet(this, _InputMaskController_host, host, "f");
|
|
273
|
+
__classPrivateFieldSet(this, _InputMaskController_input, input, "f");
|
|
274
|
+
__classPrivateFieldSet(this, _InputMaskController_mask, mask, "f");
|
|
275
|
+
__classPrivateFieldSet(this, _InputMaskController_pattern, pattern, "f");
|
|
276
|
+
__classPrivateFieldSet(this, _InputMaskController_validPattern, validPattern, "f");
|
|
277
|
+
if (pattern) {
|
|
278
|
+
__classPrivateFieldSet(this, _InputMaskController_patternRegexp, new RegExp(__classPrivateFieldGet(this, _InputMaskController_pattern, "f"), 'g'), "f");
|
|
279
|
+
__classPrivateFieldSet(this, _InputMaskController_patternCheck, true, "f");
|
|
280
|
+
}
|
|
281
|
+
__classPrivateFieldGet(this, _InputMaskController_host, "f").addController(this);
|
|
282
|
+
}
|
|
283
|
+
hostConnected() {
|
|
284
|
+
const maskRegexp = new RegExp(MASK_CHARACTER, 'g');
|
|
285
|
+
__classPrivateFieldSet(this, _InputMaskController_skipCharacters, this._uniqueArr(__classPrivateFieldGet(this, _InputMaskController_mask, "f").replace(maskRegexp, '').split('')), "f");
|
|
286
|
+
}
|
|
287
|
+
hostDisconnected() {
|
|
288
|
+
// this.#basePropsObservable?.unsubscribe(this.#propsObserver);
|
|
289
|
+
}
|
|
290
|
+
_setCursorPosition(positionStart = 0, positionEnd = positionStart) {
|
|
291
|
+
const $input = this._getInput();
|
|
292
|
+
if (typeof positionStart !== 'number') {
|
|
293
|
+
$input.selectionStart = positionStart[0];
|
|
294
|
+
$input.selectionEnd = positionEnd[1];
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
$input.selectionStart = positionStart;
|
|
298
|
+
if (typeof positionEnd === 'number')
|
|
299
|
+
$input.selectionEnd = positionEnd;
|
|
300
|
+
}
|
|
301
|
+
_getCursorPosition() {
|
|
302
|
+
var _a, _b;
|
|
303
|
+
const $input = this._getInput();
|
|
304
|
+
return [(_a = $input.selectionStart) !== null && _a !== void 0 ? _a : 0, (_b = $input.selectionEnd) !== null && _b !== void 0 ? _b : 0];
|
|
305
|
+
}
|
|
306
|
+
_uniqueArr(arr) {
|
|
307
|
+
const uniqueArr = [];
|
|
308
|
+
const arrLength = arr.length;
|
|
309
|
+
for (let i = 0; i < arrLength; i++) {
|
|
310
|
+
if (uniqueArr.indexOf(arr[i]) === -1 && arr[i] !== '') {
|
|
311
|
+
uniqueArr.push(arr[i]);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return uniqueArr;
|
|
315
|
+
}
|
|
316
|
+
_getInput() {
|
|
317
|
+
if (!__classPrivateFieldGet(this, _InputMaskController_input, "f").value) {
|
|
318
|
+
throw new Error('Input element is not defined');
|
|
319
|
+
}
|
|
320
|
+
return __classPrivateFieldGet(this, _InputMaskController_input, "f").value;
|
|
321
|
+
}
|
|
322
|
+
_areKeysCombined(ev) {
|
|
323
|
+
return ev.altKey || ev.ctrlKey || ev.metaKey;
|
|
324
|
+
}
|
|
325
|
+
_insertCharAt(string, char, position) {
|
|
326
|
+
return string.slice(0, position) + char + string.slice(position);
|
|
327
|
+
}
|
|
328
|
+
_replaceCharAt(string, char, position) {
|
|
329
|
+
return string.substr(0, position) + char + string.substr(position + 1);
|
|
330
|
+
}
|
|
331
|
+
_skipCharactersBy(value, position, skipBy, backward) {
|
|
332
|
+
backward = backward ? backward : false;
|
|
333
|
+
if (__classPrivateFieldGet(this, _InputMaskController_skipCharacters, "f").indexOf(value[position]) >= 0) {
|
|
334
|
+
if (backward) {
|
|
335
|
+
position -= 1;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
position += 1;
|
|
339
|
+
}
|
|
340
|
+
skipBy += 1;
|
|
341
|
+
return this._skipCharactersBy.call(this, value, position, skipBy, backward);
|
|
342
|
+
}
|
|
343
|
+
return skipBy;
|
|
344
|
+
}
|
|
345
|
+
_isValidPattern(value) {
|
|
346
|
+
if (__classPrivateFieldGet(this, _InputMaskController_patternCheck, "f")) {
|
|
347
|
+
const valueLength = value.length;
|
|
348
|
+
let partialValue = '';
|
|
349
|
+
for (let i = 0; i < valueLength; i += 1) {
|
|
350
|
+
partialValue += value[i] !== '_' ? value[i] : __classPrivateFieldGet(this, _InputMaskController_validPattern, "f")[i];
|
|
351
|
+
}
|
|
352
|
+
return partialValue.match(__classPrivateFieldGet(this, _InputMaskController_patternRegexp, "f")) !== null;
|
|
353
|
+
}
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
_InputMaskController_host = new WeakMap(), _InputMaskController_input = new WeakMap(), _InputMaskController_mask = new WeakMap(), _InputMaskController_pattern = new WeakMap(), _InputMaskController_validPattern = new WeakMap(), _InputMaskController_skipCharacters = new WeakMap(), _InputMaskController_skipKeys = new WeakMap(), _InputMaskController_patternRegexp = new WeakMap(), _InputMaskController_patternCheck = new WeakMap(), _InputMaskController_keydownValue = new WeakMap(), _InputMaskController_isFirstPosition = new WeakMap(), _InputMaskController_isLastPosition = new WeakMap(), _InputMaskController_isEnabled = new WeakMap();
|
|
358
|
+
|
|
359
|
+
export { InputMaskController };
|
|
360
|
+
//# sourceMappingURL=input_mask_controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|