diff --git a/ase/properties.cc b/ase/properties.cc index e85286b7..27bd0a82 100644 --- a/ase/properties.cc +++ b/ase/properties.cc @@ -98,7 +98,7 @@ JSONIPC_INHERIT (LambdaPropertyImpl, Property); void LambdaPropertyImpl::notify() { - emit_event ("change", identifier()); + emit_notify (identifier()); } Value @@ -204,7 +204,7 @@ void Bag::on_events (const String &eventselector, const EventHandler &eventhandler) { for (auto p : props) - connections.push_back (p->on_event ("change", eventhandler)); + connections.push_back (p->on_event (eventselector, eventhandler)); } } // Properties diff --git a/ase/server.cc b/ase/server.cc index 616fc51f..a2059625 100644 --- a/ase/server.cc +++ b/ase/server.cc @@ -94,7 +94,7 @@ Preferences::access_properties (const EventHandler &eventhandler) bag += Text (&plugin_path, _("Plugin Path"), "", STANDARD + "searchpath", _("Search path of directories, seperated by \";\", used to find plugins. This path " "is searched for in addition to the standard plugin location on this system.")); - bag.on_events ("change", eventhandler); + bag.on_events ("notify", eventhandler); return bag.props; } diff --git a/ui/Makefile.mk b/ui/Makefile.mk index bd1c8641..77daad5e 100644 --- a/ui/Makefile.mk +++ b/ui/Makefile.mk @@ -336,7 +336,7 @@ $>/.tscheck.done: ui/types.d.ts ui/tsconfig.json $(ui/tscheck.deps) ui/Makefile. $(QECHO) RUN tscheck $Q cp ui/tsconfig.json ui/types.d.ts $>/ui/ @ # tsc *.js needs to find node_modules/ in the directory hierarchy ("moduleResolution": "node") - -$Q cd $>/ && node_modules/.bin/tsc -p ui/tsconfig.json --pretty false |& ../misc/colorize.sh + -$Q cd $>/ && node_modules/.bin/tsc -p ui/tsconfig.json $${INSIDE_EMACS:+--pretty false} $Q touch $@ $>/ui/.build2-stamp: $>/.tscheck.done tscheck: $>/node_modules/.npm.done diff --git a/ui/b/basics.js b/ui/b/basics.js new file mode 100644 index 00000000..8a32e7c0 --- /dev/null +++ b/ui/b/basics.js @@ -0,0 +1,78 @@ +// This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0 +// @ts-check + +import { JsExtract } from '../little.js'; +import * as Util from '../util.js'; + +// - - - - diff --git a/ui/b/choiceinput.js b/ui/b/choiceinput.js new file mode 100644 index 00000000..ccae4e4a --- /dev/null +++ b/ui/b/choiceinput.js @@ -0,0 +1,256 @@ +// This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0 +// @ts-check + +import { LitComponent, html, nothing, JsExtract, live, docs, ref } from '../little.js'; +import * as Util from '../util.js'; + +/** # B-CHOICE + * This element provides a choice popup to choose from a set of options. + * It supports the Vue + * [v-model](https://vuejs.org/v2/guide/components-custom-events.html#Customizing-Component-v-model) + * protocol by emitting an `input` event on value changes and accepting inputs via the `value` prop. + * ## Props: + * *value* + * : Integer, the index of the choice value to be displayed. + * *choices* + * : List of choices: `[ { icon, label, blurb }... ]` + * ## Events: + * *valuechange* + * : Value change notification event. + */ + +// - - - - diff --git a/ui/b/fed-object.vue b/ui/b/fed-object.vue deleted file mode 100644 index cf69d0c5..00000000 --- a/ui/b/fed-object.vue +++ /dev/null @@ -1,199 +0,0 @@ - - - - # B-FED-OBJECT - A field-editor for object input. - A copy of the input value is edited, update notifications are provided via - an `input` event. - ## Properties: - *value* - : Object with properties to be edited. - *readonly* - : Make this component non editable for the user. - *debounce* - : Delay in milliseconds for `input` event notifications. - ## Events: - *input* - : This event is emitted whenever the value changes through user input or needs to be constrained. - - - - - - - - diff --git a/ui/b/fed-switch.vue b/ui/b/fed-switch.vue deleted file mode 100644 index 7280388f..00000000 --- a/ui/b/fed-switch.vue +++ /dev/null @@ -1,80 +0,0 @@ - - - - # B-FED-SWITCH - A field-editor switch to change between on and off. - ## Properties: - *value* - : Contains a boolean indicating whether the switch is on or off. - *readonly* - : Make this component non editable for the user. - ## Events: - *input* - : This event is emitted whenever the value changes through user input or needs to be constrained. - - - - - - - diff --git a/ui/b/numberinput.js b/ui/b/numberinput.js new file mode 100644 index 00000000..4a3f389a --- /dev/null +++ b/ui/b/numberinput.js @@ -0,0 +1,157 @@ +// This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0 +// @ts-check + +import { LitComponent, html, JsExtract, live, docs, ref } from '../little.js'; +import * as Util from '../util.js'; + +/** # B-FED-NUMBER + * A field-editor for integer or floating point number ranges. + * The input `value` will be constrained to take on an amount between `min` and `max` inclusively. + * ## Properties: + * *value* + * : Contains the number being edited. + * *min* + * : The minimum amount that `value` can take on. + * *max* + * : The maximum amount that `value` can take on. + * *step* + * : A useful amount for stepwise increments. + * *allowfloat* + * : Unless this setting is `true`, numbers are constrained to integer values. + * *readonly* + * : Make this component non editable for the user. + * ## Events: + * *valuechange* + * : This event is emitted whenever the value changes through user input or needs to be constrained. + */ + +//