@otto-de/b2b-core-components 1.23.0 → 1.23.2

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 (76) hide show
  1. package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
  2. package/dist/b2b-core-components/p-0f5b8f0f.entry.js +1 -0
  3. package/dist/b2b-core-components/p-2ca7c595.entry.js +1 -0
  4. package/dist/b2b-core-components/p-462d5ad3.entry.js +1 -0
  5. package/dist/cjs/b2b-grid-col.cjs.entry.js +7 -6
  6. package/dist/cjs/b2b-grid-row.cjs.entry.js +33 -2
  7. package/dist/cjs/b2b-grid.cjs.entry.js +1 -1
  8. package/dist/collection/components/alert/alert.css +2 -2
  9. package/dist/collection/components/anchor/anchor.css +2 -2
  10. package/dist/collection/components/background-box/background-box.css +2 -2
  11. package/dist/collection/components/breadcrumb/breadcrumb.css +2 -2
  12. package/dist/collection/components/button/button.css +2 -2
  13. package/dist/collection/components/card/card.css +2 -2
  14. package/dist/collection/components/checkbox/checkbox.css +2 -2
  15. package/dist/collection/components/checkbox-group/checkbox-group.css +2 -2
  16. package/dist/collection/components/chip/chip.css +2 -2
  17. package/dist/collection/components/date-picker/date-picker-days-header.css +2 -2
  18. package/dist/collection/components/date-picker/date-picker-days.css +2 -2
  19. package/dist/collection/components/date-picker/date-picker-header.css +2 -2
  20. package/dist/collection/components/date-picker/date-picker-months.css +2 -2
  21. package/dist/collection/components/date-picker/date-picker-years.css +2 -2
  22. package/dist/collection/components/date-picker/date-picker.css +2 -2
  23. package/dist/collection/components/dropdown/dropdown.css +2 -2
  24. package/dist/collection/components/flyout-menu/flyout-menu-option.css +2 -2
  25. package/dist/collection/components/flyout-menu/flyout-menu.css +2 -2
  26. package/dist/collection/components/grid/column.js +7 -6
  27. package/dist/collection/components/grid/grid.css +14 -0
  28. package/dist/collection/components/grid/row.js +33 -2
  29. package/dist/collection/components/headline/headline.css +2 -2
  30. package/dist/collection/components/icon/icon.css +2 -2
  31. package/dist/collection/components/icon-100/icon-100.css +2 -2
  32. package/dist/collection/components/icon-50/icon-50.css +2 -2
  33. package/dist/collection/components/input/input.css +2 -2
  34. package/dist/collection/components/input-group/input-group.css +2 -2
  35. package/dist/collection/components/input-list/input-list.css +2 -2
  36. package/dist/collection/components/label/label.css +2 -2
  37. package/dist/collection/components/modal/modal.css +2 -2
  38. package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.css +2 -2
  39. package/dist/collection/components/pagination/pagination.css +2 -2
  40. package/dist/collection/components/paragraph/paragraph.css +2 -2
  41. package/dist/collection/components/progress-bar/progress-bar.css +2 -2
  42. package/dist/collection/components/radio/radio.css +2 -2
  43. package/dist/collection/components/radio-group/radio-group.css +2 -2
  44. package/dist/collection/components/required-separator/required-separator.css +2 -2
  45. package/dist/collection/components/rounded-icon/rounded-icon.css +2 -2
  46. package/dist/collection/components/scrollable-container/scrollable-container.css +2 -2
  47. package/dist/collection/components/separator/separator.css +2 -2
  48. package/dist/collection/components/snackbar/snackbar.css +2 -2
  49. package/dist/collection/components/spinner/spinner.css +2 -2
  50. package/dist/collection/components/tab/tab.css +2 -2
  51. package/dist/collection/components/tab-panel/tab-panel.css +2 -2
  52. package/dist/collection/components/table/table-cell/table-cell.css +2 -2
  53. package/dist/collection/components/table/table-header/table-header.css +2 -2
  54. package/dist/collection/components/table/table-row/table-row.css +2 -2
  55. package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +2 -2
  56. package/dist/collection/components/table/table.css +2 -2
  57. package/dist/collection/components/textarea/textarea.css +2 -2
  58. package/dist/collection/components/toggle-button/toggle-button.css +2 -2
  59. package/dist/collection/components/toggle-chip/toggle-chip.css +2 -2
  60. package/dist/collection/components/toggle-group/toggle-group.css +2 -2
  61. package/dist/collection/components/toggle-switch/toggle-switch.css +2 -2
  62. package/dist/collection/components/tooltip/tooltip.css +2 -2
  63. package/dist/collection/components/wizard/wizard.css +2 -2
  64. package/dist/collection/components/wizard-icon/wizard-icon.css +2 -2
  65. package/dist/components/b2b-grid-col.js +7 -6
  66. package/dist/components/b2b-grid-row.js +33 -2
  67. package/dist/components/b2b-grid.js +1 -1
  68. package/dist/esm/b2b-grid-col.entry.js +7 -6
  69. package/dist/esm/b2b-grid-row.entry.js +33 -2
  70. package/dist/esm/b2b-grid.entry.js +1 -1
  71. package/dist/types/components/grid/row.d.ts +2 -0
  72. package/dist/web-types.json +1 -1
  73. package/package.json +2 -2
  74. package/dist/b2b-core-components/p-02ceefdf.entry.js +0 -1
  75. package/dist/b2b-core-components/p-545b6ba2.entry.js +0 -1
  76. package/dist/b2b-core-components/p-744e8fc3.entry.js +0 -1
