@formkit/pro 0.122.21 → 0.123.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/index.mjs +1 -1
- package/dropdown/index.mjs +1 -1
- package/genesis.css +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +141 -4
- package/index.mjs +1 -1
- package/mask/index.mjs +1 -1
- package/package.json +1 -1
- package/rating/index.mjs +1 -1
- package/rating/rating.ts +23 -7
- package/taglist/index.mjs +1 -1
- package/unit/index.mjs +1 -0
- package/unit/unit.ts +58 -0
package/mask/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSectionFactory as e,createBaseSections as r,createMaskOverlaySections as a}from"../index.mjs";const l=e("mk"),{outer:
|
|
1
|
+
import{createSectionFactory as e,createBaseSections as r,createMaskOverlaySections as a}from"../index.mjs";const l=e("mk"),{outer:o,wrapper:n,inner:s,label:d,prefix:i,suffix:t,help:p,messages:u,message:y,icon:$}=r(l),{overlayPlaceholder:m,overlayLiteral:b,overlayChar:c,overlayEnum:v,overlay:h,overlayParts:f,overlayInner:x}=a(l),I=l("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}})));export{l as createSection,p as help,$ as icon,s as inner,d as label,I as maskInput,y as message,u as messages,o as outer,h as overlay,c as overlayChar,v as overlayEnum,x as overlayInner,b as overlayLiteral,f as overlayParts,m as overlayPlaceholder,i as prefix,t as suffix,n as wrapper};
|
package/package.json
CHANGED
package/rating/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSectionFactory as e,createBaseSections as t,$if as
|
|
1
|
+
import{createSectionFactory as e,createBaseSections as t,$if as n}from"../index.mjs";const l=e("rt"),{outer:a,wrapper:s,inner:r,label:o,prefix:i,suffix:$,help:d,messages:m,message:f,icon:h}=t(l),u=l("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),p=l("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),c=l("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),g=l("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),v=l("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),x=l("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),I=l("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),b=l("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),w=l("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),y=l("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),_=()=>n("$slots.onItem",(()=>()=>"$slots.onItem"),n("$slots.default",(()=>()=>"$slots.default"),h("rating"))),V=()=>n("$slots.offItem",(()=>()=>"$slots.offItem"),n("$slots.default",(()=>()=>"$slots.default"),h("rating")));export{l as createSection,d as help,h as icon,r as inner,x as input,g as itemLabel,v as itemLabelInner,u as itemsWrapper,o as label,f as message,m as messages,V as offItem,b as offItemRow,y as offItemWrapper,_ as onItem,I as onItemRow,w as onItemWrapper,a as outer,i as prefix,p as ratingItem,$ as suffix,c as template,s as wrapper};
|
package/rating/rating.ts
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { defaultIcon } from '@formkit/inputs'
|
|
2
|
-
import
|
|
2
|
+
import newRate from '../features/rate'
|
|
3
3
|
import { FormKitProInput } from '@formkit/pro'
|
|
4
4
|
import {
|
|
5
5
|
outer,
|
|
6
6
|
wrapper,
|
|
7
7
|
label,
|
|
8
8
|
inner,
|
|
9
|
-
onItems,
|
|
10
|
-
offItems,
|
|
11
9
|
onItem,
|
|
12
10
|
offItem,
|
|
13
|
-
input,
|
|
14
11
|
itemsWrapper,
|
|
15
12
|
help,
|
|
16
13
|
messages,
|
|
14
|
+
ratingItem,
|
|
15
|
+
input,
|
|
17
16
|
message,
|
|
18
17
|
icon,
|
|
19
18
|
prefix,
|
|
19
|
+
itemLabel,
|
|
20
|
+
itemLabelInner,
|
|
21
|
+
template,
|
|
20
22
|
suffix,
|
|
23
|
+
onItemRow,
|
|
24
|
+
offItemRow,
|
|
25
|
+
onItemWrapper,
|
|
26
|
+
offItemWrapper,
|
|
21
27
|
} from '../sections/ratingSections'
|
|
22
28
|
|
|
23
29
|
/**
|
|
@@ -34,8 +40,18 @@ export const rating: FormKitProInput = {
|
|
|
34
40
|
inner(
|
|
35
41
|
icon('prefix'),
|
|
36
42
|
prefix(),
|
|
37
|
-
itemsWrapper(
|
|
38
|
-
|
|
43
|
+
itemsWrapper(
|
|
44
|
+
ratingItem(
|
|
45
|
+
template(
|
|
46
|
+
itemLabel(
|
|
47
|
+
onItemRow(onItemWrapper(onItem())),
|
|
48
|
+
offItemRow(offItemWrapper(offItem())),
|
|
49
|
+
itemLabelInner()
|
|
50
|
+
),
|
|
51
|
+
input()
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
),
|
|
39
55
|
suffix(),
|
|
40
56
|
icon('suffix')
|
|
41
57
|
)
|
|
@@ -54,7 +70,7 @@ export const rating: FormKitProInput = {
|
|
|
54
70
|
/**
|
|
55
71
|
* Additional features that make this input work.
|
|
56
72
|
*/
|
|
57
|
-
features: [
|
|
73
|
+
features: [newRate, defaultIcon('rating', 'star')],
|
|
58
74
|
}
|
|
59
75
|
|
|
60
76
|
export default rating
|
package/taglist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$if as e,createSectionFactory as
|
|
1
|
+
import{$if as e,$attrs as t,createSectionFactory as i,createBaseSections as o}from"../index.mjs";import{icon as a}from"@formkit/inputs";const n=(e,t)=>()=>a(e,t),l=i("tl"),{outer:d,wrapper:s,inner:r,icon:$,label:p,prefix:u,suffix:c,help:g,messages:b,message:x}=o(l),v=l("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",name:"$node.name",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),h=l("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),m=l("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection($activeSelectionValue, $option)"}}))),f=l("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),y=l("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),_=l("tagLabel",(()=>({$el:"span"}))),k=l("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),S=l("tagLoading","span"),w=function(i){const o=i("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),a=i("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),l=i("listitem",(()=>({$el:"li",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),d=i("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),s=i("loadMoreInner","span"),r=i("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),$=i("emptyMessageInner","span"),p=i("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=i("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=i("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),g=i("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),b=i("groupLabel","span"),x=i("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>o(a(r($("$emptyMessage")),u(e("$option.group",g(b("$option.group"),x(c(t((()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'})),l(e("$fns.isSelected($option)",n("selected")),p("$option.label")))))),l(e("$fns.isSelected($option)",n("selected")),p("$option.label")))),d(e("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(e("$state.loading",n("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}(l);export{l as createSection,g as help,$ as icon,r as inner,v as input,p as label,w as listbox,h as listboxButton,x as message,b as messages,d as outer,u as prefix,y as removeSelection,c as suffix,f as tag,_ as tagLabel,S as tagLoading,m as tagWrapper,k as tags,s as wrapper};
|
package/unit/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createSectionFactory as a,createBaseSections as e}from"../index.mjs";const n=a("tb"),{outer:l,inner:d,wrapper:o,label:t,prefix:r,suffix:i,help:u,messages:s,message:$,icon:c}=e(n),p=n("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"off",id:"$id",onClick:"$handlers.handleClick",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",onBlur:"$handlers.handleBlur",onFocus:"$handlers.handleFocus",readonly:"$readonly",disabled:"$disabled",value:"$_displayValue","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));export{n as createSection,u as help,c as icon,d as inner,p as input,t as label,$ as message,s as messages,l as outer,r as prefix,i as suffix,o as wrapper};
|
package/unit/unit.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FormKitProInput } from '@formkit/pro'
|
|
2
|
+
import { options as optionsCore } from '@formkit/inputs'
|
|
3
|
+
import {
|
|
4
|
+
outer,
|
|
5
|
+
inner,
|
|
6
|
+
input,
|
|
7
|
+
wrapper,
|
|
8
|
+
label,
|
|
9
|
+
help,
|
|
10
|
+
messages,
|
|
11
|
+
message,
|
|
12
|
+
prefix,
|
|
13
|
+
suffix,
|
|
14
|
+
icon,
|
|
15
|
+
} from '../sections/unitSections'
|
|
16
|
+
import unitFeatures from '../features/unit'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Input definition for a toggle group input.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export const unit: FormKitProInput = {
|
|
23
|
+
/**
|
|
24
|
+
* The actual schema of the input, or a function that returns the schema.
|
|
25
|
+
*/
|
|
26
|
+
schema: outer(
|
|
27
|
+
wrapper(
|
|
28
|
+
label('$label'),
|
|
29
|
+
inner(
|
|
30
|
+
icon('prefix'),
|
|
31
|
+
prefix(),
|
|
32
|
+
input(),
|
|
33
|
+
suffix(),
|
|
34
|
+
icon('suffix')
|
|
35
|
+
)
|
|
36
|
+
),
|
|
37
|
+
help('$help'),
|
|
38
|
+
messages(message('$message.value'))
|
|
39
|
+
),
|
|
40
|
+
/**
|
|
41
|
+
* The type of node, can be a list, group, or input.
|
|
42
|
+
*/
|
|
43
|
+
type: 'input',
|
|
44
|
+
|
|
45
|
+
family: 'text',
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* An array of extra props to accept for this input.
|
|
49
|
+
*/
|
|
50
|
+
props: [
|
|
51
|
+
'options'
|
|
52
|
+
],
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Additional features that make this input work.
|
|
56
|
+
*/
|
|
57
|
+
features: [unitFeatures, optionsCore],
|
|
58
|
+
}
|