Commit Graph

123 Commits

Author SHA1 Message Date
ralf
bec95a4a9d et2-select-tab widget to fix common preferences not storing and some fixes 2022-07-19 15:17:43 +02:00
nathan
ddd72fd51a Et2Select: Fix selects with static options from the server would not consistently keep any additional options set.
Creation / lifecycle would sometimes set the extra options several times, and depending on the timing of the server response they might get overwritten, or overwrite the server options.  Now keeping them separate to avoid this.
2022-07-15 12:56:24 -06:00
nathan
523c785049 Et2Select: Fix manual message was repeated for each selected value. Once is enough. 2022-07-14 11:33:35 -06:00
nathan
2c08542529 Better handling of select validation 2022-07-12 16:40:38 -06:00
nathan
e8e3d2fc38 Et2Select layout improvements
- Better sizing when row is set
- Always show contact / + for EmailTag instead of just on hover
2022-07-12 10:50:11 -06:00
nathan
ad82ea8faf Et2Select layout improvements
- Added RowLimitedMixin to limit rows
- when multiple=true tags take full width by default, but intelligently resize
- No longer showing search icon
- Move Et2EmailTag add / CRM button to left of remove button
2022-07-11 17:27:17 -06:00
nathan
0ca7508cd3 Select bugfixes
- If value is changed because it's not a valid option, that might need a refresh
- If empty_label is changed, we need to update that
2022-07-11 11:01:42 -06:00
nathan
ed16ce52a2 Change nextmatch headers to use web components 2022-07-07 13:18:42 -06:00
nathan
46b172c88e Et2Select: In some cases the change event from the search input was triggering an extra widget change event 2022-07-06 11:22:10 -06:00
ralf
489eb615ac fix validation in et2-select had problems with value being an array
eg. mail.compose always displayed "Invalid email"
running validator now for each array element or "" for an empty array
2022-07-06 10:33:06 +02:00
nathan
31e476089c Et2Select: Fix missing initial value when initial value is not in select_options
Our custom setter was not being called for some reason so option cleaning was not being done.
2022-07-04 15:09:16 -06:00
nathan
36c6df9685 Remove InvokerMixin from Et2Select, we cover the functionality in other ways.
InvokerMixin still used in other widgets
2022-06-30 09:39:22 -06:00
nathan
7c7b81201f Implement missing validation error for Et2Select 2022-06-29 11:49:24 -06:00
nathan
0f5cb9f9d3 Select styling improvements
- support for Shoelace's size property
- relative sizing for EmailTag's add icon height
2022-06-24 14:12:04 -06:00
nathan
d11be10fa1 Et2SelectEmail: Add button on hover to add a new contact with the email
(multiple)
2022-06-24 12:10:10 -06:00
nathan
9ca78de12f Et2Select: Fix empty label was not being shown for invalid values 2022-06-23 15:56:28 -06:00
nathan
9b3de5db95 Et2SelectCountry: Use CSS for flag images 2022-06-22 16:13:58 -06:00
nathan
d9400430e5 Mail: Use et2-select-email for displaying addresses in preview 2022-06-21 16:34:57 -06:00
nathan
e44ca6183a Promote select category to its own file 2022-06-20 09:35:38 -06:00
ralf
8228104b82 add extra parameter return_promise to StaticOptions.cached_server_side and using that for Et2SelectCountry to add flags and their css class 2022-06-20 17:01:28 +02:00
ralf
96109e0f26 Several account or contact edit fixes
- fix no groups were selected (as they have numeric values)
- fix size of country and state selection
- WIP adding flags to select-country
- WIP fixing selecting a country set country_code for state selection
2022-06-18 15:06:50 +02:00
nathan
fdd6f23560 Better readonly styling 2022-06-17 14:06:12 -06:00
nathan
cfce00f7ea Et2Select: Deal with initial value of multiple set as CSV 2022-06-17 11:41:29 -06:00
nathan
f2c57c5e75 Et2Select: Fix search icon appearing everywhere 2022-06-17 08:53:15 -06:00
nathan
851a054599 Select / Search bugs:
- search result would only be shown once even if next search included it
- selected values disappear when starting a new search
- loading spinner was not shown
2022-06-16 11:05:13 -06:00
nathan
260d8f523a Get category icons & colors working for select category
Also some refactoring of things to where they should be
2022-06-15 16:43:39 -06:00
nathan
67b9102a69 Et2Select: Allow dropdown option list to be wider than the field 2022-06-14 15:14:17 -06:00
nathan
1215626473 Select / Search CSS:
- Promote image styling from Et2LinkAppSelect to all Selects
- fix double scrollbar if there are a lot of options
- different cursor for editable tags
- align +# right to make it stand out a little more
2022-06-10 14:11:57 -06:00
nathan
cf151afff8 Clean up some TypeScript type issues
Putting the constructor type fixes some complaints about our widgets not being LitElements
2022-06-10 10:25:31 -06:00
ralf
d98978ddd3 fix current user in timesheet not selected (was a numeric value) and empty_label not used, if no matching option for the value 2022-06-10 13:07:27 +02:00
nathan
b7258692a4 Et2Select: Fix double change event
Caused double submit (which failed) in infolog when you changed type
2022-06-08 14:01:00 -06:00
nathan
94d534d897 Et2Select bugs:
- multiple always had the first option selected
- removing multiple options did not trigger change event
2022-06-06 16:41:29 -06:00
nathan
796c0a33df Et2SelectCat: Add in category colors & icons 2022-06-06 16:09:08 -06:00
nathan
e9d3db9b6d Et2Select: Add missing support for options on static type options (number, percent) 2022-06-03 10:19:05 -06:00
nathan
23f9015331 Fix Et2Select / Et2LinkEntry clear button did nothing
Automatic select first entry was re-setting the value after clearing
2022-06-02 09:59:08 -06:00
ralf
a720a7f48a remove unnecessary getValue() 2022-06-02 16:31:27 +02:00
ralf
a9e180a9fb fix mixup of this.value, Lion this.modelValue and old get/set_value
causing eg. numeric values not to be cast to string and therefore not selecting their option
2022-06-02 16:12:38 +02:00
nathan
2b68b6cbbe Work on LinkEntry
- fix missing app select
- add clear button
- use request() instead of json() to query server
- add optional class property to SelectOption
- move cleaning select options to its own function so we can use it anywhere
- Use separate render to keep local / remote options separate.  Local options stay in select_options.
2022-06-01 09:25:11 -06:00
nathan
bc045bf0da Add SearchMixin
A little clunky and still missing server-side
2022-05-30 17:05:38 -06:00
ralf
0b547c921d fix error for typeof this.value !== 'string', eg. number, undefined, ... 2022-05-29 09:53:41 +02:00
nathan
7f1cd117a7 Fix select change event not firing, initial value not showing 2022-05-27 15:39:51 -06:00
nathan
c212734618 Switch Et2Select to be based on Shoelace select instead of LionSelect 2022-05-27 14:12:31 -06:00
nathan
4f17302bb1 CSS / Layout cleanup - better autosize
- More consistent sizing/position for invoker
2022-04-22 15:22:31 -06:00
nathan
f8f04071be CSS / Layout cleanup
- Remove margin from input,button,select
- Fix some spacing issues
- Switch selects from display:inline-block to display:block so they take up all parent's space
- Let background (required) color show through select tag
- Some layout tweaks on mail account template
2022-04-22 13:07:22 -06:00
nathan
0c8824c496 Fix addressbook contact type filter was sometimes 'D' after being initialized to 'n'
When nextmatch moved the template in the DOM, we were re-adding already existing options which re-set the value.
2022-04-01 11:12:19 -06:00
ralf
a45d26511b fix not set invoker for expand_multiple_rows attribute 2022-03-18 22:26:15 +02:00
ralf
b9cca9c5ff using set/get select_option plus a set_selection_options marked as deprecated
- get_select_options seems to be nowhere in use, so I did not implement it
- Et2Select* widgets with static options assign them in their constructor (like the r/o ones)
- removed a jQuery.proxy call, which we dont want in new code
2022-03-16 22:36:43 +02:00
ralf
7a749a8f54 fix instead of all only last option was selected sometimes
because multiple property was not yet synced to DOM node
2022-03-15 11:43:55 +02:00
ralf
293e9f2fc6 Implement multi-select value as string[] or comma-separated
Had to overwrite some formMixin methods, which considered everything not string as invalid and set/get value to do the right thing for multi-select
Not sure if code should go to Et2WidgetWithSelectMixing to be shared with TagList ...
2022-03-14 21:13:47 +02:00
ralf
940e1b12c1 Implement expand_multiple_rows attribute for Et2Select using Et2InvokerMixin 2022-03-12 14:49:25 +02:00
ralf
9285b87a92 implement multiple attribute for et2-select reflecting it to selectbox
fixing TypeError set_multiple is not a function
2022-03-10 15:48:27 +02:00
nathan
aff71549a2 Move some code out of Et2Select into parent mixin for better re-use
Any child that has selectbox type functionality (extends Et2WidgetWithSelectMixin) needs to implement:
- _optionTargetNode() : HTMLElement
- _optionTemplate(option : SelectOption) : TemplateResult
2022-03-03 10:38:56 -07:00
ralf
5ff96e7818 fix last option select instead of empty label or any other option
eg. "shared by me" in Addressbook instead of "All contacts"
caused by this._inputNode not available when set_value was called
2022-03-01 18:29:13 +02:00
ralf
36e3bd5de0 fix typo modalValue instead of modelValue to get validation (required) working
Had to overwrite formatter as it gave an error for accessing not yet set _inputNode
2022-03-01 16:51:40 +02:00
Hadi Nategh
2d6770ebfa Fix missing Et2WidgetWithSelect class 2022-03-01 13:31:13 +01:00
Hadi Nategh
08549e25da Make Et2WidgetWithSelect a Dedup Mixin in order to make it available cross widgets 2022-03-01 12:35:33 +01:00
ralf
9260f25476 fist option with value of 0 was not selected 2022-02-28 17:42:57 +02:00
ralf
eff1f10484 fix sometimes first non-empty label used for empty value
seems update got triggered before empty_label was set
2022-02-28 15:21:23 +02:00
ralf
e567a0d465 fix et2-select use first option, not just empty_lable, if value is not in options 2022-02-28 14:11:57 +02:00
nathan
f0455b2ad2 Show empty_label when given a value that is not in the list of options 2022-02-23 13:13:14 -07:00
ralf
c2166c5750 fix select-boxes submit their old value, if they are onchange="1"
@Nathan: Not sure if this is the right fix, but I can't see where we use Lit's FormatMixing, which defines serializedValue (and therefore select-box always returns the old modalValue)
2022-02-21 20:58:56 +02:00
nathan
9079f97d7e Fix selectbox values were not set.
Paying more attention to the WebComponent life cycle here, rather than what our widgets do - connectedCallback(), requestUpdate(), updated() are more important than loadFromXML(), etc. which are only used when loading from the .xet the first time.
2022-02-18 12:02:27 -07:00
nathan
be4633c9fa Implement et2-date-duration 2022-02-16 16:45:40 -07:00
nathan
3ba1fe1416 Fix action pushed infolog edit dialog really wide 2022-02-15 14:01:07 -07:00
nathan
b91f66c629 Add some cleanup to find_select_options() make sure we're returning nice arrays instead of objects 2022-02-03 14:45:14 -07:00
nathan
e07220392d Select widgets with static options as WebComponents 2022-01-17 15:13:50 -07:00
nathan
09cbc44e67 Get cached server-side options working for webcomponent 2022-01-14 09:29:59 -07:00
nathan
20c82b6d72 Starting on selectboxes with static options.
Not entirely sure this is the way to go, but at least we don't have to
 1. copy the options
 2. inherit the whole editable object for a readonly
2022-01-13 15:28:52 -07:00
nathan
fd7e7e2828 Basic tests for Et2Select, & fixes for bugs they revealed 2022-01-07 14:13:38 -07:00
nathan
57860e03db Get onchange working (for select widget) 2022-01-06 16:22:55 -07:00
nathan
a48e6cf1d3 - Add cssImage() to help with putting our images into LitElement CSS blocks
- Some code cleanup
2022-01-05 10:21:18 -07:00
nathan
85f753324d Remove unused import 2022-01-05 08:07:01 -07:00
nathan
f8ab5c521e Selectbox webcomponent 2022-01-04 15:38:10 -07:00