@acorex/platform 20.7.13 → 20.7.15
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/common/index.d.ts +10 -1
- package/core/index.d.ts +93 -4
- package/fesm2022/{acorex-platform-common-common-settings.provider-BwBLG0Hl.mjs → acorex-platform-common-common-settings.provider-gyb6ohAE.mjs} +15 -1
- package/fesm2022/acorex-platform-common-common-settings.provider-gyb6ohAE.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +3 -2
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +428 -157
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +90 -74
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +954 -1223
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +600 -192
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +7 -7
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-BfV3spe3.mjs → acorex-platform-layout-widgets-file-list-popup.component-B0omAUil.mjs} +18 -3
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-B0omAUil.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-repeater-widget-column.component-DnhR00cH.mjs → acorex-platform-layout-widgets-repeater-widget-column.component-fcCirNxz.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-fcCirNxz.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +153 -37
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-CJcbkSBF.mjs → acorex-platform-themes-default-entity-master-create-view.component-CCiYPMhz.mjs} +29 -26
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CCiYPMhz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-HBr-ZTSt.mjs → acorex-platform-themes-default-entity-master-list-view.component-BQODc73e.mjs} +2 -2
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-HBr-ZTSt.mjs.map → acorex-platform-themes-default-entity-master-list-view.component-BQODc73e.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DAFQ4UI9.mjs → acorex-platform-themes-default-entity-master-modify-view.component-CgLUnYRq.mjs} +3 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-CgLUnYRq.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-CwHHYmiK.mjs → acorex-platform-themes-default-entity-master-single-view.component-di5w_3K2.mjs} +4 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-di5w_3K2.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +11 -11
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +244 -246
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +0 -3
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/components/index.d.ts +159 -248
- package/layout/entity/index.d.ts +42 -1
- package/layout/widgets/index.d.ts +41 -3
- package/package.json +9 -9
- package/themes/shared/index.d.ts +1 -1
- package/workflow/index.d.ts +33 -30
- package/fesm2022/acorex-platform-common-common-settings.provider-BwBLG0Hl.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-BfV3spe3.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-DnhR00cH.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CJcbkSBF.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-DAFQ4UI9.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-CwHHYmiK.mjs.map +0 -1
|
@@ -7,33 +7,31 @@ import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
|
7
7
|
import * as i1 from '@angular/common';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { computed, inject, Component, InjectionToken,
|
|
10
|
+
import { computed, inject, Component, InjectionToken, signal, effect, ChangeDetectionStrategy, Injectable, Input, Injector, NgModule } from '@angular/core';
|
|
11
11
|
import { AXPSettingsService, AXP_SETTING_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
|
12
|
-
import * as i1$
|
|
13
|
-
import { AXPScreenSize, AXPPlatformScope } from '@acorex/platform/core';
|
|
12
|
+
import * as i1$3 from '@acorex/platform/core';
|
|
13
|
+
import { AXPScreenSize, AXPPlatformScope, AXPComponentSlotModule } from '@acorex/platform/core';
|
|
14
14
|
import { HttpClient } from '@angular/common/http';
|
|
15
15
|
import { signalStore, withState, withComputed, withMethods, patchState, withHooks } from '@ngrx/signals';
|
|
16
16
|
import { timer, firstValueFrom, filter } from 'rxjs';
|
|
17
17
|
import * as i5 from '@acorex/core/translation';
|
|
18
18
|
import { AXTranslationModule } from '@acorex/core/translation';
|
|
19
|
-
import * as
|
|
19
|
+
import * as i2$3 from '@acorex/platform/layout/widget-core';
|
|
20
20
|
import { AXPValueWidgetComponent, AXP_WIDGETS_LAYOUT_CATEGORY, AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
|
|
21
|
-
import
|
|
22
|
-
import { AXPComponentSlotModule } from '@acorex/platform/layout/components';
|
|
23
|
-
import * as i2$1 from '@acorex/components/form';
|
|
24
|
-
import { AXFormModule } from '@acorex/components/form';
|
|
25
|
-
import * as i4$1 from '@acorex/components/search-box';
|
|
26
|
-
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
|
27
|
-
import * as i1$1 from '@acorex/components/select-box';
|
|
28
|
-
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
|
21
|
+
import { AXSelectionCdkModule } from '@acorex/cdk/selection';
|
|
29
22
|
import * as i5$1 from '@angular/forms';
|
|
30
23
|
import { FormsModule } from '@angular/forms';
|
|
31
24
|
import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY } from '@acorex/platform/layout/widgets';
|
|
32
|
-
import { AXSelectionCdkModule } from '@acorex/cdk/selection';
|
|
33
25
|
import { AXPopupService } from '@acorex/components/popup';
|
|
34
|
-
import * as i2$
|
|
26
|
+
import * as i2$1 from '@acorex/components/button-group';
|
|
35
27
|
import { AXButtonGroupModule } from '@acorex/components/button-group';
|
|
36
28
|
import { AXBasePageComponent } from '@acorex/components/page';
|
|
29
|
+
import * as i1$1 from '@acorex/components/search-box';
|
|
30
|
+
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
|
31
|
+
import * as i2$2 from '@acorex/components/form';
|
|
32
|
+
import { AXFormModule } from '@acorex/components/form';
|
|
33
|
+
import * as i1$2 from '@acorex/components/select-box';
|
|
34
|
+
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
|
37
35
|
|
|
38
36
|
var AXPThemeLayoutSetting;
|
|
39
37
|
(function (AXPThemeLayoutSetting) {
|
|
@@ -467,234 +465,6 @@ class AXPThemePaletteProviderDefault {
|
|
|
467
465
|
}
|
|
468
466
|
}
|
|
469
467
|
|
|
470
|
-
class AXPColorProvider {
|
|
471
|
-
}
|
|
472
|
-
function titleCase(str) {
|
|
473
|
-
return str.replace(/-/g, ' ').replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
474
|
-
}
|
|
475
|
-
function generateDefaultColors() {
|
|
476
|
-
const colors = [];
|
|
477
|
-
const styles = ['primary', 'secondary', 'success', 'warning', 'danger'];
|
|
478
|
-
const variants = [
|
|
479
|
-
'lightest',
|
|
480
|
-
'lighter',
|
|
481
|
-
'light',
|
|
482
|
-
'surface',
|
|
483
|
-
'dark',
|
|
484
|
-
'darker',
|
|
485
|
-
'darkest',
|
|
486
|
-
// ,'default'
|
|
487
|
-
];
|
|
488
|
-
for (const style of styles) {
|
|
489
|
-
for (const variant of variants) {
|
|
490
|
-
let name;
|
|
491
|
-
let colorClass;
|
|
492
|
-
// if (variant === 'default') {
|
|
493
|
-
// name = `${style}-${variant}`;
|
|
494
|
-
// colorClass = `ax-text-${style}-${variant}`;
|
|
495
|
-
// } else {
|
|
496
|
-
name = `${style}-${variant}`;
|
|
497
|
-
colorClass = `ax-text-${style}-on-${variant}`;
|
|
498
|
-
// }
|
|
499
|
-
colors.push({
|
|
500
|
-
title: titleCase(variant === 'surface' ? style : titleCase(name)),
|
|
501
|
-
name: name,
|
|
502
|
-
color: colorClass,
|
|
503
|
-
background: `ax-bg-${name}`,
|
|
504
|
-
border: `ax-border-${name}`,
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
return colors;
|
|
509
|
-
}
|
|
510
|
-
const DEFAULT_COLORS = generateDefaultColors();
|
|
511
|
-
class AXPColorProviderDefault extends AXPColorProvider {
|
|
512
|
-
async provide() {
|
|
513
|
-
return DEFAULT_COLORS;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
const AXP_COLOR_PROVIDER = new InjectionToken('AXP_COLOR_PROVIDER');
|
|
517
|
-
class AXPColorChooserService {
|
|
518
|
-
constructor() {
|
|
519
|
-
this.defaultProvider = new AXPColorProviderDefault();
|
|
520
|
-
this.providers = (() => {
|
|
521
|
-
const injected = inject(AXP_COLOR_PROVIDER, { optional: true });
|
|
522
|
-
if (!injected) {
|
|
523
|
-
return [this.defaultProvider];
|
|
524
|
-
}
|
|
525
|
-
const providers = Array.isArray(injected) ? injected : [injected];
|
|
526
|
-
return [...providers, this.defaultProvider];
|
|
527
|
-
})();
|
|
528
|
-
this.cache = null;
|
|
529
|
-
}
|
|
530
|
-
async getColors() {
|
|
531
|
-
if (this.cache) {
|
|
532
|
-
return this.cache;
|
|
533
|
-
}
|
|
534
|
-
const allColors = [];
|
|
535
|
-
for (const resolver of this.providers) {
|
|
536
|
-
const result = await resolver.provide();
|
|
537
|
-
allColors.push(...result);
|
|
538
|
-
}
|
|
539
|
-
const uniqueColors = allColors.filter((color, index, self) => index === self.findIndex((c) => c.title === color.title));
|
|
540
|
-
this.cache = uniqueColors;
|
|
541
|
-
return uniqueColors;
|
|
542
|
-
}
|
|
543
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
544
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserService, providedIn: 'root' }); }
|
|
545
|
-
}
|
|
546
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserService, decorators: [{
|
|
547
|
-
type: Injectable,
|
|
548
|
-
args: [{
|
|
549
|
-
providedIn: 'root',
|
|
550
|
-
}]
|
|
551
|
-
}] });
|
|
552
|
-
|
|
553
|
-
class AXPColorChooserWidgetEditComponent extends AXPValueWidgetComponent {
|
|
554
|
-
constructor() {
|
|
555
|
-
super(...arguments);
|
|
556
|
-
this.colorService = inject(AXPColorChooserService);
|
|
557
|
-
this.colors = signal([], ...(ngDevMode ? [{ debugName: "colors" }] : []));
|
|
558
|
-
this.placeholder = computed(() => this.options()['placeholder'] ?? '', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
559
|
-
this.selectedColor = computed(() => {
|
|
560
|
-
const value = this.getValue();
|
|
561
|
-
if (!value) {
|
|
562
|
-
return this.colors()[0];
|
|
563
|
-
}
|
|
564
|
-
// If value is a string in the format: "ax-text-* ax-bg-* ax-border-*"
|
|
565
|
-
if (typeof value === 'string') {
|
|
566
|
-
const parsed = this.parseStringValue(value);
|
|
567
|
-
if (parsed) {
|
|
568
|
-
return parsed;
|
|
569
|
-
}
|
|
570
|
-
return this.colors()[0];
|
|
571
|
-
}
|
|
572
|
-
// Otherwise value is an object
|
|
573
|
-
return value.name;
|
|
574
|
-
}, ...(ngDevMode ? [{ debugName: "selectedColor" }] : []));
|
|
575
|
-
}
|
|
576
|
-
async ngOnInit() {
|
|
577
|
-
const allColors = await this.colorService.getColors();
|
|
578
|
-
this.colors.set(allColors);
|
|
579
|
-
super.ngOnInit();
|
|
580
|
-
}
|
|
581
|
-
handleValueChange(event) {
|
|
582
|
-
if (event.isUserInteraction) {
|
|
583
|
-
if (!event.value) {
|
|
584
|
-
this.setValue(undefined);
|
|
585
|
-
return;
|
|
586
|
-
}
|
|
587
|
-
const color = event.component.selectedItems[0];
|
|
588
|
-
// Always store as ordered string: "color background border"
|
|
589
|
-
const stringValue = `${color.color} ${color.background} ${color.border}`;
|
|
590
|
-
this.setValue(stringValue);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
parseStringValue(value) {
|
|
594
|
-
const parts = value.trim().split(/\s+/);
|
|
595
|
-
if (parts.length !== 3) {
|
|
596
|
-
return null;
|
|
597
|
-
}
|
|
598
|
-
const [color, background, border] = parts;
|
|
599
|
-
const match = this.colors().find((c) => c.color === color && c.background === background && c.border === border);
|
|
600
|
-
return match?.name ?? null;
|
|
601
|
-
}
|
|
602
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
603
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: AXPColorChooserWidgetEditComponent, isStandalone: true, selector: "ax-color-chooser-widget", usesInheritance: true, ngImport: i0, template: `
|
|
604
|
-
<ax-form [messageStyle]="'float'" [updateOn]="'change'">
|
|
605
|
-
<ax-form-field>
|
|
606
|
-
<ax-select-box
|
|
607
|
-
[dataSource]="colors()"
|
|
608
|
-
textField="title"
|
|
609
|
-
valueField="name"
|
|
610
|
-
[placeholder]="placeholder()"
|
|
611
|
-
[itemTemplate]="customItemTemplate"
|
|
612
|
-
[ngModel]="selectedColor()"
|
|
613
|
-
(onValueChanged)="handleValueChange($event)"
|
|
614
|
-
[selectedTemplate]="customItemTemplate"
|
|
615
|
-
>
|
|
616
|
-
<ng-template #customItemTemplate let-item>
|
|
617
|
-
<div class="ax-flex ax-items-center ax-gap-2 ax-p-2">
|
|
618
|
-
<div
|
|
619
|
-
class="ax-w-6 ax-h-6 ax-rounded ax-flex ax-items-center ax-justify-center ax-border ax-border-dashed ax-border-black dark:ax-border-white"
|
|
620
|
-
[ngClass]="item.data.background"
|
|
621
|
-
>
|
|
622
|
-
<span [ngClass]="item.data.color">Aa</span>
|
|
623
|
-
</div>
|
|
624
|
-
<span>{{ item.data.title }}</span>
|
|
625
|
-
</div>
|
|
626
|
-
</ng-template>
|
|
627
|
-
<ax-search-box look="fill"></ax-search-box>
|
|
628
|
-
<ax-validation-rule message="field can't be empty" rule="required"></ax-validation-rule>
|
|
629
|
-
</ax-select-box>
|
|
630
|
-
</ax-form-field>
|
|
631
|
-
</ax-form>
|
|
632
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i1$1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "itemHeight", "maxVisibleItems", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i2$1.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i2$1.AXFormComponent, selector: "ax-form", inputs: ["disabled", "readonly", "labelMode", "look", "messageStyle", "updateOn", "inUserInteractionActive"], outputs: ["onValidate", "updateOnChange"] }, { kind: "directive", type: i2$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i4$1.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
633
|
-
}
|
|
634
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserWidgetEditComponent, decorators: [{
|
|
635
|
-
type: Component,
|
|
636
|
-
args: [{
|
|
637
|
-
selector: 'ax-color-chooser-widget',
|
|
638
|
-
template: `
|
|
639
|
-
<ax-form [messageStyle]="'float'" [updateOn]="'change'">
|
|
640
|
-
<ax-form-field>
|
|
641
|
-
<ax-select-box
|
|
642
|
-
[dataSource]="colors()"
|
|
643
|
-
textField="title"
|
|
644
|
-
valueField="name"
|
|
645
|
-
[placeholder]="placeholder()"
|
|
646
|
-
[itemTemplate]="customItemTemplate"
|
|
647
|
-
[ngModel]="selectedColor()"
|
|
648
|
-
(onValueChanged)="handleValueChange($event)"
|
|
649
|
-
[selectedTemplate]="customItemTemplate"
|
|
650
|
-
>
|
|
651
|
-
<ng-template #customItemTemplate let-item>
|
|
652
|
-
<div class="ax-flex ax-items-center ax-gap-2 ax-p-2">
|
|
653
|
-
<div
|
|
654
|
-
class="ax-w-6 ax-h-6 ax-rounded ax-flex ax-items-center ax-justify-center ax-border ax-border-dashed ax-border-black dark:ax-border-white"
|
|
655
|
-
[ngClass]="item.data.background"
|
|
656
|
-
>
|
|
657
|
-
<span [ngClass]="item.data.color">Aa</span>
|
|
658
|
-
</div>
|
|
659
|
-
<span>{{ item.data.title }}</span>
|
|
660
|
-
</div>
|
|
661
|
-
</ng-template>
|
|
662
|
-
<ax-search-box look="fill"></ax-search-box>
|
|
663
|
-
<ax-validation-rule message="field can't be empty" rule="required"></ax-validation-rule>
|
|
664
|
-
</ax-select-box>
|
|
665
|
-
</ax-form-field>
|
|
666
|
-
</ax-form>
|
|
667
|
-
`,
|
|
668
|
-
imports: [AXSelectBoxModule, AXFormModule, CommonModule, AXSearchBoxModule, AXButtonModule, FormsModule],
|
|
669
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
670
|
-
}]
|
|
671
|
-
}] });
|
|
672
|
-
|
|
673
|
-
var themeColorChooserEdit_component = /*#__PURE__*/Object.freeze({
|
|
674
|
-
__proto__: null,
|
|
675
|
-
AXPColorChooserWidgetEditComponent: AXPColorChooserWidgetEditComponent
|
|
676
|
-
});
|
|
677
|
-
|
|
678
|
-
const AXPThemeColorChooserWidgetConfig = {
|
|
679
|
-
name: 'theme-color-chooser',
|
|
680
|
-
title: 'Theme Color Chooser',
|
|
681
|
-
icon: 'fa-solid fa-palette',
|
|
682
|
-
type: 'editor',
|
|
683
|
-
categories: AXP_WIDGETS_LAYOUT_CATEGORY,
|
|
684
|
-
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY],
|
|
685
|
-
components: {
|
|
686
|
-
edit: {
|
|
687
|
-
component: () => Promise.resolve().then(function () { return themeColorChooserEdit_component; }).then((c) => c.AXPColorChooserWidgetEditComponent),
|
|
688
|
-
},
|
|
689
|
-
column: {
|
|
690
|
-
component: () => import('./acorex-platform-themes-shared-theme-color-chooser-column.component-BQxoUmYL.mjs').then((c) => c.AXPColorChooserWidgetColumnComponent),
|
|
691
|
-
},
|
|
692
|
-
view: {
|
|
693
|
-
component: () => import('./acorex-platform-themes-shared-theme-color-chooser-view.component-CTGy2kjJ.mjs').then((c) => c.AXPColorChooserWidgetViewComponent),
|
|
694
|
-
},
|
|
695
|
-
},
|
|
696
|
-
};
|
|
697
|
-
|
|
698
468
|
class AXPFontSizeChooserWidgetComponent extends AXPValueWidgetComponent {
|
|
699
469
|
constructor() {
|
|
700
470
|
super(...arguments);
|
|
@@ -1053,7 +823,7 @@ class AXPIconChooserPopupComponent extends AXBasePageComponent {
|
|
|
1053
823
|
</div>
|
|
1054
824
|
</div>
|
|
1055
825
|
</div>
|
|
1056
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type:
|
|
826
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i1$1.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonGroupModule }, { kind: "component", type: i2$1.AXButtonGroupComponent, selector: "ax-button-group", inputs: ["disabled", "color", "look", "fitParent", "selection"], outputs: ["onBlur", "onFocus", "lookChange", "colorChange", "disabledChange", "onClick", "selectionChange", "selectedButtonChange"] }, { kind: "component", type: i2$1.AXButtonGroupItemComponent, selector: "ax-button-group-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1057
827
|
}
|
|
1058
828
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPIconChooserPopupComponent, decorators: [{
|
|
1059
829
|
type: Component,
|
|
@@ -1883,6 +1653,234 @@ const AXPMenuOrientationChooserWidget = {
|
|
|
1883
1653
|
}
|
|
1884
1654
|
};
|
|
1885
1655
|
|
|
1656
|
+
class AXPColorProvider {
|
|
1657
|
+
}
|
|
1658
|
+
function titleCase(str) {
|
|
1659
|
+
return str.replace(/-/g, ' ').replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
1660
|
+
}
|
|
1661
|
+
function generateDefaultColors() {
|
|
1662
|
+
const colors = [];
|
|
1663
|
+
const styles = ['primary', 'secondary', 'success', 'warning', 'danger'];
|
|
1664
|
+
const variants = [
|
|
1665
|
+
'lightest',
|
|
1666
|
+
'lighter',
|
|
1667
|
+
'light',
|
|
1668
|
+
'surface',
|
|
1669
|
+
'dark',
|
|
1670
|
+
'darker',
|
|
1671
|
+
'darkest',
|
|
1672
|
+
// ,'default'
|
|
1673
|
+
];
|
|
1674
|
+
for (const style of styles) {
|
|
1675
|
+
for (const variant of variants) {
|
|
1676
|
+
let name;
|
|
1677
|
+
let colorClass;
|
|
1678
|
+
// if (variant === 'default') {
|
|
1679
|
+
// name = `${style}-${variant}`;
|
|
1680
|
+
// colorClass = `ax-text-${style}-${variant}`;
|
|
1681
|
+
// } else {
|
|
1682
|
+
name = `${style}-${variant}`;
|
|
1683
|
+
colorClass = `ax-text-${style}-on-${variant}`;
|
|
1684
|
+
// }
|
|
1685
|
+
colors.push({
|
|
1686
|
+
title: titleCase(variant === 'surface' ? style : titleCase(name)),
|
|
1687
|
+
name: name,
|
|
1688
|
+
color: colorClass,
|
|
1689
|
+
background: `ax-bg-${name}`,
|
|
1690
|
+
border: `ax-border-${name}`,
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
return colors;
|
|
1695
|
+
}
|
|
1696
|
+
const DEFAULT_COLORS = generateDefaultColors();
|
|
1697
|
+
class AXPColorProviderDefault extends AXPColorProvider {
|
|
1698
|
+
async provide() {
|
|
1699
|
+
return DEFAULT_COLORS;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
const AXP_COLOR_PROVIDER = new InjectionToken('AXP_COLOR_PROVIDER');
|
|
1703
|
+
class AXPColorChooserService {
|
|
1704
|
+
constructor() {
|
|
1705
|
+
this.defaultProvider = new AXPColorProviderDefault();
|
|
1706
|
+
this.providers = (() => {
|
|
1707
|
+
const injected = inject(AXP_COLOR_PROVIDER, { optional: true });
|
|
1708
|
+
if (!injected) {
|
|
1709
|
+
return [this.defaultProvider];
|
|
1710
|
+
}
|
|
1711
|
+
const providers = Array.isArray(injected) ? injected : [injected];
|
|
1712
|
+
return [...providers, this.defaultProvider];
|
|
1713
|
+
})();
|
|
1714
|
+
this.cache = null;
|
|
1715
|
+
}
|
|
1716
|
+
async getColors() {
|
|
1717
|
+
if (this.cache) {
|
|
1718
|
+
return this.cache;
|
|
1719
|
+
}
|
|
1720
|
+
const allColors = [];
|
|
1721
|
+
for (const resolver of this.providers) {
|
|
1722
|
+
const result = await resolver.provide();
|
|
1723
|
+
allColors.push(...result);
|
|
1724
|
+
}
|
|
1725
|
+
const uniqueColors = allColors.filter((color, index, self) => index === self.findIndex((c) => c.title === color.title));
|
|
1726
|
+
this.cache = uniqueColors;
|
|
1727
|
+
return uniqueColors;
|
|
1728
|
+
}
|
|
1729
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1730
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserService, providedIn: 'root' }); }
|
|
1731
|
+
}
|
|
1732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserService, decorators: [{
|
|
1733
|
+
type: Injectable,
|
|
1734
|
+
args: [{
|
|
1735
|
+
providedIn: 'root',
|
|
1736
|
+
}]
|
|
1737
|
+
}] });
|
|
1738
|
+
|
|
1739
|
+
class AXPColorChooserWidgetEditComponent extends AXPValueWidgetComponent {
|
|
1740
|
+
constructor() {
|
|
1741
|
+
super(...arguments);
|
|
1742
|
+
this.colorService = inject(AXPColorChooserService);
|
|
1743
|
+
this.colors = signal([], ...(ngDevMode ? [{ debugName: "colors" }] : []));
|
|
1744
|
+
this.placeholder = computed(() => this.options()['placeholder'] ?? '', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1745
|
+
this.selectedColor = computed(() => {
|
|
1746
|
+
const value = this.getValue();
|
|
1747
|
+
if (!value) {
|
|
1748
|
+
return this.colors()[0];
|
|
1749
|
+
}
|
|
1750
|
+
// If value is a string in the format: "ax-text-* ax-bg-* ax-border-*"
|
|
1751
|
+
if (typeof value === 'string') {
|
|
1752
|
+
const parsed = this.parseStringValue(value);
|
|
1753
|
+
if (parsed) {
|
|
1754
|
+
return parsed;
|
|
1755
|
+
}
|
|
1756
|
+
return this.colors()[0];
|
|
1757
|
+
}
|
|
1758
|
+
// Otherwise value is an object
|
|
1759
|
+
return value.name;
|
|
1760
|
+
}, ...(ngDevMode ? [{ debugName: "selectedColor" }] : []));
|
|
1761
|
+
}
|
|
1762
|
+
async ngOnInit() {
|
|
1763
|
+
const allColors = await this.colorService.getColors();
|
|
1764
|
+
this.colors.set(allColors);
|
|
1765
|
+
super.ngOnInit();
|
|
1766
|
+
}
|
|
1767
|
+
handleValueChange(event) {
|
|
1768
|
+
if (event.isUserInteraction) {
|
|
1769
|
+
if (!event.value) {
|
|
1770
|
+
this.setValue(undefined);
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
const color = event.component.selectedItems[0];
|
|
1774
|
+
// Always store as ordered string: "color background border"
|
|
1775
|
+
const stringValue = `${color.color} ${color.background} ${color.border}`;
|
|
1776
|
+
this.setValue(stringValue);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
parseStringValue(value) {
|
|
1780
|
+
const parts = value.trim().split(/\s+/);
|
|
1781
|
+
if (parts.length !== 3) {
|
|
1782
|
+
return null;
|
|
1783
|
+
}
|
|
1784
|
+
const [color, background, border] = parts;
|
|
1785
|
+
const match = this.colors().find((c) => c.color === color && c.background === background && c.border === border);
|
|
1786
|
+
return match?.name ?? null;
|
|
1787
|
+
}
|
|
1788
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1789
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: AXPColorChooserWidgetEditComponent, isStandalone: true, selector: "ax-color-chooser-widget", usesInheritance: true, ngImport: i0, template: `
|
|
1790
|
+
<ax-form [messageStyle]="'float'" [updateOn]="'change'">
|
|
1791
|
+
<ax-form-field>
|
|
1792
|
+
<ax-select-box
|
|
1793
|
+
[dataSource]="colors()"
|
|
1794
|
+
textField="title"
|
|
1795
|
+
valueField="name"
|
|
1796
|
+
[placeholder]="placeholder()"
|
|
1797
|
+
[itemTemplate]="customItemTemplate"
|
|
1798
|
+
[ngModel]="selectedColor()"
|
|
1799
|
+
(onValueChanged)="handleValueChange($event)"
|
|
1800
|
+
[selectedTemplate]="customItemTemplate"
|
|
1801
|
+
>
|
|
1802
|
+
<ng-template #customItemTemplate let-item>
|
|
1803
|
+
<div class="ax-flex ax-items-center ax-gap-2 ax-p-2">
|
|
1804
|
+
<div
|
|
1805
|
+
class="ax-w-6 ax-h-6 ax-rounded ax-flex ax-items-center ax-justify-center ax-border ax-border-dashed ax-border-black dark:ax-border-white"
|
|
1806
|
+
[ngClass]="item.data.background"
|
|
1807
|
+
>
|
|
1808
|
+
<span [ngClass]="item.data.color">Aa</span>
|
|
1809
|
+
</div>
|
|
1810
|
+
<span>{{ item.data.title }}</span>
|
|
1811
|
+
</div>
|
|
1812
|
+
</ng-template>
|
|
1813
|
+
<ax-search-box look="fill"></ax-search-box>
|
|
1814
|
+
<ax-validation-rule message="field can't be empty" rule="required"></ax-validation-rule>
|
|
1815
|
+
</ax-select-box>
|
|
1816
|
+
</ax-form-field>
|
|
1817
|
+
</ax-form>
|
|
1818
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i1$2.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "itemHeight", "maxVisibleItems", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i2$2.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i2$2.AXFormComponent, selector: "ax-form", inputs: ["disabled", "readonly", "labelMode", "look", "messageStyle", "updateOn", "inUserInteractionActive"], outputs: ["onValidate", "updateOnChange"] }, { kind: "directive", type: i2$2.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i1$1.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type", "autoSearch"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1819
|
+
}
|
|
1820
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPColorChooserWidgetEditComponent, decorators: [{
|
|
1821
|
+
type: Component,
|
|
1822
|
+
args: [{
|
|
1823
|
+
selector: 'ax-color-chooser-widget',
|
|
1824
|
+
template: `
|
|
1825
|
+
<ax-form [messageStyle]="'float'" [updateOn]="'change'">
|
|
1826
|
+
<ax-form-field>
|
|
1827
|
+
<ax-select-box
|
|
1828
|
+
[dataSource]="colors()"
|
|
1829
|
+
textField="title"
|
|
1830
|
+
valueField="name"
|
|
1831
|
+
[placeholder]="placeholder()"
|
|
1832
|
+
[itemTemplate]="customItemTemplate"
|
|
1833
|
+
[ngModel]="selectedColor()"
|
|
1834
|
+
(onValueChanged)="handleValueChange($event)"
|
|
1835
|
+
[selectedTemplate]="customItemTemplate"
|
|
1836
|
+
>
|
|
1837
|
+
<ng-template #customItemTemplate let-item>
|
|
1838
|
+
<div class="ax-flex ax-items-center ax-gap-2 ax-p-2">
|
|
1839
|
+
<div
|
|
1840
|
+
class="ax-w-6 ax-h-6 ax-rounded ax-flex ax-items-center ax-justify-center ax-border ax-border-dashed ax-border-black dark:ax-border-white"
|
|
1841
|
+
[ngClass]="item.data.background"
|
|
1842
|
+
>
|
|
1843
|
+
<span [ngClass]="item.data.color">Aa</span>
|
|
1844
|
+
</div>
|
|
1845
|
+
<span>{{ item.data.title }}</span>
|
|
1846
|
+
</div>
|
|
1847
|
+
</ng-template>
|
|
1848
|
+
<ax-search-box look="fill"></ax-search-box>
|
|
1849
|
+
<ax-validation-rule message="field can't be empty" rule="required"></ax-validation-rule>
|
|
1850
|
+
</ax-select-box>
|
|
1851
|
+
</ax-form-field>
|
|
1852
|
+
</ax-form>
|
|
1853
|
+
`,
|
|
1854
|
+
imports: [AXSelectBoxModule, AXFormModule, CommonModule, AXSearchBoxModule, AXButtonModule, FormsModule],
|
|
1855
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1856
|
+
}]
|
|
1857
|
+
}] });
|
|
1858
|
+
|
|
1859
|
+
var themeColorChooserEdit_component = /*#__PURE__*/Object.freeze({
|
|
1860
|
+
__proto__: null,
|
|
1861
|
+
AXPColorChooserWidgetEditComponent: AXPColorChooserWidgetEditComponent
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1864
|
+
const AXPThemeColorChooserWidgetConfig = {
|
|
1865
|
+
name: 'theme-color-chooser',
|
|
1866
|
+
title: 'Theme Color Chooser',
|
|
1867
|
+
icon: 'fa-solid fa-palette',
|
|
1868
|
+
type: 'editor',
|
|
1869
|
+
categories: AXP_WIDGETS_LAYOUT_CATEGORY,
|
|
1870
|
+
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY],
|
|
1871
|
+
components: {
|
|
1872
|
+
edit: {
|
|
1873
|
+
component: () => Promise.resolve().then(function () { return themeColorChooserEdit_component; }).then((c) => c.AXPColorChooserWidgetEditComponent),
|
|
1874
|
+
},
|
|
1875
|
+
column: {
|
|
1876
|
+
component: () => import('./acorex-platform-themes-shared-theme-color-chooser-column.component-BQxoUmYL.mjs').then((c) => c.AXPColorChooserWidgetColumnComponent),
|
|
1877
|
+
},
|
|
1878
|
+
view: {
|
|
1879
|
+
component: () => import('./acorex-platform-themes-shared-theme-color-chooser-view.component-CTGy2kjJ.mjs').then((c) => c.AXPColorChooserWidgetViewComponent),
|
|
1880
|
+
},
|
|
1881
|
+
},
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1886
1884
|
class AXPThemeModeChooserWidgetComponent extends AXPValueWidgetComponent {
|
|
1887
1885
|
constructor() {
|
|
1888
1886
|
super(...arguments);
|
|
@@ -2039,8 +2037,8 @@ class AXPThemesSharedModule {
|
|
|
2039
2037
|
},
|
|
2040
2038
|
});
|
|
2041
2039
|
}
|
|
2042
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPThemesSharedModule, deps: [{ token: i1$
|
|
2043
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPThemesSharedModule, imports: [
|
|
2040
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPThemesSharedModule, deps: [{ token: i1$3.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2041
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.16", ngImport: i0, type: AXPThemesSharedModule, imports: [i1$3.AXPComponentSlotModule, i2$3.AXPWidgetCoreModule] }); }
|
|
2044
2042
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPThemesSharedModule, providers: [
|
|
2045
2043
|
{
|
|
2046
2044
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
|
@@ -2113,7 +2111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
2113
2111
|
...provideDefaultIconChooser(),
|
|
2114
2112
|
],
|
|
2115
2113
|
}]
|
|
2116
|
-
}], ctorParameters: () => [{ type: i1$
|
|
2114
|
+
}], ctorParameters: () => [{ type: i1$3.AXPAppStartUpService }, { type: i0.Injector }] });
|
|
2117
2115
|
|
|
2118
2116
|
/**
|
|
2119
2117
|
* Generated bundle index. Do not edit.
|