bromcom-ui 2.4.34 → 2.4.37

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.
Files changed (65) hide show
  1. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  2. package/dist/bromcom-ui/{p-055022f2.entry.js → p-0a24018a.entry.js} +1 -1
  3. package/dist/bromcom-ui/p-0f32662d.js +1 -0
  4. package/dist/bromcom-ui/p-20d1fe2f.js +1 -0
  5. package/dist/bromcom-ui/{p-34a197df.js → p-3ccd76e6.js} +1 -1
  6. package/dist/bromcom-ui/{p-6c00e018.entry.js → p-5ebc9d83.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-e71116e9.entry.js → p-8d11a373.entry.js} +1 -1
  8. package/dist/bromcom-ui/p-a36f3cae.entry.js +1 -0
  9. package/dist/bromcom-ui/p-a437dce1.entry.js +1 -0
  10. package/dist/bromcom-ui/{p-677fc81c.entry.js → p-bbd684a5.entry.js} +1 -1
  11. package/dist/bromcom-ui/p-bd5c8891.entry.js +1 -0
  12. package/dist/bromcom-ui/{p-971c4e35.entry.js → p-c91af148.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-afc38f38.entry.js → p-ca7337d8.entry.js} +1 -1
  14. package/dist/cjs/bcm-button_12.cjs.entry.js +37 -26
  15. package/dist/cjs/bcm-icon-2_2.cjs.entry.js +2 -2
  16. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +10 -2
  17. package/dist/cjs/bcm-popconfirm.cjs.entry.js +1 -1
  18. package/dist/cjs/bcm-popover-box.cjs.entry.js +2 -2
  19. package/dist/cjs/bcm-popover.cjs.entry.js +1 -1
  20. package/dist/cjs/bcm-select.cjs.entry.js +1 -1
  21. package/dist/cjs/bcm-stepper.cjs.entry.js +3 -3
  22. package/dist/cjs/bcm-tag-2.cjs.entry.js +1 -1
  23. package/dist/cjs/bromcom-ui.cjs.js +1 -1
  24. package/dist/cjs/{generate-acd42354.js → generate-56162a07.js} +1 -1
  25. package/dist/cjs/{json-parse-decarator-89653e78.js → json-parse-decarator-c4de75ac.js} +15 -2
  26. package/dist/cjs/loader.cjs.js +1 -1
  27. package/dist/cjs/{stepper-states-82ab195a.js → stepper-states-83349125.js} +1 -1
  28. package/dist/collection/components/atoms/text/text.js +21 -1
  29. package/dist/collection/components/molecules/popconfirm/popconfirm-box.css +1 -1
  30. package/dist/collection/components/molecules/popconfirm/popconfirm-box.js +28 -0
  31. package/dist/collection/components/molecules/popover/popover-box.css +1 -1
  32. package/dist/collection/components/molecules/select/select.js +1 -1
  33. package/dist/collection/components/molecules/tooltip/tooltip-box.css +1 -1
  34. package/dist/collection/components/organism/form/form.js +20 -1
  35. package/dist/collection/components/organism/list/list.js +27 -22
  36. package/dist/collection/decorators/json-parse-decarator.js +15 -2
  37. package/dist/collection/templates/input-template.js +5 -2
  38. package/dist/esm/bcm-button_12.entry.js +37 -26
  39. package/dist/esm/bcm-icon-2_2.entry.js +2 -2
  40. package/dist/esm/bcm-popconfirm-box.entry.js +10 -2
  41. package/dist/esm/bcm-popconfirm.entry.js +1 -1
  42. package/dist/esm/bcm-popover-box.entry.js +2 -2
  43. package/dist/esm/bcm-popover.entry.js +1 -1
  44. package/dist/esm/bcm-select.entry.js +1 -1
  45. package/dist/esm/bcm-stepper.entry.js +3 -3
  46. package/dist/esm/bcm-tag-2.entry.js +1 -1
  47. package/dist/esm/bromcom-ui.js +1 -1
  48. package/dist/esm/{generate-a10528eb.js → generate-34fc2887.js} +1 -1
  49. package/dist/esm/json-parse-decarator-c6372800.js +34 -0
  50. package/dist/esm/loader.js +1 -1
  51. package/dist/esm/{stepper-states-2ae7dca5.js → stepper-states-ca00e945.js} +1 -1
  52. package/dist/types/components/atoms/text/text.d.ts +3 -1
  53. package/dist/types/components/molecules/popconfirm/popconfirm-box.d.ts +2 -0
  54. package/dist/types/components/organism/form/form.d.ts +1 -0
  55. package/dist/types/components/organism/list/list.d.ts +1 -3
  56. package/dist/types/components.d.ts +5 -0
  57. package/dist/types/decorators/json-parse-decarator.d.ts +1 -1
  58. package/dist/types/templates/input-template.d.ts +1 -0
  59. package/package.json +1 -1
  60. package/dist/bromcom-ui/p-119f660a.js +0 -1
  61. package/dist/bromcom-ui/p-1550abeb.entry.js +0 -1
  62. package/dist/bromcom-ui/p-b9f40215.entry.js +0 -1
  63. package/dist/bromcom-ui/p-c11595ee.entry.js +0 -1
  64. package/dist/bromcom-ui/p-c7a6f7d8.js +0 -1
  65. package/dist/esm/json-parse-decarator-8563927a.js +0 -21
