fas-admin 0.0.117 → 0.0.118
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/esm2022/lib/components/views/subscriptions/subscription-form/badge-price.mjs +38 -0
- package/esm2022/lib/components/views/subscriptions/subscription-form/subscription-form.component.mjs +46 -4
- package/esm2022/lib/components/views/subscriptions/subscriptions-list/subscriptions-list.component.mjs +4 -2
- package/esm2022/lib/shared/tokens/subscription-price-kind.token.mjs +12 -0
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/fas-admin.mjs +95 -5
- package/fesm2022/fas-admin.mjs.map +1 -1
- package/lib/components/views/subscriptions/subscription-form/badge-price.d.ts +15 -0
- package/lib/components/views/subscriptions/subscription-form/subscription-form.component.d.ts +12 -0
- package/lib/components/views/subscriptions/subscriptions-list/subscriptions-list.component.d.ts +1 -0
- package/lib/shared/tokens/subscription-price-kind.token.d.ts +11 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
package/fesm2022/fas-admin.mjs
CHANGED
|
@@ -103,6 +103,17 @@ function provideFASAdminLibApiConfig(apiUrl) {
|
|
|
103
103
|
*/
|
|
104
104
|
const FAS_USERS_LIST_EXTRA_COLUMNS = new InjectionToken('FAS_USERS_LIST_EXTRA_COLUMNS');
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Podpis ceny abonamentu w widoku Abonamenty. Bez ustawienia cena jest opisana jako netto.
|
|
108
|
+
* Aplikacja, która pobiera od klienta dokładnie `value` (bez doliczania VAT), ustawia brutto:
|
|
109
|
+
* `{ provide: FAS_SUBSCRIPTION_PRICE_KIND, useValue: 'gross' }` w providers aplikacji.
|
|
110
|
+
*/
|
|
111
|
+
const FAS_SUBSCRIPTION_PRICE_KIND = new InjectionToken('FAS_SUBSCRIPTION_PRICE_KIND');
|
|
112
|
+
/** "netto" albo "brutto" - do podpisów pól i kolumn z ceną abonamentu. */
|
|
113
|
+
function subscriptionPriceKindLabel(kind) {
|
|
114
|
+
return kind === 'gross' ? 'brutto' : 'netto';
|
|
115
|
+
}
|
|
116
|
+
|
|
106
117
|
class FASAdminService {
|
|
107
118
|
constructor() {
|
|
108
119
|
this.fasAdminConfigSubject = new BehaviorSubject(FAS_DEFAULT_CONFIG_VALUE);
|
|
@@ -246,6 +257,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
|
|
|
246
257
|
type: Input
|
|
247
258
|
}] } });
|
|
248
259
|
|
|
260
|
+
const BADGE_SEPARATOR = ' / ';
|
|
261
|
+
const FIRST_NUMBER = /\d+(?:[.,]\d+)?/;
|
|
262
|
+
/**
|
|
263
|
+
* The offer tile of the application shows the amount written in the badge
|
|
264
|
+
* ("9,99 / jednorazowo"), while the customer is charged the plan's price.
|
|
265
|
+
* Returns what differs when the two do not agree, or null when they do or
|
|
266
|
+
* when the badge carries no amount at all.
|
|
267
|
+
*/
|
|
268
|
+
function badgePriceMismatch(badgeText, value) {
|
|
269
|
+
if (!badgeText || value === null || value === undefined)
|
|
270
|
+
return null;
|
|
271
|
+
const amount = Number(value);
|
|
272
|
+
if (!Number.isFinite(amount))
|
|
273
|
+
return null;
|
|
274
|
+
const separatorAt = badgeText.indexOf(BADGE_SEPARATOR);
|
|
275
|
+
const pricePart = separatorAt === -1 ? badgeText : badgeText.slice(0, separatorAt);
|
|
276
|
+
const rest = separatorAt === -1 ? '' : badgeText.slice(separatorAt);
|
|
277
|
+
const match = FIRST_NUMBER.exec(pricePart);
|
|
278
|
+
if (!match)
|
|
279
|
+
return null;
|
|
280
|
+
const written = match[0];
|
|
281
|
+
if (Math.abs(Number(written.replace(',', '.')) - amount) < 0.005)
|
|
282
|
+
return null;
|
|
283
|
+
const decimalSeparator = written.includes('.') ? '.' : ',';
|
|
284
|
+
const fractionDigits = /[.,]/.test(written) || !Number.isInteger(amount) ? 2 : 0;
|
|
285
|
+
const expected = amount
|
|
286
|
+
.toFixed(fractionDigits)
|
|
287
|
+
.replace('.', decimalSeparator);
|
|
288
|
+
return {
|
|
289
|
+
written,
|
|
290
|
+
expected,
|
|
291
|
+
correctedBadge: pricePart.slice(0, match.index) +
|
|
292
|
+
expected +
|
|
293
|
+
pricePart.slice(match.index + written.length) +
|
|
294
|
+
rest,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
249
298
|
class SubscriptionFormComponent {
|
|
250
299
|
get fc() {
|
|
251
300
|
return this.subscriptionDetailsFormGroup.controls;
|
|
@@ -253,7 +302,9 @@ class SubscriptionFormComponent {
|
|
|
253
302
|
constructor() {
|
|
254
303
|
this._fb = inject(FormBuilder);
|
|
255
304
|
this.controlContainer = inject(ControlContainer);
|
|
305
|
+
this.priceKind = subscriptionPriceKindLabel(inject(FAS_SUBSCRIPTION_PRICE_KIND, { optional: true }));
|
|
256
306
|
this.formFields = this.setFormFields();
|
|
307
|
+
this.patchingForm = false;
|
|
257
308
|
this.editMode = model(false);
|
|
258
309
|
this.currentSubscriptionData = model(null);
|
|
259
310
|
effect(() => {
|
|
@@ -270,6 +321,40 @@ class SubscriptionFormComponent {
|
|
|
270
321
|
ngOnInit() {
|
|
271
322
|
this.buildForm();
|
|
272
323
|
}
|
|
324
|
+
/** Set while the amount in the badge differs from the price of the plan. */
|
|
325
|
+
get badgePriceWarning() {
|
|
326
|
+
if (!this.subscriptionDetailsFormGroup)
|
|
327
|
+
return null;
|
|
328
|
+
const { badgeText, value } = this.subscriptionDetailsFormGroup.getRawValue();
|
|
329
|
+
return badgePriceMismatch(badgeText, value);
|
|
330
|
+
}
|
|
331
|
+
fixBadgeText() {
|
|
332
|
+
const mismatch = this.badgePriceWarning;
|
|
333
|
+
if (mismatch) {
|
|
334
|
+
this.fc['badgeText'].setValue(mismatch.correctedBadge);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* While the operator edits the price, a badge that agreed with the old
|
|
339
|
+
* price follows the new one; a badge that already differed is left alone
|
|
340
|
+
* and stays flagged by the warning.
|
|
341
|
+
*/
|
|
342
|
+
keepBadgeInStepWithPrice() {
|
|
343
|
+
let previousValue = this.fc['value'].value;
|
|
344
|
+
this.fc['value'].valueChanges.subscribe((value) => {
|
|
345
|
+
const before = previousValue;
|
|
346
|
+
previousValue = value;
|
|
347
|
+
if (this.patchingForm || !this.editMode())
|
|
348
|
+
return;
|
|
349
|
+
const badgeText = this.fc['badgeText'].value;
|
|
350
|
+
if (!badgeText || badgePriceMismatch(badgeText, before))
|
|
351
|
+
return;
|
|
352
|
+
const mismatch = badgePriceMismatch(badgeText, value);
|
|
353
|
+
if (mismatch) {
|
|
354
|
+
this.fc['badgeText'].setValue(mismatch.correctedBadge);
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
}
|
|
273
358
|
trimInput(controlName) {
|
|
274
359
|
const control = this.fc[controlName];
|
|
275
360
|
if (control && control.value && typeof control.value === 'string') {
|
|
@@ -283,6 +368,7 @@ class SubscriptionFormComponent {
|
|
|
283
368
|
});
|
|
284
369
|
this.subscriptionDetailsFormGroup = this._fb.group(formGroup);
|
|
285
370
|
this.controlContainer.control.addControl('subscriptionDetailsFormGroup', this.subscriptionDetailsFormGroup);
|
|
371
|
+
this.keepBadgeInStepWithPrice();
|
|
286
372
|
}
|
|
287
373
|
patchFormValues() {
|
|
288
374
|
const data = this.currentSubscriptionData();
|
|
@@ -311,7 +397,9 @@ class SubscriptionFormComponent {
|
|
|
311
397
|
customImplementationTypeName: data.customImplementationTypeName,
|
|
312
398
|
appleProductId: data.appleProductId
|
|
313
399
|
};
|
|
400
|
+
this.patchingForm = true;
|
|
314
401
|
this.subscriptionDetailsFormGroup.patchValue(mappedData);
|
|
402
|
+
this.patchingForm = false;
|
|
315
403
|
}
|
|
316
404
|
generateNumberOptions(length) {
|
|
317
405
|
const numberOptions = Array.from({ length }, (v, i) => ({
|
|
@@ -363,7 +451,7 @@ class SubscriptionFormComponent {
|
|
|
363
451
|
},
|
|
364
452
|
{
|
|
365
453
|
name: 'value',
|
|
366
|
-
label:
|
|
454
|
+
label: `Cena ${this.priceKind}`,
|
|
367
455
|
initialValue: 0,
|
|
368
456
|
type: 'input-number',
|
|
369
457
|
inputNumberSettings: {
|
|
@@ -459,6 +547,7 @@ class SubscriptionFormComponent {
|
|
|
459
547
|
label: 'Napis dla “Badge”',
|
|
460
548
|
initialValue: '',
|
|
461
549
|
type: 'input-string',
|
|
550
|
+
fieldTooltip: 'Ten napis aplikacja pokazuje na kafelku oferty jako cenę, w formacie „9,99 / jednorazowo”. Kwota w napisie musi być taka sama jak cena abonamentu.',
|
|
462
551
|
},
|
|
463
552
|
{ name: 'isTrial', label: 'Abonament typu “Trial”', initialValue: false, type: 'checkbox', },
|
|
464
553
|
{
|
|
@@ -490,11 +579,11 @@ class SubscriptionFormComponent {
|
|
|
490
579
|
];
|
|
491
580
|
}
|
|
492
581
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SubscriptionFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
493
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.2.2", type: SubscriptionFormComponent, selector: "lib-subscription-form", inputs: { editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null }, currentSubscriptionData: { classPropertyName: "currentSubscriptionData", publicName: "currentSubscriptionData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editMode: "editModeChange", currentSubscriptionData: "currentSubscriptionDataChange" }, ngImport: i0, template: "<form [formGroup]=\"subscriptionDetailsFormGroup\">\n <div class=\"flex flex-wrap justify-content-between\">\n <ng-container *ngFor=\"let field of formFields\">\n <div [ngSwitch]=\"field.type\"\n class=\"w-full flex-wrap sm:flex-nowrap flex border-bottom-1 border-bluegray-300\"\n [ngStyle]=\"{ 'padding-block': '12px', 'min-height': '64px' }\" [ngClass]=\"field.fieldWidth ? field.fieldWidth : 'lg:w-24rem'\">\n <label [for]=\"field.name\"\n class=\"flex-none flex align-items-center text-gray-500 font-normal text-sm\"\n [ngClass]=\"field.labelWidth ? field.labelWidth : 'w-11rem'\">\n <span class=\"text-sm\">{{ field.label }}<i *ngIf=\"field.fieldTooltip\" class=\"pi pi-info-circle ml-2\"\n [pTooltip]=\"field.fieldTooltip\" tooltipPosition=\"bottom\"></i></span>\n </label>\n <div class=\"w-full flex align-items-center\">\n <input *ngSwitchDefault [id]=\"field.name\" type=\"text\" pInputText [formControlName]=\"field.name\"\n (blur)=\"trimInput(field.name)\" />\n <p-dropdown *ngSwitchCase=\"'dropdown'\" [id]=\"field.name\" [options]=\"field.dropdownoptions\"\n appendTo=\"body\" [formControlName]=\"field.name\" optionLabel=\"label\" optionValue=\"value\"\n styleClass=\"w-full\" class=\"w-full\" [placeholder]=\"field.placeholder ?? 'Wybierz'\" />\n <p-inputNumber *ngSwitchCase=\"'input-number'\" class=\"w-full\" styleClass=\"w-full\" [id]=\"field.name\"\n [inputId]=\"field.name\" [formControlName]=\"field.name\" locale=\"pl-PL\"\n [minFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \"\n [maxFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \" currency=\"PLN\"\n [mode]=\"field.inputNumberSettings?.currencyField ? 'currency' : 'decimal'\" />\n <p-checkbox *ngSwitchCase=\"'checkbox'\" [formControlName]=\"field.name\" [binary]=\"true\"\n class=\"flex align-items-center\" styleClass=\"flex align-items-center\" [inputId]=\"field.name\" />\n <p-calendar *ngSwitchCase=\"'calendar'\" [showIcon]=\"true\" [formControlName]=\"field.name\"\n appendTo=\"body\" dateFormat=\"dd.mm.yy\" appendTo=\"body\" baseZIndex=\"1001\" />\n <textarea *ngSwitchCase=\"'textarea'\" rows=\"2\" cols=\"30\" pInputTextarea\n [formControlName]=\"field.name\"></textarea>\n </div>\n </div>\n </ng-container>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "directive", type: i4$1.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i5.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i6.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i8.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i9.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }] }); }
|
|
582
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.2.2", type: SubscriptionFormComponent, selector: "lib-subscription-form", inputs: { editMode: { classPropertyName: "editMode", publicName: "editMode", isSignal: true, isRequired: false, transformFunction: null }, currentSubscriptionData: { classPropertyName: "currentSubscriptionData", publicName: "currentSubscriptionData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editMode: "editModeChange", currentSubscriptionData: "currentSubscriptionDataChange" }, ngImport: i0, template: "<form [formGroup]=\"subscriptionDetailsFormGroup\">\n <div class=\"flex flex-wrap justify-content-between\">\n <ng-container *ngFor=\"let field of formFields\">\n <div [ngSwitch]=\"field.type\"\n class=\"w-full flex-wrap sm:flex-nowrap flex border-bottom-1 border-bluegray-300\"\n [ngStyle]=\"{ 'padding-block': '12px', 'min-height': '64px' }\" [ngClass]=\"field.fieldWidth ? field.fieldWidth : 'lg:w-24rem'\">\n <label [for]=\"field.name\"\n class=\"flex-none flex align-items-center text-gray-500 font-normal text-sm\"\n [ngClass]=\"field.labelWidth ? field.labelWidth : 'w-11rem'\">\n <span class=\"text-sm\">{{ field.label }}<i *ngIf=\"field.fieldTooltip\" class=\"pi pi-info-circle ml-2\"\n [pTooltip]=\"field.fieldTooltip\" tooltipPosition=\"bottom\"></i></span>\n </label>\n <div class=\"w-full flex align-items-center\">\n <input *ngSwitchDefault [id]=\"field.name\" type=\"text\" pInputText [formControlName]=\"field.name\"\n (blur)=\"trimInput(field.name)\" />\n <p-dropdown *ngSwitchCase=\"'dropdown'\" [id]=\"field.name\" [options]=\"field.dropdownoptions\"\n appendTo=\"body\" [formControlName]=\"field.name\" optionLabel=\"label\" optionValue=\"value\"\n styleClass=\"w-full\" class=\"w-full\" [placeholder]=\"field.placeholder ?? 'Wybierz'\" />\n <p-inputNumber *ngSwitchCase=\"'input-number'\" class=\"w-full\" styleClass=\"w-full\" [id]=\"field.name\"\n [inputId]=\"field.name\" [formControlName]=\"field.name\" locale=\"pl-PL\"\n [minFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \"\n [maxFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \" currency=\"PLN\"\n [mode]=\"field.inputNumberSettings?.currencyField ? 'currency' : 'decimal'\" />\n <p-checkbox *ngSwitchCase=\"'checkbox'\" [formControlName]=\"field.name\" [binary]=\"true\"\n class=\"flex align-items-center\" styleClass=\"flex align-items-center\" [inputId]=\"field.name\" />\n <p-calendar *ngSwitchCase=\"'calendar'\" [showIcon]=\"true\" [formControlName]=\"field.name\"\n appendTo=\"body\" dateFormat=\"dd.mm.yy\" appendTo=\"body\" baseZIndex=\"1001\" />\n <textarea *ngSwitchCase=\"'textarea'\" rows=\"2\" cols=\"30\" pInputTextarea\n [formControlName]=\"field.name\"></textarea>\n </div>\n </div>\n <ng-container *ngIf=\"field.name === 'badgeText'\">\n <div *ngIf=\"badgePriceWarning as warning\"\n class=\"badge-price-warning w-full flex flex-wrap align-items-center gap-2 text-sm\" role=\"alert\">\n <i class=\"pi pi-exclamation-triangle\"></i>\n <span>Kwota w napisie ({{ warning.written }}) r\u00F3\u017Cni si\u0119 od ceny abonamentu ({{ warning.expected }}).\n Aplikacja pokazuje na kafelku oferty kwot\u0119 z napisu, a pobiera cen\u0119.</span>\n <button *ngIf=\"editMode()\" type=\"button\" class=\"badge-price-fix\" (click)=\"fixBadgeText()\">\n Zmie\u0144 napis na \u201E{{ warning.correctedBadge }}\u201D\n </button>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</form>", styles: [".badge-price-warning{margin-block:8px;padding:10px 12px;border-radius:6px;background:#fff7ed;border:1px solid #fdba74;color:#9a3412}.badge-price-fix{border:0;background:none;padding:0;color:inherit;font:inherit;font-weight:600;text-decoration:underline;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "directive", type: i4$1.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i5.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: i6.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i7.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: i8.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i9.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }] }); }
|
|
494
583
|
}
|
|
495
584
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SubscriptionFormComponent, decorators: [{
|
|
496
585
|
type: Component,
|
|
497
|
-
args: [{ selector: 'lib-subscription-form', template: "<form [formGroup]=\"subscriptionDetailsFormGroup\">\n <div class=\"flex flex-wrap justify-content-between\">\n <ng-container *ngFor=\"let field of formFields\">\n <div [ngSwitch]=\"field.type\"\n class=\"w-full flex-wrap sm:flex-nowrap flex border-bottom-1 border-bluegray-300\"\n [ngStyle]=\"{ 'padding-block': '12px', 'min-height': '64px' }\" [ngClass]=\"field.fieldWidth ? field.fieldWidth : 'lg:w-24rem'\">\n <label [for]=\"field.name\"\n class=\"flex-none flex align-items-center text-gray-500 font-normal text-sm\"\n [ngClass]=\"field.labelWidth ? field.labelWidth : 'w-11rem'\">\n <span class=\"text-sm\">{{ field.label }}<i *ngIf=\"field.fieldTooltip\" class=\"pi pi-info-circle ml-2\"\n [pTooltip]=\"field.fieldTooltip\" tooltipPosition=\"bottom\"></i></span>\n </label>\n <div class=\"w-full flex align-items-center\">\n <input *ngSwitchDefault [id]=\"field.name\" type=\"text\" pInputText [formControlName]=\"field.name\"\n (blur)=\"trimInput(field.name)\" />\n <p-dropdown *ngSwitchCase=\"'dropdown'\" [id]=\"field.name\" [options]=\"field.dropdownoptions\"\n appendTo=\"body\" [formControlName]=\"field.name\" optionLabel=\"label\" optionValue=\"value\"\n styleClass=\"w-full\" class=\"w-full\" [placeholder]=\"field.placeholder ?? 'Wybierz'\" />\n <p-inputNumber *ngSwitchCase=\"'input-number'\" class=\"w-full\" styleClass=\"w-full\" [id]=\"field.name\"\n [inputId]=\"field.name\" [formControlName]=\"field.name\" locale=\"pl-PL\"\n [minFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \"\n [maxFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \" currency=\"PLN\"\n [mode]=\"field.inputNumberSettings?.currencyField ? 'currency' : 'decimal'\" />\n <p-checkbox *ngSwitchCase=\"'checkbox'\" [formControlName]=\"field.name\" [binary]=\"true\"\n class=\"flex align-items-center\" styleClass=\"flex align-items-center\" [inputId]=\"field.name\" />\n <p-calendar *ngSwitchCase=\"'calendar'\" [showIcon]=\"true\" [formControlName]=\"field.name\"\n appendTo=\"body\" dateFormat=\"dd.mm.yy\" appendTo=\"body\" baseZIndex=\"1001\" />\n <textarea *ngSwitchCase=\"'textarea'\" rows=\"2\" cols=\"30\" pInputTextarea\n [formControlName]=\"field.name\"></textarea>\n </div>\n </div>\n </ng-container>\n </div>\n</form>" }]
|
|
586
|
+
args: [{ selector: 'lib-subscription-form', template: "<form [formGroup]=\"subscriptionDetailsFormGroup\">\n <div class=\"flex flex-wrap justify-content-between\">\n <ng-container *ngFor=\"let field of formFields\">\n <div [ngSwitch]=\"field.type\"\n class=\"w-full flex-wrap sm:flex-nowrap flex border-bottom-1 border-bluegray-300\"\n [ngStyle]=\"{ 'padding-block': '12px', 'min-height': '64px' }\" [ngClass]=\"field.fieldWidth ? field.fieldWidth : 'lg:w-24rem'\">\n <label [for]=\"field.name\"\n class=\"flex-none flex align-items-center text-gray-500 font-normal text-sm\"\n [ngClass]=\"field.labelWidth ? field.labelWidth : 'w-11rem'\">\n <span class=\"text-sm\">{{ field.label }}<i *ngIf=\"field.fieldTooltip\" class=\"pi pi-info-circle ml-2\"\n [pTooltip]=\"field.fieldTooltip\" tooltipPosition=\"bottom\"></i></span>\n </label>\n <div class=\"w-full flex align-items-center\">\n <input *ngSwitchDefault [id]=\"field.name\" type=\"text\" pInputText [formControlName]=\"field.name\"\n (blur)=\"trimInput(field.name)\" />\n <p-dropdown *ngSwitchCase=\"'dropdown'\" [id]=\"field.name\" [options]=\"field.dropdownoptions\"\n appendTo=\"body\" [formControlName]=\"field.name\" optionLabel=\"label\" optionValue=\"value\"\n styleClass=\"w-full\" class=\"w-full\" [placeholder]=\"field.placeholder ?? 'Wybierz'\" />\n <p-inputNumber *ngSwitchCase=\"'input-number'\" class=\"w-full\" styleClass=\"w-full\" [id]=\"field.name\"\n [inputId]=\"field.name\" [formControlName]=\"field.name\" locale=\"pl-PL\"\n [minFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \"\n [maxFractionDigits]=\"field.inputNumberSettings?.maxFractionDigits ?? 0 \" currency=\"PLN\"\n [mode]=\"field.inputNumberSettings?.currencyField ? 'currency' : 'decimal'\" />\n <p-checkbox *ngSwitchCase=\"'checkbox'\" [formControlName]=\"field.name\" [binary]=\"true\"\n class=\"flex align-items-center\" styleClass=\"flex align-items-center\" [inputId]=\"field.name\" />\n <p-calendar *ngSwitchCase=\"'calendar'\" [showIcon]=\"true\" [formControlName]=\"field.name\"\n appendTo=\"body\" dateFormat=\"dd.mm.yy\" appendTo=\"body\" baseZIndex=\"1001\" />\n <textarea *ngSwitchCase=\"'textarea'\" rows=\"2\" cols=\"30\" pInputTextarea\n [formControlName]=\"field.name\"></textarea>\n </div>\n </div>\n <ng-container *ngIf=\"field.name === 'badgeText'\">\n <div *ngIf=\"badgePriceWarning as warning\"\n class=\"badge-price-warning w-full flex flex-wrap align-items-center gap-2 text-sm\" role=\"alert\">\n <i class=\"pi pi-exclamation-triangle\"></i>\n <span>Kwota w napisie ({{ warning.written }}) r\u00F3\u017Cni si\u0119 od ceny abonamentu ({{ warning.expected }}).\n Aplikacja pokazuje na kafelku oferty kwot\u0119 z napisu, a pobiera cen\u0119.</span>\n <button *ngIf=\"editMode()\" type=\"button\" class=\"badge-price-fix\" (click)=\"fixBadgeText()\">\n Zmie\u0144 napis na \u201E{{ warning.correctedBadge }}\u201D\n </button>\n </div>\n </ng-container>\n </ng-container>\n </div>\n</form>", styles: [".badge-price-warning{margin-block:8px;padding:10px 12px;border-radius:6px;background:#fff7ed;border:1px solid #fdba74;color:#9a3412}.badge-price-fix{border:0;background:none;padding:0;color:inherit;font:inherit;font-weight:600;text-decoration:underline;cursor:pointer}\n"] }]
|
|
498
587
|
}], ctorParameters: () => [] });
|
|
499
588
|
|
|
500
589
|
class SubscriptionsDetailsComponent {
|
|
@@ -778,6 +867,7 @@ class SubscriptionsListComponent {
|
|
|
778
867
|
this._platformAvailableSubscriptionPlansService = inject(PlatformAvailableSubscriptionPlansService);
|
|
779
868
|
this._platformSubscriptionUsageService = inject(PlatformSubscriptionUsageService);
|
|
780
869
|
this._messageService = inject(MessageService);
|
|
870
|
+
this.priceKind = subscriptionPriceKindLabel(inject(FAS_SUBSCRIPTION_PRICE_KIND, { optional: true }));
|
|
781
871
|
this.subscriptionPlansLoading = false;
|
|
782
872
|
this.showUserTable = false;
|
|
783
873
|
this.resetUserTableTrigger = new Subject();
|
|
@@ -806,7 +896,7 @@ class SubscriptionsListComponent {
|
|
|
806
896
|
},
|
|
807
897
|
]
|
|
808
898
|
},
|
|
809
|
-
{ field: 'value', columnHeader:
|
|
899
|
+
{ field: 'value', columnHeader: `Koszt abonamentu (${this.priceKind})`, },
|
|
810
900
|
{
|
|
811
901
|
columnHeader: 'Akcje',
|
|
812
902
|
sortable: false,
|
|
@@ -5797,5 +5887,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
|
|
|
5797
5887
|
* Generated bundle index. Do not edit.
|
|
5798
5888
|
*/
|
|
5799
5889
|
|
|
5800
|
-
export { API_URL, FASAdminModule, FASAdminService, FAS_DEFAULT_CONFIG_VALUE, FAS_LIB_CONFIG, FAS_USERS_LIST_EXTRA_COLUMNS, provideFASAdminLibApiConfig, provideFASAdminLibConfig };
|
|
5890
|
+
export { API_URL, FASAdminModule, FASAdminService, FAS_DEFAULT_CONFIG_VALUE, FAS_LIB_CONFIG, FAS_SUBSCRIPTION_PRICE_KIND, FAS_USERS_LIST_EXTRA_COLUMNS, provideFASAdminLibApiConfig, provideFASAdminLibConfig, subscriptionPriceKindLabel };
|
|
5801
5891
|
//# sourceMappingURL=fas-admin.mjs.map
|