origam 2.8.0 → 2.9.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/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +32 -0
- package/dist/src/assets/css/tokens/light.css +16 -0
- package/dist/src/assets/scss/tokens/_dark.scss +16 -0
- package/dist/src/assets/scss/tokens/_light.scss +16 -0
- package/dist/src/components/Alert/OrigamAlert.vue +4 -2
- package/dist/src/components/Avatar/OrigamAvatarGroup.vue +31 -12
- package/dist/src/components/Btn/OrigamBtn.vue +11 -2
- package/dist/src/components/Btn/OrigamBtnGroup.vue +204 -22
- package/dist/src/components/Btn/OrigamBtnToggle.vue +5 -1
- package/dist/src/components/Card/OrigamCard.vue +5 -2
- package/dist/src/components/Checkbox/OrigamCheckbox.vue +3 -1
- package/dist/src/components/Chip/OrigamChip.vue +2 -0
- package/dist/src/components/Code/OrigamCode.vue +4 -2
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +19 -2
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +3 -2
- package/dist/src/components/Dialog/OrigamDialog.vue +1 -1
- package/dist/src/components/Field/OrigamField.vue +7 -0
- package/dist/src/components/Layout/OrigamLayout.vue +10 -1
- package/dist/src/components/Menu/OrigamMenu.vue +3 -1
- package/dist/src/components/NumberField/OrigamNumberField.vue +3 -2
- package/dist/src/components/Overlay/OrigamOverlayScrim.vue +2 -0
- package/dist/src/components/Radio/OrigamRadio.vue +3 -1
- package/dist/src/components/Select/OrigamSelect.vue +3 -1
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +2 -0
- package/dist/src/components/SliderField/OrigamSliderField.vue +3 -1
- package/dist/src/components/Snackbar/OrigamSnackbar.vue +3 -1
- package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +2 -0
- package/dist/src/components/Switch/OrigamSwitch.vue +42 -1
- package/dist/src/components/Switch/OrigamSwitchTrack.vue +35 -2
- package/dist/src/components/Table/OrigamTable.vue +4 -2
- package/dist/src/components/Tabs/OrigamTabs.vue +3 -1
- package/dist/src/components/Tooltip/OrigamTooltip.vue +2 -0
- package/dist/src/composables/Commons/defaults.composable.cjs +10 -6
- package/dist/src/composables/Commons/defaults.composable.d.ts +30 -0
- package/dist/src/composables/Commons/defaults.composable.js +9 -6
- package/dist/src/composables/Theme/theme.composable.cjs +49 -30
- package/dist/src/composables/Theme/theme.composable.js +41 -22
- package/dist/src/interfaces/App/app.interface.d.ts +1 -1
- package/dist/src/interfaces/Btn/btn-group.interface.d.ts +2 -2
- package/dist/src/interfaces/Switch/switch-track.interface.d.ts +23 -6
- package/dist/src/themes/origam.theme.cjs +2 -4
- package/dist/src/themes/origam.theme.js +2 -2
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/Commons/commons.util.cjs +10 -0
- package/dist/src/utils/Commons/commons.util.d.ts +18 -0
- package/dist/src/utils/Commons/commons.util.js +9 -0
- package/package.json +1 -1
|
@@ -37,6 +37,7 @@ exports.mergeDeep = mergeDeep;
|
|
|
37
37
|
exports.noop = noop;
|
|
38
38
|
exports.normalize = normalize;
|
|
39
39
|
exports.omit = omit;
|
|
40
|
+
exports.omitUndefined = omitUndefined;
|
|
40
41
|
exports.only = only;
|
|
41
42
|
exports.oops = oops;
|
|
42
43
|
exports.padEnd = padEnd;
|
|
@@ -214,6 +215,15 @@ function omit(obj, exclude) {
|
|
|
214
215
|
exclude.forEach(prop => delete clone[prop]);
|
|
215
216
|
return clone;
|
|
216
217
|
}
|
|
218
|
+
function omitUndefined(obj) {
|
|
219
|
+
const out = {};
|
|
220
|
+
for (const key in obj) {
|
|
221
|
+
if (obj[key] !== void 0) {
|
|
222
|
+
out[key] = obj[key];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return out;
|
|
226
|
+
}
|
|
217
227
|
function only(obj, include) {
|
|
218
228
|
const clone = {};
|
|
219
229
|
include.forEach(prop => clone[prop] = obj[prop]);
|
|
@@ -169,6 +169,24 @@ export declare function keys<O extends Record<string, unknown>>(o: O): (keyof O)
|
|
|
169
169
|
* @returns …
|
|
170
170
|
*/
|
|
171
171
|
export declare function omit<T extends object, U extends Extract<keyof T, string>>(obj: T, exclude: Array<U>): Omit<T, U>;
|
|
172
|
+
/**
|
|
173
|
+
* Omit undefined.
|
|
174
|
+
*
|
|
175
|
+
* @description
|
|
176
|
+
* Strips every own key whose value is `undefined` (a key that is merely
|
|
177
|
+
* *present but unset* is NOT the same as an *absent* key for `mergeDeep` —
|
|
178
|
+
* `for...in` still enumerates it, so `mergeDeep(theme, {border: undefined})`
|
|
179
|
+
* silently overwrites a theme default with `undefined`). Components that
|
|
180
|
+
* build a `slotDefaults` map to forward down via `<OrigamDefaultsProvider>`
|
|
181
|
+
* (e.g. `OrigamAvatarGroup`, `OrigamBtnGroup`) must run their per-component
|
|
182
|
+
* defaults object through this before handing it to the provider, so an
|
|
183
|
+
* unset prop is simply absent rather than an explicit `undefined` that
|
|
184
|
+
* clobbers an ancestor/theme default.
|
|
185
|
+
*
|
|
186
|
+
* @param obj …
|
|
187
|
+
* @returns …
|
|
188
|
+
*/
|
|
189
|
+
export declare function omitUndefined<T extends object>(obj: T): Partial<T>;
|
|
172
190
|
/**
|
|
173
191
|
* Only.
|
|
174
192
|
*
|
|
@@ -172,6 +172,15 @@ export function omit(obj, exclude) {
|
|
|
172
172
|
exclude.forEach((prop) => delete clone[prop]);
|
|
173
173
|
return clone;
|
|
174
174
|
}
|
|
175
|
+
export function omitUndefined(obj) {
|
|
176
|
+
const out = {};
|
|
177
|
+
for (const key in obj) {
|
|
178
|
+
if (obj[key] !== void 0) {
|
|
179
|
+
out[key] = obj[key];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return out;
|
|
183
|
+
}
|
|
175
184
|
export function only(obj, include) {
|
|
176
185
|
const clone = {};
|
|
177
186
|
include.forEach((prop) => clone[prop] = obj[prop]);
|