Commit Graph

95 Commits

Author SHA1 Message Date
Martin Raifer
53f77fb852 accept raw number input also for roadspeed/roadheight fields 2023-05-26 19:34:32 +02:00
Martin Raifer
2b64d70352 generalize implementation to skip input value update
when contents are "equivalent" in a given context, e.g. for numeric values with potentially different formatting in number fields
2023-05-26 19:24:10 +02:00
Martin Raifer
e0f11af2b2 also allow "raw" numbers to be input in numeric fields
when a user enters a decimal number using the "international"/English/OSM-raw-data formatting (e.g. as in `0.5`), it is parsed using the basic, non-localized, number parser. In such cases, the content of the input field should not be overwritten with the localized formatting, as that would cause unexpected glitches and make editing harder (e.g. when thousands-grouping characters seemingly "magically" disappear or appear while typing).

see https://github.com/openstreetmap/iD/pull/8769/#pullrequestreview-1324246437 ff.
2023-05-26 18:38:16 +02:00
Martin Raifer
b266ec57ad treat "empty" numbers in semicolon separated "list" as invalid 2023-05-26 15:00:10 +02:00
Martin Raifer
6d01c05f76 allow numbers to be input in "raw" format 2023-05-26 13:44:50 +02:00
Martin Raifer
249771d747 fix variable declarations 2023-05-26 13:25:59 +02:00
Martin Raifer
6c362b6517 Merge branch 'develop' into 1ec5-number-field-format-3615 2023-05-26 13:06:09 +02:00
Martin Raifer
559a4ba728 support input fields with multiple tag keys
requires upstream changes from tagging-schema v6.3, see https://github.com/openstreetmap/id-tagging-schema/issues/905
2023-05-23 15:22:58 +02:00
archpdx
e466ad4bf8 Update dependencies country-coder and location-conflation (#9546) 2023-03-30 12:53:38 +02:00
Minh Nguyễn
ab442b76ac Preserve precision in raw tags 2023-03-04 23:43:40 -08:00
Minh Nguyễn
023907f9e2 Fixed incrementing/decrementing formatted numbers
The float formatter function now takes a number of fraction digits to return.
2023-03-04 18:36:06 -08:00
Minh Nguyễn
74fdf17477 More minor corrections from code review 2023-03-03 22:42:14 -08:00
Minh Nguyễn
9817894752 Apply suggestions from code review
Co-authored-by: Martin Raifer <martin@raifer.tech>
2023-03-03 22:42:14 -08:00
Minh Nguyễn
2ba7177080 Polyfill inadequate Intl support
Ensure that formatting is balanced with parsing to avoid truncating numbers.
2023-03-03 22:42:14 -08:00
Minh Nguyễn
252828bb4b Localize numbers in numeric fields 2023-03-03 22:42:14 -08:00
Martin Raifer
fc5b78ba0a show 'set to today' button also on 'survey:date' field 2023-01-27 17:10:02 +01:00
Martin Raifer
3238d3439c fix linter issues 2023-01-27 17:05:43 +01:00
Martin Raifer
adcbdae6e8 implement date field, for #9477 2023-01-27 17:03:28 +01:00
Martin Raifer
f931d447af add length indicator to regular text (and localized) fields 2022-11-25 18:10:14 +01:00
Martin Raifer
f573c374c2 number field: improve +/- buttons
* Clamp degree values in `direction` fields between 0 and 359 degrees, fixes #9386
* Only match cardinal values to numbers in `direction` fields
* Disable increment/decrement buttons on number fields if the input value is not numeric or when there is a multi-selection with conflicting values
* Fix/implement reverse operation for semicolon delimited `direction` values
2022-11-24 15:16:49 +01:00
Martin Raifer
501011ef4d use colour field type instead of relying on the tag key
see #9320
2022-11-08 13:16:08 +01:00
Kyℓe Hensel
2bf92b42b9 fix the phone input field showing the wrong placeholder (#9316) 2022-11-01 18:56:48 +01:00
Martin Raifer
cb1202883f fix export 2022-10-18 13:58:38 +02:00
Martin Raifer
b2b6cb5c19 add support for field type colour
see https://github.com/ideditor/schema-builder/pull/38
2022-10-18 11:56:05 +02:00
Kyℓe Hensel
81f3b0666c support incrementing cardinal directions with the 🔼/🔽 buttons (#9141) 2022-07-15 16:48:47 +02:00
Martin Raifer
cc6f16d480 Merge branch 'develop' into accessible_ui 2021-12-07 16:22:01 +01:00
Martin Raifer
250763882d fix code lint issues 2021-12-02 18:46:14 +01:00
Martin Raifer
a3e65e553b Merge branch 'colour-preview' into develop 2021-12-01 12:16:42 +01:00
Martin Raifer
e4008b4229 show native colour picker when clicking on colour preview
further tweaks:
* hide the box on invalid colours
* only affect field with a tag key that included "colour" separated by ":"
2021-12-01 12:11:13 +01:00
Martin Raifer
7015fae91c only allow to click on valid website URLs
closes #8827
2021-11-30 15:30:02 +01:00
Milos Brzakovic (E-Search)
03fed63668 increment - decrement 2021-11-26 16:10:20 +01:00
Kyle Hensel
3a3d977f7e add preview for colour input 2021-11-04 15:05:23 +13:00
Minh Nguyễn
5f58b533ff Added roadheight field with unit dropdowns 2021-10-25 17:38:41 -07:00
Kyle Hensel
416c1af372 add link button next to website tag 2021-08-19 15:17:45 +12:00
Bryan Housel
96298f2836 Preserve name value if this preset shows brand or operator field
This also fixes the logic for calculating whether the preset shows a
`brand` or `operator` field - it needs to use `fields()` to actually
resolve the fields, as these fields can be inherited from another preset.

This also includes a change to match "primary" names before
"alternate" names (aka the "Baby Gap" / "Gap" problem)
2021-01-19 13:15:16 -05:00
Bryan Housel
4228b65602 Support more *:wikidata tags for field locking and pin styling 2021-01-18 17:18:37 -05:00
Quincy Morgan
cb7f1c2b3c Update to id-tagging-schema v3.0.0
Add UI for translatable combo fields
2020-12-08 15:23:51 -05:00
Quincy Morgan
0f716e93f8 Merge branch 'develop' into d3-6 2020-10-13 13:38:09 -04:00
Quincy Morgan
c214a6c6e2 Add increment property for numeric fields (close #7867) 2020-10-13 12:00:01 -04:00
Quincy Morgan
21a49bbec8 Initial support for D3 v6.2.0 2020-10-06 15:08:39 -04:00
Quincy Morgan
58014ace62 Don't prevent default tabbing to elements (re: #8004) 2020-09-17 12:07:20 -04:00
Quincy Morgan
5f93da5a59 Add a reusable function for calculating the combined extent of multiple entities (re: #7706) 2020-06-16 13:17:43 -04:00
Quincy Morgan
4467c4a501 Fix issue where spaces couldn't be typed in the changeset comment (re: #6817) 2020-06-11 10:52:58 -04:00
Quincy Morgan
874c412b74 Enforce max unicode charachter length of keys, values, and relation roles through truncation upon input rather than HTML maxlength attribute (close #6817)
Normalize unicode when changing keys, values, and relation roles
2020-06-10 14:11:55 -04:00
Quincy Morgan
b3ece74807 Fix issue where the telephone field placeholders weren't localized 2020-05-29 10:57:17 -04:00
Quincy Morgan
60f7dc7c0b Replace presets property of context with singleton
Remove utilPreset
2020-04-01 13:08:45 -07:00
Quincy Morgan
a1af118f0e Ensure locales and presets are loaded before the UI loads (close #7406)
Consolidate localization behavior and init to a coreLocalizer function and singleton
Explicitly support `en-US` locale
Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext
Add `apiConnections` property of coreContext to simplify adding a source switcher
Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions
Make coreContext itself load the UI if a container has been specified at init time
Fix code tests
2020-03-31 12:23:31 -07:00
Quincy Morgan
8439795b58 Fix lint warning 2020-03-21 13:57:17 -07:00
Quincy Morgan
4872b06a28 Randomize form field ids to thwart browser memory and help with embedding iD (close #6444) 2020-03-21 13:16:40 -07:00
Quincy Morgan
b3262a71dc Use newlines instead of semicolons to separate mutliselection tag values in tooltips (re: #7306) 2020-01-31 10:49:31 -05:00