wcs-core 2.9.0 → 2.12.0

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 (98) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/{popper-5777994b.js → popper-8cf375ec.js} +130 -71
  3. package/dist/cjs/wcs-accordion-content.cjs.entry.js +19 -0
  4. package/dist/cjs/wcs-accordion-header.cjs.entry.js +16 -0
  5. package/dist/cjs/wcs-accordion-panel.cjs.entry.js +31 -0
  6. package/dist/cjs/wcs-accordion.cjs.entry.js +36 -0
  7. package/dist/cjs/wcs-button.cjs.entry.js +1 -1
  8. package/dist/cjs/wcs-com-nav-category.cjs.entry.js +1 -1
  9. package/dist/cjs/wcs-com-nav-submenu.cjs.entry.js +2 -2
  10. package/dist/cjs/wcs-com-nav.cjs.entry.js +24 -2
  11. package/dist/cjs/wcs-dropdown.cjs.entry.js +4 -2
  12. package/dist/cjs/wcs-error_2.cjs.entry.js +6 -9
  13. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +1 -1
  14. package/dist/cjs/wcs-horizontal-stepper.cjs.entry.js +13 -10
  15. package/dist/cjs/wcs-mat-icon.cjs.entry.js +1 -1
  16. package/dist/cjs/wcs-modal.cjs.entry.js +6 -2
  17. package/dist/cjs/wcs-select_2.cjs.entry.js +2790 -2577
  18. package/dist/cjs/wcs-tooltip.cjs.entry.js +11 -4
  19. package/dist/cjs/wcs.cjs.js +1 -1
  20. package/dist/collection/collection-manifest.json +4 -0
  21. package/dist/collection/components/accordion/accordion.js +38 -0
  22. package/dist/collection/components/accordion-content/accordion-content.css +4 -0
  23. package/dist/collection/components/accordion-content/accordion-content.js +15 -0
  24. package/dist/collection/components/accordion-header/accordion-header.js +9 -0
  25. package/dist/collection/components/accordion-panel/accordion-panel.css +35 -0
  26. package/dist/collection/components/accordion-panel/accordion-panel.js +89 -0
  27. package/dist/collection/components/button/button.css +12 -4
  28. package/dist/collection/components/com-nav/com-nav.css +68 -10
  29. package/dist/collection/components/com-nav/com-nav.js +34 -5
  30. package/dist/collection/components/com-nav-category/com-nav-category.css +70 -45
  31. package/dist/collection/components/com-nav-submenu/com-nav-submenu.css +123 -72
  32. package/dist/collection/components/com-nav-submenu/com-nav-submenu.js +1 -1
  33. package/dist/collection/components/dropdown/dropdown.js +3 -1
  34. package/dist/collection/components/form-field/form-field.js +6 -9
  35. package/dist/collection/components/horizontal-stepper/horizontal-stepper.js +14 -11
  36. package/dist/collection/components/input/input.js +1 -1
  37. package/dist/collection/components/mat-icon/mat-icon.css +3 -1
  38. package/dist/collection/components/modal/modal.css +16 -29
  39. package/dist/collection/components/modal/modal.js +25 -4
  40. package/dist/collection/components/select/select.js +2 -0
  41. package/dist/collection/components/tooltip/tooltip.js +28 -2
  42. package/dist/esm/loader.js +1 -1
  43. package/dist/esm/{popper-5f42e560.js → popper-548df79b.js} +130 -71
  44. package/dist/esm/wcs-accordion-content.entry.js +15 -0
  45. package/dist/esm/wcs-accordion-header.entry.js +12 -0
  46. package/dist/esm/wcs-accordion-panel.entry.js +27 -0
  47. package/dist/esm/wcs-accordion.entry.js +32 -0
  48. package/dist/esm/wcs-button.entry.js +1 -1
  49. package/dist/esm/wcs-com-nav-category.entry.js +1 -1
  50. package/dist/esm/wcs-com-nav-submenu.entry.js +2 -2
  51. package/dist/esm/wcs-com-nav.entry.js +25 -3
  52. package/dist/esm/wcs-dropdown.entry.js +4 -2
  53. package/dist/esm/wcs-error_2.entry.js +6 -9
  54. package/dist/esm/wcs-galactic-menu.entry.js +1 -1
  55. package/dist/esm/wcs-horizontal-stepper.entry.js +13 -10
  56. package/dist/esm/wcs-mat-icon.entry.js +1 -1
  57. package/dist/esm/wcs-modal.entry.js +6 -2
  58. package/dist/esm/wcs-select_2.entry.js +2790 -2577
  59. package/dist/esm/wcs-tooltip.entry.js +11 -4
  60. package/dist/esm/wcs.js +1 -1
  61. package/dist/types/components/accordion/accordion.d.ts +12 -0
  62. package/dist/types/components/accordion-content/accordion-content.d.ts +3 -0
  63. package/dist/types/components/accordion-header/accordion-header.d.ts +3 -0
  64. package/dist/types/components/accordion-panel/accordion-panel.d.ts +8 -0
  65. package/dist/types/components/com-nav/com-nav.d.ts +7 -0
  66. package/dist/types/components/input/input-interface.d.ts +1 -1
  67. package/dist/types/components/modal/modal.d.ts +4 -0
  68. package/dist/types/components/tooltip/tooltip.d.ts +12 -0
  69. package/dist/types/components.d.ts +72 -0
  70. package/dist/wcs/p-055c20de.entry.js +1 -0
  71. package/dist/wcs/p-0bb5f03a.entry.js +1 -0
  72. package/dist/wcs/p-19e6600c.entry.js +15 -0
  73. package/dist/wcs/p-2507b398.entry.js +1 -0
  74. package/dist/wcs/p-4f15e5f6.entry.js +1 -0
  75. package/dist/wcs/{p-ecbe5165.entry.js → p-600d4d99.entry.js} +2 -2
  76. package/dist/wcs/{p-22813c8e.entry.js → p-66e74651.entry.js} +1 -1
  77. package/dist/wcs/p-706d195a.entry.js +1 -0
  78. package/dist/wcs/{p-4e9e226d.entry.js → p-b69840d6.entry.js} +1 -1
  79. package/dist/wcs/p-bcf381a2.entry.js +1 -0
  80. package/dist/wcs/p-c295cfca.entry.js +1 -0
  81. package/dist/wcs/p-cf77e1d9.entry.js +1 -0
  82. package/dist/wcs/p-d45c7c63.entry.js +1 -0
  83. package/dist/wcs/p-df5baf36.entry.js +1 -0
  84. package/dist/wcs/p-e4fdcd1f.js +1 -0
  85. package/dist/wcs/{p-ff6d0dfd.entry.js → p-f00ef24c.entry.js} +1 -1
  86. package/dist/wcs/p-f43213f5.entry.js +1 -0
  87. package/dist/wcs/wcs.esm.js +1 -1
  88. package/package.json +9 -5
  89. package/CHANGELOG.md +0 -269
  90. package/dist/wcs/p-08a7e84d.entry.js +0 -1
  91. package/dist/wcs/p-1f5aed36.entry.js +0 -1
  92. package/dist/wcs/p-7c26f650.entry.js +0 -1
  93. package/dist/wcs/p-8864a491.entry.js +0 -1
  94. package/dist/wcs/p-94a31f64.entry.js +0 -1
  95. package/dist/wcs/p-b5ffbea8.entry.js +0 -1
  96. package/dist/wcs/p-c7d6d3e1.entry.js +0 -15
  97. package/dist/wcs/p-d3c9a644.js +0 -1
  98. package/dist/wcs/p-db68379f.entry.js +0 -1
