@evotecit/canopyx 0.3.16 → 0.3.18
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/CanopyX.Html/Assets/canopyx-board.css +50 -0
- package/CanopyX.Html/Assets/canopyx-board.js +39 -0
- package/CanopyX.Html/Assets/canopyx-buckets.js +15 -0
- package/CanopyX.Html/Assets/canopyx-calculations.css +7 -0
- package/CanopyX.Html/Assets/canopyx-calculations.js +52 -0
- package/CanopyX.Html/Assets/canopyx-calendar-edit.js +3 -3
- package/CanopyX.Html/Assets/canopyx-calendar.css +5 -24
- package/CanopyX.Html/Assets/canopyx-calendar.js +14 -19
- package/CanopyX.Html/Assets/canopyx-cell-range.js +16 -14
- package/CanopyX.Html/Assets/canopyx-changes.css +6 -24
- package/CanopyX.Html/Assets/canopyx-changes.js +18 -15
- package/CanopyX.Html/Assets/canopyx-compare.css +37 -0
- package/CanopyX.Html/Assets/canopyx-compare.js +12 -0
- package/CanopyX.Html/Assets/canopyx-data.js +3 -3
- package/CanopyX.Html/Assets/canopyx-editing.css +2 -2
- package/CanopyX.Html/Assets/canopyx-editing.js +2 -2
- package/CanopyX.Html/Assets/canopyx-enhance.js +4 -4
- package/CanopyX.Html/Assets/canopyx-export.js +54 -13
- package/CanopyX.Html/Assets/canopyx-facets.css +14 -5
- package/CanopyX.Html/Assets/canopyx-facets.js +19 -15
- package/CanopyX.Html/Assets/canopyx-filter-editor.css +71 -85
- package/CanopyX.Html/Assets/canopyx-filter-editor.js +20 -16
- package/CanopyX.Html/Assets/canopyx-flow-checks.css +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-checks.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-dialog.css +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-dialog.js +1 -1
- package/CanopyX.Html/Assets/canopyx-flow-entry.css +136 -12
- package/CanopyX.Html/Assets/canopyx-flow-entry.js +2 -2
- package/CanopyX.Html/Assets/canopyx-flow-module.mjs +2 -2
- package/CanopyX.Html/Assets/canopyx-format-editor.js +2 -2
- package/CanopyX.Html/Assets/canopyx-formatting.js +10 -9
- package/CanopyX.Html/Assets/canopyx-grid-module.mjs +182 -128
- package/CanopyX.Html/Assets/canopyx-grid.css +228 -96
- package/CanopyX.Html/Assets/canopyx-grid.js +182 -128
- package/CanopyX.Html/Assets/canopyx-grouping.css +22 -15
- package/CanopyX.Html/Assets/canopyx-grouping.js +24 -17
- package/CanopyX.Html/Assets/canopyx-interactive.css +197 -74
- package/CanopyX.Html/Assets/canopyx-interactive.js +38 -45
- package/CanopyX.Html/Assets/canopyx-labels-de.js +177 -9
- package/CanopyX.Html/Assets/canopyx-labels-es.js +177 -9
- package/CanopyX.Html/Assets/canopyx-labels-fr.js +176 -8
- package/CanopyX.Html/Assets/canopyx-labels-it.js +176 -8
- package/CanopyX.Html/Assets/canopyx-labels-pl.js +176 -8
- package/CanopyX.Html/Assets/canopyx-layouts.css +48 -20
- package/CanopyX.Html/Assets/canopyx-layouts.js +36 -14
- package/CanopyX.Html/Assets/canopyx-link.js +2 -2
- package/CanopyX.Html/Assets/canopyx-live.css +1 -3
- package/CanopyX.Html/Assets/canopyx-live.js +3 -3
- package/CanopyX.Html/Assets/canopyx-matrix.css +1 -8
- package/CanopyX.Html/Assets/canopyx-matrix.js +11 -11
- package/CanopyX.Html/Assets/canopyx-module.mjs +38 -45
- package/CanopyX.Html/Assets/canopyx-office-export.js +2936 -0
- package/CanopyX.Html/Assets/canopyx-path.css +45 -0
- package/CanopyX.Html/Assets/canopyx-path.js +28 -0
- package/CanopyX.Html/Assets/canopyx-pivot.css +75 -0
- package/CanopyX.Html/Assets/canopyx-pivot.js +72 -0
- package/CanopyX.Html/Assets/canopyx-plan.css +56 -0
- package/CanopyX.Html/Assets/canopyx-plan.js +67 -0
- package/CanopyX.Html/Assets/canopyx-presenters.js +2 -2
- package/CanopyX.Html/Assets/canopyx-record-panel.css +8 -7
- package/CanopyX.Html/Assets/canopyx-record-panel.js +15 -14
- package/CanopyX.Html/Assets/canopyx-reporting-module.mjs +222 -161
- package/CanopyX.Html/Assets/canopyx-reporting.css +240 -107
- package/CanopyX.Html/Assets/canopyx-reporting.js +222 -161
- package/CanopyX.Html/Assets/canopyx-stack.css +35 -0
- package/CanopyX.Html/Assets/canopyx-stack.js +24 -0
- package/CanopyX.Html/Assets/canopyx-time-slider.css +18 -0
- package/CanopyX.Html/Assets/canopyx-time-slider.js +27 -0
- package/CanopyX.Html/Assets/canopyx-timeline.js +6 -5
- package/CanopyX.Html/Assets/canopyx-tree-tools.css +36 -35
- package/CanopyX.Html/Assets/canopyx-tree-tools.js +15 -12
- package/CanopyX.Html/Assets/canopyx-ui-menu.css +41 -0
- package/CanopyX.Html/Assets/canopyx-ui-menu.js +64 -0
- package/CanopyX.Html/Assets/canopyx-ui-navigation.css +73 -0
- package/CanopyX.Html/Assets/canopyx-ui-navigation.js +39 -0
- package/CanopyX.Html/Assets/canopyx-ui-overlays.css +79 -0
- package/CanopyX.Html/Assets/canopyx-ui-overlays.js +42 -0
- package/CanopyX.Html/Assets/canopyx-ui-picker.css +12 -0
- package/CanopyX.Html/Assets/canopyx-ui-picker.js +6 -0
- package/CanopyX.Html/Assets/canopyx-ui-stepper.css +174 -0
- package/CanopyX.Html/Assets/canopyx-ui-stepper.js +48 -0
- package/CanopyX.Html/Assets/canopyx-ui-tabs.css +153 -0
- package/CanopyX.Html/Assets/canopyx-ui-tabs.js +47 -0
- package/CanopyX.Html/Assets/canopyx-values.css +5 -0
- package/CanopyX.Html/Assets/canopyx-values.js +13 -0
- package/CanopyX.Html/Assets/canopyx-view-intents.css +12 -0
- package/CanopyX.Html/Assets/canopyx-view-intents.js +56 -0
- package/CanopyX.Html/Assets/canopyx.css +197 -71
- package/CanopyX.Html/Assets/canopyx.js +29 -19
- package/JavaScript/board.d.ts +30 -0
- package/JavaScript/changes.d.ts +4 -1
- package/JavaScript/facets.d.ts +5 -3
- package/JavaScript/grid.d.ts +150 -16
- package/JavaScript/hosts.d.ts +14 -1
- package/JavaScript/index.d.ts +4 -2
- package/JavaScript/locales/de.mjs +177 -9
- package/JavaScript/locales/es.mjs +177 -9
- package/JavaScript/locales/fr.mjs +176 -8
- package/JavaScript/locales/it.mjs +176 -8
- package/JavaScript/locales/pl.mjs +176 -8
- package/JavaScript/matrix.d.ts +4 -1
- package/JavaScript/path.d.ts +33 -0
- package/JavaScript/pivot.d.ts +135 -0
- package/JavaScript/plan.d.ts +23 -0
- package/JavaScript/protocol.d.ts +16 -3
- package/JavaScript/records.d.ts +2 -0
- package/JavaScript/stack.d.ts +28 -0
- package/JavaScript/time-slider.d.ts +58 -0
- package/JavaScript/ui.d.ts +261 -0
- package/JavaScript/view-intents.d.ts +45 -0
- package/README.md +22 -3
- package/ThirdParty/OfficeIMO/LICENSE +21 -0
- package/ThirdParty/OfficeIMO/README.md +13 -0
- package/package.json +76 -3
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
--cx-size-10px:10px;
|
|
37
37
|
--cx-size-11px:11px;
|
|
38
38
|
--cx-size-1d5px:1.5px;
|
|
39
|
-
--cx-size-21px:21px;
|
|
40
39
|
--cx-size-5px:5px;
|
|
41
40
|
--cx-size-280px:280px;
|
|
42
41
|
--cx-size-34px:34px;
|
|
@@ -48,17 +47,13 @@
|
|
|
48
47
|
--cx-size-16px:16px;
|
|
49
48
|
--cx-size-320px:320px;
|
|
50
49
|
--cx-size-2px:2px;
|
|
51
|
-
--cx-size-d8em:.8em;
|
|
52
|
-
--cx-size-d85em:.85em;
|
|
53
50
|
--cx-size-neg-2px:-2px;
|
|
54
51
|
--cx-size-180px:180px;
|
|
55
|
-
--cx-size-d92em:.92em;
|
|
56
52
|
--cx-size-9px:9px;
|
|
57
53
|
--cx-size-neg-3px:-3px;
|
|
58
54
|
--cx-size-18px:18px;
|
|
59
55
|
--cx-size-1d6px:1.6px;
|
|
60
56
|
--cx-size-999px:999px;
|
|
61
|
-
--cx-size-12em:12em;
|
|
62
57
|
--cx-size-100vh:100vh;
|
|
63
58
|
--cx-size-340px:340px;
|
|
64
59
|
--cx-size-20px:20px;
|
|
@@ -83,30 +78,36 @@
|
|
|
83
78
|
box-sizing:border-box;
|
|
84
79
|
display:flex;
|
|
85
80
|
flex-direction:column;
|
|
86
|
-
height:
|
|
81
|
+
height:480px;
|
|
87
82
|
min-height:0;
|
|
88
83
|
color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));
|
|
89
84
|
background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));
|
|
90
85
|
font-family:var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);
|
|
91
86
|
font-size:var(--hfx-control-font-size,calc(var(--hfx-type-body-size,0.875rem) - var(--cx-compact,0) * .0625rem));
|
|
92
|
-
line-height:1.4;
|
|
87
|
+
line-height:var(--hfx-type-small-line,1.4);
|
|
93
88
|
}
|
|
89
|
+
.cx-host[data-cx-chrome="embedded"]{background:transparent;border:0;border-radius:0;}
|
|
90
|
+
.cx-host[data-cx-chrome="embedded"] > .cx-grid{border-inline:0;border-bottom:0;border-radius:0;background:transparent;}
|
|
91
|
+
.cx-host[data-cx-chrome="embedded"] > :is(.cx-grid-notice,.cx-grid-status,.cx-grid-pager){background:transparent;}
|
|
92
|
+
.cx-host[data-cx-chrome="embedded"] :is(.cx-toolbar,.cx-grid-query-summary,.cx-grid-status,.cx-grid-pager){padding-inline:var(--hfx-card-padding-x,calc(20px - var(--cx-compact,0) * 4px));}
|
|
93
|
+
.cx-host[data-cx-chrome="embedded"] :is(.cx-hrow,.cx-row) > :first-child{padding-inline-start:var(--hfx-card-padding-x,calc(20px - var(--cx-compact,0) * 4px));}
|
|
94
|
+
.cx-host[data-cx-chrome="embedded"] :is(.cx-hrow,.cx-row) > :last-child{padding-inline-end:var(--hfx-card-padding-x,calc(20px - var(--cx-compact,0) * 4px));}
|
|
94
95
|
.cx-host *,.cx-host *::before,.cx-host *::after{box-sizing:border-box;}
|
|
95
|
-
.cx-host .cx-button.cx-filter-chip{display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--
|
|
96
|
-
.cx-filter-chip > .cx-chip-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
96
|
+
.cx-host .cx-button.cx-filter-chip{display:inline-flex;align-items:center;justify-content:flex-start;gap:var(--hfx-space-1-5,6px);min-width:0;}
|
|
97
|
+
.cx-filter-chip > .cx-chip-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:var(--hfx-type-small-line,1.4);}
|
|
97
98
|
.cx-filter-chip > .cx-chip-remove{flex:none;}
|
|
98
99
|
@media print{.cx-filter-chip > .cx-chip-label{white-space:normal;overflow:visible;text-overflow:clip;}}
|
|
99
100
|
@media not (forced-colors:active){
|
|
100
101
|
:where(.cx-host,.cx-host *){scrollbar-color:var(--cx-scrollbar-thumb) var(--cx-scrollbar-track);scrollbar-width:thin;}
|
|
101
102
|
.cx-host::-webkit-scrollbar,.cx-host ::-webkit-scrollbar{width:var(--cx-scrollbar-size);height:var(--cx-scrollbar-size);}
|
|
102
103
|
.cx-host::-webkit-scrollbar-track,.cx-host ::-webkit-scrollbar-track,.cx-host ::-webkit-scrollbar-corner{background:var(--cx-scrollbar-track);}
|
|
103
|
-
.cx-host::-webkit-scrollbar-thumb,.cx-host ::-webkit-scrollbar-thumb{background:var(--cx-scrollbar-thumb) padding-box;border:var(--
|
|
104
|
+
.cx-host::-webkit-scrollbar-thumb,.cx-host ::-webkit-scrollbar-thumb{background:var(--cx-scrollbar-thumb) padding-box;border:calc(var(--hfx-border-width,1px)*2) solid transparent;border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));}
|
|
104
105
|
.cx-host ::-webkit-scrollbar-thumb:hover{background-color:var(--cx-scrollbar-thumb-hover);}
|
|
105
106
|
}
|
|
106
107
|
.cx-sr-only{
|
|
107
|
-
--cx-size-1px:1px;--cx-size-neg-1px:-1px;
|
|
108
108
|
position:absolute !important;
|
|
109
|
-
width:
|
|
109
|
+
width:1px;height:1px;padding:0;
|
|
110
|
+
margin:calc(var(--hfx-border-width,1px)*-1);
|
|
110
111
|
overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
|
|
111
112
|
}
|
|
112
113
|
.cx-host[data-cx-density="compact"]{--cx-compact:1;}
|
|
@@ -115,6 +116,129 @@ overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
|
|
|
115
116
|
:where([data-cx-fallback-mode="light"],.cx-static[data-theme="light"],.cx-static[data-cx-theme="light"]){color-scheme:light;}
|
|
116
117
|
:where([data-cx-fallback-mode="dark"],.cx-static[data-theme="dark"],.cx-static[data-cx-theme="dark"]){color-scheme:dark;}
|
|
117
118
|
}
|
|
119
|
+
@layer hfx.components{
|
|
120
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close){
|
|
121
|
+
display:inline-flex;align-items:center;justify-content:center;gap:var(--hfx-space-1-5,6px);
|
|
122
|
+
min-block-size:var(--cx-ui-touch-target,var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px)));block-size:var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px));padding:0 var(--hfx-control-padding-x,calc(14px - var(--cx-compact,0) * 4px));
|
|
123
|
+
border:var(--hfx-border-width,1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));
|
|
124
|
+
background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));
|
|
125
|
+
font:var(--hfx-weight-medium,500) var(--hfx-control-font-size,calc(var(--hfx-type-body-size,0.875rem) - var(--cx-compact,0) * .0625rem)) var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);line-height:1;white-space:nowrap;cursor:pointer;
|
|
126
|
+
}
|
|
127
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):hover{background:var(--hfx-color-hover,light-dark(#f5f5f5,#232529));}
|
|
128
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):active{background:var(--hfx-color-active,light-dark(#ebebec,#2e3034));}
|
|
129
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):focus-visible{outline:var(--hfx-focus-width,2px) solid var(--hfx-color-focus-ring,light-dark(#02726a,#37c9b8));outline-offset:var(--hfx-focus-offset,2px);}
|
|
130
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-variant="primary"],[data-primary],.primary){
|
|
131
|
+
background:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));border-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));color:var(--hfx-color-accent-contrast,light-dark(#ffffff,#0c0d10));
|
|
132
|
+
}
|
|
133
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-variant="primary"],[data-primary],.primary):hover{background:var(--hfx-color-accent-hover,light-dark(#0d6760,#4dd9c8));border-color:var(--hfx-color-accent-hover,light-dark(#0d6760,#4dd9c8));}
|
|
134
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-variant="ghost"],[data-ghost],.ghost){background:transparent;border-color:transparent;color:var(--hfx-color-text-secondary,light-dark(#4d525b,#b0b4bc));}
|
|
135
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-variant="ghost"],[data-ghost],.ghost):hover{background:var(--hfx-color-hover,light-dark(#f5f5f5,#232529));color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));}
|
|
136
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-variant="danger"],.danger){color:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));border-color:var(--hfx-color-status-bad-border,light-dark(#eeacac,#814345));}
|
|
137
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([aria-pressed="true"],.active){
|
|
138
|
+
border-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));background:var(--hfx-color-accent-subtle,light-dark(#e7f1f1,#1b3435));color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));
|
|
139
|
+
}
|
|
140
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is(:disabled,[aria-disabled="true"]),:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is(:disabled,[aria-disabled="true"]):hover{color:var(--hfx-color-text-disabled,light-dark(#a3a8b0,#5a5f68));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));border-color:var(--hfx-color-border,light-dark(#e2e4e7,#272a30));cursor:default;}
|
|
141
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-variant="ghost"],[data-ghost],.ghost):is(:disabled,[aria-disabled="true"]),:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-variant="ghost"],[data-ghost],.ghost):is(:disabled,[aria-disabled="true"]):hover{background:transparent;border-color:transparent;}
|
|
142
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-size="sm"],.sm){block-size:var(--hfx-control-height-sm,calc(28px - var(--cx-compact,0) * 4px));min-block-size:var(--hfx-control-height-sm,calc(28px - var(--cx-compact,0) * 4px));padding:0 var(--hfx-space-2,0.5rem);}
|
|
143
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-size="lg"],.lg){block-size:var(--hfx-control-height-lg,calc(44px - var(--cx-compact,0) * 8px));min-block-size:var(--hfx-control-height-lg,calc(44px - var(--cx-compact,0) * 8px));}
|
|
144
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-icon],.icon){inline-size:var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px));padding:0;}
|
|
145
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close):is([data-icon],.icon):is([data-size="sm"],.sm){inline-size:var(--hfx-control-height-sm,calc(28px - var(--cx-compact,0) * 4px));}
|
|
146
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,[data-cx-open],.cx-overlay-close) :where(.badge,.cx-count){
|
|
147
|
+
display:inline-grid;place-items:center;min-inline-size:var(--hfx-badge-height,20px);block-size:var(--hfx-badge-height,20px);padding:0 var(--hfx-space-1,0.25rem);
|
|
148
|
+
border-radius:var(--hfx-radius-pill,999px);background:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));color:var(--hfx-color-accent-contrast,light-dark(#ffffff,#0c0d10));
|
|
149
|
+
font-size:var(--hfx-type-caption-size,0.75rem);font-weight:var(--hfx-weight-semibold,600);
|
|
150
|
+
}
|
|
151
|
+
:where(.cx-input,.cx-select,.cx-textarea){
|
|
152
|
+
min-inline-size:0;block-size:var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px));padding:0 calc(var(--hfx-space-1,0.25rem)*2.5);
|
|
153
|
+
border:var(--hfx-border-width,1px) solid var(--hfx-color-border-control,light-dark(#8a8f98,#6e737c));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));
|
|
154
|
+
background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));font:inherit;font-size:var(--hfx-control-font-size,calc(var(--hfx-type-body-size,0.875rem) - var(--cx-compact,0) * .0625rem));
|
|
155
|
+
}
|
|
156
|
+
:where(.cx-textarea){block-size:auto;min-block-size:calc(var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px))*2);padding-block:var(--hfx-space-2,0.5rem);}
|
|
157
|
+
:where(.cx-input,.cx-select,.cx-textarea)::placeholder{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));opacity:1;}
|
|
158
|
+
:where(.cx-input,.cx-select,.cx-textarea):focus-visible{outline:var(--hfx-focus-width,2px) solid var(--hfx-color-focus-ring,light-dark(#02726a,#37c9b8));outline-offset:var(--hfx-focus-offset,2px);border-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));}
|
|
159
|
+
:where(.cx-input,.cx-select,.cx-textarea):disabled{color:var(--hfx-color-text-disabled,light-dark(#a3a8b0,#5a5f68));background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
|
|
160
|
+
:where(.cx-input,.cx-select,.cx-textarea)[aria-invalid="true"]{border-color:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));}
|
|
161
|
+
:where(.cx-input,.cx-select,.cx-textarea):is([data-size="sm"],.sm){block-size:var(--hfx-control-height-sm,calc(28px - var(--cx-compact,0) * 4px));padding:0 var(--hfx-space-2,0.5rem);}
|
|
162
|
+
:where(.cx-check){inline-size:var(--hfx-icon-md,16px);block-size:var(--hfx-icon-md,16px);margin:0;accent-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));flex:none;}
|
|
163
|
+
:where(.cx-toggle){
|
|
164
|
+
appearance:none;flex:none;position:relative;inline-size:calc(var(--hfx-icon-md,16px)*2.25);block-size:calc(var(--hfx-icon-md,16px)*1.25);margin:0;
|
|
165
|
+
border-radius:var(--hfx-radius-pill,999px);background:var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));cursor:pointer;
|
|
166
|
+
transition:background-color var(--hfx-motion-duration-fast,120ms) var(--hfx-motion-easing-standard,cubic-bezier(.2,0,0,1));
|
|
167
|
+
}
|
|
168
|
+
:where(.cx-toggle)::before{
|
|
169
|
+
content:"";position:absolute;inset-block-start:calc(var(--hfx-icon-md,16px)*.125);inset-inline-start:calc(var(--hfx-icon-md,16px)*.125);
|
|
170
|
+
inline-size:var(--hfx-icon-md,16px);block-size:var(--hfx-icon-md,16px);border-radius:var(--hfx-radius-pill,999px);background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));box-shadow:var(--hfx-elevation-1,0 1px 2px rgba(22,24,28,.06));
|
|
171
|
+
transition:transform var(--hfx-motion-duration-fast,120ms) var(--hfx-motion-easing-standard,cubic-bezier(.2,0,0,1));
|
|
172
|
+
}
|
|
173
|
+
:where(.cx-toggle):checked{background:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));}
|
|
174
|
+
:where(.cx-toggle):checked::before{transform:translateX(var(--hfx-icon-md,16px));}
|
|
175
|
+
:where(:dir(rtl)) :where(.cx-toggle):checked::before{transform:translateX(calc(var(--hfx-icon-md,16px)*-1));}
|
|
176
|
+
:where(.cx-toggle):disabled{background:var(--hfx-color-border,light-dark(#e2e4e7,#272a30));cursor:default;}
|
|
177
|
+
:where(.cx-toggle,.cx-check):focus-visible{outline:var(--hfx-focus-width,2px) solid var(--hfx-color-focus-ring,light-dark(#02726a,#37c9b8));outline-offset:var(--hfx-focus-offset,2px);}
|
|
178
|
+
:where(.cx-segmented,.cx-seg){
|
|
179
|
+
display:inline-flex;align-items:center;gap:var(--hfx-space-0-5,2px);padding:var(--hfx-space-0-5,2px);
|
|
180
|
+
border:var(--hfx-border-width,1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));
|
|
181
|
+
}
|
|
182
|
+
:where(.cx-segmented,.cx-seg) > :where(button,[role="radio"]){
|
|
183
|
+
display:inline-flex;align-items:center;justify-content:center;gap:var(--hfx-space-1-5,6px);
|
|
184
|
+
block-size:calc(var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px)) - var(--hfx-space-1,0.25rem));padding:0 var(--hfx-space-3,0.75rem);border:0;border-radius:calc(var(--hfx-radius-control,var(--hfx-radius-md,6px)) - var(--hfx-space-0-5,2px));
|
|
185
|
+
background:transparent;color:var(--hfx-color-text-secondary,light-dark(#4d525b,#b0b4bc));font:var(--hfx-weight-medium,500) var(--hfx-control-font-size,calc(var(--hfx-type-body-size,0.875rem) - var(--cx-compact,0) * .0625rem)) var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);cursor:pointer;white-space:nowrap;
|
|
186
|
+
}
|
|
187
|
+
:where(.cx-segmented,.cx-seg) > :where(button,[role="radio"]):hover{color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));}
|
|
188
|
+
:where(.cx-segmented,.cx-seg) > :where([aria-pressed="true"],[aria-checked="true"],.active,.on){background:var(--hfx-color-surface-raised,light-dark(#ffffff,#1e2126));color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));box-shadow:var(--hfx-elevation-1,0 1px 2px rgba(22,24,28,.06));outline:var(--hfx-border-width,1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));outline-offset:calc(var(--hfx-border-width,1px)*-1);}
|
|
189
|
+
:where(.cx-segmented,.cx-seg) > :where(button,[role="radio"]):focus-visible{outline:var(--hfx-focus-width,2px) solid var(--hfx-color-focus-ring,light-dark(#02726a,#37c9b8));outline-offset:calc(var(--hfx-focus-width,2px)*-1);}
|
|
190
|
+
:where(.cx-segmented,.cx-seg):is([data-size="sm"],.sm) > :where(button,[role="radio"]){block-size:calc(var(--hfx-control-height-sm,calc(28px - var(--cx-compact,0) * 4px)) - var(--hfx-space-1,0.25rem));padding:0 var(--hfx-space-2,0.5rem);}
|
|
191
|
+
:where(.cx-chip){
|
|
192
|
+
display:inline-flex;align-items:center;gap:var(--hfx-space-1-5,6px);max-inline-size:100%;block-size:var(--hfx-control-height-sm,calc(28px - var(--cx-compact,0) * 4px));padding:0 calc(var(--hfx-space-1,0.25rem)*2.5);
|
|
193
|
+
border:var(--hfx-border-width,1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-status,999px);
|
|
194
|
+
background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));font:var(--hfx-weight-medium,500) var(--hfx-type-small-size,0.8125rem) var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);white-space:nowrap;
|
|
195
|
+
}
|
|
196
|
+
:where(button.cx-chip){cursor:pointer;}
|
|
197
|
+
:where(button.cx-chip):hover{background:var(--hfx-color-hover,light-dark(#f5f5f5,#232529));}
|
|
198
|
+
:where(.cx-chip):is([aria-pressed="true"],.active){border-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));background:var(--hfx-color-accent-subtle,light-dark(#e7f1f1,#1b3435));color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));}
|
|
199
|
+
:where(.cx-chip):focus-visible{outline:var(--hfx-focus-width,2px) solid var(--hfx-color-focus-ring,light-dark(#02726a,#37c9b8));outline-offset:var(--hfx-focus-offset,2px);}
|
|
200
|
+
:where(.cx-pill,.p-pill){
|
|
201
|
+
display:inline-flex;align-items:center;gap:var(--hfx-space-1,0.25rem);block-size:var(--hfx-pill-height,22px);padding:0 var(--hfx-space-2,0.5rem);
|
|
202
|
+
border-radius:var(--hfx-radius-status,999px);background:var(--hfx-color-status-neutral-bg,light-dark(#eeeff0,#2a2c31));color:var(--hfx-color-status-neutral-fg,light-dark(#5b6069,#a0a5ae));
|
|
203
|
+
font:var(--hfx-weight-semibold,600) var(--hfx-type-caption-size,0.75rem) var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);white-space:nowrap;
|
|
204
|
+
outline:var(--hfx-border-width,1px) solid color-mix(in srgb,currentColor 24%,transparent);outline-offset:calc(var(--hfx-border-width,1px)*-1);
|
|
205
|
+
}
|
|
206
|
+
:where(.cx-pill,.p-pill):is(.cx-tone-info,.info){background:var(--hfx-color-status-info-bg,light-dark(#e4ecfa,#262f41));color:var(--hfx-color-status-info-fg,light-dark(#2b5fc0,#74a2f7));}
|
|
207
|
+
:where(.cx-pill,.p-pill):is(.cx-tone-success,.success){background:var(--hfx-color-status-good-bg,light-dark(#e2f0e9,#1f362f));color:var(--hfx-color-status-good-fg,light-dark(#177345,#4cc78a));}
|
|
208
|
+
:where(.cx-pill,.p-pill):is(.cx-tone-warning,.warning){background:var(--hfx-color-status-warn-bg,light-dark(#f8efde,#3b3322));color:var(--hfx-color-status-warn-fg,light-dark(#8c5c05,#eeb640));}
|
|
209
|
+
:where(.cx-pill,.p-pill):is(.cx-tone-danger,.danger){background:var(--hfx-color-status-bad-bg,light-dark(#f9e4e4,#3c272a));color:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));}
|
|
210
|
+
:where(.cx-pill,.p-pill).cx-toned{background:var(--cx-t-bg,color-mix(in srgb,var(--cx-t,var(--hfx-color-text,light-dark(#16181c,#f2f3f5))) 12%,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));color:var(--cx-t,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));}
|
|
211
|
+
:where(.cx-disclosure){
|
|
212
|
+
flex:none;display:inline-grid;place-items:center;inline-size:var(--hfx-icon-md,16px);block-size:var(--hfx-icon-md,16px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));
|
|
213
|
+
transition:transform var(--hfx-motion-duration-fast,120ms) var(--hfx-motion-easing-standard,cubic-bezier(.2,0,0,1));
|
|
214
|
+
}
|
|
215
|
+
:where(.cx-disclosure)::before{
|
|
216
|
+
content:"";inline-size:calc(var(--hfx-icon-md,16px)*.4375);block-size:calc(var(--hfx-icon-md,16px)*.4375);
|
|
217
|
+
border-inline-end:calc(var(--hfx-border-width,1px)*1.6) solid currentColor;border-block-end:calc(var(--hfx-border-width,1px)*1.6) solid currentColor;transform:rotate(-45deg);
|
|
218
|
+
}
|
|
219
|
+
:where([aria-expanded="true"]) > :where(.cx-disclosure),:where(.cx-disclosure)[data-open]{transform:rotate(90deg);}
|
|
220
|
+
:where(:dir(rtl)) :where(.cx-disclosure)::before{transform:rotate(135deg);}
|
|
221
|
+
:where(.cx-empty-state){
|
|
222
|
+
display:grid;justify-items:center;gap:var(--hfx-space-2,0.5rem);padding:var(--hfx-space-6,2rem) var(--hfx-space-4,1rem);text-align:center;color:var(--hfx-color-text-secondary,light-dark(#4d525b,#b0b4bc));
|
|
223
|
+
}
|
|
224
|
+
:where(.cx-empty-state) > :where(strong,h2,h3){color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));font-size:var(--hfx-type-heading-size,0.9375rem);font-weight:var(--hfx-weight-semibold,600);}
|
|
225
|
+
:where(.cx-empty-state)[data-tone="danger"] > :where(strong,h2,h3){color:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));}
|
|
226
|
+
:where(.cx-notice){
|
|
227
|
+
display:flex;align-items:center;gap:var(--hfx-space-2,0.5rem);padding:var(--hfx-space-2,0.5rem) var(--hfx-space-3,0.75rem);
|
|
228
|
+
border:var(--hfx-border-width,1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-inline-start:calc(var(--hfx-border-width,1px)*3) solid var(--cx-notice,var(--hfx-color-accent,light-dark(#11776f,#37c9b8)));
|
|
229
|
+
border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));font-size:var(--hfx-type-small-size,0.8125rem);
|
|
230
|
+
}
|
|
231
|
+
:where(.cx-notice).cx-tone-info{--cx-notice:var(--hfx-color-status-info-fg,light-dark(#2b5fc0,#74a2f7));}
|
|
232
|
+
:where(.cx-notice).cx-tone-success{--cx-notice:var(--hfx-color-status-good-fg,light-dark(#177345,#4cc78a));}
|
|
233
|
+
:where(.cx-notice).cx-tone-warning{--cx-notice:var(--hfx-color-status-warn-fg,light-dark(#8c5c05,#eeb640));}
|
|
234
|
+
:where(.cx-notice).cx-tone-danger{--cx-notice:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));}
|
|
235
|
+
@media (prefers-reduced-motion:reduce){:where(.cx-toggle,.cx-toggle::before,.cx-disclosure){transition:none;}}
|
|
236
|
+
@media (forced-colors:active){
|
|
237
|
+
:where(.cx-btn,.cx-button,.cx-ui-button,.cx-chip,.cx-segmented > *):is([aria-pressed="true"],[aria-checked="true"],.active){forced-color-adjust:none;background:Highlight;color:HighlightText;}
|
|
238
|
+
:where(.cx-toggle){border:var(--hfx-border-width,1px) solid ButtonText;}
|
|
239
|
+
:where(.cx-toggle):checked{background:Highlight;}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
118
242
|
.cx-host.cx-flow-host{min-height:0;display:block;background:transparent;}
|
|
119
243
|
.cx-host:where(.cx-flow-host:not([data-cx-height])){height:auto;}
|
|
120
244
|
body.cx-page > .cx-host.cx-flow-host:not([data-cx-height]),body.cx-page > .cx-main > .cx-host.cx-flow-host:not([data-cx-height]){height:auto;padding:0;}
|
|
@@ -58,7 +58,7 @@ function gridDateInputMoment(text,local){const match=/^(\d{4})-(\d{2})-(\d{2})T(
|
|
|
58
58
|
if(!match)return null;const moment=gridMomentFromParts(Number(match[1]),Number(match[2]),Number(match[3]),Number(match[4]),Number(match[5]),Number(match[6]||0),local);if(moment)moment.setTime(moment.getTime()+ Number((match[7]||"").padEnd(3,"0")));return moment}
|
|
59
59
|
function gridFreeze(value){if(value&&typeof value==="object"&&!Object.isFrozen(value)){Object.values(value).forEach(gridFreeze);Object.freeze(value)}
|
|
60
60
|
return value}
|
|
61
|
-
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"forms":["0d77c25f4fa14425","canopyx-forms.3b18e30a2aeb56dd.js","canopyx-forms.e3a0e1f016287057.css"],"flow":["93f8d2eb57cc1770","canopyx-flow.c3f65a21ced2d654.js","canopyx-flow.68af38159226dd08.css"],"flow-host":["6f335df747cc5f05","canopyx-flow-host.ea0be90307b19d0f.js","canopyx-flow-host.87b00b9ed5899f1f.css"],"flow-checks":["
|
|
61
|
+
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"forms":["0d77c25f4fa14425","canopyx-forms.3b18e30a2aeb56dd.js","canopyx-forms.e3a0e1f016287057.css"],"flow":["93f8d2eb57cc1770","canopyx-flow.c3f65a21ced2d654.js","canopyx-flow.68af38159226dd08.css"],"flow-host":["6f335df747cc5f05","canopyx-flow-host.ea0be90307b19d0f.js","canopyx-flow-host.87b00b9ed5899f1f.css"],"flow-checks":["1710216916cb32a5","canopyx-flow-checks.5a3e04709a556310.js","canopyx-flow-checks.e97a4514fd32bde5.css"],"flow-options":["60450342239ded26","canopyx-flow-options.d31458a54aa4b1e7.js"],"flow-pick":["e5f79a9e81e93898","canopyx-flow-pick.e17b209908086225.js","canopyx-flow-pick.7ec005490120da23.css"],"flow-records":["d02b7dc1c7f75805","canopyx-flow-records.5efc3b14cf70b524.js","canopyx-flow-records.cf62ae7260a46ec4.css"],"flow-drafts":["40dc8e50169fa271","canopyx-flow-drafts.67fb3ab7fbc22606.js","canopyx-flow-drafts.f8535eb8992ea36a.css"],"flow-preview":["3d8ffe456323db95","canopyx-flow-preview.4731603add2f8e84.js","canopyx-flow-preview.f1c740bc97130a7d.css"],"flow-command":["a6c75cf736c93444","canopyx-flow-command.f3608c38cc18f333.js","canopyx-flow-command.279d6ad310e39e97.css"],"flow-tasks":["8d9ea504e81e8fcd","canopyx-flow-tasks.eeb43b791491b43b.js","canopyx-flow-tasks.5c0dc5743e02c670.css"],"flow-dialog":["c3b57a7478b94a93","canopyx-flow-dialog.a98f91c1fe0ade3b.js","canopyx-flow-dialog.98c7ea17adc9a223.css"],"flow-links":["2c14b19c9236e90d","canopyx-flow-links.7b6cfe42d28b6067.js"],"flow-endpoint":["f5cddfc9545e0920","canopyx-flow-endpoint.b31146202bd76aac.js"],"flow-facts":["385b5e61ed487e16","canopyx-flow-facts.8dad3bc07a71fdb0.js"],"flow-consent":["22121778bc0d07c5","canopyx-flow-consent.749b97f13039bc71.js","canopyx-flow-consent.9f6580d3673ae8bf.css"]},PART_CODE=new Map(),SHARED_PARTS={},partName=name=>typeof name==="string"&&/^[a-z][a-z\d-]{0,31}$/.test(name);
|
|
62
62
|
function registerPart(name,part){if(!partName(name)||!part||typeof part.version!=="string"||typeof part.install!=="function"||
|
|
63
63
|
part.requires!==undefined&&!(Array.isArray(part.requires)&&part.requires.every(partName)))throw new Error("CanopyX: invalid part.");PART_CODE.set(name,part)}
|
|
64
64
|
function definePart(View,name,label,context){const parts=View.prototype.parts||={};return parts[name]={name,label,context,parts}}
|
|
@@ -67,7 +67,7 @@ script.textContent=trusted("Script",payload.textContent);script.nonce=payload.no
|
|
|
67
67
|
const load=(element,attribute,file,kind)=>new Promise((resolve,reject)=>{const url=new URL(file,runtime).href;element[attribute]=attribute==="src"?trusted("ScriptURL",url):url;element.onload=resolve;element.onerror=()=>{element.remove();reject(new Error("CanopyX: "+part.label+" "+kind+" unavailable."))};document.head.appendChild(withNonce(element))});const link=h("link");link.rel="stylesheet";const style=styleFile&&(part.styleReady||=load(link,"href",hashed?styleFile:"canopyx-"+part.name+".css","stylesheet")
|
|
68
68
|
.catch(error=>{part.styleReady=null;throw error}));const code=PART_CODE.get(part.name)?.version===part.version||(part.scriptReady||=load(script,"src",hashed?scriptFile:"canopyx-"+part.name+".js","script")
|
|
69
69
|
.finally(()=>script.remove()).catch(error=>{part.scriptReady=null;throw error}));await Promise.all([style,code])}}
|
|
70
|
-
const code=PART_CODE.get(part.name);if(code?.version!==part.version)throw new Error("CanopyX: "+part.label+" and runtime must come from the same build.");for(const name of code.requires||[])await loadPart(part.parts[name]);code.install(part.context())}).catch(error=>{part.ready=null;throw error})}
|
|
70
|
+
const code=PART_CODE.get(part.name);if(code?.version!==part.version)throw new Error("CanopyX: "+part.label+" and runtime must come from the same build.");for(const name of code.requires||[])await loadPart(part.parts[name]||SHARED_PARTS[name]);code.install(part.context())}).catch(error=>{part.ready=null;throw error})}
|
|
71
71
|
const partQueue=global.CanopyXParts=global.CanopyXParts||[];partQueue.forEach(entry=>registerPart(...entry));partQueue.length=0;partQueue.push=(...entries)=>{entries.forEach(entry=>registerPart(...entry));return 0};class FlowHost{}
|
|
72
72
|
const FORMS_IMPL={},FLOW_IMPL={},activeFlows=new WeakMap();const FORMS_PART=definePart(FlowHost,"forms","forms",()=>({FORMS_IMPL,h,setText,fill,gridFreeze,gridMomentFromParts,boundedPattern,foldText}));const FLOW_VIEWS=typeof FLOW_GRID_VIEWS==="object"?FLOW_GRID_VIEWS:Object.freeze({grid:null,tree:null,reporting:false});const FLOW_PART=definePart(FlowHost,"flow","flow view",()=>({FLOW_IMPL,FORMS_IMPL,h,setText,fill,plural,foldText,boundedPattern,numberFormat,gridFreeze}));const FLOW_FEATURES={};for(const name of["host","checks","options","pick","records","drafts","preview","command","tasks","dialog","links","endpoint","consent","facts"])
|
|
73
73
|
FLOW_FEATURES[name]=definePart(FlowHost,"flow-"+name,"flow "+name,()=>({FLOW_IMPL,FORMS_IMPL,h,setText,fill,plural,numberFormat,FLOW_VIEWS}));if(typeof DataGrid==="function")DataGrid.prototype.parts.forms=FORMS_PART;const FLOW_DOC_PARTS={command:"command",presets:"drafts",draft:"drafts",deepLinks:"links",endpoint:"endpoint"},FLOW_DOC_PLAIN={draft:"none",deepLinks:false};function flowFeatures(doc,hooks){const names=new Set(),add=(name,on)=>on&&names.add(name),list=value=>Array.isArray(value)?value:[];const object=value=>value!==null&&typeof value==="object"&&!Array.isArray(value),has=(value,...keys)=>object(value)&&keys.some(key=>value[key]!==undefined);for(const[key,name]of Object.entries(FLOW_DOC_PARTS))add(name,doc[key]!==undefined&&doc[key]!==FLOW_DOC_PLAIN[key]);add("tasks",doc.mode==="tasks");add("dialog",has(doc.layout,"launch")||has(doc.layout,"container")&&doc.layout.container!=="inline");add("preview",list(doc.endpoint?.routes).includes("preview"));for(const step of list(doc.steps).filter(object)){add("facts",step.facts!==undefined);add("checks",step.checks!==undefined);add("pick",step.type==="pick");add("preview",step.preview===true);add("consent",has(step,"confirm","acknowledge"));for(const block of[step,...list(step.sections)]){if(block!==step)add("options",has(block,"source","dependsOn"));for(const field of object(block)?list(block.fields):[]){add("options",has(field,"dependsOn")||has(field,"source")&&field.source!=="document");add("records",object(field)&&field.type==="records")}}}
|
|
@@ -60,7 +60,7 @@ function gridDateInputMoment(text,local){const match=/^(\d{4})-(\d{2})-(\d{2})T(
|
|
|
60
60
|
if(!match)return null;const moment=gridMomentFromParts(Number(match[1]),Number(match[2]),Number(match[3]),Number(match[4]),Number(match[5]),Number(match[6]||0),local);if(moment)moment.setTime(moment.getTime()+ Number((match[7]||"").padEnd(3,"0")));return moment}
|
|
61
61
|
function gridFreeze(value){if(value&&typeof value==="object"&&!Object.isFrozen(value)){Object.values(value).forEach(gridFreeze);Object.freeze(value)}
|
|
62
62
|
return value}
|
|
63
|
-
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"forms":["0d77c25f4fa14425","canopyx-forms.3b18e30a2aeb56dd.js","canopyx-forms.e3a0e1f016287057.css"],"flow":["93f8d2eb57cc1770","canopyx-flow.c3f65a21ced2d654.js","canopyx-flow.68af38159226dd08.css"],"flow-host":["6f335df747cc5f05","canopyx-flow-host.ea0be90307b19d0f.js","canopyx-flow-host.87b00b9ed5899f1f.css"],"flow-checks":["
|
|
63
|
+
const PART_URL=typeof document!=="undefined"&&document.currentScript?.src;const PARTS={"forms":["0d77c25f4fa14425","canopyx-forms.3b18e30a2aeb56dd.js","canopyx-forms.e3a0e1f016287057.css"],"flow":["93f8d2eb57cc1770","canopyx-flow.c3f65a21ced2d654.js","canopyx-flow.68af38159226dd08.css"],"flow-host":["6f335df747cc5f05","canopyx-flow-host.ea0be90307b19d0f.js","canopyx-flow-host.87b00b9ed5899f1f.css"],"flow-checks":["1710216916cb32a5","canopyx-flow-checks.5a3e04709a556310.js","canopyx-flow-checks.e97a4514fd32bde5.css"],"flow-options":["60450342239ded26","canopyx-flow-options.d31458a54aa4b1e7.js"],"flow-pick":["e5f79a9e81e93898","canopyx-flow-pick.e17b209908086225.js","canopyx-flow-pick.7ec005490120da23.css"],"flow-records":["d02b7dc1c7f75805","canopyx-flow-records.5efc3b14cf70b524.js","canopyx-flow-records.cf62ae7260a46ec4.css"],"flow-drafts":["40dc8e50169fa271","canopyx-flow-drafts.67fb3ab7fbc22606.js","canopyx-flow-drafts.f8535eb8992ea36a.css"],"flow-preview":["3d8ffe456323db95","canopyx-flow-preview.4731603add2f8e84.js","canopyx-flow-preview.f1c740bc97130a7d.css"],"flow-command":["a6c75cf736c93444","canopyx-flow-command.f3608c38cc18f333.js","canopyx-flow-command.279d6ad310e39e97.css"],"flow-tasks":["8d9ea504e81e8fcd","canopyx-flow-tasks.eeb43b791491b43b.js","canopyx-flow-tasks.5c0dc5743e02c670.css"],"flow-dialog":["c3b57a7478b94a93","canopyx-flow-dialog.a98f91c1fe0ade3b.js","canopyx-flow-dialog.98c7ea17adc9a223.css"],"flow-links":["2c14b19c9236e90d","canopyx-flow-links.7b6cfe42d28b6067.js"],"flow-endpoint":["f5cddfc9545e0920","canopyx-flow-endpoint.b31146202bd76aac.js"],"flow-facts":["385b5e61ed487e16","canopyx-flow-facts.8dad3bc07a71fdb0.js"],"flow-consent":["22121778bc0d07c5","canopyx-flow-consent.749b97f13039bc71.js","canopyx-flow-consent.9f6580d3673ae8bf.css"]},PART_CODE=new Map(),SHARED_PARTS={},partName=name=>typeof name==="string"&&/^[a-z][a-z\d-]{0,31}$/.test(name);
|
|
64
64
|
function registerPart(name,part){if(!partName(name)||!part||typeof part.version!=="string"||typeof part.install!=="function"||
|
|
65
65
|
part.requires!==undefined&&!(Array.isArray(part.requires)&&part.requires.every(partName)))throw new Error("CanopyX: invalid part.");PART_CODE.set(name,part)}
|
|
66
66
|
function definePart(View,name,label,context){const parts=View.prototype.parts||={};return parts[name]={name,label,context,parts}}
|
|
@@ -69,7 +69,7 @@ script.textContent=trusted("Script",payload.textContent);script.nonce=payload.no
|
|
|
69
69
|
const load=(element,attribute,file,kind)=>new Promise((resolve,reject)=>{const url=new URL(file,runtime).href;element[attribute]=attribute==="src"?trusted("ScriptURL",url):url;element.onload=resolve;element.onerror=()=>{element.remove();reject(new Error("CanopyX: "+part.label+" "+kind+" unavailable."))};document.head.appendChild(withNonce(element))});const link=h("link");link.rel="stylesheet";const style=styleFile&&(part.styleReady||=load(link,"href",hashed?styleFile:"canopyx-"+part.name+".css","stylesheet")
|
|
70
70
|
.catch(error=>{part.styleReady=null;throw error}));const code=PART_CODE.get(part.name)?.version===part.version||(part.scriptReady||=load(script,"src",hashed?scriptFile:"canopyx-"+part.name+".js","script")
|
|
71
71
|
.finally(()=>script.remove()).catch(error=>{part.scriptReady=null;throw error}));await Promise.all([style,code])}}
|
|
72
|
-
const code=PART_CODE.get(part.name);if(code?.version!==part.version)throw new Error("CanopyX: "+part.label+" and runtime must come from the same build.");for(const name of code.requires||[])await loadPart(part.parts[name]);code.install(part.context())}).catch(error=>{part.ready=null;throw error})}
|
|
72
|
+
const code=PART_CODE.get(part.name);if(code?.version!==part.version)throw new Error("CanopyX: "+part.label+" and runtime must come from the same build.");for(const name of code.requires||[])await loadPart(part.parts[name]||SHARED_PARTS[name]);code.install(part.context())}).catch(error=>{part.ready=null;throw error})}
|
|
73
73
|
const partQueue=global.CanopyXParts=global.CanopyXParts||[];partQueue.forEach(entry=>registerPart(...entry));partQueue.length=0;partQueue.push=(...entries)=>{entries.forEach(entry=>registerPart(...entry));return 0};class FlowHost{}
|
|
74
74
|
const FORMS_IMPL={},FLOW_IMPL={},activeFlows=new WeakMap();const FORMS_PART=definePart(FlowHost,"forms","forms",()=>({FORMS_IMPL,h,setText,fill,gridFreeze,gridMomentFromParts,boundedPattern,foldText}));const FLOW_VIEWS=typeof FLOW_GRID_VIEWS==="object"?FLOW_GRID_VIEWS:Object.freeze({grid:null,tree:null,reporting:false});const FLOW_PART=definePart(FlowHost,"flow","flow view",()=>({FLOW_IMPL,FORMS_IMPL,h,setText,fill,plural,foldText,boundedPattern,numberFormat,gridFreeze}));const FLOW_FEATURES={};for(const name of["host","checks","options","pick","records","drafts","preview","command","tasks","dialog","links","endpoint","consent","facts"])
|
|
75
75
|
FLOW_FEATURES[name]=definePart(FlowHost,"flow-"+name,"flow "+name,()=>({FLOW_IMPL,FORMS_IMPL,h,setText,fill,plural,numberFormat,FLOW_VIEWS}));if(typeof DataGrid==="function")DataGrid.prototype.parts.forms=FORMS_PART;const FLOW_DOC_PARTS={command:"command",presets:"drafts",draft:"drafts",deepLinks:"links",endpoint:"endpoint"},FLOW_DOC_PLAIN={draft:"none",deepLinks:false};function flowFeatures(doc,hooks){const names=new Set(),add=(name,on)=>on&&names.add(name),list=value=>Array.isArray(value)?value:[];const object=value=>value!==null&&typeof value==="object"&&!Array.isArray(value),has=(value,...keys)=>object(value)&&keys.some(key=>value[key]!==undefined);for(const[key,name]of Object.entries(FLOW_DOC_PARTS))add(name,doc[key]!==undefined&&doc[key]!==FLOW_DOC_PLAIN[key]);add("tasks",doc.mode==="tasks");add("dialog",has(doc.layout,"launch")||has(doc.layout,"container")&&doc.layout.container!=="inline");add("preview",list(doc.endpoint?.routes).includes("preview"));for(const step of list(doc.steps).filter(object)){add("facts",step.facts!==undefined);add("checks",step.checks!==undefined);add("pick",step.type==="pick");add("preview",step.preview===true);add("consent",has(step,"confirm","acknowledge"));for(const block of[step,...list(step.sections)]){if(block!==step)add("options",has(block,"source","dependsOn"));for(const field of object(block)?list(block.fields):[]){add("options",has(field,"dependsOn")||has(field,"source")&&field.source!=="document");add("records",object(field)&&field.type==="records")}}}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(global){"use strict";const installed=new WeakSet();const part={version:"
|
|
1
|
+
(function(global){"use strict";const installed=new WeakSet();const part={version:"5398e457a885ef0d",requires:["filter-editor","formatting"],install(context){if(installed.has(context.DataGrid.prototype))return;const{DataGrid,h,setText,fill,gridButton,gridVariant,gridOption,gridDateInputMoment,gridInputLabel,gridIcon,gridDecorateButton,announceMenu,formatCompile,formatToneVar,formatError,FORMAT_ICONS,FORMAT_TONE_ICONS,FORMAT_OPERATORS,svgIcon,overlayTheme}=context;const FORMAT_EDITOR_LABELS={formatRule:"Rule {number}",formatAddRule:"Add rule",formatEditRule:"Edit {rule}",formatDeleteRule:"Delete {rule}",formatMoveUp:"Move {rule} up",formatMoveDown:"Move {rule} down",formatEnableRule:"Apply {rule}",formatNoRules:"No formatting rules.",formatName:"Name",formatDescription:"Screen reader description",formatOnlyRowsWhere:"Only rows where",formatEveryRow:"Every row",formatNone:"None",formatApplyTo:"Apply to",formatTargetCell:"Cell",formatTargetRow:"Whole row",formatTargetColumns:"Chosen columns",formatStyle:"Style",formatHighlight:"Highlight",formatDataBar:"Data bar",formatColorScale:"Colour scale",formatBands:"Threshold bands",formatTone:"Tone",formatEmphasis:"Emphasis",formatFill:"Fill",formatTextOnly:"Text colour",formatStrong:"Bold fill",formatIcon:"Icon",formatNoIcon:"No icon",formatAutomatic:"Automatic",formatBadge:"Badge",formatCue:"Text cue",formatLowest:"Lowest",formatMidpoint:"Midpoint",formatHighest:"Highest",formatAddBand:"+ Band",formatRemoveBand:"Remove band",formatSave:"Save rule",formatCancel:"Cancel",formatShowLegend:"Show legend",formatInvalid:"Complete the rule before saving.",formatMatchCase:"Match case",formatToneDanger:"Danger",formatToneWarning:"Warning",formatToneSuccess:"Success",formatToneInfo:"Info",formatToneNeutral:"Neutral",formatToneMuted:"Muted",formatNotContains:"does not contain",formatEndsWith:"ends with",formatNotIn:"is none of",formatBetween:"between",formatLike:"matches wildcard",formatMatches:"matches pattern",formatOlderThan:"older than (days)",formatWithinLast:"within the last (days)",formatNotLike:"does not match wildcard",formatNotMatches:"does not match pattern",formatBetweenExclusive:"between (exclusive)"};function formatIconButton(label,icon,run){const button=gridDecorateButton(gridButton("",run),icon==="edit"?"more":icon,true);if(icon==="edit")button.querySelector("svg").replaceWith(svgIcon('<path d="M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4"/>'));button.classList.add("icon");button.setAttribute("aria-label",label);button.title=label;return button}
|
|
2
2
|
function formatPreview(style){const swatch=h("span","cx-format-swatch"),stops=style.scale?style.scale.stops.map(stop=>stop.tone):style.bands?style.bands.map(band=>band.tone):null;swatch.setAttribute("aria-hidden","true");if(stops){swatch.classList.add("cx-fmt-gradient");swatch.style.setProperty("--cx-fmt-scale","linear-gradient(90deg,"+stops.map(formatToneVar).join(",")+ ")")}
|
|
3
3
|
else if(style.bar){swatch.classList.add("cx-fmt-barred");const bar=h("span","cx-fmt-bar");bar.style.setProperty("--cx-fmt-w","70%");bar.style.setProperty("--cx-fmt",formatToneVar(style.bar.tone||"info"));swatch.appendChild(bar)}
|
|
4
4
|
else if(style.tone){swatch.classList.add("cx-fmt-fill");swatch.style.setProperty("--cx-fmt",formatToneVar(style.tone));const name=!style.icon||style.icon==="auto"?FORMAT_TONE_ICONS[style.tone]||"dot":style.icon;if(name!=="none")setText(swatch,FORMAT_ICONS[name]||name)}else if(style.badge)setText(swatch,style.badge.slice(0,2));return swatch}
|
|
5
5
|
Object.assign(DataGrid.prototype,{showFormatEditor(){this.formatEditor?.close();if(!this.formatLabels.formatAddRule){const own={};for(const name of Object.keys(FORMAT_EDITOR_LABELS))own[name]=Object.hasOwn(this.labels,name)?this.labels[name]:FORMAT_EDITOR_LABELS[name];this.formatLabels={...this.formatLabels,...own}}
|
|
6
6
|
const labels=this.formatLabels,returnFocus=document.activeElement,phone=this.host.clientWidth<=640;const dialog=h("dialog","cx-host cx-grid-overlay cx-format-editor"),head=h("div","cx-drawer-h"),title=h("h4"),body=h("div","cx-format-body"),status=h("p","cx-grid-control-error"),foot=h("div","cx-pop-f");overlayTheme(this.host,dialog);dialog.classList.toggle("cx-phone",phone);title.id=this.id+"-format-title";title.tabIndex=-1;setText(title,labels.formatRules);dialog.setAttribute("aria-labelledby",title.id);status.setAttribute("role","status");head.append(title,formatIconButton(labels.formatCancel,"close",()=>dialog.close()));dialog.append(head,body,status,foot);document.body.appendChild(dialog);this.formatEditor=dialog;const editor={dialog,body,foot,status,title,rules:JSON.parse(JSON.stringify(this.getFormatRules()))};editor.apply=()=>this.setFormatRules(editor.rules).then(()=>{setText(status,"");return true},error=>{setText(status,error.message);return false});editor.list=focus=>this.renderFormatList(editor,focus);dialog.addEventListener("keydown",event=>{if(event.key==="Escape"){event.preventDefault();event.stopPropagation();if(editor.back)editor.back();else dialog.close()}});dialog.addEventListener("close",()=>{dialog.remove();if(this.formatEditor===dialog)this.formatEditor=null;if(!this.destroyed)(returnFocus?.isConnected&&returnFocus.checkVisibility?.()?returnFocus:this.grid).focus({preventScroll:true})},{once:true});const owner=new AbortController();this.lifetime.signal.addEventListener("abort",()=>dialog.close(),{once:true,signal:owner.signal});dialog.addEventListener("close",()=>owner.abort(),{once:true});announceMenu(dialog);dialog.showModal();editor.list();title.focus({preventScroll:true});return dialog},renderFormatList(editor,focus){const labels=this.formatLabels,{body,foot,rules}=editor,name=(rule,index)=>rule.label||fill(labels.formatRule,{number:index+1});editor.back=null;setText(editor.title,labels.formatRules);body.replaceChildren();foot.replaceChildren();const list=h("ol","cx-format-rules");list.setAttribute("aria-label",labels.formatRules);const change=(mutate,next)=>{mutate();editor.apply().then(ok=>{if(!ok)editor.rules=JSON.parse(JSON.stringify(this.getFormatRules()));editor.list(next)})};rules.forEach((rule,index)=>{const item=h("li","cx-format-item"),toggle=h("input"),text=h("span","cx-format-item-text"),title=h("b"),summary=h("span","cx-muted"),actions=h("span","cx-format-actions");const label=name(rule,index);toggle.type="checkbox";toggle.checked=rule.enabled!==false;toggle.setAttribute("aria-label",fill(labels.formatEnableRule,{rule:label}));toggle.addEventListener("change",()=>change(()=>{if(toggle.checked)delete rule.enabled;else rule.enabled=false},"toggle:"+index));setText(title,label);setText(summary,this.formatSummary(rule));text.append(title,summary);const move=(by,key)=>()=>change(()=>rules.splice(index+by,0,rules.splice(index,1)[0]),key+":" +(index+by));const up=formatIconButton(fill(labels.formatMoveUp,{rule:label}),"up",move(-1,"up")),down=formatIconButton(fill(labels.formatMoveDown,{rule:label}),"down",move(1,"down"));up.disabled=index===0;down.disabled=index===rules.length-1;const edit=formatIconButton(fill(labels.formatEditRule,{rule:label}),"edit",()=>this.renderFormatRule(editor,index));edit.dataset.cxFocus="edit:"+index;const remove=formatIconButton(fill(labels.formatDeleteRule,{rule:label}),"close",()=>change(()=>rules.splice(index,1),"add"));toggle.dataset.cxFocus="toggle:"+index;up.dataset.cxFocus="up:"+index;down.dataset.cxFocus="down:"+index;actions.append(up,down,edit,remove);item.append(toggle,formatPreview(rule.style||{}),text,actions);list.appendChild(item)});if(rules.length)body.appendChild(list);else{const empty=h("p","cx-muted");setText(empty,labels.formatNoRules);body.appendChild(empty)}
|
|
7
|
-
const add=gridButton(labels.formatAddRule,()=>this.renderFormatRule(editor,-1));add.classList.add("cx-link");add.dataset.cxFocus="add";add.disabled=rules.length>=64;const legend=h("input"),legendLabel=gridInputLabel(labels.formatShowLegend,legend);legend.type="checkbox";legend.checked=!!this.formatLegendShown;legendLabel.classList.add("cx-format-legend-switch");legend.addEventListener("change",()=>this.setFormatLegend(legend.checked));const done=gridButton(this.labels.gridDone,()=>editor.dialog.close());foot.append(add,legendLabel,done);const target=focus&&editor.dialog.querySelector('[data-cx-focus="'+focus+'"]');if(target&&!target.disabled)target.focus({preventScroll:true});else if(focus)add.focus({preventScroll:true})},formatSummary(rule){const labels=this.formatLabels,title=id=>this.columns.find(column=>column.id===id)?.title||id,style=rule.style||{};const target=rule.target==="row"?labels.formatTargetRow:rule.target==="columns"?(rule.columns||[]).map(title).join(", "):labels.formatTargetCell+" · "+title(rule.column);const kind=style.bar?labels.formatDataBar:style.scale?labels.formatColorScale:style.bands?labels.formatBands:labels.formatHighlight;return[target,kind,rule.when?null:labels.formatEveryRow].filter(Boolean).join(" · ")}});const FORMAT_TONES=["danger","warning","success","info","neutral","muted"];function formatField(text,control,className){const label=control.tagName==="DIV"?h("div"):gridInputLabel(text,control);if(control.tagName==="DIV"){const heading=h("span");setText(heading,text);heading.setAttribute("aria-hidden","true");label.append(heading,control)}
|
|
7
|
+
const add=gridButton(labels.formatAddRule,()=>this.renderFormatRule(editor,-1));add.classList.add("cx-link");add.dataset.cxFocus="add";add.disabled=rules.length>=64;const legend=h("input"),legendLabel=gridInputLabel(labels.formatShowLegend,legend);legend.type="checkbox";legend.checked=!!this.formatLegendShown;legendLabel.classList.add("cx-format-legend-switch");legend.addEventListener("change",()=>this.setFormatLegend(legend.checked));const done=gridVariant(gridButton(this.labels.gridDone,()=>editor.dialog.close()),"primary");foot.append(add,legendLabel,done);const target=focus&&editor.dialog.querySelector('[data-cx-focus="'+focus+'"]');if(target&&!target.disabled)target.focus({preventScroll:true});else if(focus)add.focus({preventScroll:true})},formatSummary(rule){const labels=this.formatLabels,title=id=>this.columns.find(column=>column.id===id)?.title||id,style=rule.style||{};const target=rule.target==="row"?labels.formatTargetRow:rule.target==="columns"?(rule.columns||[]).map(title).join(", "):labels.formatTargetCell+" · "+title(rule.column);const kind=style.bar?labels.formatDataBar:style.scale?labels.formatColorScale:style.bands?labels.formatBands:labels.formatHighlight;return[target,kind,rule.when?null:labels.formatEveryRow].filter(Boolean).join(" · ")}});const FORMAT_TONES=["danger","warning","success","info","neutral","muted"];function formatField(text,control,className){const label=control.tagName==="DIV"?h("div"):gridInputLabel(text,control);if(control.tagName==="DIV"){const heading=h("span");setText(heading,text);heading.setAttribute("aria-hidden","true");label.append(heading,control)}
|
|
8
8
|
label.classList.add("cx-format-field");if(className)label.classList.add(className);if(control.tagName==="SELECT"||control.tagName==="INPUT"&&control.type!=="checkbox")control.classList.add("cx-input");return label}
|
|
9
9
|
function formatSelect(options,value){const select=h("select");for(const[key,text]of options)select.appendChild(gridOption(key,text));if(value!==undefined&&options.some(option=>option[0]===value))select.value=value;return select}
|
|
10
10
|
function formatNumberInput(value,placeholder){const input=h("input");input.type="number";input.step="any";if(placeholder)input.placeholder=placeholder;if(value!==undefined&&value!==null)input.value=String(value);return input}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(global){"use strict";const installed=new WeakSet();const part={version:"
|
|
1
|
+
(function(global){"use strict";const installed=new WeakSet();const part={version:"7d7402e30ec311ca",install(context){if(installed.has(context.DataGrid.prototype))return;const{toneVariable,DataGrid,h,setText,setClass,fill,gridFreeze,gridDateInputMoment,cellValue,cellText,foldText,toneOf,numberFormat,gridButton,gridVariant,gridOption,gridInputLabel,gridIcon,gridDecorateButton,GRID_REPORTING,loadPart,definePart,announceMenu,boundedPattern,wildcardMatch,svgIcon,overlayTheme}=context;const FORMAT_OPERATORS={eq:1,ne:1,gt:1,ge:1,lt:1,le:1,contains:1,notContains:1,startsWith:1,endsWith:1,like:1,notLike:1,matches:1,notMatches:1,in:-1,notIn:-1,between:2,betweenExclusive:2,isNull:0,isNotNull:0,olderThan:1,withinLast:1};const FORMAT_TYPES=["text","number","boolean","date"],FORMAT_DAY=86400000;function formatError(message){throw new Error("CanopyX: "+message)}
|
|
2
2
|
function formatKeys(value,keys,what){if(!value||typeof value!=="object"||Array.isArray(value)||Object.keys(value).some(key=>!keys.includes(key)))formatError("invalid "+what+".")}
|
|
3
3
|
const formatCultures=new Map();function formatCulture(culture){let entry=formatCultures.get(culture);if(!entry){let tag;try{tag=Intl.getCanonicalLocales(culture)[0]}catch(_){formatError("unknown culture '"+culture+"'.")}
|
|
4
4
|
const parts=new Intl.NumberFormat(tag).formatToParts(12345.6),part=type=>(parts.find(item=>item.type===type)||{}).value;entry={tag,group:part("group")||",",decimal:part("decimal")||".",accent:new Intl.Collator(tag,{sensitivity:"accent"}),variant:new Intl.Collator(tag,{sensitivity:"variant"})};if(formatCultures.size<64)formatCultures.set(culture,entry)}
|
|
@@ -17,7 +17,7 @@ formatError("invalid formatting condition.");const patterned=op==="like"||op==="
|
|
|
17
17
|
formatError("formatting condition '"+op+"' has the wrong number of values.");if(values.some(value=>!(typeof value==="string"&&value.length<=4096||typeof value==="boolean"||Number.isFinite(value))))
|
|
18
18
|
formatError("condition values are text, finite numbers or booleans.");const culture=predicate.culture?formatCulture(predicate.culture):null,exact=!!predicate.caseSensitive;const type=op==="olderThan"||op==="withinLast"?"date":predicate.type||(column.kind==="number"?"number":column.kind==="datetime"?"date":null);if((op==="olderThan"||op==="withinLast")&&!(typeof values[0]==="number"&&values[0]>=0&&values[0]<=36500))
|
|
19
19
|
formatError("relative dates take a number of days from 0 to 36500.");const text=value=>typeof value==="string"?exact?value:culture?value.toLocaleLowerCase(culture.tag):foldText(value):value;const read=(cells,id)=>text(formatCoerce(cellValue(cells[id]),type,culture));const collator=culture&&(exact?culture.variant:culture.accent);const order=(a,b)=>typeof a==="string"&&typeof b==="string"&&collator?collator.compare(a,b):a<b?-1:a>b?1:0;let operands=[],pattern=null;if(patterned){const source=String(values[0]);if(source.length>256)formatError("patterns have at most 256 characters.");try{pattern=op==="like"||op==="notLike"?{test:value=>wildcardMatch(source,value,exact)}:boundedPattern(source,exact)}
|
|
20
|
-
catch(_){formatError("invalid pattern '"+source+"'.")}}else if(op==="olderThan"||op==="withinLast")operands=[values[0]*FORMAT_DAY];else operands=values.map(value=>{const typed=text(formatCoerce(value,type,culture));if(typed===null)formatError("value '"+value+"' does not convert to " +(type||"text")+ ".");return typed});if((op==="between"||op==="betweenExclusive")&&order(operands[0],operands[1])>0)formatError("a range starts with its lower value.");const id=column.id,otherId=other&&other.id,set=arity<0&&!collator?new Set(operands):null;const member=value=>set?set.has(value):operands.some(operand=>typeof operand===typeof value&&order(value,operand)===0);budget.relative||=op==="olderThan"||op==="withinLast";return row=>{const value=read(row.cells,id);if(op==="isNull")return value===null;if(op==="isNotNull"||value===null)return op==="isNotNull"&&value!==null;const operand=other?read(row.cells,otherId):operands[0];if(operand===null)return false;switch(op){case "eq":return order(value,operand)===0&&typeof value===typeof operand;case "ne":return!(order(value,operand)===0&&typeof value===typeof operand);case "gt":return order(value,operand)>0;case "ge":return order(value,operand)>=0;case "lt":return order(value,operand)<0;case "le":return order(value,operand)<=0;case "in":return member(value);case "notIn":return!member(value);case "between":return order(value,operand)>=0&&order(value,operands[1])<=0;case "betweenExclusive":return order(value,operand)>0&&order(value,operands[1])<0;case "contains":return String(value).includes(String(operand));case "notContains":return!String(value).includes(String(operand));case "startsWith":return String(value).startsWith(String(operand));case "endsWith":return String(value).endsWith(String(operand));case "like":case "matches":return pattern.test(String(value).slice(0,4096));case "notLike":case "notMatches":return!pattern.test(String(value).slice(0,4096));case "olderThan":return value<
|
|
20
|
+
catch(_){formatError("invalid pattern '"+source+"'.")}}else if(op==="olderThan"||op==="withinLast")operands=[values[0]*FORMAT_DAY];else operands=values.map(value=>{const typed=text(formatCoerce(value,type,culture));if(typed===null)formatError("value '"+value+"' does not convert to " +(type||"text")+ ".");return typed});if((op==="between"||op==="betweenExclusive")&&order(operands[0],operands[1])>0)formatError("a range starts with its lower value.");const id=column.id,otherId=other&&other.id,set=arity<0&&!collator?new Set(operands):null;const member=value=>set?set.has(value):operands.some(operand=>typeof operand===typeof value&&order(value,operand)===0);budget.relative||=op==="olderThan"||op==="withinLast";return row=>{const value=read(row.cells,id);if(op==="isNull")return value===null;if(op==="isNotNull"||value===null)return op==="isNotNull"&&value!==null;const operand=other?read(row.cells,otherId):operands[0];if(operand===null)return false;switch(op){case "eq":return order(value,operand)===0&&typeof value===typeof operand;case "ne":return!(order(value,operand)===0&&typeof value===typeof operand);case "gt":return order(value,operand)>0;case "ge":return order(value,operand)>=0;case "lt":return order(value,operand)<0;case "le":return order(value,operand)<=0;case "in":return member(value);case "notIn":return!member(value);case "between":return order(value,operand)>=0&&order(value,operands[1])<=0;case "betweenExclusive":return order(value,operand)>0&&order(value,operands[1])<0;case "contains":return String(value).includes(String(operand));case "notContains":return!String(value).includes(String(operand));case "startsWith":return String(value).startsWith(String(operand));case "endsWith":return String(value).endsWith(String(operand));case "like":case "matches":return pattern.test(String(value).slice(0,4096));case "notLike":case "notMatches":return!pattern.test(String(value).slice(0,4096));case "olderThan":return value<budget.now()- operand;case "withinLast":{const now=budget.now();return value>=now-operand&&value<=now}}
|
|
21
21
|
return false}}
|
|
22
22
|
function formatGroup(group,columns,budget,depth){if(depth>8||++budget.groups>64)formatError("formatting conditions exceed eight levels or 64 groups.");formatKeys(group,["operator","filters","groups"],"formatting condition group");const filters=group.filters??[],groups=group.groups??[];if(!["and","or","none"].includes(group.operator)||!Array.isArray(filters)||!Array.isArray(groups)||!filters.length&&!groups.length)
|
|
23
23
|
formatError("invalid or empty formatting condition group.");const tests=[...filters.map(filter=>formatPredicate(filter,columns,budget)),...groups.map(child=>formatGroup(child,columns,budget,depth+1))];const count=tests.length;if(group.operator==="and")return row=>{for(let i=0;i<count;i++)if(!tests[i](row))return false;return true};const any=row=>{for(let i=0;i<count;i++)if(tests[i](row))return true;return false};return group.operator==="or"?any:row=>!any(row)}
|
|
@@ -37,11 +37,11 @@ if(style.bands!==undefined){const bands=style.bands;if(!Array.isArray(bands)||!b
|
|
|
37
37
|
formatError("threshold bands rise, and only the last may be open.")})}
|
|
38
38
|
if(!["tone","icon","badge","cue","className","css",...visuals].some(name=>style[name]!==undefined&&style[name]!=="none"))
|
|
39
39
|
formatError("a formatting rule needs a style.")}
|
|
40
|
-
function formatCompile(rules,grid){if(!Array.isArray(rules)||rules.length>64)formatError("a grid has at most 64 formatting rules.");const columns=new Map(grid.columns.map(column=>[column.id,column])),ids=new Set();return rules.map((rule,index)=>{formatKeys(rule,["id","label","description","enabled","when","column","target","columns","details","style","stopIfTrue"],"formatting rule");if(typeof rule.id!=="string"||!/^[A-Za-z0-9][\w.:-]{0,63}$/.test(rule.id) || ids.has(rule.id)) formatError("formatting rules need unique identifiers.");
|
|
40
|
+
function formatCompile(rules,grid,now=Date.now){if(!Array.isArray(rules)||rules.length>64)formatError("a grid has at most 64 formatting rules.");const columns=new Map(grid.columns.map(column=>[column.id,column])),ids=new Set();return rules.map((rule,index)=>{formatKeys(rule,["id","label","description","enabled","when","column","target","columns","details","style","stopIfTrue"],"formatting rule");if(typeof rule.id!=="string"||!/^[A-Za-z0-9][\w.:-]{0,63}$/.test(rule.id) || ids.has(rule.id)) formatError("formatting rules need unique identifiers.");
|
|
41
41
|
ids.add(rule.id);formatText(rule.label,200);formatText(rule.description,1000);const target=rule.target??"cell";if(!["cell","row","columns"].includes(target)||["enabled","details","stopIfTrue"].some(name=>rule[name]!==undefined&&typeof rule[name]!=="boolean")||
|
|
42
42
|
rule.column!==undefined&&!columns.has(rule.column)||target==="cell"&&rule.column===undefined)
|
|
43
43
|
formatError("formatting rule '"+rule.id+"' needs a declared column for its target.");const targets=target==="columns"?rule.columns:target==="cell"?[rule.column]:[];if(target==="columns"?!Array.isArray(targets)||!targets.length||targets.length>64||new Set(targets).size!==targets.length||targets.some(id=>!columns.has(id)):rule.columns!==undefined)
|
|
44
|
-
formatError("formatting rule '"+rule.id+"' names its columns once each.");formatStyle(rule.style,{target,column:rule.column});const budget={predicates:0,groups:0},test=rule.when===undefined?null:formatGroup(rule.when,columns,budget,1);return{id:rule.id,index,label:rule.label,description:rule.description||rule.label||rule.id,enabled:rule.enabled!==false,test,target,column:rule.column,columns:targets,details:rule.details!==false,stop:!!rule.stopIfTrue,style:rule.style,relative:!!budget.relative}})}
|
|
44
|
+
formatError("formatting rule '"+rule.id+"' names its columns once each.");formatStyle(rule.style,{target,column:rule.column});const budget={predicates:0,groups:0,now},test=rule.when===undefined?null:formatGroup(rule.when,columns,budget,1);return{id:rule.id,index,label:rule.label,description:rule.description||rule.label||rule.id,enabled:rule.enabled!==false,test,target,column:rule.column,columns:targets,details:rule.details!==false,stop:!!rule.stopIfTrue,style:rule.style,relative:!!budget.relative}})}
|
|
45
45
|
function formatOptions(options){if(options===undefined)return{};formatKeys(options,["legend","editor"],"formatting options");if(["legend","editor"].some(name=>options[name]!==undefined&&typeof options[name]!=="boolean"))formatError("formatting options are booleans.");return{legend:!!options.legend,editor:!!options.editor}}
|
|
46
46
|
function formatStats(grid){const inline=grid.view.source.kind==="inline"&&(!grid.opts.source||grid.enhanceStore),key=inline?"inline:" +(grid.enhanceStore?.version??0)+ ":"+grid.view.rows.length:grid.queryEpoch+":" +(grid.snapshot?.revision||"")+ ":" +[...grid.pages.keys()].join(",");if(grid.formatStatsKey===key)return grid.formatStatsCache;const wanted=new Set(grid.formatCompiled.filter(rule=>rule.style.bar||rule.style.scale).map(rule=>rule.column)),stats=new Map();if(wanted.size){const rows=inline?grid.view.rows:[...grid.rowCache.values()].map(row=>row.h);for(const id of wanted){let min=Infinity,max=-Infinity;for(const row of rows){const value=formatCoerce(cellValue(row.cells[id]),"number");if(value!==null){if(value<min)min=value;if(value>max)max=value}}
|
|
47
47
|
stats.set(id,min<=max?{min,max}:null)}}
|
|
@@ -56,9 +56,10 @@ return out}
|
|
|
56
56
|
function formatMerge(into,rule,style){const target=into||{rules:[],descriptions:[]};for(const name of["tone","emphasis","icon","badge","cue","className","css","bar","scale","band"])
|
|
57
57
|
if(target[name]===undefined&&style[name]!==undefined)target[name]=style[name];target.rules.push(rule.id);if(rule.description&&!target.descriptions.includes(rule.description))target.descriptions.push(rule.description);if(style.band&&!target.descriptions.includes(style.band))target.descriptions.push(style.band);target.details=target.details||rule.details;return target}
|
|
58
58
|
function formatFinish(target){if(!target)return target;if(target.icon===undefined&&target.tone&&!target.badge&&!target.cue&&!target.bar&&!target.scale)target.icon="auto";const name=target.icon==="auto"?FORMAT_TONE_ICONS[target.tone]||"dot":target.icon;target.glyph=name&&name!=="none"?FORMAT_ICONS[name]||name:null;return target}
|
|
59
|
-
|
|
59
|
+
function formatEvaluate(rules,stats,data,details=false){let row=null,cells=null;for(const rule of rules){if(!rule.enabled||rule.test&&!rule.test(data))continue;const style=formatResolve(rule,data,stats);if(style&&(!details||rule.details)){if(rule.target==="row")row=formatMerge(row,rule,style);else for(const id of rule.columns)(cells||=new Map()).set(id,formatMerge(cells.get(id),rule,style))}
|
|
60
60
|
if(rule.stop)break}
|
|
61
|
-
if(cells)for(const target of cells.values())formatFinish(target);
|
|
61
|
+
if(cells)for(const target of cells.values())formatFinish(target);return row||cells?{row:formatFinish(row),cells:cells||new Map()}:null}
|
|
62
|
+
Object.assign(DataGrid.prototype,{formatResult(data,details=false){const rules=this.formatCompiled;if(!rules||!rules.length)return null;const cache=details?this.formatDetailCache||=new WeakMap():this.formatCache;const stats=formatStats(this),cached=cache.get(data);if(cached&&cached.version===this.formatVersion)return cached.result;const result=formatEvaluate(rules,stats,data,details);cache.set(data,{version:this.formatVersion,result});return result}});const FORMAT_RANK={danger:5,warning:4,info:3,success:2,neutral:1,muted:1};function formatUndo(fx){for(const node of fx.nodes)node.remove();for(const name of fx.props)fx.element.style.removeProperty(name);for(const name of fx.classes)fx.element.classList.remove(name)}
|
|
62
63
|
function formatClearSlot(slot){if(slot.fx){formatUndo(slot.fx);slot.fx=null}
|
|
63
64
|
for(const child of slot.childSlots||[])formatClearSlot(child)}
|
|
64
65
|
function formatClear(element){for(const slot of element._cells||[])if(slot)formatClearSlot(slot);if(element._fx){formatUndo(element._fx);element._fx=null}}
|
|
@@ -66,7 +67,7 @@ function formatEffects(element){return{element,nodes:[],props:[],classes:[]}}
|
|
|
66
67
|
function formatDecorate(element,target,fx,before,emphasis){const add=name=>{if(!element.classList.contains(name)){element.classList.add(name);fx.classes.push(name)}};const prop=(target,name,value)=>{target.style.setProperty(name,value);if(target===element)fx.props.push(name)};const node=(tag,className,text)=>{const item=h(tag,className);if(text)setText(item,text);fx.nodes.push(item);return item};if(target.tone&&emphasis){add("cx-fmt-" +(target.bar||target.scale?"text":target.emphasis||emphasis));prop(element,"--cx-fmt",formatToneVar(target.tone))}
|
|
67
68
|
if(target.scale){add("cx-fmt-scale");prop(element,"--cx-fmt-scale",target.scale)}
|
|
68
69
|
if(target.className)for(const name of target.className.split(/\s+/)) if (name) add(name);
|
|
69
|
-
if(target.css)for(const name of Object.keys(target.css))prop(element,name,target.css[name]);if(target.glyph){const icon=node("span","cx-fmt-icon",target.glyph);icon.setAttribute("aria-hidden","true");if(target.tone)prop(icon,"--cx-fmt",formatToneVar(target.tone));element.insertBefore(icon,before&&before.parentNode===
|
|
70
|
+
if(target.css)for(const name of Object.keys(target.css))prop(element,name,target.css[name]);if(target.glyph){const icon=node("span","cx-fmt-icon",target.glyph);icon.setAttribute("aria-hidden","true");if(target.tone)prop(icon,"--cx-fmt",formatToneVar(target.tone));const line=element.querySelector(":scope > .cx-phone-primary")||element;line.insertBefore(icon,before&&before.parentNode===line?before:line.firstChild)}
|
|
70
71
|
if(target.bar){add("cx-fmt-barred");if(!target.bar.show)add("cx-fmt-novalue");const bar=node("span","cx-fmt-bar");bar.setAttribute("aria-hidden","true");prop(bar,"--cx-fmt-w",(target.bar.width*100).toFixed(1)+ "%");prop(bar,"--cx-fmt",formatToneVar(target.bar.tone));element.insertBefore(bar,element.firstChild)}
|
|
71
72
|
if(target.badge){const badge=node("span","cx-badge cx-fmt-badge",target.badge),tone=toneOf(target.tone||"neutral");badge.className +=tone.cls;if(tone.host){prop(badge,"--cx-t",toneVariable(tone.host));prop(badge,"--cx-t-bg",toneVariable(tone.host,true))}
|
|
72
73
|
element.appendChild(badge)}
|
|
@@ -85,7 +86,7 @@ width=Math.ceil(width+2*pad+4);need=Math.max(need,width);if(flag)floor=Math.max(
|
|
|
85
86
|
if(floor){column.formatMinW=column.minW;column.minW=Math.max(column.minW||0,Math.min(floor,420))}
|
|
86
87
|
return need>result.width||floor>result.width?Object.freeze({...result,width:Math.max(result.width,Math.min(Math.max(need,floor),420))}):result};DataGrid.prototype.formatRefit=function(){this.fitKey=null;if(this.sized&&this.grid.clientWidth)this.applyWidths()};function formatDrawer(grid,dialog){let effects=[];const paint=()=>{effects.forEach(formatUndo);effects=[];const head=dialog.querySelector(".cx-drawer-h"),title=head&&head.querySelector("h4"),data=dialog._cxRecord;if(!dialog.isConnected||!title||!data||!grid.formatCompiled||!grid.formatCompiled.length)return;const result=grid.formatResult(data,true);if(!result)return;if(result.row){const fx=formatEffects(head);effects.push(fx);formatDecorate(head,{tone:result.row.tone,descriptions:result.row.descriptions,glyph:result.row.glyph},fx,title,"accent")}
|
|
87
88
|
for(const field of grid.drawerFields(dialog)){const target=field.column&&result.cells.get(field.column.id);if(!target||!target.details)continue;const fx=formatEffects(field.value);effects.push(fx);formatDecorate(field.value,target,fx,field.value.firstChild,"fill")}};dialog.addEventListener("cx-drawer-paint",paint);dialog.addEventListener("close",()=>{effects.forEach(formatUndo);effects=[]},{once:true})}
|
|
88
|
-
DataGrid.drawerHook(20,function(dialog){formatDrawer(this,dialog)});const FORMAT_EDITOR=definePart(DataGrid,"format-editor","formatting rule editor",()=>({DataGrid,h,setText,fill,gridButton,gridOption,gridDateInputMoment,gridInputLabel,gridIcon,gridDecorateButton,announceMenu,formatCompile,formatToneVar,formatError,FORMAT_ICONS,FORMAT_TONE_ICONS,FORMAT_OPERATORS,svgIcon,overlayTheme}));function formatPick(labels){const own={};for(const name of Object.keys(FORMAT_LABELS))own[name]=Object.hasOwn(labels,name)?labels[name]:FORMAT_LABELS[name];return own}
|
|
89
|
+
DataGrid.drawerHook(20,function(dialog){formatDrawer(this,dialog)});const FORMAT_EDITOR=definePart(DataGrid,"format-editor","formatting rule editor",()=>({DataGrid,h,setText,fill,gridButton,gridVariant,gridOption,gridDateInputMoment,gridInputLabel,gridIcon,gridDecorateButton,announceMenu,formatCompile,formatToneVar,formatError,FORMAT_ICONS,FORMAT_TONE_ICONS,FORMAT_OPERATORS,svgIcon,overlayTheme}));function formatPick(labels){const own={};for(const name of Object.keys(FORMAT_LABELS))own[name]=Object.hasOwn(labels,name)?labels[name]:FORMAT_LABELS[name];return own}
|
|
89
90
|
Object.assign(DataGrid.prototype,{validateFormatRules(rules){formatCompile(rules,this)},startFormatting(){if(this.formatStarted||this.destroyed)return;this.formatStarted=true;this.formatVersion=1;this.formatCache=new WeakMap();this.formatLabels=formatPick(this.labels);try{this.formatOptions=formatOptions(this.view.formatting);this.formatCompiled=formatCompile(this.view.formatRules||[],this)}
|
|
90
91
|
catch(error){this.formatOptions=this.formatOptions||{};this.formatCompiled=[];this.emit("error",{error})}
|
|
91
92
|
this.formatRules=gridFreeze(JSON.parse(JSON.stringify(this.formatCompiled.length?this.view.formatRules:[])));this.formatEdited=false;this.formatLegendShown=!!this.formatOptions.legend;if(this.formatOptions.editor&&this.overflow){const entry=gridButton(this.formatLabels.formatRules,()=>this.openFormatRules().catch(error=>this.emit("error",{error})));entry.classList.add("cx-grid-format-rules");entry.setAttribute("aria-haspopup","dialog");this.overflow.panel.insertBefore(entry,this.overflow.panel.querySelector(".cx-grid-details, .cx-grid-print"))}
|
|
@@ -98,5 +99,5 @@ this.formatLabels.formatAbove+" "+numberFormat(this.lang).format(rule.style.band
|
|
|
98
99
|
this.formatLabels.formatUpTo+" "+numberFormat(this.lang).format(band.upperBound))),{tone:band.tone,icon:band.icon??rule.style.icon}));else key(rule.label,rule.style,rule.description)}
|
|
99
100
|
if(!legend.isConnected)this.host.insertBefore(legend,this.notice)}});function formatExported(target){if(!target)return undefined;const out={rules:target.rules.slice()};for(const name of["tone","badge","cue","band"])if(target[name]!==undefined)out[name]=target[name];if(target.glyph)out.icon=target.glyph;if(target.bar)out.bar={fraction:Math.round(target.bar.width*1000)/ 1000, tone: target.bar.tone };
|
|
100
101
|
if(target.scale)out.color=target.scale;if(target.descriptions.length)out.description=target.descriptions.join(", ");return out}
|
|
101
|
-
GRID_REPORTING.formatRecord=(grid,row,record)=>{const result=
|
|
102
|
+
const FORMAT_EXPORTS=new WeakMap(),FORMAT_PREPARE_EXPORT=DataGrid.prototype.prepareExport;DataGrid.prototype.prepareExport=function(options){const capture=FORMAT_PREPARE_EXPORT.call(this,options),now=Date.now(),rules=this.getFormatRules();const compiled=formatCompile(rules,this,()=>now),stats=compiled.length&&this.formatCompiled?formatStats(this):new Map();FORMAT_EXPORTS.set(capture.request,{rules:compiled,stats:new Map([...stats].map(([id,range])=>[id,range&&{...range}]))});return capture};GRID_REPORTING.copyExportFormatting=(from,to)=>{if(FORMAT_EXPORTS.has(from))FORMAT_EXPORTS.set(to,FORMAT_EXPORTS.get(from))};GRID_REPORTING.formatRecord=(grid,row,record,request)=>{const capture=FORMAT_EXPORTS.get(request),result=capture&&formatEvaluate(capture.rules,capture.stats,row);if(!result)return record;const cells={};for(const[id,cell]of Object.entries(record.cells)){const format=formatExported(result.cells.get(id));cells[id]=format?{...cell,format}:cell}
|
|
102
103
|
return gridFreeze({...record,cells,...(result.row?{format:formatExported(result.row)}:{})})};installed.add(context.DataGrid.prototype)}};(global.CanopyXParts||=[]).push(["formatting",part])})(typeof window!=="undefined"?window:globalThis);
|