@dloizides/ui-forms 1.15.0 → 1.17.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.
- package/CHANGELOG.md +402 -383
- package/dist/index.d.mts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -958,10 +958,13 @@ var OUTLINE_PAD_H = 12;
|
|
|
958
958
|
var OUTLINE_PAD_V = 5;
|
|
959
959
|
var OUTLINE_FONT_SIZE = 13;
|
|
960
960
|
var CHIP_ICON_GAP = 6;
|
|
961
|
+
var MIN_TARGET_PX = 44;
|
|
961
962
|
var chipStyles = StyleSheet.create({
|
|
962
963
|
chip: {
|
|
963
964
|
paddingHorizontal: 12,
|
|
964
965
|
paddingVertical: 6,
|
|
966
|
+
minHeight: MIN_TARGET_PX,
|
|
967
|
+
justifyContent: "center",
|
|
965
968
|
borderRadius: SOLID_RADIUS,
|
|
966
969
|
backgroundColor: TRANSPARENT_COLOR,
|
|
967
970
|
borderWidth: 1
|
|
@@ -969,6 +972,8 @@ var chipStyles = StyleSheet.create({
|
|
|
969
972
|
chipOutline: {
|
|
970
973
|
paddingHorizontal: OUTLINE_PAD_H,
|
|
971
974
|
paddingVertical: OUTLINE_PAD_V,
|
|
975
|
+
minHeight: MIN_TARGET_PX,
|
|
976
|
+
justifyContent: "center",
|
|
972
977
|
borderRadius: OUTLINE_RADIUS,
|
|
973
978
|
borderWidth: 1
|
|
974
979
|
},
|
|
@@ -1673,6 +1678,30 @@ function DateRangeControl({
|
|
|
1673
1678
|
] });
|
|
1674
1679
|
}
|
|
1675
1680
|
|
|
1676
|
-
|
|
1681
|
+
// src/groupSelection/groupSelection.ts
|
|
1682
|
+
var NONE = 0;
|
|
1683
|
+
function countSelected(selected, groupKeys) {
|
|
1684
|
+
return groupKeys.filter((key) => selected.includes(key)).length;
|
|
1685
|
+
}
|
|
1686
|
+
function resolveGroupSelection(selected, groupKeys) {
|
|
1687
|
+
const count = countSelected(selected, groupKeys);
|
|
1688
|
+
if (count === NONE) return { all: false, some: false };
|
|
1689
|
+
return count === groupKeys.length ? { all: true, some: false } : { all: false, some: true };
|
|
1690
|
+
}
|
|
1691
|
+
function groupAriaChecked(state) {
|
|
1692
|
+
if (state.all) return true;
|
|
1693
|
+
return state.some ? "mixed" : false;
|
|
1694
|
+
}
|
|
1695
|
+
function toggleGroupSelection(selected, groupKeys, order) {
|
|
1696
|
+
const { all } = resolveGroupSelection(selected, groupKeys);
|
|
1697
|
+
if (all) return selected.filter((key) => !groupKeys.includes(key));
|
|
1698
|
+
const merged = [...selected];
|
|
1699
|
+
groupKeys.forEach((key) => {
|
|
1700
|
+
if (!merged.includes(key)) merged.push(key);
|
|
1701
|
+
});
|
|
1702
|
+
return order === void 0 ? merged : order.filter((key) => merged.includes(key));
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
export { AnchoredMenu, ChipSelector, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateRangeControl, Field, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormSwitch, SelectControl, ThemedTextInput, TypeaheadControl, controlStyles, groupAriaChecked, isUnmatched, resolveGroupSelection, suggestOptions, toggleGroupSelection, useRecentValues, useThemedInput };
|
|
1677
1706
|
//# sourceMappingURL=index.mjs.map
|
|
1678
1707
|
//# sourceMappingURL=index.mjs.map
|