@webority/ui-react 0.101.5 → 0.102.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/dist/canvas-kit/kit.js +18488 -18124
- package/dist/canvas-kit/manifest.json +191 -1
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppContextMenu.js +1 -1
- package/dist/components/AppDueDate.js +1 -1
- package/dist/components/AppPageHeader.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/types/components/AppContextMenu.d.ts +18 -1
- package/dist/types/components/AppDueDate.d.ts +15 -1
- package/dist/types/components/AppPageHeader.d.ts +3 -0
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"kind": "WeborityWeb",
|
|
3
3
|
"library": {
|
|
4
4
|
"name": "@webority/ui-react",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.102.0"
|
|
6
6
|
},
|
|
7
7
|
"rendererProtocolVersion": 12,
|
|
8
8
|
"platform": "Web",
|
|
@@ -5750,6 +5750,12 @@
|
|
|
5750
5750
|
"name": "items",
|
|
5751
5751
|
"type": "array",
|
|
5752
5752
|
"itemFields": [
|
|
5753
|
+
{
|
|
5754
|
+
"name": "checked",
|
|
5755
|
+
"type": "boolean",
|
|
5756
|
+
"required": false,
|
|
5757
|
+
"description": "Shows a check mark beside the label, for a selection."
|
|
5758
|
+
},
|
|
5753
5759
|
{
|
|
5754
5760
|
"name": "danger",
|
|
5755
5761
|
"type": "boolean",
|
|
@@ -5768,6 +5774,12 @@
|
|
|
5768
5774
|
"required": false,
|
|
5769
5775
|
"description": "Draws a separator; the row then needs only its key."
|
|
5770
5776
|
},
|
|
5777
|
+
{
|
|
5778
|
+
"name": "hint",
|
|
5779
|
+
"type": "string",
|
|
5780
|
+
"required": false,
|
|
5781
|
+
"description": "Muted text after the label, such as a keyboard shortcut."
|
|
5782
|
+
},
|
|
5771
5783
|
{
|
|
5772
5784
|
"name": "icon",
|
|
5773
5785
|
"type": "icon",
|
|
@@ -5780,6 +5792,12 @@
|
|
|
5780
5792
|
"required": false,
|
|
5781
5793
|
"description": "A picture URL shown instead of the icon."
|
|
5782
5794
|
},
|
|
5795
|
+
{
|
|
5796
|
+
"name": "items",
|
|
5797
|
+
"type": "array",
|
|
5798
|
+
"required": false,
|
|
5799
|
+
"description": "Makes the row open a side menu of these rows, in the same item model."
|
|
5800
|
+
},
|
|
5783
5801
|
{
|
|
5784
5802
|
"name": "key",
|
|
5785
5803
|
"type": "string",
|
|
@@ -5792,6 +5810,25 @@
|
|
|
5792
5810
|
"required": false,
|
|
5793
5811
|
"description": "The row's text."
|
|
5794
5812
|
},
|
|
5813
|
+
{
|
|
5814
|
+
"name": "searchPlaceholder",
|
|
5815
|
+
"type": "string",
|
|
5816
|
+
"required": false,
|
|
5817
|
+
"description": "The placeholder of the filter field on a searchable side menu.",
|
|
5818
|
+
"default": "Search"
|
|
5819
|
+
},
|
|
5820
|
+
{
|
|
5821
|
+
"name": "searchable",
|
|
5822
|
+
"type": "boolean",
|
|
5823
|
+
"required": false,
|
|
5824
|
+
"description": "On a row with items, puts a filter field at the top of its side menu."
|
|
5825
|
+
},
|
|
5826
|
+
{
|
|
5827
|
+
"name": "shortcut",
|
|
5828
|
+
"type": "string",
|
|
5829
|
+
"required": false,
|
|
5830
|
+
"description": "The key that runs the row, such as E, drawn as a key chip at the end of the row. The page binds the key itself."
|
|
5831
|
+
},
|
|
5795
5832
|
{
|
|
5796
5833
|
"name": "to",
|
|
5797
5834
|
"type": "string",
|
|
@@ -5821,6 +5858,12 @@
|
|
|
5821
5858
|
"type": "string",
|
|
5822
5859
|
"required": false,
|
|
5823
5860
|
"description": "CSS selector of the elements the menu serves. Without it, the menu serves `children`."
|
|
5861
|
+
},
|
|
5862
|
+
{
|
|
5863
|
+
"name": "trigger",
|
|
5864
|
+
"type": "string",
|
|
5865
|
+
"required": false,
|
|
5866
|
+
"description": "A CSS selector inside the region: a click or Enter on a match opens the menu under it."
|
|
5824
5867
|
}
|
|
5825
5868
|
],
|
|
5826
5869
|
"itemsTakeAction": [
|
|
@@ -6306,6 +6349,89 @@
|
|
|
6306
6349
|
{
|
|
6307
6350
|
"name": "columns",
|
|
6308
6351
|
"type": "array",
|
|
6352
|
+
"itemFields": [
|
|
6353
|
+
{
|
|
6354
|
+
"name": "align",
|
|
6355
|
+
"type": "enum",
|
|
6356
|
+
"enum": [
|
|
6357
|
+
"center",
|
|
6358
|
+
"end",
|
|
6359
|
+
"num"
|
|
6360
|
+
],
|
|
6361
|
+
"required": false,
|
|
6362
|
+
"description": "Aligns the cells: num right-aligns figures in tabular digits."
|
|
6363
|
+
},
|
|
6364
|
+
{
|
|
6365
|
+
"name": "cellClassName",
|
|
6366
|
+
"type": "string",
|
|
6367
|
+
"required": false,
|
|
6368
|
+
"description": "A class added to every cell in the column."
|
|
6369
|
+
},
|
|
6370
|
+
{
|
|
6371
|
+
"name": "cellStyle",
|
|
6372
|
+
"type": "object",
|
|
6373
|
+
"required": false,
|
|
6374
|
+
"description": "Inline styles added to every cell in the column."
|
|
6375
|
+
},
|
|
6376
|
+
{
|
|
6377
|
+
"name": "grow",
|
|
6378
|
+
"type": "boolean",
|
|
6379
|
+
"required": false,
|
|
6380
|
+
"description": "Gives this column the spare width."
|
|
6381
|
+
},
|
|
6382
|
+
{
|
|
6383
|
+
"name": "hideable",
|
|
6384
|
+
"type": "boolean",
|
|
6385
|
+
"required": false,
|
|
6386
|
+
"description": "Lets the person hide this column from the column menu."
|
|
6387
|
+
},
|
|
6388
|
+
{
|
|
6389
|
+
"name": "key",
|
|
6390
|
+
"type": "string",
|
|
6391
|
+
"required": true,
|
|
6392
|
+
"description": "The row field this column reads."
|
|
6393
|
+
},
|
|
6394
|
+
{
|
|
6395
|
+
"name": "label",
|
|
6396
|
+
"type": "node",
|
|
6397
|
+
"required": true,
|
|
6398
|
+
"description": "The column heading."
|
|
6399
|
+
},
|
|
6400
|
+
{
|
|
6401
|
+
"name": "minWidth",
|
|
6402
|
+
"type": "stringOrNumber",
|
|
6403
|
+
"required": false,
|
|
6404
|
+
"description": "The narrowest the column may shrink, in px or a CSS length."
|
|
6405
|
+
},
|
|
6406
|
+
{
|
|
6407
|
+
"name": "nowrap",
|
|
6408
|
+
"type": "boolean",
|
|
6409
|
+
"required": false,
|
|
6410
|
+
"description": "Keeps each cell on one line."
|
|
6411
|
+
},
|
|
6412
|
+
{
|
|
6413
|
+
"name": "pin",
|
|
6414
|
+
"type": "enum",
|
|
6415
|
+
"enum": [
|
|
6416
|
+
"end",
|
|
6417
|
+
"start"
|
|
6418
|
+
],
|
|
6419
|
+
"required": false,
|
|
6420
|
+
"description": "Keeps the column in view at the start or end while the table scrolls sideways."
|
|
6421
|
+
},
|
|
6422
|
+
{
|
|
6423
|
+
"name": "sortable",
|
|
6424
|
+
"type": "boolean",
|
|
6425
|
+
"required": false,
|
|
6426
|
+
"description": "Lets the heading sort the rows by this column."
|
|
6427
|
+
},
|
|
6428
|
+
{
|
|
6429
|
+
"name": "width",
|
|
6430
|
+
"type": "stringOrNumber",
|
|
6431
|
+
"required": false,
|
|
6432
|
+
"description": "The column's width, in px or a CSS length."
|
|
6433
|
+
}
|
|
6434
|
+
],
|
|
6309
6435
|
"required": true,
|
|
6310
6436
|
"description": "The columns, each an object with a key and a label, plus optional settings such as sortable, hideable, pin, align and grow."
|
|
6311
6437
|
},
|
|
@@ -7756,6 +7882,13 @@
|
|
|
7756
7882
|
"required": false,
|
|
7757
7883
|
"description": "The due date: an ISO date or date-time string, or epoch milliseconds, read in India Standard Time."
|
|
7758
7884
|
},
|
|
7885
|
+
{
|
|
7886
|
+
"name": "icon",
|
|
7887
|
+
"type": "boolean",
|
|
7888
|
+
"required": false,
|
|
7889
|
+
"description": "Draws a calendar glyph before the date text in every dated state.",
|
|
7890
|
+
"default": false
|
|
7891
|
+
},
|
|
7759
7892
|
{
|
|
7760
7893
|
"name": "overdue",
|
|
7761
7894
|
"type": "boolean",
|
|
@@ -7774,6 +7907,17 @@
|
|
|
7774
7907
|
"type": "number",
|
|
7775
7908
|
"required": false,
|
|
7776
7909
|
"description": "Within this many days of the date, the text reads \"N days left\" in warning."
|
|
7910
|
+
},
|
|
7911
|
+
{
|
|
7912
|
+
"name": "soonWording",
|
|
7913
|
+
"type": "enum",
|
|
7914
|
+
"enum": [
|
|
7915
|
+
"days",
|
|
7916
|
+
"due"
|
|
7917
|
+
],
|
|
7918
|
+
"required": false,
|
|
7919
|
+
"description": "Within soonDays, \"days\" reads \"N days left\"; \"due\" reads \"Due today\", \"Due tomorrow\" or \"Due in N days\".",
|
|
7920
|
+
"default": "days"
|
|
7777
7921
|
}
|
|
7778
7922
|
],
|
|
7779
7923
|
"itemsTakeAction": [],
|
|
@@ -13384,6 +13528,12 @@
|
|
|
13384
13528
|
"required": true,
|
|
13385
13529
|
"description": "Rendered as the screen heading."
|
|
13386
13530
|
},
|
|
13531
|
+
{
|
|
13532
|
+
"name": "titleSlot",
|
|
13533
|
+
"type": "node",
|
|
13534
|
+
"required": false,
|
|
13535
|
+
"description": "Rendered inside the heading in place of title, for a title with a badge or a link in it. The heading is then named by title."
|
|
13536
|
+
},
|
|
13387
13537
|
{
|
|
13388
13538
|
"name": "tone",
|
|
13389
13539
|
"type": "enum",
|
|
@@ -18485,6 +18635,46 @@
|
|
|
18485
18635
|
{
|
|
18486
18636
|
"name": "results",
|
|
18487
18637
|
"type": "array",
|
|
18638
|
+
"itemFields": [
|
|
18639
|
+
{
|
|
18640
|
+
"name": "hits",
|
|
18641
|
+
"type": "array",
|
|
18642
|
+
"itemFields": [
|
|
18643
|
+
{
|
|
18644
|
+
"name": "href",
|
|
18645
|
+
"type": "url",
|
|
18646
|
+
"required": true,
|
|
18647
|
+
"description": "Where the suggestion goes."
|
|
18648
|
+
},
|
|
18649
|
+
{
|
|
18650
|
+
"name": "icon",
|
|
18651
|
+
"type": "icon",
|
|
18652
|
+
"required": false,
|
|
18653
|
+
"description": "An icon before the title."
|
|
18654
|
+
},
|
|
18655
|
+
{
|
|
18656
|
+
"name": "subtitle",
|
|
18657
|
+
"type": "string",
|
|
18658
|
+
"required": false,
|
|
18659
|
+
"description": "A second line under the title."
|
|
18660
|
+
},
|
|
18661
|
+
{
|
|
18662
|
+
"name": "title",
|
|
18663
|
+
"type": "string",
|
|
18664
|
+
"required": true,
|
|
18665
|
+
"description": "The suggestion's text."
|
|
18666
|
+
}
|
|
18667
|
+
],
|
|
18668
|
+
"required": true,
|
|
18669
|
+
"description": "The suggestions in the group."
|
|
18670
|
+
},
|
|
18671
|
+
{
|
|
18672
|
+
"name": "label",
|
|
18673
|
+
"type": "string",
|
|
18674
|
+
"required": false,
|
|
18675
|
+
"description": "The group heading."
|
|
18676
|
+
}
|
|
18677
|
+
],
|
|
18488
18678
|
"required": false,
|
|
18489
18679
|
"nullable": true,
|
|
18490
18680
|
"description": "Suggestion groups, each with a label and its hits. Null hides the list."
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webority-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.102.0",
|
|
4
4
|
"platform": "Web",
|
|
5
5
|
"kitModuleVersion": 2,
|
|
6
6
|
"rendererProtocolVersion": 12,
|
|
7
7
|
"library": {
|
|
8
8
|
"name": "@webority/ui-react",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.102.0"
|
|
10
10
|
},
|
|
11
11
|
"files": {
|
|
12
12
|
"manifest.json": {
|
|
13
|
-
"sha256": "
|
|
14
|
-
"bytes":
|
|
13
|
+
"sha256": "574a750ea887438b4198cf70342152675dd4bec0229b1e545c502911988c7d91",
|
|
14
|
+
"bytes": 850905
|
|
15
15
|
},
|
|
16
16
|
"kit.js": {
|
|
17
|
-
"sha256": "
|
|
18
|
-
"bytes":
|
|
17
|
+
"sha256": "a351946943375d06b7b715b5a56c23fe43a7f9a4a2e54ce26e0e32582bceacd9",
|
|
18
|
+
"bytes": 10876977
|
|
19
19
|
},
|
|
20
20
|
"kit.css": {
|
|
21
21
|
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import n from"./renderIconProp.js";import{useEffect as
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnUnknownProps.js";import{shortcutAria as n,shortcutChip as r}from"../lib/shortcutChip.js";import i from"./renderIconProp.js";import{useEffect as a,useLayoutEffect as o,useRef as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import"@webority/ui-elements/elements/context-menu";function u(n){let{items:r=[],target:i,trigger:u,children:d,ariaLabel:p=`Context menu`,disabled:m=!1,open:h,onOpen:g,onBeforeOpen:_,menuClassName:v=``,linkComponent:y,...b}=n;t(`AppContextMenu`,b);let x=s(null);return a(()=>{let e=x.current;if(!g)return;let t=e=>g(e.detail);return e.addEventListener(`wui-context-menu:open`,t),()=>e.removeEventListener(`wui-context-menu:open`,t)},[g]),a(()=>{let e=x.current;if(_)return e.addEventListener(`wui-context-menu:beforeopen`,_),()=>e.removeEventListener(`wui-context-menu:beforeopen`,_)},[_]),o(()=>{x.current.toggleAttribute(`open`,!!h)},[h]),l(`wui-context-menu`,{ref:x,target:i,trigger:u,disabled:m,...e(`AppContextMenu`,n),...b,children:[d,c(`div`,{className:`dropdown-menu wui-context-menu-panel${v?` ${v}`:``}`,role:`menu`,"aria-label":p,tabIndex:-1,children:f(r,y)})]})}var d=e=>`dropdown-item${e.danger?` danger`:``}${e.disabled?` disabled`:``}`;function f(e,t){return e.map(e=>{if(e.divider)return c(`hr`,{className:`dropdown-divider`},e.key);if(e.items!=null){let n=e.searchPlaceholder||`Search`;return l(`div`,{className:`wui-context-menu-sub`,role:`none`,"data-searchable":e.searchable?``:void 0,children:[l(`button`,{type:`button`,className:d(e),role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":`false`,tabIndex:-1,"data-key":e.key,"aria-disabled":e.disabled?`true`:void 0,children:[i(e.icon,{size:16}),e.label,i(`chevron-right`,{size:14,className:`wui-context-menu-chevron`})]}),l(`div`,{className:`dropdown-menu wui-context-menu-subpanel`,role:`menu`,"aria-label":e.label,tabIndex:-1,children:[e.searchable?c(`input`,{type:`search`,className:`wui-context-menu-search`,autoComplete:`off`,placeholder:n,"aria-label":n}):null,f(e.items,t)]})]},e.key)}let a=!!e.to&&!e.disabled;return l(a?t??`a`:`button`,{...a?t?{to:e.to}:{href:e.to}:{type:`button`},className:d(e),role:`menuitem`,tabIndex:-1,"data-key":e.key,"aria-checked":e.checked?`true`:void 0,"data-hint":e.hint||void 0,"aria-keyshortcuts":n(e.shortcut),"aria-disabled":e.disabled?`true`:void 0,onClick:e.disabled?void 0:e.onClick,children:[e.image?c(`img`,{src:e.image,alt:``}):i(e.icon,{size:16}),e.label,r(e.shortcut)]},e.key)})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{formatDate as i,toInstant as a}from"@webority/ui-elements/helpers";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=864e5,l=330*6e4,u=14,d=[`days`,`due`],f=e=>Math.floor((e+l)/c),p=(...e)=>e.filter(Boolean).join(` `),m=(e,t)=>e===`due`?t===0?`Due today`:t===1?`Due tomorrow`:`Due in ${t} days`:t===1?`1 day left`:`${t} days left`;function h(l){let{date:h,soonDays:g,soonWording:_=`days`,icon:v=!1,overdue:y=!1,overdueLabel:b,className:x=``,...S}=l;n(`AppDueDate`,S),t(`AppDueDate`,`soonWording`,_,d);let C=a(h);if(!Number.isFinite(C))return o(`wui-due-date`,{class:p(`wui-due-date`,`wui-due-date-empty`,x),...e(`AppDueDate`,l),...S,children:o(`time`,{children:`Not set`})});let w=f(C),T=new Date(w*c).toISOString().slice(0,10),E=w-f(Date.now()),D=v?o(r,{name:`calendar`,size:u}):null;if(y){let t=i(C);return s(`wui-due-date`,{class:p(`wui-due-date`,`wui-due-date-danger`,x),title:`Overdue since ${t}`,...e(`AppDueDate`,l),...S,children:[o(r,{name:`danger`,size:u}),D,o(`time`,{dateTime:T,children:b||t})]})}return Number.isFinite(g)&&E>=0&&E<=g?s(`wui-due-date`,{class:p(`wui-due-date`,`wui-due-date-warning`,x),...e(`AppDueDate`,l),...S,children:[D,o(`time`,{dateTime:T,children:m(_,E)})]}):s(`wui-due-date`,{class:p(`wui-due-date`,x),...e(`AppDueDate`,l),...S,children:[D,o(`time`,{dateTime:T,children:i(C)})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{BreadcrumbTrailContext as i}from"./AppBreadcrumbs.js";import{formatNumber as a}from"@webority/ui-elements/helpers";import{useEffect as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`primary`,`success`,`warning`,`danger`,`info`],d=[`sm`,`md`,`lg`,`bar`],f=[`start`,`center`],p=[`inline`,`below`],m=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function h(h){let{title:g,as:
|
|
1
|
+
import{wuiMarkerAttributes as e}from"../lib/wuiMarker.js";import t from"./warnInvalidValue.js";import n from"./warnUnknownProps.js";import r from"./AppIcon.js";import{BreadcrumbTrailContext as i}from"./AppBreadcrumbs.js";import{formatNumber as a}from"@webority/ui-elements/helpers";import{useEffect as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";var u=[`primary`,`success`,`warning`,`danger`,`info`],d=[`sm`,`md`,`lg`,`bar`],f=[`start`,`center`],p=[`inline`,`below`],m=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function h(h){let{title:g,titleSlot:_,as:v=`h1`,subtitle:y,eyebrow:b,icon:x,tone:S=`primary`,status:C,breadcrumbs:w,actions:T,views:E,tools:D,meta:O,metaPlacement:k=`inline`,bulkFor:A,bulk:j,size:M=`md`,align:N=`start`,divider:P=!1,sticky:F=!1,className:I=``,...L}=h;n(`AppPageHeader`,L),t(`AppPageHeader`,`tone`,S,u),t(`AppPageHeader`,`size`,M,d),t(`AppPageHeader`,`align`,N,f),t(`AppPageHeader`,`as`,v,m),t(`AppPageHeader`,`metaPlacement`,k,p);let R=m.includes(v)?v:`h1`,z=M===`bar`,B=z&&k===`below`,V=[`page-header`,M&&M!==`md`?`page-header-${M}`:``,N===`center`?`page-header-center`:``,P?`page-header-divider`:``,F?`page-header-sticky`:``,S&&S!==`primary`?`tone-${S}`:``,B?`wui-page-header-meta-below`:``,I].filter(Boolean).join(` `),[H,U]=s(0),W=z?A:void 0;o(()=>{if(!W)return;document.getElementById(W)?.setAttribute(`data-wui-bulk-in-bar`,``);let e=e=>{typeof e.detail?.selected==`number`&&document.getElementById(W)?.contains(e.target)&&U(e.detail.selected)};return document.addEventListener(`selectionchange`,e),()=>{document.removeEventListener(`selectionchange`,e),document.getElementById(W)?.removeAttribute(`data-wui-bulk-in-bar`)}},[W]);let G=g!=null||_!=null?c(R,{className:_==null?`page-title`:`page-title wui-page-title-slot`,"aria-label":_!=null&&typeof g==`string`&&g!==``?g:void 0,children:_??g}):null;if(z)return l(`header`,{className:V,"data-wui-page-header-bar":``,"data-wui-bulk-for":A||void 0,...e(`AppPageHeader`,h),...L,children:[w!=null&&c(i.Provider,{value:!0,children:c(`div`,{className:`page-header-bar-crumbs`,children:w})}),G,C!=null&&c(`span`,{className:`page-status`,children:C}),E!=null&&c(`div`,{className:`page-header-bar-views`,"data-wui-bar-swap":``,hidden:A&&H>0?!0:void 0,children:E}),c(`span`,{className:`page-header-bar-spacer`,"aria-hidden":`true`}),O!=null&&!B&&c(`div`,{className:`page-header-bar-meta`,children:O}),D!=null&&c(`div`,{className:`page-header-bar-tools`,"data-wui-bar-swap":``,hidden:A&&H>0?!0:void 0,children:D}),A?l(`div`,{className:`page-header-bar-bulk`,"data-wui-bar-bulk":``,hidden:H===0||void 0,children:[c(`span`,{className:`page-header-bar-bulk-count`,"aria-live":`polite`,children:H>0?`${a(H,{decimals:0})} selected`:``}),j]}):null,T!=null&&c(`div`,{className:`page-actions`,children:T}),O!=null&&B&&c(`div`,{className:`page-header-bar-meta`,children:O})]});let K=x==null?null:typeof x==`string`?c(r,{name:x,size:20}):x;return l(`div`,{className:V,...e(`AppPageHeader`,h),...L,children:[w!=null&&c(`div`,{className:`page-breadcrumbs`,children:w}),l(`div`,{className:`page-header-bar`,children:[l(`div`,{className:`page-header-lead`,children:[K!=null&&c(`span`,{className:`page-header-icon`,children:K}),l(`div`,{className:`page-header-titles`,children:[b!=null&&c(`div`,{className:`page-eyebrow`,children:b}),l(`div`,{className:`page-titlebar`,children:[G,C!=null&&c(`span`,{className:`page-status`,children:C})]}),y!=null&&c(`div`,{className:`page-subtitle`,children:y})]})]}),T!=null&&c(`div`,{className:`page-actions`,children:T})]})]})}export{h as default};
|
package/dist/guidance.json
CHANGED
|
@@ -12,18 +12,26 @@ import "@webority/ui-elements/elements/context-menu";
|
|
|
12
12
|
* it, and use `target="tbody tr"`). The browser's own menu stays on inside inputs, textareas
|
|
13
13
|
* and contenteditable content, with `disabled`, and on Shift+right-click.
|
|
14
14
|
*
|
|
15
|
+
* A row with `items` opens a side menu. It opens on click, Enter, Space or ArrowRight; with
|
|
16
|
+
* `searchable` it holds a filter field that narrows its rows as the user types.
|
|
17
|
+
*
|
|
15
18
|
* NOTE: the exported component must stay the FIRST destructured function in this file —
|
|
16
19
|
* the parity check reads the first signature it finds as the component's public props.
|
|
17
20
|
*
|
|
18
21
|
* @param {object} props
|
|
19
|
-
* @param {{ key: string, label?: string, icon?: string|import('react').ReactNode, image?: string, to?: string, onClick?: () => void, danger?: boolean, disabled?: boolean, divider?: boolean }[]} [props.items]
|
|
22
|
+
* @param {{ key: string, label?: string, icon?: string|import('react').ReactNode, image?: string, hint?: string, shortcut?: string, checked?: boolean, to?: string, onClick?: () => void, danger?: boolean, disabled?: boolean, divider?: boolean, searchable?: boolean, searchPlaceholder?: string, items?: object[] }[]} [props.items]
|
|
23
|
+
* A row's `shortcut` is the key that runs it, such as "E": a key chip at the row's end and `aria-keyshortcuts`. The page binds the key itself.
|
|
20
24
|
* @param {string} [props.target]
|
|
25
|
+
* @param {string} [props.trigger] A CSS selector inside the region; a click or Enter on a match opens the menu under it.
|
|
21
26
|
* @param {import('react').ReactNode} [props.children] The region to attach to, when `target` is not used.
|
|
22
27
|
* @param {string} [props.ariaLabel]
|
|
23
28
|
* @param {boolean} [props.disabled]
|
|
24
29
|
* @param {boolean} [props.open] Shows the menu open at the top-left corner of its region, for a design preview or a controlled caller.
|
|
25
30
|
* @param {(detail: { region: Element, origin: Element, x: number, y: number }) => void} [props.onOpen]
|
|
26
31
|
* Called as the menu opens. `region` is the matched target, `origin` the element the user acted on inside it.
|
|
32
|
+
* @param {(event: CustomEvent) => void} [props.onBeforeOpen]
|
|
33
|
+
* Called before the menu shows, with the cancelable event; `event.detail` holds `region`, `origin` and `trigger`.
|
|
34
|
+
* Calling `event.preventDefault()` keeps the menu closed.
|
|
27
35
|
* @param {string} [props.menuClassName]
|
|
28
36
|
* @param {import('react').ElementType} [props.linkComponent] Component for `to` items (e.g. Link).
|
|
29
37
|
*/
|
|
@@ -37,14 +45,22 @@ export default function AppContextMenu(props: {
|
|
|
37
45
|
label?: string;
|
|
38
46
|
icon?: string | import('react').ReactNode;
|
|
39
47
|
image?: string;
|
|
48
|
+
hint?: string;
|
|
49
|
+
shortcut?: string;
|
|
50
|
+
checked?: boolean;
|
|
40
51
|
to?: string;
|
|
41
52
|
onClick?: () => void;
|
|
42
53
|
danger?: boolean;
|
|
43
54
|
disabled?: boolean;
|
|
44
55
|
divider?: boolean;
|
|
56
|
+
searchable?: boolean;
|
|
57
|
+
searchPlaceholder?: string;
|
|
58
|
+
items?: object[];
|
|
45
59
|
}[];
|
|
46
60
|
/** CSS selector of the elements the menu serves. Without it, the menu serves `children`. */
|
|
47
61
|
target?: string;
|
|
62
|
+
/** A CSS selector inside the region: a click or Enter on a match opens the menu under it. */
|
|
63
|
+
trigger?: string;
|
|
48
64
|
children?: import('react').ReactNode;
|
|
49
65
|
/**
|
|
50
66
|
* Accessible name of the menu.
|
|
@@ -64,6 +80,7 @@ export default function AppContextMenu(props: {
|
|
|
64
80
|
x: number;
|
|
65
81
|
y: number;
|
|
66
82
|
}) => void;
|
|
83
|
+
onBeforeOpen?: (event: CustomEvent) => void;
|
|
67
84
|
/**
|
|
68
85
|
* Extra classes on the menu panel.
|
|
69
86
|
* @default ""
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A due date that never wraps. An overdue date shows in danger with its title "Overdue since dd-MMM-yyyy"
|
|
3
|
-
* and the danger glyph; a date within `soonDays` shows "N days left" in warning
|
|
3
|
+
* and the danger glyph; a date within `soonDays` shows "N days left" in warning, or "Due today", "Due tomorrow"
|
|
4
|
+
* and "Due in N days" with `soonWording="due"`; no date shows the muted "Not set". `icon` draws the calendar
|
|
5
|
+
* glyph before the date in every dated state.
|
|
4
6
|
* Dates are read in India Standard Time. The Razor `<app-due-date>` renders the same markup and classes.
|
|
5
7
|
*
|
|
6
8
|
* @param {object} props
|
|
7
9
|
* @param {string|number|Date} [props.date]
|
|
8
10
|
* @param {number} [props.soonDays]
|
|
11
|
+
* @param {"days"|"due"} [props.soonWording] `days` (default) reads "N days left"; `due` reads "Due today", "Due tomorrow" or "Due in N days".
|
|
12
|
+
* @param {boolean} [props.icon] Draws the calendar glyph before the date text.
|
|
9
13
|
* @param {boolean} [props.overdue]
|
|
10
14
|
* @param {string} [props.overdueLabel]
|
|
11
15
|
* @param {string} [props.className]
|
|
@@ -15,6 +19,16 @@ export default function AppDueDate(props: {
|
|
|
15
19
|
date?: string | number | Date;
|
|
16
20
|
/** Within this many days of the date, the text reads "N days left" in warning. */
|
|
17
21
|
soonDays?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Within soonDays, "days" reads "N days left"; "due" reads "Due today", "Due tomorrow" or "Due in N days".
|
|
24
|
+
* @default "days"
|
|
25
|
+
*/
|
|
26
|
+
soonWording?: "days" | "due";
|
|
27
|
+
/**
|
|
28
|
+
* Draws a calendar glyph before the date text in every dated state.
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
icon?: boolean;
|
|
18
32
|
/**
|
|
19
33
|
* Set by the caller from its own rule. Done items are never overdue.
|
|
20
34
|
* @default false
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @param {object} props
|
|
20
20
|
* @param {import('react').ReactNode} props.title
|
|
21
|
+
* @param {import('react').ReactNode} [props.titleSlot] Rendered inside the heading in place of `title`, for a title with a badge or a link in it; the heading is then named by `title`.
|
|
21
22
|
* @param {"h1"|"h2"|"h3"|"h4"|"h5"|"h6"} [props.as]
|
|
22
23
|
* @param {import('react').ReactNode} [props.subtitle]
|
|
23
24
|
* @param {import('react').ReactNode} [props.eyebrow]
|
|
@@ -41,6 +42,8 @@
|
|
|
41
42
|
export default function AppPageHeader(props: {
|
|
42
43
|
/** Rendered as the screen heading. */
|
|
43
44
|
title: import('react').ReactNode;
|
|
45
|
+
/** Rendered inside the heading in place of title, for a title with a badge or a link in it. The heading is then named by title. */
|
|
46
|
+
titleSlot?: import('react').ReactNode;
|
|
44
47
|
/**
|
|
45
48
|
* The heading element for the title. Keep one h1 per page.
|
|
46
49
|
* @default "h1"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.102.0",
|
|
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,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/theme": "0.
|
|
33
|
-
"@webority/ui-elements": "0.
|
|
32
|
+
"@webority/theme": "0.102.0",
|
|
33
|
+
"@webority/ui-elements": "0.102.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@webority/analytics": "^0.28.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"typescript": "^7.0.2",
|
|
57
57
|
"vite": "^8.0.12",
|
|
58
58
|
"vitest": "5.0.1",
|
|
59
|
-
"@webority/canvas-kit": "0.
|
|
60
|
-
"@webority/tokens": "0.
|
|
59
|
+
"@webority/canvas-kit": "0.102.0",
|
|
60
|
+
"@webority/tokens": "0.102.0"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "vite build && tsc -p tsconfig.json && node ../../scripts/inject-meta-docs.mjs && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json && node ../../scripts/sync-rcl-assets.mjs analytics",
|