@@ -77,22 +77,19 @@ let FormField = class {
77
77
  this.updateLabelRequiredFlag(isRequired, label);
78
78
  }
79
79
  initSpiedElement() {
80
- var _a;
80
+ var _a, _b;
81
81
  const SUPPORTED_COMPONENTS = ['wcs-input', 'wcs-select', 'wcs-textarea', 'wcs-radio-group', 'wcs-switch', 'wcs-checkbox'];
82
- this.spiedElement = (_a = this.el.shadowRoot.querySelector('slot:not([name])')) === null || _a === void 0 ? void 0 : _a.assignedElements()[0];
82
+ this.spiedElement = (_a = this.el.shadowRoot.querySelector('slot:not([name])')) === null || _a === void 0 ? void 0 : _a.assignedElements().filter(n => [...SUPPORTED_COMPONENTS, 'SLOT'].map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0];
83
83
  // If the component is used in another web component
84
- if (this.spiedElement.tagName === 'SLOT') {
84
+ if (((_b = this.spiedElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'SLOT') {
85
85
  this.spiedElement = (this.spiedElement
86
86
  .assignedElements()
87
87
  .filter(n => SUPPORTED_COMPONENTS.map(x => x.toUpperCase()).indexOf(n.nodeName) !== -1)[0]);
88
88
  }
89
- if (!this.spiedElement)
90
- throw new Error('You must provide a slotted element in form field');
91
- if (SUPPORTED_COMPONENTS
92
- .map(x => x.toUpperCase())
93
- .indexOf(this.spiedElement.tagName) === -1) {
89
+ if (!this.spiedElement) {
94
90
  // tslint:disable-next-line:no-console
95
- console.warn('form-field component support ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component (component ' + this.spiedElement.tagName + ' not natively supported).');
91
+ console.warn('Form-field component support only ' + SUPPORTED_COMPONENTS.toString() + '. Some features may not work with the provided component.');
92
+ return;
96
93
  }
97
94
  }
98
95
  updateLabelRequiredFlag(isRequired, label) {
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-b982604a.js';
2
2
  import { a as clickInsideElement } from './helpers-e2993152.js';
3
- import { c as createPopper } from './popper-5f42e560.js';
3
+ import { c as createPopper } from './popper-548df79b.js';
4
4
 
5
5
  const galacticMenuCss = "#menu{background-color:var(--wcs-gray);color:white;display:none;padding:var(--wcs-padding)}#menu[data-show]{display:block;z-index:9999}#menu[data-popper-placement^=top]>#arrow{bottom:-4px}#menu[data-popper-placement^=bottom]>#arrow{top:-4px}#menu[data-popper-placement^=left]>#arrow{right:-4px}#menu[data-popper-placement^=right]>#arrow{left:-4px}:host{display:flex;align-items:center;height:32px;padding-left:var(--wcs-padding);background-color:var(--wcs-gray-light)}#toggle-menu-icon{cursor:pointer;padding:0 var(--wcs-padding);user-select:none}#arrow,#arrow::before{position:absolute;width:8px;height:8px;background:inherit}#arrow{visibility:hidden}#arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}";
6
6
 
@@ -41,16 +41,19 @@ let HorizontalStepper = class {
41
41
  }
42
42
  }
43
43
  onCurrentStepChange(newValue, oldValue) {
44
- const stepInterval = Math.abs(oldValue - newValue);
45
- this.el.style.setProperty('--wcs-progress-bar-animation-duration', 375 / stepInterval + 'ms');
46
- if (newValue !== oldValue) {
47
- for (let i = 0; i < stepInterval; i++) {
48
- setTimeout(() => {
49
- this.internalCurrentStep -= (oldValue - newValue) > 0 ? 1 : -1;
50
- if (i === stepInterval - 1) {
51
- this.el.style.removeProperty('--wcs-progress-bar-animation-duration');
52
- }
53
- }, (i * (375 / stepInterval)));
44
+ //Check if the function is called before the component has finished its initialization in which case we do nothing
45
+ if (this.internalCurrentStep !== undefined) {
46
+ const stepInterval = Math.abs(oldValue - newValue);
47
+ this.el.style.setProperty('--wcs-progress-bar-animation-duration', 375 / stepInterval + 'ms');
48
+ if (newValue !== oldValue) {
49
+ for (let i = 0; i < stepInterval; i++) {
50
+ setTimeout(() => {
51
+ this.internalCurrentStep -= (oldValue - newValue) > 0 ? 1 : -1;
52
+ if (i === stepInterval - 1) {
53
+ this.el.style.removeProperty('--wcs-progress-bar-animation-duration');
54
+ }
55
+ }, (i * (375 / stepInterval)));
56
+ }
54
57
  }
55
58
  }
56
59
  }
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-b982604a.js';
2
2
 
3
- const matIconCss = ":host{display:inline-block}:host .size-s{font-size:18px}:host .size-m{font-size:24px}:host .size-l{font-size:36px}:host .size-xl{font-size:48px}";
3
+ const matIconCss = ":host{display:flex;flex-direction:column;justify-content:center}:host .size-s{font-size:18px}:host .size-m{font-size:24px}:host .size-l{font-size:36px}:host .size-xl{font-size:48px}";
4
4
 
5
5
  let MatIcon = class {
6
6
  constructor(hostRef) {
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-b982604a.js';
2
2
 
3
- const modalCss = "wcs-modal{--saas-fix-modal:rgba(var(--wcs-black), 0.5);z-index:999;position:fixed;top:0;bottom:0;left:0;right:0;display:none}wcs-modal[show]{display:block;width:100%;height:100%;opacity:1;display:block}wcs-modal[without-backdrop] .wcs-modal-backdrop{display:none}wcs-modal[without-backdrop] .wcs-modal-container{border:solid 1px var(--wcs-text-light)}.wcs-modal-backdrop{display:block;position:fixed;top:0;left:0;bottom:0;right:0;opacity:0.4;background-color:var(--wcs-black)}.wcs-modal-container{position:fixed;top:50%;left:50%;box-sizing:border-box;max-width:100%;transform:translate(-50%, -50%);pointer-events:auto;background-color:#fff;background-clip:padding-box;border:0 solid rgba(0, 0, 0, 0.2);border-radius:0.4375rem;outline:0;z-index:20000;display:block;padding:1.375rem 1.875rem 1.875rem 1.875rem}.wcs-modal-container[data-size=s]{width:288px}.wcs-modal-container[data-size=m]{width:480px}.wcs-modal-container[data-size=l]{width:864px}.wcs-modal-container[data-size=xl]{width:1200px}.wcs-modal-header{margin-bottom:8px;display:flex;align-items:center;justify-content:space-between}.wcs-modal-header h5{font-size:24px;font-weight:400;margin:0}.wcs-modal-content{font-weight:400;font-size:16px}.wcs-modal-actions{margin-top:20px;float:right}";
3
+ const modalCss = "wcs-modal{z-index:999;position:fixed;top:0;bottom:0;left:0;right:0;display:none;background:rgba(0, 0, 0, 0.4)}wcs-modal[show]{display:flex;height:100vh;width:100vw;align-items:center;justify-content:center}wcs-modal[without-backdrop]{background-color:unset}wcs-modal[without-backdrop] .wcs-modal-container{border:solid 1px var(--wcs-text-light)}.wcs-modal-container{max-height:var(--wcs-modal-max-height, 80%);background-color:#fff;display:grid;grid-template-columns:100%;grid-template-rows:auto 1fr auto;box-sizing:border-box;pointer-events:auto;background-clip:padding-box;border:0 solid rgba(0, 0, 0, 0.2);border-radius:0.4375rem;z-index:20000;padding:1.375rem 1.875rem 1.875rem 1.875rem}.wcs-modal-container[data-size=s]{width:288px}.wcs-modal-container[data-size=m]{width:480px}.wcs-modal-container[data-size=l]{width:864px}.wcs-modal-container[data-size=xl]{width:1200px}.wcs-modal-header{margin-bottom:8px;display:flex;align-items:center;justify-content:space-between}.wcs-modal-header h5{font-size:24px;font-weight:400;margin:0}.wcs-modal-content{font-weight:400;font-size:16px;overflow-y:auto}.wcs-modal-actions{margin-top:20px;display:flex;justify-content:flex-end}";
4
4
 
5
5
  let Modal = class {
6
6
  constructor(hostRef) {
@@ -24,9 +24,13 @@ let Modal = class {
24
24
  * size best suited for the content and screen size displaying the modal. Remember to test responsiveness.
25
25
  */
26
26
  this.size = 'm';
27
+ /**
28
+ * Specifies whether the component should hide the actions slot or not
29
+ */
30
+ this.hideActions = false;
27
31
  }
28
32
  render() {
29
- return (h(Host, null, h("div", { class: "wcs-modal-backdrop" }), h("div", { class: "wcs-modal-container", "data-size": this.size }, h("div", { class: "wcs-modal-header" }, h("h5", null, h("slot", { name: "header" })), this.showCloseButton && (h("wcs-button", { shape: "round", mode: "clear", class: "wcs-dark", onClick: ($event) => this.onCloseButtonClick($event) }, h("i", { class: "material-icons" }, "close")))), h("div", { class: "wcs-modal-content" }, h("slot", null)), h("div", { class: "wcs-modal-actions" }, h("slot", { name: "actions" })))));
33
+ return (h(Host, null, h("div", { class: "wcs-modal-container", "data-size": this.size }, h("div", { class: "wcs-modal-header" }, h("h5", null, h("slot", { name: "header" })), this.showCloseButton && (h("wcs-button", { shape: "round", mode: "clear", class: "wcs-dark", onClick: ($event) => this.onCloseButtonClick($event) }, h("wcs-mat-icon", { icon: "close" })))), h("div", { class: "wcs-modal-content" }, h("slot", null)), !this.hideActions && (h("div", { class: "wcs-modal-actions" }, h("slot", { name: "actions" }))))));
30
34
  }
31
35
  onKeyDown(event) {
32
36
  if (this.showCloseButton && event.key === 'Escape') {