@nxgt/material-vue 0.35.0 → 0.36.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/CHANGELOG.md +76 -0
- package/README.md +11 -5
- package/dist/{Button-C6GBoxwB.js → Button-CurFF4Zt.js} +1 -1
- package/dist/{HoverCardTrigger-BRajrP9V.js → HoverCardTrigger-C3r0oc5d.js} +2 -2
- package/dist/{camera-BIK3JMQq.js → camera-CaQlF4JJ.js} +4 -4
- package/dist/components/components.css +1 -0
- package/dist/components/print-only.css +44 -0
- package/dist/{components-B3e9Djen.js → components-D56FEfTa.js} +42219 -41699
- package/dist/components.js +8 -8
- package/dist/composables.js +35 -25
- package/dist/dnd.js +1 -1
- package/dist/{form-scope-DH96Nu9y.js → form-scope-DOL9MJL3.js} +1 -1
- package/dist/{i18n-provider-D0wc5ysD.js → i18n-provider-B2q6vp6H.js} +1 -1
- package/dist/i18n.js +4 -4
- package/dist/{icon-button-Cep-hCMB.js → icon-button-CIUc1bEp.js} +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/ui/actions/button/Button.vue.d.ts +1 -1
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +1 -1
- package/dist/lib/components/ui/actions/copy-button/copy-button.vue.d.ts +1 -1
- package/dist/lib/components/ui/actions/copy-button/use-copy-status.d.ts +14 -0
- package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +1 -1
- package/dist/lib/components/ui/actions/icon-button/icon-button.vue.d.ts +1 -1
- package/dist/lib/components/ui/actions/scroll-to-top/scroll-to-top.vue.d.ts +1 -1
- package/dist/lib/components/ui/display/badge/index.d.ts +1 -1
- package/dist/lib/components/ui/display/cards/cards.gallery.d.ts +3 -3
- package/dist/lib/components/ui/display/count-badge/count-badge.vue.d.ts +1 -1
- package/dist/lib/components/ui/display/enrolment-secret/enrolment-secret.vue.d.ts +30 -0
- package/dist/lib/components/ui/display/enrolment-secret/index.d.ts +3 -0
- package/dist/lib/components/ui/display/index.d.ts +2 -0
- package/dist/lib/components/ui/display/recovery-codes/index.d.ts +5 -0
- package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-actions.vue.d.ts +11 -0
- package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-confirm.vue.d.ts +15 -0
- package/dist/lib/components/ui/display/recovery-codes/partials/recovery-codes-list.vue.d.ts +7 -0
- package/dist/lib/components/ui/display/recovery-codes/recovery-codes.vue.d.ts +56 -0
- package/dist/lib/components/ui/display/recovery-codes/types.d.ts +23 -0
- package/dist/lib/components/ui/display/recovery-codes/use-recovery-codes-labels.d.ts +18 -0
- package/dist/lib/components/ui/feedback/alert/alert.vue.d.ts +1 -1
- package/dist/lib/components/ui/feedback/circular-progress/circular-progress.vue.d.ts +2 -2
- package/dist/lib/components/ui/feedback/spinner/spinner.variants.d.ts +1 -1
- package/dist/lib/components/ui/feedback/spinner/spinner.vue.d.ts +1 -1
- package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
- package/dist/lib/components/ui/fields/form-section/form-section-classes.d.ts +30 -0
- package/dist/lib/components/ui/fields/form-section/form-section.vue.d.ts +37 -0
- package/dist/lib/components/ui/fields/form-section/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/index.d.ts +1 -0
- package/dist/lib/components/ui/fields/rating-field/rating-field.variants.d.ts +1 -1
- package/dist/lib/components/ui/fields/rating-field/rating-field.vue.d.ts +1 -1
- package/dist/lib/components/ui/forms/form-scope-schema.d.ts +8 -2
- package/dist/lib/components/ui/forms/index.d.ts +1 -0
- package/dist/lib/components/ui/forms/use-code-resolver.d.ts +45 -0
- package/dist/lib/components/ui/layout/app-shell/activity-content.vue.d.ts +1 -1
- package/dist/lib/components/ui/layout/auth-card/auth-card-notice.vue.d.ts +18 -0
- package/dist/lib/components/ui/layout/auth-card/auth-card.vue.d.ts +45 -0
- package/dist/lib/components/ui/layout/auth-card/index.d.ts +3 -0
- package/dist/lib/components/ui/layout/auth-card/types.d.ts +2 -0
- package/dist/lib/components/ui/layout/index.d.ts +1 -0
- package/dist/lib/composables/index.d.ts +2 -0
- package/dist/lib/composables/use-focus-on-mount.d.ts +23 -0
- package/dist/lib/composables/use-submit-once.d.ts +33 -0
- package/dist/lib/i18n/resources/en/en.d.ts +21 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +21 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +21 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -0
- package/dist/lib/i18n/resources/resources.d.ts +42 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/lib/index.d.ts +1 -0
- package/dist/lib/nuxt/auto-imports.d.ts +1 -1
- package/dist/lib/nuxt/component-names.d.ts +1 -1
- package/dist/lib.js +59 -104
- package/dist/main.js +17 -17
- package/dist/map.js +4 -4
- package/dist/material-vue.css +1 -1
- package/dist/{pdf-outline-sidebar-Bjz8jMaZ.js → pdf-outline-sidebar-Gmdd3RNG.js} +2 -2
- package/dist/{pdf-page-BRtEfDpx.js → pdf-page-C3XhLcrp.js} +1 -1
- package/dist/{pdf-page-list-DUSFOt6b.js → pdf-page-list-BTIb5Y-Y.js} +2 -2
- package/dist/{pdf-reader-Dhuuu3ud.js → pdf-reader-CX2owreo.js} +8 -8
- package/dist/{pdf-sidebar-BOsuIcvK.js → pdf-sidebar-BmAJ8Q_m.js} +3 -3
- package/dist/{pdf-thumbnail-sidebar-CEinOvk3.js → pdf-thumbnail-sidebar-C04OeZ9M.js} +3 -3
- package/dist/{pdf-toolbar-ZYITLhtl.js → pdf-toolbar-zI0_eNXV.js} +4 -4
- package/dist/pdf.js +2 -2
- package/dist/print-format.utils-keJqahvw.js +187 -0
- package/dist/{sortable-provider-BCawiL69.js → sortable-provider-DMu8DL2z.js} +2 -2
- package/dist/{stored-language-CGMzf-kR.js → stored-language-dtksFoGO.js} +42 -0
- package/dist/{stx-player-DAhHmRHW.js → stx-player-BUo2Vs0j.js} +5 -5
- package/dist/{translator-DhrnT0YX.js → translator-DqiGrSH_.js} +1 -1
- package/dist/{use-heading-spy-BF4hsZLZ.js → use-heading-spy-BZ7ctGZ5.js} +58 -48
- package/dist/{use-material-translation-D30V5LyT.js → use-material-translation-DRB6oPdF.js} +3 -3
- package/docs/components/README.md +3 -3
- package/docs/components/data-display.md +112 -0
- package/docs/components/form-fields.md +81 -0
- package/docs/components/navigation-and-layout.md +64 -0
- package/docs/guides/forms.md +120 -0
- package/docs/guides/helpers.md +85 -0
- package/docs/guides/i18n.md +17 -0
- package/docs/guides/printing.md +27 -0
- package/docs/previews/data-display-enrolmentsecret.webp +0 -0
- package/docs/previews/data-display-recoverycodes.webp +0 -0
- package/docs/previews/form-fields-formsection.webp +0 -0
- package/docs/previews/navigation-layout-authcard.webp +0 -0
- package/docs/roadmap.md +15 -0
- package/docs/troubleshooting.md +66 -0
- package/lib/components/components.css +1 -0
- package/lib/components/print-only.css +44 -0
- package/lib/nuxt/auto-imports.ts +2 -0
- package/lib/nuxt/component-names.ts +4 -0
- package/package.json +2 -2
- package/dist/print-format.utils-DpBtUJvL.js +0 -138
package/docs/roadmap.md
CHANGED
|
@@ -162,6 +162,21 @@ version they shipped in, and planned entries may name the major they target.
|
|
|
162
162
|
|
|
163
163
|
## Shipped
|
|
164
164
|
|
|
165
|
+
- **Signed-out pages and two-step verification** — `AuthCard`, the frame of a
|
|
166
|
+
sign-in page (one `main`, the card's title its `h1`, a status or alert
|
|
167
|
+
notice, safe-area padding); `EnrolmentSecret`, a TOTP enrolment's QR code,
|
|
168
|
+
app link and key grouped by four; `RecoveryCodes`, one-time codes to copy,
|
|
169
|
+
download or print alone, with an "I have saved these codes" confirmation
|
|
170
|
+
(`v-model:saved`) an app's router guard can follow. 0.36.0.
|
|
171
|
+
- **Focus after a change, one submit at a time, errors worded by code** —
|
|
172
|
+
`useFocusOnMount` focuses the heading of what replaced the content the user
|
|
173
|
+
acted on; `useSubmitOnce` drops a double click or a second Enter until the
|
|
174
|
+
request ends; `useCodeResolver` words a zod schema's errors in the page's
|
|
175
|
+
language, a refinement's `params.code` in the app's own words. 0.36.0.
|
|
176
|
+
- **Long forms in titled sections** — `FormSection`: a heading (an `h2`, or
|
|
177
|
+
the level `title-as` names), a description and actions, its fields in the form
|
|
178
|
+
grid's columns and one column on a phone, a rule between sections, and a
|
|
179
|
+
group a screen reader announces by its title. 0.36.0.
|
|
165
180
|
- **A strict Content Security Policy** — a page that sends `script-src` with a
|
|
166
181
|
nonce and no `'unsafe-eval'`, and `style-src-elem` with a nonce and no
|
|
167
182
|
`'unsafe-inline'`, runs every component with no violation report:
|
package/docs/troubleshooting.md
CHANGED
|
@@ -102,6 +102,7 @@ words in your error.
|
|
|
102
102
|
|
|
103
103
|
**Printing**
|
|
104
104
|
|
|
105
|
+
- [`RecoveryCodes`' Print button prints the whole page](#recoverycodes-print-button-prints-the-whole-page)
|
|
105
106
|
- [The table header and the total row print blank](#the-table-header-and-the-total-row-print-blank)
|
|
106
107
|
- [A `tw()` class has no effect](#a-tw-class-has-no-effect)
|
|
107
108
|
- [An amount in yen shows no decimals, or one in dinars shows three](#an-amount-in-yen-shows-no-decimals-or-one-in-dinars-shows-three)
|
|
@@ -140,6 +141,8 @@ words in your error.
|
|
|
140
141
|
- [A test asserting the old Zod string length text fails](#a-test-asserting-the-old-zod-string-length-text-fails)
|
|
141
142
|
- [A calendar's weekday row is in English on a French page](#a-calendars-weekday-row-is-in-english-on-a-french-page)
|
|
142
143
|
- [An accessibility audit reports low contrast on a calendar's weekday row or its days](#an-accessibility-audit-reports-low-contrast-on-a-calendars-weekday-row-or-its-days)
|
|
144
|
+
- [Errors keep their old words after a language switch](#errors-keep-their-old-words-after-a-language-switch)
|
|
145
|
+
- [`useCodeResolver` re-validates or resets the form on every render](#usecoderesolver-re-validates-or-resets-the-form-on-every-render)
|
|
143
146
|
|
|
144
147
|
**Runtime**
|
|
145
148
|
|
|
@@ -1960,6 +1963,30 @@ const field = useTemplateRef<ComponentExposed<typeof Autocomplete>>('field');
|
|
|
1960
1963
|
|
|
1961
1964
|
## Printing
|
|
1962
1965
|
|
|
1966
|
+
### `RecoveryCodes`' Print button prints the whole page
|
|
1967
|
+
|
|
1968
|
+
**When:** "Print" on `RecoveryCodes` prints the rest of the page with the
|
|
1969
|
+
codes, or the codes away from the top of the sheet.
|
|
1970
|
+
**Why:** the button only marks the page (`<html data-nxgt-print>`) and the
|
|
1971
|
+
card (`data-nxgt-print-target`); hiding the rest is a `@media print` rule in
|
|
1972
|
+
the package's stylesheet (`print-only.css`). A page that does not load
|
|
1973
|
+
`@nxgt/material-vue/styles.css` (or
|
|
1974
|
+
`dist/material-vue.css`) has no such rule, and an app's own
|
|
1975
|
+
print rule that is `!important` (or a `position` on an ancestor set with
|
|
1976
|
+
`!important`) wins over it.
|
|
1977
|
+
**Fix:** load the stylesheet the setup guide names, and keep your print
|
|
1978
|
+
rules off the marked page:
|
|
1979
|
+
|
|
1980
|
+
```css
|
|
1981
|
+
/* your app's print rules, everywhere but while one element is printed */
|
|
1982
|
+
@media print {
|
|
1983
|
+
html:not([data-nxgt-print]) .page-header { position: static !important; }
|
|
1984
|
+
}
|
|
1985
|
+
```
|
|
1986
|
+
|
|
1987
|
+
To print an element of your own the same way, call `printOnly(element)`
|
|
1988
|
+
from `@nxgt/material-vue/lib`; the same rules apply to it.
|
|
1989
|
+
|
|
1963
1990
|
### The table header and the total row print blank
|
|
1964
1991
|
|
|
1965
1992
|
**When:** on paper or in a PDF, the table header and the grand-total row are
|
|
@@ -2532,6 +2559,45 @@ reka hides the weekday row from assistive tech (`<thead aria-hidden>`); in a
|
|
|
2532
2559
|
test, find a day by its full date instead
|
|
2533
2560
|
(`getByRole('gridcell', { name: 'jeudi 1 octobre 2026' })`).
|
|
2534
2561
|
|
|
2562
|
+
### Errors keep their old words after a language switch
|
|
2563
|
+
|
|
2564
|
+
**When:** a form validated with `useCodeResolver` shows an error, the user
|
|
2565
|
+
switches the language, and the error stays in the old one (a code's words
|
|
2566
|
+
or a zod message alike).
|
|
2567
|
+
**Why:** the typed schema is a computed that follows the language, and
|
|
2568
|
+
vee-validate re-validates when its `validationSchema` ref changes — but only
|
|
2569
|
+
when it receives the ref. Passing `validationSchema.value` hands it a plain
|
|
2570
|
+
object, which keeps the language of the first validation.
|
|
2571
|
+
**Fix:** pass the computed itself:
|
|
2572
|
+
|
|
2573
|
+
```ts
|
|
2574
|
+
const validationSchema = useCodeResolver(schema, { translate });
|
|
2575
|
+
const { handleSubmit } = useForm({ validationSchema }); // not validationSchema.value
|
|
2576
|
+
```
|
|
2577
|
+
|
|
2578
|
+
Storybook: `Guides/Forms/useCodeResolver`. See
|
|
2579
|
+
[forms](guides/forms.md#wording-errors-by-code).
|
|
2580
|
+
|
|
2581
|
+
### `useCodeResolver` re-validates or resets the form on every render
|
|
2582
|
+
|
|
2583
|
+
**When:** the schema, `translate` or `codeOf` is created inside a computed
|
|
2584
|
+
or a render function, so `useCodeResolver` is called again with a new one.
|
|
2585
|
+
**Why:** each call makes a new typed schema; vee-validate re-validates every
|
|
2586
|
+
time `validationSchema` changes.
|
|
2587
|
+
**Fix:** call `useCodeResolver` once in `setup`, with a schema, a translator
|
|
2588
|
+
and a `codeOf` defined at module scope (a `language` ref or getter is what
|
|
2589
|
+
should change):
|
|
2590
|
+
|
|
2591
|
+
```ts
|
|
2592
|
+
import { type CodeIssue, defaultCodeOf, isEmptyRequired, useCodeResolver } from '@nxgt/material-vue/components';
|
|
2593
|
+
|
|
2594
|
+
const schema = z.object({ username: z.string().min(3) });
|
|
2595
|
+
const codeOf = (issue: CodeIssue) =>
|
|
2596
|
+
isEmptyRequired(issue) ? 'errors.required' : defaultCodeOf(issue);
|
|
2597
|
+
|
|
2598
|
+
const validationSchema = useCodeResolver(schema, { translate, codeOf });
|
|
2599
|
+
```
|
|
2600
|
+
|
|
2535
2601
|
## Runtime
|
|
2536
2602
|
|
|
2537
2603
|
### A test asserting the old Zod string length text fails
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
@import "./ui/actions/button-group/button-group.css";
|
|
22
22
|
@import "./ui/primitives/label/label.css";
|
|
23
23
|
@import "./ui/feedback/toast/toast.css";
|
|
24
|
+
@import "./print-only.css";
|
|
24
25
|
@import "./ui/fields/contacts/contact-item.css";
|
|
25
26
|
@import "./ui/fields/opening-hours/opening-hours-item.css";
|
|
26
27
|
@import "./ui/fields/attributes/partials/attribute-form.css";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* Printing one element of the page (`printOnly`, from `/lib` or
|
|
2
|
+
* @nxgt/material-core/print-only; RecoveryCodes' Print button): while
|
|
3
|
+
* <html data-nxgt-print> is set, print media shows the element marked
|
|
4
|
+
* data-nxgt-print-target and nothing else. No inline style: only these rules,
|
|
5
|
+
* the same in @nxgt/material and @nxgt/material-vue.
|
|
6
|
+
*
|
|
7
|
+
* Everything that neither is, holds nor sits inside the target is taken out
|
|
8
|
+
* of the flow, so the page prints no blank sheets after it; where :has() is
|
|
9
|
+
* not supported, that rule is dropped and `visibility` alone hides the rest.
|
|
10
|
+
* The target's ancestors stop positioning it, so it starts at the top left of
|
|
11
|
+
* the first page. Unlayered, these rules beat the components' Tailwind
|
|
12
|
+
* utilities (layered) with no `!important`. */
|
|
13
|
+
@media print {
|
|
14
|
+
html[data-nxgt-print]
|
|
15
|
+
body
|
|
16
|
+
*:not(
|
|
17
|
+
[data-nxgt-print-target],
|
|
18
|
+
[data-nxgt-print-target] *,
|
|
19
|
+
:has([data-nxgt-print-target])
|
|
20
|
+
) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
html[data-nxgt-print] body * {
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
html[data-nxgt-print] :has([data-nxgt-print-target]) {
|
|
29
|
+
position: static;
|
|
30
|
+
transform: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
html[data-nxgt-print] [data-nxgt-print-target],
|
|
34
|
+
html[data-nxgt-print] [data-nxgt-print-target] * {
|
|
35
|
+
visibility: visible;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
html[data-nxgt-print] [data-nxgt-print-target] {
|
|
39
|
+
position: absolute;
|
|
40
|
+
inset: 0 0 auto 0;
|
|
41
|
+
margin: 0;
|
|
42
|
+
box-shadow: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
package/lib/nuxt/auto-imports.ts
CHANGED
|
@@ -34,6 +34,7 @@ export const COMPONENT_NAMES = [
|
|
|
34
34
|
'AttributesField',
|
|
35
35
|
'AttributesFormField',
|
|
36
36
|
'AttributesList',
|
|
37
|
+
'AuthCard',
|
|
37
38
|
'Autocomplete',
|
|
38
39
|
'AutocompleteFormField',
|
|
39
40
|
'Avatar',
|
|
@@ -234,6 +235,7 @@ export const COMPONENT_NAMES = [
|
|
|
234
235
|
'EmojiList',
|
|
235
236
|
'EmojiPicker',
|
|
236
237
|
'EmptyState',
|
|
238
|
+
'EnrolmentSecret',
|
|
237
239
|
'EntityHeader',
|
|
238
240
|
'EventCalendar',
|
|
239
241
|
'EventCard',
|
|
@@ -266,6 +268,7 @@ export const COMPONENT_NAMES = [
|
|
|
266
268
|
'FilterProvider',
|
|
267
269
|
'FilterSheet',
|
|
268
270
|
'FilterTrigger',
|
|
271
|
+
'FormSection',
|
|
269
272
|
'FunnelCard',
|
|
270
273
|
'FunnelChart',
|
|
271
274
|
'Gallery',
|
|
@@ -431,6 +434,7 @@ export const COMPONENT_NAMES = [
|
|
|
431
434
|
'RatingFormField',
|
|
432
435
|
'RatioCard',
|
|
433
436
|
'ReceiptCard',
|
|
437
|
+
'RecoveryCodes',
|
|
434
438
|
'RelativeTime',
|
|
435
439
|
'ResizableHandle',
|
|
436
440
|
'ResizablePanel',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxgt/material-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"email": "stevegires@gmail.com"
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"docs:previews": "vitest run --project previews"
|
|
125
125
|
},
|
|
126
126
|
"dependencies": {
|
|
127
|
-
"@nxgt/material-core": "^0.
|
|
127
|
+
"@nxgt/material-core": "^0.10.0",
|
|
128
128
|
"@floating-ui/dom": "^1.8.0",
|
|
129
129
|
"@fortawesome/fontawesome-common-types": "7.3.1",
|
|
130
130
|
"@lucide/vue": "^1.45.0",
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_baseIsEqual-BUD8VQJE.js";
|
|
2
|
-
import { n as t } from "./number.utils-Bpo9tUaJ.js";
|
|
3
|
-
import { defineComponent as n, getCurrentInstance as r, h as i, inject as a, provide as o, useId as s } from "vue";
|
|
4
|
-
import { defineStore as c } from "pinia";
|
|
5
|
-
import { createFormatters as l, formatAmount as u, formatDate as d } from "@nxgt/material-core/print-format";
|
|
6
|
-
//#region ../../node_modules/lodash-es/isEqual.js
|
|
7
|
-
function f(t, n) {
|
|
8
|
-
return e(t, n);
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region ../../node_modules/lodash-es/isNil.js
|
|
12
|
-
function p(e) {
|
|
13
|
-
return e == null;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region lib/lib/string.utils.ts
|
|
17
|
-
function m(e) {
|
|
18
|
-
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
19
|
-
}
|
|
20
|
-
function h(e) {
|
|
21
|
-
return e ? e.toLowerCase().replace(/_/g, "-") : "";
|
|
22
|
-
}
|
|
23
|
-
function g(e, t = ", ") {
|
|
24
|
-
return e.filter((e) => !!e).join(t);
|
|
25
|
-
}
|
|
26
|
-
function _(e, t) {
|
|
27
|
-
let n = t.trim();
|
|
28
|
-
if (!n) return [{
|
|
29
|
-
text: e,
|
|
30
|
-
match: !1
|
|
31
|
-
}];
|
|
32
|
-
let r = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = new RegExp(r, "ig"), a = [], o = 0;
|
|
33
|
-
for (let t of e.matchAll(i)) {
|
|
34
|
-
let n = t.index ?? 0;
|
|
35
|
-
n > o && a.push({
|
|
36
|
-
text: e.slice(o, n),
|
|
37
|
-
match: !1
|
|
38
|
-
}), a.push({
|
|
39
|
-
text: t[0],
|
|
40
|
-
match: !0
|
|
41
|
-
}), o = n + t[0].length;
|
|
42
|
-
}
|
|
43
|
-
return o < e.length && a.push({
|
|
44
|
-
text: e.slice(o),
|
|
45
|
-
match: !1
|
|
46
|
-
}), a.length > 0 ? a : [{
|
|
47
|
-
text: e,
|
|
48
|
-
match: !1
|
|
49
|
-
}];
|
|
50
|
-
}
|
|
51
|
-
var v = {
|
|
52
|
-
enumToKebabCase: h,
|
|
53
|
-
joinTruthyParts: g,
|
|
54
|
-
slugify: m,
|
|
55
|
-
splitMatch: _
|
|
56
|
-
}, y = 0;
|
|
57
|
-
function b(e) {
|
|
58
|
-
return r() ? `${e}:${s()}` : (y += 1, `${e}:${y}`);
|
|
59
|
-
}
|
|
60
|
-
function x(e, t) {
|
|
61
|
-
return (n) => c(b(e), {
|
|
62
|
-
state: () => ({
|
|
63
|
-
...t.state(),
|
|
64
|
-
...n
|
|
65
|
-
}),
|
|
66
|
-
actions: { ...t.actions ?? {} },
|
|
67
|
-
getters: { ...t.getters ?? {} }
|
|
68
|
-
})();
|
|
69
|
-
}
|
|
70
|
-
function S(e, t) {
|
|
71
|
-
return t ? {
|
|
72
|
-
...e,
|
|
73
|
-
...t
|
|
74
|
-
} : e;
|
|
75
|
-
}
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region lib/lib/storage.utils.ts
|
|
78
|
-
function C(e, t) {
|
|
79
|
-
try {
|
|
80
|
-
let n = localStorage.getItem(e);
|
|
81
|
-
if (n) return typeof t == "string" ? n : JSON.parse(n);
|
|
82
|
-
} catch (t) {
|
|
83
|
-
console.warn(`Failed to restore state for key "${e}":`, t);
|
|
84
|
-
}
|
|
85
|
-
return t;
|
|
86
|
-
}
|
|
87
|
-
function w(e, t) {
|
|
88
|
-
try {
|
|
89
|
-
localStorage.setItem(e, typeof t == "string" ? t : JSON.stringify(t));
|
|
90
|
-
} catch (t) {
|
|
91
|
-
console.warn(`Failed to store state for key "${e}":`, t);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function T(e) {
|
|
95
|
-
try {
|
|
96
|
-
localStorage.removeItem(e);
|
|
97
|
-
} catch (t) {
|
|
98
|
-
console.warn(`Failed to remove state for key "${e}":`, t);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
var E = {
|
|
102
|
-
safeGetItem: C,
|
|
103
|
-
safeSetItem: w,
|
|
104
|
-
safeRemoveItem: T
|
|
105
|
-
}, D = {
|
|
106
|
-
colorFromVariable(e, t = 1) {
|
|
107
|
-
return `rgb(from var(--${e}) r g b / ${t})`;
|
|
108
|
-
},
|
|
109
|
-
cssSize(e) {
|
|
110
|
-
if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region lib/lib/url.utils.ts
|
|
115
|
-
function O(e) {
|
|
116
|
-
return new URL(e.url).searchParams;
|
|
117
|
-
}
|
|
118
|
-
function k(e, t) {
|
|
119
|
-
return O(e).get(t);
|
|
120
|
-
}
|
|
121
|
-
function A(e) {
|
|
122
|
-
return /^(https?:)?\/\//.test(e) || e.startsWith("mailto:");
|
|
123
|
-
}
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region lib/lib/client-only.utils.ts
|
|
126
|
-
var j = Symbol("inside-client-only");
|
|
127
|
-
function M(e) {
|
|
128
|
-
return n({
|
|
129
|
-
name: "ClientOnly",
|
|
130
|
-
inheritAttrs: !1,
|
|
131
|
-
setup(n, { attrs: r, slots: s }) {
|
|
132
|
-
let c = a(j, !1), l = t();
|
|
133
|
-
return o(j, !0), () => !c && !l.value ? null : i(e, { ...r }, s);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
export { f as S, h as _, A as a, _ as b, D as c, T as d, w as f, v as g, S as h, M as i, E as l, b as m, u as n, k as o, x as p, d as r, O as s, l as t, C as u, g as v, p as x, m as y };
|