@webority/ui-react 0.139.2 → 0.139.3

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.
@@ -2,7 +2,7 @@
2
2
  "kind": "WeborityWeb",
3
3
  "library": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.139.2"
5
+ "version": "0.139.3"
6
6
  },
7
7
  "rendererProtocolVersion": 13,
8
8
  "platform": "Web",
@@ -20543,6 +20543,13 @@
20543
20543
  "description": "Shows the value but blocks editing. The value still posts.",
20544
20544
  "default": false
20545
20545
  },
20546
+ {
20547
+ "name": "remote",
20548
+ "type": "boolean",
20549
+ "required": false,
20550
+ "description": "Search and tag modes: the page answers each query itself. The element fires its search event (React onSearch) with the query and its number, fetches nothing, and shows the searching row until the page sets options. Leave it off with loadOptions or source.",
20551
+ "default": false
20552
+ },
20546
20553
  {
20547
20554
  "name": "required",
20548
20555
  "type": "boolean",
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "webority-web",
3
- "version": "0.139.2",
3
+ "version": "0.139.3",
4
4
  "platform": "Web",
5
5
  "kitModuleVersion": 2,
6
6
  "rendererProtocolVersion": 13,
7
7
  "library": {
8
8
  "name": "@webority/ui-react",
9
- "version": "0.139.2"
9
+ "version": "0.139.3"
10
10
  },
11
11
  "files": {
12
12
  "manifest.json": {
13
- "sha256": "1ef70c106b711b2abc55ec04939a9bcb95ef92a9b6836e56081301b134f12ce1",
14
- "bytes": 974282
13
+ "sha256": "6c25aa5e2a813c2f27f997ac0ee6b73fbe694e2fba092d2281f24a8c5271aa09",
14
+ "bytes": 974700
15
15
  },
16
16
  "kit.js": {
17
- "sha256": "df400159f88f682e4962aac979c61a68289d8ebfb59e63c1d35ca221ea27f8af",
18
- "bytes": 11152483
17
+ "sha256": "0b18a02936a5807d689cdab0375ef84cdaf07fe5286500382eb61ddcfe2d3257",
18
+ "bytes": 11153339
19
19
  },
20
20
  "kit.css": {
21
21
  "sha256": "13b14f71fb6ea024945f95cba617b4f1d49f44a65ba7c7ed05d2354805539ef6",
@@ -1 +1 @@
1
- import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{loadFlagStyles as n}from"../lib/flagStyles.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import ee from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import te from"./useNodeLabels.js";import ne,{optionsEqual as re}from"./useWuiControl.js";import a from"./warnInvalidValue.js";import ie from"./warnUnknownProps.js";import{forwardRef as o,useEffect as s,useId as ae,useLayoutEffect as c,useMemo as oe,useRef as l}from"react";import{Fragment as se,jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var ce=[`single`,`multiple`,`search`,`tag`,`country`],le=[`comfortable`,`compact`],f=[`sm`,`md`,`lg`],ue=[`off`,`border`,`above`],de=[],p=[],fe=e=>e===`multiple`||e===`tag`,pe=(e,t)=>{let n=t??``;String(e.value??``)!==String(n)&&(e.value=n)},me=(e,t)=>{let n=Array.isArray(t)?t:p,r=Array.isArray(e.value)?e.value:p;n.length===r.length&&n.every((e,t)=>e===r[t])||(e.value=n)},he=(e,t)=>({...e,label:t}),m=e=>Array.isArray(e)?e.join(`,`):e,ge=o(function(o,ge){let{marker:h,props:_e}=r(`AppSelect`,o),{mode:g=`single`,density:_=`comfortable`,size:v,value:ve,defaultValue:y,onChange:b,options:x=de,loadOptions:S,validate:C,placeholder:ye,searchPlaceholder:be,emptyText:xe,searchable:w,clearable:Se=!1,icon:Ce,valuePrefix:T,prefix:E,suffix:D,floatingLabel:O=`off`,disabled:we,readOnly:Te=!1,loading:Ee=!1,open:De,label:k,required:A=!1,optional:j=!1,optionalLabel:M=`(optional)`,error:N,helperText:P,help:F,helpLabel:Oe=`More information`,id:ke,name:Ae,minChars:I,debounce:L,allowCustom:je=!1,addLabel:Me,searchingText:Ne,hintText:Pe,valueLabel:Fe,valueAvatar:Ie,valueInitials:Le,maxTags:R,allowDuplicates:Re=!1,separators:ze,pattern:Be,invalidMessage:Ve,createLabel:He,collapseChips:Ue=!1,selectedText:We,clearAllLabel:Ge,countries:Ke,suggested:qe,suggestedLabel:Je,allCountriesLabel:Ye,className:Xe=``,fieldClassName:z=``,"aria-label":Ze,"aria-labelledby":Qe,"aria-describedby":$e,...B}=_e;ie(`AppSelect`,B),a(`AppSelect`,`mode`,g,ce),a(`AppSelect`,`density`,_,le),a(`AppSelect`,`size`,v,f);let V=fe(g);a(`AppSelect`,`floatingLabel`,O,V?[`off`]:ue);let H=l(!1);V&&(E!=null||D!=null)&&!H.current&&(H.current=!0,e(`AppSelect: prefix and suffix are not drawn in mode="${g}"; they are ignored.`));let et=ae(),U=l(!1);s(()=>{g===`country`&&n()},[g]);let{setRef:tt,innerRef:W}=ne({ref:ge,value:ve??(y===void 0?V?p:``:void 0),defaultValue:y,writeValue:V?me:pe,on:{change:e=>{let t=e.currentTarget.value;g===`search`||g===`tag`?b?.(t,{isCustom:!!e.detail?.isCustom}):b?.(t)}}}),G=oe(()=>typeof S==`function`?(e,t)=>new Promise(n=>n(S(e,t))).then(e=>(U.current=!0,e),e=>{throw U.current=!0,e}):null,[S]),{portal:nt,toElementOptions:K}=te(x),q=l({el:null,options:null,map:null});c(()=>{let e=W.current;if(!e||q.current.el===e&&q.current.options===x&&q.current.map===K||(q.current={el:e,options:x,map:K},S&&U.current))return;let t=K(x,he);re(t,e.options)||(e.options=t)}),c(()=>{let e=W.current;if(!e)return;e.loadOptions!==G&&(e.loadOptions=G);let t=typeof C==`function`?C:null;e.validate!==t&&(e.validate=t)}),c(()=>{W.current?.toggleAttribute(`loading`,!!Ee)});let J=ke||et,Y=!V&&O!==`off`&&k,X=N&&J?`${J}-error`:void 0,Z=P&&J?`${J}-hint`:void 0,rt=X||Z||$e;s(()=>{let e=W.current;e&&(T==null||T===``?e.removeAttribute(`prefix`):e.setAttribute(`prefix`,T))},[T,W]);let it=!V&&!Y&&(E!=null||D!=null),Q=g!==`multiple`&&g!==`tag`&&g!==`country`&&!k&&!N&&!P&&!z,at=/* @__PURE__ */ u(`wui-select`,{"aria-label":Ze||(typeof k==`string`?k:void 0),"aria-labelledby":Qe||void 0,"aria-describedby":rt||void 0,"aria-invalid":N?`true`:void 0,ref:tt,id:J,name:Ae,mode:g,density:_===`compact`?`compact`:void 0,placeholder:Y?` `:ye||void 0,"search-placeholder":be||void 0,"empty-text":xe||void 0,searchable:w===void 0?void 0:w?`true`:`false`,clearable:Se?``:void 0,size:v!==`md`&&f.includes(v)?v:void 0,icon:Ce||void 0,disabled:we?``:void 0,readonly:Te?``:void 0,open:De?``:void 0,required:A?``:void 0,"min-chars":I==null?void 0:String(I),debounce:L==null?void 0:String(L),"allow-custom":je?``:void 0,"add-label":Me||void 0,"searching-text":Ne||void 0,"hint-text":Pe||void 0,"value-label":Fe||void 0,"value-avatar":Ie||void 0,"value-initials":Le||void 0,"max-tags":R==null?void 0:String(R),"allow-duplicates":Re?``:void 0,separators:ze||void 0,pattern:Be||void 0,"invalid-message":Ve||void 0,"create-label":He||void 0,"collapse-chips":Ue?``:void 0,"selected-text":We||void 0,"clear-all-label":Ge||void 0,countries:m(Ke)||void 0,suggested:m(qe)||void 0,"suggested-label":Je||void 0,"all-countries-label":Ye||void 0,className:Xe||void 0,...Q&&!it?h:null,...B}),$=/* @__PURE__ */ d(se,{children:[at,nt]}),ot=it?/* @__PURE__ */ d(`div`,{...Q?h:null,className:`input-affixed`,children:[E!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-pre`,children:E}),$,D!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-suf`,children:D})]}):$;if(Q)return ot;let st=[`field`,z].filter(Boolean).join(` `);return/* @__PURE__ */ d(`div`,{...h,className:st,children:[k&&!Y&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:J,children:[k,j&&!A&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${M}`}),A&&/* @__PURE__ */ u(i,{}),F&&/* @__PURE__ */ u(ee,{label:Oe,children:F})]}),Y?/* @__PURE__ */ d(`div`,{className:O===`above`?`field-float wui-float-above`:`field-float`,children:[$,/* @__PURE__ */ d(`label`,{className:`float-label`,htmlFor:J,children:[k,j&&!A&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${M}`}),A&&/* @__PURE__ */ u(i,{})]})]}):ot,/* @__PURE__ */ u(t,{error:N,hint:P,errorId:X,hintId:Z})]})});export{ge as default};
1
+ import{devWarn as e}from"../lib/devWarn.js";import t from"../lib/FieldMessage.js";import{loadFlagStyles as n}from"../lib/flagStyles.js";import{splitMarkerProps as r}from"../lib/wuiMarker.js";import ee from"./AppInfoTip.js";import i from"./AppRequiredMark.js";import te from"./useNodeLabels.js";import ne,{optionsEqual as re}from"./useWuiControl.js";import a from"./warnInvalidValue.js";import ie from"./warnUnknownProps.js";import{forwardRef as o,useEffect as s,useId as ae,useLayoutEffect as c,useMemo as oe,useRef as l}from"react";import{Fragment as se,jsx as u,jsxs as d}from"react/jsx-runtime";import"@webority/ui-elements/elements/select";var ce=[`single`,`multiple`,`search`,`tag`,`country`],le=[`comfortable`,`compact`],f=[`sm`,`md`,`lg`],ue=[`off`,`border`,`above`],de=[],p=[],fe=e=>e===`multiple`||e===`tag`,pe=(e,t)=>{let n=t??``;String(e.value??``)!==String(n)&&(e.value=n)},me=(e,t)=>{let n=Array.isArray(t)?t:p,r=Array.isArray(e.value)?e.value:p;n.length===r.length&&n.every((e,t)=>e===r[t])||(e.value=n)},he=(e,t)=>({...e,label:t}),m=e=>Array.isArray(e)?e.join(`,`):e,h=o(function(o,h){let{marker:g,props:ge}=r(`AppSelect`,o),{mode:_=`single`,density:v=`comfortable`,size:y,value:_e,defaultValue:b,onChange:x,options:S=de,loadOptions:C,remote:ve=!1,onSearch:ye,validate:be,placeholder:xe,searchPlaceholder:Se,emptyText:Ce,searchable:w,clearable:we=!1,icon:Te,valuePrefix:T,prefix:E,suffix:D,floatingLabel:O=`off`,disabled:Ee,readOnly:De=!1,loading:Oe=!1,open:ke,label:k,required:A=!1,optional:j=!1,optionalLabel:M=`(optional)`,error:N,helperText:P,help:F,helpLabel:Ae=`More information`,id:je,name:Me,minChars:I,debounce:L,allowCustom:Ne=!1,addLabel:Pe,searchingText:Fe,hintText:Ie,valueLabel:Le,valueAvatar:Re,valueInitials:ze,maxTags:R,allowDuplicates:Be=!1,separators:Ve,pattern:He,invalidMessage:Ue,createLabel:We,collapseChips:Ge=!1,selectedText:Ke,clearAllLabel:qe,countries:Je,suggested:Ye,suggestedLabel:Xe,allCountriesLabel:Ze,className:Qe=``,fieldClassName:z=``,"aria-label":$e,"aria-labelledby":et,"aria-describedby":tt,...B}=ge;ie(`AppSelect`,B),a(`AppSelect`,`mode`,_,ce),a(`AppSelect`,`density`,v,le),a(`AppSelect`,`size`,y,f);let V=fe(_);a(`AppSelect`,`floatingLabel`,O,V?[`off`]:ue);let H=l(!1);V&&(E!=null||D!=null)&&!H.current&&(H.current=!0,e(`AppSelect: prefix and suffix are not drawn in mode="${_}"; they are ignored.`));let nt=ae(),U=l(!1);s(()=>{_===`country`&&n()},[_]);let{setRef:rt,innerRef:W}=ne({ref:h,value:_e??(b===void 0?V?p:``:void 0),defaultValue:b,writeValue:V?me:pe,on:{change:e=>{let t=e.currentTarget.value;_===`search`||_===`tag`?x?.(t,{isCustom:!!e.detail?.isCustom}):x?.(t)},search:e=>{ve&&typeof C!=`function`&&ye?.(e.detail.query,{seq:e.detail.seq})}}}),G=oe(()=>typeof C==`function`?(e,t)=>new Promise(n=>n(C(e,t))).then(e=>(U.current=!0,e),e=>{throw U.current=!0,e}):null,[C]),{portal:it,toElementOptions:K}=te(S),q=l({el:null,options:null,map:null});c(()=>{let e=W.current;if(!e||q.current.el===e&&q.current.options===S&&q.current.map===K||(q.current={el:e,options:S,map:K},C&&U.current))return;let t=K(S,he);re(t,e.options)||(e.options=t)}),c(()=>{let e=W.current;if(!e)return;e.loadOptions!==G&&(e.loadOptions=G);let t=typeof be==`function`?be:null;e.validate!==t&&(e.validate=t)}),c(()=>{W.current?.toggleAttribute(`loading`,!!Oe)});let J=je||nt,Y=!V&&O!==`off`&&k,X=N&&J?`${J}-error`:void 0,at=P&&J?`${J}-hint`:void 0,ot=X||at||tt;s(()=>{let e=W.current;e&&(T==null||T===``?e.removeAttribute(`prefix`):e.setAttribute(`prefix`,T))},[T,W]);let st=!V&&!Y&&(E!=null||D!=null),Z=_!==`multiple`&&_!==`tag`&&_!==`country`&&!k&&!N&&!P&&!z,ct=/* @__PURE__ */ u(`wui-select`,{"aria-label":$e||(typeof k==`string`?k:void 0),"aria-labelledby":et||void 0,"aria-describedby":ot||void 0,"aria-invalid":N?`true`:void 0,ref:rt,id:J,name:Me,mode:_,density:v===`compact`?`compact`:void 0,placeholder:Y?` `:xe||void 0,"search-placeholder":Se||void 0,"empty-text":Ce||void 0,searchable:w===void 0?void 0:w?`true`:`false`,clearable:we?``:void 0,size:y!==`md`&&f.includes(y)?y:void 0,icon:Te||void 0,disabled:Ee?``:void 0,readonly:De?``:void 0,open:ke?``:void 0,required:A?``:void 0,"min-chars":I==null?void 0:String(I),debounce:L==null?void 0:String(L),remote:ve?``:void 0,"allow-custom":Ne?``:void 0,"add-label":Pe||void 0,"searching-text":Fe||void 0,"hint-text":Ie||void 0,"value-label":Le||void 0,"value-avatar":Re||void 0,"value-initials":ze||void 0,"max-tags":R==null?void 0:String(R),"allow-duplicates":Be?``:void 0,separators:Ve||void 0,pattern:He||void 0,"invalid-message":Ue||void 0,"create-label":We||void 0,"collapse-chips":Ge?``:void 0,"selected-text":Ke||void 0,"clear-all-label":qe||void 0,countries:m(Je)||void 0,suggested:m(Ye)||void 0,"suggested-label":Xe||void 0,"all-countries-label":Ze||void 0,className:Qe||void 0,...Z&&!st?g:null,...B}),Q=/* @__PURE__ */ d(se,{children:[ct,it]}),$=st?/* @__PURE__ */ d(`div`,{...Z?g:null,className:`input-affixed`,children:[E!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-pre`,children:E}),Q,D!=null&&/* @__PURE__ */ u(`span`,{className:`affix affix-suf`,children:D})]}):Q;if(Z)return $;let lt=[`field`,z].filter(Boolean).join(` `);return/* @__PURE__ */ d(`div`,{...g,className:lt,children:[k&&!Y&&/* @__PURE__ */ d(`label`,{className:`label`,htmlFor:J,children:[k,j&&!A&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${M}`}),A&&/* @__PURE__ */ u(i,{}),F&&/* @__PURE__ */ u(ee,{label:Ae,children:F})]}),Y?/* @__PURE__ */ d(`div`,{className:O===`above`?`field-float wui-float-above`:`field-float`,children:[Q,/* @__PURE__ */ d(`label`,{className:`float-label`,htmlFor:J,children:[k,j&&!A&&/* @__PURE__ */ u(`span`,{className:`label-optional`,children:` ${M}`}),A&&/* @__PURE__ */ u(i,{})]})]}):$,/* @__PURE__ */ u(t,{error:N,hint:P,errorId:X,hintId:at})]})});export{h as default};
@@ -2,7 +2,7 @@
2
2
  "format": "webority-guidance/1",
