@gravitee/ui-components 3.25.3-typescript-fdacf14 → 3.25.3-typescript-493e1dd

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.
Files changed (183) hide show
  1. package/package.json +5 -13
  2. package/src/atoms/gv-autocomplete.js +422 -1
  3. package/src/atoms/gv-button.js +397 -1
  4. package/src/atoms/gv-checkbox.js +178 -1
  5. package/src/atoms/gv-date-picker-calendar.js +812 -1
  6. package/src/atoms/gv-date-picker-cell.js +174 -1
  7. package/src/atoms/gv-date-picker.js +638 -1
  8. package/src/atoms/gv-file-upload.js +348 -1
  9. package/src/atoms/gv-icon.js +93 -1
  10. package/src/atoms/gv-image.js +135 -1
  11. package/src/atoms/gv-input-message.js +78 -1
  12. package/src/atoms/gv-input.js +508 -1
  13. package/src/atoms/gv-link.js +204 -1
  14. package/src/atoms/gv-message.js +133 -1
  15. package/src/atoms/gv-metric.js +112 -1
  16. package/src/atoms/gv-relative-time.js +143 -1
  17. package/src/atoms/gv-select-native.js +363 -1
  18. package/src/atoms/gv-select.js +413 -1
  19. package/src/atoms/gv-spinner.js +54 -1
  20. package/src/atoms/gv-state.js +125 -1
  21. package/src/atoms/gv-switch.js +235 -1
  22. package/src/atoms/gv-tag.js +162 -1
  23. package/src/atoms/gv-text.js +160 -1
  24. package/src/charts/gv-chart-bar.js +101 -1
  25. package/src/charts/gv-chart-gauge.js +92 -1
  26. package/src/charts/gv-chart-histogram.js +78 -1
  27. package/src/charts/gv-chart-line.js +218 -1
  28. package/src/charts/gv-chart-map.js +111 -1
  29. package/src/charts/gv-chart-pie.js +89 -1
  30. package/src/index.js +77 -1
  31. package/src/lib/cron-expression.js +176 -1
  32. package/src/lib/date.js +43 -1
  33. package/src/lib/events.js +26 -1
  34. package/src/lib/http-client-schema-form.js +67 -1
  35. package/src/lib/http.js +237 -1
  36. package/src/lib/i18n.js +93 -1
  37. package/src/lib/item.js +110 -1
  38. package/src/lib/properties.js +171 -1
  39. package/src/lib/schema-form.js +39 -1
  40. package/src/lib/studio.js +144 -1
  41. package/src/lib/style.js +39 -1
  42. package/src/lib/text-format.js +65 -1
  43. package/src/lib/theme.js +60 -1
  44. package/src/lib/utils.js +106 -1
  45. package/src/mixins/chart-element.js +153 -1
  46. package/src/mixins/input-element.js +136 -1
  47. package/src/mixins/item-resource.js +102 -1
  48. package/src/mixins/keyboard-element.js +62 -1
  49. package/src/mixins/update-after-browser.js +30 -1
  50. package/src/mixins/with-resize-observer.js +62 -1
  51. package/src/mixins/with-skeleton-attribute.js +109 -1
  52. package/src/molecules/gv-card-full.js +209 -1
  53. package/src/molecules/gv-card-list.js +101 -1
  54. package/src/molecules/gv-card.js +130 -1
  55. package/src/molecules/gv-category-list.js +56 -1
  56. package/src/molecules/gv-category.js +163 -1
  57. package/src/molecules/gv-code.js +334 -1
  58. package/src/molecules/gv-confirm.js +175 -1
  59. package/src/molecules/gv-cron-editor.js +685 -1
  60. package/src/molecules/gv-dropdown-menu.js +108 -1
  61. package/src/molecules/gv-expandable.js +116 -1
  62. package/src/molecules/gv-expression-language.js +263 -1
  63. package/src/molecules/gv-identity-picture.js +139 -1
  64. package/src/molecules/gv-list.js +214 -1
  65. package/src/molecules/gv-metrics.js +147 -1
  66. package/src/molecules/gv-modal.js +203 -1
  67. package/src/molecules/gv-nav.js +180 -1
  68. package/src/molecules/gv-option.js +230 -1
  69. package/src/molecules/gv-plans.js +400 -1
  70. package/src/molecules/gv-popover.js +323 -1
  71. package/src/molecules/gv-promote.js +203 -1
  72. package/src/molecules/gv-rating-list.js +341 -1
  73. package/src/molecules/gv-rating.js +234 -1
  74. package/src/molecules/gv-row-expandable.js +42 -1
  75. package/src/molecules/gv-row.js +205 -1
  76. package/src/molecules/gv-stats.js +110 -1
  77. package/src/molecules/gv-stepper.js +274 -1
  78. package/src/molecules/gv-table.js +644 -1
  79. package/src/molecules/gv-tree.js +238 -1
  80. package/src/organisms/gv-documentation.js +205 -1
  81. package/src/organisms/gv-header.js +276 -1
  82. package/src/organisms/gv-http-client.js +258 -1
  83. package/src/organisms/gv-menu.js +258 -1
  84. package/src/organisms/gv-newsletter-subscription.js +258 -1
  85. package/src/organisms/gv-pagination.js +179 -1
  86. package/src/organisms/gv-properties.js +860 -1
  87. package/src/organisms/gv-resizable-views.js +371 -1
  88. package/src/organisms/gv-resources.js +496 -1
  89. package/src/organisms/gv-schema-form-array.js +237 -1
  90. package/src/organisms/gv-schema-form-control-object.js +141 -1
  91. package/src/organisms/gv-schema-form-control.js +419 -1
  92. package/src/organisms/gv-schema-form.js +700 -1
  93. package/src/organisms/gv-tabs.js +201 -1
  94. package/src/organisms/gv-user-menu.js +298 -1
  95. package/src/organisms/gv-vertical-menu.js +119 -1
  96. package/src/policy-studio/gv-flow-step.js +443 -1
  97. package/src/policy-studio/gv-flow.js +595 -1
  98. package/src/policy-studio/gv-policy-studio-menu.js +689 -1
  99. package/src/policy-studio/gv-policy-studio.js +1712 -1
  100. package/src/styles/empty.js +35 -1
  101. package/src/styles/input.js +262 -1
  102. package/src/styles/link.js +31 -1
  103. package/src/styles/shapes.js +17 -1
  104. package/src/styles/skeleton.js +52 -1
  105. package/src/styles/zoom.js +39 -1
  106. package/src/theme/gv-theme.js +197 -1
  107. package/wc/gv-autocomplete.js +1 -1
  108. package/wc/gv-button.js +1 -1
  109. package/wc/gv-card-full.js +1 -1
  110. package/wc/gv-card-list.js +1 -1
  111. package/wc/gv-card.js +1 -1
  112. package/wc/gv-category-list.js +1 -1
  113. package/wc/gv-category.js +1 -1
  114. package/wc/gv-chart-bar.js +1 -1
  115. package/wc/gv-chart-gauge.js +1 -1
  116. package/wc/gv-chart-histogram.js +1 -1
  117. package/wc/gv-chart-line.js +1 -1
  118. package/wc/gv-chart-map.js +1 -1
  119. package/wc/gv-chart-pie.js +1 -1
  120. package/wc/gv-checkbox.js +1 -1
  121. package/wc/gv-code.js +1 -1
  122. package/wc/gv-confirm.js +1 -1
  123. package/wc/gv-cron-editor.js +1 -1
  124. package/wc/gv-date-picker-calendar.js +1 -1
  125. package/wc/gv-date-picker-cell.js +1 -1
  126. package/wc/gv-date-picker.js +1 -1
  127. package/wc/gv-documentation.js +1 -1
  128. package/wc/gv-dropdown-menu.js +1 -1
  129. package/wc/gv-expandable.js +1 -1
  130. package/wc/gv-expression-language.js +1 -1
  131. package/wc/gv-file-upload.js +1 -1
  132. package/wc/gv-flow-step.js +1 -1
  133. package/wc/gv-flow.js +1 -1
  134. package/wc/gv-header.js +1 -1
  135. package/wc/gv-http-client.js +1 -1
  136. package/wc/gv-icon.js +1 -1
  137. package/wc/gv-identity-picture.js +1 -1
  138. package/wc/gv-image.js +1 -1
  139. package/wc/gv-input-message.js +1 -1
  140. package/wc/gv-input.js +1 -1
  141. package/wc/gv-link.js +1 -1
  142. package/wc/gv-list.js +1 -1
  143. package/wc/gv-menu.js +1 -1
  144. package/wc/gv-message.js +1 -1
  145. package/wc/gv-metric.js +1 -1
  146. package/wc/gv-metrics.js +1 -1
  147. package/wc/gv-modal.js +1 -1
  148. package/wc/gv-nav.js +1 -1
  149. package/wc/gv-newsletter-subscription.js +1 -1
  150. package/wc/gv-option.js +1 -1
  151. package/wc/gv-pagination.js +1 -1
  152. package/wc/gv-plans.js +1 -1
  153. package/wc/gv-policy-studio-menu.js +1 -1
  154. package/wc/gv-policy-studio.js +1 -1
  155. package/wc/gv-popover.js +1 -1
  156. package/wc/gv-promote.js +1 -1
  157. package/wc/gv-properties.js +1 -1
  158. package/wc/gv-rating-list.js +1 -1
  159. package/wc/gv-rating.js +1 -1
  160. package/wc/gv-relative-time.js +1 -1
  161. package/wc/gv-resizable-views.js +1 -1
  162. package/wc/gv-resources.js +1 -1
  163. package/wc/gv-row-expandable.js +1 -1
  164. package/wc/gv-row.js +1 -1
  165. package/wc/gv-schema-form-array.js +1 -1
  166. package/wc/gv-schema-form-control-object.js +1 -1
  167. package/wc/gv-schema-form-control.js +1 -1
  168. package/wc/gv-schema-form.js +1 -1
  169. package/wc/gv-select-native.js +1 -1
  170. package/wc/gv-select.js +1 -1
  171. package/wc/gv-spinner.js +1 -1
  172. package/wc/gv-state.js +1 -1
  173. package/wc/gv-stats.js +1 -1
  174. package/wc/gv-stepper.js +1 -1
  175. package/wc/gv-switch.js +1 -1
  176. package/wc/gv-table.js +1 -1
  177. package/wc/gv-tabs.js +1 -1
  178. package/wc/gv-tag.js +1 -1
  179. package/wc/gv-text.js +1 -1
  180. package/wc/gv-theme.js +1 -1
  181. package/wc/gv-tree.js +1 -1
  182. package/wc/gv-user-menu.js +1 -1
  183. package/wc/gv-vertical-menu.js +1 -1
