@limetech/lime-elements 39.39.0 → 39.40.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.
@@ -36,6 +36,7 @@ import { FileInfo } from '../../global/shared-types/file.types';
36
36
  * @exampleComponent limel-example-file-per-file-loading
37
37
  * @exampleComponent limel-example-file-per-file-progress
38
38
  * @exampleComponent limel-example-file-per-file-invalid
39
+ * @exampleComponent limel-example-file-per-file-status
39
40
  * @exampleComponent limel-example-file-menu-items
40
41
  * @exampleComponent limel-example-file-accepted-types
41
42
  * @exampleComponent limel-example-file-composite
@@ -94,6 +95,7 @@ export declare class File {
94
95
  */
95
96
  private interact;
96
97
  render(): any;
98
+ private get statusText();
97
99
  /**
98
100
  * The component is busy for any reason: its own `loading`, or a file that
99
101
  * is `loading` or has `progress` (including `0`). Completion is signalled
@@ -106,6 +108,7 @@ export declare class File {
106
108
  private dropZoneTip;
107
109
  private handleNewFiles;
108
110
  private getChipArray;
111
+ private getBadge;
109
112
  private renderChipset;
110
113
  private handleChipSetChange;
111
114
  private handleChipInteract;
@@ -120,7 +120,13 @@ export declare class FileViewer {
120
120
  private renderOffice;
121
121
  private isOfficeFileAccessibleViaURL;
122
122
  private getOfficeViewerUrl;
123
- private renderNoFileSupportMessage;
123
+ /**
124
+ * @param withDownloadButton whether to render a download button as a
125
+ * recovery option. Should be `false` when the message is shown as
126
+ * fallback content alongside the buttons bar, which already renders the
127
+ * download button when enabled, to avoid showing two download buttons.
128
+ */
129
+ private readonly renderNoFileSupportMessage;
124
130
  private renderFileNotFoundMessage;
125
131
  private renderButtons;
126
132
  private renderToggleFullscreenButton;
@@ -1602,6 +1602,7 @@ export namespace Components {
1602
1602
  * @exampleComponent limel-example-file-per-file-loading
1603
1603
  * @exampleComponent limel-example-file-per-file-progress
1604
1604
  * @exampleComponent limel-example-file-per-file-invalid
1605
+ * @exampleComponent limel-example-file-per-file-status
1605
1606
  * @exampleComponent limel-example-file-menu-items
1606
1607
  * @exampleComponent limel-example-file-accepted-types
1607
1608
  * @exampleComponent limel-example-file-composite
@@ -5115,6 +5116,7 @@ declare global {
5115
5116
  * @exampleComponent limel-example-file-per-file-loading
5116
5117
  * @exampleComponent limel-example-file-per-file-progress
5117
5118
  * @exampleComponent limel-example-file-per-file-invalid
5119
+ * @exampleComponent limel-example-file-per-file-status
5118
5120
  * @exampleComponent limel-example-file-menu-items
5119
5121
  * @exampleComponent limel-example-file-accepted-types
5120
5122
  * @exampleComponent limel-example-file-composite
@@ -8206,6 +8208,7 @@ declare namespace LocalJSX {
8206
8208
  * @exampleComponent limel-example-file-per-file-loading
8207
8209
  * @exampleComponent limel-example-file-per-file-progress
8208
8210
  * @exampleComponent limel-example-file-per-file-invalid
8211
+ * @exampleComponent limel-example-file-per-file-status
8209
8212
  * @exampleComponent limel-example-file-menu-items
8210
8213
  * @exampleComponent limel-example-file-accepted-types
8211
8214
  * @exampleComponent limel-example-file-composite
@@ -12055,6 +12058,7 @@ declare module "@stencil/core" {
12055
12058
  * @exampleComponent limel-example-file-per-file-loading
12056
12059
  * @exampleComponent limel-example-file-per-file-progress
12057
12060
  * @exampleComponent limel-example-file-per-file-invalid
12061
+ * @exampleComponent limel-example-file-per-file-status
12058
12062
  * @exampleComponent limel-example-file-menu-items
12059
12063
  * @exampleComponent limel-example-file-accepted-types
12060
12064
  * @exampleComponent limel-example-file-composite
@@ -87,6 +87,16 @@ export interface FileInfo {
87
87
  * upload, as a percentage. Must be a number between `0` and `100`.
88
88
  */
89
89
  progress?: number;
90
+ /**
91
+ * A short label describing the file's current state, such as
92
+ * `Uploading…`, `Scanning for viruses…` or `Failed`. When set, it replaces
93
+ * the file size badge on the chip, and is read by assistive technologies as
94
+ * part of the chip's accessible name.
95
+ *
96
+ * Prefer `progress` for a measurable value like a percentage, so it is
97
+ * shown as a progress bar instead of rapidly-changing text.
98
+ */
99
+ statusText?: string;
90
100
  /**
91
101
  * Set to `true` to mark the file as invalid, rendering it in an error
92
102
  * state. This is independent of the component's own `invalid` state.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.39.0",
3
+ "version": "39.40.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -1 +0,0 @@
1
- import{r as i,c as t,h as e,H as s}from"./p-BGxJfR2f.js";import{t as r}from"./p-EPnIW0K5.js";import{g as n,a,b as o,c as h}from"./p-BCq5M9TE.js";import{f as l}from"./p-u_sd2HMb.js";import"./p-Bu_YRgCL.js";import"./p-CgNJbSP4.js";const d={id:null,text:null,removable:!0},p=class{constructor(e){i(this,e),this.change=t(this,"change"),this.interact=t(this,"interact"),this.required=!1,this.disabled=!1,this.readonly=!1,this.invalid=!1,this.loading=!1,this.accept="*",this.language="en",this.dropZoneTip=()=>this.getTranslation("file.drag-and-drop-tips"),this.handleNewFiles=i=>{this.preventAndStop(i),this.change.emit(i.detail[0])},this.handleChipSetChange=i=>{i.stopPropagation();const t=0===i.detail.length?i.detail[0]:null;t||this.change.emit(t)},this.handleChipInteract=i=>{this.preventAndStop(i),this.interact.emit(i.detail.id)}}render(){return e(s,{key:"aba4dcef1d93c610ef95cc91b1e1c64674bf767d","aria-busy":this.isBusy?"true":"false"},e("limel-file-dropzone",{key:"48bebc39d3c7a271528aee8450db766a5c4399db",disabled:this.disabled||this.readonly||!!this.value,accept:this.accept,onFilesSelected:this.handleNewFiles},this.renderChipset()),this.renderDragAndDropTip(),this.renderSpinner())}get isBusy(){var i,t;return this.loading||Boolean(null===(i=this.value)||void 0===i?void 0:i.loading)||void 0!==(null===(t=this.value)||void 0===t?void 0:t.progress)}renderSpinner(){if(this.isBusy)return e("limel-spinner",null)}renderDragAndDropTip(){if(!(this.value||this.disabled||this.readonly||this.isBusy))return e("div",{class:"drag-and-drop-tip"},e("span",{class:"invisible-label-mock",role:"presentation"},this.label),e("span",{class:"tip"},this.dropZoneTip()))}getChipArray(){if(!this.value)return[];const i="number"==typeof this.value.size?l(this.value.size):void 0;return[Object.assign(Object.assign({},d),{text:this.value.filename,id:this.value.id,icon:{name:h(this.value),title:o(this.value),color:a(this.value),backgroundColor:n(this.value)},badge:i,href:this.value.href,menuItems:this.value.menuItems,loading:this.value.loading,progress:this.value.progress,invalid:this.value.invalid})]}renderChipset(){const i=e("limel-chip-set",{disabled:this.disabled,readonly:this.readonly,invalid:this.invalid,label:this.label,helperText:this.helperText,leadingIcon:"upload_to_cloud",language:this.language,onChange:this.handleChipSetChange,onInteract:this.handleChipInteract,required:this.required,type:"input",value:this.getChipArray()});return this.value?i:e("limel-file-input",{accept:this.accept,disabled:this.disabled||this.readonly},i)}preventAndStop(i){i.stopPropagation(),i.preventDefault()}getTranslation(i){return r.get(i,this.language)}};p.style='@charset "UTF-8";:host(limel-file){--badge-max-width:auto;position:relative}.drag-and-drop-tip{pointer-events:none;position:absolute;box-sizing:border-box;margin:0.25rem;inset:0;display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;border-radius:0.25rem;border:1px dashed rgb(var(--contrast-700));padding:0 0.5rem}.drag-and-drop-tip .invisible-label-mock{flex-shrink:0;opacity:0;padding-right:1rem;padding-left:1.5rem}.drag-and-drop-tip .tip{font-size:smaller;color:var(--limel-theme-text-secondary-on-background-color);height:auto;max-height:3rem;line-height:1;display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}limel-spinner{pointer-events:none;position:absolute;inset:0 0.375rem 0 auto;margin:auto}';export{p as limel_file}