@signalplus/params-about 0.1.35 → 0.1.39
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 +3 -0
- package/lib/css/Bool.scss +5 -1
- package/lib/css/Expiries.scss +4 -0
- package/lib/css/TextArray.scss +4 -3
- package/lib/css/index.css +1 -1
- package/lib/es/index.js +34 -126
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ declare class ParamRenderer extends PureComponent<ParamRendererProps> {
|
|
|
43
43
|
defaultValue?: any;
|
|
44
44
|
Comp: React.ComponentType<BaseInputProps>;
|
|
45
45
|
validator?(value: any): string;
|
|
46
|
+
required?: boolean | undefined;
|
|
46
47
|
};
|
|
47
48
|
get value(): any;
|
|
48
49
|
onChange: (val: any) => void;
|
|
@@ -288,6 +289,7 @@ declare const ParamTypeConfig: Record<ParamType, {
|
|
|
288
289
|
defaultValue?: any;
|
|
289
290
|
Comp: React.ComponentType<BaseInputProps>;
|
|
290
291
|
validator?(value: any): string;
|
|
292
|
+
required?: boolean;
|
|
291
293
|
}>;
|
|
292
294
|
declare function paramValidator(val: any, values: {
|
|
293
295
|
valueType: ParamType;
|
|
@@ -300,6 +302,7 @@ declare const ParamTypeOptions: {
|
|
|
300
302
|
defaultValue?: any;
|
|
301
303
|
Comp: React.ComponentType<BaseInputProps>;
|
|
302
304
|
validator?(value: any): string;
|
|
305
|
+
required?: boolean | undefined;
|
|
303
306
|
}[];
|
|
304
307
|
|
|
305
308
|
declare function formatNum(val: string): number | undefined;
|
package/lib/css/Bool.scss
CHANGED
package/lib/css/Expiries.scss
CHANGED
package/lib/css/TextArray.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
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,
|
|
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: $
|
|
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-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}
|
|
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}
|
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bundle of @signalplus/params-about
|
|
3
|
-
* Generated: 2022-04-
|
|
4
|
-
* Version: 0.1.
|
|
3
|
+
* Generated: 2022-04-18
|
|
4
|
+
* Version: 0.1.39
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -253,115 +253,6 @@ function _slicedToArray(arr, i) {
|
|
|
253
253
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
257
|
-
|
|
258
|
-
function createCommonjsModule(fn, module) {
|
|
259
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
var utc = createCommonjsModule(function (module, exports) {
|
|
263
|
-
!function (t, i) {
|
|
264
|
-
module.exports = i() ;
|
|
265
|
-
}(commonjsGlobal, function () {
|
|
266
|
-
|
|
267
|
-
var t = "minute",
|
|
268
|
-
i = /[+-]\d\d(?::?\d\d)?/g,
|
|
269
|
-
e = /([+-]|\d\d)/g;
|
|
270
|
-
return function (s, f, n) {
|
|
271
|
-
var u = f.prototype;
|
|
272
|
-
n.utc = function (t) {
|
|
273
|
-
var i = {
|
|
274
|
-
date: t,
|
|
275
|
-
utc: !0,
|
|
276
|
-
args: arguments
|
|
277
|
-
};
|
|
278
|
-
return new f(i);
|
|
279
|
-
}, u.utc = function (i) {
|
|
280
|
-
var e = n(this.toDate(), {
|
|
281
|
-
locale: this.$L,
|
|
282
|
-
utc: !0
|
|
283
|
-
});
|
|
284
|
-
return i ? e.add(this.utcOffset(), t) : e;
|
|
285
|
-
}, u.local = function () {
|
|
286
|
-
return n(this.toDate(), {
|
|
287
|
-
locale: this.$L,
|
|
288
|
-
utc: !1
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
var o = u.parse;
|
|
292
|
-
|
|
293
|
-
u.parse = function (t) {
|
|
294
|
-
t.utc && (this.$u = !0), this.$utils().u(t.$offset) || (this.$offset = t.$offset), o.call(this, t);
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
var r = u.init;
|
|
298
|
-
|
|
299
|
-
u.init = function () {
|
|
300
|
-
if (this.$u) {
|
|
301
|
-
var t = this.$d;
|
|
302
|
-
this.$y = t.getUTCFullYear(), this.$M = t.getUTCMonth(), this.$D = t.getUTCDate(), this.$W = t.getUTCDay(), this.$H = t.getUTCHours(), this.$m = t.getUTCMinutes(), this.$s = t.getUTCSeconds(), this.$ms = t.getUTCMilliseconds();
|
|
303
|
-
} else r.call(this);
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
var a = u.utcOffset;
|
|
307
|
-
|
|
308
|
-
u.utcOffset = function (s, f) {
|
|
309
|
-
var n = this.$utils().u;
|
|
310
|
-
if (n(s)) return this.$u ? 0 : n(this.$offset) ? a.call(this) : this.$offset;
|
|
311
|
-
if ("string" == typeof s && (s = function (t) {
|
|
312
|
-
void 0 === t && (t = "");
|
|
313
|
-
var s = t.match(i);
|
|
314
|
-
if (!s) return null;
|
|
315
|
-
var f = ("" + s[0]).match(e) || ["-", 0, 0],
|
|
316
|
-
n = f[0],
|
|
317
|
-
u = 60 * +f[1] + +f[2];
|
|
318
|
-
return 0 === u ? 0 : "+" === n ? u : -u;
|
|
319
|
-
}(s), null === s)) return this;
|
|
320
|
-
var u = Math.abs(s) <= 16 ? 60 * s : s,
|
|
321
|
-
o = this;
|
|
322
|
-
if (f) return o.$offset = u, o.$u = 0 === s, o;
|
|
323
|
-
|
|
324
|
-
if (0 !== s) {
|
|
325
|
-
var r = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
326
|
-
(o = this.local().add(u + r, t)).$offset = u, o.$x.$localOffset = r;
|
|
327
|
-
} else o = this.utc();
|
|
328
|
-
|
|
329
|
-
return o;
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
var h = u.format;
|
|
333
|
-
u.format = function (t) {
|
|
334
|
-
var i = t || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
335
|
-
return h.call(this, i);
|
|
336
|
-
}, u.valueOf = function () {
|
|
337
|
-
var t = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || new Date().getTimezoneOffset());
|
|
338
|
-
return this.$d.valueOf() - 6e4 * t;
|
|
339
|
-
}, u.isUTC = function () {
|
|
340
|
-
return !!this.$u;
|
|
341
|
-
}, u.toISOString = function () {
|
|
342
|
-
return this.toDate().toISOString();
|
|
343
|
-
}, u.toString = function () {
|
|
344
|
-
return this.toDate().toUTCString();
|
|
345
|
-
};
|
|
346
|
-
var l = u.toDate;
|
|
347
|
-
|
|
348
|
-
u.toDate = function (t) {
|
|
349
|
-
return "s" === t && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
var c = u.diff;
|
|
353
|
-
|
|
354
|
-
u.diff = function (t, i, e) {
|
|
355
|
-
if (t && this.$u === t.$u) return c.call(this, t, i, e);
|
|
356
|
-
var s = this.local(),
|
|
357
|
-
f = n(t).local();
|
|
358
|
-
return c.call(s, f, i, e);
|
|
359
|
-
};
|
|
360
|
-
};
|
|
361
|
-
});
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
dayjs.extend(utc);
|
|
365
256
|
function formatNum(val) {
|
|
366
257
|
var num = parseFloat(val);
|
|
367
258
|
return isNaN(num) ? undefined : num;
|
|
@@ -427,7 +318,8 @@ function keyValidator(val, allKeys) {
|
|
|
427
318
|
function isExpired(val) {
|
|
428
319
|
if (!val) return false;
|
|
429
320
|
var now = dayjs();
|
|
430
|
-
var
|
|
321
|
+
var expiry = dayjs("".concat(val), 'DDMMMYY');
|
|
322
|
+
var expireTime = dayjs("".concat(expiry.format('YYYY-MM-DD'), "T08:00Z"));
|
|
431
323
|
return now >= expireTime;
|
|
432
324
|
}
|
|
433
325
|
function validatorCvt(validator, form) {
|
|
@@ -488,12 +380,13 @@ var Bool = /*#__PURE__*/function (_PureComponent) {
|
|
|
488
380
|
cy: "8.5",
|
|
489
381
|
r: "7.5",
|
|
490
382
|
fill: "none",
|
|
491
|
-
stroke: "
|
|
383
|
+
stroke: "#006FA7",
|
|
384
|
+
strokeWidth: "1"
|
|
492
385
|
}), /*#__PURE__*/React.createElement("circle", {
|
|
493
386
|
cx: "8",
|
|
494
387
|
cy: "8.5",
|
|
495
388
|
r: "4",
|
|
496
|
-
fill: "
|
|
389
|
+
fill: "#006FA7"
|
|
497
390
|
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
498
391
|
id: "clip0_0_7934"
|
|
499
392
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
@@ -514,7 +407,8 @@ var Bool = /*#__PURE__*/function (_PureComponent) {
|
|
|
514
407
|
cy: "8.5",
|
|
515
408
|
r: "7.5",
|
|
516
409
|
fill: "none",
|
|
517
|
-
stroke: "
|
|
410
|
+
stroke: "#CCCCCC",
|
|
411
|
+
strokeWidth: "1"
|
|
518
412
|
})));
|
|
519
413
|
|
|
520
414
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (val) {
|
|
@@ -1216,7 +1110,8 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
1216
1110
|
name: '普通数值',
|
|
1217
1111
|
key: 'number',
|
|
1218
1112
|
Comp: Num,
|
|
1219
|
-
validator: emptyValidator
|
|
1113
|
+
validator: emptyValidator,
|
|
1114
|
+
required: true
|
|
1220
1115
|
}), _defineProperty(_ParamTypeConfig, ParamType.Percentage, {
|
|
1221
1116
|
name: '百分比数值',
|
|
1222
1117
|
key: 'number',
|
|
@@ -1225,17 +1120,20 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
1225
1120
|
isPercentage: true
|
|
1226
1121
|
}));
|
|
1227
1122
|
},
|
|
1228
|
-
validator: emptyValidator
|
|
1123
|
+
validator: emptyValidator,
|
|
1124
|
+
required: true
|
|
1229
1125
|
}), _defineProperty(_ParamTypeConfig, ParamType.Bool, {
|
|
1230
1126
|
name: 'TRUE/FALSE',
|
|
1231
1127
|
key: 'bool',
|
|
1232
1128
|
Comp: Bool,
|
|
1233
|
-
validator: emptyValidator
|
|
1129
|
+
validator: emptyValidator,
|
|
1130
|
+
required: true
|
|
1234
1131
|
}), _defineProperty(_ParamTypeConfig, ParamType.NumberRange, {
|
|
1235
1132
|
name: '数值范围',
|
|
1236
1133
|
key: 'range',
|
|
1237
1134
|
Comp: NumRange,
|
|
1238
|
-
validator: numRangeValidator
|
|
1135
|
+
validator: numRangeValidator,
|
|
1136
|
+
required: true
|
|
1239
1137
|
}), _defineProperty(_ParamTypeConfig, ParamType.PercentageRange, {
|
|
1240
1138
|
name: '百分比范围',
|
|
1241
1139
|
key: 'range',
|
|
@@ -1244,7 +1142,8 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
1244
1142
|
isPercentage: true
|
|
1245
1143
|
}));
|
|
1246
1144
|
},
|
|
1247
|
-
validator: numRangeValidator
|
|
1145
|
+
validator: numRangeValidator,
|
|
1146
|
+
required: true
|
|
1248
1147
|
}), _defineProperty(_ParamTypeConfig, ParamType.ExpiryLimit, {
|
|
1249
1148
|
name: '到期日 Limit',
|
|
1250
1149
|
key: 'expiryLimitList',
|
|
@@ -1385,7 +1284,7 @@ function ParentSelector(props) {
|
|
|
1385
1284
|
var _it$children;
|
|
1386
1285
|
|
|
1387
1286
|
return _objectSpread2(_objectSpread2({}, it), {}, {
|
|
1388
|
-
label: it.name,
|
|
1287
|
+
label: it.name || it.key,
|
|
1389
1288
|
value: String(it.$paramId),
|
|
1390
1289
|
children: (_it$children = it.children) === null || _it$children === void 0 ? void 0 : _it$children.map(cvt)
|
|
1391
1290
|
});
|
|
@@ -1463,8 +1362,13 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
1463
1362
|
_createClass(ParamForm, [{
|
|
1464
1363
|
key: "formItems",
|
|
1465
1364
|
get: function get() {
|
|
1466
|
-
var
|
|
1365
|
+
var _this$ref$current$get,
|
|
1366
|
+
_this$ref$current,
|
|
1367
|
+
_this$props$initialVa,
|
|
1368
|
+
_this2 = this;
|
|
1467
1369
|
|
|
1370
|
+
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;
|
|
1371
|
+
var config = ParamTypeConfig[valueType];
|
|
1468
1372
|
return [{
|
|
1469
1373
|
label: '所属分组',
|
|
1470
1374
|
name: 'parentId',
|
|
@@ -1520,6 +1424,7 @@ var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
|
1520
1424
|
}, {
|
|
1521
1425
|
label: '默认值',
|
|
1522
1426
|
name: 'value',
|
|
1427
|
+
required: config === null || config === void 0 ? void 0 : config.required,
|
|
1523
1428
|
Comp: function Comp(props) {
|
|
1524
1429
|
var _this2$ref$current$ge, _this2$ref$current, _this2$props$initialV;
|
|
1525
1430
|
|
|
@@ -1638,9 +1543,9 @@ var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
|
1638
1543
|
_createClass(ParamFormModalEl, [{
|
|
1639
1544
|
key: "isEdit",
|
|
1640
1545
|
get: function get() {
|
|
1641
|
-
var _this$props$
|
|
1546
|
+
var _this$props$initialVa2;
|
|
1642
1547
|
|
|
1643
|
-
return Boolean((_this$props$
|
|
1548
|
+
return Boolean((_this$props$initialVa2 = this.props.initialValues) === null || _this$props$initialVa2 === void 0 ? void 0 : _this$props$initialVa2.$paramId);
|
|
1644
1549
|
}
|
|
1645
1550
|
}, {
|
|
1646
1551
|
key: "render",
|
|
@@ -2206,11 +2111,13 @@ function genOptions(props) {
|
|
|
2206
2111
|
return it.valueType === ParamType.ParamGroup && level < maxLevel;
|
|
2207
2112
|
};
|
|
2208
2113
|
|
|
2114
|
+
var targetParams = props.targetParams.map(String);
|
|
2115
|
+
|
|
2209
2116
|
var cvt = function cvt(it, level) {
|
|
2210
2117
|
var _it$children;
|
|
2211
2118
|
|
|
2212
2119
|
return _objectSpread2(_objectSpread2({}, it), {}, {
|
|
2213
|
-
disabled:
|
|
2120
|
+
disabled: targetParams.includes(String(it.$paramId)),
|
|
2214
2121
|
children: (_it$children = it.children) === null || _it$children === void 0 ? void 0 : _it$children.filter(function ($it) {
|
|
2215
2122
|
return filter($it, level + 1);
|
|
2216
2123
|
}).map(function ($it) {
|
|
@@ -2228,12 +2135,13 @@ function genOptions(props) {
|
|
|
2228
2135
|
|
|
2229
2136
|
function genParamsMap(props) {
|
|
2230
2137
|
var map = {};
|
|
2138
|
+
var targetParams = props.targetParams.map(String);
|
|
2231
2139
|
|
|
2232
2140
|
var append = function append(it) {
|
|
2233
2141
|
var _it$children2;
|
|
2234
2142
|
|
|
2235
2143
|
map[it.$paramId] = _objectSpread2(_objectSpread2({}, it), {}, {
|
|
2236
|
-
disabled:
|
|
2144
|
+
disabled: targetParams.includes(String(it.$paramId))
|
|
2237
2145
|
});
|
|
2238
2146
|
(_it$children2 = it.children) === null || _it$children2 === void 0 ? void 0 : _it$children2.forEach(append);
|
|
2239
2147
|
};
|