@frontile/forms 0.17.0 → 0.18.0-alpha.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.
|
@@ -66,83 +66,83 @@ declare class Switch extends Component<SwitchSignature> {
|
|
|
66
66
|
handleBlur: () => void;
|
|
67
67
|
get classes(): {
|
|
68
68
|
base: (slotProps?: ({
|
|
69
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
69
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
70
70
|
size?: "sm" | "md" | "lg" | undefined;
|
|
71
71
|
isDisabled?: boolean | undefined;
|
|
72
72
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
73
73
|
labelContainer: (slotProps?: ({
|
|
74
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
74
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
75
75
|
size?: "sm" | "md" | "lg" | undefined;
|
|
76
76
|
isDisabled?: boolean | undefined;
|
|
77
77
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
78
78
|
label: (slotProps?: ({
|
|
79
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
79
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
80
80
|
size?: "sm" | "md" | "lg" | undefined;
|
|
81
81
|
isDisabled?: boolean | undefined;
|
|
82
82
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
83
83
|
wrapper: (slotProps?: ({
|
|
84
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
84
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
85
85
|
size?: "sm" | "md" | "lg" | undefined;
|
|
86
86
|
isDisabled?: boolean | undefined;
|
|
87
87
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
88
88
|
hiddenInput: (slotProps?: ({
|
|
89
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
89
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
90
90
|
size?: "sm" | "md" | "lg" | undefined;
|
|
91
91
|
isDisabled?: boolean | undefined;
|
|
92
92
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
93
93
|
thumb: (slotProps?: ({
|
|
94
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
94
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
95
95
|
size?: "sm" | "md" | "lg" | undefined;
|
|
96
96
|
isDisabled?: boolean | undefined;
|
|
97
97
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
98
98
|
startContent: (slotProps?: ({
|
|
99
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
99
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
100
100
|
size?: "sm" | "md" | "lg" | undefined;
|
|
101
101
|
isDisabled?: boolean | undefined;
|
|
102
102
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
103
103
|
endContent: (slotProps?: ({
|
|
104
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
104
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
105
105
|
size?: "sm" | "md" | "lg" | undefined;
|
|
106
106
|
isDisabled?: boolean | undefined;
|
|
107
107
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
108
108
|
} & {
|
|
109
109
|
base: (slotProps?: ({
|
|
110
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
110
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
111
111
|
size?: "sm" | "md" | "lg" | undefined;
|
|
112
112
|
isDisabled?: boolean | undefined;
|
|
113
113
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
114
114
|
labelContainer: (slotProps?: ({
|
|
115
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
115
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
116
116
|
size?: "sm" | "md" | "lg" | undefined;
|
|
117
117
|
isDisabled?: boolean | undefined;
|
|
118
118
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
119
119
|
label: (slotProps?: ({
|
|
120
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
120
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
121
121
|
size?: "sm" | "md" | "lg" | undefined;
|
|
122
122
|
isDisabled?: boolean | undefined;
|
|
123
123
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
124
124
|
wrapper: (slotProps?: ({
|
|
125
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
125
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
126
126
|
size?: "sm" | "md" | "lg" | undefined;
|
|
127
127
|
isDisabled?: boolean | undefined;
|
|
128
128
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
129
129
|
hiddenInput: (slotProps?: ({
|
|
130
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
130
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
131
131
|
size?: "sm" | "md" | "lg" | undefined;
|
|
132
132
|
isDisabled?: boolean | undefined;
|
|
133
133
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
134
134
|
thumb: (slotProps?: ({
|
|
135
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
135
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
136
136
|
size?: "sm" | "md" | "lg" | undefined;
|
|
137
137
|
isDisabled?: boolean | undefined;
|
|
138
138
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
139
139
|
startContent: (slotProps?: ({
|
|
140
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
140
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
141
141
|
size?: "sm" | "md" | "lg" | undefined;
|
|
142
142
|
isDisabled?: boolean | undefined;
|
|
143
143
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
144
144
|
endContent: (slotProps?: ({
|
|
145
|
-
intent?: "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
145
|
+
intent?: "accent" | "primary" | "success" | "danger" | "warning" | "default" | undefined;
|
|
146
146
|
size?: "sm" | "md" | "lg" | undefined;
|
|
147
147
|
isDisabled?: boolean | undefined;
|
|
148
148
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
package/dist/components/input.js
CHANGED
|
@@ -4,7 +4,7 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { on } from '@ember/modifier';
|
|
5
5
|
import { useStyles } from '@frontile/theme';
|
|
6
6
|
import { FormControl } from './form-control.js';
|
|
7
|
-
import { t as triggerFormInputEvent } from '../index-
|
|
7
|
+
import { t as triggerFormInputEvent } from '../index-6gTa9ocT.js';
|
|
8
8
|
import { ref } from '@frontile/utilities';
|
|
9
9
|
import { CloseButton } from '@frontile/buttons';
|
|
10
10
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
@@ -7,7 +7,7 @@ import { useStyles } from '@frontile/theme';
|
|
|
7
7
|
import { ref, Spinner, VisuallyHidden } from '@frontile/utilities';
|
|
8
8
|
import { Popover } from '@frontile/overlays';
|
|
9
9
|
import { FormControl } from './form-control.js';
|
|
10
|
-
import { t as triggerFormInputEvent } from '../index-
|
|
10
|
+
import { t as triggerFormInputEvent } from '../index-6gTa9ocT.js';
|
|
11
11
|
import { CloseButton } from '@frontile/buttons';
|
|
12
12
|
import { IconChevronUpDown } from './icons.js';
|
|
13
13
|
import { keyAndLabelForItem } from '@frontile/collections/utils/listManager';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { buildWaiter } from '@ember/test-waiters';
|
|
2
|
+
|
|
3
|
+
const waiter = buildWaiter('@frontile/forms:triggerFormInputEvent)');
|
|
4
|
+
function triggerFormInputEvent(element) {
|
|
5
|
+
if (!element) return;
|
|
6
|
+
const waiterToken = waiter.beginAsync();
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
let parent = element.parentElement;
|
|
9
|
+
while (parent) {
|
|
10
|
+
if (parent.tagName === 'FORM') {
|
|
11
|
+
parent.dispatchEvent(new Event('input', {
|
|
12
|
+
bubbles: true
|
|
13
|
+
}));
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
parent = parent.parentElement;
|
|
17
|
+
}
|
|
18
|
+
waiter.endAsync(waiterToken);
|
|
19
|
+
}, 0);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { triggerFormInputEvent as t };
|
|
23
|
+
//# sourceMappingURL=index-6gTa9ocT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-6gTa9ocT.js","sources":["../src/utils/index.ts"],"sourcesContent":["import { buildWaiter } from '@ember/test-waiters';\nconst waiter = buildWaiter('@frontile/forms:triggerFormInputEvent)');\n\nfunction triggerFormInputEvent(element?: HTMLElement | null): void {\n if (!element) return;\n const waiterToken = waiter.beginAsync();\n\n setTimeout(() => {\n let parent = element.parentElement;\n while (parent) {\n if (parent.tagName === 'FORM') {\n (parent as HTMLFormElement).dispatchEvent(\n new Event('input', { bubbles: true })\n );\n break;\n }\n parent = parent.parentElement;\n }\n\n waiter.endAsync(waiterToken);\n }, 0);\n}\n\nexport { triggerFormInputEvent };\nexport {\n flattenData,\n unflattenData,\n hasNestedData,\n deepEqual\n} from './nested-data';\n"],"names":["waiter","buildWaiter","triggerFormInputEvent","element","waiterToken","beginAsync","setTimeout","parent","parentElement","tagName","dispatchEvent","Event","bubbles","endAsync"],"mappings":";;AACA,MAAMA,MAAM,GAAGC,WAAW,CAAC,wCAAwC,CAAC;AAEpE,SAASC,qBAAqBA,CAACC,OAA4B,EAAQ;EACjE,IAAI,CAACA,OAAO,EAAE;AACd,EAAA,MAAMC,WAAW,GAAGJ,MAAM,CAACK,UAAU,EAAE;AAEvCC,EAAAA,UAAU,CAAC,MAAM;AACf,IAAA,IAAIC,MAAM,GAAGJ,OAAO,CAACK,aAAa;AAClC,IAAA,OAAOD,MAAM,EAAE;AACb,MAAA,IAAIA,MAAM,CAACE,OAAO,KAAK,MAAM,EAAE;AAC5BF,QAAAA,MAAM,CAAqBG,aAAa,CACvC,IAAIC,KAAK,CAAC,OAAO,EAAE;AAAEC,UAAAA,OAAO,EAAE;AAAK,SAAC,CACtC,CAAC;AACD,QAAA;AACF,MAAA;MACAL,MAAM,GAAGA,MAAM,CAACC,aAAa;AAC/B,IAAA;AAEAR,IAAAA,MAAM,CAACa,QAAQ,CAACT,WAAW,CAAC;EAC9B,CAAC,EAAE,CAAC,CAAC;AACP;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontile/forms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0-alpha.0",
|
|
4
4
|
"description": "Component Library for Ember Octane apps: Forms",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -36,29 +36,14 @@
|
|
|
36
36
|
"declarations",
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "rollup --config",
|
|
41
|
-
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
|
|
42
|
-
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
|
|
43
|
-
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
|
|
44
|
-
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
|
|
45
|
-
"lint:js": "eslint . --cache",
|
|
46
|
-
"lint:js:fix": "eslint . --fix",
|
|
47
|
-
"lint:types": "glint",
|
|
48
|
-
"prepack": "concurrently 'npm:build'",
|
|
49
|
-
"start": "concurrently 'npm:start:*'",
|
|
50
|
-
"start:js": "rollup --config --watch --no-watch.clearScreen",
|
|
51
|
-
"start:types": "glint -d --watch",
|
|
52
|
-
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
|
|
53
|
-
},
|
|
54
39
|
"dependencies": {
|
|
55
40
|
"@ember/test-waiters": "^4.0.0",
|
|
56
41
|
"@embroider/addon-shim": "^1.9.0",
|
|
57
|
-
"@frontile/buttons": "0.
|
|
58
|
-
"@frontile/collections": "0.
|
|
59
|
-
"@frontile/overlays": "0.
|
|
60
|
-
"@frontile/theme": "0.
|
|
61
|
-
"@frontile/utilities": "0.
|
|
42
|
+
"@frontile/buttons": "0.18.0-alpha.0",
|
|
43
|
+
"@frontile/collections": "0.18.0-alpha.0",
|
|
44
|
+
"@frontile/overlays": "0.18.0-alpha.0",
|
|
45
|
+
"@frontile/theme": "0.18.0-alpha.0",
|
|
46
|
+
"@frontile/utilities": "0.18.0-alpha.0",
|
|
62
47
|
"@glint/template": "1.5.2",
|
|
63
48
|
"ember-modifier": "^4.1.0",
|
|
64
49
|
"form-data-utils": "^0.6.0"
|
|
@@ -123,5 +108,18 @@
|
|
|
123
108
|
"./components/textarea.js": "./dist/_app_/components/textarea.js"
|
|
124
109
|
}
|
|
125
110
|
},
|
|
126
|
-
"
|
|
127
|
-
|
|
111
|
+
"scripts": {
|
|
112
|
+
"build": "rollup --config",
|
|
113
|
+
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
|
|
114
|
+
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
|
|
115
|
+
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
|
|
116
|
+
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
|
|
117
|
+
"lint:js": "eslint . --cache",
|
|
118
|
+
"lint:js:fix": "eslint . --fix",
|
|
119
|
+
"lint:types": "glint",
|
|
120
|
+
"start": "concurrently 'npm:start:*'",
|
|
121
|
+
"start:js": "rollup --config --watch --no-watch.clearScreen",
|
|
122
|
+
"start:types": "glint -d --watch",
|
|
123
|
+
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
|
|
124
|
+
}
|
|
125
|
+
}
|