imm-element-ui 2.4.0 → 2.4.2
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/grid/cell-render/primeAct-renderer.mjs +89 -0
- package/esm2022/lib/grid/mock-data.mjs +4 -2
- package/esm2022/lib/page-form/page-form.component.mjs +1 -2
- package/fesm2022/imm-element-ui.mjs +87 -2
- package/fesm2022/imm-element-ui.mjs.map +1 -1
- package/lib/grid/cell-render/primeAct-renderer.d.ts +12 -0
- package/lib/grid/grid/grid.component.d.ts +1 -0
- package/lib/grid/mock-data.d.ts +2 -0
- package/package.json +1 -1
|
@@ -5808,6 +5808,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
5808
5808
|
}]
|
|
5809
5809
|
}], ctorParameters: () => [{ type: i0.Renderer2 }] });
|
|
5810
5810
|
|
|
5811
|
+
class PrimeActionsRenderer {
|
|
5812
|
+
constructor() {
|
|
5813
|
+
this.btnConfigs = [];
|
|
5814
|
+
}
|
|
5815
|
+
agInit(params) {
|
|
5816
|
+
this.params = params;
|
|
5817
|
+
this.btnConfigs = (params.btnConfigs || []).filter((v) => {
|
|
5818
|
+
if (v.hidden && typeof v.hidden === 'function') {
|
|
5819
|
+
return v.hidden(this.params.data);
|
|
5820
|
+
}
|
|
5821
|
+
return true;
|
|
5822
|
+
});
|
|
5823
|
+
}
|
|
5824
|
+
refresh(params) {
|
|
5825
|
+
this.params = params;
|
|
5826
|
+
this.btnConfigs = (params.btnConfigs || []).filter((v) => {
|
|
5827
|
+
if (v.hidden && typeof v.hidden === 'function') {
|
|
5828
|
+
return v.hidden(this.params.data);
|
|
5829
|
+
}
|
|
5830
|
+
return true;
|
|
5831
|
+
});
|
|
5832
|
+
return true;
|
|
5833
|
+
}
|
|
5834
|
+
getDisabled(item) {
|
|
5835
|
+
if (typeof item.disabled === 'function') {
|
|
5836
|
+
return item.disabled(this.params.data);
|
|
5837
|
+
}
|
|
5838
|
+
return item.disabled ?? false;
|
|
5839
|
+
}
|
|
5840
|
+
onBtnClick(item) {
|
|
5841
|
+
if (item.onActionClick) {
|
|
5842
|
+
item.onActionClick({
|
|
5843
|
+
data: this.params.data,
|
|
5844
|
+
rowIndex: this.params.rowIndex,
|
|
5845
|
+
node: this.params.node,
|
|
5846
|
+
});
|
|
5847
|
+
}
|
|
5848
|
+
}
|
|
5849
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PrimeActionsRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5850
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: PrimeActionsRenderer, isStandalone: true, selector: "prime-actions-renderer", ngImport: i0, template: `
|
|
5851
|
+
<div
|
|
5852
|
+
class="flex gap-2"
|
|
5853
|
+
style="height: 100%; align-items: center;">
|
|
5854
|
+
@for (item of btnConfigs; track item) {
|
|
5855
|
+
<p-button
|
|
5856
|
+
pRipple
|
|
5857
|
+
[icon]="item.icon"
|
|
5858
|
+
[label]="item.label"
|
|
5859
|
+
[severity]="item.severity"
|
|
5860
|
+
[variant]="item.variant"
|
|
5861
|
+
[raised]="item.raised"
|
|
5862
|
+
[size]="'small'"
|
|
5863
|
+
class="mr-2"
|
|
5864
|
+
(click)="onBtnClick(item)"></p-button>
|
|
5865
|
+
}
|
|
5866
|
+
</div>
|
|
5867
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2$4.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }] }); }
|
|
5868
|
+
}
|
|
5869
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PrimeActionsRenderer, decorators: [{
|
|
5870
|
+
type: Component,
|
|
5871
|
+
args: [{
|
|
5872
|
+
selector: 'prime-actions-renderer',
|
|
5873
|
+
standalone: true,
|
|
5874
|
+
imports: [ButtonModule],
|
|
5875
|
+
template: `
|
|
5876
|
+
<div
|
|
5877
|
+
class="flex gap-2"
|
|
5878
|
+
style="height: 100%; align-items: center;">
|
|
5879
|
+
@for (item of btnConfigs; track item) {
|
|
5880
|
+
<p-button
|
|
5881
|
+
pRipple
|
|
5882
|
+
[icon]="item.icon"
|
|
5883
|
+
[label]="item.label"
|
|
5884
|
+
[severity]="item.severity"
|
|
5885
|
+
[variant]="item.variant"
|
|
5886
|
+
[raised]="item.raised"
|
|
5887
|
+
[size]="'small'"
|
|
5888
|
+
class="mr-2"
|
|
5889
|
+
(click)="onBtnClick(item)"></p-button>
|
|
5890
|
+
}
|
|
5891
|
+
</div>
|
|
5892
|
+
`,
|
|
5893
|
+
}]
|
|
5894
|
+
}] });
|
|
5895
|
+
|
|
5811
5896
|
// rowModelType 使用clientSide的最大值
|
|
5812
5897
|
const CLIENTLIMIT = 9999;
|
|
5813
5898
|
const components = {
|
|
@@ -5821,7 +5906,8 @@ const components = {
|
|
|
5821
5906
|
imgRenderer: ImgRenderer,
|
|
5822
5907
|
cellEditInputDateComponent: CellEditInputDateComponent,
|
|
5823
5908
|
rowSpanRenderer: RowSpanRenderer,
|
|
5824
|
-
cellEditSelectFieldComponent: CellEditSelectFieldComponent
|
|
5909
|
+
cellEditSelectFieldComponent: CellEditSelectFieldComponent,
|
|
5910
|
+
primeActionsRenderer: PrimeActionsRenderer
|
|
5825
5911
|
};
|
|
5826
5912
|
|
|
5827
5913
|
const defaultOption = {
|
|
@@ -9523,7 +9609,6 @@ class PageFormComponent extends AmComponent {
|
|
|
9523
9609
|
}
|
|
9524
9610
|
}
|
|
9525
9611
|
getDetail() {
|
|
9526
|
-
this.indexValue = 0;
|
|
9527
9612
|
this.web_get(this.getPrm).subscribe((res) => {
|
|
9528
9613
|
this.detailCb(res);
|
|
9529
9614
|
});
|