Examples of Vlocity/SF LWC components (in various states of working)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
  1. import { LightningElement, track } from 'lwc';
  2. import { OmniscriptBaseMixin } from 'vlocity_cmt/omniscriptBaseMixin';
  3. export default class MyCustomComponent extends OmniscriptBaseMixin(LightningElement) {
  4. @track layout;
  5. @track theme;
  6. @track parentClass;
  7. connectedCallback() {
  8. console.log("MyCustomComponent - Connected");
  9. this.layout = this.getAttribute('data-omni-layout'); // returns lightning or newport
  10. this.theme = this.layout === 'lightning' ? 'slds' : 'nds'; // we can now use theme={theme} in html
  11. this.parentClass = this.layout === 'lightning' ? 'slds-grid slds-wrap' : 'nds-grid nds-wrap';
  12. try {
  13. console.log("MyCustomComponent - this:", this);
  14. console.log("MyCustomComponent - this.omniScriptHeaderDef:", JSON.parse(JSON.stringify(this.omniScriptHeaderDef)));
  15. console.log("MyCustomComponent - this.omniResume:", JSON.parse(JSON.stringify(this.omniResume)));
  16. console.log("MyCustomComponent - this.omniSeedJson:", JSON.parse(JSON.stringify(this.omniSeedJson)));
  17. console.log("MyCustomComponent - this.omniJsonDef:", JSON.parse(JSON.stringify(this.omniJsonDef)));
  18. console.log("MyCustomComponent - this.omniJsonData:", JSON.parse(JSON.stringify(this.omniJsonData)));
  19. } catch (e) {
  20. console.debug("Error Parsing: ", e);
  21. }
  22. }
  23. handleInput(evt) {
  24. let inp = this.template.querySelector('input')
  25. this.omniUpdateDataJson();
  26. }
  27. }