APIs

Show:
  1. /**
  2. * @namespace flexygo.ui.wc
  3. */
  4. var flexygo;
  5. (function (flexygo) {
  6. var ui;
  7. (function (ui) {
  8. var wc;
  9. (function (wc) {
  10. /**
  11. * Library for the flx-dependencymanager web component.
  12. *
  13. * @class FlxDependencyManagerElement
  14. * @constructor
  15. * @return {FlxDependencyManagerElement} .
  16. */
  17. class FlxDependencyManagerElement extends HTMLElement {
  18. constructor() {
  19. super();
  20. /**
  21. * Set when component is attached to DOM
  22. * @property connected {boolean}
  23. */
  24. this.connected = false;
  25. this.template = null;
  26. this.objectname = null;
  27. this.reportname = null;
  28. this.processname = null;
  29. this.propertyname = null;
  30. this.constringItems = null;
  31. this.cusControlsItems = null;
  32. this.propItems = [];
  33. this.mode = null;
  34. }
  35. /**
  36. * Fires when element is attached to DOM
  37. * @method connectedCallback
  38. */
  39. connectedCallback() {
  40. let element = $(this);
  41. this.connected = true;
  42. this.loadConnStrings();
  43. this.loadCusControls();
  44. this.template = this.getTemplate();
  45. this.objectname = element.attr('ObjectName');
  46. this.reportname = element.attr("ReportName");
  47. this.processname = element.attr("ProcessName");
  48. this.propertyname = element.attr('PropertyName');
  49. let mode = 'object';
  50. if (this.reportname) {
  51. mode = 'report';
  52. }
  53. if (this.processname) {
  54. mode = 'process';
  55. }
  56. this.mode = mode;
  57. element.empty();
  58. this.init();
  59. }
  60. /**
  61. * Array of observed attributes.
  62. * @property observedAttributes {Array}
  63. */
  64. static get observedAttributes() {
  65. return ['objectname', 'reportname', 'processname', 'propertyname'];
  66. }
  67. /**
  68. * Fires when the attribute value of the element is changed.
  69. * @method attributeChangedCallback
  70. */
  71. attributeChangedCallback(attrName, oldVal, newVal) {
  72. if (!this.connected) {
  73. return false;
  74. }
  75. if (attrName.toLowerCase() == 'objectname' && newVal && newVal != '') {
  76. this.objectname = newVal;
  77. this.refresh();
  78. }
  79. if (attrName.toLowerCase() == 'reportname' && newVal && newVal != '') {
  80. this.reportname = newVal;
  81. this.refresh();
  82. }
  83. if (attrName.toLowerCase() == 'processname' && newVal && newVal != '') {
  84. this.processname = newVal;
  85. this.refresh();
  86. }
  87. if (attrName.toLowerCase() == 'propertyname' && newVal && newVal != '') {
  88. this.propertyname = newVal;
  89. this.refresh();
  90. }
  91. }
  92. /**
  93. * Init the webcomponent.
  94. * @method init
  95. */
  96. init() {
  97. this.refresh();
  98. }
  99. /**
  100. * Refresh de webcomponent.
  101. * @method refresh
  102. */
  103. refresh() {
  104. let me = $(this);
  105. me.empty();
  106. this.loadTabs();
  107. this.loadProps();
  108. me.find(".pnlProperties").sortable();
  109. }
  110. /**
  111. * RefrLoads connstrings for combo.
  112. * @method loadConnStrings
  113. */
  114. loadConnStrings() {
  115. let obj = new flexygo.obj.Entity('sysObject');
  116. this.constringItems = obj.getView('CnnStrings');
  117. }
  118. /**
  119. * RefrLoads CusControls for combo.
  120. * @method loadCusControls
  121. */
  122. loadCusControls() {
  123. let obj = new flexygo.obj.Entity('SysCustomProperty');
  124. this.cusControlsItems = obj.getView('SysCustomPropertyDefaultList');
  125. }
  126. /**
  127. * RefrLoads tabs.
  128. * @method loadTabs
  129. */
  130. loadTabs() {
  131. let me = $(this);
  132. me.append('<ul class="pnlNavigate nav nav-tabs" />');
  133. me.find('.pnlNavigate').append('<li class="active" data-link="order-controls"><a href="#"><i class="flx-icon icon-bullet-number-list"></i> ' + flexygo.localization.translate('dependecymanager.sort') + '</a></li>');
  134. me.find('.pnlNavigate').append('<li data-link="value-controls"><a href="#"><i class="flx-icon icon-tag"></i> ' + flexygo.localization.translate('dependecymanager.valuedep') + '</a></li>');
  135. me.find('.pnlNavigate').append('<li data-link="class-controls"><a href="#"><i class="flx-icon icon-custom"></i> ' + flexygo.localization.translate('dependecymanager.classdep') + '</a></li>');
  136. me.find('.pnlNavigate').append('<li data-link="combo-controls"><a href="#"><i class="flx-icon icon-listbox-2"></i> ' + flexygo.localization.translate('dependecymanager.combodep') + '</a></li>');
  137. me.find('.pnlNavigate').append('<li data-link="enabled-controls"><a href="#"><i class="flx-icon icon-lock-1"></i> ' + flexygo.localization.translate('dependecymanager.enabledep') + '</a></li>');
  138. me.find('.pnlNavigate').append('<li data-link="visible-controls"><a href="#"><i class="flx-icon icon-eye"></i> ' + flexygo.localization.translate('dependecymanager.visibledep') + '</a></li>');
  139. me.find('.pnlNavigate').append('<li data-link="required-controls"><a href="#"><i class="flx-icon icon-checked"></i> ' + flexygo.localization.translate('dependecymanager.requireddep') + '</a></li>');
  140. me.find('.pnlNavigate').append('<li data-link="customControl-controls"><a href="#"><i class="flx-icon icon-wizard-1"></i> ' + flexygo.localization.translate('dependecymanager.CustomProperty') + '</a></li>');
  141. me.find('.pnlNavigate').append('<li data-link="cnnstrings-controls"><a href="#"><i class="flx-icon icon-database-configuration"></i> ' + flexygo.localization.translate('dependecymanager.connectionstrings') + '</a></li>');
  142. me.find('.pnlNavigate').append('<li data-link="save-Module" class="pull-right"><button class="btn btn-default bg-info"><i class="flx-icon icon-save"></i> ' + flexygo.localization.translate('dependecymanager.save') + '</button></a></li>');
  143. me.find('.pnlNavigate>li>a').on('click', (ev) => {
  144. ev.stopPropagation();
  145. ev.preventDefault();
  146. let itm = $(ev.currentTarget);
  147. me.find('.pnlNavigate>li').removeClass('active');
  148. itm.parent().addClass('active');
  149. me.find('.ctl-panel').hide();
  150. me.find('.' + itm.parent().attr('data-link')).show();
  151. if (itm.parent().attr('data-link') == 'order-controls') {
  152. me.find(".pnlProperties").sortable('enable');
  153. me.find(".pnlProperties").disableSelection();
  154. }
  155. else {
  156. me.find(".pnlProperties").sortable('disable');
  157. me.find(".pnlProperties").enableSelection();
  158. }
  159. });
  160. me.find('.pnlNavigate>li>button').on('click', (e) => {
  161. this.save();
  162. });
  163. }
  164. /**
  165. * Saves dependencies.
  166. * @method save
  167. */
  168. save() {
  169. let me = $(this);
  170. let depItems = me.find('.pnlProperties li');
  171. let depProps = new Array();
  172. for (let i = 0; i < depItems.length; i++) {
  173. let dep = $(depItems[i]);
  174. let prop = new flexygo.api.edit.DependencyHelper();
  175. switch (this.mode) {
  176. case 'process':
  177. prop.ObjectName = this.processname;
  178. break;
  179. case 'report':
  180. prop.ObjectName = this.reportname;
  181. break;
  182. default:
  183. prop.ObjectName = this.objectname;
  184. break;
  185. }
  186. prop.PropertyName = this.propertyname;
  187. prop.DependingPropertyName = dep.attr('DependingPropertyName');
  188. prop.Order = i + 1;
  189. let controls = dep.find('[property]');
  190. for (let j = 0; j < controls.length; j++) {
  191. let cntl = $(controls[j]);
  192. prop[cntl.attr('property')] = cntl.val();
  193. }
  194. depProps.push(prop);
  195. }
  196. let params = {
  197. ObjectName: this.objectname,
  198. ProcessName: this.processname,
  199. ReportName: this.reportname,
  200. PropertyName: this.propertyname,
  201. Dependencies: depProps
  202. };
  203. flexygo.ajax.post('~/api/Edit', 'SaveDependenciesConfig', params, (ret) => {
  204. me.closest('.ui-dialog').remove();
  205. flexygo.msg.success('Saved :)');
  206. });
  207. }
  208. loadProps() {
  209. let me = $(this);
  210. me.append('<ul class="pnlProperties" />');
  211. me.append('<div class="panel panel-default"><div class="panel-heading"><i class="fa fa-plus"></i> ' + flexygo.localization.translate('dependecymanager.addmore') + '</div><div class="panel-body"><ul class="unactiveProperties nav nav-pills" /></div></div>');
  212. let obj;
  213. switch (this.mode) {
  214. case 'process':
  215. obj = new flexygo.obj.Entity('sysProcessParam', "Processes_Params.ProcessName='" + this.processname + "' and Processes_Params.ParamName='" + this.propertyname + "'");
  216. break;
  217. case 'report':
  218. obj = new flexygo.obj.Entity('sysReportParam', "Reports_Params.ReportName='" + this.reportname + "' and Reports_Params.ParamName='" + this.propertyname + "'");
  219. break;
  220. default:
  221. obj = new flexygo.obj.Entity('sysObjectProperty', "Objects_Properties.ObjectName='" + this.objectname + "' and Objects_Properties.propertyName='" + this.propertyname + "'");
  222. break;
  223. }
  224. let propItems = obj.getView('AllDependencies');
  225. ;
  226. this.propItems = propItems;
  227. let pnl = me.find('.pnlProperties');
  228. let unpnl = me.find('.unactiveProperties');
  229. for (let i = 0; i < propItems.length; i++) {
  230. if (propItems[i].HasValueDep == 1 || propItems[i].HasClassDep == 1 || propItems[i].HasComboDep == 1 || propItems[i].HasEnabledDep == 1 || propItems[i].HasVisibleDep == 1 || propItems[i].HasRequiredDep || propItems[i].HasCustomPropertyDep || propItems[i].HasConnstringDep) {
  231. pnl.append(flexygo.utils.parser.compile(propItems[i], this.template, flexygo));
  232. }
  233. else {
  234. let prop = $(flexygo.utils.parser.compile(propItems[i], '<li class="active"><a href="#">{{DependingPropertyName}}</a></li>', flexygo));
  235. prop.data('fulldata', propItems[i]);
  236. unpnl.append(prop);
  237. }
  238. }
  239. me.find('.unactiveProperties>li>a').on('click', (e) => {
  240. this.unactivePropClick(e, me);
  241. });
  242. me.find('[property]').on('change', (e) => {
  243. let dep = $(e.currentTarget).closest('li');
  244. this.processDependency(dep);
  245. });
  246. me.find('.deleteDependencyButton').on('click', (e) => {
  247. let dep = $(e.currentTarget).closest('li');
  248. this.deleteDependency(dep);
  249. });
  250. setTimeout(() => {
  251. me.find('.pnlProperties li').each((i, e) => {
  252. this.processDependency($(e));
  253. });
  254. }, 500);
  255. }
  256. unactivePropClick(e, me) {
  257. e.stopPropagation();
  258. e.preventDefault();
  259. let itm = $(e.currentTarget);
  260. let newProp = $(flexygo.utils.parser.compile(itm.parent().data('fulldata'), this.template, flexygo));
  261. me.find('.pnlProperties').append(newProp);
  262. itm.remove();
  263. newProp.find('.ctl-panel').hide();
  264. newProp.find('.' + me.find('.pnlNavigate>li.active').attr('data-link')).show();
  265. newProp.find('[property]').on('change', (ee) => {
  266. let dep = $(ee.currentTarget).closest('li');
  267. this.processDependency(dep);
  268. });
  269. newProp.find('.deleteDependencyButton').on('click', (p) => {
  270. let dep = $(p.currentTarget).closest('li');
  271. this.deleteDependency(dep);
  272. });
  273. }
  274. processDependency(dep) {
  275. //Show or hide dependency icons
  276. dep.find('.HasValueDep').visible(dep.find('[property="SQLValue"]').val() != null);
  277. dep.find('.HasClassDep').visible(dep.find('[property="SQLClass"]').val() != null);
  278. dep.find('.HasComboDep').visible(dep.find('[property="SQLComboFilter"]').val() != null || dep.find('[property="SQLComboSentence"]').val() != null);
  279. dep.find('.HasEnabledDep').visible(dep.find('[property="EnabledValues"]').val() != null || dep.find('[property="DisabledValues"]').val() != null || dep.find('[property="SQLEnabled"]').val() != null);
  280. dep.find('.HasVisibleDep').visible(dep.find('[property="VisibleValues"]').val() != null || dep.find('[property="HiddenValues"]').val() != null || dep.find('[property="SQLVisible"]').val() != null);
  281. dep.find('.HasRequiredDep').visible(dep.find('[property="RequiredValues"]').val() != null || dep.find('[property="NotRequiredValues"]').val() != null || dep.find('[property="SQLRequired"]').val() != null);
  282. dep.find('.HasCustomPropertyDep').visible(dep.find('[property="SQLCustomProperty"]').val() != null || dep.find('[property="PropertyValue"]').val() != null || dep.find('[property="CusPropName"]').val() != null);
  283. dep.find('.HasConnstringDep').visible(dep.find('[property="HasConnstringDep"]').val() != null);
  284. //dep.find('.HasConnstringDep').visible(dep.find('[property="ConnStringId"]').val() != null);
  285. if (dep.find('[property="Active"]').val()) {
  286. dep.find('.propName').removeClass('strike');
  287. }
  288. else {
  289. dep.find('.propName').addClass('strike');
  290. }
  291. //Enabled or disabled Combo dep
  292. dep.find('.combo-controls [property]').removeAttr('disabled');
  293. if (dep.find('[property="SQLComboFilter"]').val() != null) {
  294. dep.find('[property="SQLComboSentence"]').attr('disabled', true);
  295. }
  296. else if (dep.find('[property="SQLComboSentence"]').val() != null) {
  297. dep.find('[property="SQLComboFilter"]').attr('disabled', true);
  298. }
  299. //Enabled or disabled Enabled dep
  300. dep.find('.enabled-controls [property]').removeAttr('disabled');
  301. if (dep.find('[property="EnabledValues"]').val() != null) {
  302. dep.find('[property="DisabledValues"]').attr('disabled', true);
  303. dep.find('[property="SQLEnabled"]').attr('disabled', true);
  304. }
  305. else if (dep.find('[property="DisabledValues"]').val() != null) {
  306. dep.find('[property="EnabledValues"]').attr('disabled', true);
  307. dep.find('[property="SQLEnabled"]').attr('disabled', true);
  308. }
  309. else if (dep.find('[property="SQLEnabled"]').val() != null) {
  310. dep.find('[property="EnabledValues"]').attr('disabled', true);
  311. dep.find('[property="DisabledValues"]').attr('disabled', true);
  312. }
  313. //Enabled or disabled Visibled dep
  314. dep.find('.visible-controls [property]').removeAttr('disabled');
  315. if (dep.find('[property="VisibleValues"]').val() != null) {
  316. dep.find('[property="HiddenValues"]').attr('disabled', true);
  317. dep.find('[property="SQLVisible"]').attr('disabled', true);
  318. }
  319. else if (dep.find('[property="HiddenValues"]').val() != null) {
  320. dep.find('[property="VisibleValues"]').attr('disabled', true);
  321. dep.find('[property="SQLVisible"]').attr('disabled', true);
  322. }
  323. else if (dep.find('[property="SQLVisible"]').val() != null) {
  324. dep.find('[property="VisibleValues"]').attr('disabled', true);
  325. dep.find('[property="HiddenValues"]').attr('disabled', true);
  326. }
  327. //Enabled or disabled Required dep
  328. dep.find('.required-controls [property]').removeAttr('disabled');
  329. if (dep.find('[property="RequiredValues"]').val() != null) {
  330. dep.find('[property="NotRequiredValues"]').attr('disabled', true);
  331. dep.find('[property="SQLRequired"]').attr('disabled', true);
  332. }
  333. else if (dep.find('[property="NotRequiredValues"]').val() != null) {
  334. dep.find('[property="RequiredValues"]').attr('disabled', true);
  335. dep.find('[property="SQLRequired"]').attr('disabled', true);
  336. }
  337. else if (dep.find('[property="SQLRequired"]').val() != null) {
  338. dep.find('[property="RequiredValues"]').attr('disabled', true);
  339. dep.find('[property="NotRequiredValues"]').attr('disabled', true);
  340. }
  341. //Enabled or disabled Custom Property dep
  342. dep.find('.customControl-controls [property]').removeAttr('disabled');
  343. if (dep.find('[property="SQLCustomProperty"]').val() != null) {
  344. dep.find('[property="PropertyValue"]').attr('disabled', true);
  345. dep.find('[property="CusPropName"]').attr('disabled', true);
  346. }
  347. else if (dep.find('[property="PropertyValue"]').val() != null) {
  348. dep.find('[property="SQLCustomProperty"]').attr('disabled', true);
  349. }
  350. else if (dep.find('[property="CusPropName"]').val() != null) {
  351. dep.find('[property="SQLCustomProperty"]').attr('disabled', true);
  352. }
  353. }
  354. /**
  355. * Gets template.
  356. * @method getTemplate
  357. * @returns string
  358. */
  359. getTemplate() {
  360. let template = '';
  361. template += '<li DependingPropertyName="{{DependingPropertyName}}" >';
  362. template += '<div class="row">';
  363. template += '<div class="col-2 propName {{Active|Bool:,strike}}">';
  364. template += '{{DependingPropertyName}}';
  365. template += ' <i title="Connection string for dependencies" class="flx-icon icon-database-configuration " style="{{HasConnstringDep|Bool:,display:none}}"></i>';
  366. template += ' <i title="Has Custom Control dependency" class="flx-icon icon-wizard-1 HasCustomPropertyDep" style="{{HasCustomPropertyDep|Bool:,display:none}}"></i>';
  367. template += ' <i title="Has value dependency" class="flx-icon icon-tag HasValueDep" style="{{HasValueDep|Bool:,display:none}}"></i>';
  368. template += ' <i title="Has Class dependency" class="flx-icon icon-custom HasClassDep" style="{{HasClassDep|Bool:,display:none}}"></i>';
  369. template += ' <i title="Has Combo dependency" class="flx-icon icon-listbox-2 HasComboDep" style="{{HasComboDep|Bool:,display:none}}"></i>';
  370. template += ' <i title="Has Enabled dependency" class="flx-icon icon-lock-1 HasEnabledDep" style="{{HasEnabledDep|Bool:,display:none}}"></i>';
  371. template += ' <i title="Has Visibility dependency" class="flx-icon icon-eye HasVisibleDep" style="{{HasVisibleDep|Bool:,display:none}}"></i>';
  372. template += ' <i title="Has Required dependency" class="flx-icon icon-checked HasRequiredDep" style="{{HasRequiredDep|Bool:,display:none}}"></i>';
  373. template += '</div>';
  374. template += '<div class="col-9">';
  375. template += '<div class="cnnstrings-controls ctl-panel" style="display:none">';
  376. template += ' <flx-combo type="text" property="ConnStringId" placeholder="' + flexygo.localization.translate('dependecymanager.connStringvalues') + '" value="{{ConnStringId}}">' + this.getConnStringItems() + '</flx-combo>';
  377. template += '</div>';
  378. template += '<div class="customControl-controls ctl-panel" style="display:none">';
  379. template += ' <flx-tag separator= "|" class="col-3" property="PropertyValue" placeholder="' + flexygo.localization.translate('dependecymanager.valueApply') + '" value= "{{PropertyValue}}" > </flx-tag>';
  380. template += ' <flx-combo type="text" title="' + flexygo.localization.translate('dependecymanager.CusPropertyName') + '" class="col-3" property="CusPropName" value="{{CusPropName}}">' + this.getCusControls() + '</flx-combo>';
  381. template += ' <flx-text type="text" class="col-6" property="SQLCustomProperty" placeholder="' + flexygo.localization.translate('dependecymanager.SQLCustomProperty') + '" value="{{SQLCustomProperty}}" ></flx-text>';
  382. template += '</div>';
  383. template += '<div class="value-controls ctl-panel" style="display:none">';
  384. template += ' <flx-text type="text" property="SQLValue" placeholder="' + flexygo.localization.translate('dependecymanager.sqlvalue') + '" value="{{SQLValue}}"></flx-text>';
  385. template += '</div>';
  386. template += '<div class="class-controls ctl-panel" style="display:none">';
  387. template += ' <flx-text type="text" property="SQLClass" placeholder="' + flexygo.localization.translate('dependecymanager.sqlclass') + '" value="{{SQLClass}}" ></flx-text>';
  388. template += '</div>';
  389. template += '<div class="combo-controls ctl-panel" style="display:none">';
  390. template += ' <flx-text type="text" class="col-4" property="SQLComboFilter" placeholder="' + flexygo.localization.translate('dependecymanager.sqlcombofilter') + '" value="{{SQLComboFilter}}" ></flx-text>';
  391. template += ' <flx-text type="text" class="col-8" property="SQLComboSentence" placeholder="' + flexygo.localization.translate('dependecymanager.sqlcombosentence') + '" value="{{SQLComboSentence}}" ></flx-text>';
  392. template += '</div>';
  393. template += '<div class="enabled-controls ctl-panel" style="display:none">';
  394. template += ' <flx-tag separator="|" class="col-3" property="EnabledValues" placeholder="' + flexygo.localization.translate('dependecymanager.enabledvalues') + '" value="{{EnabledValues}}" ></flx-tag>';
  395. template += ' <flx-tag separator="|" class="col-3" property="DisabledValues" placeholder="' + flexygo.localization.translate('dependecymanager.disabledvalues') + '" value="{{DisabledValues}}" ></flx-tag>';
  396. template += ' <flx-text type="text" class="col-6" property="SQLEnabled" placeholder="' + flexygo.localization.translate('dependecymanager.sqlenabledsentence') + '" value="{{SQLEnabled}}" ></flx-text>';
  397. template += '</div>';
  398. template += '<div class="visible-controls ctl-panel" style="display:none">';
  399. template += ' <flx-tag separator="|" class="col-3" property="VisibleValues" placeholder="' + flexygo.localization.translate('dependecymanager.visiblevalues') + '" value="{{VisibleValues}}" ></flx-tag>';
  400. template += ' <flx-tag separator="|" class="col-3" property="HiddenValues" placeholder="' + flexygo.localization.translate('dependecymanager.hiddenvalues') + '" value="{{HiddenValues}}" ></flx-tag>';
  401. template += ' <flx-text type="text" class="col-6" property="SQLVisible" placeholder="' + flexygo.localization.translate('dependecymanager.visiblesentence') + '" value="{{SQLVisible}}" ></flx-text>';
  402. template += '</div>';
  403. template += '<div class="required-controls ctl-panel" style="display:none">';
  404. template += ' <flx-tag separator="|" class="col-3" property="RequiredValues" placeholder="' + flexygo.localization.translate('dependecymanager.requiredvalues') + '" value="{{RequiredValues}}" ></flx-tag>';
  405. template += ' <flx-tag separator="|" class="col-3" property="NotRequiredValues" placeholder="' + flexygo.localization.translate('dependecymanager.notrequiredvalues') + '" value="{{NotRequiredValues}}" ></flx-tag>';
  406. template += ' <flx-text type="text" class="col-6" property="SQLRequired" placeholder="' + flexygo.localization.translate('dependecymanager.requiredsentence') + '" value="{{SQLRequired}}" ></flx-text>';
  407. template += '</div>';
  408. template += '<div class="order-controls ctl-panel">';
  409. template += ' <flx-switch class="pull-left" property="Active" {{Active|Bool:checked}} ></flx-switch>';
  410. template += ' <flx-text type="text" class="pull-left ctlDescrip" property="Descrip" placeholder="' + flexygo.localization.translate('dependecymanager.description') + '" value="{{Descrip}}" ></flx-text>';
  411. template += '</div>';
  412. template += '</div>';
  413. template += '<div class="col-1 padding-top-s"><i class="flx-icon icon-close txt-danger clickable deleteDependencyButton"/></div>';
  414. template += '</div>';
  415. template += ' </li>';
  416. return template;
  417. }
  418. /**
  419. * Gets connection string items as string.
  420. * @method getConnStringItems
  421. * @returns string
  422. */
  423. getConnStringItems() {
  424. let str = '<option value=""></option>';
  425. for (let i = 0; i < this.constringItems.length; i++) {
  426. str += '<option value="' + this.constringItems[i].ConnStringid + '">' + this.constringItems[i].ConnStringid + '</option >';
  427. }
  428. return str;
  429. }
  430. getCusControls() {
  431. let str = '<option value=""></option>';
  432. for (let i = 0; i < this.cusControlsItems.length; i++) {
  433. str += '<option value="' + this.cusControlsItems[i].CustomPropName + '">' + this.cusControlsItems[i].CustomPropName + '</option >';
  434. }
  435. return str;
  436. }
  437. deleteDependency(dep) {
  438. let me = $(this);
  439. let unpnl = me.find('.unactiveProperties');
  440. const found = this.propItems.find(element => element.DependingPropertyName == dep[0].attributes[0].textContent);
  441. let prop = $(flexygo.utils.parser.compile(found, '<li class="active"><a href="#">{{DependingPropertyName}}</a></li>', flexygo));
  442. prop.data('fulldata', found);
  443. console.log(found);
  444. for (const property in found) {
  445. if (property !== 'ConnStringId' && property !== 'DependingPropertyName' && property !== 'ObjectName' && property !== 'ord') {
  446. found[property] = null;
  447. }
  448. }
  449. unpnl.append(prop);
  450. //me.find('.unactiveProperties>li>a').off();
  451. prop.find('a').on('click', (e) => {
  452. this.unactivePropClick(e, me);
  453. });
  454. dep.remove();
  455. }
  456. }
  457. wc.FlxDependencyManagerElement = FlxDependencyManagerElement;
  458. })(wc = ui.wc || (ui.wc = {}));
  459. })(ui = flexygo.ui || (flexygo.ui = {}));
  460. })(flexygo || (flexygo = {}));
  461. window.customElements.define('flx-dependencymanager', flexygo.ui.wc.FlxDependencyManagerElement);
  462. //# sourceMappingURL=flx-dependencymanager.js.map