@leaflink/stash 50.0.6 → 50.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CurrencyInput.js +23 -19
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/CurrencyInput.vue.d.ts +31 -10
- package/dist/Field.js +1 -1
- package/dist/Field.vue.d.ts +9 -0
- package/dist/{Field.vue_vue_type_script_setup_true_lang--tBfZB2K.js → Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js} +35 -32
- package/dist/Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js.map +1 -0
- package/dist/FilterSelect.js +67 -56
- package/dist/FilterSelect.js.map +1 -1
- package/dist/FilterSelect.vue.d.ts +54 -2
- package/dist/Filters.vue.d.ts +162 -105
- package/dist/Input.js +71 -68
- package/dist/Input.js.map +1 -1
- package/dist/Input.vue.d.ts +31 -28
- package/dist/InputOptions.js +76 -68
- package/dist/InputOptions.js.map +1 -1
- package/dist/InputOptions.vue.d.ts +55 -23
- package/dist/ListView.vue.d.ts +213 -146
- package/dist/RadioGroup.js +67 -70
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioGroup.vue.d.ts +54 -45
- package/dist/Select.js +223 -224
- package/dist/Select.js.map +1 -1
- package/dist/Select.vue.d.ts +54 -51
- package/dist/TextEditor.js +671 -684
- package/dist/TextEditor.js.map +1 -1
- package/dist/TextEditor.vue.d.ts +54 -61
- package/dist/Textarea.js +63 -60
- package/dist/Textarea.js.map +1 -1
- package/dist/Textarea.vue.d.ts +50 -39
- package/dist/components.css +2 -2
- package/package.json +1 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang--tBfZB2K.js.map +0 -1
package/dist/FilterSelect.js
CHANGED
|
@@ -1,116 +1,127 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { t as
|
|
3
|
-
import { _ as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as S, computed as m, openBlock as r, createBlock as $, mergeProps as C, withCtx as d, createElementVNode as s, createElementBlock as u, withDirectives as f, vModelCheckbox as v, createVNode as y, withKeys as h, createTextVNode as _, toDisplayString as x, unref as A, createCommentVNode as E, Fragment as K, renderList as N } from "vue";
|
|
2
|
+
import { t as O } from "./locale.js";
|
|
3
|
+
import { _ as D } from "./Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js";
|
|
4
|
+
import b from "./FilterChip.js";
|
|
5
|
+
const F = { class: "tw-flex tw-flex-wrap tw-gap-1.5" }, I = ["id"], T = ["for"], L = ["id", "value"], R = ["for"], j = /* @__PURE__ */ S({
|
|
6
6
|
__name: "FilterSelect",
|
|
7
7
|
props: {
|
|
8
8
|
name: {},
|
|
9
|
-
label: {},
|
|
10
9
|
options: {},
|
|
11
10
|
modelValue: {},
|
|
12
|
-
canSelectAll: { type: Boolean, default: !1 }
|
|
11
|
+
canSelectAll: { type: Boolean, default: !1 },
|
|
12
|
+
addBottomSpace: { type: Boolean },
|
|
13
|
+
errorText: {},
|
|
14
|
+
hintText: {},
|
|
15
|
+
id: {},
|
|
16
|
+
errorId: {},
|
|
17
|
+
isReadOnly: { type: Boolean },
|
|
18
|
+
isRequired: { type: Boolean },
|
|
19
|
+
label: {},
|
|
20
|
+
showOptionalInLabel: { type: Boolean },
|
|
21
|
+
fieldset: { type: Boolean },
|
|
22
|
+
isDisabled: { type: Boolean },
|
|
23
|
+
disabled: { type: Boolean }
|
|
13
24
|
},
|
|
14
25
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(
|
|
16
|
-
const e =
|
|
26
|
+
setup(B, { emit: V }) {
|
|
27
|
+
const e = B, c = V, o = m({
|
|
17
28
|
get() {
|
|
18
29
|
return e.modelValue;
|
|
19
30
|
},
|
|
20
|
-
set(
|
|
21
|
-
c("update:modelValue",
|
|
31
|
+
set(t) {
|
|
32
|
+
c("update:modelValue", t);
|
|
22
33
|
}
|
|
23
|
-
}),
|
|
34
|
+
}), n = m({
|
|
24
35
|
get() {
|
|
25
36
|
return e.options.length === e.modelValue.length;
|
|
26
37
|
},
|
|
27
|
-
set(
|
|
28
|
-
c("update:modelValue",
|
|
38
|
+
set(t) {
|
|
39
|
+
c("update:modelValue", t ? e.options.map((a) => a.value) : []);
|
|
29
40
|
}
|
|
30
41
|
});
|
|
31
|
-
function
|
|
32
|
-
return `${e.name}--${
|
|
42
|
+
function i(t) {
|
|
43
|
+
return `${e.name}--${t.value}`;
|
|
33
44
|
}
|
|
34
|
-
function
|
|
35
|
-
return e.modelValue.includes(
|
|
45
|
+
function g(t) {
|
|
46
|
+
return e.modelValue.includes(t.value);
|
|
36
47
|
}
|
|
37
|
-
function
|
|
38
|
-
const a =
|
|
39
|
-
a.length ===
|
|
48
|
+
function w(t) {
|
|
49
|
+
const a = o.value.filter((l) => l !== t);
|
|
50
|
+
a.length === o.value.length && a.push(t), o.value = a;
|
|
40
51
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
52
|
+
function k() {
|
|
53
|
+
n.value = !n.value;
|
|
43
54
|
}
|
|
44
|
-
return (
|
|
55
|
+
return (t, a) => (r(), $(D, C(e, {
|
|
45
56
|
class: "stash-filter-select",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, {
|
|
49
|
-
default:
|
|
50
|
-
s("div",
|
|
51
|
-
e.canSelectAll ? (
|
|
57
|
+
"data-test": "stash-filter-select",
|
|
58
|
+
fieldset: ""
|
|
59
|
+
}), {
|
|
60
|
+
default: d(() => [
|
|
61
|
+
s("div", F, [
|
|
62
|
+
e.canSelectAll ? (r(), u("div", {
|
|
52
63
|
key: `${e.name}--all`
|
|
53
64
|
}, [
|
|
54
65
|
f(s("input", {
|
|
55
66
|
id: `${e.name}--all`,
|
|
56
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
67
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => n.value = l),
|
|
57
68
|
class: "tw-sr-only",
|
|
58
69
|
tabindex: "-1",
|
|
59
70
|
type: "checkbox",
|
|
60
71
|
value: "all"
|
|
61
|
-
}, null, 8,
|
|
62
|
-
[v,
|
|
72
|
+
}, null, 8, I), [
|
|
73
|
+
[v, n.value]
|
|
63
74
|
]),
|
|
64
75
|
s("label", {
|
|
65
76
|
for: `${e.name}--all`
|
|
66
77
|
}, [
|
|
67
|
-
|
|
68
|
-
"is-selected":
|
|
78
|
+
y(b, {
|
|
79
|
+
"is-selected": n.value,
|
|
69
80
|
tabindex: "0",
|
|
70
|
-
onKeypress: h(
|
|
81
|
+
onKeypress: h(k, ["enter"])
|
|
71
82
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
|
|
83
|
+
default: d(() => [
|
|
84
|
+
_(x(A(O)("ll.all")), 1)
|
|
74
85
|
]),
|
|
75
86
|
_: 1
|
|
76
87
|
}, 8, ["is-selected"])
|
|
77
|
-
], 8,
|
|
78
|
-
])) :
|
|
79
|
-
(
|
|
80
|
-
key:
|
|
88
|
+
], 8, T)
|
|
89
|
+
])) : E("", !0),
|
|
90
|
+
(r(!0), u(K, null, N(e.options, (l) => (r(), u("div", {
|
|
91
|
+
key: i(l)
|
|
81
92
|
}, [
|
|
82
93
|
f(s("input", {
|
|
83
|
-
id:
|
|
84
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
94
|
+
id: i(l),
|
|
95
|
+
"onUpdate:modelValue": a[1] || (a[1] = (p) => o.value = p),
|
|
85
96
|
class: "tw-sr-only",
|
|
86
97
|
tabindex: "-1",
|
|
87
98
|
type: "checkbox",
|
|
88
|
-
value:
|
|
89
|
-
}, null, 8,
|
|
90
|
-
[v,
|
|
99
|
+
value: l.value
|
|
100
|
+
}, null, 8, L), [
|
|
101
|
+
[v, o.value]
|
|
91
102
|
]),
|
|
92
103
|
s("label", {
|
|
93
|
-
for:
|
|
104
|
+
for: i(l)
|
|
94
105
|
}, [
|
|
95
|
-
|
|
96
|
-
"is-selected":
|
|
106
|
+
y(b, {
|
|
107
|
+
"is-selected": g(l),
|
|
97
108
|
tabindex: "0",
|
|
98
|
-
onKeypress: h((
|
|
109
|
+
onKeypress: h((p) => w(l.value), ["enter"])
|
|
99
110
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
|
|
111
|
+
default: d(() => [
|
|
112
|
+
_(x(l.label), 1)
|
|
102
113
|
]),
|
|
103
114
|
_: 2
|
|
104
115
|
}, 1032, ["is-selected", "onKeypress"])
|
|
105
|
-
], 8,
|
|
116
|
+
], 8, R)
|
|
106
117
|
]))), 128))
|
|
107
118
|
])
|
|
108
119
|
]),
|
|
109
120
|
_: 1
|
|
110
|
-
},
|
|
121
|
+
}, 16));
|
|
111
122
|
}
|
|
112
123
|
});
|
|
113
124
|
export {
|
|
114
|
-
|
|
125
|
+
j as default
|
|
115
126
|
};
|
|
116
127
|
//# sourceMappingURL=FilterSelect.js.map
|
package/dist/FilterSelect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSelect.js","sources":["../src/components/FilterSelect/FilterSelect.vue"],"sourcesContent":["<script lang=\"ts\">\n export * from './FilterSelect.types';\n</script>\n\n<script lang=\"ts\" setup>\n import { computed } from 'vue';\n\n import { t } from '../../locale';\n import Field from '../Field/Field.vue';\n import FilterChip from '../FilterChip/FilterChip.vue';\n import { FilterSelectModelValue, FilterSelectOption } from './FilterSelect.types';\n\n export interface FilterSelectProps {\n /**\n * The name attribute for the `<input>` elements. It is also used as a unique field to differentiate FilterSelect instances.\n */\n name: string;\n\n
|
|
1
|
+
{"version":3,"file":"FilterSelect.js","sources":["../src/components/FilterSelect/FilterSelect.vue"],"sourcesContent":["<script lang=\"ts\">\n export * from './FilterSelect.types';\n</script>\n\n<script lang=\"ts\" setup>\n import { computed } from 'vue';\n\n import { t } from '../../locale';\n import Field, { type FieldProps } from '../Field/Field.vue';\n import FilterChip from '../FilterChip/FilterChip.vue';\n import { FilterSelectModelValue, FilterSelectOption } from './FilterSelect.types';\n\n export interface FilterSelectProps extends FieldProps {\n /**\n * The name attribute for the `<input>` elements. It is also used as a unique field to differentiate FilterSelect instances.\n */\n name: string;\n\n options: FilterSelectOption[];\n\n modelValue: FilterSelectModelValue;\n\n /**\n * When true, this prop adds an \"All\" option for selecting all options.\n */\n canSelectAll?: boolean;\n }\n\n const props = withDefaults(defineProps<FilterSelectProps>(), {\n canSelectAll: false,\n });\n\n const emit = defineEmits<{\n (e: 'update:modelValue', value: FilterSelectModelValue): void;\n }>();\n\n /**\n * @see: https://vuejs.org/guide/components/v-model.html#component-v-model\n */\n const selected = computed({\n get() {\n return props.modelValue;\n },\n set(value) {\n emit('update:modelValue', value);\n },\n });\n\n const isAllSelected = computed({\n get() {\n return props.options.length === props.modelValue.length;\n },\n set(isChecked) {\n emit('update:modelValue', isChecked ? props.options.map((option) => option.value) : []);\n },\n });\n\n function getOptionId(option: FilterSelectOption) {\n return `${props.name}--${option.value}`;\n }\n\n function isOptionSelected(option: FilterSelectOption) {\n return props.modelValue.includes(option.value);\n }\n\n function onEnter(enteredValue: FilterSelectOption['value']) {\n const newSelected = selected.value.filter((value) => value !== enteredValue);\n\n if (newSelected.length === selected.value.length) {\n newSelected.push(enteredValue);\n }\n\n selected.value = newSelected;\n }\n\n function onEnterAll() {\n isAllSelected.value = !isAllSelected.value;\n }\n</script>\n\n<template>\n <Field v-bind=\"props\" class=\"stash-filter-select\" data-test=\"stash-filter-select\" fieldset>\n <div class=\"tw-flex tw-flex-wrap tw-gap-1.5\">\n <div v-if=\"props.canSelectAll\" :key=\"`${props.name}--all`\">\n <input\n :id=\"`${props.name}--all`\"\n v-model=\"isAllSelected\"\n class=\"tw-sr-only\"\n tabindex=\"-1\"\n type=\"checkbox\"\n value=\"all\"\n />\n <label :for=\"`${props.name}--all`\">\n <FilterChip :is-selected=\"isAllSelected\" tabindex=\"0\" @keypress.enter=\"onEnterAll\">\n {{ t('ll.all') }}\n </FilterChip>\n </label>\n </div>\n <div v-for=\"option in props.options\" :key=\"getOptionId(option)\">\n <input\n :id=\"getOptionId(option)\"\n v-model=\"selected\"\n class=\"tw-sr-only\"\n tabindex=\"-1\"\n type=\"checkbox\"\n :value=\"option.value\"\n />\n <label :for=\"getOptionId(option)\">\n <FilterChip :is-selected=\"isOptionSelected(option)\" tabindex=\"0\" @keypress.enter=\"onEnter(option.value)\">\n {{ option.label }}\n </FilterChip>\n </label>\n </div>\n </div>\n </Field>\n</template>\n"],"names":["props","__props","emit","__emit","selected","computed","value","isAllSelected","isChecked","option","getOptionId","isOptionSelected","onEnter","enteredValue","newSelected","onEnterAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BE,UAAMA,IAAQC,GAIRC,IAAOC,GAOPC,IAAWC,EAAS;AAAA,MACxB,MAAM;AACJ,eAAOL,EAAM;AAAA,MACf;AAAA,MACA,IAAIM,GAAO;AACT,QAAAJ,EAAK,qBAAqBI,CAAK;AAAA,MACjC;AAAA,IAAA,CACD,GAEKC,IAAgBF,EAAS;AAAA,MAC7B,MAAM;AACJ,eAAOL,EAAM,QAAQ,WAAWA,EAAM,WAAW;AAAA,MACnD;AAAA,MACA,IAAIQ,GAAW;AACR,QAAAN,EAAA,qBAAqBM,IAAYR,EAAM,QAAQ,IAAI,CAACS,MAAWA,EAAO,KAAK,IAAI,CAAE,CAAA;AAAA,MACxF;AAAA,IAAA,CACD;AAED,aAASC,EAAYD,GAA4B;AAC/C,aAAO,GAAGT,EAAM,IAAI,KAAKS,EAAO,KAAK;AAAA,IACvC;AAEA,aAASE,EAAiBF,GAA4B;AACpD,aAAOT,EAAM,WAAW,SAASS,EAAO,KAAK;AAAA,IAC/C;AAEA,aAASG,EAAQC,GAA2C;AAC1D,YAAMC,IAAcV,EAAS,MAAM,OAAO,CAACE,MAAUA,MAAUO,CAAY;AAE3E,MAAIC,EAAY,WAAWV,EAAS,MAAM,UACxCU,EAAY,KAAKD,CAAY,GAG/BT,EAAS,QAAQU;AAAA,IACnB;AAEA,aAASC,IAAa;AACN,MAAAR,EAAA,QAAQ,CAACA,EAAc;AAAA,IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -39,6 +39,59 @@ canSelectAll: boolean;
|
|
|
39
39
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
40
40
|
export default _default;
|
|
41
41
|
|
|
42
|
+
declare interface FieldProps {
|
|
43
|
+
/**
|
|
44
|
+
* Adds spacing under the field that is consistent whether hint/error text is displayed.
|
|
45
|
+
*/
|
|
46
|
+
addBottomSpace?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Error text to display. Replaces `hintText` (if provided) & adds error styling.
|
|
49
|
+
*/
|
|
50
|
+
errorText?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Displays text below the input; hidden when the isReadOnly prop is truthy.
|
|
53
|
+
*/
|
|
54
|
+
hintText?: string;
|
|
55
|
+
/**
|
|
56
|
+
* ID for the Label and Input; must be unique
|
|
57
|
+
*/
|
|
58
|
+
id?: string;
|
|
59
|
+
/**
|
|
60
|
+
* ID for the error text element; useful for aria-errormessage
|
|
61
|
+
*/
|
|
62
|
+
errorId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Whether it's a readonly field.
|
|
65
|
+
*/
|
|
66
|
+
isReadOnly?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the field is required.
|
|
69
|
+
*/
|
|
70
|
+
isRequired?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Label to render above the input.
|
|
73
|
+
*/
|
|
74
|
+
label?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Show "(optional)" to the right of the label text
|
|
77
|
+
*/
|
|
78
|
+
showOptionalInLabel?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Indicates wheter the field is a fieldset or not
|
|
81
|
+
*/
|
|
82
|
+
fieldset?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Indicates whether the field is disabled.
|
|
85
|
+
*/
|
|
86
|
+
isDisabled?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Indicates whether the field is disabled.
|
|
89
|
+
*
|
|
90
|
+
* @deprecated Use `isDisabled` instead.
|
|
91
|
+
*/
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
}
|
|
94
|
+
|
|
42
95
|
export declare type FilterSelectModelValue = Array<FilterSelectOption['value']>;
|
|
43
96
|
|
|
44
97
|
export declare interface FilterSelectOption {
|
|
@@ -46,12 +99,11 @@ export declare interface FilterSelectOption {
|
|
|
46
99
|
value: string;
|
|
47
100
|
}
|
|
48
101
|
|
|
49
|
-
export declare interface FilterSelectProps {
|
|
102
|
+
export declare interface FilterSelectProps extends FieldProps {
|
|
50
103
|
/**
|
|
51
104
|
* The name attribute for the `<input>` elements. It is also used as a unique field to differentiate FilterSelect instances.
|
|
52
105
|
*/
|
|
53
106
|
name: string;
|
|
54
|
-
label: string;
|
|
55
107
|
options: FilterSelectOption[];
|
|
56
108
|
modelValue: FilterSelectModelValue;
|
|
57
109
|
/**
|