@yoobic/yobi 8.5.0-21 → 8.5.0-22

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.
@@ -4720,6 +4720,7 @@ const YooFormDynamicComponent = class {
4720
4720
  const PreviewButton = ({ slot }) => (index$1.h("yoo-button", { animated: true, color: "app-color", disabled: !validity, fill: "transparent", size: "small", slot: slot, onClick: () => {
4721
4721
  const preview = document.createElement('yoo-form-recurrence-preview');
4722
4722
  preview.value = overlays.getFieldValue(field, this.currentData, this.suffix);
4723
+ preview.addEventListener('close', () => overlays.closeModal(null, preview));
4723
4724
  overlays.showModal(preview, null, null, overlays.getModalAnimation('Enter', 'X', { host: this.host, reversedSlide: true }), overlays.getModalAnimation('Leave', 'X', { host: this.host, reversedSlide: true }), true);
4724
4725
  } }, index$1.h("yoo-icon", { color: "app-color", name: "eye", size: "small", slot: "start" }), overlays.translate('PREVIEW')));
4725
4726
  return validity ? (index$1.h("yoo-tooltip", { content: overlays.translate('PREVIEWSCHEDULEDPUBLICATION'), placement: "top", slot: slot }, index$1.h(PreviewButton, null))) : (index$1.h(PreviewButton, { slot: slot }));
@@ -4,13 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-7319daa9.js');
6
6
  const index$1 = require('./index-3ee3c595.js');
7
- const commonHelpers = require('./common-helpers-ae3afe20.js');
8
7
  const overlays = require('./overlays-f03457f6.js');
9
8
  require('./lodash-72d493b9.js');
10
9
  require('./index-bed242d9.js');
11
10
  require('./_commonjsHelpers-94df2ea7.js');
12
11
 
13
- const formRecurrencePreviewCss = "svg:not(:root){overflow:hidden}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;background-color:var(--light, #ffffff);-webkit-box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1))}:host footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);border-top:var(--border-width-01, 0.0625rem) solid var(--stable-light, #f1f1f1)}:host header{font-weight:bold}:host main{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}:host main.empty{-ms-flex-pack:center;justify-content:center}:host main:not(.empty){padding:var(--spacing-16, 1rem) var(--spacing-48, 3rem);overflow:auto}:host h1{margin:0 0 var(--spacing-16, 1rem);font-size:inherit}:host p{margin:0;color:var(--stable, #adadad);font-size:var(--font-size-14, 0.875rem);text-align:center}:host table{width:100%;border-collapse:collapse}:host table,:host td,:host th{border:var(--border-width-01, 0.0625rem) solid var(--stable-alt, #d0d0d0)}:host tbody tr:nth-child(odd){background:var(--stable-light, #f1f1f1)}:host td,:host th{width:50%;padding:var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem);text-align:left}:host yoo-empty-state+p{margin-top:var(--spacing-16, 1rem)}:host .schedule{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-24, 1.5rem);width:100%;margin-top:var(--spacing-24, 1.5rem)}:host .timezones{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-16, 1rem);max-width:34.5rem}:host .timezones h1{text-align:right}:host .timezones p{grid-column:1/-1}";
12
+ const formRecurrencePreviewCss = "svg:not(:root){overflow:hidden}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;background-color:var(--light, #ffffff)}:host footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);border-top:var(--border-width-01, 0.0625rem) solid var(--stable-light, #f1f1f1)}:host header{font-weight:bold}:host main{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}:host main.empty{-ms-flex-pack:center;justify-content:center}:host main:not(.empty){padding:var(--spacing-16, 1rem) var(--spacing-48, 3rem);overflow:auto}:host h1{margin:0 0 var(--spacing-16, 1rem);font-size:inherit}:host p{margin:0;color:var(--stable, #adadad);font-size:var(--font-size-14, 0.875rem);text-align:center}:host table{width:100%;border-collapse:collapse}:host table,:host td,:host th{border:var(--border-width-01, 0.0625rem) solid var(--stable-alt, #d0d0d0)}:host tbody tr:nth-child(odd){background:var(--stable-light, #f1f1f1)}:host td,:host th{width:50%;padding:var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem);text-align:left}:host yoo-empty-state+p{margin-top:var(--spacing-16, 1rem)}:host .schedule{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-24, 1.5rem);width:100%;margin-top:var(--spacing-24, 1.5rem)}:host .timezones{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-16, 1rem);max-width:34.5rem}:host .timezones h1{text-align:right}:host .timezones p{grid-column:1/-1}";
14
13
 
15
14
  const EmptyState = () => [index.h("yoo-empty-state", null), index.h("p", null, overlays.translate('LISTEMPTY'))];
16
15
  const Recurrences = ({ dates, label }) => (index.h("div", { class: "recurrences" }, index.h("h1", null, overlays.translate(label)), index.h("table", null, index.h("thead", null, index.h("tr", null, index.h("th", null, overlays.translate('YOOBICDATE')), index.h("th", null, overlays.translate('YOOBICHOUR')))), index.h("tbody", null, dates.map((date) => (index.h("tr", null, index.h("td", null, overlays.pipes.dateFormat.transform(date, 'ddd L')), index.h("td", null, overlays.pipes.dateFormat.transform(date, 'LT')))))))));
@@ -33,14 +32,12 @@ const YooFormRecurrencePreviewComponent = class {
33
32
  }
34
33
  finish() {
35
34
  this.close.emit();
36
- overlays.closeModal(null);
37
35
  }
38
36
  render() {
39
37
  const recurrences = index$1.getNextRecurrences(this.value, { max: this.max, timezone: this.timezone });
40
38
  const hasRecurrences = !!(recurrences === null || recurrences === void 0 ? void 0 : recurrences.length);
41
- return (index.h(index.Host, { class: { ...commonHelpers.getAppContext(this.host) } }, index.h("header", null, index.h("yoo-navbar", null, index.h("yoo-items", { slot: "start" }, index.h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, index.h("yoo-icon", { color: "stable", name: "close" }))), index.h("yoo-truncate", null, overlays.translate('RECURRENCEPREVIEWTITLE')))), index.h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && index.h(Timezones, { value: this.timezone, values: overlays.TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (index.h("div", { class: "schedule" }, index.h(Recurrences, { dates: index$1.getNextRecurrences(this.value, { max: this.max, timezone: overlays.guessCurrentTimezone() }), label: overlays.translate('RECURRENCEPREVIEWLEFT') }), index.h(Recurrences, { dates: recurrences, label: overlays.translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && index.h(EmptyState, null)), index.h("footer", null, index.h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, overlays.translate('YOOBICSAVE')))));
39
+ return (index.h(index.Host, null, index.h("header", null, index.h("yoo-navbar", null, index.h("yoo-items", { slot: "start" }, index.h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, index.h("yoo-icon", { color: "stable", name: "close" }))), index.h("yoo-truncate", null, overlays.translate('RECURRENCEPREVIEWTITLE')))), index.h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && index.h(Timezones, { value: this.timezone, values: overlays.TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (index.h("div", { class: "schedule" }, index.h(Recurrences, { dates: index$1.getNextRecurrences(this.value, { max: this.max, timezone: overlays.guessCurrentTimezone() }), label: overlays.translate('RECURRENCEPREVIEWLEFT') }), index.h(Recurrences, { dates: recurrences, label: overlays.translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && index.h(EmptyState, null)), index.h("footer", null, index.h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, overlays.translate('YOOBICSAVE')))));
42
40
  }
43
- get host() { return index.getElement(this); }
44
41
  };
45
42
  YooFormRecurrencePreviewComponent.style = formRecurrencePreviewCss;
46
43
 
@@ -1,5 +1,5 @@
1
1
  import { FormFieldType, IncentivePartType, QUIZZ_COMPONENTS_FORM_FIELDS } from '@shared/interfaces';
2
- import { answerIsValid, cancelRequestInterval, debounce, disableKeyboardResize, enableKeyboardResize, evalInContext, findField, findParent, getConfidenceDescriptionKey, getConfidenceEmoji, getCssColor, getDistance, getFieldReplacement, getFieldValue, getModalAnimation, getSession, hasValue, isAndroid, isAnimationsDisabled, isChromeForIos, isConfidenceAssessment, isContentOnly, isFieldWithDirectValue, isFieldWithNoValue, isIonic, isIOS, isIphoneX, isKeyboardResizeModeInactive, isNativeMobile, isNullOrUndefined, isPhotoOrMultiPhotosField, isPresent, isQuiz, isSafari, isSamsung, isTimedQuiz, isValueATranslationKey, isVisible, isWeb, pipes, requestInterval, showContextMenu, showModal, showToast, slenderizeObject, translate, translateMulti, updateDatasetFilters } from '@shared/utils';
2
+ import { answerIsValid, cancelRequestInterval, closeModal, debounce, disableKeyboardResize, enableKeyboardResize, evalInContext, findField, findParent, getConfidenceDescriptionKey, getConfidenceEmoji, getCssColor, getDistance, getFieldReplacement, getFieldValue, getModalAnimation, getSession, hasValue, isAndroid, isAnimationsDisabled, isChromeForIos, isConfidenceAssessment, isContentOnly, isFieldWithDirectValue, isFieldWithNoValue, isIonic, isIOS, isIphoneX, isKeyboardResizeModeInactive, isNativeMobile, isNullOrUndefined, isPhotoOrMultiPhotosField, isPresent, isQuiz, isSafari, isSamsung, isTimedQuiz, isValueATranslationKey, isVisible, isWeb, pipes, requestInterval, showContextMenu, showModal, showToast, slenderizeObject, translate, translateMulti, updateDatasetFilters } from '@shared/utils';
3
3
  import { forceUpdate, h, Host } from '@stencil/core';
4
4
  import { assign, cloneDeep, compact, findLastIndex, flatten, get, groupBy, isArray, isEmpty, isEqual, isFunction, isNumber, isObject, isString, keys, orderBy, pick, range, result, uniqBy } from 'lodash-es';
5
5
  import { getMissionStatusIconName } from '../../../feature-operate/campaign/helpers/operation-helpers';
@@ -4520,6 +4520,7 @@ export class YooFormDynamicComponent {
4520
4520
  const PreviewButton = ({ slot }) => (h("yoo-button", { animated: true, color: "app-color", disabled: !validity, fill: "transparent", size: "small", slot: slot, onClick: () => {
4521
4521
  const preview = document.createElement('yoo-form-recurrence-preview');
4522
4522
  preview.value = getFieldValue(field, this.currentData, this.suffix);
4523
+ preview.addEventListener('close', () => closeModal(null, preview));
4523
4524
  showModal(preview, null, null, getModalAnimation('Enter', 'X', { host: this.host, reversedSlide: true }), getModalAnimation('Leave', 'X', { host: this.host, reversedSlide: true }), true);
4524
4525
  } }, h("yoo-icon", { color: "app-color", name: "eye", size: "small", slot: "start" }), translate('PREVIEW')));
4525
4526
  return validity ? (h("yoo-tooltip", { content: translate('PREVIEWSCHEDULEDPUBLICATION'), placement: "top", slot: slot }, h(PreviewButton, null))) : (h(PreviewButton, { slot: slot }));
@@ -210,7 +210,6 @@ svg:not(:root) {
210
210
  flex-direction: column;
211
211
  height: 100%;
212
212
  background-color: var(--light, #ffffff);
213
- box-shadow: var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1));
214
213
  }
215
214
  :host footer {
216
215
  display: flex;
@@ -249,13 +248,16 @@ svg:not(:root) {
249
248
  width: 100%;
250
249
  border-collapse: collapse;
251
250
  }
252
- :host table, :host td, :host th {
251
+ :host table,
252
+ :host td,
253
+ :host th {
253
254
  border: var(--border-width-01, 0.0625rem) solid var(--stable-alt, #d0d0d0);
254
255
  }
255
256
  :host tbody tr:nth-child(odd) {
256
257
  background: var(--stable-light, #f1f1f1);
257
258
  }
258
- :host td, :host th {
259
+ :host td,
260
+ :host th {
259
261
  width: 50%;
260
262
  padding: var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem);
261
263
  text-align: left;
@@ -1,6 +1,5 @@
1
- import { closeModal, getNextRecurrences, guessCurrentTimezone, pipes, TIMEZONES, translate } from '@shared/utils';
1
+ import { getNextRecurrences, guessCurrentTimezone, pipes, TIMEZONES, translate } from '@shared/utils';
2
2
  import { h, Host } from '@stencil/core';
3
- import { getAppContext } from '../../../utils/helpers/common-helpers';
4
3
  const EmptyState = () => [h("yoo-empty-state", null), h("p", null, translate('LISTEMPTY'))];
5
4
  const Recurrences = ({ dates, label }) => (h("div", { class: "recurrences" }, h("h1", null, translate(label)), h("table", null, h("thead", null, h("tr", null, h("th", null, translate('YOOBICDATE')), h("th", null, translate('YOOBICHOUR')))), h("tbody", null, dates.map((date) => (h("tr", null, h("td", null, pipes.dateFormat.transform(date, 'ddd L')), h("td", null, pipes.dateFormat.transform(date, 'LT')))))))));
6
5
  const Timezones = ({ value, values, onUpdate }) => (h("div", { class: "timezones" }, h("p", { innerHTML: translate('RECURRENCEPREVIEWDETAILS') }), h("h1", null, translate('RECURRENCEPREVIEWTIMEZONE')), h("yoo-form-autocomplete", { size: "medium", value: value, values: values, onFetchData: (event) => { var _a; return (_a = event.detail.infiniteScroll) === null || _a === void 0 ? void 0 : _a.complete(); }, onInputChanged: (event) => {
@@ -20,12 +19,11 @@ export class YooFormRecurrencePreviewComponent {
20
19
  }
21
20
  finish() {
22
21
  this.close.emit();
23
- closeModal(null);
24
22
  }
25
23
  render() {
26
24
  const recurrences = getNextRecurrences(this.value, { max: this.max, timezone: this.timezone });
27
25
  const hasRecurrences = !!(recurrences === null || recurrences === void 0 ? void 0 : recurrences.length);
28
- return (h(Host, { class: { ...getAppContext(this.host) } }, h("header", null, h("yoo-navbar", null, h("yoo-items", { slot: "start" }, h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, h("yoo-icon", { color: "stable", name: "close" }))), h("yoo-truncate", null, translate('RECURRENCEPREVIEWTITLE')))), h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && h(Timezones, { value: this.timezone, values: TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (h("div", { class: "schedule" }, h(Recurrences, { dates: getNextRecurrences(this.value, { max: this.max, timezone: guessCurrentTimezone() }), label: translate('RECURRENCEPREVIEWLEFT') }), h(Recurrences, { dates: recurrences, label: translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && h(EmptyState, null)), h("footer", null, h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, translate('YOOBICSAVE')))));
26
+ return (h(Host, null, h("header", null, h("yoo-navbar", null, h("yoo-items", { slot: "start" }, h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, h("yoo-icon", { color: "stable", name: "close" }))), h("yoo-truncate", null, translate('RECURRENCEPREVIEWTITLE')))), h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && h(Timezones, { value: this.timezone, values: TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (h("div", { class: "schedule" }, h(Recurrences, { dates: getNextRecurrences(this.value, { max: this.max, timezone: guessCurrentTimezone() }), label: translate('RECURRENCEPREVIEWLEFT') }), h(Recurrences, { dates: recurrences, label: translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && h(EmptyState, null)), h("footer", null, h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, translate('YOOBICSAVE')))));
29
27
  }
30
28
  static get is() { return "yoo-form-recurrence-preview"; }
31
29
  static get encapsulation() { return "shadow"; }
@@ -117,5 +115,4 @@ export class YooFormRecurrencePreviewComponent {
117
115
  }
118
116
  }];
119
117
  }
120
- static get elementRef() { return "host"; }
121
118
  }
@@ -6,7 +6,7 @@ import { b as getMissionStatusIconName } from './operation-helpers-d79af51a.js';
6
6
  import { q as querySelectorDeep, c as querySelectorAllDeep, j as lockSwipes, b as getActiveElementShadow, m as hideShowTabbar, g as getAppContext } from './common-helpers-b157cebd.js';
7
7
  import { a as isRequired, b as getTypeValidation, c as isReadonly, s as setFieldData, u as updateFormulas, d as getDynamicProperty, e as isDisabled, f as isCreationAllowed, h as isEditionAllowed, j as generateLabel } from './form-helpers-3c02d10c.js';
8
8
  import { e as setValueAndResetInputValidity, a as setValueAndValidateInput } from './form-input-helpers-5a6e022f.js';
9
- import { A as isWeb, t as translate, j as isNativeMobile, C as debounce, k as isAndroid, Q as findParent, by as getFieldValue, cJ as isQuiz, ed as isTimedQuiz, ee as isConfidenceAssessment, b5 as showToast, a$ as findField, X as isNullOrUndefined, a3 as getSession, dz as isKeyboardResizeModeInactive, aa as disableKeyboardResize, cw as isIonic, ab as enableKeyboardResize, v as cancelRequestInterval, bC as slenderizeObject, r as requestInterval, ef as isVisible, eg as hasValue, aD as showContextMenu, z as showModal, Z as translateMulti, K as getCssColor, H as isIOS, eh as getDistance, ei as isFieldWithDirectValue, aI as isPresent, ej as isFieldWithNoValue, ek as updateDatasetFilters, dg as isAnimationsDisabled, cG as answerIsValid, el as getConfidenceEmoji, cD as getConfidenceDescriptionKey, G as isIphoneX, cB as isContentOnly, ar as pipes, bz as getFieldReplacement, bu as evalInContext, em as isSamsung, y as getModalAnimation, en as isPhotoOrMultiPhotosField, bh as isValueATranslationKey, bS as isSafari, eo as isChromeForIos } from './overlays-c83a9ace.js';
9
+ import { A as isWeb, t as translate, j as isNativeMobile, C as debounce, k as isAndroid, Q as findParent, by as getFieldValue, cJ as isQuiz, ed as isTimedQuiz, ee as isConfidenceAssessment, b5 as showToast, a$ as findField, X as isNullOrUndefined, a3 as getSession, dz as isKeyboardResizeModeInactive, aa as disableKeyboardResize, cw as isIonic, ab as enableKeyboardResize, v as cancelRequestInterval, bC as slenderizeObject, r as requestInterval, ef as isVisible, eg as hasValue, aD as showContextMenu, z as showModal, Z as translateMulti, K as getCssColor, H as isIOS, eh as getDistance, ei as isFieldWithDirectValue, aI as isPresent, ej as isFieldWithNoValue, ek as updateDatasetFilters, dg as isAnimationsDisabled, cG as answerIsValid, el as getConfidenceEmoji, cD as getConfidenceDescriptionKey, G as isIphoneX, cB as isContentOnly, ar as pipes, bz as getFieldReplacement, bu as evalInContext, em as isSamsung, p as closeModal, y as getModalAnimation, en as isPhotoOrMultiPhotosField, bh as isValueATranslationKey, bS as isSafari, eo as isChromeForIos } from './overlays-c83a9ace.js';
10
10
  import './_commonjsHelpers-f4d11124.js';
11
11
 
12
12
  function getFieldState(field, fieldsState) {
@@ -4716,6 +4716,7 @@ const YooFormDynamicComponent = class {
4716
4716
  const PreviewButton = ({ slot }) => (h("yoo-button", { animated: true, color: "app-color", disabled: !validity, fill: "transparent", size: "small", slot: slot, onClick: () => {
4717
4717
  const preview = document.createElement('yoo-form-recurrence-preview');
4718
4718
  preview.value = getFieldValue(field, this.currentData, this.suffix);
4719
+ preview.addEventListener('close', () => closeModal(null, preview));
4719
4720
  showModal(preview, null, null, getModalAnimation('Enter', 'X', { host: this.host, reversedSlide: true }), getModalAnimation('Leave', 'X', { host: this.host, reversedSlide: true }), true);
4720
4721
  } }, h("yoo-icon", { color: "app-color", name: "eye", size: "small", slot: "start" }), translate('PREVIEW')));
4721
4722
  return validity ? (h("yoo-tooltip", { content: translate('PREVIEWSCHEDULEDPUBLICATION'), placement: "top", slot: slot }, h(PreviewButton, null))) : (h(PreviewButton, { slot: slot }));
@@ -1,12 +1,11 @@
1
- import { h, r as registerInstance, i as createEvent, e as Host, g as getElement } from './index-0a59e2a1.js';
1
+ import { h, r as registerInstance, i as createEvent, e as Host } from './index-0a59e2a1.js';
2
2
  import { h as getNextRecurrences } from './index-a2be01f6.js';
3
- import { g as getAppContext } from './common-helpers-b157cebd.js';
4
- import { t as translate, ar as pipes, es as guessCurrentTimezone, p as closeModal, et as TIMEZONES } from './overlays-c83a9ace.js';
3
+ import { t as translate, ar as pipes, es as guessCurrentTimezone, et as TIMEZONES } from './overlays-c83a9ace.js';
5
4
  import './lodash-653c0bcd.js';
6
5
  import './index-dddbbd40.js';
7
6
  import './_commonjsHelpers-f4d11124.js';
8
7
 
9
- const formRecurrencePreviewCss = "svg:not(:root){overflow:hidden}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;background-color:var(--light, #ffffff);-webkit-box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1))}:host footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);border-top:var(--border-width-01, 0.0625rem) solid var(--stable-light, #f1f1f1)}:host header{font-weight:bold}:host main{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}:host main.empty{-ms-flex-pack:center;justify-content:center}:host main:not(.empty){padding:var(--spacing-16, 1rem) var(--spacing-48, 3rem);overflow:auto}:host h1{margin:0 0 var(--spacing-16, 1rem);font-size:inherit}:host p{margin:0;color:var(--stable, #adadad);font-size:var(--font-size-14, 0.875rem);text-align:center}:host table{width:100%;border-collapse:collapse}:host table,:host td,:host th{border:var(--border-width-01, 0.0625rem) solid var(--stable-alt, #d0d0d0)}:host tbody tr:nth-child(odd){background:var(--stable-light, #f1f1f1)}:host td,:host th{width:50%;padding:var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem);text-align:left}:host yoo-empty-state+p{margin-top:var(--spacing-16, 1rem)}:host .schedule{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-24, 1.5rem);width:100%;margin-top:var(--spacing-24, 1.5rem)}:host .timezones{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-16, 1rem);max-width:34.5rem}:host .timezones h1{text-align:right}:host .timezones p{grid-column:1/-1}";
8
+ const formRecurrencePreviewCss = "svg:not(:root){overflow:hidden}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;background-color:var(--light, #ffffff)}:host footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);border-top:var(--border-width-01, 0.0625rem) solid var(--stable-light, #f1f1f1)}:host header{font-weight:bold}:host main{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}:host main.empty{-ms-flex-pack:center;justify-content:center}:host main:not(.empty){padding:var(--spacing-16, 1rem) var(--spacing-48, 3rem);overflow:auto}:host h1{margin:0 0 var(--spacing-16, 1rem);font-size:inherit}:host p{margin:0;color:var(--stable, #adadad);font-size:var(--font-size-14, 0.875rem);text-align:center}:host table{width:100%;border-collapse:collapse}:host table,:host td,:host th{border:var(--border-width-01, 0.0625rem) solid var(--stable-alt, #d0d0d0)}:host tbody tr:nth-child(odd){background:var(--stable-light, #f1f1f1)}:host td,:host th{width:50%;padding:var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem);text-align:left}:host yoo-empty-state+p{margin-top:var(--spacing-16, 1rem)}:host .schedule{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-24, 1.5rem);width:100%;margin-top:var(--spacing-24, 1.5rem)}:host .timezones{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-16, 1rem);max-width:34.5rem}:host .timezones h1{text-align:right}:host .timezones p{grid-column:1/-1}";
10
9
 
11
10
  const EmptyState = () => [h("yoo-empty-state", null), h("p", null, translate('LISTEMPTY'))];
12
11
  const Recurrences = ({ dates, label }) => (h("div", { class: "recurrences" }, h("h1", null, translate(label)), h("table", null, h("thead", null, h("tr", null, h("th", null, translate('YOOBICDATE')), h("th", null, translate('YOOBICHOUR')))), h("tbody", null, dates.map((date) => (h("tr", null, h("td", null, pipes.dateFormat.transform(date, 'ddd L')), h("td", null, pipes.dateFormat.transform(date, 'LT')))))))));
@@ -29,14 +28,12 @@ const YooFormRecurrencePreviewComponent = class {
29
28
  }
30
29
  finish() {
31
30
  this.close.emit();
32
- closeModal(null);
33
31
  }
34
32
  render() {
35
33
  const recurrences = getNextRecurrences(this.value, { max: this.max, timezone: this.timezone });
36
34
  const hasRecurrences = !!(recurrences === null || recurrences === void 0 ? void 0 : recurrences.length);
37
- return (h(Host, { class: { ...getAppContext(this.host) } }, h("header", null, h("yoo-navbar", null, h("yoo-items", { slot: "start" }, h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, h("yoo-icon", { color: "stable", name: "close" }))), h("yoo-truncate", null, translate('RECURRENCEPREVIEWTITLE')))), h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && h(Timezones, { value: this.timezone, values: TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (h("div", { class: "schedule" }, h(Recurrences, { dates: getNextRecurrences(this.value, { max: this.max, timezone: guessCurrentTimezone() }), label: translate('RECURRENCEPREVIEWLEFT') }), h(Recurrences, { dates: recurrences, label: translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && h(EmptyState, null)), h("footer", null, h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, translate('YOOBICSAVE')))));
35
+ return (h(Host, null, h("header", null, h("yoo-navbar", null, h("yoo-items", { slot: "start" }, h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, h("yoo-icon", { color: "stable", name: "close" }))), h("yoo-truncate", null, translate('RECURRENCEPREVIEWTITLE')))), h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && h(Timezones, { value: this.timezone, values: TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (h("div", { class: "schedule" }, h(Recurrences, { dates: getNextRecurrences(this.value, { max: this.max, timezone: guessCurrentTimezone() }), label: translate('RECURRENCEPREVIEWLEFT') }), h(Recurrences, { dates: recurrences, label: translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && h(EmptyState, null)), h("footer", null, h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, translate('YOOBICSAVE')))));
38
36
  }
39
- get host() { return getElement(this); }
40
37
  };
41
38
  YooFormRecurrencePreviewComponent.style = formRecurrencePreviewCss;
42
39
 
@@ -6,7 +6,7 @@ import { b as getMissionStatusIconName } from './operation-helpers-d79af51a.js';
6
6
  import { q as querySelectorDeep, c as querySelectorAllDeep, j as lockSwipes, b as getActiveElementShadow, m as hideShowTabbar, g as getAppContext } from './common-helpers-b157cebd.js';
7
7
  import { a as isRequired, b as getTypeValidation, c as isReadonly, s as setFieldData, u as updateFormulas, d as getDynamicProperty, e as isDisabled, f as isCreationAllowed, h as isEditionAllowed, j as generateLabel } from './form-helpers-3c02d10c.js';
8
8
  import { e as setValueAndResetInputValidity, a as setValueAndValidateInput } from './form-input-helpers-5a6e022f.js';
9
- import { A as isWeb, t as translate, j as isNativeMobile, C as debounce, k as isAndroid, Q as findParent, by as getFieldValue, cJ as isQuiz, ed as isTimedQuiz, ee as isConfidenceAssessment, b5 as showToast, a$ as findField, X as isNullOrUndefined, a3 as getSession, dz as isKeyboardResizeModeInactive, aa as disableKeyboardResize, cw as isIonic, ab as enableKeyboardResize, v as cancelRequestInterval, bC as slenderizeObject, r as requestInterval, ef as isVisible, eg as hasValue, aD as showContextMenu, z as showModal, Z as translateMulti, K as getCssColor, H as isIOS, eh as getDistance, ei as isFieldWithDirectValue, aI as isPresent, ej as isFieldWithNoValue, ek as updateDatasetFilters, dg as isAnimationsDisabled, cG as answerIsValid, el as getConfidenceEmoji, cD as getConfidenceDescriptionKey, G as isIphoneX, cB as isContentOnly, ar as pipes, bz as getFieldReplacement, bu as evalInContext, em as isSamsung, y as getModalAnimation, en as isPhotoOrMultiPhotosField, bh as isValueATranslationKey, bS as isSafari, eo as isChromeForIos } from './overlays-c83a9ace.js';
9
+ import { A as isWeb, t as translate, j as isNativeMobile, C as debounce, k as isAndroid, Q as findParent, by as getFieldValue, cJ as isQuiz, ed as isTimedQuiz, ee as isConfidenceAssessment, b5 as showToast, a$ as findField, X as isNullOrUndefined, a3 as getSession, dz as isKeyboardResizeModeInactive, aa as disableKeyboardResize, cw as isIonic, ab as enableKeyboardResize, v as cancelRequestInterval, bC as slenderizeObject, r as requestInterval, ef as isVisible, eg as hasValue, aD as showContextMenu, z as showModal, Z as translateMulti, K as getCssColor, H as isIOS, eh as getDistance, ei as isFieldWithDirectValue, aI as isPresent, ej as isFieldWithNoValue, ek as updateDatasetFilters, dg as isAnimationsDisabled, cG as answerIsValid, el as getConfidenceEmoji, cD as getConfidenceDescriptionKey, G as isIphoneX, cB as isContentOnly, ar as pipes, bz as getFieldReplacement, bu as evalInContext, em as isSamsung, p as closeModal, y as getModalAnimation, en as isPhotoOrMultiPhotosField, bh as isValueATranslationKey, bS as isSafari, eo as isChromeForIos } from './overlays-c83a9ace.js';
10
10
  import './_commonjsHelpers-f4d11124.js';
11
11
 
12
12
  function getFieldState(field, fieldsState) {
@@ -4716,6 +4716,7 @@ const YooFormDynamicComponent = class {
4716
4716
  const PreviewButton = ({ slot }) => (h("yoo-button", { animated: true, color: "app-color", disabled: !validity, fill: "transparent", size: "small", slot: slot, onClick: () => {
4717
4717
  const preview = document.createElement('yoo-form-recurrence-preview');
4718
4718
  preview.value = getFieldValue(field, this.currentData, this.suffix);
4719
+ preview.addEventListener('close', () => closeModal(null, preview));
4719
4720
  showModal(preview, null, null, getModalAnimation('Enter', 'X', { host: this.host, reversedSlide: true }), getModalAnimation('Leave', 'X', { host: this.host, reversedSlide: true }), true);
4720
4721
  } }, h("yoo-icon", { color: "app-color", name: "eye", size: "small", slot: "start" }), translate('PREVIEW')));
4721
4722
  return validity ? (h("yoo-tooltip", { content: translate('PREVIEWSCHEDULEDPUBLICATION'), placement: "top", slot: slot }, h(PreviewButton, null))) : (h(PreviewButton, { slot: slot }));
@@ -1,12 +1,11 @@
1
- import { h, r as registerInstance, i as createEvent, e as Host, g as getElement } from './index-0a59e2a1.js';
1
+ import { h, r as registerInstance, i as createEvent, e as Host } from './index-0a59e2a1.js';
2
2
  import { h as getNextRecurrences } from './index-a2be01f6.js';
3
- import { g as getAppContext } from './common-helpers-b157cebd.js';
4
- import { t as translate, ar as pipes, es as guessCurrentTimezone, p as closeModal, et as TIMEZONES } from './overlays-c83a9ace.js';
3
+ import { t as translate, ar as pipes, es as guessCurrentTimezone, et as TIMEZONES } from './overlays-c83a9ace.js';
5
4
  import './lodash-653c0bcd.js';
6
5
  import './index-dddbbd40.js';
7
6
  import './_commonjsHelpers-f4d11124.js';
8
7
 
9
- const formRecurrencePreviewCss = "svg:not(:root){overflow:hidden}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;background-color:var(--light, #ffffff);-webkit-box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1))}:host footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);border-top:var(--border-width-01, 0.0625rem) solid var(--stable-light, #f1f1f1)}:host header{font-weight:bold}:host main{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}:host main.empty{-ms-flex-pack:center;justify-content:center}:host main:not(.empty){padding:var(--spacing-16, 1rem) var(--spacing-48, 3rem);overflow:auto}:host h1{margin:0 0 var(--spacing-16, 1rem);font-size:inherit}:host p{margin:0;color:var(--stable, #adadad);font-size:var(--font-size-14, 0.875rem);text-align:center}:host table{width:100%;border-collapse:collapse}:host table,:host td,:host th{border:var(--border-width-01, 0.0625rem) solid var(--stable-alt, #d0d0d0)}:host tbody tr:nth-child(odd){background:var(--stable-light, #f1f1f1)}:host td,:host th{width:50%;padding:var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem);text-align:left}:host yoo-empty-state+p{margin-top:var(--spacing-16, 1rem)}:host .schedule{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-24, 1.5rem);width:100%;margin-top:var(--spacing-24, 1.5rem)}:host .timezones{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-16, 1rem);max-width:34.5rem}:host .timezones h1{text-align:right}:host .timezones p{grid-column:1/-1}";
8
+ const formRecurrencePreviewCss = "svg:not(:root){overflow:hidden}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;background-color:var(--light, #ffffff)}:host footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);border-top:var(--border-width-01, 0.0625rem) solid var(--stable-light, #f1f1f1)}:host header{font-weight:bold}:host main{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}:host main.empty{-ms-flex-pack:center;justify-content:center}:host main:not(.empty){padding:var(--spacing-16, 1rem) var(--spacing-48, 3rem);overflow:auto}:host h1{margin:0 0 var(--spacing-16, 1rem);font-size:inherit}:host p{margin:0;color:var(--stable, #adadad);font-size:var(--font-size-14, 0.875rem);text-align:center}:host table{width:100%;border-collapse:collapse}:host table,:host td,:host th{border:var(--border-width-01, 0.0625rem) solid var(--stable-alt, #d0d0d0)}:host tbody tr:nth-child(odd){background:var(--stable-light, #f1f1f1)}:host td,:host th{width:50%;padding:var(--spacing-08, 0.5rem) var(--spacing-24, 1.5rem);text-align:left}:host yoo-empty-state+p{margin-top:var(--spacing-16, 1rem)}:host .schedule{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-24, 1.5rem);width:100%;margin-top:var(--spacing-24, 1.5rem)}:host .timezones{display:grid;grid-template-columns:repeat(2, 1fr);gap:var(--spacing-16, 1rem);max-width:34.5rem}:host .timezones h1{text-align:right}:host .timezones p{grid-column:1/-1}";
10
9
 
11
10
  const EmptyState = () => [h("yoo-empty-state", null), h("p", null, translate('LISTEMPTY'))];
12
11
  const Recurrences = ({ dates, label }) => (h("div", { class: "recurrences" }, h("h1", null, translate(label)), h("table", null, h("thead", null, h("tr", null, h("th", null, translate('YOOBICDATE')), h("th", null, translate('YOOBICHOUR')))), h("tbody", null, dates.map((date) => (h("tr", null, h("td", null, pipes.dateFormat.transform(date, 'ddd L')), h("td", null, pipes.dateFormat.transform(date, 'LT')))))))));
@@ -29,14 +28,12 @@ const YooFormRecurrencePreviewComponent = class {
29
28
  }
30
29
  finish() {
31
30
  this.close.emit();
32
- closeModal(null);
33
31
  }
34
32
  render() {
35
33
  const recurrences = getNextRecurrences(this.value, { max: this.max, timezone: this.timezone });
36
34
  const hasRecurrences = !!(recurrences === null || recurrences === void 0 ? void 0 : recurrences.length);
37
- return (h(Host, { class: { ...getAppContext(this.host) } }, h("header", null, h("yoo-navbar", null, h("yoo-items", { slot: "start" }, h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, h("yoo-icon", { color: "stable", name: "close" }))), h("yoo-truncate", null, translate('RECURRENCEPREVIEWTITLE')))), h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && h(Timezones, { value: this.timezone, values: TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (h("div", { class: "schedule" }, h(Recurrences, { dates: getNextRecurrences(this.value, { max: this.max, timezone: guessCurrentTimezone() }), label: translate('RECURRENCEPREVIEWLEFT') }), h(Recurrences, { dates: recurrences, label: translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && h(EmptyState, null)), h("footer", null, h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, translate('YOOBICSAVE')))));
35
+ return (h(Host, null, h("header", null, h("yoo-navbar", null, h("yoo-items", { slot: "start" }, h("yoo-button", { animated: true, color: "stable", fill: "transparent", rippleType: "unbounded", shape: "circular", onClick: () => this.finish() }, h("yoo-icon", { color: "stable", name: "close" }))), h("yoo-truncate", null, translate('RECURRENCEPREVIEWTITLE')))), h("main", { class: { empty: !hasRecurrences } }, hasRecurrences && h(Timezones, { value: this.timezone, values: TIMEZONES, onUpdate: (timezone) => (this.timezone = timezone) }), hasRecurrences && (h("div", { class: "schedule" }, h(Recurrences, { dates: getNextRecurrences(this.value, { max: this.max, timezone: guessCurrentTimezone() }), label: translate('RECURRENCEPREVIEWLEFT') }), h(Recurrences, { dates: recurrences, label: translate('RECURRENCEPREVIEWRIGHT') }))), !hasRecurrences && h(EmptyState, null)), h("footer", null, h("yoo-button", { animated: true, color: "app-color", onClick: () => this.finish() }, translate('YOOBICSAVE')))));
38
36
  }
39
- get host() { return getElement(this); }
40
37
  };
41
38
  YooFormRecurrencePreviewComponent.style = formRecurrencePreviewCss;
42
39
 
@@ -17,7 +17,6 @@ export declare class YooFormRecurrencePreviewComponent implements ComponentInter
17
17
  * Emitted when it is closed.
18
18
  */
19
19
  close: EventEmitter<void>;
20
- host: HTMLYooFormRecurrencePreviewElement;
21
20
  finish(): void;
22
21
  render(): any;
23
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoobic/yobi",
3
- "version": "8.5.0-21",
3
+ "version": "8.5.0-22",
4
4
  "description": "Yobi - Yoobic Design System",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",