@nyaruka/temba-components 0.105.1 → 0.106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -215,6 +215,7 @@ export class ContactSearch extends FormElement {
215
215
  --temba-select-selected-line-height: 1em;
216
216
  --temba-select-selected-font-size: 1em;
217
217
  --search-input-height: 0px !important;
218
+ --temba-select-min-height: 1.8em;
218
219
  min-width: 100px;
219
220
  }
220
221
 
@@ -226,7 +227,18 @@ export class ContactSearch extends FormElement {
226
227
  `;
227
228
  }
228
229
  refresh() {
229
- this.refreshKey = 'requested_' + new Date().getTime();
230
+ if (this.advanced || this.recipients.length > 0) {
231
+ this.refreshKey = 'requested_' + new Date().getTime();
232
+ }
233
+ else {
234
+ this.summary = null;
235
+ this.fetching = false;
236
+ this.requestUpdate();
237
+ this.fireCustomEvent(CustomEventType.ContentChanged, { reset: true });
238
+ }
239
+ }
240
+ firstUpdated(changes) {
241
+ super.firstUpdated(changes);
230
242
  }
231
243
  updated(changedProperties) {
232
244
  super.updated(changedProperties);
@@ -271,6 +283,9 @@ export class ContactSearch extends FormElement {
271
283
  }).then((response) => {
272
284
  this.fetching = false;
273
285
  this.initialized = true;
286
+ if (this.recipients.length == 0 && !this.advanced) {
287
+ return;
288
+ }
274
289
  if (response.status === 200) {
275
290
  this.summary = response.json;
276
291
  if (!this.advanced) {
@@ -373,7 +388,7 @@ export class ContactSearch extends FormElement {
373
388
  else {
374
389
  this.exclusions[checkbox.name] = value;
375
390
  }
376
- if (ex !== JSON.stringify(this.exclusions)) {
391
+ if (ex !== JSON.stringify(this.exclusions) && this.endpoint) {
377
392
  this.refresh();
378
393
  }
379
394
  }
@@ -422,10 +437,11 @@ export class ContactSearch extends FormElement {
422
437
  }
423
438
  }
424
439
  const notSeenSinceDays = this.exclusions['not_seen_since_days'];
440
+ let blockers = null;
425
441
  if (this.summary &&
426
442
  this.summary.blockers &&
427
443
  this.summary.blockers.length > 0) {
428
- return html `${this.summary.blockers.map((error) => html `<temba-alert level="error">${unsafeHTML(error)}</temba-alert>`)}`;
444
+ blockers = html `${this.summary.blockers.map((error) => html `<temba-alert level="error">${unsafeHTML(error)}</temba-alert>`)}`;
429
445
  }
430
446
  return html `
431
447
  ${this.advanced
@@ -474,7 +490,14 @@ export class ContactSearch extends FormElement {
474
490
  Only include contacts who...
475
491
  </div>
476
492
  </div>
477
-
493
+ ${this.in_a_flow
494
+ ? html `<temba-checkbox
495
+ name="in_a_flow"
496
+ label="${msg('Are not currently in a flow')}"
497
+ ?checked=${this.exclusions['in_a_flow']}
498
+ @change=${this.handleExclusionChanged}
499
+ ></temba-checkbox>`
500
+ : null}
478
501
  ${this.not_seen_since_days
479
502
  ? html `
480
503
  <div
@@ -518,14 +541,6 @@ export class ContactSearch extends FormElement {
518
541
  <div></div>
519
542
  </div>
520
543
  `
521
- : null}
522
- ${this.in_a_flow
523
- ? html `<temba-checkbox
524
- name="in_a_flow"
525
- label="${msg('Are not currently in a flow')}"
526
- ?checked=${this.exclusions['in_a_flow']}
527
- @change=${this.handleExclusionChanged}
528
- ></temba-checkbox>`
529
544
  : null}
530
545
  ${this.started_previously
531
546
  ? html `<temba-checkbox
@@ -550,11 +565,14 @@ export class ContactSearch extends FormElement {
550
565
  <temba-loading units="6" size="8"></temba-loading>
551
566
  <div class="summary ${this.expanded ? 'expanded' : ''}">${summary}</div>
552
567
  </div>
553
- ${this.summary && this.summary.warnings
568
+ ${blockers}
569
+ ${!blockers && this.summary && this.summary.warnings
554
570
  ? this.summary.warnings.map((warning) => html `<temba-alert level="warning"
555
571
  >${unsafeHTML(warning)}</temba-alert
556
572
  >`)
557
573
  : ``}
574
+
575
+
558
576
  `;
559
577
  }
560
578
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContactSearch.js","sourceRoot":"","sources":["../../../src/contactsearch/ContactSearch.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChD,O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E,MAAM,EAAE,CAAC;wDACF;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACT;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACpB;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2CACnC;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDACI;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACV;AAOT;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACH","sourcesContent":["import { TemplateResult, html, css } from 'lit';\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js';\nimport { property } from 'lit/decorators.js';\nimport { getClasses, postJSON, stopEvent, WebResponse } from '../utils';\nimport { TextInput } from '../textinput/TextInput';\nimport '../alert/Alert';\nimport { Contact, CustomEventType } from '../interfaces';\nimport { FormElement } from '../FormElement';\nimport { Checkbox } from '../checkbox/Checkbox';\nimport { msg } from '@lit/localize';\nimport { OmniOption } from '../omnibox/Omnibox';\nimport { Select } from '../select/Select';\n\nconst QUEIT_MILLIS = 2000;\n\ninterface SummaryResponse {\n total: number;\n sample: Contact[];\n query: string;\n fields: { [uuid: string]: { label: string; type: string } };\n error?: string;\n warnings: string[];\n blockers: string[];\n}\n\nexport class ContactSearch extends FormElement {\n static get styles() {\n return css`\n :host {\n color: var(--color-text);\n }\n\n .urn {\n width: 120px;\n }\n\n .name {\n width: 160px;\n }\n\n .date {\n text-align: right;\n }\n\n .field-header {\n font-size: 80%;\n color: var(--color-text-dark);\n }\n\n .field-header.date {\n text-align: right;\n }\n\n .more {\n font-size: 90%;\n padding-top: 5px;\n padding-right: 3px;\n text-align: right;\n width: 100px;\n vertical-align: top;\n }\n\n table {\n width: 100%;\n }\n\n .contact td {\n border-bottom: 1px solid var(--color-borders);\n padding: 5px 3px;\n }\n\n .table-footer td {\n padding: 10px 3px;\n }\n\n .query-replaced,\n .count-replaced {\n display: inline-block;\n background: var(--color-primary-light);\n color: var(--color-text-dark);\n padding: 3px 6px;\n border-radius: var(--curvature);\n font-size: 85%;\n margin: 0px 3px;\n }\n\n temba-loading {\n transform: scale(0);\n max-width: 0;\n opacity: 0;\n transition: transform 200ms ease-in-out;\n }\n\n .fetching temba-loading {\n transform: scale(1);\n max-width: 500px;\n opacity: 1;\n display: block;\n }\n\n .error {\n margin-top: 10px;\n }\n\n .match-count {\n padding: 4px;\n margin-top: 6px;\n }\n\n .linked {\n color: var(--color-link-primary);\n text-decoration: none;\n cursor: pointer;\n }\n\n .header td {\n border-bottom: 0px solid var(--color-borders);\n padding: 5px 3px;\n }\n\n .expanded .header td {\n border-bottom: 2px solid var(--color-borders);\n }\n\n td.field-header,\n tr.table-footer,\n tr.contact {\n display: none;\n }\n\n .expanded td.field-header {\n display: table-cell;\n }\n\n .expanded tr.contact,\n .expanded tr.table-footer {\n display: table-row;\n }\n\n .query {\n display: var(--contact-search-query-display);\n margin-bottom: 10px;\n }\n\n .results {\n display: none;\n }\n\n .summary {\n min-height: 2.2em;\n display: flex;\n flex-grow: 1;\n align-items: center;\n }\n\n .summary .result-count {\n flex-grow: 1;\n }\n\n .results.empty {\n display: none !important;\n }\n\n .results.initialized {\n display: flex;\n align-items: center;\n margin-top: 0.5em;\n margin-left: 0.6em;\n }\n\n .advanced-icon {\n cursor: pointer;\n margin-right: 0.5em;\n }\n\n .query .advanced-icon {\n margin-top: 1em;\n margin-right: 1em;\n }\n\n .advanced-icon:hover {\n --icon-color: var(--color-link-primary-hover) !important;\n }\n\n .query {\n --textarea-height: 5em;\n }\n\n #recipients {\n margin-bottom: 1em;\n display: block;\n }\n\n temba-alert {\n margin: 1em 0;\n }\n\n temba-select[name='not_seen_since_days'] {\n margin-bottom: 1em;\n display: block;\n }\n\n .activity-select {\n display: flex;\n align-items: center;\n padding: var(--checkbox-padding, 10px);\n border-radius: var(--curvature);\n cursor: pointer;\n }\n\n .activity-select:hover {\n background: #f9f9f9;\n }\n\n .small-select {\n --temba-select-selected-padding: 0px 0.5em;\n --temba-select-selected-line-height: 1em;\n --temba-select-selected-font-size: 1em;\n --search-input-height: 0px !important;\n min-width: 100px;\n }\n\n .filters {\n padding: 1em;\n border: 1px solid var(--color-borders);\n border-radius: var(--curvature);\n }\n `;\n }\n\n @property({ type: Boolean })\n in_a_flow: boolean;\n\n @property({ type: Boolean })\n started_previously: boolean;\n\n @property({ type: Boolean })\n not_seen_since_days: boolean;\n\n @property({ type: Boolean })\n fetching: boolean;\n\n @property({ type: Boolean })\n expanded: boolean;\n\n @property({ type: String })\n endpoint: string;\n\n @property({ type: String })\n placeholder = '';\n\n @property({ type: String })\n name = '';\n\n @property({ type: String })\n query = '';\n\n @property({ type: Number })\n inactiveThreshold = 1000;\n\n @property({ type: Number })\n inactiveDays = 90;\n\n @property({ type: Object, attribute: false })\n summary: SummaryResponse;\n\n @property({ type: Object, attribute: false })\n flow: any;\n\n @property({ type: Array })\n recipients: OmniOption[] = [];\n\n @property({ type: Boolean })\n advanced = false;\n\n @property({ type: String })\n refreshKey = '0';\n\n public refresh(): void {\n this.refreshKey = 'requested_' + new Date().getTime();\n }\n\n @property({ type: Object })\n private exclusions = {};\n\n private lastQuery: number;\n private initialized = false;\n\n public updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n\n if (changedProperties.has('recipients')) {\n this.handleRecipientsChanged();\n }\n\n // if we remove the in_a_flow option, make sure it's not part of our exclusions\n if (changedProperties.has('in_a_flow') && !this.in_a_flow) {\n delete this.exclusions['in_a_flow'];\n this.requestUpdate('exclusions');\n }\n\n if (\n (changedProperties.has('query') && this.advanced) ||\n (changedProperties.has('refreshKey') && this.refreshKey !== '0')\n ) {\n this.summary = null;\n // this.errors = [];\n this.fireCustomEvent(CustomEventType.ContentChanged, { reset: true });\n if (this.lastQuery) {\n window.clearTimeout(this.lastQuery);\n this.fetching = false;\n }\n\n if (this.query.trim().length > 0 || this.recipients.length > 0) {\n this.fetching = true;\n this.lastQuery = window.setTimeout(() => {\n this.fetchSummary();\n }, QUEIT_MILLIS);\n }\n }\n }\n\n public fetchSummary(): any {\n if (this.endpoint) {\n const group_uuids = this.recipients\n .filter((value: OmniOption) => value.type === 'group')\n .map((value: OmniOption) => value.id);\n\n const contact_uuids = this.recipients\n .filter((value: OmniOption) => value.type === 'contact')\n .map((value: OmniOption) => value.id);\n\n postJSON(this.endpoint, {\n include: this.advanced\n ? { query: this.query }\n : { contact_uuids, group_uuids },\n\n exclude: this.exclusions\n }).then((response: WebResponse) => {\n this.fetching = false;\n this.initialized = true;\n if (response.status === 200) {\n this.summary = response.json as SummaryResponse;\n if (!this.advanced) {\n this.query = this.summary.query;\n }\n this.setValue({\n advanced: this.advanced,\n query: this.query,\n exclusions: this.exclusions,\n recipients: this.recipients\n });\n\n if (this.summary.error) {\n this.errors = [this.summary.error];\n } else {\n this.errors = [];\n }\n this.requestUpdate('errors');\n this.fireCustomEvent(CustomEventType.ContentChanged, this.summary);\n } else {\n this.summary = response.json as SummaryResponse;\n if (this.summary.error) {\n this.errors = [this.summary.error];\n }\n this.requestUpdate('errors');\n this.fireCustomEvent(CustomEventType.ContentChanged, this.summary);\n }\n });\n }\n }\n\n private handleAdvancedToggle(evt: MouseEvent) {\n stopEvent(evt);\n this.recipients = [];\n this.exclusions = {};\n if (this.advanced) {\n this.query = '';\n this.value = null;\n }\n this.advanced = !this.advanced;\n\n this.setValue({\n advanced: this.advanced,\n query: this.query,\n exclusions: this.exclusions,\n recipients: this.recipients\n });\n }\n\n private handleQueryChange(evt: KeyboardEvent) {\n const input = evt.target as TextInput;\n this.query = input.inputElement.value;\n }\n\n private handleRecipientsChanged() {\n if (!this.endpoint) {\n return;\n }\n\n if (this.recipients && (this.refreshKey !== '0' || this.initialized)) {\n this.refresh();\n } else {\n this.initialized = true;\n }\n }\n\n private handleActivityLevelChanged(evt: any) {\n const select = evt.target as Select;\n const option = select.values[0];\n if (option) {\n if (this.exclusions['not_seen_since_days']) {\n this.exclusions['not_seen_since_days'] = parseInt(option.value);\n this.refresh();\n }\n }\n }\n\n private handleActivityLabelClicked(evt: any) {\n if (\n evt.target &&\n evt.target.tagName !== 'TEMBA-CHECKBOX' &&\n evt.target.tagName !== 'TEMBA-SELECT' &&\n !evt.target.disabled\n ) {\n const checkbox = evt.currentTarget.querySelector('temba-checkbox');\n checkbox.checked = !checkbox.checked;\n }\n }\n\n private handleExclusionChanged(evt: any) {\n if (evt.target.tagName === 'TEMBA-CHECKBOX') {\n const ex = JSON.stringify(this.exclusions);\n const checkbox = evt.target as Checkbox;\n let value = checkbox.checked as any;\n\n // if we check the activity box, look inside the select for the value\n if (checkbox.name === 'not_seen_since_days' && value) {\n const select = checkbox.parentElement.querySelector(\n 'temba-select'\n ) as Select;\n if (select.values[0]) {\n value = parseInt(select.values[0].value);\n } else {\n value = this.exclusions[checkbox.name];\n }\n }\n\n if (!value) {\n delete this.exclusions[checkbox.name];\n } else {\n this.exclusions[checkbox.name] = value;\n }\n\n if (ex !== JSON.stringify(this.exclusions)) {\n this.refresh();\n }\n }\n }\n\n public render(): TemplateResult {\n let summary: TemplateResult;\n if (this.summary) {\n if (!this.summary.error) {\n const count = this.summary.total || 0;\n\n summary = html`\n <div class=\"result-count\">\n Found\n <a\n class=\"linked\"\n target=\"_\"\n href=\"/contact/?search=${encodeURIComponent(this.summary.query)}\"\n >\n ${count.toLocaleString()}\n </a>\n contact${count !== 1 ? 's' : ''}\n </div>\n <temba-button\n class=\"edit\"\n name=\"edit\"\n secondary\n small\n @click=${this.handleAdvancedToggle}\n >\n <div slot=\"name\">\n <div style=\"display: flex; align-items: center;\">\n ${this.advanced\n ? html` <temba-icon\n name=\"reset\"\n style=\"margin-right:0.5em\"\n ></temba-icon>\n Start Over`\n : html` <temba-icon\n name=\"edit\"\n style=\"margin-right:0.5em\"\n ></temba-icon>\n Edit Query`}\n </div>\n </div>\n </temba-button>\n `;\n }\n }\n\n const notSeenSinceDays = this.exclusions['not_seen_since_days'];\n if (\n this.summary &&\n this.summary.blockers &&\n this.summary.blockers.length > 0\n ) {\n return html`${this.summary.blockers.map(\n (error) =>\n html`<temba-alert level=\"error\">${unsafeHTML(error)}</temba-alert>`\n )}`;\n }\n\n return html`\n ${\n this.advanced\n ? html`<div class=\"query\">\n <temba-textinput\n .label=${this.label}\n .helpText=${this.helpText}\n .widgetOnly=${this.widgetOnly}\n .errors=${this.errors}\n name=${this.name}\n .inputRoot=${this}\n @input=${this.handleQueryChange}\n placeholder=${this.placeholder}\n .value=${this.query}\n textarea\n autogrow\n >\n </temba-textinput>\n </div>`\n : html`<temba-omnibox\n placeholder=\"Search for contacts or groups\"\n widget_only=\"\"\n groups=\"\"\n contacts=\"\"\n label=\"Recipients\"\n help_text=\"The contacts to send the message to.\"\n .errors=${this.errors}\n id=\"recipients\"\n name=\"recipients\"\n .value=${this.recipients}\n endpoint=\"/contact/omnibox/?\"\n @change=${this.handleRecipientsChanged}\n >\n </temba-omnibox>\n\n ${this.not_seen_since_days ||\n this.in_a_flow ||\n this.started_previously\n ? html`\n <div class=\"filters\">\n <div\n style=\"display:flex;font-size:1em;margin-bottom:0.5em\"\n >\n <temba-icon size=\"1\" name=\"filter\"></temba-icon>\n <div style=\"margin-left:0.5em\">\n Only include contacts who...\n </div>\n </div>\n\n ${this.not_seen_since_days\n ? html`\n <div\n class=\"activity-select\"\n @click=${this.handleActivityLabelClicked}\n >\n <temba-checkbox\n style=\"display:inline;\"\n name=\"not_seen_since_days\"\n ?checked=${notSeenSinceDays}\n @change=${this.handleExclusionChanged}\n >\n </temba-checkbox>\n\n <div style=\"margin-left:0.5em\">\n ${msg('Have sent a message in the last')}\n </div>\n\n <temba-select\n style=\"margin-left:0.5em\"\n class=\"small-select\"\n @change=${this.handleActivityLevelChanged}\n ?disabled=${!notSeenSinceDays}\n >\n <temba-option\n name=\"90 days\"\n value=\"90\"\n ?selected=${notSeenSinceDays === 90}\n ></temba-option>\n <temba-option\n name=\"180 days\"\n value=\"180\"\n ?selected=${notSeenSinceDays === 180}\n ></temba-option>\n <temba-option\n name=\"Year\"\n value=\"365\"\n ?selected=${notSeenSinceDays === 365}\n ></temba-option>\n </temba-select>\n <div></div>\n </div>\n `\n : null}\n ${this.in_a_flow\n ? html`<temba-checkbox\n name=\"in_a_flow\"\n label=\"${msg('Are not currently in a flow')}\"\n ?checked=${this.exclusions['in_a_flow']}\n @change=${this.handleExclusionChanged}\n ></temba-checkbox>`\n : null}\n ${this.started_previously\n ? html`<temba-checkbox\n name=\"started_previously\"\n label=\"${msg(\n 'Have not started this flow in the last 90 days'\n )}\"\n ?checked=${this.exclusions['started_previously']}\n @change=${this.handleExclusionChanged}\n ></temba-checkbox>`\n : null}\n </div>\n `\n : null} `\n }\n </div>\n <div\n class=\"results ${getClasses({\n fetching: this.fetching,\n initialized: this.initialized || this.fetching,\n empty:\n ((this.summary && this.summary.error) || !this.summary) &&\n !this.fetching\n })}\"\n >\n <temba-loading units=\"6\" size=\"8\"></temba-loading>\n <div class=\"summary ${this.expanded ? 'expanded' : ''}\">${summary}</div>\n </div>\n ${\n this.summary && this.summary.warnings\n ? this.summary.warnings.map(\n (warning) =>\n html`<temba-alert level=\"warning\"\n >${unsafeHTML(warning)}</temba-alert\n >`\n )\n : ``\n }\n `;\n }\n}\n"]}
1
+ {"version":3,"file":"ContactSearch.js","sourceRoot":"","sources":["../../../src/contactsearch/ContactSearch.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,IAAI,EAAE,GAAG,EAAoB,MAAM,KAAK,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAA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AI,EAAE,OAAO,EAAE,CAAC;yDACA;AAG5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DACC;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACV;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACV;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACjB;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAChB;AAGX;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDACF;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACT;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;8CACpB;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2CACnC;AAGV;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDACI;AAG9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACV;AAcV;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDACJ","sourcesContent":["import { TemplateResult, html, css, PropertyValueMap } from 'lit';\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js';\nimport { property } from 'lit/decorators.js';\nimport { getClasses, postJSON, stopEvent, WebResponse } from '../utils';\nimport { TextInput } from '../textinput/TextInput';\nimport '../alert/Alert';\nimport { Contact, CustomEventType } from '../interfaces';\nimport { FormElement } from '../FormElement';\nimport { Checkbox } from '../checkbox/Checkbox';\nimport { msg } from '@lit/localize';\nimport { OmniOption } from '../omnibox/Omnibox';\nimport { Select } from '../select/Select';\n\nconst QUEIT_MILLIS = 2000;\n\ninterface SummaryResponse {\n total: number;\n sample: Contact[];\n query: string;\n fields: { [uuid: string]: { label: string; type: string } };\n error?: string;\n warnings: string[];\n blockers: string[];\n}\n\nexport class ContactSearch extends FormElement {\n static get styles() {\n return css`\n :host {\n color: var(--color-text);\n }\n\n .urn {\n width: 120px;\n }\n\n .name {\n width: 160px;\n }\n\n .date {\n text-align: right;\n }\n\n .field-header {\n font-size: 80%;\n color: var(--color-text-dark);\n }\n\n .field-header.date {\n text-align: right;\n }\n\n .more {\n font-size: 90%;\n padding-top: 5px;\n padding-right: 3px;\n text-align: right;\n width: 100px;\n vertical-align: top;\n }\n\n table {\n width: 100%;\n }\n\n .contact td {\n border-bottom: 1px solid var(--color-borders);\n padding: 5px 3px;\n }\n\n .table-footer td {\n padding: 10px 3px;\n }\n\n .query-replaced,\n .count-replaced {\n display: inline-block;\n background: var(--color-primary-light);\n color: var(--color-text-dark);\n padding: 3px 6px;\n border-radius: var(--curvature);\n font-size: 85%;\n margin: 0px 3px;\n }\n\n temba-loading {\n transform: scale(0);\n max-width: 0;\n opacity: 0;\n transition: transform 200ms ease-in-out;\n }\n\n .fetching temba-loading {\n transform: scale(1);\n max-width: 500px;\n opacity: 1;\n display: block;\n }\n\n .error {\n margin-top: 10px;\n }\n\n .match-count {\n padding: 4px;\n margin-top: 6px;\n }\n\n .linked {\n color: var(--color-link-primary);\n text-decoration: none;\n cursor: pointer;\n }\n\n .header td {\n border-bottom: 0px solid var(--color-borders);\n padding: 5px 3px;\n }\n\n .expanded .header td {\n border-bottom: 2px solid var(--color-borders);\n }\n\n td.field-header,\n tr.table-footer,\n tr.contact {\n display: none;\n }\n\n .expanded td.field-header {\n display: table-cell;\n }\n\n .expanded tr.contact,\n .expanded tr.table-footer {\n display: table-row;\n }\n\n .query {\n display: var(--contact-search-query-display);\n margin-bottom: 10px;\n }\n\n .results {\n display: none;\n }\n\n .summary {\n min-height: 2.2em;\n display: flex;\n flex-grow: 1;\n align-items: center;\n }\n\n .summary .result-count {\n flex-grow: 1;\n }\n\n .results.empty {\n display: none !important;\n }\n\n .results.initialized {\n display: flex;\n align-items: center;\n margin-top: 0.5em;\n margin-left: 0.6em;\n }\n\n .advanced-icon {\n cursor: pointer;\n margin-right: 0.5em;\n }\n\n .query .advanced-icon {\n margin-top: 1em;\n margin-right: 1em;\n }\n\n .advanced-icon:hover {\n --icon-color: var(--color-link-primary-hover) !important;\n }\n\n .query {\n --textarea-height: 5em;\n }\n\n #recipients {\n margin-bottom: 1em;\n display: block;\n }\n\n temba-alert {\n margin: 1em 0;\n }\n\n temba-select[name='not_seen_since_days'] {\n margin-bottom: 1em;\n display: block;\n }\n\n .activity-select {\n display: flex;\n align-items: center;\n padding: var(--checkbox-padding, 10px);\n border-radius: var(--curvature);\n cursor: pointer;\n }\n\n .activity-select:hover {\n background: #f9f9f9;\n }\n\n .small-select {\n --temba-select-selected-padding: 0px 0.5em;\n --temba-select-selected-line-height: 1em;\n --temba-select-selected-font-size: 1em;\n --search-input-height: 0px !important;\n --temba-select-min-height: 1.8em;\n min-width: 100px;\n }\n\n .filters {\n padding: 1em;\n border: 1px solid var(--color-borders);\n border-radius: var(--curvature);\n }\n `;\n }\n\n @property({ type: Boolean })\n in_a_flow: boolean;\n\n @property({ type: Boolean })\n started_previously: boolean;\n\n @property({ type: Boolean })\n not_seen_since_days: boolean;\n\n @property({ type: Boolean })\n fetching: boolean;\n\n @property({ type: Boolean })\n expanded: boolean;\n\n @property({ type: String })\n endpoint: string;\n\n @property({ type: String })\n placeholder = '';\n\n @property({ type: String })\n name = '';\n\n @property({ type: String })\n query = '';\n\n @property({ type: Number })\n inactiveThreshold = 1000;\n\n @property({ type: Number })\n inactiveDays = 90;\n\n @property({ type: Object, attribute: false })\n summary: SummaryResponse;\n\n @property({ type: Object, attribute: false })\n flow: any;\n\n @property({ type: Array })\n recipients: OmniOption[] = [];\n\n @property({ type: Boolean })\n advanced = false;\n\n @property({ type: String })\n refreshKey = '0';\n\n public refresh(): void {\n if (this.advanced || this.recipients.length > 0) {\n this.refreshKey = 'requested_' + new Date().getTime();\n } else {\n this.summary = null;\n this.fetching = false;\n this.requestUpdate();\n this.fireCustomEvent(CustomEventType.ContentChanged, { reset: true });\n }\n }\n\n @property({ type: Object })\n public exclusions = {};\n\n private lastQuery: number;\n private initialized = false;\n\n public firstUpdated(\n changes: PropertyValueMap<any> | Map<PropertyKey, unknown>\n ): void {\n super.firstUpdated(changes);\n }\n\n public updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n\n if (changedProperties.has('recipients')) {\n this.handleRecipientsChanged();\n }\n\n // if we remove the in_a_flow option, make sure it's not part of our exclusions\n if (changedProperties.has('in_a_flow') && !this.in_a_flow) {\n delete this.exclusions['in_a_flow'];\n this.requestUpdate('exclusions');\n }\n\n if (\n (changedProperties.has('query') && this.advanced) ||\n (changedProperties.has('refreshKey') && this.refreshKey !== '0')\n ) {\n this.summary = null;\n // this.errors = [];\n this.fireCustomEvent(CustomEventType.ContentChanged, { reset: true });\n if (this.lastQuery) {\n window.clearTimeout(this.lastQuery);\n this.fetching = false;\n }\n\n if (this.query.trim().length > 0 || this.recipients.length > 0) {\n this.fetching = true;\n this.lastQuery = window.setTimeout(() => {\n this.fetchSummary();\n }, QUEIT_MILLIS);\n }\n }\n }\n\n public fetchSummary(): any {\n if (this.endpoint) {\n const group_uuids = this.recipients\n .filter((value: OmniOption) => value.type === 'group')\n .map((value: OmniOption) => value.id);\n\n const contact_uuids = this.recipients\n .filter((value: OmniOption) => value.type === 'contact')\n .map((value: OmniOption) => value.id);\n\n postJSON(this.endpoint, {\n include: this.advanced\n ? { query: this.query }\n : { contact_uuids, group_uuids },\n\n exclude: this.exclusions\n }).then((response: WebResponse) => {\n this.fetching = false;\n this.initialized = true;\n if (this.recipients.length == 0 && !this.advanced) {\n return;\n }\n if (response.status === 200) {\n this.summary = response.json as SummaryResponse;\n if (!this.advanced) {\n this.query = this.summary.query;\n }\n this.setValue({\n advanced: this.advanced,\n query: this.query,\n exclusions: this.exclusions,\n recipients: this.recipients\n });\n\n if (this.summary.error) {\n this.errors = [this.summary.error];\n } else {\n this.errors = [];\n }\n this.requestUpdate('errors');\n this.fireCustomEvent(CustomEventType.ContentChanged, this.summary);\n } else {\n this.summary = response.json as SummaryResponse;\n if (this.summary.error) {\n this.errors = [this.summary.error];\n }\n this.requestUpdate('errors');\n this.fireCustomEvent(CustomEventType.ContentChanged, this.summary);\n }\n });\n }\n }\n\n private handleAdvancedToggle(evt: MouseEvent) {\n stopEvent(evt);\n this.recipients = [];\n this.exclusions = {};\n if (this.advanced) {\n this.query = '';\n this.value = null;\n }\n this.advanced = !this.advanced;\n\n this.setValue({\n advanced: this.advanced,\n query: this.query,\n exclusions: this.exclusions,\n recipients: this.recipients\n });\n }\n\n private handleQueryChange(evt: KeyboardEvent) {\n const input = evt.target as TextInput;\n this.query = input.inputElement.value;\n }\n\n private handleRecipientsChanged() {\n if (!this.endpoint) {\n return;\n }\n\n if (this.recipients && (this.refreshKey !== '0' || this.initialized)) {\n this.refresh();\n } else {\n this.initialized = true;\n }\n }\n\n private handleActivityLevelChanged(evt: any) {\n const select = evt.target as Select;\n const option = select.values[0];\n if (option) {\n if (this.exclusions['not_seen_since_days']) {\n this.exclusions['not_seen_since_days'] = parseInt(option.value);\n this.refresh();\n }\n }\n }\n\n private handleActivityLabelClicked(evt: any) {\n if (\n evt.target &&\n evt.target.tagName !== 'TEMBA-CHECKBOX' &&\n evt.target.tagName !== 'TEMBA-SELECT' &&\n !evt.target.disabled\n ) {\n const checkbox = evt.currentTarget.querySelector('temba-checkbox');\n checkbox.checked = !checkbox.checked;\n }\n }\n\n private handleExclusionChanged(evt: any) {\n if (evt.target.tagName === 'TEMBA-CHECKBOX') {\n const ex = JSON.stringify(this.exclusions);\n const checkbox = evt.target as Checkbox;\n let value = checkbox.checked as any;\n\n // if we check the activity box, look inside the select for the value\n if (checkbox.name === 'not_seen_since_days' && value) {\n const select = checkbox.parentElement.querySelector(\n 'temba-select'\n ) as Select;\n if (select.values[0]) {\n value = parseInt(select.values[0].value);\n } else {\n value = this.exclusions[checkbox.name];\n }\n }\n\n if (!value) {\n delete this.exclusions[checkbox.name];\n } else {\n this.exclusions[checkbox.name] = value;\n }\n\n if (ex !== JSON.stringify(this.exclusions) && this.endpoint) {\n this.refresh();\n }\n }\n }\n\n public render(): TemplateResult {\n let summary: TemplateResult;\n if (this.summary) {\n if (!this.summary.error) {\n const count = this.summary.total || 0;\n\n summary = html`\n <div class=\"result-count\">\n Found\n <a\n class=\"linked\"\n target=\"_\"\n href=\"/contact/?search=${encodeURIComponent(this.summary.query)}\"\n >\n ${count.toLocaleString()}\n </a>\n contact${count !== 1 ? 's' : ''}\n </div>\n <temba-button\n class=\"edit\"\n name=\"edit\"\n secondary\n small\n @click=${this.handleAdvancedToggle}\n >\n <div slot=\"name\">\n <div style=\"display: flex; align-items: center;\">\n ${this.advanced\n ? html` <temba-icon\n name=\"reset\"\n style=\"margin-right:0.5em\"\n ></temba-icon>\n Start Over`\n : html` <temba-icon\n name=\"edit\"\n style=\"margin-right:0.5em\"\n ></temba-icon>\n Edit Query`}\n </div>\n </div>\n </temba-button>\n `;\n }\n }\n\n const notSeenSinceDays = this.exclusions['not_seen_since_days'];\n let blockers = null;\n\n if (\n this.summary &&\n this.summary.blockers &&\n this.summary.blockers.length > 0\n ) {\n blockers = html`${this.summary.blockers.map(\n (error) =>\n html`<temba-alert level=\"error\">${unsafeHTML(error)}</temba-alert>`\n )}`;\n }\n\n return html`\n ${\n this.advanced\n ? html`<div class=\"query\">\n <temba-textinput\n .label=${this.label}\n .helpText=${this.helpText}\n .widgetOnly=${this.widgetOnly}\n .errors=${this.errors}\n name=${this.name}\n .inputRoot=${this}\n @input=${this.handleQueryChange}\n placeholder=${this.placeholder}\n .value=${this.query}\n textarea\n autogrow\n >\n </temba-textinput>\n </div>`\n : html`<temba-omnibox\n placeholder=\"Search for contacts or groups\"\n widget_only=\"\"\n groups=\"\"\n contacts=\"\"\n label=\"Recipients\"\n help_text=\"The contacts to send the message to.\"\n .errors=${this.errors}\n id=\"recipients\"\n name=\"recipients\"\n .value=${this.recipients}\n endpoint=\"/contact/omnibox/?\"\n @change=${this.handleRecipientsChanged}\n >\n </temba-omnibox>\n\n ${this.not_seen_since_days ||\n this.in_a_flow ||\n this.started_previously\n ? html`\n <div class=\"filters\">\n <div\n style=\"display:flex;font-size:1em;margin-bottom:0.5em\"\n >\n <temba-icon size=\"1\" name=\"filter\"></temba-icon>\n <div style=\"margin-left:0.5em\">\n Only include contacts who...\n </div>\n </div>\n ${this.in_a_flow\n ? html`<temba-checkbox\n name=\"in_a_flow\"\n label=\"${msg('Are not currently in a flow')}\"\n ?checked=${this.exclusions['in_a_flow']}\n @change=${this.handleExclusionChanged}\n ></temba-checkbox>`\n : null}\n ${this.not_seen_since_days\n ? html`\n <div\n class=\"activity-select\"\n @click=${this.handleActivityLabelClicked}\n >\n <temba-checkbox\n style=\"display:inline;\"\n name=\"not_seen_since_days\"\n ?checked=${notSeenSinceDays}\n @change=${this.handleExclusionChanged}\n >\n </temba-checkbox>\n\n <div style=\"margin-left:0.5em\">\n ${msg('Have sent a message in the last')}\n </div>\n\n <temba-select\n style=\"margin-left:0.5em\"\n class=\"small-select\"\n @change=${this.handleActivityLevelChanged}\n ?disabled=${!notSeenSinceDays}\n >\n <temba-option\n name=\"90 days\"\n value=\"90\"\n ?selected=${notSeenSinceDays === 90}\n ></temba-option>\n <temba-option\n name=\"180 days\"\n value=\"180\"\n ?selected=${notSeenSinceDays === 180}\n ></temba-option>\n <temba-option\n name=\"Year\"\n value=\"365\"\n ?selected=${notSeenSinceDays === 365}\n ></temba-option>\n </temba-select>\n <div></div>\n </div>\n `\n : null}\n ${this.started_previously\n ? html`<temba-checkbox\n name=\"started_previously\"\n label=\"${msg(\n 'Have not started this flow in the last 90 days'\n )}\"\n ?checked=${this.exclusions['started_previously']}\n @change=${this.handleExclusionChanged}\n ></temba-checkbox>`\n : null}\n </div>\n `\n : null} `\n }\n </div>\n <div\n class=\"results ${getClasses({\n fetching: this.fetching,\n initialized: this.initialized || this.fetching,\n empty:\n ((this.summary && this.summary.error) || !this.summary) &&\n !this.fetching\n })}\"\n >\n <temba-loading units=\"6\" size=\"8\"></temba-loading>\n <div class=\"summary ${this.expanded ? 'expanded' : ''}\">${summary}</div>\n </div>\n ${blockers}\n ${\n !blockers && this.summary && this.summary.warnings\n ? this.summary.warnings.map(\n (warning) =>\n html`<temba-alert level=\"warning\"\n >${unsafeHTML(warning)}</temba-alert\n >`\n )\n : ``\n }\n\n\n `;\n }\n}\n"]}
@@ -4,8 +4,8 @@
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
6
  scf1453991c986b25: `Tab para completar, enter para seleccionar`,
7
- s638236250662c6b3: `Have sent a message in the last`,
8
7
  s8f02e3a18ffc083a: `Are not currently in a flow`,
8
+ s638236250662c6b3: `Have sent a message in the last`,
9
9
  s4788ee206c4570c7: `Have not started this flow in the last 90 days`
10
10
  };
11
11
  //# sourceMappingURL=es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,4CAA4C;IAC/D,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab para completar, enter para seleccionar`,\n s638236250662c6b3: `Have sent a message in the last`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
1
+ {"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,4CAA4C;IAC/D,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab para completar, enter para seleccionar`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -4,8 +4,8 @@
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
6
  scf1453991c986b25: `Tab to complete, enter to select`,
7
- s638236250662c6b3: `Have sent a message in the last`,
8
7
  s8f02e3a18ffc083a: `Are not currently in a flow`,
8
+ s638236250662c6b3: `Have sent a message in the last`,
9
9
  s4788ee206c4570c7: `Have not started this flow in the last 90 days`
10
10
  };
11
11
  //# sourceMappingURL=fr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s638236250662c6b3: `Have sent a message in the last`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
1
+ {"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
@@ -4,8 +4,8 @@
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
5
  export const templates = {
6
6
  scf1453991c986b25: `Tab to complete, enter to select`,
7
- s638236250662c6b3: `Have sent a message in the last`,
8
7
  s8f02e3a18ffc083a: `Are not currently in a flow`,
8
+ s638236250662c6b3: `Have sent a message in the last`,
9
9
  s4788ee206c4570c7: `Have not started this flow in the last 90 days`
10
10
  };
11
11
  //# sourceMappingURL=pt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s638236250662c6b3: `Have sent a message in the last`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
1
+ {"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,gDAAgD;AAEhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,kCAAkC;IACrD,iBAAiB,EAAE,6BAA6B;IAChD,iBAAiB,EAAE,iCAAiC;IACpD,iBAAiB,EAAE,gDAAgD;CACpE,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize\n\n/* eslint-disable no-irregular-whitespace */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const templates = {\n scf1453991c986b25: `Tab to complete, enter to select`,\n s8f02e3a18ffc083a: `Are not currently in a flow`,\n s638236250662c6b3: `Have sent a message in the last`,\n s4788ee206c4570c7: `Have not started this flow in the last 90 days`\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nyaruka/temba-components",
3
- "version": "0.105.1",
3
+ "version": "0.106.0",
4
4
  "description": "Web components to support rapidpro and related projects",
5
5
  "author": "Nyaruka <code@nyaruka.coim>",
6
6
  "main": "dist/index.js",
@@ -1,4 +1,4 @@
1
- import { TemplateResult, html, css } from 'lit';
1
+ import { TemplateResult, html, css, PropertyValueMap } from 'lit';
2
2
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
3
3
  import { property } from 'lit/decorators.js';
4
4
  import { getClasses, postJSON, stopEvent, WebResponse } from '../utils';
@@ -217,6 +217,7 @@ export class ContactSearch extends FormElement {
217
217
  --temba-select-selected-line-height: 1em;
218
218
  --temba-select-selected-font-size: 1em;
219
219
  --search-input-height: 0px !important;
220
+ --temba-select-min-height: 1.8em;
220
221
  min-width: 100px;
221
222
  }
222
223
 
@@ -277,15 +278,28 @@ export class ContactSearch extends FormElement {
277
278
  refreshKey = '0';
278
279
 
279
280
  public refresh(): void {
280
- this.refreshKey = 'requested_' + new Date().getTime();
281
+ if (this.advanced || this.recipients.length > 0) {
282
+ this.refreshKey = 'requested_' + new Date().getTime();
283
+ } else {
284
+ this.summary = null;
285
+ this.fetching = false;
286
+ this.requestUpdate();
287
+ this.fireCustomEvent(CustomEventType.ContentChanged, { reset: true });
288
+ }
281
289
  }
282
290
 
283
291
  @property({ type: Object })
284
- private exclusions = {};
292
+ public exclusions = {};
285
293
 
286
294
  private lastQuery: number;
287
295
  private initialized = false;
288
296
 
297
+ public firstUpdated(
298
+ changes: PropertyValueMap<any> | Map<PropertyKey, unknown>
299
+ ): void {
300
+ super.firstUpdated(changes);
301
+ }
302
+
289
303
  public updated(changedProperties: Map<string, any>) {
290
304
  super.updated(changedProperties);
291
305
 
@@ -339,6 +353,9 @@ export class ContactSearch extends FormElement {
339
353
  }).then((response: WebResponse) => {
340
354
  this.fetching = false;
341
355
  this.initialized = true;
356
+ if (this.recipients.length == 0 && !this.advanced) {
357
+ return;
358
+ }
342
359
  if (response.status === 200) {
343
360
  this.summary = response.json as SummaryResponse;
344
361
  if (!this.advanced) {
@@ -452,7 +469,7 @@ export class ContactSearch extends FormElement {
452
469
  this.exclusions[checkbox.name] = value;
453
470
  }
454
471
 
455
- if (ex !== JSON.stringify(this.exclusions)) {
472
+ if (ex !== JSON.stringify(this.exclusions) && this.endpoint) {
456
473
  this.refresh();
457
474
  }
458
475
  }
@@ -504,12 +521,14 @@ export class ContactSearch extends FormElement {
504
521
  }
505
522
 
506
523
  const notSeenSinceDays = this.exclusions['not_seen_since_days'];
524
+ let blockers = null;
525
+
507
526
  if (
508
527
  this.summary &&
509
528
  this.summary.blockers &&
510
529
  this.summary.blockers.length > 0
511
530
  ) {
512
- return html`${this.summary.blockers.map(
531
+ blockers = html`${this.summary.blockers.map(
513
532
  (error) =>
514
533
  html`<temba-alert level="error">${unsafeHTML(error)}</temba-alert>`
515
534
  )}`;
@@ -563,7 +582,14 @@ export class ContactSearch extends FormElement {
563
582
  Only include contacts who...
564
583
  </div>
565
584
  </div>
566
-
585
+ ${this.in_a_flow
586
+ ? html`<temba-checkbox
587
+ name="in_a_flow"
588
+ label="${msg('Are not currently in a flow')}"
589
+ ?checked=${this.exclusions['in_a_flow']}
590
+ @change=${this.handleExclusionChanged}
591
+ ></temba-checkbox>`
592
+ : null}
567
593
  ${this.not_seen_since_days
568
594
  ? html`
569
595
  <div
@@ -608,14 +634,6 @@ export class ContactSearch extends FormElement {
608
634
  </div>
609
635
  `
610
636
  : null}
611
- ${this.in_a_flow
612
- ? html`<temba-checkbox
613
- name="in_a_flow"
614
- label="${msg('Are not currently in a flow')}"
615
- ?checked=${this.exclusions['in_a_flow']}
616
- @change=${this.handleExclusionChanged}
617
- ></temba-checkbox>`
618
- : null}
619
637
  ${this.started_previously
620
638
  ? html`<temba-checkbox
621
639
  name="started_previously"
@@ -643,8 +661,9 @@ export class ContactSearch extends FormElement {
643
661
  <temba-loading units="6" size="8"></temba-loading>
644
662
  <div class="summary ${this.expanded ? 'expanded' : ''}">${summary}</div>
645
663
  </div>
664
+ ${blockers}
646
665
  ${
647
- this.summary && this.summary.warnings
666
+ !blockers && this.summary && this.summary.warnings
648
667
  ? this.summary.warnings.map(
649
668
  (warning) =>
650
669
  html`<temba-alert level="warning"
@@ -653,6 +672,8 @@ export class ContactSearch extends FormElement {
653
672
  )
654
673
  : ``
655
674
  }
675
+
676
+
656
677
  `;
657
678
  }
658
679
  }
package/src/locales/es.ts CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  export const templates = {
8
8
  scf1453991c986b25: `Tab para completar, enter para seleccionar`,
9
- s638236250662c6b3: `Have sent a message in the last`,
10
9
  s8f02e3a18ffc083a: `Are not currently in a flow`,
10
+ s638236250662c6b3: `Have sent a message in the last`,
11
11
  s4788ee206c4570c7: `Have not started this flow in the last 90 days`
12
12
  };
package/src/locales/fr.ts CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  export const templates = {
8
8
  scf1453991c986b25: `Tab to complete, enter to select`,
9
- s638236250662c6b3: `Have sent a message in the last`,
10
9
  s8f02e3a18ffc083a: `Are not currently in a flow`,
10
+ s638236250662c6b3: `Have sent a message in the last`,
11
11
  s4788ee206c4570c7: `Have not started this flow in the last 90 days`
12
12
  };
package/src/locales/pt.ts CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  export const templates = {
8
8
  scf1453991c986b25: `Tab to complete, enter to select`,
9
- s638236250662c6b3: `Have sent a message in the last`,
10
9
  s8f02e3a18ffc083a: `Are not currently in a flow`,
10
+ s638236250662c6b3: `Have sent a message in the last`,
11
11
  s4788ee206c4570c7: `Have not started this flow in the last 90 days`
12
12
  };