1.0.0 • Published 13 days ago

@ffras4vnpm/deleniti-praesentium-magnam v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
13 days ago

Extending the properties panel changed significantly with bpmn-js-properties-panel>=1. For the 0.x version of the library, check out the 0.x branch. Read more on the changes in the changelog.

bpmn-js-properties-panel

CI

A properties panel extension for bpmn-js that adds the ability to edit technical properties (generic and Camunda).

bpmn-js-properties-panel screenshot

Features

The properties panel allows users to edit invisible BPMN properties in a convenient way.

Some of the features are:

  • Edit element ids, multi-instance details and more
  • Edit execution related Camunda 7 and Camunda 8 properties
  • Redo and undo (plugs into the bpmn-js editing cycle)

Usage

Provide two HTML elements, one for the properties panel and one for the BPMN diagram:

<div class="modeler">
  <div id="canvas"></div>
  <div id="properties"></div>
</div>

Bootstrap bpmn-js with the properties panel and a properties provider:

import BpmnModeler from 'bpmn-js/lib/Modeler';
import {
  BpmnPropertiesPanelModule,
  BpmnPropertiesProviderModule,
} from 'bpmn-js-properties-panel';

const modeler = new BpmnModeler({
  container: '#canvas',
  propertiesPanel: {
    parent: '#properties'
  },
  additionalModules: [
    BpmnPropertiesPanelModule,
    BpmnPropertiesProviderModule
  ]
});

Styling

For proper styling include the necessary stylesheets:

<link rel="stylesheet" href="https://unpkg.com/@bpmn-io/properties-panel/dist/assets/properties-panel.css">

Dynamic Attach/Detach

You may attach or detach the properties panel dynamically to any element on the page, too:

const propertiesPanel = bpmnJS.get('propertiesPanel');

// detach the panel
propertiesPanel.detach();

// attach it to some other element
propertiesPanel.attachTo('#other-properties');

Edit Camunda Properties

To edit Camunda properties, you have to use a moddle extension so bpmn-js is can read and write Camunda properties and use a provider so these properties are shown in the properties panel.

For example, to edit Camunda 8 properties, use the Camunda 8 moddle extension and the Camunda 8 provider. Additionally, you should use behaviors specific to Camunda 8 to ensure parts of the model that are specific to Camunda 8 are maintained correctly.

import BpmnModeler from 'bpmn-js/lib/Modeler';
import {
  BpmnPropertiesPanelModule,
  BpmnPropertiesProviderModule,
  ZeebePropertiesProviderModule // Camunda 8 provider
} from 'bpmn-js-properties-panel';

// Camunda 8 moddle extension
import zeebeModdle from 'zeebe-bpmn-moddle/resources/zeebe';

// Camunda 8 behaviors
import ZeebeBehaviorsModule from 'camunda-bpmn-js-behaviors/lib/camunda-cloud';

const modeler = new BpmnModeler({
  container: '#canvas',
  propertiesPanel: {
    parent: '#properties'
  },
  additionalModules: [
    BpmnPropertiesPanelModule,
    BpmnPropertiesProviderModule,
    ZeebePropertiesProviderModule,
    ZeebeBehaviorsModule
  ],
  moddleExtensions: {
    zeebe: zeebeModdle
  }
});

API

BpmnPropertiesPanelRenderer#attachTo(container: HTMLElement) => void

Attach the properties panel to a parent node.

const propertiesPanel = modeler.get('propertiesPanel');

propertiesPanel.attachTo('#other-properties');

BpmnPropertiesPanelRenderer#detach() => void

Detach the properties panel from its parent node.

const propertiesPanel = modeler.get('propertiesPanel');

propertiesPanel.detach();

BpmnPropertiesPanelRenderer#registerProvider(priority: Number, provider: PropertiesProvider) => void

Register a new properties provider to the properties panel.

class ExamplePropertiesProvider {
  constructor(propertiesPanel) {
    propertiesPanel.registerProvider(500, this);
  }

  getGroups(element) {
    return (groups) => {

      // add, modify or remove groups
      // ...

      return groups;
    };
  }
}

ExamplePropertiesProvider.$inject = [ 'propertiesPanel' ];

Additional Resources

Development

Prepare the project by installing all dependencies:

npm install

Then, depending on your use-case, you may run any of the following commands:

# build the library and run all tests
npm run all

# spin up a single local modeler instance
npm start

# run the full development setup
npm run dev

License

MIT

