@luzmo/analytics-components-kit 1.0.9-beta.4 → 1.0.9-beta.6
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.
- package/README.md +1 -1
- package/package.json +2 -2
- package/react/package.json +2 -2
- package/standalone/chunks/base-CR5wZnQk.js +2 -0
- package/standalone/chunks/display-settings-binning-D3wYG0p7.js +38 -0
- package/standalone/chunks/display-settings-datetime-D37ERF0v.js +199 -0
- package/standalone/chunks/display-settings-grand-totals-CKm9PkBj.js +26 -0
- package/standalone/chunks/display-settings-numeric-f9Mdphm-.js +172 -0
- package/standalone/chunks/{display-settings-period-over-period-Bwjoji3a.js → display-settings-period-over-period-Cl-vLKk3.js} +1 -1
- package/standalone/chunks/{embed-c581fYN4.js → embed-B3y_k1ri.js} +1 -1
- package/standalone/chunks/{filters-XL4xRKOk.js → filters-CIOtenxx.js} +1 -1
- package/standalone/chunks/{formula-codemirror-BAlhe79s.js → formula-codemirror-BXh_3Te_.js} +1 -1
- package/standalone/chunks/item-option-action-button-group-DdbUGL3Q.js +35 -0
- package/standalone/chunks/item-option-base-CJwisW9b.js +38 -0
- package/standalone/chunks/item-option-color-palette-picker-CIM_beO6.js +22 -0
- package/standalone/chunks/{item-option-color-picker-59il-pkm.js → item-option-color-picker-CFeaAV1o.js} +1 -1
- package/standalone/chunks/item-option-color-range-DlZPq0gW.js +80 -0
- package/standalone/chunks/item-option-guidelines-DTTp08iA.js +117 -0
- package/standalone/chunks/{item-option-multi-language-field-BNn4WFUG.js → item-option-multi-language-field-DPrary5L.js} +1 -1
- package/standalone/chunks/{item-option-number-field-_lCPA_qC.js → item-option-number-field-DqTWCfQm.js} +1 -1
- package/standalone/chunks/{item-option-panel-s1ZKzAZ9.js → item-option-panel-PNWjgMMu.js} +2 -2
- package/standalone/chunks/{item-option-picker-CeK7QDTm.js → item-option-picker-dpSAYz4b.js} +1 -1
- package/standalone/chunks/item-option-position-picker-CHSKJ29N.js +14 -0
- package/standalone/chunks/item-option-positions-number-field-DaUTQCTD.js +31 -0
- package/standalone/chunks/{item-option-radio-button-group-DR7gdaTr.js → item-option-radio-button-group-cy5Lc7Yg.js} +1 -1
- package/standalone/chunks/item-option-slider-CA-mF5rp.js +15 -0
- package/standalone/chunks/{item-option-switch-DJfnhpf_.js → item-option-switch-Dp2L-Owv.js} +1 -1
- package/standalone/chunks/{item-option-text-field-DNqL7Evw.js → item-option-text-field-dmwmrTKe.js} +1 -1
- package/standalone/chunks/{item-slot-picker-panel-DsZvl6kA.js → item-slot-picker-panel-DRqvLkhG.js} +2 -2
- package/standalone/chunks/load-data-fields-for-datasets-D74yX8C2.js +25 -0
- package/standalone/chunks/{load-formula-codemirror-Cyqo4LoE.js → load-formula-codemirror-D1TsWHH6.js} +1 -1
- package/standalone/chunks/localized-mixin-j1gjzMSn.js +2 -0
- package/standalone/chunks/{luzmo-icon-markup-GqF25og5.js → luzmo-icon-markup-BENMHpB_.js} +1 -1
- package/standalone/chunks/task-BRrSUTFr.js +2 -0
- package/standalone/interactive-viz-item.js +1 -1
- package/standalone/item-grid.js +1 -1
- package/standalone/manifest.json +33 -33
- package/standalone/chunks/base-DOKoeL4P.js +0 -2
- package/standalone/chunks/display-settings-binning-CTWsdo0F.js +0 -38
- package/standalone/chunks/display-settings-datetime-CdxMI-9Q.js +0 -199
- package/standalone/chunks/display-settings-grand-totals-BCW8hefp.js +0 -26
- package/standalone/chunks/display-settings-numeric-CSaI0l55.js +0 -172
- package/standalone/chunks/item-option-action-button-group-B_XEkUcP.js +0 -35
- package/standalone/chunks/item-option-base-R8-N5_rE.js +0 -38
- package/standalone/chunks/item-option-color-palette-picker-CMZyo1NH.js +0 -22
- package/standalone/chunks/item-option-color-range-BWaElfwS.js +0 -80
- package/standalone/chunks/item-option-guidelines-BzvrNruz.js +0 -117
- package/standalone/chunks/item-option-position-picker-BAWZpDBA.js +0 -14
- package/standalone/chunks/item-option-positions-number-field-BmEtttZL.js +0 -31
- package/standalone/chunks/item-option-slider-C_jierlR.js +0 -15
- package/standalone/chunks/load-data-fields-for-datasets-_VJWUFPO.js +0 -25
- package/standalone/chunks/localized-mixin-BEfBwOPN.js +0 -2
- package/standalone/chunks/task-C3c3OWyi.js +0 -2
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ ACK produces and edits chart configuration (type, slots, options, filters). It d
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install @luzmo/analytics-components-kit lit@^3.3.2 @luzmo/lucero@^2.
|
|
18
|
+
npm install @luzmo/analytics-components-kit lit@^3.3.2 @luzmo/lucero@^2.4.1 @luzmo/icons@^1.0.1-alpha.47
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
ACK uses Lucero 2 for its design-system primitives. Package managers that do not install peer dependencies automatically must install the compatible peer versions explicitly.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luzmo/analytics-components-kit",
|
|
3
|
-
"version": "1.0.9-beta.
|
|
3
|
+
"version": "1.0.9-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./components/index.js",
|
|
6
6
|
"module": "./components/index.js",
|
|
@@ -334,7 +334,7 @@
|
|
|
334
334
|
"@lit/task": "^1.0.1",
|
|
335
335
|
"@luzmo/embed": "^7.5.0",
|
|
336
336
|
"@luzmo/icons": "^1.0.1-alpha.47",
|
|
337
|
-
"@luzmo/lucero": "^2.
|
|
337
|
+
"@luzmo/lucero": "^2.4.1",
|
|
338
338
|
"colorjs.io": "^0.5.2",
|
|
339
339
|
"lit": "^3.3.2",
|
|
340
340
|
"yjs": "^13.6.29"
|
package/react/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@lit/react": "^1.0.6",
|
|
31
31
|
"react": "^18.0.0 || ^19.0.0",
|
|
32
|
-
"@luzmo/analytics-components-kit": "^1.0.9-beta.
|
|
32
|
+
"@luzmo/analytics-components-kit": "^1.0.9-beta.6"
|
|
33
33
|
},
|
|
34
|
-
"version": "1.0.9-beta.
|
|
34
|
+
"version": "1.0.9-beta.6"
|
|
35
35
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{n as e}from"./localized-mixin-j1gjzMSn.js";import{LitElement as t,property as n}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";var r=new Set;new MutationObserver(()=>{let e=document.documentElement.dir===`rtl`?document.documentElement.dir:`ltr`;r.forEach(t=>{t.setAttribute(`dir`,e)})}).observe(document.documentElement,{attributes:!0,attributeFilter:[`dir`]});var i=e=>e.startManagingContentDirection!==void 0||e.tagName===`LUZMO-THEME`,a=(e=document)=>{let t=e.activeElement;for(;t?.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;let n=t?[t]:[];for(;t;){let e=t.assignedSlot||t.parentElement||t.getRootNode()?.host;e&&n.push(e),t=e}return n};function o(e){class t extends e{get isLTR(){return this.dir===`ltr`}hasVisibleFocusInTree(){let e=a(this.getRootNode())[0];if(!e)return!1;try{return e.matches(`:focus-visible`)||e.matches(`.focus-visible`)}catch{return e.matches(`.focus-visible`)}}connectedCallback(){if(super.connectedCallback(),!this.hasAttribute(`dir`)){let e=this.assignedSlot||this.parentNode;for(;e!==document.documentElement&&!i(e);)e=e.assignedSlot||e.parentNode||e.host;if(this.dir=e.dir===`rtl`?e.dir:this.dir||`ltr`,e===document.documentElement)r.add(this);else{let{localName:t}=e;t.search(`-`)>-1&&!customElements.get(t)?customElements.whenDefined(t).then(()=>{typeof e.startManagingContentDirection==`function`&&e.startManagingContentDirection(this)}):typeof e.startManagingContentDirection==`function`&&e.startManagingContentDirection(this)}this._dirParent=e}super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._dirParent&&(this._dirParent===document.documentElement?r.delete(this):typeof this._dirParent.stopManagingContentDirection==`function`&&this._dirParent.stopManagingContentDirection(this),this.removeAttribute(`dir`))}}return t}var s=class extends o(t){},c=!0;try{document.body.querySelector(`:focus-visible`)}catch{c=!1}var l=e=>{if(e.shadowRoot==null||Object.hasOwn(e.dataset,`jsFocusVisible`))return()=>{};if(self.applyFocusVisiblePolyfill)self.applyFocusVisiblePolyfill(e.shadowRoot),e.manageAutoFocus&&e.manageAutoFocus();else{let t=()=>{self.applyFocusVisiblePolyfill&&e.shadowRoot&&self.applyFocusVisiblePolyfill(e.shadowRoot),e.manageAutoFocus&&e.manageAutoFocus()};return self.addEventListener(`focus-visible-polyfill-ready`,t,{once:!0}),()=>{self.removeEventListener(`focus-visible-polyfill-ready`,t)}}return()=>{}},u=e=>{let t=Symbol(`endPolyfillCoordination`);class n extends e{constructor(...e){super(...e),this[t]=null}connectedCallback(){super.connectedCallback&&super.connectedCallback(),c||requestAnimationFrame(()=>{this[t]??(this[t]=l(this))})}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),c||requestAnimationFrame(()=>{this[t]!=null&&(this[t](),this[t]=null)})}}return n};function d(){return new Promise(e=>requestAnimationFrame(()=>e()))}var f=class extends u(s){constructor(...e){super(...e),this.disabled=!1,this.autofocus=!1,this._tabIndex=0,this.manipulatingTabindex=!1,this.autofocusReady=Promise.resolve()}get tabIndex(){if(this.focusElement===this){let e=this.hasAttribute(`tabindex`)?Number(this.getAttribute(`tabindex`)):NaN;return Number.isNaN(e)?-1:e}let e=Number.parseFloat(this.hasAttribute(`tabindex`)&&this.getAttribute(`tabindex`)||`0`);return this.disabled||e<0?-1:this.focusElement?this._tabIndex:e}set tabIndex(e){if(this.manipulatingTabindex){this.manipulatingTabindex=!1;return}if(this.focusElement===this){if(this.disabled)this._tabIndex=e;else if(e!==this._tabIndex){this._tabIndex=e;let t=``+e;this.manipulatingTabindex=!0,this.setAttribute(`tabindex`,t)}return}if(e===-1?this.addEventListener(`pointerdown`,this.onPointerdownManagementOfTabIndex):(this.manipulatingTabindex=!0,this.removeEventListener(`pointerdown`,this.onPointerdownManagementOfTabIndex)),e===-1||this.disabled){if(this.manipulatingTabindex=!0,this.setAttribute(`tabindex`,`-1`),this.removeAttribute(`focusable`),this.selfManageFocusElement)return;e===-1?this.focusElement?.removeAttribute(`tabindex`):(this._tabIndex=e,this.manageFocusElementTabindex(e));return}this.setAttribute(`focusable`,``),this.hasAttribute(`tabindex`)?this.removeAttribute(`tabindex`):this.manipulatingTabindex=!1,this._tabIndex=e,this.manageFocusElementTabindex(e)}onPointerdownManagementOfTabIndex(){this.tabIndex===-1&&setTimeout(()=>{this.tabIndex=0,this.focus({preventScroll:!0}),this.tabIndex=-1})}async manageFocusElementTabindex(e){this.focusElement||await this.updateComplete,e===null?this.focusElement.removeAttribute(`tabindex`):this.focusElement!==this&&(this.focusElement.tabIndex=e)}get focusElement(){throw Error(`Must implement focusElement getter!`)}get selfManageFocusElement(){return!1}focus(e){this.disabled||!this.focusElement||(this.focusElement===this?Reflect.apply(HTMLElement.prototype.focus,this,[e]):this.focusElement.focus(e))}blur(){let e=this.focusElement||this;e===this?HTMLElement.prototype.blur.apply(this):e.blur()}click(){if(this.disabled)return;let e=this.focusElement||this;e===this?HTMLElement.prototype.click.apply(this):e.click()}manageAutoFocus(){this.autofocus&&(this.dispatchEvent(new KeyboardEvent(`keydown`,{code:`Tab`})),this.focusElement.focus())}firstUpdated(e){super.firstUpdated(e),(!this.hasAttribute(`tabindex`)||this.getAttribute(`tabindex`)!==`-1`)&&this.setAttribute(`focusable`,``)}update(e){e.has(`disabled`)&&this.handleDisabledChanged(this.disabled,e.get(`disabled`)),super.update(e)}updated(e){super.updated(e),e.has(`disabled`)&&this.disabled&&this.blur()}async handleDisabledChanged(e,t){let n=()=>this.focusElement!==this&&this.focusElement.disabled!==void 0;e?(this.manipulatingTabindex=!0,this.setAttribute(`tabindex`,`-1`),await this.updateComplete,n()?this.focusElement.disabled=!0:this.setAttribute(`aria-disabled`,`true`)):t&&(this.manipulatingTabindex=!0,this.focusElement===this?this.setAttribute(`tabindex`,``+this._tabIndex):this.removeAttribute(`tabindex`),await this.updateComplete,n()?this.focusElement.disabled=!1:this.removeAttribute(`aria-disabled`))}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this.autofocusReady,e}connectedCallback(){super.connectedCallback(),this.autofocus&&(this.autofocusReady=(async()=>{await d(),await d()})(),this.updateComplete.then(()=>this.manageAutoFocus()))}};e([n({type:Boolean,reflect:!0})],f.prototype,`disabled`,void 0),e([n({type:Boolean})],f.prototype,`autofocus`,void 0),e([n({type:Number})],f.prototype,`tabIndex`,null);var p={xxs:`xxs`,xs:`xs`,s:`s`,m:`m`,l:`l`,xl:`xl`,xxl:`xxl`};function m(t,{validSizes:r=[`s`,`m`,`l`,`xl`],noDefaultSize:i,defaultSize:a=`m`}={}){class o extends t{constructor(...e){super(...e),this._size=a}get size(){return this._size||a}set size(e){let t=i?null:a,n=e&&e.toLocaleLowerCase(),o=r.includes(n)?n:t;if(o&&this.setAttribute(`size`,o),this._size===o)return;let s=this._size;this._size=o,this.requestUpdate(`size`,s)}update(e){!this.hasAttribute(`size`)&&!i&&this.setAttribute(`size`,this.size),super.update(e)}}return e([n({type:String})],o.prototype,`size`,null),o}export{m as n,s as r,p as t};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
import{n as e,t}from"./localized-mixin-j1gjzMSn.js";import{n}from"./lit-localize-CIGP-NUw.js";import{t as r}from"./localized-decorator-Buib6Rq1.js";import{n as i,t as a}from"./luzmoCheckbox-BksyONqE.js";import{n as o,r as s,t as c}from"./base-CR5wZnQk.js";import{html as l,property as u,query as d,state as f,unsafeCSS as p}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/number-field.js";var m=`:host .settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-binning-gap,var(--display-settings-binning-gap));display:flex}:host,:host([size=s]){--display-settings-binning-gap:var(--luzmo-spacing-3)}:host([size=l]){--display-settings-binning-gap:var(--luzmo-spacing-4)}:host([size=xl]){--display-settings-binning-gap:var(--luzmo-spacing-5)}`,h=class extends t(o(s,{validSizes:Object.values(c)})){constructor(...e){super(...e),this.slotContent={},this._enabled=!1,this._binWidth=10}static get styles(){return[p(m)]}willUpdate(e){super.willUpdate(e),e.has(`slotContent`)&&(this._enabled=this.slotContent?.bins?.enabled??!1,this._binWidth=this.slotContent?.bins?.number??10)}toggleBinning(){this._enabled=!this._enabled,this.sendEvent()}setBinning(){this._binWidth=this.binWidthElement.value,this.sendEvent()}sendEvent(){let e={enabled:!!this._enabled,number:this._binWidth??10};this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this.slotContent,bins:e}}}))}renderBinWidth(){return l`<div class="setting">
|
|
3
|
+
<luzmo-field-label .size=${this.size} for="bin-width"
|
|
4
|
+
>${n(`Bin width`,{desc:`The width of each bin in the histogram`})}</luzmo-field-label
|
|
5
|
+
>
|
|
6
|
+
<luzmo-number-field
|
|
7
|
+
id="bin-width"
|
|
8
|
+
min="0"
|
|
9
|
+
.value=${this._binWidth}
|
|
10
|
+
.size=${this.size}
|
|
11
|
+
@change=${this.setBinning}
|
|
12
|
+
></luzmo-number-field>
|
|
13
|
+
</div>`}render(){return l`<div class="settings-container">
|
|
14
|
+
<div class="settings-row">
|
|
15
|
+
<div class="setting">
|
|
16
|
+
<luzmo-field-label .size=${this.size} for="binning"
|
|
17
|
+
>${n(`Binning`,{desc:`Grouping numeric data into intervals or "bins" for analysis and visualization`})}</luzmo-field-label
|
|
18
|
+
>
|
|
19
|
+
<luzmo-action-button
|
|
20
|
+
id="binning"
|
|
21
|
+
toggles
|
|
22
|
+
emphasized
|
|
23
|
+
.size=${this.size}
|
|
24
|
+
?selected=${this._enabled}
|
|
25
|
+
class=${this._enabled?`active`:`inactive`}
|
|
26
|
+
@click=${this.toggleBinning}
|
|
27
|
+
>
|
|
28
|
+
<luzmo-icon
|
|
29
|
+
slot="icon"
|
|
30
|
+
.size=${this.size}
|
|
31
|
+
.icon=${this._enabled?i:a}
|
|
32
|
+
></luzmo-icon>
|
|
33
|
+
${this._enabled?n(`Enabled`,{desc:`Option set to enabled`}):n(`Disabled`,{desc:`Option set to disabled`})}
|
|
34
|
+
</luzmo-action-button>
|
|
35
|
+
</div>
|
|
36
|
+
${this._enabled?this.renderBinWidth():``}
|
|
37
|
+
</div>
|
|
38
|
+
</div>`}};e([u()],h.prototype,`slotContent`,void 0),e([f()],h.prototype,`_enabled`,void 0),e([d(`#bin-width`)],h.prototype,`binWidthElement`,void 0),h=e([r()],h),customElements.get(`luzmo-display-settings-binning`)||customElements.define(`luzmo-display-settings-binning`,h);
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
|
|
2
|
+
import{n as e,t}from"./localized-mixin-j1gjzMSn.js";import{n}from"./lit-localize-CIGP-NUw.js";import{t as r}from"./localized-decorator-Buib6Rq1.js";import{n as i,t as a}from"./luzmoCheckbox-BksyONqE.js";import{n as o,r as s,t as c}from"./base-CR5wZnQk.js";import{t as l}from"./task-BRrSUTFr.js";import{r as u,t as d}from"./formatter-LzhH-XSQ.js";import{i as f,r as p,t as m}from"./periods.const-Cie50jR4.js";import{html as h,property as g,query as _,unsafeCSS as v}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/picker.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/progress-circle.js";var y={"~":()=>n(`Auto`,{desc:`Automatic setting of the option`}),"/":()=>`/`,"-":()=>`-`,".":()=>`.`},b=`:host{font-family:var(--luzmo-display-settings-datetime-font-family,var(--luzmo-font-family))}:host .settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-datetime-gap,var(--display-settings-datetime-gap));display:flex}:host{--display-settings-datetime-example-font-size:var(--luzmo-font-size-s);--display-settings-datetime-example-color:var(--luzmo-font-color);--display-settings-datetime-example-label-font-weight:bold;--display-settings-datetime-example-label-color:var(--luzmo-primary);--display-settings-datetime-example-language-color:var(--luzmo-primary);--display-settings-datetime-gap:var(--luzmo-spacing-3);--display-settings-datetime-example-height:var(--luzmo-component-height)}:host([size=s]){--display-settings-datetime-gap:var(--luzmo-spacing-3);--display-settings-datetime-example-height:var(--luzmo-component-height-s);--display-settings-datetime-example-font-size:var(--luzmo-font-size-s)}:host([size=l]){--display-settings-datetime-gap:var(--luzmo-spacing-4);--display-settings-datetime-example-height:var(--luzmo-component-height-l);--display-settings-datetime-example-font-size:var(--luzmo-font-size)}:host([size=xl]){--display-settings-datetime-gap:var(--luzmo-spacing-5);--display-settings-datetime-example-height:var(--luzmo-component-height-xl);--display-settings-datetime-example-font-size:var(--luzmo-font-size-l)}`,x=class extends t(o(s,{validSizes:Object.values(c)})){constructor(...e){super(...e),this._loadLocaleFormatsConfig=new l(this,{task:async([e])=>{if(e&&e!==this._contentLanguageLoaded){let t=Object.assign({"../../utils/formatter/formats/cs.ts":()=>import(`./cs-DLnr3a23.js`),"../../utils/formatter/formats/da.ts":()=>import(`./da-BJgbo0uE.js`),"../../utils/formatter/formats/de.ts":()=>import(`./de-DPgYMyja.js`),"../../utils/formatter/formats/en-GB.ts":()=>import(`./en-GB-DnwmFNwC.js`),"../../utils/formatter/formats/en-US.ts":()=>import(`./en-US-BD2RCLuw.js`),"../../utils/formatter/formats/en.ts":()=>import(`./en-BD2RCLuw.js`),"../../utils/formatter/formats/es.ts":()=>import(`./es-Dp1UuDDz.js`),"../../utils/formatter/formats/fi.ts":()=>import(`./fi-CLQ6vC7V.js`),"../../utils/formatter/formats/fr.ts":()=>import(`./fr-D8xrUEX4.js`),"../../utils/formatter/formats/he.ts":()=>import(`./he-DHPb0VBo.js`),"../../utils/formatter/formats/hu.ts":()=>import(`./hu-BpaYooip.js`),"../../utils/formatter/formats/it.ts":()=>import(`./it-DWTvD2Xn.js`),"../../utils/formatter/formats/ja.ts":()=>import(`./ja-CtDlXHD1.js`),"../../utils/formatter/formats/ko.ts":()=>import(`./ko-CekuHU50.js`),"../../utils/formatter/formats/mk.ts":()=>import(`./mk-Dq3YK4jD.js`),"../../utils/formatter/formats/nl.ts":()=>import(`./nl-7csxtU-I.js`),"../../utils/formatter/formats/no.ts":()=>import(`./no-DJNRx8au.js`),"../../utils/formatter/formats/pl.ts":()=>import(`./pl-zDnuk9Gd.js`),"../../utils/formatter/formats/pt.ts":()=>import(`./pt-BEVAH5AJ.js`),"../../utils/formatter/formats/ru.ts":()=>import(`./ru-Ceji1Fqk.js`),"../../utils/formatter/formats/sv.ts":()=>import(`./sv-CgssnOqA.js`),"../../utils/formatter/formats/tr.ts":()=>import(`./tr-i3G2sFi4.js`),"../../utils/formatter/formats/zh-CN.ts":()=>import(`./zh-CN-NVnv57dz.js`),"../../utils/formatter/formats/zh-TW.ts":()=>import(`./zh-TW-NVnv57dz.js`)});if(t[`../../utils/formatter/formats/${e}.ts`]){let n=await t[`../../utils/formatter/formats/${e}.ts`]();this._localeFormats=n?.default??{}}return this._contentLanguageLoaded=e,this._localeFormats}},args:()=>[this.contentLanguage]}),this.contentLanguage=`en`,this.size=`m`,this.slotContent={},this._dateLevel=5,this._displayAs=`default`,this._weekStart=`monday`,this._weekDayAndMonthInYearFormat=`long`,this._dateFormat=`auto`,this._dateSeparator=`~`,this._sendEvent=()=>{this._calculateSlotContent(),this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}}static get styles(){return[v(b)]}_parseSlotContent(){this._dateLevel=this.slotContent?.level??this.slotContent?.lowestLevel??5,this._displayAs=this.slotContent?.datetimeDisplayMode??`default`,this._displayAs===`weekday_number`&&(this._displayAs=`day_in_week`,this._weekDayAndMonthInYearFormat=`number`),this._displayAs===`weekday_name`&&(this._displayAs=`day_in_week`),this._displayAs===`month_number`&&(this._displayAs=`month_in_year`,this._weekDayAndMonthInYearFormat=`number`),this._displayAs===`month_name`&&(this._displayAs=`month_in_year`),this._parseSavedFormat()}_parseSavedFormat(){let e=this.slotContent?.format??`%d-%m-%Y`,t=e.match(/[./-]/);if(this._dateSeparator=e.includes(`~`)?`~`:t?.[0]??`~`,e.includes(`%amd`))this._dateFormat=`auto`;else{let t=e.indexOf(`%d`),n=e.indexOf(`%m`);t!==-1&&n!==-1&&(this._dateFormat=t<n?`ddmm`:`mmdd`)}this._24hFormat=e.includes(`%H`),this._monthName=/%B|%b/.test(e),this._weekDay=/%a|%A/.test(e),this._monthName&&(this._monthNameFormat=e.includes(`%b`)?`short`:`long`),this._weekDay&&(this._weekDayAndMonthInYearFormat=e.includes(`%a`)?`short`:`long`);let n=this._dateLevel===5&&this.slotContent?.weekDayNameFormat||this._dateLevel===3&&this.slotContent?.monthNameFormat;n&&(this._weekDayAndMonthInYearFormat=n)}_calculateFormat(){let e,t=this._localeFormats?.smartDateFormats??u;this._monthName?(e=t.filter(e=>e.monthType===`name`&&e.longText===(this._monthNameFormat===`long`)&&e.weekday===this._weekDay),e.length>0?this._format=e[0].key:(this._weekDayAndMonthInYearFormat=`short`,this._weekDay=!0,this._format=`%a %e %B %Y`)):(e=this._dateLevel&&this._dateLevel===4?t.filter(e=>e.monthType===`number`&&e.mmdd===(this._weekFormat===`mmdd`||this._weekFormat!==`ddmm`&&null)&&e.separator===this._dateSeparator):t.filter(e=>e.monthType===`number`&&e.mmdd===(this._dateFormat===`mmdd`||this._dateFormat!==`ddmm`&&null)&&e.separator===this._dateSeparator),this._dateFormat===`auto`&&this._dateLevel&&this._dateLevel!==4?this._format=`%amd`+this._dateSeparator+`%Y`:e.length>0?this._format=e[0].key:(this._dateFormat=`ddmm`,this._dateSeparator=`/`,this._format=`%d/%m/%Y`)),this._dateLevel&&this._dateLevel>5&&(this._format+=this._24hFormat?` %H:%M:%S.%L`:` %I:%M:%S.%L %p`)}_setWeekStartsOn(){this._weekStart=this._weekStartElement.value,this._sendEvent(),this.requestUpdate()}_setDisplayAs(){this._displayAs=this._displayAsElement.value,this._sendEvent(),this.requestUpdate()}_setWeekdayAndMonthInYearFormat(){this._weekDayAndMonthInYearFormat=this._weekDayAndMonthInYearFormatElement.selected?.[0]??`long`,this._sendEvent(),this.requestUpdate()}_setMonthNameFormat(){this._monthNameFormat=this._monthNameFormatElement.selected?.[0],this._sendEvent(),this.requestUpdate()}_setMonthName(){this._monthName=this._monthNameElement.selected,this._sendEvent(),this.requestUpdate()}_setWeekFormat(){this._weekFormat=this._weekFormatElement.selected?.[0],this._sendEvent(),this.requestUpdate()}_setDateFormat(){this._dateFormat=this._dateFormatElement.value,this._sendEvent(),this.requestUpdate()}_setDateSeparator(){this._dateSeparator=this._dateSeparatorElement.value,this._sendEvent(),this.requestUpdate()}_set24hFormat(){this._24hFormat=this._format24hElement.selected,this._sendEvent(),this.requestUpdate()}_setWeekday(){this._weekDay=this._weekDayElement.selected,this._sendEvent(),this.requestUpdate()}_calculateSlotContent(){this._currentSlotContent={...this.slotContent},this._calculateFormat(),this._currentSlotContent.format=this._format,this._displayAs==="default"?delete this._currentSlotContent.datetimeDisplayMode:(this._currentSlotContent.datetimeDisplayMode=this._displayAs,this._displayAs===`week_in_year`?this._currentSlotContent.datetimeDisplayMode=this._weekDayAndMonthInYearFormat===`number`?`week_number`:`week_name`:this._displayAs===`month_in_year`?this._currentSlotContent.datetimeDisplayMode=this._weekDayAndMonthInYearFormat===`number`?`month_number`:`month_name`:this._displayAs===`day_in_week`&&(this._currentSlotContent.datetimeDisplayMode=this._weekDayAndMonthInYearFormat===`number`?`weekday_number`:`weekday_name`,this._currentSlotContent.weekStart=this._weekStart),this._weekDayAndMonthInYearFormat&&(this._dateLevel===3?this._currentSlotContent.monthNameFormat=this._weekDayAndMonthInYearFormat:this._dateLevel===5&&(this._currentSlotContent.weekDayNameFormat=this._weekDayAndMonthInYearFormat)))}willUpdate(e){super.willUpdate(e),e.has(`slotContent`)&&(this._parseSlotContent(),this._calculateSlotContent())}_renderDisplaySettings(){let e=m?.[`level${this._dateLevel??0}`]?.map(e=>h`<luzmo-menu-item value=${e.key}>
|
|
3
|
+
${e.i18n()}
|
|
4
|
+
</luzmo-menu-item>`);return h`<div class="setting">
|
|
5
|
+
<luzmo-field-label .size=${this.size} for="display-as"
|
|
6
|
+
>${n(`Display`,{desc:`Label for display setting`})}</luzmo-field-label
|
|
7
|
+
>
|
|
8
|
+
<luzmo-picker
|
|
9
|
+
id="display-as"
|
|
10
|
+
size=${this.size}
|
|
11
|
+
variant="highlight"
|
|
12
|
+
value=${this._displayAs??`default`}
|
|
13
|
+
@change=${this._setDisplayAs}
|
|
14
|
+
>
|
|
15
|
+
${e}
|
|
16
|
+
</luzmo-picker>
|
|
17
|
+
</div>`}_renderWeekDayAndMonthNameFormatSettings(){let e=Object.keys(p).map(e=>h`<luzmo-action-button value=${e}>
|
|
18
|
+
${p[e]()}
|
|
19
|
+
</luzmo-action-button>`);return h` <div class="setting">
|
|
20
|
+
<luzmo-field-label .size=${this.size} for="weekday-and-month-in-year-format"
|
|
21
|
+
>${n(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
|
|
22
|
+
>
|
|
23
|
+
<luzmo-action-group
|
|
24
|
+
emphasized
|
|
25
|
+
id="weekday-and-month-in-year-format"
|
|
26
|
+
size=${this.size}
|
|
27
|
+
compact
|
|
28
|
+
.selected=${[this._weekDayAndMonthInYearFormat??`short`]}
|
|
29
|
+
selects="single"
|
|
30
|
+
@change=${this._setWeekdayAndMonthInYearFormat}
|
|
31
|
+
>
|
|
32
|
+
${e}
|
|
33
|
+
</luzmo-action-group>
|
|
34
|
+
</div>`}_renderMonthNameFormatSettings(){return h` <div class="setting">
|
|
35
|
+
<luzmo-field-label .size=${this.size} for="month-name-format"
|
|
36
|
+
>${n(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
|
|
37
|
+
>
|
|
38
|
+
<luzmo-action-group
|
|
39
|
+
emphasized
|
|
40
|
+
id="month-name-format"
|
|
41
|
+
size=${this.size}
|
|
42
|
+
compact
|
|
43
|
+
.selected=${[this._monthNameFormat??`long`]}
|
|
44
|
+
selects="single"
|
|
45
|
+
@change=${this._setMonthNameFormat}
|
|
46
|
+
>
|
|
47
|
+
<luzmo-action-button value="short">
|
|
48
|
+
${n(`Short`,{desc:`Short format option`})}
|
|
49
|
+
</luzmo-action-button>
|
|
50
|
+
<luzmo-action-button value="long">
|
|
51
|
+
${n(`Long`,{desc:`Long format option`})}
|
|
52
|
+
</luzmo-action-button>
|
|
53
|
+
</luzmo-action-group>
|
|
54
|
+
</div>`}_renderWeekFormatSettings(){let e=this._localeFormats?.smartDateFormats??u,t=e.find(e=>e.mmdd===!0&&e.separator===this._dateSeparator&&e.monthType===`number`),r=e.find(e=>e.mmdd===!1&&e.separator===this._dateSeparator&&e.monthType===`number`);return h` <div class="setting">
|
|
55
|
+
<luzmo-field-label .size=${this.size} for="week-format"
|
|
56
|
+
>${n(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
|
|
57
|
+
>
|
|
58
|
+
<luzmo-action-group
|
|
59
|
+
emphasized
|
|
60
|
+
id="week-format"
|
|
61
|
+
size=${this.size}
|
|
62
|
+
compact
|
|
63
|
+
.selected=${[this._weekFormat??`ddmm`]}
|
|
64
|
+
selects="single"
|
|
65
|
+
@change=${this._setWeekFormat}
|
|
66
|
+
>
|
|
67
|
+
<luzmo-action-button value="ddmm">
|
|
68
|
+
${d({...this._currentSlotContent,type:`datetime`,format:r?.key},{localFormats:this._localeFormats,level:this._dateLevel})(new Date)}
|
|
69
|
+
</luzmo-action-button>
|
|
70
|
+
<luzmo-action-button value="mmdd"
|
|
71
|
+
>${d({...this._currentSlotContent,type:`datetime`,format:t?.key},{localFormats:this._localeFormats,level:this._dateLevel})(new Date)}</luzmo-action-button
|
|
72
|
+
>
|
|
73
|
+
</luzmo-action-group>
|
|
74
|
+
</div>`}_renderWeekStartsOnSettings(){let e=Object.keys(f).map(e=>h`<luzmo-menu-item value=${e}>
|
|
75
|
+
${f[e]()}
|
|
76
|
+
</luzmo-menu-item>`);return h`<div class="setting">
|
|
77
|
+
<luzmo-field-label .size=${this.size} for="week-start"
|
|
78
|
+
>${n(`Week starts on`,{desc:`Label for week start setting`})}</luzmo-field-label
|
|
79
|
+
>
|
|
80
|
+
<luzmo-picker
|
|
81
|
+
id="week-start"
|
|
82
|
+
size=${this.size}
|
|
83
|
+
variant="highlight"
|
|
84
|
+
value=${this._weekStart??`Auto`}
|
|
85
|
+
@change=${this._setWeekStartsOn}
|
|
86
|
+
>
|
|
87
|
+
${e}
|
|
88
|
+
</luzmo-picker>
|
|
89
|
+
</div>`}_renderMonthNameSettings(){return h`<div class="settings-">
|
|
90
|
+
<luzmo-field-label .size=${this.size} for="month-name"
|
|
91
|
+
>${n(`Month`,{desc:`Time unit`})}</luzmo-field-label
|
|
92
|
+
>
|
|
93
|
+
<luzmo-action-button
|
|
94
|
+
id="month-name"
|
|
95
|
+
emphasized
|
|
96
|
+
toggles
|
|
97
|
+
.size=${this.size}
|
|
98
|
+
?selected=${this._monthName}
|
|
99
|
+
@change=${this._setMonthName}
|
|
100
|
+
>
|
|
101
|
+
<luzmo-icon
|
|
102
|
+
slot="icon"
|
|
103
|
+
.size=${this.size}
|
|
104
|
+
.icon=${this._monthName?i:a}
|
|
105
|
+
></luzmo-icon>
|
|
106
|
+
${n(`Name`)}
|
|
107
|
+
</luzmo-action-button>
|
|
108
|
+
</div>`}_renderDateFormatSettings(){let e=this._dateSeparator===`~`?`/`:this._dateSeparator;return h`<div class="setting">
|
|
109
|
+
<luzmo-field-label .size=${this.size} for="date-format"
|
|
110
|
+
>${n(`Format`,{desc:`Label for format setting`})}</luzmo-field-label
|
|
111
|
+
>
|
|
112
|
+
<luzmo-picker
|
|
113
|
+
id="date-format"
|
|
114
|
+
size=${this.size}
|
|
115
|
+
variant="highlight"
|
|
116
|
+
value=${this._dateFormat??`Auto`}
|
|
117
|
+
@change=${this._setDateFormat}
|
|
118
|
+
>
|
|
119
|
+
<luzmo-menu-item value="auto">
|
|
120
|
+
${n(`Auto`,{desc:`Automatic setting of the option`})}
|
|
121
|
+
</luzmo-menu-item>
|
|
122
|
+
<luzmo-menu-item value="mmdd">12${e}31</luzmo-menu-item>
|
|
123
|
+
<luzmo-menu-item value="ddmm">31${e}12</luzmo-menu-item>
|
|
124
|
+
</luzmo-picker>
|
|
125
|
+
</div>`}_renderSeparatorSettings(){let e=Object.keys(y).map(e=>h`<luzmo-menu-item value=${e}>
|
|
126
|
+
${y[e]()}
|
|
127
|
+
</luzmo-menu-item>`);return h`<div class="setting">
|
|
128
|
+
<luzmo-field-label .size=${this.size} for="date-separator"
|
|
129
|
+
>${n(`Separator`,{desc:`Label for date separator setting`})}</luzmo-field-label
|
|
130
|
+
>
|
|
131
|
+
<luzmo-picker
|
|
132
|
+
id="date-separator"
|
|
133
|
+
size=${this.size}
|
|
134
|
+
variant="highlight"
|
|
135
|
+
value=${this._dateSeparator??`~`}
|
|
136
|
+
@change=${this._setDateSeparator}
|
|
137
|
+
>
|
|
138
|
+
${e}
|
|
139
|
+
</luzmo-picker>
|
|
140
|
+
</div>`}_render24hFormatSettings(){return h`<div class="settings-">
|
|
141
|
+
<luzmo-field-label .size=${this.size} for="format-24h"
|
|
142
|
+
>${n(`24h`,{desc:`Label for 24h format setting`})}</luzmo-field-label
|
|
143
|
+
>
|
|
144
|
+
<luzmo-action-button
|
|
145
|
+
id="format-24h"
|
|
146
|
+
emphasized
|
|
147
|
+
toggles
|
|
148
|
+
.size=${this.size}
|
|
149
|
+
.label=${n(`Show`)}
|
|
150
|
+
?selected=${this._24hFormat}
|
|
151
|
+
@change=${this._set24hFormat}
|
|
152
|
+
>
|
|
153
|
+
<luzmo-icon
|
|
154
|
+
slot="icon"
|
|
155
|
+
.size=${this.size}
|
|
156
|
+
.icon=${this._24hFormat?i:a}
|
|
157
|
+
></luzmo-icon>
|
|
158
|
+
</luzmo-action-button>
|
|
159
|
+
</div>`}_renderWeekdaySettings(){return h`<div class="settings-">
|
|
160
|
+
<luzmo-field-label .size=${this.size} for="weekday"
|
|
161
|
+
>${n(`Weekday`,{desc:`Label for weekday setting`})}</luzmo-field-label
|
|
162
|
+
>
|
|
163
|
+
<luzmo-action-button
|
|
164
|
+
id="weekday"
|
|
165
|
+
emphasized
|
|
166
|
+
toggles
|
|
167
|
+
.size=${this.size}
|
|
168
|
+
?selected=${this._weekDay}
|
|
169
|
+
@change=${this._setWeekday}
|
|
170
|
+
>
|
|
171
|
+
<luzmo-icon
|
|
172
|
+
slot="icon"
|
|
173
|
+
.size=${this.size}
|
|
174
|
+
.icon=${this._weekDay?i:a}
|
|
175
|
+
></luzmo-icon>
|
|
176
|
+
${n(`Show`)}
|
|
177
|
+
</luzmo-action-button>
|
|
178
|
+
</div>`}_renderAllSettings(){return h`<div class="settings-container">
|
|
179
|
+
${this._dateLevel&&![1,9].includes(this._dateLevel)?h` <div class="settings-row">
|
|
180
|
+
${this._renderDisplaySettings()}
|
|
181
|
+
${this._dateLevel&&this._dateLevel>=5&&this._displayAs===`day_in_week`?this._renderWeekStartsOnSettings():``}
|
|
182
|
+
</div>`:``}
|
|
183
|
+
${[`month_in_year`,`day_in_week`].includes(this._displayAs??``)?h` <div class="settings-row">
|
|
184
|
+
${this._renderWeekDayAndMonthNameFormatSettings()}
|
|
185
|
+
</div>`:``}
|
|
186
|
+
${this._dateLevel&&this._dateLevel>1&&this._displayAs==="default"?h` <div class="settings-row">
|
|
187
|
+
${this._dateLevel&&this._dateLevel!==4&&this._dateLevel!==2?this._renderMonthNameSettings():``}
|
|
188
|
+
${this._dateLevel&&this._dateLevel!==4&&this._dateLevel>2&&this._monthName?this._renderMonthNameFormatSettings():``}
|
|
189
|
+
${this._dateLevel&&this._dateLevel===4&&!this._monthName?this._renderWeekFormatSettings():``}
|
|
190
|
+
${this._dateLevel&&this._dateLevel>=5&&!this._monthName?this._renderDateFormatSettings():``}
|
|
191
|
+
${this._dateLevel&&this._dateLevel>1&&!this._monthName?this._renderSeparatorSettings():``}
|
|
192
|
+
${this._dateLevel&&this._dateLevel>=5&&this._monthName?this._renderWeekdaySettings():``}
|
|
193
|
+
${this._dateLevel&&this._dateLevel>5?this._render24hFormatSettings():``}
|
|
194
|
+
</div>`:``}
|
|
195
|
+
</div>`}render(){return this._loadLocaleFormatsConfig.render({pending:()=>h`<luzmo-progress-circle
|
|
196
|
+
indeterminate
|
|
197
|
+
.label=${n(`Loading`,{desc:`Loading spinner label`})}
|
|
198
|
+
.size=${this.size}
|
|
199
|
+
></luzmo-progress-circle>`,complete:()=>this._renderAllSettings(),error:()=>this._renderAllSettings()})}};e([g({type:String})],x.prototype,`contentLanguage`,void 0),e([g({type:String})],x.prototype,`size`,void 0),e([g({type:Object,reflect:!1})],x.prototype,`slotContent`,void 0),e([_(`#display-as`)],x.prototype,`_displayAsElement`,void 0),e([_(`#week-start`)],x.prototype,`_weekStartElement`,void 0),e([_(`#weekday-and-month-in-year-format`)],x.prototype,`_weekDayAndMonthInYearFormatElement`,void 0),e([_(`#month-name-format`)],x.prototype,`_monthNameFormatElement`,void 0),e([_(`#month-name`)],x.prototype,`_monthNameElement`,void 0),e([_(`#week-format`)],x.prototype,`_weekFormatElement`,void 0),e([_(`#date-format`)],x.prototype,`_dateFormatElement`,void 0),e([_(`#date-separator`)],x.prototype,`_dateSeparatorElement`,void 0),e([_(`#weekday`)],x.prototype,`_weekDayElement`,void 0),e([_(`#format-24h`)],x.prototype,`_format24hElement`,void 0),x=e([r()],x),customElements.get(`luzmo-display-settings-datetime`)||customElements.define(`luzmo-display-settings-datetime`,x);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import{n as e,t}from"./localized-mixin-j1gjzMSn.js";import{n}from"./lit-localize-CIGP-NUw.js";import{t as r}from"./localized-decorator-Buib6Rq1.js";import{n as i,t as a}from"./luzmoCheckbox-BksyONqE.js";import{n as o,r as s,t as c}from"./base-CR5wZnQk.js";import{html as l,ifDefined as u,property as d,state as f,unsafeCSS as p}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/icon.js";var m=`:host .settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-grand-totals-gap,var(--display-settings-grand-totals-gap));display:flex}:host,:host([size=s]){--display-settings-grand-totals-gap:var(--luzmo-spacing-3)}:host([size=l]){--display-settings-grand-totals-gap:var(--luzmo-spacing-4)}:host([size=xl]){--display-settings-grand-totals-gap:var(--luzmo-spacing-5)}`,h=class extends t(o(s,{validSizes:Object.values(c)})){constructor(...e){super(...e),this.slotContent={}}static get styles(){return[p(m)]}willUpdate(e){super.willUpdate(e),e.has(`slotContent`)&&(this._enabled=this.slotContent?.grandTotals?.enabled??!1)}toggleGrandTotals(){this._enabled=!this._enabled,this.sendEvent()}sendEvent(){let e={enabled:!!this._enabled};this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this.slotContent,grandTotals:e}}}))}render(){return l`<div class="settings-container">
|
|
3
|
+
<div class="settings-row">
|
|
4
|
+
<div class="setting">
|
|
5
|
+
<luzmo-field-label .size=${this.size} for="grand-totals"
|
|
6
|
+
>${n(`Grand totals`,{desc:`Label for grand totals setting in a table`})}</luzmo-field-label
|
|
7
|
+
>
|
|
8
|
+
<luzmo-action-button
|
|
9
|
+
id="grand-totals"
|
|
10
|
+
toggles
|
|
11
|
+
emphasized
|
|
12
|
+
.size=${this.size}
|
|
13
|
+
?selected=${this._enabled}
|
|
14
|
+
class=${u(this._enabled?`active`:`inactive`)}
|
|
15
|
+
@click=${this.toggleGrandTotals}
|
|
16
|
+
>
|
|
17
|
+
<luzmo-icon
|
|
18
|
+
slot="icon"
|
|
19
|
+
.size=${this.size}
|
|
20
|
+
.icon=${this._enabled?i:a}
|
|
21
|
+
></luzmo-icon>
|
|
22
|
+
${this._enabled?n(`Enabled`,{desc:`Option set to enabled`}):n(`Disabled`,{desc:`Option set to disabled`})}
|
|
23
|
+
</luzmo-action-button>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>`}};e([d()],h.prototype,`slotContent`,void 0),e([f()],h.prototype,`_enabled`,void 0),h=e([r()],h),customElements.get(`luzmo-display-settings-grand-totals`)||customElements.define(`luzmo-display-settings-grand-totals`,h);
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
|
|
2
|
+
import{n as e,t}from"./localized-mixin-j1gjzMSn.js";import{n}from"./lit-localize-CIGP-NUw.js";import{t as r}from"./localized-decorator-Buib6Rq1.js";import{t as i}from"./luzmoAngleDown-PNrItYzK.js";import{a,t as o}from"./calculate-data-field-icon-CrEVAfzJ.js";import{t as s}from"./luzmo-icon-markup-BENMHpB_.js";import{n as c,r as l,t as u}from"./base-CR5wZnQk.js";import{t as d}from"./decompose-numeric-format-BXLQ97e2.js";import{t as f}from"./localize-BXHWaHdZ.js";import{html as p,nothing as m,property as h,query as g,state as _,unsafeCSS as v}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/number-field.js";import{removeSlottableRequest as y}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/picker.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/tooltip.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/menu.js";var b=`:host .settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-numeric-gap,var(--display-settings-numeric-gap));display:flex}.duration-angle-down-icon{margin-inline-start:var(--luzmo-numeric-duration-levels-dropdown-icon-margin-inline-start,var(--numeric-duration-levels-dropdown-icon-margin-inline-start))}.dataset-header{white-space:nowrap;text-overflow:ellipsis;text-transform:uppercase;max-width:100%;color:var(--luzmo-font-color);white-space:nowrap;cursor:default;margin:.5rem 1rem;font-weight:600;overflow:hidden}.no-weight-label{margin-left:1rem}.with-secondary-icon{clip-path:polygon(0 0,60% 0,65% 60%,100% 65%,100% 100%,0 100%)}.secondary-icon{width:auto;font-size:.75em;line-height:1;position:absolute;bottom:45%;left:60%}.data-icon-type{text-align:center;width:1.5rem;display:inline-block;position:relative}:host{--display-settings-numeric-gap:var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start:var(--luzmo-spacing-2)}:host([size=s]){--display-settings-numeric-gap:var(--luzmo-spacing-3);--numeric-duration-levels-dropdown-icon-margin-inline-start:var(--luzmo-spacing-1)}:host([size=l]){--display-settings-numeric-gap:var(--luzmo-spacing-4);--numeric-duration-levels-dropdown-icon-margin-inline-start:var(--luzmo-spacing-3)}:host([size=xl]){--display-settings-numeric-gap:var(--luzmo-spacing-5);--numeric-duration-levels-dropdown-icon-margin-inline-start:var(--luzmo-spacing-4)}`,x={sum:()=>n(`Sum`,{desc:`Aggregation label`}),cumulativesum:()=>n(`Cumulative sum`,{desc:`Aggregation label`}),average:()=>n(`Average`,{desc:`Aggregation label`}),median:()=>n(`Median`,{desc:`Aggregation label`}),count:()=>n(`Count rows`,{desc:`Aggregation label`}),distinctcount:()=>n(`Count distinct`,{desc:`Aggregation label`}),min:()=>n(`Minimum`,{desc:`Aggregation label`}),max:()=>n(`Maximum`,{desc:`Aggregation label`}),stddev:()=>n(`Standard deviation`,{desc:`Aggregation label`}),rate:()=>n(`Rate`,{desc:`Aggregation label`})},S={general:`123`,percentage:`%`,scientific:`SI`},C={time:()=>n(`Time`,{desc:`Time format option`}),short:()=>n(`Short`,{desc:`Short format option`}),long:()=>n(`Long`,{desc:`Long format option`})},w={Auto:{auto:!0,label:()=>n(`Auto`,{desc:`Automatic setting of the option`})},"1,000.00":{auto:!1,label:()=>`1,000.00`,thousandSeparator:`,`,decimalSeparator:`.`,hiddenFor:`scientific`},"1.000,00":{auto:!1,label:()=>`1.000,00`,thousandSeparator:`.`,decimalSeparator:`,`,hiddenFor:`scientific`},"1000.00":{auto:!1,label:()=>`1000.00`,decimalSeparator:`.`},"1000,00":{auto:!1,label:()=>`1000,00`,decimalSeparator:`,`}},T={levels:[{level:1,label:`years`},{level:2,label:`quarters`},{level:3,label:`months`},{level:4,label:`weeks`},{level:5,label:`days`},{level:6,label:`hours`},{level:7,label:`minutes`},{level:8,label:`seconds`},{level:9,label:`milliseconds`}]},E=class extends t(c(l,{validSizes:Object.values(u)})){constructor(...e){super(...e),this.slotContent={},this.measureColumns=[],this._durationLevels=[],this._renderDurationLevelMenu=!1,this._handleSlottableRequest=e=>{this._renderDurationLevelMenu=e.data!==y},this._sendEvent=()=>{let e={...this.slotContent,format:this._format,aggregationFunc:this._aggregationFunc};this._aggregationWeightColumn?e.aggregationWeight={...this._aggregationWeightColumn}:delete e.aggregationWeight,this._displayMode===`duration`?(e.duration=e.duration??{},e.duration.format=this._durationFormat,e.duration.levels=this._durationLevels):delete e.duration,this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:e}}))}}static get styles(){return[v(b)]}_parseSavedNumericFormatSettings(){if(this._displayMode=this.slotContent?.subtype===`duration`?`duration`:`numeric`,this._durationFormat=this.slotContent?.duration?.format??`short`,this._durationLevels=this.slotContent?.duration?.levels??[1],this._displayMode===`duration`)this._precision=2,this._commaDecimals=!1,this._thousandSeparator=!1;else{this._format=this.slotContent?.format??`.0f`;let e=d(this._format??`.0f`);this._isAuto=e.typeFormat?.includes(`a`)??!1,[`%`,`a%`,`y`,`ay`].includes(e.typeFormat)?this._displayAs=`percentage`:[`s`,`as`,`w`,`aw`].includes(e.typeFormat)?this._displayAs=`scientific`:this._displayAs=`general`,this._precision=e.precision?Number.parseInt(e.precision.replace(`.`,``),10):+(this._displayAs===`scientific`),this._commaDecimals=[`z`,`az`,`y`,`ay`,`w`,`aw`].includes(e.typeFormat),this._thousandSeparator=e.comma===`,`,this._isAuto?this._numericFormatGroup=`Auto`:this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup=`1.000,00`:!this._commaDecimals&&this._thousandSeparator?this._numericFormatGroup=`1,000.00`:this._commaDecimals&&!this._thousandSeparator?this._numericFormatGroup=`1000,00`:!this._commaDecimals&&!this._thousandSeparator&&(this._numericFormatGroup=`1000.00`)}}_setNumericDisplayAs(){this._displayAs=this._displayAsElement?.selected?.[0]??`general`,this._displayAs===`scientific`&&(this._precision=Math.max(this._precision??0,1),this._thousandSeparator=!1),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setNumericSeparators(e){let t=w[e?.detail??`Auto`];this._thousandSeparator=[`,`,`.`].includes(t?.thousandSeparator??``),this._commaDecimals=t?.decimalSeparator===`,`,this._isAuto=t?.auto,this._setNumericFormat(),this._sendEvent()}_setPrecision(){Number.isNaN(this._precisionElement.value)&&(this._precisionElement.value=+(this._displayAs===`scientific`)),this._precision=this._precisionElement.value,this._setNumericFormat(),this._sendEvent()}_setNumericFormat(){let e=`f`,t=this.slotContent.subtype===`duration`?this._durationLevels&&this._durationLevels?.length===1?`numeric`:`duration`:`numeric`;if(this._maxDurationLevel=Math.min(...this._durationLevels),t===`duration`)(![`time`,`short`,`long`].includes(this._durationFormat??``)||this._maxDurationLevel<6&&this._durationFormat===`time`)&&(this._durationFormat=`short`);else{let t=this._displayAs??`general`;t===`general`&&this._commaDecimals?e=`z`:t===`percentage`&&this._commaDecimals?e=`y`:t===`scientific`&&this._commaDecimals?e=`w`:t===`percentage`?e=`%`:t===`scientific`&&(e=`s`),this._format=(this._thousandSeparator||this._isAuto?`,`:``)+`.`+this._precision+(this._isAuto?`a`:``)+e}}_setAggregationFunc(){let e=this._aggregationElement.value,t=this._aggregationFunc,n=this.slotContent.format;if(e!==(t===`weightedaverage`?`average`:t)){if(this._aggregationFunc=e===`average`&&this._aggregationWeightColumn?.column?`weightedaverage`:e,t===`rate`){let e=d(n),t=[`%`,`y`,`a%`,`ay`].includes(e.typeFormat);this.slotContent.subtype===`currency`&&t&&this._setNumericDisplayAs()}this._sendEvent(),(this._aggregationFunc===`rate`||t===`rate`)&&this.requestUpdate()}}_setAggregationWeight(){let e=this._aggregationWeightElement.value,t=this._aggregationFunc;if(e===`none`)this._aggregationWeightColumn=void 0,this._aggregationFunc===`weightedaverage`&&(this._aggregationFunc=`average`);else{let t,n;for(let r of this.measureColumns??[]){let i=r.columns?.find(t=>t.id===e);if(i){t=i,n=r.datasetId;break}}t&&(this._aggregationWeightColumn={column:t.id,set:n,columnSubType:t.subtype}),this._aggregationFunc===`average`&&(this._aggregationFunc=`weightedaverage`)}this._sendEvent(),this.requestUpdate(),(t===`weightedaverage`&&this._aggregationFunc===`average`||t===`average`&&this._aggregationFunc===`weightedaverage`)&&this.requestUpdate()}_setDurationLevels(){let e=this._durationLevels,t=this._durationLevelsElement.value.split(`,`).filter(e=>e!==``).map(e=>Number.parseInt(e,10));this._durationLevels=(t?.length??0)>=1?t:e,this._maxDurationLevel=Math.min(...this._durationLevels),this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_setDurationFormat(){this._durationFormat=this._durationFormatElement?.selected?.[0],this._fillTimeDurationLevels(),this._setNumericFormat(),this._sendEvent(),this.requestUpdate()}_fillTimeDurationLevels(){if(this._durationFormat===`time`){let e=this._durationLevels.sort().at(-1);if([7,8,9].includes(e)){for(let t of{lev7:[6],lev8:[6,7],lev9:[6,7,8]}[`lev`+e])this._durationLevels.includes(t)||this._durationLevels.push(t);this._durationLevels=[...this._durationLevels].sort()}}}willUpdate(e){super.willUpdate(e),e.has(`slotContent`)&&(this._parseSavedNumericFormatSettings(),this._aggregationFunc=this.slotContent?.aggregationFunc??(this.slotContent?.type===`numeric`?`sum`:`count`),this._aggregationWeightColumn=this.slotContent?.aggregationWeight,this._isFormula=this.slotContent?.formula||this.slotContent?.formulaId)}_renderDurationLevelsSettings(){let e=T.levels.map(e=>{let t=!1;return this._durationFormat===`time`&&e.level>=6&&this._durationLevels.includes(e.level)&&e.level!==Math.max(...this._durationLevels)&&(t=!0),this._durationLevels.length===1&&this._durationLevels.includes(e.level)&&(t=!0),p`<luzmo-menu-item
|
|
3
|
+
value=${e.level}
|
|
4
|
+
?selected=${this._durationLevels.includes(e.level)}
|
|
5
|
+
?disabled=${t}
|
|
6
|
+
>
|
|
7
|
+
${e.label}
|
|
8
|
+
</luzmo-menu-item>`});return p` <div class="setting">
|
|
9
|
+
<luzmo-field-label .size=${this.size} for="duration-levels">
|
|
10
|
+
${n(`Duration levels`,{desc:`Label for duration levels setting`})}
|
|
11
|
+
</luzmo-field-label>
|
|
12
|
+
<luzmo-action-button id="duration-levels-trigger" size=${this.size} aria-haspopup="true" aria-expanded=${this._renderDurationLevelMenu?`true`:`false`}>
|
|
13
|
+
${this._durationLevels.length}
|
|
14
|
+
${this._durationLevels.length===1?n(`level`,{desc:`Singular form of level for duration levels`}):n(`levels`,{desc:`Plural form of level for duration levels`})} ${n(`active`,{desc:`Active suffix for duration levels count`})}
|
|
15
|
+
<span class="duration-angle-down-icon">
|
|
16
|
+
${s(i)}
|
|
17
|
+
</span>
|
|
18
|
+
</luzmo-action-button>
|
|
19
|
+
<luzmo-overlay
|
|
20
|
+
id="duration-levels-overlay"
|
|
21
|
+
trigger="duration-levels-trigger@click"
|
|
22
|
+
type="auto"
|
|
23
|
+
placement="bottom-start"
|
|
24
|
+
type="page"
|
|
25
|
+
@slottable-request=${this._handleSlottableRequest}
|
|
26
|
+
>
|
|
27
|
+
<luzmo-popover style="position: relative">
|
|
28
|
+
${this._renderDurationLevelMenu?p` <luzmo-menu
|
|
29
|
+
id="duration-levels"
|
|
30
|
+
size=${this.size}
|
|
31
|
+
selects="multiple"
|
|
32
|
+
.value=${this._durationLevels.join(`,`)}
|
|
33
|
+
@change=${this._setDurationLevels}
|
|
34
|
+
>
|
|
35
|
+
${e}
|
|
36
|
+
</luzmo-menu>`:``}
|
|
37
|
+
</luzmo-popover>
|
|
38
|
+
</luzmo-overlay>
|
|
39
|
+
</div>`}_renderDurationFormatSettings(){let e=Object.keys(C).map(e=>e===`time`&&(this._maxDurationLevel??1)<6?``:p`<luzmo-action-button value=${e}>
|
|
40
|
+
${C[e]()}
|
|
41
|
+
</luzmo-action-button>`);return p` <div class="setting">
|
|
42
|
+
<luzmo-field-label .size=${this.size} for="duration-format">
|
|
43
|
+
${n(`Format`,{desc:`Label for format setting`})}
|
|
44
|
+
</luzmo-field-label>
|
|
45
|
+
<luzmo-action-group
|
|
46
|
+
emphasized
|
|
47
|
+
id="duration-format"
|
|
48
|
+
size=${this.size}
|
|
49
|
+
compact=""
|
|
50
|
+
.selected=${[this._durationFormat??`short`]}
|
|
51
|
+
selects="single"
|
|
52
|
+
@change=${this._setDurationFormat}
|
|
53
|
+
>
|
|
54
|
+
${e}
|
|
55
|
+
</luzmo-action-group>
|
|
56
|
+
</div>`}_renderNumericDisplayAsSettings(){let e=Object.keys(S).filter(e=>e!==`percentage`||(this.slotContent.subtype!==`currency`||this.slotContent.aggregationFunc===`rate`)&&this.slotContent.periodOverPeriod?.type!==`percentageChange`).map(e=>p`<luzmo-action-button value=${e}
|
|
57
|
+
>${S[e]}</luzmo-action-button
|
|
58
|
+
>`);return p`<div class="setting">
|
|
59
|
+
<luzmo-field-label .size=${this.size} for="display-as">
|
|
60
|
+
${n(`Display as`,{desc:`Label for display as setting for the datetime field`})}
|
|
61
|
+
</luzmo-field-label>
|
|
62
|
+
<luzmo-action-group
|
|
63
|
+
emphasized
|
|
64
|
+
id="display-as"
|
|
65
|
+
size=${this.size}
|
|
66
|
+
compact=""
|
|
67
|
+
.selected=${[this._displayAs]}
|
|
68
|
+
selects="single"
|
|
69
|
+
@change=${this._setNumericDisplayAs}
|
|
70
|
+
>
|
|
71
|
+
${e}
|
|
72
|
+
</luzmo-action-group>
|
|
73
|
+
</div>`}_renderNumericFormatSettings(){let e=Object.entries(w).filter(([,{hiddenFor:e}])=>!e||e!==this._displayAs).map(([e,{label:t}])=>p`<luzmo-menu-item value=${e}>${t()}</luzmo-menu-item>`);return p` <div class="setting">
|
|
74
|
+
<luzmo-field-label .size=${this.size} for="format">
|
|
75
|
+
${n(`Format`,{desc:`Label for format setting`})}
|
|
76
|
+
</luzmo-field-label>
|
|
77
|
+
<luzmo-picker
|
|
78
|
+
id="format"
|
|
79
|
+
size=${this.size}
|
|
80
|
+
variant="highlight"
|
|
81
|
+
value=${this._numericFormatGroup??`Auto`}
|
|
82
|
+
@change=${this._setNumericSeparators}
|
|
83
|
+
>
|
|
84
|
+
${e}
|
|
85
|
+
</luzmo-picker>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="setting">
|
|
88
|
+
<luzmo-field-label .size=${this.size} for="precision" id="precision-label">
|
|
89
|
+
${this._displayAs===`scientific`?n(`Precision`,{desc:`Label for precision setting`}):n(`Decimals`,{desc:`Label for decimals setting`})}
|
|
90
|
+
</luzmo-field-label>
|
|
91
|
+
<luzmo-number-field
|
|
92
|
+
id="precision"
|
|
93
|
+
label=${this._displayAs===`scientific`?n(`Precision`,{desc:`Label for precision setting`}):n(`Decimals`,{desc:`Label for decimals setting`})}
|
|
94
|
+
min=${+(this._displayAs===`scientific`)}
|
|
95
|
+
max="22"
|
|
96
|
+
size=${this.size}
|
|
97
|
+
value=${this._precision??+(this._displayAs===`scientific`)}
|
|
98
|
+
@change=${this._setPrecision}
|
|
99
|
+
></luzmo-number-field>
|
|
100
|
+
</div>`}_renderAggregationSettings(){let e=Object.entries(x).filter(([e])=>[`count`,`distinctcount`].includes(e)||this.slotContent?.type===`numeric`).filter(([e])=>e!==`cumulativesum`||this.isCumulativeSumEnabled).map(([e,t])=>p`<luzmo-menu-item value=${e}>${t()}</luzmo-menu-item>`),t=[p`
|
|
101
|
+
<luzmo-menu-item
|
|
102
|
+
value="none"
|
|
103
|
+
class="no-weight"
|
|
104
|
+
>
|
|
105
|
+
<span class="no-weight-label">${n(`No weight`,{desc:`Label for no weight option`})}</span>
|
|
106
|
+
</luzmo-menu-item>
|
|
107
|
+
`,...(this.measureColumns??[]).flatMap(e=>{let t=typeof e.datasetName==`object`?f(e.datasetName,this.language):e.datasetName;return[p`<div class="dataset-header" role="group" aria-label=${t}>
|
|
108
|
+
${t}
|
|
109
|
+
<luzmo-tooltip self-managed placement="right" size=${this.size}>
|
|
110
|
+
${t}
|
|
111
|
+
</luzmo-tooltip>
|
|
112
|
+
</div>`,...(e.columns??[]).map(e=>{let t=typeof e.name==`object`?f(e.name,this.language):e.name,n=s(o(e,`s`)),r=e.expression?a:void 0,i=!!r,c=i?p`<span class="secondary-icon"
|
|
113
|
+
>${s(r)}</span
|
|
114
|
+
>`:m;return p`<luzmo-menu-item value=${e.id}>
|
|
115
|
+
<span class="data-icon-type" slot="icon">
|
|
116
|
+
<span class=${i?`with-secondary-icon`:``}
|
|
117
|
+
>${n}</span
|
|
118
|
+
>
|
|
119
|
+
${c}
|
|
120
|
+
</span>
|
|
121
|
+
<span class="column-label text-truncate">${t}</span>
|
|
122
|
+
<luzmo-tooltip self-managed placement="right" size=${this.size}>
|
|
123
|
+
${t}
|
|
124
|
+
</luzmo-tooltip>
|
|
125
|
+
</luzmo-menu-item>`})]})];return p`<div class="settings-row">
|
|
126
|
+
<div class="setting">
|
|
127
|
+
<luzmo-field-label .size=${this.size} for="aggregation">
|
|
128
|
+
${n(`Aggregation`,{desc:`Label for aggregation setting`})}
|
|
129
|
+
</luzmo-field-label>
|
|
130
|
+
<luzmo-picker
|
|
131
|
+
id="aggregation"
|
|
132
|
+
size=${this.size}
|
|
133
|
+
variant="highlight"
|
|
134
|
+
value=${(()=>{let e=this.slotContent?.type===`numeric`?`sum`:`count`;return this._aggregationFunc===`weightedaverage`?`average`:this._aggregationFunc??e})()}
|
|
135
|
+
@change=${this._setAggregationFunc}
|
|
136
|
+
>
|
|
137
|
+
${e}
|
|
138
|
+
</luzmo-picker>
|
|
139
|
+
</div>
|
|
140
|
+
${[`rate`,`average`,`weightedaverage`].includes(this._aggregationFunc??``)?p`<div class="setting">
|
|
141
|
+
<luzmo-field-label .size=${this.size} for="weighting-column">
|
|
142
|
+
${this._aggregationFunc===`rate`?n(`Denominator`,{desc:`Label for denominator field`}):n(`Weight`,{desc:`Label for weight field`})}
|
|
143
|
+
</luzmo-field-label>
|
|
144
|
+
${this.measureColumns.length>0?p`
|
|
145
|
+
<luzmo-picker
|
|
146
|
+
id="weighting-column"
|
|
147
|
+
size=${this.size}
|
|
148
|
+
variant="highlight"
|
|
149
|
+
icons="none"
|
|
150
|
+
value=${this._aggregationWeightColumn?.column??`none`}
|
|
151
|
+
@change=${this._setAggregationWeight}
|
|
152
|
+
>
|
|
153
|
+
${t}
|
|
154
|
+
</luzmo-picker>
|
|
155
|
+
`:p`<luzmo-picker
|
|
156
|
+
id="weighting-column"
|
|
157
|
+
size=${this.size}
|
|
158
|
+
variant="highlight"
|
|
159
|
+
icons="none"
|
|
160
|
+
value="none"
|
|
161
|
+
>
|
|
162
|
+
<luzmo-menu-item value="none">${n(`No weight`,{desc:`Label for no weight option`})}</luzmo-menu-item>
|
|
163
|
+
</luzmo-picker>`}
|
|
164
|
+
</div>`:``}
|
|
165
|
+
</div>`}render(){return p`<div class="settings-container">
|
|
166
|
+
<div class="settings-row">
|
|
167
|
+
${this._displayMode===`duration`?this._renderDurationLevelsSettings():this._renderNumericDisplayAsSettings()}
|
|
168
|
+
${this._durationLevels?.length>1?this._renderDurationFormatSettings():this._renderNumericFormatSettings()}
|
|
169
|
+
</div>
|
|
170
|
+
${this._isFormula||this.isAggregationDisabled?m:this._renderAggregationSettings()}
|
|
171
|
+
</div>
|
|
172
|
+
</div>`}};e([h({type:Object,attribute:!1})],E.prototype,`slotContent`,void 0),e([h({type:Array,reflect:!1})],E.prototype,`measureColumns`,void 0),e([h({type:Boolean})],E.prototype,`isAggregationDisabled`,void 0),e([h({type:Boolean})],E.prototype,`isCumulativeSumEnabled`,void 0),e([g(`#display-as`)],E.prototype,`_displayAsElement`,void 0),e([g(`#precision`)],E.prototype,`_precisionElement`,void 0),e([g(`#aggregation`)],E.prototype,`_aggregationElement`,void 0),e([g(`#weighting-column`)],E.prototype,`_aggregationWeightElement`,void 0),e([g(`#duration-levels`)],E.prototype,`_durationLevelsElement`,void 0),e([g(`#duration-format`)],E.prototype,`_durationFormatElement`,void 0),e([_()],E.prototype,`_renderDurationLevelMenu`,void 0),E=e([r()],E),customElements.get(`luzmo-display-settings-numeric`)||customElements.define(`luzmo-display-settings-numeric`,E);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import{n as e,t}from"./localized-mixin-
|
|
2
|
+
import{n as e,t}from"./localized-mixin-j1gjzMSn.js";import{n}from"./lit-localize-CIGP-NUw.js";import{t as r}from"./localized-decorator-Buib6Rq1.js";import{n as i,r as a,t as o}from"./base-CR5wZnQk.js";import{t as s}from"./decompose-numeric-format-BXLQ97e2.js";import{t as c}from"./localize-BXHWaHdZ.js";import{t as l}from"./period-over-period-condition.const-AC_onvUf.js";import{html as u,property as d,query as f,state as p,unsafeCSS as m}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/picker.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/menu.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/accordion.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.4.1/standalone/checkbox.js";var h={none:()=>n(`None`),past:()=>n(`Past value`,{desc:`Period option`}),absoluteChange:()=>n(`Absolute change`,{desc:`Period option`}),percentageChange:()=>n(`% change`,{desc:`Period option`})},g=[{key:`periods`,i18n:()=>n(`Periods`,{desc:`Period option`})},{key:`years`,i18n:()=>n(`Years`,{desc:`Period option`})},{key:`quarters`,i18n:()=>n(`Quarters`,{desc:`Period option`})},{key:`months`,i18n:()=>n(`Months`,{desc:`Period option`})},{key:`weeks`,i18n:()=>n(`Weeks`,{desc:`Period option`})},{key:`days`,i18n:()=>n(`Days`,{desc:`Period option`})},{key:`hours`,i18n:()=>n(`Hours`,{desc:`Period option`})},{key:`minutes`,i18n:()=>n(`Minutes`,{desc:`Period option`})},{key:`seconds`,i18n:()=>n(`Seconds`,{desc:`Period option`})}],_=function(e){return e.Relative=`relative`,e.UserDefined=`user-defined`,e}({}),v=[{key:`relative`,i18n:()=>n(`Relative`,{desc:`Range type option`})},{key:`user-defined`,i18n:()=>n(`User-defined`,{desc:`Range type option`})}],y=`:host{font-family:var(--luzmo-display-settings-period-over-period-font-family,var(--luzmo-font-family));font-size:var(--luzmo-display-settings-period-over-period-font-size,var(--display-settings-period-over-period-font-size));color:var(--luzmo-display-settings-period-over-period-color,var(--luzmo-font-color))}:host .settings-container{flex-direction:column;gap:0;display:flex}:host .settings-container:first-of-type{margin-right:var(--luzmo-spacing-4)}:host .settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-period-over-period-gap,var(--display-settings-period-over-period-gap));display:flex}:host .wrap{flex-wrap:wrap}:host .setting.period-number-setting{align-items:center;display:flex}:host .dynamic-settings-container{max-width:var(--luzmo-display-setting-period-over-period-dynamic-max-width,var(--display-setting-period-over-period-dynamic-max-width))}:host luzmo-accordion{--luzmo-accordion-item-content-area-top-to-content:0;--luzmo-accordion-item-content-padding-left:var(--luzmo-spacing-1);--luzmo-accordion-item-header-bottom-margin:0;--luzmo-accordion-item-content-area-bottom-to-content:var(--luzmo-spacing-2);--accordion-item-header-font-size:var(--luzmo-display-settings-period-over-period-font-size,var(--display-settings-period-over-period-font-size));--accordion-item-content-font-size:var(--luzmo-display-settings-period-over-period-font-size,var(--display-settings-period-over-period-font-size))}:host .label-container{align-items:center;gap:var(--luzmo-spacing-2);display:flex}:host .academy-link{color:var(--luzmo-link-color);font-size:var(--luzmo-font-size-s);margin-left:var(--luzmo-spacing-2);text-decoration:none}:host .academy-link:hover{color:var(--luzmo-link-color-hover)}:host(:focus){--luzmo-menu-item-label-icon-color-focus:var(--luzmo-menu-item-label-icon-color-focus,var(--luzmo-font-color))}luzmo-menu-item{--luzmo-menu-item-tooltip-font-size:var(--luzmo-display-settings-tooltip-font-size)}luzmo-checkbox{--checkbox-font-size:var(--luzmo-display-settings-period-over-period-font-size,var(--display-settings-period-over-period-font-size))}luzmo-picker{--picker-font-size:var(--luzmo-display-settings-period-over-period-font-size,var(--display-settings-period-over-period-font-size))}luzmo-number-field{--text-field-placeholder-font-size:var(--luzmo-display-settings-period-over-period-font-size,var(--display-settings-period-over-period-font-size));--stepper-button-font-size:var(--luzmo-display-settings-period-over-period-font-size,var(--display-settings-period-over-period-font-size))}:host{--display-settings-period-over-period-gap:var(--luzmo-spacing-3);--display-settings-period-over-period-font-size:var(--luzmo-font-size);--display-setting-period-over-period-dynamic-max-width:22rem}:host([size=xs]){--display-settings-period-over-period-gap:var(--luzmo-spacing-2);--display-settings-period-over-period-font-size:var(--luzmo-font-size-xs);--display-setting-period-over-period-dynamic-max-width:17rem}:host([size=s]){--display-settings-period-over-period-gap:var(--luzmo-spacing-3);--display-settings-period-over-period-font-size:var(--luzmo-font-size-s);--display-setting-period-over-period-dynamic-max-width:19rem}:host([size=l]){--display-settings-period-over-period-gap:var(--luzmo-spacing-4);--display-settings-period-over-period-font-size:var(--luzmo-font-size-l);--display-setting-period-over-period-dynamic-max-width:26rem}:host([size=xl]){--display-settings-period-over-period-gap:var(--luzmo-spacing-5);--display-settings-period-over-period-font-size:var(--luzmo-font-size-xl);--display-setting-period-over-period-dynamic-max-width:30rem}`,b=class extends t(i(a,{validSizes:Object.values(o)})){constructor(...e){super(...e),this.slotContent={},this.allowPeriodsWithoutDatetimeColumn=!1,this.hidePastValue=!1,this.linkedDatasetDatetimeColumns=[],this.needsOffsetDatetimeColumn=()=>this.periodOverPeriodUiType===l.NoDatetimeColumnButComparisonFilters||this.periodOverPeriodUiType===l.NoDatetimeColumnAndNoComparisonFilters}static get styles(){return[m(y)]}willUpdate(e){if(super.willUpdate(e),e.has(`slotContent`)){this._periodComparison=this.slotContent?.periodOverPeriod?.type,this._numberPeriods=this.slotContent?.periodOverPeriod?.quantity;let e=this.slotContent?.periodOverPeriod?.level;this._periodLevel=typeof e==`number`&&e>=0&&e<g.length?g[e].key:this.slotContent?.periodOverPeriod?.level||`periods`,this._incompletePeriods=this.slotContent?.periodOverPeriod?.periodToDate,this._offsetDateColumn=this.slotContent?.periodOverPeriod?.offsetDateColumn,this._minLevel=this.slotContent?.periodOverPeriod?.minLevel??this.slotContent?.periodOverPeriod?.offsetDateColumn?.lowestLevel??this.slotContent?.lowestLevel??(this.slotContent?.subtype===`date`?5:9),this._rangeType=this.slotContent?.periodOverPeriod?.rangeType}this._periodComparison=this._periodComparison??`none`,this._numberPeriods=this._numberPeriods??1,this._periodLevel=this._periodLevel??`periods`,this._incompletePeriods=this._incompletePeriods??!1,this._minLevel=this._minLevel??9,this._rangeType=this._rangeType??_.Relative,this._offsetDateColumn=this._offsetDateColumn||void 0}setPeriodComparison(){let e={...this.slotContent};this.setInitialOffsetDateColumn(e),this._periodComparison=this._periodComparisonElement.value;let t=s(this.slotContent?.format),n=[`%`,`y`,`a%`,`ay`].includes(t.typeFormat),r=t.typeFormat.includes(`a`),i=r?`a`:``,a=t.comma===`,`||r?`,`:``,o=t.precision?Number.parseInt(t.precision.replace(`.`,``),10):0,c=[`z`,`az`,`y`,`ay`,`w`,`aw`].includes(t.typeFormat);this._periodComparison===`percentageChange`&&n&&(e.format=`${a}.${o}${i}${c?`z`:`f`}`),this.sendEvent(e)}setNumberOfPeriods(){this._numberPeriods=Number.parseInt(this._numberPeriodsElement.value,10);let e={...this.slotContent};this.sendEvent(e)}setPeriodLevel(){this._periodLevel=this._periodLevelElement.value;let e={...this.slotContent};this.sendEvent(e)}setOffsetDateColumn(){this._offsetDateColumn=this.linkedDatasetDatetimeColumns.find(e=>e.id===this._offsetDateColumnElement.value);let e={...this.slotContent};this.sendEvent(e)}setIncompletePeriods(){this._incompletePeriods=this._incompletePeriodsElement.checked;let e={...this.slotContent};this.sendEvent(e)}setRangeType(e){this._rangeType=e;let t={...this.slotContent};this.setInitialOffsetDateColumn(t),this.sendEvent(t)}sendEvent(e){let t={...e},n=g.findIndex(e=>e.key===this._periodLevel);t.periodOverPeriod={...e.periodOverPeriod,type:this._periodComparison,level:Math.max(n,0),quantity:this._numberPeriods,periodToDate:this._incompletePeriods,minLevel:this._minLevel,rangeType:this._rangeType,offsetDateColumn:this._offsetDateColumn},this._periodComparison===`none`&&delete t.periodOverPeriod,this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:t}}))}incompletePeriodsSetting(){return u`
|
|
3
3
|
<div class="settings-row">
|
|
4
4
|
<div class="setting">
|
|
5
5
|
<luzmo-checkbox
|