cps-ui-kit 21.12.0 → 21.13.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/fesm2022/cps-ui-kit.mjs +77 -52
- package/fesm2022/cps-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/cps-ui-kit.d.ts +204 -1
package/package.json
CHANGED
package/types/cps-ui-kit.d.ts
CHANGED
|
@@ -6000,6 +6000,209 @@ declare class CpsThemeService {
|
|
|
6000
6000
|
static ɵprov: i0.ɵɵInjectableDeclaration<CpsThemeService>;
|
|
6001
6001
|
}
|
|
6002
6002
|
|
|
6003
|
+
/**
|
|
6004
|
+
* Service for validating 6-field cron expressions with extended features.
|
|
6005
|
+
*
|
|
6006
|
+
* This service handles cron validation logic for extended cron expression formats
|
|
6007
|
+
* that support additional features beyond standard Unix cron for more flexible
|
|
6008
|
+
* scheduling capabilities.
|
|
6009
|
+
*
|
|
6010
|
+
* Format: minutes hours day-of-month month day-of-week year
|
|
6011
|
+
*
|
|
6012
|
+
* Key Features:
|
|
6013
|
+
* - Wildcards: asterisk (any value), question mark (any value for day fields)
|
|
6014
|
+
* - Ranges: 1-5, MON-FRI, JAN-MAR
|
|
6015
|
+
* - Steps: asterisk/15, 5/10, 1-5/2
|
|
6016
|
+
* - Lists: 1,3,5, MON,WED,FRI
|
|
6017
|
+
* - Special chars: L (last), W (weekday), hash (nth occurrence)
|
|
6018
|
+
* @see {@link https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html#cron-based | AWS EventBridge Scheduler - Cron-based schedules}
|
|
6019
|
+
* @group Services
|
|
6020
|
+
*/
|
|
6021
|
+
declare class CpsCronValidationService {
|
|
6022
|
+
/**
|
|
6023
|
+
* Validates a complete 6-field cron expression.
|
|
6024
|
+
*
|
|
6025
|
+
* @param cron - The 6-field cron expression to validate
|
|
6026
|
+
* @param allowEmpty - Whether to allow empty cron expressions
|
|
6027
|
+
* @returns boolean - True if the cron expression is valid
|
|
6028
|
+
* @group Method
|
|
6029
|
+
*/
|
|
6030
|
+
isValidCron(cron: string, allowEmpty?: boolean): boolean;
|
|
6031
|
+
/**
|
|
6032
|
+
* Validates all six fields of an extended cron expression.
|
|
6033
|
+
*
|
|
6034
|
+
* Extended cron format uses 6 fields: minutes hours day-of-month month day-of-week year
|
|
6035
|
+
* This method validates each field according to extended cron syntax rules,
|
|
6036
|
+
* which build upon standard Unix cron with additional features.
|
|
6037
|
+
*
|
|
6038
|
+
* Field Ranges and Features:
|
|
6039
|
+
* - Minutes (0-59): Numeric, ranges, steps, lists
|
|
6040
|
+
* - Hours (0-23): Numeric, ranges, steps, lists
|
|
6041
|
+
* - Day-of-month (1-31): Numeric + special chars (L, W, LW)
|
|
6042
|
+
* - Month (1-12): Numeric or named (JAN-DEC), ranges, steps, lists
|
|
6043
|
+
* - Day-of-week (1-7): Numeric or named (SUN-SAT), special chars (L, #)
|
|
6044
|
+
* - Year (1970-2199): Extended range for long-term scheduling
|
|
6045
|
+
*
|
|
6046
|
+
* Key Rules:
|
|
6047
|
+
* - Day-of-month and day-of-week are mutually exclusive (one must be * or ?)
|
|
6048
|
+
* - ? is only valid for day-of-month and day-of-week fields
|
|
6049
|
+
* - Special characters provide advanced scheduling capabilities
|
|
6050
|
+
*
|
|
6051
|
+
* @param parts - Array of 6 cron field strings [minutes, hours, dayOfMonth, month, dayOfWeek, year]
|
|
6052
|
+
* @returns boolean - True if all fields are valid and follow extended cron rules
|
|
6053
|
+
*/
|
|
6054
|
+
private _validateCronFields;
|
|
6055
|
+
/**
|
|
6056
|
+
* Enhanced validation for complex cron field patterns.
|
|
6057
|
+
* Supports extended cron features including ranges, steps, lists, and special characters.
|
|
6058
|
+
*
|
|
6059
|
+
* This method handles extended cron expression syntax which builds upon
|
|
6060
|
+
* standard Unix cron format with additional features for flexible scheduling.
|
|
6061
|
+
*
|
|
6062
|
+
* Supported patterns:
|
|
6063
|
+
* - Wildcards: asterisk (any value), question mark (any value for day fields)
|
|
6064
|
+
* - Ranges: 1-5 (values 1 through 5), MON-FRI (Monday through Friday)
|
|
6065
|
+
* - Steps: asterisk/10 (every 10th value), 1-5/2 (every 2nd value from 1 to 5)
|
|
6066
|
+
* - Lists: 1,3,5 (specific values), MON,WED,FRI (specific days)
|
|
6067
|
+
* - Special chars: L (last), W (weekday), hash (nth occurrence)
|
|
6068
|
+
*
|
|
6069
|
+
* @param field - The cron field value to validate (examples: "1-5/2", "MON-FRI", "asterisk/10")
|
|
6070
|
+
* @param min - Minimum valid numeric value for this field type
|
|
6071
|
+
* @param max - Maximum valid numeric value for this field type
|
|
6072
|
+
* @param type - The cron field type ('minutes', 'hours', 'dayOfMonth', 'month', 'dayOfWeek', 'year')
|
|
6073
|
+
* @returns boolean - True if the field is valid according to EventBridge Scheduler rules
|
|
6074
|
+
*/
|
|
6075
|
+
private _validateComplexField;
|
|
6076
|
+
/**
|
|
6077
|
+
* Validates single values and extended cron special characters.
|
|
6078
|
+
*
|
|
6079
|
+
* This method handles the validation of individual field values including:
|
|
6080
|
+
* - Numeric values within specified ranges
|
|
6081
|
+
* - Special characters for advanced scheduling
|
|
6082
|
+
* - Named values like month names (JAN, FEB) and day names (SUN, MON)
|
|
6083
|
+
*
|
|
6084
|
+
* Extended Cron Special Characters:
|
|
6085
|
+
* - L: Last day of month (day-of-month) or last occurrence of weekday (day-of-week)
|
|
6086
|
+
* - W: Nearest weekday to the specified day (day-of-month only)
|
|
6087
|
+
* - LW: Last weekday of the month (day-of-month only)
|
|
6088
|
+
* - #: Nth occurrence of weekday (e.g., "3#2" = 3rd Tuesday of month)
|
|
6089
|
+
*
|
|
6090
|
+
* @param value - The single value to validate (e.g., "15", "L", "15W", "MON", "3#2")
|
|
6091
|
+
* @param min - Minimum valid numeric value for this field type
|
|
6092
|
+
* @param max - Maximum valid numeric value for this field type
|
|
6093
|
+
* @param type - The cron field type for context-specific validation
|
|
6094
|
+
* @returns boolean - True if the value is valid for EventBridge Scheduler
|
|
6095
|
+
*/
|
|
6096
|
+
private _validateSingleValue;
|
|
6097
|
+
/**
|
|
6098
|
+
* Validates range patterns with step intervals.
|
|
6099
|
+
*
|
|
6100
|
+
* This method handles complex range-step patterns like "1-5/2" which means
|
|
6101
|
+
* "every 2nd value from 1 to 5" (resulting in: 1, 3, 5).
|
|
6102
|
+
*
|
|
6103
|
+
* Extended cron uses this pattern for flexible interval scheduling within specific ranges.
|
|
6104
|
+
* For example: "9-17/2" for hours would trigger at 9:00, 11:00, 13:00, 15:00, 17:00.
|
|
6105
|
+
*
|
|
6106
|
+
* @param start - Range start value (numeric or named like "MON")
|
|
6107
|
+
* @param end - Range end value (numeric or named like "FRI")
|
|
6108
|
+
* @param step - Step interval as string (must be positive integer)
|
|
6109
|
+
* @param min - Minimum allowed value for this field type
|
|
6110
|
+
* @param max - Maximum allowed value for this field type
|
|
6111
|
+
* @param type - Field type for context-aware validation (dayOfWeek gets special handling)
|
|
6112
|
+
* @returns boolean - True if the range-step pattern is valid for EventBridge
|
|
6113
|
+
*/
|
|
6114
|
+
private _validateRangeWithStep;
|
|
6115
|
+
/**
|
|
6116
|
+
* Validates simple range patterns without step intervals.
|
|
6117
|
+
*
|
|
6118
|
+
* This method handles basic range patterns like "1-5" (values 1 through 5) or
|
|
6119
|
+
* "MON-FRI" (Monday through Friday). Extended cron supports both numeric and
|
|
6120
|
+
* named ranges for flexible scheduling.
|
|
6121
|
+
*
|
|
6122
|
+
* Examples:
|
|
6123
|
+
* - "9-17" for hours: triggers every hour from 9:00 to 17:00 (9am to 5pm)
|
|
6124
|
+
* - "MON-FRI" for day-of-week: triggers Monday through Friday
|
|
6125
|
+
* - "JAN-MAR" for months: triggers January through March
|
|
6126
|
+
*
|
|
6127
|
+
* @param start - Range start value (numeric or named)
|
|
6128
|
+
* @param end - Range end value (numeric or named)
|
|
6129
|
+
* @param min - Minimum allowed value for this field type
|
|
6130
|
+
* @param max - Maximum allowed value for this field type
|
|
6131
|
+
* @param type - Field type for validation context (affects named value handling)
|
|
6132
|
+
* @returns boolean - True if the range pattern is valid for EventBridge
|
|
6133
|
+
*/
|
|
6134
|
+
private _validateSimpleRange;
|
|
6135
|
+
/**
|
|
6136
|
+
* Validates step patterns from a starting point.
|
|
6137
|
+
*
|
|
6138
|
+
* This method handles step patterns like "5/10" (every 10th value starting from 5)
|
|
6139
|
+
* or asterisk/15 (every 15th value starting from minimum). Extended cron uses this for
|
|
6140
|
+
* interval-based scheduling from specific starting points.
|
|
6141
|
+
*
|
|
6142
|
+
* Examples:
|
|
6143
|
+
* - "0/15" for minutes: triggers at 0, 15, 30, 45 minutes past the hour
|
|
6144
|
+
* - asterisk/5 for minutes: triggers every 5 minutes (0, 5, 10, 15, ...)
|
|
6145
|
+
* - "2/3" for day-of-month: triggers every 3rd day starting from the 2nd (2, 5, 8, ...)
|
|
6146
|
+
*
|
|
6147
|
+
* @param start - Starting value (can be asterisk for wildcard start or specific value)
|
|
6148
|
+
* @param step - Step interval as string (must be positive integer)
|
|
6149
|
+
* @param min - Minimum allowed value for this field type
|
|
6150
|
+
* @param max - Maximum allowed value for this field type
|
|
6151
|
+
* @param type - Field type for validation context
|
|
6152
|
+
* @returns boolean - True if the step pattern is valid for EventBridge
|
|
6153
|
+
*/
|
|
6154
|
+
private _validateStepField;
|
|
6155
|
+
/**
|
|
6156
|
+
* Validates day-of-month field with special characters.
|
|
6157
|
+
*/
|
|
6158
|
+
private _validateDayOfMonth;
|
|
6159
|
+
/**
|
|
6160
|
+
* Validates month field with support for named months.
|
|
6161
|
+
*/
|
|
6162
|
+
private _validateMonth;
|
|
6163
|
+
/**
|
|
6164
|
+
* Validates day-of-week field with support for named days and special characters.
|
|
6165
|
+
*/
|
|
6166
|
+
private _validateDayOfWeek;
|
|
6167
|
+
/**
|
|
6168
|
+
* Validates mutual exclusivity rule for day-of-month and day-of-week fields.
|
|
6169
|
+
* Extended cron requires that one of these fields must be a wildcard.
|
|
6170
|
+
*/
|
|
6171
|
+
private _validateDayMutualExclusivity;
|
|
6172
|
+
/**
|
|
6173
|
+
* Checks if a value represents a valid day of the week (numeric or named).
|
|
6174
|
+
*/
|
|
6175
|
+
private _isValidDayOfWeek;
|
|
6176
|
+
/**
|
|
6177
|
+
* Checks if a value represents a valid month name.
|
|
6178
|
+
*/
|
|
6179
|
+
private _isValidMonthName;
|
|
6180
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CpsCronValidationService, never>;
|
|
6181
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CpsCronValidationService>;
|
|
6182
|
+
}
|
|
6183
|
+
/**
|
|
6184
|
+
* Injection token for `CpsCronValidationService`.
|
|
6185
|
+
*
|
|
6186
|
+
* Always inject this token instead of `CpsCronValidationService` directly.
|
|
6187
|
+
* This allows consumer applications to override or disable cron validation by
|
|
6188
|
+
* providing an alternative implementation via `providers`.
|
|
6189
|
+
*
|
|
6190
|
+
* @example
|
|
6191
|
+
* // Inject in a component or service
|
|
6192
|
+
* private readonly cronValidation = inject(CPS_CRON_VALIDATION_SERVICE);
|
|
6193
|
+
*
|
|
6194
|
+
* @example
|
|
6195
|
+
* // Override with a custom implementation
|
|
6196
|
+
* providers: [{ provide: CPS_CRON_VALIDATION_SERVICE, useClass: MyCustomCronValidationService }]
|
|
6197
|
+
*
|
|
6198
|
+
* @example
|
|
6199
|
+
* // Disable cron validation entirely
|
|
6200
|
+
* providers: [{ provide: CPS_CRON_VALIDATION_SERVICE, useValue: null }]
|
|
6201
|
+
*
|
|
6202
|
+
* @group Tokens
|
|
6203
|
+
*/
|
|
6204
|
+
declare const CPS_CRON_VALIDATION_SERVICE: InjectionToken<CpsCronValidationService | null>;
|
|
6205
|
+
|
|
6003
6206
|
/**
|
|
6004
6207
|
* Collects all --cps-color-* CSS custom properties from :root rules only.
|
|
6005
6208
|
* Theme overrides (e.g. [data-theme='dark']) are excluded to avoid duplicates,
|
|
@@ -6009,5 +6212,5 @@ declare const getCpsColors: (_document: Document) => [string, string][];
|
|
|
6009
6212
|
declare const getCSSColor: (val: string, _document: Document) => string;
|
|
6010
6213
|
declare const getTextColor: (backgroundColor: string) => string;
|
|
6011
6214
|
|
|
6012
|
-
export { CPS_FOCUS_SERVICE, CPS_RADIO_GROUP, CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsColumnFilterMatchMode, CpsDatepickerComponent, CpsDialogConfig, CpsDialogRef, CpsDialogService, CpsDividerComponent, CpsExpansionPanelComponent, CpsFileUploadComponent, CpsFocusService, CpsIconComponent, CpsInfoCircleComponent, CpsInputComponent, CpsLoaderComponent, CpsMenuComponent, CpsMenuHideReason, CpsNotificationAppearance, CpsNotificationPosition, CpsNotificationService, CpsPaginatePipe, CpsPaginatorComponent, CpsProgressCircularComponent, CpsProgressLinearComponent, CpsRadioComponent, CpsRadioGroupComponent, CpsSchedulerComponent, CpsSelectComponent, CpsSidebarMenuComponent, CpsSwitchComponent, CpsTabComponent, CpsTabGroupComponent, CpsTableColumnFilterDirective, CpsTableColumnResizableDirective, CpsTableColumnSortableDirective, CpsTableComponent, CpsTableDetectFilterTypePipe, CpsTableHeaderSelectableDirective, CpsTableRowSelectableDirective, CpsTagComponent, CpsTextareaComponent, CpsThemeService, CpsTimepickerComponent, CpsTooltipDirective, CpsTreeAutocompleteComponent, CpsTreeSelectComponent, CpsTreeTableColumnFilterDirective, CpsTreeTableColumnResizableDirective, CpsTreeTableColumnSortableDirective, CpsTreeTableComponent, CpsTreeTableDetectFilterTypePipe, CpsTreeTableHeaderSelectableDirective, CpsTreeTableRowSelectableDirective, CpsTreetableRowTogglerDirective, ICONS_PATH, getCSSColor, getCpsColors, getTextColor, iconNames, tableFactory, treeTableFactory };
|
|
6215
|
+
export { CPS_CRON_VALIDATION_SERVICE, CPS_FOCUS_SERVICE, CPS_RADIO_GROUP, CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsColumnFilterMatchMode, CpsCronValidationService, CpsDatepickerComponent, CpsDialogConfig, CpsDialogRef, CpsDialogService, CpsDividerComponent, CpsExpansionPanelComponent, CpsFileUploadComponent, CpsFocusService, CpsIconComponent, CpsInfoCircleComponent, CpsInputComponent, CpsLoaderComponent, CpsMenuComponent, CpsMenuHideReason, CpsNotificationAppearance, CpsNotificationPosition, CpsNotificationService, CpsPaginatePipe, CpsPaginatorComponent, CpsProgressCircularComponent, CpsProgressLinearComponent, CpsRadioComponent, CpsRadioGroupComponent, CpsSchedulerComponent, CpsSelectComponent, CpsSidebarMenuComponent, CpsSwitchComponent, CpsTabComponent, CpsTabGroupComponent, CpsTableColumnFilterDirective, CpsTableColumnResizableDirective, CpsTableColumnSortableDirective, CpsTableComponent, CpsTableDetectFilterTypePipe, CpsTableHeaderSelectableDirective, CpsTableRowSelectableDirective, CpsTagComponent, CpsTextareaComponent, CpsThemeService, CpsTimepickerComponent, CpsTooltipDirective, CpsTreeAutocompleteComponent, CpsTreeSelectComponent, CpsTreeTableColumnFilterDirective, CpsTreeTableColumnResizableDirective, CpsTreeTableColumnSortableDirective, CpsTreeTableComponent, CpsTreeTableDetectFilterTypePipe, CpsTreeTableHeaderSelectableDirective, CpsTreeTableRowSelectableDirective, CpsTreetableRowTogglerDirective, ICONS_PATH, getCSSColor, getCpsColors, getTextColor, iconNames, tableFactory, treeTableFactory };
|
|
6013
6216
|
export type { CpsAutocompleteAppearanceType, CpsBaseTheme, CpsButtonToggleOption, CpsColorTheme, CpsColumnFilterCategoryOption, CpsColumnFilterType, CpsDatepickerAppearanceType, CpsDialogAutoFocusTarget, CpsDividerType, CpsInputAppearanceType, CpsMenuAttachPosition, CpsMenuItem, CpsNotificationConfig, CpsRadioOption, CpsRadiusTheme, CpsSelectAppearanceType, CpsSidebarMenuItem, CpsTabChangeEvent, CpsTableExportFormat, CpsTableSize, CpsTableSortMode, CpsTableToolbarSize, CpsTabsAlignmentType, CpsTabsAnimationType, CpsTheme, CpsTime, CpsTooltipOpenOn, CpsTooltipPosition, CpsTreeAutocompleteAppearanceType, CpsTreeSelectAppearanceType, CpsTreeTableSize, CpsTreeTableSortMode, CpsTreeTableToolbarSize, IconType, iconSizeType };
|