Compare commits

...

10 Commits

Author SHA1 Message Date
Ralf Becker
7571a07fd1 Adding carbon lit components tutorial
https://github.com/carbon-design-system/carbon-web-components#basic-usage
Thought Rollup gives following Babel error:
Error: Could not load /Volumes/htdocs/egw-test/node_modules/carbon-web-components/es/components/dropdown/@babel/runtime/helpers/esm/decorate.js (imported by node_modules/carbon-web-components/es/components/dropdown/dropdown-item.js): ENOENT: no such file or directory, open '/Volumes/htdocs/egw-test/node_modules/carbon-web-components/es/components/dropdown/@babel/runtime/helpers/esm/decorate.js'
2021-07-06 09:53:18 +02:00
nathangray
867b539c18 Make sure nested document actions open in new tab, same as others. 2021-07-06 08:58:45 +02:00
Guy Bedford
ba2ac61546 enable terser source maps 2021-07-06 08:58:45 +02:00
nathangray
18cf49f0f2 Get calendar working with rollup
owner widget was not being loaded
2021-07-06 08:58:45 +02:00
Ralf Becker
08e9798a6d using warning.toString() instead of warning message, giving eg. the file using this, while circular dependencies are displayed the same 2021-07-06 08:58:45 +02:00
Ralf Becker
c67ff8ed4b remove some dead code and spelling fixes 2021-07-06 08:58:45 +02:00
nathangray
188ad39153 Api: Fix missed change in nested document actions
see 186e03671a
2021-07-06 08:58:45 +02:00
nathangray
0786273f0e Api: Get rid of double super constructor call 2021-07-06 08:58:45 +02:00
Ralf Becker
d7bfc54c02 replace eval with Function constructor to quiten rollup warning 2021-07-06 08:58:45 +02:00
Ralf Becker
ded5f95fcc change rollup.config.js to scan for all installed apps, and run rollup as part of install-cli.php automatic 2021-07-06 08:58:45 +02:00
13 changed files with 2351 additions and 564 deletions

View File

