@pathscale/ui 3.0.0 → 3.2.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/README.md +13 -2
- package/dist/components/accordion/Accordion.css +24 -1
- package/dist/components/alert/Alert.css +11 -1
- package/dist/components/auth-field-group/AuthFieldGroup.css +11 -3
- package/dist/components/button/Button.css +37 -10
- package/dist/components/calendar/Calendar.generated.d.ts +19 -2
- package/dist/components/calendar/Calendar.generated.js +30 -23
- package/dist/components/calendar/index.d.ts +1 -1
- package/dist/components/card/Card.generated.d.ts +38 -2
- package/dist/components/card/Card.generated.js +99 -45
- package/dist/components/card/Card.interactions.d.ts +70 -0
- package/dist/components/card/Card.interactions.js +19 -0
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/checkbox/Checkbox.generated.d.ts +23 -2
- package/dist/components/checkbox/Checkbox.generated.js +14 -6
- package/dist/components/collapsible/Collapsible.css +17 -1
- package/dist/components/color-wheel-flower/ColorWheelFlower.generated.d.ts +8 -0
- package/dist/components/color-wheel-flower/ColorWheelFlower.generated.js +14 -1
- package/dist/components/color-wheel-flower/colorWheelFlowerContext.d.ts +9 -2
- package/dist/components/color-wheel-flower/colorWheelFlowerContext.js +2 -4
- package/dist/components/connection-settings/ConnectionSettings.css +76 -0
- package/dist/components/connection-settings/ConnectionSettings.generated.d.ts +45 -0
- package/dist/components/connection-settings/ConnectionSettings.generated.js +300 -0
- package/dist/components/connection-settings/ConnectionSettings.recipe.d.ts +54 -0
- package/dist/components/connection-settings/ConnectionSettings.recipe.js +111 -0
- package/dist/components/connection-settings/index.d.ts +2 -0
- package/dist/components/connection-settings/index.js +1 -0
- package/dist/components/date-picker/DatePicker.generated.d.ts +3 -1
- package/dist/components/date-picker/DatePicker.generated.js +8 -5
- package/dist/components/date-range-picker/DateRangePicker.generated.d.ts +3 -1
- package/dist/components/date-range-picker/DateRangePicker.generated.js +9 -6
- package/dist/components/dialog/Dialog.generated.js +17 -79
- package/dist/components/drawer/Drawer.a11y.d.ts +1 -3
- package/dist/components/drawer/Drawer.a11y.js +2 -30
- package/dist/components/drawer/Drawer.generated.d.ts +24 -0
- package/dist/components/drawer/Drawer.generated.js +65 -58
- package/dist/components/grid/Grid.generated.js +3 -3
- package/dist/components/icon/Icon.generated.d.ts +15 -0
- package/dist/components/icon/Icon.generated.js +11 -2
- package/dist/components/immersive-landing/ImmersiveLanding.css +1 -1
- package/dist/components/immersive-landing/components/CookieConsent.interactions.d.ts +24 -0
- package/dist/components/immersive-landing/components/CookieConsent.interactions.js +2 -0
- package/dist/components/immersive-landing/components/CookieConsent.js +52 -47
- package/dist/components/immersive-landing/components/FirefoxPWABanner.js +10 -10
- package/dist/components/immersive-landing/types.d.ts +15 -0
- package/dist/components/input/Input.css +5 -3
- package/dist/components/input/Input.generated.js +6 -3
- package/dist/components/language-switcher/LanguageSwitcher.generated.js +1 -1
- package/dist/components/live-chat/LiveChatPanel.generated.js +2 -6
- package/dist/components/live-chat/LiveChatPanel.interactions.d.ts +21 -0
- package/dist/components/live-chat/LiveChatPanel.interactions.js +10 -0
- package/dist/components/password-field/PasswordField.generated.d.ts +9 -1
- package/dist/components/password-field/PasswordField.generated.js +2 -2
- package/dist/components/password-field/PasswordField.interactions.d.ts +2 -2
- package/dist/components/password-field/PasswordField.interactions.js +2 -2
- package/dist/components/popover/Popover.a11y.d.ts +47 -0
- package/dist/components/popover/Popover.a11y.js +19 -0
- package/dist/components/popover/Popover.generated.d.ts +26 -0
- package/dist/components/popover/Popover.generated.js +119 -46
- package/dist/components/radio/Radio.generated.d.ts +26 -2
- package/dist/components/radio/Radio.generated.js +9 -5
- package/dist/components/range-calendar/RangeCalendar.generated.d.ts +3 -1
- package/dist/components/range-calendar/RangeCalendar.generated.js +4 -1
- package/dist/components/select/Select.generated.js +5 -0
- package/dist/components/slider/Slider.generated.d.ts +14 -1
- package/dist/components/slider/Slider.generated.js +3 -2
- package/dist/components/switch/Switch.css +0 -3
- package/dist/components/switch/Switch.generated.d.ts +23 -2
- package/dist/components/switch/Switch.generated.js +21 -44
- package/dist/components/switch/Switch.recipe.d.ts +61 -38
- package/dist/components/switch/Switch.recipe.js +88 -68
- package/dist/components/table/MobileListView.generated.js +1 -1
- package/dist/components/text/Text.generated.d.ts +26 -1
- package/dist/components/text/Text.generated.js +14 -13
- package/dist/components/text/Text.recipe.d.ts +17 -5
- package/dist/components/text/Text.recipe.js +7 -13
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/theme-color-picker/ThemeColorPicker.generated.js +1 -1
- package/dist/hooks/connection/createConnectionSettings.d.ts +128 -0
- package/dist/hooks/connection/createConnectionSettings.js +211 -0
- package/dist/hooks/connection/index.d.ts +2 -0
- package/dist/hooks/connection/index.js +1 -0
- package/dist/hooks/date/date.names.d.ts +107 -0
- package/dist/hooks/date/date.names.js +74 -0
- package/dist/hooks/date/date.utils.d.ts +11 -1
- package/dist/hooks/date/date.utils.js +3 -6
- package/dist/hooks/date/index.d.ts +1 -0
- package/dist/hooks/date/index.js +1 -0
- package/dist/hooks/date/useCalendarState.d.ts +12 -5
- package/dist/hooks/date/useCalendarState.js +7 -19
- package/dist/hooks/form/createForm.d.ts +4 -4
- package/dist/hooks/form/createForm.js +7 -9
- package/dist/index.d.ts +8 -4
- package/dist/index.js +3 -1
- package/dist/layouts.manifest.json +4 -1
- package/dist/lib/focus.d.ts +31 -0
- package/dist/lib/focus.js +39 -0
- package/dist/lib/overlay.d.ts +94 -0
- package/dist/lib/overlay.js +72 -0
- package/dist/purge-manifest.json +14427 -15269
- package/dist/responsive-classes.txt +450 -0
- package/dist/styles/base/index.css +42 -0
- package/package.json +11 -6
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { claimElement, createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
2
|
+
import { defineComponent } from "solid-layouts/solid-2/application-boundary";
|
|
3
|
+
import "./ConnectionSettings.css";
|
|
4
|
+
import { For, Show, createMemo, createSignal, createUniqueId, omit } from "solid-js";
|
|
5
|
+
import button_0 from "../button/index.js";
|
|
6
|
+
import input from "../input/index.js";
|
|
7
|
+
import switch_0 from "../switch/index.js";
|
|
8
|
+
import { componentRecipe } from "./ConnectionSettings.recipe.js";
|
|
9
|
+
var _tmpl$ = /*#__PURE__*/ template("<p>"), _tmpl$2 = /*#__PURE__*/ template("<div><!><!>"), _tmpl$3 = /*#__PURE__*/ template("<div><label>"), _tmpl$4 = /*#__PURE__*/ template("<form><div><div><p></p></div></div><!><div></div><div><!><!>"), _tmpl$5 = /*#__PURE__*/ template("<div><label></label><!><!>"), _tmpl$6 = /*#__PURE__*/ template("<span><!>: <!>");
|
|
10
|
+
const __solidLayoutConnectionSettingsLayout = (_stable, p)=>{
|
|
11
|
+
const others = omit(p, "children", "class", "dataTheme", "onSubmit", "style", "store", "endpoints", "labels", "showAppPublicId", "onSaved", "onSaveFailed", "onResetDone");
|
|
12
|
+
const uid = createUniqueId();
|
|
13
|
+
const fieldId = (name)=>`connection-settings-${uid}-${name}`;
|
|
14
|
+
const [open, setOpen] = createSignal(p.endpoints.some((e)=>p.store.isOverridden(e.name)));
|
|
15
|
+
const [draft, setDraft] = createSignal({});
|
|
16
|
+
const [appIdDraft, setAppIdDraft] = createSignal(void 0);
|
|
17
|
+
const [failure, setFailure] = createSignal(void 0);
|
|
18
|
+
const fieldValue = (name)=>draft()[name] ?? p.store.state.urls[name] ?? "";
|
|
19
|
+
const appIdValue = ()=>appIdDraft() ?? p.store.state.appPublicId;
|
|
20
|
+
const resolvedUrls = createMemo(()=>p.store.urls);
|
|
21
|
+
const edit = (name, value)=>setDraft({
|
|
22
|
+
...draft(),
|
|
23
|
+
[name]: value
|
|
24
|
+
});
|
|
25
|
+
const setUseCustom = (next)=>setOpen(next);
|
|
26
|
+
let saving = false;
|
|
27
|
+
const save = async ()=>{
|
|
28
|
+
if (saving) return;
|
|
29
|
+
saving = true;
|
|
30
|
+
try {
|
|
31
|
+
await commit();
|
|
32
|
+
} finally{
|
|
33
|
+
saving = false;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const commit = async ()=>{
|
|
37
|
+
setFailure(void 0);
|
|
38
|
+
const values = new Map(p.endpoints.map((endpoint)=>[
|
|
39
|
+
endpoint.name,
|
|
40
|
+
fieldValue(endpoint.name)
|
|
41
|
+
]));
|
|
42
|
+
if (open()) for (const [name, value] of values){
|
|
43
|
+
const problem = p.store.validate(name, value);
|
|
44
|
+
if (problem) {
|
|
45
|
+
setFailure(problem);
|
|
46
|
+
p.onSaveFailed?.(new Error(problem));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
for (const endpoint of p.endpoints){
|
|
51
|
+
const value = values.get(endpoint.name) ?? "";
|
|
52
|
+
const fallback = p.store.fallbacks[endpoint.name];
|
|
53
|
+
const overridden = open() && "" !== value && value !== fallback;
|
|
54
|
+
p.store.setOverride(endpoint.name, overridden);
|
|
55
|
+
if ("" !== value) p.store.setUrl(endpoint.name, value);
|
|
56
|
+
}
|
|
57
|
+
const id = appIdDraft();
|
|
58
|
+
if (void 0 !== id) p.store.setAppPublicId(id);
|
|
59
|
+
setDraft({});
|
|
60
|
+
setAppIdDraft(void 0);
|
|
61
|
+
try {
|
|
62
|
+
await p.store.apply();
|
|
63
|
+
p.onSaved?.();
|
|
64
|
+
} catch (error) {
|
|
65
|
+
setFailure(error instanceof Error ? error.message : String(error));
|
|
66
|
+
p.onSaveFailed?.(error);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const saveOnEnter = (event)=>{
|
|
70
|
+
if ("Enter" !== event.key || event.isComposing) return;
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
save();
|
|
73
|
+
};
|
|
74
|
+
const reset = async ()=>{
|
|
75
|
+
setFailure(void 0);
|
|
76
|
+
setDraft({});
|
|
77
|
+
setAppIdDraft(void 0);
|
|
78
|
+
p.store.reset();
|
|
79
|
+
setOpen(false);
|
|
80
|
+
try {
|
|
81
|
+
await p.store.apply();
|
|
82
|
+
p.onResetDone?.();
|
|
83
|
+
} catch (error) {
|
|
84
|
+
setFailure(error instanceof Error ? error.message : String(error));
|
|
85
|
+
p.onSaveFailed?.(error);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var _el$ = _tmpl$4(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$14 = _el$2.nextSibling, _el$1 = _el$14.nextSibling, _el$11 = _el$1.nextSibling, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling;
|
|
89
|
+
claimElement(_el$);
|
|
90
|
+
spread(_el$, mergeProps(others, ()=>_stable.slot.root, {
|
|
91
|
+
get style () {
|
|
92
|
+
return p.style;
|
|
93
|
+
},
|
|
94
|
+
get ["data-theme"] () {
|
|
95
|
+
return p.dataTheme;
|
|
96
|
+
},
|
|
97
|
+
get ["data-open"] () {
|
|
98
|
+
return open() ? "true" : "false";
|
|
99
|
+
},
|
|
100
|
+
get ["data-applying"] () {
|
|
101
|
+
return p.store.isApplying ? "true" : "false";
|
|
102
|
+
},
|
|
103
|
+
onSubmit: (event)=>{
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
save();
|
|
106
|
+
}
|
|
107
|
+
}), true);
|
|
108
|
+
spread(_el$2, mergeProps(()=>_stable.slot.header), true);
|
|
109
|
+
spread(_el$4, mergeProps(()=>_stable.slot.title), true);
|
|
110
|
+
insert(_el$4, ()=>p.labels.useCustom);
|
|
111
|
+
insert(_el$3, createComponent(Show, {
|
|
112
|
+
get when () {
|
|
113
|
+
return p.labels.useCustomDescription;
|
|
114
|
+
},
|
|
115
|
+
get children () {
|
|
116
|
+
var _el$5 = _tmpl$();
|
|
117
|
+
spread(_el$5, mergeProps(()=>_stable.slot.description), true);
|
|
118
|
+
insert(_el$5, ()=>p.labels.useCustomDescription);
|
|
119
|
+
return _el$5;
|
|
120
|
+
}
|
|
121
|
+
}), null);
|
|
122
|
+
insert(_el$2, createComponent(switch_0, mergeProps(()=>_stable.slot.switch, {
|
|
123
|
+
get id () {
|
|
124
|
+
return fieldId("use-custom");
|
|
125
|
+
},
|
|
126
|
+
get ["aria-label"] () {
|
|
127
|
+
return p.labels.useCustom;
|
|
128
|
+
},
|
|
129
|
+
get checked () {
|
|
130
|
+
return open();
|
|
131
|
+
},
|
|
132
|
+
get disabled () {
|
|
133
|
+
return p.store.isApplying;
|
|
134
|
+
},
|
|
135
|
+
onChange: ()=>setUseCustom(!open())
|
|
136
|
+
})), null);
|
|
137
|
+
insert(_el$, createComponent(Show, {
|
|
138
|
+
get when () {
|
|
139
|
+
return open();
|
|
140
|
+
},
|
|
141
|
+
get children () {
|
|
142
|
+
var _el$6 = _tmpl$2(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
|
|
143
|
+
spread(_el$6, mergeProps(()=>_stable.slot.fields), true);
|
|
144
|
+
insert(_el$6, createComponent(For, {
|
|
145
|
+
get each () {
|
|
146
|
+
return p.endpoints;
|
|
147
|
+
},
|
|
148
|
+
children: (endpoint)=>(()=>{
|
|
149
|
+
var _el$15 = _tmpl$5(), _el$16 = _el$15.firstChild, _el$18 = _el$16.nextSibling, _el$19 = _el$18.nextSibling;
|
|
150
|
+
spread(_el$15, mergeProps(()=>_stable.slot.field), true);
|
|
151
|
+
spread(_el$16, mergeProps(()=>_stable.slot.label, {
|
|
152
|
+
get ["for"] () {
|
|
153
|
+
return fieldId(endpoint.name);
|
|
154
|
+
}
|
|
155
|
+
}), true);
|
|
156
|
+
insert(_el$16, ()=>endpoint.label);
|
|
157
|
+
insert(_el$15, createComponent(input.Field, mergeProps(()=>_stable.slot.input, {
|
|
158
|
+
get id () {
|
|
159
|
+
return fieldId(endpoint.name);
|
|
160
|
+
},
|
|
161
|
+
get name () {
|
|
162
|
+
return endpoint.name;
|
|
163
|
+
},
|
|
164
|
+
type: "text",
|
|
165
|
+
onKeyDown: saveOnEnter,
|
|
166
|
+
get ["aria-label"] () {
|
|
167
|
+
return endpoint.label;
|
|
168
|
+
},
|
|
169
|
+
get placeholder () {
|
|
170
|
+
return endpoint.placeholder;
|
|
171
|
+
},
|
|
172
|
+
get value () {
|
|
173
|
+
return fieldValue(endpoint.name);
|
|
174
|
+
},
|
|
175
|
+
get disabled () {
|
|
176
|
+
return p.store.isApplying;
|
|
177
|
+
},
|
|
178
|
+
onInput: (event)=>edit(endpoint.name, event.currentTarget.value)
|
|
179
|
+
})), _el$18);
|
|
180
|
+
insert(_el$15, createComponent(Show, {
|
|
181
|
+
get when () {
|
|
182
|
+
return endpoint.hint;
|
|
183
|
+
},
|
|
184
|
+
get children () {
|
|
185
|
+
var _el$17 = _tmpl$();
|
|
186
|
+
spread(_el$17, mergeProps(()=>_stable.slot.hint), true);
|
|
187
|
+
insert(_el$17, ()=>endpoint.hint);
|
|
188
|
+
return _el$17;
|
|
189
|
+
}
|
|
190
|
+
}), _el$19);
|
|
191
|
+
return _el$15;
|
|
192
|
+
})()
|
|
193
|
+
}), _el$7);
|
|
194
|
+
insert(_el$6, ()=>_stable.children, _el$8);
|
|
195
|
+
return _el$6;
|
|
196
|
+
}
|
|
197
|
+
}), _el$14);
|
|
198
|
+
insert(_el$, createComponent(Show, {
|
|
199
|
+
get when () {
|
|
200
|
+
return memo(()=>!!p.showAppPublicId)() ? p.labels.appPublicId : p.showAppPublicId;
|
|
201
|
+
},
|
|
202
|
+
get children () {
|
|
203
|
+
var _el$9 = _tmpl$3(), _el$0 = _el$9.firstChild;
|
|
204
|
+
spread(_el$9, mergeProps(()=>_stable.slot.field), true);
|
|
205
|
+
spread(_el$0, mergeProps(()=>_stable.slot.label, {
|
|
206
|
+
get ["for"] () {
|
|
207
|
+
return fieldId("app-public-id");
|
|
208
|
+
}
|
|
209
|
+
}), true);
|
|
210
|
+
insert(_el$0, ()=>p.labels.appPublicId);
|
|
211
|
+
insert(_el$9, createComponent(input.Field, mergeProps(()=>_stable.slot.input, {
|
|
212
|
+
get id () {
|
|
213
|
+
return fieldId("app-public-id");
|
|
214
|
+
},
|
|
215
|
+
type: "text",
|
|
216
|
+
onKeyDown: saveOnEnter,
|
|
217
|
+
get ["aria-label"] () {
|
|
218
|
+
return p.labels.appPublicId;
|
|
219
|
+
},
|
|
220
|
+
get value () {
|
|
221
|
+
return appIdValue();
|
|
222
|
+
},
|
|
223
|
+
get disabled () {
|
|
224
|
+
return p.store.isApplying;
|
|
225
|
+
},
|
|
226
|
+
onInput: (event)=>setAppIdDraft(event.currentTarget.value)
|
|
227
|
+
})), null);
|
|
228
|
+
return _el$9;
|
|
229
|
+
}
|
|
230
|
+
}), _el$1);
|
|
231
|
+
spread(_el$1, mergeProps(()=>_stable.slot.current), true);
|
|
232
|
+
insert(_el$1, createComponent(For, {
|
|
233
|
+
get each () {
|
|
234
|
+
return p.endpoints;
|
|
235
|
+
},
|
|
236
|
+
children: (endpoint)=>(()=>{
|
|
237
|
+
var _el$20 = _tmpl$6(), _el$22 = _el$20.firstChild, _el$21 = _el$22.nextSibling, _el$23 = _el$21.nextSibling;
|
|
238
|
+
insert(_el$20, (()=>{
|
|
239
|
+
var _c$ = memo(()=>!!p.labels.current);
|
|
240
|
+
return ()=>_c$() ? `${p.labels.current} ` : "";
|
|
241
|
+
})(), _el$22);
|
|
242
|
+
insert(_el$20, ()=>endpoint.label, _el$21);
|
|
243
|
+
insert(_el$20, ()=>resolvedUrls()[endpoint.name], _el$23);
|
|
244
|
+
return _el$20;
|
|
245
|
+
})()
|
|
246
|
+
}));
|
|
247
|
+
insert(_el$, createComponent(Show, {
|
|
248
|
+
get when () {
|
|
249
|
+
return failure();
|
|
250
|
+
},
|
|
251
|
+
get children () {
|
|
252
|
+
var _el$10 = _tmpl$();
|
|
253
|
+
spread(_el$10, mergeProps(()=>_stable.slot.hint, {
|
|
254
|
+
role: "alert"
|
|
255
|
+
}), true);
|
|
256
|
+
insert(_el$10, failure);
|
|
257
|
+
return _el$10;
|
|
258
|
+
}
|
|
259
|
+
}), _el$11);
|
|
260
|
+
spread(_el$11, mergeProps(()=>_stable.slot.actions), true);
|
|
261
|
+
insert(_el$11, createComponent(button_0, {
|
|
262
|
+
type: "button",
|
|
263
|
+
flavor: "primary",
|
|
264
|
+
get disabled () {
|
|
265
|
+
return p.store.isApplying;
|
|
266
|
+
},
|
|
267
|
+
onClick: ()=>void save(),
|
|
268
|
+
get children () {
|
|
269
|
+
return p.labels.save;
|
|
270
|
+
}
|
|
271
|
+
}), _el$12);
|
|
272
|
+
insert(_el$11, createComponent(button_0, {
|
|
273
|
+
type: "button",
|
|
274
|
+
flavor: "secondary",
|
|
275
|
+
get disabled () {
|
|
276
|
+
return p.store.isApplying;
|
|
277
|
+
},
|
|
278
|
+
onClick: reset,
|
|
279
|
+
get children () {
|
|
280
|
+
return p.labels.reset;
|
|
281
|
+
}
|
|
282
|
+
}), _el$13);
|
|
283
|
+
return _el$;
|
|
284
|
+
};
|
|
285
|
+
const ConnectionSettingsLayout = defineComponent({
|
|
286
|
+
recipe: componentRecipe,
|
|
287
|
+
layout: __solidLayoutConnectionSettingsLayout,
|
|
288
|
+
embedded: true,
|
|
289
|
+
behaviour: [
|
|
290
|
+
"store",
|
|
291
|
+
"endpoints",
|
|
292
|
+
"labels",
|
|
293
|
+
"showAppPublicId",
|
|
294
|
+
"children",
|
|
295
|
+
"onSaved",
|
|
296
|
+
"onSaveFailed",
|
|
297
|
+
"onResetDone"
|
|
298
|
+
]
|
|
299
|
+
});
|
|
300
|
+
export { ConnectionSettingsLayout };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presentation lives here, not in the layout.
|
|
3
|
+
*
|
|
4
|
+
* This declared empty slots while `ConnectionSettings.layout.tsx` kept a
|
|
5
|
+
* `CLASSES` table and assembled class strings by hand with `twMerge`. That is
|
|
6
|
+
* the shape `solid-layouts-lint` calls a "legacy component-shaped Layout", and
|
|
7
|
+
* it was the only unbaselined warning in the repository -- new debt in a new
|
|
8
|
+
* component, which is exactly the debt `warningsAsErrors` exists to stop.
|
|
9
|
+
*
|
|
10
|
+
* `open` and `applying` are recipe props rather than conditional classes in the
|
|
11
|
+
* component, so the compiler owns the whole class string.
|
|
12
|
+
*/
|
|
13
|
+
export declare const componentRecipe: import("solid-layouts/solid-2").Recipe<{
|
|
14
|
+
readonly component: "connection-settings";
|
|
15
|
+
readonly element: "form";
|
|
16
|
+
readonly slots: {
|
|
17
|
+
readonly root: {
|
|
18
|
+
readonly base: "connection-settings";
|
|
19
|
+
};
|
|
20
|
+
readonly header: {
|
|
21
|
+
readonly base: "connection-settings__header";
|
|
22
|
+
};
|
|
23
|
+
readonly title: {
|
|
24
|
+
readonly base: "connection-settings__title";
|
|
25
|
+
};
|
|
26
|
+
readonly description: {
|
|
27
|
+
readonly base: "connection-settings__description";
|
|
28
|
+
};
|
|
29
|
+
readonly switch: {
|
|
30
|
+
readonly base: "connection-settings__switch";
|
|
31
|
+
};
|
|
32
|
+
readonly fields: {
|
|
33
|
+
readonly base: "connection-settings__fields";
|
|
34
|
+
};
|
|
35
|
+
readonly field: {
|
|
36
|
+
readonly base: "connection-settings__field";
|
|
37
|
+
};
|
|
38
|
+
readonly label: {
|
|
39
|
+
readonly base: "connection-settings__label";
|
|
40
|
+
};
|
|
41
|
+
readonly input: {
|
|
42
|
+
readonly base: "connection-settings__input";
|
|
43
|
+
};
|
|
44
|
+
readonly hint: {
|
|
45
|
+
readonly base: "connection-settings__hint";
|
|
46
|
+
};
|
|
47
|
+
readonly current: {
|
|
48
|
+
readonly base: "connection-settings__current";
|
|
49
|
+
};
|
|
50
|
+
readonly actions: {
|
|
51
|
+
readonly base: "connection-settings__actions";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { recipe } from "../../lib/layouts/index.js";
|
|
2
|
+
const componentRecipe = recipe({
|
|
3
|
+
component: "connection-settings",
|
|
4
|
+
element: "form",
|
|
5
|
+
slots: {
|
|
6
|
+
root: {
|
|
7
|
+
base: "connection-settings"
|
|
8
|
+
},
|
|
9
|
+
header: {
|
|
10
|
+
base: "connection-settings__header"
|
|
11
|
+
},
|
|
12
|
+
title: {
|
|
13
|
+
base: "connection-settings__title"
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
base: "connection-settings__description"
|
|
17
|
+
},
|
|
18
|
+
switch: {
|
|
19
|
+
base: "connection-settings__switch"
|
|
20
|
+
},
|
|
21
|
+
fields: {
|
|
22
|
+
base: "connection-settings__fields"
|
|
23
|
+
},
|
|
24
|
+
field: {
|
|
25
|
+
base: "connection-settings__field"
|
|
26
|
+
},
|
|
27
|
+
label: {
|
|
28
|
+
base: "connection-settings__label"
|
|
29
|
+
},
|
|
30
|
+
input: {
|
|
31
|
+
base: "connection-settings__input"
|
|
32
|
+
},
|
|
33
|
+
hint: {
|
|
34
|
+
base: "connection-settings__hint"
|
|
35
|
+
},
|
|
36
|
+
current: {
|
|
37
|
+
base: "connection-settings__current"
|
|
38
|
+
},
|
|
39
|
+
actions: {
|
|
40
|
+
base: "connection-settings__actions"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
_layouts: {
|
|
44
|
+
slots: {
|
|
45
|
+
root: {
|
|
46
|
+
base: "connection-settings",
|
|
47
|
+
axes: {}
|
|
48
|
+
},
|
|
49
|
+
header: {
|
|
50
|
+
base: "connection-settings__header",
|
|
51
|
+
axes: {}
|
|
52
|
+
},
|
|
53
|
+
title: {
|
|
54
|
+
base: "connection-settings__title",
|
|
55
|
+
axes: {}
|
|
56
|
+
},
|
|
57
|
+
description: {
|
|
58
|
+
base: "connection-settings__description",
|
|
59
|
+
axes: {}
|
|
60
|
+
},
|
|
61
|
+
switch: {
|
|
62
|
+
base: "connection-settings__switch",
|
|
63
|
+
axes: {}
|
|
64
|
+
},
|
|
65
|
+
fields: {
|
|
66
|
+
base: "connection-settings__fields",
|
|
67
|
+
axes: {}
|
|
68
|
+
},
|
|
69
|
+
field: {
|
|
70
|
+
base: "connection-settings__field",
|
|
71
|
+
axes: {}
|
|
72
|
+
},
|
|
73
|
+
label: {
|
|
74
|
+
base: "connection-settings__label",
|
|
75
|
+
axes: {}
|
|
76
|
+
},
|
|
77
|
+
input: {
|
|
78
|
+
base: "connection-settings__input",
|
|
79
|
+
axes: {}
|
|
80
|
+
},
|
|
81
|
+
hint: {
|
|
82
|
+
base: "connection-settings__hint",
|
|
83
|
+
axes: {}
|
|
84
|
+
},
|
|
85
|
+
current: {
|
|
86
|
+
base: "connection-settings__current",
|
|
87
|
+
axes: {}
|
|
88
|
+
},
|
|
89
|
+
actions: {
|
|
90
|
+
base: "connection-settings__actions",
|
|
91
|
+
axes: {}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
stateKeys: [],
|
|
95
|
+
slotIds: {
|
|
96
|
+
root: 9,
|
|
97
|
+
header: 5,
|
|
98
|
+
title: 11,
|
|
99
|
+
description: 2,
|
|
100
|
+
switch: 10,
|
|
101
|
+
fields: 4,
|
|
102
|
+
field: 3,
|
|
103
|
+
label: 8,
|
|
104
|
+
input: 7,
|
|
105
|
+
hint: 6,
|
|
106
|
+
current: 1,
|
|
107
|
+
actions: 0
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
export { componentRecipe };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConnectionSettingsLayout as ConnectionSettings, ConnectionSettingsLayout as default } from "./ConnectionSettings.generated.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Component as __LayoutComponent } from "solid-js";
|
|
2
2
|
import "./DatePicker.css";
|
|
3
3
|
import type { JSX } from "@solidjs/web";
|
|
4
|
-
import { type CalendarWeekdayFormat } from "../calendar";
|
|
4
|
+
import { type CalendarWeekdayFormat, type DateNames } from "../calendar";
|
|
5
5
|
import type { UIBaseProps, State } from "../vocabulary";
|
|
6
6
|
type DatePickerBaseProps = {
|
|
7
7
|
value?: Date;
|
|
@@ -13,6 +13,8 @@ type DatePickerBaseProps = {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
placeholder?: string;
|
|
15
15
|
locale?: string;
|
|
16
|
+
/** Month and weekday names for a language other than English. See `Calendar`. */
|
|
17
|
+
dateNames?: DateNames;
|
|
16
18
|
weekdayFormat?: CalendarWeekdayFormat;
|
|
17
19
|
minValue?: Date;
|
|
18
20
|
maxValue?: Date;
|
|
@@ -3,12 +3,12 @@ import { defineComponent } from "solid-layouts/solid-2/application-boundary";
|
|
|
3
3
|
import "./DatePicker.css";
|
|
4
4
|
import { Show, createMemo, createUniqueId, omit } from "solid-js";
|
|
5
5
|
import { twMerge } from "../../lib/twMerge.js";
|
|
6
|
-
import { formatDate, toISODate, useDateSelection, usePickerOpenState } from "../../hooks/date/index.js";
|
|
6
|
+
import { formatDate, resolveDateNames, toISODate, useDateSelection, usePickerOpenState } from "../../hooks/date/index.js";
|
|
7
7
|
import calendar from "../calendar/index.js";
|
|
8
8
|
import { CLASSES, componentRecipe } from "./DatePicker.recipe.js";
|
|
9
9
|
var _tmpl$ = /*#__PURE__*/ template("<input type=hidden>"), _tmpl$2 = /*#__PURE__*/ template("<div>"), _tmpl$3 = /*#__PURE__*/ template("<div><button><span></span><span><svg><rect x=3 y=4 width=18 height=18 rx=2 ry=2></rect><line x1=16 y1=2 x2=16 y2=6></line><line x1=8 y1=2 x2=8 y2=6></line><line x1=3 y1=10 x2=21 y2=10></line></svg></span></button><!>");
|
|
10
10
|
const __solidLayoutDatePicker = (_stable, p)=>{
|
|
11
|
-
const others = omit(p, "class", "dataTheme", "style", "ref", "value", "defaultValue", "onChange", "open", "defaultOpen", "onOpenChange", "name", "placeholder", "locale", "weekdayFormat", "minValue", "maxValue", "isDateUnavailable", "state", "disabled");
|
|
11
|
+
const others = omit(p, "class", "dataTheme", "style", "ref", "value", "defaultValue", "onChange", "open", "defaultOpen", "onOpenChange", "name", "placeholder", "locale", "dateNames", "weekdayFormat", "minValue", "maxValue", "isDateUnavailable", "state", "disabled");
|
|
12
12
|
const isDisabled = createMemo(()=>Boolean("disabled" === p.state) || Boolean(p.disabled));
|
|
13
13
|
const selection = useDateSelection({
|
|
14
14
|
value: ()=>p.value,
|
|
@@ -21,11 +21,11 @@ const __solidLayoutDatePicker = (_stable, p)=>{
|
|
|
21
21
|
onOpenChange: ()=>p.onOpenChange,
|
|
22
22
|
isDisabled
|
|
23
23
|
});
|
|
24
|
-
const
|
|
24
|
+
const dateNames = createMemo(()=>resolveDateNames(p.locale, p.dateNames).names);
|
|
25
25
|
const displayValue = createMemo(()=>{
|
|
26
26
|
const selectedDate = selection.selectedDate();
|
|
27
27
|
if (!selectedDate) return p.placeholder ?? "Select date";
|
|
28
|
-
return formatDate(selectedDate,
|
|
28
|
+
return formatDate(selectedDate, dateNames());
|
|
29
29
|
});
|
|
30
30
|
const uniqueId = createUniqueId();
|
|
31
31
|
const popoverId = `date-picker-popover-${uniqueId}`;
|
|
@@ -154,7 +154,10 @@ const __solidLayoutDatePicker = (_stable, p)=>{
|
|
|
154
154
|
},
|
|
155
155
|
onChange: handleDateChange,
|
|
156
156
|
get locale () {
|
|
157
|
-
return locale
|
|
157
|
+
return p.locale;
|
|
158
|
+
},
|
|
159
|
+
get dateNames () {
|
|
160
|
+
return p.dateNames;
|
|
158
161
|
},
|
|
159
162
|
get weekdayFormat () {
|
|
160
163
|
return p.weekdayFormat;
|
|
@@ -2,7 +2,7 @@ import type { Component as __LayoutComponent } from "solid-js";
|
|
|
2
2
|
import "./DateRangePicker.css";
|
|
3
3
|
import type { JSX } from "@solidjs/web";
|
|
4
4
|
import { type ControlledDateRangeValue } from "../../hooks/date";
|
|
5
|
-
import { type CalendarWeekdayFormat } from "../calendar";
|
|
5
|
+
import { type CalendarWeekdayFormat, type DateNames } from "../calendar";
|
|
6
6
|
import type { UIBaseProps, State } from "../vocabulary";
|
|
7
7
|
export type DateRangeValue = ControlledDateRangeValue;
|
|
8
8
|
type DateRangePickerBaseProps = {
|
|
@@ -17,6 +17,8 @@ type DateRangePickerBaseProps = {
|
|
|
17
17
|
startPlaceholder?: string;
|
|
18
18
|
endPlaceholder?: string;
|
|
19
19
|
locale?: string;
|
|
20
|
+
/** Month and weekday names for a language other than English. See `Calendar`. */
|
|
21
|
+
dateNames?: DateNames;
|
|
20
22
|
weekdayFormat?: CalendarWeekdayFormat;
|
|
21
23
|
minValue?: Date;
|
|
22
24
|
maxValue?: Date;
|
|
@@ -3,12 +3,12 @@ import { defineComponent } from "solid-layouts/solid-2/application-boundary";
|
|
|
3
3
|
import "./DateRangePicker.css";
|
|
4
4
|
import { Show, createMemo, createTrackedEffect, createUniqueId, omit } from "solid-js";
|
|
5
5
|
import { twMerge } from "../../lib/twMerge.js";
|
|
6
|
-
import { formatDate, toISODate, usePickerOpenState, useRangeSelection } from "../../hooks/date/index.js";
|
|
6
|
+
import { formatDate, resolveDateNames, toISODate, usePickerOpenState, useRangeSelection } from "../../hooks/date/index.js";
|
|
7
7
|
import calendar from "../calendar/index.js";
|
|
8
8
|
import { CLASSES, componentRecipe } from "./DateRangePicker.recipe.js";
|
|
9
9
|
var _tmpl$ = /*#__PURE__*/ template("<input type=hidden>"), _tmpl$2 = /*#__PURE__*/ template("<div>"), _tmpl$3 = /*#__PURE__*/ template("<div><!><button><span></span><span>-</span><span></span><span><svg><rect x=3 y=4 width=18 height=18 rx=2 ry=2></rect><line x1=16 y1=2 x2=16 y2=6></line><line x1=8 y1=2 x2=8 y2=6></line><line x1=3 y1=10 x2=21 y2=10></line></svg></span></button><!>");
|
|
10
10
|
const __solidLayoutDateRangePicker = (_stable, p)=>{
|
|
11
|
-
const others = omit(p, "class", "dataTheme", "style", "ref", "value", "defaultValue", "onChange", "open", "defaultOpen", "onOpenChange", "startName", "endName", "startPlaceholder", "endPlaceholder", "locale", "weekdayFormat", "minValue", "maxValue", "isDateUnavailable", "state", "disabled");
|
|
11
|
+
const others = omit(p, "class", "dataTheme", "style", "ref", "value", "defaultValue", "onChange", "open", "defaultOpen", "onOpenChange", "startName", "endName", "startPlaceholder", "endPlaceholder", "locale", "dateNames", "weekdayFormat", "minValue", "maxValue", "isDateUnavailable", "state", "disabled");
|
|
12
12
|
const isDisabled = createMemo(()=>Boolean("disabled" === p.state) || Boolean(p.disabled));
|
|
13
13
|
const rangeSelection = useRangeSelection({
|
|
14
14
|
value: ()=>p.value,
|
|
@@ -25,17 +25,17 @@ const __solidLayoutDateRangePicker = (_stable, p)=>{
|
|
|
25
25
|
if (openState.isOpen()) return;
|
|
26
26
|
rangeSelection.clearPendingSelection();
|
|
27
27
|
});
|
|
28
|
-
const
|
|
28
|
+
const dateNames = createMemo(()=>resolveDateNames(p.locale, p.dateNames).names);
|
|
29
29
|
const startValue = createMemo(()=>rangeSelection.rangeStart());
|
|
30
30
|
const endValue = createMemo(()=>rangeSelection.rangeEnd());
|
|
31
31
|
const focusDate = createMemo(()=>rangeSelection.focusDate());
|
|
32
32
|
const startDisplay = createMemo(()=>{
|
|
33
33
|
if (!startValue()) return p.startPlaceholder ?? "Start date";
|
|
34
|
-
return formatDate(startValue(),
|
|
34
|
+
return formatDate(startValue(), dateNames());
|
|
35
35
|
});
|
|
36
36
|
const endDisplay = createMemo(()=>{
|
|
37
37
|
if (!endValue()) return p.endPlaceholder ?? "End date";
|
|
38
|
-
return formatDate(endValue(),
|
|
38
|
+
return formatDate(endValue(), dateNames());
|
|
39
39
|
});
|
|
40
40
|
const handleDateSelect = (date)=>{
|
|
41
41
|
const wasSelectingEnd = rangeSelection.isSelectingEnd();
|
|
@@ -208,7 +208,10 @@ const __solidLayoutDateRangePicker = (_stable, p)=>{
|
|
|
208
208
|
return rangeSelection.setHoverDate;
|
|
209
209
|
},
|
|
210
210
|
get locale () {
|
|
211
|
-
return locale
|
|
211
|
+
return p.locale;
|
|
212
|
+
},
|
|
213
|
+
get dateNames () {
|
|
214
|
+
return p.dateNames;
|
|
212
215
|
},
|
|
213
216
|
get weekdayFormat () {
|
|
214
217
|
return p.weekdayFormat;
|