nested cssbyteOffseta11yloggerboundargvvaluestatusremovecodesflagsES6colorsform-validationflattenlockfileES2019compilerutilitiesArray.prototype.findLasteventEmitterhashbindtypanionbddURLautoprefixerstyled-componentszodhasOwntesterweaksetflagESnextsharedarraybufferpropertyeverysuperagentmixinsxhrdeep-cloneStreamArray.prototype.includesjasminejsdomjsonschemasanitizeshellObject.assigngetOwnPropertyDescriptorutilbuffersjsdiffeast-asian-widthio-tsreducerlook-upreuseponyfilliteratecharactersettapnumberECMAScript 2016debugharmonymimehooksInt16Arrayutil.inspectcallboundairbnbgetPrototypeOfAsyncIteratoravauuidansistylingclass-validatorramdaphoneArray.prototype.flatMaplookpreprocessorSettakechaibrowserlistspinnersWebSocketsutilitychromiumFunction.prototype.namematchtrimLeftenvironmentvariableswidthdeepgenericseslintpluginregularconsttestingawesomesaucebundlinges6descriptorkeyscorsuprequirenativeexecnodemkdirslrujwtjestpnpm9protormdirl10nfetchless.jswordbreaksignal[[Prototype]]colormoduleserror-handling3darraydataViewUint8ClampedArrayECMAScript 2015istestjavascriptargsstringjson-schemaobjectregular expressionES2016watchFileES2015webfastArrayArray.prototype.flatchromeassignjQueryasciireacttypesmime-dbcollection.es6fixed-widthinstallxtermvaluescall-bindbufferexit-codefindLastIndexloadingECMAScript 2021rateauthwarningrequestmake dirdirectorylastArrayBuffer.prototype.sliceObject.entriespolyfillexitinterruptsserializeformcolumntypedarraysgradients cssdeletepropguidregular expressionsObject.valuestoSortedes-shim APIcopyRFC-6455react-hooksMapquerystringparentsuninstallrandomslotloggingES2022bluebirdshimfullObject.isArray.prototype.filterweakmapfast-deep-cloneclonecallbackefficientbusymetadataTypedArrayinputspeedduplextranspileFloat32ArrayformattingcryptoString.prototype.trimtddcommanderprotocol-buffersvariables in csses-abstractqueueMicrotaskindicatoreslint-pluginfile systemECMAScript 2018less compilerlibphonenumbernpmlinkdebuggerCSSpostcssvestidleserializationstreamreact posereduxstringifyfindLastconfigurablesequenceartdropfileURLSearchParamswritableeslintconfiggradients css3objbyteconfigvalidationsetImmediatecommand-linespecoptimizervalidatormergeredux-toolkitthroatviewES2018animationforEach6to5pushauthenticationObject.fromEntriesbrowserslistsafees2016circularhelperselectronnameses2018importlesscssconnectprototypeperformancesorted256persistentmappurevisualsameValueZerooffsetsyntaxprogresspackageseventDispatchercode pointsstylesheetfsgroupBybyteLengthkeyBigUint64ArraymonorepoObservableArray.prototype.containstsreact-testing-librarytouchcss variableArray.prototype.findLastIndexmatchAllprefixargumentquotepostcss-pluginpasswordlogenumerablefigletpromisesoperating-systemECMAScript 2023performantcryptemojiUnderscoredependenciesreadesparsercompile lessYAMLdependency managerWeakSetconcurrencymakeconsumeTypeScriptencryptionslicetoolkitreact-hook-formclassnamesigintcheckbcryptrm -frUint16Arrayecmascriptfilterpropertiesrmequalitypipergbbootstrap lesswordwrapjapaneseES7fpfantasy-landregexwrapFloat64ArraygesturesstructuredCloneincludesmoduletranspilertoolstypescriptes8Uint32ArrayECMAScript 7descriptionsettingsinspectWebSocketdescriptorsexpressdeterministickoreanmatcheswaapisymlinkcollectionstringifierarraybuffersetPrototypeOfdayjsparsePromisestylearraysECMAScript 5expressionspringES2017ES2021timeposeformatcachehttpsgdprclassesWeakMapfoldercurriedwalkReactiveExtensionsthrottlePush@@toStringTagcensormkdirpInt8ArrayES2020limiteddeep-copyObject.getPrototypeOfObject.definePropertyscheme-validationreadablecharactersjoiES8jssortsanitizationttywhichlengthflatMapieframerqsimmerSymbolminimalrecursivetostringtagbannerpatchhookformdirpoint-freecjkes-shimstraversewaitredactpositivewriteunicodeESes2017colourES3BigInt64ArrayArray.prototype.flattenglobuser-streamshigher-ordercss nestingstablecreatetrimRightpyyamlfast-copygetstyleguidemiddlewareargparsebabel-coreextensioninternal slottextbatchcolumnssymlinkstypeddeepcopyequalgroupparent$.extendconcatshampluginthreecomputed-typesbabelpackagequeueomittslibsuperstructstdlibfull-widthwatchvalidateIteratortoStringTagjson-schema-validationajvjsxfunctionskarmasetterhandlersES5getintrinsicapidotenvreal-timeclassnamesbrowsershebangyupwindowsonceprivate datalimitECMAScript 2022rapid__proto__nodejsObservablesInt32Arraystartercss lessaccessorrangeerrorcore-jsMicrosoftjsonECMAScript 3.env
1.0.0

13 days ago