diagram-js_lib_features_rules_RuleProvider.js 898 B

123456789101112131415161718192021222324252627282930313233
  1. import {
  2. CommandInterceptor
  3. } from "./chunk-6IT32OMX.js";
  4. import {
  5. e
  6. } from "./chunk-6C2KFJ7V.js";
  7. import "./chunk-4AK4GF4H.js";
  8. import "./chunk-2LSFTFF7.js";
  9. // node_modules/.pnpm/diagram-js@11.9.1/node_modules/diagram-js/lib/features/rules/RuleProvider.js
  10. function RuleProvider(eventBus) {
  11. CommandInterceptor.call(this, eventBus);
  12. this.init();
  13. }
  14. RuleProvider.$inject = ["eventBus"];
  15. e(RuleProvider, CommandInterceptor);
  16. RuleProvider.prototype.addRule = function(actions, priority, fn) {
  17. var self = this;
  18. if (typeof actions === "string") {
  19. actions = [actions];
  20. }
  21. actions.forEach(function(action) {
  22. self.canExecute(action, priority, function(context, action2, event) {
  23. return fn(context);
  24. }, true);
  25. });
  26. };
  27. RuleProvider.prototype.init = function() {
  28. };
  29. export {
  30. RuleProvider as default
  31. };
  32. //# sourceMappingURL=diagram-js_lib_features_rules_RuleProvider.js.map