@@ -26,8 +26,15 @@ export class BcmPopconfirmBox {
26
26
  this.getPopconfirm().hide();
27
27
  this.hide();
28
28
  }
29
+ showHandler(e) {
30
+ if (e.detail != this._target_id) {
31
+ this.getPopconfirm().hide();
32
+ this.hide();
33
+ }
34
+ }
29
35
  async show() {
30
36
  this.open = true;
37
+ this.onShow.emit(this._target_id);
31
38
  }
32
39
  async hide() {
33
40
  this.open = false;
@@ -300,6 +307,21 @@ export class BcmPopconfirmBox {
300
307
  "resolved": "any",
301
308
  "references": {}
302
309
  }
310
+ }, {
311
+ "method": "onShow",
312
+ "name": "bcm-popconfirm-show",
313
+ "bubbles": true,
314
+ "cancelable": true,
315
+ "composed": true,
316
+ "docs": {
317
+ "tags": [],
318
+ "text": ""
319
+ },
320
+ "complexType": {
321
+ "original": "any",
322
+ "resolved": "any",
323
+ "references": {}
324
+ }
303
325
  }]; }
304
326
  static get methods() { return {
305
327
  "show": {
@@ -342,6 +364,12 @@ export class BcmPopconfirmBox {
342
364
  "target": "window",
343
365
  "capture": false,
344
366
  "passive": false
367
+ }, {
368
+ "name": "bcm-popconfirm-show",
369
+ "method": "showHandler",
370
+ "target": "document",
371
+ "capture": false,
372
+ "passive": false
345
373
  }, {
346
374
  "name": "resize",
347
375
  "method": "calculateLocation",
@@ -18514,7 +18514,7 @@
18514
18514
  box = box
18515
18515
  after = arrow
18516
18516
  */
18517
- position: absolute;
18517
+ position: fixed;
18518
18518
  transition: transform 0.2s ease-in-out;
18519
18519
  /*
18520
18520
  PLACEMENTS
@@ -447,7 +447,7 @@ export class BcmSelect {
447
447
  this.change.emit(newVal);
448
448
  }
449
449
  else {
450
- if (newVal[this.objectMapping['id']] && oldVal[this.objectMapping['id']]) {
450
+ if (newVal && newVal[this.objectMapping['id']] && oldVal && oldVal[this.objectMapping['id']]) {
451
451
  if (newVal[this.objectMapping['id']] != oldVal[this.objectMapping['id']]) {
452
452
  this.change.emit(newVal);
453
453
  }
@@ -18516,7 +18516,7 @@
18516
18516
  box = box
18517
18517
  after = arrow
18518
18518
  */
18519
- position: absolute;
18519
+ position: fixed;
18520
18520
  transition: transform 0.2s ease-in-out;
18521
18521
  /*
18522
18522
  PLACEMENTS
@@ -53,6 +53,7 @@ export class BcmForm {
53
53
  this.hidden = false;
54
54
  this.validation = false;
55
55
  this.name = "";
56
+ this.autocomplete = false;
56
57
  }
57
58
  handleSubmit(e) {
58
59
  if (lowercase(e.target.nodeName) === 'bcm-button') {
@@ -316,7 +317,7 @@ export class BcmForm {
316
317
  render() {
317
318
  const hostClasses = cs(this.hidden ? 'hidden' : null);
318
319
  return (h(Host, { class: hostClasses },
319
- h("form", { class: "bcm-form" },
320
+ h("form", { class: "bcm-form", autocomplete: this.autocomplete ? "on" : "off" },
320
321
  h("slot", null))));
321
322
  }
322
323
  static get is() { return "bcm-form"; }
@@ -416,6 +417,24 @@ export class BcmForm {
416
417
  },
417
418
  "attribute": "value",
418
419
  "reflect": false
420
+ },
421
+ "autocomplete": {
422
+ "type": "boolean",
423
+ "mutable": false,
424
+ "complexType": {
425
+ "original": "boolean",
426
+ "resolved": "boolean",
427
+ "references": {}
428
+ },
429
+ "required": false,
430
+ "optional": false,
431
+ "docs": {
432
+ "tags": [],
433
+ "text": ""
434
+ },
435
+ "attribute": "autocomplete",
436
+ "reflect": false,
437
+ "defaultValue": "false"
419
438
  }
420
439
  }; }
421
440
  static get events() { return [{
@@ -67,8 +67,6 @@ export class BcmList {
67
67
  this.searchFound = null;
68
68
  this.returnFilterData = {};
69
69
  this.returnOtherData = {};
70
- this.isLoadingInput = true;
71
- this.isLoadingList = true;
72
70
  this.options = {
73
71
  rootMargin: '30px'
74
72
  };
@@ -191,16 +189,17 @@ export class BcmList {
191
189
  }
192
190
  }
193
191
  handleResize() {
194
- this.isLoadingInput = true;
195
192
  this.calculateLocation();
196
193
  this.debounceHandler();
197
194
  }
198
- //mouse wheel event
199
- handleWheel() {
195
+ handleWheel(event) {
200
196
  if (this.isOpen) {
201
- if (this.type == 'select' || this.type == 'autocomplete' || this.linkedComponent) {
202
- this.calculateLocation();
203
- this.debounceHandler();
197
+ const list = document.querySelector(`#bcm-list-${this._id}`);
198
+ const isClickInside = list && (Generate.findEventPath(event, list));
199
+ if (isClickInside) {
200
+ if (this.type == 'select' || this.type == 'autocomplete' || this.linkedComponent) {
201
+ this.calculateLocation();
202
+ }
204
203
  }
205
204
  }
206
205
  }
@@ -396,7 +395,6 @@ export class BcmList {
396
395
  return false;
397
396
  }
398
397
  async setClear(e) {
399
- // this.isLoadingInput = true
400
398
  listState.setClear(this._id);
401
399
  this.value = null;
402
400
  this.inputText = '';
@@ -434,14 +432,15 @@ export class BcmList {
434
432
  this.selectAllItem = Object.assign(Object.assign({}, this.selectAllItem), { indeterminate: this.checkboxes && checkeds > 0 ? checkeds === total ? 'check' : 'indeterminate' : 'uncheck', checked: this.checkboxes && checkeds > 0 ? checkeds === total ? true : false : false });
435
433
  }
436
434
  listenResize() {
437
- this.isLoadingInput = true;
438
435
  this.tagControl();
439
436
  this.calculateLocation();
437
+ this.markForCheck();
440
438
  }
441
439
  async unSelectOther() {
442
440
  await this.onClearSearch();
443
441
  this.isSelectedOther = false;
444
442
  this.returnFilterData = {};
443
+ listState.filterData(this._id, null);
445
444
  // this.isOpen = false
446
445
  }
447
446
  async onClearSearch() {
@@ -478,7 +477,6 @@ export class BcmList {
478
477
  }
479
478
  async initState() {
480
479
  var _a, _b, _c;
481
- this.isLoadingInput = true;
482
480
  await listState.setValue({
483
481
  id: this._id,
484
482
  dataSource: this.data && snq(() => typeof this.data == 'string' ? JSON.parse(this.data) : this.data, []),
@@ -490,12 +488,10 @@ export class BcmList {
490
488
  this.value = this.checkboxes ? (await this.getCheckedList()).checkedList : listState.selectedItem(this._id) ? listState.selectedItem(this._id)[0] : null;
491
489
  // value && value.length > 0 && (this.value = value)
492
490
  if (this.checkboxes) {
493
- await delay(100);
494
491
  this.tagControl();
495
492
  }
496
493
  else {
497
494
  this.inputText = ((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
498
- this.isLoadingInput = false;
499
495
  }
500
496
  const checkedIDs = [];
501
497
  ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 0 && this.value.forEach(item => {
@@ -631,13 +627,19 @@ export class BcmList {
631
627
  list.style.width = targetElement.offsetWidth + "px";
632
628
  }
633
629
  if (this.height.indexOf('%') > -1) {
634
- list.style.height = NumberHelper.toNumber(this.height.replace('%', '')) * 0.01 * window.innerHeight - pos[0] - 50 + "px";
630
+ list.style.height = NumberHelper.toNumber(this.height) * 0.01 * window.innerHeight - pos[0] - 50 + "px";
635
631
  }
636
632
  else {
637
633
  list.style.height = this.height;
638
634
  }
639
- list.style.minHeight = "156px";
640
- list.style.maxHeight = window.innerHeight - pos[0] - 50 + 'px';
635
+ list.style.minHeight = this.minHeight;
636
+ const calculatedMaxHeight = window.innerHeight - pos[0] - 50;
637
+ if (this.maxHeight.indexOf('%') > -1) {
638
+ list.style.maxHeight = NumberHelper.toNumber(this.maxHeight) * 0.01 * calculatedMaxHeight + "px";
639
+ }
640
+ else {
641
+ list.style.maxHeight = NumberHelper.toNumber(this.maxHeight) < calculatedMaxHeight ? this.maxHeight : calculatedMaxHeight + "px";
642
+ }
641
643
  }
642
644
  }
643
645
  }
@@ -677,9 +679,10 @@ export class BcmList {
677
679
  if (item.text.length > 10) {
678
680
  element.title = item.text;
679
681
  }
680
- itemsWidth += element.offsetWidth + 8;
682
+ const elementOffsetWidth = element.offsetWidth > 20 ? element.offsetWidth : 95;
683
+ itemsWidth += elementOffsetWidth + 8;
681
684
  if (itemsWidth > tagContainerWidth) {
682
- itemsWidth -= element.offsetWidth + 8;
685
+ itemsWidth -= elementOffsetWidth + 8;
683
686
  element.remove();
684
687
  throw BreakException;
685
688
  }
@@ -713,7 +716,8 @@ export class BcmList {
713
716
  otherText = `${otherTag.length} ${pluralize('item', otherTag.length)} selected`;
714
717
  otherElement = await this.createTag({ id: 'other-tag', text: otherText });
715
718
  await delay(10);
716
- if (otherElement.offsetWidth + 20 > (tagContainerWidth - itemsWidth)) {
719
+ const otherOffsetWidth = otherElement.offsetWidth > 40 ? otherElement.offsetWidth : 140;
720
+ if (otherOffsetWidth + 20 > (tagContainerWidth - itemsWidth)) {
717
721
  itemsWidth -= item.offsetWidth + 4;
718
722
  item.remove();
719
723
  await removeItems();
@@ -1569,8 +1573,6 @@ export class BcmList {
1569
1573
  "searchFound": {},
1570
1574
  "returnFilterData": {},
1571
1575
  "returnOtherData": {},
1572
- "isLoadingInput": {},
1573
- "isLoadingList": {},
1574
1576
  "options": {},
1575
1577
  "tagContainerWidth": {},
1576
1578
  "selectAllItem": {}
@@ -1814,7 +1816,7 @@ export class BcmList {
1814
1816
  }, {
1815
1817
  "name": "wheel",
1816
1818
  "method": "handleWheel",
1817
- "target": "window",
1819
+ "target": "document",
1818
1820
  "capture": false,
1819
1821
  "passive": true
1820
1822
  }, {
@@ -1864,3 +1866,6 @@ export class BcmList {
1864
1866
  __decorate([
1865
1867
  JsonParse('data')
1866
1868
  ], BcmList.prototype, "data", void 0);
1869
+ __decorate([
1870
+ JsonParse('data', true)
1871
+ ], BcmList.prototype, "dataChanged", null);
@@ -1,8 +1,8 @@
1
1
  import { getElement } from "@stencil/core";
2
2
  import snq from 'snq';
3
- export function JsonParse(attribute) {
3
+ export function JsonParse(attribute, isMethod = false) {
4
4
  return (proto, propName) => {
5
- const { connectedCallback } = proto;
5
+ const { connectedCallback, componentWillRender } = proto;
6
6
  proto.connectedCallback = function () {
7
7
  const host = getElement(this);
8
8
  if (host[propName]) {
@@ -14,5 +14,18 @@ export function JsonParse(attribute) {
14
14
  }
15
15
  return connectedCallback && connectedCallback.call(this);
16
16
  };
17
+ proto.componentWillRender = async function () {
18
+ if (isMethod) {
19
+ const host = getElement(this);
20
+ if (isMethod) {
21
+ const value = snq(() => host.hasAttribute(attribute) ? host.getAttribute(attribute).valueOf() : host[attribute].valueOf(), null);
22
+ if (value && value.length > 0 && typeof value === 'string') {
23
+ this[attribute] = snq(() => JSON.parse(value), []);
24
+ }
25
+ host.removeAttribute(attribute);
26
+ }
27
+ return componentWillRender && componentWillRender.call(this);
28
+ }
29
+ };
17
30
  };
18
31
  }
@@ -10,7 +10,7 @@ id, internalId, type, placeholder, value, size,
10
10
  //,
11
11
  unit, unitPrefix, maxLength,
12
12
  //boolean
13
- disabled, clearable, focused, readonly, isPasswordVisible, passwordToggle, noDefaultIcon, inValid, captionType, resize,
13
+ disabled, clearable, focused, readonly, isPasswordVisible, passwordToggle, noDefaultIcon, inValid, captionType, resize, autocomplete,
14
14
  // custom functions
15
15
  changePasswordVisibility, handleClear, steps,
16
16
  //event functions
@@ -49,7 +49,10 @@ ref, handleBlur, handleFocus, handleInput, handleChange }) => {
49
49
  h("span", { class: "input-prefix" },
50
50
  h("slot", { name: "prefix" }),
51
51
  unitPrefix && h("span", { class: unitClass }, unitPrefix)),
52
- h(ElementTagType, Object.assign({ tabindex: "1", id: id, "bcm-internal-id": internalId, class: 'bcm-input-element ' + inputClass }, ((ElementTagType === Bcm.HtmlElementType.input && { type: type })), ((ElementTagType === Bcm.HtmlElementType.textarea && { rows: rows })), { value: value, maxLength: maxLength, placeholder: placeholder, disabled: disabled, readOnly: readonly, ref: (el) => ref(el), onBlur: (e) => templateHandleBlur(e), onFocus: (e) => templateHandleFocus(e), onInput: (e) => handleInput(e), onChange: (e) => handleChange(e) })),
52
+ h(ElementTagType, Object.assign({ tabindex: "1", id: id, "bcm-internal-id": internalId, class: 'bcm-input-element ' + inputClass }, ((ElementTagType === Bcm.HtmlElementType.input && {
53
+ type,
54
+ autocomplete: autocomplete ? 'on' : 'off'
55
+ })), ((ElementTagType === Bcm.HtmlElementType.textarea && { rows: rows })), { value: value, maxLength: maxLength, placeholder: placeholder, disabled: disabled, readOnly: readonly, ref: (el) => ref(el), onBlur: (e) => templateHandleBlur(e), onFocus: (e) => templateHandleFocus(e), onInput: (e) => handleInput(e), onChange: (e) => handleChange(e) })),
53
56
  (clearable && !disabled) &&
54
57
  h("span", { class: "input-suffix input-suffix-button input-clear-button", onClick: (e) => handleClear(e) },
55
58
  h("bcm-icon", { icon: "close-circle", type: "fill", size: iconSizes[size], color: "grey-7" })),