@dloizides/ui-tables 3.0.0 → 3.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/index.js +20 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
5
5
|
import { useReducedMotion, FadeIn } from '@dloizides/ui-motion';
|
|
6
6
|
import { Z_INDEX } from '@dloizides/design-tokens';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
|
-
import { DateRangeControl, Field, controlStyles,
|
|
8
|
+
import { DateRangeControl, DateInput, Field, controlStyles, TypeaheadControl, DEFAULT_TYPEAHEAD_MIN_CHARS, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, SelectControl } from '@dloizides/ui-forms';
|
|
9
9
|
export { DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, isUnmatched, suggestOptions } from '@dloizides/ui-forms';
|
|
10
10
|
import { useA11y } from '@dloizides/a11y';
|
|
11
11
|
|
|
@@ -1665,21 +1665,6 @@ function SelectField({ field, barTestID, value, onChange, placeholder, dropdownH
|
|
|
1665
1665
|
}
|
|
1666
1666
|
);
|
|
1667
1667
|
}
|
|
1668
|
-
var NO_HINT = "";
|
|
1669
|
-
function SingleDateField({ field, barTestID, value, onChange, onSubmit, containerStyle }) {
|
|
1670
|
-
const testID = field.testID ?? fieldTestID(barTestID, field.key);
|
|
1671
|
-
return /* @__PURE__ */ jsx(View, { style: containerStyle, testID, children: /* @__PURE__ */ jsx(
|
|
1672
|
-
DateField,
|
|
1673
|
-
{
|
|
1674
|
-
accessibilityHint: field.accessibilityHint ?? NO_HINT,
|
|
1675
|
-
label: field.label,
|
|
1676
|
-
testID: `${testID}-input`,
|
|
1677
|
-
value,
|
|
1678
|
-
onChange,
|
|
1679
|
-
onSubmit
|
|
1680
|
-
}
|
|
1681
|
-
) });
|
|
1682
|
-
}
|
|
1683
1668
|
function TextField({ field, barTestID, value, onChange, onSubmit }) {
|
|
1684
1669
|
const { theme } = useUi();
|
|
1685
1670
|
const { colors } = theme;
|
|
@@ -1731,6 +1716,7 @@ function clampedMinWidth(minWidth) {
|
|
|
1731
1716
|
}
|
|
1732
1717
|
var EMPTY_RANGE = { from: "", to: "" };
|
|
1733
1718
|
var GROW_FLEX = 1;
|
|
1719
|
+
var NO_HINT = "";
|
|
1734
1720
|
function asString(value) {
|
|
1735
1721
|
return typeof value === "string" ? value : "";
|
|
1736
1722
|
}
|
|
@@ -1752,21 +1738,26 @@ function FilterFieldView({ field, barTestID, values, setField, onSubmit, strings
|
|
|
1752
1738
|
return /* @__PURE__ */ jsx(BooleanField, { field, barTestID, value: asBool(raw), onChange: (v) => setField(field.key, v) });
|
|
1753
1739
|
}
|
|
1754
1740
|
const containerStyle = fieldContainerStyle(field);
|
|
1755
|
-
|
|
1756
|
-
return /* @__PURE__ */ jsx(
|
|
1757
|
-
SingleDateField,
|
|
1758
|
-
{
|
|
1759
|
-
barTestID,
|
|
1760
|
-
containerStyle,
|
|
1761
|
-
field,
|
|
1762
|
-
value: asString(raw),
|
|
1763
|
-
onChange: (v) => setField(field.key, v),
|
|
1764
|
-
onSubmit
|
|
1765
|
-
}
|
|
1766
|
-
);
|
|
1767
|
-
}
|
|
1741
|
+
const testID = field.testID ?? fieldTestID(barTestID, field.key);
|
|
1768
1742
|
const body = (() => {
|
|
1769
1743
|
switch (field.kind) {
|
|
1744
|
+
case "date":
|
|
1745
|
+
return function renderDateInput(context) {
|
|
1746
|
+
return /* @__PURE__ */ jsx(
|
|
1747
|
+
DateInput,
|
|
1748
|
+
{
|
|
1749
|
+
context,
|
|
1750
|
+
fieldProps: {
|
|
1751
|
+
accessibilityHint: field.accessibilityHint ?? NO_HINT,
|
|
1752
|
+
label: field.label,
|
|
1753
|
+
testID: `${testID}-input`,
|
|
1754
|
+
value: asString(raw),
|
|
1755
|
+
onChange: (v) => setField(field.key, v),
|
|
1756
|
+
onSubmit
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
);
|
|
1760
|
+
};
|
|
1770
1761
|
case "select":
|
|
1771
1762
|
if (renderSelect !== void 0) {
|
|
1772
1763
|
return renderSelect({
|
|
@@ -1832,7 +1823,7 @@ function FilterFieldView({ field, barTestID, values, setField, onSubmit, strings
|
|
|
1832
1823
|
containerStyle,
|
|
1833
1824
|
label: field.label,
|
|
1834
1825
|
labelVariant: "control",
|
|
1835
|
-
testID
|
|
1826
|
+
testID,
|
|
1836
1827
|
children: body
|
|
1837
1828
|
}
|
|
1838
1829
|
);
|