3
3
  "package": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.139.2"
5
+ "version": "0.139.3"
6
6
  },
7
7
  "components": [
8
8
  {
@@ -45,6 +45,14 @@ declare const AppSelect: import("react").ForwardRefExoticComponent<{
45
45
  value: string;
46
46
  label: string;
47
47
  }>>;
48
+ /**
49
+ * Search and tag modes: the page answers each query itself. The element fires its search event (React onSearch) with the query and its number, fetches nothing, and shows the searching row until the page sets options. Leave it off with loadOptions or source.
50
+ * @default false
51
+ */
52
+ remote?: boolean;
53
+ onSearch?: (query: string, meta: {
54
+ seq: number;
55
+ }) => void;
48
56
  validate?: (value: string) => true | string;
49
57
  /** The text in the empty field. Left unset, the element's default for the mode applies: Select… in single, search and multiple, Add… in tag, Select country in country. */
50
58
  placeholder?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.139.2",
3
+ "version": "0.139.3",
4
4
  "description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -29,10 +29,10 @@
29
29
  },
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
- "@webority/markdown-core": "0.139.2",
33
- "@webority/theme": "0.139.2",
34
- "@webority/ui-elements": "0.139.2",
35
- "@webority/web-core": "0.139.2"
32
+ "@webority/markdown-core": "0.139.3",
33
+ "@webority/theme": "0.139.3",
34
+ "@webority/ui-elements": "0.139.3",
35
+ "@webority/web-core": "0.139.3"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@webority/analytics": "^0.35.0",
@@ -50,8 +50,8 @@
50
50
  "@vitejs/plugin-react": "^6.0.1",
51
51
  "@vitest/coverage-v8": "5.0.1",
52
52
  "@webority/analytics": "0.35.1",
53
- "@webority/canvas-kit": "0.139.2",
54
- "@webority/tokens": "0.139.2",
53
+ "@webority/canvas-kit": "0.139.3",
54
+ "@webority/tokens": "0.139.3",
55
55
  "bootstrap": "5.3.3",
56
56
  "jsdom": "30.1.1",
57
57
  "react": "^19.2.6",