js: Convert static/js/pill_typeahead.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-10 08:00:04 -08:00 committed by Tim Abbott
parent 118edf8982
commit a935af9243
10 changed files with 8 additions and 15 deletions

View File

@ -212,7 +212,6 @@
"padded_widget": false,
"page_params": false,
"panels": false,
"pill_typeahead": false,
"pm_list": false,
"pm_list_dom": false,
"pointer": false,

View File

@ -10,7 +10,6 @@ const {run_test} = require("../zjsunit/test");
const {make_zjquery} = require("../zjsunit/zjquery");
const user_pill = zrequire("user_pill");
zrequire("pill_typeahead");
const settings_user_groups = zrequire("settings_user_groups");
set_global("$", make_zjquery());

View File

@ -38,7 +38,6 @@ set_global("$", make_zjquery());
zrequire("input_pill");
const peer_data = zrequire("peer_data");
const people = zrequire("people");
zrequire("pill_typeahead");
zrequire("subs");
const stream_edit = zrequire("stream_edit");
const stream_data = zrequire("stream_data");

View File

@ -7,7 +7,6 @@ const {run_test} = require("../zjsunit/test");
const people = zrequire("people");
const user_pill = zrequire("user_pill");
zrequire("pill_typeahead");
set_global("page_params", {});

View File

@ -95,7 +95,6 @@ import "../typeahead_helper";
import "../search_suggestion";
import "../search";
import "../composebox_typeahead";
import "../pill_typeahead";
import "../navigate";
import "../list_util";
import "../hotkey";

View File

@ -81,7 +81,6 @@ declare let overlays: any;
declare let padded_widget: any;
declare let page_params: any;
declare let panels: any;
declare let pill_typeahead: any;
declare let pm_list: any;
declare let pointer: any;
declare let poll_widget: any;

View File

@ -1,10 +1,8 @@
"use strict";
import * as people from "./people";
import * as settings_data from "./settings_data";
import * as stream_pill from "./stream_pill";
const people = require("./people");
const settings_data = require("./settings_data");
const stream_pill = require("./stream_pill");
exports.set_up = function (input, pills, opts) {
export function set_up(input, pills, opts) {
let source = opts.source;
if (!opts.source) {
source = () => user_pill.typeahead_source(pills);
@ -67,6 +65,4 @@ exports.set_up = function (input, pills, opts) {
},
stopAdvance: true,
});
};
window.pill_typeahead = exports;
}

View File

@ -7,6 +7,7 @@ const render_settings_custom_user_profile_field = require("../templates/settings
const render_settings_dev_env_email_access = require("../templates/settings/dev_env_email_access.hbs");
const people = require("./people");
const pill_typeahead = require("./pill_typeahead");
const setup = require("./setup");
exports.update_email = function (new_email) {

View File

@ -6,6 +6,7 @@ const render_admin_user_group_list = require("../templates/admin_user_group_list
const render_confirm_delete_user = require("../templates/confirm_delete_user.hbs");
const people = require("./people");
const pill_typeahead = require("./pill_typeahead");
const meta = {
loaded: false,

View File

@ -8,6 +8,7 @@ const render_subscription_stream_privacy_modal = require("../templates/subscript
const peer_data = require("./peer_data");
const people = require("./people");
const pill_typeahead = require("./pill_typeahead");
const settings_config = require("./settings_config");
const settings_data = require("./settings_data");
const stream_pill = require("./stream_pill");