generic-ui-core 1.5.2-rc1 → 1.5.2-rc3
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/README.md +2 -2
- package/dist/index.d.ts +126 -78
- package/dist/main.js +10 -21
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Generic UI Core [](https://www.npmjs.com/package/generic-ui-core)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A support library for generic UI components.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -28,6 +28,6 @@ Licensed under the [AGPL-3.0 license](https://www.gnu.org/licenses/agpl-3.0.en.h
|
|
|
28
28
|
|
|
29
29
|
This project is maintained by:
|
|
30
30
|
|
|
31
|
-
- [
|
|
31
|
+
- [Claire Lin](mailto:lclaire@gmail.com)
|
|
32
32
|
|
|
33
33
|
Feel free to reach out if you have any questions or suggestions!
|
package/dist/index.d.ts
CHANGED
|
@@ -1,86 +1,134 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
DEL_LAYER:
|
|
4
|
-
DEL_FIELD:
|
|
5
|
-
DEL_SELECT:
|
|
6
|
-
DEL_OPTION:
|
|
7
|
-
F_CHECKBOX:
|
|
8
|
-
F_DATE:
|
|
9
|
-
F_DATETIME:
|
|
10
|
-
F_DATETIME_RANGE:
|
|
11
|
-
F_DRAG:
|
|
12
|
-
F_DRAG_ELEMENT:
|
|
13
|
-
F_DRAG_MOLECULE:
|
|
14
|
-
F_DRAG_SAMPLE:
|
|
15
|
-
F_DRAG_REACTION:
|
|
16
|
-
F_DUMMY:
|
|
17
|
-
F_FORMULA_FIELD:
|
|
18
|
-
F_INPUT_GROUP:
|
|
19
|
-
F_INTEGER:
|
|
20
|
-
F_LABEL:
|
|
21
|
-
F_NUMBER:
|
|
22
|
-
F_ONTOLOGY_SELECT:
|
|
23
|
-
F_SELECT:
|
|
24
|
-
F_SELECT_MULTI:
|
|
25
|
-
F_SYS_REACTION:
|
|
26
|
-
F_SYSTEM_DEFINED:
|
|
27
|
-
F_TABLE:
|
|
28
|
-
F_TEXT:
|
|
29
|
-
F_TEXTAREA:
|
|
30
|
-
F_TEXT_FORMULA:
|
|
31
|
-
F_UPLOAD:
|
|
32
|
-
F_WF_NEXT:
|
|
33
|
-
V_BOOLEAN:
|
|
34
|
-
V_UNDEFINED:
|
|
35
|
-
}>;
|
|
1
|
+
declare module 'generic-ui-core' {
|
|
2
|
+
export const FieldTypes: Readonly<{
|
|
3
|
+
DEL_LAYER: 'Layer';
|
|
4
|
+
DEL_FIELD: 'Field';
|
|
5
|
+
DEL_SELECT: 'Select';
|
|
6
|
+
DEL_OPTION: 'Option';
|
|
7
|
+
F_CHECKBOX: 'checkbox';
|
|
8
|
+
F_DATE: 'date';
|
|
9
|
+
F_DATETIME: 'datetime';
|
|
10
|
+
F_DATETIME_RANGE: 'datetime-range';
|
|
11
|
+
F_DRAG: 'drag';
|
|
12
|
+
F_DRAG_ELEMENT: 'drag_element';
|
|
13
|
+
F_DRAG_MOLECULE: 'drag_molecule';
|
|
14
|
+
F_DRAG_SAMPLE: 'drag_sample';
|
|
15
|
+
F_DRAG_REACTION: 'drag_reaction';
|
|
16
|
+
F_DUMMY: 'dummy';
|
|
17
|
+
F_FORMULA_FIELD: 'formula-field';
|
|
18
|
+
F_INPUT_GROUP: 'input-group';
|
|
19
|
+
F_INTEGER: 'integer';
|
|
20
|
+
F_LABEL: 'label';
|
|
21
|
+
F_NUMBER: 'number';
|
|
22
|
+
F_ONTOLOGY_SELECT: 'ontology-select';
|
|
23
|
+
F_SELECT: 'select';
|
|
24
|
+
F_SELECT_MULTI: 'select-multi';
|
|
25
|
+
F_SYS_REACTION: 'sys-reaction';
|
|
26
|
+
F_SYSTEM_DEFINED: 'system-defined';
|
|
27
|
+
F_TABLE: 'table';
|
|
28
|
+
F_TEXT: 'text';
|
|
29
|
+
F_TEXTAREA: 'textarea';
|
|
30
|
+
F_TEXT_FORMULA: 'text-formula';
|
|
31
|
+
F_UPLOAD: 'upload';
|
|
32
|
+
F_WF_NEXT: 'wf-next';
|
|
33
|
+
V_BOOLEAN: 'boolean';
|
|
34
|
+
V_UNDEFINED: 'undefined';
|
|
35
|
+
}>;
|
|
36
36
|
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}>;
|
|
37
|
+
export const OptionMaps: Readonly<{
|
|
38
|
+
TBL_OPTS_MOLECULE: Array<{
|
|
39
|
+
label: 'InChiKey' | 'SMILES' | 'IUPAC' | 'Mass';
|
|
40
|
+
value: 'inchikey' | 'smiles' | 'iupac' | 'molecular_weight';
|
|
41
|
+
}>;
|
|
42
|
+
TBL_OPTS_SAMPLE: Array<{
|
|
43
|
+
label: 'Name' | 'Ext. Label' | 'Mass';
|
|
44
|
+
value: 'name' | 'external_label' | 'molecular_weight';
|
|
45
|
+
}>;
|
|
46
|
+
}>;
|
|
48
47
|
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}>;
|
|
48
|
+
export const WorkflowTypes: Readonly<{
|
|
49
|
+
ND_INPUT: 'input';
|
|
50
|
+
ND_OUTPUT: 'output';
|
|
51
|
+
ND_DEFAULT: 'default';
|
|
52
|
+
}>;
|
|
55
53
|
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
export interface Element {
|
|
55
|
+
properties_template: {
|
|
56
|
+
layers: Record<
|
|
57
|
+
string,
|
|
58
|
+
{
|
|
59
|
+
fields: Array<{
|
|
60
|
+
type: string;
|
|
61
|
+
value?: any;
|
|
62
|
+
sub_fields?: Array<{
|
|
63
|
+
type: string;
|
|
64
|
+
value: string;
|
|
65
|
+
}>;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
>;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
60
71
|
|
|
61
|
-
|
|
62
|
-
export
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
72
|
+
// Common functions
|
|
73
|
+
export function downloadFile(file: { contents: string; name: string }): void;
|
|
74
|
+
export function swapAryEls<T>(ary: T[], idx1: number, idx2: number): T[];
|
|
75
|
+
export function buildTS(
|
|
76
|
+
ontology: { iri: string; ontology_prefix: string; type: string } | null
|
|
77
|
+
): string | null;
|
|
78
|
+
export function buildTSS(q: string | null): string | null;
|
|
69
79
|
|
|
70
|
-
|
|
71
|
-
export
|
|
80
|
+
// Condition Operator types
|
|
81
|
+
export interface CondOperatorOption {
|
|
82
|
+
label: 'Match One' | 'Match All' | 'Match None';
|
|
83
|
+
value: 0 | 1 | 9;
|
|
84
|
+
}
|
|
85
|
+
export const defaultCondOperator: 1;
|
|
86
|
+
export const condOperatorOptions: CondOperatorOption[];
|
|
87
|
+
export const getCondOperator: Record<0 | 1 | 9, string>;
|
|
72
88
|
|
|
73
|
-
|
|
74
|
-
export function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export function orgLayerObject(_layers?: any[]): any;
|
|
80
|
-
export function isLayerVisible(layer: any, layers: any): any;
|
|
89
|
+
// Order utility functions
|
|
90
|
+
export function moveLayer(
|
|
91
|
+
layers: Record<string, { position: number; [key: string]: any }>,
|
|
92
|
+
sourceKey: string,
|
|
93
|
+
targetKey: string
|
|
94
|
+
): Record<string, { position: number; [key: string]: any }>;
|
|
81
95
|
|
|
82
|
-
export function
|
|
83
|
-
|
|
96
|
+
export function moveField(
|
|
97
|
+
fields: Array<{ field: string; position: number; [key: string]: any }>,
|
|
98
|
+
sourceKey: string,
|
|
99
|
+
targetKey: string
|
|
100
|
+
): Array<{ field: string; position: number; [key: string]: any }>;
|
|
84
101
|
|
|
85
|
-
|
|
86
|
-
export function
|
|
102
|
+
// Template functions
|
|
103
|
+
export function clsInputGroup(el: Element): Element;
|
|
104
|
+
export function replaceData(data: string, spec?: string): string;
|
|
105
|
+
export function resetProperties(props: { layers: Record<string, any> }): {
|
|
106
|
+
layers: Record<string, any>;
|
|
107
|
+
};
|
|
108
|
+
export function absOlsTermId(val: string): string;
|
|
109
|
+
export function absOlsTermLabel(val: string): string;
|
|
110
|
+
export function showProperties(dataObj: any, layers: any): any[];
|
|
111
|
+
export function orgLayerObject(layers?: any[]): Record<string, any>;
|
|
112
|
+
export function isLayerVisible(
|
|
113
|
+
layer: {
|
|
114
|
+
cond_fields?: Array<any>;
|
|
115
|
+
},
|
|
116
|
+
layers: Record<string, any>
|
|
117
|
+
): boolean;
|
|
118
|
+
|
|
119
|
+
// Unit functions
|
|
120
|
+
export function getUnitSystem(externalUnits?: Record<string, any>): any[];
|
|
121
|
+
export function genUnit(type: string, unit: string): Record<string, string>;
|
|
122
|
+
export function genUnits(type: string): Array<Record<string, string>>;
|
|
123
|
+
export function unitConvertToBase(value: number, fromUnit: string): number;
|
|
124
|
+
export function unitConversion(
|
|
125
|
+
value: number,
|
|
126
|
+
fromUnit: string,
|
|
127
|
+
toUnit: string
|
|
128
|
+
): number;
|
|
129
|
+
export function reUnit(value: string): string;
|
|
130
|
+
|
|
131
|
+
// Workflow functions
|
|
132
|
+
export function isLayerInWF(element: Element, layerKey: string): boolean;
|
|
133
|
+
export function storeFlow(props: { elements: Element[] }): any[];
|
|
134
|
+
}
|
package/dist/main.js
CHANGED
|
@@ -2356,12 +2356,12 @@ var n={};
|
|
|
2356
2356
|
r.r(n),
|
|
2357
2357
|
// EXPORTS
|
|
2358
2358
|
r.d(n,{FieldTypes:()=>/* reexport */e,OptionMaps:()=>/* reexport */t,absOlsTermId:()=>/* reexport */D,absOlsTermLabel:()=>/* reexport */I,buildTS:()=>/* reexport */f,buildTSS:()=>/* reexport */p,clsInputGroup:()=>/* reexport */L,condOperatorOptions:()=>/* reexport */b,defaultCondOperator:()=>/* reexport */y,downloadFile:()=>/* reexport */c,genUnit:()=>/* reexport */R.genUnit,genUnits:()=>/* reexport */R.genUnits,getCondOperator:()=>/* reexport */m,getUnitSystem:()=>/* reexport */V,isLayerInWF:()=>/* reexport */K,isLayerVisible:()=>/* reexport */N,moveField:()=>/* reexport */E,moveLayer:()=>/* reexport */w,orgLayerObject:()=>/* reexport */z,reUnit:()=>/* reexport */R.reUnit,replaceData:()=>/* reexport */P,resetProperties:()=>/* reexport */C,showProperties:()=>/* reexport */M,storeFlow:()=>/* reexport */X,swapAryEls:()=>/* reexport */s,unitConversion:()=>/* reexport */R.unitConversion,unitConvertToBase:()=>/* reexport */R.unitConvertToBase});
|
|
2359
|
-
/* harmony default export */const e=Object.freeze({DEL_LAYER:"Layer",DEL_FIELD:"Field",DEL_SELECT:"Select",DEL_OPTION:"Option",F_CHECKBOX:"checkbox",F_DATE:"date",F_DATETIME:"datetime",F_DATETIME_RANGE:"datetime-range",F_DRAG:"drag",F_DRAG_ELEMENT:"drag_element",F_DRAG_MOLECULE:"drag_molecule",F_DRAG_SAMPLE:"drag_sample",F_DRAG_REACTION:"drag_reaction",F_DUMMY:"dummy",F_FORMULA_FIELD:"formula-field",F_INPUT_GROUP:"input-group",F_INTEGER:"integer",F_LABEL:"label",
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2359
|
+
/* harmony default export */const e=Object.freeze({DEL_LAYER:"Layer",DEL_FIELD:"Field",DEL_SELECT:"Select",DEL_OPTION:"Option",F_CHECKBOX:"checkbox",F_DATE:"date",F_DATETIME:"datetime",F_DATETIME_RANGE:"datetime-range",F_DRAG:"drag",F_DRAG_ELEMENT:"drag_element",F_DRAG_MOLECULE:"drag_molecule",F_DRAG_SAMPLE:"drag_sample",F_DRAG_REACTION:"drag_reaction",F_DUMMY:"dummy",F_FORMULA_FIELD:"formula-field",F_INPUT_GROUP:"input-group",F_INTEGER:"integer",F_LABEL:"label",F_NUMBER:"number",F_ONTOLOGY_SELECT:"ontology-select",F_SELECT:"select",F_SELECT_MULTI:"select-multi",F_SYS_REACTION:"sys-reaction",F_SYSTEM_DEFINED:"system-defined",F_TABLE:"table",F_TEXT:"text",F_TEXTAREA:"textarea",F_TEXT_FORMULA:"text-formula",F_UPLOAD:"upload",F_WF_NEXT:"wf-next",V_BOOLEAN:"boolean",V_UNDEFINED:"undefined"});
|
|
2360
|
+
/* harmony default export */const t=Object.freeze({TBL_OPTS_MOLECULE:[{label:"InChiKey",value:"inchikey"},{label:"SMILES",value:"smiles"},{label:"IUPAC",value:"iupac"},{label:"Mass",value:"molecular_weight"}],TBL_OPTS_SAMPLE:[{label:"Name",value:"name"},{label:"Ext. Label",value:"external_label"},{label:"Mass",value:"molecular_weight"}]}),o=JSON.parse('{"p":"https://api.terminology.tib.eu/api","T":{"class":"terms","property":"props","individual":"individuals"}}');// ./src/kits/common.js
|
|
2361
|
+
function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var u=["rows=30","schema=collection","type=class","type=property","obsoletes=false","local=false","fieldList=id,iri,label,short_form,obo_id,ontology_name,ontology_prefix,description,type"].join("&"),c=function(e){var t=e.contents,r=e.name,n=document.createElement("a");n.download=r,n.href=t;var o=new window.MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});n.dispatchEvent(o)},s=function(e,t,r){var n=i(e),o=n[t];return n[t]=n[r],n[r]=o,n},f=function(e){if(!e||"object"!==a(e))return null;var t=e.iri,r=e.ontology_prefix,n=e.type;if(!(t&&r&&n&&o.T[n]))return null;var i=encodeURIComponent(t);return"".concat(o.p,"/ontologies/").concat(r,"/").concat(o.T[n],"?iri=").concat(i)},p=function(e){return!e||"string"!=typeof e||e.trim().length<2?null:"".concat(o.p,"/select?q=").concat(e,"&").concat(u)},y=1,b=[{label:"Match One",value:1},{label:"Match All",value:9},{label:"Match None",value:0}],m=Object.fromEntries(b.map((function(e){return[e.value,e.label]}))),d=r(3031),v=r.n(d);// ./src/kits/order-util.js
|
|
2362
|
+
function h(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=A(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==A(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||k(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){if(e){if("string"==typeof e)return O(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(e,t):void 0}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}
|
|
2363
|
+
// @ts-nocheck
|
|
2364
|
+
var w=function(e,t,r){if(!e||"object"!==A(e))return{};
|
|
2365
2365
|
// Convert to array and sort by current positions
|
|
2366
2366
|
var n=Object.entries(e).sort((function(e,t){var r=j(e,2)[1],n=j(t,2)[1];return r.position-n.position})),o=n.findIndex((function(e){return j(e,1)[0]===t})),a=n.findIndex((function(e){return j(e,1)[0]===r}));
|
|
2367
2367
|
// Find indices
|
|
@@ -2370,7 +2370,9 @@ if(-1===o||-1===a)return g({},e);// Return copy of original if keys not found
|
|
|
2370
2370
|
var i=j(n.splice(o,1),1)[0];
|
|
2371
2371
|
// Update all positions with multiples of 10
|
|
2372
2372
|
return n.splice(a,0,i),n.reduce((function(e,t,r){var n=j(t,2),o=n[0],a=n[1];return e[o]=g(g({},a),{},{position:10*r}),e}),{})},E=function(e,t,r){if(!Array.isArray(e))return[];var n=v()(h(e),["position"]),o=n.findIndex((function(e){return e.field===t})),a=n.findIndex((function(e){return e.field===r}));if(-1===o||-1===a)return h(e);var i=j(n.splice(o,1),1)[0];return n.splice(a,0,i),n.map((function(e,t){return g(g({},e),{},{position:10*t})}))};// ./src/kits/template.js
|
|
2373
|
-
function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}
|
|
2373
|
+
function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}
|
|
2374
|
+
// @ts-nocheck
|
|
2375
|
+
function L(t){if(!t)return t;var r=t,n=r.properties_template.layers;return Object.keys(n).forEach((function(t){n[t].fields.filter((function(t){return t.type===e.F_INPUT_GROUP})).forEach((function(t){t.sub_fields.forEach((function(t){var r=t;r.type===e.F_TEXT&&(r.value="")}))}))})),r}function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"string"!=typeof e?t:e?""===e.toString().trim()?t:e:t}
|
|
2374
2376
|
// Define reset-requiring field types once
|
|
2375
2377
|
var U=[e.F_DRAG_SAMPLE,e.F_DRAG_ELEMENT,e.F_SYS_REACTION,e.F_UPLOAD],C=function(t){return null!=t&&t.layers&&"object"===T(t.layers)?(Object.values(t.layers).forEach((function(t){t.ai=[];var r=(t.fields||[]).filter((function(e){return null!=e}));r.forEach((function(r,n){r&&U.includes(r.type)&&(t.fields[n].value=void 0),r&&r.type===e.F_TABLE&&(t.fields[n].sub_values=[])})),t.fields=r})),t):t},D=function(e){return(e||"").split("|")[0].trim()||""},I=function(e){var t;return null==e||null===(t=e.replace(D(e),""))||void 0===t?void 0:t.replace("|","").trim()},M=function(t,r){var n,o;
|
|
2376
2378
|
// always show because no restriction
|
|
@@ -2380,21 +2382,8 @@ for(var a,i=null!==(o=t.cond_operator)&&void 0!==o?o:1,l=0,u=function(){var n,o=
|
|
|
2380
2382
|
// if match NONE, return true only if no condition is met
|
|
2381
2383
|
// if match ALL, return true only if all conditions are met
|
|
2382
2384
|
return 0===i?[0===l,""]:9===i?[l===t.cond_fields.length,""]:[!1,""]},z=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var r=e,n=Object.keys(r);if(n.includes(t.key)){var o=n.filter((function(e){return e===t.key||e.startsWith("".concat(t.key,"."))})).length,a="".concat(t.key,".").concat(o);t.key=a,r[a]=t}else r[t.key]=t;return r}),{})},N=function(e,t){return void 0===e.cond_fields||null==e.cond_fields||0===e.cond_fields.length||S(M(e,t),1)[0]},R=r(8780),V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,R.genUnitsSystem)({externalUnits:e})},B=r(8055),G=r.n(B);
|
|
2383
|
-
// migrate from 'chem-generic-ui'
|
|
2384
2385
|
/* harmony default export */const $=Object.freeze({ND_INPUT:"input",ND_OUTPUT:"output",ND_DEFAULT:"default"});// ./src/kits/workflow.js
|
|
2385
|
-
//
|
|
2386
|
-
// const fs = _layerVals.filter(
|
|
2387
|
-
// (o) => o.wf && o.wf_info && o.wf_info.source_layer === _srcKey
|
|
2388
|
-
// );
|
|
2389
|
-
// if (fs.length > 1) {
|
|
2390
|
-
// fs.forEach((o) => {
|
|
2391
|
-
// findCurrentNode(o, _layerVals);
|
|
2392
|
-
// });
|
|
2393
|
-
// } else if (fs.length === 1) {
|
|
2394
|
-
// return findCurrentNode(fs[0].key, _layerVals);
|
|
2395
|
-
// }
|
|
2396
|
-
// return [_srcKey];
|
|
2397
|
-
// }
|
|
2386
|
+
// @ts-nocheck
|
|
2398
2387
|
function K(e,t){return((e.properties_template.flow||{}).elements||[]).filter((function(e){return e.type===$.ND_DEFAULT&&(e.data||{}).lKey===t})).length>0}function X(e){var t=e.elements,r=G()(t);return r.map((function(e){return[$.ND_DEFAULT].includes(e.type)&&e.data&&(delete e.data.label,delete e.data.layer),e})),r}})// ./index.js
|
|
2399
2388
|
(),n;
|
|
2400
2389
|
/******/})()));
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generic-ui-core",
|
|
3
|
-
"version": "1.5.2-
|
|
3
|
+
"version": "1.5.2-rc3",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "A support library for generic UI components.",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"private": false,
|
|
9
|
+
"author": "Claire Lin <lclaire@gmail.com>",
|
|
9
10
|
"files": [
|
|
10
11
|
"dist/*"
|
|
11
12
|
],
|
|
12
13
|
"keywords": [
|
|
13
14
|
"chemistry",
|
|
14
15
|
"generic",
|
|
15
|
-
"
|
|
16
|
+
"generic ui",
|
|
17
|
+
"user interface"
|
|
16
18
|
],
|
|
17
19
|
"scripts": {
|
|
18
|
-
"
|
|
19
|
-
"types": "tsc -p tsconfig.json",
|
|
20
|
+
"types": "cp types/index.d.ts dist/",
|
|
20
21
|
"production": "webpack --config webpack.config.js --mode production",
|
|
21
22
|
"development": "webpack --config webpack.config.js --mode development",
|
|
22
23
|
"build": "yarn production && yarn types",
|