@mozaic-ds/web-components 0.8.0 → 0.9.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 (76) hide show
  1. package/package.json +1 -1
  2. package/public/{DataTableDefaultAction.nested-483f8bb0.js → DataTableDefaultAction.nested-60e24c9f.js} +2 -2
  3. package/public/{DataTableDefaultAction.nested-483f8bb0.js.map → DataTableDefaultAction.nested-60e24c9f.js.map} +1 -1
  4. package/public/DataTableUtilities-e3e0dc27.js +2 -0
  5. package/public/DataTableUtilities-e3e0dc27.js.map +1 -0
  6. package/public/adeo/{DataTableDefaultAction.nested-90536fe3.js → DataTableDefaultAction.nested-ad728094.js} +2 -2
  7. package/public/adeo/{DataTableDefaultAction.nested-90536fe3.js.map → DataTableDefaultAction.nested-ad728094.js.map} +1 -1
  8. package/public/adeo/DataTableUtilities-e3e0dc27.js +2 -0
  9. package/public/adeo/DataTableUtilities-e3e0dc27.js.map +1 -0
  10. package/public/adeo/bundle.js +5 -0
  11. package/public/adeo/components/barchart/BarChart.svelte +4 -5
  12. package/public/adeo/components/chart/BarChart.js +1 -1
  13. package/public/adeo/components/chart/BarChart.js.map +1 -1
  14. package/public/adeo/components/datatable/DataTable.js +1 -1
  15. package/public/adeo/components/datatable/DataTableDefaultAction.nested.js +1 -1
  16. package/public/adeo/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
  17. package/public/adeo/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
  18. package/public/adeo/components/datatable/DataTableFooter.nested.js +1 -1
  19. package/public/adeo/components/kpi/Kpi.js +2 -0
  20. package/public/adeo/components/kpi/Kpi.js.map +1 -0
  21. package/public/adeo/components/kpi/Kpi.svelte +232 -0
  22. package/public/adeo/icons-storybook.js +16 -0
  23. package/public/adeo/main.d.ts +1 -0
  24. package/public/adeo/main.d.ts.map +1 -1
  25. package/public/adeo/utilities/DataTableUtilities.d.ts.map +1 -1
  26. package/public/adeo/utilities/DataTableUtilities.ts +9 -1
  27. package/public/bricoman/{DataTableDefaultAction.nested-928e5e2d.js → DataTableDefaultAction.nested-e557bfca.js} +2 -2
  28. package/public/bricoman/{DataTableDefaultAction.nested-928e5e2d.js.map → DataTableDefaultAction.nested-e557bfca.js.map} +1 -1
  29. package/public/bricoman/DataTableUtilities-e3e0dc27.js +2 -0
  30. package/public/bricoman/DataTableUtilities-e3e0dc27.js.map +1 -0
  31. package/public/bricoman/bundle.js +5 -0
  32. package/public/bricoman/components/barchart/BarChart.svelte +4 -5
  33. package/public/bricoman/components/chart/BarChart.js +1 -1
  34. package/public/bricoman/components/chart/BarChart.js.map +1 -1
  35. package/public/bricoman/components/datatable/DataTable.js +1 -1
  36. package/public/bricoman/components/datatable/DataTableDefaultAction.nested.js +1 -1
  37. package/public/bricoman/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
  38. package/public/bricoman/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
  39. package/public/bricoman/components/datatable/DataTableFooter.nested.js +1 -1
  40. package/public/bricoman/components/kpi/Kpi.js +2 -0
  41. package/public/bricoman/components/kpi/Kpi.js.map +1 -0
  42. package/public/bricoman/components/kpi/Kpi.svelte +232 -0
  43. package/public/bricoman/icons-storybook.js +16 -0
  44. package/public/bricoman/main.d.ts +1 -0
  45. package/public/bricoman/main.d.ts.map +1 -1
  46. package/public/bricoman/utilities/DataTableUtilities.d.ts.map +1 -1
  47. package/public/bricoman/utilities/DataTableUtilities.ts +9 -1
  48. package/public/bundle.js +5 -0
  49. package/public/components/barchart/BarChart.svelte +4 -5
  50. package/public/components/chart/BarChart.js +1 -1
  51. package/public/components/chart/BarChart.js.map +1 -1
  52. package/public/components/datatable/DataTable.js +1 -1
  53. package/public/components/datatable/DataTableDefaultAction.nested.js +1 -1
  54. package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -1
  55. package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -1
  56. package/public/components/datatable/DataTableFooter.nested.js +1 -1
  57. package/public/components/kpi/Kpi.js +2 -0
  58. package/public/components/kpi/Kpi.js.map +1 -0
  59. package/public/components/kpi/Kpi.svelte +232 -0
  60. package/public/icons-storybook.js +16 -0
  61. package/public/main.d.ts +1 -0
  62. package/public/main.d.ts.map +1 -1
  63. package/public/utilities/DataTableUtilities.d.ts.map +1 -1
  64. package/public/utilities/DataTableUtilities.ts +9 -1
  65. package/public/utilities/main.d.ts +1 -0
  66. package/public/utilities/main.d.ts.map +1 -1
  67. package/public/utilities/stories/datatable/DataTable.stories.d.ts.map +1 -1
  68. package/public/utilities/stories/kpi/kpi.stories.d.ts +7 -0
  69. package/public/utilities/stories/kpi/kpi.stories.d.ts.map +1 -0
  70. package/public/utilities/utilities/DataTableUtilities.d.ts.map +1 -1
  71. package/public/DataTableUtilities-60220c78.js +0 -2
  72. package/public/DataTableUtilities-60220c78.js.map +0 -1
  73. package/public/adeo/DataTableUtilities-60220c78.js +0 -2
  74. package/public/adeo/DataTableUtilities-60220c78.js.map +0 -1
  75. package/public/bricoman/DataTableUtilities-60220c78.js +0 -2
  76. package/public/bricoman/DataTableUtilities-60220c78.js.map +0 -1
