@ngx-smz/core 21.1.16 → 21.1.18
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/ngx-smz-core.mjs +1701 -1600
- package/fesm2022/ngx-smz-core.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/assets/scss/dialogs/smz-general-styles.scss +1 -1
- package/resources/assets/scss/fontawesome-free.scss +1 -1
- package/resources/assets/scss/smz-dialogs.scss +3 -3
- package/resources/assets/scss/smz-dock.scss +1 -1
- package/resources/assets/scss/smz-forms.scss +1 -1
- package/resources/assets/scss/styles.scss +17 -18
- package/types/ngx-smz-core.d.ts +93 -2
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* FONTAWESOME FREE */
|
|
2
|
-
@
|
|
2
|
+
@use "@fortawesome/fontawesome-free/css/all.min.css" as *;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "./dialogs/smz-general-styles" as *;
|
|
2
2
|
// @import "./dialogs/prime10.scss";
|
|
3
3
|
// @import "./dialogs/theme10.scss";
|
|
4
|
-
@
|
|
5
|
-
@
|
|
4
|
+
@use "./dialogs/dialog-ng19" as *;
|
|
5
|
+
@use "./dialogs/menu-ng19" as *;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "./dock/dock" as *;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use "./forms/forms" as *;
|
|
@@ -1,51 +1,50 @@
|
|
|
1
1
|
/* EXTRAS */
|
|
2
|
-
@
|
|
2
|
+
@use "./extras/extras" as *;
|
|
3
3
|
|
|
4
4
|
/* PRETTY JSON */
|
|
5
|
-
@
|
|
5
|
+
@use "./extras/pretty-json" as *;
|
|
6
6
|
|
|
7
7
|
/* SMZ-TABLES */
|
|
8
|
-
@
|
|
8
|
+
@use "./smz-tables" as *;
|
|
9
9
|
|
|
10
10
|
/* SMZ-TREES */
|
|
11
|
-
@
|
|
11
|
+
@use "./smz-trees" as *;
|
|
12
12
|
|
|
13
13
|
/* COLORS */
|
|
14
|
-
@
|
|
14
|
+
@use "./extras/colors" as *;
|
|
15
15
|
|
|
16
16
|
/* DIVIDERS */
|
|
17
|
-
@
|
|
17
|
+
@use "./extras/dividers" as *;
|
|
18
18
|
|
|
19
19
|
/* PÁGINAS DE ERRO E NOTFOUND */
|
|
20
|
-
@
|
|
20
|
+
@use "./pages/app-exceptions" as *;
|
|
21
21
|
|
|
22
22
|
/* DIALOGS */
|
|
23
|
-
@
|
|
23
|
+
@use "./smz-dialogs" as *;
|
|
24
24
|
|
|
25
25
|
/* DOCKS */
|
|
26
|
-
@
|
|
26
|
+
@use "./smz-dock" as *;
|
|
27
27
|
|
|
28
28
|
/* FORMS */
|
|
29
|
-
@
|
|
29
|
+
@use "./smz-forms" as *;
|
|
30
30
|
|
|
31
31
|
/* DOCUMENTS */
|
|
32
|
-
@
|
|
32
|
+
@use "./documents/documents" as *;
|
|
33
33
|
|
|
34
34
|
/* BROWSER STUFFS */
|
|
35
|
-
@
|
|
35
|
+
@use "./extras/browser" as *;
|
|
36
36
|
|
|
37
|
-
@
|
|
37
|
+
@use "./smz-prime-fix" as *;
|
|
38
38
|
|
|
39
39
|
/* OVERLAY DO PRIME */
|
|
40
|
-
@
|
|
40
|
+
@use "./overlay-panel/overlay-panel" as *;
|
|
41
41
|
|
|
42
42
|
/* FOI FEITO UM OVERRIDE DO PRIME GRID ORIGINAL PARA ADICIONAR !IMPORTANT */
|
|
43
|
-
@
|
|
43
|
+
@use './prime-grid/grid' as *;
|
|
44
44
|
|
|
45
45
|
/* PRIME ICONS */
|
|
46
|
-
@
|
|
46
|
+
@use "primeicons/primeicons.css" as *;
|
|
47
47
|
|
|
48
48
|
/* ANIMATIONS */
|
|
49
49
|
// @import "hover.css/css/hover-min.css";
|
|
50
|
-
@
|
|
51
|
-
|
|
50
|
+
@use "animate.css/animate.min.css" as *;
|
package/types/ngx-smz-core.d.ts
CHANGED
|
@@ -1337,6 +1337,8 @@ interface SmzForm<T> {
|
|
|
1337
1337
|
context?: SmzFormContext<T>;
|
|
1338
1338
|
isDebug?: boolean;
|
|
1339
1339
|
formId?: string;
|
|
1340
|
+
/** If set, root `<form>` of `smz-form-group` gets `data-testid` with this value. */
|
|
1341
|
+
formTestId?: string;
|
|
1340
1342
|
behaviors?: SmzFormsBehaviorsConfig;
|
|
1341
1343
|
functions?: SmzFormsBehaviorsFunctions<T>;
|
|
1342
1344
|
groups: SmzFormGroup[];
|
|
@@ -6615,7 +6617,8 @@ declare class SmzFormConditionalTooltipBuilder<TInput, TResponse> {
|
|
|
6615
6617
|
private styleClass;
|
|
6616
6618
|
private position;
|
|
6617
6619
|
constructor(inputBuilder: TInput, inputRef: SmzFormsBaseControl, resolveMessage: (formValues: any) => string | null);
|
|
6618
|
-
|
|
6620
|
+
/** Reassigns the warning signal; `update()` is unsafe when the builder runs inside an Angular `computed` (NG0600). */
|
|
6621
|
+
private applyWarningState;
|
|
6619
6622
|
withStyleClass(styleClass: string): SmzFormConditionalTooltipBuilder<TInput, TResponse>;
|
|
6620
6623
|
withPosition(position: 'top' | 'bottom' | 'left' | 'right'): SmzFormConditionalTooltipBuilder<TInput, TResponse>;
|
|
6621
6624
|
get input(): TInput;
|
|
@@ -6907,10 +6910,11 @@ declare class SmzFormPasswordBuilder<TResponse> extends SmzFormInputBuilder<SmzF
|
|
|
6907
6910
|
enableToggleMask(): SmzFormPasswordBuilder<TResponse>;
|
|
6908
6911
|
setStrengthRegex(medium: string, strong: string): SmzFormPasswordBuilder<TResponse>;
|
|
6909
6912
|
}
|
|
6910
|
-
declare class SmzFormInputValidatorBuilder<TInput, TResponse> {
|
|
6913
|
+
declare class SmzFormInputValidatorBuilder<TInput, TResponse> extends SmzBuilderUtilities<SmzFormInputValidatorBuilder<TInput, TResponse>> {
|
|
6911
6914
|
inputRefBuilder: TInput;
|
|
6912
6915
|
private inputRef;
|
|
6913
6916
|
groupBuilderRef: SmzFormGroupBuilder<TResponse>;
|
|
6917
|
+
protected that: this;
|
|
6914
6918
|
constructor(inputRefBuilder: TInput, inputRef: SmzFormsBaseControl, groupBuilderRef: SmzFormGroupBuilder<TResponse>);
|
|
6915
6919
|
required(): SmzFormInputValidatorBuilder<TInput, TResponse>;
|
|
6916
6920
|
length(min: number, max: number): SmzFormInputValidatorBuilder<TInput, TResponse>;
|
|
@@ -7068,33 +7072,101 @@ declare class SmzFormUiDefinitionBuilder<TResponse> extends SmzBaseUiDefinitionB
|
|
|
7068
7072
|
get form(): SmzFormBuilder<TResponse>;
|
|
7069
7073
|
}
|
|
7070
7074
|
|
|
7075
|
+
/**
|
|
7076
|
+
* Fluent builder for the entire form model ({@link SmzForm}).
|
|
7077
|
+
*
|
|
7078
|
+
* **Entry point:** start with `new SmzFormBuilder<T>()` (standalone) or obtain via
|
|
7079
|
+
* {@link SmzDialogBuilder.form} when the form is hosted inside a dialog. Always add at least
|
|
7080
|
+
* one {@link SmzFormBuilder.group} before defining controls, then call {@link SmzFormBuilder.build}
|
|
7081
|
+
* to get immutable state for `smz-form-group` / form features.
|
|
7082
|
+
*/
|
|
7071
7083
|
declare class SmzFormBuilder<TResponse> {
|
|
7072
7084
|
dialogBuilderRef: SmzDialogBuilder<TResponse>;
|
|
7073
7085
|
private defaultConfig;
|
|
7074
7086
|
formState: SmzForm<TResponse>;
|
|
7075
7087
|
createdByUiDefinitions: boolean;
|
|
7088
|
+
/**
|
|
7089
|
+
* @param dialogBuilderRef When non-null, this builder is owned by a dialog feature (see {@link SmzDialogBuilder.form}).
|
|
7090
|
+
* @param state Optional existing {@link SmzForm} to mutate (e.g. UI definition hydration).
|
|
7091
|
+
*/
|
|
7076
7092
|
constructor(dialogBuilderRef?: SmzDialogBuilder<TResponse>, state?: SmzForm<TResponse>);
|
|
7093
|
+
/** Turns on form debug logging in the form group component. */
|
|
7077
7094
|
debugMode(): SmzFormBuilder<TResponse>;
|
|
7095
|
+
/**
|
|
7096
|
+
* Sets {@link SmzForm.formTestId}: exposed on the root {@code <form>} as {@code data-testid}.
|
|
7097
|
+
* Pass a blank string to clear a previously set id.
|
|
7098
|
+
*/
|
|
7099
|
+
withFormTestId(testId: string): SmzFormBuilder<TResponse>;
|
|
7100
|
+
/**
|
|
7101
|
+
* Appends a new form group and returns a builder to add controls, layout, and validators.
|
|
7102
|
+
* @param name Optional group title; when set, the group can show a heading.
|
|
7103
|
+
* @param key Optional key used to identify the group in advanced scenarios (e.g. hide/show, reactions).
|
|
7104
|
+
*/
|
|
7078
7105
|
group(name?: string, key?: string): SmzFormGroupBuilder<TResponse>;
|
|
7106
|
+
/** If set, submitted data keeps nested object shape instead of flattening. */
|
|
7079
7107
|
disableFlattenResponse(): SmzFormBuilder<TResponse>;
|
|
7108
|
+
/**
|
|
7109
|
+
* When true, per-control custom “on load” logic runs as the form is initialized
|
|
7110
|
+
* (e.g. derived defaults).
|
|
7111
|
+
*/
|
|
7080
7112
|
runCustomFunctionsOnLoad(): SmzFormBuilder<TResponse>;
|
|
7113
|
+
/**
|
|
7114
|
+
* Emits output events for all controls on first load, not only on user interaction
|
|
7115
|
+
* (use when consumers need a full initial snapshot).
|
|
7116
|
+
*/
|
|
7081
7117
|
emitAllOutputsOnLoad(): SmzFormBuilder<TResponse>;
|
|
7118
|
+
/**
|
|
7119
|
+
* Replaces the default “after change” behavior with a custom hook (advanced integration).
|
|
7120
|
+
* Prefer control-level and group-level configuration when possible.
|
|
7121
|
+
*/
|
|
7082
7122
|
setCustomBehavior(callback: (data: SmzFormsResponse<TResponse>, config: SmzForm<TResponse>, form: UntypedFormGroup, outputEvents: Record<string, unknown>) => void): SmzFormBuilder<TResponse>;
|
|
7123
|
+
/**
|
|
7124
|
+
* Sets the separator used in flattened response keys for nested data (e.g. `parent_child`).
|
|
7125
|
+
* The dot (`.`) is not allowed because it is reserved for nested object paths.
|
|
7126
|
+
*/
|
|
7083
7127
|
withNestedResponseKeySeparator(separator: string): SmzFormBuilder<TResponse>;
|
|
7128
|
+
/**
|
|
7129
|
+
* Sets default values on existing control definitions by `propertyName`.
|
|
7130
|
+
* **Requires** at least one group with controls. Unlike {@link applyData}, values are
|
|
7131
|
+
* applied directly as stored default values in the form model.
|
|
7132
|
+
*/
|
|
7084
7133
|
applyValues(...values: {
|
|
7085
7134
|
propertyName: string;
|
|
7086
7135
|
value: unknown;
|
|
7087
7136
|
}[]): SmzFormBuilder<TResponse>;
|
|
7137
|
+
/**
|
|
7138
|
+
* Merges a data object into existing controls (handles simple-entity values by id).
|
|
7139
|
+
* **Requires** at least one group. Set `debug` to log merge steps in the console.
|
|
7140
|
+
*/
|
|
7088
7141
|
applyData(data: Record<string, unknown>, debug?: boolean): SmzFormBuilder<TResponse>;
|
|
7142
|
+
/** Debounce in ms for value emissions / validation feedback (form-level). */
|
|
7089
7143
|
setDebounceTime(debouceTime: number): SmzFormBuilder<TResponse>;
|
|
7144
|
+
/** Binds value updates to blur so emissions fire when leaving a field, not on every keystroke. */
|
|
7090
7145
|
emitChangesOnFocusExit(): SmzFormBuilder<TResponse>;
|
|
7146
|
+
/** When appropriate for the host, allows submitting the form on Enter. */
|
|
7091
7147
|
enableSubmitOnEnter(): SmzFormBuilder<TResponse>;
|
|
7148
|
+
/** Emits on every `change` event (as opposed to blur/submit). */
|
|
7092
7149
|
emitChangesOnAllChanges(): SmzFormBuilder<TResponse>;
|
|
7150
|
+
/** Skips the first emit pass after the form is built (avoids “dirty on load” in some UIs). */
|
|
7093
7151
|
avoidEmitChangesOnLoad(): SmzFormBuilder<TResponse>;
|
|
7152
|
+
/** When validation yields multiple issues, show all messages instead of only the first. */
|
|
7094
7153
|
showMultipleErrorsMessages(): SmzFormBuilder<TResponse>;
|
|
7154
|
+
/**
|
|
7155
|
+
* Form-level custom validator: return `true` if the form is valid for your custom rules.
|
|
7156
|
+
* Works alongside Angular validators on each control.
|
|
7157
|
+
*/
|
|
7095
7158
|
setCustomValidator(callback: (data: SmzFormsResponse<TResponse>, formGroup: UntypedFormGroup) => boolean): SmzFormBuilder<TResponse>;
|
|
7159
|
+
/** When this form was created from a dialog, returns the parent {@link SmzDialogBuilder}. */
|
|
7096
7160
|
get dialog(): SmzDialogBuilder<TResponse>;
|
|
7161
|
+
/**
|
|
7162
|
+
* Finalizes the form model. Throws if any duplicate `propertyName` exists across groups.
|
|
7163
|
+
* The returned state is what `smz-form-group` consumes as `[config]`.
|
|
7164
|
+
*/
|
|
7097
7165
|
build(): SmzForm<TResponse>;
|
|
7166
|
+
/**
|
|
7167
|
+
* Switches to UI-definition–driven form construction (server or bundle definitions).
|
|
7168
|
+
* Call once; further fluent API usage follows the UI definition builder.
|
|
7169
|
+
*/
|
|
7098
7170
|
fromUiDefinition(entity: string): SmzFormUiDefinitionBuilder<TResponse>;
|
|
7099
7171
|
}
|
|
7100
7172
|
|
|
@@ -7226,11 +7298,17 @@ declare class SmzDialogOverlayPanelBuilder<TResponse> extends SmzBuilderUtilitie
|
|
|
7226
7298
|
get dialog(): SmzDialogBuilder<TResponse>;
|
|
7227
7299
|
}
|
|
7228
7300
|
|
|
7301
|
+
/**
|
|
7302
|
+
* Fluent builder for a modal (or inline) dialog: title, feature stack (form, table, custom component, …),
|
|
7303
|
+
* and button/callback configuration. Chains to {@link SmzFormBuilder} for form content via
|
|
7304
|
+
* {@link SmzDialogBuilder.form} — that is the recommended entry to compose form UIs that open in dialogs.
|
|
7305
|
+
*/
|
|
7229
7306
|
declare class SmzDialogBuilder<TResponse> extends SmzBuilderUtilities<SmzDialogBuilder<TResponse>> {
|
|
7230
7307
|
protected that: this;
|
|
7231
7308
|
private defaultConfig;
|
|
7232
7309
|
dialogState: SmzDialog<TResponse>;
|
|
7233
7310
|
createdByUiDefinitions: boolean;
|
|
7311
|
+
/** Shown in the dialog header. Pass `null` to clear the title. */
|
|
7234
7312
|
setTitle(title?: string | null): SmzDialogBuilder<TResponse>;
|
|
7235
7313
|
useAdvancedResponse(): SmzDialogBuilder<TResponse>;
|
|
7236
7314
|
closeOnEscape(): SmzDialogBuilder<TResponse>;
|
|
@@ -7256,8 +7334,21 @@ declare class SmzDialogBuilder<TResponse> extends SmzBuilderUtilities<SmzDialogB
|
|
|
7256
7334
|
setPreset(preset: SmzPresetTypes): SmzDialogBuilder<TResponse>;
|
|
7257
7335
|
useAsOverlayPanel(elementId: string, guideState: SmzUiGuidesState): SmzDialogOverlayPanelBuilder<TResponse>;
|
|
7258
7336
|
buttons(): SmzDialogButtonsBuilder<TResponse>;
|
|
7337
|
+
/**
|
|
7338
|
+
* Start dialog construction from a server-side UI definition. Mutually exclusive with manual
|
|
7339
|
+
* `form()` / `component()` / … chains until the definition layer finishes hydrating state.
|
|
7340
|
+
*/
|
|
7259
7341
|
fromUiDefinition(entityName: string): SmzDialogUiDefinitionBuilder<TResponse>;
|
|
7342
|
+
/**
|
|
7343
|
+
* Appends a **form** feature and returns {@link SmzFormBuilder} to define groups/controls in the
|
|
7344
|
+
* usual way. **Primary entry** for “dialog + form” product flows. Pass a prebuilt {@link SmzForm} to
|
|
7345
|
+
* edit existing state, or omit/`null` to start an empty form model owned by the returned builder.
|
|
7346
|
+
*/
|
|
7260
7347
|
form(form?: SmzForm<TResponse>): SmzFormBuilder<TResponse>;
|
|
7348
|
+
/**
|
|
7349
|
+
* Like {@link form} but returns {@link SmzDialogFormBuilder} to set layout on the form feature
|
|
7350
|
+
* container before calling {@link SmzDialogFormBuilder.form} for the {@link SmzFormBuilder} chain.
|
|
7351
|
+
*/
|
|
7261
7352
|
formFeature(): SmzDialogFormBuilder<TResponse>;
|
|
7262
7353
|
component(component: ComponentDataBase | any): SmzDialogComponentBuilder<TResponse>;
|
|
7263
7354
|
message(message: string | string[]): SmzDialogBuilder<TResponse>;
|