@dloizides/ui-forms 1.30.0 → 1.31.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/dist/index.d.mts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -908,7 +908,6 @@ function useThemedInput(options = {}) {
|
|
|
908
908
|
colors.border,
|
|
909
909
|
colors.surface,
|
|
910
910
|
colors.surfaceElevated,
|
|
911
|
-
colors.background,
|
|
912
911
|
colors.textSecondary,
|
|
913
912
|
editable,
|
|
914
913
|
primary,
|
|
@@ -2166,7 +2165,8 @@ function WebDateInput({ fieldProps, context, webInputType }) {
|
|
|
2166
2165
|
);
|
|
2167
2166
|
}
|
|
2168
2167
|
var IS_WEB7 = Platform.OS === "web";
|
|
2169
|
-
function
|
|
2168
|
+
function TemporalInput({ fieldProps, context, webInputType }) {
|
|
2169
|
+
if (IS_WEB7) return /* @__PURE__ */ jsx(WebDateInput, { context, fieldProps, webInputType });
|
|
2170
2170
|
return /* @__PURE__ */ jsx(
|
|
2171
2171
|
ThemedTextInput,
|
|
2172
2172
|
{
|
|
@@ -2176,7 +2176,6 @@ function renderNativeInput(fieldProps, context) {
|
|
|
2176
2176
|
editable: fieldProps.disabled !== true,
|
|
2177
2177
|
hasError: context.hasError,
|
|
2178
2178
|
id: context.controlId,
|
|
2179
|
-
placeholder: fieldProps.placeholder,
|
|
2180
2179
|
requiredField: fieldProps.required,
|
|
2181
2180
|
testID: fieldProps.testID,
|
|
2182
2181
|
value: fieldProps.value,
|
|
@@ -2187,7 +2186,7 @@ function renderNativeInput(fieldProps, context) {
|
|
|
2187
2186
|
}
|
|
2188
2187
|
function TemporalField({ fieldProps, webInputType }) {
|
|
2189
2188
|
const { label, required, hint, error } = fieldProps;
|
|
2190
|
-
return /* @__PURE__ */ jsx(Field, { error, hint, label, required, children: (context) =>
|
|
2189
|
+
return /* @__PURE__ */ jsx(Field, { error, hint, label, required, children: (context) => /* @__PURE__ */ jsx(TemporalInput, { context, fieldProps, webInputType }) });
|
|
2191
2190
|
}
|
|
2192
2191
|
function DateField(props) {
|
|
2193
2192
|
return /* @__PURE__ */ jsx(TemporalField, { fieldProps: props, webInputType: "date" });
|
|
@@ -2198,20 +2197,17 @@ function DateRangeControl({
|
|
|
2198
2197
|
onSubmit,
|
|
2199
2198
|
fromLabel,
|
|
2200
2199
|
toLabel,
|
|
2201
|
-
fromPlaceholder,
|
|
2202
|
-
toPlaceholder,
|
|
2203
2200
|
accessibilityHint,
|
|
2204
2201
|
style,
|
|
2205
2202
|
testID
|
|
2206
2203
|
}) {
|
|
2207
|
-
const hint = accessibilityHint ??
|
|
2204
|
+
const hint = accessibilityHint ?? `${fromLabel} \u2013 ${toLabel}`;
|
|
2208
2205
|
return /* @__PURE__ */ jsx(GapOwnedProvider, { value: true, children: /* @__PURE__ */ jsxs(View, { style: [controlStyles.dateRow, style], testID: `${testID}-range`, children: [
|
|
2209
2206
|
/* @__PURE__ */ jsx(View, { style: controlStyles.dateCol, children: /* @__PURE__ */ jsx(
|
|
2210
2207
|
DateField,
|
|
2211
2208
|
{
|
|
2212
2209
|
accessibilityHint: hint,
|
|
2213
2210
|
label: fromLabel,
|
|
2214
|
-
placeholder: fromPlaceholder,
|
|
2215
2211
|
testID: `${testID}-from`,
|
|
2216
2212
|
value: value.from,
|
|
2217
2213
|
onChange: (from) => onChange({ from, to: value.to }),
|
|
@@ -2223,7 +2219,6 @@ function DateRangeControl({
|
|
|
2223
2219
|
{
|
|
2224
2220
|
accessibilityHint: hint,
|
|
2225
2221
|
label: toLabel,
|
|
2226
|
-
placeholder: toPlaceholder,
|
|
2227
2222
|
testID: `${testID}-to`,
|
|
2228
2223
|
value: value.to,
|
|
2229
2224
|
onChange: (to) => onChange({ from: value.from, to }),
|
|
@@ -2235,6 +2230,9 @@ function DateRangeControl({
|
|
|
2235
2230
|
function DateTimeField(props) {
|
|
2236
2231
|
return /* @__PURE__ */ jsx(TemporalField, { fieldProps: props, webInputType: "datetime-local" });
|
|
2237
2232
|
}
|
|
2233
|
+
function DateInput({ fieldProps, context }) {
|
|
2234
|
+
return /* @__PURE__ */ jsx(TemporalInput, { context, fieldProps, webInputType: "date" });
|
|
2235
|
+
}
|
|
2238
2236
|
|
|
2239
2237
|
// src/groupSelection/groupSelection.ts
|
|
2240
2238
|
var NONE = 0;
|
|
@@ -2475,6 +2473,6 @@ var UploadWithLinkField = ({
|
|
|
2475
2473
|
] });
|
|
2476
2474
|
};
|
|
2477
2475
|
|
|
2478
|
-
export { AlignToControl, AnchoredMenu, ChipSelector, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, DateRangeControl, DateTimeField, Field, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, ResponsiveFormLayout, SelectControl, SelectField, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, isWideFormLayout, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
|
|
2476
|
+
export { AlignToControl, AnchoredMenu, ChipSelector, DEFAULT_MAX_RECENTS, DEFAULT_OPTIONAL_LABEL, DEFAULT_TYPEAHEAD_MAX_SUGGESTIONS, DEFAULT_TYPEAHEAD_MIN_CHARS, DateField, DateInput, DateRangeControl, DateTimeField, Field, FormActions, FormCell, FormCheckbox, FormField, FormGrid, FormSection, FormStack, FormStatusLine, FormSwitch, INLINE_FIELD_ROW_MIN_WIDTH, InlineFieldRow, RESPONSIVE_FORM_DEFAULT_BREAKPOINT, ResponsiveFormLayout, SelectControl, SelectField, StepperNav, StepperTabs, ThemedTextInput, TypeaheadControl, UploadWithLinkField, controlStyles, groupAriaChecked, inlineFieldRowLayout, isUnmatched, isWideFormLayout, nextHighlight, resolveGroupSelection, resolveStepNeighbours, suggestOptions, toggleGroupSelection, useFocusFirstInvalid, useKeepInView, useRecentValues, useThemedInput };
|
|
2479
2477
|
//# sourceMappingURL=index.mjs.map
|
|
2480
2478
|
//# sourceMappingURL=index.mjs.map
|