wcs-core 4.0.2 → 4.1.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 (142) hide show
  1. package/README.md +4 -2
  2. package/dist/cjs/grid-pagination-4b55c908.js.map +1 -1
  3. package/dist/cjs/isEqual-9ea7ee49.js +2047 -0
  4. package/dist/cjs/isEqual-9ea7ee49.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/wcs-button.cjs.entry.js +4 -0
  7. package/dist/cjs/wcs-button.cjs.entry.js.map +1 -1
  8. package/dist/cjs/wcs-com-nav.cjs.entry.js +22 -2
  9. package/dist/cjs/wcs-com-nav.cjs.entry.js.map +1 -1
  10. package/dist/cjs/wcs-counter.cjs.entry.js +61 -34
  11. package/dist/cjs/wcs-counter.cjs.entry.js.map +1 -1
  12. package/dist/cjs/wcs-error_2.cjs.entry.js +1 -1
  13. package/dist/cjs/wcs-error_2.cjs.entry.js.map +1 -1
  14. package/dist/cjs/wcs-grid-column.cjs.entry.js.map +1 -1
  15. package/dist/cjs/wcs-grid-custom-cell.cjs.entry.js.map +1 -1
  16. package/dist/cjs/wcs-grid.cjs.entry.js +1104 -12
  17. package/dist/cjs/wcs-grid.cjs.entry.js.map +1 -1
  18. package/dist/cjs/wcs-native-select.cjs.entry.js +1 -1
  19. package/dist/cjs/wcs-native-select.cjs.entry.js.map +1 -1
  20. package/dist/cjs/wcs-select_2.cjs.entry.js +2 -2
  21. package/dist/cjs/wcs-select_2.cjs.entry.js.map +1 -1
  22. package/dist/cjs/wcs-skeleton-circle.cjs.entry.js +23 -0
  23. package/dist/cjs/wcs-skeleton-circle.cjs.entry.js.map +1 -0
  24. package/dist/cjs/wcs-skeleton-rectangle.cjs.entry.js +25 -0
  25. package/dist/cjs/wcs-skeleton-rectangle.cjs.entry.js.map +1 -0
  26. package/dist/cjs/wcs-skeleton-text.cjs.entry.js +23 -0
  27. package/dist/cjs/wcs-skeleton-text.cjs.entry.js.map +1 -0
  28. package/dist/cjs/wcs.cjs.js +1 -1
  29. package/dist/collection/collection-manifest.json +3 -0
  30. package/dist/collection/components/button/button.js +12 -0
  31. package/dist/collection/components/button/button.js.map +1 -1
  32. package/dist/collection/components/com-nav/com-nav.css +15 -0
  33. package/dist/collection/components/com-nav/com-nav.js +27 -1
  34. package/dist/collection/components/com-nav/com-nav.js.map +1 -1
  35. package/dist/collection/components/counter/counter.js +64 -40
  36. package/dist/collection/components/counter/counter.js.map +1 -1
  37. package/dist/collection/components/form-field/form-field.js +1 -1
  38. package/dist/collection/components/form-field/form-field.js.map +1 -1
  39. package/dist/collection/components/grid/grid.js +30 -20
  40. package/dist/collection/components/grid/grid.js.map +1 -1
  41. package/dist/collection/components/grid-column/grid-column.js +16 -11
  42. package/dist/collection/components/grid-column/grid-column.js.map +1 -1
  43. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js +3 -0
  44. package/dist/collection/components/grid-custom-cell/grid-custom-cell.js.map +1 -1
  45. package/dist/collection/components/grid-pagination/grid-pagination.js +9 -6
  46. package/dist/collection/components/grid-pagination/grid-pagination.js.map +1 -1
  47. package/dist/collection/components/native-select/native-select.css +5 -3
  48. package/dist/collection/components/select/select.js +3 -3
  49. package/dist/collection/components/select/select.js.map +1 -1
  50. package/dist/collection/components/skeleton/skeleton-interface.js +2 -0
  51. package/dist/collection/components/skeleton/skeleton-interface.js.map +1 -0
  52. package/dist/collection/components/skeleton-circle/skeleton-circle.css +47 -0
  53. package/dist/collection/components/skeleton-circle/skeleton-circle.js +71 -0
  54. package/dist/collection/components/skeleton-circle/skeleton-circle.js.map +1 -0
  55. package/dist/collection/components/skeleton-rectangle/skeleton-rectangle.css +53 -0
  56. package/dist/collection/components/skeleton-rectangle/skeleton-rectangle.js +121 -0
  57. package/dist/collection/components/skeleton-rectangle/skeleton-rectangle.js.map +1 -0
  58. package/dist/collection/components/skeleton-text/skeleton-text.css +62 -0
  59. package/dist/collection/components/skeleton-text/skeleton-text.js +71 -0
  60. package/dist/collection/components/skeleton-text/skeleton-text.js.map +1 -0
  61. package/dist/collection/shared-types.js.map +1 -1
  62. package/dist/esm/grid-pagination-41354861.js.map +1 -1
  63. package/dist/esm/isEqual-20881bca.js +2020 -0
  64. package/dist/esm/isEqual-20881bca.js.map +1 -0
  65. package/dist/esm/loader.js +1 -1
  66. package/dist/esm/wcs-button.entry.js +4 -0
  67. package/dist/esm/wcs-button.entry.js.map +1 -1
  68. package/dist/esm/wcs-com-nav.entry.js +22 -2
  69. package/dist/esm/wcs-com-nav.entry.js.map +1 -1
  70. package/dist/esm/wcs-counter.entry.js +61 -34
  71. package/dist/esm/wcs-counter.entry.js.map +1 -1
  72. package/dist/esm/wcs-error_2.entry.js +1 -1
  73. package/dist/esm/wcs-error_2.entry.js.map +1 -1
  74. package/dist/esm/wcs-grid-column.entry.js.map +1 -1
  75. package/dist/esm/wcs-grid-custom-cell.entry.js.map +1 -1
  76. package/dist/esm/wcs-grid.entry.js +1104 -12
  77. package/dist/esm/wcs-grid.entry.js.map +1 -1
  78. package/dist/esm/wcs-native-select.entry.js +1 -1
  79. package/dist/esm/wcs-native-select.entry.js.map +1 -1
  80. package/dist/esm/wcs-select_2.entry.js +2 -2
  81. package/dist/esm/wcs-select_2.entry.js.map +1 -1
  82. package/dist/esm/wcs-skeleton-circle.entry.js +19 -0
  83. package/dist/esm/wcs-skeleton-circle.entry.js.map +1 -0
  84. package/dist/esm/wcs-skeleton-rectangle.entry.js +21 -0
  85. package/dist/esm/wcs-skeleton-rectangle.entry.js.map +1 -0
  86. package/dist/esm/wcs-skeleton-text.entry.js +19 -0
  87. package/dist/esm/wcs-skeleton-text.entry.js.map +1 -0
  88. package/dist/esm/wcs.js +1 -1
  89. package/dist/types/components/button/button.d.ts +12 -0
  90. package/dist/types/components/com-nav/com-nav.d.ts +11 -0
  91. package/dist/types/components/counter/counter.d.ts +8 -10
  92. package/dist/types/components/grid/grid.d.ts +22 -5
  93. package/dist/types/components/grid-column/grid-column.d.ts +37 -1
  94. package/dist/types/components/grid-custom-cell/grid-custom-cell.d.ts +3 -0
  95. package/dist/types/components/grid-pagination/grid-pagination.d.ts +26 -0
  96. package/dist/types/components/skeleton/skeleton-interface.d.ts +1 -0
  97. package/dist/types/components/skeleton-circle/skeleton-circle.d.ts +16 -0
  98. package/dist/types/components/skeleton-rectangle/skeleton-rectangle.d.ts +27 -0
  99. package/dist/types/components/skeleton-text/skeleton-text.d.ts +16 -0
  100. package/dist/types/components.d.ts +350 -16
  101. package/dist/types/shared-types.d.ts +22 -0
  102. package/dist/wcs/p-15058c29.entry.js +2 -0
  103. package/dist/wcs/p-15058c29.entry.js.map +1 -0
  104. package/dist/wcs/p-22480bd8.entry.js +2 -0
  105. package/dist/wcs/p-22480bd8.entry.js.map +1 -0
  106. package/dist/wcs/p-292ca644.entry.js +2 -0
  107. package/dist/wcs/p-292ca644.entry.js.map +1 -0
  108. package/dist/wcs/p-30d8f9c3.entry.js.map +1 -1
  109. package/dist/wcs/{p-26e7de5c.entry.js → p-405140f9.entry.js} +3 -3
  110. package/dist/wcs/{p-26e7de5c.entry.js.map → p-405140f9.entry.js.map} +1 -1
  111. package/dist/wcs/p-475ac7c5.js.map +1 -1
  112. package/dist/wcs/{p-4b2d8a6d.entry.js → p-57560d7d.entry.js} +2 -2
  113. package/dist/wcs/{p-4b2d8a6d.entry.js.map → p-57560d7d.entry.js.map} +1 -1
  114. package/dist/wcs/p-627bbb6a.entry.js.map +1 -1
  115. package/dist/wcs/p-6b66ce85.entry.js +2 -0
  116. package/dist/wcs/p-6b66ce85.entry.js.map +1 -0
  117. package/dist/wcs/p-8181f8cd.js +2 -0
  118. package/dist/wcs/p-8181f8cd.js.map +1 -0
  119. package/dist/wcs/p-84afb8af.entry.js +2 -0
  120. package/dist/wcs/p-84afb8af.entry.js.map +1 -0
  121. package/dist/wcs/p-b229a91c.entry.js.map +1 -1
  122. package/dist/wcs/p-cfcacc44.entry.js +2 -0
  123. package/dist/wcs/p-cfcacc44.entry.js.map +1 -0
  124. package/dist/wcs/p-dfddec76.entry.js +2 -0
  125. package/dist/wcs/p-dfddec76.entry.js.map +1 -0
  126. package/dist/wcs/wcs.esm.js +1 -1
  127. package/dist/wcs/wcs.esm.js.map +1 -1
  128. package/package.json +5 -9
  129. package/dist/cjs/lodash-776d6f03.js +0 -17211
  130. package/dist/cjs/lodash-776d6f03.js.map +0 -1
  131. package/dist/esm/lodash-d6d9d079.js +0 -17209
  132. package/dist/esm/lodash-d6d9d079.js.map +0 -1
  133. package/dist/wcs/p-5a7999bb.entry.js +0 -2
  134. package/dist/wcs/p-5a7999bb.entry.js.map +0 -1
  135. package/dist/wcs/p-a24fa4f4.entry.js +0 -2
  136. package/dist/wcs/p-a24fa4f4.entry.js.map +0 -1
  137. package/dist/wcs/p-adef7aaf.js +0 -2
  138. package/dist/wcs/p-adef7aaf.js.map +0 -1
  139. package/dist/wcs/p-bcb8b731.entry.js +0 -2
  140. package/dist/wcs/p-bcb8b731.entry.js.map +0 -1
  141. package/dist/wcs/p-f386bb8b.entry.js +0 -2
  142. package/dist/wcs/p-f386bb8b.entry.js.map +0 -1
