@loadsmart/loadsmart-ui 6.4.0 → 7.0.1
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/dist/components/Table/Table.d.ts +4 -12
- package/dist/components/Table/Table.types.d.ts +0 -4
- package/dist/index.js +71 -96
- package/dist/index.js.map +1 -1
- package/dist/{miranda-compatibility.theme-22a9ce26.js → miranda-compatibility.theme-bb671a80.js} +2 -2
- package/dist/{miranda-compatibility.theme-22a9ce26.js.map → miranda-compatibility.theme-bb671a80.js.map} +1 -1
- package/dist/prop-e569d46a.js +2 -0
- package/dist/{prop-201ffe28.js.map → prop-e569d46a.js.map} +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/theming/index.js +1 -1
- package/dist/tools/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Table/Table.stories.tsx +27 -27
- package/src/components/Table/Table.test.tsx +10 -10
- package/src/components/Table/Table.tsx +35 -90
- package/src/components/Table/Table.types.ts +0 -5
- package/src/testing/DatePickerEvent/DatePickerEvent.ts +15 -18
- package/src/testing/SelectEvent/SelectEvent.ts +2 -2
- package/src/theming/themes/miranda-compatibility.theme.ts +1 -1
- package/dist/prop-201ffe28.js +0 -2
|
@@ -17,7 +17,6 @@ export interface TableProps<T extends Selectable = TableSelectableRow>
|
|
|
17
17
|
extends HTMLAttributes<HTMLTableElement> {
|
|
18
18
|
scale?: Scale
|
|
19
19
|
selection?: TableSelectionConfig<T>
|
|
20
|
-
withExpandableRows?: boolean
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {
|
|
@@ -57,10 +56,6 @@ export interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {
|
|
|
57
56
|
selected?: boolean
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
export interface TableHeadCellProps extends TableCellProps {
|
|
61
|
-
capitalized?: boolean
|
|
62
|
-
}
|
|
63
|
-
|
|
64
59
|
export type TableColumn<T = Record<string, unknown>> = {
|
|
65
60
|
/**
|
|
66
61
|
* The accessor of you entry interface
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import { act, queries, fireEvent, waitForElementToBeRemoved } from '@testing-library/react'
|
|
3
|
-
|
|
2
|
+
import { act, queries, fireEvent, waitFor, waitForElementToBeRemoved } from '@testing-library/react'
|
|
4
3
|
// find the date picker container from its input field 🤷
|
|
5
4
|
function getContainerFromInput(input: HTMLElement): HTMLElement {
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -20,10 +19,10 @@ async function expand(input: HTMLElement): Promise<void> {
|
|
|
20
19
|
return
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
fireEvent.click(input)
|
|
22
|
+
fireEvent.click(input)
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
await waitFor(() => {
|
|
25
|
+
expect(queries.getByRole(datePickerContainer, 'menu')).toBeInTheDocument()
|
|
27
26
|
})
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -40,10 +39,10 @@ async function collapse(input: HTMLElement): Promise<void> {
|
|
|
40
39
|
return
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
fireEvent.click(queries.getByText(datePickerContainer, 'Close'))
|
|
42
|
+
fireEvent.click(queries.getByText(datePickerContainer, 'Close'))
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
await waitFor(() => {
|
|
45
|
+
expect(queries.queryByRole(datePickerContainer, 'menu')).not.toBeInTheDocument()
|
|
47
46
|
})
|
|
48
47
|
}
|
|
49
48
|
|
|
@@ -59,15 +58,15 @@ async function pick(day: string, input: HTMLElement): Promise<void> {
|
|
|
59
58
|
|
|
60
59
|
await expand(input)
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
act(() => {
|
|
63
62
|
input.focus()
|
|
63
|
+
})
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
const dayElement = queries.getByLabelText(datePickerContainer, day)
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
})
|
|
67
|
+
if (dayElement && dayElement.getAttribute('aria-checked') == 'false') {
|
|
68
|
+
fireEvent.click(dayElement)
|
|
69
|
+
}
|
|
71
70
|
|
|
72
71
|
await collapse(input)
|
|
73
72
|
}
|
|
@@ -80,11 +79,9 @@ async function pick(day: string, input: HTMLElement): Promise<void> {
|
|
|
80
79
|
async function clear(input: HTMLElement): Promise<void> {
|
|
81
80
|
const datePickerContainer = getContainerFromInput(input)
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
const clearButton = queries.getByLabelText(datePickerContainer, 'Clear selection')
|
|
82
|
+
const clearButton = queries.getByLabelText(datePickerContainer, 'Clear selection')
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
})
|
|
84
|
+
fireEvent.click(clearButton)
|
|
88
85
|
|
|
89
86
|
await collapse(input)
|
|
90
87
|
}
|
|
@@ -89,8 +89,8 @@ async function expand(input: HTMLElement): Promise<void> {
|
|
|
89
89
|
input.dispatchEvent(new MouseEvent('click', { bubbles: true }))
|
|
90
90
|
})
|
|
91
91
|
|
|
92
|
-
await waitFor(
|
|
93
|
-
expect(
|
|
92
|
+
await waitFor(() => {
|
|
93
|
+
expect(within(getSelectContainer(input)).getByRole('listbox')).toBeInTheDocument()
|
|
94
94
|
})
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -872,7 +872,7 @@ const mirandaCompatibility = {
|
|
|
872
872
|
// Table
|
|
873
873
|
'table-row-default-color': color('neutral-white'),
|
|
874
874
|
'table-row-variant-color': toCSSValue('color-neutral-40', 0.2),
|
|
875
|
-
'table-row-selected-color': toCSSValue('color-primary-
|
|
875
|
+
'table-row-selected-color': toCSSValue('color-primary-20'),
|
|
876
876
|
|
|
877
877
|
// Top Navigation
|
|
878
878
|
'top-navigation-height': rem('60px'),
|
package/dist/prop-201ffe28.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("./toArray-b56541b4.js"),n=require("./miranda-compatibility.theme-22a9ce26.js"),e=require("./theming/index.js");function r(t,r){return Object.keys(t||{}).reduce(((o,i)=>{var u;let s=t[i];if(n.isFunction(s)&&(s=s(r)),s){const t=i,n=null!==(u=e.getToken(t,r))&&void 0!==u?u:i;return[...o,n]}return o}),[]).join(" ")}function o(...t){const[n,e]=t;return null==n||!1===n||Number.isNaN(n)?e||n:"string"==typeof n&&0===n.length&&e||n}exports.conditional=function(...e){return function(o){let i=[];for(let u=0;u<e.length;u++){const s=e[u];n.isFunction(s)?i.push(s(o)):t.isObject(s)?i=i.concat(r(s,o)):s&&i.push(String(s))}return i.join(" ")}},exports.prop=function(t,n,e=o){return r=>e(r[t],n)},exports.whenProps=function(e){return function(r){const o=t.toArray(e);let i=!1;for(let e=0;e<o.length;e++){const u=o[e],s=Object.keys(u);let c=!0;for(let e=0;e<s.length&&c;e++){const o=s[e],i=n.lodash_get(r,o),l=u[o];c=Array.isArray(l)?c&&t.toArray(l).includes(i):n.isFunction(l)?c&&Boolean(l(i)):c&&l===i}i=i||c}return i}};
|
|
2
|
-
//# sourceMappingURL=prop-201ffe28.js.map
|