From 5ec2a233a4e4ac5b004341752e4a517121a802ce Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Jan 2022 10:57:06 +0200 Subject: [PATCH] using WCs for simple select, r/o select-* and r/o date(-time) ToDo/Questions Nathan: - Tracker index gives a client-side TypeError - ", but "") (substr($matches[4], -1) === '/' ? substr($matches[4], 0, -1) . '>'; - }, $str); + }, $str); + + // handling of partially implemented select and date widget (only readonly or simple select without tags or search attribute or options) + $str = preg_replace_callback('#<(select|date)(-[^ ]+)? ([^>]+)/>#', static function (array $matches) + { + preg_match_all('/(^| )([a-z0-9_-]+)="([^"]+)"/', $matches[3], $attrs, PREG_PATTERN_ORDER); + $attrs = array_combine($attrs[2], $attrs[3]); + // fix not understood '; + } + return $matches[0]; + }, $str); $processing = microtime(true); diff --git a/api/js/etemplate/Et2Date/Et2DateTime.ts b/api/js/etemplate/Et2Date/Et2DateTime.ts index 372faca739..be0b650c90 100644 --- a/api/js/etemplate/Et2Date/Et2DateTime.ts +++ b/api/js/etemplate/Et2Date/Et2DateTime.ts @@ -66,4 +66,4 @@ export class Et2DateTime extends Et2Date } // @ts-ignore TypeScript is not recognizing that Et2DateTime is a LitElement -customElements.define("et2-datetime", Et2DateTime); +customElements.define("et2-date-time", Et2DateTime); diff --git a/api/js/etemplate/Et2Date/Et2DateTimeReadonly.ts b/api/js/etemplate/Et2Date/Et2DateTimeReadonly.ts index 230b613ffc..9c0f9bda68 100644 --- a/api/js/etemplate/Et2Date/Et2DateTimeReadonly.ts +++ b/api/js/etemplate/Et2Date/Et2DateTimeReadonly.ts @@ -24,4 +24,4 @@ export class Et2DateTimeReadonly extends Et2DateReadonly } // @ts-ignore TypeScript is not recognizing that Et2Date is a LitElement -customElements.define("et2-datetime_ro", Et2DateTimeReadonly); \ No newline at end of file +customElements.define("et2-date-time_ro", Et2DateTimeReadonly); \ No newline at end of file