@@ -10,8 +10,39 @@ const B2bGridRowComponent = /*@__PURE__*/ proxyCustomElement(class B2bGridRowCom
10
10
  this.alignItems = 'stretch';
11
11
  this.justify = 'start';
12
12
  }
13
+ componentDidLoad() {
14
+ this.adjustColumnFlex();
15
+ }
16
+ adjustColumnFlex() {
17
+ const columns = this.hostElement.querySelectorAll(':scope > b2b-grid-col');
18
+ let totalSpan = 0;
19
+ let columnsWithoutSpan = [];
20
+ columns.forEach((column) => {
21
+ const span = column.getAttribute('span');
22
+ if (span) {
23
+ totalSpan += parseInt(span, 10);
24
+ }
25
+ else {
26
+ columnsWithoutSpan.push(column);
27
+ }
28
+ });
29
+ const remainingSpan = 12 - totalSpan;
30
+ if (remainingSpan == 12) {
31
+ if (columnsWithoutSpan.length > 0) {
32
+ columnsWithoutSpan.forEach(column => {
33
+ column.setAttribute('span', '1');
34
+ });
35
+ }
36
+ }
37
+ if (columnsWithoutSpan.length > 0) {
38
+ const flexPerColumn = ((remainingSpan / 12) * 100) / columnsWithoutSpan.length;
39
+ columnsWithoutSpan.forEach(column => {
40
+ column.style.flex = `${flexPerColumn}%`;
41
+ });
42
+ }
43
+ }
13
44
  render() {
14
- return (h(Host, { key: 'cea79124fea736c6276b0f60c8ba983d3085dbdb', style: {
45
+ return (h(Host, { key: '469913a61a9e77d16ef17fd2e7947ab303b50081', style: {
15
46
  ['justify-content']: `${this.justify}`,
16
47
  ['gap']: `${this.columnGap}px`,
17
48
  ['margin']: `${this.rowGap}px 0`,
@@ -19,7 +50,7 @@ const B2bGridRowComponent = /*@__PURE__*/ proxyCustomElement(class B2bGridRowCom
19
50
  ['display']: 'flex',
20
51
  ['flex-wrap']: 'wrap',
21
52
  ['box-sizing']: 'border-box',
22
- } }, h("slot", { key: '218cf8da76adc6f58983f90fb808629a4785f6a6' })));
53
+ } }, h("slot", { key: 'd3e960866ad5a611b690827bb03ca25caf118bde' })));
23
54
  }
24
55
  get hostElement() { return this; }
25
56
  }, [1, "b2b-grid-row", {
@@ -1,6 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
 
3
- const gridCss = ":host(.b2b-grid){width:100%;margin:0 auto;box-sizing:border-box}";
3
+ const gridCss = ":host(.b2b-grid){width:100%;margin:0 auto;box-sizing:border-box}:host(.b2b-grid-row){display:flex;flex-wrap:wrap}:host(.b2b-grid-col){display:flex;flex-direction:column}.b2b-grid-col>.b2b-grid-row{flex:1}";
4
4
  const B2bGridStyle0 = gridCss;
5
5
 
6
6
  const B2bGridComponent = /*@__PURE__*/ proxyCustomElement(class B2bGridComponent extends HTMLElement {
@@ -4,17 +4,18 @@ const B2bGridColumnComponent = class {
4
4
  constructor(hostRef) {
5
5
  registerInstance(this, hostRef);
6
6
  this.calculateGrowDimension = (span) => {
7
- const colSpan = span !== null && span !== void 0 ? span : 1;
8
- const flex = (colSpan / 12) * 100;
9
- return {
10
- ['flex']: `${flex}`,
11
- };
7
+ if (span !== undefined) {
8
+ const flex = (span / 12) * 100;
9
+ return {
10
+ ['flex']: `${flex}`,
11
+ };
12
+ }
12
13
  };
13
14
  this.span = undefined;
14
15
  this.textAlign = 'left';
15
16
  }
16
17
  render() {
17
- return (h(Host, { key: 'ad6a14cd39b9429064c305bfbe6e0d6b9f506faa', style: Object.assign(Object.assign({}, this.calculateGrowDimension(this.span)), { ['text-align']: `${this.textAlign}` }) }, h("slot", { key: '1b488c100774214fb52eeec64ffe70a8fadf0a3c' })));
18
+ return (h(Host, { key: '84919b56153393d378a29ce84d4048af80a95fea', style: Object.assign(Object.assign({}, this.calculateGrowDimension(this.span)), { ['text-align']: `${this.textAlign}` }) }, h("slot", { key: '1fef59961b312a1efdd94488865aa0a436170489' })));
18
19
  }
19
20
  get hostElement() { return getElement(this); }
20
21
  };
@@ -8,8 +8,39 @@ const B2bGridRowComponent = class {
8
8
  this.alignItems = 'stretch';
9
9
  this.justify = 'start';
10
10
  }
11
+ componentDidLoad() {
12
+ this.adjustColumnFlex();
13
+ }
14
+ adjustColumnFlex() {
15
+ const columns = this.hostElement.querySelectorAll(':scope > b2b-grid-col');
16
+ let totalSpan = 0;
17
+ let columnsWithoutSpan = [];
18
+ columns.forEach((column) => {
19
+ const span = column.getAttribute('span');
20
+ if (span) {
21
+ totalSpan += parseInt(span, 10);
22
+ }
23
+ else {
24
+ columnsWithoutSpan.push(column);
25
+ }
26
+ });
27
+ const remainingSpan = 12 - totalSpan;
28
+ if (remainingSpan == 12) {
29
+ if (columnsWithoutSpan.length > 0) {
30
+ columnsWithoutSpan.forEach(column => {
31
+ column.setAttribute('span', '1');
32
+ });
33
+ }
34
+ }
35
+ if (columnsWithoutSpan.length > 0) {
36
+ const flexPerColumn = ((remainingSpan / 12) * 100) / columnsWithoutSpan.length;
37
+ columnsWithoutSpan.forEach(column => {
38
+ column.style.flex = `${flexPerColumn}%`;
39
+ });
40
+ }
41
+ }
11
42
  render() {
12
- return (h(Host, { key: 'cea79124fea736c6276b0f60c8ba983d3085dbdb', style: {
43
+ return (h(Host, { key: '469913a61a9e77d16ef17fd2e7947ab303b50081', style: {
13
44
  ['justify-content']: `${this.justify}`,
14
45
  ['gap']: `${this.columnGap}px`,
15
46
  ['margin']: `${this.rowGap}px 0`,
@@ -17,7 +48,7 @@ const B2bGridRowComponent = class {
17
48
  ['display']: 'flex',
18
49
  ['flex-wrap']: 'wrap',
19
50
  ['box-sizing']: 'border-box',
20
- } }, h("slot", { key: '218cf8da76adc6f58983f90fb808629a4785f6a6' })));
51
+ } }, h("slot", { key: 'd3e960866ad5a611b690827bb03ca25caf118bde' })));
21
52
  }
22
53
  get hostElement() { return getElement(this); }
23
54
  };
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, g as getElement } from './index-ab9eb36d.js';
2
2
 
3
- const gridCss = ":host(.b2b-grid){width:100%;margin:0 auto;box-sizing:border-box}";
3
+ const gridCss = ":host(.b2b-grid){width:100%;margin:0 auto;box-sizing:border-box}:host(.b2b-grid-row){display:flex;flex-wrap:wrap}:host(.b2b-grid-col){display:flex;flex-direction:column}.b2b-grid-col>.b2b-grid-row{flex:1}";
4
4
  const B2bGridStyle0 = gridCss;
5
5
 
6
6
  const B2bGridComponent = class {
@@ -8,5 +8,7 @@ export declare class B2bGridRowComponent {
8
8
  alignItems: 'stretch' | 'flex-start' | 'center' | 'flex-end';
9
9
  /** Horizontal alignment of columns. */
10
10
  justify: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly';
11
+ componentDidLoad(): void;
12
+ private adjustColumnFlex;
11
13
  render(): any;
12
14
  }
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "@otto-de/b2b-core-components",
5
- "version": "1.22.0",
5
+ "version": "1.23.1",
6
6
  "js-types-syntax": "typescript",
7
7
  "description-markup": "markdown",
8
8
  "contributions": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otto-de/b2b-core-components",
3
- "version": "1.23.0",
3
+ "version": "1.23.2",
4
4
  "description": "Core components defined with Stencil",
5
5
  "author": "Otto GmbH",
6
6
  "license": "Apache-2.0",
@@ -40,7 +40,7 @@
40
40
  "build:storybook": "npm run copy-md-files && storybook build -o docs-build/design-system"
41
41
  },
42
42
  "dependencies": {
43
- "@otto-de/b2b-tokens": "1.23.0",
43
+ "@otto-de/b2b-tokens": "1.23.2",
44
44
  "@stencil-community/eslint-plugin": "^0.5.0",
45
45
  "@stencil/core": "^4.12.4"
46
46
  },
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as s,g as a}from"./p-b6a753e8.js";const r=class{constructor(e){t(this,e),this.calculateGrowDimension=t=>({flex:""+(null!=t?t:1)/12*100}),this.span=void 0,this.textAlign="left"}render(){return e(s,{key:"ad6a14cd39b9429064c305bfbe6e0d6b9f506faa",style:Object.assign(Object.assign({},this.calculateGrowDimension(this.span)),{"text-align":`${this.textAlign}`})},e("slot",{key:"1b488c100774214fb52eeec64ffe70a8fadf0a3c"}))}get hostElement(){return a(this)}};export{r as b2b_grid_col}
@@ -1 +0,0 @@
1
- import{r as e,h as s,H as t,g as r}from"./p-b6a753e8.js";const a=class{constructor(s){e(this,s),this.margin=24}render(){return s(t,{key:"d969835eaef0a092de761496f817e3aeb9fe9da3",style:{padding:`${this.margin}px`},class:"b2b-grid"},s("slot",{key:"457acba45d11bb8ed33008c1158f89d33f5222f6"}))}get hostElement(){return r(this)}};a.style=":host(.b2b-grid){width:100%;margin:0 auto;box-sizing:border-box}";export{a as b2b_grid}
@@ -1 +0,0 @@
1
- import{r as t,h as s,H as r,g as a}from"./p-b6a753e8.js";const e=class{constructor(s){t(this,s),this.columnGap=24,this.rowGap=24,this.alignItems="stretch",this.justify="start"}render(){return s(r,{key:"cea79124fea736c6276b0f60c8ba983d3085dbdb",style:{"justify-content":`${this.justify}`,gap:`${this.columnGap}px`,margin:`${this.rowGap}px 0`,"align-items":`${this.alignItems}`,display:"flex","flex-wrap":"wrap","box-sizing":"border-box"}},s("slot",{key:"218cf8da76adc6f58983f90fb808629a4785f6a6"}))}get hostElement(){return a(this)}};export{e as b2b_grid_row}