@nys-cui/cui-formpill 0.2.3 → 0.2.5
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 +1 -1
- package/src/cui-formpill.js +32 -3
package/package.json
CHANGED
package/src/cui-formpill.js
CHANGED
@@ -147,6 +147,15 @@ class CUI_FORMPILL_PILL extends HTMLElement {
|
|
147
147
|
|
148
148
|
}
|
149
149
|
|
150
|
+
disconnectedCallback() {
|
151
|
+
|
152
|
+
for (let dPopover of document.body.querySelectorAll('cui-formpill-popover')) {
|
153
|
+
if (dPopover.state.dFor === this) {
|
154
|
+
document.body.removeChild(dPopover);
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
150
159
|
|
151
160
|
}
|
152
161
|
|
@@ -296,6 +305,15 @@ class CUI_FORMPILL extends HTMLElement {
|
|
296
305
|
|
297
306
|
}
|
298
307
|
|
308
|
+
if (this._state.dMenuPopover) {
|
309
|
+
this._state.dMenuPopover.state.bOpen = false;
|
310
|
+
document.body.removeChild(this._state.dMenuPopover)
|
311
|
+
this._state.dMenuPopover = null;
|
312
|
+
document.body.removeEventListener('click', this.fGlobalBodyClick);
|
313
|
+
this._state.bMenuDisplayed = false;
|
314
|
+
}
|
315
|
+
|
316
|
+
|
299
317
|
this.render(true);
|
300
318
|
}
|
301
319
|
get label() {
|
@@ -820,11 +838,22 @@ class CUI_FORMPILL extends HTMLElement {
|
|
820
838
|
this.dValueField = document.createElement('cui-listbox');
|
821
839
|
this.dValueField.setState({ 'items': controls.value.options, 'label': `${(controls.fieldLabel) ? controls.fieldLabel : 'Value'}` });
|
822
840
|
|
841
|
+
|
842
|
+
if (controls.value.multiple) {
|
843
|
+
this.dValueField.setAttribute('multiple', true)
|
844
|
+
}
|
845
|
+
if (controls.value.codedesc) {
|
846
|
+
this.dValueField.setAttribute('codedesc', true)
|
847
|
+
}
|
848
|
+
if (controls.value.search) {
|
849
|
+
this.dValueField.setAttribute('search', true)
|
850
|
+
}
|
851
|
+
|
823
852
|
if (pill._state.sValue2.indexOf(',') == -1) {
|
824
853
|
this.dValueField.setAttribute('value', pill._state.sValue2)
|
825
854
|
}
|
826
855
|
else {
|
827
|
-
|
856
|
+
|
828
857
|
let aValues = pill._state.sValue2.split(',');
|
829
858
|
this.dValueField.setAttribute('value', aValues)
|
830
859
|
}
|
@@ -921,7 +950,7 @@ class CUI_FORMPILL extends HTMLElement {
|
|
921
950
|
this.field = document.createElement('cui-date');
|
922
951
|
}
|
923
952
|
|
924
|
-
if(controls.value.control[i].validation){
|
953
|
+
if (controls.value.control[i].validation) {
|
925
954
|
this.field.setAttribute('validation', controls.value.control[i].validation)
|
926
955
|
}
|
927
956
|
|
@@ -1269,7 +1298,7 @@ class CUI_FORMPILL extends HTMLElement {
|
|
1269
1298
|
|
1270
1299
|
if (this._state.dMenuPopover) {
|
1271
1300
|
this._state.dMenuPopover.state.bOpen = false;
|
1272
|
-
|
1301
|
+
document.body.removeChild(this._state.dMenuPopover)
|
1273
1302
|
this._state.dMenuPopover = null;
|
1274
1303
|
}
|
1275
1304
|
|