@@ -23,6 +23,8 @@ import { RadioGroupChangeEventDetail, RadioGroupMode } from "./components/radio-
23
23
  import { RadioChosedEvent } from "./components/radio/radio-interface";
24
24
  import { SelectChangeEventDetail, WcsSelectSize } from "./components/select/select-interface";
25
25
  import { SelectOptionChosedEvent } from "./components/select-option/select-option-interface";
26
+ import { WcsSkeletonAnimation } from "./components/skeleton/skeleton-interface";
27
+ import { CssTypes } from "./shared-types";
26
28
  import { WcsSpinnerMode } from "./components/spinner/spinner-interface";
27
29
  import { SwitchChangeEventDetail, SwitchLabelAlignment } from "./components/switch/switch-interface";
28
30
  import { WcsTabChangeEvent, WcsTabsAlignment } from "./components/tabs/tabs-interface";
@@ -46,6 +48,8 @@ export { RadioGroupChangeEventDetail, RadioGroupMode } from "./components/radio-
46
48
  export { RadioChosedEvent } from "./components/radio/radio-interface";
47
49
  export { SelectChangeEventDetail, WcsSelectSize } from "./components/select/select-interface";
48
50
  export { SelectOptionChosedEvent } from "./components/select-option/select-option-interface";
51
+ export { WcsSkeletonAnimation } from "./components/skeleton/skeleton-interface";
52
+ export { CssTypes } from "./shared-types";
49
53
  export { WcsSpinnerMode } from "./components/spinner/spinner-interface";
50
54
  export { SwitchChangeEventDetail, SwitchLabelAlignment } from "./components/switch/switch-interface";
51
55
  export { WcsTabChangeEvent, WcsTabsAlignment } from "./components/tabs/tabs-interface";
@@ -106,6 +110,12 @@ export namespace Components {
106
110
  }
107
111
  /**
108
112
  * Button component, can also be a link when specifying href.
113
+ * ## Click event
114
+ * The WCS button relies on the native click event to pass a user click to your app.
115
+ * For now, it's not possible for us to prevent the click event to be fired when the button's disabled attribute is true.
116
+ * This means you'll receive click events on a disabled wcs button.
117
+ * If you're using the button with a library like Angular or React, they have internal mechanisms to prevent this behavior. Your callbacks will therefore not be called.
118
+ * To fix this problem, we plan to provide a wcsClick event in addition to the native click for applications developed without frameworks.
109
119
  */
110
120
  interface WcsButton {
111
121
  /**
@@ -225,9 +235,9 @@ export namespace Components {
225
235
  */
226
236
  "step": number;
227
237
  /**
228
- * Allow to change currentValue programmatically
238
+ * The current value of the counter.
229
239
  */
230
- "value"?: number;
240
+ "value": number;
231
241
  }
232
242
  interface WcsDivider {
233
243
  }
@@ -325,44 +335,87 @@ export namespace Components {
325
335
  */
326
336
  "text": string;
327
337
  }
338
+ /**
339
+ * The grid component is a complex component used as an HTML table to display collections of data.
340
+ * @cssprop --wcs-grid-highlight-color - Color for selected rows
341
+ * @cssprop --wcs-grid-column-border-left - Left border of all grid headers
342
+ */
328
343
  interface WcsGrid {
344
+ /**
345
+ * Contains the data to display in the table from a js object
346
+ */
329
347
  "data": any[];
330
348
  /**
331
- * Flag to display spinner during data loading
349
+ * Flag to display a spinner during data loading
332
350
  */
333
351
  "loading": boolean;
334
352
  /**
335
- * Name of the object's key that will be used to display the cells whose keyValue attribute matches to the object's value for this key.
353
+ * Name of the object's key that will be used to display the cells whose `keyValue` attribute matches to the object's value for this key.
336
354
  */
337
355
  "rowIdPath": string;
338
356
  /**
339
- * Set the selected items
357
+ * Set the selected items (rows)
340
358
  */
341
359
  "selectedItems": any | any[];
342
360
  /**
343
- * Used to manage grid's row selection
361
+ * Used to manage grid's row selection. "none": no row can be selected. "multiple": several rows can be selected. "single": one row only can be selected.
344
362
  */
345
363
  "selectionConfig": WcsGridSelectionConfig;
346
364
  /**
347
- * True to manage sort and pagination with a backend server, default: false
365
+ * Manage sort and pagination with a backend server when set to `true`
348
366
  */
349
367
  "serverMode": boolean;
368
+ /**
369
+ * Automatically set by the component to reference the wcs-grid-pagination HTML element by its id.
370
+ */
350
371
  "wcsGridPaginationId": string;
351
372
  }
