Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | 1x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 6x 6x 4x 6x 6x 6x 6x 6x 6x 6x 6x 6x 6x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 11x 3x 3x 11x 11x 4x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 2x 2x 4x 4x 4x 4x 1x 1x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 11x 11x 11x 11x 11x 11x 11x 11x 4x 2x 2x 2x 2x 4x 4x 4x 4x 4x 2x 2x 4x 4x 11x 7x 7x 11x 11x 4x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 8x 26x 26x 4x 4x 4x 26x 11x 11x 11x 10x 10x 10x 1x 1x 1x 11x 1x 1x 22x 26x 4x 4x 4x 4x 22x 22x 8x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 8x 8x 8x 8x 8x 2x 2x 8x 2x 2x 8x 8x 8x 8x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 4x 1x 1x 2x 2x 2x 2x 2x 2x 1x 1x 1x 1x 2x 2x 1x 1x 4x 4x 13x 13x 2x 2x 2x 13x 2x 2x 2x 2x 11x 11x 4x 4x 4x 4x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | const {zcl_abapgit_gui_component} = await import("./zcl_abapgit_gui_component.clas.mjs"); const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_html_table.clas.abap class zcl_abapgit_html_table extends zcl_abapgit_gui_component { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_HTML_TABLE'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MI_RENDERER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_TABLE"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MT_COLUMNS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["COLUMN_ID"]},"secondary":[]}, "zcl_abapgit_html_table=>ty_columns");}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MI_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_WITH_CIDS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_TABLE_ID": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MS_SORTING_STATE": {"type": () => {return new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MR_LAST_GRP": {"type": () => {return new abap.types.DataReference(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {}));}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_SORT_SPAN_CLASS": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_SORT_ACTIVE_CLASS": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "C_SORT_BY_EVENT_PREFIX": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": "X", "is_class": "X"}, "C_SORT_BY_EVENT_REGEX": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": "X", "is_class": "X"}}; static METHODS = {"RENDER_THEAD": {"visibility": "I", "parameters": {}}, "RENDER_TBODY": {"visibility": "I", "parameters": {"IT_DATA": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"});}, "is_optional": " "}}}, "RENDER_ROW": {"visibility": "I", "parameters": {"IV_ROW_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IS_ROW": {"type": () => {return new abap.types.Character(4);}, "is_optional": " "}}}, "RENDER_COLUMN_TITLE": {"visibility": "I", "parameters": {"RV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_COL": {"type": () => {return new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {});}, "is_optional": " "}}}, "CID_ATTR": {"visibility": "I", "parameters": {"RS_DATA_ATTR": {"type": () => {return new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {});}, "is_optional": " "}, "IV_COLUMN_ID": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "GID_ATTR": {"visibility": "I", "parameters": {"RS_DATA_ATTR": {"type": () => {return new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {});}, "is_optional": " "}, "IV_COLUMN_ID": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "APPLY_SORTING": {"visibility": "I", "parameters": {"CT_DATA": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"});}, "is_optional": " "}}}, "CREATE": {"visibility": "U", "parameters": {"RO_INSTANCE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TABLE"});}, "is_optional": " "}, "II_RENDERER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_TABLE"});}, "is_optional": " "}, "IS_INITIAL_SORTING_STATE": {"type": () => {return new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {});}, "is_optional": " "}}}, "DEFINE_COLUMN": {"visibility": "U", "parameters": {"RO_SELF": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TABLE"});}, "is_optional": " "}, "IV_COLUMN_ID": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_COLUMN_TITLE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_FROM_FIELD": {"type": () => {return new abap.types.Character(30, {"qualifiedName":"abap_compname"});}, "is_optional": " "}, "IV_SORTABLE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "DEFINE_COLUMN_GROUP": {"visibility": "U", "parameters": {"RO_SELF": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TABLE"});}, "is_optional": " "}, "IV_GROUP_ID": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_GROUP_TITLE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "RENDER": {"visibility": "U", "parameters": {"RI_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "is_optional": " "}, "II_RENDERER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_TABLE"});}, "is_optional": " "}, "IT_DATA": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"});}, "is_optional": " "}, "IV_ID": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IV_CSS_CLASS": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IV_WITH_CIDS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IS_SORTING_STATE": {"type": () => {return new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {});}, "is_optional": " "}, "IV_WRAP_IN_DIV": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "DETECT_SORTING_REQUEST": {"visibility": "U", "parameters": {"RS_SORTING_REQUEST": {"type": () => {return new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {});}, "is_optional": " "}, "IV_EVENT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "PROCESS_SORTING_REQUEST": {"visibility": "U", "parameters": {"RV_PROCESSED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_EVENT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}}; #mi_renderer; #mt_columns; #mi_html; #mv_with_cids; #mv_table_id; #ms_sorting_state; #mr_last_grp; #mv_sort_span_class; #mv_sort_active_class; constructor() { const sup = super(); this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "SUPER": sup.FRIENDS_ACCESS_INSTANCE, "render_thead": this.#render_thead.bind(this), "render_tbody": this.#render_tbody.bind(this), "render_row": this.#render_row.bind(this), "render_column_title": this.#render_column_title.bind(this), "apply_sorting": this.#apply_sorting.bind(this), "define_column": this.define_column.bind(this), "define_column_group": this.define_column_group.bind(this), "render": this.render.bind(this), "process_sorting_request": this.process_sorting_request.bind(this), }; this.#mi_renderer = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_TABLE"}); this.FRIENDS_ACCESS_INSTANCE["mi_renderer"] = this.#mi_renderer; this.#mt_columns = abap.types.TableFactory.construct(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["COLUMN_ID"]},"secondary":[]}, "zcl_abapgit_html_table=>ty_columns"); this.FRIENDS_ACCESS_INSTANCE["mt_columns"] = this.#mt_columns; this.#mi_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"}); this.FRIENDS_ACCESS_INSTANCE["mi_html"] = this.#mi_html; this.#mv_with_cids = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_with_cids"] = this.#mv_with_cids; this.#mv_table_id = new abap.types.String({qualifiedName: "STRING"}); this.FRIENDS_ACCESS_INSTANCE["mv_table_id"] = this.#mv_table_id; this.#ms_sorting_state = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {}); this.FRIENDS_ACCESS_INSTANCE["ms_sorting_state"] = this.#ms_sorting_state; this.#mr_last_grp = new abap.types.DataReference(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {})); this.FRIENDS_ACCESS_INSTANCE["mr_last_grp"] = this.#mr_last_grp; this.#mv_sort_span_class = new abap.types.String({qualifiedName: "STRING"}); this.#mv_sort_span_class.set(`sort-arrow`); this.FRIENDS_ACCESS_INSTANCE["mv_sort_span_class"] = this.#mv_sort_span_class; this.#mv_sort_active_class = new abap.types.String({qualifiedName: "STRING"}); this.#mv_sort_active_class.set(`sort-active`); this.FRIENDS_ACCESS_INSTANCE["mv_sort_active_class"] = this.#mv_sort_active_class; this.c_sort_by_event_prefix = zcl_abapgit_html_table.c_sort_by_event_prefix; this.c_sort_by_event_regex = zcl_abapgit_html_table.c_sort_by_event_regex; } async constructor_(INPUT) { if (super.constructor_) { await super.constructor_(INPUT); } return this; } async #apply_sorting(INPUT) { let ct_data = abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"}); if (INPUT && INPUT.ct_data) {ct_data = INPUT.ct_data;} let lv_field = new abap.types.Character(30, {"qualifiedName":"abap_compname"}); let ls_col = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {}); if (abap.compare.initial(this.#ms_sorting_state.get().column_id)) { return; } abap.statements.readTable(this.#mt_columns,{into: ls_col, withKey: (i) => {return abap.compare.eq(i.column_id, this.#ms_sorting_state.get().column_id);}, withKeyValue: [{key: (i) => {return i.column_id}, value: this.#ms_sorting_state.get().column_id}], usesTableLine: false, withKeySimple: {"column_id": this.#ms_sorting_state.get().column_id}}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { return; } if (abap.compare.initial(ls_col.get().from_field) === false) { lv_field.set(abap.builtin.to_upper({val: ls_col.get().from_field})); } else { lv_field.set(abap.builtin.to_upper({val: this.#ms_sorting_state.get().column_id})); } if (abap.compare.eq(this.#ms_sorting_state.get().descending, abap.builtin.abap_true)) { abap.statements.sort(ct_data,{}); } else { abap.statements.sort(ct_data,{}); } } async cid_attr(INPUT) { return zcl_abapgit_html_table.cid_attr(INPUT); } static async cid_attr(INPUT) { let rs_data_attr = new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {}); let iv_column_id = INPUT?.iv_column_id; if (iv_column_id?.getQualifiedName === undefined || iv_column_id.getQualifiedName() !== "STRING") { iv_column_id = undefined; } if (iv_column_id === undefined) { iv_column_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_column_id); } rs_data_attr.get().name.set(abap.CharacterFactory.get(3, 'cid')); rs_data_attr.get().value.set(iv_column_id); return rs_data_attr; } async create(INPUT) { return zcl_abapgit_html_table.create(INPUT); } static async create(INPUT) { let ro_instance = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TABLE"}); let ii_renderer = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_TABLE"}); if (INPUT && INPUT.ii_renderer) {ii_renderer.set(INPUT.ii_renderer);} let is_initial_sorting_state = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {}); if (INPUT && INPUT.is_initial_sorting_state) {is_initial_sorting_state.set(INPUT.is_initial_sorting_state);} ro_instance.set(await (new abap.Classes['ZCL_ABAPGIT_HTML_TABLE']()).constructor_()); ro_instance.get().FRIENDS_ACCESS_INSTANCE["mi_renderer"].set(ii_renderer); ro_instance.get().FRIENDS_ACCESS_INSTANCE["ms_sorting_state"].set(is_initial_sorting_state); return ro_instance; } async define_column(INPUT) { let ro_self = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TABLE"}); let iv_column_id = INPUT?.iv_column_id; if (iv_column_id?.getQualifiedName === undefined || iv_column_id.getQualifiedName() !== "STRING") { iv_column_id = undefined; } if (iv_column_id === undefined) { iv_column_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_column_id); } let iv_column_title = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.iv_column_title) {iv_column_title.set(INPUT.iv_column_title);} let iv_from_field = new abap.types.Character(30, {"qualifiedName":"abap_compname"}); if (INPUT && INPUT.iv_from_field) {iv_from_field.set(INPUT.iv_from_field);} let iv_sortable = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_sortable) {iv_sortable.set(INPUT.iv_sortable);} if (INPUT === undefined || INPUT.iv_sortable === undefined) {iv_sortable = abap.builtin.abap_true;} let fs_ls_c_ = new abap.types.FieldSymbol(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {})); abap.statements.assert(abap.compare.initial(iv_column_id) === false); ro_self.set(this.me); fs_ls_c_.assign(this.#mt_columns.appendInitial()); fs_ls_c_.get().column_id.set(iv_column_id); fs_ls_c_.get().column_title.set(iv_column_title); fs_ls_c_.get().from_field.set(abap.builtin.to_upper({val: iv_from_field})); fs_ls_c_.get().sortable.set(iv_sortable); if (abap.compare.initial(this.#mr_last_grp) === false) { this.#mr_last_grp.get().group_span.set(abap.operators.add(this.#mr_last_grp.get().group_span,abap.IntegerFactory.get(1))); } return ro_self; } async define_column_group(INPUT) { let ro_self = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TABLE"}); let iv_group_id = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.iv_group_id) {iv_group_id.set(INPUT.iv_group_id);} let iv_group_title = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.iv_group_title) {iv_group_title.set(INPUT.iv_group_title);} if (abap.compare.gt(abap.builtin.lines({val: this.#mt_columns}), abap.IntegerFactory.get(0)) && abap.compare.initial(this.#mr_last_grp)) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(31, 'Start groups from the beginning')}); } ro_self.set(this.me); this.#mr_last_grp.assign(this.#mt_columns.appendInitial()); this.#mr_last_grp.get().is_group.set(abap.builtin.abap_true); this.#mr_last_grp.get().column_id.set(iv_group_id); this.#mr_last_grp.get().column_title.set(iv_group_title); return ro_self; } async detect_sorting_request(INPUT) { return zcl_abapgit_html_table.detect_sorting_request(INPUT); } static async detect_sorting_request(INPUT) { let rs_sorting_request = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {}); let iv_event = INPUT?.iv_event; if (iv_event?.getQualifiedName === undefined || iv_event.getQualifiedName() !== "STRING") { iv_event = undefined; } if (iv_event === undefined) { iv_event = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_event); } let lv_req = new abap.types.String({qualifiedName: "STRING"}); if (abap.compare.eq(abap.builtin.find({val: iv_event, regex: zcl_abapgit_html_table.c_sort_by_event_regex}), abap.IntegerFactory.get(0))) { lv_req.set(abap.builtin.replace({val: iv_event, sub: zcl_abapgit_html_table.c_sort_by_event_prefix, with: abap.CharacterFactory.get(1, '')})); abap.statements.split({source: lv_req, at: abap.CharacterFactory.get(1, ':'), targets: [rs_sorting_request.get().column_id,lv_req]}); rs_sorting_request.get().descending.set(abap.builtin.boolc(abap.compare.eq(lv_req, abap.CharacterFactory.get(3, 'dsc')))); } return rs_sorting_request; } async gid_attr(INPUT) { return zcl_abapgit_html_table.gid_attr(INPUT); } static async gid_attr(INPUT) { let rs_data_attr = new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {}); let iv_column_id = INPUT?.iv_column_id; if (iv_column_id?.getQualifiedName === undefined || iv_column_id.getQualifiedName() !== "STRING") { iv_column_id = undefined; } if (iv_column_id === undefined) { iv_column_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_column_id); } rs_data_attr.get().name.set(abap.CharacterFactory.get(3, 'gid')); rs_data_attr.get().value.set(iv_column_id); return rs_data_attr; } async process_sorting_request(INPUT) { let rv_processed = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); let iv_event = INPUT?.iv_event; if (iv_event?.getQualifiedName === undefined || iv_event.getQualifiedName() !== "STRING") { iv_event = undefined; } if (iv_event === undefined) { iv_event = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_event); } let ls_sorting_req = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {}); ls_sorting_req.set((await this.detect_sorting_request({iv_event: iv_event}))); if (abap.compare.initial(ls_sorting_req) === false) { this.#ms_sorting_state.set(ls_sorting_req); rv_processed.set(abap.builtin.abap_true); } return rv_processed; } async render(INPUT) { let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"}); let ii_renderer = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_TABLE"}); if (INPUT && INPUT.ii_renderer) {ii_renderer.set(INPUT.ii_renderer);} let it_data = INPUT?.it_data; let iv_id = INPUT?.iv_id || new abap.types.Character(); let iv_css_class = INPUT?.iv_css_class || new abap.types.Character(); let iv_with_cids = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_with_cids) {iv_with_cids.set(INPUT.iv_with_cids);} if (INPUT === undefined || INPUT.iv_with_cids === undefined) {iv_with_cids = abap.builtin.abap_false;} let is_sorting_state = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_SORTING_STATE-COLUMN_ID"}), "descending": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_html_table=>ty_sorting_state", undefined, {}, {}); if (INPUT && INPUT.is_sorting_state) {is_sorting_state.set(INPUT.is_sorting_state);} let iv_wrap_in_div = new abap.types.String({qualifiedName: "STRING"}); if (INPUT && INPUT.iv_wrap_in_div) {iv_wrap_in_div.set(INPUT.iv_wrap_in_div);} let lv_attrs = new abap.types.String({qualifiedName: "STRING"}); let lr_data_copy = new abap.types.DataReference(new abap.types.Character(4)); let fs_lt_data_ = new abap.types.FieldSymbol(abap.types.TableFactory.construct(new abap.types.Character(4), {"withHeader":false,"keyType":"DEFAULT"})); if (abap.compare.initial(ii_renderer) === false) { this.#mi_renderer.set(ii_renderer); } abap.statements.assert(abap.compare.initial(this.#mi_renderer) === false); this.#mv_with_cids.set(iv_with_cids); this.#mv_table_id.set(iv_id); abap.statements.assign({target: fs_lt_data_, source: it_data}); if (abap.compare.initial(is_sorting_state) === false) { this.#ms_sorting_state.set(is_sorting_state); } else if (abap.compare.initial(this.#ms_sorting_state) === false) { abap.statements.createData(lr_data_copy,{"like": it_data}); abap.statements.assign({target: fs_lt_data_, source: lr_data_copy.dereference()}); fs_lt_data_.set(it_data); await this.#apply_sorting({ct_data: fs_lt_data_}); } if (abap.compare.initial(iv_id) === false) { lv_attrs.set(abap.operators.concat(lv_attrs,new abap.types.String().set(` id="${abap.templateFormatting(iv_id)}"`))); } if (abap.compare.initial(iv_css_class) === false) { lv_attrs.set(abap.operators.concat(lv_attrs,new abap.types.String().set(` class="${abap.templateFormatting(iv_css_class)}"`))); } this.#mi_html.set(await (new abap.Classes['ZCL_ABAPGIT_HTML']()).constructor_()); ri_html.set(this.#mi_html); if (abap.compare.initial(iv_wrap_in_div) === false) { await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<div class="${abap.templateFormatting(iv_wrap_in_div)}">`)}); } await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<table${abap.templateFormatting(lv_attrs)}>`)}); await this.#render_thead(); await this.#render_tbody({it_data: fs_lt_data_}); await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(8, '</table>')}); if (abap.compare.initial(iv_wrap_in_div) === false) { await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(6, '</div>')}); } return ri_html; } async #render_column_title(INPUT) { let rv_text = new abap.types.String({qualifiedName: "STRING"}); let is_col = INPUT?.is_col; if (is_col?.getQualifiedName === undefined || is_col.getQualifiedName() !== "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN") { is_col = undefined; } if (is_col === undefined) { is_col = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {}).set(INPUT.is_col); } let lv_direction = new abap.types.String({qualifiedName: "STRING"}); let lv_arrow = new abap.types.String({qualifiedName: "STRING"}); let lv_sort_active = new abap.types.String({qualifiedName: "STRING"}); if (abap.compare.eq(is_col.get().sortable, abap.builtin.abap_true) && abap.compare.initial(this.#ms_sorting_state) === false) { if (abap.compare.eq(is_col.get().column_id, this.#ms_sorting_state.get().column_id) && abap.compare.eq(this.#ms_sorting_state.get().descending, abap.builtin.abap_false)) { lv_direction.set(abap.CharacterFactory.get(3, 'dsc')); } else { lv_direction.set(abap.CharacterFactory.get(3, 'asc')); } if (abap.compare.eq(is_col.get().column_id, this.#ms_sorting_state.get().column_id) && abap.compare.eq(this.#ms_sorting_state.get().descending, abap.builtin.abap_true)) { lv_arrow.set(abap.CharacterFactory.get(8, '▴')); } else { lv_arrow.set(abap.CharacterFactory.get(8, '▾')); } if (abap.compare.eq(is_col.get().column_id, this.#ms_sorting_state.get().column_id)) { lv_sort_active.set(new abap.types.String().set(` ${abap.templateFormatting(this.#mv_sort_active_class)}`)); } rv_text.set((await this.#mi_html.get().zif_abapgit_html$a({iv_txt: is_col.get().column_title, iv_act: new abap.types.String().set(`${abap.templateFormatting(zcl_abapgit_html_table.c_sort_by_event_prefix)}${abap.templateFormatting(is_col.get().column_id)}:${abap.templateFormatting(lv_direction)}`)}))); rv_text.set(abap.operators.concat(rv_text,new abap.types.String().set(`<span class="${abap.templateFormatting(this.#mv_sort_span_class)}${abap.templateFormatting(lv_sort_active)}">${abap.templateFormatting(lv_arrow)}</span>`))); } else { rv_text.set(is_col.get().column_title); } return rv_text; } async #render_row(INPUT) { let iv_row_index = INPUT?.iv_row_index; if (iv_row_index?.getQualifiedName === undefined || iv_row_index.getQualifiedName() !== "I") { iv_row_index = undefined; } if (iv_row_index === undefined) { iv_row_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_row_index); } let is_row = INPUT?.is_row; let ls_render = new abap.types.Structure({ "css_class": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_CELL_RENDER-CSS_CLASS"}), "content": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_CELL_RENDER-CONTENT"}), "html": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"})}, "zif_abapgit_html_table=>ty_cell_render", undefined, {}, {}); let lv_dummy = new abap.types.String({qualifiedName: "STRING"}); let lt_attrs = abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["NAME"]},"secondary":[]}, "zif_abapgit_html=>ty_data_attrs"); let fs_ls_col_ = new abap.types.FieldSymbol(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {})); let fs_ls_grp_ = new abap.types.FieldSymbol(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {})); let fs_lv_val_ = new abap.types.FieldSymbol(new abap.types.Character(4)); for await (const unique803 of abap.statements.loop(this.#mt_columns)) { fs_ls_col_.assign(unique803); if (abap.compare.eq(fs_ls_col_.get().is_group, abap.builtin.abap_true)) { abap.statements.assign({target: fs_ls_grp_, source: fs_ls_col_}); continue; } if (abap.compare.initial(fs_ls_col_.get().from_field) === false && abap.compare.ne(fs_ls_col_.get().from_field, abap.CharacterFactory.get(1, '-'))) { abap.statements.assign({component: fs_ls_col_.get().from_field, target: fs_lv_val_, source: is_row}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`html_table: cannot assign field [${abap.templateFormatting(fs_ls_col_.get().from_field)}]`)}); } } else if (abap.compare.ne(fs_ls_col_.get().from_field, abap.CharacterFactory.get(1, '-'))) { fs_ls_col_.get().from_field.set(abap.builtin.to_upper({val: fs_ls_col_.get().column_id})); abap.statements.assign({component: fs_ls_col_.get().from_field, target: fs_lv_val_, source: is_row}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { fs_ls_col_.get().from_field.set(abap.CharacterFactory.get(1, '-')); abap.statements.assign({target: fs_lv_val_, source: lv_dummy}); } } else { abap.statements.assign({target: fs_lv_val_, source: lv_dummy}); } ls_render.set((await this.#mi_renderer.get().zif_abapgit_html_table$render_cell({iv_table_id: this.#mv_table_id, iv_row_index: iv_row_index, is_row: is_row, iv_column_id: fs_ls_col_.get().column_id, iv_value: new abap.types.String().set(`${abap.templateFormatting(fs_lv_val_)}`)}))); if (abap.compare.eq(this.#mv_with_cids, abap.builtin.abap_true)) { lt_attrs.clear(); abap.statements.append({source: (await this.cid_attr({iv_column_id: fs_ls_col_.get().column_id})), target: lt_attrs}); if (abap.compare.assigned(fs_ls_grp_) && abap.compare.initial(fs_ls_grp_.get().column_id) === false) { abap.statements.append({source: (await this.gid_attr({iv_column_id: fs_ls_grp_.get().column_id})), target: lt_attrs}); } } await this.#mi_html.get().zif_abapgit_html$td({iv_content: ls_render.get().content, ii_content: ls_render.get().html, it_data_attrs: lt_attrs, iv_class: ls_render.get().css_class}); } } async #render_tbody(INPUT) { let it_data = INPUT?.it_data; let ls_row_attrs = new abap.types.Structure({ "css_class": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_ROW_ATTRS-CSS_CLASS"}), "data": new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {})}, "zif_abapgit_html_table=>ty_row_attrs", undefined, {}, {}); let lv_row_attrs = new abap.types.String({qualifiedName: "STRING"}); let lv_index = new abap.types.Integer({qualifiedName: "I"}); let fs_ls_i_ = new abap.types.FieldSymbol(new abap.types.Character(4)); await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(7, '<tbody>')}); for await (const unique804 of abap.statements.loop(it_data)) { fs_ls_i_.assign(unique804); lv_index.set(abap.builtin.sy.get().tabix); ls_row_attrs.set((await this.#mi_renderer.get().zif_abapgit_html_table$get_row_attrs({iv_table_id: this.#mv_table_id, iv_row_index: lv_index, is_row: fs_ls_i_}))); lv_row_attrs.clear(); if (abap.compare.initial(ls_row_attrs.get().css_class) === false) { lv_row_attrs.set(abap.operators.concat(lv_row_attrs,new abap.types.String().set(` class="${abap.templateFormatting(ls_row_attrs.get().css_class)}"`))); } if (abap.compare.initial(ls_row_attrs.get().data) === false) { lv_row_attrs.set(abap.operators.concat(lv_row_attrs,new abap.types.String().set(` data-${abap.templateFormatting(ls_row_attrs.get().data.get().name)}="${abap.templateFormatting(ls_row_attrs.get().data.get().value)}"`))); } await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<tr${abap.templateFormatting(lv_row_attrs)}>`)}); await this.#render_row({iv_row_index: lv_index, is_row: fs_ls_i_}); await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(5, '</tr>')}); } await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(8, '</tbody>')}); } async #render_thead() { let fs_ls_col_ = new abap.types.FieldSymbol(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {})); let fs_ls_grp_ = new abap.types.FieldSymbol(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {})); let lt_attrs = abap.types.TableFactory.construct(new abap.types.Structure({ "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}), "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["NAME"]},"secondary":[]}, "zif_abapgit_html=>ty_data_attrs"); let ls_grp_span = new abap.types.String({qualifiedName: "STRING"}); let lv_grp_data = new abap.types.String({qualifiedName: "STRING"}); await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(7, '<thead>')}); if (abap.compare.initial(this.#mr_last_grp) === false) { await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<tr>')}); for await (const unique805 of abap.statements.loop(this.#mt_columns,{where: async (I) => {return abap.compare.eq(I.is_group, abap.builtin.abap_true);},topEquals: {"is_group": abap.builtin.abap_true}})) { fs_ls_grp_.assign(unique805); if (abap.compare.eq(this.#mv_with_cids, abap.builtin.abap_true) && abap.compare.initial(fs_ls_grp_.get().column_id) === false) { lv_grp_data.set(new abap.types.String().set(` data-gid="${abap.templateFormatting(fs_ls_grp_.get().column_id)}"`)); } else { lv_grp_data.clear(); } if (abap.compare.gt(fs_ls_grp_.get().group_span, abap.IntegerFactory.get(1))) { ls_grp_span.set(new abap.types.String().set(` colspan="${abap.templateFormatting(fs_ls_grp_.get().group_span)}"`)); } else { ls_grp_span.clear(); } await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<th${abap.templateFormatting(ls_grp_span)}${abap.templateFormatting(lv_grp_data)}>${abap.templateFormatting(fs_ls_grp_.get().column_title)}</th>`)}); } await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(5, '</tr>')}); } await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<tr>')}); for await (const unique806 of abap.statements.loop(this.#mt_columns)) { fs_ls_col_.assign(unique806); if (abap.compare.eq(fs_ls_col_.get().is_group, abap.builtin.abap_true)) { abap.statements.assign({target: fs_ls_grp_, source: fs_ls_col_}); continue; } if (abap.compare.eq(this.#mv_with_cids, abap.builtin.abap_true)) { lt_attrs.clear(); abap.statements.append({source: (await this.cid_attr({iv_column_id: fs_ls_col_.get().column_id})), target: lt_attrs}); if (abap.compare.assigned(fs_ls_grp_) && abap.compare.initial(fs_ls_grp_.get().column_id) === false) { abap.statements.append({source: (await this.gid_attr({iv_column_id: fs_ls_grp_.get().column_id})), target: lt_attrs}); } } await this.#mi_html.get().zif_abapgit_html$th({iv_content: (await this.#render_column_title({is_col: fs_ls_col_})), it_data_attrs: lt_attrs}); } await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(5, '</tr>')}); await this.#mi_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(8, '</thead>')}); } } abap.Classes['ZCL_ABAPGIT_HTML_TABLE'] = zcl_abapgit_html_table; zcl_abapgit_html_table.c_sort_by_event_prefix = new abap.types.String({qualifiedName: "STRING"}); zcl_abapgit_html_table.c_sort_by_event_prefix.set(`sort_by:`); zcl_abapgit_html_table.c_sort_by_event_regex = new abap.types.String({qualifiedName: "STRING"}); zcl_abapgit_html_table.c_sort_by_event_regex.set(`^sort_by:\\w+:(asc|dsc)$`); zcl_abapgit_html_table.ty_column = new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {}); zcl_abapgit_html_table.ty_columns = abap.types.TableFactory.construct(new abap.types.Structure({ "column_id": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_ID"}), "column_title": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-COLUMN_TITLE"}), "from_field": new abap.types.Character(30, {"qualifiedName":"abap_compname"}), "sortable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "is_group": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}), "group_span": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_HTML_TABLE=>TY_COLUMN-GROUP_SPAN"})}, "zcl_abapgit_html_table=>ty_column", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["COLUMN_ID"]},"secondary":[]}, "zcl_abapgit_html_table=>ty_columns"); export {zcl_abapgit_html_table}; |