@yibozhang/pro-table 16.0.9 → 16.1.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.
|
@@ -417,7 +417,7 @@ class PlateInputComponent {
|
|
|
417
417
|
useExisting: forwardRef(() => PlateInputComponent),
|
|
418
418
|
multi: true,
|
|
419
419
|
},
|
|
420
|
-
], ngImport: i0, template: "<div\r\n class=\"plate-antd-input-container\"\r\n [class.plate-antd-input-disabled]=\"disabled\"\r\n>\r\n <div\r\n class=\"plate-input-prefix\"\r\n [class.plate-input-prefix-disabled]=\"disabled\"\r\n nz-popover\r\n nzPopoverPlacement=\"bottom\"\r\n nzPopoverOverlayClassName=\"plate-input-popover\"\r\n [(nzPopoverVisible)]=\"nzPopoverVisible\"\r\n [nzPopoverTrigger]=\"'manual'\"\r\n [nzPopoverContent]=\"contentTemplate\"\r\n (click)=\"handlePrefixClick($event)\"\r\n >\r\n {{ platePrefix | uppercase }}\r\n <i\r\n class=\"plate-input-icon-down\"\r\n [nzRotate]=\"nzPopoverVisible ? 180 : 0\"\r\n nz-icon\r\n nzType=\"down\"\r\n nzTheme=\"outline\"\r\n ></i>\r\n </div>\r\n <ng-template #contentTemplate>\r\n <div nz-row style=\"height: 100%\">\r\n <div\r\n nz-col\r\n nzSpan=\"4\"\r\n *ngFor=\"let item of platePrefixOptions\"\r\n class=\"plate-input-popover-item\"\r\n (click)=\"!disabled && handlePlatePrefix(item.value)\"\r\n [ngClass]=\"{\r\n 'plate-input-popover-item-active': item.value === platePrefix,\r\n 'plate-input-popover-item-default': item.value !== platePrefix\r\n }\"\r\n >\r\n <div class=\"plate-input-popover-item-label\">\r\n {{ item.label }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <input\r\n class=\"plate-input-suffix\"\r\n type=\"text\"\r\n nz-input\r\n allow-trim\r\n style=\"width: 75%\"\r\n [value]=\"plateSuffix | uppercase\"\r\n [disabled]=\"disabled\"\r\n (blur)=\"!disabled && handleAntdPlateSuffixBlur($event)\"\r\n placeholder=\"\u8BF7\u8F93\u5165\"\r\n maxlength=\"
|
|
420
|
+
], ngImport: i0, template: "<div\r\n class=\"plate-antd-input-container\"\r\n [class.plate-antd-input-disabled]=\"disabled\"\r\n>\r\n <div\r\n class=\"plate-input-prefix\"\r\n [class.plate-input-prefix-disabled]=\"disabled\"\r\n nz-popover\r\n nzPopoverPlacement=\"bottom\"\r\n nzPopoverOverlayClassName=\"plate-input-popover\"\r\n [(nzPopoverVisible)]=\"nzPopoverVisible\"\r\n [nzPopoverTrigger]=\"'manual'\"\r\n [nzPopoverContent]=\"contentTemplate\"\r\n (click)=\"handlePrefixClick($event)\"\r\n >\r\n {{ platePrefix | uppercase }}\r\n <i\r\n class=\"plate-input-icon-down\"\r\n [nzRotate]=\"nzPopoverVisible ? 180 : 0\"\r\n nz-icon\r\n nzType=\"down\"\r\n nzTheme=\"outline\"\r\n ></i>\r\n </div>\r\n <ng-template #contentTemplate>\r\n <div nz-row style=\"height: 100%\">\r\n <div\r\n nz-col\r\n nzSpan=\"4\"\r\n *ngFor=\"let item of platePrefixOptions\"\r\n class=\"plate-input-popover-item\"\r\n (click)=\"!disabled && handlePlatePrefix(item.value)\"\r\n [ngClass]=\"{\r\n 'plate-input-popover-item-active': item.value === platePrefix,\r\n 'plate-input-popover-item-default': item.value !== platePrefix\r\n }\"\r\n >\r\n <div class=\"plate-input-popover-item-label\">\r\n {{ item.label }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <input\r\n class=\"plate-input-suffix\"\r\n type=\"text\"\r\n nz-input\r\n allow-trim\r\n style=\"width: 75%\"\r\n [value]=\"plateSuffix | uppercase\"\r\n [disabled]=\"disabled\"\r\n (blur)=\"!disabled && handleAntdPlateSuffixBlur($event)\"\r\n placeholder=\"\u8BF7\u8F93\u5165\"\r\n maxlength=\"8\"\r\n />\r\n</div>\r\n", styles: ["::ng-deep .plate-input-popover{box-sizing:border-box;padding:5px 0}::ng-deep .plate-input-popover .ant-popover-inner-content{width:387px;height:264px;padding:0}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item{height:42px;box-sizing:border-box;padding:6px 12px;cursor:pointer}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item .plate-input-popover-item-label{width:100%;height:100%;display:flex;justify-content:center;align-items:center;border:1px solid #ccc}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-default:hover{background-color:#eaeaea}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-active{background-color:#096dd9;color:#fff}::ng-deep .plate-input-prefix:hover:after{content:\"\";position:absolute;top:0;right:0;width:1px;height:100%;background-color:transparent;z-index:2}::ng-deep .plate-antd-input-container{width:100%;display:flex;flex-wrap:nowrap}::ng-deep .plate-antd-input-container .plate-input-prefix{width:60px;text-align:center;min-height:32px;border:1px solid #d9d9d9;border-radius:4px;display:flex;align-items:center;justify-content:center;position:relative;cursor:pointer;background-color:#fff}::ng-deep .plate-antd-input-container .plate-input-prefix .plate-input-icon-down{position:absolute;top:50%;right:5px;transform:translateY(-50%);font-size:10px}::ng-deep .plate-antd-input-container .plate-input-prefix:hover:not(.plate-input-prefix-disabled){border-color:#096dd9}::ng-deep .plate-antd-input-container .plate-input-prefix-disabled{background-color:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed;color:#7c7c7c}::ng-deep .plate-antd-input-container .plate-input-suffix{width:calc(100% - 60px)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i3$1.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "directive", type: i4.NzPopoverDirective, selector: "[nz-popover]", inputs: ["nzPopoverArrowPointAtCenter", "nzPopoverTitle", "nzPopoverContent", "nz-popover", "nzPopoverTrigger", "nzPopoverPlacement", "nzPopoverOrigin", "nzPopoverVisible", "nzPopoverMouseEnterDelay", "nzPopoverMouseLeaveDelay", "nzPopoverOverlayClassName", "nzPopoverOverlayStyle", "nzPopoverBackdrop"], outputs: ["nzPopoverVisibleChange"], exportAs: ["nzPopover"] }, { kind: "directive", type: i5.NzIconDirective, selector: "[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: TrimInputDirective, selector: "input[nz-input]" }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }] });
|
|
421
421
|
}
|
|
422
422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PlateInputComponent, decorators: [{
|
|
423
423
|
type: Component,
|
|
@@ -427,7 +427,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
427
427
|
useExisting: forwardRef(() => PlateInputComponent),
|
|
428
428
|
multi: true,
|
|
429
429
|
},
|
|
430
|
-
], template: "<div\r\n class=\"plate-antd-input-container\"\r\n [class.plate-antd-input-disabled]=\"disabled\"\r\n>\r\n <div\r\n class=\"plate-input-prefix\"\r\n [class.plate-input-prefix-disabled]=\"disabled\"\r\n nz-popover\r\n nzPopoverPlacement=\"bottom\"\r\n nzPopoverOverlayClassName=\"plate-input-popover\"\r\n [(nzPopoverVisible)]=\"nzPopoverVisible\"\r\n [nzPopoverTrigger]=\"'manual'\"\r\n [nzPopoverContent]=\"contentTemplate\"\r\n (click)=\"handlePrefixClick($event)\"\r\n >\r\n {{ platePrefix | uppercase }}\r\n <i\r\n class=\"plate-input-icon-down\"\r\n [nzRotate]=\"nzPopoverVisible ? 180 : 0\"\r\n nz-icon\r\n nzType=\"down\"\r\n nzTheme=\"outline\"\r\n ></i>\r\n </div>\r\n <ng-template #contentTemplate>\r\n <div nz-row style=\"height: 100%\">\r\n <div\r\n nz-col\r\n nzSpan=\"4\"\r\n *ngFor=\"let item of platePrefixOptions\"\r\n class=\"plate-input-popover-item\"\r\n (click)=\"!disabled && handlePlatePrefix(item.value)\"\r\n [ngClass]=\"{\r\n 'plate-input-popover-item-active': item.value === platePrefix,\r\n 'plate-input-popover-item-default': item.value !== platePrefix\r\n }\"\r\n >\r\n <div class=\"plate-input-popover-item-label\">\r\n {{ item.label }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <input\r\n class=\"plate-input-suffix\"\r\n type=\"text\"\r\n nz-input\r\n allow-trim\r\n style=\"width: 75%\"\r\n [value]=\"plateSuffix | uppercase\"\r\n [disabled]=\"disabled\"\r\n (blur)=\"!disabled && handleAntdPlateSuffixBlur($event)\"\r\n placeholder=\"\u8BF7\u8F93\u5165\"\r\n maxlength=\"
|
|
430
|
+
], template: "<div\r\n class=\"plate-antd-input-container\"\r\n [class.plate-antd-input-disabled]=\"disabled\"\r\n>\r\n <div\r\n class=\"plate-input-prefix\"\r\n [class.plate-input-prefix-disabled]=\"disabled\"\r\n nz-popover\r\n nzPopoverPlacement=\"bottom\"\r\n nzPopoverOverlayClassName=\"plate-input-popover\"\r\n [(nzPopoverVisible)]=\"nzPopoverVisible\"\r\n [nzPopoverTrigger]=\"'manual'\"\r\n [nzPopoverContent]=\"contentTemplate\"\r\n (click)=\"handlePrefixClick($event)\"\r\n >\r\n {{ platePrefix | uppercase }}\r\n <i\r\n class=\"plate-input-icon-down\"\r\n [nzRotate]=\"nzPopoverVisible ? 180 : 0\"\r\n nz-icon\r\n nzType=\"down\"\r\n nzTheme=\"outline\"\r\n ></i>\r\n </div>\r\n <ng-template #contentTemplate>\r\n <div nz-row style=\"height: 100%\">\r\n <div\r\n nz-col\r\n nzSpan=\"4\"\r\n *ngFor=\"let item of platePrefixOptions\"\r\n class=\"plate-input-popover-item\"\r\n (click)=\"!disabled && handlePlatePrefix(item.value)\"\r\n [ngClass]=\"{\r\n 'plate-input-popover-item-active': item.value === platePrefix,\r\n 'plate-input-popover-item-default': item.value !== platePrefix\r\n }\"\r\n >\r\n <div class=\"plate-input-popover-item-label\">\r\n {{ item.label }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <input\r\n class=\"plate-input-suffix\"\r\n type=\"text\"\r\n nz-input\r\n allow-trim\r\n style=\"width: 75%\"\r\n [value]=\"plateSuffix | uppercase\"\r\n [disabled]=\"disabled\"\r\n (blur)=\"!disabled && handleAntdPlateSuffixBlur($event)\"\r\n placeholder=\"\u8BF7\u8F93\u5165\"\r\n maxlength=\"8\"\r\n />\r\n</div>\r\n", styles: ["::ng-deep .plate-input-popover{box-sizing:border-box;padding:5px 0}::ng-deep .plate-input-popover .ant-popover-inner-content{width:387px;height:264px;padding:0}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item{height:42px;box-sizing:border-box;padding:6px 12px;cursor:pointer}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item .plate-input-popover-item-label{width:100%;height:100%;display:flex;justify-content:center;align-items:center;border:1px solid #ccc}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-default:hover{background-color:#eaeaea}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-active{background-color:#096dd9;color:#fff}::ng-deep .plate-input-prefix:hover:after{content:\"\";position:absolute;top:0;right:0;width:1px;height:100%;background-color:transparent;z-index:2}::ng-deep .plate-antd-input-container{width:100%;display:flex;flex-wrap:nowrap}::ng-deep .plate-antd-input-container .plate-input-prefix{width:60px;text-align:center;min-height:32px;border:1px solid #d9d9d9;border-radius:4px;display:flex;align-items:center;justify-content:center;position:relative;cursor:pointer;background-color:#fff}::ng-deep .plate-antd-input-container .plate-input-prefix .plate-input-icon-down{position:absolute;top:50%;right:5px;transform:translateY(-50%);font-size:10px}::ng-deep .plate-antd-input-container .plate-input-prefix:hover:not(.plate-input-prefix-disabled){border-color:#096dd9}::ng-deep .plate-antd-input-container .plate-input-prefix-disabled{background-color:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed;color:#7c7c7c}::ng-deep .plate-antd-input-container .plate-input-suffix{width:calc(100% - 60px)}\n"] }]
|
|
431
431
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{
|
|
432
432
|
type: Optional
|
|
433
433
|
}, {
|
|
@@ -1345,6 +1345,18 @@ class ProTableComponent {
|
|
|
1345
1345
|
setFieldsValue(fields) {
|
|
1346
1346
|
Object.keys(fields).forEach((k) => {
|
|
1347
1347
|
this._searchParams[k] = fields[k]; // 保留 Proxy,逐项赋值触发拦截
|
|
1348
|
+
// checkbox 类型需要同步更新 options 的 checked 状态,否则 UI 不会响应
|
|
1349
|
+
const targetColumn = this._searchFiledColumns.find((item) => (item.fieldProps?.name || item.prop) === k);
|
|
1350
|
+
if (targetColumn?.valueType === "checkbox") {
|
|
1351
|
+
const values = Array.isArray(fields[k]) ? fields[k] : [];
|
|
1352
|
+
const targetFieldProps = targetColumn.fieldProps;
|
|
1353
|
+
if (targetFieldProps?.options) {
|
|
1354
|
+
targetFieldProps.options = targetFieldProps.options.map((item) => ({
|
|
1355
|
+
...item,
|
|
1356
|
+
checked: values.includes(item.value),
|
|
1357
|
+
}));
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1348
1360
|
});
|
|
1349
1361
|
}
|
|
1350
1362
|
setFieldValue(key, value) {
|