@yibozhang/pro-table 0.0.18 → 0.0.19

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.
Files changed (40) hide show
  1. package/bundles/yibozhang-pro-table.umd.js +79 -0
  2. package/bundles/yibozhang-pro-table.umd.js.map +1 -1
  3. package/bundles/yibozhang-pro-table.umd.min.js +1 -1
  4. package/bundles/yibozhang-pro-table.umd.min.js.map +1 -1
  5. package/esm2015/lib/directives/trim-input.directive.js +66 -0
  6. package/esm2015/lib/directives/trim-input.module.js +11 -0
  7. package/esm2015/public-api.js +2 -1
  8. package/esm2015/yibozhang-pro-table.js +2 -1
  9. package/fesm2015/yibozhang-pro-table.js +76 -3
  10. package/fesm2015/yibozhang-pro-table.js.map +1 -1
  11. package/lib/components/colmuns-setting/colmuns-setting.component.less.shim.ngstyle.d.ts.map +1 -0
  12. package/lib/components/colmuns-setting/colmuns-setting.component.ngfactory.d.ts.map +1 -0
  13. package/lib/components/dynamic-search-field/dynamic-search-field.component.ngfactory.d.ts.map +1 -0
  14. package/lib/directives/trim-input.directive.d.ts +11 -0
  15. package/lib/directives/trim-input.directive.d.ts.map +1 -0
  16. package/lib/directives/trim-input.directive.ngfactory.d.ts.map +1 -0
  17. package/lib/directives/trim-input.module.d.ts +3 -0
  18. package/lib/directives/trim-input.module.d.ts.map +1 -0
  19. package/lib/directives/trim-input.module.ngfactory.d.ts.map +1 -0
  20. package/lib/page-container/page-container.component.less.shim.ngstyle.d.ts.map +1 -0
  21. package/lib/page-container/page-container.component.ngfactory.d.ts.map +1 -0
  22. package/lib/page-container/page-container.module.ngfactory.d.ts.map +1 -0
  23. package/lib/page-public/antd-form.ngfactory.d.ts.map +1 -0
  24. package/lib/page-public/array-form.ngfactory.d.ts.map +1 -0
  25. package/lib/plate-input/plate-input.component.less.shim.ngstyle.d.ts.map +1 -0
  26. package/lib/plate-input/plate-input.component.ngfactory.d.ts.map +1 -0
  27. package/lib/plate-input/plate-input.module.ngfactory.d.ts.map +1 -0
  28. package/lib/plate-input/plate-prefix-load.service.ngfactory.d.ts.map +1 -0
  29. package/lib/pro-table.component.css.shim.ngstyle.d.ts.map +1 -0
  30. package/lib/pro-table.component.ngfactory.d.ts.map +1 -0
  31. package/lib/pro-table.module.ngfactory.d.ts.map +1 -0
  32. package/lib/table-search-bar/table-search-bar-module.ngfactory.d.ts.map +1 -0
  33. package/lib/table-search-bar/table-search-bar.component.less.shim.ngstyle.d.ts.map +1 -0
  34. package/lib/table-search-bar/table-search-bar.component.ngfactory.d.ts.map +1 -0
  35. package/package.json +1 -1
  36. package/public-api.d.ts +1 -0
  37. package/public-api.d.ts.map +1 -1
  38. package/yibozhang-pro-table.d.ts +1 -0
  39. package/yibozhang-pro-table.d.ts.map +1 -1
  40. package/yibozhang-pro-table.metadata.json +1 -1
@@ -2453,6 +2453,83 @@
2453
2453
  { type: http.HttpClient }
2454
2454
  ]; };
2455
2455
 