373
+ /**
374
+ * The grid column is a subcomponent of `wcs-grid` that represents a column of the table.
375
+ * @cssprop --wcs-grid-column-border-left - Border separator between column names
376
+ * @csspart [path]-column - CSS part for each column for styling. e.g: first_name-column, email-column
377
+ */
352
378
  interface WcsGridColumn {
379
+ /**
380
+ * Set to true if using a `wcs-custom-cell` linked to it.
381
+ */
353
382
  "customCells": boolean;
383
+ /**
384
+ * Customizable formatter function to render the cell differently.
385
+ */
354
386
  "formatter": WcsCellFormatter;
387
+ /**
388
+ * Flag to hide the column.
389
+ */
355
390
  "hidden": boolean;
391
+ /**
392
+ * The name of the column displayed on the table (e.g: First Name, Last Name, Email, ...)
393
+ */
356
394
  "name": string;
395
+ /**
396
+ * Represents the name of the field from the `data` object (e.g: first_name, last_name, email, ...)
397
+ */
357
398
  "path": string;
399
+ /**
400
+ * Make the column sortable.
401
+ */
358
402
  "sort": boolean;
403
+ /**
404
+ * Customizable sort function to change the comparison of values.
405
+ */
359
406
  "sortFn": WcsSortFn;
407
+ /**
408
+ * Defines if the column sort is ascending or descending. `none` = the column is not sorted.
409
+ */
360
410
  "sortOrder": WcsSortOrder;
361
411
  /**
362
- * Set the column <th> element width
412
+ * Set the column `<th>` element width.
363
413
  */
364
414
  "width": string;
365
415
  }
416
+ /**
417
+ * The grid custom cell is a subcomponent of `wcs-grid`.
418
+ */
366
419
  interface WcsGridCustomCell {
367
420
  /**
368
421
  * ID of the column for which to render the cell
@@ -373,11 +426,29 @@ export namespace Components {
373
426
  */
374
427
  "rowId": any;
375
428
  }
429
+ /**
430
+ * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.
431
+ */
376
432
  interface WcsGridPagination {
433
+ /**
434
+ * Set the available page sizes in the pagination dropdown on the left.
435
+ */
377
436
  "availablePageSizes": number[];
437
+ /**
438
+ * The current page of the pagination. First page starts at index 0.
439
+ */
378
440
  "currentPage": number;
441
+ /**
442
+ * Total elements in the grid. - **Grid in `Server mode`** : You have to set `itemsCount` = your total data length. - **Grid not in Server mode** : Do not set it manually : itemsCount is set and updated every pagination refresh.
443
+ */
379
444
  "itemsCount": number;
445
+ /**
446
+ * Max number of pages. - **Grid in `Server mode`** : You have to set `pageCount` = `itemsCount` divided by `pageSize`. - **Grid not in Server mode** : Do not set it manually : pageCount is set and updated every pagination refresh.
447
+ */
380
448
  "pageCount": number;
449
+ /**
450
+ * Maximum number of elements shown per page. Default is the first value of `availablePageSizes`.
451
+ */
381
452
  "pageSize": number;
382
453
  }
