@solidev/data 0.0.1-alpha.0 → 0.0.1-alpha.1
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/esm2020/lib/dispedit/choice.pipe.mjs +40 -1
- package/esm2020/lib/dispedit/factor.pipe.mjs +33 -1
- package/esm2020/lib/dispedit/factorc.pipe.mjs +48 -1
- package/fesm2015/solidev-data.mjs +123 -1
- package/fesm2015/solidev-data.mjs.map +1 -1
- package/fesm2020/solidev-data.mjs +119 -1
- package/fesm2020/solidev-data.mjs.map +1 -1
- package/lib/dispedit/choice.pipe.d.ts +5 -0
- package/lib/dispedit/factor.pipe.d.ts +7 -0
- package/lib/dispedit/factorc.pipe.d.ts +8 -0
- package/package.json +1 -1
|
@@ -2542,6 +2542,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
|
|
|
2542
2542
|
standalone: true,
|
|
2543
2543
|
}]
|
|
2544
2544
|
}] });
|
|
2545
|
+
class PChoicePipe {
|
|
2546
|
+
transform(value, model, field, mode = 'desc') {
|
|
2547
|
+
if (!model) {
|
|
2548
|
+
return '-';
|
|
2549
|
+
}
|
|
2550
|
+
if (!value) {
|
|
2551
|
+
return '-';
|
|
2552
|
+
}
|
|
2553
|
+
const fvalue = model[field];
|
|
2554
|
+
if (mode === 'code') {
|
|
2555
|
+
return `${fvalue}`;
|
|
2556
|
+
}
|
|
2557
|
+
const manager = model.FM(field);
|
|
2558
|
+
const choices = manager.choices;
|
|
2559
|
+
if (!choices) {
|
|
2560
|
+
return `${fvalue}`;
|
|
2561
|
+
}
|
|
2562
|
+
for (const ch of choices) {
|
|
2563
|
+
if (ch.value === fvalue) {
|
|
2564
|
+
if (mode === 'desc') {
|
|
2565
|
+
return ch.desc;
|
|
2566
|
+
}
|
|
2567
|
+
else {
|
|
2568
|
+
return `[${fvalue}] ${ch.desc}`;
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
return `[${fvalue}] ??`;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
PChoicePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: PChoicePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2576
|
+
PChoicePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.9", ngImport: i0, type: PChoicePipe, isStandalone: true, name: "pchoice" });
|
|
2577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: PChoicePipe, decorators: [{
|
|
2578
|
+
type: Pipe,
|
|
2579
|
+
args: [{
|
|
2580
|
+
name: 'pchoice',
|
|
2581
|
+
standalone: true,
|
|
2582
|
+
}]
|
|
2583
|
+
}] });
|
|
2545
2584
|
|
|
2546
2585
|
function isValue(value) {
|
|
2547
2586
|
return !(value == null || value === '' || value !== value);
|
|
@@ -2587,6 +2626,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
|
|
|
2587
2626
|
type: Inject,
|
|
2588
2627
|
args: [LOCALE_ID]
|
|
2589
2628
|
}] }]; } });
|
|
2629
|
+
class PFactorPipe {
|
|
2630
|
+
constructor(_locale) {
|
|
2631
|
+
this._locale = _locale;
|
|
2632
|
+
}
|
|
2633
|
+
transform(value, model, field, digitsInfo, locale) {
|
|
2634
|
+
if (!model)
|
|
2635
|
+
return null;
|
|
2636
|
+
if (!value)
|
|
2637
|
+
return null;
|
|
2638
|
+
locale = locale || this._locale;
|
|
2639
|
+
const fvalue = model[field];
|
|
2640
|
+
if (!isValue(fvalue))
|
|
2641
|
+
return null;
|
|
2642
|
+
const manager = model.FM(field);
|
|
2643
|
+
let factor = manager.factor;
|
|
2644
|
+
factor = factor || 1;
|
|
2645
|
+
const num = strToNumber(fvalue);
|
|
2646
|
+
return formatNumber(num / factor, locale, digitsInfo);
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
PFactorPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: PFactorPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2650
|
+
PFactorPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.9", ngImport: i0, type: PFactorPipe, isStandalone: true, name: "pfactor" });
|
|
2651
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: PFactorPipe, decorators: [{
|
|
2652
|
+
type: Pipe,
|
|
2653
|
+
args: [{
|
|
2654
|
+
name: 'pfactor',
|
|
2655
|
+
standalone: true,
|
|
2656
|
+
}]
|
|
2657
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2658
|
+
type: Inject,
|
|
2659
|
+
args: [LOCALE_ID]
|
|
2660
|
+
}] }]; } });
|
|
2590
2661
|
|
|
2591
2662
|
class FactorcPipe {
|
|
2592
2663
|
constructor(_locale, _defaultCurrencyCode = 'EUR') {
|
|
@@ -2633,6 +2704,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImpor
|
|
|
2633
2704
|
type: Inject,
|
|
2634
2705
|
args: [DEFAULT_CURRENCY_CODE]
|
|
2635
2706
|
}] }]; } });
|
|
2707
|
+
class PFactorcPipe {
|
|
2708
|
+
constructor(_locale, _defaultCurrencyCode = 'EUR') {
|
|
2709
|
+
this._locale = _locale;
|
|
2710
|
+
this._defaultCurrencyCode = _defaultCurrencyCode;
|
|
2711
|
+
}
|
|
2712
|
+
transform(value, model, field, currencyCode, display, digitsInfo, locale) {
|
|
2713
|
+
if (!model)
|
|
2714
|
+
return null;
|
|
2715
|
+
if (!value)
|
|
2716
|
+
return null;
|
|
2717
|
+
const fvalue = model[field];
|
|
2718
|
+
if (!isValue(fvalue))
|
|
2719
|
+
return null;
|
|
2720
|
+
locale = locale || this._locale;
|
|
2721
|
+
let currency = currencyCode || this._defaultCurrencyCode;
|
|
2722
|
+
if (!display) {
|
|
2723
|
+
display = 'symbol';
|
|
2724
|
+
}
|
|
2725
|
+
if (display !== 'code') {
|
|
2726
|
+
if (display === 'symbol' || display === 'symbol-narrow') {
|
|
2727
|
+
currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);
|
|
2728
|
+
}
|
|
2729
|
+
else {
|
|
2730
|
+
currency = display;
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
const manager = model.FM(field);
|
|
2734
|
+
const factor = manager.factor || 1;
|
|
2735
|
+
const num = strToNumber(fvalue);
|
|
2736
|
+
return formatCurrency(num / factor, locale, currency, currencyCode, digitsInfo);
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
PFactorcPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: PFactorcPipe, deps: [{ token: LOCALE_ID }, { token: DEFAULT_CURRENCY_CODE }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2740
|
+
PFactorcPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.9", ngImport: i0, type: PFactorcPipe, isStandalone: true, name: "pfactorc" });
|
|
2741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.9", ngImport: i0, type: PFactorcPipe, decorators: [{
|
|
2742
|
+
type: Pipe,
|
|
2743
|
+
args: [{
|
|
2744
|
+
name: 'pfactorc',
|
|
2745
|
+
standalone: true,
|
|
2746
|
+
}]
|
|
2747
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
2748
|
+
type: Inject,
|
|
2749
|
+
args: [LOCALE_ID]
|
|
2750
|
+
}] }, { type: undefined, decorators: [{
|
|
2751
|
+
type: Inject,
|
|
2752
|
+
args: [DEFAULT_CURRENCY_CODE]
|
|
2753
|
+
}] }]; } });
|
|
2636
2754
|
|
|
2637
2755
|
class FkselectComponent {
|
|
2638
2756
|
constructor() {
|
|
@@ -5354,5 +5472,5 @@ const slugify = (str) => {
|
|
|
5354
5472
|
* Generated bundle index. Do not edit.
|
|
5355
5473
|
*/
|
|
5356
5474
|
|
|
5357
|
-
export { AuthInterceptor, AuthServiceBase, BanAdapter, BootstrapDataDisplayConfig, BreadcrumbComponent, ChoicePipe, Collection, CollectionMock, DATA_API_URL, DATA_AUTH_PARAMS, DATA_AUTH_SERVICE, DATA_AUTH_USER_SERVICE, DATA_DISPLAY_CONFIG, DATA_MAX_TRANSFERSTATE_TIME, DATA_MESSAGE_SOUNDS, DEFAULT_TIMEOUTS, DataBackend, DataMessageService, DataModel, DataUploaderService, DispeditComponent, FactorPipe, FactorcPipe, FkselectComponent, FlagsComponent, Jwt, Link, M2mselectComponent, Message, MessageZoneComponent, ModelList, ModelListAutocompleteFilter, ModelListAutocompleteMultiFilter, ModelListDateFilter, ModelListDatetimeFilter, ModelListDatetimerangeFilter, ModelListFieldHeaderComponent, ModelListFieldsSelectorComponent, ModelListFilters, ModelListFiltersComponent, ModelListFiltersSelectComponent, ModelListFlagsFilter, ModelListGeodistanceFilter, ModelListNumberFilter, ModelListNumberOperations, ModelListPaginatorComponent, ModelListSelectFilter, ModelListSelectMultiFilter, ModelListService, ModelListSorterComponent, ModelListTextFilter, ModelListTreeFilter, NavDriver, NgFileDropDirective, NgFileSelectDirective, NgxUploaderModule, Queryset, RData, RicheditComponent, STATUS, SafeDeleteComponent, TabMemoryService, UploadStatus, booleanField, charField, dateField, datetimeField, decimalField, detailsField, emailField, floatField, foreignKeyField, humanizeBytes, integerField, isValue, manyToManyField, passwordField, primaryField, reverseForeignKeyField, slugify, strToNumber, textField };
|
|
5475
|
+
export { AuthInterceptor, AuthServiceBase, BanAdapter, BootstrapDataDisplayConfig, BreadcrumbComponent, ChoicePipe, Collection, CollectionMock, DATA_API_URL, DATA_AUTH_PARAMS, DATA_AUTH_SERVICE, DATA_AUTH_USER_SERVICE, DATA_DISPLAY_CONFIG, DATA_MAX_TRANSFERSTATE_TIME, DATA_MESSAGE_SOUNDS, DEFAULT_TIMEOUTS, DataBackend, DataMessageService, DataModel, DataUploaderService, DispeditComponent, FactorPipe, FactorcPipe, FkselectComponent, FlagsComponent, Jwt, Link, M2mselectComponent, Message, MessageZoneComponent, ModelList, ModelListAutocompleteFilter, ModelListAutocompleteMultiFilter, ModelListDateFilter, ModelListDatetimeFilter, ModelListDatetimerangeFilter, ModelListFieldHeaderComponent, ModelListFieldsSelectorComponent, ModelListFilters, ModelListFiltersComponent, ModelListFiltersSelectComponent, ModelListFlagsFilter, ModelListGeodistanceFilter, ModelListNumberFilter, ModelListNumberOperations, ModelListPaginatorComponent, ModelListSelectFilter, ModelListSelectMultiFilter, ModelListService, ModelListSorterComponent, ModelListTextFilter, ModelListTreeFilter, NavDriver, NgFileDropDirective, NgFileSelectDirective, NgxUploaderModule, PChoicePipe, PFactorPipe, PFactorcPipe, Queryset, RData, RicheditComponent, STATUS, SafeDeleteComponent, TabMemoryService, UploadStatus, booleanField, charField, dateField, datetimeField, decimalField, detailsField, emailField, floatField, foreignKeyField, humanizeBytes, integerField, isValue, manyToManyField, passwordField, primaryField, reverseForeignKeyField, slugify, strToNumber, textField };
|
|
5358
5476
|
//# sourceMappingURL=solidev-data.mjs.map
|