@nuraly/runtime 0.1.4 → 0.1.5
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/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -2
- package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -1
- package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +60 -0
- package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +108 -0
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +1 -1
- package/components/ui/nuraly-ui/src/components/radio-group/radio-group.types.ts +1 -0
- package/dist/CodeEditor-BiNku87K.js +808 -0
- package/dist/{CodeEditor-Ch2tv9BE.js → CodeEditor-G6E8PUI7.js} +14593 -14607
- package/dist/{SmartAttributeHandler-hoSLpm1Y.js → SmartAttributeHandler-C9vS-cHW.js} +1 -1
- package/dist/SmartAttributeHandler-u-ZHGueR.js +193 -0
- package/dist/assets/editor.worker-C_S4Avdt.js +11 -0
- package/dist/assets/{html.worker-BSmGlhXp.js → html.worker-DfuQASUV.js} +18 -18
- package/dist/assets/json.worker-Cucz4wxY.js +42 -0
- package/dist/assets/{ts.worker-DyHHPhrh.js → ts.worker-Dme6S0YK.js} +78 -78
- package/dist/cssMode-B7NVlrDV.js +1443 -0
- package/dist/{freemarker2-DNc2IxPf.js → freemarker2-DS_7G9b8.js} +1 -1
- package/dist/{handlebars-CIbFckEw.js → handlebars-BDyyLkzw.js} +1 -1
- package/dist/{html-nRs_fneU.js → html-DphGFjig.js} +1 -1
- package/dist/{htmlMode-BjehA1YF.js → htmlMode-4zNnSWFo.js} +278 -281
- package/dist/index-B4yIOSMd.js +3847 -0
- package/dist/{javascript-Bn0HduZA.js → javascript-CC1jWyQy.js} +1 -1
- package/dist/{jsonMode-CfGfcJRX.js → jsonMode-Bfzb6wZf.js} +369 -372
- package/dist/{liquid-m4D_LCnC.js → liquid-lTBpqagR.js} +1 -1
- package/dist/{mdx-CakMRbCr.js → mdx-DX66Bp07.js} +1 -1
- package/dist/{micro-app-entry-CI1Rupdh.js → micro-app-entry-DDsAWUJh.js} +5138 -5322
- package/dist/micro-app.bundle.js +1 -1
- package/dist/micro-app.js +9775 -0
- package/dist/{python-oJwaiPUY.js → python-BGUhyO4G.js} +1 -1
- package/dist/{razor-u_dd4rqc.js → razor-DEVWQFSa.js} +1 -1
- package/dist/runtime.js +401 -0
- package/dist/style.css +1 -1
- package/dist/tsMode-CYFi80Jf.js +800 -0
- package/dist/{typescript-Bjs2N5Be.js → typescript-B1xIbH_T.js} +1 -1
- package/dist/{wgsl-Bv2xeo60.js → wgsl-C9yjop46.js} +1 -1
- package/dist/{xml-BCveATLl.js → xml-DmdvyqrE.js} +1 -1
- package/dist/{yaml-BfWQPJQi.js → yaml-LGNo48fy.js} +1 -1
- package/package.json +2 -2
- package/vite.config.ts +8 -8
- package/dist/.claude/settings.local.json +0 -9
- package/dist/assets/editor.worker-vBWydyGC.js +0 -11
- package/dist/assets/json.worker-Dqnoedz4.js +0 -42
- package/dist/cssMode-Bt2uK8XM.js +0 -1446
- package/dist/micro-app.bundle.umd.cjs +0 -5051
- package/dist/tsMode-DlZ38d3D.js +0 -813
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Throttles a function call to limit execution frequency
|
|
8
|
+
* Useful for performance optimization of frequently called functions
|
|
9
|
+
*
|
|
10
|
+
* @param func - Function to throttle
|
|
11
|
+
* @param limit - Milliseconds to limit between calls
|
|
12
|
+
* @returns Throttled function that will execute at most once per limit period
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const throttledScroll = throttle((event) => {
|
|
17
|
+
* console.log('Scroll event:', event);
|
|
18
|
+
* }, 16); // 60fps limit
|
|
19
|
+
*
|
|
20
|
+
* window.addEventListener('scroll', throttledScroll);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Debounces a function call to delay execution until after a period of inactivity
|
|
26
|
+
* Useful for search inputs, resize handlers, etc.
|
|
27
|
+
*
|
|
28
|
+
* @param func - Function to debounce
|
|
29
|
+
* @param delay - Milliseconds to wait after last call
|
|
30
|
+
* @returns Debounced function that will execute after delay period of inactivity
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const debouncedSearch = debounce((query: string) => {
|
|
35
|
+
* console.log('Searching for:', query);
|
|
36
|
+
* }, 300); // Wait 300ms after user stops typing
|
|
37
|
+
*
|
|
38
|
+
* input.addEventListener('input', (e) => debouncedSearch(e.target.value));
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
|
|
42
|
+
/**
|
|
43
|
+
* RAF (RequestAnimationFrame) throttle for smooth animations
|
|
44
|
+
* Ensures function is called at most once per animation frame
|
|
45
|
+
*
|
|
46
|
+
* @param func - Function to throttle to animation frames
|
|
47
|
+
* @returns Function that will execute at most once per animation frame
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const rafThrottledUpdate = rafThrottle(() => {
|
|
52
|
+
* // Expensive DOM updates
|
|
53
|
+
* updateUI();
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* element.addEventListener('mousemove', rafThrottledUpdate);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function rafThrottle<T extends (...args: any[]) => any>(func: T): (...args: Parameters<T>) => void;
|
|
60
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Validation event detail structure that validation controllers emit
|
|
8
|
+
*/
|
|
9
|
+
export interface ValidationEventDetail {
|
|
10
|
+
/** Whether the field is currently valid */
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
/** Current validation message */
|
|
13
|
+
validationMessage: string;
|
|
14
|
+
/** Current validation state */
|
|
15
|
+
validationState: string;
|
|
16
|
+
/** Array of error messages */
|
|
17
|
+
errors: string[];
|
|
18
|
+
/** Array of warning messages */
|
|
19
|
+
warnings: string[];
|
|
20
|
+
/** Complete validation result object */
|
|
21
|
+
validationResult: any;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Validation status information returned by getValidationStatus()
|
|
25
|
+
*/
|
|
26
|
+
export interface ValidationStatus {
|
|
27
|
+
/** Whether the field is currently valid */
|
|
28
|
+
isValid: boolean;
|
|
29
|
+
/** Whether validation is currently in progress */
|
|
30
|
+
isValidating?: boolean;
|
|
31
|
+
/** Array of error messages */
|
|
32
|
+
errors: string[];
|
|
33
|
+
/** Array of warning messages */
|
|
34
|
+
warnings: string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generic validation rule interface
|
|
38
|
+
*/
|
|
39
|
+
export interface ValidationRule {
|
|
40
|
+
/** Validation function */
|
|
41
|
+
validator: (value: any) => boolean | Promise<boolean>;
|
|
42
|
+
/** Error/warning message */
|
|
43
|
+
message: string;
|
|
44
|
+
/** Validation level */
|
|
45
|
+
level?: 'error' | 'warning';
|
|
46
|
+
/** Whether this rule blocks form submission */
|
|
47
|
+
blocking?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Interface for components that support validation through events and API
|
|
51
|
+
* This is the shared pattern used by input, textarea, and other form field components
|
|
52
|
+
*/
|
|
53
|
+
export interface ValidatableComponent {
|
|
54
|
+
/** Field name for form submission */
|
|
55
|
+
name?: string;
|
|
56
|
+
/** Field value */
|
|
57
|
+
value: any;
|
|
58
|
+
/** Required field indicator */
|
|
59
|
+
required?: boolean;
|
|
60
|
+
/** Disabled state */
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
/** Readonly state */
|
|
63
|
+
readonly?: boolean;
|
|
64
|
+
/** Current validation message */
|
|
65
|
+
validationMessage?: string;
|
|
66
|
+
/** Add a validation rule */
|
|
67
|
+
addRule?(rule: ValidationRule): void;
|
|
68
|
+
/** Remove validation rules matching predicate */
|
|
69
|
+
removeRule?(predicate: (rule: ValidationRule) => boolean): void;
|
|
70
|
+
/** Clear all validation rules */
|
|
71
|
+
clearRules?(): void;
|
|
72
|
+
/** Get current validation status */
|
|
73
|
+
getValidationStatus(): ValidationStatus;
|
|
74
|
+
/** Trigger validation manually */
|
|
75
|
+
validate(): Promise<boolean> | boolean;
|
|
76
|
+
/** Clear validation state */
|
|
77
|
+
clearValidation?(): void;
|
|
78
|
+
/** Dispatches 'nr-validation' events with ValidationEventDetail */
|
|
79
|
+
addEventListener(type: 'nr-validation', listener: (event: CustomEvent<ValidationEventDetail>) => void): void;
|
|
80
|
+
/** Removes 'nr-validation' event listeners */
|
|
81
|
+
removeEventListener(type: 'nr-validation', listener: (event: CustomEvent<ValidationEventDetail>) => void): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Form field information for form integration
|
|
85
|
+
*/
|
|
86
|
+
export interface FormFieldInfo {
|
|
87
|
+
element: HTMLElement & ValidatableComponent;
|
|
88
|
+
name: string;
|
|
89
|
+
value: any;
|
|
90
|
+
isValid: boolean;
|
|
91
|
+
validationMessage: string;
|
|
92
|
+
required: boolean;
|
|
93
|
+
touched: boolean;
|
|
94
|
+
dirty: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Constants for validation events
|
|
98
|
+
*/
|
|
99
|
+
export declare const VALIDATION_EVENTS: {
|
|
100
|
+
readonly VALIDATION: "nr-validation";
|
|
101
|
+
readonly FIELD_FOCUS: "nr-focus";
|
|
102
|
+
readonly FIELD_BLUR: "nr-blur";
|
|
103
|
+
readonly FIELD_CHANGE: "nr-change";
|
|
104
|
+
readonly FIELD_INPUT: "nr-input";
|
|
105
|
+
readonly FIELD_CLEAR: "nr-clear";
|
|
106
|
+
};
|
|
107
|
+
export declare type ValidationEventType = typeof VALIDATION_EVENTS[keyof typeof VALIDATION_EVENTS];
|
|
108
|
+
//# sourceMappingURL=validation.types.d.ts.map
|
|
@@ -420,7 +420,7 @@ export class NrRadioGroupElement extends NuralyUIBaseMixin(LitElement) {
|
|
|
420
420
|
[RadioButtonType.Default, () => this.renderOptionDefault()],
|
|
421
421
|
[RadioButtonType.Button, () => this.renderOptionsWithButtons()],
|
|
422
422
|
[RadioButtonType.Slot, () => this.renderOptionsWithSlots()],
|
|
423
|
-
[
|
|
423
|
+
[RadioButtonType.ButtonSlot, () => this.renderButtonsWithSlots()], // Special case for button with slots
|
|
424
424
|
])} `;
|
|
425
425
|
}
|
|
426
426
|
}
|