@@ -0,0 +1,232 @@
1
+ <svelte:options tag={null} />
2
+
3
+ <script lang="ts">
4
+ export let value: string = '';
5
+ export let iconname: string = '';
6
+ export let iconcolor: string = '';
7
+ export let label: string = '';
8
+ export let type: string = '';
9
+ export let detail: string = '';
10
+ $: labelOutsideContent = label && label.length > 0 && size() !== 'large';
11
+ $: size = function getSize() {
12
+ let size = 'small';
13
+ if (label && label.length > 0 && !detail) {
14
+ size = 'medium';
15
+ } else if (detail && detail.length > 0) {
16
+ size = 'large';
17
+ }
18
+
19
+ return size;
20
+ };
21
+
22
+ function generateIconName(iconname: string, iconcolor?: string): string {
23
+ return iconcolor ? `${iconname} fill="${iconcolor}"` : `${iconname}`;
24
+ }
25
+ </script>
26
+
27
+ <div class="mc-kpi mc-kpi--{size()} mc-kpi--{type}">
28
+ {#if labelOutsideContent}
29
+ <span class="mc-kpi__label">{label}</span>
30
+ {/if}
31
+ <div class="mc-kpi__content">
32
+ <div class="mc-kpi__main">
33
+ {#if !labelOutsideContent}
34
+ <span class="mc-kpi__label">{label}</span>
35
+ {/if}
36
+ <span class="mc-kpi__value">{value}</span>
37
+ </div>
38
+ {#if iconname || detail}
39
+ <div class="mc-kpi__aside">
40
+ {#if detail}
41
+ <span class="mc-kpi__detail">{detail}</span>
42
+ {/if}
43
+ {#if iconname}
44
+ <span class="mc-kpi__icon"
45
+ >{@html `<${generateIconName(iconname, iconcolor)} />`}</span
46
+ >
47
+ {/if}
48
+ </div>
49
+ {/if}
50
+ </div>
51
+ </div>
52
+
53
+ <style lang="scss">
54
+ @import '@mozaic-ds/styles/settings-tools/_all-settings';
55
+ .mc-kpi {
56
+ color: var(--color-kpi-text, #005c91);
57
+ display: inline-block;
58
+
59
+ &__label {
60
+ font-size: 1.2rem;
61
+ display: block;
62
+ }
63
+
64
+ &__content {
65
+ display: flex;
66
+ }
67
+
68
+ &__main {
69
+ align-items: center;
70
+ display: flex;
71
+ justify-content: center;
72
+ }
73
+
74
+ &__value {
75
+ font-size: 1.2rem;
76
+ font-weight: 600;
77
+ }
78
+
79
+ &__aside {
80
+ align-items: center;
81
+ background-color: var(--color-grey-000, #ffffff);
82
+ color: var(--color-font-dark, #000000);
83
+ display: flex;
84
+ justify-content: center;
85
+ }
86
+
87
+ &__detail {
88
+ font-size: 1.2rem;
89
+ }
90
+
91
+ &__icon {
92
+ display: block;
93
+ height: 16px;
94
+ width: 16px;
95
+ }
96
+
97
+ &--small {
98
+ .mc-kpi {
99
+ &__label {
100
+ font-size: 1rem;
101
+ margin-bottom: 6px;
102
+ color: var(--color-grey-999, #999999);
103
+ }
104
+
105
+ &__content {
106
+ gap: 0.5rem;
107
+ }
108
+
109
+ &__value {
110
+ font-size: 0.875rem;
111
+ line-height: 1.2;
112
+ }
113
+
114
+ &__main {
115
+ background-color: var(--color-kpi-background, #daeff7);
116
+ border: 1px solid var(--color-kpi-border, #007bb4);
117
+ border-radius: 4px;
118
+ overflow: hidden;
119
+ padding: 3px 7px;
120
+ }
121
+
122
+ &__aside {
123
+ background-color: transparent;
124
+ }
125
+ }
126
+ }
127
+
128
+ &--medium {
129
+ .mc-kpi {
130
+ &__label {
131
+ color: var(--color-grey-999, #999999);
132
+ margin-bottom: 6px;
133
+ }
134
+
135
+ &__content {
136
+ background-color: var(--color-kpi-background, #daeff7);
137
+ border: 1px solid var(--color-kpi-border, #007bb4);
138
+ border-radius: 4px;
139
+ overflow: hidden;
140
+ height: 40px;
141
+ min-width: 160px;
142
+ }
143
+
144
+ &__main {
145
+ flex-grow: 1;
146
+ padding: 2px 2px 2px 7px;
147
+ }
148
+
149
+ &__value {
150
+ font-size: 1.5rem;
151
+ }
152
+
153
+ &__aside {
154
+ padding-left: 12px;
155
+ padding-right: 15px;
156
+ }
157
+ }
158
+ }
159
+
160
+ &--large {
161
+ background-color: var(--color-kpi-background, #daeff7);
162
+ border: 1px solid var(--color-kpi-border, #007bb4);
163
+ border-radius: 4px;
164
+ overflow: hidden;
165
+
166
+ .mc-kpi {
167
+ &__content {
168
+ flex-direction: column;
169
+ min-width: 160px;
170
+ min-height: 100px;
171
+ }
172
+
173
+ &__main {
174
+ flex-direction: column;
175
+ padding: 10px 15px;
176
+ min-height: 5rem;
177
+ }
178
+
179
+ &__label {
180
+ line-height: 1.5;
181
+ font-size: 1rem;
182
+ }
183
+
184
+ &__value {
185
+ font-size: 2rem;
186
+ }
187
+
188
+ &__detail {
189
+ font-size: 1rem;
190
+ line-height: 1;
191
+ }
192
+
193
+ &__aside {
194
+ min-height: 3rem;
195
+ padding-right: 15px;
196
+ padding-left: 15px;
197
+ gap: 12px;
198
+ }
199
+ }
200
+ }
201
+
202
+ &--information {
203
+ --color-kpi-background: #daeff7;
204
+ --color-kpi-border: #007bb4;
205
+ --color-kpi-text: #005c91;
206
+ }
207
+
208
+ &--warning {
209
+ --color-kpi-background: #fdf1e8;
210
+ --color-kpi-border: #c65200;
211
+ --color-kpi-text: #8c3500;
212
+ }
213
+
214
+ &--danger {
215
+ --color-kpi-background: #fdeaea;
216
+ --color-kpi-border: #c61112;
217
+ --color-kpi-text: #8c0003;
218
+ }
219
+
220
+ &--success {
221
+ --color-kpi-background: #ebf5de;
222
+ --color-kpi-border: #188803;
223
+ --color-kpi-text: #006902;
224
+ }
225
+
226
+ &--neutral {
227
+ --color-kpi-background: #e6e6e6;
228
+ --color-kpi-border: #666666;
229
+ --color-kpi-text: #4d4d4d;
230
+ }
231
+ }
232
+ </style>
@@ -13,6 +13,22 @@ import ArrowArrowRight24 from './icons/ArrowArrowRight24.js';
13
13
  import DisplayHome24 from './icons/DisplayHome24.js';
14
14
  import DisplayBlink24 from './icons/DisplayBlink24.js';
15
15
  import AspectQuantity24 from './icons/AspectQuantity24.js';
16
+ import ArrowArrowTopRight16 from './icons/ArrowArrowTopRight16.js';
17
+ import ArrowArrowBottomRight16 from './icons/ArrowArrowBottomRight16.js';
18
+
19
+ if (!customElements.get('navigation-arrow-arrowtopright-16px')) {
20
+ customElements.define(
21
+ 'navigation-arrow-arrowtopright-16px',
22
+ ArrowArrowTopRight16,
23
+ );
24
+ }
25
+
26
+ if (!customElements.get('navigation-arrow-arrowbottomright-16px')) {
27
+ customElements.define(
28
+ 'navigation-arrow-arrowbottomright-16px',
29
+ ArrowArrowBottomRight16,
30
+ );
31
+ }
16
32
 
17
33
  if (!customElements.get('navigation-arrow-arrow--left-32px')) {
18
34
  customElements.define('navigation-arrow-arrow--left-32px', ArrowArrowLeft32);
@@ -49,6 +49,7 @@ declare const _default: {
49
49
  Radar: typeof Accordion;
50
50
  Header: typeof Accordion;
51
51
  TagList: typeof Accordion;
52
+ Kpi: typeof Accordion;
52
53
  };
53
54
  export default _default;
54
55
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yCAAyC,CAAC;AA+ChE,YAAY,EACV,OAAO,IAAI,WAAW,EACtB,OAAO,EACP,YAAY,EACZ,OAAO,EACP,IAAI,GACL,MAAM,oCAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG5C,wBAiDE"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,yCAAyC,CAAC;AAgDhE,YAAY,EACV,OAAO,IAAI,WAAW,EACtB,OAAO,EACP,YAAY,EACZ,OAAO,EACP,IAAI,GACL,MAAM,oCAAoC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG5C,wBAkDE"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableUtilities.d.ts","sourceRoot":"","sources":["../../../src/utilities/DataTableUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EAIR,QAAQ,EACR,aAAa,EACb,WAAW,EAEX,eAAe,EAGhB,MAAM,yCAAyC,CAAC;AAqFjD,eAAO,MAAM,cAAc,aACf,QAAQ,YACR,QAAQ,KACjB,MAMF,CAAC;AAEF,eAAO,MAAM,gBAAgB,oBACV,MAAM,GAAG,SAAS,SAC5B,MAAM;;CAQd,CAAC;AACF,eAAO,MAAM,mBAAmB,UAAW,QAAQ,EAAE,KAAG,OASvD,CAAC;AACF,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,KAAG,OAQ/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,yBACL,aAAa,KAClC,aAaF,CAAC;AAEF,eAAO,MAAM,WAAW,UACf,QAAQ,EAAE,YACP,MAAM,eACH,WAAW,iBACT,aAAa,KAC3B,QAAQ,EA8DV,CAAC;AAEF,eAAO,MAAM,yBAAyB,eACxB,MAAM,eACL,MAAM,gBACL,OAAO,KACpB,MAAM,EAmBR,CAAC;AAEF,eAAO,MAAM,wBAAw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,MAAM,EAmBR,CAAC;AAEF,eAAO,MAAM,wBAAwB,SAC7B,QAAQ,mBACG,eAAe,GAAG,SAAS,sBACxB,OAAO,KAC1B,eAAe,GAAG,SAyCpB,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAC3B,QAAQ,EAAE,mBACA,eAAe,GAAG,SAAS,sBACxB,OAAO,iBACZ,OAAO,YACZ,OAAO,KAChB,eAAe,GAAG,SAwFpB,CAAC;AAEF,eAAO,MAAM,cAAc,oBACR,eAAe,GAAG,SAAS,KAC3C,eAAe,GAAG,SAOpB,CAAC;AAEF,eAAO,MAAM,SAAS,oBACH,eAAe,GAAG,SAAS,KAC3C,eAAe,GAAG,SAOpB,CAAC;AAEF,eAAO,MAAM,mCAAmC,UACvC,QAAQ,EAAE,mBACA,eAAe,GAAG,SAAS,iBAC7B,OAAO,KACrB,OA4BF,CAAC;AAEF,oBAAY,aAAa;IACvB,KAAK,UAAU;CAChB"}
@@ -23,6 +23,12 @@ const customTextFormatter = (customText: CustomText): string => {
23
23
  );
24
24
  return customTextHtml;
25
25
  };
26
+ const customNumberFormatter = (number: Number): string => {
27
+ return `<span style="display: flex; justify-content: end;" > ${String(
28
+ number,
29
+ )} </span>`;
30
+ };
31
+
26
32
  const imageFormatter = (image: Image): string =>
27
33
  `<img style="${
28
34
  image.style || 'width: 35px; height: 35px; margin-right: 8px;'
@@ -77,6 +83,8 @@ const getFormattedCell = (
77
83
  return cellValue as string;
78
84
  case 'CustomText':
79
85
  return customTextFormatter(cellValue as CustomText);
86
+ case 'Number':
87
+ return customNumberFormatter(cellValue as Number);
80
88
  case 'Image':
81
89
  return imageFormatter(cellValue as Image);
82
90
  case 'Badge':
@@ -102,7 +110,7 @@ export const getCellContent = (
102
110
  ): string => {
103
111
  const cellValue = bodyData?.cells[headData.id];
104
112
 
105
- return cellValue
113
+ return cellValue || Number(cellValue) === 0
106
114
  ? getFormattedCell(headData.cellsFormat, cellValue, bodyData.id)
107
115
  : '';
108
116
  };