11"use strict" ;
22Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3- exports . JobContextMixin = exports . WorkflowContextMixin = exports . MethodDataContextMixin = exports . MaterialsContextMixin = exports . MaterialContextMixin = void 0 ;
43exports . ApplicationContextMixin = ApplicationContextMixin ;
5- exports . MaterialsSetContextMixin = MaterialsSetContextMixin ;
6- const utils_1 = require ( "../entity/set/ordered/utils" ) ;
7- const JobContextMixin_1 = require ( "./JobContextMixin" ) ;
8- Object . defineProperty ( exports , "JobContextMixin" , { enumerable : true , get : function ( ) { return JobContextMixin_1 . JobContextMixin ; } } ) ;
9- const MaterialContextMixin_1 = require ( "./MaterialContextMixin" ) ;
10- Object . defineProperty ( exports , "MaterialContextMixin" , { enumerable : true , get : function ( ) { return MaterialContextMixin_1 . MaterialContextMixin ; } } ) ;
11- const MaterialsContextMixin_1 = require ( "./MaterialsContextMixin" ) ;
12- Object . defineProperty ( exports , "MaterialsContextMixin" , { enumerable : true , get : function ( ) { return MaterialsContextMixin_1 . MaterialsContextMixin ; } } ) ;
13- const MethodDataContextMixin_1 = require ( "./MethodDataContextMixin" ) ;
14- Object . defineProperty ( exports , "MethodDataContextMixin" , { enumerable : true , get : function ( ) { return MethodDataContextMixin_1 . MethodDataContextMixin ; } } ) ;
15- const WorkflowContextMixin_1 = require ( "./WorkflowContextMixin" ) ;
16- Object . defineProperty ( exports , "WorkflowContextMixin" , { enumerable : true , get : function ( ) { return WorkflowContextMixin_1 . WorkflowContextMixin ; } } ) ;
174function ApplicationContextMixin ( superclass ) {
185 return class ApplicationContextMixin extends superclass {
196 constructor ( ...args ) {
@@ -33,20 +20,28 @@ function ApplicationContextMixin(superclass) {
3320 }
3421 } ;
3522}
36- function MaterialsSetContextMixin ( superclass ) {
37- return class MaterialsSetContextMixin extends superclass {
38- constructor ( ...params ) {
39- super ( ...params ) ;
40- this . _materialsSet = this . config . context && this . config . context . materialsSet ;
41- }
42- get materialsSet ( ) {
43- return this . _materialsSet ;
44- }
45- sortMaterialsByIndexInSet ( materials = [ ] ) {
46- // DO NOT SORT IN PLACE AS IT CHANGES THE ORDER IN `this.materials` AND HAS SIDE EFFECTS (MaterialViewer).
47- return materials . concat ( ) . sort ( ( a , b ) => {
48- return ( 0 , utils_1 . compareEntitiesInOrderedSetForSorting ) ( a , b , this . materialsSet . _id , false ) ;
49- } ) ;
50- }
51- } ;
52- }
23+ // export {
24+ // MaterialContextMixin,
25+ // MaterialsContextMixin,
26+ // MethodDataContextMixin,
27+ // WorkflowContextMixin,
28+ // JobContextMixin,
29+ // };
30+ // export function MaterialsSetContextMixin<T extends Constructor>(superclass: T) {
31+ // return class MaterialsSetContextMixin extends superclass {
32+ // _materialsSet: any;
33+ // constructor(...params: any) {
34+ // super(...params);
35+ // this._materialsSet = this.config.context && this.config.context.materialsSet;
36+ // }
37+ // get materialsSet() {
38+ // return this._materialsSet;
39+ // }
40+ // sortMaterialsByIndexInSet(materials: OrderedInMemoryEntityInSet[] = []) {
41+ // // DO NOT SORT IN PLACE AS IT CHANGES THE ORDER IN `this.materials` AND HAS SIDE EFFECTS (MaterialViewer).
42+ // return materials.concat().sort((a, b) => {
43+ // return compareEntitiesInOrderedSetForSorting(a, b, this.materialsSet._id, false);
44+ // });
45+ // }
46+ // };
47+ // }
0 commit comments