@@ -1 +1,685 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvCronEditor=void 0,require("../atoms/gv-date-picker"),require("../organisms/gv-tabs"),require("../atoms/gv-input"),require("../atoms/gv-tag");const e=require("lit"),t=require("../styles/skeleton"),s=require("../mixins/input-element"),a=require("object-path"),i=require("lit/directives/repeat"),n=require("../mixins/with-resize-observer"),l=require("../lib/cron-expression"),o=require("../lib/events");class r extends((0,n.withResizeObserver)((0,s.InputElement)(e.LitElement))){static get properties(){return{...super.properties,mode:{type:String},_value:{type:String,attribute:!1},_currentDocumentationId:{type:String,attribute:!1},_small:{type:Boolean},_truncateTabs:{type:Boolean}}}constructor(){super(),this._value="",this.readonly=!1,this.autofocus=!1,this.clipboard=!1,this._modes=["seconds","minutes","hourly","daily","weekly","monthly","yearly","pro"],this._timeRange=[...Array(60).keys()],this._days=[{value:"MON",label:"Monday"},{value:"TUE",label:"Tuesday"},{value:"WED",label:"Wednesday"},{value:"THU",label:"Thursday"},{value:"FRI",label:"Friday"},{value:"SAT",label:"Saturday"},{value:"SUN",label:"Sunday"}],this._months=["January","February","March","April","May","June","July","August","September","October","November","December"],this._state={seconds:{seconds:1},minutes:{minutes:1,seconds:0},hourly:{hours:1,minutes:0,seconds:0},daily:{days:1,time:0,weekdays:!1},weekly:{days:[],time:0},monthly:{day:1,month:1,time:0},yearly:{day:1,month:1,time:0},pro:{value:"",displayDetails:!1}},this._docs=[{id:"second",label:"Second"},{id:"minute",label:"Minute"},{id:"hour",label:"Hour"},{id:"day-month",label:"Day (month)"},{id:"month",label:"Month"},{id:"day-week",label:"Day (week)"}],this._currentDocumentationId=this._docs[0].id,this._handleChange=this._onChange.bind(this),this._small=!1}tryToComputeAndInitModeFromValue(){if(!this.value||this.mode)return void(this.mode=this.mode||"pro");const[e,t,s]=this.value.split(" ");/\d+ \d+ \*\/\d+ \* \* \*/.test(this.value)?(this.mode="hourly",this._state.hourly.hours=Number(s.replace("*/","")),this._state.hourly.minutes=Number(t),this._state.hourly.seconds=Number(e)):/\d+ \*\/\d+ \* \* \* \*/.test(this.value)?(this.mode="minutes",this._state.minutes.minutes=Number(t.replace("*/","")),this._state.minutes.seconds=Number(e)):/\*\/\d+ \* \* \* \* \*/.test(this.value)?(this.mode="seconds",this._state.seconds.seconds=Number(e.replace("*/",""))):this.mode="pro"}onResize({width:e}){this._truncateTabs=e<750,this._small=e<449}set value(e){(0,l.isValidCron)(e,{seconds:!0,alias:!0})&&(this._value=e,""===this._state.pro.value&&(this._state.pro.value=e))}get value(){return"pro"===this.mode?this._state.pro.value:this._value}async firstUpdated(){this.tryToComputeAndInitModeFromValue(),await new Promise((e=>setTimeout(e,0))),this.shadowRoot.querySelectorAll("gv-input, gv-date-picker, gv-checkbox, gv-select").forEach((e=>{e.addEventListener(`${e.tagName.toLowerCase()}:input`,this._handleChange)}))}_onOpenDocumentation(e){this._currentDocumentationId=e}_onChange({target:e,detail:t}){if("cron-input"===e.id&&"pro"!==this.mode&&(this.mode="pro"),e.valid){if(null==e.name)throw new Error("Field target must have a name to update the state");let s=t;"gv-date-picker"===e.tagName.toLowerCase()?s=new Date(t):"number"===e.type&&(s=Number(t).valueOf()),(0,a.set)(this._state,e.name,s),this.generate(),e.classList.contains("request-update")&&this.requestUpdate()}}_onChangeTab(e){e.preventDefault(),e.stopPropagation();const{detail:{to:t}}=e;"pro"===t&&(this._state.pro.value=this.value),this.mode=t,this.generate(),"pro"===this.mode&&this.shadowRoot.querySelector("#cron-input").focus()}_getTimeExpression(e){return e?`${e.getSeconds()} ${e.getMinutes()} ${e.getHours()}`:"* * *"}generate(){let e="";switch(this.mode){case"seconds":e=this._state.seconds.seconds?`*/${this._state.seconds.seconds} * * * * *`:"* * * * * *";break;case"minutes":e=this._state.minutes.minutes?`${this._state.minutes.seconds} */${this._state.minutes.minutes} * * * *`:`${this._state.minutes.seconds} * * * * *`;break;case"hourly":e=this._state.hourly.hours?`${this._state.hourly.seconds} ${this._state.hourly.minutes} */${this._state.hourly.hours} * * *`:`${this._state.minutes.seconds} ${this._state.hourly.minutes} * * * *`;break;case"daily":e=!1===this._state.daily.weekdays?`${this._getTimeExpression(this._state.daily.time)} ${this._state.daily.days} * *`:`${this._getTimeExpression(this._state.daily.time)} * * MON-FRI`;break;case"weekly":e=0===this._state.weekly.days.length?`${this._getTimeExpression(this._state.weekly.time)} * * *`:`${this._getTimeExpression(this._state.weekly.time)} * * ${this._state.weekly.days.join(",")}`;break;case"monthly":e=`${this._getTimeExpression(this._state.monthly.time)} ${this._state.monthly.day} ${this._state.monthly.month} *`;break;case"yearly":e=`${this._getTimeExpression(this._state.yearly.time)} ${this._state.yearly.day} */${this._months.indexOf(this._state.yearly.month)+1} *`;break;case"pro":e=this._state.pro.value;break;default:throw new Error("Invalid cron active tab selection")}this.updateState(e),this.valid&&(this._value=e,this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),(0,o.dispatchCustomEvent)(this,"input",this.value))}updateState(e){super.updateState(e),this.valid&&((0,l.isValidCron)(e,{seconds:!0,alias:!0})?this.setValidity():this.setValidity(!0,"field is not valid cron expression"))}renderLabel(){return this.label?e.html`<label for="${this.id}" title="${this.label}">${this.label}</label>`:""}displayProDetails(){this._state.pro.displayDetails=!this._state.pro.displayDetails,this.requestUpdate()}renderProDetails(){return this._state.pro.displayDetails?e.html`<div class="tab-content_pro-pane_container"><div class="tab-content_pro-pane"><div>Rules for:</div><div>${(0,i.repeat)(this._docs,(e=>e.id),(t=>{const s=t.id===this._currentDocumentationId;return e.html`<gv-tag @gv-tag:click="${this._onOpenDocumentation.bind(this,t.id)}" ?clickable="${!s}" ?major="${s}" ?minor="${!s}">${t.label}</gv-tag>`}))}</div><ul class="help"><li><small>Allowed characters: <code>${this.allowedChar}</code></small></li><li><small>Allowed values: <code>${this.allowedValues}</code></small></li></ul></div><div class="tab-content_pro-pane"><div>Examples:</div><ul class="help"><li><small><code>*</code>: for each unit (0, 1, 2, 3...)</small></li><li><small><code>5,8</code>: units 5 and 8</small></li><li><small><code>2-5</code>: units from 2 to 5 (2, 3, 4, 5)</small></li><li><small><code>*/3</code>: every 3 units (0, 3, 6, 9...)</small></li><li><small><code>10-20/3</code>: every 3 units, between the tenth and the twentieth (10, 13, 16, 19)</small></li></ul></div></div>`:""}render(){return e.html`<div>${this.renderLabel()}<div class="box"><gv-tabs .value="${this.mode}" .options="${this._modes}" .disabled="${this.disabled}" ?small="${this._small}" ?truncate="${this._truncateTabs}" @gv-tabs:change="${this._onChangeTab.bind(this)}"><div slot="title" class="generated-expression"><gv-input name="pro.value" .autofocus="${this.autofocus}" .value="${this.value}" id="cron-input" placeholder="* */30 * * * * (Every 30 min)"></gv-input></div><div slot="content" id="seconds" class="tab-content"><span>Every</span><gv-input small type="number" min="1" name="seconds.seconds" .value="${this._state.seconds.seconds}"></gv-input><span>second(s)</span></div><div slot="content" id="minutes" class="tab-content"><span>Every</span><gv-input small type="number" min="1" name="minutes.minutes" .value="${this._state.minutes.minutes}"></gv-input><span>minute(s) on second</span><gv-input small type="number" min="0" max="59" name="minutes.seconds" .value="${this._state.minutes.seconds}"></gv-input></div><div slot="content" id="hourly" class="tab-content"><span>Every</span><gv-input small type="number" min="1" name="hourly.hours" .value="${this._state.hourly.hours}"></gv-input><span>hour(s) on minute</span><gv-input small type="number" min="0" max="59" name="hourly.minutes" .value="${this._state.hourly.minutes}"></gv-input><span>and second</span><gv-input small type="number" min="0" max="59" name="hourly.seconds" .value="${this._state.hourly.seconds}"></gv-input></div><div slot="content" id="daily" class="tab-content"><span>Every</span><gv-input small type="number" min="1" max="31" name="daily.days" ?disabled="${this._state.daily.weekdays}" .value="${this._state.daily.days}"></gv-input><span class="line">day(s)<gv-checkbox class="request-update" label="of week" name="daily.weekdays" ?checked="${this._state.daily.weekdays}"></gv-checkbox>at</span><gv-date-picker small time strict name="daily.time" .value="${this._state.daily.time}"></gv-date-picker></div><div slot="content" id="weekly" class="tab-content tab-content_weekly"><span>Every</span><gv-select small multiple="multiple" name="weekly.days" .options="${this._days}" .value="${this._state.weekly.days}"></gv-select><span>day(s) at</span><gv-date-picker small time strict name="weekly.time" .value="${this._state.weekly.time}"></gv-date-picker></div><div slot="content" id="monthly" class="tab-content"><span>On the</span><gv-input small type="number" min="1" max="31" name="monthly.day" class="request-update" .value="${this._state.monthly.day}"></gv-input><span><sup>${this._getDaySuffix(this._state.monthly.day)}</sup> </span><span>day of every</span><gv-input small type="number" min="1" max="12" name="monthly.month" .value="${this._state.monthly.month}"></gv-input><span>month(s) at</span><gv-date-picker small time strict name="monthly.time" .value="${this._state.monthly.time}"></gv-date-picker></div><div slot="content" id="yearly" class="tab-content"><span>Every</span><gv-select small name="yearly.month" .options="${this._months}" .value="${this._state.yearly.month}"></gv-select><span>on the</span><gv-input small type="number" min="1" max="31" name="yearly.day" class="request-update" .value="${this._state.yearly.day}"></gv-input><span><sup>${this._getDaySuffix(this._state.yearly.day)}</sup></span> <span>day</span><gv-date-picker small time strict name="yearly.time" .value="${this._state.yearly.time}"></gv-date-picker></div><div slot="content" id="pro" class="tab-content tab-content_pro"><gv-button link small class="tab-content_pro-details_btn" @click="${this.displayProDetails}">${this._state.pro.displayDetails?"Hide information about cron rules and examples":"Display information about cron rules and examples"}</gv-button>${this.renderProDetails()}</div></gv-tabs></div></div>`}get allowedValues(){if("pro"===this.mode)switch(this._currentDocumentationId){case"hour":return"0-23";case"day-month":return"1-31";case"month":return"1-12 or JAN-DEC";case"day-week":return"1-7 or SUN-SAT";default:return"0-59"}return""}get allowedChar(){return"pro"===this.mode?",-*/":""}_getDaySuffix(e=1){return e?e.toString().endsWith("1")?"st":e.toString().endsWith("2")?"nd":e.toString().endsWith("3")?"rd":"th":""}static get styles(){return[t.skeleton,e.css`:host{box-sizing:border-box;display:block;margin:.2rem}:host([invalid]) .box{border-left-color:var(--gv-theme-color-error-dark,#d32f2f);border-left-width:3px}.box{border:1px solid var(--gv-theme-neutral-color-dark,#bfbfbf);border-radius:4px}.generated-expression{display:flex;align-items:center;flex:1}.generated-expression>code,.generated-expression>span{margin:.4rem}.generated-expression code,.generated-expression gv-input{--input-small--fz:16px;font-size:16px}.generated-expression gv-input{--gv-input--bdc:transparent;margin:0;min-width:190px}.tab-content{display:flex;align-items:center;background-color:var(--gv-theme-neutral-color,#f5f5f5);font-style:italic;font-size:var(--gv-theme-font-size-s,12px);padding:.2rem}.tab-content>*{margin:.2rem}.tab-content gv-input[type=number]{width:50px}.tab-content_weekly gv-select{width:auto}.tab-content_pro code{font-size:14px;font-weight:700;font-style:normal}.tab-content_pro{display:flex;flex-direction:column;align-items:normal;--gv-icon--s:18px;padding:.2rem}.tab-content_pro-details_btn{--gv-button--fz:12px}.tab-content_pro-pane_container{display:flex;flex-direction:row}.tab-content_pro-pane{flex:auto}.tab-content_pro>*{margin:.2rem}.tab-content_pro gv-icon,.tab-content_pro small{margin:0 .2rem}gv-tabs{--gv-tabs-options--m:auto 0.2rem auto 0}gv-tabs[small]{--gv-tabs-options--m:auto 0}gv-tabs[small] .tab-content{padding:0}.line{display:flex;align-items:center;margin:0}.line>*{margin:0 .3rem}gv-checkbox{text-decoration:line-through;font-weight:400}gv-checkbox[checked]{text-decoration:none}sup{display:inline-block;font-size:var(--gv-theme-font-size-s,12px)}ul{list-style:none;margin:.5rem 1rem;padding:0}ul.help{padding-left:.2rem;margin-left:.4rem;border-left:2px dotted var(--gv-theme-neutral-color-dark,#bfbfbf)}small{font-size:var(--gv-theme-font-size-s,12px)}`]}}exports.GvCronEditor=r,window.customElements.define("gv-cron-editor",r);
1
+ /*
2
+ * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import '../atoms/gv-date-picker';
17
+ import '../organisms/gv-tabs';
18
+ import '../atoms/gv-input';
19
+ import '../atoms/gv-tag';
20
+ import { css, LitElement, html } from 'lit';
21
+ import { skeleton } from '../styles/skeleton';
22
+ import { InputElement } from '../mixins/input-element';
23
+ import { set } from 'object-path';
24
+ import { repeat } from 'lit/directives/repeat';
25
+ import { withResizeObserver } from '../mixins/with-resize-observer';
26
+ import { isValidCron } from '../lib/cron-expression';
27
+ import { dispatchCustomEvent } from '../lib/events';
28
+ /**
29
+ * Cron editor component
30
+ *
31
+ * ## Details
32
+ *
33
+ * @fires gv-cron-editor:input - input events with the `value` on `detail`
34
+ *
35
+ * @attr {String} label - cron editor label
36
+ * @attr {String} value - cron expression
37
+ * @attr {String} mode - the opened mode (if no value is set, the pro mode will be opened)
38
+ *
39
+ * @attr {Boolean} [clipboard=false]- true if field has clipboard button
40
+ * @attr {Boolean} [autofocus=false] - true to put the focus on the input
41
+ * @attr {Boolean} [readonly=false] - true if field is readonly mode
42
+ */
43
+ export class GvCronEditor extends withResizeObserver(InputElement(LitElement)) {
44
+ static get properties() {
45
+ return {
46
+ ...super.properties,
47
+ mode: { type: String },
48
+ _value: { type: String, attribute: false },
49
+ _currentDocumentationId: { type: String, attribute: false },
50
+ _small: { type: Boolean },
51
+ _truncateTabs: { type: Boolean },
52
+ };
53
+ }
54
+ constructor() {
55
+ super();
56
+ this._value = '';
57
+ this.readonly = false;
58
+ this.autofocus = false;
59
+ this.clipboard = false;
60
+ this._modes = ['seconds', 'minutes', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'pro'];
61
+ this._timeRange = [...Array(60).keys()];
62
+ this._days = [
63
+ { value: 'MON', label: 'Monday' },
64
+ { value: 'TUE', label: 'Tuesday' },
65
+ { value: 'WED', label: 'Wednesday' },
66
+ { value: 'THU', label: 'Thursday' },
67
+ { value: 'FRI', label: 'Friday' },
68
+ { value: 'SAT', label: 'Saturday' },
69
+ { value: 'SUN', label: 'Sunday' },
70
+ ];
71
+ this._months = [
72
+ 'January',
73
+ 'February',
74
+ 'March',
75
+ 'April',
76
+ 'May',
77
+ 'June',
78
+ 'July',
79
+ 'August',
80
+ 'September',
81
+ 'October',
82
+ 'November',
83
+ 'December',
84
+ ];
85
+ this._state = {
86
+ seconds: {
87
+ seconds: 1,
88
+ },
89
+ minutes: {
90
+ minutes: 1,
91
+ seconds: 0,
92
+ },
93
+ hourly: {
94
+ hours: 1,
95
+ minutes: 0,
96
+ seconds: 0,
97
+ },
98
+ daily: {
99
+ days: 1,
100
+ time: 0,
101
+ weekdays: false,
102
+ },
103
+ weekly: {
104
+ days: [],
105
+ time: 0,
106
+ },
107
+ monthly: {
108
+ day: 1,
109
+ month: 1,
110
+ time: 0,
111
+ },
112
+ yearly: {
113
+ day: 1,
114
+ month: 1,
115
+ time: 0,
116
+ },
117
+ pro: {
118
+ value: '',
119
+ displayDetails: false,
120
+ },
121
+ };
122
+ this._docs = [
123
+ { id: 'second', label: 'Second' },
124
+ { id: 'minute', label: 'Minute' },
125
+ { id: 'hour', label: 'Hour' },
126
+ { id: 'day-month', label: 'Day (month)' },
127
+ { id: 'month', label: 'Month' },
128
+ { id: 'day-week', label: 'Day (week)' },
129
+ ];
130
+ this._currentDocumentationId = this._docs[0].id;
131
+ this._handleChange = this._onChange.bind(this);
132
+ this._small = false;
133
+ }
134
+ tryToComputeAndInitModeFromValue() {
135
+ if (!this.value || this.mode) {
136
+ this.mode = this.mode || 'pro';
137
+ return;
138
+ }
139
+ const [seconds, minutes, hours] = this.value.split(' ');
140
+ if (/\d+ \d+ \*\/\d+ \* \* \*/.test(this.value)) {
141
+ // Match: `1 42 */15 * * *`
142
+ this.mode = 'hourly';
143
+ this._state.hourly.hours = Number(hours.replace('*/', ''));
144
+ this._state.hourly.minutes = Number(minutes);
145
+ this._state.hourly.seconds = Number(seconds);
146
+ }
147
+ else if (/\d+ \*\/\d+ \* \* \* \*/.test(this.value)) {
148
+ // Match: `1 */15 * * * *`
149
+ this.mode = 'minutes';
150
+ this._state.minutes.minutes = Number(minutes.replace('*/', ''));
151
+ this._state.minutes.seconds = Number(seconds);
152
+ }
153
+ else if (/\*\/\d+ \* \* \* \* \*/.test(this.value)) {
154
+ // Match: `*/15 * * * * *`
155
+ this.mode = 'seconds';
156
+ this._state.seconds.seconds = Number(seconds.replace('*/', ''));
157
+ }
158
+ else {
159
+ this.mode = 'pro';
160
+ }
161
+ }
162
+ onResize({ width }) {
163
+ this._truncateTabs = width < 750;
164
+ this._small = width < 449;
165
+ }
166
+ set value(value) {
167
+ if (isValidCron(value, { seconds: true, alias: true })) {
168
+ this._value = value;
169
+ if (this._state.pro.value === '') {
170
+ this._state.pro.value = value;
171
+ }
172
+ }
173
+ }
174
+ get value() {
175
+ if (this.mode === 'pro') {
176
+ return this._state.pro.value;
177
+ }
178
+ return this._value;
179
+ }
180
+ async firstUpdated() {
181
+ this.tryToComputeAndInitModeFromValue();
182
+ // Give the browser a chance to paint
183
+ // eslint-disable-next-line promise/param-names
184
+ await new Promise((r) => setTimeout(r, 0));
185
+ this.shadowRoot.querySelectorAll('gv-input, gv-date-picker, gv-checkbox, gv-select').forEach((element) => {
186
+ element.addEventListener(`${element.tagName.toLowerCase()}:input`, this._handleChange);
187
+ });
188
+ }
189
+ _onOpenDocumentation(docId) {
190
+ this._currentDocumentationId = docId;
191
+ }
192
+ _onChange({ target, detail }) {
193
+ if (target.id === 'cron-input' && this.mode !== 'pro') {
194
+ this.mode = 'pro';
195
+ }
196
+ if (target.valid) {
197
+ if (target.name == null) {
198
+ throw new Error('Field target must have a name to update the state');
199
+ }
200
+ const tagName = target.tagName.toLowerCase();
201
+ let value = detail;
202
+ if (tagName === 'gv-date-picker') {
203
+ value = new Date(detail);
204
+ }
205
+ else if (target.type === 'number') {
206
+ value = Number(detail).valueOf();
207
+ }
208
+ set(this._state, target.name, value);
209
+ this.generate();
210
+ if (target.classList.contains('request-update')) {
211
+ this.requestUpdate();
212
+ }
213
+ }
214
+ }
215
+ _onChangeTab(event) {
216
+ event.preventDefault();
217
+ event.stopPropagation();
218
+ const { detail: { to }, } = event;
219
+ if (to === 'pro') {
220
+ // Needs to be done first otherwise `value` is overridden before using it
221
+ this._state.pro.value = this.value;
222
+ }
223
+ this.mode = to;
224
+ this.generate();
225
+ if (this.mode === 'pro') {
226
+ this.shadowRoot.querySelector('#cron-input').focus();
227
+ }
228
+ }
229
+ _getTimeExpression(date) {
230
+ if (date) {
231
+ return `${date.getSeconds()} ${date.getMinutes()} ${date.getHours()}`;
232
+ }
233
+ return '* * *';
234
+ }
235
+ generate() {
236
+ let tmpValue = '';
237
+ switch (this.mode) {
238
+ case 'seconds':
239
+ if (this._state.seconds.seconds) {
240
+ tmpValue = `*/${this._state.seconds.seconds} * * * * *`;
241
+ }
242
+ else {
243
+ tmpValue = `* * * * * *`;
244
+ }
245
+ break;
246
+ case 'minutes':
247
+ if (this._state.minutes.minutes) {
248
+ tmpValue = `${this._state.minutes.seconds} */${this._state.minutes.minutes} * * * *`;
249
+ }
250
+ else {
251
+ tmpValue = `${this._state.minutes.seconds} * * * * *`;
252
+ }
253
+ break;
254
+ case 'hourly':
255
+ if (this._state.hourly.hours) {
256
+ tmpValue = `${this._state.hourly.seconds} ${this._state.hourly.minutes} */${this._state.hourly.hours} * * *`;
257
+ }
258
+ else {
259
+ tmpValue = `${this._state.minutes.seconds} ${this._state.hourly.minutes} * * * *`;
260
+ }
261
+ break;
262
+ case 'daily':
263
+ if (this._state.daily.weekdays === false) {
264
+ tmpValue = `${this._getTimeExpression(this._state.daily.time)} ${this._state.daily.days} * *`;
265
+ }
266
+ else {
267
+ tmpValue = `${this._getTimeExpression(this._state.daily.time)} * * MON-FRI`;
268
+ }
269
+ break;
270
+ case 'weekly':
271
+ if (this._state.weekly.days.length === 0) {
272
+ tmpValue = `${this._getTimeExpression(this._state.weekly.time)} * * *`;
273
+ }
274
+ else {
275
+ tmpValue = `${this._getTimeExpression(this._state.weekly.time)} * * ${this._state.weekly.days.join(',')}`;
276
+ }
277
+ break;
278
+ case 'monthly':
279
+ tmpValue = `${this._getTimeExpression(this._state.monthly.time)} ${this._state.monthly.day} ${this._state.monthly.month} *`;
280
+ break;
281
+ case 'yearly':
282
+ tmpValue = `${this._getTimeExpression(this._state.yearly.time)} ${this._state.yearly.day} */${this._months.indexOf(this._state.yearly.month) + 1} *`;
283
+ break;
284
+ case 'pro':
285
+ tmpValue = this._state.pro.value;
286
+ break;
287
+ default:
288
+ throw new Error('Invalid cron active tab selection');
289
+ }
290
+ this.updateState(tmpValue);
291
+ if (this.valid) {
292
+ this._value = tmpValue;
293
+ this.dispatchEvent(new Event('input', { bubbles: true, cancelable: true }));
294
+ dispatchCustomEvent(this, 'input', this.value);
295
+ }
296
+ }
297
+ updateState(value) {
298
+ super.updateState(value);
299
+ if (this.valid) {
300
+ if (isValidCron(value, { seconds: true, alias: true })) {
301
+ this.setValidity();
302
+ }
303
+ else {
304
+ this.setValidity(true, 'field is not valid cron expression');
305
+ }
306
+ }
307
+ }
308
+ renderLabel() {
309
+ if (this.label) {
310
+ return html `<label for=${this.id} title="${this.label}">${this.label}</label>`;
311
+ }
312
+ return '';
313
+ }
314
+ displayProDetails() {
315
+ this._state.pro.displayDetails = !this._state.pro.displayDetails;
316
+ this.requestUpdate();
317
+ }
318
+ renderProDetails() {
319
+ if (this._state.pro.displayDetails) {
320
+ return html `<div class="tab-content_pro-pane_container">
321
+ <div class="tab-content_pro-pane">
322
+ <div>Rules for:</div>
323
+ <div>
324
+ ${repeat(this._docs, (doc) => doc.id, (doc) => {
325
+ const isCurrent = doc.id === this._currentDocumentationId;
326
+ return html ` <gv-tag
327
+ @gv-tag:click="${this._onOpenDocumentation.bind(this, doc.id)}"
328
+ ?clickable="${!isCurrent}"
329
+ ?major="${isCurrent}"
330
+ ?minor="${!isCurrent}"
331
+ >${doc.label}</gv-tag
332
+ >`;
333
+ })}
334
+ </div>
335
+ <ul class="help">
336
+ <li>
337
+ <small>Allowed characters: <code>${this.allowedChar}</code></small>
338
+ </li>
339
+ <li>
340
+ <small>Allowed values: <code>${this.allowedValues}</code></small>
341
+ </li>
342
+ </ul>
343
+ </div>
344
+ <div class="tab-content_pro-pane">
345
+ <div>Examples:</div>
346
+ <ul class="help">
347
+ <li>
348
+ <small><code>*</code>: for each unit (0, 1, 2, 3...)</small>
349
+ </li>
350
+ <li>
351
+ <small><code>5,8</code>: units 5 and 8</small>
352
+ </li>
353
+ <li>
354
+ <small><code>2-5</code>: units from 2 to 5 (2, 3, 4, 5)</small>
355
+ </li>
356
+ <li>
357
+ <small><code>*/3</code>: every 3 units (0, 3, 6, 9...)</small>
358
+ </li>
359
+ <li>
360
+ <small><code>10-20/3</code>: every 3 units, between the tenth and the twentieth (10, 13, 16, 19)</small>
361
+ </li>
362
+ </ul>
363
+ </div>
364
+ </div>`;
365
+ }
366
+ return '';
367
+ }
368
+ render() {
369
+ return html `<div>
370
+ ${this.renderLabel()}
371
+ <div class="box">
372
+ <gv-tabs
373
+ .value="${this.mode}"
374
+ .options="${this._modes}"
375
+ .disabled="${this.disabled}"
376
+ ?small="${this._small}"
377
+ ?truncate="${this._truncateTabs}"
378
+ @gv-tabs:change="${this._onChangeTab.bind(this)}"
379
+ >
380
+ <div slot="title" class="generated-expression">
381
+ <gv-input
382
+ name="pro.value"
383
+ .autofocus="${this.autofocus}"
384
+ .value="${this.value}"
385
+ id="cron-input"
386
+ placeholder="* */30 * * * * (Every 30 min)"
387
+ ></gv-input>
388
+ </div>
389
+
390
+ <div slot="content" id="seconds" class="tab-content">
391
+ <span>Every</span>
392
+ <gv-input small type="number" min="1" name="seconds.seconds" .value="${this._state.seconds.seconds}"></gv-input>
393
+ <span>second(s)</span>
394
+ </div>
395
+
396
+ <div slot="content" id="minutes" class="tab-content">
397
+ <span>Every</span>
398
+ <gv-input small type="number" min="1" name="minutes.minutes" .value="${this._state.minutes.minutes}"></gv-input>
399
+ <span>minute(s) on second</span>
400
+ <gv-input small type="number" min="0" max="59" name="minutes.seconds" .value="${this._state.minutes.seconds}"></gv-input>
401
+ </div>
402
+
403
+ <div slot="content" id="hourly" class="tab-content">
404
+ <span>Every</span>
405
+ <gv-input small type="number" min="1" name="hourly.hours" .value="${this._state.hourly.hours}"></gv-input>
406
+ <span>hour(s) on minute</span>
407
+ <gv-input small type="number" min="0" max="59" name="hourly.minutes" .value="${this._state.hourly.minutes}"></gv-input>
408
+ <span>and second</span>
409
+ <gv-input small type="number" min="0" max="59" name="hourly.seconds" .value="${this._state.hourly.seconds}"></gv-input>
410
+ </div>
411
+
412
+ <div slot="content" id="daily" class="tab-content">
413
+ <span>Every</span>
414
+ <gv-input
415
+ small
416
+ type="number"
417
+ min="1"
418
+ max="31"
419
+ name="daily.days"
420
+ ?disabled="${this._state.daily.weekdays}"
421
+ .value="${this._state.daily.days}"
422
+ ></gv-input>
423
+ <span class="line">
424
+ day(s)
425
+ <gv-checkbox
426
+ class="request-update"
427
+ label="of week"
428
+ name="daily.weekdays"
429
+ ?checked="${this._state.daily.weekdays}"
430
+ ></gv-checkbox>
431
+ at</span
432
+ >
433
+ <gv-date-picker small time strict name="daily.time" .value="${this._state.daily.time}"></gv-date-picker>
434
+ </div>
435
+
436
+ <div slot="content" id="weekly" class="tab-content tab-content_weekly">
437
+ <span>Every</span>
438
+ <gv-select small multiple name="weekly.days" .options="${this._days}" .value="${this._state.weekly.days}"></gv-select>
439
+ <span>day(s) at</span>
440
+ <gv-date-picker small time strict name="weekly.time" .value="${this._state.weekly.time}"></gv-date-picker>
441
+ </div>
442
+
443
+ <div slot="content" id="monthly" class="tab-content">
444
+ <span>On the</span>
445
+ <gv-input
446
+ small
447
+ type="number"
448
+ min="1"
449
+ max="31"
450
+ name="monthly.day"
451
+ class="request-update"
452
+ .value="${this._state.monthly.day}"
453
+ ></gv-input>
454
+ <span><sup>${this._getDaySuffix(this._state.monthly.day)}</sup> </span>
455
+ <span>day of every</span>
456
+ <gv-input small type="number" min="1" max="12" name="monthly.month" .value="${this._state.monthly.month}"></gv-input>
457
+ <span>month(s) at</span>
458
+ <gv-date-picker small time strict name="monthly.time" .value="${this._state.monthly.time}"></gv-date-picker>
459
+ </div>
460
+
461
+ <div slot="content" id="yearly" class="tab-content">
462
+ <span>Every</span>
463
+ <gv-select small name="yearly.month" .options="${this._months}" .value="${this._state.yearly.month}"></gv-select>
464
+ <span>on the</span>
465
+ <gv-input
466
+ small
467
+ type="number"
468
+ min="1"
469
+ max="31"
470
+ name="yearly.day"
471
+ class="request-update"
472
+ .value="${this._state.yearly.day}"
473
+ ></gv-input>
474
+ <span><sup>${this._getDaySuffix(this._state.yearly.day)}</sup></span>
475
+ <span>day</span>
476
+ <gv-date-picker small time strict name="yearly.time" .value="${this._state.yearly.time}"></gv-date-picker>
477
+ </div>
478
+
479
+ <div slot="content" id="pro" class="tab-content tab-content_pro">
480
+ <gv-button link small class="tab-content_pro-details_btn" @click="${this.displayProDetails}">
481
+ ${this._state.pro.displayDetails
482
+ ? 'Hide information about cron rules and examples'
483
+ : 'Display information about cron rules and examples'}
484
+ </gv-button>
485
+ ${this.renderProDetails()}
486
+ </div>
487
+ </gv-tabs>
488
+ </div>
489
+ </div>`;
490
+ }
491
+ get allowedValues() {
492
+ if (this.mode === 'pro') {
493
+ switch (this._currentDocumentationId) {
494
+ case 'hour':
495
+ return '0-23';
496
+ case 'day-month':
497
+ return '1-31';
498
+ case 'month':
499
+ return '1-12 or JAN-DEC';
500
+ case 'day-week':
501
+ return '1-7 or SUN-SAT';
502
+ default:
503
+ return '0-59';
504
+ }
505
+ }
506
+ return '';
507
+ }
508
+ get allowedChar() {
509
+ if (this.mode === 'pro') {
510
+ return ',-*/';
511
+ }
512
+ return '';
513
+ }
514
+ _getDaySuffix(day = 1) {
515
+ if (day) {
516
+ if (day.toString().endsWith('1')) {
517
+ return 'st';
518
+ }
519
+ else if (day.toString().endsWith('2')) {
520
+ return 'nd';
521
+ }
522
+ else if (day.toString().endsWith('3')) {
523
+ return 'rd';
524
+ }
525
+ return 'th';
526
+ }
527
+ return '';
528
+ }
529
+ static get styles() {
530
+ return [
531
+ skeleton,
532
+ // language=CSS
533
+ css `
534
+ :host {
535
+ box-sizing: border-box;
536
+ display: block;
537
+ margin: 0.2rem;
538
+ }
539
+
540
+ :host([invalid]) .box {
541
+ border-left-color: var(--gv-theme-color-error-dark, #d32f2f);
542
+ border-left-width: 3px;
543
+ }
544
+
545
+ .box {
546
+ border: 1px solid var(--gv-theme-neutral-color-dark, #bfbfbf);
547
+ border-radius: 4px;
548
+ }
549
+
550
+ .generated-expression {
551
+ display: flex;
552
+ align-items: center;
553
+ flex: 1;
554
+ }
555
+
556
+ .generated-expression > span,
557
+ .generated-expression > code {
558
+ margin: 0.4rem;
559
+ }
560
+
561
+ .generated-expression gv-input,
562
+ .generated-expression code {
563
+ --input-small--fz: 16px;
564
+ font-size: 16px;
565
+ }
566
+
567
+ .generated-expression gv-input {
568
+ --gv-input--bdc: transparent;
569
+ margin: 0;
570
+ min-width: 190px;
571
+ }
572
+
573
+ .tab-content {
574
+ display: flex;
575
+ align-items: center;
576
+ background-color: var(--gv-theme-neutral-color, #f5f5f5);
577
+ font-style: italic;
578
+ font-size: var(--gv-theme-font-size-s, 12px);
579
+ padding: 0.2rem;
580
+ }
581
+
582
+ .tab-content > * {
583
+ margin: 0.2rem;
584
+ }
585
+
586
+ .tab-content gv-input[type='number'] {
587
+ width: 50px;
588
+ }
589
+
590
+ .tab-content_weekly gv-select {
591
+ width: auto;
592
+ }
593
+
594
+ .tab-content_pro code {
595
+ font-size: 14px;
596
+ font-weight: bold;
597
+ font-style: normal;
598
+ }
599
+
600
+ .tab-content_pro {
601
+ display: flex;
602
+ flex-direction: column;
603
+ align-items: normal;
604
+ --gv-icon--s: 18px;
605
+ padding: 0.2rem;
606
+ }
607
+
608
+ .tab-content_pro-details_btn {
609
+ --gv-button--fz: 12px;
610
+ }
611
+
612
+ .tab-content_pro-pane_container {
613
+ display: flex;
614
+ flex-direction: row;
615
+ }
616
+
617
+ .tab-content_pro-pane {
618
+ flex: auto;
619
+ }
620
+
621
+ .tab-content_pro > * {
622
+ margin: 0.2rem;
623
+ }
624
+
625
+ .tab-content_pro small,
626
+ .tab-content_pro gv-icon {
627
+ margin: 0 0.2rem;
628
+ }
629
+
630
+ gv-tabs {
631
+ --gv-tabs-options--m: auto 0.2rem auto 0;
632
+ }
633
+
634
+ gv-tabs[small] {
635
+ --gv-tabs-options--m: auto 0;
636
+ }
637
+
638
+ gv-tabs[small] .tab-content {
639
+ padding: 0;
640
+ }
641
+
642
+ .line {
643
+ display: flex;
644
+ align-items: center;
645
+ margin: 0;
646
+ }
647
+
648
+ .line > * {
649
+ margin: 0 0.3rem;
650
+ }
651
+
652
+ gv-checkbox {
653
+ text-decoration: line-through;
654
+ font-weight: normal;
655
+ }
656
+
657
+ gv-checkbox[checked] {
658
+ text-decoration: none;
659
+ }
660
+
661
+ sup {
662
+ display: inline-block;
663
+ font-size: var(--gv-theme-font-size-s, 12px);
664
+ }
665
+
666
+ ul {
667
+ list-style: none;
668
+ margin: 0.5rem 1rem;
669
+ padding: 0;
670
+ }
671
+
672
+ ul.help {
673
+ padding-left: 0.2rem;
674
+ margin-left: 0.4rem;
675
+ border-left: 2px dotted var(--gv-theme-neutral-color-dark, #bfbfbf);
676
+ }
677
+
678
+ small {
679
+ font-size: var(--gv-theme-font-size-s, 12px);
680
+ }
681
+ `,
682
+ ];
683
+ }
684
+ }
685
+ window.customElements.define('gv-cron-editor', GvCronEditor);