@ukic/canary-web-components 2.0.0-canary.34 → 2.0.0-canary.36
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.
- package/README.md +1 -0
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/helpers-951fb33a.js.map +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +23 -0
- package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-table.cjs.entry.js +23 -26
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js +31 -5
- package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +2 -2
- package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.js +42 -27
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-data-table/story-data.js +39 -4
- package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +4 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +50 -5
- package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
- package/dist/collection/utils/types.js.map +1 -1
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-badge.js +25 -2
- package/dist/components/ic-badge.js.map +1 -1
- package/dist/components/ic-data-table.js +24 -26
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input2.js +1 -1
- package/dist/components/ic-date-input2.js.map +1 -1
- package/dist/components/ic-navigation-button.js +2 -2
- package/dist/components/ic-navigation-button.js.map +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-pagination-bar2.js +33 -5
- package/dist/components/ic-pagination-bar2.js.map +1 -1
- package/dist/components/ic-toast.js +2 -2
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-938a0ccc.entry.js → p-080ebc66.entry.js} +2 -2
- package/dist/core/{p-938a0ccc.entry.js.map → p-080ebc66.entry.js.map} +1 -1
- package/dist/core/p-20241d58.entry.js +2 -0
- package/dist/core/p-20241d58.entry.js.map +1 -0
- package/dist/core/p-4476d3b0.entry.js +2 -0
- package/dist/core/p-4476d3b0.entry.js.map +1 -0
- package/dist/core/p-8ab58daa.js.map +1 -1
- package/dist/core/p-95871655.entry.js.map +1 -1
- package/dist/core/p-9c80c37d.entry.js +2 -0
- package/dist/core/p-9c80c37d.entry.js.map +1 -0
- package/dist/core/{p-4f118361.entry.js → p-9cd73369.entry.js} +2 -2
- package/dist/core/p-9cd73369.entry.js.map +1 -0
- package/dist/core/p-b68d6867.entry.js +2 -0
- package/dist/core/p-b68d6867.entry.js.map +1 -0
- package/dist/core/{p-2b61d283.entry.js → p-f2bb3c93.entry.js} +2 -2
- package/dist/core/{p-2b61d283.entry.js.map → p-f2bb3c93.entry.js.map} +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/helpers-948df101.js.map +1 -1
- package/dist/esm/ic-badge.entry.js +23 -0
- package/dist/esm/ic-badge.entry.js.map +1 -1
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-data-table.entry.js +23 -26
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +1 -1
- package/dist/esm/ic-date-input.entry.js.map +1 -1
- package/dist/esm/ic-empty-state_2.entry.js +31 -5
- package/dist/esm/ic-empty-state_2.entry.js.map +1 -1
- package/dist/esm/ic-navigation-button.entry.js +2 -2
- package/dist/esm/ic-navigation-button.entry.js.map +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +2 -2
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +4 -0
- package/dist/types/components/ic-data-table/story-data.d.ts +2 -1
- package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +5 -0
- package/dist/types/components.d.ts +16 -0
- package/dist/types/utils/types.d.ts +10 -9
- package/hydrate/index.js +87 -39
- package/package.json +12 -3
- package/dist/core/p-3156304b.entry.js +0 -2
- package/dist/core/p-3156304b.entry.js.map +0 -1
- package/dist/core/p-4f118361.entry.js.map +0 -1
- package/dist/core/p-61ca218b.entry.js +0 -2
- package/dist/core/p-61ca218b.entry.js.map +0 -1
- package/dist/core/p-d9f8f96d.entry.js +0 -2
- package/dist/core/p-d9f8f96d.entry.js.map +0 -1
- package/dist/core/p-e7439c1e.entry.js +0 -2
- package/dist/core/p-e7439c1e.entry.js.map +0 -1
@@ -14,9 +14,9 @@ const ROW_HEADER_TITLES = [
|
|
14
14
|
const imageIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h600q24 0 42 18t18 42v600q0 24-18 42t-42 18H180Zm0-60h600v-600H180v600Zm56-97h489L578-473 446-302l-93-127-117 152Zm-56 97v-600 600Z"/></svg>';
|
15
15
|
const userIconSVG = '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-481q-66 0-108-42t-42-108q0-66 42-108t108-42q66 0 108 42t42 108q0 66-42 108t-108 42ZM160-160v-94q0-38 19-65t49-41q67-30 128.5-45T480-420q62 0 123 15.5t127.921 44.694q31.301 14.126 50.19 40.966Q800-292 800-254v94H160Zm60-60h520v-34q0-16-9.5-30.5T707-306q-64-31-117-42.5T480-360q-57 0-111 11.5T252-306q-14 7-23 21.5t-9 30.5v34Zm260-321q39 0 64.5-25.5T570-631q0-39-25.5-64.5T480-721q-39 0-64.5 25.5T390-631q0 39 25.5 64.5T480-541Zm0-90Zm0 411Z"/></svg>';
|
16
16
|
const alertIconSVG = '<svg aria-label="alert-icon" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 24 24" fill="#000000"><path d="M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z"/></svg>';
|
17
|
-
const copyButton = '<ic-button variant="icon" size="small" aria-label="you can disable tooltips on icon buttons"> <svg aria-label="copy-button" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg> </ic-button>';
|
18
|
-
const cellphoneButton = '<ic-button variant="icon" size="small" aria-label="you can disable tooltips on icon buttons"> <svg aria-label="cellphone-button" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000"><path d="M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z"/></svg> </ic-button>';
|
19
|
-
const downloadButton = '<ic-button variant="icon" size="small" aria-label="you can disable tooltips on icon buttons"> <svg aria-label="download-button" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000"><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/></svg> </ic-button>';
|
17
|
+
const copyButton = '<ic-button data-testid="copy-button" variant="icon" size="small" aria-label="you can disable tooltips on icon buttons"> <svg aria-label="copy-button" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"/></svg> </ic-button>';
|
18
|
+
const cellphoneButton = '<ic-button data-testid="cellphone-button" variant="icon" size="small" aria-label="you can disable tooltips on icon buttons"> <svg aria-label="cellphone-button" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000"><path d="M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z"/></svg> </ic-button>';
|
19
|
+
const downloadButton = '<ic-button data-testid="download-button" variant="icon" size="small" aria-label="you can disable tooltips on icon buttons"> <svg aria-label="download-button" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#000000"><path d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/></svg> </ic-button>';
|
20
20
|
// TODO: Add columnOptions
|
21
21
|
export const COLS = [
|
22
22
|
{
|
@@ -934,7 +934,8 @@ export const ACTION_DATA_ELEMENTS = [
|
|
934
934
|
firstName: {
|
935
935
|
data: "Joe",
|
936
936
|
actionElement: `${downloadButton}${cellphoneButton}${copyButton}`,
|
937
|
-
actionOnClick: () => {
|
937
|
+
actionOnClick: (event) => {
|
938
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
938
939
|
console.log("hello");
|
939
940
|
},
|
940
941
|
},
|
@@ -1240,6 +1241,40 @@ export const SortOptions = () => {
|
|
1240
1241
|
});
|
1241
1242
|
return dataTable;
|
1242
1243
|
};
|
1244
|
+
export const DisableSort = () => {
|
1245
|
+
const originalData = [...DATA];
|
1246
|
+
const dataTable = createDataTableElement("Sort", COLS, DATA);
|
1247
|
+
dataTable.setAttribute("sortable", "true");
|
1248
|
+
dataTable.setAttribute("disable-auto-sort", "true");
|
1249
|
+
dataTable.addEventListener("icSortChange", (event) => {
|
1250
|
+
console.log("Sort changed", event.detail);
|
1251
|
+
if (event.detail.sorted === "ascending") {
|
1252
|
+
DATA.sort((a, b) => {
|
1253
|
+
const column = event.detail.columnName;
|
1254
|
+
if (a[column] < b[column])
|
1255
|
+
return -1;
|
1256
|
+
if (a[column] > b[column])
|
1257
|
+
return 1;
|
1258
|
+
return 0;
|
1259
|
+
});
|
1260
|
+
}
|
1261
|
+
else if (event.detail.sorted === "descending") {
|
1262
|
+
DATA.sort((a, b) => {
|
1263
|
+
const column = event.detail.columnName;
|
1264
|
+
if (a[column] < b[column])
|
1265
|
+
return 1;
|
1266
|
+
if (a[column] > b[column])
|
1267
|
+
return -1;
|
1268
|
+
return 0;
|
1269
|
+
});
|
1270
|
+
}
|
1271
|
+
else {
|
1272
|
+
DATA.splice(0, DATA.length, ...originalData);
|
1273
|
+
}
|
1274
|
+
dataTable.data = [...DATA];
|
1275
|
+
});
|
1276
|
+
return dataTable;
|
1277
|
+
};
|
1243
1278
|
export const Pagination = () => {
|
1244
1279
|
const dataTable = createDataTableElement("Pagination", LONG_COLS, LONG_DATA);
|
1245
1280
|
dataTable.setAttribute("show-pagination", "true");
|