@ngx-smz/ui-kit 21.9.0-next.16 → 21.9.0-next.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.
|
@@ -173,17 +173,26 @@ const SINGLE_GROUPS = [
|
|
|
173
173
|
function tokensOf(value) {
|
|
174
174
|
return (value ?? '').split(/\s+/).filter(Boolean);
|
|
175
175
|
}
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
/**
|
|
177
|
+
* Utilitario de padding de verdade (`p-4`, `px-[3px]`, `pl-px`, `px-input-x`), e nao uma classe qualquer que
|
|
178
|
+
* so comeca com "p-" (`p-col-12`, `p-column-filter`, ...), que nao pode remover o padding base do componente.
|
|
179
|
+
*/
|
|
180
|
+
const PADDING_UTILITY = /^p([xytblrse]?)-(?:\d|\[|px$|auto$|input-|control-)/;
|
|
181
|
+
function isPadding(token, sides) {
|
|
182
|
+
const match = PADDING_UTILITY.exec(token);
|
|
183
|
+
return match !== null && sides.includes(`p${match[1]}`);
|
|
184
|
+
}
|
|
185
|
+
function hasPadding(tokens, sides) {
|
|
186
|
+
return tokens.some((token) => isPadding(token, sides));
|
|
178
187
|
}
|
|
179
188
|
/** Resolve o padding de um eixo (x ou y) quando o consumidor sobrescreve so um lado. */
|
|
180
189
|
function resolveAxis(token, axis, extra) {
|
|
181
|
-
const all =
|
|
182
|
-
const both =
|
|
183
|
-
const sides = axis === 'x' ? ['pl
|
|
184
|
-
const otherSides = axis === 'x' ? ['pr
|
|
185
|
-
const first =
|
|
186
|
-
const second =
|
|
190
|
+
const all = hasPadding(extra, ['p']);
|
|
191
|
+
const both = hasPadding(extra, [`p${axis}`]);
|
|
192
|
+
const sides = axis === 'x' ? ['pl', 'ps'] : ['pt'];
|
|
193
|
+
const otherSides = axis === 'x' ? ['pr', 'pe'] : ['pb'];
|
|
194
|
+
const first = hasPadding(extra, sides);
|
|
195
|
+
const second = hasPadding(extra, otherSides);
|
|
187
196
|
const value = token.slice(3);
|
|
188
197
|
if (all || both || (first && second))
|
|
189
198
|
return null;
|
|
@@ -6106,22 +6115,22 @@ class SmzInputMaskComponent extends SmzValueAccessor {
|
|
|
6106
6115
|
this.field().nativeElement.setSelectionRange(position, position);
|
|
6107
6116
|
}
|
|
6108
6117
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzInputMaskComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
6109
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.1", type: SmzInputMaskComponent, isStandalone: true, selector: "ui-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, slotChar: { classPropertyName: "slotChar", publicName: "slotChar", isSignal: true, isRequired: false, transformFunction: null }, characterPattern: { classPropertyName: "characterPattern", publicName: "characterPattern", isSignal: true, isRequired: false, transformFunction: null }, unmask: { classPropertyName: "unmask", publicName: "unmask", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputed: "inputed", blurred: "blurred", completed: "completed" }, host: { classAttribute: "flex min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzInputMaskComponent), multi: true }], viewQueries: [{ propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
6110
|
-
<input
|
|
6111
|
-
#field
|
|
6112
|
-
[attr.type]="type()"
|
|
6113
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
6114
|
-
[attr.id]="inputId() || null"
|
|
6115
|
-
[attr.name]="name() || null"
|
|
6116
|
-
[attr.placeholder]="placeholder() || null"
|
|
6117
|
-
[disabled]="isDisabled()"
|
|
6118
|
-
[readOnly]="readonly()"
|
|
6119
|
-
[value]="display()"
|
|
6120
|
-
(focus)="onFocus()"
|
|
6121
|
-
(input)="onInput($event)"
|
|
6122
|
-
(keydown)="onKeydown($event)"
|
|
6123
|
-
(blur)="onBlur($event)"
|
|
6124
|
-
/>
|
|
6118
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.1", type: SmzInputMaskComponent, isStandalone: true, selector: "ui-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, slotChar: { classPropertyName: "slotChar", publicName: "slotChar", isSignal: true, isRequired: false, transformFunction: null }, characterPattern: { classPropertyName: "characterPattern", publicName: "characterPattern", isSignal: true, isRequired: false, transformFunction: null }, unmask: { classPropertyName: "unmask", publicName: "unmask", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { inputed: "inputed", blurred: "blurred", completed: "completed" }, host: { classAttribute: "flex min-w-0" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzInputMaskComponent), multi: true }], viewQueries: [{ propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
6119
|
+
<input
|
|
6120
|
+
#field
|
|
6121
|
+
[attr.type]="type()"
|
|
6122
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
6123
|
+
[attr.id]="inputId() || null"
|
|
6124
|
+
[attr.name]="name() || null"
|
|
6125
|
+
[attr.placeholder]="placeholder() || null"
|
|
6126
|
+
[disabled]="isDisabled()"
|
|
6127
|
+
[readOnly]="readonly()"
|
|
6128
|
+
[value]="display()"
|
|
6129
|
+
(focus)="onFocus()"
|
|
6130
|
+
(input)="onInput($event)"
|
|
6131
|
+
(keydown)="onKeydown($event)"
|
|
6132
|
+
(blur)="onBlur($event)"
|
|
6133
|
+
/>
|
|
6125
6134
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6126
6135
|
}
|
|
6127
6136
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: SmzInputMaskComponent, decorators: [{
|
|
@@ -6131,22 +6140,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
6131
6140
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6132
6141
|
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SmzInputMaskComponent), multi: true }],
|
|
6133
6142
|
host: { class: 'flex min-w-0' },
|
|
6134
|
-
template: `
|
|
6135
|
-
<input
|
|
6136
|
-
#field
|
|
6137
|
-
[attr.type]="type()"
|
|
6138
|
-
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
6139
|
-
[attr.id]="inputId() || null"
|
|
6140
|
-
[attr.name]="name() || null"
|
|
6141
|
-
[attr.placeholder]="placeholder() || null"
|
|
6142
|
-
[disabled]="isDisabled()"
|
|
6143
|
-
[readOnly]="readonly()"
|
|
6144
|
-
[value]="display()"
|
|
6145
|
-
(focus)="onFocus()"
|
|
6146
|
-
(input)="onInput($event)"
|
|
6147
|
-
(keydown)="onKeydown($event)"
|
|
6148
|
-
(blur)="onBlur($event)"
|
|
6149
|
-
/>
|
|
6143
|
+
template: `
|
|
6144
|
+
<input
|
|
6145
|
+
#field
|
|
6146
|
+
[attr.type]="type()"
|
|
6147
|
+
class="h-control w-full min-w-0 rounded-control border border-ui-line-strong bg-ui-surface-1 px-input-x font-ui text-ui-md text-ui-fg transition-colors duration-ui placeholder:text-ui-fg-subtle focus:outline-none focus:border-ui-focus focus:ring-1 focus:ring-ui-focus disabled:cursor-not-allowed disabled:opacity-50 [&.ng-invalid.ng-dirty]:border-ui-danger"
|
|
6148
|
+
[attr.id]="inputId() || null"
|
|
6149
|
+
[attr.name]="name() || null"
|
|
6150
|
+
[attr.placeholder]="placeholder() || null"
|
|
6151
|
+
[disabled]="isDisabled()"
|
|
6152
|
+
[readOnly]="readonly()"
|
|
6153
|
+
[value]="display()"
|
|
6154
|
+
(focus)="onFocus()"
|
|
6155
|
+
(input)="onInput($event)"
|
|
6156
|
+
(keydown)="onKeydown($event)"
|
|
6157
|
+
(blur)="onBlur($event)"
|
|
6158
|
+
/>
|
|
6150
6159
|
`,
|
|
6151
6160
|
}]
|
|
6152
6161
|
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], slotChar: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotChar", required: false }] }], characterPattern: [{ type: i0.Input, args: [{ isSignal: true, alias: "characterPattern", required: false }] }], unmask: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmask", required: false }] }], autoClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClear", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], inputed: [{ type: i0.Output, args: ["inputed"] }], blurred: [{ type: i0.Output, args: ["blurred"] }], completed: [{ type: i0.Output, args: ["completed"] }], field: [{ type: i0.ViewChild, args: ['field', { isSignal: true }] }] } });
|