383
454
  interface WcsHeader {
@@ -754,6 +825,54 @@ export namespace Components {
754
825
  */
755
826
  "value"?: any;
756
827
  }
828
+ /**
829
+ * Use a skeleton circle as a placeholder round images, illustrations or components
830
+ */
831
+ interface WcsSkeletonCircle {
832
+ /**
833
+ * Specifies the animation of the skeleton
834
+ */
835
+ "animation": WcsSkeletonAnimation;
836
+ /**
837
+ * Specifies the radius of the circle in px
838
+ */
839
+ "radius": number;
840
+ }
841
+ /**
842
+ * Use a skeleton rectangle as a placeholder for large images or square-shaped components
843
+ * @cssprop --wcs-skeleton-border-radius - Controls the border-radius of the 'rounded' skeleton rectangle (default 0.5rem)
844
+ */
845
+ interface WcsSkeletonRectangle {
846
+ /**
847
+ * Specifies the animation of the skeleton
848
+ */
849
+ "animation": WcsSkeletonAnimation;
850
+ /**
851
+ * Specifies the height of the skeleton (can be any valid CSS value)
852
+ */
853
+ "height": CssTypes.Height;
854
+ /**
855
+ * Adds a border radius on the skeleton if true
856
+ */
857
+ "rounded": boolean;
858
+ /**
859
+ * Specifies the width of the skeleton (can be any valid CSS value)
860
+ */
861
+ "width": CssTypes.Width;
862
+ }
863
+ /**
864
+ * Use a skeleton text as a placeholder for titles or paragraphs.
865
+ */
866
+ interface WcsSkeletonText {
867
+ /**
868
+ * Specifies the animation of the skeleton
869
+ */
870
+ "animation": WcsSkeletonAnimation;
871
+ /**
872
+ * Specifies the line height of the text skeleton
873
+ */
874
+ "height": 'h1' | 'h2' | 'h3' | 'caption' | 'body';
875
+ }
757
876
  interface WcsSpinner {
758
877
  /**
759
878
  * Indicates the spinner display mode. Accepted values: `border` or `growing`
@@ -1124,6 +1243,12 @@ declare global {
1124
1243
  };
1125
1244
  /**
1126
1245
  * Button component, can also be a link when specifying href.
1246
+ * ## Click event
1247
+ * The WCS button relies on the native click event to pass a user click to your app.
1248
+ * For now, it's not possible for us to prevent the click event to be fired when the button's disabled attribute is true.
1249
+ * This means you'll receive click events on a disabled wcs button.
1250
+ * If you're using the button with a library like Angular or React, they have internal mechanisms to prevent this behavior. Your callbacks will therefore not be called.
1251
+ * To fix this problem, we plan to provide a wcsClick event in addition to the native click for applications developed without frameworks.
1127
1252
  */
1128
1253
  interface HTMLWcsButtonElement extends Components.WcsButton, HTMLStencilElement {
1129
1254
  }
@@ -1265,24 +1390,40 @@ declare global {
1265
1390
  prototype: HTMLWcsGalacticMenuElement;
1266
1391
  new (): HTMLWcsGalacticMenuElement;
1267
1392
  };
1393
+ /**
1394
+ * The grid component is a complex component used as an HTML table to display collections of data.
1395
+ * @cssprop --wcs-grid-highlight-color - Color for selected rows
1396
+ * @cssprop --wcs-grid-column-border-left - Left border of all grid headers
1397
+ */
1268
1398
  interface HTMLWcsGridElement extends Components.WcsGrid, HTMLStencilElement {
1269
1399
  }
1270
1400
  var HTMLWcsGridElement: {
1271
1401
  prototype: HTMLWcsGridElement;
1272
1402
  new (): HTMLWcsGridElement;
1273
1403
  };
1404
+ /**
1405
+ * The grid column is a subcomponent of `wcs-grid` that represents a column of the table.
1406
+ * @cssprop --wcs-grid-column-border-left - Border separator between column names
1407
+ * @csspart [path]-column - CSS part for each column for styling. e.g: first_name-column, email-column
1408
+ */
1274
1409
  interface HTMLWcsGridColumnElement extends Components.WcsGridColumn, HTMLStencilElement {
1275
1410
  }
1276
1411
  var HTMLWcsGridColumnElement: {
1277
1412
  prototype: HTMLWcsGridColumnElement;
1278
1413
  new (): HTMLWcsGridColumnElement;
1279
1414
  };
1415
+ /**
1416
+ * The grid custom cell is a subcomponent of `wcs-grid`.
1417
+ */
1280
1418
  interface HTMLWcsGridCustomCellElement extends Components.WcsGridCustomCell, HTMLStencilElement {
1281
1419
  }
1282
1420
  var HTMLWcsGridCustomCellElement: {
1283
1421
  prototype: HTMLWcsGridCustomCellElement;
1284
1422
  new (): HTMLWcsGridCustomCellElement;
1285
1423
  };
1424
+ /**
1425
+ * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.
1426
+ */
1286
1427
  interface HTMLWcsGridPaginationElement extends Components.WcsGridPagination, HTMLStencilElement {
1287
1428
  }
1288
1429
  var HTMLWcsGridPaginationElement: {
@@ -1440,6 +1581,34 @@ declare global {
1440
1581
  prototype: HTMLWcsSelectOptionElement;
1441
1582
  new (): HTMLWcsSelectOptionElement;
1442
1583
  };
1584
+ /**
1585
+ * Use a skeleton circle as a placeholder round images, illustrations or components
1586
+ */
1587
+ interface HTMLWcsSkeletonCircleElement extends Components.WcsSkeletonCircle, HTMLStencilElement {
1588
+ }
1589
+ var HTMLWcsSkeletonCircleElement: {
1590
+ prototype: HTMLWcsSkeletonCircleElement;
1591
+ new (): HTMLWcsSkeletonCircleElement;
1592
+ };
1593
+ /**
1594
+ * Use a skeleton rectangle as a placeholder for large images or square-shaped components
1595
+ * @cssprop --wcs-skeleton-border-radius - Controls the border-radius of the 'rounded' skeleton rectangle (default 0.5rem)
1596
+ */
1597
+ interface HTMLWcsSkeletonRectangleElement extends Components.WcsSkeletonRectangle, HTMLStencilElement {
1598
+ }
1599
+ var HTMLWcsSkeletonRectangleElement: {
1600
+ prototype: HTMLWcsSkeletonRectangleElement;
1601
+ new (): HTMLWcsSkeletonRectangleElement;
1602
+ };
1603
+ /**
1604
+ * Use a skeleton text as a placeholder for titles or paragraphs.
1605
+ */
1606
+ interface HTMLWcsSkeletonTextElement extends Components.WcsSkeletonText, HTMLStencilElement {
1607
+ }
1608
+ var HTMLWcsSkeletonTextElement: {
1609
+ prototype: HTMLWcsSkeletonTextElement;
1610
+ new (): HTMLWcsSkeletonTextElement;
1611
+ };
1443
1612
  interface HTMLWcsSpinnerElement extends Components.WcsSpinner, HTMLStencilElement {
1444
1613
  }
1445
1614
  var HTMLWcsSpinnerElement: {
@@ -1554,6 +1723,9 @@ declare global {
1554
1723
  "wcs-radio-group": HTMLWcsRadioGroupElement;
1555
1724
  "wcs-select": HTMLWcsSelectElement;
1556
1725
  "wcs-select-option": HTMLWcsSelectOptionElement;
1726
+ "wcs-skeleton-circle": HTMLWcsSkeletonCircleElement;
1727
+ "wcs-skeleton-rectangle": HTMLWcsSkeletonRectangleElement;
1728
+ "wcs-skeleton-text": HTMLWcsSkeletonTextElement;
1557
1729
  "wcs-spinner": HTMLWcsSpinnerElement;
1558
1730
  "wcs-switch": HTMLWcsSwitchElement;
1559
1731
  "wcs-tab": HTMLWcsTabElement;
@@ -1617,6 +1789,12 @@ declare namespace LocalJSX {
1617
1789
  }
1618
1790
  /**
1619
1791
  * Button component, can also be a link when specifying href.
1792
+ * ## Click event
1793
+ * The WCS button relies on the native click event to pass a user click to your app.
1794
+ * For now, it's not possible for us to prevent the click event to be fired when the button's disabled attribute is true.
1795
+ * This means you'll receive click events on a disabled wcs button.
1796
+ * If you're using the button with a library like Angular or React, they have internal mechanisms to prevent this behavior. Your callbacks will therefore not be called.
1797
+ * To fix this problem, we plan to provide a wcsClick event in addition to the native click for applications developed without frameworks.
1620
1798
  */
1621
1799
  interface WcsButton {
1622
1800
  /**
@@ -1739,9 +1917,9 @@ declare namespace LocalJSX {
1739
1917
  */
1740
1918
  "step"?: number;
1741
1919
  /**
1742
- * Allow to change currentValue programmatically
1920
+ * The current value of the counter.
1743
1921
  */
1744
- "value"?: number;
1922
+ "value": number;
1745
1923
  }
1746
1924
  interface WcsDivider {
1747
1925
  }
@@ -1844,10 +2022,18 @@ declare namespace LocalJSX {
1844
2022
  */
1845
2023
  "text"?: string;
1846
2024
  }
2025
+ /**
2026
+ * The grid component is a complex component used as an HTML table to display collections of data.
2027
+ * @cssprop --wcs-grid-highlight-color - Color for selected rows
2028
+ * @cssprop --wcs-grid-column-border-left - Left border of all grid headers
2029
+ */
1847
2030
  interface WcsGrid {
2031
+ /**
2032
+ * Contains the data to display in the table from a js object
2033
+ */
1848
2034
  "data"?: any[];
1849
2035
  /**
1850
- * Flag to display spinner during data loading
2036
+ * Flag to display a spinner during data loading
1851
2037
  */
1852
2038
  "loading"?: boolean;
1853
2039
  /**
@@ -1859,39 +2045,80 @@ declare namespace LocalJSX {
1859
2045
  */
1860
2046
  "onWcsGridSelectionChange"?: (event: WcsGridCustomEvent<WcsGridRowSelectedEventDetails>) => void;
1861
2047
  /**
1862
- * Name of the object's key that will be used to display the cells whose keyValue attribute matches to the object's value for this key.
2048
+ * Name of the object's key that will be used to display the cells whose `keyValue` attribute matches to the object's value for this key.
1863
2049
  */
1864
2050
  "rowIdPath"?: string;
1865
2051
  /**
1866
- * Set the selected items
2052
+ * Set the selected items (rows)
1867
2053
  */
1868
2054
  "selectedItems"?: any | any[];
1869
2055
  /**
1870
- * Used to manage grid's row selection
2056
+ * Used to manage grid's row selection. "none": no row can be selected. "multiple": several rows can be selected. "single": one row only can be selected.
1871
2057
  */
1872
2058
  "selectionConfig"?: WcsGridSelectionConfig;
1873
2059
  /**
1874
- * True to manage sort and pagination with a backend server, default: false
2060
+ * Manage sort and pagination with a backend server when set to `true`
1875
2061
  */
1876
2062
  "serverMode"?: boolean;
2063
+ /**
2064
+ * Automatically set by the component to reference the wcs-grid-pagination HTML element by its id.
2065
+ */
1877
2066
  "wcsGridPaginationId"?: string;
1878
2067
  }
2068
+ /**
2069
+ * The grid column is a subcomponent of `wcs-grid` that represents a column of the table.
2070
+ * @cssprop --wcs-grid-column-border-left - Border separator between column names
2071
+ * @csspart [path]-column - CSS part for each column for styling. e.g: first_name-column, email-column
2072
+ */
1879
2073
  interface WcsGridColumn {
2074
+ /**
2075
+ * Set to true if using a `wcs-custom-cell` linked to it.
2076
+ */
1880
2077
  "customCells"?: boolean;
2078
+ /**
2079
+ * Customizable formatter function to render the cell differently.
2080
+ */
1881
2081
  "formatter"?: WcsCellFormatter;
2082
+ /**
2083
+ * Flag to hide the column.
2084
+ */
1882
2085
  "hidden"?: boolean;
2086
+ /**
2087
+ * The name of the column displayed on the table (e.g: First Name, Last Name, Email, ...)
2088
+ */
1883
2089
  "name"?: string;
2090
+ /**
2091
+ * Event emitted if the column is dynamically switching visibility.
2092
+ */
1884
2093
  "onWcsHiddenChange"?: (event: WcsGridColumnCustomEvent<boolean>) => void;
2094
+ /**
2095
+ * Event emitted when the sort of the column is changed.
2096
+ */
1885
2097
  "onWcsSortChange"?: (event: WcsGridColumnCustomEvent<WcsGridColumnSortChangeEventDetails>) => void;
2098
+ /**
2099
+ * Represents the name of the field from the `data` object (e.g: first_name, last_name, email, ...)
2100
+ */
1886
2101
  "path"?: string;
2102
+ /**
2103
+ * Make the column sortable.
2104
+ */
1887
2105
  "sort"?: boolean;
2106
+ /**
2107
+ * Customizable sort function to change the comparison of values.
2108
+ */
1888
2109
  "sortFn"?: WcsSortFn;
2110
+ /**
2111
+ * Defines if the column sort is ascending or descending. `none` = the column is not sorted.
2112
+ */
1889
2113
  "sortOrder"?: WcsSortOrder;
1890
2114
  /**
1891
- * Set the column <th> element width
2115
+ * Set the column `<th>` element width.
1892
2116
  */
1893
2117
  "width"?: string;
1894
2118
  }
2119
+ /**
2120
+ * The grid custom cell is a subcomponent of `wcs-grid`.
2121
+ */
1895
2122
  interface WcsGridCustomCell {
1896
2123
  /**
1897
2124
  * ID of the column for which to render the cell
@@ -1902,12 +2129,33 @@ declare namespace LocalJSX {
1902
2129
  */
1903
2130
  "rowId"?: any;
1904
2131
  }
2132
+ /**
2133
+ * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.
2134
+ */
1905
2135
  interface WcsGridPagination {
2136
+ /**
2137
+ * Set the available page sizes in the pagination dropdown on the left.
2138
+ */
1906
2139
  "availablePageSizes"?: number[];
2140
+ /**
2141
+ * The current page of the pagination. First page starts at index 0.
2142
+ */
1907
2143
  "currentPage"?: number;
2144
+ /**
2145
+ * Total elements in the grid. - **Grid in `Server mode`** : You have to set `itemsCount` = your total data length. - **Grid not in Server mode** : Do not set it manually : itemsCount is set and updated every pagination refresh.
2146
+ */
1908
2147
  "itemsCount"?: number;
2148
+ /**
2149
+ * Event emitted when the pagination changes.
2150
+ */
1909
2151
  "onWcsGridPaginationChange"?: (event: WcsGridPaginationCustomEvent<WcsGridPaginationChangeEventDetails>) => void;
2152
+ /**
2153
+ * Max number of pages. - **Grid in `Server mode`** : You have to set `pageCount` = `itemsCount` divided by `pageSize`. - **Grid not in Server mode** : Do not set it manually : pageCount is set and updated every pagination refresh.
2154
+ */
1910
2155
  "pageCount"?: number;
2156
+ /**
2157
+ * Maximum number of elements shown per page. Default is the first value of `availablePageSizes`.
2158
+ */
1911
2159
  "pageSize"?: number;
1912
2160
  }
1913
2161
  interface WcsHeader {
@@ -2295,6 +2543,54 @@ declare namespace LocalJSX {
2295
2543
  */
2296
2544
  "value"?: any;
2297
2545
  }
2546
+ /**
2547
+ * Use a skeleton circle as a placeholder round images, illustrations or components
2548
+ */
2549
+ interface WcsSkeletonCircle {
2550
+ /**
2551
+ * Specifies the animation of the skeleton
2552
+ */
2553
+ "animation"?: WcsSkeletonAnimation;
2554
+ /**
2555
+ * Specifies the radius of the circle in px
2556
+ */
2557
+ "radius"?: number;
2558
+ }
2559
+ /**
2560
+ * Use a skeleton rectangle as a placeholder for large images or square-shaped components
2561
+ * @cssprop --wcs-skeleton-border-radius - Controls the border-radius of the 'rounded' skeleton rectangle (default 0.5rem)
2562
+ */
2563
+ interface WcsSkeletonRectangle {
2564
+ /**
2565
+ * Specifies the animation of the skeleton
2566
+ */
2567
+ "animation"?: WcsSkeletonAnimation;
2568
+ /**
2569
+ * Specifies the height of the skeleton (can be any valid CSS value)
2570
+ */
2571
+ "height"?: CssTypes.Height;
2572
+ /**
2573
+ * Adds a border radius on the skeleton if true
2574
+ */
2575
+ "rounded"?: boolean;
2576
+ /**
2577
+ * Specifies the width of the skeleton (can be any valid CSS value)
2578
+ */
2579
+ "width"?: CssTypes.Width;
2580
+ }
2581
+ /**
2582
+ * Use a skeleton text as a placeholder for titles or paragraphs.
2583
+ */
2584
+ interface WcsSkeletonText {
2585
+ /**
2586
+ * Specifies the animation of the skeleton
2587
+ */
2588
+ "animation"?: WcsSkeletonAnimation;
2589
+ /**
2590
+ * Specifies the line height of the text skeleton
2591
+ */
2592
+ "height"?: 'h1' | 'h2' | 'h3' | 'caption' | 'body';
2593
+ }
2298
2594
  interface WcsSpinner {
2299
2595
  /**
2300
2596
  * Indicates the spinner display mode. Accepted values: `border` or `growing`
@@ -2583,6 +2879,9 @@ declare namespace LocalJSX {
2583
2879
  "wcs-radio-group": WcsRadioGroup;
2584
2880
  "wcs-select": WcsSelect;
2585
2881
  "wcs-select-option": WcsSelectOption;
2882
+ "wcs-skeleton-circle": WcsSkeletonCircle;
2883
+ "wcs-skeleton-rectangle": WcsSkeletonRectangle;
2884
+ "wcs-skeleton-text": WcsSkeletonText;
2586
2885
  "wcs-spinner": WcsSpinner;
2587
2886
  "wcs-switch": WcsSwitch;
2588
2887
  "wcs-tab": WcsTab;
@@ -2604,6 +2903,12 @@ declare module "@stencil/core" {
2604
2903
  "wcs-badge": LocalJSX.WcsBadge & JSXBase.HTMLAttributes<HTMLWcsBadgeElement>;
2605
2904
  /**
2606
2905
  * Button component, can also be a link when specifying href.
2906
+ * ## Click event
2907
+ * The WCS button relies on the native click event to pass a user click to your app.
2908
+ * For now, it's not possible for us to prevent the click event to be fired when the button's disabled attribute is true.
2909
+ * This means you'll receive click events on a disabled wcs button.
2910
+ * If you're using the button with a library like Angular or React, they have internal mechanisms to prevent this behavior. Your callbacks will therefore not be called.
2911
+ * To fix this problem, we plan to provide a wcsClick event in addition to the native click for applications developed without frameworks.
2607
2912
  */
2608
2913
  "wcs-button": LocalJSX.WcsButton & JSXBase.HTMLAttributes<HTMLWcsButtonElement>;
2609
2914
  "wcs-card": LocalJSX.WcsCard & JSXBase.HTMLAttributes<HTMLWcsCardElement>;
@@ -2635,9 +2940,25 @@ declare module "@stencil/core" {
2635
2940
  "wcs-form-field": LocalJSX.WcsFormField & JSXBase.HTMLAttributes<HTMLWcsFormFieldElement>;
2636
2941
  "wcs-galactic": LocalJSX.WcsGalactic & JSXBase.HTMLAttributes<HTMLWcsGalacticElement>;
2637
2942
  "wcs-galactic-menu": LocalJSX.WcsGalacticMenu & JSXBase.HTMLAttributes<HTMLWcsGalacticMenuElement>;
2943
+ /**
2944
+ * The grid component is a complex component used as an HTML table to display collections of data.
2945
+ * @cssprop --wcs-grid-highlight-color - Color for selected rows
2946
+ * @cssprop --wcs-grid-column-border-left - Left border of all grid headers
2947
+ */
2638
2948
  "wcs-grid": LocalJSX.WcsGrid & JSXBase.HTMLAttributes<HTMLWcsGridElement>;
2949
+ /**
2950
+ * The grid column is a subcomponent of `wcs-grid` that represents a column of the table.
2951
+ * @cssprop --wcs-grid-column-border-left - Border separator between column names
2952
+ * @csspart [path]-column - CSS part for each column for styling. e.g: first_name-column, email-column
2953
+ */
2639
2954
  "wcs-grid-column": LocalJSX.WcsGridColumn & JSXBase.HTMLAttributes<HTMLWcsGridColumnElement>;
2955
+ /**
2956
+ * The grid custom cell is a subcomponent of `wcs-grid`.
2957
+ */
2640
2958
  "wcs-grid-custom-cell": LocalJSX.WcsGridCustomCell & JSXBase.HTMLAttributes<HTMLWcsGridCustomCellElement>;
2959
+ /**
2960
+ * The grid pagination is a subcomponent of `wcs-grid`, slotted in `grid-pagination` under the `<table>` element.
2961
+ */
2641
2962
  "wcs-grid-pagination": LocalJSX.WcsGridPagination & JSXBase.HTMLAttributes<HTMLWcsGridPaginationElement>;
2642
2963
  "wcs-header": LocalJSX.WcsHeader & JSXBase.HTMLAttributes<HTMLWcsHeaderElement>;
2643
2964
  "wcs-hint": LocalJSX.WcsHint & JSXBase.HTMLAttributes<HTMLWcsHintElement>;
@@ -2690,6 +3011,19 @@ declare module "@stencil/core" {
2690
3011
  * Select option component, use in conjunction with wcs-select.
2691
3012
  */
2692
3013
  "wcs-select-option": LocalJSX.WcsSelectOption & JSXBase.HTMLAttributes<HTMLWcsSelectOptionElement>;
3014
+ /**
3015
+ * Use a skeleton circle as a placeholder round images, illustrations or components
3016
+ */
3017
+ "wcs-skeleton-circle": LocalJSX.WcsSkeletonCircle & JSXBase.HTMLAttributes<HTMLWcsSkeletonCircleElement>;
3018
+ /**
3019
+ * Use a skeleton rectangle as a placeholder for large images or square-shaped components
3020
+ * @cssprop --wcs-skeleton-border-radius - Controls the border-radius of the 'rounded' skeleton rectangle (default 0.5rem)
3021
+ */
3022
+ "wcs-skeleton-rectangle": LocalJSX.WcsSkeletonRectangle & JSXBase.HTMLAttributes<HTMLWcsSkeletonRectangleElement>;
3023
+ /**
3024
+ * Use a skeleton text as a placeholder for titles or paragraphs.
3025
+ */
3026
+ "wcs-skeleton-text": LocalJSX.WcsSkeletonText & JSXBase.HTMLAttributes<HTMLWcsSkeletonTextElement>;
2693
3027
  "wcs-spinner": LocalJSX.WcsSpinner & JSXBase.HTMLAttributes<HTMLWcsSpinnerElement>;
2694
3028
  "wcs-switch": LocalJSX.WcsSwitch & JSXBase.HTMLAttributes<HTMLWcsSwitchElement>;
2695
3029
  /**
@@ -8,3 +8,25 @@
8
8
  * xs = 24 px
9
9
  */
10
10
  export type WcsSize = 'xs' | 's' | 'm' | 'l' | 'xl';
11
+ /***********************/
12
+ /***********************/
13
+ /**
14
+ * Namespace containing types for representing all available CSS properties.
15
+ * @namespace CssTypes
16
+ */
17
+ export declare namespace CssTypes {
18
+ type Height = CssUnits.LengthOrPercentage | CssUnits.Keyword | CssUnits.Global;
19
+ type Width = CssUnits.LengthOrPercentage | CssUnits.Keyword | CssUnits.Global;
20
+ }
21
+ /**
22
+ * Namespace containing types for representing CSS length units, percentages, keywords, and global values.
23
+ * @namespace CssUnits
24
+ */
25
+ export declare namespace CssUnits {
26
+ type LengthUnits = 'ch' | 'em' | 'rem' | 'px' | 'vh' | 'vw';
27
+ type Length = `${number}${LengthUnits}`;
28
+ type Percentage = `${number}%`;
29
+ type LengthOrPercentage = CssUnits.Length | CssUnits.Percentage;
30
+ type Keyword = 'auto' | 'min-content' | 'max-content' | 'fit-content' | `fit-content(${CssUnits.LengthOrPercentage}`;
31
+ type Global = 'unset' | 'initial' | 'inherit' | 'revert' | 'revert-layer';
32
+ }
@@ -0,0 +1,2 @@
1
+ import{r as t,c as e,f as r,h as n,H as i,g as o}from"./p-a2df3a49.js";import{G as s}from"./p-475ac7c5.js";import{i as a,b as c,a as u,S as f,c as l,g as h,e as d,d as v,f as b,h as g,M as p,o as w,k as j,r as m,j as y,s as C,l as A,m as S,U as x,n as O,p as k,q as U,t as I,u as R,v as E,w as F}from"./p-8181f8cd.js";function D(t){switch(t){case"asc":return 1;case"desc":return-1}}var G;var M=new Uint8Array(16);function P(){if(!G){G=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!=="undefined"&&typeof msCrypto.getRandomValues==="function"&&msCrypto.getRandomValues.bind(msCrypto);if(!G){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return G(M)}const B=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function H(t){return typeof t==="string"&&B.test(t)}var T=[];for(var W=0;W<256;++W){T.push((W+256).toString(16).substr(1))}function $(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var r=(T[t[e+0]]+T[t[e+1]]+T[t[e+2]]+T[t[e+3]]+"-"+T[t[e+4]]+T[t[e+5]]+"-"+T[t[e+6]]+T[t[e+7]]+"-"+T[t[e+8]]+T[t[e+9]]+"-"+T[t[e+10]]+T[t[e+11]]+T[t[e+12]]+T[t[e+13]]+T[t[e+14]]+T[t[e+15]]).toLowerCase();if(!H(r)){throw TypeError("Stringified UUID is invalid")}return r}function _(t,e,r){t=t||{};var n=t.random||(t.rng||P)();n[6]=n[6]&15|64;n[8]=n[8]&63|128;if(e){r=r||0;for(var i=0;i<16;++i){e[r+i]=n[i]}return e}return $(n)}var V="[object Symbol]";function N(t){return typeof t=="symbol"||a(t)&&c(t)==V}function q(t,e){var r=-1,n=t==null?0:t.length,i=Array(n);while(++r<n){i[r]=e(t[r],r,t)}return i}var L=1/0;var z=f?f.prototype:undefined,J=z?z.toString:undefined;function K(t){if(typeof t=="string"){return t}if(u(t)){return q(t,K)+""}if(N(t)){return J?J.call(t):""}var e=t+"";return e=="0"&&1/t==-L?"-0":e}var Q=Object.create;var X=function(){function t(){}return function(e){if(!l(e)){return{}}if(Q){return Q(e)}t.prototype=e;var r=new t;t.prototype=undefined;return r}}();function Y(t,e){var r=-1,n=t.length;e||(e=Array(n));while(++r<n){e[r]=t[r]}return e}var Z=function(){try{var t=h(Object,"defineProperty");t({},"",{});return t}catch(t){}}();function tt(t,e){var r=-1,n=t==null?0:t.length;while(++r<n){if(e(t[r],r,t)===false){break}}return t}function et(t,e,r){if(e=="__proto__"&&Z){Z(t,e,{configurable:true,enumerable:true,value:r,writable:true})}else{t[e]=r}}var rt=Object.prototype;var nt=rt.hasOwnProperty;function it(t,e,r){var n=t[e];if(!(nt.call(t,e)&&d(n,r))||r===undefined&&!(e in t)){et(t,e,r)}}function ot(t,e,r,n){var i=!r;r||(r={});var o=-1,s=e.length;while(++o<s){var a=e[o];var c=n?n(r[a],t[a],a,r,t):undefined;if(c===undefined){c=t[a]}if(i){et(r,a,c)}else{it(r,a,c)}}return r}function st(t){var e=[];if(t!=null){for(var r in Object(t)){e.push(r)}}return e}var at=Object.prototype;var ct=at.hasOwnProperty;function ut(t){if(!l(t)){return st(t)}var e=v(t),r=[];for(var n in t){if(!(n=="constructor"&&(e||!ct.call(t,n)))){r.push(n)}}return r}function ft(t){return b(t)?g(t,true):ut(t)}var lt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ht=/^\w*$/;function dt(t,e){if(u(t)){return false}var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||N(t)){return true}return ht.test(t)||!lt.test(t)||e!=null&&t in Object(e)}var vt="Expected a function";function bt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function"){throw new TypeError(vt)}var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i)){return o.get(i)}var s=t.apply(this,n);r.cache=o.set(i,s)||o;return s};r.cache=new(bt.Cache||p);return r}bt.Cache=p;var gt=500;function pt(t){var e=bt(t,(function(t){if(r.size===gt){r.clear()}return t}));var r=e.cache;return e}var wt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var jt=/\\(\\)?/g;var mt=pt((function(t){var e=[];if(t.charCodeAt(0)===46){e.push("")}t.replace(wt,(function(t,r,n,i){e.push(n?i.replace(jt,"$1"):r||t)}));return e}));function yt(t){return t==null?"":K(t)}function Ct(t,e){if(u(t)){return t}return dt(t,e)?[t]:mt(yt(t))}var At=1/0;function St(t){if(typeof t=="string"||N(t)){return t}var e=t+"";return e=="0"&&1/t==-At?"-0":e}function xt(t,e){e=Ct(e,t);var r=0,n=e.length;while(t!=null&&r<n){t=t[St(e[r++])]}return r&&r==n?t:undefined}function Ot(t,e,r){var n=t==null?undefined:xt(t,e);return n===undefined?r:n}var kt=w(Object.getPrototypeOf,Object);function Ut(t,e){return t&&ot(e,j(e),t)}function It(t,e){return t&&ot(e,ft(e),t)}var Rt=typeof exports=="object"&&exports&&!exports.nodeType&&exports;var Et=Rt&&typeof module=="object"&&module&&!module.nodeType&&module;var Ft=Et&&Et.exports===Rt;var Dt=Ft?m.Buffer:undefined,Gt=Dt?Dt.allocUnsafe:undefined;function Mt(t,e){if(e){return t.slice()}var r=t.length,n=Gt?Gt(r):new t.constructor(r);t.copy(n);return n}function Pt(t,e){return ot(t,y(t),e)}var Bt=Object.getOwnPropertySymbols;var Ht=!Bt?C:function(t){var e=[];while(t){A(e,y(t));t=kt(t)}return e};function Tt(t,e){return ot(t,Ht(t),e)}function Wt(t){return S(t,ft,Ht)}var $t=Object.prototype;var _t=$t.hasOwnProperty;function Vt(t){var e=t.length,r=new t.constructor(e);if(e&&typeof t[0]=="string"&&_t.call(t,"index")){r.index=t.index;r.input=t.input}return r}function Nt(t){var e=new t.constructor(t.byteLength);new x(e).set(new x(t));return e}function qt(t,e){var r=e?Nt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Lt=/\w*$/;function zt(t){var e=new t.constructor(t.source,Lt.exec(t));e.lastIndex=t.lastIndex;return e}var Jt=f?f.prototype:undefined,Kt=Jt?Jt.valueOf:undefined;function Qt(t){return Kt?Object(Kt.call(t)):{}}function Xt(t,e){var r=e?Nt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Yt="[object Boolean]",Zt="[object Date]",te="[object Map]",ee="[object Number]",re="[object RegExp]",ne="[object Set]",ie="[object String]",oe="[object Symbol]";var se="[object ArrayBuffer]",ae="[object DataView]",ce="[object Float32Array]",ue="[object Float64Array]",fe="[object Int8Array]",le="[object Int16Array]",he="[object Int32Array]",de="[object Uint8Array]",ve="[object Uint8ClampedArray]",be="[object Uint16Array]",ge="[object Uint32Array]";function pe(t,e,r){var n=t.constructor;switch(e){case se:return Nt(t);case Yt:case Zt:return new n(+t);case ae:return qt(t,r);case ce:case ue:case fe:case le:case he:case de:case ve:case be:case ge:return Xt(t,r);case te:return new n;case ee:case ie:return new n(t);case re:return zt(t);case ne:return new n;case oe:return Qt(t)}}function we(t){return typeof t.constructor=="function"&&!v(t)?X(kt(t)):{}}var je="[object Map]";function me(t){return a(t)&&O(t)==je}var ye=U&&U.isMap;var Ce=ye?k(ye):me;var Ae="[object Set]";function Se(t){return a(t)&&O(t)==Ae}var xe=U&&U.isSet;var Oe=xe?k(xe):Se;var ke=1,Ue=2,Ie=4;var Re="[object Arguments]",Ee="[object Array]",Fe="[object Boolean]",De="[object Date]",Ge="[object Error]",Me="[object Function]",Pe="[object GeneratorFunction]",Be="[object Map]",He="[object Number]",Te="[object Object]",We="[object RegExp]",$e="[object Set]",_e="[object String]",Ve="[object Symbol]",Ne="[object WeakMap]";var qe="[object ArrayBuffer]",Le="[object DataView]",ze="[object Float32Array]",Je="[object Float64Array]",Ke="[object Int8Array]",Qe="[object Int16Array]",Xe="[object Int32Array]",Ye="[object Uint8Array]",Ze="[object Uint8ClampedArray]",tr="[object Uint16Array]",er="[object Uint32Array]";var rr={};rr[Re]=rr[Ee]=rr[qe]=rr[Le]=rr[Fe]=rr[De]=rr[ze]=rr[Je]=rr[Ke]=rr[Qe]=rr[Xe]=rr[Be]=rr[He]=rr[Te]=rr[We]=rr[$e]=rr[_e]=rr[Ve]=rr[Ye]=rr[Ze]=rr[tr]=rr[er]=true;rr[Ge]=rr[Me]=rr[Ne]=false;function nr(t,e,r,n,i,o){var s,a=e&ke,c=e&Ue,f=e&Ie;if(r){s=i?r(t,n,i,o):r(t)}if(s!==undefined){return s}if(!l(t)){return t}var h=u(t);if(h){s=Vt(t);if(!a){return Y(t,s)}}else{var d=O(t),v=d==Me||d==Pe;if(I(t)){return Mt(t,a)}if(d==Te||d==Re||v&&!i){s=c||v?{}:we(t);if(!a){return c?Tt(t,It(s,t)):Pt(t,Ut(s,t))}}else{if(!rr[d]){return i?t:{}}s=pe(t,d,a)}}o||(o=new R);var b=o.get(t);if(b){return b}o.set(t,s);if(Oe(t)){t.forEach((function(n){s.add(nr(n,e,r,n,t,o))}))}else if(Ce(t)){t.forEach((function(n,i){s.set(i,nr(n,e,r,i,t,o))}))}var g=f?c?Wt:E:c?ft:j;var p=h?undefined:g(t);tt(p||t,(function(n,i){if(p){i=n;n=t[i]}it(s,i,nr(n,e,r,i,t,o))}));return s}var ir=1,or=4;function sr(t){return nr(t,ir|or)}const ar=":host{display:block;--wcs-grid-highlight-color:var(--wcs-light)}:host th{background-color:var(--wcs-light)}:host th:not(:first-child){border-left:solid 1px var(--wcs-text-light)}:host ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:none}:host table{width:100%;border-spacing:0}:host td{color:var(--wcs-gray-light);margin:0;padding:calc(var(--wcs-padding) / 2) var(--wcs-padding)}:host tr:not(:last-child) td{border-bottom:solid 1px var(--wcs-text-light)}:host .wcs-grid-selection-column{padding:calc(var(--wcs-padding) / 2) var(--wcs-padding);width:40px}:host tr.selected{background-color:var(--wcs-grid-highlight-color)}:host .loading{text-align:center}:host([selection]) ::slotted([slot=grid-column]:first-child){--wcs-grid-column-border-left:solid 1px var(--wcs-text-light) !important}";const cr=class{constructor(r){t(this,r);this.wcsGridSelectionChange=e(this,"wcsGridSelectionChange",7);this.wcsGridAllSelectionChange=e(this,"wcsGridAllSelectionChange",7);this.serverMode=false;this.data=undefined;this.loading=undefined;this.selectionConfig="none";this.selectedItems=[];this.wcsGridPaginationId=undefined;this.rowIdPath=undefined;this.columns=undefined;this.paginationEl=undefined;this.rows=[]}onDataChange(t){this.updateGridRows(t);this.refreshSort(false)}onSelectedItemsPropertyChange(t){this.updateSelectionWithValues(t)}onHiddenColumnChange(){r(this)}updateSelectionWithValues(t){if(this.selectionConfig==="single"){this.rows.map((t=>t.selected=false));for(const e of this.rows){if(F(e.data,t)){e.selected=true;break}}}else if(this.selectionConfig==="multiple"){this.rows.map((t=>t.selected=false));for(const e of this.rows){if(t.find((t=>F(t,e.data)))){e.selected=true}}}this.rows=sr(this.rows)}wcsGridRowToWcsGridRowData(t){return{selected:t.selected,page:t.page,data:t.data}}updateGridRows(t){const e=[];if(t&&this.columns){for(let r=0;r<t.length;r++){const n={uuid:_(),data:t[r],selected:false,cells:[]};for(const e of this.columns){n.cells.push({content:Ot(t[r],e.path),column:e,formatter:e.formatter})}e.push(n)}this.rows=e;this.updatePageIndex()}}componentDidLoad(){this.columns=this.getGridColumnsFromTemplate();this.paginationEl=this.wcsGridPaginationId?document.getElementById(this.wcsGridPaginationId):this.getGridPaginationsFromTemplate()[0];this.updateGridRows(this.data);if(this.selectedItems){this.updateSelectionWithValues(this.selectedItems)}this.refreshSort(true)}refreshSort(t){if(this.columns){const[e,...r]=this.columns.filter((t=>t.sortOrder!=="none"));if(e&&!this.serverMode){this.sortBy(e)}t&&this.disableSortOrderForColumns(r)}}disableSortOrderForColumns(t){t===null||t===void 0?void 0:t.forEach((t=>t.sortOrder="none"))}getGridColumnsFromTemplate(){const t=this.el.shadowRoot.querySelector('slot[name="grid-column"]');return t.assignedElements()}getGridPaginationsFromTemplate(){const t=this.el.shadowRoot.querySelector('slot[name="grid-pagination"]');return t.assignedElements()}sortChangeEventHandler(t){if(t.detail.order==="none")return;this.disableSortOrderForColumns(this.columns.filter((e=>e!==t.detail.column)));if(this.serverMode)return;this.sortBy(t.detail.column);this.updatePageIndex()}sortBy(t){if(t.sortFn){this.rows=sr(this.rows).sort(((e,r)=>t.sortFn(e.data,r.data,t)*D(t.sortOrder)))}else{this.rows=sr(this.rows).sort(((e,r)=>{const n=t.path;return(Ot(e.data,n)<Ot(r.data,n)?-1:Ot(e.data,n)>Ot(r.data,n)?1:0)*D(t.sortOrder)}))}}updatePageIndex(){if(!this.serverMode&&this.paginationEl){this.paginationEl.itemsCount=this.data.length;this.paginationEl.pageCount=Math.ceil(this.data.length/this.paginationEl.pageSize);if(this.paginationEl.pageCount<=1){this.paginationEl.currentPage=s.INDEX_FIRST_PAGE}else if(this.paginationEl.pageCount>0&&this.paginationEl.currentPage+1>this.paginationEl.pageCount){this.paginationEl.currentPage=this.paginationEl.pageCount-1}const t=sr(this.rows);t.forEach(((t,e)=>t.page=Math.floor(e/this.paginationEl.pageSize)));this.rows=[...t]}}paginationChangeEventHandler(){this.onPaginationChange()}paginationChangeEventHandlerOutside(t){if(this.wcsGridPaginationId&&this.wcsGridPaginationId===t.target.id){this.onPaginationChange()}}onPaginationChange(){if(this.serverMode)return;this.updatePageIndex()}onRowSelection(t){if(this.selectionConfig==="single"){this.rows.filter((e=>e.uuid!==t.uuid)).map((t=>t.selected=false))}t.selected=!t.selected;if(this.selectionConfig!=="single"||t.selected){this.wcsGridSelectionChange.emit({row:this.wcsGridRowToWcsGridRowData(t)})}this.rows=sr(this.rows)}selectAllRows(){const t=this.getRowsForCurrentPage();const e=!this.allRowsAreSelected();t.map((t=>t.selected=e));this.wcsGridAllSelectionChange.emit({rows:e?t.map((t=>this.wcsGridRowToWcsGridRowData(t))):[]});this.rows=sr(this.rows)}allRowsAreSelected(){const t=this.getRowsForCurrentPage();return t.length>0&&t.filter((t=>t.selected)).length===t.length}getRowsForCurrentPage(){if(this.paginationEl){return this.rows.filter((t=>t.page===this.paginationEl.currentPage))}return this.rows}renderSelectionColumn(t){switch(this.selectionConfig){case"none":return;case"single":return n("td",null,n("wcs-radio",{checked:t.selected,onClick:this.onRowSelection.bind(this,t)}));case"multiple":return n("td",null,n("wcs-checkbox",{checked:t.selected,onWcsChange:this.onRowSelection.bind(this,t)}))}}getCellContent(t,e){if(e.formatter){return e.formatter(n,e.column,this.wcsGridRowToWcsGridRowData(t))}return e.content}totalColumnCount(){if(!this.columns){return 0}return this.columns.length+(this.selectionConfig==="none"?0:1)}render(){var t;return n(i,null,n("table",null,n("thead",null,this.selectionConfig==="none"?"":n("th",{class:"wcs-grid-selection-column"},this.selectionConfig==="single"?"":n("wcs-checkbox",{checked:this.allRowsAreSelected(),onWcsChange:this.selectAllRows.bind(this)})),n("slot",{name:"grid-column"})),n("tbody",null,this.loading?n("tr",null,n("td",{colSpan:this.totalColumnCount(),class:"loading"},n("wcs-spinner",null))):(t=this.rows)===null||t===void 0?void 0:t.filter((t=>this.serverMode||!this.paginationEl||t.page===this.paginationEl.currentPage)).map((t=>this.renderRow(t))))),n("slot",{name:"grid-pagination"}))}renderRow(t){var e;return n("tr",{class:t.selected?"selected":""},this.renderSelectionColumn(t),(e=t.cells)===null||e===void 0?void 0:e.map((e=>{if(e.column.hidden){return}return e.column.customCells?n("td",null,n("slot",{name:e.column.id+"-"+t.data[this.rowIdPath]})):n("td",{part:e.column.path+"-column"},this.getCellContent(t,e))})))}get el(){return o(this)}static get watchers(){return{data:["onDataChange"],selectedItems:["onSelectedItemsPropertyChange"]}}};cr.style=ar;export{cr as wcs_grid};
2
+ //# sourceMappingURL=p-15058c29.entry.js.map