@yibozhang/pro-table 0.0.19 → 0.1.0

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.
@@ -2032,6 +2032,83 @@
2032
2032
  { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [PLATE_PREFIX_LOAD_SERVICE,] }] }
2033
2033
  ]; };
2034
2034
 
2035
+ var TrimInputDirective = /** @class */ (function () {
2036
+ function TrimInputDirective(el, ngControl) {
2037
+ this.el = el;
2038
+ this.ngControl = ngControl;
2039
+ }
2040
+ TrimInputDirective.prototype.shouldProcess = function () {
2041
+ if (this.el.nativeElement.hasAttribute("allow-trim")) {
2042
+ return false;
2043
+ }
2044
+ if (this.el.nativeElement.hasAttribute("not-allow-trim")) {
2045
+ return true;
2046
+ }
2047
+ var element = this.el.nativeElement;
2048
+ while (element) {
2049
+ var className = element.className;
2050
+ if (typeof className === "string" &&
2051
+ className.includes("ant-form-custom")) {
2052
+ return true;
2053
+ }
2054
+ element = element.parentElement;
2055
+ }
2056
+ return false;
2057
+ };
2058
+ TrimInputDirective.prototype.onBlur = function () {
2059
+ if (!this.shouldProcess()) {
2060
+ return;
2061
+ }
2062
+ var value = this.el.nativeElement.value;
2063
+ if (typeof value === "string") {
2064
+ var trimmedValue = value.trim();
2065
+ this.el.nativeElement.value = trimmedValue;
2066
+ if (this.ngControl && this.ngControl.control) {
2067
+ this.ngControl.control.setValue(trimmedValue, { emitEvent: false });
2068
+ }
2069
+ }
2070
+ };
2071
+ TrimInputDirective.prototype.onInput = function () {
2072
+ if (!this.shouldProcess()) {
2073
+ return;
2074
+ }
2075
+ var value = this.el.nativeElement.value;
2076
+ if (typeof value === "string" && /\s/.test(value)) {
2077
+ var noSpaceValue = value.replace(/\s/g, "");
2078
+ this.el.nativeElement.value = noSpaceValue;
2079
+ if (this.ngControl && this.ngControl.control) {
2080
+ this.ngControl.control.setValue(noSpaceValue, { emitEvent: false });
2081
+ }
2082
+ }
2083
+ };
2084
+ return TrimInputDirective;
2085
+ }());
2086
+ TrimInputDirective.decorators = [
2087
+ { type: i0.Directive, args: [{
2088
+ selector: "input[nz-input]",
2089
+ },] }
2090
+ ];
2091
+ TrimInputDirective.ctorParameters = function () { return [
2092
+ { type: i0.ElementRef },
2093
+ { type: i1.NgControl, decorators: [{ type: i0.Optional }] }
2094
+ ]; };
2095
+ TrimInputDirective.propDecorators = {
2096
+ onBlur: [{ type: i0.HostListener, args: ["blur",] }],
2097
+ onInput: [{ type: i0.HostListener, args: ["input",] }]
2098
+ };
2099
+
2100
+ var TrimInputModule = /** @class */ (function () {
2101
+ function TrimInputModule() {
2102
+ }
2103
+ return TrimInputModule;
2104
+ }());
2105
+ TrimInputModule.decorators = [
2106
+ { type: i0.NgModule, args: [{
2107
+ declarations: [TrimInputDirective],
2108
+ exports: [TrimInputDirective],
2109
+ },] }
2110
+ ];
2111
+
2035
2112
  var PlateInputModule = /** @class */ (function () {
2036
2113
  function PlateInputModule() {
2037
2114
  }
@@ -2046,6 +2123,7 @@
2046
2123
  input.NzInputModule,
2047
2124
  popover.NzPopoverModule,
2048
2125
  icon.NzIconModule,
2126
+ TrimInputModule,
2049
2127
  ],
2050
2128
  declarations: [PlateInputComponent],
2051
2129
  providers: [],
@@ -2453,83 +2531,6 @@
2453
2531
  { type: http.HttpClient }
2454
2532
  ]; };
2455
2533
 
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
-
2533
2534
  // ==================== 服务类 ====================
2534
2535
  var AntdFormService = /** @class */ (function () {
2535
2536
  // ==================== 构造函数 ====================
@@ -3545,10 +3546,10 @@
3545
3546
  exports["ɵ2"] = ɵ2;
3546
3547
  exports["ɵa"] = PageContainerComponent;
3547
3548
  exports["ɵb"] = TableSearchBarComponent;
3548
- exports["ɵc"] = PlateInputComponent;
3549
- exports["ɵd"] = ColmunsSettingComponent;
3550
- exports["ɵe"] = DynamicSearchFieldComponent;
3551
- exports["ɵf"] = TrimInputDirective;
3549
+ exports["ɵc"] = TrimInputDirective;
3550
+ exports["ɵd"] = PlateInputComponent;
3551
+ exports["ɵe"] = ColmunsSettingComponent;
3552
+ exports["ɵf"] = DynamicSearchFieldComponent;
3552
3553
 
3553
3554
  Object.defineProperty(exports, '__esModule', { value: true });
3554
3555