From 06d05db6f5224dca2584468e10df7f26e88024ff Mon Sep 17 00:00:00 2001 From: Lidor-Systems Date: Tue, 21 Jun 2022 23:35:50 +0200 Subject: [PATCH] 22.2 --- LICENSE.md | 6 + README.md | 182 +++++++++++++++++- components/integralui.base.js | 15 ++ components/integralui.base.value.js | 15 ++ components/integralui.enums.js | 15 ++ components/integralui.label.js | 15 ++ external/class-map.js | 14 ++ external/if-defined.js | 14 ++ external/lit-element.js | 171 ++++++++++++++++ external/style-map.js | 14 ++ package.json | 33 ++++ services/integralui.common.service.js | 15 ++ .../dark/integralui.label.dark.js | 20 ++ .../light/integralui.label.light.js | 16 ++ styles/default/integralui.label.style.js | 84 ++++++++ .../themes/office/integralui.label.office.js | 7 + wrappers/react.integralui.label.js | 15 ++ 17 files changed, 650 insertions(+), 1 deletion(-) create mode 100644 LICENSE.md create mode 100644 components/integralui.base.js create mode 100644 components/integralui.base.value.js create mode 100644 components/integralui.enums.js create mode 100644 components/integralui.label.js create mode 100644 external/class-map.js create mode 100644 external/if-defined.js create mode 100644 external/lit-element.js create mode 100644 external/style-map.js create mode 100644 package.json create mode 100644 services/integralui.common.service.js create mode 100644 styles/color-schemes/dark/integralui.label.dark.js create mode 100644 styles/color-schemes/light/integralui.label.light.js create mode 100644 styles/default/integralui.label.style.js create mode 100644 styles/themes/office/integralui.label.office.js create mode 100644 wrappers/react.integralui.label.js diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..841ae81 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,6 @@ +You are FREE to use this product to develop Internet and Intranet web sites, web applications and other products, with no-charge. + +This project has been released under the IntegralUI Web Lite License, and may not be used except in compliance with the License. +A copy of the License should have been installed in the product's root installation directory or it can be found here: [License Agreement](https://www.lidorsystems.com/products/web/lite/integralui-web-lite-license-agreement.pdf). + +This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index dc5a0dc..99ec06d 100644 --- a/README.md +++ b/README.md @@ -1 +1,181 @@ -# integralui-web-label \ No newline at end of file +# IntegralUI Web - Label, v22.2 + +IntegralUI Web - Label is a native Web Component that is fully customizable label with different alignments relative to attached element. + +![IntegralUI Web - Label, 22.2 - a native Web Component for JavaScript, Angular, React and Vue. A fully customizable label with different alignments relative to attached element.](https://www.lidorsystems.com/products/web/studio/images/integralui-web-label.png) + +Note This component is part of [IntegralUI Web](https://github.com/lidorsystems/integralui-web.git) library. + +Here is a brief overview of what is included: + + +## Components + +[Label](https://www.lidorsystems.com/products/web/studio/samples/#/label) - A fully customizable label with different alignments relative to attached element + + +## Services + +Common - Includes a set of common functions usable in most applications + + +## Dependencies + +IntegralUI Web is built on top of [LitElement](https://github.com/Polymer/lit-element). All necessary files from that library are already included in the /external subfolder of this repository. + + +## DEMO + +[Online QuickStart App](https://www.lidorsystems.com/products/web/studio/samples/) - An online demo of Label component is included + + +## Installation + +Install the repository by running + +```bash +npm install https://github.com/lidorsystems/integralui-web-label.git +``` + +or directly from NPM + +```bash +npm i integralui-web-label +``` + + +## How to Use + +Note A detailed information is available here: [How to Use IntegralUI Web Components](https://www.lidorsystems.com/help/integralui/web-components/introduction/installation/). Explains how to setup and use components for each framework: Angular, React or Vanilla JavaScript. + +In general, you need to open your application and add a reference to a component you want to use. For example, if you are using the IntegralUI Label component:

