@masterteam/components 0.0.300 → 0.0.301

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.
@@ -342,7 +342,8 @@ declare class SelectFieldConfig extends BaseFieldConfig {
342
342
  filter: boolean;
343
343
  filterBy: string;
344
344
  filterPlaceholder: string;
345
- showClear: boolean;
345
+ /** Unset lets mt-select-field decide: clearable unless the field is required. */
346
+ showClear?: boolean;
346
347
  emptyMessage: string;
347
348
  size: string;
348
349
  hasPlaceholderPrefix: boolean;
@@ -1273,6 +1274,30 @@ declare function formatClockTime(parts: ClockTimeParts): string;
1273
1274
  /** Seconds since midnight — the comparable form of a wall-clock time. */
1274
1275
  declare function clockTimeToSeconds(parts: ClockTimeParts): number;
1275
1276
 
1277
+ /**
1278
+ * Helpers for `Checkbox` property values — a boolean the backend stores and
1279
+ * returns as **text**.
1280
+ *
1281
+ * A property value is persisted as a string, and the render pipeline formats a
1282
+ * checkbox as the literal `"True"` / `"False"` (`PropertyRenderingService`), so
1283
+ * a loaded checkbox arrives as `'True'`, not `true`. `mt-toggle-field` hands
1284
+ * whatever it is given straight to `p-toggleswitch`, which decides "checked" by
1285
+ * `modelValue === trueValue` — a strict comparison a string can never win. The
1286
+ * result is a checked record whose edit form renders every toggle off, and a
1287
+ * silent flip to `false` the moment the user saves without touching it.
1288
+ *
1289
+ * The truth set mirrors the backend's own `string.ToBool()`, which accepts
1290
+ * `1` / `true` / `yes` / `ok` case-insensitively.
1291
+ */
1292
+ /**
1293
+ * Coerce a stored checkbox value to a real boolean.
1294
+ *
1295
+ * Returns `null` for a value that was never set (`null`, `undefined`, blank
1296
+ * text) rather than `false`, so an untouched checkbox stays "empty" for the
1297
+ * callers that decide whether a field carries anything to submit.
1298
+ */
1299
+ declare function coerceCheckboxValue(value: unknown): boolean | null;
1300
+
1276
1301
  type MTDateFormatType = 'date' | 'dateTime' | 'time';
1277
1302
  declare class MTDateFormatPipe implements PipeTransform {
1278
1303
  private readonly locale;
@@ -1282,5 +1307,5 @@ declare class MTDateFormatPipe implements PipeTransform {
1282
1307
  static ɵpipe: i0.ɵɵPipeDeclaration<MTDateFormatPipe, "mtDateFormat", true>;
1283
1308
  }
1284
1309
 
1285
- export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, READABLE_DARK_INK, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, WCAG_AA_NORMAL_TEXT, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, clockTimeToSeconds, contrastRatio, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, formatClockTime, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, newFieldId, parseClockTime, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, readableTextOn, relativeLuminance, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, toClockTimeParts, wrapValidatorWithMessage };
1310
+ export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, READABLE_DARK_INK, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, WCAG_AA_NORMAL_TEXT, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, clockTimeToSeconds, coerceCheckboxValue, contrastRatio, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, formatClockTime, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, newFieldId, parseClockTime, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, readableTextOn, relativeLuminance, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, toClockTimeParts, wrapValidatorWithMessage };
1286
1311
  export type { ApiRequestConfig, BaseFieldConstructorConfig, ClockTimeParts, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DSColorScale, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, EntityListFieldRuntimeContext, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupCheckListPropertyConfig, LookupMatrixCellConfig, LookupModuleCheckListFieldRuntimeContext, LookupOptionItemConfig, MTDateFormatType, MTDateFormats, MTDesignIdentity, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, ScheduleItemSelectorFieldRuntimeContext, SchedulePredecessorFieldRuntimeContext, SchemaConnectionFieldRuntimeContext, SectionConfig, ValidatorType };