@signalplus/params-about 0.1.34 → 0.1.37

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/index.d.ts CHANGED
@@ -10,7 +10,8 @@ declare enum ParamType {
10
10
  PercentageRange = 5,
11
11
  ExpiryLimit = 6,
12
12
  Expiry = 7,
13
- Phone = 8
13
+ Phone = 8,
14
+ Text = 9
14
15
  }
15
16
  interface BaseInputProps {
16
17
  value?: any;
@@ -42,6 +43,7 @@ declare class ParamRenderer extends PureComponent<ParamRendererProps> {
42
43
  defaultValue?: any;
43
44
  Comp: React.ComponentType<BaseInputProps>;
44
45
  validator?(value: any): string;
46
+ required?: boolean | undefined;
45
47
  };
46
48
  get value(): any;
47
49
  onChange: (val: any) => void;
@@ -287,6 +289,7 @@ declare const ParamTypeConfig: Record<ParamType, {
287
289
  defaultValue?: any;
288
290
  Comp: React.ComponentType<BaseInputProps>;
289
291
  validator?(value: any): string;
292
+ required?: boolean;
290
293
  }>;
291
294
  declare function paramValidator(val: any, values: {
292
295
  valueType: ParamType;
@@ -299,6 +302,7 @@ declare const ParamTypeOptions: {
299
302
  defaultValue?: any;
300
303
  Comp: React.ComponentType<BaseInputProps>;
301
304
  validator?(value: any): string;
305
+ required?: boolean | undefined;
302
306
  }[];
303
307
 
304
308
  declare function formatNum(val: string): number | undefined;
package/lib/css/Bool.scss CHANGED
@@ -1,4 +1,4 @@
1
- @import "./var";
1
+ @import './var';
2
2
 
3
3
  .param-bool {
4
4
  flex: 1;
@@ -21,3 +21,7 @@
21
21
  margin: 0 5px 0 0;
22
22
  }
23
23
  }
24
+
25
+ .active {
26
+ color: #006fa7;
27
+ }
@@ -19,6 +19,10 @@
19
19
  white-space: initial;
20
20
  cursor: default;
21
21
  background: transparent;
22
+
23
+ &.multiple {
24
+ white-space: pre-wrap;
25
+ }
22
26
  }
23
27
 
24
28
  &.multiple {
@@ -0,0 +1,18 @@
1
+ @import "./var";
2
+
3
+ .param-text {
4
+ flex: 1;
5
+ display: flex;
6
+ align-items: center;
7
+ height: $input-height;
8
+
9
+ &.readonly {
10
+ height: $input-readonly-height;
11
+ }
12
+ }
13
+
14
+ .param-text-val {
15
+ position: relative;
16
+ z-index: 1;
17
+ margin: 0;
18
+ }
@@ -1,4 +1,4 @@
1
- @import "./var";
1
+ @import './var';
2
2
 
3
3
  .param-text-array {
4
4
  padding: calc((#{$input-height} - 30px) / 2) 0;
@@ -32,7 +32,8 @@
32
32
  height: 100%;
33
33
  padding: 0 10px;
34
34
 
35
- .param-arr-ops-add, .param-arr-ops-del {
35
+ .param-arr-ops-add,
36
+ .param-arr-ops-del {
36
37
  display: flex;
37
38
  align-items: center;
38
39
  justify-content: center;
@@ -47,6 +48,6 @@
47
48
  }
48
49
 
49
50
  .param-arr-ops-del {
50
- color: $red;
51
+ color: $primary;
51
52
  }
52
53
  }
package/lib/css/index.css CHANGED
@@ -1 +1 @@
1
- .param-parent-selector.readonly .ant-select-selector{padding:0 !important;border-color:transparent !important;background:transparent !important;cursor:initial !important}.param-parent-selector.readonly .ant-select-selection-item{color:#333 !important}.param-parent-selector.readonly .ant-select-arrow{display:none !important}.param-form.param-value-editor .ant-form-item-label,.param-value-editor.param-value-editor .ant-form-item-label,.param-group-editor.param-value-editor .ant-form-item-label,.param-mover.param-value-editor .ant-form-item-label{width:100px}.param-form .ant-form-item-label,.param-value-editor .ant-form-item-label,.param-group-editor .ant-form-item-label,.param-mover .ant-form-item-label{width:80px;padding:0 15px 0 0}.param-form .ant-form-item-label>label,.param-value-editor .ant-form-item-label>label,.param-group-editor .ant-form-item-label>label,.param-mover .ant-form-item-label>label{height:40px}.param-form .ant-form-item-label>label:after,.param-value-editor .ant-form-item-label>label:after,.param-group-editor .ant-form-item-label>label:after,.param-mover .ant-form-item-label>label:after{content:none !important}.param-form input.ant-input.ant-input,.param-form .ant-select-selector.ant-select-selector,.param-form .ant-cascader.ant-cascader,.param-value-editor input.ant-input.ant-input,.param-value-editor .ant-select-selector.ant-select-selector,.param-value-editor .ant-cascader.ant-cascader,.param-group-editor input.ant-input.ant-input,.param-group-editor .ant-select-selector.ant-select-selector,.param-group-editor .ant-cascader.ant-cascader,.param-mover input.ant-input.ant-input,.param-mover .ant-select-selector.ant-select-selector,.param-mover .ant-cascader.ant-cascader{height:40px !important}.param-form input.ant-input.ant-input input,.param-form input.ant-input.ant-input .ant-select-selection-placeholder,.param-form input.ant-input.ant-input .ant-select-selection-item,.param-form .ant-select-selector.ant-select-selector input,.param-form .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-form .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-form .ant-cascader.ant-cascader input,.param-form .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-form .ant-cascader.ant-cascader .ant-select-selection-item,.param-value-editor input.ant-input.ant-input input,.param-value-editor input.ant-input.ant-input .ant-select-selection-placeholder,.param-value-editor input.ant-input.ant-input .ant-select-selection-item,.param-value-editor .ant-select-selector.ant-select-selector input,.param-value-editor .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-value-editor .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-value-editor .ant-cascader.ant-cascader input,.param-value-editor .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-value-editor .ant-cascader.ant-cascader .ant-select-selection-item,.param-group-editor input.ant-input.ant-input input,.param-group-editor input.ant-input.ant-input .ant-select-selection-placeholder,.param-group-editor input.ant-input.ant-input .ant-select-selection-item,.param-group-editor .ant-select-selector.ant-select-selector input,.param-group-editor .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-group-editor .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-group-editor .ant-cascader.ant-cascader input,.param-group-editor .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-group-editor .ant-cascader.ant-cascader .ant-select-selection-item,.param-mover input.ant-input.ant-input input,.param-mover input.ant-input.ant-input .ant-select-selection-placeholder,.param-mover input.ant-input.ant-input .ant-select-selection-item,.param-mover .ant-select-selector.ant-select-selector input,.param-mover .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-mover .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-mover .ant-cascader.ant-cascader input,.param-mover .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-mover .ant-cascader.ant-cascader .ant-select-selection-item{height:calc(40px - 2px) !important;line-height:calc(40px - 2px) !important}.param-form textarea.ant-input.ant-input,.param-value-editor textarea.ant-input.ant-input,.param-group-editor textarea.ant-input.ant-input,.param-mover textarea.ant-input.ant-input{height:100px;min-height:40px;padding:9px 10px}.param-form .ant-form-item.ant-form-item:not(.ant-form-item-with-help),.param-value-editor .ant-form-item.ant-form-item:not(.ant-form-item-with-help),.param-group-editor .ant-form-item.ant-form-item:not(.ant-form-item-with-help),.param-mover .ant-form-item.ant-form-item:not(.ant-form-item-with-help){margin:0 0 12px}.param-form .ant-form-item-explain.ant-form-item-explain,.param-value-editor .ant-form-item-explain.ant-form-item-explain,.param-group-editor .ant-form-item-explain.ant-form-item-explain,.param-mover .ant-form-item-explain.ant-form-item-explain{height:auto;min-height:auto;margin:0 0 12px;font-size:12px;line-height:14px}.param-form .react-file-name,.param-value-editor .react-file-name,.param-group-editor .react-file-name,.param-mover .react-file-name{display:none !important}.param-form .ant-row,.param-value-editor .ant-row,.param-group-editor .ant-row,.param-mover .ant-row{display:flex}.param-form .param-value-before,.param-value-editor .param-value-before,.param-group-editor .param-value-before,.param-mover .param-value-before{padding:calc((40px - 30px) / 2) 0}.param-form .param-value-before .ant-form-item-label>label,.param-value-editor .param-value-before .ant-form-item-label>label,.param-group-editor .param-value-before .ant-form-item-label>label,.param-mover .param-value-before .ant-form-item-label>label{height:30px}.param-image-upload.param-image-upload .react-file-input{border-color:#d9d9d9}.param-bool{flex:1;display:flex;align-items:center;height:40px}.param-bool.readonly{height:30px}.param-bool-option{display:inline-flex;align-items:center;margin:0 16px 0 0;cursor:pointer}.param-bool-option>svg{margin:0 5px 0 0}.param-expiries{position:relative;flex:1;max-width:100%;min-width:calc(7em + 24px + 2px);padding:calc((40px - 22px) / 2) calc(1em + 14px) calc((40px - 22px) / 2) 10px;line-height:0;border:1px solid #d9d9d9;border-radius:2px;cursor:pointer;background:#fff}.param-expiries.readonly{padding:calc((30px - 20px) / 2) 0;border-color:transparent;overflow:initial;white-space:initial;cursor:default;background:transparent}.param-expiries.multiple{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.param-expiries-arrow{position:absolute;top:50%;right:7px;margin:-0.5em 0 0;color:#d9d9d9 !important}.param-expiries-val{display:inline-block;margin:0 6px 0 0;line-height:20px;white-space:initial}.param-expiries-placeholder{display:inline-block;margin:0 6px 0 0;line-height:20px;color:rgba(0,0,0,0.25);max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.param-expiries-multi-val{display:inline-block;margin:0 6px 0 0;padding:0 3px 0 8px;line-height:20px;border-radius:2px;background:rgba(0,0,0,0.1)}.param-expiries-multi-val svg{display:inline-block;margin:0 0 0 4px;color:#999;cursor:pointer}.param-expiries-popover .ant-popover-inner-content{max-height:50vh;overflow-y:auto}.param-expiries-option{display:flex;align-items:center;justify-content:space-between;width:240px;margin:0 -16px;padding:0 16px;line-height:30px;color:rgba(51,51,51,0.6);cursor:pointer}.param-expiries-option.param-expiries-option-checked{font-weight:bold;color:#333}.param-expiries-option.param-expiries-option-disabled{cursor:not-allowed;opacity:0.5}.param-expiries-option:hover{color:#333;background:rgba(0,0,0,0.1)}.param-expiries-option svg{color:#57be6a}.param-expiries-limit{padding:calc((40px - 20px) / 2) 0}.param-expiries-limit.readonly{padding:calc((30px - 20px) / 2) 0}.param-expiries-limit .param-number-range{margin:0 0 0 10px}.param-expiries-limit .param-number-range-prefix{display:none}.param-expiries-limit .param-number-suffix{padding:0 7px}.param-expiries-limit-val{display:block}.param-expiries-limit-val:after{content:';'}.param-expiries-limit-val-sep{padding:0 4px;color:#999}.param-expiries-limit-inputs{display:grid;grid-row-gap:10px;grid-column-gap:10px;grid-template-rows:auto;grid-template-columns:auto auto auto auto}.param-expiries-limit-inputs .param-expiries,.param-expiries-limit-inputs .param-number-range,.param-expiries-limit-inputs .param-arr-ops{height:30px;padding-top:0;padding-right:0;margin:0}.param-expiries-limit-inputs .param-expiries.readonly,.param-expiries-limit-inputs .param-number-range.readonly,.param-expiries-limit-inputs .param-arr-ops.readonly{height:20px;line-height:18px}.param-expiries-limit-inputs .param-expiries.readonly .param-expiries-val,.param-expiries-limit-inputs .param-number-range.readonly .param-expiries-val,.param-expiries-limit-inputs .param-arr-ops.readonly .param-expiries-val{margin-top:0}.param-expiries-limit-inputs .param-expiries .param-expiries-placeholder,.param-expiries-limit-inputs .param-expiries .param-expiries-val,.param-expiries-limit-inputs .param-number-range .param-expiries-placeholder,.param-expiries-limit-inputs .param-number-range .param-expiries-val,.param-expiries-limit-inputs .param-arr-ops .param-expiries-placeholder,.param-expiries-limit-inputs .param-arr-ops .param-expiries-val{margin-top:4px}.param-expiries-limit-inputs .param-expiries .param-number-range-sep,.param-expiries-limit-inputs .param-number-range .param-number-range-sep,.param-expiries-limit-inputs .param-arr-ops .param-number-range-sep{margin:0 6px}.param-expiries-limit-inputs .param-arr-ops{padding:0}.param-expiries-popover{padding:0 !important}.param-expiries-popover .ant-popover-arrow{display:none}.param-number{flex:1;display:flex;align-items:center;height:40px}.param-number.readonly{height:30px}.param-number.readonly .param-number-suffix{padding:0;margin:0 0 0 1px;border:none;background:none}.param-number-val{position:relative;z-index:1;margin:0}.param-number-suffix{display:flex;align-items:center;justify-content:center;position:relative;z-index:0;flex:none;height:100%;padding:0 14px;margin:0 0 0 -2px;border-radius:2px;border:1px solid #d9d9d9;background:#f2f2f2}.param-number-range{flex:1;display:flex;align-items:center;height:40px}.param-number-range .param-number{height:100%}.param-number-range.readonly{height:30px}.param-number-range.readonly .param-number{flex:none}.param-number-range .param-number-range-prefix{margin:0 8px 0 0}.param-number-range .param-number-range-sep{margin:0 10px}.param-text-array{padding:calc((40px - 30px) / 2) 0}.param-arr-item{display:flex;align-items:center;height:30px;margin:0 0 4px}.param-arr-item>input{flex:none;width:160px}.param-arr-ops{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;height:100%;padding:0 10px}.param-arr-ops .param-arr-ops-add,.param-arr-ops .param-arr-ops-del{display:flex;align-items:center;justify-content:center;width:30px;height:100%;border-radius:4px;color:#006FA7}.param-arr-ops .param-arr-ops-add:hover,.param-arr-ops .param-arr-ops-del:hover{background:rgba(0,0,0,0.1)}.param-arr-ops .param-arr-ops-del{color:#d51414}.param-renderer{box-sizing:border-box;margin:0;line-height:20px;color:#333}.param-renderer.readonly input,.param-renderer.readonly select,.param-renderer.readonly .select{padding:0;border:none;box-shadow:none}.param-renderer *{box-sizing:border-box}.param-renderer input,.param-renderer select,.param-renderer .select{flex:1;width:50px;height:100%;padding:0 10px;border:1px solid #d9d9d9;border-radius:2px;outline:none;box-shadow:none;background:#fff}.param-renderer input::placeholder,.param-renderer select::placeholder,.param-renderer .select::placeholder{color:rgba(0,0,0,0.25)}.param-renderer input:hover,.param-renderer select:hover,.param-renderer .select:hover{border-color:#006FA7}.param-renderer input:focus,.param-renderer select:focus,.param-renderer .select:focus{border-color:#006FA7;box-shadow:0 0 0 2px rgba(0,111,167,0.1)}
1
+ .param-parent-selector.readonly .ant-select-selector{padding:0 !important;border-color:transparent !important;background:transparent !important;cursor:initial !important}.param-parent-selector.readonly .ant-select-selection-item{color:#333 !important}.param-parent-selector.readonly .ant-select-arrow{display:none !important}.param-form.param-value-editor .ant-form-item-label,.param-value-editor.param-value-editor .ant-form-item-label,.param-group-editor.param-value-editor .ant-form-item-label,.param-mover.param-value-editor .ant-form-item-label{width:100px}.param-form .ant-form-item-label,.param-value-editor .ant-form-item-label,.param-group-editor .ant-form-item-label,.param-mover .ant-form-item-label{width:80px;padding:0 15px 0 0}.param-form .ant-form-item-label>label,.param-value-editor .ant-form-item-label>label,.param-group-editor .ant-form-item-label>label,.param-mover .ant-form-item-label>label{height:40px}.param-form .ant-form-item-label>label:after,.param-value-editor .ant-form-item-label>label:after,.param-group-editor .ant-form-item-label>label:after,.param-mover .ant-form-item-label>label:after{content:none !important}.param-form input.ant-input.ant-input,.param-form .ant-select-selector.ant-select-selector,.param-form .ant-cascader.ant-cascader,.param-value-editor input.ant-input.ant-input,.param-value-editor .ant-select-selector.ant-select-selector,.param-value-editor .ant-cascader.ant-cascader,.param-group-editor input.ant-input.ant-input,.param-group-editor .ant-select-selector.ant-select-selector,.param-group-editor .ant-cascader.ant-cascader,.param-mover input.ant-input.ant-input,.param-mover .ant-select-selector.ant-select-selector,.param-mover .ant-cascader.ant-cascader{height:40px !important}.param-form input.ant-input.ant-input input,.param-form input.ant-input.ant-input .ant-select-selection-placeholder,.param-form input.ant-input.ant-input .ant-select-selection-item,.param-form .ant-select-selector.ant-select-selector input,.param-form .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-form .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-form .ant-cascader.ant-cascader input,.param-form .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-form .ant-cascader.ant-cascader .ant-select-selection-item,.param-value-editor input.ant-input.ant-input input,.param-value-editor input.ant-input.ant-input .ant-select-selection-placeholder,.param-value-editor input.ant-input.ant-input .ant-select-selection-item,.param-value-editor .ant-select-selector.ant-select-selector input,.param-value-editor .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-value-editor .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-value-editor .ant-cascader.ant-cascader input,.param-value-editor .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-value-editor .ant-cascader.ant-cascader .ant-select-selection-item,.param-group-editor input.ant-input.ant-input input,.param-group-editor input.ant-input.ant-input .ant-select-selection-placeholder,.param-group-editor input.ant-input.ant-input .ant-select-selection-item,.param-group-editor .ant-select-selector.ant-select-selector input,.param-group-editor .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-group-editor .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-group-editor .ant-cascader.ant-cascader input,.param-group-editor .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-group-editor .ant-cascader.ant-cascader .ant-select-selection-item,.param-mover input.ant-input.ant-input input,.param-mover input.ant-input.ant-input .ant-select-selection-placeholder,.param-mover input.ant-input.ant-input .ant-select-selection-item,.param-mover .ant-select-selector.ant-select-selector input,.param-mover .ant-select-selector.ant-select-selector .ant-select-selection-placeholder,.param-mover .ant-select-selector.ant-select-selector .ant-select-selection-item,.param-mover .ant-cascader.ant-cascader input,.param-mover .ant-cascader.ant-cascader .ant-select-selection-placeholder,.param-mover .ant-cascader.ant-cascader .ant-select-selection-item{height:calc(40px - 2px) !important;line-height:calc(40px - 2px) !important}.param-form textarea.ant-input.ant-input,.param-value-editor textarea.ant-input.ant-input,.param-group-editor textarea.ant-input.ant-input,.param-mover textarea.ant-input.ant-input{height:100px;min-height:40px;padding:9px 10px}.param-form .ant-form-item.ant-form-item:not(.ant-form-item-with-help),.param-value-editor .ant-form-item.ant-form-item:not(.ant-form-item-with-help),.param-group-editor .ant-form-item.ant-form-item:not(.ant-form-item-with-help),.param-mover .ant-form-item.ant-form-item:not(.ant-form-item-with-help){margin:0 0 12px}.param-form .ant-form-item-explain.ant-form-item-explain,.param-value-editor .ant-form-item-explain.ant-form-item-explain,.param-group-editor .ant-form-item-explain.ant-form-item-explain,.param-mover .ant-form-item-explain.ant-form-item-explain{height:auto;min-height:auto;margin:0 0 12px;font-size:12px;line-height:14px}.param-form .react-file-name,.param-value-editor .react-file-name,.param-group-editor .react-file-name,.param-mover .react-file-name{display:none !important}.param-form .ant-row,.param-value-editor .ant-row,.param-group-editor .ant-row,.param-mover .ant-row{display:flex}.param-form .param-value-before,.param-value-editor .param-value-before,.param-group-editor .param-value-before,.param-mover .param-value-before{padding:calc((40px - 30px) / 2) 0}.param-form .param-value-before .ant-form-item-label>label,.param-value-editor .param-value-before .ant-form-item-label>label,.param-group-editor .param-value-before .ant-form-item-label>label,.param-mover .param-value-before .ant-form-item-label>label{height:30px}.param-image-upload.param-image-upload .react-file-input{border-color:#d9d9d9}.param-bool{flex:1;display:flex;align-items:center;height:40px}.param-bool.readonly{height:30px}.param-bool-option{display:inline-flex;align-items:center;margin:0 16px 0 0;cursor:pointer}.param-bool-option>svg{margin:0 5px 0 0}.active{color:#006fa7}.param-expiries{position:relative;flex:1;max-width:100%;min-width:calc(7em + 24px + 2px);padding:calc((40px - 22px) / 2) calc(1em + 14px) calc((40px - 22px) / 2) 10px;line-height:0;border:1px solid #d9d9d9;border-radius:2px;cursor:pointer;background:#fff}.param-expiries.readonly{padding:calc((30px - 20px) / 2) 0;border-color:transparent;overflow:initial;white-space:initial;cursor:default;background:transparent}.param-expiries.readonly.multiple{white-space:pre-wrap}.param-expiries.multiple{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.param-expiries-arrow{position:absolute;top:50%;right:7px;margin:-0.5em 0 0;color:#d9d9d9 !important}.param-expiries-val{display:inline-block;margin:0 6px 0 0;line-height:20px;white-space:initial}.param-expiries-placeholder{display:inline-block;margin:0 6px 0 0;line-height:20px;color:rgba(0,0,0,0.25);max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.param-expiries-multi-val{display:inline-block;margin:0 6px 0 0;padding:0 3px 0 8px;line-height:20px;border-radius:2px;background:rgba(0,0,0,0.1)}.param-expiries-multi-val svg{display:inline-block;margin:0 0 0 4px;color:#999;cursor:pointer}.param-expiries-popover .ant-popover-inner-content{max-height:50vh;overflow-y:auto}.param-expiries-option{display:flex;align-items:center;justify-content:space-between;width:240px;margin:0 -16px;padding:0 16px;line-height:30px;color:rgba(51,51,51,0.6);cursor:pointer}.param-expiries-option.param-expiries-option-checked{font-weight:bold;color:#333}.param-expiries-option.param-expiries-option-disabled{cursor:not-allowed;opacity:0.5}.param-expiries-option:hover{color:#333;background:rgba(0,0,0,0.1)}.param-expiries-option svg{color:#57be6a}.param-expiries-limit{padding:calc((40px - 20px) / 2) 0}.param-expiries-limit.readonly{padding:calc((30px - 20px) / 2) 0}.param-expiries-limit .param-number-range{margin:0 0 0 10px}.param-expiries-limit .param-number-range-prefix{display:none}.param-expiries-limit .param-number-suffix{padding:0 7px}.param-expiries-limit-val{display:block}.param-expiries-limit-val:after{content:';'}.param-expiries-limit-val-sep{padding:0 4px;color:#999}.param-expiries-limit-inputs{display:grid;grid-row-gap:10px;grid-column-gap:10px;grid-template-rows:auto;grid-template-columns:auto auto auto auto}.param-expiries-limit-inputs .param-expiries,.param-expiries-limit-inputs .param-number-range,.param-expiries-limit-inputs .param-arr-ops{height:30px;padding-top:0;padding-right:0;margin:0}.param-expiries-limit-inputs .param-expiries.readonly,.param-expiries-limit-inputs .param-number-range.readonly,.param-expiries-limit-inputs .param-arr-ops.readonly{height:20px;line-height:18px}.param-expiries-limit-inputs .param-expiries.readonly .param-expiries-val,.param-expiries-limit-inputs .param-number-range.readonly .param-expiries-val,.param-expiries-limit-inputs .param-arr-ops.readonly .param-expiries-val{margin-top:0}.param-expiries-limit-inputs .param-expiries .param-expiries-placeholder,.param-expiries-limit-inputs .param-expiries .param-expiries-val,.param-expiries-limit-inputs .param-number-range .param-expiries-placeholder,.param-expiries-limit-inputs .param-number-range .param-expiries-val,.param-expiries-limit-inputs .param-arr-ops .param-expiries-placeholder,.param-expiries-limit-inputs .param-arr-ops .param-expiries-val{margin-top:4px}.param-expiries-limit-inputs .param-expiries .param-number-range-sep,.param-expiries-limit-inputs .param-number-range .param-number-range-sep,.param-expiries-limit-inputs .param-arr-ops .param-number-range-sep{margin:0 6px}.param-expiries-limit-inputs .param-arr-ops{padding:0}.param-expiries-popover{padding:0 !important}.param-expiries-popover .ant-popover-arrow{display:none}.param-number{flex:1;display:flex;align-items:center;height:40px}.param-number.readonly{height:30px}.param-number.readonly .param-number-suffix{padding:0;margin:0 0 0 1px;border:none;background:none}.param-number-val{position:relative;z-index:1;margin:0}.param-number-suffix{display:flex;align-items:center;justify-content:center;position:relative;z-index:0;flex:none;height:100%;padding:0 14px;margin:0 0 0 -2px;border-radius:2px;border:1px solid #d9d9d9;background:#f2f2f2}.param-number-range{flex:1;display:flex;align-items:center;height:40px}.param-number-range .param-number{height:100%}.param-number-range.readonly{height:30px}.param-number-range.readonly .param-number{flex:none}.param-number-range .param-number-range-prefix{margin:0 8px 0 0}.param-number-range .param-number-range-sep{margin:0 10px}.param-text-array{padding:calc((40px - 30px) / 2) 0}.param-arr-item{display:flex;align-items:center;height:30px;margin:0 0 4px}.param-arr-item>input{flex:none;width:160px}.param-arr-ops{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;height:100%;padding:0 10px}.param-arr-ops .param-arr-ops-add,.param-arr-ops .param-arr-ops-del{display:flex;align-items:center;justify-content:center;width:30px;height:100%;border-radius:4px;color:#006FA7}.param-arr-ops .param-arr-ops-add:hover,.param-arr-ops .param-arr-ops-del:hover{background:rgba(0,0,0,0.1)}.param-arr-ops .param-arr-ops-del{color:#006FA7}.param-text{flex:1;display:flex;align-items:center;height:40px}.param-text.readonly{height:30px}.param-text-val{position:relative;z-index:1;margin:0}.param-renderer{box-sizing:border-box;margin:0;line-height:20px;color:#333}.param-renderer.readonly input,.param-renderer.readonly select,.param-renderer.readonly .select{padding:0;border:none;box-shadow:none}.param-renderer.readonly textarea{padding:calc((30px - 20px - 2px) / 2) 10px}.param-renderer *{box-sizing:border-box}.param-renderer textarea,.param-renderer input,.param-renderer select,.param-renderer .select{flex:1;width:50px;height:100%;padding:0 10px;border:1px solid #d9d9d9;border-radius:2px;outline:none;box-shadow:none;background:#fff}.param-renderer textarea::placeholder,.param-renderer input::placeholder,.param-renderer select::placeholder,.param-renderer .select::placeholder{color:rgba(0,0,0,0.25)}.param-renderer textarea:hover,.param-renderer input:hover,.param-renderer select:hover,.param-renderer .select:hover{border-color:#006FA7}.param-renderer textarea:focus,.param-renderer input:focus,.param-renderer select:focus,.param-renderer .select:focus{border-color:#006FA7;box-shadow:0 0 0 2px rgba(0,111,167,0.1)}.param-renderer textarea{width:100%;padding:calc((40px - 20px - 2px) / 2) 10px}
@@ -6,6 +6,7 @@
6
6
  @import "./Num";
7
7
  @import "./NumRange";
8
8
  @import "./TextArray";
9
+ @import "./Text";
9
10
 
10
11
  .param-renderer {
11
12
  box-sizing: border-box;
@@ -20,13 +21,17 @@
20
21
  border: none;
21
22
  box-shadow: none;
22
23
  }
24
+
25
+ textarea {
26
+ padding: calc((#{$input-readonly-height} - 20px - 2px) / 2) 10px;
27
+ }
23
28
  }
24
29
 
25
30
  * {
26
31
  box-sizing: border-box;
27
32
  }
28
33
 
29
- input, select, .select {
34
+ textarea, input, select, .select {
30
35
  flex: 1;
31
36
  width: 50px;
32
37
  height: 100%;
@@ -50,4 +55,9 @@
50
55
  box-shadow: 0 0 0 2px rgba($primary, 0.1);
51
56
  }
52
57
  }
58
+
59
+ textarea {
60
+ width: 100%;
61
+ padding: calc((#{$input-height} - 20px - 2px) / 2) 10px;
62
+ }
53
63
  }
package/lib/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Bundle of @signalplus/params-about
3
- * Generated: 2022-04-14
4
- * Version: 0.1.34
3
+ * Generated: 2022-04-18
4
+ * Version: 0.1.37
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
@@ -192,6 +192,7 @@ var ParamType;
192
192
  ParamType[ParamType["ExpiryLimit"] = 6] = "ExpiryLimit";
193
193
  ParamType[ParamType["Expiry"] = 7] = "Expiry";
194
194
  ParamType[ParamType["Phone"] = 8] = "Phone";
195
+ ParamType[ParamType["Text"] = 9] = "Text";
195
196
  })(ParamType || (ParamType = {}));
196
197
 
197
198
  function _arrayWithHoles(arr) {
@@ -487,12 +488,13 @@ var Bool = /*#__PURE__*/function (_PureComponent) {
487
488
  cy: "8.5",
488
489
  r: "7.5",
489
490
  fill: "none",
490
- stroke: "currentColor"
491
+ stroke: "#006FA7",
492
+ strokeWidth: "1"
491
493
  }), /*#__PURE__*/React.createElement("circle", {
492
494
  cx: "8",
493
495
  cy: "8.5",
494
496
  r: "4",
495
- fill: "currentColor"
497
+ fill: "#006FA7"
496
498
  })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
497
499
  id: "clip0_0_7934"
498
500
  }, /*#__PURE__*/React.createElement("rect", {
@@ -513,7 +515,8 @@ var Bool = /*#__PURE__*/function (_PureComponent) {
513
515
  cy: "8.5",
514
516
  r: "7.5",
515
517
  fill: "none",
516
- stroke: "currentColor"
518
+ stroke: "#CCCCCC",
519
+ strokeWidth: "1"
517
520
  })));
518
521
 
519
522
  _defineProperty(_assertThisInitialized(_this), "onChange", function (val) {
@@ -577,7 +580,7 @@ var NumCvt = /*#__PURE__*/function () {
577
580
  return NumCvt;
578
581
  }();
579
582
 
580
- function initState$1(props) {
583
+ function initState$2(props) {
581
584
  return {
582
585
  preProps: props,
583
586
  tempValue: NumCvt.show(props.value, props.isPercentage)
@@ -600,7 +603,7 @@ var Num = /*#__PURE__*/function (_PureComponent) {
600
603
 
601
604
  _this = _super.call.apply(_super, [this].concat(args));
602
605
 
603
- _defineProperty(_assertThisInitialized(_this), "state", initState$1(_this.props));
606
+ _defineProperty(_assertThisInitialized(_this), "state", initState$2(_this.props));
604
607
 
605
608
  _defineProperty(_assertThisInitialized(_this), "onChange", function (e) {
606
609
  var $value = e.target.value;
@@ -1134,6 +1137,77 @@ var ExpiriesLimit = /*#__PURE__*/function (_PureComponent) {
1134
1137
  return ExpiriesLimit;
1135
1138
  }(PureComponent);
1136
1139
 
1140
+ function initState$1(props) {
1141
+ return {
1142
+ preProps: props
1143
+ };
1144
+ }
1145
+
1146
+ var Text = /*#__PURE__*/function (_PureComponent) {
1147
+ _inherits(Text, _PureComponent);
1148
+
1149
+ var _super = _createSuper(Text);
1150
+
1151
+ function Text() {
1152
+ var _this;
1153
+
1154
+ _classCallCheck(this, Text);
1155
+
1156
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1157
+ args[_key] = arguments[_key];
1158
+ }
1159
+
1160
+ _this = _super.call.apply(_super, [this].concat(args));
1161
+
1162
+ _defineProperty(_assertThisInitialized(_this), "state", initState$1(_this.props));
1163
+
1164
+ _defineProperty(_assertThisInitialized(_this), "onChange", function (e) {
1165
+ var _this$props$onChange, _this$props;
1166
+
1167
+ var $value = e.target.value;
1168
+ (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, $value);
1169
+ });
1170
+
1171
+ _defineProperty(_assertThisInitialized(_this), "onBlur", function (e) {
1172
+ var _this$props$onBlur, _this$props2;
1173
+
1174
+ (_this$props$onBlur = (_this$props2 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props2);
1175
+ });
1176
+
1177
+ return _this;
1178
+ }
1179
+
1180
+ _createClass(Text, [{
1181
+ key: "render",
1182
+ value: function render() {
1183
+ return /*#__PURE__*/React.createElement("div", {
1184
+ className: classNames('param-text', {
1185
+ readonly: this.props.readonly
1186
+ }, this.props.className),
1187
+ style: this.props.style
1188
+ }, this.props.readonly ? /*#__PURE__*/React.createElement("span", {
1189
+ className: "param-text-val"
1190
+ }, this.props.value || '-') : /*#__PURE__*/React.createElement("input", {
1191
+ className: "param-text-val",
1192
+ type: "text",
1193
+ placeholder: this.props.placeholder || 'Text',
1194
+ value: this.props.value || '',
1195
+ onChange: this.onChange,
1196
+ onBlur: this.onBlur
1197
+ }));
1198
+ }
1199
+ }], [{
1200
+ key: "getDerivedStateFromProps",
1201
+ value: function getDerivedStateFromProps(props, state) {
1202
+ return _objectSpread2(_objectSpread2({}, state), {}, {
1203
+ preProps: props
1204
+ });
1205
+ }
1206
+ }]);
1207
+
1208
+ return Text;
1209
+ }(PureComponent);
1210
+
1137
1211
  var _ParamTypeConfig;
1138
1212
  var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig, ParamType.ParamGroup, {
1139
1213
  name: '参数组',
@@ -1144,7 +1218,8 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1144
1218
  name: '普通数值',
1145
1219
  key: 'number',
1146
1220
  Comp: Num,
1147
- validator: emptyValidator
1221
+ validator: emptyValidator,
1222
+ required: true
1148
1223
  }), _defineProperty(_ParamTypeConfig, ParamType.Percentage, {
1149
1224
  name: '百分比数值',
1150
1225
  key: 'number',
@@ -1153,17 +1228,20 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1153
1228
  isPercentage: true
1154
1229
  }));
1155
1230
  },
1156
- validator: emptyValidator
1231
+ validator: emptyValidator,
1232
+ required: true
1157
1233
  }), _defineProperty(_ParamTypeConfig, ParamType.Bool, {
1158
1234
  name: 'TRUE/FALSE',
1159
1235
  key: 'bool',
1160
1236
  Comp: Bool,
1161
- validator: emptyValidator
1237
+ validator: emptyValidator,
1238
+ required: true
1162
1239
  }), _defineProperty(_ParamTypeConfig, ParamType.NumberRange, {
1163
1240
  name: '数值范围',
1164
1241
  key: 'range',
1165
1242
  Comp: NumRange,
1166
- validator: numRangeValidator
1243
+ validator: numRangeValidator,
1244
+ required: true
1167
1245
  }), _defineProperty(_ParamTypeConfig, ParamType.PercentageRange, {
1168
1246
  name: '百分比范围',
1169
1247
  key: 'range',
@@ -1172,7 +1250,8 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1172
1250
  isPercentage: true
1173
1251
  }));
1174
1252
  },
1175
- validator: numRangeValidator
1253
+ validator: numRangeValidator,
1254
+ required: true
1176
1255
  }), _defineProperty(_ParamTypeConfig, ParamType.ExpiryLimit, {
1177
1256
  name: '到期日 Limit',
1178
1257
  key: 'expiryLimitList',
@@ -1226,6 +1305,11 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
1226
1305
  if (index > -1) return "The ".concat(index + 1, "th item: should not be empty");
1227
1306
  return '';
1228
1307
  }
1308
+ }), _defineProperty(_ParamTypeConfig, ParamType.Text, {
1309
+ name: '文本',
1310
+ key: 'text',
1311
+ Comp: Text,
1312
+ validator: emptyValidator
1229
1313
  }), _ParamTypeConfig);
1230
1314
  function paramValidator(val, values) {
1231
1315
  var _config$validator;
@@ -1308,7 +1392,7 @@ function ParentSelector(props) {
1308
1392
  var _it$children;
1309
1393
 
1310
1394
  return _objectSpread2(_objectSpread2({}, it), {}, {
1311
- label: it.name,
1395
+ label: it.name || it.key,
1312
1396
  value: String(it.$paramId),
1313
1397
  children: (_it$children = it.children) === null || _it$children === void 0 ? void 0 : _it$children.map(cvt)
1314
1398
  });
@@ -1386,8 +1470,13 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
1386
1470
  _createClass(ParamForm, [{
1387
1471
  key: "formItems",
1388
1472
  get: function get() {
1389
- var _this2 = this;
1473
+ var _this$ref$current$get,
1474
+ _this$ref$current,
1475
+ _this$props$initialVa,
1476
+ _this2 = this;
1390
1477
 
1478
+ var valueType = (_this$ref$current$get = (_this$ref$current = this.ref.current) === null || _this$ref$current === void 0 ? void 0 : _this$ref$current.getFieldValue('valueType')) !== null && _this$ref$current$get !== void 0 ? _this$ref$current$get : (_this$props$initialVa = this.props.initialValues) === null || _this$props$initialVa === void 0 ? void 0 : _this$props$initialVa.valueType;
1479
+ var config = ParamTypeConfig[valueType];
1391
1480
  return [{
1392
1481
  label: '所属分组',
1393
1482
  name: 'parentId',
@@ -1443,6 +1532,7 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
1443
1532
  }, {
1444
1533
  label: '默认值',
1445
1534
  name: 'value',
1535
+ required: config === null || config === void 0 ? void 0 : config.required,
1446
1536
  Comp: function Comp(props) {
1447
1537
  var _this2$ref$current$ge, _this2$ref$current, _this2$props$initialV;
1448
1538
 
@@ -1561,9 +1651,9 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
1561
1651
  _createClass(ParamFormModalEl, [{
1562
1652
  key: "isEdit",
1563
1653
  get: function get() {
1564
- var _this$props$initialVa;
1654
+ var _this$props$initialVa2;
1565
1655
 
1566
- return Boolean((_this$props$initialVa = this.props.initialValues) === null || _this$props$initialVa === void 0 ? void 0 : _this$props$initialVa.$paramId);
1656
+ return Boolean((_this$props$initialVa2 = this.props.initialValues) === null || _this$props$initialVa2 === void 0 ? void 0 : _this$props$initialVa2.$paramId);
1567
1657
  }
1568
1658
  }, {
1569
1659
  key: "render",
@@ -2129,11 +2219,13 @@ function genOptions(props) {
2129
2219
  return it.valueType === ParamType.ParamGroup && level < maxLevel;
2130
2220
  };
2131
2221
 
2222
+ var targetParams = props.targetParams.map(String);
2223
+
2132
2224
  var cvt = function cvt(it, level) {
2133
2225
  var _it$children;
2134
2226
 
2135
2227
  return _objectSpread2(_objectSpread2({}, it), {}, {
2136
- disabled: props.targetParams.includes(String(it.$paramId)),
2228
+ disabled: targetParams.includes(String(it.$paramId)),
2137
2229
  children: (_it$children = it.children) === null || _it$children === void 0 ? void 0 : _it$children.filter(function ($it) {
2138
2230
  return filter($it, level + 1);
2139
2231
  }).map(function ($it) {
@@ -2151,12 +2243,13 @@ function genOptions(props) {
2151
2243
 
2152
2244
  function genParamsMap(props) {
2153
2245
  var map = {};
2246
+ var targetParams = props.targetParams.map(String);
2154
2247
 
2155
2248
  var append = function append(it) {
2156
2249
  var _it$children2;
2157
2250
 
2158
2251
  map[it.$paramId] = _objectSpread2(_objectSpread2({}, it), {}, {
2159
- disabled: props.targetParams.includes(String(it.$paramId))
2252
+ disabled: targetParams.includes(String(it.$paramId))
2160
2253
  });
2161
2254
  (_it$children2 = it.children) === null || _it$children2 === void 0 ? void 0 : _it$children2.forEach(append);
2162
2255
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalplus/params-about",
3
- "version": "0.1.34",
3
+ "version": "0.1.37",
4
4
  "description": "A description for the module",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",