+ +### Angular + +```bash +import 'integralui-web-label/components/integralui.label.js'; +import { IntegralUILabelAlignment, IntegralUITheme } from 'integralui-web-label/components/integralui.enums.js'; + +@Component({ + selector: '', + templateUrl: './label-overview.html', + styleUrls: ['./label-overview.css'] +}) +export class LabelOverviewSample { + public labelAlignment: IntegralUILabelAlignment = IntegralUILabelAlignment.Left; + public labelContentSize: any = { width: 200 } + public labelSize: any = { width: 350 } + public currentTheme: IntegralUITheme = IntegralUITheme.Office; +} +``` + +Then, place the component in HTML using its tag. Here is an example: + + +```bash +
+ + + +
+``` + +Depending on current version of TypeScript, you may need to add some settings in tsconfig.json, under "angularCompilerOptions": + +```bash +"angularCompilerOptions": { + + . . . + + "suppressImplicitAnyIndexErrors": true, // solves implicit any values + "noImplicitAny": false, // solves angular could not find a declaration file for module implicitly has an 'any' type + "strictNullChecks": false // solves type null is not assignable to type + +} +``` + + +### React + +Currently [ReactJS doesn't have full support for Web Components](https://custom-elements-everywhere.com/#react). Mainly because of the way data is passed to the component via attributes and their own synthetic event system. For this reason, you can use available wrappers located under /wrappers directory, which are ReactJS components that provide all public API from an IntegralUI component.

+ +```bash +import IntegralUILabelComponent from 'integralui-web-label/wrappers/react.integralui.label.js'; +import { IntegralUILabelAlignment, IntegralUITheme } from 'integralui-web-label/components/integralui.enums.js'; + +class LabelOverview extends Component { + + constructor(props){ + super(props); + + this.state = { + isAnimationAllowed: true, + labelAlignment: IntegralUILabelAlignment.Left, + labelContentSize: { width: 200 }, + labelSize: { width: 350 }, + currentTheme: IntegralUITheme.Office + } + } +} +``` + +Then, place the component in HTML using its tag. Here is an example: + +```bash + render() { + return ( +
+ + + +
+ ); + } +``` + + +### Vanilla JavaScript + +```bash + +``` + +Then, place the component in HTML using its tag. Here is an example: + +```bash +
+ +
+``` + +## How to Change Appearance + +To modify the Label appearance, you can use CSS custom properties: + +```bash +.alignment-block iui-label { + --label-background: #cecece; + --label-display: block; + --label-focused-background: #6ea9db; + --label-focused-color: white; + --label-margin: 10px 0; + + --label-value-padding: 5px; +} +``` + +## QuickStart App + +There is a demo application with source code that contains samples for each component included in the IntegralUI Web library. It can help you to get started quickly with learning about the components and write tests immediatelly. + +From [IntegralUI Web - QuickStart](https://github.com/lidorsystems/integralui-web-quickstart) you can download a demo app for Angular, AngularJS, React and Vanilla JavaScript. A detailed information about each of these quick-start demos is available in ReadMe file, located in the root folder of the demo app. + + +## License Information + +You are FREE to use this product to develop Internet and Intranet web sites, web applications and other products, with no-charge. + +This project has been released under the IntegralUI Web Lite License, and may not be used except in compliance with the License. +A copy of the License should have been installed in the product's root installation directory or it can be found here: [License Agreement](https://www.lidorsystems.com/products/web/lite/integralui-web-lite-license-agreement.pdf). + +This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. \ No newline at end of file diff --git a/components/integralui.base.js b/components/integralui.base.js new file mode 100644 index 0000000..de09c3a --- /dev/null +++ b/components/integralui.base.js @@ -0,0 +1,15 @@ +/* + filename: integralui.base.js + version : 22.2.0 + Copyright © 2016-2022 Lidor Systems. All rights reserved. + + This file is part of the "IntegralUI Web" Library. + + The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. + A copy of the License should have been installed in the product's root installation directory or it can be found at + http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. + + This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language + governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. +*/ +import{c as css,h as html,L as LitElement}from"../external/lit-element.js";import{s as styleMap}from"../external/style-map.js";import IntegralUICommonService from"../services/integralui.common.service.js";import{IntegralUIColorScheme,IntegralUIObjectState,IntegralUITheme}from"./integralui.enums.js";class IntegralUIBase extends LitElement{constructor(){super();this.m8();this.m7()}m8(){this.a2=new IntegralUICommonService;this.a20=!1;this.a4=null;this.a5="";this.a8=IntegralUIObjectState.Normal;this.a14=0;this.a21=!0;this.a22=!1;this.a26={currentStyle:null};this.a23=!0;this.a6={top:0,left:0,width:0,height:0};this.a1={width:0,height:0};this.a7={width:0,height:0};this.a27={width:0,height:0};this.a18=null;this.a13="../icons";this.a10=IntegralUIColorScheme.Light;this.a9=css``;this.a11={};this.a12={};this.a16=IntegralUITheme.None;this.a15=css``;this.a17={};this.a3={};this.a19="iui-control";this.a24=!0;this.a25=!0}m7(){this.a17={general:{disabled:this.a19+"-disabled",focused:this.a19+"-focused",normal:this.a19,hovered:this.a19+"-hovered",selected:this.a19+"-selected"}};this.m11(this.a10);this.refresh()}attributeChangedCallback(t,e,a){super.attributeChangedCallback(t,e,a)}static get properties(){return{allowAnimation:{type:Boolean,attribute:"allow-animation",relect:!0},allowFocus:{type:Boolean,attribute:"allow-focus",reflect:!0},allowUpdate:{type:Boolean,attribute:"allow-update",relect:!0},colorScheme:{converter:{fromAttribute:t=>{switch((t=t.replace(/"|'/,"").replace(/"|'/,"")).toLowerCase()){case"light":return IntegralUIColorScheme.Light;case"dark":return IntegralUIColorScheme.Dark;default:return IntegralUIColorScheme.None}},toAttribute:t=>{switch(t){case IntegralUIColorScheme.Light:return"Light";case IntegralUIColorScheme.Dark:return"Dark";default:return"None"}}},reflect:!0},customStyle:{type:Object,attribute:"custom-style"},data:{type:Object},enabled:{type:Boolean,relect:!0},name:{type:String,relect:!0},readOnly:{type:Boolean,attribute:"read-only",relect:!0},resourcePath:{type:String,attribute:"resource-path",relect:!0},size:{type:Object},state:{type:Number,relect:!0},theme:{converter:{fromAttribute:t=>{switch((t=t.replace(/"|'/,"").replace(/"|'/,"")).toLowerCase()){case"office":return IntegralUITheme.Office;default:return IntegralUITheme.None}},toAttribute:t=>{switch(t){case IntegralUITheme.Office:return"Office";default:return"None"}}},reflect:!0}}}get allowAnimation(){return this.a20}set allowAnimation(t){if(this.a20!==t){const e=this.a20;this.a20=t;this.requestUpdate("allowAnimation",e)}}get allowFocus(){return this.a23}set allowFocus(t){if(this.a23!==t){const e=this.a23;this.a23=t;this.requestUpdate("allowFocus",e);this.updateLayout()}}get allowUpdate(){return this.a25}set allowUpdate(t){if(this.a25!==t){const e=this.a25;this.a25=t;this.requestUpdate("allowUpdate",e)}}get colorScheme(){return this.a10}set colorScheme(t){if(this.a10!==t){const e=this.a10;this.a10=t;this.m11(t);this.requestUpdate("colorScheme",e);this.refresh()}}get customStyle(){return this.a11}set customStyle(t){if(this.a11!==t){const e=this.a11;this.a11=t;this.requestUpdate("customStyle",e);this.refresh()}}get data(){return this.a4}set data(t){if(this.a4!==t){const e=this.a4;this.a4=t;this.requestUpdate("data",e)}}get enabled(){return this.a21}set enabled(t){if(void 0!==t&&this.a21!==t){const e=this.a21;this.a21=t;this.m9("enabledChanged",{enabled:t});this.requestUpdate("enabled",e);if(t)this.state&=~IntegralUIObjectState.Disabled;else this.state|=IntegralUIObjectState.Disabled}}get name(){return this.a5}set name(t){if(this.a5!==t){const e=this.a5;this.a5=t;this.requestUpdate("name",e)}}get readOnly(){return this.a22}set readOnly(t){if(this.a22!==t){const e=this.a22;this.a22=t;this.requestUpdate("readOnly",e)}}get resourcePath(){return this.a13}set resourcePath(t){if(this.a13!==t){const e=this.a13;this.a13=t;this.m11(this.a10);this.m13(t);this.requestUpdate("resourcePath",e)}}get size(){return this.a7}set size(t){if(t){let e=!1;const a=this.a7;if(void 0!==t.width&&this.a7.width!==t.width){this.a7.width=Math.max(t.width,0);e=!0}if(void 0!==t.height&&this.a7.height!==t.height){this.a7.height=Math.max(t.height,0);e=!0}if(e){this.m9("sizeChanged",{size:this.a7});this.requestUpdate("size",a);this.updateLayout()}}}get state(){return this.a8}set state(t){if(this.a8!==t){const e=this.a8;this.a8=t;this.m12();this.m10();this.requestUpdate("state",e);this.m9("stateChanged",{state:t});this.update()}}get tabIndex(){return this.a14}set tabIndex(t){if(void 0!==t&&this.a14!==t){const e=this.a14;this.a14=t;this.requestUpdate("tabIndex",e);this.update()}}get theme(){return this.a16}set theme(t){if(this.a16!==t){const e=this.a16;this.a16=t;this.m16(t);this.requestUpdate("theme",e);this.refresh()}}m9(t,e,a,s){let i=new CustomEvent(t,{detail:e,bubbles:void 0!==a?a:!1,composed:void 0!==s?s:!1});this.dispatchEvent(i);return e}t3Func(){}getElemRef(){return this.a18}getSize(t){return this.a18?t?{width:this.a18.clientWidth,height:this.a18.clientHeight}:{width:this.a18.offsetWidth,height:this.a18.offsetHeight}:{width:0,height:0}}m10(){}setFocus(){if(this.a18)this.a18.focus()}m11(){this.a9=css``}m16(){this.a15=css``}refresh(){this.m15(this.controlStyle);this.m12();this.update();this.m14()}setClass(t){if(this.a18)if(t)this.a18.classList.add(t);else this.a18.className=this.a19}setStyle(t){if(this.a18){this.a18.style=t?Object.assign(this.a18.style||{},t):{};this.refresh()}}m12(){this.a3={};this.a3[this.a19]=!0;if(this.a26.currentStyle&&this.a26.currentStyle.general){this.a3[this.a26.currentStyle.general.normal]=!0;if(this.state&IntegralUIObjectState.Disabled)this.a3[this.a26.currentStyle.general.disabled]=!0;else if(this.state&IntegralUIObjectState.Focused)this.a3[this.a26.currentStyle.general.focused]=!0;else if(this.state&IntegralUIObjectState.Selected)this.a3[this.a26.currentStyle.general.selected]=!0;else if(this.state&IntegralUIObjectState.Hovered)this.a3[this.a26.currentStyle.general.hovered]=!0;if(this.allowAnimation)if(this.state&IntegralUIObjectState.Hovered)this.a3[this.a17.general.normal+"-enter"]=!0;else this.a3[this.a17.general.normal+"-leave"]=!0}}m2(){return this.a3}m3(){let t={};if(this.a7.width>0)t.width=this.a7.width+"px";if(this.a7.height>0)t.height=this.a7.height+"px";return t}m5(){return{general:this.m4()}}m4(){return this.a17&&this.a17.general?{disabled:this.a17.general.disabled,focused:this.a17.general.focused,hovered:this.a17.general.hovered,normal:this.a17.general.normal,selected:this.a17.general.selected}:{}}m6(t){if(this.a2)if(this.a2.isString(t))return t;else if(t)return{disabled:this.a2.isFieldAvailable(t.disabled,this.a19+"-disabled"),focused:this.a2.isFieldAvailable(t.focused,this.a19+"-focused"),hovered:this.a2.isFieldAvailable(t.hovered,this.a19+"-hovered"),normal:this.a2.isFieldAvailable(t.normal,this.a19),selected:this.a2.isFieldAvailable(t.selected,this.a19+"-selected")};return this.m4()}m13(t){}m15(t){if(t)this.a26.currentStyle={general:this.m6(t.general)};else this.a26.currentStyle=this.m5()}resolve(t){this.a24=!0}async shouldUpdate(t){t.forEach((t,e)=>{});return!0}async updateLayout(){this.update()}wait(){this.a24=!1}m14(){}}export default IntegralUIBase; \ No newline at end of file diff --git a/components/integralui.base.value.js b/components/integralui.base.value.js new file mode 100644 index 0000000..cc8d076 --- /dev/null +++ b/components/integralui.base.value.js @@ -0,0 +1,15 @@ +/* + filename: integralui.base.value.js + version : 22.2.0 + Copyright © 2016-2022 Lidor Systems. All rights reserved. + + This file is part of the "IntegralUI Web" Library. + + The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. + A copy of the License should have been installed in the product's root installation directory or it can be found at + http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. + + This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language + governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. +*/ +import IntegralUIBase from"./integralui.base.js";import IntegralUIObjectState from"./integralui.enums.js";class IntegralUIBaseValue extends IntegralUIBase{m8(){super.m8();this.b1=0;this.b3={};this.a19="iui-basevalue";this.b2=this.a19+"-content"}m7(){this.a17={general:{disabled:this.a19+"-disabled",focused:this.a19+"-focused",normal:this.a19,hovered:this.a19+"-hovered",selected:this.a19+"-selected"},content:{disabled:this.b2+"-disabled",focused:this.b2+"-focused",normal:this.b2,hovered:this.b2+"-hovered",selected:this.b2+"-selected"}};this.m11(this.a10);this.refresh()}attributeChangedCallback(e,t,s){super.attributeChangedCallback(e,t,s)}static get properties(){return{value:{type:Number,reflect:!0}}}get value(){return this.b1}set value(e){if(this.b1!==e){const t=this.b1;this.b1=e;this.m9("valueChanged",{value:this.b1});this.requestUpdate("value",t);this.updateLayout()}}n4(e){e.preventDefault();e.stopPropagation()}async updateLayout(e){this.m14();await this.n5(e);this.update()}n5(e){let t=this;return new Promise(e=>{let s=setTimeout(function(){t.a1={width:t.a18?t.a18.clientWidth:0,height:t.a18?t.a18.clientHeight:0};clearTimeout(s);e()},1)})}refresh(){this.m15(this.controlStyle);this.m12();this.n6();this.update()}m5(){return{general:this.m4(),content:this.n1()}}n1(){return this.a17&&this.a17.content?{disabled:this.a17.content.disabled,focused:this.a17.content.focused,hovered:this.a17.content.hovered,normal:this.a17.content.normal,selected:this.a17.content.selected}:{}}n2(){return this.b3}n3(e){if(this.a2)if(this.a2.isString(e))return e;else if(e)return{disabled:this.a2.isFieldAvailable(e.disabled,this.b2+"-disabled"),focused:this.a2.isFieldAvailable(e.focused,this.b2+"-focused"),hovered:this.a2.isFieldAvailable(e.hovered,this.b2+"-hovered"),normal:this.a2.isFieldAvailable(e.normal,this.b2),selected:this.a2.isFieldAvailable(e.selected,this.b2+"-selected")};return this.n1()}n6(){this.b3={};this.b3[this.b2]=!0;if(this.a26.currentStyle&&this.a26.currentStyle.content){this.b3[this.a26.currentStyle.content.normal]=!0;if(this.state&IntegralUIObjectState.Disabled)this.b3[this.a26.currentStyle.content.disabled]=!0;else if(this.state&IntegralUIObjectState.Focused)this.b3[this.a26.currentStyle.content.focused]=!0;else if(this.state&IntegralUIObjectState.Selected)this.b3[this.a26.currentStyle.content.selected]=!0;else if(this.state&IntegralUIObjectState.Hovered)this.b3[this.a26.currentStyle.content.hovered]=!0}}m15(e){if(e)this.a26.currentStyle={general:this.m6(e.general),content:this.n3(e.content)};else this.a26.currentStyle=this.m5()}}export default IntegralUIBaseValue; \ No newline at end of file diff --git a/components/integralui.enums.js b/components/integralui.enums.js new file mode 100644 index 0000000..abefa41 --- /dev/null +++ b/components/integralui.enums.js @@ -0,0 +1,15 @@ +/* + filename: integralui.enums.js + version : 22.2.0 + Copyright © 2016-2022 Lidor Systems. All rights reserved. + + This file is part of the "IntegralUI Web" Library. + + The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. + A copy of the License should have been installed in the product's root installation directory or it can be found at + http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. + + This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language + governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. +*/ +export const IntegralUIAlignment={None:0,Top:1,Right:2,Bottom:4,Left:8};Object.freeze(IntegralUIAlignment);export const IntegralUIAnchorStyle={None:0,Top:1,Right:2,Bottom:4,Left:8};Object.freeze(IntegralUIAnchorStyle);export const IntegralUIAnimationType={None:"None",Fade:"Fade",Slide:"Slide"};Object.freeze(IntegralUIAnimationType);export const IntegralUICheckMode={TwoState:"TwoState",ThreeState:"ThreeState"};Object.freeze(IntegralUICheckMode);export const IntegralUICheckState={Unchecked:"Unchecked",Indeterminate:"Indeterminate",Checked:"Checked"};Object.freeze(IntegralUICheckState);export const IntegralUIColorFormat={HEX:"HEX",HSL:"HSL",RGB:"RGB"};Object.freeze(IntegralUIColorFormat);export const IntegralUIColorScheme={None:"None",Dark:"Dark",Light:"Light"};Object.freeze(IntegralUIColorScheme);export const IntegralUIContentVisibility={None:"None",Hover:"Hover",Select:"Select",Both:"Both"};Object.freeze(IntegralUIContentVisibility);export const IntegralUIDateFormat={Short:"Short",Long:"Long",Custom:"Custom"};Object.freeze(IntegralUIDateFormat);export const IntegralUIDirection={None:1,Above:2,Right:4,Below:8,Left:16};Object.freeze(IntegralUIDirection);export const IntegralUIDockPermission={None:1,Top:2,Right:4,Fill:8,Bottom:16,Left:32,All:64};Object.freeze(IntegralUIDockPermission);export const IntegralUIDockStyle={None:"None",Top:"Top",Right:"Right",Fill:"Fill",Bottom:"Bottom",Left:"Left"};Object.freeze(IntegralUIDockStyle);export const IntegralUIDragDropDisplayMode={Popup:"Popup",Handle:"Handle"};Object.freeze(IntegralUIDragDropDisplayMode);export const IntegralUIEditMode={None:"None",Batch:"Batch",Custom:"Custom",Dialog:"Dialog",Form:"Form",Inline:"Inline"};Object.freeze(IntegralUIEditMode);export const IntegralUIEditorType={None:"None",Button:"Button",CheckBox:"CheckBox",Color:"Color",Custom:"Custom",Date:"Date",DropDownList:"DropDownList",Image:"Image",Label:"Label",ListScroller:"ListScroller",Numeric:"Numeric",Progress:"Progress",RadioButton:"RadioButton",Rating:"Rating",Slider:"Slider",Text:"Text"};Object.freeze(IntegralUIEditorType);export const IntegralUIFilterType={Boolean:1,Date:2,Numeric:4,String:8};Object.freeze(IntegralUIFilterType);export const IntegralUIGridLines={None:"None",Horizontal:"Horizontal",Vertical:"Vertical",Both:"Both"};Object.freeze(IntegralUIGridLines);export const IntegralUIHorizontalAlignment={Left:"Left",Center:"Center",Right:"Right"};Object.freeze(IntegralUIHorizontalAlignment);export const IntegralUIIncrementMode={Free:"Free",Partial:"Partial",Full:"Full"};Object.freeze(IntegralUIIncrementMode);export const IntegralUIItemDisplayMode={Partial:"Partial",Full:"Full"};Object.freeze(IntegralUIItemDisplayMode);export const IntegralUILabelAlignment={BottomCenter:"BottomCenter",BottomLeft:"BottomLeft",BottomRight:"BottomRight",Inline:"Inline",Left:"Left",MiddleCenter:"MiddleCenter",MiddleLeft:"MiddleLeft",MiddleRight:"MiddleRight",Right:"Right",TopCenter:"TopCenter",TopLeft:"TopLeft",TopRight:"TopRight"};Object.freeze(IntegralUILabelAlignment);export const IntegralUIMoveDirection={After:"After",At:"At",Before:"Before",Down:"Down",First:"First",Left:"Left",Last:"Last",Right:"Right",Up:"Up"};Object.freeze(IntegralUIMoveDirection);export const IntegralUINumericDisplayMode={InBound:"InBound",LeftRight:"LeftRight",UpDown:"UpDown"};Object.freeze(IntegralUINumericDisplayMode);export const IntegralUIObjectState={Normal:0,Hovered:1,Selected:2,Focused:4,Disabled:8};Object.freeze(IntegralUIObjectState);export const IntegralUIOrientation={Horizontal:"Horizontal",Vertical:"Vertical"};Object.freeze(IntegralUIOrientation);export const IntegralUIPlacement={Top:"Top",Right:"Right",Bottom:"Bottom",Left:"Left"};Object.freeze(IntegralUIPlacement);export const IntegralUIResize={None:"None",TopLeft:"TopLeft",Top:"Top",TopRight:"TopRight",Right:"Right",BottomRight:"BottomRight",Bottom:"Bottom",BottomLeft:"BottomLeft",Left:"Left"};Object.freeze(IntegralUIResize);export const IntegralUIScrollMode={Horizontal:"Horizontal",Vertical:"Vertical"};Object.freeze(IntegralUIScrollMode);export const IntegralUISelectionMode={None:"None",One:"One",MultiSimple:"MultiSimple",MultiExtended:"MultiExtended"};Object.freeze(IntegralUISelectionMode);export const IntegralUISortOrder={None:"None",Ascending:"Ascending",Descending:"Descending"};Object.freeze(IntegralUISortOrder);export const IntegralUISpeedMode={VerySlow:"VerySlow",Slow:"Slow",Normal:"Normal",Fast:"Fast",VeryFast:"VeryFast"};Object.freeze(IntegralUISpeedMode);export const IntegralUITabDisplayMode={AutoSized:"AutoSized",Compressed:"Compressed",Justified:"Justified"};Object.freeze(IntegralUITabDisplayMode);export const IntegralUITabScrollMode={None:"None",InBound:"InBound",OutBound:"OutBound"};Object.freeze(IntegralUITabScrollMode);export const IntegralUITabStripPlacement={Top:"Top",Right:"Right",Middle:"Middle",Bottom:"Bottom",Left:"Left"};Object.freeze(IntegralUITabStripPlacement);export const IntegralUITheme={None:"None",Office:"Office"};Object.freeze(IntegralUITheme);export const IntegralUIToastAlignment={BottomCenter:"BottomCenter",BottomFull:"BottomFull",BottomLeft:"BottomLeft",BottomRight:"BottomRight",TopCenter:"TopCenter",TopFull:"TopFull",TopLeft:"TopLeft",TopRight:"TopRight"};Object.freeze(IntegralUIToastAlignment);export const IntegralUIToastType={Error:"Error",Info:"Info",Success:"Success",Warning:"Warning"};Object.freeze(IntegralUIToastType);export const IntegralUIToolItemType={Button:"Button",CheckBox:"CheckBox",Date:"Date",DropDownList:"DropDownList",Image:"Image",Label:"Label",ListScroller:"ListScroller",Numeric:"Numeric",Progress:"Progress",Rating:"Rating",Separator:"Separator",Slider:"Slider",TextBox:"TextBox"};Object.freeze(IntegralUIToolItemType);export const IntegralUIVerticalAlignment={Top:"Top",Middle:"Middle",Bottom:"Bottom"};Object.freeze(IntegralUIVerticalAlignment);export const IntegralUIVisibility={None:1,Hover:2,Click:4,Always:8};Object.freeze(IntegralUIVisibility);export const IntegralUIWeekDays={Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",Sunday:"Sunday"};Object.freeze(IntegralUIWeekDays);export const IntegralUIWindowState={Maximized:"Maximized",Minimized:"Minimized",Normal:"Normal"};Object.freeze(IntegralUIWindowState);export default IntegralUIObjectState; \ No newline at end of file diff --git a/components/integralui.label.js b/components/integralui.label.js new file mode 100644 index 0000000..30a3d1b --- /dev/null +++ b/components/integralui.label.js @@ -0,0 +1,15 @@ +/* + filename: integralui.label.js + version : 22.2.0 + Copyright © 2016-2022 Lidor Systems. All rights reserved. + + This file is part of the "IntegralUI Web" Library. + + The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. + A copy of the License should have been installed in the product's root installation directory or it can be found at + http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. + + This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language + governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. +*/ +import{c as css,h as html}from"../external/lit-element.js";import{c as classMap}from"../external/class-map.js";import{s as styleMap}from"../external/style-map.js";import IntegralUIBaseValue from"./integralui.base.value.js";import{IntegralUIColorScheme,IntegralUIObjectState,IntegralUILabelAlignment,IntegralUITheme}from"./integralui.enums.js";import{iuiLabelDefaultStyle}from"../styles/default/integralui.label.style.js";import{iuiLabelOfficeStyle}from"../styles/themes/office/integralui.label.office.js";import{iuiLabelDarkStyle}from"../styles/color-schemes/dark/integralui.label.dark.js";import{iuiLabelLightStyle}from"../styles/color-schemes/light/integralui.label.light.js";class IntegralUILabel extends IntegralUIBaseValue{m8(){super.m8();this.c26=null;this.c16="Placeholder text";this.b1="";this.c18=!1;this.c14=IntegralUILabelAlignment.Left;this.c1={top:0,right:0,bottom:0,left:0};this.c3={top:0,right:0,bottom:0,left:0};this.c4={top:0,right:0,bottom:0,left:0};this.c5={width:0,height:0};this.c6={top:0,right:0,bottom:0,left:0};this.c9={top:0,right:0,bottom:0,left:0};this.c10={top:0,right:0,bottom:0,left:0};this.c11={width:0,height:0};this.c12={top:0,right:0,bottom:0,left:0};this.c13={top:0,right:0,bottom:0,left:0};this.c22=1;this.c23={top:0,right:0,bottom:0,left:0};this.c24={top:0,left:0};this.c25={width:0,height:0};this.c27={top:0,right:0,bottom:0,left:0};this.c28={width:0,height:0};this.c17=!1;this.c19=!1;this.c2=null;this.c7=null;this.c7Ref=null;this.c21=null;this.a19="iui-label";this.b2=this.a19+"-content";this.c20={};this.c15=iuiLabelDefaultStyle;this.m7()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback();this.q9();this.q10()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i)}static get properties(){return{alignment:{attribute:"alignment",converter:{fromAttribute:t=>{switch((t=t.replace(/"|'/,"").replace(/"|'/,"")).toLowerCase()){case"bottomcenter":return IntegralUILabelAlignment.BottomCenter;case"bottomleft":return IntegralUILabelAlignment.BottomLeft;case"bottomright":return IntegralUILabelAlignment.BottomRight;case"inline":return IntegralUILabelAlignment.Inline;case"right":return IntegralUILabelAlignment.Right;case"topcenter":return IntegralUILabelAlignment.TopCenter;case"topleft":return IntegralUILabelAlignment.TopLeft;case"topright":return IntegralUILabelAlignment.TopRight;default:return IntegralUILabelAlignment.Left}},toAttribute:t=>{switch(t){case IntegralUILabelAlignment.BottomCenter:return"BottomCenter";case IntegralUILabelAlignment.BottomLeft:return"BottomLeft";case IntegralUILabelAlignment.BottomRight:return"BottomRight";case IntegralUILabelAlignment.Inline:return"Inline";case IntegralUILabelAlignment.Right:return"Right";case IntegralUILabelAlignment.TopCenter:return"TopCenter";case IntegralUILabelAlignment.TopLeft:return"TopLeft";case IntegralUILabelAlignment.TopRight:return"TopRight";default:return"Left"}}},reflect:!0},contentSize:{type:Object},size:{type:Object},value:{type:String,reflect:!0}}}get alignment(){return this.c14}set alignment(t){if(this.c14!==t){const e=this.c14;this.c14=t;this.requestUpdate("alignment",e);this.updateLayout()}}get contentSize(){return this.c11}set contentSize(t){if(t){let e=!1;const i=this.c11;if(void 0!==t.width&&this.c11.width!==t.width){this.c11.width=Math.max(t.width,0);e=!0}if(void 0!==t.height&&this.c11.height!==t.height){this.c11.height=Math.max(t.height,0);e=!0}if(e){this.requestUpdate("contentSize",i);this.updateLayout()}}}get size(){return this.a7}set size(t){if(t){let e=!1;const i=this.a7;if(void 0!==t.width&&this.a7.width!==t.width&&t.width>=this.c11.width+10){this.a7.width=Math.max(t.width,0);e=!0}if(void 0!==t.height&&this.a7.height!==t.height){this.a7.height=Math.max(t.height,0);e=!0}if(e){this.m9("sizeChanged",{size:this.a7});this.requestUpdate("size",i);this.updateLayout()}}}get value(){return this.b1}set value(t){if(this.b1!==t){const e=this.b1;this.b1=t;this.m9("valueChanged",{value:this.b1});this.requestUpdate("value",e);this.updateLayout()}}q2(t,e){let i=this;return new Promise(h=>{if(i.a20){i.q10();let l={top:i.c24.top,left:i.c24.left},s=i.c22,a=0,c=5,n={top:{factor:i.c24.top>t.top?-1:1,value:Math.floor(Math.abs(t.top-i.c24.top)/c)},left:{factor:i.c24.left>t.left?-1:1,value:Math.floor(Math.abs(t.left-i.c24.left)/c)},fontSize:{factor:i.c22>e?-1:1,value:Math.abs(e-i.c22)/c}};i.c26=setInterval(function(){if(a{t.c19=!0;t.update();t.c12=t.a2.getBorderWidth(t.a18);t.c13=t.a2.getPadding(t.a18);t.c1=t.a2.getBorderWidth(t.c2);t.c3=t.a2.getMargin(t.c2);t.c4=t.a2.getPadding(t.c2);let i=t.c7Ref.querySelector("slot").assignedNodes();if(i.length>0){t.c7=i[0];t.c6=t.a2.getBorderWidth(t.c7);t.c9=t.a2.getMargin(t.c7);t.c10=t.a2.getPadding(t.c7)}let h={top:0,left:0,width:t.a18.clientWidth,height:t.a18.clientHeight};t.a1={width:t.a18.clientWidth-(t.c13.left+t.c13.right),height:t.a18.clientHeight-(t.c13.top+t.c13.bottom)};t.c5=t.c2?{width:t.c2.offsetWidth,height:t.c2.offsetHeight}:{width:0,height:0};t.c25=t.c21?{width:t.c21.offsetWidth,height:t.c21.offsetHeight}:{width:0,height:0};t.c28=t.c7Ref?{width:t.c7Ref.offsetWidth,height:t.c7Ref.offsetHeight}:{width:0,height:0};h.height=Math.max(t.c25.height,t.c28.height);t.c17="inline-block"===getComputedStyle(t.a18).display?!0:!1;if(t.c14===IntegralUILabelAlignment.Inline){t.c25.height*=.65;h.height=0}else if(t.c14!==IntegralUILabelAlignment.Left&&t.c14!==IntegralUILabelAlignment.Right)h.height=t.c25.height+t.c28.height;if(t.c14!==IntegralUILabelAlignment.Inline)h.height+=t.c3.top+t.c3.bottom+t.c1.top+t.c1.bottom+t.c4.top+t.c4.bottom;t.a6=h;t.c23=t.a2.getPadding(t.c21);t.c24={top:t.c13.top,left:t.c13.left};t.c27={top:0,right:0,bottom:0,left:0};t.c28={width:t.a1.width-t.c25.width,height:t.c28.height};t.q11();t.c19=!1;t.refresh();e()})}q11(){let t=this,e=t.c25.width;if(t.c14===IntegralUILabelAlignment.Left||t.c14===IntegralUILabelAlignment.Right)if(t.c17){if(t.a7.width>0)e=t.q7()+(t.c23.left+t.c23.right)}else if(t.c11.width>0)e=t.q7()+(t.c23.left+t.c23.right);switch(t.c14){case IntegralUILabelAlignment.BottomCenter:t.c24.left=Math.max(t.c13.left,(t.a6.width-t.c25.width)/2);t.c24.top=t.c13.top+t.c28.height;t.c27.bottom=t.c25.height;break;case IntegralUILabelAlignment.BottomLeft:t.c24.left=t.c13.left;t.c24.top=t.c13.top+t.c28.height;t.c27.bottom=t.c25.height;break;case IntegralUILabelAlignment.BottomRight:t.c24.left=t.a6.width-t.c13.right-t.c25.width;t.c24.top=t.c13.top+t.c28.height+1;t.c27.bottom=t.c25.height;break;case IntegralUILabelAlignment.Inline:t.c24.left=t.c13.left+t.c6.left+t.c10.left;t.c24.top=t.c13.top+t.c25.height+t.c6.top+t.c10.top-1;t.c27.top=0;if(!t.a20)t.q13();break;case IntegralUILabelAlignment.Right:t.c24.left=t.a6.width-t.c13.right-e;t.c24.top=t.c13.top+(t.a6.height-t.c25.height)/2;t.c27.right=t.c25.width;break;case IntegralUILabelAlignment.TopCenter:t.c24.left=Math.max(t.c13.left,(t.a6.width-t.c25.width)/2);t.c27.top=t.c25.height;break;case IntegralUILabelAlignment.TopLeft:t.c24.left=t.c13.left;t.c27.top=t.c25.height;break;case IntegralUILabelAlignment.TopRight:t.c24.left=t.a6.width-t.c13.right-t.c25.width;t.c27.top=t.c25.height;break;default:t.c24.left=t.c13.left;t.c24.top=t.c13.top+(t.a6.height-t.c25.height)/2;t.c27.left=e}}async updateLayout(){this.m14();await this.n5();this.update()}n3(){let t={};if(this.c14===IntegralUILabelAlignment.Left||this.c14===IntegralUILabelAlignment.Right){if(this.c11.width>0)t.width=this.c11.width+"px"}else if(0===this.a7.width&&this.c11.width>0)t.width=this.c11.width+"px";if(this.c11.height>0)t.height=this.c11.height+"px";switch(this.c14){case IntegralUILabelAlignment.BottomCenter:case IntegralUILabelAlignment.BottomLeft:case IntegralUILabelAlignment.BottomRight:t.marginBottom=this.c27.bottom+"px";break;case IntegralUILabelAlignment.Inline:t.marginTop=this.c27.top+"px";break;case IntegralUILabelAlignment.Right:t.marginTop=this.c27.top+"px";t.marginRight=this.c27.right+"px";break;case IntegralUILabelAlignment.TopCenter:case IntegralUILabelAlignment.TopLeft:case IntegralUILabelAlignment.TopRight:t.marginTop=this.c27.top+"px";break;default:t.marginTop=this.c27.top+"px";t.marginLeft=this.c27.left+"px"}return t}m3(){let t={};if(this.a7.width>0)t.width=this.a7.width+"px";else if(this.c11.width>0&&this.c14!==IntegralUILabelAlignment.Left&&this.c14!==IntegralUILabelAlignment.Right)t.width=this.c11.width+"px";if(this.a6.height>0)t.height=this.a6.height+"px";else if(this.a7.height>0)t.height=this.a7.height+"px";return t}q5(){return this.c20}q6(){let t={top:this.c24.top+"px",left:this.c24.left+"px",fontSize:this.c22+"rem"};if(!this.c18&&this.q8())t.background="transparent";else t.zIndex=1;if(this.c14===IntegralUILabelAlignment.Left)t.textAlign="right";if(this.c14===IntegralUILabelAlignment.Left||this.c14===IntegralUILabelAlignment.Right)if(this.c17){if(this.a7.width>0)t.width=this.q7()+"px"}else if(this.c11.width>0)t.width=this.q7()+"px";if(this.c19)t.fontWeight="bold";return t}q7(){return this.a1.width-(this.c23.left+this.c23.right)-this.c11.width}refresh(){this.m15(this.controlStyle);this.m12();this.n6();this.q14();this.update()}m11(t){this.a9=css``;switch(t){case IntegralUIColorScheme.Dark:this.a9.cssText=this.a2.replaceAll(iuiLabelDarkStyle.cssText,"../../../icons",this.a13);break;case IntegralUIColorScheme.Light:this.a9.cssText=this.a2.replaceAll(iuiLabelLightStyle.cssText,"../../../icons",this.a13);break;default:this.a9.cssText=""}}m12(){this.a3={};this.a3[this.a19]=!0;if(this.a26.currentStyle&&this.a26.currentStyle.general){this.a3[this.a26.currentStyle.general.normal]=!0;if(this.state&IntegralUIObjectState.Disabled)this.a3[this.a26.currentStyle.general.disabled]=!0;else if(this.state&IntegralUIObjectState.Focused||this.c18)this.a3[this.a26.currentStyle.general.focused]=!0;else if(this.state&IntegralUIObjectState.Selected)this.a3[this.a26.currentStyle.general.selected]=!0;else if(this.state&IntegralUIObjectState.Hovered)this.a3[this.a26.currentStyle.general.hovered]=!0;if(this.allowAnimation)if(this.state&IntegralUIObjectState.Hovered)this.a3[this.a17.general.normal+"-enter"]=!0;else this.a3[this.a17.general.normal+"-leave"]=!0;if(this.c14===IntegralUILabelAlignment.Inline)this.a3[this.a19+"-inline"]=!0}}q14(){this.c20={};this.c20[this.a19+"-value"]=!0;if(this.c14===IntegralUILabelAlignment.Inline)if(this.c18||!this.q8())this.c20[this.a19+"-value-inline"]=!0}m16(t){this.a15=css``;switch(t){case IntegralUITheme.Office:this.a15.cssText=this.a2.replaceAll(iuiLabelOfficeStyle.cssText,"../../../icons",this.a13);break;default:this.a15.cssText=""}}firstUpdated(t){this.m14();this.updateLayout()}render(){return html`
${this.b1}
`}q12(t){this.updateLayout()}m13(t){this.c15=css``;this.c15.cssText=this.a2.replaceAll(iuiLabelDefaultStyle.cssText,"../../icons",t)}m14(){this.q9();this.a18=this.shadowRoot.querySelector("div[data-ctrl=label]");this.c2=this.shadowRoot.querySelector(".iui-label-block");this.c21=this.shadowRoot.querySelector(".iui-label-value");this.c7Ref=this.shadowRoot.querySelector(".iui-label-content");if(this.c7Ref){let t=this.c7Ref.querySelector("slot").assignedNodes();if(t.length>0){this.c7=t[0];this.q1();this.q13();this.c6=this.a2.getBorderWidth(this.c7);this.c9=this.a2.getMargin(this.c7);this.c10=this.a2.getPadding(this.c7);let e=this.c9.left+this.c9.right+(this.c6.left+this.c6.right)+(this.c10.left+this.c10.right);this.c7.style.width="calc(100% - "+e+"px)"}}}}window.customElements.define("iui-label",IntegralUILabel);export default IntegralUILabel; \ No newline at end of file diff --git a/external/class-map.js b/external/class-map.js new file mode 100644 index 0000000..25afcaf --- /dev/null +++ b/external/class-map.js @@ -0,0 +1,14 @@ +import{d as directive,A as AttributePart,P as PropertyPart}from"./lit-element.js"; +/** + * @license + * Copyright (c) 2018 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */const classMapCache=new WeakMap(),classMap=directive(t=>e=>{if(!(e instanceof AttributePart)||e instanceof PropertyPart||"class"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:s}=e,{element:a}=s;if(!classMapCache.has(e))a.className=s.strings.join(" ");const{classList:r}=a,c=classMapCache.get(e);for(const e in c)if(!(e in t))r.remove(e);for(const e in t){const s=t[e];if(!c||s!==c[e]){r[s?"add":"remove"](e)}}classMapCache.set(e,t)});export{classMap, classMap as c}; \ No newline at end of file diff --git a/external/if-defined.js b/external/if-defined.js new file mode 100644 index 0000000..8d5d3b0 --- /dev/null +++ b/external/if-defined.js @@ -0,0 +1,14 @@ +import{d as directive,A as AttributePart}from"./lit-element.js"; +/** + * @license + * Copyright (c) 2018 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */const previousValues=new WeakMap(),ifDefined=directive(e=>t=>{const i=previousValues.get(t);if(void 0===e&&t instanceof AttributePart){if(void 0!==i||!previousValues.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else if(e!==i)t.setValue(e);previousValues.set(t,e)});export{ifDefined as i}; \ No newline at end of file diff --git a/external/lit-element.js b/external/lit-element.js new file mode 100644 index 0000000..d62a50d --- /dev/null +++ b/external/lit-element.js @@ -0,0 +1,171 @@ +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +const directives=new WeakMap(),directive=e=>(...t)=>{const s=e(...t);directives.set(s,!0);return s},isDirective=e=>"function"===typeof e&&directives.has(e),isCEPolyfill=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,removeNodes=(e,t,s=null)=>{for(;t!==s;){const s=t.nextSibling;e.removeChild(t);t=s}},noChange={},nothing={},marker=`{{lit-${String(Math.random()).slice(2)}}}`,nodeMarker=`\x3c!--${marker}--\x3e`,markerRegex=new RegExp(`${marker}|${nodeMarker}`),boundAttributeSuffix="$lit$";class Template{constructor(e,t){this.parts=[];this.element=t;const s=[],i=[],r=document.createTreeWalker(t.content,133,null,!1);let n=0,o=-1,a=0;const{strings:l,values:{length:c}}=e;for(;a0;){const t=l[a],s=lastAttributeNameRegex.exec(t)[2],i=s.toLowerCase()+boundAttributeSuffix,r=e.getAttribute(i);e.removeAttribute(i);const n=r.split(markerRegex);this.parts.push({type:"attribute",index:o,name:s,strings:n});a+=n.length-1}}if("TEMPLATE"===e.tagName){i.push(e);r.currentNode=e.content}}else if(3===e.nodeType){const t=e.data;if(t.indexOf(marker)>=0){const i=e.parentNode,r=t.split(markerRegex),n=r.length-1;for(let t=0;t{const s=e.length-t.length;return s>=0&&e.slice(s)===t},isTemplatePartActive=e=>-1!==e.index,createMarker=()=>document.createComment(""),lastAttributeNameRegex=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +class TemplateInstance{constructor(e,t,s){this.__parts=[];this.template=e;this.processor=t;this.options=s}update(e){let t=0;for(const s of this.__parts){if(void 0!==s)s.setValue(e[t]);t++}for(const e of this.__parts)if(void 0!==e)e.commit()}_clone(){const e=isCEPolyfill?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r,n=0,o=0,a=i.nextNode();for(;n-1||s)&&-1===e.indexOf("--\x3e",r+1);const n=lastAttributeNameRegex.exec(e);if(null===n)t+=e+(s?commentMarker:nodeMarker);else t+=e.substr(0,n.index)+n[1]+n[2]+boundAttributeSuffix+n[3]+marker}return t+=this.strings[e]}getTemplateElement(){const e=document.createElement("template");e.innerHTML=this.getHTML();return e}} +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */const isPrimitive=e=>null===e||!("object"===typeof e||"function"===typeof e),isIterable=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class AttributeCommitter{constructor(e,t,s){this.dirty=!0;this.element=e;this.name=t;this.strings=s;this.parts=[];for(let e=0;ethis.handleEvent(e))}setValue(e){this.__pendingValue=e}commit(){for(;isDirective(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=noChange;e(this)}if(this.__pendingValue===noChange)return;const e=this.__pendingValue,t=this.value,s=null==e||(null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive)),i=null!=e&&(null==t||s);if(s)this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options);if(i){this.__options=getOptions(e);this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)}this.value=e;this.__pendingValue=noChange}handleEvent(e){if("function"===typeof this.value)this.value.call(this.eventContext||this.element,e);else this.value.handleEvent(e)}}const getOptions=e=>e&&(eventOptionsSupported?{capture:e.capture,passive:e.passive,once:e.once}:e.capture); +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */class DefaultTemplateProcessor{handleAttributeExpressions(e,t,s,i){const r=t[0];if("."===r){return new PropertyCommitter(e,t.slice(1),s).parts}if("@"===r)return[new EventPart(e,t.slice(1),i.eventContext)];if("?"===r)return[new BooleanAttributePart(e,t.slice(1),s)];else return new AttributeCommitter(e,t,s).parts}handleTextExpression(e){return new NodePart(e)}}const defaultTemplateProcessor=new DefaultTemplateProcessor(); +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */function templateFactory(e){let t=templateCaches.get(e.type);if(void 0===t){t={stringsArray:new WeakMap(),keyString:new Map()};templateCaches.set(e.type,t)}let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const i=e.strings.join(marker);if(void 0===(s=t.keyString.get(i))){s=new Template(e,e.getTemplateElement());t.keyString.set(i,s)}t.stringsArray.set(e.strings,s);return s}const templateCaches=new Map(),parts=new WeakMap(),render=(e,t,s)=>{let i=parts.get(t);if(void 0===i){removeNodes(t,t.firstChild);parts.set(t,i=new NodePart(Object.assign({templateFactory:templateFactory},s)));i.appendInto(t)}i.setValue(e);i.commit()}; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.2");const html=(e,...t)=>new TemplateResult(e,t,"html",defaultTemplateProcessor),walkerNodeFilter=133; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */function removeNodesFromTemplate(e,t){const{element:{content:s},parts:i}=e,r=document.createTreeWalker(s,walkerNodeFilter,null,!1);let n=nextActiveIndexInTemplateParts(i),o=i[n],a=-1,l=0;const c=[];let h=null;for(;r.nextNode();){a++;const e=r.currentNode;if(e.previousSibling===h)h=null;if(t.has(e)){c.push(e);if(null===h)h=e}if(null!==h)l++;for(;void 0!==o&&o.index===a;){o.index=null!==h?-1:o.index-l;o=i[n=nextActiveIndexInTemplateParts(i,n)]}}c.forEach(e=>e.parentNode.removeChild(e))}const countNodes=e=>{let t=11===e.nodeType?0:1;const s=document.createTreeWalker(e,walkerNodeFilter,null,!1);for(;s.nextNode();)t++;return t},nextActiveIndexInTemplateParts=(e,t=-1)=>{for(let s=t+1;s0){for(;-1!==o;){r[o].index+=a;o=nextActiveIndexInTemplateParts(r,o)}return}o=nextActiveIndexInTemplateParts(r,o)}}} +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */const getTemplateCacheKey=(e,t)=>`${e}--${t}`;let compatibleShadyCSSVersion=!0;if("undefined"===typeof window.ShadyCSS)compatibleShadyCSSVersion=!1;else if("undefined"===typeof window.ShadyCSS.prepareTemplateDom){console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1.");compatibleShadyCSSVersion=!1}const shadyTemplateFactory=e=>t=>{const s=getTemplateCacheKey(t.type,e);let i=templateCaches.get(s);if(void 0===i){i={stringsArray:new WeakMap(),keyString:new Map()};templateCaches.set(s,i)}let r=i.stringsArray.get(t.strings);if(void 0!==r)return r;const n=t.strings.join(marker);if(void 0===(r=i.keyString.get(n))){const s=t.getTemplateElement();if(compatibleShadyCSSVersion)window.ShadyCSS.prepareTemplateDom(s,e);r=new Template(t,s);i.keyString.set(n,r)}i.stringsArray.set(t.strings,r);return r},TEMPLATE_TYPES=["html","svg"],removeStylesFromLitTemplates=e=>{TEMPLATE_TYPES.forEach(t=>{const s=templateCaches.get(getTemplateCacheKey(t,e));if(void 0!==s)s.keyString.forEach(e=>{const{element:{content:t}}=e,s=new Set();Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)});removeNodesFromTemplate(e,s)})})},shadyRenderSet=new Set(),prepareTemplateStyles=(e,t,s)=>{shadyRenderSet.add(e);const i=s?s.element:document.createElement("template"),r=t.querySelectorAll("style"),{length:n}=r;if(0===n){window.ShadyCSS.prepareTemplateStyles(i,e);return}const o=document.createElement("style");for(let e=0;e{if(!s||"object"!==typeof s||!s.scopeName)throw new Error("The `scopeName` option is required.");const i=s.scopeName,r=parts.has(t),n=compatibleShadyCSSVersion&&11===t.nodeType&&!!t.host,o=n&&!shadyRenderSet.has(i),a=o?document.createDocumentFragment():t;render(e,a,Object.assign({templateFactory:shadyTemplateFactory(i)},s));if(o){const e=parts.get(a);parts.delete(a);const s=e.value instanceof TemplateInstance?e.value.template:void 0;prepareTemplateStyles(i,a,s);removeNodes(t,t.firstChild);t.appendChild(a);parts.set(t,e)}if(!r&&n)window.ShadyCSS.styleElement(t.host)}; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +var _a;window.JSCompiler_renameProperty=((e,t)=>e);const defaultConverter={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e);default:return e}},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e);default:return e}}},notEqual=(e,t)=>t!==e&&(t===t||e===e),defaultPropertyDeclaration={attribute:!0,type:String,converter:defaultConverter,reflect:!1,hasChanged:notEqual},microtaskPromise=Promise.resolve(!0),STATE_HAS_UPDATED=1,STATE_UPDATE_REQUESTED=4,STATE_IS_REFLECTING_TO_ATTRIBUTE=8,STATE_IS_REFLECTING_TO_PROPERTY=16,STATE_HAS_CONNECTED=32,finalized="finalized";class UpdatingElement extends HTMLElement{constructor(){super();this._updateState=0;this._instanceProperties=void 0;this._updatePromise=microtaskPromise;this._hasConnectedResolver=void 0;this._changedProperties=new Map();this._reflectingProperties=void 0;this.initialize()}static get observedAttributes(){this.finalize();const e=[];this._classProperties.forEach((t,s)=>{const i=this._attributeNameForProperty(s,t);if(void 0!==i){this._attributeToPropertyMap.set(i,s);e.push(i)}});return e}static _ensureClassProperties(){if(!this.hasOwnProperty(window.JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map();const e=Object.getPrototypeOf(this)._classProperties;if(void 0!==e)e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=defaultPropertyDeclaration){this._ensureClassProperties();this._classProperties.set(e,t);if(t.noAccessor||this.prototype.hasOwnProperty(e))return;const s="symbol"===typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{get(){return this[s]},set(t){const i=this[e];this[s]=t;this._requestUpdate(e,i)},configurable:!0,enumerable:!0})}static finalize(){const e=Object.getPrototypeOf(this);if(!e.hasOwnProperty(finalized))e.finalize();this[finalized]=!0;this._ensureClassProperties();this._attributeToPropertyMap=new Map();if(this.hasOwnProperty(window.JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"===typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const s of t)this.createProperty(s,e[s])}}static _attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"===typeof s?s:"string"===typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,s=notEqual){return s(e,t)}static _propertyValueFromAttribute(e,t){const s=t.type,i=t.converter||defaultConverter,r="function"===typeof i?i:i.fromAttribute;return r?r(e,s):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const s=t.type,i=t.converter;return((i&&i.toAttribute)||defaultConverter.toAttribute)(e,s)}initialize(){this._saveInstanceProperties();this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t];if(!this._instanceProperties)this._instanceProperties=new Map();this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e);this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|STATE_HAS_CONNECTED;if(this._hasConnectedResolver){this._hasConnectedResolver();this._hasConnectedResolver=void 0}}disconnectedCallback(){}attributeChangedCallback(e,t,s){if(t!==s)this._attributeToProperty(e,s)}_propertyToAttribute(e,t,s=defaultPropertyDeclaration){const i=this.constructor,r=i._attributeNameForProperty(e,s);if(void 0!==r){const e=i._propertyValueToAttribute(t,s);if(void 0===e)return;this._updateState=this._updateState|STATE_IS_REFLECTING_TO_ATTRIBUTE;if(null==e)this.removeAttribute(r);else this.setAttribute(r,e);this._updateState=this._updateState&~STATE_IS_REFLECTING_TO_ATTRIBUTE}}_attributeToProperty(e,t){if(this._updateState&STATE_IS_REFLECTING_TO_ATTRIBUTE)return;const s=this.constructor,i=s._attributeToPropertyMap.get(e);if(void 0!==i){const e=s._classProperties.get(i)||defaultPropertyDeclaration;this._updateState=this._updateState|STATE_IS_REFLECTING_TO_PROPERTY;this[i]=s._propertyValueFromAttribute(t,e);this._updateState=this._updateState&~STATE_IS_REFLECTING_TO_PROPERTY}}_requestUpdate(e,t){let s=!0;if(void 0!==e){const i=this.constructor,r=i._classProperties.get(e)||defaultPropertyDeclaration;if(i._valueHasChanged(this[e],t,r.hasChanged)){if(!this._changedProperties.has(e))this._changedProperties.set(e,t);if(!0===r.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(void 0===this._reflectingProperties)this._reflectingProperties=new Map();this._reflectingProperties.set(e,r)}}else s=!1}if(!this._hasRequestedUpdate&&s)this._enqueueUpdate()}requestUpdate(e,t){this._requestUpdate(e,t);return this.updateComplete}async _enqueueUpdate(){this._updateState=this._updateState|STATE_UPDATE_REQUESTED;let e,t;const s=this._updatePromise;this._updatePromise=new Promise((s,i)=>{e=s;t=i});try{await s}catch(e){}if(!this._hasConnected)await new Promise(e=>this._hasConnectedResolver=e);try{const e=this.performUpdate();if(null!=e)await e}catch(e){t(e)}e(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&STATE_HAS_CONNECTED}get _hasRequestedUpdate(){return this._updateState&STATE_UPDATE_REQUESTED}get hasUpdated(){return this._updateState&STATE_HAS_UPDATED}performUpdate(){if(this._instanceProperties)this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{if((e=this.shouldUpdate(t)))this.update(t)}catch(t){e=!1;throw t}finally{this._markUpdated()}if(e){if(!(this._updateState&STATE_HAS_UPDATED)){this._updateState=this._updateState|STATE_HAS_UPDATED;this.firstUpdated(t)}this.updated(t)}}_markUpdated(){this._changedProperties=new Map();this._updateState=this._updateState&~STATE_UPDATE_REQUESTED}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){if(void 0!==this._reflectingProperties&&this._reflectingProperties.size>0){this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e));this._reflectingProperties=void 0}}updated(e){}firstUpdated(e){}}UpdatingElement[_a=finalized]=!0; +/** +@license +Copyright (c) 2019 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at +http://polymer.github.io/LICENSE.txt The complete set of authors may be found at +http://polymer.github.io/AUTHORS.txt The complete set of contributors may be +found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as +part of the polymer project is also subject to an additional IP rights grant +found at http://polymer.github.io/PATENTS.txt +*/const supportsAdoptingStyleSheets="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,constructionToken=Symbol();class CSSResult{constructor(e,t){if(t!==constructionToken)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){if(void 0===this._styleSheet)if(supportsAdoptingStyleSheets){this._styleSheet=new CSSStyleSheet();this._styleSheet.replaceSync(this.cssText)}else this._styleSheet=null;return this._styleSheet}toString(){return this.cssText}}const textFromCSSResult=e=>{if(e instanceof CSSResult)return e.cssText;else if("number"===typeof e)return e;else throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)},css=(e,...t)=>{const s=t.reduce((t,s,i)=>t+textFromCSSResult(s)+e[i+1],e[0]);return new CSSResult(s,constructionToken)}; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +(window.litElementVersions||(window.litElementVersions=[])).push("2.2.1");function arrayFlat(e,t=[]){for(let s=0,i=e.length;se.flat?e.flat(1/0):arrayFlat(e);class LitElement extends UpdatingElement{static finalize(){super.finalize.call(this);this._styles=this.hasOwnProperty(window.JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}static _getUniqueStyles(){const e=this.styles,t=[];if(Array.isArray(e)){flattenStyles(e).reduceRight((e,t)=>{e.add(t);return e},new Set()).forEach(e=>t.unshift(e))}else if(e)t.push(e);return t}initialize(){super.initialize();this.renderRoot=this.createRenderRoot();if(window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot)this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;if(0!==e.length)if(void 0!==window.ShadyCSS&&!window.ShadyCSS.nativeShadow)window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName);else if(supportsAdoptingStyleSheets)this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet);else this._needsShimAdoptedStyleSheets=!0}connectedCallback(){super.connectedCallback();if(this.hasUpdated&&void 0!==window.ShadyCSS)window.ShadyCSS.styleElement(this)}update(e){super.update(e);const t=this.render();if(t instanceof TemplateResult)this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this});if(this._needsShimAdoptedStyleSheets){this._needsShimAdoptedStyleSheets=!1;this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText;this.renderRoot.appendChild(t)})}}render(){}}LitElement.finalized=!0;LitElement.render=render$1;export{AttributePart as A,LitElement,LitElement as L,PropertyPart as P,TemplateResult,TemplateResult as T,defaultTemplateProcessor as a,css,css as c,directive as d,html,html as h}; \ No newline at end of file diff --git a/external/style-map.js b/external/style-map.js new file mode 100644 index 0000000..1111bd5 --- /dev/null +++ b/external/style-map.js @@ -0,0 +1,14 @@ +import{d as directive,A as AttributePart,P as PropertyPart}from"./lit-element.js"; +/** + * @license + * Copyright (c) 2018 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */const styleMapCache=new WeakMap(),styleMap=directive(t=>e=>{if(!(e instanceof AttributePart)||e instanceof PropertyPart||"style"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:s}=e,{style:r}=s.element;if(!styleMapCache.has(e))r.cssText=s.strings.join(" ");const i=styleMapCache.get(e);for(const e in i)if(!(e in t))if(-1===e.indexOf("-"))r[e]=null;else r.removeProperty(e);for(const e in t)if(-1===e.indexOf("-"))r[e]=t[e];else r.setProperty(e,t[e]);styleMapCache.set(e,t)});export{styleMap, styleMap as s,}; \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..9520747 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "integralui-web-label", + "version": "22.2.0", + "description": "IntegralUI Web - Label is a native Web Component that is fully customizable label with different alignments relative to attached element", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/lidorsystems/integralui-web-label.git" + }, + "keywords": [ + "component", + "integralui", + "label", + "ui", + "web", + "web-component", + "javascript", + "js", + "angular", + "react", + "reactjs", + "vue", + "vuejs" + ], + "author": "Lidor Systems", + "license": "SEE LICENSE in LICENSE.md", + "homepage": "https://www.lidorsystems.com/products/web/studio/", + "bugs": { + "url": "https://github.com/lidorsystems/integralui-web-label/issues" + } +} diff --git a/services/integralui.common.service.js b/services/integralui.common.service.js new file mode 100644 index 0000000..0f694c6 --- /dev/null +++ b/services/integralui.common.service.js @@ -0,0 +1,15 @@ +/* + filename: integralui.common.service.js + version : 22.2.0 + Copyright © 2016-2022 Lidor Systems. All rights reserved. + + This file is part of the "IntegralUI Web" Library. + + The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. + A copy of the License should have been installed in the product's root installation directory or it can be found at + http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. + + This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language + governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. +*/ +class IntegralUICommonService{calcMargin(t){if(t)return{top:getComputedStyle(t)["margin-top"]?parseInt(getComputedStyle(t)["margin-top"],10):getComputedStyle(t).marginTop?parseInt(getComputedStyle(t).marginTop,10):0,right:getComputedStyle(t)["margin-right"]?parseInt(getComputedStyle(t)["margin-right"],10):getComputedStyle(t).marginRight?parseInt(getComputedStyle(t).marginRight,10):0,bottom:getComputedStyle(t)["margin-bottom"]?parseInt(getComputedStyle(t)["margin-bottom"],10):getComputedStyle(t).marginBottom?parseInt(getComputedStyle(t).marginBottom,10):0,left:getComputedStyle(t)["margin-left"]?parseInt(getComputedStyle(t)["margin-left"],10):getComputedStyle(t).marginLeft?parseInt(getComputedStyle(t).marginLeft,10):0};else return{top:0,right:0,bottom:0,left:0}}checkHit(t,e,r){if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)return!0;else return!1}checkNumInRange(t,e,r){return t>e-r&&t1)r-=1;if(r<1/6)return t+6*(e-t)*r;if(r<.5)return e;if(r<2/3)return t+(e-t)*(2/3-r)*6;else return t}convertRgbaToHex(t){let e="#";this.convertRgbaToNum(t,!0).forEach(t=>{t=t.toString(16);e+=1===t.length?"0"+t:t});return e}convertRgbaToHsl(t){let e,r,o=this.convertRgbaToNum(t,!0),n=o[0]/255,i=o[1]/255,g=o[2]/255,l=Math.max(n,i,g),a=Math.min(n,i,g),u=(l+a)/2;if(l===a)e=r=0;else{let t=l-a;r=u>.5?t/(2-l-a):t/(l+a);switch(l){case n:e=(i-g)/t+(iparseInt(t));if(e)r=r.filter((t,e)=>e<3);r.forEach(t=>this.setNumInRange(t,0,255));return r}convertHexToRgba(t){let e=0,r=0,o=0;if(4===(t=t.replace(/[.*+?^${}()|[\]\\]/g,"")).length){e=Number("0x"+t[1]+t[1]);r=Number("0x"+t[2]+t[2]);o=Number("0x"+t[3]+t[3])}else if(7===t.length){e=Number("0x"+t[1]+t[2]);r=Number("0x"+t[3]+t[4]);o=Number("0x"+t[5]+t[6])}return"rgba("+parseInt(e,10).toString()+","+parseInt(r,10).toString()+","+parseInt(o,10).toString()+",1)"}convertHslToRgba(t){let e=(t=(t=t.replace(/[.*+?^${}()|[\]\\]/g,"")).replace(String.fromCharCode(176),"").replace("%","").replace("%","")).split(",").filter((t,e)=>e<3).map(t=>parseInt(t)),r=e[0],o=e[1]/100,n=e[2]/100,i=0,g=0,l=0;if(0===o)i=g=l=n;else{let t=n<.5?n*(1+o):n+o-n*o,e=2*n-t;i=this.colorToRgb(e,t,r+1/3);g=this.colorToRgb(e,t,r);l=this.colorToRgb(e,t,r-1/3)}return"rgba("+(i=Math.round(255*i))+", "+(g=Math.round(255*g))+", "+(l=Math.round(255*l))+", 1)"}convertValue(t,e){let r=null!==t&&void 0!==t?t:null;if(e){let o=e.locales||"en-US",n=e.options||{};if(this.isNumber(r))r=Intl.NumberFormat(o,n).format(r);else if(this.isDate(r))r=Intl.DateTimeFormat(o,n).format(r);else r=this.convertValueToString(t)}else r=this.convertValueToString(t);return r}convertValueToString(t){return null!==t&&void 0!==t?t.toString():""}_defaultFunc(){}getBodyElem(t){let e=null;for(;t;){if(null===t.offsetParent){e=t;break}t=t.offsetParent}return e}getBorderWidth(t){if(t)return{top:getComputedStyle(t)["border-top-width"]?parseInt(getComputedStyle(t)["border-top-width"],10):getComputedStyle(t).borderTopWidth?parseInt(getComputedStyle(t).borderTopWidth,10):0,right:getComputedStyle(t)["border-right-width"]?parseInt(getComputedStyle(t)["border-right-width"],10):getComputedStyle(t).borderRightWidth?parseInt(getComputedStyle(t).borderRightWidth,10):0,bottom:getComputedStyle(t)["border-bottom-width"]?parseInt(getComputedStyle(t)["border-bottom-width"],10):getComputedStyle(t).borderTopWidth?parseInt(getComputedStyle(t).borderTopWidth,10):0,left:getComputedStyle(t)["border-left-width"]?parseInt(getComputedStyle(t)["border-left-width"],10):getComputedStyle(t).borderLeftWidth?parseInt(getComputedStyle(t).borderLeftWidth,10):0};else return{top:0,right:0,bottom:0,left:0}}getClientPos(t,e){let r=this.getShiftPos(),o=this.getMousePos(t);o.x-=r.x;o.y-=r.y;let n=this.getPageRect(e);return{x:o.x-n.left,y:o.y-n.top}}getColorAtPosition(t,e,r){if(t){const o=t.getImageData(e,r,1,1).data;return"rgba("+o[0]+","+o[1]+","+o[2]+",1)"}return""}getMargin(t){return t?this.calcMargin(t):{top:0,right:0,bottom:0,left:0}}getMouseOffsetPos(t,e){let r=this.getShiftPos(),o=this.getMousePos(t);o.x-=r.x;o.y-=r.y;let n=this.getPageRect(e);return{x:o.x-n.left,y:o.y-n.top}}getMousePos(t){return{x:t.pageX?t.pageX:t.originalEvent?t.originalEvent.pageX:0,y:t.pageY?t.pageY:t.originalEvent?t.originalEvent.pageY:0}}getObjFromListById(t,e){let r=null;if(t)for(let o=0;o0?document.body.scrollLeft:document.documentElement.scrollLeft>0?document.documentElement.scrollLeft:0,y:document.body.scrollTop>0?document.body.scrollTop:document.documentElement.scrollTop>0?document.documentElement.scrollTop:0}}getTouchData(t){return t.changedTouches?t.changedTouches:t.originalEvent?t.originalEvent.changedTouches:null}getUniqueId(t){let e=t||"-";function r(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return r()+r()+e+r()+e+r()+e+r()+e+r()+r()+r()}isDate(t){return t&&"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t)}isTrue(t){return!1===t?!1:!0}isEmpty(t){return t&&0===Object.keys(t).length&&t.constructor===Object}isEqual(t,e){if(t&&e)return t.toString()===e.toString();else return!1}isFieldAvailable(t,e){return void 0!==t?t:e}isFunc(t){return t?"function"===typeof t||t instanceof Function:!1}isIndexInRange(t,e){return e?t>=0&&t