2456
+ var TrimInputDirective = /** @class */ (function () {
2457
+ function TrimInputDirective(el, ngControl) {
2458
+ this.el = el;
2459
+ this.ngControl = ngControl;
2460
+ }
2461
+ TrimInputDirective.prototype.shouldProcess = function () {
2462
+ if (this.el.nativeElement.hasAttribute("allow-trim")) {
2463
+ return false;
2464
+ }
2465
+ if (this.el.nativeElement.hasAttribute("not-allow-trim")) {
2466
+ return true;
2467
+ }
2468
+ var element = this.el.nativeElement;
2469
+ while (element) {
2470
+ var className = element.className;
2471
+ if (typeof className === "string" &&
2472
+ className.includes("ant-form-custom")) {
2473
+ return true;
2474
+ }
2475
+ element = element.parentElement;
2476
+ }
2477
+ return false;
2478
+ };
2479
+ TrimInputDirective.prototype.onBlur = function () {
2480
+ if (!this.shouldProcess()) {
2481
+ return;
2482
+ }
2483
+ var value = this.el.nativeElement.value;
2484
+ if (typeof value === "string") {
2485
+ var trimmedValue = value.trim();
2486
+ this.el.nativeElement.value = trimmedValue;
2487
+ if (this.ngControl && this.ngControl.control) {
2488
+ this.ngControl.control.setValue(trimmedValue, { emitEvent: false });
2489
+ }
2490
+ }
2491
+ };
2492
+ TrimInputDirective.prototype.onInput = function () {
2493
+ if (!this.shouldProcess()) {
2494
+ return;
2495
+ }
2496
+ var value = this.el.nativeElement.value;
2497
+ if (typeof value === "string" && /\s/.test(value)) {
2498
+ var noSpaceValue = value.replace(/\s/g, "");
2499
+ this.el.nativeElement.value = noSpaceValue;
2500
+ if (this.ngControl && this.ngControl.control) {
2501
+ this.ngControl.control.setValue(noSpaceValue, { emitEvent: false });
2502
+ }
2503
+ }
2504
+ };
2505
+ return TrimInputDirective;
2506
+ }());
2507
+ TrimInputDirective.decorators = [
2508
+ { type: i0.Directive, args: [{
2509
+ selector: "input[nz-input],textarea[nz-input]",
2510
+ },] }
2511
+ ];
2512
+ TrimInputDirective.ctorParameters = function () { return [
2513
+ { type: i0.ElementRef },
2514
+ { type: i1.NgControl, decorators: [{ type: i0.Optional }] }
2515
+ ]; };
2516
+ TrimInputDirective.propDecorators = {
2517
+ onBlur: [{ type: i0.HostListener, args: ["blur",] }],
2518
+ onInput: [{ type: i0.HostListener, args: ["input",] }]
2519
+ };
2520
+
2521
+ var TrimInputModule = /** @class */ (function () {
2522
+ function TrimInputModule() {
2523
+ }
2524
+ return TrimInputModule;
2525
+ }());
2526
+ TrimInputModule.decorators = [
2527
+ { type: i0.NgModule, args: [{
2528
+ declarations: [TrimInputDirective],
2529
+ exports: [TrimInputDirective],
2530
+ },] }
2531
+ ];
2532
+
2456
2533
  // ==================== 服务类 ====================
2457
2534
  var AntdFormService = /** @class */ (function () {
2458
2535
  // ==================== 构造函数 ====================
@@ -3462,6 +3539,7 @@
3462
3539
  exports.ProTableComponent = ProTableComponent;
3463
3540
  exports.ProTableModule = ProTableModule;
3464
3541
  exports.TableSearchBarModule = TableSearchBarModule;
3542
+ exports.TrimInputModule = TrimInputModule;
3465
3543
  exports["ɵ0"] = ɵ0;
3466
3544
  exports["ɵ1"] = ɵ1;
3467
3545
  exports["ɵ2"] = ɵ2;
@@ -3470,6 +3548,7 @@
3470
3548
  exports["ɵc"] = PlateInputComponent;
3471
3549
  exports["ɵd"] = ColmunsSettingComponent;
3472
3550
  exports["ɵe"] = DynamicSearchFieldComponent;
3551
+ exports["ɵf"] = TrimInputDirective;
3473
3552
 
3474
3553
  Object.defineProperty(exports, '__esModule', { value: true });
3475
3554