@ -4,7 +4,7 @@
* @link http://www.egroupware.org
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @author Ralf Becker <rb@egroupware.org>
* @copyright (c) 2016 by Ralf Becker <rb@egroupware.org>
* @copyright (c) 2016-21 by Ralf Becker <rb@egroupware.org>
*/
/**
@ -16,290 +16,21 @@
* To generate the now existing package.json:
* npm init
* npm install grunt --save-dev
* npm install grunt-terser --save-dev
* npm install grunt-newer --save-dev
* npm install grunt-contrib-cssmin --save-dev
*
* Building happens by running in your EGroupware directory:
*
* grunt # runs uglify and cssmin for all targets with changed files
* or
* grunt [newer:]terser:<target> # targets: api, et2, pixelegg, mobile, mail, calendar, ...
* grunt # runs cssmin for all targets with changed files
* or
* grunt [newer:]cssmin:<target> # targets: pixelegg, jdots
*
* app.js files can be added like mail target or, if you want automatic dependencies,
* you need to add them in egw_framework::$bundle2minurl and egw_framework::get_bundles().
*
* To update files in Gruntfile after adding new js files you need to run:
*
* updateGruntfile.php
*
* Please use only double quotes, as we parse this file as json to update it!
*
* @param {object} grunt
*/
module.exports = function (grunt) {
grunt.initConfig({
terser: {
options: {
mangle: false,
sourceMap: true,
output: {
preamble: "/*!\n * EGroupware (http://www.egroupware.org/) minified Javascript\n *\n * full sources are available under https://github.com/EGroupware/egroupware/\n *\n * build <%= grunt.template.today() %>\n */\n"
}
},
api: {
files: {
"api/js/jsapi.min.js": [
"vendor/bower-asset/jquery/dist/jquery.js",
"api/js/jquery/jquery.noconflict.js",
"vendor/bower-asset/jquery-ui/jquery-ui.js",
"api/js/jsapi/jsapi.js",
"api/js/egw_json.js",
"api/js/jsapi/egw_core.js",
"api/js/jsapi/egw_debug.js",
"api/js/jsapi/egw_preferences.js",
"api/js/jsapi/egw_utils.js",
"api/js/jsapi/egw_ready.js",
"api/js/jsapi/egw_files.js",
"api/js/jsapi/egw_lang.js",
"api/js/jsapi/egw_links.js",
"api/js/jsapi/egw_open.js",
"api/js/jsapi/egw_user.js",
"api/js/jsapi/egw_config.js",
"api/js/jsapi/egw_images.js",
"api/js/jsapi/egw_jsonq.js",
"api/js/jsapi/egw_json.js",
"api/js/jsapi/egw_store.js",
"api/js/jsapi/egw_tooltip.js",
"api/js/jsapi/egw_css.js",
"api/js/jquery/jquery-ui-timepicker-addon.js",
"api/js/jsapi/egw_calendar.js",
"api/js/jsapi/egw_data.js",
"api/js/jsapi/egw_tail.js",
"api/js/jsapi/egw_inheritance.js",
"api/js/jsapi/egw_message.js",
"api/js/jsapi/egw_notification.js",
"api/js/es6-promise.min.js",
"api/js/jsapi/app_base.js",
"api/js/jsapi/egw_app.js",
"api/js/dhtmlxtree/codebase/dhtmlxcommon.js",
"api/js/dhtmlxtree/sources/dhtmlxtree.js",
"api/js/dhtmlxtree/sources/ext/dhtmlxtree_json.js",
"api/js/egw_action/egw_action_common.js",
"api/js/egw_action/egw_action.js",
"api/js/egw_action/egw_keymanager.js",
"api/js/egw_action/egw_menu.js",
"api/js/jquery/jquery-tap-and-hold/jquery.tapandhold.js",
"api/js/egw_action/egw_action_popup.js",
"api/js/egw_action/egw_action_dragdrop.js",
"api/js/egw_action/egw_dragdrop_dhtmlx_tree.js",
"api/js/dhtmlxMenu/sources/dhtmlxmenu.js",
"api/js/dhtmlxMenu/sources/ext/dhtmlxmenu_ext.js",
"api/js/egw_action/egw_menu_dhtmlx.js",
"api/js/jquery/chosen/chosen.jquery.js"
]
}
},
et2: {
files: {
"api/js/etemplate/etemplate2.min.js": [
"api/js/etemplate/et2_core_xml.js",
"api/js/etemplate/et2_core_interfaces.js",
"api/js/etemplate/et2_core_common.js",
"api/js/etemplate/et2_core_inheritance.js",
"api/js/etemplate/et2_core_phpExpressionCompiler.js",
"api/js/etemplate/et2_core_arrayMgr.js",
"api/js/etemplate/et2_core_widget.js",
"api/js/etemplate/et2_core_DOMWidget.js",
"api/js/etemplate/et2_widget_template.js",
"api/js/etemplate/et2_widget_grid.js",
"api/js/etemplate/et2_core_baseWidget.js",
"api/js/etemplate/et2_widget_box.js",
"api/js/etemplate/et2_widget_hbox.js",
"api/js/etemplate/et2_widget_groupbox.js",
"api/js/jquery/splitter.js",
"api/js/etemplate/et2_widget_split.js",
"api/js/etemplate/et2_widget_button.js",
"api/js/etemplate/et2_core_valueWidget.js",
"api/js/etemplate/et2_core_inputWidget.js",
"api/js/etemplate/et2_widget_color.js",
"api/js/jquery/blueimp/js/blueimp-gallery.min.js",
"api/js/etemplate/expose.js",
"api/js/etemplate/et2_widget_description.js",
"api/js/etemplate/et2_widget_entry.js",
"api/js/etemplate/et2_widget_textbox.js",
"api/js/etemplate/et2_widget_number.js",
"api/js/etemplate/et2_widget_password.js",
"api/js/jquery/jquery.base64.js",
"api/js/etemplate/et2_widget_url.js",
"api/js/etemplate/et2_widget_selectbox.js",
"api/js/etemplate/et2_widget_checkbox.js",
"api/js/etemplate/et2_widget_radiobox.js",
"api/js/etemplate/lib/date.js",
"api/js/etemplate/et2_widget_date.js",
"api/js/etemplate/et2_widget_dialog.js",
"vendor/bower-asset/diff2html/dist/diff2html.min.js",
"api/js/etemplate/et2_widget_diff.js",
"api/js/etemplate/et2_widget_dropdown_button.js",
"api/js/etemplate/et2_widget_styles.js",
"api/js/etemplate/et2_widget_link.js",
"api/js/etemplate/et2_widget_selectAccount.js",
"vendor/egroupware/magicsuggest/magicsuggest.js",
"api/js/etemplate/et2_widget_taglist.js",
"api/js/etemplate/et2_extension_customfields.js",
"api/js/etemplate/et2_dataview_view_rowProvider.js",
"api/js/etemplate/et2_extension_nextmatch_rowProvider.js",
"api/js/etemplate/et2_dataview_view_container.js",
"api/js/etemplate/et2_dataview_view_row.js",
"api/js/etemplate/et2_dataview_interfaces.js",
"vendor/bower-asset/jquery-touchswipe/jquery.touchSwipe.js",
"api/js/etemplate/et2_dataview_view_aoi.js",
"api/js/etemplate/et2_dataview_controller_selection.js",
"api/js/etemplate/et2_dataview_view_tile.js",
"api/js/etemplate/et2_dataview_controller.js",
"api/js/etemplate/et2_extension_nextmatch_actions.js",
"api/js/etemplate/et2_extension_nextmatch_controller.js",
"api/js/etemplate/et2_widget_dynheight.js",
"api/js/etemplate/et2_dataview_model_columns.js",
"api/js/etemplate/et2_dataview_view_spacer.js",
"api/js/etemplate/et2_dataview_view_grid.js",
"api/js/etemplate/et2_dataview_view_resizeable.js",
"api/js/etemplate/et2_dataview.js",
"api/js/etemplate/et2_extension_nextmatch.js",
"api/js/etemplate/et2_widget_favorites.js",
"api/js/etemplate/et2_widget_html.js",
"api/js/etemplate/et2_core_editableWidget.js",
"api/js/etemplate/et2_widget_htmlarea.js",
"api/js/etemplate/et2_widget_tabs.js",
"api/js/etemplate/et2_widget_timestamper.js",
"api/js/etemplate/et2_widget_toolbar.js",
"api/js/etemplate/et2_widget_tree.js",
"api/js/etemplate/et2_widget_historylog.js",
"api/js/etemplate/et2_widget_hrule.js",
"vendor/bower-asset/cropper/dist/cropper.min.js",
"api/js/etemplate/et2_widget_image.js",
"api/js/etemplate/et2_widget_iframe.js",
"api/js/Resumable/resumable.js",
"api/js/etemplate/et2_widget_file.js",
"api/js/etemplate/et2_widget_progress.js",
"api/js/etemplate/et2_widget_portlet.js",
"api/js/etemplate/et2_widget_ajaxSelect.js",
"api/js/etemplate/vfsSelectUI.js",
"api/js/etemplate/et2_widget_vfs.js",
"api/js/etemplate/et2_widget_video.js",
"api/js/etemplate/et2_widget_audio.js",
"api/js/jquery/barcode/jquery-barcode.min.js",
"api/js/etemplate/et2_widget_barcode.js",
"api/js/etemplate/et2_extension_itempicker_actions.js",
"api/js/etemplate/et2_widget_itempicker.js",
"api/js/etemplate/et2_widget_script.js",
"api/js/etemplate/et2_widget_countdown.js",
"api/js/etemplate/et2_core_legacyJSFunctions.js",
"api/js/etemplate/etemplate2.js"
]
}
},
mail: {
files: {
"mail/js/app.min.js": [
"mail/js/app.js"
]
}
},
calendar: {
files: {
"calendar/js/app.min.js": [
"calendar/js/View.js",
"calendar/js/et2_widget_owner.js",
"calendar/js/et2_widget_view.js",
"calendar/js/et2_widget_timegrid.js",
"calendar/js/et2_widget_event.js",
"calendar/js/et2_widget_daycol.js",
"calendar/js/et2_widget_planner_row.js",
"calendar/js/et2_widget_planner.js",
"calendar/js/app.js"
]
}
},
jdots: {
files: {
"jdots/js/fw_jdots.min.js": [
"api/js/framework/fw_base.js",
"api/js/framework/fw_browser.js",
"api/js/jquery/mousewheel/mousewheel.js",
"api/js/framework/fw_ui.js",
"api/js/framework/fw_classes.js",
"api/js/framework/fw_desktop.js",
"jdots/js/fw_jdots.js"
]
}
},
mobile: {
files: {
"pixelegg/js/fw_mobile.min.js": [
"vendor/bower-asset/fastclick/lib/fastclick.js",
"api/js/framework/fw_base.js",
"api/js/framework/fw_browser.js",
"api/js/jquery/mousewheel/mousewheel.js",
"api/js/framework/fw_ui.js",
"api/js/framework/fw_classes.js",
"pixelegg/js/fw_mobile.js"
]
}
},
notifications: {
files: {
"notifications/js/notificationajaxpopup.min.js": [
"notifications/js/notificationajaxpopup.js"
]
}
},
pixelegg: {
files: {
"pixelegg/js/fw_pixelegg.min.js": [
"api/js/framework/fw_base.js",
"api/js/framework/fw_browser.js",
"api/js/jquery/mousewheel/mousewheel.js",
"api/js/framework/fw_ui.js",
"api/js/framework/fw_classes.js",
"api/js/framework/fw_desktop.js",
"pixelegg/js/slider.js",
"pixelegg/js/fw_pixelegg.js"
]
}
},
projectmanager: {
files: {
"projectmanager/js/app.min.js": [
"vendor/npm-asset/dhtmlx-gantt/codebase/dhtmlxgantt.js",
"vendor/npm-asset/dhtmlx-gantt/codebase/ext/dhtmlxgantt_marker.js",
"projectmanager/js/et2_widget_gantt.js",
"projectmanager/js/app.js"
]
}
},
smallpart: {
files: {
"smallpart/js/app.min.js": [
"smallpart/js/et2_widget_videobar.js",
"smallpart/js/et2_videooverlay_interface.js",
"smallpart/js/overlay_plugins/et2_smallpart_overlay_html.js",
"smallpart/js/overlay_plugins/et2_smallpart_question_multiplechoice.js",
"smallpart/js/overlay_plugins/et2_smallpart_question_singlechoice.js",
"smallpart/js/overlay_plugins/et2_smallpart_question_text.js",
"smallpart/js/et2_widget_videooverlay.js",
"smallpart/js/et2_widget_videooverlay_slider_controller.js",
"smallpart/js/et2_widget_videotime.js",
"smallpart/js/et2_widget_comment.js",
"smallpart/js/et2_widget_color_radiobox.js",
"smallpart/js/et2_widget_filter_participants.js",
"smallpart/js/app.js"
]
}
}
},
cssmin: {
options: {
shorthandCompacting: false,
@ -474,9 +205,6 @@ module.exports = function (grunt) {
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks("grunt-terser");
// Load plugin for css minificaton
grunt.loadNpmTasks("grunt-contrib-cssmin");

View File

@ -15,7 +15,7 @@
import {et2_createWidget, et2_register_widget, WidgetConfig} from "./et2_core_widget";
import {et2_valueWidget} from "./et2_core_valueWidget";
import {ClassWithAttributes} from "./et2_core_inheritance";
import {et2_no_init} from "./et2_core_common";
import {et2_cloneObject, et2_no_init} from "./et2_core_common";
/**
* A widget to display a value from an entry
@ -94,7 +94,12 @@ export class et2_entry extends et2_valueWidget
}
let value = _attrs.value;
super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_entry._attributes, _child || {}));
// Add all attributes hidden in the content arrays to the attributes
// parameter
this.transformAttributes(_attrs);
// Create a local copy of the options object
this.options = et2_cloneObject(_attrs);
// Save value from parsing, but only if set
if(value)

View File

@ -292,7 +292,7 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd)
var url = _link;
if (url.indexOf('javascript:') == 0)
{
eval(url.substr(11));
(new Function(url.substr(11)))();
return;
}
if (url.indexOf('mailto:') == 0)

View File

@ -26,11 +26,11 @@ use setup_cmd_ldap;
/**
* LDAP Backend for accounts
*
* The LDAP backend of the accounts class now stores accounts, groups and the memberships completly in LDAP.
* The LDAP backend of the accounts class now stores accounts, groups and the memberships completely in LDAP.
* It does NO longer use the ACL class/table for group membership information.
* Nor does it use the phpgwAcounts schema (part of that information is stored via shadowAccount now).
*
* A user is recogniced by eGW, if he's in the user_context tree AND has the posixAccount object class AND
* A user is recognised by eGW, if he's in the user_context tree AND has the posixAccount object class AND
* matches the LDAP search filter specified in setup >> configuration.
* A group is recogniced by eGW, if it's in the group_context tree AND has the posixGroup object class.
* The group members are stored as memberuid's.
@ -153,17 +153,13 @@ class Ldap
{
$this->frontend = $frontend;
// enable the caching in the session, done by the accounts class extending this class.
$this->use_session_cache = true;
$this->ldap = Api\Ldap::factory(false, $this->frontend->config['ldap_host'],
$this->frontend->config['ldap_root_dn'],$this->frontend->config['ldap_root_pw']);
$this->ds = $this->ldap->ds;
$this->user_context = $this->frontend->config['ldap_context'];
$this->account_filter = $this->frontend->config['ldap_search_filter'];
$this->group_context = $this->frontend->config['ldap_group_context'] ?
$this->frontend->config['ldap_group_context'] : $this->frontend->config['ldap_context'];
$this->group_context = $this->frontend->config['ldap_group_context'] ?: $this->frontend->config['ldap_context'];
}
/**
@ -203,7 +199,7 @@ class Ldap
$this->ldapServerInfo = $this->ldap->getLDAPServerInfo($this->frontend->config['ldap_host']);
}
// common code for users and groups
// checks if accout_lid (dn) has been changed or required objectclass'es are missing
// checks if account_lid (dn) has been changed or required objectclass'es are missing
if ($data_utf8['account_id'] && $data_utf8['account_lid'])
{
// read the entry first, to check if the dn (account_lid) has changed
@ -741,7 +737,7 @@ class Ldap
if ($param['type'] != 'both')
{
// folw:
// follow:
// - first query only few attributes for sorting and throwing away not needed results
// - throw away & sort
// - fetch relevant accounts with full information
@ -766,7 +762,6 @@ class Ldap
if (is_numeric($param['type'])) // return only group-members
{
$relevantAccounts = array();
$sri = ldap_search($this->ds,$this->group_context,"(&(objectClass=posixGroup)(gidnumber=" . abs($param['type']) . "))",array('memberuid'));
$group = ldap_get_entries($this->ds, $sri);
$fullSet = $group[0]['memberuid'] ? array_intersect_key($fullSet, array_flip($group[0]['memberuid'])) : array();

View File

@ -2137,6 +2137,13 @@ abstract class Merge
}
foreach($files as $file)
{
$edit_attributes = array(
'menuaction' => $GLOBALS['egw_info']['flags']['currentapp'].'.'.get_called_class().'.merge_entries',
'document' => $file['path'],
'merge' => get_called_class(),
'id' => '$id',
'select_all' => '$select_all'
);
if (count($dircount) > 1)
{
$name_arr = explode('/', $file['name']);
@ -2158,7 +2165,9 @@ abstract class Merge
'icon' => Api\Vfs::mime_icon($file['mime']),
'caption' => Api\Vfs::decodePath($name_arr[$count]),
'group' => 2,
'postSubmit' => true, // download needs post submit (not Ajax) to work
'postSubmit' => true, // download needs post submit (not Ajax) to work,
'target' => '_blank',
'url' => urldecode(http_build_query($edit_attributes))
);
if ($file['mime'] == 'message/rfc822')
{
@ -2197,13 +2206,6 @@ abstract class Merge
'target' => '_blank',
'postSubmit' => true, // download needs post submit (not Ajax) to work
);
$edit_attributes = array(
'menuaction' => $GLOBALS['egw_info']['flags']['currentapp'].'.'.get_called_class().'.merge_entries',
'document' => $file['path'],
'merge' => get_called_class(),
'id' => '$id',
'select_all' => '$select_all'
);
$documents[$file['mime']]['children'][$prefix.$file['name']]['url'] = urldecode(http_build_query($edit_attributes));
if ($file['mime'] == 'message/rfc822')
{
@ -2218,14 +2220,6 @@ abstract class Merge
'group' => 2,
'target' => '_blank'
);
$edit_attributes = array(
'menuaction' => $GLOBALS['egw_info']['flags']['currentapp'].'.'.get_called_class().'.merge_entries',
'document' => $file['path'],
'merge' => get_called_class(),
'id' => '$id',
'select_all' => '$select_all'
);
$documents[$prefix.$file['name']]['url'] = urldecode(http_build_query($edit_attributes));
if ($file['mime'] == 'message/rfc822')
{

View File

@ -24,6 +24,7 @@ import {EgwApp, PushData} from "../../api/js/jsapi/egw_app";
import {etemplate2} from "../../api/js/etemplate/etemplate2";
import {et2_container} from "../../api/js/etemplate/et2_core_baseWidget";
import {et2_date} from "../../api/js/etemplate/et2_widget_date";
import {et2_calendar_owner} from "./et2_widget_owner";
import {day, day4, listview, month, planner, week, weekN} from "./View";
import {et2_calendar_view} from "./et2_widget_view";
import {et2_calendar_timegrid} from "./et2_widget_timegrid";
@ -43,17 +44,8 @@ import {date} from "../../api/js/etemplate/lib/date.js";
import {sprintf} from "../../api/js/egw_action/egw_action_common.js";
import {egw_registerGlobalShortcut} from "../../api/js/egw_action/egw_keymanager.js";
// et2 widgets need to be imported, so they register themselves
import "./et2_widget_daycol";
import "./et2_widget_event";
import "./et2_widget_owner";
import "./et2_widget_planner";
import "./et2_widget_planner_row";
import "./et2_widget_timegrid";
import "./et2_widget_view";
import {egw, egw_getFramework, framework} from "../../api/js/jsapi/egw_global";
import {et2_number} from "../../api/js/etemplate/et2_widget_number";
import {et2_calendar_owner} from "./et2_widget_owner";
import {et2_template} from "../../api/js/etemplate/et2_widget_template";
import {et2_checkbox} from "../../api/js/etemplate/et2_widget_checkbox";
import {et2_grid} from "../../api/js/etemplate/et2_widget_grid";
@ -264,6 +256,9 @@ export class CalendarApp extends EgwApp
var sidebox = jQuery('#favorite_sidebox_'+this.appname);
if(sidebox.length == 0 && egw_getFramework() != null)
{
// Force rollup to load owner widget, it leaves it out otherwise
new et2_calendar_owner(_et2.widgetContainer,{});
var egw_fw = egw_getFramework();
sidebox= jQuery('#favorite_sidebox_'+this.appname,egw_fw.sidemenuDiv);
}

View File

@ -8,11 +8,6 @@
* @author Nathan Gray
*/
/*egw:uses
et2_widget_taglist;
*/
import {et2_register_widget} from "../../api/js/etemplate/et2_core_widget";
import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
import {et2_taglist_email} from "../../api/js/etemplate/et2_widget_taglist";

View File

@ -275,12 +275,14 @@ foreach(scandir(__DIR__) as $dir)
$cmd = $composer.' install '.implode(' ', $composer_args);
run_cmd($cmd, 'composer');
// update npm dependencies and run grunt to minify javascript and css
// update npm dependencies, run grunt to minify css and rollup to build javascript
if ($npm && $grunt)
{
run_cmd($npm.' install', 'npm');
run_cmd($npm.' install', 'npm install');
run_cmd($grunt, 'grunt');
run_cmd($npm .' run build', 'rollup (npm run build)');
}
echo "\n$succieded tasks successful run".

47
lit/index.html Normal file
View File

@ -0,0 +1,47 @@
<!--
@license
Copyright IBM Corp. 2019
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->
<html>
<head>
<title>carbon-web-components example</title>
<meta charset="UTF-8" />
<style type="text/css">
body {
font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
}
#app {
width: 300px;
}
bx-dropdown,
bx-dropdown-item {
visibility: hidden;
}
bx-dropdown:defined,
bx-dropdown-item:defined {
visibility: inherit;
}
</style>
</head>
<body>
<h1>Hello World! 👋</h1>
<div id="app">
<bx-dropdown trigger-content="Select an item">
<bx-dropdown-item value="all">Option 1</bx-dropdown-item>
<bx-dropdown-item value="cloudFoundry">Option 2</bx-dropdown-item>
<bx-dropdown-item value="staging">Option 3</bx-dropdown-item>
<bx-dropdown-item value="dea">Option 4</bx-dropdown-item>
<bx-dropdown-item value="router">Option 5</bx-dropdown-item>
</bx-dropdown>
</div>
<script type="module" src="js/app.min.js"></script>
</body>
</html>

11
lit/js/app.js Normal file
View File

@ -0,0 +1,11 @@
/**
* @license
*
* Copyright IBM Corp. 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import 'carbon-web-components/es/components/dropdown/dropdown.js';
import 'carbon-web-components/es/components/dropdown/dropdown-item.js';

2421
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@
"@babel/core": "^7.14.6",
"@babel/preset-typescript": "^7.14.5",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-typescript": "^8.2.1",
"@types/jquery": "^3.5.5",
"@types/jqueryui": "^1.12.14",
@ -42,5 +43,11 @@
"egw": true,
"app": true
}
},
"dependencies": {
"carbon-components": "^10.37.0",
"carbon-web-components": "^1.14.1",
"lit-element": "^2.5.1",
"lit-html": "^1.4.1"
}
}

View File

@ -14,6 +14,8 @@ import babel from '@babel/core';
import { readFileSync } from "fs";
import rimraf from 'rimraf';
import { minify } from 'terser';
import { readdir,stat } from 'fs/promises';
import resolve from '@rollup/plugin-node-resolve';
// Best practice: use this
//rimraf.sync('./dist/');
@ -22,7 +24,7 @@ rimraf.sync('./chunks/');
// Turn on minification
const do_minify = false;
export default {
const config = {
treeshake: false,
input: {
// Output : Input
@ -32,35 +34,8 @@ export default {
"api/js/etemplate/etemplate2.min":"api/js/etemplate/etemplate2.ts",
"api/js/egw_action/egw_dragdrop_dhtmlx_tree.min":"api/js/egw_action/egw_dragdrop_dhtmlx_tree.js",
"api/js/jsapi/egw.min": "api/js/jsapi/egw_modules.js",
"api/js/jsapi.min": 'api/js/jsapi/jsapi.js',
// Should be just built-in apps, but until rollup supports multi-level we need them all
"addressbook/js/app": "addressbook/js/app.ts",
"admin/js/app": "admin/js/app.ts",
"bookmarks/js/app": "bookmarks/js/app.ts",
"calendar/js/app" : "calendar/js/app.ts",
"collabora/js/app": "collabora/js/app.ts",
"filemanager/js/app": "filemanager/js/app.ts",
//"home/js/app": "home/js/app.js",
"importexport/js/app": "importexport/js/app.ts",
"infolog/js/app": "infolog/js/app.ts",
"mail/js/app.min": "mail/js/app.js",
"news_admin/js/app": "news_admin/js/app.ts",
"notifications/js/notificationajaxpopup.min": "notifications/js/notificationajaxpopup.js",
"preferences/js/app": "preferences/js/app.ts",
"projectmanager/js/app": "projectmanager/js/app.ts",
"resources/js/app": "resources/js/app.ts",
"rocketchat/js/app.min": "rocketchat/js/app.js",
"smallpart/js/app": "smallpart/js/app.ts",
"status/js/app": "status/js/app.ts",
"timesheet/js/app": "timesheet/js/app.ts",
"tracker/js/app": "tracker/js/app.ts",
// EPL
"esyncpro/js/app": "esyncpro/js/app.ts",
"kanban/js/app": "kanban/js/app.ts",
"policy/js/app": "policy/js/app.ts",
"stylite/js/app": "stylite/js/app.ts",
"webauthn/js/app": "webauthn/js/app.ts",
// app.ts/js are added automatic by addAppsConfig() below
},
external: function(id,parentId,isResolved) {
if(!isResolved)
@ -107,7 +82,10 @@ export default {
return tsPath;
}
}
}, {
},
// resolve (external) node modules from node_modules directory
resolve(),
{
transform (code, id) {
if (id.endsWith('.ts'))
return new Promise((resolve, reject) => {
@ -138,9 +116,10 @@ export default {
}
return minify(code, {
mangle: false,
sourceMap: true,
output: {
preamble: `/*!
* EGroupware (http://www.egroupware.org/) minified Javascript
* EGroupware (https://www.egroupware.org/) minified Javascript
*
* full sources are available under https://github.com/EGroupware/egroupware/
*
@ -151,11 +130,39 @@ export default {
});
}
}],
// Custom warning handler to give more information about circular dependencies
onwarn: function(warning,warn) {
console.warn(warning);
console.warn(warning.toString());
}
};
};
/**
* Add existing app.ts/js endpoints to config.input and return it
*
* @return Promise<object>
*/
export default async function addAppsConfig()
{
const conf = config;
const files = await readdir('.', { withFileTypes: true});
for (const file of files)
{
if (file.isDirectory())
{
try {
await stat(file.name + '/js/app.ts');
config.input[file.name + '/js/app'] = file.name + '/js/app.ts';
}
catch (e) {
try {
await stat(file.name + '/js/app.js');
config.input[file.name + '/js/app.min'] = file.name + '/js/app.js';
}
catch (e) {
}
}
}
}
return conf;
}