@trendyol/baklava 2.0.0-beta.42 → 2.0.0-beta.43
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/dist/baklava-react.d.ts +19 -15
- package/dist/baklava-react.d.ts.map +1 -1
- package/dist/baklava-react.js +1 -1
- package/dist/baklava-react.js.map +3 -3
- package/dist/baklava.d.ts +11 -9
- package/dist/baklava.d.ts.map +1 -1
- package/dist/baklava.js +1 -1
- package/dist/chunk-5VLVLBWY.js +2 -0
- package/dist/chunk-5VLVLBWY.js.map +7 -0
- package/dist/{chunk-SI4AOUS5.js → chunk-FFIDELPT.js} +3 -3
- package/dist/{chunk-SI4AOUS5.js.map → chunk-FFIDELPT.js.map} +0 -0
- package/dist/chunk-JDM44V27.js +20 -0
- package/dist/chunk-JDM44V27.js.map +7 -0
- package/dist/chunk-WFBCOT52.js +20 -0
- package/dist/chunk-WFBCOT52.js.map +7 -0
- package/dist/components/alert/bl-alert.js +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/radio-group/bl-radio-group.d.ts +50 -0
- package/dist/components/radio-group/bl-radio-group.d.ts.map +1 -0
- package/dist/components/radio-group/bl-radio-group.js +2 -0
- package/dist/components/radio-group/bl-radio-group.js.map +7 -0
- package/dist/components/radio-group/bl-radio-group.test.d.ts +2 -0
- package/dist/components/radio-group/bl-radio-group.test.d.ts.map +1 -0
- package/dist/components/radio-group/radio/bl-radio.d.ts +60 -0
- package/dist/components/radio-group/radio/bl-radio.d.ts.map +1 -0
- package/dist/components/radio-group/radio/bl-radio.js +2 -0
- package/dist/components/radio-group/radio/bl-radio.js.map +7 -0
- package/dist/components/radio-group/radio/bl-radio.test.d.ts +2 -0
- package/dist/components/radio-group/radio/bl-radio.test.d.ts.map +1 -0
- package/dist/custom-elements.json +231 -0
- package/package.json +2 -2
- package/dist/chunk-HF5CPTQT.js +0 -20
- package/dist/chunk-HF5CPTQT.js.map +0 -7
package/dist/baklava-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-NZ3RGSR6.js";import o from"react";var
|
|
1
|
+
import"./chunk-NZ3RGSR6.js";import o from"react";var h=new Set(["children","localName","ref","style","className"]),B=new WeakMap,f=(a,d,c,g,u)=>{let y=u==null?void 0:u[d];y!==void 0?c!==g&&((s,n,i)=>{let p=B.get(s);p===void 0&&B.set(s,p=new Map);let t=p.get(n);i!==void 0?t===void 0?(p.set(n,t={handleEvent:i}),s.addEventListener(n,t)):t.handleEvent=i:t!==void 0&&(p.delete(n),s.removeEventListener(n,t))})(a,y,c):a[d]=c},e=(a,d,c,g,u)=>{let y=a.Component,s=a.createElement,n=new Set(Object.keys(g!=null?g:{}));for(let t in c.prototype)t in HTMLElement.prototype||(h.has(t)?console.warn(`${d} contains property ${t} which is a React reserved property. It will be used by React and not set on the element.`):n.add(t));class i extends y{constructor(){super(...arguments),this.o=null}t(l){if(this.o!==null)for(let b in this.i)f(this.o,b,this.props[b],l?l[b]:void 0,g)}componentDidMount(){this.t()}componentDidUpdate(l){this.t(l)}render(){let l=this.props._$Gl;this.h!==void 0&&this.u===l||(this.h=r=>{this.o===null&&(this.o=r),l!==null&&((m,T)=>{typeof m=="function"?m(T):m.current=T})(l,r),this.u=l});let b={ref:this.h};this.i={};for(let[r,m]of Object.entries(this.props))r!=="__forwardedRef"&&(n.has(r)?this.i[r]=m:b[r==="className"?"class":r]=m);return s(d,b)}}i.displayName=u!=null?u:c.name;let p=a.forwardRef((t,l)=>s(i,{...t,_$Gl:l},t==null?void 0:t.children));return p.displayName=i.displayName,p};var I=e(o,"bl-alert",customElements.get("bl-alert"),{onClose:"bl-close"}),w=e(o,"bl-badge",customElements.get("bl-badge"),{}),R=e(o,"bl-button",customElements.get("bl-button"),{onClick:"bl-click"}),S=e(o,"bl-checkbox",customElements.get("bl-checkbox"),{onChange:"bl-checkbox-change"}),P=e(o,"bl-dialog",customElements.get("bl-dialog"),{onOpen:"bl-dialog-open",onClose:"bl-dialog-close"}),G=e(o,"bl-icon",customElements.get("bl-icon"),{onLoad:"bl-load",onError:"bl-error"}),O=e(o,"bl-input",customElements.get("bl-input"),{onChange:"bl-change",onInput:"bl-input",onInvalid:"bl-invalid"}),N=e(o,"bl-pagination",customElements.get("bl-pagination"),{onChange:"bl-change"}),D=e(o,"bl-progress-indicator",customElements.get("bl-progress-indicator"),{}),L=e(o,"undefined",customElements.get("undefined"),{}),M=e(o,"bl-select",customElements.get("bl-select"),{onSelect:"bl-select"}),_=e(o,"bl-tab-group",customElements.get("bl-tab-group"),{}),$=e(o,"bl-tooltip",customElements.get("bl-tooltip"),{onShow:"bl-tooltip-show",onHide:"bl-tooltip-hide"}),A=e(o,"undefined",customElements.get("undefined"),{}),j=e(o,"bl-select-option",customElements.get("bl-select-option"),{onOption:"bl-select-option"}),H=e(o,"bl-tab",customElements.get("bl-tab"),{onSelected:"bl-tab-selected"}),U=e(o,"bl-tab-panel",customElements.get("bl-tab-panel"),{});export{I as BlAlert,w as BlBadge,R as BlButton,S as BlCheckbox,P as BlDialog,G as BlIcon,O as BlInput,N as BlPagination,D as BlProgressIndicator,M as BlSelect,j as BlSelectOption,H as BlTab,_ as BlTabGroup,U as BlTabPanel,$ as BlTooltip,L as blRadioGroupTag,A as blRadioTag};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google LLC
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/baklava-react.ts", "../node_modules/@lit-labs/react/src/create-component.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-nocheck\n import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport type BlAlertType from \"./components/alert/bl-alert\";\nimport type BlBadgeType from \"./components/badge/bl-badge\";\nimport type BlButtonType from \"./components/button/bl-button\";\nimport type BlCheckboxType from \"./components/checkbox/bl-checkbox\";\nimport type BlDialogType from \"./components/dialog/bl-dialog\";\nimport type BlIconType from \"./components/icon/bl-icon\";\nimport type BlInputType from \"./components/input/bl-input\";\nimport type BlPaginationType from \"./components/pagination/bl-pagination\";\nimport type BlProgressIndicatorType from \"./components/progress-indicator/bl-progress-indicator\";\nimport type BlSelectType from \"./components/select/bl-select\";\nimport type BlTabGroupType from \"./components/tab-group/bl-tab-group\";\nimport type BlTooltipType from \"./components/tooltip/bl-tooltip\";\nimport type BlSelectOptionType from \"./components/select/option/bl-select-option\";\nimport type BlTabType from \"./components/tab-group/tab/bl-tab\";\nimport type BlTabPanelType from \"./components/tab-group/tab-panel/bl-tab-panel\";\n \n export const BlAlert = createComponent<BlAlertType>(\n React,\n 'bl-alert',\n customElements.get('bl-alert'),\n {\"onClose\":\"bl-close\"}\n );\n\n\n export const BlBadge = createComponent<BlBadgeType>(\n React,\n 'bl-badge',\n customElements.get('bl-badge'),\n {}\n );\n\n\n export const BlButton = createComponent<BlButtonType>(\n React,\n 'bl-button',\n customElements.get('bl-button'),\n {\"onClick\":\"bl-click\"}\n );\n\n\n export const BlCheckbox = createComponent<BlCheckboxType>(\n React,\n 'bl-checkbox',\n customElements.get('bl-checkbox'),\n {\"onChange\":\"bl-checkbox-change\"}\n );\n\n\n export const BlDialog = createComponent<BlDialogType>(\n React,\n 'bl-dialog',\n customElements.get('bl-dialog'),\n {\"onOpen\":\"bl-dialog-open\",\"onClose\":\"bl-dialog-close\"}\n );\n\n\n export const BlIcon = createComponent<BlIconType>(\n React,\n 'bl-icon',\n customElements.get('bl-icon'),\n {\"onLoad\":\"bl-load\",\"onError\":\"bl-error\"}\n );\n\n\n export const BlInput = createComponent<BlInputType>(\n React,\n 'bl-input',\n customElements.get('bl-input'),\n {\"onChange\":\"bl-change\",\"onInput\":\"bl-input\",\"onInvalid\":\"bl-invalid\"}\n );\n\n\n export const BlPagination = createComponent<BlPaginationType>(\n React,\n 'bl-pagination',\n customElements.get('bl-pagination'),\n {\"onChange\":\"bl-change\"}\n );\n\n\n export const BlProgressIndicator = createComponent<BlProgressIndicatorType>(\n React,\n 'bl-progress-indicator',\n customElements.get('bl-progress-indicator'),\n {}\n );\n\n\n export const BlSelect = createComponent<BlSelectType>(\n React,\n 'bl-select',\n customElements.get('bl-select'),\n {\"onSelect\":\"bl-select\"}\n );\n\n\n export const BlTabGroup = createComponent<BlTabGroupType>(\n React,\n 'bl-tab-group',\n customElements.get('bl-tab-group'),\n {}\n );\n\n\n export const BlTooltip = createComponent<BlTooltipType>(\n React,\n 'bl-tooltip',\n customElements.get('bl-tooltip'),\n {\"onShow\":\"bl-tooltip-show\",\"onHide\":\"bl-tooltip-hide\"}\n );\n\n\n export const BlSelectOption = createComponent<BlSelectOptionType>(\n React,\n 'bl-select-option',\n customElements.get('bl-select-option'),\n {\"onOption\":\"bl-select-option\"}\n );\n\n\n export const BlTab = createComponent<BlTabType>(\n React,\n 'bl-tab',\n customElements.get('bl-tab'),\n {\"onSelected\":\"bl-tab-selected\"}\n );\n\n\n export const BlTabPanel = createComponent<BlTabPanelType>(\n React,\n 'bl-tab-panel',\n customElements.get('bl-tab-panel'),\n {}\n );", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents: WeakMap<\n Element,\n Map<string, EventListenerObject>\n> = new WeakMap();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: Events\n) => {\n const event = events?.[name];\n if (event !== undefined) {\n // Dirty check event value.\n if (value !== old) {\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n }\n } else {\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n }\n};\n\n// Set a React ref. Note, there are 2 kinds of refs and there's no built in\n// React API to set a ref.\nconst setRef = (ref: React.Ref<unknown>, value: Element | null) => {\n if (typeof ref === 'function') {\n (ref as (e: Element | null) => void)(value);\n } else {\n (ref as {current: Element | null}).current = value;\n }\n};\n\ntype Constructor<T> = {new (): T};\n\n/***\n * Typecast that curries an Event type through a string. The goal of the type\n * cast is to match a prop name to a typed event callback.\n */\nexport type EventName<T extends Event = Event> = string & {\n __event_type: T;\n};\n\ntype Events = Record<string, EventName | string>;\n\ntype EventProps<R extends Events> = {\n [K in keyof R]: R[K] extends EventName\n ? (e: R[K]['__event_type']) => void\n : (e: Event) => void;\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param React The React module, typically imported from the `react` npm\n * package.\n * @param tagName The custom element tag name registered via\n * `customElements.define`.\n * @param elementClass The custom element class registered via\n * `customElements.define`.\n * @param events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport const createComponent = <I extends HTMLElement, E extends Events = {}>(\n React: typeof window.React,\n tagName: string,\n elementClass: Constructor<I>,\n events?: E,\n displayName?: string\n) => {\n const Component = React.Component;\n const createElement = React.createElement;\n\n // Props the user is allowed to use, includes standard attributes, children,\n // ref, as well as special event and element properties.\n type ReactProps = Omit<React.HTMLAttributes<I>, keyof E>;\n type ElementWithoutPropsOrEvents = Omit<I, keyof E | keyof ReactProps>;\n type UserProps = Partial<\n ReactProps & ElementWithoutPropsOrEvents & EventProps<E>\n >;\n\n // Props used by this component wrapper. This is the UserProps and the\n // special `__forwardedRef` property. Note, this ref is special because\n // it's both needed in this component to get access to the rendered element\n // and must fulfill any ref passed by the user.\n type ComponentProps = UserProps & {\n __forwardedRef?: React.Ref<unknown>;\n };\n\n // Set of properties/events which should be specially handled by the wrapper\n // and not handled directly by React.\n const elementClassProps = new Set(Object.keys(events ?? {}));\n for (const p in elementClass.prototype) {\n if (!(p in HTMLElement.prototype)) {\n if (reservedReactProperties.has(p)) {\n // Note, this effectively warns only for `ref` since the other\n // reserved props are on HTMLElement.prototype. To address this\n // would require crawling down the prototype, which doesn't feel worth\n // it since implementing these properties on an element is extremely\n // rare.\n console.warn(\n `${tagName} contains property ${p} which is a React ` +\n `reserved property. It will be used by React and not set on ` +\n `the element.`\n );\n } else {\n elementClassProps.add(p);\n }\n }\n }\n\n class ReactComponent extends Component<ComponentProps> {\n private _element: I | null = null;\n private _elementProps!: {[index: string]: unknown};\n private _userRef?: React.Ref<unknown>;\n private _ref?: React.RefCallback<I>;\n\n static displayName = displayName ?? elementClass.name;\n\n private _updateElement(oldProps?: ComponentProps) {\n if (this._element === null) {\n return;\n }\n // Set element properties to the values in `this.props`\n for (const prop in this._elementProps) {\n setProperty(\n this._element,\n prop,\n this.props[prop as keyof ComponentProps],\n oldProps ? oldProps[prop as keyof ComponentProps] : undefined,\n events\n );\n }\n // Note, the spirit of React might be to \"unset\" any old values that\n // are no longer included; however, there's no reasonable value to set\n // them to so we just leave the previous state as is.\n }\n\n /**\n * Updates element properties correctly setting properties\n * on mount.\n */\n override componentDidMount() {\n this._updateElement();\n }\n\n /**\n * Updates element properties correctly setting properties\n * on every update. Note, this does not include mount.\n */\n override componentDidUpdate(old: ComponentProps) {\n this._updateElement(old);\n }\n\n /**\n * Renders the custom element with a `ref` prop which allows this\n * component to reference the custom element.\n *\n * Standard attributes are passed to React and element properties and events\n * are updated in componentDidMount/componentDidUpdate.\n *\n */\n override render() {\n // Since refs only get fulfilled once, pass a new one if the user's\n // ref changed. This allows refs to be fulfilled as expected, going from\n // having a value to null.\n const userRef = this.props.__forwardedRef as React.Ref<unknown>;\n if (this._ref === undefined || this._userRef !== userRef) {\n this._ref = (value: I | null) => {\n if (this._element === null) {\n this._element = value;\n }\n if (userRef !== null) {\n setRef(userRef, value);\n }\n this._userRef = userRef;\n };\n }\n // Filters class properties out and passes the remaining\n // attributes to React. This allows attributes to use framework rules\n // for setting attributes and render correctly under SSR.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {ref: this._ref};\n // Note, save element props while iterating to avoid the need to\n // iterate again when setting properties.\n this._elementProps = {};\n for (const [k, v] of Object.entries(this.props)) {\n if (k === '__forwardedRef') continue;\n\n if (elementClassProps.has(k)) {\n this._elementProps[k] = v;\n } else {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n props[k === 'className' ? 'class' : k] = v;\n }\n }\n return createElement(tagName, props);\n }\n }\n\n const ForwardedComponent = React.forwardRef(\n (props?: UserProps, ref?: React.Ref<unknown>) =>\n createElement(\n ReactComponent,\n {...props, __forwardedRef: ref} as ComponentProps,\n props?.children\n )\n );\n\n // To ease debugging in the React Developer Tools\n ForwardedComponent.displayName = ReactComponent.displayName;\n\n return ForwardedComponent;\n};\n"],
|
|
5
|
-
"mappings": "4BAEI,OAAOA,MAAW,QCItB,IAAMC,EAA0B,IAAIC,IAAI,CACtC,WACA,YACA,MACA,QACA,WAAA,C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KM,MAAMF,GACXD,EAAWA,EAASC,GAAAA,OACpBlC,CAAAA,CAML,CAMQqC,mBAAAA,CACPP,KAAKE,EAAAA,CACN,CAMQM,mBAAmBvC,EAAAA,CAC1B+B,KAAKE,EAAejC,CAAAA,CACrB,CAUQwC,QAAAA,CAIP,IAAMC,EAAUV,KAAKM,MAAMK,KACvBX,KAAKY,IADkBD,QACIX,KAAKa,IAAaH,IAC/CV,KAAKY,EAAQ5C,GAAAA,CACPgC,KAAKC,IAAa,OACpBD,KAAKC,EAAWjC,GAEd0C,IAAY,OA5JX,CAACI,EAAyB9C,IAAAA,CACpB,OAAR8C,GAAQ,WAChBA,EAAoC9C,CAAAA,EAEpC8C,EAAkCC,QAAU/C,CAC9C,GAwJgB0C,EAAS1C,CAAAA,EAElBgC,KAAKa,EAAWH,CAAO,GAO3B,IAAMJ,EAAa,CAACQ,IAAKd,KAAKY,CAAAA,EAG9BZ,KAAKK,EAAgB,CAAA,EACrB,OAAK,CAAOW,EAAGC,CAAAA,IAAM5B,OAAO6B,QAAQlB,KAAKM,KAAAA,EACnCU,IAAM,mBAEN5B,EAAkBM,IAAIsB,CAAAA,EACxBhB,KAAKK,EAAcW,GAAKC,EAIxBX,EAAMU,IAAM,YAAc,QAAUA,GAAKC,GAG7C,OAAO9B,EAAcJ,EAASuB,CAAAA,CAC/B,CAAA,CAjFMR,EAAWb,YAAGA,GAAAA,KAAAA,EAAeD,EAAajB,KAoFnD,IAAMoD,EAAqBrC,EAAMsC,WAC/B,CAACd,EAAmBQ,IAClB3B,EACEW,EACA,CAAA,GAAIQ,EAAOK,KAAgBG,CAAAA,EAC3BR,GAAAA,KAAAA,OAAAA,EAAOe,QAAAA,CAAAA,EAOb,OAFAF,EAAmBlC,YAAca,EAAeb,YAEzCkC,CAAkB,
|
|
6
|
-
"names": ["React", "reservedReactProperties", "Set", "listenedEvents", "WeakMap", "setProperty", "node", "name", "value", "old", "events", "event", "listener", "get", "set", "Map", "handler", "handleEvent", "addEventListener", "delete", "removeEventListener", "createComponent", "React", "tagName", "elementClass", "displayName", "Component", "createElement", "elementClassProps", "Object", "keys", "p", "prototype", "HTMLElement", "has", "console", "warn", "add", "ReactComponent", "constructor", "this", "_element", "_updateElement", "oldProps", "prop", "_elementProps", "props", "componentDidMount", "componentDidUpdate", "render", "userRef", "__forwardedRef", "_ref", "_userRef", "ref", "current", "k", "v", "entries", "ForwardedComponent", "forwardRef", "children", "BlAlert", "s", "React", "BlBadge", "BlButton", "BlCheckbox", "BlDialog", "BlIcon", "BlInput", "BlPagination", "BlProgressIndicator", "BlSelect", "BlTabGroup", "BlTooltip", "BlSelectOption", "BlTab", "BlTabPanel"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-nocheck\n import React from 'react';\nimport { createComponent } from '@lit-labs/react';\nimport type BlAlertType from \"./components/alert/bl-alert\";\nimport type BlBadgeType from \"./components/badge/bl-badge\";\nimport type BlButtonType from \"./components/button/bl-button\";\nimport type BlCheckboxType from \"./components/checkbox/bl-checkbox\";\nimport type BlDialogType from \"./components/dialog/bl-dialog\";\nimport type BlIconType from \"./components/icon/bl-icon\";\nimport type BlInputType from \"./components/input/bl-input\";\nimport type BlPaginationType from \"./components/pagination/bl-pagination\";\nimport type BlProgressIndicatorType from \"./components/progress-indicator/bl-progress-indicator\";\nimport type blRadioGroupTagType from \"./components/radio-group/bl-radio-group\";\nimport type BlSelectType from \"./components/select/bl-select\";\nimport type BlTabGroupType from \"./components/tab-group/bl-tab-group\";\nimport type BlTooltipType from \"./components/tooltip/bl-tooltip\";\nimport type blRadioTagType from \"./components/radio-group/radio/bl-radio\";\nimport type BlSelectOptionType from \"./components/select/option/bl-select-option\";\nimport type BlTabType from \"./components/tab-group/tab/bl-tab\";\nimport type BlTabPanelType from \"./components/tab-group/tab-panel/bl-tab-panel\";\n \n export const BlAlert = createComponent<BlAlertType>(\n React,\n 'bl-alert',\n customElements.get('bl-alert'),\n {\"onClose\":\"bl-close\"}\n );\n\n\n export const BlBadge = createComponent<BlBadgeType>(\n React,\n 'bl-badge',\n customElements.get('bl-badge'),\n {}\n );\n\n\n export const BlButton = createComponent<BlButtonType>(\n React,\n 'bl-button',\n customElements.get('bl-button'),\n {\"onClick\":\"bl-click\"}\n );\n\n\n export const BlCheckbox = createComponent<BlCheckboxType>(\n React,\n 'bl-checkbox',\n customElements.get('bl-checkbox'),\n {\"onChange\":\"bl-checkbox-change\"}\n );\n\n\n export const BlDialog = createComponent<BlDialogType>(\n React,\n 'bl-dialog',\n customElements.get('bl-dialog'),\n {\"onOpen\":\"bl-dialog-open\",\"onClose\":\"bl-dialog-close\"}\n );\n\n\n export const BlIcon = createComponent<BlIconType>(\n React,\n 'bl-icon',\n customElements.get('bl-icon'),\n {\"onLoad\":\"bl-load\",\"onError\":\"bl-error\"}\n );\n\n\n export const BlInput = createComponent<BlInputType>(\n React,\n 'bl-input',\n customElements.get('bl-input'),\n {\"onChange\":\"bl-change\",\"onInput\":\"bl-input\",\"onInvalid\":\"bl-invalid\"}\n );\n\n\n export const BlPagination = createComponent<BlPaginationType>(\n React,\n 'bl-pagination',\n customElements.get('bl-pagination'),\n {\"onChange\":\"bl-change\"}\n );\n\n\n export const BlProgressIndicator = createComponent<BlProgressIndicatorType>(\n React,\n 'bl-progress-indicator',\n customElements.get('bl-progress-indicator'),\n {}\n );\n\n\n export const blRadioGroupTag = createComponent<blRadioGroupTagType>(\n React,\n 'undefined',\n customElements.get('undefined'),\n {}\n );\n\n\n export const BlSelect = createComponent<BlSelectType>(\n React,\n 'bl-select',\n customElements.get('bl-select'),\n {\"onSelect\":\"bl-select\"}\n );\n\n\n export const BlTabGroup = createComponent<BlTabGroupType>(\n React,\n 'bl-tab-group',\n customElements.get('bl-tab-group'),\n {}\n );\n\n\n export const BlTooltip = createComponent<BlTooltipType>(\n React,\n 'bl-tooltip',\n customElements.get('bl-tooltip'),\n {\"onShow\":\"bl-tooltip-show\",\"onHide\":\"bl-tooltip-hide\"}\n );\n\n\n export const blRadioTag = createComponent<blRadioTagType>(\n React,\n 'undefined',\n customElements.get('undefined'),\n {}\n );\n\n\n export const BlSelectOption = createComponent<BlSelectOptionType>(\n React,\n 'bl-select-option',\n customElements.get('bl-select-option'),\n {\"onOption\":\"bl-select-option\"}\n );\n\n\n export const BlTab = createComponent<BlTabType>(\n React,\n 'bl-tab',\n customElements.get('bl-tab'),\n {\"onSelected\":\"bl-tab-selected\"}\n );\n\n\n export const BlTabPanel = createComponent<BlTabPanelType>(\n React,\n 'bl-tab-panel',\n customElements.get('bl-tab-panel'),\n {}\n );", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents: WeakMap<\n Element,\n Map<string, EventListenerObject>\n> = new WeakMap();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: Events\n) => {\n const event = events?.[name];\n if (event !== undefined) {\n // Dirty check event value.\n if (value !== old) {\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n }\n } else {\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n }\n};\n\n// Set a React ref. Note, there are 2 kinds of refs and there's no built in\n// React API to set a ref.\nconst setRef = (ref: React.Ref<unknown>, value: Element | null) => {\n if (typeof ref === 'function') {\n (ref as (e: Element | null) => void)(value);\n } else {\n (ref as {current: Element | null}).current = value;\n }\n};\n\ntype Constructor<T> = {new (): T};\n\n/***\n * Typecast that curries an Event type through a string. The goal of the type\n * cast is to match a prop name to a typed event callback.\n */\nexport type EventName<T extends Event = Event> = string & {\n __event_type: T;\n};\n\ntype Events = Record<string, EventName | string>;\n\ntype EventProps<R extends Events> = {\n [K in keyof R]: R[K] extends EventName\n ? (e: R[K]['__event_type']) => void\n : (e: Event) => void;\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param React The React module, typically imported from the `react` npm\n * package.\n * @param tagName The custom element tag name registered via\n * `customElements.define`.\n * @param elementClass The custom element class registered via\n * `customElements.define`.\n * @param events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport const createComponent = <I extends HTMLElement, E extends Events = {}>(\n React: typeof window.React,\n tagName: string,\n elementClass: Constructor<I>,\n events?: E,\n displayName?: string\n) => {\n const Component = React.Component;\n const createElement = React.createElement;\n\n // Props the user is allowed to use, includes standard attributes, children,\n // ref, as well as special event and element properties.\n type ReactProps = Omit<React.HTMLAttributes<I>, keyof E>;\n type ElementWithoutPropsOrEvents = Omit<I, keyof E | keyof ReactProps>;\n type UserProps = Partial<\n ReactProps & ElementWithoutPropsOrEvents & EventProps<E>\n >;\n\n // Props used by this component wrapper. This is the UserProps and the\n // special `__forwardedRef` property. Note, this ref is special because\n // it's both needed in this component to get access to the rendered element\n // and must fulfill any ref passed by the user.\n type ComponentProps = UserProps & {\n __forwardedRef?: React.Ref<unknown>;\n };\n\n // Set of properties/events which should be specially handled by the wrapper\n // and not handled directly by React.\n const elementClassProps = new Set(Object.keys(events ?? {}));\n for (const p in elementClass.prototype) {\n if (!(p in HTMLElement.prototype)) {\n if (reservedReactProperties.has(p)) {\n // Note, this effectively warns only for `ref` since the other\n // reserved props are on HTMLElement.prototype. To address this\n // would require crawling down the prototype, which doesn't feel worth\n // it since implementing these properties on an element is extremely\n // rare.\n console.warn(\n `${tagName} contains property ${p} which is a React ` +\n `reserved property. It will be used by React and not set on ` +\n `the element.`\n );\n } else {\n elementClassProps.add(p);\n }\n }\n }\n\n class ReactComponent extends Component<ComponentProps> {\n private _element: I | null = null;\n private _elementProps!: {[index: string]: unknown};\n private _userRef?: React.Ref<unknown>;\n private _ref?: React.RefCallback<I>;\n\n static displayName = displayName ?? elementClass.name;\n\n private _updateElement(oldProps?: ComponentProps) {\n if (this._element === null) {\n return;\n }\n // Set element properties to the values in `this.props`\n for (const prop in this._elementProps) {\n setProperty(\n this._element,\n prop,\n this.props[prop as keyof ComponentProps],\n oldProps ? oldProps[prop as keyof ComponentProps] : undefined,\n events\n );\n }\n // Note, the spirit of React might be to \"unset\" any old values that\n // are no longer included; however, there's no reasonable value to set\n // them to so we just leave the previous state as is.\n }\n\n /**\n * Updates element properties correctly setting properties\n * on mount.\n */\n override componentDidMount() {\n this._updateElement();\n }\n\n /**\n * Updates element properties correctly setting properties\n * on every update. Note, this does not include mount.\n */\n override componentDidUpdate(old: ComponentProps) {\n this._updateElement(old);\n }\n\n /**\n * Renders the custom element with a `ref` prop which allows this\n * component to reference the custom element.\n *\n * Standard attributes are passed to React and element properties and events\n * are updated in componentDidMount/componentDidUpdate.\n *\n */\n override render() {\n // Since refs only get fulfilled once, pass a new one if the user's\n // ref changed. This allows refs to be fulfilled as expected, going from\n // having a value to null.\n const userRef = this.props.__forwardedRef as React.Ref<unknown>;\n if (this._ref === undefined || this._userRef !== userRef) {\n this._ref = (value: I | null) => {\n if (this._element === null) {\n this._element = value;\n }\n if (userRef !== null) {\n setRef(userRef, value);\n }\n this._userRef = userRef;\n };\n }\n // Filters class properties out and passes the remaining\n // attributes to React. This allows attributes to use framework rules\n // for setting attributes and render correctly under SSR.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {ref: this._ref};\n // Note, save element props while iterating to avoid the need to\n // iterate again when setting properties.\n this._elementProps = {};\n for (const [k, v] of Object.entries(this.props)) {\n if (k === '__forwardedRef') continue;\n\n if (elementClassProps.has(k)) {\n this._elementProps[k] = v;\n } else {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n props[k === 'className' ? 'class' : k] = v;\n }\n }\n return createElement(tagName, props);\n }\n }\n\n const ForwardedComponent = React.forwardRef(\n (props?: UserProps, ref?: React.Ref<unknown>) =>\n createElement(\n ReactComponent,\n {...props, __forwardedRef: ref} as ComponentProps,\n props?.children\n )\n );\n\n // To ease debugging in the React Developer Tools\n ForwardedComponent.displayName = ReactComponent.displayName;\n\n return ForwardedComponent;\n};\n"],
|
|
5
|
+
"mappings": "4BAEI,OAAOA,MAAW,QCItB,IAAMC,EAA0B,IAAIC,IAAI,CACtC,WACA,YACA,MACA,QACA,WAAA,CAAA,EAGIC,EAGF,IAAIC,QAsCFC,EAAc,CAClBC,EACAC,EACAC,EACAC,EACAC,IAAAA,CAEA,IAAMC,EAAQD,GAAAA,KAAAA,OAAAA,EAASH,GACnBI,IADmBJ,OAGjBC,IAAUC,IAxCe,CAC/BH,EACAK,EACAC,IAAAA,CAEA,IAAIF,EAASP,EAAeU,IAAIP,CAAAA,EAC5BI,IAD4BJ,QAE9BH,EAAeW,IAAIR,EAAOI,EAAS,IAAIK,GAAAA,EAEzC,IAAIC,EAAUN,EAAOG,IAAIF,CAAAA,EACrBC,IADqBD,OAGnB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AAU,UAAU,CAC1C,EAGWM,EAAUP,EACnBC,EACA,WACA,eAAe,IAAI,UAAU,EAC7B,CAAC,SAAW,YAAY,QAAU,WAAW,UAAY,YAAY,CACvE,EAGWO,EAAeR,EACxBC,EACA,gBACA,eAAe,IAAI,eAAe,EAClC,CAAC,SAAW,WAAW,CACzB,EAGWQ,EAAsBT,EAC/BC,EACA,wBACA,eAAe,IAAI,uBAAuB,EAC1C,CAAC,CACH,EAGWS,EAAkBV,EAC3BC,EACA,YACA,eAAe,IAAI,WAAW,EAC9B,CAAC,CACH,EAGWU,EAAWX,EACpBC,EACA,YACA,eAAe,IAAI,WAAW,EAC9B,CAAC,SAAW,WAAW,CACzB,EAGWW,EAAaZ,EACtBC,EACA,eACA,eAAe,IAAI,cAAc,EACjC,CAAC,CACH,EAGWY,EAAYb,EACrBC,EACA,aACA,eAAe,IAAI,YAAY,EAC/B,CAAC,OAAS,kBAAkB,OAAS,iBAAiB,CACxD,EAGWa,EAAad,EACtBC,EACA,YACA,eAAe,IAAI,WAAW,EAC9B,CAAC,CACH,EAGWc,EAAiBf,EAC1BC,EACA,mBACA,eAAe,IAAI,kBAAkB,EACrC,CAAC,SAAW,kBAAkB,CAChC,EAGWe,EAAQhB,EACjBC,EACA,SACA,eAAe,IAAI,QAAQ,EAC3B,CAAC,WAAa,iBAAiB,CACjC,EAGWgB,EAAajB,EACtBC,EACA,eACA,eAAe,IAAI,cAAc,EACjC,CAAC,CACH",
|
|
6
|
+
"names": ["React", "reservedReactProperties", "Set", "listenedEvents", "WeakMap", "setProperty", "node", "name", "value", "old", "events", "event", "listener", "get", "set", "Map", "handler", "handleEvent", "addEventListener", "delete", "removeEventListener", "createComponent", "React", "tagName", "elementClass", "displayName", "Component", "createElement", "elementClassProps", "Object", "keys", "p", "prototype", "HTMLElement", "has", "console", "warn", "add", "ReactComponent", "constructor", "this", "_element", "_updateElement", "oldProps", "prop", "_elementProps", "props", "componentDidMount", "componentDidUpdate", "render", "userRef", "__forwardedRef", "_ref", "_userRef", "ref", "current", "k", "v", "entries", "ForwardedComponent", "forwardRef", "children", "BlAlert", "s", "React", "BlBadge", "BlButton", "BlCheckbox", "BlDialog", "BlIcon", "BlInput", "BlPagination", "BlProgressIndicator", "blRadioGroupTag", "BlSelect", "BlTabGroup", "BlTooltip", "blRadioTag", "BlSelectOption", "BlTab", "BlTabPanel"]
|
|
7
7
|
}
|
package/dist/baklava.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as BlButton } from './components/button/bl-button';
|
|
1
|
+
export { default as BlAlert } from './components/alert/bl-alert';
|
|
3
2
|
export { default as BlBadge } from './components/badge/bl-badge';
|
|
3
|
+
export { default as BlButton } from './components/button/bl-button';
|
|
4
|
+
export { default as BlCheckbox } from './components/checkbox/bl-checkbox';
|
|
5
|
+
export { default as BlDialog } from './components/dialog/bl-dialog';
|
|
6
|
+
export { default as BlIcon } from './components/icon/bl-icon';
|
|
4
7
|
export { default as BlInput } from './components/input/bl-input';
|
|
8
|
+
export { default as BlPagination } from './components/pagination/bl-pagination';
|
|
9
|
+
export { default as BlProgressIndicator } from './components/progress-indicator/bl-progress-indicator';
|
|
10
|
+
export { default as BlRadioGroup } from './components/radio-group/bl-radio-group';
|
|
11
|
+
export { default as BlRadio } from './components/radio-group/radio/bl-radio';
|
|
12
|
+
export { default as BlSelect } from './components/select/bl-select';
|
|
13
|
+
export { default as BlSelectOption } from './components/select/option/bl-select-option';
|
|
5
14
|
export { default as BlTab } from './components/tab-group/tab/bl-tab';
|
|
6
15
|
export { default as BlTabGroup } from './components/tab-group/bl-tab-group';
|
|
7
16
|
export { default as BlTabPanel } from './components/tab-group/tab-panel/bl-tab-panel';
|
|
8
17
|
export { default as BlTooltip } from './components/tooltip/bl-tooltip';
|
|
9
|
-
export { default as BlProgressIndicator } from './components/progress-indicator/bl-progress-indicator';
|
|
10
|
-
export { default as BlCheckbox } from './components/checkbox/bl-checkbox';
|
|
11
|
-
export { default as BlAlert } from './components/alert/bl-alert';
|
|
12
|
-
export { default as BlSelect } from './components/select/bl-select';
|
|
13
|
-
export { default as BlSelectOption } from './components/select/option/bl-select-option';
|
|
14
|
-
export { default as BlPagination } from './components/pagination/bl-pagination';
|
|
15
|
-
export { default as BlDialog } from './components/dialog/bl-dialog';
|
|
16
18
|
export { getIconPath, setIconPath } from './utilities/asset-paths';
|
|
17
19
|
//# sourceMappingURL=baklava.d.ts.map
|
package/dist/baklava.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baklava.d.ts","sourceRoot":"","sources":["../src/baklava.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"baklava.d.ts","sourceRoot":"","sources":["../src/baklava.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AACvG,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as x}from"./chunk-3ZCWE6JC.js";import{a as d}from"./chunk-JDM44V27.js";import{a as B}from"./chunk-A25HQAVJ.js";import{c as m,f as n}from"./chunk-WFBCOT52.js";import"./chunk-5VLVLBWY.js";import{a as s}from"./chunk-GBFJ2WUI.js";import{a as u}from"./chunk-KWTSWXUL.js";import{a as g}from"./chunk-C5HFLPOK.js";import{a as i}from"./chunk-EX6STMCI.js";import{a as c}from"./chunk-IDG5M2QP.js";import{a as I}from"./chunk-7FCUFV6V.js";import"./chunk-VNGNBBSS.js";import{a as e}from"./chunk-FFIDELPT.js";import{a as r}from"./chunk-54XXQVFL.js";import{a as f}from"./chunk-KXWO7VUG.js";import"./chunk-KQBKSEYJ.js";import{a as p}from"./chunk-N5Q3PK3Z.js";import{a as l}from"./chunk-HUFJDENF.js";import"./chunk-2TVOKUHE.js";import"./chunk-ENFFFE4I.js";import{a as o,b as t,c as a}from"./chunk-WXJKPVRA.js";import"./chunk-72IJCTLJ.js";import"./chunk-23UFIOHV.js";import"./chunk-HG7OBTQS.js";import"./chunk-NZ3RGSR6.js";export{e as BlAlert,r as BlBadge,l as BlButton,f as BlCheckbox,p as BlDialog,a as BlIcon,d as BlInput,x as BlPagination,B as BlProgressIndicator,m as BlRadio,n as BlRadioGroup,s as BlSelect,u as BlSelectOption,i as BlTab,g as BlTabGroup,c as BlTabPanel,I as BlTooltip,t as getIconPath,o as setIconPath};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var l=function(d,o,m,n){if(m==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?d!==o||!n:!o.has(d))throw new TypeError("Cannot read private member from an object whose class did not declare it");return m==="m"?n:m==="a"?n.call(d):n?n.value:o.get(d)},M=function(d,o,m,n,y){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!y)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?d!==o||!y:!o.has(d))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?y.call(d,m):y?y.value=m:o.set(d,m),m};function it(d){var o,m,n,y,k,I,F,S,V,W,R,T,L,O,C,P,$,D;class H extends d{constructor(...s){super(...s),o.add(this),this.internals=this.attachInternals(),m.set(this,!1),n.set(this,!1),y.set(this,!1),k.set(this,void 0),I.set(this,void 0),S.set(this,""),V.set(this,()=>{M(this,y,!0,"f"),M(this,m,!0,"f"),l(this,o,"m",C).call(this)}),W.set(this,()=>{M(this,m,!1,"f"),l(this,o,"m",P).call(this,this.shouldFormValueUpdate()?l(this,S,"f"):""),!this.validity.valid&&l(this,y,"f")&&M(this,n,!0,"f");let r=l(this,o,"m",C).call(this);this.validationMessageCallback&&this.validationMessageCallback(r?this.internals.validationMessage:"")}),R.set(this,()=>{var r;M(this,n,!0,"f"),l(this,o,"m",C).call(this),(r=this===null||this===void 0?void 0:this.validationMessageCallback)===null||r===void 0||r.call(this,this.showError?this.internals.validationMessage:"")}),T.set(this,void 0),L.set(this,!1),O.set(this,Promise.resolve()),this.addEventListener("focus",l(this,V,"f")),this.addEventListener("blur",l(this,W,"f")),this.addEventListener("invalid",l(this,R,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let s=this.validators.map(g=>g.attribute),r=super.observedAttributes||[];return[...new Set([...r,...s])]}static getValidator(s){return this.validators.find(r=>r.attribute===s)||null}get form(){return this.internals.form}get showError(){return l(this,o,"m",C).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(s,r,v){var g;(g=super.attributeChangedCallback)===null||g===void 0||g.call(this,s,r,v),this.constructor.getValidator(s)&&this.validationTarget&&this.setValue(l(this,S,"f"))}setValue(s){var r;M(this,n,!1,"f"),(r=this.validationMessageCallback)===null||r===void 0||r.call(this,""),M(this,S,s,"f");let g=this.shouldFormValueUpdate()?s:null;this.internals.setFormValue(g),l(this,o,"m",P).call(this,g),this.valueChangedCallback&&this.valueChangedCallback(g),l(this,o,"m",C).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(s=>s(l(this,O,"f")))}formResetCallback(){var s,r;M(this,y,!1,"f"),M(this,n,!1,"f"),l(this,o,"m",C).call(this),(s=this.resetFormControl)===null||s===void 0||s.call(this),(r=this.validationMessageCallback)===null||r===void 0||r.call(this,l(this,o,"m",C).call(this)?this.validationMessage:"")}}return m=new WeakMap,n=new WeakMap,y=new WeakMap,k=new WeakMap,I=new WeakMap,S=new WeakMap,V=new WeakMap,W=new WeakMap,R=new WeakMap,T=new WeakMap,L=new WeakMap,O=new WeakMap,o=new WeakSet,F=function(){let s=this.getRootNode(),r=`${this.localName}[name="${this.getAttribute("name")}"]`;return s.querySelectorAll(r)},C=function(){if(this.hasAttribute("disabled"))return!1;let s=l(this,n,"f")||l(this,y,"f")&&!this.validity.valid&&!l(this,m,"f");return s&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),s},P=function(s){let r=this.constructor,v={},g=r.validators,_=[];l(this,L,"f")||(M(this,O,new Promise(E=>{M(this,T,E,"f")}),"f"),M(this,L,!0,"f")),l(this,k,"f")&&(l(this,k,"f").abort(),M(this,I,l(this,k,"f"),"f"));let b=new AbortController;M(this,k,b,"f");let N,U=!1;!g.length||(g.forEach(E=>{let z=E.key||"customError",A=E.isValid(this,s,b.signal);A instanceof Promise?(_.push(A),A.then(q=>{q!=null&&(v[z]=!q,N=l(this,o,"m",D).call(this,E,s),l(this,o,"m",$).call(this,v,N))})):(v[z]=!A,this.validity[z]!==!A&&(U=!0),A||(N=l(this,o,"m",D).call(this,E,s)))}),Promise.allSettled(_).then(()=>{var E;b!=null&&b.signal.aborted||(M(this,L,!1,"f"),(E=l(this,T,"f"))===null||E===void 0||E.call(this))}),U&&l(this,o,"m",$).call(this,v,N))},$=function(s,r){if(this.validationTarget)this.internals.setValidity(s,r,this.validationTarget);else{if(this.internals.setValidity(s,r),this.internals.validity.valid)return;let v=0,g=setInterval(()=>{v>=100||this.validity.valid?clearInterval(g):this.validationTarget&&(this.internals.setValidity(this.validity,r,this.validationTarget),clearInterval(g)),v+=1},0)}},D=function(s,r){if(this.validityCallback){let v=this.validityCallback(s.key||"customError");if(v)return v}return s.message instanceof Function?s.message(this,r):s.message},H}(function(){"use strict";let d=new WeakMap,o=new WeakMap,m=new WeakMap,n=new WeakMap,y=new WeakMap,k=new WeakMap,I=new WeakMap,F=new WeakMap,S=new WeakMap,V=new WeakMap,W=new WeakMap,R=new WeakMap,T=new WeakMap,L={attributes:!0,attributeFilter:["disabled"]},O=new MutationObserver(e=>{for(let t of e){let a=t.target;if(a.constructor.formAssociated){let i=a.hasAttribute("disabled");a.toggleAttribute("internals-disabled",i),i?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled"),a.formDisabledCallback&&a.formDisabledCallback.apply(a,[i])}}}),C=e=>{m.get(e).forEach(a=>{a.remove()}),m.set(e,[])},P=(e,t)=>{let a=document.createElement("input");return a.type="hidden",a.name=e.getAttribute("name"),e.after(a),m.get(t).push(a),a},$=(e,t)=>{m.set(t,[]);let a=e.hasAttribute("disabled");e.toggleAttribute("internals-disabled",a),O.observe(e,L)},D=(e,t)=>{if(t.length){Array.from(t).forEach(i=>i.addEventListener("click",e.focus.bind(e)));let a=t[0].id;t[0].id||(a=`${t[0].htmlFor}_Label`,t[0].id=a),e.setAttribute("aria-labelledby",a)}},H=e=>{let t=Array.from(e.elements).filter(c=>c.validity).map(c=>c.validity.valid),a=F.get(e)||[],i=Array.from(a).filter(c=>c.isConnected).map(c=>n.get(c).validity.valid),h=[...t,...i].includes(!1);e.toggleAttribute("internals-invalid",h),e.toggleAttribute("internals-valid",!h)},x=e=>{H(_(e.target))},s=e=>{H(_(e.target))},r=e=>{let t=":is(:is(button, input)[type=submit], button:not([type])):not([disabled])",a=`${t}:not([form])`;e.id&&(a+=`,${t}[form='${e.id}']`),e.addEventListener("click",i=>{if(i.target.closest(a)){let c=F.get(e);if(e.noValidate)return;c.size&&Array.from(c).reverse().map(f=>n.get(f).reportValidity()).includes(!1)&&i.preventDefault()}})},v=e=>{let t=F.get(e.target);t&&t.size&&t.forEach(a=>{a.constructor.formAssociated&&a.formResetCallback&&a.formResetCallback.apply(a)})},g=(e,t,a)=>{if(t){let i=F.get(t);if(i)i.add(e);else{let h=new Set;h.add(e),F.set(t,h),r(t),t.addEventListener("reset",v),t.addEventListener("input",x),t.addEventListener("change",s)}k.set(t,{ref:e,internals:a}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),H(t)}},_=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=_(t)),t},b=(e,t,a=DOMException)=>{if(!e.constructor.formAssociated)throw new a(t)},N=(e,t,a)=>{let i=F.get(e);return i&&i.size&&i.forEach(h=>{n.get(h)[a]()||(t=!1)}),t},U=e=>{if(e.constructor.formAssociated){let t=n.get(e),{labels:a,form:i}=t;D(e,a),g(e,i,t)}},E={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},z=(e,t)=>{for(let a in E){t[a]=null;let i=null,h=E[a];Object.defineProperty(t,a,{get(){return i},set(c){i=c,e.isConnected?e.setAttribute(h,c):V.set(e,t)}})}};class A{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}let Q=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),q=(e,t,a)=>(e.valid=j(t),Object.keys(t).forEach(i=>e[i]=t[i]),a&&H(a),e),j=e=>{let t=!0;for(let a in e)a!=="valid"&&e[a]!==!1&&(t=!1);return t};function X(e){let t=n.get(e),{form:a}=t;g(e,a,t),D(e,t.labels)}function G(e){e.forEach(t=>{let{addedNodes:a,removedNodes:i}=t,h=Array.from(a),c=Array.from(i);h.forEach(u=>{if(n.has(u)&&u.constructor.formAssociated&&X(u),V.has(u)){let p=V.get(u);Object.keys(E).filter(w=>p[w]!==null).forEach(w=>{u.setAttribute(E[w],p[w])}),V.delete(u)}if(u.localName==="form"){let p=F.get(u),f=document.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,{acceptNode(Z){return n.has(Z)&&!p&&!p.has(Z)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),w=f.nextNode();for(;w;)X(w),w=f.nextNode()}}),c.forEach(u=>{let p=n.get(u);p&&m.get(p)&&C(p),I.has(u)&&I.get(u).disconnect()})})}function tt(e){e.forEach(t=>{let{removedNodes:a}=t;a.forEach(i=>{let h=T.get(t.target);n.has(i)&&U(i),h.disconnect()})})}let et=e=>{let t=new MutationObserver(tt);t.observe(e,{childList:!0}),T.set(e,t)};new MutationObserver(G);let K={childList:!0,subtree:!0},J=new WeakMap;class B extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");J.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);let a=super.add(t),i=J.get(this);return i.toggleAttribute(`state${t}`,!0),i.part&&i.part.add(`state${t}`),a}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){let a=super.delete(t),i=J.get(this);return i.toggleAttribute(`state${t}`,!1),i.part&&i.part.remove(`state${t}`),a}}class Y{constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");let a=t.getRootNode(),i=new A;this.states=new B(t),d.set(this,t),o.set(this,i),n.set(t,this),z(t,this),$(t,this),Object.seal(this),U(t),a instanceof DocumentFragment&&et(a)}static get isPolyfilled(){return!0}checkValidity(){let t=d.get(this);if(b(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=o.get(this);if(!a.valid){let i=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(i)}return a.valid}get form(){let t=d.get(this);b(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let a;return t.constructor.formAssociated===!0&&(a=_(t)),a}get labels(){let t=d.get(this);b(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");let a=t.getAttribute("id"),i=t.getRootNode();return i&&a?i.querySelectorAll(`[for="${a}"]`):[]}reportValidity(){let t=d.get(this);if(b(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=this.checkValidity(),i=R.get(this);if(i&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!a&&i&&(t.focus(),i.focus()),a}setFormValue(t){let a=d.get(this);if(b(a,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),C(this),t!=null&&!(t instanceof FormData)){if(a.getAttribute("name")){let i=P(a,this);i.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([i,h])=>{if(typeof h=="string"){let c=P(a,this);c.name=i,c.value=h}});S.set(a,t)}setValidity(t,a,i){let h=d.get(this);if(b(h,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");R.set(this,i);let c=o.get(this),u={};for(let w in t)u[w]=t[w];Object.keys(u).length===0&&Q(c);let p={...c,...u};delete p.valid;let{valid:f}=q(c,p,this.form);if(!f&&!a)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");y.set(this,f?"":a),h.toggleAttribute("internals-invalid",!f),h.toggleAttribute("internals-valid",f),h.setAttribute("aria-invalid",`${!f}`)}get shadowRoot(){let t=d.get(this),a=W.get(t);return a||null}get validationMessage(){let t=d.get(this);return b(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),y.get(this)}get validity(){let t=d.get(this);return b(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),o.get(this)}get willValidate(){let t=d.get(this);return b(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function at(){if(!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);let a=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(i=>i in a.internals)}if(at()){if(!window.CustomStateSet){window.CustomStateSet=B;let e=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(...t){let a=e.call(this,t);return a.states=new B(this),a}}}else{let e=function(...p){let f=i.apply(this,p),w=new MutationObserver(G);return W.set(this,f),window.ShadyDOM?w.observe(this,K):w.observe(f,K),I.set(this,w),f},t=function(...p){let f=c.apply(this,p);return N(this,f,"checkValidity")},a=function(...p){let f=u.apply(this,p);return N(this,f,"reportValidity")};window.ElementInternals=Y,HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new Y(this)};let i=Element.prototype.attachShadow;Element.prototype.attachShadow=e,new MutationObserver(G).observe(document.documentElement,K);let c=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=t;let u=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=a,window.CustomStateSet||(window.CustomStateSet=B)}})();export{it as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5VLVLBWY.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@open-wc/form-control/src/FormControlMixin.ts", "../node_modules/element-internals-polyfill/dist/index.js"],
|
|
4
|
+
"sourcesContent": [null, "(function () {\n 'use strict';\n\n const refMap = new WeakMap();\n const validityMap = new WeakMap();\n const hiddenInputMap = new WeakMap();\n const internalsMap = new WeakMap();\n const validationMessageMap = new WeakMap();\n const formsMap = new WeakMap();\n const shadowHostsMap = new WeakMap();\n const formElementsMap = new WeakMap();\n const refValueMap = new WeakMap();\n const upgradeMap = new WeakMap();\n const shadowRootMap = new WeakMap();\n const validationAnchorMap = new WeakMap();\n const documentFragmentMap = new WeakMap();\n\n const observerConfig$1 = { attributes: true, attributeFilter: ['disabled'] };\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n const target = mutation.target;\n if (target.constructor['formAssociated']) {\n const isDisabled = target.hasAttribute('disabled');\n target.toggleAttribute('internals-disabled', isDisabled);\n if (isDisabled) {\n target.setAttribute('aria-disabled', 'true');\n }\n else {\n target.removeAttribute('aria-disabled');\n }\n if (target.formDisabledCallback) {\n target.formDisabledCallback.apply(target, [isDisabled]);\n }\n }\n }\n });\n const removeHiddenInputs = (internals) => {\n const hiddenInputs = hiddenInputMap.get(internals);\n hiddenInputs.forEach(hiddenInput => {\n hiddenInput.remove();\n });\n hiddenInputMap.set(internals, []);\n };\n const createHiddenInput = (ref, internals) => {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = ref.getAttribute('name');\n ref.after(input);\n hiddenInputMap.get(internals).push(input);\n return input;\n };\n const initRef = (ref, internals) => {\n hiddenInputMap.set(internals, []);\n const isDisabled = ref.hasAttribute('disabled');\n ref.toggleAttribute('internals-disabled', isDisabled);\n observer.observe(ref, observerConfig$1);\n };\n const initLabels = (ref, labels) => {\n if (labels.length) {\n Array.from(labels).forEach(label => label.addEventListener('click', ref.focus.bind(ref)));\n let firstLabelId = labels[0].id;\n if (!labels[0].id) {\n firstLabelId = `${labels[0].htmlFor}_Label`;\n labels[0].id = firstLabelId;\n }\n ref.setAttribute('aria-labelledby', firstLabelId);\n }\n };\n const setFormValidity = (form) => {\n const nativeControlValidity = Array.from(form.elements)\n .filter((element) => element.validity)\n .map((element) => element.validity.valid);\n const polyfilledElements = formElementsMap.get(form) || [];\n const polyfilledValidity = Array.from(polyfilledElements)\n .filter(control => control.isConnected)\n .map((control) => internalsMap.get(control).validity.valid);\n const hasInvalid = [...nativeControlValidity, ...polyfilledValidity].includes(false);\n form.toggleAttribute('internals-invalid', hasInvalid);\n form.toggleAttribute('internals-valid', !hasInvalid);\n };\n const formInputCallback = (event) => {\n setFormValidity(findParentForm(event.target));\n };\n const formChangeCallback = (event) => {\n setFormValidity(findParentForm(event.target));\n };\n const wireSubmitLogic = (form) => {\n const SUBMIT_BUTTON_SELECTOR = ':is(:is(button, input)[type=submit], button:not([type])):not([disabled])';\n let submitButtonSelector = `${SUBMIT_BUTTON_SELECTOR}:not([form])`;\n if (form.id) {\n submitButtonSelector += `,${SUBMIT_BUTTON_SELECTOR}[form='${form.id}']`;\n }\n form.addEventListener('click', event => {\n const target = event.target;\n if (target.closest(submitButtonSelector)) {\n const elements = formElementsMap.get(form);\n if (form.noValidate) {\n return;\n }\n if (elements.size) {\n const nodes = Array.from(elements);\n const validityList = nodes\n .reverse()\n .map(node => {\n const internals = internalsMap.get(node);\n return internals.reportValidity();\n });\n if (validityList.includes(false)) {\n event.preventDefault();\n }\n }\n }\n });\n };\n const formResetCallback = (event) => {\n const elements = formElementsMap.get(event.target);\n if (elements && elements.size) {\n elements.forEach(element => {\n if (element.constructor.formAssociated && element.formResetCallback) {\n element.formResetCallback.apply(element);\n }\n });\n }\n };\n const initForm = (ref, form, internals) => {\n if (form) {\n const formElements = formElementsMap.get(form);\n if (formElements) {\n formElements.add(ref);\n }\n else {\n const initSet = new Set();\n initSet.add(ref);\n formElementsMap.set(form, initSet);\n wireSubmitLogic(form);\n form.addEventListener('reset', formResetCallback);\n form.addEventListener('input', formInputCallback);\n form.addEventListener('change', formChangeCallback);\n }\n formsMap.set(form, { ref, internals });\n if (ref.constructor['formAssociated'] && ref.formAssociatedCallback) {\n setTimeout(() => {\n ref.formAssociatedCallback.apply(ref, [form]);\n }, 0);\n }\n setFormValidity(form);\n }\n };\n const findParentForm = (elem) => {\n let parent = elem.parentNode;\n if (parent && parent.tagName !== 'FORM') {\n parent = findParentForm(parent);\n }\n return parent;\n };\n const throwIfNotFormAssociated = (ref, message, ErrorType = DOMException) => {\n if (!ref.constructor['formAssociated']) {\n throw new ErrorType(message);\n }\n };\n const overrideFormMethod = (form, returnValue, method) => {\n const elements = formElementsMap.get(form);\n if (elements && elements.size) {\n elements.forEach(element => {\n const internals = internalsMap.get(element);\n const valid = internals[method]();\n if (!valid) {\n returnValue = false;\n }\n });\n }\n return returnValue;\n };\n const upgradeInternals = (ref) => {\n if (ref.constructor['formAssociated']) {\n const internals = internalsMap.get(ref);\n const { labels, form } = internals;\n initLabels(ref, labels);\n initForm(ref, form, internals);\n }\n };\n\n const aom = {\n ariaAtomic: 'aria-atomic',\n ariaAutoComplete: 'aria-autocomplete',\n ariaBusy: 'aria-busy',\n ariaChecked: 'aria-checked',\n ariaColCount: 'aria-colcount',\n ariaColIndex: 'aria-colindex',\n ariaColSpan: 'aria-colspan',\n ariaCurrent: 'aria-current',\n ariaDisabled: 'aria-disabled',\n ariaExpanded: 'aria-expanded',\n ariaHasPopup: 'aria-haspopup',\n ariaHidden: 'aria-hidden',\n ariaKeyShortcuts: 'aria-keyshortcuts',\n ariaLabel: 'aria-label',\n ariaLevel: 'aria-level',\n ariaLive: 'aria-live',\n ariaModal: 'aria-modal',\n ariaMultiLine: 'aria-multiline',\n ariaMultiSelectable: 'aria-multiselectable',\n ariaOrientation: 'aria-orientation',\n ariaPlaceholder: 'aria-placeholder',\n ariaPosInSet: 'aria-posinset',\n ariaPressed: 'aria-pressed',\n ariaReadOnly: 'aria-readonly',\n ariaRelevant: 'aria-relevant',\n ariaRequired: 'aria-required',\n ariaRoleDescription: 'aria-roledescription',\n ariaRowCount: 'aria-rowcount',\n ariaRowIndex: 'aria-rowindex',\n ariaRowSpan: 'aria-rowspan',\n ariaSelected: 'aria-selected',\n ariaSetSize: 'aria-setsize',\n ariaSort: 'aria-sort',\n ariaValueMax: 'aria-valuemax',\n ariaValueMin: 'aria-valuemin',\n ariaValueNow: 'aria-valuenow',\n ariaValueText: 'aria-valuetext',\n role: 'role'\n };\n const initAom = (ref, internals) => {\n for (let key in aom) {\n internals[key] = null;\n let closureValue = null;\n const attributeName = aom[key];\n Object.defineProperty(internals, key, {\n get() {\n return closureValue;\n },\n set(value) {\n closureValue = value;\n if (ref.isConnected) {\n ref.setAttribute(attributeName, value);\n }\n else {\n upgradeMap.set(ref, internals);\n }\n }\n });\n }\n };\n\n class ValidityState {\n constructor() {\n this.badInput = false;\n this.customError = false;\n this.patternMismatch = false;\n this.rangeOverflow = false;\n this.rangeUnderflow = false;\n this.stepMismatch = false;\n this.tooLong = false;\n this.tooShort = false;\n this.typeMismatch = false;\n this.valid = true;\n this.valueMissing = false;\n Object.seal(this);\n }\n }\n const setValid = (validityObject) => {\n validityObject.badInput = false;\n validityObject.customError = false;\n validityObject.patternMismatch = false;\n validityObject.rangeOverflow = false;\n validityObject.rangeUnderflow = false;\n validityObject.stepMismatch = false;\n validityObject.tooLong = false;\n validityObject.tooShort = false;\n validityObject.typeMismatch = false;\n validityObject.valid = true;\n validityObject.valueMissing = false;\n return validityObject;\n };\n const reconcileValidity = (validityObject, newState, form) => {\n validityObject.valid = isValid(newState);\n Object.keys(newState).forEach(key => validityObject[key] = newState[key]);\n if (form) {\n setFormValidity(form);\n }\n return validityObject;\n };\n const isValid = (validityState) => {\n let valid = true;\n for (let key in validityState) {\n if (key !== 'valid' && validityState[key] !== false) {\n valid = false;\n }\n }\n return valid;\n };\n\n function initNode(node) {\n const internals = internalsMap.get(node);\n const { form } = internals;\n initForm(node, form, internals);\n initLabels(node, internals.labels);\n }\n function observerCallback(mutationList) {\n mutationList.forEach(mutationRecord => {\n const { addedNodes, removedNodes } = mutationRecord;\n const added = Array.from(addedNodes);\n const removed = Array.from(removedNodes);\n added.forEach(node => {\n if (internalsMap.has(node) && node.constructor['formAssociated']) {\n initNode(node);\n }\n if (upgradeMap.has(node)) {\n const internals = upgradeMap.get(node);\n const aomKeys = Object.keys(aom);\n aomKeys\n .filter(key => internals[key] !== null)\n .forEach(key => {\n node.setAttribute(aom[key], internals[key]);\n });\n upgradeMap.delete(node);\n }\n if (node.localName === 'form') {\n const formElements = formElementsMap.get(node);\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n return internalsMap.has(node) && !formElements && !formElements.has(node) ?\n NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n let current = walker.nextNode();\n while (current) {\n initNode(current);\n current = walker.nextNode();\n }\n }\n });\n removed.forEach(node => {\n const internals = internalsMap.get(node);\n if (internals && hiddenInputMap.get(internals)) {\n removeHiddenInputs(internals);\n }\n if (shadowHostsMap.has(node)) {\n const observer = shadowHostsMap.get(node);\n observer.disconnect();\n }\n });\n });\n }\n function fragmentObserverCallback(mutationList) {\n mutationList.forEach(mutation => {\n const { removedNodes } = mutation;\n removedNodes.forEach(node => {\n const observer = documentFragmentMap.get(mutation.target);\n if (internalsMap.has(node)) {\n upgradeInternals(node);\n }\n observer.disconnect();\n });\n });\n }\n const deferUpgrade = (fragment) => {\n const observer = new MutationObserver(fragmentObserverCallback);\n observer.observe(fragment, { childList: true });\n documentFragmentMap.set(fragment, observer);\n };\n new MutationObserver(observerCallback);\n const observerConfig = {\n childList: true,\n subtree: true\n };\n\n const customStateMap = new WeakMap();\n class CustomStateSet extends Set {\n static get isPolyfilled() {\n return true;\n }\n constructor(ref) {\n super();\n if (!ref || !ref.tagName || ref.tagName.indexOf('-') === -1) {\n throw new TypeError('Illegal constructor');\n }\n customStateMap.set(this, ref);\n }\n add(state) {\n if (!/^--/.test(state) || typeof state !== 'string') {\n throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${state} must start with '--'.`);\n }\n const result = super.add(state);\n const ref = customStateMap.get(this);\n ref.toggleAttribute(`state${state}`, true);\n if (ref.part) {\n ref.part.add(`state${state}`);\n }\n return result;\n }\n clear() {\n for (let [entry] of this.entries()) {\n this.delete(entry);\n }\n super.clear();\n }\n delete(state) {\n const result = super.delete(state);\n const ref = customStateMap.get(this);\n ref.toggleAttribute(`state${state}`, false);\n if (ref.part) {\n ref.part.remove(`state${state}`);\n }\n return result;\n }\n }\n\n class ElementInternals {\n constructor(ref) {\n if (!ref || !ref.tagName || ref.tagName.indexOf('-') === -1) {\n throw new TypeError('Illegal constructor');\n }\n const rootNode = ref.getRootNode();\n const validity = new ValidityState();\n this.states = new CustomStateSet(ref);\n refMap.set(this, ref);\n validityMap.set(this, validity);\n internalsMap.set(ref, this);\n initAom(ref, this);\n initRef(ref, this);\n Object.seal(this);\n upgradeInternals(ref);\n if (rootNode instanceof DocumentFragment) {\n deferUpgrade(rootNode);\n }\n }\n static get isPolyfilled() {\n return true;\n }\n checkValidity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!this.willValidate) {\n return true;\n }\n const validity = validityMap.get(this);\n if (!validity.valid) {\n const validityEvent = new Event('invalid', {\n bubbles: false,\n cancelable: true,\n composed: false\n });\n ref.dispatchEvent(validityEvent);\n }\n return validity.valid;\n }\n get form() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n let form;\n if (ref.constructor['formAssociated'] === true) {\n form = findParentForm(ref);\n }\n return form;\n }\n get labels() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n const id = ref.getAttribute('id');\n const hostRoot = ref.getRootNode();\n if (hostRoot && id) {\n return hostRoot.querySelectorAll(`[for=\"${id}\"]`);\n }\n return [];\n }\n reportValidity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!this.willValidate) {\n return true;\n }\n const valid = this.checkValidity();\n const anchor = validationAnchorMap.get(this);\n if (anchor && !ref.constructor['formAssociated']) {\n throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n }\n if (!valid && anchor) {\n ref.focus();\n anchor.focus();\n }\n return valid;\n }\n setFormValue(value) {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`);\n removeHiddenInputs(this);\n if (value != null && !(value instanceof FormData)) {\n if (ref.getAttribute('name')) {\n const hiddenInput = createHiddenInput(ref, this);\n hiddenInput.value = value;\n }\n }\n else if (value != null && value instanceof FormData) {\n Array.from(value).reverse().forEach(([formDataKey, formDataValue]) => {\n if (typeof formDataValue === 'string') {\n const hiddenInput = createHiddenInput(ref, this);\n hiddenInput.name = formDataKey;\n hiddenInput.value = formDataValue;\n }\n });\n }\n refValueMap.set(ref, value);\n }\n setValidity(validityChanges, validationMessage, anchor) {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!validityChanges) {\n throw new TypeError('Failed to execute \\'setValidity\\' on \\'ElementInternals\\': 1 argument required, but only 0 present.');\n }\n validationAnchorMap.set(this, anchor);\n const validity = validityMap.get(this);\n const validityChangesObj = {};\n for (const key in validityChanges) {\n validityChangesObj[key] = validityChanges[key];\n }\n if (Object.keys(validityChangesObj).length === 0) {\n setValid(validity);\n }\n const check = { ...validity, ...validityChangesObj };\n delete check.valid;\n const { valid } = reconcileValidity(validity, check, this.form);\n if (!valid && !validationMessage) {\n throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);\n }\n validationMessageMap.set(this, valid ? '' : validationMessage);\n ref.toggleAttribute('internals-invalid', !valid);\n ref.toggleAttribute('internals-valid', valid);\n ref.setAttribute('aria-invalid', `${!valid}`);\n }\n get shadowRoot() {\n const ref = refMap.get(this);\n const shadowRoot = shadowRootMap.get(ref);\n if (shadowRoot) {\n return shadowRoot;\n }\n return null;\n }\n get validationMessage() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n return validationMessageMap.get(this);\n }\n get validity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n const validity = validityMap.get(this);\n return validity;\n }\n get willValidate() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n if ((ref.disabled || ref.hasAttribute('disabled')) ||\n ref.hasAttribute('readonly')) {\n return false;\n }\n return true;\n }\n }\n function isElementInternalsSupported() {\n if (!window.ElementInternals || !HTMLElement.prototype.attachInternals) {\n return false;\n }\n class ElementInternalsFeatureDetection extends HTMLElement {\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n }\n const randomName = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, '')}`;\n customElements.define(randomName, ElementInternalsFeatureDetection);\n const featureDetectionElement = new ElementInternalsFeatureDetection();\n return [\n 'shadowRoot',\n 'form',\n 'willValidate',\n 'validity',\n 'validationMessage',\n 'labels',\n 'setFormValue',\n 'setValidity',\n 'checkValidity',\n 'reportValidity'\n ].every(prop => prop in featureDetectionElement.internals);\n }\n if (!isElementInternalsSupported()) {\n window.ElementInternals = ElementInternals;\n function attachShadowObserver(...args) {\n const shadowRoot = attachShadow.apply(this, args);\n const observer = new MutationObserver(observerCallback);\n shadowRootMap.set(this, shadowRoot);\n if (window.ShadyDOM) {\n observer.observe(this, observerConfig);\n }\n else {\n observer.observe(shadowRoot, observerConfig);\n }\n shadowHostsMap.set(this, observer);\n return shadowRoot;\n }\n function checkValidityOverride(...args) {\n let returnValue = checkValidity.apply(this, args);\n return overrideFormMethod(this, returnValue, 'checkValidity');\n }\n function reportValidityOverride(...args) {\n let returnValue = reportValidity.apply(this, args);\n return overrideFormMethod(this, returnValue, 'reportValidity');\n }\n HTMLElement.prototype.attachInternals = function () {\n if (!this.tagName) {\n return {};\n }\n else if (this.tagName.indexOf('-') === -1) {\n throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);\n }\n if (internalsMap.has(this)) {\n throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);\n }\n return new ElementInternals(this);\n };\n const attachShadow = Element.prototype.attachShadow;\n Element.prototype.attachShadow = attachShadowObserver;\n const documentObserver = new MutationObserver(observerCallback);\n documentObserver.observe(document.documentElement, observerConfig);\n const checkValidity = HTMLFormElement.prototype.checkValidity;\n HTMLFormElement.prototype.checkValidity = checkValidityOverride;\n const reportValidity = HTMLFormElement.prototype.reportValidity;\n HTMLFormElement.prototype.reportValidity = reportValidityOverride;\n if (!window.CustomStateSet) {\n window.CustomStateSet = CustomStateSet;\n }\n }\n else if (!window.CustomStateSet) {\n window.CustomStateSet = CustomStateSet;\n const attachInternals = HTMLElement.prototype.attachInternals;\n HTMLElement.prototype.attachInternals = function (...args) {\n const internals = attachInternals.call(this, args);\n internals.states = new CustomStateSet(this);\n return internals;\n };\n }\n\n}());\n"],
|
|
5
|
+
"mappings": "0pBAEM,SAAUA,GAEdC,EAAiB,yCACjB,MAAMC,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,CAAc,EACjE,IAAM8B,EAAgB,gBAAgB,UAAU,cAChD,gBAAgB,UAAU,cAAgBD,EAC1C,IAAMG,EAAiB,gBAAgB,UAAU,eACjD,gBAAgB,UAAU,eAAiBD,EACtC,OAAO,iBACR,OAAO,eAAiB7B,EAEhC,CAWJ,GAAE",
|
|
6
|
+
"names": ["FormControlMixin", "SuperClass", "FormControl", "args", "_FormControl_focused", "_FormControl_forceError", "_FormControl_touched", "_FormControl_abortController", "_FormControl_previousAbortController", "_FormControl_value", "_FormControl_onFocus", "__classPrivateFieldSet", "__classPrivateFieldGet", "_FormControl_instances", "_FormControl_shouldShowError", "_FormControl_onBlur", "_FormControl_runValidators", "showError", "_FormControl_onInvalid", "_a", "_FormControl_validationCompleteResolver", "_FormControl_isValidationPending", "_FormControl_validationComplete", "validatorAttributes", "validator", "observedAttributes", "attribute", "name", "oldValue", "newValue", "value", "valueToUpdate", "resolve", "_b", "rootNode", "selector", "proto", "validity", "validators", "asyncValidators", "abortController", "validationMessage", "hasChange", "key", "isValid", "isValidatorValid", "_FormControl_getValidatorMessageForValue", "_FormControl_setValidityWithOptionalTarget", "tick", "id", "message", "refMap", "validityMap", "hiddenInputMap", "internalsMap", "validationMessageMap", "formsMap", "shadowHostsMap", "formElementsMap", "refValueMap", "upgradeMap", "shadowRootMap", "validationAnchorMap", "documentFragmentMap", "observerConfig$1", "observer", "mutationsList", "mutation", "target", "isDisabled", "removeHiddenInputs", "internals", "hiddenInput", "createHiddenInput", "ref", "input", "initRef", "initLabels", "labels", "label", "firstLabelId", "setFormValidity", "form", "nativeControlValidity", "element", "polyfilledElements", "polyfilledValidity", "control", "hasInvalid", "formInputCallback", "event", "findParentForm", "formChangeCallback", "wireSubmitLogic", "SUBMIT_BUTTON_SELECTOR", "submitButtonSelector", "elements", "node", "formResetCallback", "initForm", "formElements", "initSet", "elem", "parent", "throwIfNotFormAssociated", "message", "ErrorType", "overrideFormMethod", "returnValue", "method", "upgradeInternals", "aom", "initAom", "key", "closureValue", "attributeName", "value", "ValidityState", "setValid", "validityObject", "reconcileValidity", "newState", "isValid", "validityState", "valid", "initNode", "observerCallback", "mutationList", "mutationRecord", "addedNodes", "removedNodes", "added", "removed", "walker", "current", "fragmentObserverCallback", "deferUpgrade", "fragment", "observerConfig", "customStateMap", "CustomStateSet", "state", "result", "entry", "ElementInternals", "rootNode", "validity", "validityEvent", "id", "hostRoot", "anchor", "formDataKey", "formDataValue", "validityChanges", "validationMessage", "validityChangesObj", "check", "shadowRoot", "isElementInternalsSupported", "ElementInternalsFeatureDetection", "randomName", "featureDetectionElement", "prop", "attachInternals", "args", "attachShadowObserver", "attachShadow", "checkValidityOverride", "checkValidity", "reportValidityOverride", "reportValidity"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as m}from"./chunk-2TVOKUHE.js";import{a as b}from"./chunk-ENFFFE4I.js";import{a as u}from"./chunk-23UFIOHV.js";import{a as c,b as n,f as p,g as d,h as o}from"./chunk-HG7OBTQS.js";import{a as r}from"./chunk-NZ3RGSR6.js";var h=c`:host{display:block}.alert{--padding:var(--bl-size-m);--main-color:var(--bl-color-primary);--main-bg-color:var(--bl-color-accent-primary-background);position:relative;display:flex;align-items:flex-start;justify-content:space-between;background-color:var(--main-bg-color);color:var(--bl-color-content-primary);box-shadow:0 0 0 1px var(--main-color);border-radius:var(--bl-border-radius-s);padding:calc(var(--padding) / 2) var(--padding)}.description{font:var(--bl-font-title-3-regular)}.wrapper{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;flex:auto}.content{display:flex;align-items:center;padding:calc(var(--padding) / 2) 0;margin-right:var(--bl-size-2xs);flex:20 1 70%}.icon{margin-right:var(--bl-size-2xs);color:var(--main-color)}.text-content{display:flex;flex-direction:column}.caption{color:var(--main-color);font:var(--bl-font-title-3-medium);margin-bottom:var(--bl-size-4xs)}.action{display:flex;align-items:center;flex:1 1 0%}.caption+.description{font:var(--bl-font-body-text-3)}.close-spaced{margin-top:calc(var(--padding) / 2)}:host([closed]){display:none}:host([variant='success']) .alert{--main-color:var(--bl-color-success);--main-bg-color:var(--bl-color-success-background)}:host([variant='warning']) .alert{--main-color:var(--bl-color-warning);--main-bg-color:var(--bl-color-warning-background)}:host([variant='danger']) .alert{--main-color:var(--bl-color-danger);--main-bg-color:var(--bl-color-danger-background)}`,f=h;var g=()=>({fromAttribute:a=>!a||a==="true"?!0:a==="false"?!1:a});var t=class extends p{constructor(){super(...arguments);this.variant="info";this.closable=!1;this.closed=!1}static get styles(){return[f]}open(){this.closed=!1}close(){this.closed=!0}get _hasAlertCaptionSlot(){return this.querySelector(':scope > [slot="caption"]')!==null}_closeHandler(){this.closed=!0,this.onClose(!0)}_predefinedIcons(){switch(this.variant){case"success":return"check_fill";case"danger":return"close_fill";default:return this.variant}}_getIcon(){if(!!this.icon)return this.icon===!0?this._predefinedIcons():this.icon}_initAlertActionSlot(i){i.target.assignedElements().forEach(e=>{var s;if(e.tagName!=="BL-BUTTON"){(s=e.parentNode)==null||s.removeChild(e);return}e.setAttribute("variant","tertiary"),e.setAttribute("kind","neutral"),e.setAttribute("size","medium"),e.removeAttribute("icon")})}render(){let i=this.caption||this._hasAlertCaptionSlot?n`<span class="caption">
|
|
2
2
|
<slot name="caption"> ${this.caption} </slot>
|
|
3
|
-
</span>`:null,l=this._getIcon()?n`<bl-icon class="icon" name=${
|
|
3
|
+
</span>`:null,l=this._getIcon()?n`<bl-icon class="icon" name=${m(this._getIcon())}></bl-icon>`:null,e=b({close:!0,"close-spaced":!!i}),s=this.closable?n`<bl-button
|
|
4
4
|
class=${e}
|
|
5
5
|
label="close"
|
|
6
6
|
variant="tertiary"
|
|
@@ -22,4 +22,4 @@ import{a as b}from"./chunk-2TVOKUHE.js";import{a as m}from"./chunk-ENFFFE4I.js";
|
|
|
22
22
|
${s}
|
|
23
23
|
</div>
|
|
24
24
|
`}};r([o({reflect:!0})],t.prototype,"variant",2),r([o()],t.prototype,"description",2),r([o({converter:g()})],t.prototype,"icon",2),r([o({type:Boolean,reflect:!0})],t.prototype,"closable",2),r([o()],t.prototype,"caption",2),r([o({type:Boolean,reflect:!0})],t.prototype,"closed",2),r([u("bl-close")],t.prototype,"onClose",2),t=r([d("bl-alert")],t);export{t as a};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-FFIDELPT.js.map
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as g}from"./chunk-5VLVLBWY.js";import{a as m}from"./chunk-KQBKSEYJ.js";import{a as s}from"./chunk-2TVOKUHE.js";import{a as u}from"./chunk-ENFFFE4I.js";import{a as d}from"./chunk-23UFIOHV.js";import{a as c,b as l,f as p,g as b,h as i,i as v,j as h}from"./chunk-HG7OBTQS.js";import{a as e}from"./chunk-NZ3RGSR6.js";var y=o=>{if(o.reportValidity()){let n=new Event("submit",{cancelable:!0});o.dispatchEvent(n),n.defaultPrevented||o.submit()}else return};var T=["valueMissing","typeMismatch","tooLong","tooShort","rangeUnderflow","rangeOverflow","badInput","customError"],f=T.map(o=>({key:o,isValid(n){return n.validationTarget?!n.validationTarget.validity[o]:!0}}));var k=c`:host{display:inline-block;width:200px;position:relative;--bl-input-padding-vertical:var(--bl-size-2xs);--bl-input-padding-horizontal:var(--bl-size-xs);--bl-input-border-color:var(--bl-color-border);--bl-input-icon-color:var(--bl-color-content-tertiary);--bl-input-text-color:var(--bl-color-content-primary);--bl-input-height:var(--bl-size-2xl)}input{outline:0;box-sizing:border-box;height:var(--bl-input-height);border:solid 1px var(--bl-input-border-color);width:100%;font:var(--bl-font-title-3-regular);padding:0 var(--bl-input-padding-horizontal);margin:0;border-radius:4px;color:var(--bl-input-text-color)}bl-icon{position:absolute;top:var(--bl-input-padding-vertical);right:var(--bl-input-padding-horizontal);font-size:var(--bl-size-m);z-index:1;color:var(--bl-input-icon-color)}input:focus{--bl-input-border-color:var(--bl-color-primary)}:host([label-fixed]) bl-icon{top:calc(var(--bl-input-padding-vertical) + var(--bl-size-m))}input:focus ~ bl-icon{--bl-input-icon-color:var(--bl-color-primary)}:host ::placeholder{color:var(--bl-color-content-tertiary)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}:host input:focus::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}input:disabled{background-color:var(--bl-color-primary-background);--bl-input-text-color:var(--bl-color-content-tertiary)}input.dirty:invalid{--bl-input-border-color:var(--bl-color-danger)}input.has-icon{padding-right:calc(var(--bl-size-xs) * 2 + var(--bl-size-m))}.error-icon,.invalid-text{display:none}label{position:absolute;top:var(--bl-input-padding-vertical);left:var(--bl-input-padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);color:var(--bl-color-content-tertiary);padding:0}:where(input:focus,input.has-value) ~ label{top:0;left:var(--bl-size-2xs);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--bl-size-3xs);background-color:var(--bl-color-primary-background);pointer-events:initial}:host([label-fixed]){padding-top:var(--bl-size-m)}:host([label-fixed]) label{top:0;left:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0}.dirty:invalid ~ label{color:var(--bl-color-danger)}.invalid-text,.help-text{font:var(--bl-font-title-4-regular);padding:var(--bl-size-3xs) var(--bl-input-padding-horizontal);margin:0}.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}.error-icon{color:var(--bl-color-danger)}.dirty:invalid ~ .invalid-text{display:block}.dirty:invalid ~ .help-text{display:none}.dirty:invalid ~ .error-icon{display:inline-block}.dirty:invalid ~ .custom-icon ~ .error-icon{display:none}.dirty:invalid ~ .custom-icon{--bl-input-icon-color:var(--bl-color-danger)}:host([size='large']){--bl-input-height:var(--bl-size-3xl);--bl-input-padding-vertical:var(--bl-size-xs);--bl-input-padding-horizontal:var(--bl-size-m)}`,x=k;var t=class extends g(p){constructor(){super(...arguments);this.type="text";this.value="";this.required=!1;this.size="medium";this.disabled=!1;this.labelFixed=!1;this.onKeydown=r=>{r.code==="Enter"&&this.form&&y(this.form)};this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1}static get styles(){return[x]}connectedCallback(){var r;super.connectedCallback(),this.addEventListener("keydown",this.onKeydown),this.addEventListener("invalid",this.onError),(r=this.internals.form)==null||r.addEventListener("submit",()=>{this.reportValidity()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeydown),this.removeEventListener("invalid",this.onError)}validityCallback(){var r;return this.customInvalidText||((r=this.validationTarget)==null?void 0:r.validationMessage)}reportValidity(){return this.dirty=!0,this.checkValidity()}valueChangedCallback(r){this.value=r}inputHandler(r){let a=r.target.value;this.setValue(a),this.onInput(a)}changeHandler(r){let a=r.target.value;this.dirty=!0,this.setValue(a),this.onChange(a)}firstUpdated(){this.setValue(this.value)}render(){let r=this.checkValidity()?"":l`<p class="invalid-text">${this.validationMessage}</p>`,a=this.helpText?l`<p class="help-text">${this.helpText}</p>`:"",E=this.icon?l` <bl-icon class="custom-icon" name="${this.icon}"></bl-icon>`:"",z=this.label?l`<label>${this.label}</label>`:"",$={dirty:this.dirty,"has-icon":this.icon||this.dirty&&!this.checkValidity(),"has-value":this.value!==null&&this.value!==""};return l`
|
|
2
|
+
<input
|
|
3
|
+
type=${this.type}
|
|
4
|
+
class=${u($)}
|
|
5
|
+
.value=${m(this.value)}
|
|
6
|
+
placeholder="${s(this.placeholder)}"
|
|
7
|
+
minlength="${s(this.minlength)}"
|
|
8
|
+
maxlength="${s(this.maxlength)}"
|
|
9
|
+
min="${s(this.min)}"
|
|
10
|
+
max="${s(this.max)}"
|
|
11
|
+
?required=${this.required}
|
|
12
|
+
?disabled=${this.disabled}
|
|
13
|
+
@change=${this.changeHandler}
|
|
14
|
+
@input=${this.inputHandler}
|
|
15
|
+
/>
|
|
16
|
+
${z} ${E}
|
|
17
|
+
<bl-icon class="error-icon" name="alert"></bl-icon>
|
|
18
|
+
${r} ${a}
|
|
19
|
+
`}};t.formControlValidators=f,e([h("input")],t.prototype,"validationTarget",2),e([i({})],t.prototype,"type",2),e([i({})],t.prototype,"label",2),e([i({})],t.prototype,"placeholder",2),e([i()],t.prototype,"value",2),e([i({type:Boolean})],t.prototype,"required",2),e([i({type:Number})],t.prototype,"minlength",2),e([i({type:Number})],t.prototype,"maxlength",2),e([i({type:Number})],t.prototype,"min",2),e([i({type:Number})],t.prototype,"max",2),e([i({type:String})],t.prototype,"icon",2),e([i({type:String,reflect:!0})],t.prototype,"size",2),e([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([i({type:Boolean,attribute:"label-fixed"})],t.prototype,"labelFixed",2),e([i({type:String,attribute:"invalid-text"})],t.prototype,"customInvalidText",2),e([i({type:String,attribute:"help-text"})],t.prototype,"helpText",2),e([d("bl-change")],t.prototype,"onChange",2),e([d("bl-input")],t.prototype,"onInput",2),e([d("bl-invalid")],t.prototype,"onInvalid",2),e([v()],t.prototype,"dirty",2),t=e([b("bl-input")],t);export{t as a};
|
|
20
|
+
//# sourceMappingURL=chunk-JDM44V27.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@open-wc/form-helpers/src/index.ts", "../src/utilities/form-control.ts", "../src/components/input/bl-input.css", "../src/components/input/bl-input.ts"],
|
|
4
|
+
"sourcesContent": [null, "const validityStates: Array<keyof ValidityState> = [\n 'valueMissing',\n 'typeMismatch',\n 'tooLong',\n 'tooShort',\n 'rangeUnderflow',\n 'rangeOverflow',\n 'badInput',\n 'customError',\n];\n\nexport const innerInputValidators = validityStates.map(key => ({\n key,\n isValid(instance: HTMLElement & { validationTarget: HTMLInputElement }) {\n if (instance.validationTarget) {\n return !instance.validationTarget.validity[key];\n }\n return true;\n },\n}));\n", "import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative;--bl-input-padding-vertical:var(--bl-size-2xs);--bl-input-padding-horizontal:var(--bl-size-xs);--bl-input-border-color:var(--bl-color-border);--bl-input-icon-color:var(--bl-color-content-tertiary);--bl-input-text-color:var(--bl-color-content-primary);--bl-input-height:var(--bl-size-2xl)}input{outline:0;box-sizing:border-box;height:var(--bl-input-height);border:solid 1px var(--bl-input-border-color);width:100%;font:var(--bl-font-title-3-regular);padding:0 var(--bl-input-padding-horizontal);margin:0;border-radius:4px;color:var(--bl-input-text-color)}bl-icon{position:absolute;top:var(--bl-input-padding-vertical);right:var(--bl-input-padding-horizontal);font-size:var(--bl-size-m);z-index:1;color:var(--bl-input-icon-color)}input:focus{--bl-input-border-color:var(--bl-color-primary)}:host([label-fixed]) bl-icon{top:calc(var(--bl-input-padding-vertical) + var(--bl-size-m))}input:focus ~ bl-icon{--bl-input-icon-color:var(--bl-color-primary)}:host ::placeholder{color:var(--bl-color-content-tertiary)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}:host input:focus::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}input:disabled{background-color:var(--bl-color-primary-background);--bl-input-text-color:var(--bl-color-content-tertiary)}input.dirty:invalid{--bl-input-border-color:var(--bl-color-danger)}input.has-icon{padding-right:calc(var(--bl-size-xs) * 2 + var(--bl-size-m))}.error-icon,.invalid-text{display:none}label{position:absolute;top:var(--bl-input-padding-vertical);left:var(--bl-input-padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);color:var(--bl-color-content-tertiary);padding:0}:where(input:focus,input.has-value) ~ label{top:0;left:var(--bl-size-2xs);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--bl-size-3xs);background-color:var(--bl-color-primary-background);pointer-events:initial}:host([label-fixed]){padding-top:var(--bl-size-m)}:host([label-fixed]) label{top:0;left:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0}.dirty:invalid ~ label{color:var(--bl-color-danger)}.invalid-text,.help-text{font:var(--bl-font-title-4-regular);padding:var(--bl-size-3xs) var(--bl-input-padding-horizontal);margin:0}.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}.error-icon{color:var(--bl-color-danger)}.dirty:invalid ~ .invalid-text{display:block}.dirty:invalid ~ .help-text{display:none}.dirty:invalid ~ .error-icon{display:inline-block}.dirty:invalid ~ .custom-icon ~ .error-icon{display:none}.dirty:invalid ~ .custom-icon{--bl-input-icon-color:var(--bl-color-danger)}:host([size='large']){--bl-input-height:var(--bl-size-3xl);--bl-input-padding-vertical:var(--bl-size-xs);--bl-input-padding-horizontal:var(--bl-size-m)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { FormControlMixin } from '@open-wc/form-control';\nimport { submit } from '@open-wc/form-helpers';\nimport { live } from 'lit/directives/live.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport { innerInputValidators } from '../../utilities/form-control';\nimport 'element-internals-polyfill';\nimport '../icon/bl-icon';\n\nimport style from './bl-input.css';\n\nexport type InputSize = 'medium' | 'large';\n/**\n * @tag bl-input\n * @summary Baklava Input component\n */\n@customElement('bl-input')\nexport default class BlInput extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n static formControlValidators = innerInputValidators;\n\n @query('input')\n validationTarget: HTMLInputElement;\n\n /**\n * Type of the input. It's used to set `type` attribute of native input inside. Only `text` and `number` is supported for now.\n */\n @property({})\n type: 'text' | 'number' = 'text';\n\n /**\n * Sets label of the input\n */\n @property({})\n label?: string;\n\n /**\n * Sets placeholder of the input\n */\n @property({})\n placeholder?: string;\n\n /**\n * Sets initial value of the input\n */\n @property()\n value = '';\n\n /**\n * Makes input a mandatory field\n */\n @property({ type: Boolean })\n required = false;\n\n /**\n * Sets minimum length of the input\n */\n @property({ type: Number })\n minlength?: number;\n\n /**\n * Sets maximum length of the input\n */\n @property({ type: Number })\n maxlength?: number;\n\n /**\n * Sets the smallest number can be entered to a `number` input\n */\n @property({ type: Number })\n min?: number;\n\n /**\n * Sets the biggest number can be entered to a `number` input\n */\n @property({ type: Number })\n max?: number;\n\n /**\n * Sets the custom icon name. `bl-icon` component is used to show an icon\n */\n @property({ type: String })\n icon?: string;\n\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = 'medium';\n\n /**\n * Disables the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: 'label-fixed' })\n labelFixed = false;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: 'invalid-text' })\n customInvalidText?: string;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText?: string;\n\n /**\n * Fires when an alteration to the element's value is committed by the user. Unlike the input event, the change event is not necessarily fired for each alteration to an element's value.\n */\n @event('bl-change') private onChange: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event('bl-input') private onInput: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event('bl-invalid') private onInvalid: EventDispatcher<ValidityState>;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('keydown', this.onKeydown);\n this.addEventListener('invalid', this.onError);\n\n this.internals.form?.addEventListener('submit', () => {\n this.reportValidity();\n });\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this.onKeydown);\n this.removeEventListener('invalid', this.onError);\n }\n\n private onKeydown = (event: KeyboardEvent): void => {\n if (event.code === 'Enter' && this.form) {\n submit(this.form);\n }\n }\n\n private onError = (): void => {\n this.onInvalid(this.internals.validity);\n }\n\n @state() private dirty = false;\n\n validityCallback(): string | void {\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n valueChangedCallback(value: string): void {\n this.value = value;\n }\n\n private inputHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.setValue(value);\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.dirty = true;\n this.setValue(value);\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p class=\"invalid-text\">${this.validationMessage}</p>`\n : ``;\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : ``;\n const icon = this.icon\n ? html` <bl-icon class=\"custom-icon\" name=\"${this.icon}\"></bl-icon>`\n : '';\n const label = this.label ? html`<label>${this.label}</label>` : '';\n\n const classes = {\n 'dirty': this.dirty,\n 'has-icon': this.icon || (this.dirty && !this.checkValidity()),\n 'has-value': this.value !== null && this.value !== '',\n };\n\n return html`\n <input\n type=${this.type}\n class=${classMap(classes)}\n .value=${live(this.value)}\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n maxlength=\"${ifDefined(this.maxlength)}\"\n min=\"${ifDefined(this.min)}\"\n max=\"${ifDefined(this.max)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n />\n ${label} ${icon}\n <bl-icon class=\"error-icon\" name=\"alert\"></bl-icon>\n ${invalidMessage} ${helpMessage}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-input': BlInput;\n }\n}\n"],
|
|
5
|
+
"mappings": "kUAOO,IAAMA,EAAUC,GAA+B,CACpD,GAAKA,EAAK,eAAc,EAEjB,CACL,IAAMC,EAAc,IAAI,MAAM,SAAU,CACtC,WAAY,GACb,EACDD,EAAK,cAAcC,CAAW,EACzBA,EAAY,kBACfD,EAAK,OAAM,MAPb,OAUJ,ECnBA,IAAME,EAA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S,GA/BSnB,EAgCnB,qBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,CAAC,GArCRnB,EAsCnB,wBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GA3CPnB,EA4CnB,yBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GAjDPnB,EAkDnB,yBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GAvDPnB,EAwDnB,mBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GA7DPnB,EA8DnB,mBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GAnEPnB,EAoEnB,oBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAzEtBnB,EA0EnB,oBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA/EvBnB,EAgFnB,wBAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,UAAW,aAAc,CAAC,GArFlCnB,EAsFnB,0BAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GA3FlCnB,EA4FnB,iCAMAiB,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,GAjG/BnB,EAkGnB,wBAK4BiB,EAAA,CAA3Bd,EAAM,WAAW,GAvGCH,EAuGS,wBAKDiB,EAAA,CAA1Bd,EAAM,UAAU,GA5GEH,EA4GQ,uBAKGiB,EAAA,CAA5Bd,EAAM,YAAY,GAjHDH,EAiHW,yBA4BbiB,EAAA,CAAhBG,EAAM,GA7IYpB,EA6IF,qBA7IEA,EAArBiB,EAAA,CADCI,EAAc,UAAU,GACJrB",
|
|
6
|
+
"names": ["submit", "form", "submitEvent", "validityStates", "innerInputValidators", "key", "instance", "styles", "r", "bl_input_default", "BlInput", "FormControlMixin", "s", "event", "submit", "bl_input_default", "_a", "value", "invalidMessage", "$", "helpMessage", "icon", "label", "classes", "o", "l", "innerInputValidators", "__decorateClass", "i", "e", "t", "n"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as f}from"./chunk-5VLVLBWY.js";import{a as v}from"./chunk-ENFFFE4I.js";import{a as i}from"./chunk-23UFIOHV.js";import{a as s,b as n,f as d,g as c,h as o,i as u,j as m}from"./chunk-HG7OBTQS.js";import{a as t}from"./chunk-NZ3RGSR6.js";var k=s`:host{display:flex;flex-direction:row}fieldset{border:0;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-content-primary)}.options{display:flex;flex-flow:var(--bl-radio-direction,column) wrap;gap:16px;margin-block:var(--bl-size-xs)}`,g=k;var b="bl-radio-group",h="bl-radio-change",r=class extends f(d){constructor(){super(...arguments);this.value="";this.required=!1;this.focusedOptionIndex=0}static get styles(){return[g]}get options(){return[].slice.call(this.querySelectorAll(p))}get availableOptions(){return this.options.filter(e=>!e.disabled)}updated(e){e.has("value")&&(this.setValue(this.value),this.onChange(this.value))}handleOptionChecked(e){let a=e.target;this.setValue(a.value),this.onChange(a.value)}handleKeyDown(e){if(["ArrowDown","ArrowRight"].includes(e.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(e.key))this.focusedOptionIndex--;else if([" "].includes(e.key)){this.availableOptions[this.focusedOptionIndex].select();return}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.availableOptions.length-1)),this.availableOptions[this.focusedOptionIndex].focus(),e.preventDefault()}connectedCallback(){super.connectedCallback(),this.tabIndex=0,this.addEventListener("focus",this.handleFocus),this.addEventListener("keydown",this.handleKeyDown)}handleFocus(){this.availableOptions[this.focusedOptionIndex].focus()}render(){return n`<fieldset
|
|
2
|
+
role="radiogroup"
|
|
3
|
+
aria-labelledby="label"
|
|
4
|
+
aria-required=${this.required}
|
|
5
|
+
>
|
|
6
|
+
<legend>${this.label}</legend>
|
|
7
|
+
<div class="options" @bl-checked=${this.handleOptionChecked}>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</fieldset>`}};t([o({type:String})],r.prototype,"label",2),t([o()],r.prototype,"value",2),t([o({type:Boolean,reflect:!0})],r.prototype,"required",2),t([i("bl-radio-change")],r.prototype,"onChange",2),r=t([c(b)],r);var C=s`:host{display:inline-block;cursor:pointer;outline:0}.wrapper{outline:0}#label{display:flex;font:var(--bl-font-title-3-regular);height:var(--bl-size-m);line-height:normal;vertical-align:middle;margin-block:0;color:var(--bl-color-content-primary)}#label::before{content:'';display:inline-block;box-sizing:border-box;width:var(--bl-size-m);height:var(--bl-size-m);background-color:white;border-radius:var(--bl-border-radius-circle);border:solid 1px var(--bl-color-border);margin-right:var(--bl-size-2xs);vertical-align:middle}.selected #label::before{border-width:4px;border-color:var(--bl-color-primary)}:host(:hover) #label,.selected #label,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) #label,.selected #label{color:var(--bl-color-primary)}:host([disabled]){cursor:not-allowed;pointer-events:none}:host([disabled]) #label{color:var(--bl-color-content-passive)}:host([disabled]) #label::before{background-color:var(--bl-color-secondary-background)}:host([disabled]) .selected #label::before{background-color:var(--bl-color-content-passive);border-color:var(--bl-color-secondary-background)}.wrapper:focus-visible #label::before{box-shadow:0 0 0 1px white,0 0 0 3px var(--bl-color-primary)}`,x=C;var p="bl-radio",Q="bl-checked",l=class extends d{constructor(){super(...arguments);this.disabled=!1;this.selected=!1;this.handleFieldValueChange=e=>{let a=e.detail;this.selected=a===this.value}}static get styles(){return[x]}select(){this.selected=!0,this.onChecked(this.value)}get checked(){return this.selected}focus(){this.radioElement.tabIndex=0,this.radioElement.focus(),this.onFocus(this.value)}blur(){this.radioElement.tabIndex=-1,this.onBlur(this.value)}connectedCallback(){var e;super.connectedCallback(),this.field=this.closest(b),this.field||console.warn("bl-radio is designed to be used inside a bl-radio-group",this),(e=this.field)==null||e.addEventListener(h,this.handleFieldValueChange)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.field)==null||e.removeEventListener(h,this.handleFieldValueChange)}render(){let e=v({wrapper:!0,selected:this.selected});return n`<div
|
|
11
|
+
class=${e}
|
|
12
|
+
role="radio"
|
|
13
|
+
aria-labelledby="label"
|
|
14
|
+
aria-disabled=${this.disabled}
|
|
15
|
+
aria-readonly=${this.disabled}
|
|
16
|
+
@blur=${this.blur}
|
|
17
|
+
@click=${this.select}>
|
|
18
|
+
<p id="label"><slot></slot></p>
|
|
19
|
+
</div>`}};t([o()],l.prototype,"name",2),t([o()],l.prototype,"value",2),t([o({type:Boolean,reflect:!0})],l.prototype,"disabled",2),t([u()],l.prototype,"selected",2),t([i("bl-checked")],l.prototype,"onChecked",2),t([i("bl-focus")],l.prototype,"onFocus",2),t([i("bl-blur")],l.prototype,"onBlur",2),t([m("[role=radio]")],l.prototype,"radioElement",2),l=t([c(p)],l);export{p as a,Q as b,l as c,b as d,h as e,r as f};
|
|
20
|
+
//# sourceMappingURL=chunk-WFBCOT52.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/radio-group/bl-radio-group.css", "../src/components/radio-group/bl-radio-group.ts", "../src/components/radio-group/radio/bl-radio.css", "../src/components/radio-group/radio/bl-radio.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:flex;flex-direction:row}fieldset{border:0;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-content-primary)}.options{display:flex;flex-flow:var(--bl-radio-direction,column) wrap;gap:16px;margin-block:var(--bl-size-xs)}`;\nexport default styles;\n", "import { FormControlMixin } from '@open-wc/form-control';\nimport { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport 'element-internals-polyfill';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport style from './bl-radio-group.css';\nimport BlRadio, { blRadioTag } from './radio/bl-radio';\n\nexport const blRadioGroupTag = 'bl-radio-group';\n\nexport const blChangeEventName = 'bl-radio-change';\n\n/**\n * @tag bl-radio-group\n * @summary Baklava Button component\n *\n * @cssproperty --bl-radio-direction - Can be used for showing radio options as columns instead of rows. Options are `row` or `column`\n */\n@customElement(blRadioGroupTag)\nexport default class BlRadioGroup extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the radio group label\n */\n @property({ type: String })\n label: string;\n\n /**\n * Set and gets the actual value of the field\n */\n @property()\n value = '';\n\n /**\n * Sets option as required\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n get options(): BlRadio[] {\n return [].slice.call(this.querySelectorAll(blRadioTag));\n }\n\n get availableOptions(): BlRadio[] {\n return this.options.filter(option => !option.disabled);\n }\n\n updated(changedProperties: Map<string, unknown>): void {\n if (changedProperties.has('value')) {\n this.setValue(this.value);\n this.onChange(this.value);\n }\n }\n\n /**\n * Fires when radio group value changed\n */\n @event('bl-radio-change') private onChange: EventDispatcher<string>;\n\n private focusedOptionIndex = 0;\n\n private handleOptionChecked(event: CustomEvent) {\n const checkedOption = event.target as BlRadio;\n this.setValue(checkedOption.value);\n this.onChange(checkedOption.value);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n // Next option\n if (['ArrowDown', 'ArrowRight'].includes(event.key)) {\n this.focusedOptionIndex++;\n\n // Previous option\n } else if (['ArrowUp', 'ArrowLeft'].includes(event.key)) {\n this.focusedOptionIndex--;\n\n // Select option\n } else if ([' '].includes(event.key)) {\n this.availableOptions[this.focusedOptionIndex].select();\n return;\n } else {\n // Other keys are not our interest here\n return;\n }\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, this.availableOptions.length - 1)\n );\n\n this.availableOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.tabIndex = 0;\n this.addEventListener('focus', this.handleFocus);\n this.addEventListener('keydown', this.handleKeyDown);\n }\n\n private handleFocus() {\n this.availableOptions[this.focusedOptionIndex].focus();\n }\n\n render(): TemplateResult {\n return html`<fieldset\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-required=${this.required}\n >\n <legend>${this.label}</legend>\n <div class=\"options\" @bl-checked=${this.handleOptionChecked}>\n <slot></slot>\n </div>\n </fieldset>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blRadioGroupTag]: BlRadioGroup;\n }\n interface HTMLElementEventMap {\n [blChangeEventName]: CustomEvent<string>;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;cursor:pointer;outline:0}.wrapper{outline:0}#label{display:flex;font:var(--bl-font-title-3-regular);height:var(--bl-size-m);line-height:normal;vertical-align:middle;margin-block:0;color:var(--bl-color-content-primary)}#label::before{content:'';display:inline-block;box-sizing:border-box;width:var(--bl-size-m);height:var(--bl-size-m);background-color:white;border-radius:var(--bl-border-radius-circle);border:solid 1px var(--bl-color-border);margin-right:var(--bl-size-2xs);vertical-align:middle}.selected #label::before{border-width:4px;border-color:var(--bl-color-primary)}:host(:hover) #label,.selected #label,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) #label,.selected #label{color:var(--bl-color-primary)}:host([disabled]){cursor:not-allowed;pointer-events:none}:host([disabled]) #label{color:var(--bl-color-content-passive)}:host([disabled]) #label::before{background-color:var(--bl-color-secondary-background)}:host([disabled]) .selected #label::before{background-color:var(--bl-color-content-passive);border-color:var(--bl-color-secondary-background)}.wrapper:focus-visible #label::before{box-shadow:0 0 0 1px white,0 0 0 3px var(--bl-color-primary)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { event, EventDispatcher } from '../../../utilities/event';\nimport type BlRadioGroup from '../bl-radio-group';\nimport { blChangeEventName, blRadioGroupTag } from '../bl-radio-group';\nimport style from './bl-radio.css';\n\n\nexport const blRadioTag = 'bl-radio';\n\nexport const blCheckedEventName = 'bl-checked';\n\n/**\n * @tag bl-radio\n * @summary Baklava Radio Option component\n */\n@customElement(blRadioTag)\nexport default class BlRadio extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @property()\n name: string;\n\n @property()\n value: string;\n\n /**\n * Sets option as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n\n @state() private selected = false;\n\n /**\n * Fires when radio is checked\n */\n @event('bl-checked') private onChecked: EventDispatcher<string>;\n\n /**\n * Fires when radio is blurred\n */\n @event('bl-focus') private onFocus: EventDispatcher<string>;\n\n /**\n * Fires when radio is blurred\n */\n @event('bl-blur') private onBlur: EventDispatcher<string>;\n\n /**\n * Sets this option selected\n */\n select() {\n this.selected = true;\n this.onChecked(this.value);\n }\n\n /**\n * Readonly property to determine if option is currently checked\n */\n get checked() {\n return this.selected;\n }\n\n @query('[role=radio]') private radioElement: HTMLElement;\n\n /**\n * Focuses this option\n */\n focus() {\n this.radioElement.tabIndex = 0;\n this.radioElement.focus();\n this.onFocus(this.value);\n }\n\n /**\n * Blurs from this option\n */\n blur() {\n this.radioElement.tabIndex = -1;\n this.onBlur(this.value);\n }\n\n private handleFieldValueChange = (event: CustomEvent<string>) => {\n const newValue = event.detail;\n this.selected = newValue === this.value;\n }\n\n private field: BlRadioGroup | null;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.field = this.closest<BlRadioGroup>(blRadioGroupTag);\n\n if (!this.field) {\n console.warn('bl-radio is designed to be used inside a bl-radio-group', this);\n }\n\n this.field?.addEventListener(blChangeEventName, this.handleFieldValueChange);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.field?.removeEventListener(blChangeEventName, this.handleFieldValueChange);\n }\n\n render(): TemplateResult {\n const classes = classMap({\n wrapper: true,\n selected: this.selected\n });\n\n return html`<div\n class=${classes}\n role=\"radio\"\n aria-labelledby=\"label\"\n aria-disabled=${this.disabled}\n aria-readonly=${this.disabled}\n @blur=${this.blur}\n @click=${this.select}>\n <p id=\"label\"><slot></slot></p>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blRadioTag]: BlRadio;\n }\n interface HTMLElementEventMap {\n [blCheckedEventName]: CustomEvent<string>\n }\n}\n"],
|
|
5
|
+
"mappings": "kPACO,IAAMA,EAASC,oQACfC,EAAQF,ECMR,IAAMG,EAAkB,iBAElBC,EAAoB,kBASZC,EAArB,cAA0CC,EAAiBC,CAAU,CAAE,CAAvE,kCAeE,WAAQ,GAMR,cAAW,GAsBX,KAAQ,mBAAqB,EA1C7B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAoBA,IAAI,SAAqB,CACvB,MAAO,CAAC,EAAE,MAAM,KAAK,KAAK,iBAAiBC,CAAU,CAAC,CACxD,CAEA,IAAI,kBAA8B,CAChC,OAAO,KAAK,QAAQ,OAAOC,GAAU,CAACA,EAAO,QAAQ,CACvD,CAEA,QAAQC,EAA+C,CACjDA,EAAkB,IAAI,OAAO,IAC/B,KAAK,SAAS,KAAK,KAAK,EACxB,KAAK,SAAS,KAAK,KAAK,EAE5B,CASQ,oBAAoBC,EAAoB,CAC9C,IAAMC,EAAgBD,EAAM,OAC5B,KAAK,SAASC,EAAc,KAAK,EACjC,KAAK,SAASA,EAAc,KAAK,CACnC,CAEQ,cAAcD,EAAsB,CAE1C,GAAI,CAAC,YAAa,YAAY,EAAE,SAASA,EAAM,GAAG,EAChD,KAAK,6BAGI,CAAC,UAAW,WAAW,EAAE,SAASA,EAAM,GAAG,EACpD,KAAK,6BAGI,CAAC,GAAG,EAAE,SAASA,EAAM,GAAG,EAAG,CACpC,KAAK,iBAAiB,KAAK,oBAAoB,OAAO,EACtD,MACF,KAEE,QAIF,KAAK,mBAAqB,KAAK,IAC7B,EACA,KAAK,IAAI,KAAK,mBAAoB,KAAK,iBAAiB,OAAS,CA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O,KAAK,KAAK,CACxB,CASA,mBAA0B,CA9F5B,IAAAC,EA+FI,MAAM,kBAAkB,EAExB,KAAK,MAAQ,KAAK,QAAsBC,CAAe,EAElD,KAAK,OACR,QAAQ,KAAK,0DAA2D,IAAI,GAG9ED,EAAA,KAAK,QAAL,MAAAA,EAAY,iBAAiBE,EAAmB,KAAK,uBACvD,CAEA,sBAA6B,CA1G/B,IAAAF,EA2GI,MAAM,qBAAqB,GAC3BA,EAAA,KAAK,QAAL,MAAAA,EAAY,oBAAoBE,EAAmB,KAAK,uBAC1D,CAEA,QAAyB,CACvB,IAAMC,EAAUC,EAAS,CACvB,QAAS,GACT,SAAU,KAAK,QACjB,CAAC,EAED,OAAOC;AAAA,cACGF;AAAA;AAAA;AAAA,sBAGQ,KAAK;AAAA,sBACL,KAAK;AAAA,cACb,KAAK;AAAA,eACJ,KAAK;AAAA;AAAA,WAGlB,CACF,EAxGEG,EAAA,CADCC,EAAS,GALSZ,EAMnB,oBAGAW,EAAA,CADCC,EAAS,GARSZ,EASnB,qBAMAW,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAdvBZ,EAenB,wBAGiBW,EAAA,CAAhBE,EAAM,GAlBYb,EAkBF,wBAKYW,EAAA,CAA5BT,EAAM,YAAY,GAvBAF,EAuBU,yBAKDW,EAAA,CAA1BT,EAAM,UAAU,GA5BCF,EA4BS,uBAKFW,EAAA,CAAzBT,EAAM,SAAS,GAjCGF,EAiCO,sBAiBKW,EAAA,CAA9BG,EAAM,cAAc,GAlDFd,EAkDY,4BAlDZA,EAArBW,EAAA,CADCI,EAAcjB,CAAU,GACJE",
|
|
6
|
+
"names": ["styles", "r", "bl_radio_group_default", "blRadioGroupTag", "blChangeEventName", "BlRadioGroup", "FormControlMixin", "s", "bl_radio_group_default", "blRadioTag", "option", "changedProperties", "event", "checkedOption", "$", "__decorateClass", "e", "n", "styles", "r", "bl_radio_default", "blRadioTag", "blCheckedEventName", "BlRadio", "s", "event", "newValue", "bl_radio_default", "_a", "blRadioGroupTag", "blChangeEventName", "classes", "o", "$", "__decorateClass", "e", "t", "i", "n"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-FFIDELPT.js";import"../../chunk-2TVOKUHE.js";import"../../chunk-ENFFFE4I.js";import"../../chunk-WXJKPVRA.js";import"../../chunk-72IJCTLJ.js";import"../../chunk-23UFIOHV.js";import"../../chunk-HG7OBTQS.js";import"../../chunk-NZ3RGSR6.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-alert.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-JDM44V27.js";import"../../chunk-5VLVLBWY.js";import"../../chunk-KQBKSEYJ.js";import"../../chunk-2TVOKUHE.js";import"../../chunk-ENFFFE4I.js";import"../../chunk-WXJKPVRA.js";import"../../chunk-72IJCTLJ.js";import"../../chunk-23UFIOHV.js";import"../../chunk-HG7OBTQS.js";import"../../chunk-NZ3RGSR6.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-3ZCWE6JC.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-3ZCWE6JC.js";import"../../chunk-JDM44V27.js";import"../../chunk-5VLVLBWY.js";import"../../chunk-GBFJ2WUI.js";import"../../chunk-KWTSWXUL.js";import"../../chunk-VNGNBBSS.js";import"../../chunk-KQBKSEYJ.js";import"../../chunk-HUFJDENF.js";import"../../chunk-2TVOKUHE.js";import"../../chunk-ENFFFE4I.js";import"../../chunk-WXJKPVRA.js";import"../../chunk-72IJCTLJ.js";import"../../chunk-23UFIOHV.js";import"../../chunk-HG7OBTQS.js";import"../../chunk-NZ3RGSR6.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-pagination.js.map
|